{"version":3,"sources":["hooks/useUserGroups.tsx","components/NonIdealState/index.tsx","config.js","hooks/useControlledState.tsx","components/CenteredLoadingScreen/index.tsx","context/global-app-state.tsx","components/date-time-picker/index.tsx","components/Home.js","img/mc-logo-wide-white.svg","components/ForceChangePassword.js","components/ForgotPassword.js","components/Verify.js","components/SignIn.js","components/form/InputCognitoPhoneNumber/CognitoPhoneNumber.tsx","components/form/InputCognitoPhoneNumber/index.tsx","components/form/InputCognitoPhoneNumber/validator.tsx","components/SignUpOrganizationSearch/index.tsx","formValidators.js","components/SignUp.js","components/PrivateRoute.js","components/feedback-mood/index.tsx","components/UserContentUploader/index.tsx","components/feedback-form/form.tsx","components/feedback-form/hook.tsx","components/feedback-form/modal.tsx","context/global-filter.tsx","pages/app/flightboard/fb-shortcut-listener.tsx","components/live-2/util.tsx","pages/app/flightboard/shortcut-descriptions.tsx","pages/app/flightboard/flight-board-page.tsx","pages/app/flightboard/location-page.tsx","pages/window/flytwatch/aircraft-details-page.tsx","pages/app/employer/nav.js","components/EditableTable.js","common/types/transport.ts","components/flight/FlightState/index.tsx","components/boarding-restrictions/BoardingRestrictionButton.js","components/DestinationList.js","common/isn/index.tsx","components/IsnCheckStatusButton.js","common/table/columnset.tsx","common/table/columns.js","components/GlobalFilter/GetFiltersQuery.js","components/GlobalFilter/SetFilterMutation.js","components/form/select/LocationSelect/LocationSelect.js","components/form/select/OrganizationSelect/OrganizationQuery.js","components/form/select/OrganizationSelect/OrganizationSelect.tsx","components/GlobalFilter/ResetGlobalFilterMutation.js","components/GlobalFilter/GlobalFilter.js","components/GlobalFilter/Wrapper.js","Queries/PaginationLimit.js","components/Paginator/Paginator.js","components/form/select/CountryCodeSelect/CountryCodeQuery.js","components/form/select/CountryCodeSelect/index.js","components/form/select/EmployerSelect/EmployerQuery.js","components/form/select/EmployerSelect/EmployerSelect.js","components/form/select/EmployerSelect/EmployerSelectWithData.js","components/covid-vax-date-form/date-label-select.tsx","components/covid-vax-manufacturer-select/index.tsx","components/covid-vax-date-form/index.tsx","components/covid-vax-date-form/submitter.tsx","components/PassengerEditor/CovidVaccineDates.tsx","context/query-result-context.tsx","components/Credential/EditControl.js","components/Credential/EditForm.js","components/Credential/Credential.js","components/Credential/CredentialQuery.js","components/Credential/SaveCredentialMutation.js","credentialTypes.js","components/Credential/CredentialWithData.js","components/CredentialForm/CredentialForm.js","components/CredentialManager/CredentialManager.js","components/withErrorCatch.js","Queries/Credentials.js","components/LoadingContent.js","components/CredentialManager/Mutations/SaveCredential.js","components/CredentialManager/Mutations/RemoveCredential.js","components/CredentialManager/CredentialManagerWithData.js","components/PassengerEditor/PassengerEditor.js","components/PassengerEditor/PassengerQuery.js","components/PassengerEditor/PassengerEditorWithData.js","components/NotAuthorized.tsx","components/boarding-restrictions/BoardingRestrictionsOverride.js","components/boarding-restrictions/BoardingRestrictionsDrawer.js","components/withBoardingRestrictionDrawer.js","components/tables/FilterableTable/FilterDropdown.js","components/tables/FilterableTable/GetHighlightStateQuery.js","components/tables/FilterableTable/highlightText.js","components/tables/FilterableTable/FilterableTable.js","components/lists/Attribute.js","components/lists/passenger/PassengerItem.js","components/lists/passenger/PassengerList.js","components/lists/cargo/CargoItem.js","components/lists/cargo/CargoList.js","components/lists/legs/LegItem.js","components/lists/legs/CollapsibleLegs.js","components/flight/FlightPreview.js","components/WithFlightDrawer.tsx","components/isn/OverrideCard/OverrideCard.js","components/isn/QCCard/QCCard.js","components/isn/QCResult/QCResult.js","Queries/ISNResultQuery.js","Mutations/SetPaxSelectedISNResult.js","Mutations/ISNCheck.js","components/isn/QCResult/QCResultWithData.js","components/withUserInfo.js","components/Override.js","components/isn/PaxISN/PaxISN.js","components/isn/PaxISN/PaxQuery.js","components/isn/PaxISN/PaxISNWithData.js","components/tables/PassengerTable.js","components/live/LivePassengers/LivePassengers.js","components/live/LivePassengers/PaxQuery.js","components/withGlobalFilter.js","components/live/LivePassengers/LivePassengersWithData.js","components/BlueprintTableInfiniteScroller/index.tsx","hooks/usePromise.ts","components/masterdata-2-0/details.tsx","components/masterdata-2-0/DuplicationChecker.tsx","components/masterdata-2-0/header.tsx","components/masterdata-2-0/util.tsx","components/masterdata-2-0/hook.tsx","components/masterdata-2-0/layout.tsx","components/masterdata-2-0/NoResults.tsx","common/table/index.tsx","components/masterdata-2-0/table.tsx","components/masterdata-2-0/TableLoading.tsx","components/masterdata-2-0/TableLoader.tsx","components/masterdata-2-0/index.tsx","components/masterdata-2-0/entryForms/index.tsx","components/masterdata-2-0/entryForms/aircraft.tsx","Mutations/DeleteEntity.js","components/masterdata-2-0/pages/Aircraft.tsx","components/masterdata-2-0/entryForms/contract.tsx","components/masterdata-2-0/pages/Contract.tsx","components/transfer/CountryCheckTransfer/index.tsx","components/transfer/SteelToeDestinationsTransfer/index.tsx","Queries/list-available-notifiers.tsx","components/org-notif-email-list-editor/validator.tsx","components/org-notif-email-list-editor/org-notif-email-list-editor.tsx","components/org-notif-email-list-editor/index.tsx","components/masterdata-2-0/entryForms/customer.tsx","components/masterdata-2-0/pages/Customer.tsx","components/masterdata-2-0/entryForms/employer.tsx","components/masterdata-2-0/pages/Employer.tsx","components/masterdata-2-0/entryForms/vessel.tsx","components/masterdata-2-0/pages/Vessel.tsx","components/masterdata-2-0/entryForms/location.tsx","components/masterdata-2-0/pages/Location.tsx","components/form/InputPhoneNumber/InputPhoneNumber.tsx","components/form/InputPhone/phoneTypes.js","components/form/InputPhone/InputPhone.tsx","components/form/InputEmail.js","components/masterdata-2-0/entryForms/pilot.tsx","components/masterdata-2-0/pages/Pilot.tsx","components/form/InputAddress.js","components/form/usStates.js","components/form/InputName.js","components/form/ContactInfoForm.tsx","Queries/ISNQuickCheck.js","components/ISNChecker/index.js","components/masterdata/DuplicationChecker.js","components/PersonEditor/CredentialInput.js","components/PersonEditor/index.js","components/form/select/RigSelect/index.tsx","components/masterdata-2-0/entryForms/person/ContactInfoCards.tsx","components/masterdata-2-0/entryForms/person/CredentialInput.tsx","components/masterdata-2-0/entryForms/person/index.tsx","components/masterdata-2-0/pages/Personnel/index.tsx","common/windowSizes.tsx","components/decounced-field/debounced-field.tsx","pages/app/management/email-triggers/employer-email-triggers.tsx","pages/app/management/email-triggers/user-org-email-triggers.tsx","pages/app/management/email-triggers/email-triggers.tsx","pages/app/employer/index.js","components/MobileScreenWarningAlert/index.tsx","Mutations/CheckInPassenger.js","components/CurrentOrg/index.tsx","components/PersonSearch/PersonSearchQuery.js","components/PersonSearch/PersonSearch.js","common/couchdb/utils.ts","components/form/select/VesselSelect/VesselQuery.js","components/form/select/VesselSelect/index.js","components/CurrentCustomer/index.js","Queries/LocationBlock.js","components/LocationBlock/index.js","components/WithAppLoaded.js","containers/TransporterSelector.js","components/PersonToPassenger/index.js","components/PaxCheckIn/PersonQuery.js","components/PaxCheckIn/PaxCheckIn.js","components/docks/nav.js","components/withISNCheck.js","components/isn/CrewISN/CrewQuery.js","components/isn/CrewQCResult/SetCrewISNSelectionMutation.js","components/isn/CrewQCResult/ISNCheck.js","components/isn/CrewQCResult/CrewISNResultQuery.js","components/isn/CrewQCResult/CrewQCResult.js","components/isn/PaxQCResult/PaxQCResult.js","components/isn/ISNManager/ISNManager.js","components/isn/CrewISN/CrewISN.js","components/live-2/LiveColoredButton.tsx","components/live-2/ColorKey.tsx","components/docks/pages/boats/boatDetail.js","components/docks/pages/boats/boats.js","components/docks/main.js","components/flights/times/WithAllFinalizedFlightsData.tsx","common/flight/index.tsx","components/flights/times/LegTimeEntry.js","components/TableDragSorting.js","components/flights/times/FlightManualLegsAssign.js","common/flight-leg/flight-path.ts","common/flight-leg/flight-leg-manager.tsx","common/flight-leg/util.tsx","components/flights/times/UnassignedPaxCgoWarning.tsx","components/flights/times/FlightTimesEntryDrawer.js","components/flights/times/WithFlightTimesEntryDrawer.js","hooks/infinite-scroller/adapter/couchdb-mango-adapter.ts","hooks/infinite-scroller/adapter/apollo-query-adapter.ts","components/flights/times/FlightTimes.js","hooks/infinite-scroller/infinite-scroller.ts","components/flights/times/FlightTimesHeader.js","components/live-2/LiveHeader/index.tsx","components/live-2/LiveCard/index.tsx","components/live-2/cargo/query.tsx","components/form/CargoForm.tsx","components/scheduling/PaxCgoScheduler/CargoFooter.tsx","components/scheduling/PaxCgoScheduler/CargoSiderTab.tsx","Mutations/CheckInInboundCargo.js","common/data-export/antd-converter.ts","common/data-export/index.ts","common/data-export/csv-converter.ts","components/live-2/cargo/index.tsx","components/live-2/flights/query.tsx","hooks/custom-reducer-hook/use-extended-reducer.ts","components/live-2/flights/state.ts","Queries/LiveFlights.ts","__generated__/graphql/types.ts","components/live-2/flights/add-flight-drawer.tsx","components/live-2/flights/index.tsx","components/live-2/flights/live-flights-page.tsx","components/editable-text/index.tsx","components/live-2/passengers/query.tsx","components/live-2/passengers/index.tsx","img/default-avatar.png","components/quartermaster/inTransitList/index.tsx","components/quartermaster/qmAlert/index.tsx","components/quartermaster/offshoreLocList/index.tsx","components/quartermaster/pages/quartermaster.tsx","hooks/useDelayedEffect.tsx","pages/app/flytwatch/fuel-taken/form.tsx","pages/app/flytwatch/fuel-taken/add-fuel-taken-form.tsx","pages/app/flytwatch/fuel-taken/delete-fuel-taken.tsx","pages/app/flytwatch/fuel-taken/update-fuel-taken.tsx","pages/app/flytwatch/fuel-taken/fuel-taken.tsx","pages/app/flytwatch/fuel-taken/index.tsx","pages/app/flytwatch/fuel-taken-report/criteria-form.tsx","pages/app/flytwatch/fuel-taken-report/index.tsx","hooks/useApplyAllContractsToUser.tsx","pages/admin/user/userContractManager.tsx","pages/admin/user/userForm.tsx","pages/admin/user/userGroupSelect.tsx","pages/admin/user/userDetails.tsx","pages/admin/user/index.tsx","pages/app/admin/changes-by-console-report/criteria-form.tsx","pages/app/admin/changes-by-console-report/index.tsx","pages/app/admin/flytwatch-billing-report/criteria-form.tsx","pages/app/admin/flytwatch-billing-report/context.tsx","pages/app/admin/flytwatch-billing-report/table.tsx","pages/app/admin/flytwatch-billing-report/index.tsx","components/flighteditor/FlightEditorForm.tsx","components/flighteditor/FlightEditorFormWrapper.tsx","components/flighteditor/FlightLegsTable.tsx","components/flighteditor/LegContent.tsx","components/flighteditor/LegManualAssignContent.tsx","components/icons/DepartingHeli.tsx","components/search/index.tsx","common/table/blueprintcells/IsnStatusCell.tsx","common/table/blueprintcolumnset.tsx","common/table/blueprintcolumns.tsx","hooks/useMultiSelectByID.tsx","components/search/SelectionCount/index.tsx","components/search/SearchHeader/index.tsx","components/search/CgoSearch/index.tsx","components/search/PaxSearch/index.tsx","components/search/PaxCgoSearch/index.tsx","containers/flighteditor/LiveLegsAdd.tsx","containers/flighteditor/graphql.ts","containers/flighteditor/LiveFlightEditor.tsx","common/carriable/index.tsx","components/flights/scheduling/FlightScheduleUtils.tsx","components/flights/scheduling/FlightManualScheduleLegPax.tsx","components/flights/scheduling/FlightManualScheduleLegs.js","components/form/LocationOnshoreSelect.js","components/scheduling/MainHeader/index.tsx","Queries/Scheduling.ts","components/scheduling/SchedulingStepsHeader/index.js","components/scheduling/MainLayout/index.js","components/flights/scheduling/notes-for-pilot/validation.ts","components/flights/scheduling/notes-for-pilot/quickedit/state.ts","components/flights/scheduling/notes-for-pilot/quickedit/notes-for-pilot-quick-edit.tsx","components/flights/scheduling/columns.tsx","components/flights/scheduling/FlightScheduleLegPax.tsx","components/flights/scheduling/FlightScheduleLegs.js","hooks/useMultiSelect.tsx","components/flights/scheduling/scheduled-paxcgo-adder/state.ts","components/flights/scheduling/scheduled-paxcgo-adder/graphql.ts","hooks/useApolloClientHelper.ts","common/style/collapse.ts","components/flights/scheduling/scheduled-paxcgo-adder/util.ts","components/flights/scheduling/util.tsx","common/types/location.ts","common/carriable/util.tsx","components/scheduling/util.ts","components/flights/scheduling/scheduled-paxcgo-adder/scheduled-paxcgo-adder.tsx","components/flights/scheduling/scheduled-paxcgo-adder/hook.tsx","hooks/useBreakpoints.ts","components/flights/scheduling/scheduled-paxcgo-adder/index.ts","components/flights/scheduling/notes-for-pilot/editor/util.ts","components/flights/scheduling/notes-for-pilot/editor/note-assigner.tsx","components/flights/scheduling/notes-for-pilot/editor/state.ts","components/flights/scheduling/notes-for-pilot/editor/api.ts","components/flights/scheduling/notes-for-pilot/editor/notes-for-pilot-editor.tsx","components/flights/scheduling/notes-for-pilot/editor/toolbar.tsx","component-wrappers/state-wrapper.tsx","components/flights/scheduling/route-editor/state.ts","common/reducer/undo-redo.ts","components/flights/scheduling/route-editor/hook.ts","components/flights/scheduling/route-editor/route-editor.tsx","components/flights/scheduling/FlightScheduleEdit.tsx","components/LinkWrapper.js","components/flights/scheduling/WorkflowCard.js","components/flights/scheduling/MainScheduling.js","components/ButtonLink.js","Queries/DeleteEntity.js","components/scheduling/SetsList/index.js","components/scheduling/checkScheduledPax.js","components/scheduling/PaxCgoScheduler/QueryPersonnelIDs.tsx","components/scheduling/PaxCgoScheduler/table.tsx","components/scheduling/SetsEditor/SetFormShedule.js","components/search/PersonSearch/index.tsx","components/search/PersonSearchByCred/index.tsx","components/scheduling/SetsEditor/SetForm.js","components/scheduling/SetsEditor/SetsTable.js","components/scheduling/SetsEditor/SetsEditor.js","Mutations/SchedulePassengersMutation.js","Mutations/SetPersonSet.js","Queries/GetPersonSetQuery.js","Queries/GetPersonSetQueryCached.js","containers/SetsEditorContainer.js","components/BulkISNChecker.js","components/ResolveEntityID.tsx","components/scheduling/PaxCgoScheduler/mutation/CreatePersonSet.tsx","components/scheduling/SetForm/SetForm.tsx","components/scheduling/PaxCgoScheduler/CreatePersonSet.tsx","components/scheduling/PaxCgoScheduler/GroupForm.tsx","components/scheduling/PaxCgoScheduler/query/GetCustomerManifestPrintout.tsx","components/scheduling/Printout/PrintoutForm.tsx","components/scheduling/PaxCgoScheduler/ManifestPrintout.tsx","components/scheduling/PaxCgoScheduler/mutation/SaveScheduledPaxInbCgo.tsx","components/scheduling/PaxCgoScheduler/query/GetScheduledPaxInbCgo.tsx","common/person/personToPassenger.tsx","components/scheduling/PaxCgoScheduler/schedulerStateHook.tsx","components/scheduling/PaxCgoScheduler/index.tsx","components/scheduling/calendar/index.tsx","components/scheduling/calendar/monthselect.tsx","components/scheduling/ScheduledGroupsList/table.tsx","components/scheduling/ScheduledGroupsList/calendar.tsx","components/scheduling/ScheduledGroupsList/graphql.ts","components/scheduling/scheduled-groups/list/scheduled-groups-list.tsx","components/scheduling/scheduled-groups/list/index.ts","components/scheduling/ScheduledGroupsList/index.tsx","components/scheduling/util/use-generate-flight-desig.ts","components/flights/scheduling/NewFlightDrawer.tsx","components/scheduling/ScheduledFlightsList/table.tsx","components/scheduling/ScheduledFlightsList/calendar.tsx","components/scheduling/ScheduledFlightsList/list.tsx","components/scheduling/ScheduledFlightsList/index.tsx","pages/app/scheduling/phase-2-scheduler/util.ts","pages/app/scheduling/phase-2-scheduler/purge-entities-from-flight-tool/graphql.ts","pages/app/scheduling/phase-2-scheduler/purge-entities-from-flight-tool/purge-from-flight.ts","pages/app/scheduling/phase-2-scheduler/purge-entities-from-flight-tool/state.ts","pages/app/scheduling/phase-2-scheduler/scheduled-to-expected-paxcgo/action.ts","pages/app/scheduling/phase-2-scheduler/scheduled-to-expected-paxcgo/graphql.ts","pages/app/scheduling/phase-2-scheduler/scheduled-to-expected-paxcgo/util.ts","pages/app/scheduling/phase-2-scheduler/scheduled-to-expected-paxcgo/state.ts","pages/app/scheduling/phase-2-scheduler/state.ts","pages/app/scheduling/phase-2-scheduler/scheduled-to-expected-paxcgo/invoke-mutation.ts","components/form/select/dep-dest-select/dep-dest-select.tsx","components/form/select/dep-dest-select/index.ts","pages/app/scheduling/phase-2-scheduler/carriable-selector.tsx","pages/app/scheduling/phase-2-scheduler/form.tsx","components/flights/scheduling/math.ts","pages/app/scheduling/phase-2-scheduler/table.tsx","pages/app/scheduling/phase-2-scheduler/validation.ts","pages/app/scheduling/phase-2-scheduler/new-leg-form.tsx","pages/app/scheduling/phase-2-scheduler/toolbar.tsx","pages/app/scheduling/phase-2-scheduler/purge-entities-from-flight-tool/component.tsx","pages/app/scheduling/phase-2-scheduler/purge-entities-from-flight-tool/index.ts","pages/app/scheduling/phase-2-scheduler/purge-entities-from-flight-tool/api-override.ts","pages/app/scheduling/phase-2-scheduler/scheduled-to-expected-paxcgo/component.tsx","pages/app/scheduling/phase-2-scheduler/scheduled-to-expected-paxcgo/index.ts","pages/app/scheduling/phase-2-scheduler/scheduled-to-expected-paxcgo/api-override.ts","pages/app/scheduling/phase-2-scheduler/editor.tsx","pages/app/scheduling/phase-2-scheduler/graphql.ts","Queries/Person.ts","pages/app/scheduling/phase-2-scheduler/cargo-util.ts","pages/app/scheduling/phase-2-scheduler/api.ts","pages/app/scheduling/phase-2-scheduler/main-header.tsx","pages/app/scheduling/phase-2-scheduler/phase-2-scheduler-page.tsx","pages/app/scheduling/phase-2-scheduler/index.ts","pages/app/scheduling/phase-1-history/graphql.ts","pages/app/scheduling/phase-1-history/state.ts","pages/app/scheduling/phase-1-history/list.tsx","pages/app/scheduling/phase-1-history/page.tsx","pages/app/scheduling/phase-1-history/index.ts","pages/app/scheduling/phase-1-history-editor/main-header.tsx","components/scheduling/editor/schedule-editor-v2/util.ts","components/scheduling/editor/schedule-editor-v2/form.tsx","components/scheduling/editor/schedule-editor-v2/table.tsx","components/scheduling/editor/schedule-editor-v2/new-leg-form.tsx","components/scheduling/editor/schedule-editor-v2/view-button.tsx","components/scheduling/editor/schedule-editor-v2/schedule-editor.tsx","components/scheduling/editor/schedule-editor-v2/state.ts","components/scheduling/editor/schedule-editor-v2/index.ts","components/scheduling/editor/schedule-editor-v2/cargo-util.ts","components/scheduling/editor/schedule-editor-v2/api.ts","pages/app/scheduling/phase-1-history-editor/graphql.ts","pages/app/scheduling/phase-1-history-editor/state.ts","pages/app/scheduling/phase-1-history-editor/api.ts","pages/app/scheduling/phase-1-history-editor/util.ts","pages/app/scheduling/phase-1-history-editor/clone-form.tsx","pages/app/scheduling/phase-1-history-editor/clone-form-drawer.tsx","pages/app/scheduling/phase-1-history-editor/index.ts","pages/app/scheduling/phase-1-history-editor/page.tsx","routes/scheduling.tsx","components/flights/scheduling/main.js","components/reporting/fieldTypes.js","defaultState.ts","components/reporting/ReportForms/hooks/useCachedDateRange.tsx","components/reporting/ReportForm/ReportForm.tsx","components/reporting/ReportForm/ReportFormSubmitter.js","components/reporting/ReportList/ReportList.js","components/reporting/ReportList/ReportListQuery.js","components/reporting/ReportList/ReportListWithData.js","components/reporting/ReportForms/PaxForm.js","components/reporting/ReportForms/CgoForm.js","components/reporting/ReportForms/ManifestForm.js","components/reporting/ReportForms/ISNForm.js","components/reporting/ReportForms/CovidForm.js","components/reporting/ReportForms/CovidVaccineForm.js","components/reporting/ReportForms/PersonCovidVaccine.js","components/reporting/ReportForms/PersonHotFuel.js","components/reporting/ReportForms/PaxIsnEvents.js","components/reporting/ReportForms/index.js","components/reporting/ReportDetails/DetailHeader.js","components/reporting/ReportDetails/ReportDetails.js","components/reporting/ReportDetails/ReportDetailsWithData.js","components/reporting/summaries/Pax.js","components/reporting/summaries/Cgo.js","components/reporting/summaries/Manifest.js","components/reporting/summaries/ISN.js","components/reporting/summaries/Covid.js","components/reporting/summaries/PaxCovidVax.js","components/reporting/summaries/PaxCovidVaxDetailed.js","components/reporting/summaries/PersonHotFuel.js","components/reporting/summaries/PaxIsnEvents.js","components/reporting/summaries/index.js","hooks/useSortableData.tsx","components/blueprinttable/SortableColumnHeaderCell.tsx","common/types/non-comply-bypass.ts","components/reporting/detail/Pax.js","components/reporting/detail/Cgo.js","components/reporting/detail/Manifest.js","components/reporting/detail/ISN.js","components/reporting/detail/Covid.js","components/reporting/detail/CovidVaccine.js","components/reporting/detail/CovidVaccineDetailed.js","components/reporting/detail/PersonHotFuel.js","components/reporting/detail/PaxIsnEvents.js","components/reporting/detail/index.js","components/reporting/ReportingInterface/ReportingInterface.js","components/flights/dashboard/ISNChartSelector.js","components/flights/dashboard/Dashboard.js","components/admin/sidebar-nav/AdminSubMenu/index.tsx","components/flights/FlightsNav.js","components/NonPreferredEmployerSearch.js","Queries/GetNonPreferred.js","Mutations/SetNonPreferred.js","components/flights/masterdata/nonpreferred/Employer.js","components/search/NonPreferredPersonSearch/index.tsx","components/flights/masterdata/nonpreferred/Person.js","components/flights/masterdata/nonpreferred/NonPreferred.js","components/form/whitelist-bypass-form/whitelist-bypass-form.tsx","components/WithTransporter.js","components/form/whitelist-bypass-form/index.ts","Queries/WhiteList.ts","components/flights/masterdata/whitelisting/ConditionCount.tsx","components/flights/masterdata/whitelisting/Person.js","components/EmployerSearch.js","components/flights/masterdata/whitelisting/Employer.js","components/LocationSearch.js","components/WithLoading.js","components/WithError.js","components/flights/masterdata/whitelisting/Location.js","components/flights/masterdata/whitelisting/Whitelist.js","components/WithCustomer.js","components/flights/report/Report.js","components/charts/isn/IsnNullAndOverride.js","components/charts/isn/IsnCardStatus.js","components/flights/report/ISN.js","components/withUserPermissions.js","components/flights/TsaCheck.js","components/flights/main.js","routes/admin.tsx","components/AboutApp.tsx","registerServiceWorker.js","context/serviceworker.tsx","components/feedback-button/index.tsx","components/preferences/EditablePrefTable.tsx","components/preferences/AccountAttributes.tsx","components/preferences/ChangePassword.js","components/preferences/VerifyEmailAlert.tsx","hooks/useWindowSize.tsx","components/preferences/Preferences.js","components/withUserPreferences.js","hooks/s3config.tsx","components/GlobalNavbar.tsx","components/pob/pages/pob.js","components/pob/nav.js","components/PobEditor/pobViewer.js","components/PobEditor/pobQuery.js","components/PobEditor/pobViewerWithData.js","components/pob/pages/rigDetail.js","components/pob/main.js","components/App.js","routes/window.tsx","components/AppLoading.js","components/GlobalFilterInitializer/GlobalFilterInitializer.js","resolvers/app.js","resolvers/transporter.js","resolvers/customer.js","resolvers/auth.js","resolvers/dashboard.js","resolvers/contracts.ts","resolvers/organization.ts","resolvers/scheduling.ts","resolvers/index.ts","typeDefs/index.ts","typeDefs/app.js","typeDefs/transporter.js","typeDefs/customer.js","typeDefs/auth.js","typeDefs/dashboard.js","typeDefs/scheduling.ts","components/WithApolloProvider.js","Queries/UserSettingsQuery.js","containers/AppInitializer.js","components/Maintenance/index.tsx","components/Main.js","index.js","components/form/ContractSelect.tsx","common/util/util-js.js","common/util/get-node-text.ts","context/theme.tsx","context/auth.tsx","Queries/Location.ts","components/form/PilotSelect.tsx","components/editable-cell/editable-cell.tsx","components/editable-cell/index.tsx","components/form/AircraftSelect.tsx","components/WithCognitoUser.tsx","components/form/select/LocationSelect/LocationQuery.js","components/form/select/LocationSelect/LocationSelect2.tsx","Queries/Organization.ts","hooks/persistence.tsx","hooks/apollo-extensions/useAutoPaginatedQuery.tsx","components/flytwatch/aircraft-history/util.tsx","components/scheduling/Printout/useManifestPrintout.js","components/ColumnSelector.js","components/reporting/export/index.js","common/reducer/generic-state-reducer.tsx","components/form/select/SearchSelect/SearchSelect.js","components/form/select/SearchSelect/SearchSelectWithData.js","components/reporting/hooks/report-details.tsx","common/form/index.tsx","components/reporting/ReportDetails/Criteria.js","components/reporting/ReportDetails/ReportQuery.js","components/mapping/location-marker/index.tsx","components/reporting/ReportForm/QueryQuickReport.js","components/reporting/hooks/report-submitter.tsx","common/util/export-text-in-ref.tsx","components/reporting-2/report-ui.tsx","hooks/useDebouncedCallback.tsx","components/isn-override-file-uploader/index.tsx","components/WithOrgData.tsx","component-wrappers/wrap-ctx-provider.tsx","components/useInterval.js","components/reporting-2/context.tsx","components/reporting/ReportForm/SubmitReport.js","common/mc-map/layer-dropdown.tsx","common/mc-map/mc-map.tsx","common/mc-map/index.tsx","components/flytwatch/details-map/index.tsx","pages/app/flytwatch/history-editor-page/editor.tsx","components/form/select/timezone-picker/index.tsx","components/icon/icons/map-arrow.svg","components/flytwatch/aircraft-history/aircraft-history.tsx","components/flytwatch/aircraft-history/index.tsx","components/flytwatch/aircraft-details/index.tsx","context/orgData.tsx","common/auto-scroll.ts","components/enchanced-antd-table/table-group.tsx","components/enchanced-antd-table/index.tsx","components/userGroup.tsx","components/icon/index.tsx","common/util-ts.ts"],"names":["QUERY","gql","_templateObject","_taggedTemplateLiteral","useUserGroups","_useQuery","useQuery","data","rest","_objectWithoutProperties","_excluded","castArray","userGroups","_objectSpread","BASE_CN","NonIdealState","props","typeCNIcon","undefined","type","_jsx","className","style","children","_jsxs","icon","_Icon","iconProps","React","isValidElement","exisClassName","cloneElement","cn","renderIcon","title","description","AUTH","REACT_MAP_GL_CONFIG","version","sources","tiles","tileSize","layers","id","source","minzoom","maxzoom","permanent","paint","availableLayers","beforeId","label","config","dashboardAPI","pythonBackendApi","reduxDebug","appSync","url","region","auth","reactmapgl","blockInfo","reportS3Bucket","userContentS3Bucket","configS3Bucket","configKey","manifestPrintoutEndpoint","dfS3WebImages","defaultTheme","amplify","Auth","identityPoolId","userPoolId","userPoolWebClientId","useControlledState","initialState","controlState","onSetState","allowSetStateWhileControlled","arguments","length","_useState","useState","_useState2","_slicedToArray","state","setState","value","CenteredLoadingScreen","_ref","message","_ref$icon","_Spin","size","indicator","restProps","APP_NAME","GlobalAppStateContext","createContext","INIT_USER_SETTINGS","appName","settings","generalSettings","savedTpId","tableSettings","name","hiddenColumns","mcMap","enabled","INIT_STATE","sidebarCollapsed","flytwatchCollapsedColumns","TYPES","reducer","action","payload","UserSettingsQuery","SetUserSettingsMutation","_templateObject2","GlobalAppStateProvider","_useReducer","useReducer","_useReducer2","dispatch","userSettingsState","setUserSettingsState","client","useApolloClient","useEffect","window","innerWidth","console","log","fetchPolicy","errorPolicy","networkStatus","NetworkStatus","loading","_data$GetRemoteUserAp","JSON","parse","GetRemoteUserAppSettings","err","error","contractDocs","GetRemoteUserSettings","userSettingsData","e","_useMutation","useMutation","update","cache","writeQuery","query","__typename","SetRemoteUserAppSettings","_useMutation2","setUserSettings","setUserSettingsLoading","getOrCreateTableSettings","defaultSettings","settingsItem","find","item","Object","entries","forEach","_ref2","_ref3","settingName","settingValue","setOrCreateTableSettings","debouncedHandleSetUserSettingsMut","useDebouncedCallback","newUserSettings","variables","stringify","optimisticResponse","handleSetUserSettings","featureName","_defineProperty","Provider","toggleSidebarCollapse","collapsed","writeData","navSiderCollapsed","userContracts","getUserSettings","defaultValue","setTableColumnVisibility","tableID","columnName","show","newTableSettings","_userSettingsData$set","_userSettingsData$set2","_userSettingsData$set3","_userSettingsData$set4","filter","colName","concat","_toConsumableArray","newSettings","catch","reason","getTableSettings","tableName","_userSettingsData$set5","_userSettingsData$set6","collapseFlytwatchColumn","includes","unCollapseFlytwatchColumn","col","DateTimePickerValue","date","time","_classCallCheck","this","momentOrNull","_createClass","key","toString","set","hours","minutes","seconds","milliseconds","t","moment","hour","minute","second","millisecond","timeDuration","diff","dateTime","add","toMoment","toISOString","dt","m","DateTimePicker","_props$value","_props$value2","dateVal","timeVal","getLabel","text","defaultText","BASE_CLS","showLabels","dateLabelProps","dateLabelText","_DatePicker","marginRight","width","format","allowClear","onChange","_props$onChange","call","placeholder","datePickerProps","timeLabelProps","timeLabelText","_TimePicker","_props$onChange2","timePickerProps","strToDateTimePickerValue","from","defaultProps","Home","_Component","_inherits","_super","_createSuper","_this","_len","args","Array","_key","apply","render","_this2","currentAuthenticatedUser","then","user","history","push","Component","withRouter","ForceChangePassword","componentDidMount","email","form","setFieldsValue","handleSubmit","preventDefault","stopPropagation","validateFields","values","newpassword","completeNewPassword","onSuccess","handleConfirmBlur","target","confirmDirty","compareToFirstPassword","rule","callback","getFieldValue","validateToNextPassword","force","getFieldDecorator","formItemLayout","labelCol","xs","span","sm","wrapperCol","src","mcLogo","alt","fontWeight","marginBottom","_Alert","closable","onClose","evt","_Form","onSubmit","Item","rules","required","validator","_Input","onBlur","_Button","htmlType","onClick","onBack","create","ForgotPassword","code","forgotPasswordSubmit","setforgotpassword","handleEmail","forgotPassword","resp","showCode","FormItem","Verify","redirect","redirectTo","signIn","username","password","redicrectToAfterSignIn","validateFieldsAndScroll","confirmSignUp","resendCode","resendSignUp","codeResent","signup","layout","PAGE_NAMES","SignIn","challengeName","urlBeforeLogin","localStorage","getItem","removeItem","showPage","setForgotPassword","bool","newPassword","prefix","color","display","justifyContent","margin","Link","to","CognitoPhoneNumber","countryCode","number","setCountryCode","cc","replaceAll","clean","phonenumber","phone","parsePhoneNumber","countryCallingCode","nationalNumber","phoneNumber","matchAll","join","COUNTRY_CODES","countryCodes","customList","InputCognitoPhoneNumber","forwardRef","ref","_valueProp3","_valueProp4","valueProp","unFormattedValue","clear","_props$onChange3","parseString","Input","Group","compact","_props$onBlur","currentTarget","contains","relatedTarget","onFocus","_Tooltip","Select","showSearch","_valueProp","updateCountryCode","flexShrink","showAction","selectProps","keys","map","Option","_valueProp2","updateNumber","max","inputProps","validateCognitoPhoneNumber","match","validateNumberChars","classTypeMap","OrgSearch","search","result","currOrgData","setError","msg","String","_message","getCurrOrgType","fetch","getLabelInValueKey","_asyncToGenerator","_regeneratorRuntime","mark","_callee","res","wrap","_context","prev","next","ok","json","sent","classType","stop","_x","getOrganizations","encodeURIComponent","mode","_callee2","_context2","_x2","debouncedGetOrganizations","debounce","prevProps","_this$state$result","_this$state$result2","_this$state$result3","notFoundContent","_Typography","Text","labelInValue","debug","orgType","fontSize","float","marginLeft","_Select","onSearch","val","filterOption","v","isArray","OptGroup","validateISNNumber","isnNumber","replace","test","validateCredWithExpiration","expiration","composeValidators","validators","callbacks","i","cb","validateOtherFieldIsFilledIn","fieldName","fieldLabel","validateAlphaNumeric","validateDecimal","startsWith","endsWith","validateFirstLastName","lastName","firstName","validatePassword","violations","r","validateDateTimePicker","SignUp","attr","attributes","given_name","firstname","family_name","lastname","employer","phone_number","companyphone","signUp","showVerification","organizations","organizationsError","autoComplete","tailFormItemLayout","lineHeight","initialValue","CognitoPhoneNumberClass","PrivateRoute","_React$Component","loaded","isAuthenticated","authenticate","unlisten","listen","_this3","setItem","location","pathname","_this$props","component","_this$state","Route","Redirect","FeedbackMood","_Radio","Button","MCIcon","UserContentUploader","_useContext","useContext","AuthContext","refreshUser","baseKey","uploadProps","multiple","withCredentials","customRequest","_customRequest","file","onError","s3","handleError","comm","onProgress","t0","S3Client","t1","currentCredentials","t2","t3","credentials","PutObjectCommand","ACL","Bucket","Key","Body","ContentType","send","setTimeout","_Upload","renderResponseType","userAttributes","BaseFeedbackForm","onValuesChange","_props$onValuesChange","_props$form","typeValue","lockToType","defaultDescription","defaultType","optionLabelProp","_Fragment","TextArea","autoSize","minRows","renderBugForm","displayWarning","renderOutageForm","displayOutageWarning","renderGeneralFeedbackForm","renderFeatureRequestForm","renderForm","valuePropName","getValueFromEvent","fileList","MUTATION","FeedbackFormModal","received","setReceived","formRef","useRef","_useFeedbackSubmitter","options","onCompleted","_options$onSubmitted","onSubmitted","cleanGraphQLErrorMsg","invokeMutation","input","vars","attachments","appUrlPath","href","attachmentKeyList","useFeedbackSubmitter","_useFeedbackSubmitter2","submit","submitLoading","_formRef$current","_formRef$current2","_formRef$current3","_formRef$current4","modalProps","bodyStyle","minHeight","centered","destroyOnClose","afterClose","_props$afterClose","textAlign","current","alignItems","footer","_props$onCancel","onCancel","feedbackFormProps","onOk","okText","okButtonProps","disabled","Modal","GlobalFilterContext","GlobalFilterProvider","globalFilter","DEFAULTS","autoScrollEnabled","scrollSpeed","useFbShortcuts","maxScrollSpeed","_usePersistence","usePersistence","persistentData","setPersistentValue","ThemeContext","themeName","changeTheme","isDisabled","shortcut","disableShortcuts","findIndex","s","handleKey","_document$activeEleme","document","activeElement","tagName","ctrlKey","altKey","shiftKey","newSpeed","Math","info","content","min","addEventListener","removeEventListener","setAutoScroll","fetchMoreAndGetToken","_x3","_x4","_fetchMoreAndGetToken","fetchMore","queryVars","token","queryKey","_newResult","_newResult$queryKey","newVars","newResult","newToken","bookmark","updateQuery","fetchMoreResult","AutoPaginator","isOnLastPage","docs","abrupt","T","ShortcutDescriptions","_Descriptions","bordered","column","_Switch","checked","Header","_Layout","Footer","Title","FBDataContext","rows","currTime","FBTableRow","Consumer","dataRowKey","row","_id","currentCarrierID","estDepartureTime","estTime","currTimeMoment","isAfter","subtract","FlightboardPage","_data$passengers2","_orgData$transporter","_useFbShortcuts","setCurrTime","logoAltRef","updateCurrTime","newCurrTime","interval","setInterval","clearInterval","orgData","OrgDataContext","transporter","transporterID","onlyShowLive","transitTypes","checkInTypes","departures","locationID","locID","locData","locDataLoading","_useAutoPaginatedQuer","useAutoPaginatedQuery","supressDataUpdates","getNextToken","_getNextToken","getTokenFromData","_data$passengers","passengers","refetch","initialPaginationRunning","paginating","paginationError","startPolling","stopPolling","sort","a","b","getPersonFullName","localeCompare","loc","columns","_","record","dataIndex","carrier","desig","dest","level","capitalizeWords","showIcon","ETable","pagination","rowKey","dataSource","flexMode","stickyHeader","groupByColKey","transformGroupValue","charAt","components","body","groupHeaderType","groupValue","idx","colSpan","borderTop","toUpperCase","autoScroll","hideIdleMouse","speed","onScrollReachEnd","onScrollNeeded","needed","spinning","flex","_Popover","trigger","placement","FlightboardLocationSelectPage","getPersistentValue","setPersistentValues","_Card","_props$onSubmit","castToLabelInValue","LocationSelect","displayName","QUERY_AIRCRAFT_DETAILS","FWAircraftDetailsPage","_af$departingDoc","_af$departingDoc2","_af$departingDoc3","_af$destinationDoc","_af$destinationDoc2","_af$destinationDoc3","_af$contractDoc","dispatchID","pollInterval","af","GetDispatchByID","acData","aircraftID","tailNum","aircraftDoc","departure","departingDoc","departureID","departureAreaBlock","getAreaBlock","departureCoordinates","resolvedCoordinates","destination","destinationDoc","destinationID","destinationAreaBlock","destinationCoordinates","ato","eta","ata","pob","contract","contractDoc","pilot","getPilotName","pilotDoc","status","createdBy","padding","height","AircraftDetails","historyDrawerProps","EmployerNav","assign","_objectDestructuringEmpty","_useUserGroups","_Menu","theme","defaultOpenKeys","SubMenu","g","EditableContext","TransportStateEnum","EditableRow","DraggableEditableRow","_React$Component2","_super2","isOver","connectDragSource","connectDropTarget","dragRow","moveRow","clientOffset","sourceClientOffset","initialClientOffset","cursor","direction","dragIndex","hoverIndex","hoverMiddleY","y","hoverClientY","dragDirection","index","EditableFormRow","DraggableEditableFormRow","EditableCell","DropTarget","drop","monitor","connect","dropTarget","getSourceClientOffset","DragSource","beginDrag","dragSource","getClientOffset","getInitialClientOffset","_React$Component3","_super3","getInput","inputType","cancelButton","marginTop","paddingTop","paddingBottom","_InputNumber","_this$props2","editing","_this$props2$required","_excluded2","FlightState","iconName","iconClassName","textColor","LOCKED","OVERNIGHT","DEPARTED","ACTIVE","RETIRED","FINALIZED","SCHEDULED","BoardingRestrictionButton","buttonChildren","authorization","restrictions","notOverridden","overridden","_Row","gutter","_Col","pluralize","classNames","DestArrow","order","viewBox","transform","d","DestinationList","truncatedData","slice","isTruncated","newRef","exportTextInRef","getISNPassFail","pax","isnCheckRunning","running","qcs","selectedResult","lastIsnResultWithHeader","brdRestriction_Isn","quickCheckStatus","toLowerCase","isnStatus","shortLabel","isnCheckError","errMessage","noCredentials","messageSmall","substring","passed","buttonStyle","IsnCheckStatusButton","_btnProps2","_btnProps","btnProps","passFail","backgroundColor","borderColor","error_message","maxWidth","textOverflow","overflow","getIsnType","checking","ColumnSet","all","some","cols","except","NotFound","replaceColumn","obj","personName","personID","xbr","extraBroadState","employerID","designation","paxIDList","isn","transitType","block","assignedFlight","sorter","_a$currentCarrierID","_a$currentCarrierID2","_b$currentCarrierID","_b$currentCarrierID2","aCarr","bCarr","flightID","modified","modifiedTs","filters","onFilter","indexOf","tt","departureSorter","destinationSorter","getFlightDepartureWeight","flight","legs","parseLegs","_legs$","paxWeight","cgoWeight","bagWeight","Number","PaxAndCgoColumns","_ColumnSet","defaultSortOrder","useSearchFilter","aName","bName","getValue","PassengerColumns","_ColumnSet2","_len2","_key2","flightColorMap","colors","getColor","flightColorMapID","flightKeys","colorIndex","flt","tabIndex","background","customer","customerID","_ref4","aCus","bCus","tpID","_ref5","_ref6","aEmp","bEmp","weight","editable","bagCount","checkedIn","checkedInTime","isSameOrBefore","momentSorter","_ref7","_ref8","tsa","tooltipText","noFlyListed","borderRadius","ahr","paxHasRestriction","bhr","HistoryPassengerColumns","_PassengerColumns","childColumns","customerDoc","_ref9","employerDoc","_ref10","departureDoc","_ref11","_ref12","EmployerColumns","_ColumnSet3","_super4","_this4","_len3","_key3","NonPreferredColumns","_ColumnSet4","_super5","_this5","_len4","_key4","employerName","person","startDate","whiteSpace","PersonColumns","_ColumnSet5","_super6","_this6","_len5","_key5","address","contactInfo","city","CargoColumns","_ColumnSet6","_super7","_this7","_len6","_key6","_ref13","deliveredBy","attentionTo","approvedBy","hazmat","filterMultiple","hazmatUnCode","HistoryCargoColumns","_CargoColumns","_super8","_this8","_len7","_key7","_ref14","CrewColumns","_ColumnSet7","_super9","_this9","_len8","_key8","LocationColumns","_ColumnSet8","_super10","_this10","_len9","_key9","ownerOrg","field","FlightColumns","_ColumnSet9","_super11","_this11","_len10","_key10","departureWeight","getFlightDeparture","aDep","bDep","destinations","leg","seatPercent","legsArray","maxSeats","seats","num","paxCount","toFixed","weightPercent","firstLegUsableWt","BoatColumns","_ColumnSet10","_super12","_this12","_len11","_key11","crewMembers","boatCrewIDs","departureIDs","destinationIDs","OnboardPobColumns","_ColumnSet11","_super13","_this13","_len12","_key12","_ref15","_ref16","offshoreCheckedIn","offshoreCheckIn","RigColumns","_ColumnSet12","_super14","_this14","_len13","_key13","onboardCount","_ref17","inboundCount","_ref18","outboundCount","_ref19","onboardCargoCount","_ref20","inboundCargoCount","_ref21","outboundCargoCount","_ref22","DocksCgoColumns","_ColumnSet13","_super15","_this15","_len14","_key14","_ref23","assetID","_ref24","_ref25","liftCount","_ref26","lifts","liftWeight","_ref27","grossWeight","totalWeight","WorkHistory","_ColumnSet14","_super16","_this16","_len15","_key15","startTime","clockIn","endTime","clockOut","start","utc","end","duration","asHours","commonColumns","historyPax","cgo","historyCgo","crew","paxAndCgo","boat","onboardpob","rig","dockscgo","workHist","nonPreferred","LocationSelect2","OrganizationSelect","classTypes","limit","searchValue","setSearchValue","placeholderMsg","mouseEnterDelay","SearchSelectWithData","OrganizationQuery","getData","onDataItem","fieldsPerOrgType","GlobalFilter","modalOpen","shouldFieldBeShown","fieldType","org","organization","showableFields","isClearable","_this$props$data$glob","getField","setFilter","minWidth","defaultActiveFirstOption","maxTagCount","newFilter","handleReset","_this$props$data","showFields","_Divider","alignSelf","gap","_Modal","visible","flexDirection","compose","WithOrgData","graphql","GetFiltersQuery","SetFilterMutation","ResetGlobalFilterMutation","GlobalFilterWithWrapper","Query","wrapperProps","Paginator","getSkip","skip","getLimit","paginationLimit","getCurrentPage","getDataRange","count","handleChange","setPaginationLimit","hasPrev","hasNext","nextPage","prevPage","borderRight","PaginationLimit","CountryCodeSelect","CountryCodeQuery","getCountryCodes","countries","Name","Code","option","EmployerSelect","handleSearch","getEmployers","resetEmployers","employers","EmployerQuery","staticOptions","DateLabelSelect","setOptions","opt","maxDateLen","maxDateNum","minDateNum","padStringInt","omit","CovidVaxManufacturerSelect","manuList","GetCovidVaxManufacturers","errorText","manuStr","makePersonCovidVaxRecordUnique","isNew","validateDuplicateLabel","recordId","__","allFields","getFieldsValue","currLabel","split","k","requireIfNonEmpty","trim","noManuLabels","CovidVaxDatesForm","_ref6$disabled","_ref6$allowRemoveOrCl","allowRemoveOrClearRecord","resetFormFunc","initialVaxRecords","setInitialVaxRecords","_useState3","setUpdateId","sortRecords","newVaxRecords","vaxRecords","vaxOn","aDate","bDate","aLabel","bLabel","sortVaxRecordsByDate","uuid4","swapRecords","idxA","idxB","newInitialVaxRecords","dataLength","numNewRows","comment","customerName","manufacturer","resetFields","dataToRender","renderedFormItems","fieldNames","isTouched","isFieldsTouched","hasValue","checkHasValue","reset","_form$setFieldsValue","remove","splice","_form$setFields","touched","setFields","menuItems","preserve","Form","dropdownMatchSelectWidth","opacity","_Dropdown","overlay","Divider","ghost","shape","_Popconfirm","onConfirm","recordFieldMap","pickBy","reduce","acc","hasVal","getValuedRowCount","newRecord","buildBulkMutation","_buildBulkMutation","onMutationUpdate","useOptimisticResponse","_data$originalVaxReco","originalVaxRecords","mutationPromise","Promise","resolve","reject","origVaxRecordsMapByDateLabel","Map","modifiedOrAddedVaxRecords","deletedVaxRecords","vaxRowIds","vaxFormRows","renderOrder","aObj","bObj","existing","modRecord","has","stripRecord","modifyVaxRecords","deleteVaxRecords","modifiedVaxRecords","bulkUpdatePersonCovid19VaxDate","bulkDeletePersonCovid19VaxDate","proxy","updatedRecords","HEALTH_INFO_QUERY","WrappedCovidVaxDatesForm","onFieldsChange","CovidVaccineDates","_personData$customerI","_personData$customerI2","_personData$employerI","_personData$employerI2","_vaxFormRef$current","canEditOrDelete","setVaxFormFields","vaxFormRef","resetFormFuncRef","personData","records","GetPersonCov19VaxRecords","_useCovidVaxDateFormS","mutate","mutationResult","mutationOptions","_x5","useCovidVaxDateFormSubmitter","newRecords","queryData","readQuery","newQueryData","success","_useCovidVaxDateFormS2","submitVaxDates","submitVaxDatesLoading","extra","fields","QueryResultContext","EditControl","save","onSave","cancel","setEditing","onRemove","EditForm","_this$props$dateForma","dateFormat","_this$props$hasKey","hasKey","_this$props$hasExpira","hasExpiration","_this$props$needsButt","needsButton","_this$props$form","yr","WithForm","mapPropsToFields","credKey","createFormField","changedFields","propTypes","PropTypes","object","func","CredItem","DATE_FORMAT","Credential","refs","editDisabled","disableEditing","isEditing","onFormChange","setFieldsFromProps","_this$props$loading","showPerson","_this$props$title","banner","CredentialQuery","credentialIds","withPerson","Boolean","cred","credLen","SaveCredentialMutation","offset","CredentialForm","validateType","_this$props$takenType","takenTypes","_this$props$typeTaken","typeTakenMessage","_this$props2$submitTe","submitText","_this$props2$resetTex","resetText","_this$props2$showActi","showActions","lockType","chosenType","credentialTypes","entry","CredentialFormWithForm","_fields$type","_props$fields","string","arrayOf","CredentialManager","currentCredId","showForm","formFields","resetFormFields","setFormFields","getCredentials","getCredentialByType","c","setFormVisibility","typeAlreadyExists","getFormField","_this$props$showAdd","showAdd","_this$props$colProps","colProps","_this$props$showCount","showCount","_this$props$disabled","credType","ErrorCatch","resetState","alertProps","LoadingContent","_ref$text","_ref$style","credTypePrefix","computeID","personId","idEnd","Error","withErrorCatch","withOrgData","withUserGroups","paxID","_ref$requireUserGroup","requireUserGroups","hasPermission","group","Credentials","personCredentials","Mutation","mutation","SaveCredential","RemoveCredential","marginBlottom","credId","orgID","setCredential","newCreds","writeFragment","fragment","SET_PERSON","PassengerEditor","setPicError","renderPicture","path","_Avatar","renderNationSelect","edit","nation","getOrgByType","setPerson","renderInfo","_data$personID","_data$personID$contac","_data$personID$contac2","_Tabs","TabPane","tab","flexWrap","dob","queryResult","EmployerSelectWithData","empObj","personPayload","paxPayload","setPaxNode","_templateObject3","renderCredentials","CredentialManagerWithData","handleNotesChange","event","changedNotes","resetNotes","renderPersonalNotes","_this$props3","textAreaValue","notes","resize","_this$props4","defaultActiveKey","withApollo","PassengerEditorWithData","paxId","loadingStyle","PassengerQuery","getPassenger","defStyle","NotAuthorized","_ref$title","_ref$desciption","desciption","paddingRight","PASSENGER","OVERRIDE","restrictionMap","BoardingRestrictionsOverride","submitting","restriction","override","restrictionType","renderContent","initialOverrideType","initialOverrideNotes","overrideType","autosize","maxRows","_this$props$data2","_Drawer","BoardingRestrictionDrawer","selectedRestriction","credForm","renderOverride","rType","_Table","setCredFormVisibility","resetCredFormFields","handleCancelCredential","credFormRef","createRef","_this$props$data3","_credentialTypes$_thi","_credentialTypes$_thi2","_orgData$customer","BoardingRestrictionDrawerWrapper","open","drawerComponent","setDrawerComponent","close","Fragment","boardingRestrictionsDrawer","BoardingRestrictionsDrawer","FilterDropdown","setSelectedKeys","selectedKeys","confirm","clearFilters","ele","setSearchInputRef","onPressEnter","highlightText","filterText","RegExp","FilterableTable","visibleData","highlightEnabled","highlightState","highlightFiltered","setHighlight","getFilters","hasFilters","x","onFilterDropdownVisibleChange","filterType","focus","onTableChange","currentDataSource","getColumns","_this$props$dataSourc","newCol","filteredValue","filterDropdown","dropdownPlaceholder","getValueFunc","colData","filterChoices","sortedUniqBy","deepEqual","_this$props2$showFilt","showFilterBar","applyChargeCode","Search","enterButton","showHighlightMatches","filterBarProps","GetHighlightStateQuery","Atrribute","_this$props$altVal","altVal","PassengerItem","citDisplay","citMoment","_List","Attribute","PassengerList","itemLayout","renderItem","CargoItem","renderHazmat","CargoList","LegItem","paxIDs","cgoIDs","Panel","_Collapse","PanelHeader","cgoCount","CollapsibleLegs","header","FLIGHT","Property","_ref$altVal","Section","FlightPreview","getFlight","tip","copilot","timeOfDeparture","model","maxLoad","scroll","cgoIDList","FlightDrawerWrapper","drawerProps","flightDrawer","withFlightDrawer","statusMap","RedWhiteOverride","OverrideCard","paxData","hasNewFieldsAndOverriderName","overriderFirstName","overriderLastName","overriderTitle","overriderReason","approverFirstName","approverLastName","redWhiteOverride","hasOverriderNameOnly","createdTs","getLocalizedMoment","IsnOverrideFileUploader","addOnly","qcStatusColor","QCCard","setActive","onActivated","grade","active","allowSetActive","selectedColor","allowed","reasonsForNonCompliance","errorMessage","trainingStatus","scCompanyGrade","scCompanyGradeSince","isnId","companyName","companyID","mostRecentTrainingQualificationExpirationName","mostRecentTrainingExpirationDate","trainingQualificationProject","operatorQualificationProject","onlineTrainingQualificationProject","justify","cancelText","dataAsOf","Meta","QCResult","_this$props$allowSele","allowSelection","selectedIndex","qc_result","stack","err2","renderAlert","isn_customer","isn_ownerid","qc_count","onResultActivated","QCResultWithData","_this$props$showISNCh","showISNCheck","ISNResultQuery","passenger","isnData","renderQCResult","SetPaxSelectedISNResult","assignedActivities","_rev","setIsnSelection","ISNCheck","runISNCheck","UserInfoWrapper","getUser","currentUserInfo","userinfo","withUserInfo","OVERRIDE_MUTATION","FirstLastNameInput","Override","requireNewFields","requireOverrideFields1","paxOverride","_this$props$isnData","overriderName","approverName","statusList","_this2$props$userinfo","_this2$props$userinfo2","_this2$props$isnData","maxLength","OverrideWithWrappers","WithPermissions","UserGroup","Flytsuite","Isn","renderNotAuthorized","renderOverrideTab","isGreen","isOverridden","PaxISN","hasOverride","getOverride","tabBarExtraContent","PaxISNWithData","PaxQuery","PassengerTable","isnDrawer","ColorizedRow","checkInType","setIsnDrawer","withBoardingRestrictionDrawer","SET_PASSENGER","LivePassengers","editPaxModal","getActiveTab","activeTab","onTabChange","_this$props$orgData","setPaxModal","_this$props$passenger","setSkip","onKeyDown","specialCharRegex","pressedKey","onCell","warn","handleSave","RadioGroup","RadioButton","cell","withGlobalFilter","LivePassengersWithData","getTransitType","customers","transporters","Loader","loadMoreMessage","position","bottom","left","boxShadow","spin","ErrorMsg","titleText","scrollElementToBottom","element","scrollTop","scrollHeight","BlueprintTableInfiniteScroller","_tableRef$current3","_ref3$loading","_loadMore","loadMore","hasMore","tableComponent","_ref3$offset","tableRef","prevScroll","setPrevScroll","_useState4","shouldLoadMore","setShouldLoadMore","_useState5","_useState6","startedNextPageWithBtn","setStartedNextPageWithBtn","_useState7","_useState8","promiseFunc","setResult","setLoading","prom","usePromise","timeout","handleSuccess","cancelRequest","makeCancelable","scrollContainerElement","handleScroll","tableState","totalHeight","rowHeights","total","viewportTop","viewportRect","top","viewportHeight","scrollDelta","viewportBottom","scrollingDown","numRows","_tableRef$current","_tableRef$current2","handleRootScroll","right","DEFAULT_MD_DEL_USR_GRPS","DEFAULT_MD_EDIT_USR_GRPS","getDetailsTitle","isNewEntry","newEntryText","MDDetails","_props$extra","delUserGroups","deleteUserGroups","editUserGroups","userHasDeletePerm","userHasEditPerm","hideSaveBtn","contentStyle","contentWidth","onDelete","strTitle","deleting","node","showReset","onReset","saving","disableSave","saveBtnText","pointerEvents","LoadIndicator","DuplicationChecker","renderItems","renderMessage","notifyOnNetworkStatusChange","items","messageBeginning","MDHeader","inputElement","searchInputProps","hasFiltersApplied","onFiltersClear","showReloadButton","onReload","reloading","onNewEntry","isNSLoading","isNSReloading","searchValuesToQuerySearchPayload","searchValues","payloadArray","valueJson","getAlertPropsFromMDState","MDState","queryError","saveError","savedData","deletePressed","deleteError","deletedData","findSelectedIndexByID","renderCellFromKeyIndex","Cell","MDStateHasNoData","queryNetworkStatus","setVariables","MDStateToLayoutProps","displayNoData","detailsVisible","MDStateToHeaderProps","reload","editFromNew","MDStateToTableScrollerProps","getMDTableProps","pk","selectedRowIndex","getEntryFieldValue","onEditRow","editFromExisting","onEditCancel","cancelEditing","MDStateToDetailsProps","detailsTitleEntryFieldName","detailsTitle","initEntryValues","formFieldsIsTouched","entryFields","resetEntryFields","renderNoData","NoResults","onNewEntryButtonClicked","clearSearchValues","trimString","str","trimObjectStringValues","recursive","isObject","mapValues","renderOrgCell","useMasterDataState","getQueryData","resultData","setSearchValues","paginationOffset","setPaginationOffset","paginationHasMore","setPaginationHasMore","_useState9","_useState10","isInitalQuery","setIsInitialQuery","queryGQL","getQueryVariables","DEFUALT_POLL_INTERVAL","context","debounceKey","debounceTimeout","_useState11","_useState12","setInitEntryValues","_useState13","_useState14","setEntryFields","_useState15","_useState16","setIsEditing","_useState17","_useState18","setDeletePressed","_useState19","_useState20","deleteId","setDeleteId","saveMutationGQL","handleCancel","invokeSave","_useMutation2$","_useMutation3","deleteMutationGQL","_useMutation4","invokeDelete","_useMutation4$","_setEntryFields","newValues","lockFieldsToValue","identity","createFormFields","getFormFieldValue","_arguments","confirmUnsaved","finalValues","transformEditFromExisting","defaultValues","_options$onEditFromNe","onEditFromNew","delete","getSearchValue","onSearchValueChange","preserveCase","finalValue","deletingId","nextOffset","updateQueryAfterFetchMore","useMasterDataStateNoQueryHook","_options$saveMutation","_options$saveMutation2","_options$saveMutation3","_useState21","_useState22","_useState23","_useState24","_useState25","_useState26","_useState27","_useState28","_useState29","_useState30","_useState31","getValues","_useState32","handleSaveParams","setHandleSaveParams","_options$onCancel","cancelPrevious","saveMutationResult","closeAfterSave","afterSuccessfulSave","_setEntryFields2","deleteMutationResult","MDLayout","alertClosed","setAlertClosed","bodyCls","headerElement","Alert","tableElement","noDataElement","detailsElement","_Result","DEFAULT_COL_WIDTH","getColWidths","colCount","widths","defaultWidth","colWidths","setWidth","fill","useColWidths","setColWidths","updateColWidth","itemIdx","newColWidths","ActionBtnStyle","MDTable","highlightedRow","childrenArray","Children","toArray","unshift","Column","cellRenderer","interactive","_props$deleteBtnProps2","_props$deleteBtnProps","hideDelete","deleteDisabled","deleteBtnProps","handleDelete","deletingOther","renderDelete","selected","handleCancelEdit","handleEdit","renderActionCell","_props$onDelete","deleteLoadingIdx","initialColWidths","ACTION_COL_WIDTH","columnWidths","colWidthsHookValues","Table","selectedRegions","onSelection","regions","selectedRow","numFrozenColumns","enableMultipleSelection","selectionModes","SelectionModes","ROWS_AND_CELLS","onColumnWidthChanged","TableLoading","TableLoader","mdState","entryFormOptions","uppercaseFields","changedValues","allValues","AircraftEntryForm","inputRef","autoFocus","dupeChecker","getOrgIDByType","MasterDataAircrafts","DeleteEntity","dataPaginationLimit","craft","ContractEntryForm","nameInputRef","includeOneOff","hasDataflytHardware","_Checkbox","MasterDataContracts","currDate","endDate","getLabelInValue","startOf","isSame","locationName","safeGet","intent","saveData","startDateFormat","endOf","endDateFormat","CountryCheckTransfer","_Transfer","targetKeys","inputValue","titles","ALL_LOCATIONS","SteelToeDestinationsTransfer","Transfer","getLocations","useListAvailableNotifiers","queryOptions","notifiers","ListAvailableNotifiers","validateOrgNotifEmailListEditor","errors","_step","_iterator","_createForOfIteratorHelper","n","done","emailValidator","validate","validateOptIn","f","optInAll","optIn","OrgNotifSelect","_notifiers$availableN3","_useControlledState","onFilterChange","_useControlledState2","_useControlledState3","_useControlledState4","setValue","_useListAvailableNoti","errorMsg","availableNotifiers","dropdownRender","menu","_notifiers$availableN","onMouseDown","_notifiers$availableN2","notificationType","OrgNotifEmailListEditor","_props$onFormChange","_props$collapseProps","_useControlledState5","_useControlledState6","emailList","setEmailList","Set","openPanels","setOpenPanels","updateEmailItem","emailListCopy","validateEmail","newSet","removeEmailItem","addEmailButtonProps","activeKey","collapseProps","reverse","CustomerEntryForm","ebsAirCanisterRequiredCheckBoxRef","extraBroadCheckRequiredCheckBoxRef","illnessCheckRequiredCheckBoxRef","quarantinedCheckRequiredCheckBoxRef","quarantineTravelPeriodInputRef","askHaveYouBeenVaccinatedQuestionCheckBoxRef","listStyle","MasterDataCustomers","steelToeIDDestinations","notificationEmailList","removeTypename","quarantinedCountries","ebsAirCanisterRequired","extraBroadCheckRequired","illnessCheckRequired","quarantinedCheckRequired","askHaveYouBeenVaccinatedQuestion","quarantineTravelPeriod","EmployerEntryForm","DELETE_USER_GROUPS","EDIT_USER_GROUPS","MasterDataEmployers","VesselEntryForm","MasterDataVessels","LocationEntryForm","setNameInputRef","setLatitudeInputRef","isSuperUser","autoFocusLatitude","long","longitude","isRig","FormItemClassNames","NoMargin","areaBlockDuplicationChecker","MAKE_RIG_MUT","_MDState$data","editIDByDefault","routerLocation","useLocation","params","qs","ignoreQueryPrefix","duplicatesFound","setDuplicatesFound","loadingDone","setLoadingDone","findDuplicate","MasterDataLocations","newSearchValues","twicRequired","isOneOff","makeRig","makeRigLoading","renderDupeChecker","searchMode","dataArray","xorWith","isEqual","isEmpty","isLocOffShore","selectedLoc","pil","getRig","columnHeaderCellRenderer","ColumnHeaderCell","nameRenderer","latitude","delData","CreateRigFromLoc","_templateObject4","InputPhoneNumber","formatPhoneNumber","InputPhone","types","_ref$inputPhoneNumber","inputPhoneNumberProps","_ref$phoneTypeProps","phoneTypeProps","phTypes","globalPhoneTypes","InputEmail","PilotEntryForm","lastNameInputRef","MasterDataPilots","entryValues","stateOptions","InputAddress","createInput","cmpt","fieldKey","inputStyle","street","zipCode","stateSelectProps","optionFilterProp","inputs","missingFields","englishList","InputName","formValues","changed","_props$defaultValues","_props$removeFields","removeFields","addressValidator","ISNChecker","formattedIsnNumber","ISNQuickCheck","CredentialInput","_ref$value","_ref$onChange","_ref$showKey","showKey","_ref$showExpiration","showExpiration","_ref$inputProps","keyInput","expInput","onInputChange","renderInput","defaultMessage","defaultContactValues","defaultEmergencyContactValues","emergencyContactInfo","initializeOrg","personOrg","init","ContactInfoCards","tabKey","setTabKey","contactFormRef","eContactFormRef","getFormErrors","getFieldsError","contactInfoFields","eContactInfoFields","updateFields","formErrorsFunc","fieldErrors","_errors","renderTabWarning","formName","getFieldError","tabList","ContactInfoForm","DuplicateSearch","onItemClick","persons","Z","getFormCredentials","getCredAttrs","creds","_ref3$form","_ref3$orgData","onDupeSearchItemClicked","dupeSearchState","setDupeSearchState","handleDupeSearchStateUpdate","orgClassType","initialCustomer","initialEmployer","xl","US_DRIVERS_LICENSE","PASSPORT","PASSPORT_CARD","TWIC","SAFETY_CARD","HUET_CARD","EBS_CARD","ISN","RigSelect","getRigs","_r$locationID","locName","_a$locationID","_b$locationID","_item$locationID","_item$locationID2","PersonEntryForm_Internal","showCovidForm","disableCovidForm","hasAtLeastOneCred","disableCustomer","disableEmployer","covid19VaxDateRecords","PersonEntryForm","SAVE_COVID_MUTATION","SAVE_MUTATION","dataKey","apolloClient","setCredKey","personVaxRecords","setPersonVaxRecords","canModifyAndDeleteVaxRecords","canReadVaxRecords","getPersonsByCred","MasterDataPersonnel","filteringByID","credFilter","_transformEditFromExisting","_result","_result$data","_values$essentialOn$","_values$essentialOn$$","essentialOn","mapKeys","keyBy","columnElements","getLabelHeaderStyle","credCount","credList","align","_values$essentialOn","_getFirstElArrayOrNul","_values$essentialOn2","originalData","essentialOnChanged","credentialMap","_MDState$getEntryFiel","_MDState$getEntryFiel2","_MDState$getEntryFiel3","_MDState$getEntryFiel4","_yield$buildBulkMutat","getFirstElArrayOrNull","getActiveOrgID","updatePersonEssentialOn","sha256","_data$MasterDataPerso","_data$getPersonsByCre","windowSizes","large","medium","small","mobile","DebouncedField","_React$cloneElement","_React$useState","_React$useState2","refState","initialized","initializeValueOnce","debouncedOnChange","debounceTime","cloned","getValueFromChangeEvent","EMPLOYER_QUERY","SET_EMPLOYER","EmailListContext","dirty","setData","EmployerEmailTriggersEditor","emailListState","setEmailListState","listProps","_emailList","editorRef","EmployerEmailTriggers","selectedEmp","_setSelectedEmp","employerSearch","setEmployerSearch","_useGetEmployersEmail","useGetEmployersEmailList","_useGetEmployersEmail2","_useGetEmployersEmail3","_useSetEmployerEmailL","SetEmployer","empList","useSetEmployerEmailList","_useSetEmployerEmailL2","emailListUpdating","emailEditorRef","clearSelectedEmp","refetchBtn","cardBody","warning","processed","border","USER_ORG_QUERY","SET_USER_ORG_EMAIL_LIST","UserOrgEmailTriggers","_queryData$GetUserOrg","_useGetUserOrgEmailLi","_result$data$GetUserO","GetUserOrganization","useGetUserOrgEmailList","_useGetUserOrgEmailLi2","_useGetUserOrgEmailLi3","_useSetUserOrgEmailLi","SetUserOrgNotificationEmailList","useSetUserOrgEmailList","_useSetUserOrgEmailLi2","resetEmailListState","orgName","editor","EmailTriggersPage","md","lg","xxl","Sider","Content","noPadding","EmployerRoutes","memo","Switch","exact","MDPersonnel","EmployerMain","hasExpanded","setHasExpanded","useHistory","navKey","MobileScreenAlert","newProps","isMobile","CheckInPassengerFlight","CheckInPassengerDocks","PersonSearch","_data$persons2","_data$persons2$docs","_data$persons3","_data$persons3$docs","selectedPerson","_ref$onPersonSelect","onPersonSelect","_ref$queryLimit","queryLimit","currentBookmark","setCurrentBookmark","lastBookmark","setlastBookmark","isInitialQuery","setName","setNameDebounce","_debounce","mounted","PersonSearchQuery","_data$persons","formatter","_records$i","tooltip","_useColWidths","_useColWidths2","selectedRowIdx","_fetchMoreResult$pers","_prev$persons","_fetchMoreResult$pers2","enableRowHeader","rowIdx","VesselSelect","VesselQuery","vessels","CurrentCustomer","isRequired","LocationBlock","locationId","LocationBlockQuery","getLocation","withAppLoaded","appLoaded","TP_QUERY","TP_SELECTED_MUTATION","tpList","setSavedTp","travelFormItemLayout","PersonToPassenger","_person$customerID","_person$customerID2","_orgData$transporter2","_orgData$tpList","_getFieldValue","_ref$form","_ref$credentials","_ref$orgData","ContractSelect","tp","finalized","help","lastPaxWeight","hasFeedback","lastBagWeight","lastBagCount","PaxCheckIn","setSelectedPerson","hasSubmitError","setHasSubmitError","hasSubmitSuccess","setHasSubmitSuccess","refetchPerson","setRefetchPerson","hasSearched","setHasSearched","addPax","setAddPax","paxEditor","submitError","submitSuccess","validatePaxEditor","additionalFields","formattedValues","contractID","lastKnownController","restValues","credEntries","formatPersonToPassengerValues","handleSubmitBtnClick","submitBtn","renderSubmitBtn","onBackClicked","mouseLeaveDelay","onClearSelection","tableMinHeight","submittedPassengerData","PersonQuery","_keyBy","DocksNav","pathArray","breakpoint","PAX_ISN_CHECK","CREW_ISN_CHECK","IsnChecker","results","run","outbound","runPax","checkPassenger","newResults","clearResultError","isncheck","IsnCheckerWithData","crewId","CrewISNResultQuery","crewMember","getBoatCrew","SetCrewISNSelectionMutation","ISNManager","dataType","PaxQCResult","CrewQCResult","CrewISN","CrewQuery","LiveColoredButton","_ref$clickable","clickable","clsName","ColorKey","FINALIZE","BOAT","REMOVE_PAX","MUTATION_MAKE_PAX_ONSITE","BoatDetail","finalizing","selectedPax","makingPaxOnSite","getPaxPassFail","validatePax","getBoat","valid","finalize","paxValResult","handleISNCheck","startTab","endtab","_this$props$data$getB","runIsnCheck","currentTab","renderDesig","removePassengers","boatID","boatid","removePassengersFromBoat","makePaxOnSite","_this$props2$data","destLen","departLen","paxLen","crewLen","renderLocations","locations","tabContent","depart","canRemovePax","rowSelection","selectedRowKeys","isnCheckResult","renderPassengers","Count","_Badge","activeTabKey","cannotFinalizeReason","overflowX","_Breadcrumb","marginBlock","_templateObject5","_templateObject6","BoatDetailWithData","Boats","getBoats","onRow","BOATS","BoatsWithData","_props$orgData","removePadding","Cp","renderCheckIn","checkIn","CurrentOrg","basePath","submitFn","expected","cmp","DocksRoutes","MDLocation","MDEmployer","MDVessel","DocksMain","getFlightDestinations","flightTime","LegTimeEntry","BodyRow","rowSource","rowTarget","DraggableBodyRow","DraggableTable","onMoveRow","rowProps","FlightManualLegsAssign","onAddToLegs","resultLegs","selectedPaxCgo","selectedLegs","paxOnFlightLeg","editFlight","clearSelection","onRemoveFromLegs","p","cgos","_this$props$selectedL","paxRowSelection","legRowSelection","FlightPath","origin","optionalArgs","originalOrigin","preventDupeNodeInsertion","nodeIdx","forceAdd","subset","getNodeSubset","depIdx","getNodeIdx","destIdx","startIdx","endIdx","idxs","startLoc","endLoc","getRoundTripPath","_getOptimalFlightPath","getOptimalFlightPathSubset","_getOptimalFlightPath2","Infinity","displaceLocID","insertAt","overrideOrigin","_legs$2","_legs$3","originOverridden","flightPath","legDest","addNextNode","si","ei","lsi","lei","moveStart","loops","updateEntityDepDest","entity","entityCopy","FlightLegManager","initialLegs","allPax","allCgo","locIDToNameMap","manAssignedPax","manAssignedCgo","locationIDToNameMap","fromFlightLegs","flightPathOptionalArgs","paxObjs","newObj","getOriginalOrigin","cgoObjs","legDepIdx","legDestIdx","paxDep","paxDest","isOnLeg","scanned","redundantNodes","getPath","removeNode","getOrigin","isLocationRedundant","updateFlightPath","insertNode","putDestConditionally","doesEntityHaveALeg","paxList","cgoList","disableCreateMissingLegs","findAndCreateMissingLegs","paxIdsOnFlight","cgoIdsOnFlight","addEntityInfo","entityType","getInfo","union","departIdx","paxOnLeg","cgoOnLeg","get","computeLegWeightsAndCounts","paxIds","cgoIds","grabDest","hoverDest","moveNode","setOrigin","graphqlPaxToFlightManPax","gPax","_gPax$departureID","_gPax$destinationID","graphqlCgoToFlightManCgo","gCgo","_gCgo$departureID","_gCgo$destinationID","buildLocNameMapFromPaxCgoLists","flightLegs","_pax$departureID","_pax$destinationID","_cgo$departureID","_cgo$destinationID","getFlightLegManagerFromFlightQuery","additionalLocIDToNameMap","flightPathArgs","_flight$departureID","parsedLegs","nameMap","paxNodes","cgoNodes","findDroppedPaxCgoInLegs","oldLegs","newLegs","oldPaxIds","oldCgoIds","newPaxIds","newCgoIds","scan","listType","_leg$list","set1","set2","difference","droppedPax","droppedCgo","droppedPaxIds","droppedCgoIds","dropCount","UnassignedPaxCgoWarning","showPaxList","showCgoList","_flManager$findUnassi","flightData","findUnassigned","SaveFlightTimes","EditFlightHistory","RevertFlightHistory","FINALIZED_FLIGHT","getFlightTime","flightTimeTotal","isInteger","parseInt","FlightTimesEntryDrawer","addLocationToFlight","locationListToFlightLegs","getLocationsFromLegs","arr","changeWidth","selectLegs","selectPaxCgo","save_flight_times","save_flight_times_loading","editingFlight","editedFlight","getFlightHistory","_this2$props","chargeCodeCol","editMode","paxColumns","cgoColumns","selectedRows","originalFlightID","revertFlightHistory","Flight","Times","HistoryEdit","editFlightHistory","assignedPaxCgo","uniquePaxCgo","diffOfPaxCgo","paxCgo","pilotID","copilotID","activeOrg","times","PilotSelect","AircraftSelect","maringBottom","scheduleType","chargeCode","FlightTimesEntryDrawerWrapper","copy","cloneDeep","newLeg","withFlightTimesEntryDrawer","CouchFindAdapterInitState","prevNetStat","currNetStat","CouchdbMangoAdapter","_ApolloQueryAdapter","initState","sideEffect","getLoading","getMangoQueryResult","produce","draft","prevData","_prevResult$docs","prevClone","fetchMoreData","prevResult","currResult","deps","ready","hasNextPage","_get","_getPrototypeOf","prototype","ApolloQueryAdapter","onLoadMore","FINALIZED_FLIGHTS","FlightTable","_record$aircraftID","legsA","legsB","depA","depB","_record$aircraftID2","firstLegUsableWeight","aircraftMaxLoad","usefulLoad","noTimeEntered","every","paxNCgo","noChargeCode","legNoTime","rowIndex","totalFlightTime","strong","DayGroupCard","FINALIZED_FLIGHTS_FULL","PrintoutTimesButton","_useManifestPrintout","useManifestPrintout","_useManifestPrintout2","fetchPrintout","fetching","printoutLoading","setPrintOutLoading","ApolloClient","userAttr","cognitoUser","getFullFinalizedFlightsData","_getFullFinalizedFlightsData","pageSizeWeeks","noWeeks","getDataPage","pageQueue","executeQueue","pageNum","subStartDate","subEndDateCandidate","subEndDate","page","compiledResults","_args2","execute","dateRange","ceil","as","pop","t4","getFinalizedFlights","flightManifest","hessLayout","layouts","l","logoURL","logo","handleClick","flights","issuedBy","layoutName","PrintoutPercentageButton","_useManifestPrintout3","_useManifestPrintout4","_getFullFinalizedFlightsData2","_callee4","_args4","_context4","_callee3","_context3","withCognitoUser","mangoAdapter","_useInfiniteScroll","_adapterImpl$sideEffe2","adapterImpl","loadArgs","getLoadArgs","_adapterImpl$sideEffe","_useInfiniteScrollLib","useInfiniteScrollLib","sentryRef","useInfiniteScroll","rootMargin","groups","currentFlight","scheduledFlightDate","RangePicker","FlightTimesHeader","dates","disabledDate","isBefore","ranges","FlightTimes","baseClassName","LiveHeader","contentItem","_cn","titleWrapperClassName","verticallyCenterTitle","titleWrapperContent","subTitle","_props$titleWrapperPr","titleWrapper","titleWrapperProps","tabs","leftContent","middleContent","rightContent","LiveCard","_props$animation","cardClasses","contentClasses","contentNoPadding","hasTable","contentNoBorder","animation","slideIn","headerProps","CargoForm","formItems","formItemProps","extraProps","hazmatIndex","fi","getFormItems","useFields","excludeFields","formItemElements","fd","fieldComponentPropsMap","renderExtra","formatCargoFormValues","groundPickup","initials","CargoFooter","onInitialsChange","setInitials","handleButtonClick","isSubmitting","buttonDisabled","CargoSiderTab","cargoFormRef","setEditMode","editingFields","clearOnClose","newFields","formatCargoValues","uuidv4","clearOnSubmit","createTitleKey","createRenderKey","resolvePath","currProp","resolveColumnValue","DataExport","exportDataAsCsv","filename","convertedCsv","delimiter","csvRows","names","processRow","csvRow","csvConverter","contentType","blob","Blob","downloadLink","createElement","download","URL","createObjectURL","appendChild","click","exportToFile","Utils","convertAntdColumn","getNodeTextFunc","titleId","renderId","registerAntdColumn","registerNode","enhancedRender","renderFunc","DEFUALT_STATE","errorClosed","tableSettingsDropdownVisible","drawer","approvalDrawer","ACTION_TYPES","_data$cargo2","globalAppState","getGenericStateReducer","CARGO_QUERY","newState","onPaginationError","_data$cargo","cargo","pageCount","CheckInInboundCargo","setCargoNode","cargoSubmitting","inboundTransfer","groundPickupCgo","renderTabs","_tableSettings$settin3","_tableSettings$settin4","_reactNodeTextGetter","reactNodeTextGetter","getNodeText","isChecked","_tableSettings$settin","_tableSettings$settin2","cp","domEvent","ItemGroup","renderOptionsContent","onVisibleChange","receivedLocationID","firstCheckInType","nodeState","cargoType","useExtendedReducer","middlewares","initializer","originalDispatch","stateRef","getState","applyMiddleware","DefaultState","addFlight","formData","Reducer","useLiveFlightsState","_useExtendedReducer","_useExtendedReducer2","uiState","api","useMemo","dismiss","tableSettingsDropdown","setVisible","createApi","FLIGHTS_QUERY","_data$flights","CognitoUserApprovalStatusEnum","OrganizationType","LocationType","TransitType","BrdRestrictionRestrictionType","BrdRestrictionStatus","BrdRestrictionType","EmailType","PhoneType","CredentialType","ScheduledVersion","LiveEditedState","DispatchStatus","ReportStatus","ReportType","FlightNodeInputState","LiveFlightFragment","defaultFormOptions","CREATE_FLIGHT","_changedFields$lastKn","setFlight","createFlight","flightInput","locationIdToNameMap","legManager","buildFlightLegs","LiveFlightsPage","_useLiveFlightsState","_useLiveFlightsState2","_useLiveFlightsState3","btn","AddFlightDrawer","flightId","EditableText","onValueChange","onEditingChange","_ref$renderValue","renderValue","_ref$showEditIcon","showEditIcon","inputComponent","disableEdit","_ref$editTooltipMessa","editTooltipMessage","_ref$tooltipPlacement","tooltipPlacement","setInputValue","fromEnterKey","newValue","isValid","formFieldName","keyCode","customInputProps","hasValueChanged","PAX_QUERY","INIT_REDUCER_STATE","setPassengerMutation","updatePaxField","paxObj","_payload","_props$onActiveTabCha","onActiveTabChange","isPaxNodeLockedOrDeparted","InTransitList","FontAwesomeIcon","selectedID","carrierID","_props$onInTransitLoc","onInTransitLocClick","carrierName","expectedCount","QmAlert","OffshoreLocList","bedCountAlert","expectedAlert","departingAlert","onboardAlert","bedCountTooltip","departingCount","bedCount","_props$onOffshoreLocC","onOffshoreLocClick","library","faMapMarkerAlt","faUsers","faBed","faLevelUpAlt","faLevelDownAlt","faHelicopter","faShip","LOCATIONS_QUERY","QuartermasterMainPage","_result$data$GetCusto","locationInfoArray","listOfInTransits","selectedColumOne","setSelectedColumOne","handleListSelect","sortPobs","pobA","pobB","pobAName","pobBName","filterInfoBySearchValue","regex","escapeStringRegexp","filterPobListsBySelection","_pob$currentCarrierID","_pob$lastKnownControl","buildPobProfImgUrl","locIdToPobNodeMap","locIdToLocNameMap","locIdToRigDocMap","carrierIdCountMap","carrierIdToCarrierObj","allListedPobsExpected","allListedPobsOnboard","allListedPobsDeparting","GetCustomerLocationDocs","pobNodeItem","_pobNodeItem$lastKnow","_pobNodeItem$lastKnow3","_pobNodeItem$lastKnow2","pobNodeMapValue","locIdKey","listOfPobs","listOfPobsExpected","pobNode","listOfPobsOnboard","listOfPobsDeparting","_locIdToRigDocMap$get","bedcnt","bedQuartersIds","pobNodes","carrierInfo","hasLegWithLoc","locInfo","hasFlightWithLoc","carrierObj","flexBasis","pobItem","avatar","defaultAvatarImg","useDelayedEffect","effect","didMount","invalidMsg","nully","getValidateAmountValidator","getValidatePSIDValidator","AddFuelTakenForm_temp","amount","psid","requiredRule","AddFuelTakenForm","Submitter","dtt","dateMtimeMtoMoment","dateTimeTaken","fuelTaken","_props$onSuccess","useDeleteFuelTaken","itemDeleted","setItemDeleted","additionalMutationOptions","DeleteFuelTaken","useUpdateFuelTaken","itemUpdating","setItemUpdating","UploadFuelTaken","FuelTakenPage","exportOpen","setExportOpen","addFuelTakenVisible","setAddFuelTakenVisible","isRowEditing","datetime","isMoment","startDateTime","endDateTime","reportType","_useDeleteFuelTaken","parsedFuelTaken","GetFuelTaken","newFuelTaken","ft","_useDeleteFuelTaken2","deleteFuelTaken","deleteResult","deletedFuelTaken","_useUpdateFuelTaken","_useUpdateFuelTaken2","updateFuelTaken","updateResult","updatedFuelTaken","isBeingDeleted","isBeingUpdated","reduceDetail","curr","reduceSummary","totalAmount","_props$onDateChange","onDateChange","_props$onReportTypeCh","onReportTypeChange","_props$onReportTypeCh2","poll","d_columns","contractId","aircraftId","_values$locationId","_values$contractId","_values$aircraftId","editRow","d_totals","masterLabel","colNum","masterSticky","renderTdFromGroup","renderMasterTotalTd","s_totals","sticky","td","totals","groupSpacing","squareCorners","DataExporter","titleRowText","export_name","column_sets","columnSets","getColumnSets","report_type","criteria","fieldLabelMap","ReportTypeMap","dtPickerStyle","FWBRCriteriaForm_Internal","zeroTimeMoment","maxTimeMoment","FWBRCriteriaForm","getReportType","reportData","c_reportType","parsed","FuelTakenReportPage","ReportUI","useExternalContextProvider","overrideContext","overrideProvider","reportTitle","contentFlexMode","headerExtra","contextProviderProps","persistenceName","reportName","submitReportHandler","display_value","convertPersistentFormData","unconverted","updateTs","_convertedData$startD","_convertedData$endDat","convertedData","renderCriteriaForm","CriteriaForm","renderTable","_reportDetails$report","_reportDetails$report2","_reportDetails$report3","_reportDetails$report4","reportDetails","includeTotalOnTop","setReportExporterProps","_reportData$result","getReportCriteriaValue","report_id","CONTRACT_QUERY","QUERY_GET_USER","MUTATION_UPDATE_USER_CONTRACTS","useApplyAllContractsToUser","_user$mappedAttribute","applying","setApplying","cRef","cancelled","setCancelled","isCancelled","_useGetUser","AdminCognitoGetUser","useGetUser","canApply","mappedAttributes","getAllContractIDs","_getAllContractIDs","currBookmark","allContractIDs","_result$data$contract","_result$data2","_result$data2$contrac","contractsPage","contractIds","contracts","doc","_user$userSettings","userSettings","mutateUserContracts","_mutateUserContracts","contractIDs","_apply","organizationName","isApplying","UserContractManager","selSearchContracts","setSelSearchContracts","selListContracts","setSelListContracts","adding","setAdding","handleContractsAdd","_handleContractsAdd","_props$onAddContracts","onAddContracts","contractData","ct","sc","detailedDescriptions","onInputKeyDown","isAdding","disableFilterByOrg","isRemoving","extraHeaderComponents","comp","_props$onRemoveContra","onRemoveContracts","_item$tpID","_item$customerID","actions","sel","ContractDescription","transporterName","FORM_ITEM_CLASS","collapseActiveKeys","useCustomTempPass","pswdVisibility","UserEntryForm","emailRef","_props$onStateChange","onStateChange","saveUserLoading","formTouched","renderFormExtra","flexGrow","SignUpOrganizationSearch","showArrow","collapsePanelChildren","UserGroupSelectNoQuery","filterItem","GroupName","Description","UserGroupSelect","_data$AdminCognitoLis","AdminCognitoListGroups","NoQuery","QUERY_USER_DETAILS","MUTATION_UPDATE_USER_GROUPS","MUTATION_APPROVE_USER","MUTATION_REVOKE_APPROVAL","MUTATION_DENY_USER","contractFragment","_templateObject7","INITIAL_STATE","nextToken","groupSelectValues","formState","userSaveError","REDUCER_TYPES","UserMDDetails","_selectedUser$mappedA","_data$AdminCognitoGet","_data$AdminCognitoGet2","_data$AdminCognitoLis4","selectedUser","disableUserLoading","deleteUserLoading","Username","groupsNextToken","_useApplyAllContracts","approveUser","approveUserLoading","revokeApproval","revokeApprovalLoading","_useMutation5","_useMutation6","denyUser","denyUserLoading","_useMutation7","_useMutation8","updateUserGroupsMut","updateUserGroupsLoading","_useMutation9","_useMutation10","addUserContractsMut","isAddingContracts","_useMutation11","_useMutation12","removeUserContractsMut","isRemovingContracts","AdminCognitoListUserGroups","handleFormSubmit","_values$organization","_state$formState","mappedAttrs","company_phone_number","attrs","email_verified","phone_number_verified","localAttrs","deletedAttrs","tempPassword","desiredDeliveryMediums","preferredDeliveryMediums","newMappedAttrs","addUserContractsMutQueryCache","ids","newContractDocs","readFragment","uniqueCDocs","setCon","con","mergedIDs","mergedDocs","AdminUpdateUserSettings","Enabled","approvalStatus","okType","_props$onDisableUser","onDisableUser","_props$onDeleteUser","onDeleteUser","renderActions","ctIds","idStr","addGroups","_data$AdminCognitoLis2","_props$onUserGroupsCh","newGroups","_castArray$find","_data$AdminCognitoLis3","onUserGroupsChange","rGroups","removeGroups","AdminCognitoUpdateUserGroups","removed","_props$onUserGroupsCh2","rg","QUERY_USERS","MUTATION_DISABLE_USER","MUTATION_SAVE_USER","MUTATION_CREATE_USER","MUTATION_DELETE_USER","getUserMappedAttrFn","booleanRenderer","fieldMapping","char","UserStatus","UserCreateDate","UserLastModifiedDate","addUserColumnData","columnData","FilterTypeFunctions","confirmed","_user$columnData","unconfirmed","_user$columnData2","_user$columnData3","_user$columnData4","approved","_user$columnData5","waitingForApproval","_user$columnData6","deniedApproval","_user$columnData7","AdminUserPage","setSearch","sortType","setSortType","setFilterType","filteredUsers","setFilteredUsers","sortAscending","setSortAscending","setSelectedUser","userToBeDeleted","setUserToBeDeleted","filterRequiresSearchInput","filtersApplied","sortApplied","fetchMoreUsers","pageToken","paginationToken","AdminCognitoListUsers","users","maxPages","autoPaginate","refetchAndPaginate","startAutoPagination","stopAutoPagination","restQueryResult","filterUserBySearchInput","matched","prop","searchVal","compareUsers","userA","userB","valueA","valueB","saveUser","_userSaveLoading","saveUserMutationResult","createUser","userCreateLoading","createUserMutationResult","_excluded3","userSaveLoading","attrArray","Value","deletedAttributeNames","userCreateResult","AdminCognitoCreateUser","newUser","User","Attributes","att","newData","newAttrs","newAttrsMap","toObj","newUsers","deleteUser","fUsers","renderedColumns","mapping","cellContent","renderColumns","colWidthValues","toggleAscending","enableUser","AdminCognitoDisableUser","disableUser","_PageHeader","filterLabel","filterExtra","el","msgText","wasStopped","sub","ROWS_ONLY","renderMode","RenderMode","BATCH","renderBody","FWChangesByConsoleReportPage","autoRefreshOptions","isWeb","_moment","tz","guess","TimezonePicker","noDST","DEFAULT_CONTEXT_VALUE","FWBRContext","criteriaFormFields","DEFAULT_STATE","reportId","FWBRTContextConsumer","_ctx$reportDetails","_ctx$reportDetails$re","_ctx$reportDetails$re2","_ctx$reportDetails2","_ctx$reportDetails2$r","_ctx$reportDetails2$r2","_summary","ctx","summary","totalAircraft","total_aircraft_count","FWBillingReportTable","activeAircraft","faFileAlt","FWBillingReportPage_Internal","onCriteriaFieldsChange","resetCriteriaForm","submitReport","reportSubmitting","_useContext$reportDet","reportState","reportID","showReportCriteria","setShowReportCriteria","showCriteriaSider","setShowCriteriaSider","showExportDrawer","setShowExportDrawer","forceUpdateCount","setForceUpdateCount","forceUpdateInterval","prevVal","Criteria","isInProgress","justCriteria","criteriaItemStyle","getReportRuntimeFromNow","ReportExporter","FWBillingReportPage","wrapCtxProvider","providerComponent","_persistentData$start","_persistentData$endDa","useReportDetails","_useReportSubmitter","useReportSubmitter","_useReportSubmitter2","lastUpdate","c_val","getFieldOptions","createFormFieldFromProp","aircraft","colon","FlightEditorFormWrapper","onEditChange","FlightEditorForm","FlightLegsTable","legsCardProps","_props$checkLegIsRedu","checkLegIsRedundant","LegContent","legData","showOrder","o","showScheduledGroup","renderTitle","defaultActiveTabKey","onLegTabChange","legTabKey","cardProps","LegManualAssignContent","legsData","DepartingHelicopter","hasCarrier","include","carrierId","renderCheckboxColumn","isSelected","toggleSelection","checkboxDisabledText","checkProps","checkbox","renderAssignedFlightColumn","cellStyle","LoadingIndicator","shouldRenderLoadingIndicator","OnClickChild","IsnStatusCell","isnCheckRunningKey","cellProps","getISNStatus","disableClick","classNamePrefix","BlueprintColumnSet","paxEdit","renderCellElement","renderCellElementMap","basicCellRenderer","colID","renderRow","getRow","getCellElement","_createElement","columnID","renderColumn","colIDs","CommonColumnSet","_BlueprintColumnSet","PaxEditCell","colId","colIds","PaxModalState","PaxEditChild","ExtraBroadFlair","modal","paxModal","PersonColumnSet","_CommonColumnSet","getCommonColumnSets","PaxNodeColumnSet","_CommonColumnSet2","CargoNodeColumns","_CommonColumnSet3","truncated","useMultiSelectByID","selectedItems","setSelectedItems","clearAll","SelectionCount","onClear","_props$itemName","itemName","_props$renderMessage","SearchHeader","forceRefresh","onForceRefresh","showSelectedItemsCount","onRefresh","shouldRenderSI","shouldRenderRefresh","shouldRenderLoadingIcon","CGO_QUERY","initialSearchState","includeOtherCarriers","_ref$pageLimit","pageLimit","filterOptions","selectedItemsProps","_ref$showSelectedItem","onSearchStateChange","searchStateProp","searchState","excludeCarrier","setSearchState","_useMultiSelectByID","onlyUnassigned","handleInputPressEnter","colList","userOrgIsOfType","NONE","renderHeaderContent","Checkbox","includeCarrier","handleInputValueChange","initialSelectState","paxInitialSearchState","cgoInitialSearchState","PaxCgoSearch","tabsProps","selectedEntities","onEntitySelect","paxSearchOptions","cgoSearchOptions","currentCarrier","setTab","selectState","setSelectState","PaxSearch","ss","CgoSearch","locked","LiveLegsAdd","resultingLegs","setResultingLegs","resultingLocations","setResultinglocations","locs","createNewLeg","addStopToLeg","rec","samePax","sameCgo","removeStopFromLeg","px","cg","moveStop","LiveFlightEditorFlightFragment","OrganizationFragment","LocationFragment","GET_FLIGHT","SET_FLIGHT","SET_LOCKED_STATE","renderEditDisableIcon","tooltipProps","PrintoutButton","manifestType","buttonText","aircraftNo","LiveFlightEditor","selectedLeg","setSelectedLeg","setSelectedLegs","setLegTabKey","setSelectedEntities","editingForm","setEditingForm","assignerOpen","setAssignerOpen","addLegOpen","setAddLegOpen","searchSelections","setSearchSelections","assigning","setAssigning","setForceRefresh","removingEntities","setRemovingEntities","tabState","setTabState","setFlightResult","setLockedState","setLockedStateResult","_flightData","_flightData$paxIDList","_flightData2","_flightData2$cgoIDLis","_flightData3","formFieldsWithValues","actionsDisabled","mergeDataWithFormFields","getContractName","paxIDMap","cgoIDMap","subTitleIcon","flightState","liveEditedState","isEditable","checkEditable","_removeRedundantDestination","flManager","flightid","legsJson","removeLocationIfRedundant","handleFlightLegsChange","paxObjList","cgoObjList","formattedLegs","objID","handleRemoveFromLegSelectedEntities","discoveredEntities","shouldIncludeEntity","newPaxList","newCgoList","handleRemoveSelectedEntities","removePassenger","removeCgo","getPaxIDList","getCgoIDList","layoutProps","locIDToObj","handleAssignEntities","_yield$props$client$q","_yield$props$client$q2","_paxIDMap","_cgoIDMap","paxSearch","cgoSearch","resolve_entity_ids","addPassenger","addCgo","extraElements","btnText","btnIcon","onIDChange","saveForm","handleEditingForm","handleFormSave","animated","di","hi","getDestinationsFromLegs","moveDestination","onLegsReorder","_flightData4","removeRedundantDestination","fr","createLegListSelectColumn","multiSelect","legEntities","ce","selectedItemsDifference","se","selectedItemsAddAll","hasEntitiesToAdd","indeterminate","fixed","renderGroupNameMenuItems","entities","groupNames","scheduledGroup","getGroupNames","groupName","handleMenuClick","SelectedEntityCounter","legSelectedEntities","faBoxOpen","GET_PAXNODE_LIST","FlightManualScheduleLegPax","renderLegData","iconStyle","combinedList","getPaxNodeList","getCargoNodeList","onRowClick","rowClassName","FlightManualScheduleLegs","_this$props$extra","onLegChange","_record$paxIDs","_record$cgoIDs","LocationOnshoreSelect","MainHeader","renderBreadcrumb","route","routes","last","breadcrumbName","formitems","itemRender","afterRoutes","ScheduledPaxNodeFragment","ScheduledCgoNodeFragment","ScheduledFlightFragment","ScheduledPaxCgoGroupV2Fragment","Phase1StepQuery","ScheduleHistoryListItemFragment","_templateObject8","ScheduleHistoryDetailFragment","_templateObject9","QueryGetPhase1ListDateRange","_templateObject10","breadcrumbItems","select","userGroup","requireV1Scheduler","getPhase1Step","SchedulingStepsHeader_Internal","getPathName","onRouteChanged","setPhase1Step","step","renderBreadcrumbs","link","renderLink","renderText","configs","_this$props$orgData$c","useV1Scheduler","separator","SET_PHASE1_STEP","SchedulingStepsHeader","MainLayout","validateNote","note","originalText","modifiedText","_state","_action$text","_action$text2","_validateNote","NotesForPilotQuickEdit","_props$scheduleNodeDa","_props$previewProps","_props$previewProps2","_props$previewProps3","ClassNames","ClassNameBuilder","notesForPilot","scheduleNodeData","componentId","overrideState","textAreaRef","handleConfirm","_props$onConfirm","renderAccept","buttonProps","renderCancel","readOnly","textAreaElement","getElementById","Wrapper","textAreaProps","placeholderText","triggers","getPopupContainer","popupContainer","overlayStyle","previewProps","Preview","PreviewDisabled","Base","getDisabledSuffix","createScheduledEntityColumns","containerRef","reviewMode","_record$departureID","_record$destinationID","icons","FlightScheduleLegPax","_flight$paxIDList","_flight$cgoIDList","_props$events","selectedLegIndex","departureName","destinationName","events","_selectedLeg$paxIDs","_selectedLeg$cgoIDs","paxSortedList","cgoSortedList","onRemoveRedundantLeg","_props$events2","FlightScheduleLegs","_this$props$checkLegI","_this$props2$title","_this$props2$extra","_this$props2$selected","onReorder","getPrimaryKey","useMultiSelect","primaryKey","SearchEventTypes","activeSearch","openGroupPanels","openLegPanels","EventHandlers","Helper","ApplyCSRAT","getPanelKeys","panelKeys","legPanelsCopy","groupID","panelKey","_event$payload","_event$payload2","keyNames","stringArray","_group$lastKnownContr","groupDate","legKey","_leg$departureDoc","_leg$destinationDoc","draftState","category","GetScheduledGroups","AddPaxToFlight","Queries","Mutations","RESOLVE_TYPE_MAPPING","typename","fragmentName","useApolloClientHelper","_class2","resolveEntityIds","resolveEntityIdsByType","getScheduledPaxByIds","getScheduledCgoByIds","CollapseClassNames","Rounded","RoundedWithTable","approximateLegRouteColumnWidth","sidePadding","LegRoute","TRANSFER","ONSHORE","OFFSHORE","OUTBOUND","INBOUND","usePersistentDateRange","setDateRange","range","schedulingDateRange","isString","dateStr","dayDiff","newDateRange","getSNodeID","__temp_id","ScheduledPaxCgoAdder","_props$data","legRouteColumnWidth","_item$departureID","_item$destinationID","renderAddEntitiesButton","_props$onAddEntitiesT","onAddEntitiesToFlight","renderPaxTable","_props$selectionEvent","_props$selectionEvent2","paxnodeIDs","_props$onPaxNameClick","onPaxNameClicked","_props$onIsnButtonCli","onIsnButtonClicked","paxnodeDocs","selectionEvent","_props$selectionEvent3","toggle","renderCgoTable","_props$selectionEvent4","_props$selectionEvent5","cgonodeDocs","_props$selectionEvent6","renderLegPanel","_props$selectionEvent7","allIds","cgonodeIDs","selectedEntityIds","entityId","intermediate","canSelectAll","handleCheckbox","_props$selectionEvent8","_props$selectionEvent9","role","totalPaxWeight","totalCgoWeight","totalBagWeight","_props$collapseGroupK","_props$collapseGroupK2","_props$collapseGroupK3","panels","_props$selectionEvent10","entityList","entityIds","_props$selectionEvent11","_props$selectionEvent12","_props$collapseLegKey","_props$collapseLegKey2","legCount","paxOutbound","cgoOutbound","paxTransfer","cgoTransfer","paxInbound","cgoInbound","collapseControl","collapseLegKeys","_props$collapseLegKey3","_props$collapseLegKey4","legCollapse","collapseGroupKeys","isAddingToFlight","flightDate","_queryResult$data","_queryResult$data2","State","apolloHelper","addPaxToFlightMutation","handleAddEntities","_handleAddEntities","_options$override","partialFlightData","paxnodes","cgonodes","legsStr","addEntitiesToFlight","partialLeg","intersection","_options$onFlightUpda","onFlightUpdated","_state$search$state$a","_state$search$state$a2","userFilter","word","entityFilters","_entity$employerID","legFilters","transformLeg","legCpy","addEntity","_step3","_iterator3","_step4","shouldAdd","_iterator4","entityFilter","groupCpy","_step5","_iterator5","_step6","_iterator6","legFilter","selection","addEntities","addSelectedEntities","_addSelectedEntities","groupCollapseKeys","legCollapseKeys","collapse","expandAll","groupKeys","_step7","_iterator7","legKeys","collapseAll","_step8","_iterator8","toggleAll","isAllExpanded","isOpen","filterApplied","getName","list","componentProps","addButton","searchInput","searchTypeSelect","filtersAppliedAlert","errorAlert","ScreenTypeEnum","useBreakpoints","setSource","setOffset","screen","setScreen","lastWidth","handleResize","_Number","screenType","Window","clientWidth","setWidthSource","widthSource","widthOffset","setWidthOffset","observer","ResizeObserver","observe","unobserve","sizes","buildEntityMap","entityMap","getValidNotes","noteMap","newMap","_i","_entries","_entries$_i","noteId","buildNotes","_step2","nextNoteId","noteIdToMsg","msgToNoteId","_iterator2","getNextNoteId","addNote","buildEntityToNotes","entityToNote","getEntityNoteMsg","entityIdToNote","findUnassignedNoteIds","_noteId","getEntityName","getEntityIcon","PARENT_BASE_CLS","NoteAssigner","entitiesWithNote","origEntities","getNoteSelectorProps","Util","entityWithNote","noteSelector","renderNoteSelector","bulkAssignerValue","noteMessage","bulkAssigner","noteValue","visibleNotes","noteAssigner","prevState","nextState","validateVisibleNotes","newMessage","noteIds","currState","naState","useNotesForPilotEditorApi","updateNote","removeNote","getNotes","getNoteById","getEntitiesWithNote","_entityEntries","_entityEntries$_i","getComponentProps","NotesForPilotEditor","_props$api","internalApi","renderEntity","iconType","openKeys","displayNoteAssignerDrawer","verticalAlign","Toolbar","assignNoteBtn","StateWrapper","_props$children","defaultState","merged","onStateChanged","initPath","present","past","future","redoSteps","PathReducer","maxSteps","castDraft","nextPast","nextFuture","CreateUndoRedoReducer","fp","removeIndex","insertIndex","locId","_action$payload","startIndex","endIndex","useRouteEditorApi","_dispatch","overrideDispatch","initFlightPath","move","undo","redo","useDereferencedLocations","locIds","locationList","setLocationList","currLocIds","_updateLocationList","finish","updateLocationList","RouteEditor","_props$overrideState","_props$overrideState2","_useDereferencedLocat","table","renderLocName","UPDATE_FLIGHT_FORM","UPDATE_FLIGHT_LEGS","UPDATE_FLIGHT_PASSENGER","DELETE_FLIGHT","SCHEDULED_TO_EXPECTED","GET_LOCATION","defaultRules","FlightForm","editorProps","defaultFieldProps","pilotName","startMutation","callSign","getPilotNameObj","_name$split","_name$split2","copilotName","legPax","getLocationName","legCgo","manualAssign","passengerDrawerOpen","routeEditorOpen","passengerModalOpen","manualLegs","ReviewChanges","renderEntityList","rowColor","entitiesToRemove","entitiesToModify","entitiesToAdd","FlightScheduleEdit_Internal","_data$getFlight3","_setState","routerParams","useParams","_useApolloClientHelpe","drawerBreakpoints","entityMultiSelect","allEntities","_data$getFlight","_data$getFlight2","notesForPilotApi","routeEditorApi","paxCgoAdderState","_addEntitiesToFlight","paxnodeIds","cgonodeIds","computeAutoAssign","origLegs","legsWithNew","legsWithoutNew","addMissingLegs","createMissingLegs","_findDroppedPaxCgoInL","radioStyle","whatsThisText","radioValue","updateFlightMutation","updateFlightMutationResult","updateFlightLegsMutation","updateFlightLegsResult","openPassengerDrawer","closePassengerDrawer","routeEditor","_removeEntitiesRecalLegs","_callee6","_context6","_callee5","_data$getFlight8","jsonLegs","partialFlight","flightPayload","_context5","arrayToMap","pId","cId","_x10","maskClosable","_x8","_x9","_data$getFlight5","startSlice","endSlice","reorderedDestinations","newAllList","_newAllList","sortPaxByOrder","scheduledOrder","newList","transfer","inbound","sortedAll","newLegsJson","newLegsArray","getSelectedLegsFromLegs","legIdx","_callee7","_context7","handleModifyRoute","_handleModifyRoute","_callee10","locList","locMap","_findDroppedPaxCgoInL2","afterConfirm","_afterConfirm","dropWarnings","_context10","_callee9","_context9","fromLocationList","_pax$departureID2","_pax$destinationID2","_cgo$departureID2","_cgo$destinationID2","_onOk","_callee8","_context8","mainHeaderProps","Date","getFullYear","getMonth","padStart","getDate","checkIfToday","_data$getFlight6","_data$getFlight7","zIndex","marginInline","_x6","removeEntitiesRecalLegs","onAddLegs","_x7","isTruey","Paragraph","headerStyle","paddingLeft","NotAuth","Schedule","LinkWrapper","cardLinkStyle","WorkFlowCard","showDetailedDesc","detaileddescription","cardStyle","renderCard","hoverable","onMouseEnter","onMouseLeave","step1","step2","step3","Any","staticContext","ALL_SETS","OWNER_FILTER","SET_OWNER_FILTER","SetTable","owner","filterOwner","searchFilter","dep","ButtonLink","refetchQueries","deleteEntity","getPersonSets","nameA","nameB","SetsList","paxSets","Sets","invalidPax","paxWithNoPaxWeight","paxWithNoBagWeight","paxWithinvalidBagCount","hasOrHave","autoFocusButton","cancelButtonProps","QueryPersonnelIDs","IsnDrawerState","PaxCgoSchedulerTable","isnCheckDrawer","setIsnCheckDrawer","flightPreviewState","setFlightPreviewState","cgoData","hasOutboundPax","renderFlight","_commonColumns$pax$ge","_commonColumns$pax$ge2","bgColor","_record$currentCarrie","PaxColSet","_record$currentCarrie2","spanClassName","_record$currentCarrie3","onCellEdit","defaultChargeCode","CgoColSet","paxPanelHeader","renderPaxPanelExtra","lkc","_ref$showDate","showDate","_ref$dateFormat","_ref$useGroupName","useGroupName","_ref$disabled","trimStart","PERSON_SEARCH_QUERY","initialAdvancedFilterState","_ref$showCustomerColu","showCustomerColumn","_ref$showEmployerColu","showEmployerColumn","filterResults","showMoreFilters","setShowMoreFilters","advFilterState","setAdvFilterState","inputDirty","advancedFilter","advFilterValues","keyValues","valItem","getAdvFilterValues","numAdvFiltersApplied","colNames","nonPrefIcon","python_backend_isNonPreferred","PERSON_SEARCH_BY_CRED_QUERY","initialSearchCredState","SetsTable","_ref$isScheduling","isScheduling","_ref$isEditing","_ref$previewData","previewData","_ref$previewLoading","previewLoading","_ref$onMoveRow","_ref$onRowSelectChang","onRowSelectChange","_ref$onPersonsToSched","onPersonsToScheduleChange","dataWithPreview","dItem","preview","handleInputChange","person_id","per","renderNumberInput","defaultTableRowKeys","SetsEditor","_ref$isNew","_ref$onEditChange","_ref$onSave","_ref$renderTable","onPersonsAdd","onPersonsRemove","onPersonsMove","onPersonsReorder","_ref$saving","_ref$saveError","mainHeaderRoutes","onScheduleChange","_ref$addPersonsLoadin","addPersonsLoading","_ref$selectedPersonKe","selectedPersonKeys","_ref$selectedTableRow","selectedTableRowKeys","_ref$transitType","_ref$onSelectedPerson","onSelectedPersonKeysChange","_ref$onSelectedTableR","onSelectedTableRowKeysChange","_ref$onTransitTypeCha","onTransitTypeChange","_ref$personsToSchedul","personsToSchedule","_ref$cargoToSchedule","cargoToSchedule","_ref$onScheduledUpdat","onScheduledUpdate","_ref$onPersonsToSched2","onPersonsToScheduleMove","_ref$onCargoToSchedul","onCargoToScheduleChange","_ref$onSchedule","onSchedule","_ref$onDefaultChargeC","onDefaultChargeCodeChange","_ref$deleting","setsForm","cargoEditState","setCargoEditState","initialFormFields","handleFormChange","personList","handlePersonsAdd","handlePersonsRemove","handleSchedulingRemove","handleSchedulingPersonsMove","destTT","handlePersonsMove","handleMoveRow","getPersonSet","ReflexContainer","orientation","ReflexElement","minSize","tabBarGutter","tabBarStyle","sp","PersonSearchByCred","ReflexSplitter","SetFormShedule","SetForm","onCargoEdit","cargoEditID","sr","origSetId","setId","_ref$createRoutes","createRoutes","onSaved","onScheduled","onDeleted","setAPL","setSPK","setSTRK","setTT","unsavedCreated","setUnsavedCreated","setPTS","setCTS","setDefaultCC","GetPersonSetQuery","initScheduledPerson","perId","getExistingPTS","initPersonsToSchedule","GetPersonSetQueryCached","personSet","updateAttributes","handleScheduledUpdate","updatedItemList","TT","handlePersonsToScheduleChange","handlePersonsToScheduleMove","_setPTS2","handleCargoToScheduleChange","cachedData","SetPersonSet","saveSet","saveProps","SchedulePassengersMutation","scheduleSet","scheduleProps","deleteSet","deleteProps","getPersonId","personsToAdd","lodash","uniqBy","personKeys","removePersons","toTT","_setPTS","movePersons","listKey","$splice","newPersonSet","reorderPersons","scheduleData","dateString","toPersonScheduleInput","checkScheduledPax","inboundCargo","useBulkISNChecker","setStatus","paxArray","setPaxArray","setChecking","returnedIsnStatus","setReturnedIsnStatus","itemLoading","setPassengerIsnCheck","setStatusComplete","setStatusError","initStatus","promises","runChecks","getCheckStatus","checkStatus","checkLoading","checkError","checkData","ResolveEntityID","_useBulkISNChecker","queryProps","gqlFields","db","GET_LOCATIONS","defaultName","defaultDepartureID","defaultDestinationID","propLoading","getDeparture","getDestination","drawerVisible","onDrawerChange","setDrawerVisible","CreatePersonSetQuery","createPersonSet","alreadyExists","onNewSetClicked","setPersonSet","groupData","selectStyle","GroupForm","formElementProps","flightName","printoutForm","printoutError","clearPrintoutError","printoutFormFields","setPrintoutFormFields","modalVisible","setModalVisible","GetCustomerManifestPrintout","getCustomer","_props$cognitoUser$at","confirmLoading","PrintoutForm","personToPassenger","_paxData$scheduledOrd","useSchedulerState","setDeletedData","groupFormData","setGroupFormData","setDefaultChargeCode","resetGroupFormData","initialData","addPersonnel","largestScheduledOrder","getMaxScheduledOrder","removeEntities","deleteData","movePassengers","currentTransitType","destTransitType","clearChargeCodes","onRefetch","SchedulerStateWrapper","schedulerProps","getParams","Comp","initialUIState","showSetsDrawer","showPersonAssign","siderTab","preparePassengerForSchedule","prepareCargoForSchedule","createSaveMutationVars","groupFieldsValues","deletedEntities","GetScheduledPaxInbCgo","getScheduledPaxInbCgo","getLastKnownController","getTransporter","Scheduler","SaveScheduledPaxInbCgo","formFieldValues","getFormFieldsValues","onSaveSuccessful","schedulePaxInbCgo","saveSuccessMsg","saveSuccessAlertProps","saveErrorMessage","onDeleteGroupSuccessful","deleteGroup","deletingGroup","deleteErrorMessage","onDeleteGroup","searchStateCred","personSearchMultiSelect","UIState","S_setUIState","bulkISNChecker","groupFormRef","hideSaveErrorMessage","setHideSaveErrorMessage","hideSaveSuccessAlert","setHideSaveSuccessAlert","_props$schedulerProps","setUIState","changes","outboundPaxData","handleMovePassengers","getTransitTypeCount","getTransitTypeWeightCount","viewablePaxData","saveAndCheckPaxValues","deleteScheduleDisabled","paxOnFlight","deleteScheduleBtn","deleteScheduleBtnWrapped","onBackToList","CreatePersonSet","ManifestPrintout","renderMainHeader","collapserIcon","collapserTooltipText","destintationID","eIdx","wrappedComponentRef","showDrawer","renderLayoutContent","getMonthOptions","monthOptions","clone","SchedulingCalendar","_Calendar","headerRender","dateFullCellRender","cellData","dateData","dataItem","getDataDate","renderDateCell","onCellClick","MonthSelect","isSameOrAfter","selectedMonth","month","year","tableCellStyle","ScheduledGroupsTable","defaultRowHeight","onViewGroup","getCalendarEventClassName","paxOnFlightCount","base","getCalendarEventTableRowClassName","ScheduledGroupsCalendar","expandedDay","setExpandedDay","transformGroup","thProps","_group$departureID","_group$destinationID","tooltipContent","paxOutboundOnFlight","paxTransferOnFlight","paxInboundOnFlight","cgoOutboundOnFlight","cgoTransferOnFlight","cgoInboundOnFlight","onGroupClicked","GetScheduledPaxCgoGroups","getFlightStatusClassName","ScheduledGroupsList","bp","grouped","groupBy","_legs","_record$legs","scheduledVersion","sum","onFlight","showOnFlight","itemData","dividerStyle","formatDate","_orgData$organization","calValue","setCalValue","listSearch","setListSearch","viewData","_usePersistentDateRan","_usePersistentDateRan2","view","schedulingCalendarView","viewActions","_useQuery2","getScheduledPaxInbCgoGroups","GetScheduledPaxCgoGroupsV2","GroupList","_props$onGroupClicked","newScheduleUrl","Passenger","useGenerateFlightDesig","contractName","matchingNumbers","_flight$desig","nextNumber","createFlightDesig","getScheduledFlights","_form$getFieldValue","generatedDesigResult","_values$contractID","validateDesig","useCallback","ScheduledFlightsTable","destNames","onViewFlight","ScheduledFlightsCalendar","buttonTooltip","onFlightClicked","GET_FLIGHTS","newFlightOpen","setNewFlightOpen","NewFlightDrawer","onNewFlightSubmitted","deRefLocations","_deRefLocations","locationIds","_yield$apolloClient$q","ResolveLocationIdsQuery","entityFormData","modifiedPax","_entityFormData$getSN","_entityFormData$getSN2","modifiedCgo","sortByScheduledOrder","updateScheduledOrder","DepDestList","scheduleNodes","depDestList","scheduleNodesCopy","hash","nextRangeEnd","rangeEnd","rangeStart","findLegIdx","_item$departure","_leg$departure","_item$destination","_leg$destination","allRequiredFieldsHaveValue","requiredFieldNames","touchedFieldNames","_formData$_key3","requiredFieldName","genTempID","toScheduleNode","phase2ScheduleNode","formDataMap","formatChargeCode","isFlightScheduled","flightNode","RemovePaxCgoFromFlightMutation","getSelectedEntities","originalEntities","purgeEntitiesFromFlightTool","getFlightIDList","carrierIDList","_entity$currentCarrie3","useApi","getDispatch","purgeToolState","startPurge","_start","flightIDList","ineligibleFlights","entitiesOnFlight","flightsWithEntities","flightsUpdating","_entity$currentCarrie","arrayToMapAccumulate","_entity$currentCarrie2","usePurgeFromFlight","purgeToolApi","setOpen","isPurging","purgeStatus","flightIsUpdating","defineType","SET_VISIBLE","SET_SELECTED_ENTITY_IDS","SET_STATUS","SET_VISIBLE_LEGS","ScheduledToExpectedPaxCgoMutation","scheduledToExpectedPaxCgo","ActionType","dispatchMutation","useMutationDispatcher","scheduledToExpectedPaxCgoApi","isLoading","hasPax","hasCgo","_api$data","modifiedEntities","queryStatus","saveStatus","carriableSelector","selectedPersonnelIds","upperTab","lowerTab","legSelector","searchForm","hidePanel","forms","initGroupForm","groupForm","cargoForm","newLegForm","depDest","formErrors","cargoFormErrors","newLegFormModal","messageModal","visibleLegs","notesForPilotPopup","NotesForPilot","notesForPilotEditor","HelperFuncs","splitter","splitBy","separated","VisibleLegsReducer","locIDCombined","unionBy","_toScheduleNode","StateValidation","setVisibleLegs","depDestToString","_MUTABLE_validateSelectedEntities","INIT_DATA","lastKnownControllerObj","RESET_DATA","RESET_FORM_DATA","resetData","SET_ENTITY_FORM_DATA","_action$payload$charg","SET_FORM_DATA","_action$cargo$initial","_action$cargo$initial2","SET_MODIFIED_ENTITIES","newEntities","actionE","build","sorted","_state$forms$cargoFor","_p$departureID","_p$destinationID","_p$personID","SET_QUERY_STATUS","SET_SAVE_STATUS","DISMISS_SAVE_STATUS","SET_SELECTED_PERSONNEL_IDS","SET_CARRIABLE_SELECTOR_TAB","SET_EDIT_MODE","SET_CARRIABLE_SEL_SEARCH","SET_HIDE_CARRIABLE_PANEL","newSelEntityIds","CLEAR_CHARGE_CODES","foundFormData","SET_DEFAULT_CHARGE_CODE","SET_LEG_SELECTOR","SET_ISN_DRAWER","SET_PAXNODE_MODAL","SET_NEW_LEG_MODAL","newLegValue","NOTES_FOR_PILOT_POPUP","_state$data$modifiedE","origText","NOTES_FOR_PILOT_EDITOR","SUBMIT_NOTES_FOR_PILOT_EDITOR","getNextState","initData","entitiesOnValidFlightOnly","PurgeEntitiesFromFlightTool","entitiesNotOnValidFlightOnly","ScheduledToExpectedPaxCgo","validateState","Context","DEFAULT_VALUE","DepDestSelect","controlledMode","handleSelectChange","departureSelectProps","destinationSelectProps","showSwap","CarriableSelector","Phase2State","personSearchContent","tabBarExtra","searchFormValues","_api$carriableSelecto","lowerT","personnelIds","_api$selection$person","_api$selection$person2","_api$selection$person3","_api$selection$person4","selectedPersonnelSelector","getAsObjects","objects","departureValue","destinationValue","addUI","addToSchedule","calcTotalWeight","currWt","calcBagWeight","prevWeight","calcBagCount","prevCount","createFormFieldKey","splitFormFieldKey","formFieldKey","elements","NotesForPilotWrapper","getNotesForPilot","QuickEdit","updateAllWithNote","oldNote","updateEntity","getModifiedText","getQuickEditProps","Phase2Table","entityForm","listEntityIds","handleCellEdit","modifyEntity","hasSelectedPersonnel","selectionEnabled","getLegs","entityCount","chargeCodeValidator","chargeCodes","getDefault","createChargeCodeValidator","reorderBtns","swapEntities","containerElement","stopPropagationProps","bulkIsnChecker","modifyPaxColumns","columnWidth","_record$currentCarrie4","modifyCgoColumns","onRowResult","_item$departure2","_item$destination2","itemsOnFlight","depName","destName","totWt","totPaxWt","totCgoWt","totBagWt","totBagCt","tooltipTitle","isLegVisible","deleteBtn","removeLeg","addBtn","moreBtn","swapLegs","clickParam","_item$departure3","_item$destination3","setEntityLegs","noDataMsg","getAsStrings","setAsStrings","queryInfo","hideCarriablePanel","renderIsnDrawer","modalState","modalActions","renderPaxModal","getApiContext","hideCarrierPanel","scheduledPax","hasData","SelectMenu","_getApiContext","ToolsMenu","_getFeatureConfig","_getApiContext2","renderFeature","_props$featureConfig$","featureConfig","isFeatureEnabled","firstID","firstSelectedEntity","renderMoveToMenu","_api$forms$entityForm","_api$forms$entityForm2","forceVisible","showAll","hideAll","setDefault","collapseButton","editMenu","selectMenu","viewMenu","toolsMenu","pilotNodeEditorButton","editButton","selectionCount","apiOverride","removedEntities","entityID","overrideTableApi","modifyEntityColumns","nameIndex","newColumns","_pax$currentCarrierID","maxHeight","overflowY","Phase2Editor","newLegModalFormRef","popupContainerRef","tableHeader","saveStatusAlert","schedule","desc","_newLegModalFormRef$c","_values$depDest$depar","_values$depDest$desti","_api$modal$newLegForm","_api$modal$newLegForm2","NewLegForm","getToolbarProps","Editor","getEditorProps","getNotOnCarrier","ScheduledToExpectedPaxCgoTool","GetScheduledPaxCgoV2","SaveSchedulePaxCgoV2","PersonFragment","ResolvePersonIdsQuery","cargoFormToCargoNode","CargoUtils","usePhase2SchedulerApi","_orgData$getActiveOrg","_queryResult$data4","_derefSelPersonnelRes","_queryResult$data5","entityFormRef","getActiveOrg","mutateSchedule","_queryResult$data3","derefSelPersonnelResult","selectedPersonnelObjs","createDispatchFunc","onEditModeChange","modifiedEntitiesNotOnCarrier","getScheduledPaxNodes","getScheduledCgoNodes","getModifiedEntityById","_entity$departureID","_entity$destinationID","entityObj","newEntity","_startObj$departureID","_endObj$departureID","_startObj$destination","_endObj$destinationID","entityListCopy","startObj","endObj","arg1","temp","setLegs","toEntities","hasError","saveInfo","cancelEdits","notifySetCreated","setID","_props$onNewSetCreate","onNewSetCreated","_props$onFinished","onFinished","groupErr","groupValues","entityErr","_props$onScheduleSave","onScheduleSaved","deleteSchedule","_props$onScheduleDele","onScheduleDeleted","mainHeader","_addToSchedule","locResult","_locResult$data","toPassenger","autoFilledPersons","_submit","_locResult$data2","cgoNode","componentState","NotesForPilotRendererModule","hasNotes","unassignedNotes","Phase2MainHeader","Phase2SchedulerPage","provider","queryErrorAlert","pageContent","wrapperClassName","ListScheduleHistory","GetClientDateRange","ScheduleHistoryList","paxOutboundCount","paxInboundCount","paxTransferCount","Phase1HistoryPage","routeHistory","prevMonth","nextMonth","usePhase1HistoryState","datePicker","borderTopRightRadius","borderBottomRightRadius","borderTopLeftRadius","borderBottomLeftRadius","Phase1HistoryEditorMainHeader","_api$groupData","ViewButton","ScheduleEditor","showFormInToolbar","toolbar","showViewButton","showEditButton","toolbarExtra","ScheduleEditorTable","addVisibleLegs","scheduledEntities","depDestFromString","useScheduleEditorApi","_props$saveInfo","_props$saveInfo2","_props$refetch","_props$onFinish","onFinish","GetScheduleHistory","DefaultForm","cloneScheduleOpen","initCloneScheduleForm","cloneScheduleForm","formValuesToFields","resetForm","usePhase1HistoryEditorApi","routeParamsEncoded","routeParams","decodeURIComponent","cloneScheduleFormRef","cloneScheduleMutation","cloneScheduleMutationResult","editorApi","cloneSchedule","_state$cloneScheduleF","initiate","_cloneScheduleFormRef","common","_pax$personID","processEntity","isCloning","CloneForm_Internal","CloneForm","CloneFormDrawer","_useCheckExistingSche","_api$cloneSchedule$fo","exists","useCheckExistingSchedule","validateStatus","Phase1HistoryEditorPage","Phase2SchedulerWrapper","getGroupDataWithOrg","Phase2Scheduler","Phase1Routes","Phase2Routes","_props$match$params","onToScheduledFlights","_props$match$params2","SchedulingRoutes","PaxSchedulerWrapper","PaxCgoScheduler","renderSetsEditor","_ref2$match","SetsEditorContainer","phase2SchedulingRoutesLegacy","depID","destID","SchedulingV2Routes","ScheduledFlightsList","FlightScheduleEdit","MainScheduling","getFieldKey","getFieldLabel","DefaultGlobalState","reportDateRange","scheduling","phase1Step","scheduledFlights","visibleColumns","QUERY_CACHE","_useCachedDateRange","defaultStartDate","defaultEndDate","cleanDateRange","useCachedDateRange","dateRangeFormValue","isMounted","generateReportName","generatedReportDateTimeFormat","getActiveOrgName","formattedFields","fieldFormatter","getFormattedFields","renderFormItems","ReportFormSubmitter","renderReport","_this$props$onComplet","_this$props$onError","SubmitReport","run_report","ReportList","currentTime","updateCurrentTime","reports","renderEmpty","_this$props$showWarni","showWarningAtRunTime","groupedReports","calendar","sameDay","lastDay","lastWeek","sameElse","day","repList","report","isRunning","getStatus","startMoment","startTs","runTime","endTs","borderLeft","total_docs","_Empty","ReportListWithData","ReportListQuery","DATERANGE","CUSTOMERS","TRANSPORTERS","NAME","EMPLOYERS","DEPARTURES","DESTINATIONs","STATUS","formatFields","_fields$dateRange","startDay","endDay","PaxForm","fieldProps","currentCustomer","currentTransporter","deleted","CgoForm","DESIG","ManifestForm","TRANSITTYPE","ISNForm","CovidForm","CovidVaccineForm","FIRSTNAME","LASTNAME","FIRST_NAME","LAST_NAME","PersonHotFuelForm","PaxIsnEventsForm","currentEmployer","getReportForm","PersonCovidVaccineForm","getFieldFormmatter","ff1","ff2","ff3","ff4","ff5","ff6","ff7","ff8","ff9","DetailHeader","enableExport","ErrorMessage","detailMessage","ReportDetails","setActiveTab","_data$result","renderSummary","_this$props$enableExp","renderDetail","renderExport","runTimeErrorMessage","runTimeErrorDescription","_this$props$showError","showErrorAtRunTime","ReportDetailsWithData","ReportQuery","S3ReportQuery","encoding","reportencoding","mergedReport","s3Data","s3Loading","s3Error","s3Report","PaxSummary","finalize_count","pax_finalized","not_finalized_count","pax_not_finalized","paxc","pax_count","_Statistic","suffix","CgoSummary","cgo_finalized","cgo_not_finalized","cgoc","cgo_count","ManifestSummary","fc","flight_count","tpax","total_pax","tcgo","total_cgo","ISNSummary","getPercentage","pax_no_isn","statusChartData","angle","legenditems","RadialChart","innerRadius","colorType","radius","padAngle","DiscreteColorLegend","alignContent","valueStyle","CovidSummary","PaxCovidVaxSummary","_data$is_vaccinated","_data$is_not_vaccinat","_data$essential_pax","vax_count","is_vaccinated","no_vax_count","is_not_vaccinated","ess","essential_pax","PaxCovidVaxDetailedSummary","_data$essential_perso","perc","personnel_count","is_vax_count","essential_personnel","PersonHotFuel","person_count","PaxIsnEventsSummary","override_count","non_green_count","overall_count","summary_data","PersonHotFuelSummary","useSortableData","sortBy","defaultSortDir","sortDir","setSortDir","sortKey","setSortKey","dir","sortDirFactor","returnOptions","toggleSortDir","currentSortKey","currentSortDir","SortableColumnHeaderCell","currentSortedKey","onSort","keyIsSelected","isActive","headerTextStyle","headerContent","NonComplyBypassCategory","NonComplyBypassCategoryHuman","PaxDetail","_useSortableData","_row$currentCarrier","_row$currentCarrier$a","_row$currentCarrier2","_row$currentCarrier2$","getVal","currentCarrierName","finalizationReasonType","aircraftTailNum","aircraftModel","_useSortableData2","_useSortableData2$","_momentOrNull","_data$i","_data$i2","CgoDetail","CarriableCount","onClicked","ManifestDetail","selFlight","setSelFlight","carriableType","setCarriableType","haslegs","firstleg","setSelectedFlight","getSelectedFlight","YesNo","renderExportButtons","setRowHeights","onManifestExportClick","selectedFlight","renderChildGrids","onRowHeightChanged","getIsnSelectedResult","isnResult","getIsnStatus","brdIsn","getISNRestriction","getOverrideUser","overriddenBy","modifiedBy","ISNDetail","hasTrainingDeficiencies","hasReasonsForNonCompliance","hasISNOverrideNotes","hasIsnOverriderReason","_getIsnSelectedResult","_getIsnSelectedResult2","trainingDeficiencies","isnRestriction","overrideNotes","_Tag","CovidDetail","CovidVaccineDetail","true","false","CovidVaccineDetailedDetail","PersonHotFuelDetail","PaxIsnEventsDetail","renderDetailByType","ReportingInterface","selectedReport","getSelectedReport","setSelectedReport","onSelectedReportChange","selectedReportName","ReportForm","ChartItem","_this$props$showHint","showHint","green","red","yellow","onValueMouseOver","onSeriesMouseOut","subLabel","Hint","ISNChartSelector","_Component2","getSelected","setSelected","getLegend","legend","firstContent","includeTotal","Grid","FilterSelect","filterData","dataLabel","choices","FilterSelectSearch","Dashboard","filter_result","filter_visible","include_total","dateRangeState","onRangeChange","clearFilter","new_filter","getFilter","toggleFilterVisibility","value_delimiter","group_by","force_capitalization_type","default_group_if_null","onCalendarChange","afterMonth","beforeMonth","onOpenChange","dashboard","AdminSubMenu","mcItems","onlyCustomer","onlyTransporter","navItems","flytwatchItems","evalPathsFirst","rootPath","reportItems","mdItems","managementItems","adminItems","renderMenuItems","authorized","allMenuItemsPaths","findIfPathMatches","splitPath","splitPathname","itemPathElement","matchingPath","subItem","SEARCH_EMPLOYERS","SearchPrompt","EmployerResults","onSelectedChange","clearSelected","searchEmployers","isFetchingMore","EmployerResultsWithData","NonPreferredEmployerSearch","GetNonPreferredQuery","SetNonPreferredMutation","Employer","employersToAdd","addingEmployers","removingEmployers","addOrgs","npfEmployerSearchRef","getNonPreferredList","organizationIds","setNonPreferred","removeOrgs","_this$props$orgData2","setNonPreferredList","graphQLErrors","errorType","Person","addingPersons","selectedPersons","addPersons","npfSearchRef","prevPersonIds","personIds","_this$props2$orgData","NonPreferredPersonSearch","NonPreferred","useDefault","defaultWl","ownProps","_props$onFormFieldsCh","onFormFieldsChange","_props$initialData2","bypass","cat","nonComplyCategory","expiresOn","_props$initialData","findBypass","nonComplyBypass","_findBypass","_findBypass2","lastItem","firstItem","checkboxText","isEnabled","WhitelistBypassFormUtils","parseFormValues","newBypassMapping","_key$split","_key$split2","categoryStr","putBypassField","nonComplyList","WhitelistBypassForm","WhiteListNonComplyBypassFragment","WhiteListFragment","QueryGetWhiteList","ConditionCount","nonComplyBypasses","currentDate","_props$onEdit","onEdit","isBypassExpired","exp","hasExpired","_momentOrNull2","_bypass$cognitoUser","_bypass$cognitoUser2","_momentOrNull3","expiredBadge","givenName","familyName","timestamp","_props$onEdit2","textType","_props$onEdit3","SET_PERSON_ON_WHITE_LIST","addPersonStep","enableWhiteListBypass","whiteListBypassFormFields","editBypassesModal","executing","searchBarValue","filterOnlyConditions","filterOnlyExpired","removingPersons","getPersonNonComplyBypasses","whiteList","getWhiteList","_personToBypassList$f","personToBypassList","handleAddPersons","bypassFields","modifyList","setPersonOnWhiteList","whitelistBypassFormLeftPanel","bypasses","handleEditConditions","whitelistBypassFormRightPanel","keyName","modifyingPersonID","newPersonList","deleteList","setWhiteList","renderSearchCol","headStyle","borderBottom","formLayout","_this$whitelistBypass","bypassNames","expirations","filteredPersonsToAdd","getFilteredData","hasMatch","_person$employerID","doesPersonHaveCondition","isPersonExpired","now","_this$props$data2$get","_this$props$data3$get","EmployerSearch","WHITE_LIST","SET_WHITE_LIST","SEARCH_LOCATIONS","LocationResults","searchLocations","LocationResultsWithData","LocationSearch","searchPrompt","withLoading","loadingProps","withError","renderedError","errorProps","LocationSearchPrompt","Location","locationSearchOpen","locationFilter","locationsToAdd","selectedEmployers","addingLocations","openLocationSearch","closeLocationSearch","addEmployers","locationToEmployer","getSelectedLocation","employerIDs","emp","lte","removeEmployers","addLocations","_this$props$orgData3","oldLocItems","locItems","removeLocation","_this$props$orgData4","currentLocationID","newLocItems","onEmployerChecked","renderLocationContent","employerList","filteredLocations","textStyle","prevLocation","currentLocation","hasLocations","WhiteList","onCustomerSwitchChange","hasWhitelistAllGroup","customerWhitelisted","wlAllSwitch","renderTab","siderStyle","borderStyle","borderWidth","HeaderRowLayout","ReportLayout","toggleSider","siderHidden","renderSiderContent","ReportLoading","ReportNoData","ReportError","CustomerFormItem","customerList","DateRangeFormItem","initialize","daterange","_this$props2$includeR","includeReset","GenerateReportFormItem","resetReport","EmployerFormItem","ReportResult","_ref13$header","sortedBy","BaseReport","_React$Component4","getInitialState","initializeDateRange","reportQuery","_yield$_this4$props$c","_this4$state$report","_this4$props","_this4$props$formQuer","formQuery","generateReport","IsnNullAndOverride","withCustomer","nulls","overs","nullColor","overColor","chartData","stroke","labelsRadiusMultiplier","labelsStyle","IsnCardStatus","getIsnCredential","noIsnCard","hasIsnCard","CREDS","FORM_QUERY","REPORT_QUERY","ISNTable","filteredData","filterNull","cust","lastIsn","ISNReport","cgoname","_yield$_this$props$cl","getOrganization","reportIsn","_report$variables","getEmployersWithNoIsnCard","PaxEmployerList","deDupeSort","csv","TypeError","print","withUserPermissions","RenderComponent","requiredGroups","_options$renderCompon","renderComponentProps","_React$PureComponent","UserPermissions","currentSession","session","idToken","PureComponent","PASSENGERS","SET_NO_FLY","TsaCheck","getTSAPassengers","setNoFly","setPassengerNoFlyCheck","handleDateChange","FlytWatch","lazy","FlytWatchHistory","FlytWatchHistoryEditor","FlytWatchHistoricalReportingPage","getReport","renderReportInterface","_ref$match$params","renderReportDetails","_ref2$match$params","renderReportSummary","renderReportDetail","renderReportExport","renderFlightEditor","newID","renderPassengerCheckIn","qsParams","goBackTo","FlightsRoutes","LiveFlights","Suspense","fallback","detailsDrawerProps","dataId","onAircraftChosen","airID","historySearchUrl","getFlightEditorHref","onFormSubmit","FWHistoryEditorContextProvider","onApproved","onDiscard","showBackButton","useExternalEditorContext","onPreview","renderPrompt","valuesChanged","isApproved","Prompt","when","onReturnToEditor","newParams","pushHistory","RequireUserGroup","LiveCargo","requireUserGroup","MDAircraft","MDContract","MDCustomer","MDPilot","FlightsNav","AboutApp","packageJson","showHeader","isLocalhost","hostname","register","navigator","process","swUrl","response","headers","serviceWorker","registration","unregister","registerValidSW","checkValidServiceWorker","onupdatefound","installingWorker","installing","onstatechange","controller","ServiceWorkerContext","ServiceWorkerConsumer","ServiceWorkerProvider","sw","setSW","registerServiceWorker","newSW","updateAvailable","postMessage","FeedbackButton","setModalOpen","editingKey","onEditingKeyChange","setEditingKey","setIsCancelled","validationStarted","_props$onSave","txt","renderedElementRefPropName","isText","formRules","_data$organization","getAttr","attrKey","updateUserAttr","Hub","EditablePrefTable","convertPN","handleEscPress","ChangePassword","submitted","hasFailed","hasSucceeded","changePassword","oldPassword","EmailVerifyFormWrapped","verifyCurrentUserAttribute","VerifyEmailAlert","useWindowSize","innerHeight","setSize","onWindowSizeChange","NavContext","navReducer","UserPreferencesModal","windowSize","tabPosition","AccountAttributes","UserPreferencesWrapper","userprefs","withUserPreferences","useS3Config","S3Config","setS3Config","getConfig","maintenance","announcement","useInterval","_S3Config$maintenance","signOut","_useContext2","_useContext3","themeLoading","userMenuVisible","setUserMenuVisible","showAboutModal","setShowAboutModal","showFeedbackModal","setShowFeedbackModal","dropdownOverlay","MenuItem","maintenanceAnnouncement","hideMenuCollapse","Default","TransporterSelector","fontStyle","Pob","RIGS","RigsWithData","PobNav","PobViewer","setPictureVisible","renderPersonalInfo","formStyle","infoStyle","employeeNumber","renderPobInfo","lifeBoatNumber","renderCred","renderEmergencyContact","renderWorkHistory","workHistory","shiftTimes","PobViewerWithData","pobID","PobQuery","getPobNode","RigDetail","viewPobModal","setPobModal","getPobNodesOnRig","getPaxNodesToRig","getPaxNodesLeavingRig","outboundPob","inboundPax","onboardPob","onboardLen","inboundLen","outboundLen","onboard","renderCargo","getDocksCargoOnRig","getCargoToRig","getCargoLeavingRig","outboundCgo","inboundCgo","onboardCgo","RIG","RigDetailWithData","rigid","PobMain","NotApproved","App","renderMain","FlightsMain","themeContext","setThemingEnabled","GlobalNavbar","AppLoading","subMessage","GlobalFilterInitializer","isFinished","orgChanged","currOrg","currOrgID","prevOrg","prevOrgID","prevOrgData","setPaxSetsOwnerFilter","setScheduledPaxOwnerFilter","setScheduledPaxDateRangeFilter","setScheduledFlightsDateRangeFilter","setGlobalFilter","newGlobalFilter","getGlobalFilter","resetGlobalFilter","_cache$readQuery","_tableSettings","_cognitoUser","_s3Report","fileext","contentBuf","GetObjectCommand","readableStreamToBuffer","atob","getCacheKey","_userGroups","_dashboard","respData","method","jwtToken","Message","contractsResolv","organizationResolv","SchedulingResolvers","_data$scheduling","Resolvers","merge","appResolv","transporterResolv","customerResolv","authResolv","dashboardResolv","TypeDefs","InMemoryCache","dataIdFromObject","cacheRedirects","errorLink","networkError","operation","forward","_loop","Observable","oldHeaders","subscriber","getContext","setContext","bind","complete","subscribe","_ret","authLink","request","Authorization","persistCache","storage","resolvers","typeDefs","ApolloLink","RetryLink","DebounceLink","HttpLink","uri","defaults","onResetStore","withApolloProvider","ApolloProvider","enableMapSet","ORG_QUERY","FINISH_APP_LOADING","NoContracts","AppInitializer","initializing","notAuthorized","currentOrganization","attempts","loadingMessage","feedbackOpen","retry","resetAttempts","attemptAutomaticRetry","canRetry","finishAppLoading","getMaxRetryCount","maxRetries","orgId","_yield$client$query","unauthorizedError","allContracts","_yield$client$query2","_yield$client$query3","_yield$client$query4","currentTp","userSettingsQueryRes","settingsJson","_userSettingsQueryRes","_userSettingsQueryRes2","_settingsJson","_settingsJson$general","selectedTp","savedTpIndex","queryString","isWindow","logout","themeProviderProps","enableThemingOnMount","popoutActive","ThemeProvider","AuthProvider","OrgDataProvider","PersistenceProvider","DragDropContext","HTML5Backend","Maintenance","Main","BrowserRouter","Amplify","configure","BackspaceDisabler","disable","root","ReactDOM","GET_CONTRACTS","renderExpiry","spanStyle","spanStyle2","_data$contracts","_data$contracts2","_data$contracts2$docs","showInactive","filterByDate","showExpired","modifyQueryFilter","renderName","noContracts","getContracts","extraOptionsBefore","showChooseContractOption","renderDefaultOption","_contract$locationID","_contract$locationID2","_contract$customerID","showLocation","_contract$locationID3","_contract$locationID4","renderOption","array","deDupeFunc","sortFunc","aFuncVal","bFuncVal","simpleSort","funcVal","deDupe","def","paxSourceData","cgoSourceData","_ref$paxWeight","_ref2$bagWeight","_ref3$bagCount","_ref4$weight","getID","pathIndex","departureIdx","getDepartureObj","destinationIdx","getDestinationObj","nextLoc","_ref5$paxWeight","_ref6$bagWeight","_ref7$bagCount","_ref8$weight","scheduledOrders","so","renderLabel","dataEntries","newFormFields","_dataEntries$i","getDisplayName","WrappedComponent","strings","clsArray","arg","objCopy","_pax$currentCarrierID2","getMinuteDuration","sMin","floor","unix","getMinuteDurationAsHrMin","minDur","abs","getDurationHoursMinutes","formatFn","asMinutes","dateToZulu","customOffset","mom","utcOffset","getDateMidnightZulu","dateMtimeMtoZuluStr","nullIfPartial","detectInvalidDate","valueIfInvalid","getMomentIntervalsWithOverlaps","intervals","overlaps","capitalize","lowercaseRest","regexException","firstLetter","newStr","write","tmp","reportDocument","c_item","getDegAngleFromPoints","x1","y1","x2","y2","atan2","PI","nodeRefs","nodeId","nodeRef","displayText","domNode","ReactDom","findDOMNode","textContent","clonedNode","DARK_THEME_STORAGE_KEY","ENABLE_THEME_STORAGE_KEY","applied","themingEnabled","getThemeVars","dark","darkVars","lightVars","isDarkFromName","_props$enableThemingO","themeVars","setThemeVars","darkApplied","setDarkApplied","themeApplied","setThemeApplied","setThemeLoading","parseDarkThemeStorage","listenToStorageChanges","applyTheme","useDark","themeValue","themeEnabled","parseThemingEnabledStorage","modifyVars","authReducer","user_to_verify","user_to_unverify","loadUser","bypassCache","listener","getSession","prevAttr","updateUserAttributes","customSuccessMessage","verifyCurrentUserAttributeSubmit","resetStore","GET_TRANSPORTER","GET_PILOTS","noPilots","getPilots","initValue","typogStyle","maxTextWidth","changedValue","showChanges","_props$onReset","GET_AIRCRAFTS","getAircrafts","searchFields","areablock","area","LocationQuery","deletedTs","dropdownStyle","LOCALSTORAGE_KEY","getLocalStorage","unparsed","PersistenceContext","setLastUpdate","setStorage","PersistentGroup","rev","appVersion","updateUpdateTs","dataToMerge","fromObject","groupid","setInitialized","initLocalStorage","setLocalStorage","initPersistentGroup","setPersistentGroup","isGroupOutdated","getPersistentGroup","ls","getPersistentGroupValue","setPersistentGroupValue","updatePersistentGroupValues","updateData","setPersistentGroupValues","persistentGroup","updatePersistentValues","retryCount","currToken","lastToken","uuid","updateListener","isStopped","setMaxPages","updateState","_startPaging","startingPageCount","_args","onLastPage","prevNetworkStatus","dataBeforePagination","initNetworkStatus","initialPaginationCompleted","shouldStartPagination","autoPaginatorRef","pState","startPaging","continuePagination","stopPaging","ApolloError","refetchPromise","formatDateTime","dispatchFormDataToArray","rowIdToFormData","splitK","fieldname","new","getTotalDurationHoursMinutes","momentConverter","totalMinutes","endpoint","setFetching","autoDownload","fileName","buffer","compressed","objURL","strToU8","compressSync","bytesToBase64","setAttribute","parentNode","removeChild","ColumnSelector","paxIsnEventsColumns","file_types","content_type","_ref$default_file_typ","default_file_type","_ref$export_as_zip","export_as_zip","downloadUrl","setDownloadUrl","setDesig","exportedFileType","single_column_set","mutation_name","mut","export_report","renderColumnSelector","colSet","checkedByDefault","flightDesigText","_criteria","selectedFileType","file_type","rel","_flight$customerDoc","_flight$departureDoc","_cgo$departureDoc","_cgo$destinationDoc","_pax$employerDoc","_pax$departureDoc","_pax$destinationDoc","_pax$personDoc","personDoc","extendTypeHandling","SearchSelect","searchDebounceTime","_this$props$errorMess","nfContent","_couchResult$data2","_couchResult$data2$re","setReportState","skipCouch","skipS3","couchResult","_couchResult$data","_couchResult$data$rep","s3Result","useDataAsValue","formFieldsValuesHaveChanged","oldFormFields","oldValues","convertKeyLabel","findChanged","fv","otherValue","newKeys","oldKeys","recursiveLevels","nextRecursiveLevel","labelKey","objKey","uppercased","uppercaseField","fieldValue","hasOwnProperty","validateLabelInValue","SiderSection","ReportProperty","_ref4$justCriteria","_ref4$criteriaItemSty","setCurrentTime","isTime","created","LocationMarker","isStart","useQuickReportQuery","reportCriteria","QueryQuickReport","submitEvents","enhanceElement","ReportUI_Internal","_props$autoRefreshOpt2","_props$headerExtra","_props$headerExtra2","_props$headerExtra3","_props$headerExtra4","ReportUIContext","setAutoRefreshInterval","setAutoRefreshMode","autoRefreshMode","_props$autoRefreshOpt","pendingState","setPendingState","renderedCriteriaForm","_props$autoRefreshOpt3","renderAutoRefreshMode","_props$setReportExpor","exporterProps","renderExporter","ReportUIContextProvider","wrapperPropsToProviderProps","wait","argsRef","cleanup","clearTimeout","getHeaders","_getHeaders","_refreshUser","currUser","_args7","signInUserSession","_downloadImagePreview","arrBuf","b64Str","arrayBuffer","Buffer","convertS3FileList","downloadImagePreview","urlStr","uid","lastModifiedDate","LastModified","Size","_listFiles","_callee11","_context11","listFiles","fileIdx","prevStatus","newFileList","handleFail","_onPreview","anchor","revokeObjectURL","onDownload","_onDownload","activeOrgIsOfType","getOrgNameByType","childProps","cp_props","delay","savedCallback","autoRefreshInterval","_res1$data","_res2$","res1","run_quick_report","_res1$data2","res2","called","on","ms","DEFAULT_SETTINGS","LayerDropdownControl","container","_map","_container","McMapLayerDropdown","_settings$layers$nexr","layerDropdownVisible","setLayerDropDownVisible","divContainer","setDivContainer","uSettings","useControl","div","control","dropdown","_settings$layers$id","toggleLayer","createPortal","maplibregl","workerClass","maplibreglWorker","McMap","layer","layerSetting","Layer","getLayers","getDependencies","ReactMapGL","mapStyle","customAttribution","mapLib","NavigationControl","showCompass","FullscreenControl","ScaleControl","unit","viewport","zoom","FlytWatchDetailsMap","handleMove","viewState","onMove","FWHistoryEditorContext","MUTATION_APPROVE","MUTATION_DELETE","FormValueGetters","_record$departingDoc","_record$departingDoc2","areaBlockName","_record$destinationDo","_record$destinationDo2","_record$contractDoc","_record$contractDoc2","_record$pilotDoc","coPilot","_record$coPilotDoc","coPilotDoc","remarks","FormValueGettersNewRecords","lastRecord","_lastRecord$contractD","_lastRecord$contractD2","_lastRecord$pilotDoc","_lastRecord$coPilotDo","genNewRecordId","_result$data$Dispatch","len","newR","initNewRecords","numNewEmptyRows","setNewRecords","setFormData","initFormData","setInitFormData","setApproved","newRecordsArray","lastFilledRecord","fieldValues","fieldKeys","j","_fieldValues$k","lastFilledRecordIdx","newRecordsCopy","deleteOccurred","sideValues","notAddableRecords","addableRecordsChangedFieldCount","changedNewRecords","initFormState","formStateEntries","uniqueIDs","uniqueFields","addableRecordIds","uniqueIDsArray","uniqueFieldsArray","isAddable","fieldCountMap","_formState","getChangedNewRecordIDs","notChangedNewRecords","dateStart","dateEnd","_e$path","approveMutation","approveMutationRes","deleteMutation","deleteMutationRes","hisData","DispatchHistoryFlights","hisTzAbbr","_hisData$i","dispatchDoc","getTzAbbr","_props$onApproved","tableData","_item$_r_latestRemark","_r_latestRemark","remark","buildFieldKey","dataValue","toFormData","deletedIDs","tzAbbr","deleteHistoryIDs","approve","findHis","his","changedData","_hisData$find","_hisData$find2","_item$contract","_item$dep","_item$dest","_item$pilot","_item$coPilot","departingID","coPilotID","changedHistory","approveMutationResult","AtoAtaMap","_Map","_wrapNativeSuper","validateReverseTimeRange","docID","validateTimeOverlaps","atoAtaMap","allValuesEntries","_allValuesEntries$i","put","currAtoAta","docIDToIntervalIdxMap","timeRanges","docId","_ref8$","overlappingIntervals","currentIntervalIdx","validateRow","enable","additionalValidator","FWHistoryEditorWithForm","_React$useContext","userCanEdit","userCanDelete","renderFlightDuration","resetField","_props$onFieldReset","onFieldReset","isRecordAdded","_formData","handleNewRecordFieldChange","isRecordRemoved","_formData$buildFieldK","_record$aircraftDoc","_record$departingDoc3","_record$destinationDo3","_getFieldValue2","_record$contractDoc3","_getFieldValue3","_getFieldValue4","_getFieldValue5","atoAtaList","_lastRecord$aircraftD","_getFieldValue6","_getFieldValue7","_getFieldValue8","_getFieldValue9","_getFieldValue10","FWHistoryEditor","renderWithConsumer","newFormData","zoneData","getZoneList","shorthand","FWAircraftHistory","_qData$DispatchHistor","qData","_record$dep","_record$dest","getTzNameFromDoc","aMom","bMom","_record$contract","_record$pilot","_record$coPilot","DItem","renderTime","propData","buttonBarStyle","skipQuery","queryLoading","dimensions","setDimensions","historyDrawer","mapContainerRef","getMapDimensions","mc","clientHeight","divProps","locIcons","nodes","renderLocIcons","getAcTime","getDrawerTitle","renderButtonBar","ErrorBoundary","fallbackRender","_data$departureCoordi","_data$departureCoordi3","Marker","_data$departureCoordi2","_data$destinationCoor","avgCoords","lineData","properties","geometry","coordinates","pitchAlignment","rotationAlignment","MapArrowSvg","Source","renderUnauthorized","renderMap","_data$employer","_data$employer2","_data$customer","_data$customer2","_data$transporter","AutoScroll","defaultScrollSpeed","repeat","waitMsBeforeScroll","waitMsOnReachBottom","finishCb","scrollNeededCb","computedDuration","scrollNeeded","stepping","finished","currScrollTop","computeDuration","clientRect","getBoundingClientRect","backToTop","startY","scrollTo","behavior","sleep","performance","progress","requestAnimationFrame","setScrollSpeed","getScrollSpeed","onFinishCallback","scrollNeededCallback","ETableGroup","tableGroupContainer","_groupElements","groupElement","_i2","_tables","getElementsByClassName","offsetTop","fixedTables","offsetFixedColumnsInTableGroup","EnhancedTableComp","tableProps","_this$props$totals$td","getNumColumns","isFixed","overrideFooter","renderTotalRow","_this$props$totals","renderTotalTop","renderFooter","EnhancedTableCompWrapper","ETableWrapperContext","ETableContext","EnhancedBodyComp","renderHeaderElement","renderHeader","getGroupSpacing","_this$props$totals$re","_this$props$totals2","_this$props$totals$re2","_this$props$totals3","rowItems","aVal","bVal","compareRes","child","tableBodies","groupKey","renderMasterFooter","renderGroupedBody","EnchancedBodyCompWrapper","tableChildren","EnhancedHeaderComp","_React$Component5","_React$Component6","tableWrapperBody","scrollTimeoutHandle","mouseHideTimeoutHandle","mouseInTable","isScrolling","getComponents","_this6$props$componen","_this6$props$componen2","_this6$props$componen3","_this6$props$componen4","_this6$props$componen5","_this6$props$componen6","wrapper","initAutoScroll","_this6$props$autoScro6","textOrElement","_this6$props$autoScro","_this6$props$autoScro2","_this6$props$autoScro3","elems","_this6$props$autoScro4","_this6$props$autoScro5","startAutoScroll","onBodyMouseOver","ev","_this6$props$autoScro7","_this6$props$autoScro8","stopOnMouseHover","stopAutoScroll","onBodyMouseLeave","_this6$props$autoScro9","onBodyScroll","_this6$props$autoScro10","onBodyMouseDown","_this6$props$autoScro11","onBodyMouseUp","_this6$props$autoScro12","onBodyMouseMove","_this6$autoScroll","hasAttribute","removeAttribute","addMouseEvents","removeMouseEvents","startFromTop","recomputeScrollDuration","_this$props$autoScrol","_prevProps$autoScroll","_this$props$autoScrol2","_prevProps$autoScroll2","_this$props$autoScrol3","_this$props$autoScrol4","_prevProps$autoScroll3","stickyHeaderOffset","elem","USER_GROUPS","checkGroup","unauthorizedIcon","unauthorizedTitle","unauthorizedSubTitle","WithRequireUserGroup","GroupWrapper","_ref$renderError","renderError","_ref$renderNotAuthori","Master","All","PassengerViewOnly","Flytwatch","View","History","Report","iconSvgs","xmlns","cx","cy","enableBackground","xmlnsXlink","xmlSpace","fillRule","clipRule","strokeLinecap","strokeLinejoin","strokeMiterlimit","rx","ry","strokeWidth","transformOrigin","Icon","_readableStreamToBuffer","stream","chunks","reader","moreData","_yield$reader$read","_value","getReader","read","timezones","sAbbrToName","zoneNames","zoneList","_ref4$","abbrS","abbrD","isDST","_cbArray$find","defaultTz","abbr","tzName","parseZone","getSortFunction","itemGetter","aa","bb","locDoc","keyGetter","transformElement","getter"],"mappings":"2JAMMA,EAAQC,YAAGC,MAAAC,YAAA,wCAiBFC,IAXf,WACI,IAAAC,EAA0BC,YAASN,GAA3BO,EAAIF,EAAJE,KAASC,EAAIC,YAAAJ,EAAAK,GACrB,MAAO,CACHC,YAAUJ,GAAQA,EAAKK,YAAWC,wBAAA,GAE3BL,GAAI,IACPD,Y,iLCHNO,EAAU,gBAgCDC,IA9BqC,SAACC,GAEjD,IAAI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,aACA,aACA,cACA,eAGHpW,KAAI,SAAAxN,GAAG,MAAK,CAAEjK,MAAOiK,EAAKQ,IAAKR,QAMxC,OAAQywG,GACJ,IAAK,MACD,MA3dW,CACf,CACIn4B,QAAS,UACT93E,IAAK,UACLojB,QAAS,CACL,CACI7tB,MAAO,aACPyK,IAAK,aAET,CACIzK,MAAO,YACPyK,IAAK,YAET,CACIzK,MAAO,SACPyK,IAAK,wBAET,CACIzK,MAAO,YACPyK,IAAK,kBAET,CACIzK,MAAO,cACPyK,IAAK,oBAET,CACIzK,MAAO,aACPyK,IAAK,aAET,CACIzK,MAAO,aACPyK,IAAK,aAET,CACIzK,MAAO,YACPyK,IAAK,YAET,CACIzK,MAAO,cACPyK,IAAK,oBAET,CACIzK,MAAO,WACPyK,IAAK,iBAET,CACIzK,MAAO,WACPyK,IAAK,iBAET,CACIzK,MAAO,kBACPyK,IAAK,iBAET,CACIzK,MAAO,sBACPyK,IAAK,0BAET,CACIzK,MAAO,cACPyK,IAAK,cAET,CACIzK,MAAO,WACPyK,IAAK,sCAET,CACIzK,MAAO,iBACPyK,IAAK,uCAyZjB,IAAK,MACD,MArNW,CACf,CACI83E,QAAS,UACT93E,IAAK,UACLojB,QAAS,CACL,CACI7tB,MAAO,OACPyK,IAAK,QAET,CACIzK,MAAO,SACPyK,IAAK,wBAET,CACIzK,MAAO,YACPyK,IAAK,kBAET,CACIzK,MAAO,cACPyK,IAAK,oBAET,CACIzK,MAAO,gBACPyK,IAAK,gBAET,CACIzK,MAAO,SACPyK,IAAK,UAET,CACIzK,MAAO,cACPyK,IAAK,oBAET,CACIzK,MAAO,WACPyK,IAAK,iBAET,CACIzK,MAAO,gBACPyK,IAAK,iBAET,CACIzK,MAAO,WACPyK,IAAK,YAET,CACIzK,MAAO,QACPyK,IAAK,aAET,CACIzK,MAAO,cACPyK,IAAK,cAET,CACIzK,MAAO,gBACPyK,IAAK,cAET,CACIzK,MAAO,eACPyK,IAAK,kBA2JjB,IAAK,WACD,MARU,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AAO,gBACPyK,IAAK,gBAET,CACIzK,MAAO,SACPyK,IAAK,wBAET,CACIzK,MAAO,YACPyK,IAAK,kBAET,CACIzK,MAAO,cACPyK,IAAK,oBAET,CACIzK,MAAO,aACPyK,IAAK,aAET,CACIzK,MAAO,aACPyK,IAAK,aAET,CACIzK,MAAO,YACPyK,IAAK,YAET,CACIzK,MAAO,cACPyK,IAAK,oBAET,CACIzK,MAAO,WACPyK,IAAK,iBAET,CACIzK,MAAO,WACPyK,IAAK,iBAET,CACIzK,MAAO,kBACPyK,IAAK,iBAET,CACIzK,MAAO,sBACPyK,IAAK,0BAET,CACIzK,MAAO,cACPyK,IAAK,cAET,CACIzK,MAAO,eACPyK,IAAK,kBAuVjB,IAAK,6BACD,MA/UsB,CAC1B,CACI83E,QAAS,UACT93E,IAAK,UACLojB,QAAS,CACL,CACI7tB,MAAO,aACPyK,IAAK,aAET,CACIzK,MAAO,YACPyK,IAAK,YAET,CACIzK,MAAO,MACPyK,IAAK,OAET,CACIzK,MAAO,WACPyK,IAAK,gBAET,CACIzK,MAAO,oBACPyK,IAAK,oBAET,CACIzK,MAAO,SACPyK,IAAK,UAET,CACIzK,MAAO,SACPyK,IAAK,UAET,CACIzK,MAAO,gBACPyK,IAAK,iBAET,CACIzK,MAAO,WACPyK,IAAK,YAET,CACIzK,MAAO,MACPyK,IAAK,OAET,CACIzK,MAAO,QACPyK,IAAK,SAET,CACIzK,MAAO,eACPyK,IAAK,kBA6RjB,IAAK,iBACD,MAnFc,CAClB,CACI83E,QAAS,UACT93E,IAAK,UACLojB,QAAS,CACL,CACI7tB,MAAO,YACPyK,IAAK,YAET,CACIzK,MAAO,aACPyK,IAAK,aAET,CACIzK,MAAO,WACPyK,IAAK,gBAET,CACIzK,MAAO,WACPyK,IAAK,gBAET,CACIzK,MAAO,0BACPyK,IAAK,4BA6DjB,IAAK,iBACD,OAAO0jN,EACX,QACI,OAAO,MAKK1zG,CAAcC,GAClC,OAAKH,EAGEt8G,cAACu0H,EA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zsC,GACRgN,EAAIg9E,IAAIhqF,GAAKoE,KAAKgzD,GAIlBpqD,EAAI9M,IAAIF,EAAK,CAACo3D,OAIfpqD,GA5BYA,EAwChB,SAASywI,EAAQ5sI,GACpB,QAASA,EAjPbrU,OAAOC,QAAQyqO,GACZl6N,KAAI,SAAAnV,GAAA,IAAA8E,EAAAnF,YAAAK,EAAA,GAAGqvC,EAACvqC,EAAA,GAAEkU,EAAClU,EAAA,UAAOwqO,EAAYt2N,EAAE,IAAMq2B,O","file":"static/js/main.da357c53.chunk.js","sourcesContent":["import gql from \"graphql-tag\";\r\nimport { useQuery, QueryResult } from \"react-apollo\";\r\nimport { castArray } from \"common/util\";\r\n\r\nexport type UseUserGroupsResult = [Array, QueryResult>]\r\n\r\nconst QUERY = gql`\r\n{\r\n userGroups @client\r\n}\r\n`\r\n\r\nfunction useUserGroups(): UseUserGroupsResult {\r\n const { data, ...rest } = useQuery(QUERY);\r\n return [\r\n castArray(data && data.userGroups),\r\n {\r\n ...rest,\r\n data\r\n }\r\n ]\r\n}\r\n\r\nexport default useUserGroups;","import React, { CSSProperties } from 'react';\r\nimport './NonIdealState.less';\r\nimport { Icon } from 'antd';\r\nimport cn from 'classnames';\r\nimport { IconProps } from 'antd/lib/icon';\r\n\r\nexport interface NonIdealStateProps {\r\n icon?: string | JSX.Element,\r\n iconProps?: Omit,\r\n type?: 'primary',\r\n title: string | JSX.Element,\r\n description?: string | JSX.Element,\r\n style?: CSSProperties\r\n}\r\n\r\nconst BASE_CN = \"nonidealstate\"\r\n\r\nconst NonIdealState: React.FC = (props) => {\r\n\r\n let typeCNIcon = undefined;\r\n\r\n if (props.type){\r\n typeCNIcon = BASE_CN + '-icon-' + props.type;\r\n }\r\n\r\n const renderIcon = (icon: string | JSX.Element) => {\r\n if (typeof icon === 'string'){\r\n return \r\n }\r\n if (React.isValidElement(icon)){\r\n let iconProps: any = icon.props;\r\n let exisClassName = iconProps.className;\r\n return React.cloneElement(icon, { className: cn(exisClassName, BASE_CN + \"-icon\", typeCNIcon) })\r\n }\r\n }\r\n\r\n return
\r\n
\r\n {props.icon ? renderIcon(props.icon) : null}\r\n

{props.title}

\r\n {props.description ? (\r\n
{props.description}
\r\n ) : null}\r\n
\r\n
\r\n}\r\n\r\nexport default NonIdealState","// import { AUTH_TYPE } from \"aws-appsync/lib/link/auth-link\";\r\nimport { LayerProps } from 'react-map-gl';\r\n\r\nconst AUTH = {\r\n IDENTITY_POOL_ID: 'us-east-1:7e643d76-8027-4747-b34a-365de2b204d7',\r\n REGION: 'us-east-1',\r\n USER_POOL_ID: 'us-east-1_gW9HU38wx',\r\n USER_POOL_WEB_CLIENT_ID: '7ukil613rp4vm81gsnvvgpqaeo'\r\n}\r\n\r\n/**\r\n * @type { style: any, availableLayers: LayerProps[] }\r\n */\r\nlet REACT_MAP_GL_CONFIG = {\r\n style: {\r\n version: 8,\r\n sources: {\r\n 'raster-tiles': {\r\n type: 'raster',\r\n tiles: [\r\n \"https://a.tile.openstreetmap.org/{z}/{x}/{y}.png\",\r\n \"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png\",\r\n \"https://c.tile.openstreetmap.org/{z}/{x}/{y}.png\"\r\n ],\r\n tileSize: 256\r\n },\r\n 'nexrad': {\r\n type: 'raster',\r\n tiles: [\r\n \"https://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?&REQUEST=GetMap&TRANSPARENT=true&FORMAT=image/png&BGCOLOR=0x000000&VERSION=1.1.1&LAYERS=nexrad-n0r&STYLES=default&CRS=EPSG:3857&SRS=EPSG:3857&WIDTH=256&HEIGHT=256&BBOX={bbox-epsg-3857}\"\r\n ],\r\n tileSize: 256\r\n }\r\n },\r\n layers: [\r\n {\r\n id: \"osm-tiles\",\r\n type: \"raster\",\r\n source: \"raster-tiles\",\r\n minzoom: 0,\r\n maxzoom: 19,\r\n permanent: true,\r\n paint: {}\r\n }\r\n ]\r\n },\r\n availableLayers: [\r\n {\r\n id: 'nexrad',\r\n beforeId: 'dummylayer',\r\n label: 'NEXRAD Reflectivity',\r\n type: 'raster',\r\n source: 'nexrad',\r\n minzoom: 0,\r\n maxzoom: 19,\r\n paint: {}\r\n }\r\n ]\r\n}\r\n\r\n/* NOTE ABOUT DUMMYLAYERS\r\n To get around the limitations of sorting layers in maplibre-gl, I insert a dummy layer to ensure that layers that come after\r\n it are placed IN FRONT of the dummy layer. Any layer that has a `beforeId: 'dummylayer'` property will be placed BEHIND the dummylayer.\r\n This ensures that layers like nexrad will appear behind anything in front of the dummylayer.\r\n\r\n Example: ------------------------------------------------------------------------\r\n \r\n null} />\r\n \r\n \r\n \r\n \r\n ---------------------------------------------------------------------------------\r\n\r\n The layer \"flightPathLayer\" will always appear in front of the dummy layer, and the nexrad layer (used in mapStyle) will appear behind\r\n*/\r\n\r\nconst dev = {\r\n dashboardAPI: \"https://8djmldiheg.execute-api.us-east-1.amazonaws.com/dev\",\r\n pythonBackendApi: \"https://ssg3m7m4k6.execute-api.us-east-1.amazonaws.com/dev\",\r\n reduxDebug: true,\r\n appSync: {\r\n // url: 'https://7ufow67xpbf3rg37smjpect7um.appsync-api.us-east-1.amazonaws.com/graphql',\r\n url: 'https://qkpgl2wvzvgjbpvic6vfdqc3be.appsync-api.us-east-1.amazonaws.com/graphql',\r\n region: AUTH.REGION,\r\n auth: {\r\n type: \"AMAZON_COGNITO_USER_POOLS\" /*AUTH_TYPE.AMAZON_COGNITO_USER_POOLS*/\r\n // Above commented out because the whole aws-appsync library is being included for just this one enum?\r\n // Hell naw, just use the string literal. Total waste of space.\r\n }\r\n },\r\n reactmapgl: REACT_MAP_GL_CONFIG,\r\n blockInfo: {\r\n url: 'https://www.blockinfo.com/'\r\n },\r\n reportS3Bucket: 'dataflyt-report-dev',\r\n userContentS3Bucket: 'usercontent.dataflyt.net',\r\n configS3Bucket: 'manifestcentral-config',\r\n configKey: 'public.config.dev.json',\r\n manifestPrintoutEndpoint: 'https://47enjocsvf.execute-api.us-east-1.amazonaws.com/api',\r\n dfS3WebImages: 'https://s3.amazonaws.com/df-web-img/'\r\n}\r\n\r\nconst qas = {\r\n dashboardAPI: \"https://95c9pweag9.execute-api.us-east-1.amazonaws.com/beta\",\r\n pythonBackendApi: \"https://ip1dgeshxj.execute-api.us-east-1.amazonaws.com/qas\",\r\n reduxDebug: true,\r\n appSync: {\r\n url: 'https://evgehb3pmvd4lm2wjp3ec5weam.appsync-api.us-east-1.amazonaws.com/graphql',\r\n region: AUTH.REGION,\r\n auth: {\r\n type: \"AMAZON_COGNITO_USER_POOLS\"\r\n }\r\n },\r\n reactmapgl: REACT_MAP_GL_CONFIG,\r\n blockInfo: {\r\n url: 'https://www.blockinfo.com/'\r\n },\r\n reportS3Bucket: 'dataflyt-report-dev',\r\n userContentS3Bucket: 'usercontent.dataflyt.net',\r\n configS3Bucket: 'manifestcentral-config',\r\n configKey: 'public.config.beta.json',\r\n manifestPrintoutEndpoint: 'https://dh4m0aztuf.execute-api.us-east-1.amazonaws.com/api',\r\n dfS3WebImages: 'https://s3.amazonaws.com/df-web-img/'\r\n}\r\n\r\nconst prd = {\r\n dashboardAPI: \"https://i0xxqx3n2b.execute-api.us-east-1.amazonaws.com/prd\",\r\n pythonBackendApi: \"https://oqdo5gybx5.execute-api.us-east-1.amazonaws.com/prd\",\r\n reduxDebug: true,\r\n appSync: {\r\n url: 'https://vsmoskpulvbova532hd5k5edfi.appsync-api.us-east-1.amazonaws.com/graphql',\r\n region: AUTH.REGION,\r\n auth: {\r\n type: \"AMAZON_COGNITO_USER_POOLS\"\r\n }\r\n },\r\n reactmapgl: REACT_MAP_GL_CONFIG,\r\n blockInfo: {\r\n url: 'https://www.blockinfo.com/'\r\n },\r\n reportS3Bucket: 'dataflyt-report',\r\n userContentS3Bucket: 'usercontent.dataflyt.net',\r\n configS3Bucket: 'manifestcentral-config',\r\n configKey: 'public.config.prd.json',\r\n manifestPrintoutEndpoint: 'https://rz47darr9a.execute-api.us-east-1.amazonaws.com/api',\r\n dfS3WebImages: 'https://s3.amazonaws.com/df-web-img/'\r\n}\r\n\r\nvar config = dev;\r\nif (process.env.REACT_APP_STAGE === 'prd')\r\n{\r\n config = prd;\r\n}else if (process.env.REACT_APP_STAGE === 'qas'){\r\n config = qas;\r\n}else if (process.env.REACT_APP_STAGE === 'dev'){\r\n config = dev\r\n}else{\r\n throw Error(\"REACT_APP_STAGE has not been set to production, qas, or dev\")\r\n}\r\n\r\n// const config = process.env.REACT_APP_STAGE === 'production' ? prod : dev;\r\n\r\n// export default {\r\n// awsExports: {\r\n// identityPoolId: 'us-east-1:7e643d76-8027-4747-b34a-365de2b204d7', // REQUIRED - Amazon Cognito Identity Pool ID\r\n// region: 'us-east-1', // REQUIRED - Amazon Cognito Region\r\n// userPoolId: 'us-east-1_gW9HU38wx', // OPTIONAL - Amazon Cognito User Pool ID\r\n// userPoolWebClientId: '7ukil613rp4vm81gsnvvgpqaeo', // OPTIONAL - Amazon Cognito Web Client ID\r\n// },\r\n// ...config\r\n// }\r\n\r\n// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default {\r\n defaultTheme: 'dark',\r\n amplify: {\r\n Auth: {\r\n identityPoolId: AUTH.IDENTITY_POOL_ID,\r\n region: AUTH.REGION,\r\n userPoolId: AUTH.USER_POOL_ID,\r\n userPoolWebClientId: AUTH.USER_POOL_WEB_CLIENT_ID\r\n },\r\n },\r\n ...config\r\n}","import { Dispatch, SetStateAction, useState } from 'react';\r\n\r\nexport default function useControlledState(initialState: S, controlState?: S, onSetState?: (value: S) => void, allowSetStateWhileControlled: boolean=false): [S, Dispatch>]{\r\n const [ state, setState ] = useState(initialState);\r\n // useEffect(() => {\r\n // if (controlState !== undefined){\r\n // setState(controlState);\r\n // }\r\n // }, [controlState])\r\n return [\r\n controlState !== undefined ? controlState : state,\r\n (value: S) => {\r\n if (onSetState){\r\n onSetState(value);\r\n }\r\n else if (controlState === undefined || allowSetStateWhileControlled){\r\n setState(value);\r\n }\r\n }\r\n ]\r\n}","import React from 'react';\r\nimport { HTMLAttributes } from 'react';\r\nimport { Icon, Spin } from 'antd';\r\nimport cn from 'classnames';\r\nimport './style.less';\r\n\r\nexport interface CenteredLoadingScreenProps extends HTMLAttributes {\r\n message?: React.ReactNode,\r\n icon?: React.ReactNode\r\n}\r\n\r\nconst CenteredLoadingScreen: React.FC = ({\r\n message,\r\n icon=} />,\r\n className,\r\n ...restProps\r\n}) => {\r\n return
\r\n
\r\n {icon}\r\n {message ? {message} : null}\r\n
\r\n
\r\n}\r\n\r\nexport default CenteredLoadingScreen;","import gql from 'graphql-tag';\r\nimport React, { PropsWithChildren, useEffect, useReducer, useRef, useState } from 'react';\r\nimport { useApolloClient, useMutation, useQuery } from 'react-apollo';\r\nimport { debounce } from 'lodash';\r\nimport { useDebouncedCallback } from 'hooks/useDebouncedCallback';\r\nimport { NetworkStatus } from 'apollo-client';\r\n\r\nconst APP_NAME = 'manifestcentral';\r\n\r\nexport interface IGlobalAppState {\r\n sidebarCollapsed: boolean,\r\n flytwatchCollapsedColumns: string[]\r\n}\r\n\r\nexport interface McMapLayerConfig {\r\n enabled: boolean,\r\n\r\n // Just in case we need more configurability other than enabling/disabling\r\n config?: any\r\n}\r\n\r\nexport interface McMapSettings {\r\n layers: {\r\n [id: string]: McMapLayerConfig\r\n }\r\n}\r\n\r\nexport interface IGlobalAppStateContext {\r\n state: IGlobalAppState,\r\n setState: (state: Partial) => void,\r\n getUserSettings: (featureName: string, defaultValue?: T) => T,\r\n userContracts?: any[],\r\n setUserSettings: (featureName, value: any) => void,\r\n toggleSidebarCollapse: () => void,\r\n setTableColumnVisibility: (tableID: string, columnName: string, show: boolean) => void,\r\n getTableSettings: (tableName: string) => TableSettingsItem,\r\n collapseFlytwatchColumn: (colName: string) => void\r\n unCollapseFlytwatchColumn: (colName: string) => void\r\n}\r\n\r\nexport const GlobalAppStateContext = React.createContext(null);\r\n\r\nexport const INIT_USER_SETTINGS = {\r\n appName: 'manifestcentral',\r\n settings: {\r\n generalSettings: {\r\n savedTpId: null\r\n },\r\n tableSettings: [\r\n {\r\n name: 'livePassengers',\r\n settings: {\r\n hiddenColumns: []\r\n }\r\n },\r\n {\r\n name: 'liveFlights',\r\n settings: {\r\n hiddenColumns: []\r\n }\r\n },\r\n {\r\n name: 'liveCargo',\r\n settings: {\r\n hiddenColumns: []\r\n }\r\n }\r\n ],\r\n mcMap: {\r\n layers: {\r\n 'nexrad': {\r\n enabled: true\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nconst INIT_STATE: IGlobalAppState = {\r\n sidebarCollapsed: false,\r\n flytwatchCollapsedColumns: []\r\n}\r\n\r\nconst TYPES = {\r\n UPDATE_STATE: 'UPDATE_STATE',\r\n TOGGLE_SIDEBAR_COLLAPSE: 'TOGGLE_SIDEBAR_COLLAPSE'\r\n}\r\n\r\nfunction reducer (state: IGlobalAppState, action: any): IGlobalAppState {\r\n switch (action.type) {\r\n\r\n case TYPES.UPDATE_STATE:\r\n return { ...state, ...action.payload }\r\n case TYPES.TOGGLE_SIDEBAR_COLLAPSE:\r\n return { ...state, sidebarCollapsed: typeof state.sidebarCollapsed === 'boolean' ? !state.sidebarCollapsed : true }\r\n default:\r\n return state\r\n }\r\n}\r\n\r\nlet UserSettingsQuery = gql`\r\nquery GetRemoteUserSettings {\r\n GetRemoteUserSettings {\r\n contractDocs {\r\n _id\r\n name\r\n customerID {\r\n _id\r\n name\r\n }\r\n tpID {\r\n _id\r\n name\r\n }\r\n }\r\n }\r\n GetRemoteUserAppSettings(appName: \"manifestcentral\"){\r\n appName\r\n settings\r\n }\r\n}\r\n`\r\n\r\nlet SetUserSettingsMutation = gql`\r\nmutation SetRemoteUserSettings($settings: AWSJSON!) {\r\n SetRemoteUserAppSettings(appName: \"manifestcentral\", settings: $settings){\r\n appName\r\n settings\r\n }\r\n}\r\n`\r\n\r\nexport interface TableSettings {\r\n hiddenColumns: string[]\r\n}\r\n\r\nexport interface TableSettingsItem {\r\n name: string,\r\n settings: TableSettings\r\n}\r\n\r\n\r\nexport const GlobalAppStateProvider: React.FC> = (props) => {\r\n const [ state, dispatch ] = useReducer(reducer, INIT_STATE);\r\n const [ userSettingsState, setUserSettingsState ] = useState(INIT_USER_SETTINGS);\r\n const client = useApolloClient();\r\n\r\n useEffect(() => {\r\n if (window.innerWidth <= 1048 && !state.sidebarCollapsed){\r\n console.log('Small window detected. Collapsing sidebar.');\r\n dispatch({ type: TYPES.UPDATE_STATE, payload: { sidebarCollapsed: true } });\r\n }\r\n // eslint-disable-next-line\r\n }, [])\r\n\r\n let { data, networkStatus } = useQuery(UserSettingsQuery, {\r\n fetchPolicy: 'cache-and-network',\r\n errorPolicy: 'ignore',\r\n // pollInterval: 300000 // TODO: This causes child components to rerender and forget state for some reason.\r\n // Specifically causes the FlightTimesHeader component to forget its date range and stuff.\r\n }); \r\n\r\n useEffect(() => {\r\n if (networkStatus !== NetworkStatus.loading){\r\n let settingsJson;\r\n try {\r\n settingsJson = JSON.parse(data?.GetRemoteUserAppSettings?.settings);\r\n }\r\n catch(err){\r\n console.error(\"Failed to parse user settings!\", err);\r\n return;\r\n }\r\n setUserSettingsState({\r\n ...INIT_USER_SETTINGS,\r\n contractDocs: data.GetRemoteUserSettings.contractDocs,\r\n settings: {\r\n ...INIT_USER_SETTINGS.settings,\r\n ...JSON.parse(data?.GetRemoteUserAppSettings.settings)\r\n }\r\n })\r\n }\r\n }, [ networkStatus === NetworkStatus.loading ])\r\n\r\n let userSettingsData = {\r\n ...INIT_USER_SETTINGS,\r\n ...userSettingsState\r\n }\r\n\r\n if (typeof userSettingsData?.settings === 'string'){\r\n try {\r\n userSettingsData.settings = {\r\n ...INIT_USER_SETTINGS.settings,\r\n ...JSON.parse(userSettingsData.settings)\r\n };\r\n }\r\n catch (e){\r\n console.error('Could not parse user settings json:', e)\r\n console.log('userSettingsData', userSettingsData);\r\n userSettingsData.settings = undefined;\r\n }\r\n }\r\n else\r\n {\r\n userSettingsData.settings = {\r\n ...INIT_USER_SETTINGS.settings,\r\n ...userSettingsData.settings\r\n };\r\n }\r\n console.log({data, userSettingsData})\r\n\r\n const [ setUserSettings, { loading: setUserSettingsLoading } ] = useMutation(SetUserSettingsMutation, {\r\n update: (cache, { data }) => {\r\n cache.writeQuery({\r\n query: UserSettingsQuery,\r\n data: {\r\n ...data,\r\n GetRemoteUserAppSettings: {\r\n __typename: 'WebUserAppSettings',\r\n appName: data.SetRemoteUserAppSettings.appName,\r\n settings: data.SetRemoteUserAppSettings.settings\r\n }\r\n }\r\n })\r\n }\r\n })\r\n\r\n useEffect(() => {\r\n setUserSettingsState(userSettingsData);\r\n }, [ ])\r\n\r\n function getOrCreateTableSettings(tableSettings, name, defaultSettings){\r\n let settingsItem = tableSettings?.find((item) => item.name === name);\r\n if (!settingsItem){\r\n settingsItem = {\r\n name,\r\n settings: defaultSettings\r\n }\r\n }\r\n Object.entries(settingsItem.settings).forEach(([ settingName, settingValue ]) => {\r\n if (defaultSettings && defaultSettings[settingName] && !settingValue){\r\n settingsItem.settings[settingName] = defaultSettings[settingName];\r\n }\r\n })\r\n return settingsItem;\r\n }\r\n\r\n function setOrCreateTableSettings(tableSettings, name, settings){\r\n let settingsItem = tableSettings?.find((item) => item.name === name);\r\n if (!settingsItem){\r\n settingsItem = {\r\n name,\r\n settings,\r\n __typename: 'TableSettings'\r\n }\r\n }\r\n else\r\n {\r\n settingsItem.settings = { ...settingsItem.settings, ...settings };\r\n }\r\n\r\n return tableSettings\r\n }\r\n\r\n function toggleSidebarCollapse(){\r\n let collapsed = !state.sidebarCollapsed;\r\n dispatch({ type: TYPES.UPDATE_STATE, payload: { sidebarCollapsed: collapsed } })\r\n client.writeData({\r\n data: {\r\n navSiderCollapsed: collapsed\r\n }\r\n })\r\n }\r\n\r\n function handleSetUserSettingsMut(newUserSettings: any){\r\n return setUserSettings({\r\n variables: {\r\n settings: JSON.stringify(newUserSettings.settings)\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n SetRemoteUserAppSettings: {\r\n __typename: 'WebUserAppSettings',\r\n appName: APP_NAME,\r\n settings: newUserSettings.settings\r\n }\r\n }\r\n })\r\n }\r\n\r\n const debouncedHandleSetUserSettingsMut = useDebouncedCallback(handleSetUserSettingsMut, 1000)\r\n\r\n function handleSetUserSettings(featureName: string, value: any) {\r\n let newUserSettings = {\r\n ...userSettingsState,\r\n settings: {\r\n ...userSettingsState.settings,\r\n [featureName]: value\r\n }\r\n }\r\n // @ts-ignore\r\n setUserSettingsState(newUserSettings);\r\n return debouncedHandleSetUserSettingsMut(newUserSettings);\r\n }\r\n\r\n return ) => dispatch({ type: TYPES.UPDATE_STATE, payload: state }),\r\n toggleSidebarCollapse,\r\n userContracts: userSettingsState.contractDocs,\r\n getUserSettings(featureName: string, defaultValue?: T): T {\r\n if (userSettingsState.settings && !userSettingsState.settings[featureName] && defaultValue && !setUserSettingsLoading){\r\n handleSetUserSettings(featureName, defaultValue);\r\n return defaultValue\r\n }\r\n return (userSettingsState.settings && userSettingsState.settings[featureName])\r\n },\r\n setUserSettings: handleSetUserSettings,\r\n setTableColumnVisibility: (tableID: string, columnName: string, show: boolean) => {\r\n let settingsItem, newTableSettings;\r\n if (show){\r\n settingsItem = getOrCreateTableSettings(userSettingsData.settings?.tableSettings, tableID, { hiddenColumns: [] });\r\n newTableSettings = setOrCreateTableSettings(userSettingsData.settings?.tableSettings, tableID, {\r\n hiddenColumns: settingsItem.settings.hiddenColumns.filter(colName => colName !== columnName)\r\n });\r\n }\r\n else\r\n {\r\n settingsItem = getOrCreateTableSettings(userSettingsData.settings?.tableSettings, tableID, { hiddenColumns: [] });\r\n newTableSettings = setOrCreateTableSettings(userSettingsData.settings?.tableSettings, tableID, {\r\n hiddenColumns: [ ...settingsItem.settings.hiddenColumns, columnName ]\r\n });\r\n }\r\n\r\n let newSettings: any = {\r\n ...userSettingsData.settings,\r\n tableSettings: newTableSettings\r\n }\r\n newSettings = JSON.stringify(newSettings);\r\n\r\n setUserSettings({\r\n variables: {\r\n settings: newSettings\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n SetRemoteUserAppSettings: {\r\n __typename: 'WebUserAppSettings',\r\n appName: 'manifestcentral',\r\n settings: newSettings\r\n }\r\n }\r\n })\r\n .catch((reason) => {\r\n // Even if the server fails to update the user settings document write it to the query cache.\r\n console.log('setUserSettings failed: ', reason)\r\n client.writeQuery({\r\n query: UserSettingsQuery,\r\n data: {\r\n GetRemoteUserAppSettings: {\r\n __typename: 'WebUserAppSettings',\r\n appName: APP_NAME,\r\n settings: newSettings\r\n }\r\n }\r\n })\r\n })\r\n },\r\n getTableSettings: (tableName) => {\r\n let findFunc = item => item.name === tableName;\r\n let tb = userSettingsData.settings?.tableSettings?.find(findFunc);\r\n return tb\r\n },\r\n collapseFlytwatchColumn: (colName) => {\r\n if (!state.flytwatchCollapsedColumns.includes(colName)){\r\n dispatch({ type: TYPES.UPDATE_STATE, payload: { flytwatchCollapsedColumns: [...state.flytwatchCollapsedColumns, colName] } })\r\n }\r\n },\r\n unCollapseFlytwatchColumn: (colName) => {\r\n if (state.flytwatchCollapsedColumns.includes(colName)){\r\n dispatch({ type: TYPES.UPDATE_STATE, payload: { flytwatchCollapsedColumns: state.flytwatchCollapsedColumns.filter(col => col !== colName) } })\r\n }\r\n }\r\n }}>\r\n {props.children}\r\n \r\n}","import { DatePicker, TimePicker } from 'antd';\r\nimport { DatePickerProps } from 'antd/lib/date-picker/interface';\r\nimport { TimePickerProps } from 'antd/lib/time-picker';\r\nimport { momentOrNull } from 'common/util';\r\nimport moment, { Moment } from 'moment';\r\nimport React, { HTMLAttributes } from 'react';\r\nimport './index.less';\r\nimport cn from 'classnames';\r\n\r\nconst BASE_CLS = \"mc-date-time-picker\"\r\n\r\n// export interface DateTimePickerValue {\r\n// date: Moment,\r\n// time: Moment\r\n// }\r\n\r\nexport class DateTimePickerValue {\r\n date: Moment\r\n time: Moment\r\n\r\n constructor(date: string | Moment, time: string | Moment){\r\n this.date = momentOrNull(date);\r\n this.time = momentOrNull(time);\r\n }\r\n\r\n valueOf(){\r\n return this.toString();\r\n }\r\n\r\n toMoment(){\r\n let date = this.date;\r\n date.set({\r\n hours: 0,\r\n minutes: 0,\r\n seconds: 0,\r\n milliseconds: 0\r\n })\r\n\r\n let time = this.time;\r\n\r\n let t = moment(date);\r\n t.hour(time.hour());\r\n t.minute(time.minute());\r\n t.second(time.second());\r\n t.millisecond(time.millisecond());\r\n \r\n let timeDuration = t.diff(date);\r\n\r\n let dateTime = moment(date);\r\n dateTime.add(timeDuration);\r\n return dateTime;\r\n }\r\n\r\n toString(){\r\n return this.toMoment().toISOString(false);\r\n }\r\n\r\n static from(dt: string | any): DateTimePickerValue {\r\n let date: Moment, time: Moment;\r\n if (dt && typeof dt === 'object' && dt.date && dt.time){\r\n date = dt.date;\r\n time = dt.time;\r\n }\r\n else\r\n {\r\n let m = momentOrNull(dt);\r\n if (!m) return new DateTimePickerValue(null, null);\r\n date = moment(m);\r\n time = moment(m);\r\n }\r\n\r\n\r\n date.set({\r\n hours: 0,\r\n minutes: 0,\r\n seconds: 0,\r\n milliseconds: 0\r\n })\r\n\r\n time.set({\r\n date: moment().date()\r\n })\r\n\r\n return new DateTimePickerValue(date, time);\r\n }\r\n}\r\n\r\nexport interface DateTimePickerProps {\r\n value?: DateTimePickerValue,\r\n onChange?: (value: DateTimePickerValue) => void,\r\n datePickerProps?: DatePickerProps,\r\n timePickerProps?: TimePickerProps,\r\n showLabels?: boolean,\r\n dateLabelText?: string | JSX.Element,\r\n dateLabelProps?: HTMLAttributes\r\n timeLabelText?: string | JSX.Element,\r\n timeLabelProps?: HTMLAttributes\r\n style?: React.CSSProperties,\r\n size?: 'small' | 'default' | 'large'\r\n}\r\n\r\nconst DateTimePicker: React.FC = props => {\r\n let dateVal = momentOrNull(props.value?.date);\r\n let timeVal = momentOrNull(props.value?.time);\r\n\r\n // function handleChange(value: string){\r\n // let momVal = momentOrNull(value);\r\n // if (momVal){\r\n // props.onChange?.(momVal)\r\n // }\r\n // else\r\n // {\r\n // props.onChange?.(null)\r\n // }\r\n // }\r\n\r\n let getLabel = (props: any, text: any, defaultText: string) => {text || defaultText}\r\n\r\n return \r\n {props.showLabels ? getLabel(props.dateLabelProps, props.dateLabelText, 'Date:') : null}\r\n \r\n {\r\n props.onChange?.(new DateTimePickerValue(date, timeVal))\r\n }}\r\n placeholder=\"\"\r\n {...props.datePickerProps}\r\n />\r\n \r\n {props.showLabels ? getLabel(props.timeLabelProps, props.timeLabelText, 'Time:') : null}\r\n \r\n {\r\n props.onChange?.(new DateTimePickerValue(dateVal, time))\r\n }}\r\n placeholder=\"\"\r\n {...props.timePickerProps}\r\n />\r\n \r\n \r\n}\r\n\r\nexport function strToDateTimePickerValue(dt: string | any): DateTimePickerValue {\r\n if (dt instanceof DateTimePickerValue){\r\n return dt;\r\n }\r\n return DateTimePickerValue.from(dt);\r\n}\r\n\r\nDateTimePicker.defaultProps = {\r\n showLabels: false\r\n}\r\n\r\nexport default DateTimePicker","import { Auth } from '@aws-amplify/auth';\r\nimport { Component } from 'react';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport '../css/App.css';\r\n\r\nclass Home extends Component {\r\n componentDidMount() {\r\n Auth.currentAuthenticatedUser()\r\n .then(user => this.props.history.push('/app'))\r\n .catch(err => this.props.history.push('/login'))\r\n }\r\n render = () => null;\r\n}\r\n\r\nexport default withRouter(Home);\r\n","export default __webpack_public_path__ + \"static/media/mc-logo-wide-white.337d1ff4.svg\";","import React, { Component } from 'react';\r\nimport '../css/Login.css';\r\nimport { Auth } from '@aws-amplify/auth';\r\nimport { Input, Button, Form, Icon, Alert } from 'antd';\r\nimport mcLogo from '../img/mc-logo-wide-white.svg';\r\n\r\nclass ForceChangePassword extends Component {\r\n constructor(props){\r\n super(props);\r\n this.state = {\r\n error: '',\r\n confirmDirty: false\r\n }\r\n }\r\n componentDidMount = () => {\r\n var { email } = this.props;\r\n this.props.form.setFieldsValue({email: email});\r\n }\r\n handleSubmit = (e) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n this.props.form.validateFields((err, values) => {\r\n if (!err) {\r\n this.setState({ loading: true });\r\n const { newpassword } = values;\r\n Auth.completeNewPassword(this.props.user, newpassword)\r\n .then(() => this.props.onSuccess && this.props.onSuccess(newpassword))\r\n .catch(err => {\r\n this.setState({\r\n error: err.message\r\n })\r\n }\r\n );\r\n this.setState({ loading: false });\r\n }\r\n });\r\n }\r\n handleConfirmBlur = (e) => {\r\n const value = e.target.value;\r\n this.setState({ confirmDirty: this.state.confirmDirty || !!value });\r\n }\r\n compareToFirstPassword = (rule, value, callback) => {\r\n const form = this.props.form;\r\n if (value && value !== form.getFieldValue('newpassword')) {\r\n callback('Confirm Password and Password are not the same');\r\n } else {\r\n callback();\r\n }\r\n }\r\n \r\n validateToNextPassword = (rule, value, callback) => {\r\n const form = this.props.form;\r\n if (value && this.state.confirmDirty) {\r\n form.validateFields(['confirmpassword'], { force: true });\r\n }\r\n callback();\r\n }\r\n render(){\r\n const { getFieldDecorator } = this.props.form;\r\n\r\n const formItemLayout = {\r\n labelCol: {\r\n xs: { span: 24 },\r\n sm: { span: 8 },\r\n },\r\n wrapperCol: {\r\n xs: { span: 24 },\r\n sm: { span: 16 },\r\n },\r\n };\r\n return (\r\n
\r\n
\r\n \"Manifest\r\n
\r\n

Create Password

\r\n

Your account has been set up by a DataFlyt admin. Please enter a new password that you will use for now on.

\r\n {(this.state.error) ? \r\n \r\n this.setState({\r\n error: ''\r\n })\r\n }\r\n /> : ''\r\n }\r\n
\r\n \r\n {getFieldDecorator('newpassword', {\r\n rules: [\r\n {required: true, message: 'Password is required'},\r\n {\r\n validator: this.validateToNextPassword,\r\n }\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('confirmpassword', {\r\n rules: [\r\n {required: true, message: 'Confirm password is required'},\r\n {\r\n validator: this.compareToFirstPassword,\r\n }\r\n ]\r\n })(\r\n \r\n )}\r\n \r\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 Form.create()(ForceChangePassword);\r\n","import React, { Component } from 'react';\r\nimport '../css/Login.css';\r\nimport { Auth } from '@aws-amplify/auth';\r\nimport { Input, Button, Form, Icon, Alert } from 'antd';\r\nimport mcLogo from '../img/mc-logo-wide-white.svg';\r\n\r\nclass ForgotPassword extends Component {\r\n constructor(props){\r\n super(props);\r\n this.state = {\r\n error: '',\r\n email: '',\r\n showCode: false,\r\n confirmDirty: false\r\n }\r\n }\r\n componentDidMount = () => {\r\n var { email } = this.props;\r\n this.props.form.setFieldsValue({email: email});\r\n }\r\n handleSubmit = (e) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n this.props.form.validateFields((err, values) => {\r\n if (!err) {\r\n this.setState({ loading: true });\r\n const { code, newpassword } = values;\r\n Auth.forgotPasswordSubmit(this.state.email, code, newpassword)\r\n .then(user => this.props.setforgotpassword(false))\r\n .catch(err => {\r\n this.setState({\r\n error: err.message\r\n })\r\n }\r\n );\r\n this.setState({ loading: false });\r\n }\r\n });\r\n }\r\n handleConfirmBlur = (e) => {\r\n const value = e.target.value;\r\n this.setState({ confirmDirty: this.state.confirmDirty || !!value });\r\n }\r\n compareToFirstPassword = (rule, value, callback) => {\r\n const form = this.props.form;\r\n if (value && value !== form.getFieldValue('newpassword')) {\r\n callback('Confirm Password and Password are not the same');\r\n } else {\r\n callback();\r\n }\r\n }\r\n \r\n validateToNextPassword = (rule, value, callback) => {\r\n const form = this.props.form;\r\n if (value && this.state.confirmDirty) {\r\n form.validateFields(['confirmpassword'], { force: true });\r\n }\r\n callback();\r\n }\r\n handleEmail = (e) => {\r\n e.preventDefault();\r\n e.stopPropagation()\r\n this.props.form.validateFields((err, values) => {\r\n if (!err) {\r\n this.setState({ loading: true });\r\n const { email } = values;\r\n Auth.forgotPassword(email)\r\n .then(resp => this.setState({ email: email, showCode: true }))\r\n .catch(err => this.setState({ error: err.message }))\r\n this.setState({ loading: false });\r\n }\r\n });\r\n }\r\n render(){\r\n const { getFieldDecorator } = this.props.form;\r\n\r\n const formItemLayout = {\r\n labelCol: {\r\n xs: { span: 24 },\r\n sm: { span: 8 },\r\n },\r\n wrapperCol: {\r\n xs: { span: 24 },\r\n sm: { span: 16 },\r\n },\r\n };\r\n\r\n if (!this.state.showCode)\r\n {\r\n return (\r\n
\r\n
\r\n \"Manifest\r\n
\r\n

Reset Password

\r\n {(this.state.error) ? \r\n \r\n this.setState({\r\n error: ''\r\n })\r\n }\r\n /> : ''\r\n }\r\n
\r\n \r\n {getFieldDecorator('email', {\r\n rules: [{required: true, message: 'Email is required'}]\r\n })(\r\n \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{\r\n return (\r\n
\r\n
\r\n \"Manifest\r\n
\r\n

Reset Password

\r\n

A verification code has been emailed to {this.state.email}. Please copy and paste the code below and enter a new password.

\r\n {(this.state.error) ? \r\n \r\n this.setState({\r\n error: ''\r\n })\r\n }\r\n /> : ''\r\n }\r\n
\r\n \r\n {getFieldDecorator('code', {\r\n rules: [{required: true, message: 'Verification code is required'}]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('newpassword', {\r\n rules: [\r\n {required: true, message: 'Password is required'},\r\n {\r\n validator: this.validateToNextPassword,\r\n }\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('confirmpassword', {\r\n rules: [\r\n {required: true, message: 'Confirm password is required'},\r\n {\r\n validator: this.compareToFirstPassword,\r\n }\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n \r\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 Form.create()(ForgotPassword);\r\n","import React, { Component } from 'react';\r\nimport '../css/Login.css';\r\nimport { withRouter } from \"react-router-dom\";\r\n//import { withAuthenticator } from '@aws-amplify/auth-react';\r\nimport { Auth } from '@aws-amplify/auth';\r\nimport { Input, Button, Form, Alert } from 'antd';\r\nimport mcLogo from '../img/mc-logo-wide-white.svg';\r\n\r\nconst FormItem = Form.Item;\r\n\r\nclass Verify extends Component {\r\n constructor(props){\r\n super(props);\r\n this.state = {\r\n error: '',\r\n codeResent: false\r\n }\r\n }\r\n redirect = () => {\r\n const redirect = this.props.redirectTo || '/login';\r\n if (redirect)\r\n {\r\n this.props.history.push(redirect);\r\n }\r\n }\r\n signIn = (username, password) => {\r\n Auth.signIn(username, password)\r\n .then(() => this.props.history.push(this.props.redicrectToAfterSignIn || '/app'))\r\n .catch(e => {\r\n console.error('Failed to login automatically:', e);\r\n this.redirect();\r\n })\r\n }\r\n handleSubmit = (e) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n this.props.form.validateFieldsAndScroll((err, values) => {\r\n if (!err) {\r\n Auth.confirmSignUp(this.props.email, values.code)\r\n .then(user => this.signIn(this.props.email, this.props.password))\r\n .catch(err => this.setState({\r\n error: err.message\r\n }));\r\n }\r\n });\r\n }\r\n resendCode = () => {\r\n const email = this.props.email;\r\n Auth.resendSignUp(email)\r\n .then(user => this.setState({ codeResent: true, error: '' }))\r\n .catch(err => this.setState({ error: err.message }))\r\n }\r\n render(){\r\n const email = this.props.email;\r\n const signup = this.props.signup || false;\r\n const { getFieldDecorator } = this.props.form;\r\n\r\n return (\r\n
\r\n
\r\n \"Manifest\r\n
\r\n

Confirm Dataflyt Account

\r\n {\r\n this.state.codeResent && (\r\n this.setState({ codeResent: false }) }\r\n style={{marginBottom: '1rem'}}\r\n />\r\n )\r\n }\r\n {(this.state.error) ? \r\n \r\n this.setState({\r\n error: ''\r\n })\r\n }\r\n /> : ''\r\n }\r\n {signup === true &&

Your Dataflyt account has been successfully created but has not been activated yet.

}\r\n

A DataFlyt account verification code was sent to { email }. Please enter the verification code below to activate your account. If you did not receive your verification code, click to resend the code. If you have not received the code, please check your spam filter.

\r\n
\r\n \r\n {getFieldDecorator('code', {\r\n rules: [{\r\n required: true, message: 'Please enter a valid verification code',\r\n }],\r\n })(\r\n \r\n )}\r\n \r\n \r\n \r\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 Form.create()(withRouter(Verify));\r\n","import { Alert, Button, Form, Icon, Input } from 'antd';\r\nimport { Auth } from '@aws-amplify/auth';\r\nimport ForceChangePassword from 'components/ForceChangePassword';\r\nimport React, { Component } from 'react';\r\nimport { Link } from \"react-router-dom\";\r\nimport '../css/Login.css';\r\nimport mcLogo from '../img/mc-logo-wide-white.svg';\r\nimport ForgotPassword from './ForgotPassword';\r\nimport Verify from './Verify';\r\n\r\nconst PAGE_NAMES = {\r\n Verify: 'VERIFY',\r\n ForgotPassword: 'FPWD',\r\n NewPassword: 'NPWD'\r\n}\r\n\r\nclass SignIn extends Component {\r\n constructor(props){\r\n super(props);\r\n this.state = {\r\n error: '',\r\n showPage: null,\r\n email: '',\r\n loading: false,\r\n user: null,\r\n password: null\r\n }\r\n }\r\n handleSubmit = (e) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n this.props.form.validateFields((err, values) => {\r\n if (!err) {\r\n this.setState({ loading: true });\r\n const { email, password } = values;\r\n this.signIn(email, password);\r\n }\r\n });\r\n }\r\n\r\n signIn = (email, password) => {\r\n this.setState({ password, email });\r\n Auth.signIn(email, password)\r\n .then(user => {\r\n console.log(user);\r\n this.setState({ user });\r\n if (user.challengeName === 'NEW_PASSWORD_REQUIRED'){\r\n this.setState({ showPage: PAGE_NAMES.NewPassword })\r\n return;\r\n }\r\n let urlBeforeLogin = localStorage.getItem('url-before-login');\r\n if (urlBeforeLogin){\r\n localStorage.removeItem('url-before-login');\r\n this.props.history.push(urlBeforeLogin);\r\n }\r\n else\r\n {\r\n this.props.history.push('/app/passengers');\r\n }\r\n })\r\n .catch(err => {\r\n if (err.code === 'UserNotConfirmedException')\r\n {\r\n this.setState({\r\n showPage: PAGE_NAMES.Verify,\r\n email: email\r\n });\r\n }else{\r\n this.setState({\r\n error: err.message\r\n })\r\n }\r\n })\r\n .then(() => this.setState({ loading: false }));\r\n }\r\n\r\n onChange = (key, value) => {\r\n this.setState({ [key]: value });\r\n }\r\n setForgotPassword = (bool) => {\r\n this.setState({ showPage: bool ? PAGE_NAMES.ForgotPassword : null });\r\n }\r\n render(){\r\n const { getFieldDecorator } = this.props.form;\r\n if (this.state.showPage === PAGE_NAMES.ForgotPassword)\r\n {\r\n return ( this.setState({ showPage: null })}\r\n />)\r\n }\r\n else if (this.state.showPage === PAGE_NAMES.NewPassword){\r\n return this.setState({ showPage: null })}\r\n onSuccess={(newPassword) => this.signIn(this.state.email, newPassword)}\r\n loading={this.state.loading}\r\n />\r\n }\r\n else if (this.state.showPage !== PAGE_NAMES.Verify)\r\n {\r\n return (\r\n
\r\n
\r\n \"Manifest\r\n
\r\n

Dataflyt Account Login

\r\n {(this.state.error) ? \r\n \r\n this.setState({\r\n error: ''\r\n })\r\n }\r\n /> : ''\r\n }\r\n
\r\n \r\n {getFieldDecorator('email', {\r\n rules: [{required: true, message: 'Email is required'}]\r\n })(\r\n \r\n } type=\"email\" size=\"large\" placeholder=\"Email\" id=\"email\" />\r\n )}\r\n \r\n \r\n {getFieldDecorator('password', {\r\n rules: [{required: true, message: 'Password is required'}]\r\n })(\r\n \r\n } type=\"password\" size=\"large\" placeholder=\"Password\" id=\"password\"/>\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n Register New Dataflyt Account\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n )\r\n }else{\r\n return (\r\n \r\n )\r\n }\r\n \r\n }\r\n}\r\n\r\nexport default Form.create()(SignIn);\r\n","import parsePhoneNumber from 'libphonenumber-js';\r\n\r\nclass CognitoPhoneNumber {\r\n public countryCode: string\r\n public number: string\r\n\r\n constructor(countryCode: string, number: string){\r\n this.countryCode = countryCode;\r\n this.setCountryCode(countryCode);\r\n this.number = number;\r\n }\r\n\r\n setCountryCode(cc: number | string){\r\n if (typeof cc == 'string'){\r\n cc = cc.replaceAll('+', '');\r\n }\r\n this.countryCode = '+' + cc\r\n }\r\n\r\n /**\r\n * Parse from a string in the standard AWS Cognito phone format. Ex: +15554443333\r\n * @param phonenumber \r\n */\r\n public static parseString(phonenumber: string): CognitoPhoneNumber {\r\n if (typeof phonenumber !== 'string') return;\r\n let phone = parsePhoneNumber(phonenumber);\r\n if (!phone){\r\n // Parsing failed\r\n return;\r\n }\r\n return new CognitoPhoneNumber(phone.countryCallingCode.toString(), phone.nationalNumber.toString());\r\n }\r\n\r\n public static clean(phoneNumber: string): string{\r\n if (!phoneNumber) return undefined;\r\n const matched = Array.from(phoneNumber.matchAll(/\\d/g));\r\n return '+' + matched.join('');\r\n }\r\n\r\n /**\r\n * Convert to standard AWS Cognito phone number format. Ex: +15554443333\r\n */\r\n public toString(): string {\r\n if (!this.number){\r\n return '';\r\n }\r\n let cc = this.countryCode;\r\n if (!cc.includes('+')){\r\n // Shouldn't not have a + in the countryCode.\r\n // Add it back just in case.\r\n cc = '+' + cc;\r\n }\r\n return CognitoPhoneNumber.clean(cc + this.number);\r\n }\r\n}\r\n\r\nexport default CognitoPhoneNumber","/*\r\nWritten by Austin Thibodeaux\r\nInput that handles the phone number format + that Amazon Cognito expects\r\n*/\r\n\r\nimport { Button, Tooltip } from 'antd';\r\nimport Input, { InputProps } from 'antd/lib/input';\r\nimport Select, { SelectProps } from 'antd/lib/select';\r\nimport countryCodes from 'country-codes-list';\r\nimport React, { forwardRef, LegacyRef } from 'react';\r\nimport CognitoPhoneNumber from './CognitoPhoneNumber';\r\n\r\nexport interface InputCognitoPhoneNumberProps {\r\n inputProps?: Omit,\r\n selectProps?: Omit,\r\n value?: CognitoPhoneNumber | string,\r\n onChange?: (value: CognitoPhoneNumber) => void,\r\n onBlur?: (event: React.FocusEvent) => void,\r\n onFocus?: (event: React.FocusEvent) => void,\r\n allowClear?: boolean\r\n}\r\n\r\nconst COUNTRY_CODES = countryCodes.customList('countryCallingCode', '{countryNameLocal}');\r\n\r\nconst InputCognitoPhoneNumber: React.FC = forwardRef((props, ref: LegacyRef) => {\r\n\r\n let unFormattedValue = props.value;\r\n let valueProp: CognitoPhoneNumber;\r\n if (typeof unFormattedValue === 'string'){\r\n valueProp = CognitoPhoneNumber.parseString(unFormattedValue);\r\n }\r\n else\r\n {\r\n valueProp = unFormattedValue;\r\n }\r\n\r\n function updateCountryCode(value: string){\r\n props.onChange?.(new CognitoPhoneNumber(value, valueProp?.number));\r\n }\r\n\r\n function updateNumber(value: string){\r\n props.onChange?.(new CognitoPhoneNumber(valueProp?.countryCode, value))\r\n }\r\n\r\n function clear(){\r\n props.onChange?.(undefined);\r\n }\r\n\r\n function renderClearBtn(){\r\n let allowClear = (typeof props.allowClear === 'boolean') ? props.allowClear : true\r\n if (allowClear){\r\n return \r\n \r\n \r\n }\r\n return null;\r\n }\r\n\r\n function handleInputGroupBlur(e: any){\r\n if (!e.currentTarget.contains(e.relatedTarget)){ // Leaving parent\r\n props.onBlur?.(e);\r\n }\r\n }\r\n\r\n return \r\n \r\n updateCountryCode(value)}\r\n value={valueProp?.countryCode}\r\n defaultValue=\"1\"\r\n style={{ width: '6rem', flexShrink: 0 }}\r\n showAction={[\"focus\", \"click\"]}\r\n {...props.selectProps}\r\n >\r\n {Object.keys(COUNTRY_CODES).map((cc) => +{cc})}\r\n \r\n \r\n updateNumber(e.target.value)}\r\n value={valueProp?.number}\r\n max={100}\r\n ref={ref}\r\n type=\"tel\"\r\n {...props.inputProps}\r\n />\r\n {renderClearBtn()}\r\n \r\n})\r\n\r\nexport default InputCognitoPhoneNumber","import CognitoPhoneNumber from \"./CognitoPhoneNumber\";\r\n\r\nfunction validateNumberChars(value: string, callback: Function){\r\n if (!value.match(/^([0-9]|[-()]| )*$/g)){\r\n callback(\"Must only be numbers or '-', '(', and ')'\");\r\n return false\r\n }\r\n callback();\r\n return true\r\n}\r\n\r\nexport function validateCognitoPhoneNumber(rule: any, value: CognitoPhoneNumber, callback: Function){\r\n if (!rule.required && (!value || (!value.number && !value.countryCode))){\r\n callback();\r\n return;\r\n }\r\n if (rule.required && !value){\r\n callback(\"Phone number is required\");\r\n return;\r\n }\r\n if (!value.number && value.countryCode){\r\n callback(\"A phone number is required\");\r\n return;\r\n }\r\n if (!value.countryCode && value.number){\r\n callback(\"Please select a calling code\");\r\n return;\r\n }\r\n if (!validateNumberChars(value.number, callback)){\r\n callback();\r\n return;\r\n }\r\n}","import React, { Component, CSSProperties } from 'react';\r\nimport config from 'config';\r\nimport debounce from 'lodash/debounce';\r\nimport { Alert, Icon, message, Select, Spin, Typography } from 'antd';\r\nimport Text from 'antd/lib/typography/Text';\r\nimport './style.less';\r\nimport { graphql } from 'react-apollo';\r\nimport gql from 'graphql-tag';\r\nimport { SelectProps } from 'antd/lib/select';\r\nimport { getLabelInValueKey } from 'common/form';\r\n\r\nconst classTypeMap = {\r\n 'flytsuite.customer': 'Customer',\r\n 'flytsuite.transporter': 'Transporter',\r\n 'flytsuite.employer': 'Contractor'\r\n}\r\n\r\nexport interface OrgSearchProps extends SelectProps {\r\n orgData?: any,\r\n}\r\n\r\nclass OrgSearch extends Component {\r\n state = {\r\n search: null,\r\n loading: null,\r\n result: [],\r\n error: null,\r\n currOrgData: null\r\n }\r\n\r\n setError = (msg) => {\r\n this.setState({ error: String(msg), loading: false });\r\n message.error(\"An error occurred while loading organization list. Please contact DataFlyt if this persists.\");\r\n }\r\n\r\n getCurrOrgType = () => {\r\n fetch(`${config.pythonBackendApi}/organization/${getLabelInValueKey(this.props.value)}/classType,name`)\r\n .then(async (resp) => {\r\n if (resp.ok){\r\n let res = await resp.json();\r\n this.setState({ currOrgData: { classType: res[0], name: res[1] }});\r\n }\r\n else\r\n {\r\n console.error('Failed to load currOrgType')\r\n }\r\n })\r\n }\r\n\r\n componentDidMount(): void {\r\n this.getCurrOrgType();\r\n }\r\n\r\n componentDidUpdate(prevProps: Readonly): void {\r\n if (getLabelInValueKey(prevProps.value) !== getLabelInValueKey(this.props.value)){\r\n this.getCurrOrgType();\r\n }\r\n }\r\n\r\n getOrganizations = () => {\r\n if (!this.state.search){\r\n return [];\r\n }\r\n this.setState({ loading: true });\r\n fetch(`${config.pythonBackendApi}/organizations?limit=30${this.state.search ? `&filter_name=${encodeURIComponent(this.state.search)}` : ''}`, {\r\n mode: 'cors'\r\n })\r\n .then(async resp => {\r\n if (resp.ok){\r\n let data = await resp.json();\r\n this.setState({ result: data, loading: false });\r\n }\r\n else {\r\n this.setError(resp.text)\r\n }\r\n })\r\n .catch(err => this.setError(String(err)));\r\n }\r\n\r\n debouncedGetOrganizations = debounce(this.getOrganizations, 500)\r\n\r\n render(){\r\n\r\n let notFoundContent = null;\r\n\r\n if (this.state.loading){\r\n notFoundContent = } />\r\n }\r\n else if (this.state.search && !this.state.error && this.state.result?.length === 0){\r\n notFoundContent = \"No results found\";\r\n }\r\n else if (this.state.error){\r\n notFoundContent = Failed to load list\r\n }\r\n\r\n let value = this.props.value;\r\n\r\n if (!this.props.labelInValue && this.props.value){\r\n value = { key: this.props.value, label: '' }\r\n }\r\n\r\n if (this.state.currOrgData){\r\n console.debug('reached here')\r\n let style: CSSProperties = { fontSize: '0.75rem', color: 'grey', float: 'right', marginLeft: '1rem' }\r\n let orgType = classTypeMap[this.state.currOrgData.classType] || '';\r\n let label = \r\n {this.state.currOrgData.name} {orgType}\r\n \r\n value = { ...value, label: label }\r\n }\r\n\r\n return {\r\n this.setState({ search: val }, this.debouncedGetOrganizations);\r\n }}\r\n showSearch\r\n filterOption={null}\r\n showAction={[\"focus\", \"click\"]}\r\n loading={this.state.loading}\r\n placeholder=\"Type to search\"\r\n notFoundContent={notFoundContent}\r\n onChange={(value) => {\r\n let v = value;\r\n if (this.props.labelInValue && Array.isArray(value.label)){\r\n v = {\r\n key: value.key,\r\n label: value.label[0]\r\n }\r\n }\r\n else if (!this.props.labelInValue){\r\n v = getLabelInValueKey(value)\r\n }\r\n if (this.props.onChange){\r\n // @ts-ignore\r\n this.props.onChange(v);\r\n }\r\n }}\r\n allowClear\r\n labelInValue\r\n >\r\n {!this.state.error && this.state.result?.map((item) => \r\n {item.name} {classTypeMap[item.classType]}\r\n )}\r\n {!this.state.error && this.state.result?.length == 30 ? (\r\n \r\n ) : null}\r\n \r\n }\r\n}\r\n\r\nexport default OrgSearch","import regex from './regex';\r\n\r\nexport const validateISNNumber = (rule, value, callback) => {\r\n if ((!value || value === '') && (!rule || !rule.required)){\r\n callback();\r\n }\r\n const isnNumber = ('' + value).replace('ISN-', '');\r\n if (isnNumber.length !== 8){\r\n callback('ISN number must be 8 digits long');\r\n }\r\n else if (!/^\\d+$/.test(isnNumber)){\r\n callback('ISN number must be digits 0-9');\r\n }\r\n else{\r\n callback();\r\n }\r\n}\r\n\r\nexport const validateCredWithExpiration = (rule, value, callback) => {\r\n if ((!value || (value.key === '' && !value.expiration)) && (!rule || !rule.required)){\r\n callback();\r\n }else if(!value || (value.key === '' && value.expiration == null)){\r\n callback('Must have at least one credential')\r\n }else if(value.key !== '' && value.expiration == null){\r\n callback('Must have an expiration');\r\n }else if (value.key === '' && value.expiration !== null){\r\n callback('Must have a key');\r\n }else {\r\n callback();\r\n }\r\n}\r\n\r\nexport const validatePhone = (rule, value, callback) => {\r\n if ((!value || value === '') && (!rule || !rule.required)){\r\n callback();\r\n }\r\n const r = regex.phone;\r\n if (r.test(value)){\r\n callback();\r\n }\r\n else\r\n {\r\n callback('Invalid phone number format');\r\n }\r\n}\r\n\r\nexport const composeValidators = (...validators) => {\r\n return (rule, value, callback) => {\r\n let callbacks = [];\r\n for (let i = 0; i < validators.length; i++) {\r\n const validator = validators[i];\r\n validator(rule, value, (val) => callbacks.push(val));\r\n }\r\n\r\n if (callbacks.length > 0){\r\n let val = callbacks.filter(cb => cb).join(' ');\r\n callback(val ? val : undefined)\r\n }\r\n else\r\n {\r\n callback();\r\n }\r\n }\r\n}\r\n\r\nexport const validateOtherFieldIsFilledIn = (form, fieldName, fieldLabel=fieldName) => {\r\n return (rule, value, callback) => {\r\n if ((!value || value === '') && (!rule || !rule.required)){\r\n callback();\r\n return;\r\n }\r\n let otherValue = form.getFieldValue(fieldName);\r\n if (otherValue){\r\n form.validateFields([fieldName]);\r\n callback();\r\n }\r\n else\r\n {\r\n callback(fieldLabel + ' must also be filled in.');\r\n }\r\n }\r\n}\r\n\r\nexport const validateAlphaNumeric = (rule, value, callback) => {\r\n let r = /[a-zA-Z0-9]*/;\r\n\r\n let matched = String(value).match(r);\r\n if (matched[0].length < String(value).length){\r\n callback(\"Must have alphanumeric characters only. (a-z, A-Z, 0-9)\")\r\n }else{\r\n callback()\r\n }\r\n}\r\n\r\nexport const validateDecimal = (rule, value, callback) => {\r\n if ((!value || value === '') && (!rule || !rule.required)){\r\n callback();\r\n return;\r\n }\r\n let r = /[\\-\\.0-9]*/;\r\n\r\n if (String(value).startsWith('.')){\r\n callback('Please add a 0 in front of the period like this: ' + '0' + value);\r\n return;\r\n }\r\n\r\n if (String(value).endsWith('.')){\r\n callback('Please remove the period at the end');\r\n return;\r\n }\r\n\r\n let matched = String(value).match(r);\r\n if (matched[0].length < String(value).length){\r\n callback(\"Must be a decimal number.\")\r\n }else{\r\n callback()\r\n }\r\n}\r\n\r\nexport const validateFirstLastName = (rule, value, callback) => {\r\n if ((!value || value === '') && (!rule || !rule.required)){\r\n callback();\r\n }\r\n\r\n let { lastName, firstName } = value;\r\n\r\n if (!firstName && lastName) callback(\"First name is required.\")\r\n else if (firstName && !lastName)\r\n callback(\"Last name is required.\")\r\n else if (!firstName && !lastName)\r\n callback(\"First name and last name is required.\")\r\n else callback();\r\n}\r\n\r\nexport const validatePassword = (rule, value, callback) => {\r\n if (!value){\r\n callback(\"Password is required.\");\r\n return;\r\n };\r\n\r\n let violations = [];\r\n\r\n let rgx = [\r\n [/.*[0-9].*/, \"At least one number is required.\"],\r\n [/.*[a-z].*/, \"At least one lowercase letter is required.\"],\r\n [/.*[A-Z].*/, \"At least one uppercase letter is required.\"]\r\n ]\r\n\r\n rgx.forEach(r => {\r\n if (!r[0].test(value)){\r\n violations.push(r[1]);\r\n }\r\n })\r\n\r\n if (violations.length > 0){\r\n callback(violations.join(\" \"));\r\n }\r\n else\r\n {\r\n callback();\r\n }\r\n}\r\n\r\n/**\r\n * \r\n * @param {*} rule \r\n * @param {import('components/date-time-picker').DateTimePickerValue} value \r\n * @param {*} callback \r\n */\r\nexport function validateDateTimePicker(rule, value, callback){\r\n if (rule.required && !value){\r\n callback(rule.message)\r\n }\r\n else if (!value.date){\r\n callback('Please enter a date')\r\n }\r\n else if (!value.time){\r\n callback('Please enter a time')\r\n }\r\n else\r\n {\r\n callback()\r\n }\r\n}","import { Auth } from '@aws-amplify/auth';\r\nimport { Alert, Button, Form, Input } from 'antd';\r\nimport { tailFormItemLayout } from 'common/form';\r\nimport CognitoPhoneNumber from 'components/form/InputCognitoPhoneNumber';\r\nimport CognitoPhoneNumberClass from 'components/form/InputCognitoPhoneNumber/CognitoPhoneNumber';\r\nimport { validateCognitoPhoneNumber } from 'components/form/InputCognitoPhoneNumber/validator';\r\nimport OrgSearch from 'components/SignUpOrganizationSearch';\r\nimport { composeValidators, validatePassword } from 'formValidators';\r\nimport { Component } from 'react';\r\nimport { Link } from \"react-router-dom\";\r\nimport '../css/Login.css';\r\nimport mcLogo from '../img/mc-logo-wide-white.svg';\r\nimport Verify from './Verify';\r\n\r\nconst FormItem = Form.Item;\r\n\r\nclass SignUp extends Component {\r\n constructor(props){\r\n super(props);\r\n this.state = {\r\n confirmDirty: false,\r\n error: '',\r\n organizations: [],\r\n organizationsError: true,\r\n showVerification: false,\r\n user: {}\r\n }\r\n }\r\n\r\n handleConfirmBlur = (e) => {\r\n const value = e.target.value;\r\n this.setState({ confirmDirty: this.state.confirmDirty || !!value });\r\n }\r\n \r\n compareToFirstPassword = (rule, value, callback) => {\r\n const form = this.props.form;\r\n if (value && value !== form.getFieldValue('password')) {\r\n callback('Confirm Password and Password are not the same');\r\n } else {\r\n callback();\r\n }\r\n }\r\n\r\n validateToNextPassword = (rule, value, callback) => {\r\n const form = this.props.form;\r\n if (value && this.state.confirmDirty) {\r\n form.validateFields(['confirmpassword'], { force: true });\r\n }\r\n callback();\r\n }\r\n\r\n handleSubmit = (e) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n this.props.form.validateFieldsAndScroll((err, values) => {\r\n if (!err) {\r\n console.log(\"Submitting form\");\r\n let attr = {\r\n username: values.email,\r\n password: values.password,\r\n attributes: {\r\n given_name: values.firstname,\r\n family_name: values.lastname,\r\n \"custom:organization\": values.employer,\r\n \"custom:org_id\": String(1)\r\n }\r\n }\r\n if (values.phone){\r\n attr.attributes.phone_number = values.phone && values.phone.countryCode && values.phone.number ? values.phone.toString() : undefined;\r\n }\r\n if (values.companyphone){\r\n attr.attributes['custom:company_phone_number'] = values.companyphone && values.companyphone.countryCode && values.companyphone.number ? values.companyphone.toString() : undefined;\r\n }\r\n Auth.signUp(attr)\r\n .then(user => this.setState({user: user, showVerification: true, password: values.password}))\r\n .catch(err => this.setState({\r\n error: err.message\r\n }));\r\n }\r\n });\r\n }\r\n render(){\r\n const { getFieldDecorator } = this.props.form;\r\n\r\n const formItemLayout = {\r\n labelCol: {\r\n xs: { span: 24 },\r\n sm: { span: 8 },\r\n },\r\n wrapperCol: {\r\n xs: { span: 24 },\r\n sm: { span: 16 },\r\n },\r\n };\r\n\r\n if (!this.state.showVerification)\r\n {\r\n return (\r\n
\r\n
\r\n \"Manifest\r\n
\r\n

Register New Dataflyt Account

\r\n {(this.state.error) ? \r\n \r\n this.setState({\r\n error: ''\r\n })\r\n }\r\n /> : ''\r\n }\r\n
\r\n \r\n {getFieldDecorator('email', {\r\n rules: [{\r\n type: 'email', message: 'Please enter a valid email address',\r\n }, {\r\n required: true, message: 'Please enter an email address ',\r\n }],\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('password', {\r\n rules: [{\r\n validator: composeValidators(this.validateToNextPassword, validatePassword),\r\n }],\r\n })(\r\n \r\n )}\r\n \r\n \r\n

Password requirements

\r\n
    \r\n
  • At least one lowercase letter.
  • \r\n
  • At least one uppercase letter.
  • \r\n
  • At least one number.
  • \r\n
\r\n
\r\n \r\n {getFieldDecorator('confirmpassword', {\r\n rules: [{\r\n validator: composeValidators(this.compareToFirstPassword, validatePassword),\r\n }],\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('firstname', {\r\n rules: [{\r\n required: true, message: 'Please enter your first name',\r\n }],\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('lastname', {\r\n rules: [{\r\n required: true, message: 'Please enter your last name',\r\n }],\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('phone', {\r\n rules: [{\r\n required: true,\r\n validator: validateCognitoPhoneNumber\r\n }],\r\n initialValue: new CognitoPhoneNumberClass('+1', '')\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('companyphone', {\r\n rules: [{\r\n required: false,\r\n }],\r\n initialValue: new CognitoPhoneNumberClass('+1', '')\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('employer', {\r\n rules: [{\r\n required: true, message: 'Please choose your organization',\r\n }],\r\n })(\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n I already have an account\r\n
\r\n
\r\n
\r\n
\r\n )\r\n }\r\n else{\r\n return (\r\n \r\n )\r\n }\r\n }\r\n}\r\n\r\nexport default Form.create()(SignUp);\r\n","import React from 'react';\r\nimport { withRouter, Route, Redirect } from 'react-router-dom';\r\nimport { Auth } from '@aws-amplify/auth';\r\nimport { message } from 'antd';\r\n\r\nclass PrivateRoute extends React.Component {\r\n state = {\r\n loaded: false,\r\n isAuthenticated: false\r\n }\r\n componentDidMount() {\r\n this.authenticate()\r\n console.log('history', this.props.history);\r\n this.unlisten = this.props.history.listen(() => {\r\n Auth.currentAuthenticatedUser()\r\n .catch(() => {\r\n if (this.state.isAuthenticated) this.setState({ isAuthenticated: false })\r\n })\r\n });\r\n }\r\n componentWillUnmount() {\r\n this.unlisten()\r\n }\r\n authenticate() {\r\n Auth.currentAuthenticatedUser()\r\n .then(() => {\r\n this.setState({ loaded: true, isAuthenticated: true })\r\n })\r\n .catch(() => {\r\n window.localStorage.setItem('url-before-login', this.props.location.pathname);\r\n this.props.history.push('/login') && message.error.push('Please login to continue');\r\n })\r\n }\r\n render() {\r\n const { component: Component, render, ...rest } = this.props;\r\n const { loaded , isAuthenticated} = this.state\r\n if (!loaded) return null\r\n return (\r\n {\r\n if (isAuthenticated){\r\n if (Component){\r\n return \r\n }\r\n else if (render){\r\n return render(props);\r\n }\r\n return null\r\n }\r\n return (\r\n \r\n )\r\n }}\r\n />\r\n )\r\n }\r\n }\r\n\r\nexport default withRouter(PrivateRoute);","import { Radio } from 'antd';\r\nimport { RadioGroupProps } from 'antd/lib/radio';\r\nimport cn from 'classnames';\r\nimport MCIcon from 'components/icon';\r\nimport React from 'react';\r\nimport './style.less';\r\n\r\nexport interface FeedbackMoodProps extends RadioGroupProps {\r\n\r\n}\r\n\r\nconst FeedbackMood: React.FC = (props) => {\r\n return (\r\n \r\n I'm happy\r\n I'm frustrated\r\n \r\n )\r\n}\r\n\r\nexport default FeedbackMood","import { Button, Icon, message, Upload } from 'antd';\r\nimport { UploadProps } from 'antd/lib/upload';\r\nimport { PutObjectCommand, S3Client } from '@aws-sdk/client-s3';\r\nimport config from 'config';\r\nimport { AuthContext } from 'context/auth';\r\nimport React, { useContext } from 'react';\r\nimport Auth from '@aws-amplify/auth';\r\n\r\nexport interface UserContentUploaderProps extends UploadProps {\r\n\r\n}\r\n\r\nconst UserContentUploader: React.FC = (props) => {\r\n const { user, refreshUser } = useContext(AuthContext);\r\n // const [ fileList, setFileList ] = useState>([]);\r\n\r\n // function modifyFile(filename: string, newFileProps: Partial) {\r\n // let newFileList = fileList.map(file => {\r\n // if (file.name !== filename) return file;\r\n // return {\r\n // ...file,\r\n // ...newFileProps\r\n // }\r\n // })\r\n // setFileList(newFileList);\r\n // }\r\n\r\n let baseKey = 'cognito/attachments/' + user?.username + '/';\r\n\r\n let uploadProps: UploadProps = {\r\n multiple: true,\r\n withCredentials: true,\r\n // fileList: fileList,\r\n // onChange: (info) => {\r\n // console.log('onChange', info);\r\n // setFileList([ ...info.fileList, info.file ])\r\n // },\r\n customRequest: async ({ file, onSuccess, onError, onProgress }) => {\r\n await refreshUser();\r\n let s3 = new S3Client({\r\n region: config.amplify.Auth.region,\r\n credentials: await Auth.currentCredentials()\r\n });\r\n\r\n // function handleError(err){\r\n // message.error(\"File failed to upload: \" + err.message);\r\n // onError(err);\r\n // }\r\n\r\n function handleError(reason){\r\n message.error(\"File failed to upload: \" + reason);\r\n onError(reason);\r\n }\r\n\r\n // function uploadCallback(err: Error, data: S3.ManagedUpload.SendData){\r\n // if (err){\r\n // console.error('customRequest error::', err);\r\n\r\n // setTimeout(handleError, 100, err)\r\n // // modifyFile(file.name, { error: err, status: 'error' });\r\n // }\r\n // else\r\n // {\r\n // onSuccess(data, file);\r\n // // modifyFile(file.name, { error: null, response: data, status: 'done' });\r\n // }\r\n // }\r\n\r\n let comm = new PutObjectCommand({\r\n ACL: 'private',\r\n Bucket: config.userContentS3Bucket,\r\n Key: baseKey + file.name,\r\n Body: file,\r\n ContentType: file.type\r\n });\r\n\r\n s3.send(comm)\r\n .then((value) => {\r\n onSuccess(value, file);\r\n })\r\n .catch((reason) => {\r\n console.error('customRequest error::', reason);\r\n\r\n setTimeout(handleError, 100, reason)\r\n })\r\n\r\n // s3.upload({\r\n // ACL: \"private\",\r\n // Bucket: config.userContentS3Bucket,\r\n // Key: baseKey + file.name,\r\n // Body: file,\r\n // ContentType: file.type\r\n // }, uploadCallback)\r\n // .on('httpUploadProgress', function(progress){\r\n // onProgress({ percent: progress.loaded/progress.total }, file);\r\n // })\r\n },\r\n // fileList: fileList,\r\n // onRemove: (file) => removeFile(file.fileName),\r\n // onChange: (info) => setFileList(info.fileList)\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport default UserContentUploader;","import { Alert, Form, Input, Radio, Select, Typography } from 'antd';\r\nimport { ButtonProps } from 'antd/lib/button';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\nimport { WrappedFormUtils } from 'antd/lib/form/Form';\r\nimport FeedbackMood from 'components/feedback-mood';\r\nimport UserContentUploader from 'components/UserContentUploader';\r\nimport { AuthContext } from 'context/auth';\r\nimport React, { PropsWithChildren, useContext, useEffect } from 'react';\r\n\r\nexport type FeedbackType = 'bug' | 'featurerequest' | 'generalfeedback' | 'outage';\r\n\r\nexport interface FeedbackFormProps extends Omit {\r\n defaultType?: FeedbackType,\r\n lockToType?: FeedbackType,\r\n displayOutageWarning?: boolean,\r\n defaultDescription?: string,\r\n onValuesChange?: (values) => void,\r\n submitButtonProps?: ButtonProps\r\n}\r\n\r\nexport interface BaseFeedbackFormProps extends Omit, PropsWithChildren {}\r\n\r\nfunction renderBugForm(form: WrappedFormUtils) {\r\n const { getFieldDecorator } = form;\r\n return <>\r\n \r\n {getFieldDecorator('expected', {\r\n rules: [{ required: true, message: 'Please explain what you expected to happen' }]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('actual', {\r\n rules: [{ required: true, message: 'Please explain what actually happened' }]\r\n })(\r\n \r\n )}\r\n \r\n \r\n}\r\n\r\nfunction renderOutageForm(form: WrappedFormUtils, displayWarning=true) {\r\n const { getFieldDecorator } = form;\r\n return <>\r\n {displayWarning ? (\r\n \r\n ) : null}\r\n \r\n {getFieldDecorator('description', {\r\n rules: [{ required: true, message: 'Please describe what happened.' }]\r\n })(\r\n \r\n )}\r\n \r\n \r\n}\r\n\r\nfunction renderGeneralFeedbackForm(form: WrappedFormUtils, displayWarning=true) {\r\n const { getFieldDecorator } = form;\r\n return <>\r\n \r\n {getFieldDecorator('description', {\r\n rules: [{ required: true, message: 'Please answer this question.' }]\r\n })(\r\n \r\n )}\r\n \r\n \r\n}\r\n\r\nfunction renderFeatureRequestForm(form: WrappedFormUtils, displayWarning=true) {\r\n const { getFieldDecorator } = form;\r\n return <>\r\n \r\n {getFieldDecorator('description', {\r\n rules: [{ required: true, message: 'Please answer this question.' }]\r\n })(\r\n \r\n )}\r\n \r\n \r\n}\r\n\r\nfunction renderResponseType(form: WrappedFormUtils, userAttributes: any) {\r\n\r\n const { getFieldDecorator } = form;\r\n\r\n switch (form.getFieldValue('responseType')) {\r\n case 'phone':\r\n return \r\n {getFieldDecorator('responsePhone', {\r\n initialValue: userAttributes?.phone_number,\r\n rules: [{ required: true, message: 'Please enter a phone number' }]\r\n })()}\r\n \r\n case 'email':\r\n return \r\n {getFieldDecorator('responseEmail', {\r\n initialValue: userAttributes?.email,\r\n rules: [{ required: true, message: 'Please enter a phone number' }]\r\n })()}\r\n \r\n default:\r\n return null;\r\n }\r\n}\r\n\r\nconst _Internal_BaseFeedbackForm: React.FC = (props) => {\r\n const { getFieldDecorator, setFieldsValue, getFieldValue } = props.form;\r\n const { user } = useContext(AuthContext);\r\n\r\n let typeValue = getFieldValue('type');\r\n\r\n function renderForm(){\r\n switch (props.lockToType ? props.lockToType : getFieldValue('type')) {\r\n case 'bug':\r\n return renderBugForm(props.form)\r\n case 'outage':\r\n return renderOutageForm(props.form, props.displayOutageWarning)\r\n case 'generalfeedback':\r\n return renderGeneralFeedbackForm(props.form)\r\n case 'featurerequest':\r\n return renderFeatureRequestForm(props.form)\r\n default:\r\n return null;\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n if (props.lockToType){\r\n setFieldsValue({ type: props.lockToType });\r\n }\r\n // eslint-disable-next-line\r\n }, [ props.lockToType ])\r\n\r\n useEffect(() => {\r\n if (props.defaultDescription && getFieldValue('description') === undefined){\r\n setFieldsValue({ description: props.defaultDescription });\r\n }\r\n // eslint-disable-next-line\r\n }, [ props.defaultDescription ])\r\n\r\n \r\n\r\n return
\r\n {!props.lockToType ? (\r\n \r\n {getFieldDecorator('type', {\r\n initialValue: props.defaultType,\r\n rules: [{ required: true, message: 'Please select a feedback type' }],\r\n })(\r\n \r\n )}\r\n \r\n ) : null}\r\n {typeValue === 'generalfeedback' ? (\r\n \r\n {getFieldDecorator('mood')()}\r\n \r\n ) : null}\r\n {renderForm()}\r\n {(getFieldValue('type') !== undefined || props.lockToType) ? <>\r\n \r\n {getFieldDecorator('responseType', {\r\n rules: [{ required: true, message: 'Please choose an option' }]\r\n })(\r\n \r\n By Phone\r\n By Email\r\n No Response Required\r\n \r\n )}\r\n \r\n {renderResponseType(props.form, user?.attributes)}\r\n \r\n {getFieldDecorator('jobPosition')()}\r\n \r\n \r\n {getFieldDecorator('attachments', {\r\n valuePropName: 'fileList',\r\n getValueFromEvent: (e) => e.fileList\r\n })()}\r\n \r\n : null}\r\n
\r\n}\r\n\r\n/** Only the form. Does not include ability to send the feedback through a mutation. */\r\nexport const BaseFeedbackForm = Form.create({\r\n onValuesChange: (props, values) => props.onValuesChange?.(values)\r\n})(_Internal_BaseFeedbackForm)\r\n\r\n/** */\r\n// const FeedbackForm: React.FC = React.forwardRef((props, innerRef: any) => {\r\n// const [ submit, { loading } ] = useFeedbackSubmitter();\r\n\r\n// const formRef = useRef(null);\r\n// console.log('formRef', formRef.current);\r\n\r\n// return \r\n// {formRef.current ? (\r\n// \r\n// \r\n// \r\n// ) : null}\r\n// \r\n// })\r\n\r\n// export default FeedbackForm;","import { useMutation } from \"@apollo/react-hooks\";\r\nimport { message } from \"antd\";\r\nimport { UploadFile } from \"antd/lib/upload/interface\";\r\nimport { cleanGraphQLErrorMsg } from \"common/util\";\r\nimport { AuthContext } from \"context/auth\";\r\nimport gql from \"graphql-tag\";\r\nimport { useContext } from \"react\";\r\n\r\nconst MUTATION = gql`\r\nmutation SendFeedback(\r\n $type: String!\r\n $responseType: String!\r\n $expected: String\r\n $actual: String\r\n $description: String\r\n $responseEmail: AWSEmail\r\n $responsePhone: AWSPhone\r\n $attachmentKeyList: [String!]\r\n $jobPosition: String\r\n $mood: String\r\n $appUrlPath: String\r\n){\r\n SendUserFeedback(\r\n type: $type\r\n responseType: $responseType\r\n expected: $expected\r\n actual: $actual\r\n description: $description\r\n responseEmail: $responseEmail\r\n responsePhone: $responsePhone\r\n attachmentKeyList: $attachmentKeyList\r\n jobPosition: $jobPosition\r\n mood: $mood\r\n appUrlPath: $appUrlPath\r\n appName: \"Manifest Central\"\r\n )\r\n}\r\n`\r\n\r\n// Response types\r\nexport interface PhoneResponse {\r\n responseType: 'phone',\r\n responsePhone: string\r\n}\r\n\r\nexport interface EmailResponse {\r\n responseType: 'email',\r\n responseEmail: string\r\n}\r\n\r\nexport interface BugInput {\r\n type: 'bug',\r\n expected: string,\r\n actual: string\r\n}\r\n\r\nexport interface OutageInput {\r\n type: 'outage',\r\n description: string\r\n}\r\n\r\nexport interface GeneralFeedbackInput {\r\n type: 'generalfeedback',\r\n mood: string,\r\n description: string\r\n}\r\n\r\nexport interface FeatureRequestInput {\r\n type: 'featurerequest',\r\n description: string\r\n}\r\n\r\nexport interface BaseFeedbackInput {\r\n jobPosition?: string,\r\n attachments: Array\r\n}\r\n\r\nexport type FeedbackInput = (PhoneResponse | EmailResponse) & (BugInput | OutageInput | GeneralFeedbackInput | FeatureRequestInput) & BaseFeedbackInput\r\n\r\nexport interface FeedBackSubmitterOptions {\r\n onSubmitted?: () => void\r\n}\r\n\r\nexport function useFeedbackSubmitter(options?: FeedBackSubmitterOptions): [(input: FeedbackInput) => void, { loading: boolean }] {\r\n const { user } = useContext(AuthContext);\r\n const [ invokeMutation, { loading } ] = useMutation(MUTATION, {\r\n onCompleted: () => options.onSubmitted?.(),\r\n onError: (error) => message.error(\"Failed to submit feedback. \" + cleanGraphQLErrorMsg(error), 5)\r\n });\r\n\r\n function handleSubmit(input: FeedbackInput){\r\n let vars = { ...input }\r\n let attachments = input.attachments;\r\n delete vars.attachments;\r\n\r\n\r\n invokeMutation({\r\n variables: {\r\n ...vars,\r\n appUrlPath: window.location.href,\r\n attachmentKeyList: attachments && attachments.map(file => `/${user.username}/${file.name}`)\r\n },\r\n })\r\n }\r\n\r\n return [\r\n handleSubmit,\r\n {\r\n loading: loading\r\n }\r\n ]\r\n}","import { Button } from 'antd';\r\nimport Modal, { ModalProps } from 'antd/lib/modal';\r\nimport MCIcon from 'components/icon';\r\nimport React, { PropsWithChildren, useRef, useState } from 'react';\r\nimport { BaseFeedbackForm } from '.';\r\nimport { FeedbackFormProps } from './form';\r\nimport { FeedbackInput, useFeedbackSubmitter } from './hook';\r\n\r\nexport interface FeedbackFormModalProps extends Omit {\r\n feedbackFormProps?: FeedbackFormProps,\r\n onSubmitSuccessful?: () => void\r\n}\r\n\r\nconst FeedbackFormModal: React.FC = (props) => {\r\n const [ received, setReceived ] = useState(false);\r\n const formRef = useRef(null);\r\n const [ submit, { loading: submitLoading } ] = useFeedbackSubmitter({\r\n onSubmitted: () => setReceived(true)\r\n });\r\n\r\n function handleOk(e){\r\n e.stopPropagation();\r\n formRef.current.validateFieldsAndScroll((err: any, values: FeedbackInput) => {\r\n if (!err){\r\n submit(values);\r\n }\r\n })\r\n }\r\n\r\n let modalProps: ModalProps & PropsWithChildren = {\r\n bodyStyle: { minHeight: '50vh' },\r\n centered: true,\r\n destroyOnClose: true,\r\n ...props,\r\n title: \"User Feedback\" || props.title,\r\n afterClose: () => {\r\n setReceived(false);\r\n props.afterClose?.();\r\n }\r\n }\r\n\r\n if (received){\r\n modalProps.children =
\r\n \r\n

Thank you for your feedback!

\r\n {formRef.current?.getFieldValue('responseType') && formRef.current?.getFieldValue('responseType') !== 'none' ? (\r\n
\r\n We will be getting back to you soon {formRef.current?.getFieldValue('responseType') ? ` by ${formRef.current?.getFieldValue('responseType')}.` : '.'}\r\n
\r\n ) : null}\r\n
\r\n modalProps.bodyStyle = { display: 'flex', alignItems: 'center', justifyContent: 'center' }\r\n modalProps.footer=\r\n }\r\n else\r\n {\r\n modalProps.children = \r\n modalProps.onOk = handleOk;\r\n modalProps.okText = !submitLoading ? props.okText || 'Send Feedback to DataFlyt' : 'Submitting'\r\n modalProps.okButtonProps = {\r\n disabled: submitLoading\r\n }\r\n }\r\n\r\n return \r\n}\r\n\r\nexport function feedbackModalProps(): Partial{\r\n return {\r\n okText: \"Send Feedback To DataFlyt\"\r\n }\r\n}\r\n\r\nexport default FeedbackFormModal","import React, { PropsWithChildren } from 'react';\r\nimport { useQuery } from 'react-apollo';\r\nimport gql from 'graphql-tag';\r\n\r\nconst QUERY = gql`\r\n{\r\n globalFilter @client {\r\n visible\r\n customer {\r\n key\r\n label\r\n }\r\n transporter {\r\n key\r\n label\r\n }\r\n departure {\r\n key\r\n label\r\n }\r\n destination {\r\n key\r\n label\r\n }\r\n employer {\r\n key\r\n label\r\n }\r\n pax {\r\n lastName\r\n firstName\r\n }\r\n cgo {\r\n name\r\n }\r\n }\r\n}\r\n`\r\n\r\nexport interface KeyLabel {\r\n key: string,\r\n label?: string\r\n}\r\n\r\nexport interface GlobalFilterContextValue {\r\n visible: boolean,\r\n customer: KeyLabel[],\r\n transporter: KeyLabel[],\r\n departure: KeyLabel[],\r\n destination: KeyLabel[],\r\n employer: KeyLabel[],\r\n pax: {\r\n lastName?: string,\r\n firstName?: string\r\n }[],\r\n cgo: {\r\n name?: string\r\n }[]\r\n}\r\n\r\nexport const GlobalFilterContext = React.createContext(null);\r\n\r\nconst GlobalFilterProvider: React.FC> = (props) => {\r\n const { data } = useQuery(QUERY);\r\n return \r\n {props.children}\r\n \r\n}\r\n\r\nexport default GlobalFilterProvider","import { message } from \"antd\";\r\nimport { ThemeContext } from \"context/theme\";\r\nimport usePersistence from \"hooks/persistence\"\r\nimport { useContext, useEffect } from \"react\";\r\n\r\nexport interface DbShortcutsInterface {\r\n autoScrollEnabled: boolean,\r\n scrollSpeed: number,\r\n setAutoScroll?: (enabled: boolean) => void\r\n}\r\n\r\nconst DEFAULTS: DbShortcutsInterface = {\r\n autoScrollEnabled: true,\r\n scrollSpeed: 5\r\n}\r\n\r\nexport interface DbShortcutsOptions {\r\n\r\n /** Max speed of automatic scrolling. Defaults to 10. */\r\n maxScrollSpeed?: number,\r\n disableShortcuts?: ('theme' | 'auto-scroll' | 'auto-scroll-speed')[]\r\n}\r\n\r\nfunction useFbShortcuts(options?: DbShortcutsOptions): DbShortcutsInterface{\r\n\r\n let maxScrollSpeed = options?.maxScrollSpeed || 10;\r\n\r\n const { persistentData, setPersistentValue } = usePersistence('flightboard.shortcut-settings', DEFAULTS);\r\n const { themeName, changeTheme } = useContext(ThemeContext);\r\n\r\n function isDisabled(shortcut: 'theme' | 'auto-scroll' | 'auto-scroll-speed'){\r\n if (!options?.disableShortcuts){\r\n return false;\r\n }\r\n let idx = options.disableShortcuts.findIndex((s) => s === shortcut);\r\n return idx > -1\r\n }\r\n\r\n function handleKey(e: KeyboardEvent){\r\n if (document.activeElement?.tagName === 'INPUT'){\r\n // User is focused on an input. Don't allow keyboard shortcuts.\r\n return;\r\n }\r\n if (!e.ctrlKey && !e.altKey && !e.shiftKey && e.key === 'd' && !isDisabled('theme')){\r\n const newTheme = themeName === 'dark' ? 'light' : 'dark';\r\n changeTheme(newTheme);\r\n }\r\n else if (!e.ctrlKey && !e.altKey && !e.shiftKey && e.key === 's' && !isDisabled('auto-scroll')){\r\n setPersistentValue('autoScrollEnabled', !persistentData.autoScrollEnabled);\r\n if (persistentData.autoScrollEnabled){\r\n message.info({ content: 'Auto scroll disabled', key: 'autoScrollMsg' }, 1);\r\n }\r\n else\r\n {\r\n message.info({ content: 'Auto scroll enabled', key: 'autoScrollMsg' }, 1);\r\n }\r\n }\r\n else if (!e.ctrlKey && !e.shiftKey && !e.altKey && e.key === '=' && !isDisabled('auto-scroll-speed')){\r\n e.preventDefault();\r\n let newSpeed = Math.min(persistentData.scrollSpeed + 1, maxScrollSpeed);\r\n message.info({ content: 'Increased auto scroll speed to ' + newSpeed, key: 'scrollSpeedMsg' }, 1);\r\n setPersistentValue('scrollSpeed', newSpeed);\r\n }\r\n else if (!e.ctrlKey && !e.shiftKey && !e.altKey && e.key === '-' && !isDisabled('auto-scroll-speed')){\r\n e.preventDefault();\r\n let newSpeed = Math.max(persistentData.scrollSpeed - 1, 1);\r\n message.info({ content: 'Decreased auto scroll speed to ' + newSpeed, key: 'scrollSpeedMsg' }, 1);\r\n setPersistentValue('scrollSpeed', newSpeed);\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n document.addEventListener('keyup', handleKey);\r\n return () => {\r\n document.removeEventListener('keyup', handleKey);\r\n }\r\n }, [ themeName, persistentData ])\r\n\r\n return {\r\n ...persistentData,\r\n setAutoScroll: (enabled) => setPersistentValue('autoScrollEnabled', enabled)\r\n }\r\n}\r\n\r\nexport default useFbShortcuts","import { AutoPaginator } from \"hooks/apollo-extensions/useAutoPaginatedQuery\";\r\n\r\nexport async function fetchMoreAndGetToken(fetchMore: any, queryVars: any, token: string, queryKey: string){\r\n let newVars = {\r\n ...queryVars,\r\n bookmark: token,\r\n }\r\n let newResult;\r\n await fetchMore({\r\n variables: newVars,\r\n updateQuery: (prev, { fetchMoreResult }) => {\r\n if (!fetchMoreResult[queryKey]) return prev;\r\n if (AutoPaginator.isOnLastPage(prev[queryKey].bookmark, fetchMoreResult[queryKey].bookmark)){\r\n newResult = prev;\r\n return prev;\r\n }\r\n newResult = {\r\n ...prev,\r\n [queryKey]: {\r\n ...prev[queryKey],\r\n ...fetchMoreResult[queryKey],\r\n docs: [\r\n ...prev[queryKey].docs,\r\n ...fetchMoreResult[queryKey].docs\r\n ]\r\n }\r\n }\r\n return newResult;\r\n }\r\n })\r\n let newToken = newResult?.[queryKey]?.bookmark;\r\n if (newToken === 'nil'){\r\n newToken = null;\r\n }\r\n return newToken;\r\n}","import { Descriptions, Switch, Tooltip, Typography } from 'antd';\r\nimport { ThemeContext } from 'context/theme';\r\nimport React, { useContext } from 'react';\r\n\r\nconst { Text: T } = Typography;\r\n\r\nconst ShortcutDescriptions: React.FC<{}> = () => {\r\n const { themeName, changeTheme } = useContext(ThemeContext);\r\n\r\n return \r\n \r\n Press Ctrl and + to zoom in or Ctrl and - to zoom out.\r\n \r\n \r\n Press + to increase scroll speed or - to decrease scroll speed.\r\n \r\n \r\n Press S to toggle automatic scrolling (on by default)\r\n \r\n \r\n Press F11 to toggle fullscreen\r\n \r\n \r\n
\r\n Press D to toggle the dark theme\r\n \r\n changeTheme(checked ? 'dark' : 'light')}\r\n style={{ float: 'right' }}\r\n />\r\n \r\n
\r\n
\r\n
\r\n}\r\n\r\nexport default ShortcutDescriptions","import { Alert, Button, Icon, Layout, Popover, Spin, Typography } from 'antd';\r\nimport { ColumnProps } from 'antd/lib/table';\r\nimport { capitalize, capitalizeWords, castArray, cleanGraphQLErrorMsg, getPersonFullName } from 'common/util';\r\nimport ETable from 'components/enchanced-antd-table';\r\nimport { OrgDataContext } from 'context/orgData';\r\nimport gql from 'graphql-tag';\r\nimport React, { HTMLAttributes, useContext, useEffect, useRef, useState } from 'react';\r\nimport { useQuery } from 'react-apollo';\r\nimport useFbShortcuts from './fb-shortcut-listener';\r\nimport './flightboard-page.less';\r\nimport moment from 'moment';\r\nimport useAutoPaginatedQuery from 'hooks/apollo-extensions/useAutoPaginatedQuery';\r\nimport { fetchMoreAndGetToken } from 'components/live-2/util';\r\nimport { NetworkStatus } from 'apollo-client';\r\nimport ShortcutDescriptions from './shortcut-descriptions';\r\n\r\nconst POLL_INTERVAL = 10000;\r\n\r\nconst { Header, Footer } = Layout;\r\n\r\nconst { Title, Text } = Typography;\r\n\r\nconst BASE_CLS = 'mc-flightboard';\r\n\r\nexport interface FlightboardPageProps {\r\n locationID: string\r\n}\r\n\r\nconst QUERY = gql`\r\nquery GetPax(\r\n $filter: PassengersFilterInput\r\n $bookmark: String\r\n $limit: Int\r\n $skip: Int\r\n){\r\n passengers(\r\n filter: $filter\r\n bookmark: $bookmark\r\n limit: $limit\r\n skip: $skip\r\n ) {\r\n bookmark\r\n docs {\r\n _id,\r\n ... on PaxNode {\r\n lastName,\r\n firstName,\r\n personID {\r\n _id\r\n extraBroadState\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n },\r\n tpID {\r\n _id\r\n name\r\n }\r\n paxWeight,\r\n bagWeight,\r\n checkInType,\r\n bagCount,\r\n checkedInTime,\r\n scheduledFlightDate,\r\n destinationID {\r\n _id, name\r\n }\r\n departureID {\r\n _id, name\r\n },\r\n transitType\r\n lastIsnResultWithHeader {\r\n success,\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n quickCheckStatus\r\n errorMessage\r\n reason\r\n }\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n quickCheckStatus,\r\n errorMessage\r\n reason\r\n }\r\n },\r\n authorization {\r\n onWhiteList\r\n noFlyListed\r\n brdRestriction_Isn {\r\n status\r\n }\r\n brdRestriction_SafetyCard {\r\n status\r\n }\r\n brdRestriction_HuetCard {\r\n status\r\n }\r\n brdRestriction_SteelToes {\r\n status\r\n }\r\n brdRestriction_Twic {\r\n status\r\n }\r\n brdRestriction_NonPreferred {\r\n status\r\n }\r\n brdRestriction_Hazmat {\r\n status\r\n }\r\n brdRestriction_NoFlyListed {\r\n status\r\n }\r\n brdRestriction_EbsCard {\r\n status\r\n }\r\n brdRestriction_Illness {\r\n status\r\n }\r\n brdRestriction_Quarantined {\r\n status\r\n }\r\n }\r\n currentCarrierID {\r\n _id\r\n desig\r\n state\r\n estDepartureTime\r\n }\r\n }\r\n }\r\n }\r\n}`;\r\n\r\nconst FBDataContext = React.createContext({ rows: [], currTime: null });\r\n\r\nclass FBTableRow extends React.Component> {\r\n render(): React.ReactNode {\r\n return \r\n {({ rows, currTime }) => {\r\n let dataRowKey = this.props['data-row-key'];\r\n let row = rows.find((row) => row._id === dataRowKey);\r\n if (!row || !row.currentCarrierID || !row.currentCarrierID.estDepartureTime){\r\n return {this.props.children}\r\n }\r\n\r\n let estTime = moment(row.currentCarrierID.estDepartureTime, 'HH:mm:ss');\r\n let currTimeMoment = moment(currTime, 'MM/DD/YYYY HH:mm');\r\n let className = '';\r\n if (currTimeMoment.isAfter(moment(estTime).subtract(30, 'minutes').subtract(1, 'minute'))){\r\n className = BASE_CLS + '-est-in-30-minutes';\r\n }\r\n else if (currTimeMoment.isAfter(moment(estTime).subtract(1, 'hour').subtract(1, 'minute'))){\r\n className = BASE_CLS + '-est-in-1-hour';\r\n }\r\n else if (currTimeMoment.isAfter(moment(estTime).subtract(2, 'hour').subtract(1, 'minute'))){\r\n className = BASE_CLS + '-est-in-2-hours';\r\n }\r\n return {this.props.children}\r\n }}\r\n \r\n }\r\n}\r\n\r\nconst FlightboardPage: React.FC = (props) => {\r\n const { scrollSpeed, autoScrollEnabled, setAutoScroll } = useFbShortcuts();\r\n const [ currTime, setCurrTime ] = useState(\"\");\r\n const logoAltRef = useRef(null);\r\n\r\n function updateCurrTime(currTime?: string): string {\r\n let newCurrTime = moment().format('MM/DD/YYYY HH:mm');\r\n if (currTime !== newCurrTime){\r\n setCurrTime(newCurrTime);\r\n return newCurrTime;\r\n }\r\n return currTime\r\n }\r\n\r\n useEffect(() => {\r\n updateCurrTime();\r\n\r\n let currTime = '';\r\n\r\n // Repeat updateCurrTime every second\r\n let interval = window.setInterval(() => {\r\n currTime = updateCurrTime(currTime);\r\n }, 1000);\r\n\r\n return () => {\r\n\r\n // On unmount\r\n window.clearInterval(interval);\r\n }\r\n }, [])\r\n\r\n const orgData = useContext(OrgDataContext);\r\n\r\n const queryVars = {\r\n filter: {\r\n transporter: orgData.transporterID,\r\n onlyShowLive: true,\r\n transitTypes: ['OUTBOUND'],\r\n checkInTypes: ['CSR', 'KIOSK', 'LIVE_EDIT', 'LOCKED'],\r\n departures: [props.locationID]\r\n }\r\n }\r\n\r\n const { data: locData, loading: locDataLoading } = useQuery(gql`\r\n query GetLocationName($locID: ID!){\r\n location: getLocation(_id: $locID){\r\n _id\r\n name\r\n }\r\n }\r\n `, {\r\n variables: {\r\n locID: props.locationID\r\n },\r\n fetchPolicy: 'cache-first'\r\n });\r\n\r\n const { data, networkStatus, error, refetch, initialPaginationRunning, paginating, paginationError, fetchMore, startPolling, stopPolling } = useAutoPaginatedQuery(QUERY, {\r\n variables: queryVars,\r\n fetchPolicy: 'cache-and-network',\r\n errorPolicy: 'all',\r\n supressDataUpdates: true,\r\n // onError: () => dispatch({ type: TYPES.OPEN_ERROR_MSG }),\r\n // onPaginationError: () => dispatch({ type: TYPES.OPEN_ERROR_MSG }),\r\n getNextToken: async (token) => await fetchMoreAndGetToken(fetchMore, queryVars, token, 'passengers'),\r\n getTokenFromData: (data) => {\r\n let token = data?.passengers?.bookmark;\r\n if (token === 'nil'){\r\n token = null;\r\n }\r\n return token;\r\n }\r\n })\r\n\r\n const rows = castArray(data?.passengers?.docs)\r\n .sort((a, b) => getPersonFullName(a).localeCompare(getPersonFullName(b)));\r\n const loc = locData?.location;\r\n\r\n const columns: ColumnProps[] = [\r\n {\r\n title: 'PASSENGER NAME',\r\n key: 'paxName',\r\n render: (_, record) => getPersonFullName(record)\r\n },\r\n {\r\n title: 'ASSIGNED FLIGHT',\r\n key: 'assignedFlight',\r\n dataIndex: 'currentCarrierID',\r\n render: (carrier) => carrier?.desig\r\n },\r\n {\r\n title: 'DEPARTURE TIME',\r\n key: 'departureTime',\r\n dataIndex: 'currentCarrierID',\r\n render: (carrier) => {\r\n if (!carrier?.estDepartureTime){\r\n return null;\r\n }\r\n let estTime = moment(carrier.estDepartureTime, 'HH:mm:ss');\r\n return {estTime.format('HH:mm')};\r\n }\r\n },\r\n {\r\n title: 'DESTINATION',\r\n key: 'destination',\r\n dataIndex: 'destinationID',\r\n render: (dest) => dest?.name\r\n }\r\n ]\r\n\r\n return \r\n
\r\n \r\n {\r\n e.target.style.display = 'none';\r\n logoAltRef.current.style.display = 'inline-block' ;\r\n }}\r\n />\r\n
\r\n {orgData.transporter?.name}\r\n
\r\n
\r\n {locDataLoading ? <Spin indicator={<Icon type='loading' />} /> : capitalizeWords(loc?.name, true, /^([A-Z])+[0-9]+/)} Departures\r\n \r\n
\r\n {error || paginationError ? (\r\n \r\n ) : null}\r\n
\r\n \r\n record._id}\r\n dataSource={rows}\r\n columns={columns}\r\n flexMode\r\n stickyHeader\r\n groupByColKey='lastName'\r\n transformGroupValue={(lastName: string) => lastName?.charAt(0)}\r\n components={{\r\n body: {\r\n row: FBTableRow\r\n }\r\n }}\r\n groupHeaderType={(groupValue, _, idx) => \r\n \r\n {String(groupValue).toUpperCase()}\r\n \r\n }\r\n autoScroll={{\r\n hideIdleMouse: true,\r\n enabled: autoScrollEnabled,\r\n speed: scrollSpeed,\r\n onScrollReachEnd: () => refetch && refetch(),\r\n onScrollNeeded: (needed) => {\r\n if (needed){\r\n console.debug('Scrolling is needed. Disabling polling.');\r\n stopPolling();\r\n }\r\n else\r\n {\r\n console.debug('Scrolling is not needed. Enabling polling.');\r\n startPolling(POLL_INTERVAL);\r\n }\r\n }\r\n }}\r\n loading={{\r\n spinning: initialPaginationRunning,\r\n indicator: ,\r\n size: 'large'\r\n }}\r\n />\r\n \r\n
\r\n
\r\n
\r\n } placement=\"topRight\">\r\n
Controls
\r\n
\r\n \r\n {paginating || networkStatus === NetworkStatus.loading || networkStatus === NetworkStatus.fetchMore ? (\r\n Refreshing data...\r\n ) : null}\r\n
\r\n
\r\n {currTime}\r\n
\r\n
\r\n \r\n DEPARTURE TIME:\r\n WITHIN 60 MINUTES\r\n WITHIN 30 MINUTES\r\n \r\n
\r\n
\r\n
\r\n}\r\n\r\nexport default FlightboardPage","import { Button, Card, Descriptions, Form, Layout, Switch, Tooltip, Typography } from 'antd';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\nimport LocationSelect from 'components/form/select/LocationSelect/LocationSelect2';\r\nimport usePersistence from 'hooks/persistence';\r\nimport React, { useContext } from 'react';\r\nimport './location-page.less';\r\nimport { ThemeContext } from 'context/theme';\r\nimport useFbShortcuts from './fb-shortcut-listener';\r\nimport { castToLabelInValue, getLabelInValue } from 'common/form';\r\nimport ShortcutDescriptions from './shortcut-descriptions';\r\n\r\nconst BASE_CLS = 'mc-fb-location';\r\n\r\nexport interface FlightboardLocationSelectPageProps extends FormComponentProps {\r\n onSubmit?: (locationID: string) => void\r\n}\r\n\r\nconst FlightboardLocationSelectPage_Internal: React.FC = (props) => {\r\n const { getFieldDecorator, validateFieldsAndScroll } = props.form;\r\n const { getPersistentValue, setPersistentValues } = usePersistence('flightboard.location-form-data');\r\n useFbShortcuts();\r\n\r\n return \r\n
\r\n View Flight Board\r\n \r\n
{\r\n e.preventDefault();\r\n validateFieldsAndScroll((err, values) => {\r\n if (!err){\r\n setPersistentValues(values);\r\n props.onSubmit?.(values.locationID.key)\r\n }\r\n })\r\n }}>\r\n \r\n {getFieldDecorator('locationID', {\r\n rules: [{ required: true, message: 'Please choose a location' }],\r\n initialValue: castToLabelInValue(getPersistentValue('locationID'))\r\n })(\r\n \r\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 FlightboardLocationSelectPage = Form.create()(FlightboardLocationSelectPage_Internal);\r\n\r\nFlightboardLocationSelectPage.displayName = 'Form(FlightboardLocationSelectPage)';\r\n\r\nexport default FlightboardLocationSelectPage","import { Alert } from 'antd';\r\nimport { NetworkStatus } from 'apollo-client';\r\nimport { getPilotName } from 'common/util';\r\nimport { getAreaBlock } from 'common/util-ts';\r\nimport CenteredLoadingScreen from 'components/CenteredLoadingScreen';\r\nimport AircraftDetails from 'components/flytwatch/aircraft-details';\r\nimport gql from 'graphql-tag';\r\nimport React from 'react';\r\nimport { useQuery } from 'react-apollo';\r\n\r\ninterface FWAircraftDetailsPageProps {\r\n dispatchID: string\r\n}\r\n\r\nconst QUERY_AIRCRAFT_DETAILS = gql`\r\nquery AircraftDetails($id: ID!){\r\n GetDispatchByID(id: $id){\r\n _id\r\n status\r\n ata\r\n eta\r\n ato\r\n pob\r\n checkTime\r\n aircraftID\r\n createdBy\r\n aircraftDoc {\r\n _id\r\n tailNum\r\n }\r\n contractDoc {\r\n _id\r\n name\r\n }\r\n departingID\r\n departingDoc {\r\n _id\r\n name\r\n block\r\n field\r\n type\r\n resolvedCoordinates {\r\n latitude\r\n longitude\r\n }\r\n }\r\n destinationID\r\n destinationDoc {\r\n _id\r\n name\r\n block\r\n field\r\n type\r\n resolvedCoordinates {\r\n latitude\r\n longitude\r\n }\r\n }\r\n pilotDoc {\r\n _id\r\n name {\r\n firstName\r\n lastName\r\n }\r\n }\r\n name\r\n }\r\n}\r\n`\r\n\r\nconst FWAircraftDetailsPage: React.FC = (props) => {\r\n\r\n const { data, networkStatus, error } = useQuery(QUERY_AIRCRAFT_DETAILS, {\r\n variables: {\r\n id: props.dispatchID \r\n },\r\n fetchPolicy: 'cache-and-network',\r\n pollInterval: 10000\r\n })\r\n\r\n let af = data?.GetDispatchByID;\r\n\r\n if (!af && networkStatus === NetworkStatus.loading){\r\n return \r\n }\r\n\r\n if (error){\r\n return \r\n }\r\n\r\n if (!af){\r\n return \r\n }\r\n\r\n let acData = {\r\n aircraftID: af.aircraftID,\r\n tailNum: af.aircraftDoc.tailNum,\r\n departure: af.departingDoc?.name,\r\n departureID: af.departingDoc?._id,\r\n departureAreaBlock: getAreaBlock(af.departingDoc),\r\n departureCoordinates: af.departingDoc?.resolvedCoordinates,\r\n destination: af.destinationDoc?.name,\r\n destinationID: af.destinationDoc?._id,\r\n destinationAreaBlock: getAreaBlock(af.destinationDoc),\r\n destinationCoordinates: af.destinationDoc?.resolvedCoordinates,\r\n ato: af.ato,\r\n eta: af.eta,\r\n ata: af.ata,\r\n pob: af.pob,\r\n contract: af.contractDoc?.name,\r\n pilot: getPilotName(af.pilotDoc),\r\n status: af.status,\r\n createdBy: af.createdBy,\r\n name: af.name\r\n }\r\n\r\n let title = 'Flight details for ' + acData?.tailNum;\r\n\r\n document.title = title;\r\n\r\n return
\r\n \r\n
\r\n}\r\n\r\nexport default FWAircraftDetailsPage;","import { Icon, Menu } from 'antd';\r\nimport useUserGroups from 'hooks/useUserGroups';\r\nimport React from 'react';\r\n\r\nfunction EmployerNav(props){\r\n const { ...restProps } = props;\r\n\r\n const [ userGroups ] = useUserGroups();\r\n\r\n return \r\n \r\n \r\n Passengers\r\n \r\n Master Data}>\r\n Personnel\r\n \r\n {userGroups.findIndex(g => g.includes('management') || g === 'flytsuite.master.all') > -1 &&\r\n Management}>\r\n {userGroups.findIndex(g => g.includes('management.all') || g.includes('management.emailtriggers.all') || g === 'flytsuite.master.all') > -1 && (\r\n Email Triggers\r\n )}\r\n \r\n }\r\n \r\n}\r\n\r\nexport default EmployerNav","import { Form, Input, InputNumber } from 'antd';\r\nimport React from 'react';\r\nimport { DragSource, DropTarget } from 'react-dnd';\r\n\r\nconst FormItem = Form.Item;\r\nexport const EditableContext = React.createContext();\r\n\r\nfunction dragDirection(\r\n dragIndex,\r\n hoverIndex,\r\n initialClientOffset,\r\n clientOffset,\r\n sourceClientOffset,\r\n ) {\r\n const hoverMiddleY = (initialClientOffset.y - sourceClientOffset.y) / 2;\r\n const hoverClientY = clientOffset.y - sourceClientOffset.y;\r\n if (dragIndex < hoverIndex && hoverClientY > hoverMiddleY) {\r\n return 'downward';\r\n }\r\n if (dragIndex > hoverIndex && hoverClientY < hoverMiddleY) {\r\n return 'upward';\r\n }\r\n}\r\n\r\nconst rowSource = {\r\n beginDrag(props) {\r\n return {\r\n index: props.index,\r\n };\r\n },\r\n };\r\n \r\nconst rowTarget = {\r\n drop(props, monitor) {\r\n const dragIndex = monitor.getItem().index;\r\n const hoverIndex = props.index;\r\n\r\n // Don't replace items with themselves\r\n if (dragIndex === hoverIndex) {\r\n return;\r\n }\r\n\r\n // Time to actually perform the action\r\n props.moveRow(dragIndex, hoverIndex);\r\n\r\n // Note: we're mutating the monitor item here!\r\n // Generally it's better to avoid mutations,\r\n // but it's good here for the sake of performance\r\n // to avoid expensive index searches.\r\n monitor.getItem().index = hoverIndex;\r\n },\r\n};\r\n\r\nexport class EditableRow extends React.Component {\r\n render(){\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n}\r\n\r\nexport class DraggableEditableRow extends React.Component {\r\n render() {\r\n const {\r\n isOver,\r\n connectDragSource,\r\n connectDropTarget,\r\n moveRow,\r\n dragRow,\r\n clientOffset,\r\n sourceClientOffset,\r\n initialClientOffset,\r\n form,\r\n ...restProps\r\n } = this.props;\r\n const style = { ...restProps.style, cursor: 'move' };\r\n \r\n let className = restProps.className;\r\n if (isOver && initialClientOffset) {\r\n const direction = dragDirection(\r\n dragRow.index,\r\n restProps.index,\r\n initialClientOffset,\r\n clientOffset,\r\n sourceClientOffset\r\n );\r\n if (direction === 'downward') {\r\n className += ' drop-over-downward';\r\n }\r\n if (direction === 'upward') {\r\n className += ' drop-over-upward';\r\n }\r\n }\r\n return (\r\n \r\n {connectDragSource(\r\n connectDropTarget(\r\n \r\n )\r\n )\r\n }\r\n \r\n )\r\n }\r\n }\r\n\r\nexport const EditableFormRow = Form.create()(EditableRow);\r\n\r\nexport const DraggableEditableFormRow = Form.create()(DraggableEditableRow);\r\n\r\nexport const EditableFormRowWithDrag = DropTarget('row', rowTarget, (connect, monitor) => {\r\n return {\r\n connectDropTarget: connect.dropTarget(),\r\n isOver: monitor.isOver(),\r\n sourceClientOffset: monitor.getSourceClientOffset(),\r\n }\r\n })(\r\n DragSource('row', rowSource, (connect, monitor) => {\r\n return {\r\n connectDragSource: connect.dragSource(),\r\n dragRow: monitor.getItem(),\r\n clientOffset: monitor.getClientOffset(),\r\n initialClientOffset: monitor.getInitialClientOffset(),\r\n }\r\n })(DraggableEditableFormRow)\r\n );\r\n\r\nexport class EditableCell extends React.Component {\r\n getInput = () => {\r\n if (this.props.inputType === 'number') {\r\n if(this.props.cancelButton){\r\n return ;\r\n }\r\n return ;\r\n }\r\n return ;\r\n };\r\n\r\n render() {\r\n const {\r\n editing,\r\n required = false,\r\n message,\r\n dataIndex,\r\n title,\r\n inputType,\r\n inputProps,\r\n record,\r\n index,\r\n ...restProps\r\n } = this.props;\r\n\r\n return (\r\n \r\n {(form) => {\r\n const { getFieldDecorator } = form;\r\n return (\r\n \r\n {editing ? (\r\n \r\n {getFieldDecorator(dataIndex, {\r\n rules: [{\r\n required,\r\n message: message ? message : `Please Input ${title}!`,\r\n }],\r\n initialValue: record[dataIndex],\r\n })(this.getInput())}\r\n \r\n ) : restProps.children}\r\n \r\n );\r\n }}\r\n \r\n );\r\n }\r\n}\r\n\r\n// const EditableTable = props => (\r\n// \r\n// )\r\n\r\n// export default EditableTable\r\n\r\n// class EditableTable extends React.Component {\r\n// constructor(props) {\r\n// super(props);\r\n// this.state = { editingKey: '' };\r\n// }\r\n\r\n// isEditing = (record) => {\r\n// return record.key === this.state.editingKey;\r\n// };\r\n\r\n// edit(key) {\r\n// this.setState({ editingKey: key });\r\n// }\r\n\r\n// save(form, key) {\r\n// form.validateFields((error, row) => {\r\n// if (error) {\r\n// return;\r\n// }\r\n// this.props.onSave(row)\r\n// const newData = [...this.state.data];\r\n// const index = newData.findIndex(item => key === item.key);\r\n// if (index > -1) {\r\n// const item = newData[index];\r\n// newData.splice(index, 1, {\r\n// ...item,\r\n// ...row,\r\n// });\r\n// this.setState({ data: newData, editingKey: '' });\r\n// } else {\r\n// newData.push(row);\r\n// this.setState({ data: newData, editingKey: '' });\r\n// }\r\n// });\r\n// }\r\n\r\n// cancel = () => {\r\n// this.setState({ editingKey: '' });\r\n// };\r\n\r\n// render() {\r\n// const components = {\r\n// body: {\r\n// row: this.props.dragSort ? EditableFormRowWithDrag : EditableFormRow,\r\n// cell: EditableCell,\r\n// },\r\n// };\r\n\r\n// return (\r\n// \r\n// );\r\n// }\r\n// }\r\n\r\n// export default EditableTable\r\n\r\n// ReactDOM.render(, mountNode);","import { LiveEditedState } from '__generated__/graphql/types';\r\nimport {FlightLeg} from \"../../schema\";\r\n\r\nexport enum TransportStateEnum {\r\n NONE = 'NONE',\r\n ACTIVE = 'ACTIVE',\r\n OVERNIGHT = 'OVERNIGHT',\r\n LOCKED = 'LOCKED',\r\n DEPARTED = 'DEPARTED',\r\n RETIRED = 'RETIRED',\r\n FINALIZED = 'FINALIZED',\r\n SCHEDULED = 'SCHEDULED',\r\n STOLEN = 'STOLEN',\r\n}\r\n\r\nexport interface Transport {\r\n _id: string,\r\n _rev: string,\r\n timeOfDeparture?: string,\r\n state?: TransportStateEnum,\r\n contract?: string,\r\n paxIDList?: any[],\r\n cgoIDList?: any[],\r\n legs?: {[key: string]: FlightLeg},\r\n firstLegUsableWt?: number,\r\n lastKnownController?: any,\r\n stolenByController?: any,\r\n liveEditedState?: LiveEditedState,\r\n}","import MCIcon from 'components/icon';\r\nimport React, {HTMLAttributes} from 'react';\r\nimport cn from 'classnames';\r\nimport './style.less';\r\nimport {TransportStateEnum} from \"common/types/transport\";\r\n\r\nexport interface FlightStateProps extends HTMLAttributes {\r\n state?: TransportStateEnum,\r\n size?: 'large'\r\n}\r\n\r\nconst FlightState = React.forwardRef((props, ref) => {\r\n const { state, size, ...restProps } = props;\r\n let iconName, iconClassName = 'mc-flight-state-icon mc-flight-state-icon-' + state;\r\n let textColor = null;\r\n\r\n if (size){\r\n iconClassName += ' mc-flight-state-icon-lg';\r\n }\r\n\r\n // Icon switch\r\n switch (state){\r\n case TransportStateEnum.LOCKED:\r\n iconName = 'lock';\r\n break;\r\n case TransportStateEnum.OVERNIGHT:\r\n iconName = 'moon';\r\n break;\r\n case TransportStateEnum.DEPARTED:\r\n iconName = 'helicopter-flight';\r\n break;\r\n }\r\n\r\n //Color switch\r\n switch (state){\r\n case TransportStateEnum.ACTIVE:\r\n textColor = 'green';\r\n break;\r\n case TransportStateEnum.OVERNIGHT:\r\n textColor = 'purple';\r\n break;\r\n case TransportStateEnum.LOCKED:\r\n textColor = 'yellow';\r\n break;\r\n case TransportStateEnum.DEPARTED:\r\n case TransportStateEnum.RETIRED:\r\n case TransportStateEnum.FINALIZED:\r\n textColor = 'red';\r\n break;\r\n case TransportStateEnum.SCHEDULED:\r\n textColor = 'blue';\r\n break;\r\n }\r\n\r\n if (iconName){\r\n return \r\n \r\n {state}\r\n \r\n }\r\n return {state};\r\n})\r\n\r\nexport default FlightState","import React from 'react';\r\nimport { Button, Row, Col } from 'antd';\r\nimport pluralize from 'pluralize';\r\nimport { classNames } from 'common/util';\r\n\r\nclass BoardingRestrictionButton extends React.Component {\r\n render(){\r\n const { data, ...rest } = this.props;\r\n const auth = data.authorization;\r\n const getRestrictions = () => {\r\n if (typeof auth !== 'object') return []\r\n const restrictions = Object.entries(auth).filter(\r\n r => r[0].startsWith('brdRestriction') && r[0] !== 'brdRestriction_Isn' && r[1] && r[1].status !== 'NOT_APPLICABLE' && r[1].status !== 'MET_REQUIREMENT'\r\n );\r\n return restrictions\r\n }\r\n const restrictions = getRestrictions();\r\n var buttonChildren;\r\n if (restrictions.length){\r\n const notOverridden = restrictions.filter(r => r[1].status !== 'OVERRIDDEN');\r\n const overridden = restrictions.filter(r => r[1].status === 'OVERRIDDEN');\r\n buttonChildren = (\r\n \r\n {notOverridden.length ? (\r\n \r\n {notOverridden.length} {pluralize('RESTRICTION', notOverridden.length)}\r\n \r\n ) : null}\r\n {(!notOverridden.length && overridden.length) ? (\r\n \r\n {overridden.length} {pluralize('OVERRIDE', overridden.length)}\r\n \r\n ) : null}\r\n \r\n )\r\n }else{\r\n buttonChildren = 'NO RESTRICTIONS'\r\n }\r\n return (\r\n \r\n )\r\n }\r\n}\r\n\r\nexport default BoardingRestrictionButton","import React from 'react';\r\nimport { Button, Popover } from 'antd';\r\nimport './DestinationList.less';\r\nimport cn from 'classnames';\r\nimport {exportTextInRef} from \"common/util/export-text-in-ref\";\r\n\r\nconst DestArrow = ({ children, order }) => (\r\n
\r\n {order > 0 ? (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ) : null}\r\n
\r\n {children}\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n)\r\n\r\n/**\r\n *\r\n * @type {React.ForwardRefExoticComponent & React.RefAttributes>}\r\n */\r\nconst DestinationList = React.forwardRef(({ data }, ref) => {\r\n const truncatedData = data.slice(0, 5);\r\n const isTruncated = truncatedData.length < data.length;\r\n\r\n const text = data?.map(dest => dest).join(' -> ');\r\n const newRef = exportTextInRef(text, ref);\r\n\r\n return (\r\n
\r\n {truncatedData.map((dest, i) => (\r\n {dest}\r\n ))}\r\n {isTruncated && (\r\n \r\n {data.slice(5).map((dest, i) => (\r\n {dest}\r\n ))}\r\n
\r\n }>\r\n \r\n \r\n )}\r\n \r\n )\r\n})\r\n\r\nexport default DestinationList","// TODO: Deprecate this\r\nimport React from \"react\";\r\n\r\nexport function getISNStatus(pax: any): { text: string, backgroundColor?: string, textColor?: string } {\r\n if (pax){\r\n var selectedResult = pax.lastIsnResultWithHeader && pax.lastIsnResultWithHeader.selectedResult;\r\n var overridden = pax.authorization && pax.authorization.brdRestriction_Isn && pax.authorization.brdRestriction_Isn.status === 'OVERRIDDEN';\r\n }\r\n var qcs: string;\r\n if (overridden){\r\n qcs = 'overridden'\r\n }\r\n else if (selectedResult && typeof selectedResult.quickCheckStatus === 'string'){\r\n qcs = selectedResult.quickCheckStatus.toLowerCase();\r\n if(selectedResult.isnStatus){\r\n if(selectedResult.isnStatus.shortLabel === 'DISA BYPASS'){\r\n qcs = selectedResult.isnStatus.shortLabel.toLowerCase();\r\n }\r\n }\r\n if (selectedResult.reason === \"WHITELISTED\"){\r\n qcs = \"WHITELISTED\";\r\n }\r\n }\r\n if (pax && pax.isnCheckError){\r\n var errMessage = pax.isnCheckError.message;\r\n }\r\n if (errMessage && !pax.isnCheckRunning){\r\n errMessage = errMessage.replace('GraphQL error: NotFoundError: ', '')\r\n const noCredentials = errMessage.includes('No credentials') ? true : false;\r\n let messageSmall = errMessage.substring(0, 10);\r\n if (errMessage.length > messageSmall){\r\n messageSmall = messageSmall + '...';\r\n }\r\n if (noCredentials){\r\n messageSmall = 'No Credentials'\r\n }\r\n return {\r\n text: messageSmall\r\n }\r\n }\r\n switch (qcs) {\r\n case 'disa bypass':\r\n return {\r\n text:'DISA',\r\n backgroundColor: '#bbffff',\r\n textColor: 'black'\r\n }\r\n case 'green':\r\n return {\r\n text: 'GREEN',\r\n backgroundColor: '#52c41a',\r\n textColor: 'white'\r\n }\r\n case 'red':\r\n return {\r\n text: 'RED',\r\n backgroundColor: '#f5222d',\r\n textColor: 'white'\r\n }\r\n case 'multi':\r\n return {\r\n text: 'MULTIPLE RESULTS',\r\n textColor: 'white',\r\n backgroundColor: '#faad14'\r\n }\r\n case 'overridden':\r\n return {\r\n text: 'OVERRIDDEN',\r\n textColor: 'white',\r\n backgroundColor: '#1890ff'\r\n }\r\n default:\r\n let text = 'NO ISN RESULT';\r\n let textColor: string;\r\n if (pax && pax.lastIsnResultWithHeader && pax.lastIsnResultWithHeader.error_message){\r\n text = pax.lastIsnResultWithHeader.error_message;\r\n textColor = 'red';\r\n }\r\n return {\r\n text: text,\r\n textColor\r\n };\r\n }\r\n}\r\n\r\nexport type ISNPassFail = { passed: boolean, reason: string, pax: any, running: false } | { running: true, pax: any }\r\n\r\nexport function getISNPassFail(pax: any): null | ISNPassFail {\r\n if (!pax) return null;\r\n\r\n if (pax.isnCheckRunning){\r\n return {\r\n running: true,\r\n pax: pax\r\n }\r\n }\r\n\r\n const selectedResult = pax.lastIsnResultWithHeader && pax.lastIsnResultWithHeader.selectedResult;\r\n const overridden = pax.authorization && pax.authorization.brdRestriction_Isn && pax.authorization.brdRestriction_Isn.status === 'OVERRIDDEN';\r\n\r\n var qcs: string;\r\n if (overridden){\r\n qcs = 'overridden'\r\n }\r\n else if (selectedResult && typeof selectedResult.quickCheckStatus === 'string'){\r\n qcs = selectedResult.quickCheckStatus.toLowerCase();\r\n if(selectedResult.isnStatus){\r\n if(selectedResult.isnStatus.shortLabel === 'DISA BYPASS'){\r\n qcs = selectedResult.isnStatus.shortLabel.toLowerCase();\r\n }\r\n }\r\n if (selectedResult.reason === \"WHITELISTED\"){\r\n qcs = \"whitelisted\";\r\n }\r\n }\r\n if (pax.isnCheckError && !overridden){\r\n var errMessage = pax.isnCheckError.message;\r\n }\r\n if (errMessage && !pax.isnCheckRunning){\r\n errMessage = errMessage.replace('GraphQL error: NotFoundError: ', '')\r\n const noCredentials = errMessage.includes('No credentials') ? true : false;\r\n let messageSmall = errMessage.substring(0, 10);\r\n if (errMessage.length > messageSmall){\r\n messageSmall = messageSmall + '...';\r\n }\r\n if (noCredentials){\r\n messageSmall = 'No Credentials'\r\n }\r\n\r\n return {\r\n passed: false,\r\n reason: messageSmall,\r\n pax: pax,\r\n running: false\r\n };\r\n }\r\n\r\n // Fail\r\n if (String(qcs).includes('red') || String(qcs).includes('multi')){\r\n return {\r\n passed: false,\r\n reason: qcs,\r\n pax: pax,\r\n running: false\r\n }\r\n }\r\n\r\n return {\r\n passed: true,\r\n reason: qcs,\r\n pax: pax,\r\n running: false\r\n }\r\n}","import { Button, Icon, Spin } from 'antd';\r\nimport { classNames } from 'common/util';\r\nimport React from 'react';\r\nimport {getISNPassFail} from \"common/isn\";\r\n\r\nconst buttonStyle = {\r\n color: 'white',\r\n}\r\n\r\n// TODO: Unify with getISNStatus in src/common/isn/index.tsx\r\nconst getIsnType = pax => {\r\n\r\n const passFail = getISNPassFail(pax);\r\n\r\n const reason = passFail && passFail.reason;\r\n\r\n switch (reason) {\r\n case 'disa bypass':\r\n return {\r\n children:'DISA',\r\n style: {\r\n ...buttonStyle,\r\n color: 'black',\r\n backgroundColor: '#bbffff',\r\n borderColor: '#bbffff'\r\n }\r\n }\r\n case 'green':\r\n return {\r\n children: 'GREEN',\r\n style: {\r\n ...buttonStyle,\r\n backgroundColor: '#52c41a',\r\n borderColor: '#52c41a'\r\n }\r\n }\r\n case 'green – waived':\r\n case 'green waived':\r\n return {\r\n children: 'GREEN – WAIVED',\r\n style: {\r\n ...buttonStyle,\r\n backgroundColor: '#52c41a',\r\n borderColor: '#52c41a'\r\n }\r\n }\r\n case 'red':\r\n return {\r\n children: 'RED',\r\n style: {\r\n ...buttonStyle,\r\n backgroundColor: '#f5222d',\r\n borderColor: '#f5222d'\r\n }\r\n }\r\n case 'red – suspended':\r\n case 'red suspended':\r\n return {\r\n children: 'RED – SUSPENDED',\r\n style: {\r\n ...buttonStyle,\r\n backgroundColor: '#f5222d',\r\n borderColor: '#f5222d'\r\n }\r\n }\r\n case 'multi':\r\n return {\r\n children: 'MULTIPLE RESULTS',\r\n style: {\r\n ...buttonStyle,\r\n backgroundColor: '#faad14',\r\n borderColor: '#faad14'\r\n }\r\n }\r\n case 'overridden':\r\n return {\r\n children: 'OVERRIDDEN',\r\n style: {\r\n ...buttonStyle,\r\n backgroundColor: '#1890ff',\r\n borderColor: '#1890ff'\r\n },\r\n }\r\n case 'whitelisted':\r\n return {\r\n children: 'WHITELISTED',\r\n disabled: true,\r\n style: {\r\n ...buttonStyle,\r\n backgroundColor: '#52c41a',\r\n borderColor: '#52c41a'\r\n }\r\n }\r\n default:\r\n let maxQcsLen = 15;\r\n if (String(reason).includes('red')){\r\n return {\r\n children: String(reason).substring(0, maxQcsLen).toUpperCase(),\r\n style: {\r\n ...buttonStyle,\r\n backgroundColor: '#f5222d',\r\n borderColor: '#f5222d'\r\n }\r\n }\r\n }\r\n else if (String(reason).includes('green')){\r\n return {\r\n children: String(reason).substring(0, maxQcsLen).toUpperCase(),\r\n style: {\r\n ...buttonStyle,\r\n backgroundColor: '#52c41a',\r\n borderColor: '#52c41a'\r\n }\r\n }\r\n }\r\n else if (reason){\r\n // Unknown quick check status result from ISN\r\n return {\r\n children: \"UNKNOWN\",\r\n style: {\r\n ...buttonStyle\r\n }\r\n }\r\n }\r\n let text = 'NO ISN RESULT';\r\n if (pax.lastIsnResultWithHeader && pax.lastIsnResultWithHeader.error_message){\r\n let textStyle = {\r\n color: 'red',\r\n maxWidth: '5rem',\r\n textOverflow: 'ellipsis',\r\n overflow: 'hidden'\r\n }\r\n text = {pax.lastIsnResultWithHeader.error_message}\r\n }\r\n return {\r\n children: text\r\n };\r\n }\r\n}\r\n/**\r\n *\r\n * @type {React.ForwardRefExoticComponent & React.RefAttributes>}\r\n */\r\nconst IsnCheckStatusButton = React.forwardRef((props, ref) => {\r\n let btnProps = getIsnType(props.pax);\r\n if (props.checking){\r\n return } />\r\n }\r\n\r\n if (props.style){\r\n btnProps = {\r\n ...btnProps,\r\n style: {\r\n ...btnProps?.style,\r\n ...props.style\r\n }\r\n }\r\n }\r\n\r\n // if (props.pax.lastIsnResultWithHeader && props.pax.lastIsnResultWithHeader.error_message){\r\n // var errMessage = props.pax.lastIsnResultWithHeader.error_message\r\n // }\r\n return (\r\n \r\n \r\n }\r\n },\r\n name: {\r\n ...personName,\r\n useSearchFilter: true,\r\n width: 150,\r\n onFilter: (value, record) => {\r\n if (typeof record.lastName === 'string') return record.lastName.toLowerCase().includes(value.toLowerCase())\r\n if (typeof record.firstName === 'string') return record.firstName.toLowerCase().includes(value.toLowerCase())\r\n },\r\n defaultSortOrder: 'ascend',\r\n sorter: (a, b) => {\r\n const aName = `${a.lastName}, ${a.firstName}`\r\n const bName = `${b.lastName}, ${b.firstName}`\r\n if (aName < bName) return -1\r\n if (aName > bName) return 1\r\n return 0\r\n }\r\n },\r\n customer: {\r\n title: 'Customer',\r\n key: 'customer',\r\n width: 150,\r\n render: (_, record) => record.customerID && (record.customerID.name.length > 17 ? record.customerID.name.substring(0,17) + \"...\" : record.customerID.name),\r\n onFilter: (value, record) => {\r\n if (record.customerID && typeof record.customerID.name === 'string') return record.customerID.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: ({ customerID }) => customerID && customerID.name,\r\n sorter: (a, b) => {\r\n const aCus = a.customerID ? a.customerID.name : null\r\n const bCus = b.customerID ? b.customerID.name : null\r\n if (aCus < bCus) return -1\r\n if (aCus > bCus) return 1 \r\n }\r\n },\r\n transporter: {\r\n title: 'Transporter',\r\n key: 'transporter',\r\n width: 150,\r\n render: (_, record) => record.tpID && record.tpID.name,\r\n onFilter: (value, record) => {\r\n if (record.tpID && typeof record.tpID.name === 'string') return record.tpID.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: ({ tpID }) => tpID && tpID.name,\r\n sorter: (a, b) => {\r\n const aCus = a.tpID ? a.tpID.name : null\r\n const bCus = b.tpID ? b.tpID.name : null\r\n if (aCus < bCus) return -1\r\n if (aCus > bCus) return 1 \r\n }\r\n },\r\n employer: {\r\n ...employer,\r\n render: (_, record) => record.employerID && (record.employerID.name.length > 20 ? record.employerID.name.substring(0,17) + \"...\" : record.employerID.name),\r\n width: 150,\r\n onFilter: (value, record) => {\r\n if (record.employerID && typeof record.employerID.name === 'string') return record.employerID.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: ({ employerID }) => employerID && employerID.name,\r\n sorter: (a, b) => {\r\n const aEmp = a.employerID ? a.employerID.name : null\r\n const bEmp = b.employerID ? b.employerID.name : null\r\n if (aEmp < bEmp) return -1\r\n if (aEmp > bEmp) return 1 \r\n }\r\n },\r\n weight: {\r\n title: 'WT',\r\n key: 'weight',\r\n width: 50,\r\n dataIndex: 'paxWeight',\r\n editable: true,\r\n inputType: \"number\",\r\n render: (text) => text || 0,\r\n sorter: (a, b) => (a.paxWeight || 0) - (b.paxWeight || 0)\r\n },\r\n bagCount: {\r\n title: '# Bags',\r\n dataIndex: 'bagCount',\r\n width: 70,\r\n key: 'bagCount',\r\n render: (text) => text || 0,\r\n sorter: (a, b) => (a.bagCount || 0) - (b.bagCount || 0)\r\n },\r\n bagWeight: {\r\n title: 'Bag WT',\r\n dataIndex: 'bagWeight',\r\n width: 50,\r\n key: 'bagWeight',\r\n render: (text) => text || 0,\r\n sorter: (a, b) => (a.bagWeight || 0) - (b.bagWeight || 0)\r\n },\r\n checkedIn: {\r\n title: 'Checked In',\r\n dataIndex: 'checkedInTime',\r\n key: 'checkedInTime',\r\n width: 150,\r\n render: (checkedInTime) => {\r\n const m = momentOrNull(checkedInTime)\r\n if (m && !m.isSameOrBefore(moment('1970-01-01'))){\r\n return m.format('YYYY-MM-DD HH:mm');\r\n }\r\n return null;\r\n },\r\n sorter: (a, b) => momentSorter('checkedInTime', a, b)\r\n },\r\n transitType: {\r\n ...transitType,\r\n width: 150,\r\n },\r\n departure: {\r\n ...departure,\r\n render: (_, record) => record.departureID && (record.departureID.name.length > 20 ? record.departureID.name.substring(0,17) + \"...\" : record.departureID.name),\r\n onFilter: (value, record) => {\r\n if (record.departureID && typeof record.departureID.name === 'string') return record.departureID.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: ({ departureID }) => departureID && departureID.name,\r\n width: 150,\r\n sorter: departureSorter\r\n },\r\n destination: {\r\n ...destination,\r\n render: (_, record) => record.destinationID && (record.destinationID.name.length > 20 ? record.destinationID.name.substring(0,17) + \"...\" : record.destinationID.name),\r\n onFilter: (value, record) => {\r\n if (record.destinationID && typeof record.destinationID.name === 'string') return record.destinationID.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: ({ destinationID }) => destinationID && destinationID.name,\r\n width: 150,\r\n sorter: destinationSorter\r\n },\r\n tsa: {\r\n title: 'TSA',\r\n key: 'tsa',\r\n width: 50,\r\n render: (_, record) => {\r\n var color = '#d9d9d9';\r\n var tooltipText = 'Not checked';\r\n if (record.authorization){\r\n color = record.authorization.noFlyListed ? '#f5222d' : '#52c41a'\r\n tooltipText = record.authorization.noFlyListed ? 'On No-Fly List' : 'Not On No-Fly List'\r\n }\r\n return (\r\n \r\n
\r\n {tooltipText}\r\n
\r\n
\r\n )\r\n }\r\n },\r\n restrictions: {\r\n title: 'Restrictions',\r\n key: 'restrictions',\r\n render: (_, record, index, onClick) => ,\r\n width: 150,\r\n sorter: (a, b) => {\r\n let ahr = paxHasRestriction(a);\r\n let bhr = paxHasRestriction(b);\r\n if (ahr && !bhr){\r\n return -1;\r\n }\r\n if (ahr === bhr){\r\n return 0;\r\n }\r\n return 1;\r\n }\r\n },\r\n isn: {\r\n ...isn,\r\n width: 150\r\n }\r\n }\r\n}\r\n\r\nclass HistoryPassengerColumns extends PassengerColumns {\r\n\r\n constructor() {\r\n super();\r\n this.columns = this.childColumns;\r\n }\r\n\r\n childColumns = {\r\n assignedFlight: this.columns.assignedFlight,\r\n name: this.columns.name,\r\n customer: {\r\n title: 'Customer',\r\n key: 'customer',\r\n width: 150,\r\n render: (_, record) => record.customerDoc && (record.customerDoc.name.length > 17 ? record.customerDoc.name.substring(0,17) + \"...\" : record.customerDoc.name),\r\n onFilter: (value, record) => {\r\n if (record.customerDoc && typeof record.customerDoc.name === 'string') return record.customerDoc.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: ({ customerID }) => customerID && customerID.name,\r\n sorter: (a, b) => {\r\n const aCus = a.customerDoc ? a.customerDoc.name : null\r\n const bCus = b.customerDoc ? b.customerDoc.name : null\r\n if (aCus < bCus) return -1\r\n if (aCus > bCus) return 1\r\n }\r\n },\r\n transporter: this.columns.transporter,\r\n employer: {\r\n ...employer,\r\n render: (_, record) => record.employerDoc && (record.employerDoc.name.length > 20 ? record.employerDoc.name.substring(0,17) + \"...\" : record.employerDoc.name),\r\n width: 150,\r\n onFilter: (value, record) => {\r\n if (record.employerDoc && typeof record.employerDoc.name === 'string') return record.employerDoc.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: ({ employerDoc }) => employerDoc && employerDoc.name,\r\n sorter: (a, b) => {\r\n const aEmp = a.employerDoc ? a.employerDoc.name : null\r\n const bEmp = b.employerDoc ? b.employerDoc.name : null\r\n if (aEmp < bEmp) return -1\r\n if (aEmp > bEmp) return 1\r\n }\r\n },\r\n weight: this.columns.weight,\r\n bagCount: this.columns.bagCount,\r\n bagWeight: this.columns.bagWeight,\r\n checkedIn: this.columns.checkedIn,\r\n transitType: this.columns.transitType,\r\n departure: {\r\n ...departure,\r\n render: (_, record) => record.departureDoc && (record.departureDoc.name.length > 20 ? record.departureDoc.name.substring(0,17) + \"...\" : record.departureDoc.name),\r\n onFilter: (value, record) => {\r\n if (record.departureDoc && typeof record.departureDoc.name === 'string') return record.departureDoc.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: ({ departureID }) => departureID && departureID.name,\r\n width: 150,\r\n sorter: (a, b) => {\r\n return ('' + (a.departureDoc && a.departureDoc.name).toLowerCase()).localeCompare('' + (b.departureDoc && b.departureDoc.name).toLowerCase())\r\n }\r\n },\r\n destination: {\r\n ...destination,\r\n render: (_, record) => record.destinationDoc && (record.destinationDoc.name.length > 20 ? record.destinationDoc.name.substring(0,17) + \"...\" : record.destinationDoc.name),\r\n onFilter: (value, record) => {\r\n if (record.destinationDoc && typeof record.destinationDoc.name === 'string') return record.destinationDoc.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: ({ destinationID }) => destinationID && destinationID.name,\r\n width: 150,\r\n sorter: (a, b) => {\r\n return ('' + (a.destinationDoc && a.destinationDoc.name).toLowerCase()).localeCompare('' + (b.destinationDoc && b.destinationDoc.name).toLowerCase())\r\n }\r\n },\r\n tsa: this.columns.tsa,\r\n restrictions: this.columns.restrictions,\r\n isn: this.columns.isn\r\n }\r\n}\r\n\r\nclass EmployerColumns extends ColumnSet {\r\n columns = {\r\n name: {\r\n title: 'Name',\r\n key: 'name',\r\n dataIndex: 'name',\r\n render: (_, record) => {\r\n return record.name\r\n },\r\n defaultSortOrder: 'ascend',\r\n sorter: (a, b) => {\r\n if (a.name < b.name) return -1\r\n if (a.name > b.name) return 1\r\n return 0\r\n }\r\n },\r\n modified\r\n }\r\n}\r\n\r\nclass NonPreferredColumns extends ColumnSet {\r\n columns = {\r\n employerName: {\r\n title: 'Name',\r\n key: 'employerName',\r\n render: (_, record) => {\r\n return record.id.name\r\n },\r\n defaultSortOrder: 'ascend',\r\n sorter: (a, b) => {\r\n if (a.name < b.name) return -1\r\n if (a.name > b.name) return 1\r\n return 0\r\n }\r\n },\r\n personName: {\r\n title: 'Name',\r\n key: 'name',\r\n render: (_, record) => {\r\n let person = record.id;\r\n if(person){\r\n return `${person.lastName}, ${person.firstName}`\r\n }\r\n return null;\r\n }\r\n },\r\n employer: {\r\n title: 'Employer',\r\n key: 'employer',\r\n render: (_, record) => record.id.employerID ? record.id.employerID.name : NotFound\r\n },\r\n startDate: {\r\n title: 'Start Date',\r\n key: 'startDate',\r\n dataIndex: 'startDate',\r\n render: (time) => {\r\n if(time){\r\n return moment(time).format('YYYY-MM-DD')\r\n }\r\n return null;\r\n }\r\n },\r\n reason: {\r\n title: 'Reason',\r\n key: 'reason',\r\n dataIndex: 'reason',\r\n render: (_, record) => {\r\n return
\r\n {record.reason}\r\n
\r\n }\r\n }\r\n }\r\n}\r\n\r\nclass PersonColumns extends ColumnSet {\r\n columns = {\r\n name: {\r\n ...personName,\r\n defaultSortOrder: 'ascend',\r\n sorter: (a, b) => {\r\n const aName = `${a.lastName}, ${a.firstName}`\r\n const bName = `${b.lastName}, ${b.firstName}`\r\n if (aName < bName) return -1\r\n if (aName > bName) return 1\r\n return 0\r\n }\r\n },\r\n address: {\r\n title: 'City, State',\r\n key: 'citystate',\r\n render: (_, record) => {\r\n if (record.contactInfo && record.contactInfo.address){\r\n const address = record.contactInfo.address;\r\n const citystate = [address.city, address.state].filter(a => a)\r\n return citystate.join(', ')\r\n }\r\n return '-'\r\n }\r\n },\r\n employer: {\r\n ...employer,\r\n sorter: (a, b) => {\r\n const aEmp = a.employerID ? a.employerID.name : null\r\n const bEmp = b.employerID ? b.employerID.name : null\r\n if (aEmp < bEmp) return -1\r\n if (aEmp > bEmp) return 1\r\n }\r\n }\r\n }\r\n}\r\n\r\nclass CargoColumns extends ColumnSet {\r\n columns = {\r\n name: {\r\n title: 'Name',\r\n key: 'name',\r\n dataIndex: 'name',\r\n defaultSortOrder: 'ascend',\r\n width: 150,\r\n sorter: (a, b) => {\r\n if (a.name < b.name) return -1\r\n if (a.name > b.name) return 1\r\n return 0\r\n },\r\n onFilter: (value, record) => {\r\n if (typeof record.name === 'string') return record.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n useSearchFilter: true\r\n },\r\n customer: {\r\n title: 'Customer',\r\n key: 'customer',\r\n width: 150,\r\n render: (_, record) => record.customerID && record.customerID.name,\r\n onFilter: (value, record) => {\r\n if (record.customerID && typeof record.customerID.name === 'string') return record.customerID.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: ({ customerID }) => customerID && customerID.name,\r\n sorter: (a, b) => {\r\n const aCus = a.customerID ? a.customerID.name : null\r\n const bCus = b.customerID ? b.customerID.name : null\r\n if (aCus < bCus) return -1\r\n if (aCus > bCus) return 1\r\n }\r\n },\r\n checkedIn: {\r\n title: 'Checked In',\r\n key: 'checkedIn',\r\n dataIndex: 'checkedInTime',\r\n width: 150,\r\n render: (time) => moment(time).format('YYYY-MM-DD HH:mm:ss'),\r\n sorter: (a, b) => momentSorter('checkedInTime', a, b)\r\n },\r\n departure: {\r\n ...departure,\r\n width: 150,\r\n onFilter: (value, record) => {\r\n if (record.departureID && typeof record.departureID.name === 'string') return record.departureID.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: (record) => record.departureID && record.departureID.name,\r\n sorter: departureSorter\r\n },\r\n transitType: {\r\n ...transitType,\r\n width: 150,\r\n },\r\n destination: {\r\n ...destination,\r\n width: 150,\r\n onFilter: (value, record) => {\r\n if (record.destinationID && typeof record.destinationID.name === 'string') return record.destinationID.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: (record) => {\r\n return record.destinationID && record.destinationID.name\r\n },\r\n sorter: destinationSorter\r\n },\r\n deliveredBy: {\r\n title: 'Delivered By',\r\n key: 'deliveredBy',\r\n dataIndex: 'deliveredBy',\r\n width: 150,\r\n useSearchFilter: true,\r\n onFilter: (value, record) => {\r\n if (typeof record.deliveredBy === 'string') return record.deliveredBy.toLowerCase().includes(value.toLowerCase())\r\n },\r\n sorter: (a, b) => {\r\n if (a.deliveredBy < b.deliveredBy) return -1\r\n if (a.deliveredBy > b.deliveredBy) return 1\r\n return 0\r\n }\r\n },\r\n attentionTo: {\r\n title: 'Attention To',\r\n key: 'attentionTo',\r\n width: 150,\r\n dataIndex: 'attentionTo',\r\n useSearchFilter: true,\r\n onFilter: (value, record) => {\r\n if (typeof record.attentionTo === 'string') return record.attentionTo.toLowerCase().includes(value.toLowerCase())\r\n },\r\n sorter: (a, b) => {\r\n if (a.attentionTo < b.attentionTo) return -1\r\n if (a.attentionTo > b.attentionTo) return 1\r\n return 0\r\n }\r\n },\r\n approvedBy: {\r\n title: 'Approved By',\r\n key: 'approvedBy',\r\n dataIndex: 'approvedBy',\r\n defaultSortOrder: 'ascend',\r\n width: 150,\r\n sorter: (a, b) => {\r\n if (a.approvedBy < b.approvedBy) return -1\r\n if (a.approvedBy > b.approvedBy) return 1\r\n return 0\r\n }\r\n },\r\n weight: {\r\n title: 'Weight',\r\n key: 'weight',\r\n width: 150,\r\n dataIndex: 'weight',\r\n render: (text) => text || 0,\r\n sorter: (a, b) => (a.weight || 0) - (b.weight || 0)\r\n },\r\n hazmat: {\r\n title: 'Hazmat',\r\n key: 'hazmat',\r\n width: 150,\r\n filters: [\r\n {\r\n text: 'No',\r\n value: false\r\n },\r\n {\r\n text: 'Yes',\r\n value: true\r\n }\r\n ],\r\n onFilter: (value, record) => {\r\n return record.hazmat === (value === 'true')\r\n },\r\n filterMultiple: false,\r\n render: (_, record) => {\r\n const render = (text) => {text}\r\n if (record.hazmat){\r\n if (record.hazmatUnCode){\r\n return render(record.hazmatUnCode)\r\n }else{\r\n return render('Yes (No Code)')\r\n }\r\n }else{\r\n return 'No'\r\n }\r\n }\r\n },\r\n assignedFlight: {\r\n ...assignedFlight,\r\n onFilter: (value, record) => {\r\n if (record.currentCarrierID && typeof record.currentCarrierID.desig === 'string') return record.currentCarrierID.desig.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: (record) => record.currentCarrierID && record.currentCarrierID.desig,\r\n width: 150,\r\n }\r\n }\r\n}\r\n\r\nclass HistoryCargoColumns extends CargoColumns {\r\n columns = {\r\n name: this.columns.name,\r\n customer: {\r\n title: 'Customer',\r\n key: 'customer',\r\n width: 150,\r\n render: (_, record) => record.customerDoc && record.customerDoc.name,\r\n onFilter: (value, record) => {\r\n if (record.customerDoc && typeof record.customerDoc.name === 'string') return record.customerDoc.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: ({ customerID }) => customerID && customerID.name,\r\n sorter: (a, b) => {\r\n const aCus = a.customerDoc ? a.customerDoc.name : null\r\n const bCus = b.customerDoc ? b.customerDoc.name : null\r\n if (aCus < bCus) return -1\r\n if (aCus > bCus) return 1\r\n }\r\n },\r\n checkedIn: this.columns.checkedIn,\r\n departure: {\r\n ...departure,\r\n width: 150,\r\n render: (_, record) => record.departureDoc ? record.departureDoc.name : NotFound,\r\n onFilter: (value, record) => {\r\n if (record.departureDoc && typeof record.departureDoc.name === 'string') return record.departureDoc.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: (record) => record.departureDoc && record.departureDoc.name,\r\n sorter: (a, b) => {\r\n return ('' + (a.departureDoc && a.departureDoc.name).toLowerCase()).localeCompare('' + (b.departureDoc && b.departureDoc.name).toLowerCase())\r\n }\r\n },\r\n transitType: this.columns.transitType,\r\n destination: {\r\n ...destination,\r\n width: 150,\r\n render: (_, record) => record.destinationDoc ? record.destinationDoc.name : NotFound,\r\n onFilter: (value, record) => {\r\n if (record.destinationDoc && typeof record.destinationDoc.name === 'string') return record.destinationDoc.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: (record) => {\r\n return record.destinationDoc && record.destinationDoc.name\r\n },\r\n sorter: (a, b) => {\r\n return ('' + (a.destinationDoc && a.destinationDoc.name).toLowerCase()).localeCompare('' + (b.destinationDoc && b.destinationDoc.name).toLowerCase())\r\n }\r\n },\r\n deliveredBy: this.columns.deliveredBy,\r\n attentionTo: this.columns.attentionTo,\r\n approvedBy: this.columns.approvedBy,\r\n weight: this.columns.weight,\r\n hazmat: this.columns.hazmat,\r\n assignedFlight: this.columns.assignedFlight\r\n }\r\n}\r\n\r\nclass CrewColumns extends ColumnSet {\r\n columns = {\r\n name: {\r\n ...personName,\r\n render: (_, record) => {\r\n if (!record.contactInfo) return null\r\n if (!record.contactInfo.name) return null\r\n return personName.render(null, record.contactInfo.name)\r\n },\r\n width: 200\r\n },\r\n location,\r\n isn: {\r\n ...isn,\r\n width: 150\r\n }\r\n }\r\n}\r\n\r\nclass LocationColumns extends ColumnSet {\r\n columns = {\r\n name: {\r\n ...name,\r\n onFilter: (value, record) => {\r\n if (typeof record.name === 'string') return record.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n useSearchFilter: true\r\n },\r\n ownerOrg: {\r\n title: 'Organization',\r\n key: 'ownerOrg',\r\n dataIndex: 'ownerOrg',\r\n onFilter: (value, record) => {\r\n if (record.ownerOrg && typeof record.ownerOrg === 'string') return record.ownerOrg.toLowerCase().includes(value.toLowerCase())\r\n },\r\n useSearchFilter: true\r\n },\r\n type: {\r\n title: 'Type',\r\n key: 'type',\r\n dataIndex: 'type',\r\n onFilter: (value, record) => ('' + record.type).toUpperCase() === value,\r\n filterMultiple: false,\r\n filters: [\r\n {\r\n text: 'ONSHORE',\r\n value: 'ONSHORE'\r\n },\r\n {\r\n text: 'OFFSHORE',\r\n value: 'OFFSHORE'\r\n }\r\n ]\r\n },\r\n block: {\r\n title: 'Area',\r\n key: 'block',\r\n dataIndex: 'block'\r\n },\r\n field: {\r\n title: 'Block',\r\n key: 'field',\r\n dataIndex: 'field'\r\n },\r\n modified\r\n }\r\n}\r\n\r\nclass FlightColumns extends ColumnSet {\r\n columns = {\r\n designation: {\r\n ...designation,\r\n useSearchFilter: true,\r\n width: 200,\r\n onFilter: (value, record) => {\r\n if (typeof record.desig === 'string') return record.desig.toLowerCase().includes(value.toLowerCase())\r\n },\r\n defaultSortOrder: 'ascend',\r\n sorter: (a, b) => {\r\n if (a.desig < b.desig) return -1\r\n if (a.desig > b.desig) return 1\r\n return 0\r\n }\r\n },\r\n departureWeight: {\r\n title: 'Departure Weight',\r\n key: 'departureWeight',\r\n\r\n width: 150,\r\n render: (_, record) => getFlightDepartureWeight(record),\r\n sorter: (a, b) => {\r\n const aDep = getFlightDepartureWeight(a)\r\n const bDep = getFlightDepartureWeight(b)\r\n return aDep - bDep\r\n }\r\n },\r\n passengers: {\r\n ...passengers,\r\n width: 150\r\n },\r\n departure: {\r\n title: 'Departure',\r\n key: 'departure',\r\n dataIndex: 'departureID',\r\n width: 150,\r\n onFilter: (value, record) => {\r\n try{\r\n const departure = getFlightDeparture(record);\r\n if (departure && typeof departure.name === 'string') return departure.name.toLowerCase().includes(value.toLowerCase())\r\n }\r\n catch(error){\r\n console.error(\"An error occurred while filtering flight departure: \" + error.message);\r\n }\r\n },\r\n useSearchFilter: true,\r\n render: (_, record) => {\r\n const departure = getFlightDeparture(record);\r\n return departure && departure.name\r\n },\r\n sorter: (a, b) => {\r\n const aDep = getFlightDeparture(a)\r\n const bDep = getFlightDeparture(b)\r\n if (aDep < bDep) return -1\r\n if (aDep > bDep) return 1\r\n return 0\r\n }\r\n },\r\n destinations: {\r\n title: 'Destinations',\r\n key: 'destinations',\r\n width: 400,\r\n render: (_, record) => {\r\n if (record.legs){\r\n const legs = Object.values(JSON.parse(record.legs));\r\n const destinations = legs.map(leg => leg.destination);\r\n return \r\n }\r\n }\r\n },\r\n seatPercent : {\r\n title: 'Seat %',\r\n key: 'seatPercent',\r\n width: 150,\r\n render: (_, record) => {\r\n if (!record || !record.aircraftID){\r\n return null\r\n }\r\n if(record.legsArray && record.legsArray[0] && record.aircraftID.maxSeats){\r\n const seats = record.aircraftID.maxSeats || 0\r\n const paxCount = record.legsArray[0].paxCount\r\n\r\n const num = ((paxCount/seats)*100).toFixed(2)\r\n\r\n if(num === 'NaN' || num === 'Infinity' || num < 0){\r\n return null\r\n }\r\n\r\n return num\r\n }\r\n\r\n return null;\r\n }\r\n },\r\n weightPercent : {\r\n title: 'Weight %',\r\n key: 'weightPercent',\r\n width: 150,\r\n render: (_, record) => {\r\n if (!record){\r\n return null\r\n }\r\n if(record.legsArray && record.legsArray[0]){\r\n const paxWeight = record.legsArray[0].paxWeight\r\n const firstLegUsableWeight = record.firstLegUsableWt || 0\r\n\r\n const num = ((paxWeight/firstLegUsableWeight)*100).toFixed(2)\r\n \r\n if(num === 'NaN' || num === 'Infinity' || num < 0){\r\n return null\r\n }\r\n \r\n return num\r\n }\r\n\r\n return null;\r\n }\r\n },\r\n status: {\r\n title: 'Status',\r\n key: 'status',\r\n width: 50,\r\n render: (_, record) => \r\n }\r\n }\r\n}\r\n\r\nclass BoatColumns extends ColumnSet {\r\n columns = {\r\n designation: {\r\n ...designation,\r\n width: 150\r\n },\r\n passengers: {\r\n ...passengers,\r\n width: 150\r\n },\r\n crewMembers: {\r\n title: 'Crew Members',\r\n key: 'crewMembers',\r\n width: 150,\r\n render: (_, record) => record.boatCrewIDs ? record.boatCrewIDs.length : 0\r\n },\r\n departures: {\r\n title: 'Departures',\r\n key: 'departures',\r\n width: 150,\r\n render: (_, record) => {\r\n if (!record.departureIDs) return null\r\n const locations = record.departureIDs.map(loc => loc.name);\r\n return locations.join(', ');\r\n }\r\n },\r\n destinations: {\r\n title: 'Destinations',\r\n key: 'destinations',\r\n width: 150,\r\n render: (_, record) => {\r\n if (!record.departureIDs) return null\r\n const locations = record.destinationIDs.map(loc => loc.name);\r\n return locations.join(', ');\r\n }\r\n }\r\n }\r\n}\r\n\r\nclass OnboardPobColumns extends ColumnSet{\r\n columns = {\r\n name: {\r\n ...personName,\r\n useSearchFilter: true,\r\n width: 150,\r\n onFilter: (value, record) => {\r\n if (typeof record.lastName === 'string') return record.lastName.toLowerCase().includes(value.toLowerCase())\r\n if (typeof record.firstName === 'string') return record.firstName.toLowerCase().includes(value.toLowerCase())\r\n },\r\n defaultSortOrder: 'ascend',\r\n sorter: (a, b) => {\r\n const aName = `${a.lastName}, ${a.firstName}`\r\n const bName = `${b.lastName}, ${b.firstName}`\r\n if (aName < bName) return -1\r\n if (aName > bName) return 1\r\n return 0\r\n }\r\n },\r\n customer: {\r\n title: 'Customer',\r\n key: 'customer',\r\n width: 150,\r\n render: (_, record) => record.customerID && record.customerID.name,\r\n onFilter: (value, record) => {\r\n if (record.customerID && typeof record.customerID.name === 'string') return record.customerID.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: ({ customerID }) => customerID && customerID.name,\r\n sorter: (a, b) => {\r\n const aCus = a.customerID ? a.customerID.name : null\r\n const bCus = b.customerID ? b.customerID.name : null\r\n if (aCus < bCus) return -1\r\n if (aCus > bCus) return 1 \r\n }\r\n },\r\n employer: {\r\n ...employer,\r\n width: 150,\r\n onFilter: (value, record) => {\r\n if (record.employerID && typeof record.employerID.name === 'string') return record.employerID.name.toLowerCase().includes(value.toLowerCase())\r\n },\r\n getValue: ({ employerID }) => employerID && employerID.name,\r\n sorter: (a, b) => {\r\n const aEmp = a.employerID ? a.employerID.name : null\r\n const bEmp = b.employerID ? b.employerID.name : null\r\n if (aEmp < bEmp) return -1\r\n if (aEmp > bEmp) return 1 \r\n }\r\n },\r\n checkedIn: {\r\n title: 'Check In',\r\n dataIndex: 'checkedInTime',\r\n key: 'checkedInTime',\r\n width: 150,\r\n render: (checkedInTime) => {\r\n const m = moment(checkedInTime)\r\n if (!m.isSameOrBefore(moment('1970-01-01'))){\r\n return m.format('YYYY-MM-DD HH:mm:ss');\r\n }\r\n },\r\n sorter: (a, b) => momentSorter('checkedInTime', a, b)\r\n },\r\n offshoreCheckedIn: {\r\n title: 'Rig Check In',\r\n dataIndex: 'offshoreCheckIn',\r\n key: 'offshoreCheckIn',\r\n width: 150,\r\n render: (offshoreCheckIn) => {\r\n if(offshoreCheckIn){\r\n const m = moment(offshoreCheckIn)\r\n if (!m.isSameOrBefore(moment('1970-01-01'))){\r\n return m.format('YYYY-MM-DD HH:mm:ss');\r\n }\r\n }\r\n },\r\n sorter: (a, b) => momentSorter('offshoreCheckIn', a, b)\r\n }\r\n }\r\n}\r\n\r\nclass RigColumns extends ColumnSet{\r\n columns = {\r\n location,\r\n onboardCount: {\r\n title: 'Onboard',\r\n dataIndex: 'onboardCount',\r\n key: 'onboardCount',\r\n getValue: ({ onboardCount }) => onboardCount && onboardCount\r\n },\r\n inboundCount: {\r\n title: 'Inbound',\r\n dataIndex: 'inboundCount',\r\n key: 'inboundCount',\r\n getValue: ({ inboundCount }) => inboundCount && inboundCount\r\n },\r\n outboundCount: {\r\n title: 'Outbound',\r\n dataIndex: 'outboundCount',\r\n key: 'outboundCount',\r\n getValue: ({ outboundCount }) => outboundCount && outboundCount\r\n },\r\n onboardCargoCount: {\r\n title: 'Onboard Cargo',\r\n dataIndex: 'onboardCargoCount',\r\n key: 'onboardCargoCount',\r\n getValue: ({ onboardCargoCount }) => onboardCargoCount && onboardCargoCount\r\n },\r\n inboundCargoCount: {\r\n title: 'Inbound Cargo',\r\n dataIndex: 'inboundCargoCount',\r\n key: 'inboundCargoCount',\r\n getValue: ({ inboundCargoCount }) => inboundCargoCount && inboundCargoCount\r\n },\r\n outboundCargoCount: {\r\n title: 'Outbound Cargo',\r\n dataIndex: 'outboundCargoCount',\r\n key: 'outboundCargoCount',\r\n getValue: ({ outboundCargoCount }) => outboundCargoCount && outboundCargoCount\r\n }\r\n }\r\n}\r\nclass DocksCgoColumns extends ColumnSet{\r\n columns = {\r\n name: {\r\n title: 'Name',\r\n key: 'name',\r\n dataIndex: 'name',\r\n width: 150,\r\n getValue: ({ name }) => name && name,\r\n sorter: (a, b) => {\r\n const aCus = a.name ? a.name : null\r\n const bCus = b.name ? b.name : null\r\n if (aCus < bCus) return -1\r\n if (aCus > bCus) return 1 \r\n }\r\n },\r\n assetID: {\r\n title: 'Asset ID',\r\n key: 'assetID',\r\n width: 150,\r\n getValue: ({ assetID }) => assetID && assetID.name,\r\n sorter: (a, b) => {\r\n const aCus = a.assetID ? a.assetID.name : null\r\n const bCus = b.assetID ? b.assetID.name : null\r\n if (aCus < bCus) return -1\r\n if (aCus > bCus) return 1 \r\n }\r\n\r\n },\r\n description: {\r\n title: 'Description',\r\n key: 'description',\r\n width: 150,\r\n dataIndex: 'description',\r\n getValue: ({ description }) => description && description, \r\n },\r\n liftCount: {\r\n title: 'Lift Count',\r\n key: 'lifts',\r\n width: 150,\r\n dataIndex: 'lifts',\r\n getValue: ({ lifts }) => lifts && lifts,\r\n },\r\n liftWeight: {\r\n title: 'Lift Weight',\r\n key: 'liftWeight',\r\n width: 150,\r\n dataIndex: 'liftWeight',\r\n getValue: ({ liftWeight }) => liftWeight && liftWeight,\r\n },\r\n grossWeight: {\r\n title: 'Gross Weight',\r\n key: 'totalWeight',\r\n width: 150,\r\n dataIndex: 'totalWeight',\r\n render: (totalWeight, row) => {\r\n if(totalWeight){\r\n return totalWeight\r\n }\r\n return row.weight\r\n },\r\n },\r\n }\r\n}\r\n\r\nclass WorkHistory extends ColumnSet{\r\n columns = {\r\n startTime: {\r\n title: 'Start Time',\r\n dataIndex: 'startTime',\r\n key: 'startTime',\r\n render: (_, record) => {\r\n const start = moment(record.clockIn)\r\n return start.format('YYYY-MM-DD HH:mm:ss')\r\n }\r\n },\r\n endTime: {\r\n title: 'End Time',\r\n dataIndex: 'endTime',\r\n key: 'endTime',\r\n render: (_, record) => {\r\n const end = moment(record.clockOut)\r\n return end.format('YYYY-MM-DD HH:mm:ss')\r\n }\r\n },\r\n hours: {\r\n title: 'Hours',\r\n dataIndex: 'hours',\r\n key: 'hours',\r\n render: (_, record) => {\r\n const start = moment.utc(record.clockIn)\r\n const end = moment.utc(record.clockOut)\r\n const difference = moment.duration(end.diff(start));\r\n const hours = difference.asHours().toFixed(2);\r\n return hours\r\n }\r\n }\r\n }\r\n}\r\n\r\nconst commonColumns = {\r\n employer: new EmployerColumns(),\r\n person: new PersonColumns(),\r\n pax: new PassengerColumns(),\r\n historyPax: new HistoryPassengerColumns(),\r\n cgo: new CargoColumns(),\r\n historyCgo: new HistoryCargoColumns(),\r\n crew: new CrewColumns(),\r\n paxAndCgo: new PaxAndCgoColumns(),\r\n location: new LocationColumns(),\r\n flight: new FlightColumns(),\r\n boat: new BoatColumns(),\r\n onboardpob: new OnboardPobColumns(),\r\n rig: new RigColumns(),\r\n dockscgo: new DocksCgoColumns(),\r\n workHist: new WorkHistory(),\r\n nonPreferred: new NonPreferredColumns()\r\n}\r\n\r\nexport default commonColumns","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery GlobalFilter {\r\n globalFilter @client {\r\n visible\r\n customer {\r\n key\r\n label\r\n }\r\n transporter {\r\n key\r\n label\r\n }\r\n departure {\r\n key\r\n label\r\n }\r\n destination {\r\n key\r\n label\r\n }\r\n employer {\r\n key\r\n label\r\n }\r\n pax {\r\n lastName\r\n firstName\r\n }\r\n cgo {\r\n name\r\n }\r\n }\r\n}\r\n`","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nmutation SetFilter(\r\n $visible: Boolean\r\n $customer: SelectItem\r\n $transporter: selectItem!\r\n $departure: [SelectItem]\r\n $destination: [SelectItem]\r\n $employer: [SelectItem]\r\n $pax: [PaxGlobalFilter]\r\n $cgo: [CgoGlobalFilter]\r\n){\r\n setGlobalFilter(\r\n visible: $visible\r\n customer: $customer\r\n transporter: $transporter\r\n departure: $departure\r\n destination: $destination\r\n employer: $employer\r\n pax: $pax\r\n cgo: $cgo\r\n ) @client {\r\n visible\r\n customer\r\n transporter\r\n departure {\r\n key\r\n label\r\n }\r\n destination {\r\n key\r\n label\r\n }\r\n employer {\r\n key\r\n label\r\n }\r\n pax {\r\n lastName\r\n firstName\r\n }\r\n cgo {\r\n name\r\n }\r\n }\r\n}\r\n`","import LocationSelect2 from \"./LocationSelect2\";\r\n\r\n// Reexport under \"LocationSelect\" for legacy imports\r\nexport default LocationSelect2","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery OrganizationQuery(\r\n $filter: OrganizationsFilterInput\r\n $limit: Int = 15\r\n){\r\n organizations(\r\n filter: $filter\r\n limit: $limit\r\n ){\r\n docs {\r\n _id\r\n ... on Customer {\r\n name\r\n }\r\n ... on Transporter {\r\n name\r\n }\r\n ... on Employer {\r\n name\r\n }\r\n }\r\n }\r\n}\r\n`","import { Select, Tooltip } from 'antd';\r\nimport { SelectProps } from 'antd/lib/select';\r\nimport React, { useState } from 'react';\r\nimport { SearchSelectWithData } from '../SearchSelect';\r\nimport OrganizationQuery from './OrganizationQuery';\r\n\r\nconst { Option } = Select;\r\n\r\nexport interface OrganizationSelectProps extends SelectProps {\r\n classTypes?: Array<\r\n 'flytsuite.customer' |\r\n 'customer' |\r\n 'flytsuite.transporter' |\r\n 'transporter' | \r\n 'flytsuite.employer' |\r\n 'employer'\r\n >\r\n limit?: number,\r\n type?: string,\r\n organizations?: Array\r\n}\r\n\r\nconst OrganizationSelect: React.FC = (props) => {\r\n const { classTypes, limit, type, organizations, ...restProps } = props;\r\n const [ searchValue, setSearchValue ] = useState(null);\r\n\r\n const variables = {\r\n limit: limit || 10,\r\n filter: {\r\n type: type,\r\n name: searchValue,\r\n classTypes: classTypes,\r\n organizations: organizations\r\n }\r\n }\r\n var placeholderMsg = props.placeholder;\r\n if (!props.placeholder && classTypes){\r\n if (classTypes.length > 1){\r\n placeholderMsg = 'Search for a organization';\r\n }else if (classTypes.length > 0){\r\n switch (classTypes[0]) {\r\n case 'flytsuite.customer':\r\n case 'customer':\r\n placeholderMsg = 'Search for a customer';\r\n break;\r\n case 'flytsuite.transporter':\r\n case 'transporter':\r\n placeholderMsg = 'Search for a transporter';\r\n break;\r\n case 'flytsuite.employer':\r\n case 'employer':\r\n placeholderMsg = 'Search for an employer';\r\n break;\r\n default:\r\n placeholderMsg = 'Search for a organization';\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return \r\n data && data.organizations && data.organizations.docs}\r\n onDataItem={item => }\r\n onSearch={(searchValue) => setSearchValue(searchValue)}\r\n placeholder={placeholderMsg}\r\n />\r\n \r\n}\r\n\r\n// class OrganizationSelect extends Component {\r\n// state = {\r\n// value: '',\r\n// searchValue: null\r\n// }\r\n// getValue = () => {\r\n// if (this.props.value){\r\n// if (this.state.value !== this.props.value){\r\n// this.setState({ value: this.props.value });\r\n// }\r\n// return this.props.value\r\n// }\r\n// return this.state.value\r\n// }\r\n// handleChange = (value) => {\r\n// this.setState({ value });\r\n// this.props.onChange &&\r\n// this.props.onChange(value)\r\n// }\r\n// render() {\r\n// const variables = {\r\n// limit: this.props.limit || 10,\r\n// filter: {\r\n// type: this.props.type,\r\n// name: this.state.searchValue,\r\n// classTypes: this.props.classTypes,\r\n// organizations: this.props.organizations\r\n// }\r\n// }\r\n// var placeholderMsg = this.props.placeholder;\r\n// if (!this.props.placeholder){\r\n// if (this.props.classTypes.length > 1){\r\n// placeholderMsg = 'Search for a organization';\r\n// }else if (this.props.classTypes.length > 0){\r\n// switch (this.props.classTypes[0]) {\r\n// case 'flytsuite.customer':\r\n// case 'customer':\r\n// placeholderMsg = 'Search for a customer';\r\n// break;\r\n// case 'flytsuite.transporter':\r\n// case 'transporter':\r\n// placeholderMsg = 'Search for a transporter';\r\n// break;\r\n// case 'flytsuite.employer':\r\n// case 'employer':\r\n// placeholderMsg = 'Search for an employer';\r\n// break;\r\n// default:\r\n// placeholderMsg = 'Search for a organization';\r\n// break;\r\n// }\r\n// }\r\n// }\r\n\r\n// return (\r\n// \r\n// data && data.organizations && data.organizations.docs}\r\n// onDataItem={item => }\r\n// onChange={this.handleChange}\r\n// onSearch={(searchValue) => this.setState({ searchValue })}\r\n// placeholder={placeholderMsg}\r\n// />\r\n// \r\n// );\r\n// }\r\n// }\r\n\r\n// OrganizationSelect.propTypes = {\r\n// value: PropTypes.any,\r\n// onChange: PropTypes.func,\r\n// classTypes: PropTypes.arrayOf(PropTypes.oneOf(['flytsuite.customer', 'flytsuite.transporter', 'flytsuite.employer'])),\r\n// placeholder: PropTypes.string\r\n// }\r\n \r\nexport default OrganizationSelect;","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nmutation ResetGlobalFilter {\r\n resetGlobalFilter @client{\r\n visible\r\n customer\r\n transporter\r\n departure {\r\n key\r\n label\r\n }\r\n destination {\r\n key\r\n label\r\n }\r\n employer {\r\n key\r\n label\r\n }\r\n pax {\r\n lastName\r\n firstName\r\n }\r\n cgo {\r\n name\r\n }\r\n }\r\n}\r\n`","import PropTypes from 'prop-types';\r\nimport React, { Component } from 'react';\r\nimport { graphql } from 'react-apollo';\r\nimport compose from 'lodash.flowright';\r\nimport GetFiltersQuery from './GetFiltersQuery';\r\nimport { Row, Col, Spin, Divider, Tooltip, Button, Modal } from 'antd';\r\nimport SetFilterMutation from './SetFilterMutation';\r\nimport { LocationSelect } from '../form/select/LocationSelect';\r\nimport { OrganizationSelect } from '../form/select/OrganizationSelect';\r\nimport WithOrgData from '../WithOrgData';\r\nimport './GlobalFilter.less';\r\nimport MCIcon from 'components/icon';\r\nimport ResetGlobalFilterMutation from './ResetGlobalFilterMutation';\r\n\r\nconst fieldsPerOrgType = {\r\n 'flytsuite.customer': ['employer', 'departure', 'destination'],\r\n 'flytsuite.transporter': ['customer', 'employer', 'departure', 'destination'],\r\n 'flytsuite.employer': ['customer', 'transporter', 'departure', 'destination']\r\n}\r\n\r\nclass GlobalFilter extends Component {\r\n state = {\r\n modalOpen: false\r\n }\r\n shouldFieldBeShown = (fieldType) => {\r\n const org = this.props.orgData.organization;\r\n const showableFields = fieldsPerOrgType[org.classType];\r\n return Array.isArray(showableFields) && showableFields.includes(fieldType);\r\n }\r\n isClearable = () => {\r\n const {\r\n customer,\r\n transporter,\r\n departure,\r\n destination,\r\n employer,\r\n } = this.props.data.globalFilter;\r\n\r\n return (\r\n customer?.length || \r\n transporter?.length || \r\n departure?.length || \r\n destination?.length || \r\n employer?.length\r\n );\r\n }\r\n getField = (fieldType) => {\r\n const { globalFilter } = this.props.data;\r\n const { setFilter } = this.props;\r\n const {\r\n customer,\r\n transporter,\r\n departure,\r\n destination,\r\n employer,\r\n } = globalFilter;\r\n\r\n switch (fieldType) {\r\n case 'customer':\r\n return (\r\n
\r\n Customer:\r\n {\r\n const newFilter = {\r\n ...globalFilter,\r\n customer: value.map((item) => ({...item, __typename: 'SelectItem'}))\r\n };\r\n setFilter({\r\n variables: newFilter\r\n });\r\n }}\r\n />\r\n
\r\n )\r\n case 'transporter':\r\n return (\r\n
\r\n Transporter:\r\n {\r\n const newFilter = {\r\n ...globalFilter,\r\n transporter: value.map((item) => ({...item, __typename: 'SelectItem'}))\r\n };\r\n setFilter({\r\n variables: newFilter\r\n });\r\n }}\r\n />\r\n
\r\n )\r\n case 'employer':\r\n return (\r\n
\r\n Employer:\r\n {\r\n const newFilter = {\r\n ...globalFilter,\r\n employer: value.map((item) => ({...item, __typename: 'SelectItem'}))\r\n };\r\n setFilter({\r\n variables: newFilter\r\n });\r\n }}\r\n />\r\n
\r\n )\r\n case 'departure':\r\n return (\r\n
\r\n Departure:\r\n {\r\n const newFilter = {\r\n ...globalFilter,\r\n departure: value.map((item) => ({...item, __typename: 'SelectItem'}))\r\n };\r\n setFilter({\r\n variables: newFilter\r\n });\r\n }}\r\n />\r\n
\r\n )\r\n case 'destination':\r\n return (\r\n
\r\n Destination:\r\n {\r\n const newFilter = {\r\n ...globalFilter,\r\n destination: value.map((item) => ({...item, __typename: 'SelectItem'}))\r\n };\r\n setFilter({\r\n variables: newFilter\r\n });\r\n }}\r\n />\r\n
\r\n )\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n handleReset = () => {\r\n const { setFilter } = this.props;\r\n const newFilter = {\r\n customer: [],\r\n transporter: [],\r\n departure: [],\r\n destination: [],\r\n employer: []\r\n };\r\n setFilter({\r\n variables: newFilter\r\n });\r\n }\r\n\r\n render() {\r\n const { globalFilter, error } = this.props.data;\r\n if (error) {\r\n console.error(error);\r\n return Error while loading Global Filter\r\n }\r\n const showFields = this.props.showFields || [\r\n 'customer',\r\n 'employer',\r\n 'transporter',\r\n 'departure',\r\n 'destination'\r\n ]\r\n if (!globalFilter) return \r\n\r\n return (\r\n \r\n \r\n \r\n

Global Filter

\r\n \r\n
\r\n \r\n this.setState({ modalOpen: true })}\r\n >\r\n \r\n

Open Global Filter

\r\n \r\n
\r\n \r\n \r\n \r\n \r\n {showFields.map((fieldType, i) => {\r\n if (this.shouldFieldBeShown(fieldType)){\r\n return (\r\n \r\n {\r\n this.getField(fieldType)\r\n }\r\n \r\n )\r\n }\r\n return null\r\n })}\r\n {this.isClearable() ? (\r\n \r\n ) : null}\r\n \r\n \r\n this.setState({ modalOpen: false })}\r\n bodyStyle={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '12px' }}\r\n footer={}\r\n >\r\n {showFields.map((fieldType, i) => {\r\n if (this.shouldFieldBeShown(fieldType)){\r\n return (\r\n \r\n {\r\n this.getField(fieldType)\r\n }\r\n \r\n )\r\n }\r\n return null\r\n })}\r\n {this.isClearable() ? (\r\n \r\n ) : null}\r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nGlobalFilter.propTypes = {\r\n showFields: PropTypes.arrayOf(PropTypes.oneOf([\r\n 'customer',\r\n 'employer',\r\n 'transporter',\r\n 'departure',\r\n 'destination'\r\n ]))\r\n}\r\n \r\nexport default compose(\r\n WithOrgData,\r\n graphql(\r\n GetFiltersQuery\r\n ),\r\n graphql(\r\n SetFilterMutation,\r\n {\r\n name: 'setFilter'\r\n }\r\n ),\r\n graphql(\r\n ResetGlobalFilterMutation,\r\n {\r\n name: 'resetFilter'\r\n }\r\n )\r\n)(GlobalFilter);","import React from 'react';\r\nimport GlobalFilter from './GlobalFilter';\r\nimport { Query } from 'react-apollo';\r\nimport GetFiltersQuery from './GetFiltersQuery';\r\nimport './Wrapper.less';\r\n\r\nconst GlobalFilterWithWrapper = (props) => (\r\n \r\n {({ data }) => {\r\n const visible = data && data.globalFilter && data.globalFilter.visible;\r\n var classNames = ['mc-global-filter-wrapper'];\r\n if (!visible){\r\n classNames.push('mc-global-filter-wrapper-hidden');\r\n }\r\n return (\r\n
\r\n \r\n
\r\n )\r\n }}\r\n
\r\n)\r\n\r\nexport default GlobalFilterWithWrapper","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery PaginationLimit {\r\n paginationLimit @client\r\n}\r\n`","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Row, Col, Select, Button, Tooltip, Spin } from 'antd';\r\nimport { graphql } from 'react-apollo';\r\nimport compose from 'lodash.flowright';\r\nimport gql from 'graphql-tag';\r\nimport PaginationLimit from '../../Queries/PaginationLimit';\r\n\r\nconst DEFAULT_SKIP = 0;\r\n\r\nclass Paginator extends Component {\r\n static propTypes = {\r\n count: PropTypes.number.isRequired,\r\n skip: PropTypes.number,\r\n size: PropTypes.oneOf(['small', 'default', 'large']),\r\n onChange: PropTypes.func.isRequired,\r\n loading: PropTypes.bool\r\n }\r\n getSkip = () => {\r\n return this.props.skip || DEFAULT_SKIP\r\n }\r\n getLimit = () => {\r\n const { data } = this.props;\r\n return (data && data.paginationLimit) || 50;\r\n }\r\n getCurrentPage = () => {\r\n const skip = this.getSkip();\r\n return (skip / this.getLimit()) + 1\r\n }\r\n getDataRange = () => {\r\n const { count, loading } = this.props;\r\n const skip = this.getSkip();\r\n if (loading){\r\n return (\r\n \r\n {`${skip + 1} - `}\r\n \r\n \r\n )\r\n }\r\n return `${skip + 1} - ${skip + count}`\r\n }\r\n handleChange = (obj) => {\r\n if (obj.limit){\r\n this.props.setPaginationLimit({\r\n variables: {\r\n limit: obj.limit\r\n }\r\n })\r\n }\r\n this.props.onChange &&\r\n this.props.onChange({\r\n limit: this.getLimit(),\r\n skip: this.getSkip(),\r\n ...obj\r\n })\r\n }\r\n hasPrev = () => {\r\n return this.getCurrentPage() > 1\r\n }\r\n hasNext = () => {\r\n return this.props.count >= this.getLimit() ? true : false\r\n }\r\n nextPage = () => {\r\n this.handleChange({ skip: this.getSkip() + this.getLimit() })\r\n }\r\n prevPage = () => {\r\n var skip = this.getSkip() - this.getLimit();\r\n if (skip < 0) skip = 0\r\n this.handleChange({ skip })\r\n }\r\n render() {\r\n const { size, loading } = this.props;\r\n return (\r\n \r\n \r\n \r\n this.handleChange({ skip: 0 })}\r\n style={{ marginRight: 12 }}\r\n disabled={!this.hasPrev() || loading}\r\n size={size}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {`Showing items `}\r\n {this.getDataRange()}\r\n \r\n \r\n Items per page\r\n this.handleChange({ limit: Number(value) })}\r\n style={{ minWidth: '3rem' }}\r\n showAction={[\"focus\", \"click\"]}\r\n >\r\n 50\r\n 100\r\n 200\r\n 300\r\n 400\r\n 500\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n \r\nexport default compose(\r\n graphql(\r\n PaginationLimit\r\n ),\r\n graphql(\r\n gql`\r\n mutation SetPaginationLimit($limit: Int!){\r\n setPaginationLimit(limit: $limit) @client\r\n }\r\n `,\r\n {\r\n name: 'setPaginationLimit'\r\n }\r\n )\r\n)(Paginator);","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery CountryCodeQuery {\r\n getCountryCodes {\r\n _id\r\n countries {\r\n Code\r\n Name\r\n }\r\n }\r\n}\r\n`","import { Select } from 'antd';\r\nimport React from 'react';\r\nimport { SearchSelectWithData } from '../SearchSelect';\r\nimport CountryCodeQuery from './CountryCodeQuery';\r\n\r\nconst { Option } = Select;\r\n\r\nexport const CountryCodeSelect = ({\r\n value,\r\n ...restProps\r\n}) => {\r\n return (\r\n data && data.getCountryCodes && data.getCountryCodes.countries}\r\n onDataItem={item => }\r\n filterOption={(input, option) => option.props.children.toLowerCase().includes(input.toLowerCase())}\r\n />\r\n )\r\n}","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery EmployerQuery(\r\n $filter: EmployerFilterInput\r\n $limit: Int\r\n){\r\n employers(\r\n filter: $filter\r\n limit: $limit\r\n ){\r\n docs {\r\n _id\r\n ... on Employer {\r\n name\r\n }\r\n }\r\n bookmark\r\n }\r\n}\r\n`","import React, { Component } from 'react';\r\nimport debounce from 'lodash/debounce';\r\nimport { Select, Spin } from 'antd';\r\nimport PropTypes from 'prop-types';\r\n\r\nconst { Option } = Select;\r\n\r\nclass EmployerSelect extends Component {\r\n constructor(props){\r\n super(props)\r\n this.handleSearch = debounce(this.handleSearch, 500)\r\n }\r\n state = {\r\n value: []\r\n }\r\n getValue = () => {\r\n if (this.props.value){\r\n if (this.state.value !== this.props.value){\r\n this.setState({ value: this.props.value });\r\n }\r\n }else if(this.props.defaultValue){\r\n if(this.state.value !== this.props.defaultValue){\r\n this.setState({value: this.props.defaultValue})\r\n }\r\n }\r\n return this.state.value\r\n }\r\n handleSearch = (value) => {\r\n if (this.props.getEmployers)\r\n this.props.getEmployers({\r\n name: value\r\n })\r\n }\r\n handleChange = (value) => {\r\n this.setState({\r\n value: value\r\n })\r\n this.props.onChange && this.props.onChange(value)\r\n }\r\n render() { \r\n const { data, ...restProps } = this.props;\r\n const renderNFContent = () => {\r\n if (data && data.loading){\r\n return \r\n }\r\n if (data && data.error){\r\n return Failed to load employers\r\n }\r\n return null\r\n }\r\n return (\r\n \r\n {data && data.employers && data.employers.docs.map(({ _id, name }) => )}\r\n \r\n );\r\n }\r\n}\r\n\r\nEmployerSelect.propTypes = {\r\n data: PropTypes.object,\r\n getEmployers: PropTypes.func\r\n}\r\n \r\nexport default EmployerSelect;","import { graphql } from 'react-apollo';\r\nimport compose from 'lodash.flowright';\r\nimport EmployerQuery from './EmployerQuery';\r\nimport EmployerSelect from './EmployerSelect';\r\n\r\nexport default compose(\r\n graphql(\r\n EmployerQuery,\r\n {\r\n options: {\r\n variables: {\r\n limit: 0\r\n },\r\n fetchPolicy: 'network-only'\r\n },\r\n props: props => {\r\n return {\r\n ...props,\r\n getEmployers: (filter) => {\r\n if (!filter.name){\r\n props.data.updateQuery((prev) => ({\r\n ...prev,\r\n employers: {\r\n ...prev.employers,\r\n docs: [],\r\n bookmark: null\r\n }\r\n }))\r\n return\r\n }\r\n props.data.refetch({\r\n limit: 15,\r\n filter: {\r\n name: filter && filter.name\r\n }\r\n })\r\n }\r\n }\r\n }\r\n }\r\n )\r\n)(EmployerSelect)\r\n","import Select, { SelectProps } from 'antd/lib/select';\r\nimport { omit, padStringInt } from 'common/util';\r\nimport React from 'react';\r\nimport { useState, useEffect } from 'react';\r\n\r\nexport interface DateLabelSelectProps extends SelectProps {\r\n minDateNum?: number,\r\n maxDateNum?: number\r\n}\r\n\r\nconst staticOptions = [\r\n Shot 1,\r\n Shot 2,\r\n Vaccinated on,\r\n POS Test,\r\n RTW,\r\n RTW 2\r\n]\r\n\r\nconst DateLabelSelect: React.FC = (props) => {\r\n\r\n const [ options, setOptions ] = useState([]);\r\n\r\n useEffect(() => {\r\n let opt = [ ...staticOptions ];\r\n let maxDateLen = String(props.maxDateNum).length;\r\n for (let i = props.minDateNum; i <= props.maxDateNum; i++){\r\n opt.push(Booster {i})\r\n }\r\n setOptions(opt)\r\n }, [ props.minDateNum, props.maxDateNum, setOptions ])\r\n \r\n return \r\n}\r\n\r\nDateLabelSelect.defaultProps = {\r\n ...DateLabelSelect.defaultProps,\r\n minDateNum: 1,\r\n maxDateNum: 99\r\n}\r\n\r\nexport default DateLabelSelect","import { Icon, Typography } from 'antd';\r\nimport Select, { SelectProps, SelectValue } from 'antd/lib/select';\r\nimport { castArray } from 'common/util';\r\nimport gql from 'graphql-tag';\r\nimport React, { LegacyRef } from 'react';\r\nimport { useQuery } from 'react-apollo';\r\n\r\nexport interface CovidVaxManufacturerSelectProps extends SelectProps {\r\n\r\n}\r\n\r\nconst CovidVaxManufacturerSelect: React.FC = React.forwardRef(({ children, ...props }, ref: LegacyRef\r\n {manuList.map(manuStr => (\r\n {manuStr}\r\n ))}\r\n {children}\r\n \r\n );\r\n})\r\n\r\nexport default CovidVaxManufacturerSelect;","import { Button, DatePicker, Dropdown, Input, Menu, Popconfirm, Tooltip } from 'antd';\r\nimport Form from 'antd/lib/form';\r\nimport { WrappedFormUtils } from 'antd/lib/form/Form';\r\nimport DateLabelSelect from 'components/covid-vax-date-form/date-label-select';\r\nimport { PersonCovidVaxRecord } from 'components/covid-vax-date-list';\r\nimport CovidVaxManufacturerSelect from 'components/covid-vax-manufacturer-select';\r\nimport { OrgDataContext } from 'context/orgData';\r\nimport { ThemeContext } from 'context/theme';\r\nimport { pickBy } from 'lodash';\r\nimport moment from 'moment';\r\nimport React, { useEffect, useState } from 'react';\r\nimport uuid4 from 'uuid/v4';\r\nimport './style.less';\r\n\r\nexport interface UniquePersonCovidVaxRecord extends Omit {\r\n id: string,\r\n isNew: boolean\r\n}\r\n\r\nexport function makePersonCovidVaxRecordUnique(record: PersonCovidVaxRecord): UniquePersonCovidVaxRecord {\r\n return {\r\n ...record,\r\n isNew: false,\r\n id: record.personID + '-' + record.order\r\n }\r\n}\r\n\r\nexport interface CovidVaxDatesFormProps {\r\n form: WrappedFormUtils,\r\n data?: PersonCovidVaxRecord[],\r\n disabled?: boolean,\r\n allowRemoveOrClearRecord?: boolean,\r\n resetFormFunc?: (resetFunc: () => void) => void\r\n}\r\n\r\nfunction validateDuplicateLabel(recordId: string, form: WrappedFormUtils){\r\n return (_, __, callback) => {\r\n let allFields = form.getFieldsValue();\r\n let currLabel = allFields['covidvax::' + recordId + '::label'];\r\n delete allFields['covidvax::' + recordId + '::label'];\r\n\r\n let duplicateDateTimes = Object.entries(allFields)\r\n .filter(([k]) => k.split('::')[2] === 'label')\r\n .map(([k, v]) => {\r\n let id = k.split('::')[1];\r\n return {\r\n id,\r\n label: v\r\n }\r\n })\r\n .filter(({ id, label }) => {\r\n return currLabel && id !== recordId && label === currLabel\r\n })\r\n \r\n if (duplicateDateTimes.length > 0){\r\n callback(\"You cannot have two entries with the same label.\")\r\n }\r\n else\r\n {\r\n callback();\r\n }\r\n }\r\n}\r\n\r\nfunction requireIfNonEmpty(recordId: string, form: WrappedFormUtils){\r\n return (rule, value, callback) => {\r\n let prefix = 'covidvax::' + recordId\r\n if (typeof value === 'string'){\r\n value = value.trim();\r\n }\r\n if (\r\n rule.required && !value && (\r\n form.getFieldValue(prefix + '::date') ||\r\n form.getFieldValue(prefix + '::type') ||\r\n form.getFieldValue(prefix + '::comment')\r\n )\r\n ){\r\n callback(rule.message || 'This field is required')\r\n }\r\n else\r\n {\r\n callback();\r\n }\r\n }\r\n}\r\n\r\nexport function sortVaxRecordsByDate(vaxRecords: UniquePersonCovidVaxRecord[], form: WrappedFormUtils){\r\n let newVaxRecords = vaxRecords.sort((a, b) => {\r\n let vaxOn = \"Vaccinated on\";\r\n\r\n let aDate = form.getFieldValue('covidvax::' + a.id + '::date');\r\n let bDate = form.getFieldValue('covidvax::' + b.id + '::date');\r\n\r\n // It is likely that two rows, one with \"Shot 2\", and the other with \"Vaccinated on\", will have the same date.\r\n // So, we need to make sure that \"Vaccinated on\" will sort after \"Shot 2\"\r\n let aLabel = form.getFieldValue('covidvax::' + a.id + '::label');\r\n let bLabel = form.getFieldValue('covidvax::' + b.id + '::label');\r\n\r\n if (aDate) aDate = aDate && moment(aDate).format('YYYY-MM-DD');\r\n if (bDate) bDate = bDate && moment(bDate).format('YYYY-MM-DD');\r\n\r\n if (aDate && !bDate) return -1;\r\n if (!aDate && bDate) return 1;\r\n\r\n if (aDate > bDate) return 1;\r\n if (aDate < bDate) return -1;\r\n\r\n if (aDate === bDate && aLabel === vaxOn && String(bLabel).startsWith(\"Shot\")){\r\n return 1;\r\n }\r\n\r\n if (aDate === bDate && bLabel === vaxOn && String(aLabel).startsWith(\"Shot\")){\r\n return -1;\r\n }\r\n \r\n return 0;\r\n })\r\n return newVaxRecords\r\n}\r\n\r\n// List of all labels that do not require a manufacturer to be entered\r\nconst noManuLabels = [\r\n 'POS Test',\r\n 'RTW',\r\n 'RTW 2'\r\n]\r\n\r\nconst CovidVaxDatesForm: React.FC = ({\r\n form,\r\n data,\r\n disabled=false,\r\n allowRemoveOrClearRecord=true,\r\n resetFormFunc\r\n}) => {\r\n\r\n const theme = React.useContext(ThemeContext);\r\n const orgData = React.useContext(OrgDataContext);\r\n\r\n // Stores the initial values of vax record rows\r\n let [ initialVaxRecords, setInitialVaxRecords ] = useState([])\r\n\r\n\r\n let [ , setUpdateId ] = useState(''); // Need this because sorting the initialVaxRecords list doesn't trigger a re-render as expected.\r\n\r\n function sortRecords(){\r\n let newVaxRecords = sortVaxRecordsByDate(initialVaxRecords, form);\r\n setInitialVaxRecords(newVaxRecords)\r\n setUpdateId(uuid4());\r\n }\r\n\r\n function swapRecords(idxA: number, idxB: number){\r\n let a = initialVaxRecords[idxA];\r\n let b = initialVaxRecords[idxB];\r\n\r\n let newInitialVaxRecords = [...initialVaxRecords];\r\n\r\n newInitialVaxRecords[idxA] = b;\r\n newInitialVaxRecords[idxB] = a;\r\n\r\n setInitialVaxRecords(newInitialVaxRecords);\r\n }\r\n\r\n /*\r\n WARNING: If the data prop changes, the initialVaxRecords will be updated\r\n */\r\n useEffect(() => {\r\n // --------------------------------------\r\n // Populates initialVaxRecords with existing data passed in from props. Fills in the remaining 5 rows with empty rows.\r\n // --------------------------------------\r\n\r\n let dataLength = data ? data.length : 0\r\n\r\n let newVaxRecords: UniquePersonCovidVaxRecord[] = [];\r\n if (dataLength > 0){\r\n newVaxRecords = data.map((record, i) => {\r\n return {\r\n ...record,\r\n id: record.personID + '-' + record.order,\r\n order: i,\r\n isNew: false\r\n }\r\n });\r\n }\r\n let numNewRows = Math.max(5-dataLength, 0);\r\n\r\n // Add empty rows for the remaining numNewRows\r\n for (let i=0; i < numNewRows; i++){\r\n let id = \"new-\" + i;\r\n newVaxRecords.push({\r\n id: id,\r\n comment: null,\r\n date: null,\r\n label: null,\r\n order: null,\r\n customerID: orgData.customerID,\r\n customerName: orgData.customerName,\r\n employerID: orgData.employerID,\r\n employerName: orgData.employerName,\r\n manufacturer: null,\r\n isNew: true\r\n })\r\n }\r\n\r\n setInitialVaxRecords(newVaxRecords);\r\n setUpdateId(uuid4());\r\n // eslint-disable-next-line\r\n }, [ data ])\r\n\r\n // This allows parent components to trigger a reset of \r\n useEffect(() => {\r\n\r\n function reset(){\r\n form.resetFields();\r\n sortRecords();\r\n }\r\n\r\n if (resetFormFunc){\r\n resetFormFunc(reset);\r\n }\r\n // eslint-disable-next-line \r\n }, [ resetFormFunc ])\r\n\r\n function getValuedRowCount(){\r\n let allFields = form.getFieldsValue();\r\n\r\n // List of booleans for each row whether or not it is not empty.\r\n let initialVaxRecordsHaveValue = initialVaxRecords.map(record => {\r\n let recordFieldMap = pickBy(allFields, (_, key) => String(key).startsWith(\"covidvax::\" + record.id) &&\r\n !key.endsWith('renderOrder') //Skips renderOrder field because this will always have a value\r\n );\r\n return Object.values(recordFieldMap).findIndex((val) => val) > -1\r\n })\r\n \r\n let numVaxRecordsWithValue = initialVaxRecordsHaveValue.reduce((acc, hasVal) => hasVal === true ? acc + 1 : acc, 0);\r\n return numVaxRecordsWithValue;\r\n }\r\n\r\n function checkHasValue(recordId: string){\r\n if (!recordId) return false;\r\n let fieldNames = [\r\n 'covidvax::' + recordId + \"::date\",\r\n 'covidvax::' + recordId + \"::comment\",\r\n 'covidvax::' + recordId + \"::manufacturer\",\r\n 'covidvax::' + recordId + \"::label\"\r\n ]\r\n return Object.values(form.getFieldsValue(fieldNames)).find(val => val) ? true : false\r\n }\r\n \r\n function renderFormItem(record: UniquePersonCovidVaxRecord, index: number){\r\n let id = record.id;\r\n\r\n let fieldNames = [\r\n 'covidvax::' + id + \"::date\",\r\n 'covidvax::' + id + \"::comment\",\r\n 'covidvax::' + id + \"::manufacturer\",\r\n 'covidvax::' + id + \"::label\"\r\n ]\r\n\r\n let isTouched = form.isFieldsTouched(fieldNames);\r\n\r\n let hasValue = checkHasValue(record.id);\r\n\r\n function reset(){\r\n form.setFieldsValue({\r\n ['covidvax::' + id + \"::comment\"]: record.comment,\r\n ['covidvax::' + id + \"::manufacturer\"]: record.manufacturer,\r\n ['covidvax::' + id + \"::label\"]: record.label,\r\n ['covidvax::' + id + \"::date\"]: record.date ? moment(record.date) : null\r\n });\r\n }\r\n\r\n function remove(){\r\n let newVaxRecords = [ ...initialVaxRecords ];\r\n newVaxRecords.splice(index, 1);\r\n setInitialVaxRecords(newVaxRecords);\r\n }\r\n\r\n function clear(){\r\n let val = { value: null, touched: true }\r\n form.setFields({\r\n ['covidvax::' + id + \"::comment\"]: val,\r\n ['covidvax::' + id + \"::manufacturer\"]: val,\r\n ['covidvax::' + id + \"::date\"]: val,\r\n ['covidvax::' + id + \"::label\"]: val\r\n });\r\n }\r\n\r\n let menuItems = [];\r\n\r\n if (isTouched){\r\n menuItems.push(Reset)\r\n }\r\n if (!disabled && allowRemoveOrClearRecord && index >= 5) {\r\n menuItems.push(Remove)\r\n }\r\n if (!disabled && allowRemoveOrClearRecord && hasValue && !record.isNew){\r\n menuItems.push(Clear)\r\n }\r\n\r\n return
\r\n {form.getFieldDecorator('covidvax::' + id + '::renderOrder', {\r\n initialValue: index,\r\n preserve: false\r\n })}\r\n \r\n {form.getFieldDecorator('covidvax::' + id + \"::label\", {\r\n initialValue: record.label,\r\n preserve: false,\r\n rules: [\r\n {\r\n validator: validateDuplicateLabel(record.id, form)\r\n },\r\n { \r\n required: true,\r\n message: 'You must specify a label',\r\n validator: requireIfNonEmpty(record.id, form)\r\n }\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {form.getFieldDecorator('covidvax::' + id + \"::date\", {\r\n rules: [\r\n {\r\n required: true,\r\n message: 'You must specify a date',\r\n validator: requireIfNonEmpty(record.id, form)\r\n }\r\n ], \r\n preserve: false,\r\n initialValue: record.date ? moment(record.date) : null\r\n })(\r\n \r\n )}\r\n \r\n \r\n {noManuLabels.includes(form.getFieldValue('covidvax::' + id + '::label')) ? (\r\n \r\n ) : (\r\n form.getFieldDecorator('covidvax::' + id + \"::manufacturer\", {\r\n initialValue: record.manufacturer,\r\n preserve: false,\r\n rules: [ { required: true, message: 'You must specify a type', validator: requireIfNonEmpty(record.id, form) } ]\r\n })(\r\n \r\n )\r\n )}\r\n \r\n \r\n {form.getFieldDecorator('covidvax::' + id + \"::comment\", {\r\n initialValue: record.comment,\r\n preserve: false\r\n })(\r\n \r\n )}\r\n {!disabled && allowRemoveOrClearRecord ? (\r\n\r\n {\r\n switch (key) {\r\n case 'swap-up':\r\n swapRecords(index, index-1);\r\n break;\r\n case 'swap-down':\r\n swapRecords(index, index+1);\r\n break;\r\n case 'reset':\r\n reset();\r\n break;\r\n case 'remove':\r\n remove();\r\n break;\r\n case 'clear':\r\n clear();\r\n break;\r\n default:\r\n break;\r\n }\r\n }}>\r\n \r\n Swap with above\r\n \r\n = dataToRender.length-1}>\r\n Swap with below\r\n \r\n {menuItems.length > 0 ? (\r\n \r\n ) : null}\r\n {menuItems}\r\n \r\n }\r\n >\r\n \r\n \r\n ) : null}\r\n {(isTouched) ? (\r\n \r\n \r\n \r\n ) : null}\r\n {(!disabled && allowRemoveOrClearRecord && hasValue && !record.isNew) ? (\r\n \r\n \r\n \r\n ) : null}\r\n {!disabled && allowRemoveOrClearRecord && index >= 5 ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : null}\r\n \r\n
\r\n }\r\n\r\n let dataToRender: UniquePersonCovidVaxRecord[] = [ ...initialVaxRecords ]; // Copy initialVaxRecords array\r\n\r\n let renderedFormItems = dataToRender.map(renderFormItem);\r\n\r\n return (\r\n
\r\n {!disabled ? (\r\n \r\n \r\n Sort By Date\r\n \r\n \r\n ) : null}\r\n {renderedFormItems}\r\n {getValuedRowCount() >= 5 && !disabled ? ( \r\n {\r\n let newRecord = {\r\n id: 'new-' + initialVaxRecords.length,\r\n comment: null,\r\n date: null,\r\n label: null,\r\n order: initialVaxRecords.length,\r\n customerID: orgData.customerID,\r\n customerName: orgData.customerName,\r\n employerID: orgData.employerID,\r\n employerName: orgData.employerName,\r\n manufacturer: null,\r\n isNew: true\r\n }\r\n setInitialVaxRecords([\r\n ...initialVaxRecords,\r\n newRecord\r\n ])\r\n }}\r\n >\r\n Add Another\r\n \r\n ) : null}\r\n
\r\n )\r\n}\r\n\r\nexport default CovidVaxDatesForm;","import { useMutation } from '@apollo/react-hooks';\r\nimport { WrappedFormUtils } from 'antd/lib/form/Form';\r\nimport { DataProxy } from 'apollo-cache';\r\nimport { ApolloError } from 'apollo-client';\r\nimport { makePersonCovidVaxRecordUnique } from 'components/covid-vax-date-form';\r\nimport { PersonCovidVaxRecord } from 'components/covid-vax-date-list';\r\nimport gql from 'graphql-tag';\r\nimport moment from 'moment';\r\nimport { MutationFunctionOptions, MutationResult, OperationVariables } from 'react-apollo';\r\n\r\nconst MUTATION = gql`\r\nmutation UpdatePersonVaxInfo(\r\n $modifyVaxRecords: Boolean!\r\n $modifiedVaxRecords: [BulkUpdatePersonCov19VaxRecordInput!]!\r\n $deleteVaxRecords: Boolean!\r\n $deletedVaxRecords: [BulkDeletePersonCov19VaxRecordInput!]!\r\n\r\n){\r\n bulkUpdatePersonCovid19VaxDate(input: $modifiedVaxRecords) @include(if: $modifyVaxRecords){ \r\n personID\r\n order\r\n }\r\n bulkDeletePersonCovid19VaxDate(input: $deletedVaxRecords) @include(if: $deleteVaxRecords){ \r\n personID\r\n order\r\n }\r\n}\r\n`\r\n\r\nexport interface SubmitterOptions {\r\n onMutationUpdate?: (proxy: DataProxy, newRecords: PersonCovidVaxRecord[]) => void,\r\n onCompleted?: (data: any) => void,\r\n onError?: (error: ApolloError) => void,\r\n personID: string, \r\n personName: string, \r\n customerID: string,\r\n customerName: string,\r\n employerID: string,\r\n employerName: string,\r\n useOptimisticResponse?: boolean\r\n}\r\n\r\nexport async function buildBulkMutation(\r\n data: {\r\n originalVaxRecords: PersonCovidVaxRecord[],\r\n personID: string,\r\n personName: string,\r\n customerID: string,\r\n customerName: string,\r\n employerID: string,\r\n employerName: string\r\n },\r\n form: WrappedFormUtils,\r\n onMutationUpdate?:(proxy: DataProxy, newRecords: PersonCovidVaxRecord[]) => void,\r\n useOptimisticResponse?: boolean\r\n): Promise> {\r\n let { personID, personName, customerID, customerName, employerID, employerName, originalVaxRecords=[] } = data;\r\n let mutationPromise = new Promise((resolve, reject) => {\r\n form.validateFieldsAndScroll((err, values) => {\r\n try{\r\n\r\n if (err) {\r\n reject(err);\r\n return;\r\n };\r\n \r\n let origVaxRecordsMapByDateLabel = new Map(\r\n originalVaxRecords?.map((record) => (\r\n [\r\n record.label + record.date + record.manufacturer + record.comment,\r\n record\r\n ]\r\n ))\r\n )\r\n \r\n let modifiedOrAddedVaxRecords: PersonCovidVaxRecord[] = [];\r\n let deletedVaxRecords: Pick[] = [];\r\n \r\n let vaxRowIds = Object.entries(values)\r\n .filter(([ k, v ]) => k.startsWith('covidvax::') && k.endsWith('::date') && v)\r\n .map(([ key ]) => key.split(\"::\")[1])\r\n \r\n let vaxFormRows: Map = new Map(\r\n \r\n // Transform ant-design form values to list of PersonCovidVaxRecord objects\r\n vaxRowIds.map((id): [string, PersonCovidVaxRecord] => {\r\n function getField(name: string){\r\n return values['covidvax::' + id + \"::\" + name];\r\n }\r\n let date = moment(getField('date')).format('YYYY-MM-DD');\r\n let label = getField('label');\r\n let manufacturer = getField('manufacturer');\r\n let comment = getField('comment');\r\n let renderOrder = getField('renderOrder');\r\n \r\n return [\r\n personID + '-' + renderOrder,\r\n {\r\n personID,\r\n personName,\r\n order: renderOrder,\r\n customerID,\r\n customerName,\r\n employerID,\r\n employerName,\r\n comment,\r\n label,\r\n date,\r\n manufacturer\r\n }\r\n ]\r\n })\r\n \r\n // Sort everything by renderOrder\r\n .sort((a, b) => {\r\n let [, aObj] = a;\r\n let [, bObj] = b;\r\n if (aObj.order > bObj.order) return 1;\r\n if (aObj.order < bObj.order) return -1;\r\n return 0;\r\n })\r\n \r\n // Set the order field to the actual order of each row\r\n .map(([, v ], order) => {\r\n return [\r\n v.personID + \"-\" + order,\r\n {\r\n ...v,\r\n order\r\n }\r\n ]\r\n })\r\n )\r\n // Check if each vax record was modified or added\r\n Array.from(vaxFormRows.values()).forEach((record) => {\r\n let existing = origVaxRecordsMapByDateLabel[record.label + record.date + record.manufacturer + record.comment];\r\n if (\r\n existing && (\r\n existing.manufacturer !== record.manufacturer ||\r\n existing.comment !== record.comment ||\r\n existing.date !== record.date ||\r\n existing.label !== record.label\r\n )\r\n ){\r\n // If there is an existing record and the values are changed, add this record to the modified records list\r\n let modRecord = {\r\n ...existing,\r\n ...record\r\n }\r\n delete modRecord[\"__typename\"];\r\n \r\n modifiedOrAddedVaxRecords.push(modRecord);\r\n }\r\n \r\n if (!existing){\r\n // If this is an entirely new vax date, just add it to the modified records list\r\n let newRecord = {\r\n ...record\r\n }\r\n delete newRecord[\"__typename\"];\r\n modifiedOrAddedVaxRecords.push(newRecord);\r\n }\r\n })\r\n \r\n // Now check if there are vax records that were deleted from the form and add it to the deleted records list\r\n originalVaxRecords?.forEach((record) => {\r\n if (!vaxFormRows.has(personID + '-' + record.order)){\r\n deletedVaxRecords.push({\r\n personID: personID,\r\n order: record.order\r\n });\r\n }\r\n })\r\n \r\n let stripRecord = (record: PersonCovidVaxRecord) => ({\r\n personID: record.personID,\r\n order: record.order,\r\n __typename: 'PersonCov19VaxRecord'\r\n })\r\n \r\n resolve({\r\n variables: {\r\n modifyVaxRecords: modifiedOrAddedVaxRecords.length > 0,\r\n deleteVaxRecords: deletedVaxRecords.length > 0,\r\n modifiedVaxRecords: modifiedOrAddedVaxRecords,\r\n deletedVaxRecords: deletedVaxRecords\r\n },\r\n optimisticResponse: (useOptimisticResponse || false) ? {\r\n __typename: 'Mutation',\r\n bulkUpdatePersonCovid19VaxDate: modifiedOrAddedVaxRecords.map(stripRecord),\r\n bulkDeletePersonCovid19VaxDate: deletedVaxRecords.map(stripRecord)\r\n } : undefined,\r\n update: (proxy) => {\r\n if (onMutationUpdate){\r\n let updatedRecords = Array.from(vaxFormRows.values())\r\n \r\n // GraphQL requires __typename to be added\r\n .map((record) => ({ ...record, __typename: 'PersonCov19VaxRecord' }))\r\n .map(record => makePersonCovidVaxRecordUnique(record))\r\n .map((record): PersonCovidVaxRecord => {\r\n let newRecord: any = { ...record }\r\n delete newRecord.isNew;\r\n delete newRecord.id;\r\n return newRecord;\r\n });\r\n \r\n onMutationUpdate(proxy, updatedRecords);\r\n }\r\n }\r\n })\r\n }\r\n catch(e){\r\n console.log('Failed to build mutation:', e)\r\n }\r\n })\r\n })\r\n \r\n return mutationPromise;\r\n}\r\n\r\nexport function useCovidVaxDateFormSubmitter(\r\n data: PersonCovidVaxRecord[], \r\n options: SubmitterOptions\r\n): [(form: WrappedFormUtils) => void, MutationResult] {\r\n\r\n const [ mutate, mutationResult ] = useMutation(MUTATION, {\r\n onCompleted: options?.onCompleted,\r\n onError: options?.onError\r\n });\r\n\r\n return [\r\n /*submit */\r\n async (form: WrappedFormUtils) => {\r\n let mutationOptions = await buildBulkMutation(\r\n {\r\n originalVaxRecords: data,\r\n customerID: options.customerID,\r\n customerName: options.customerName,\r\n employerID: options.employerID,\r\n employerName: options.employerName,\r\n personID: options.personID,\r\n personName: options.personName\r\n },\r\n form,\r\n options.onMutationUpdate\r\n )\r\n if (!mutationOptions) return;\r\n\r\n mutate(mutationOptions)\r\n .then(() => form.resetFields())\r\n .catch(() => null)\r\n },\r\n mutationResult\r\n ]\r\n}\r\n\r\n","import { useQuery } from '@apollo/react-hooks';\r\nimport { Alert, Button, Card, Divider, Form, Icon, message, Spin } from 'antd';\r\nimport { FormComponentProps } from 'antd/lib/form/Form';\r\nimport { NetworkStatus } from 'apollo-client';\r\nimport { castArray, getPersonFullName } from 'common/util';\r\nimport CovidVaxDatesForm, { CovidVaxDatesFormProps } from 'components/covid-vax-date-form';\r\nimport { useCovidVaxDateFormSubmitter } from 'components/covid-vax-date-form/submitter';\r\nimport gql from 'graphql-tag';\r\nimport useUserGroups from 'hooks/useUserGroups';\r\nimport React, { useRef, useState } from 'react';\r\n\r\nexport interface CovidVaccineDatesProps {\r\n personID: string,\r\n personName: string\r\n}\r\n\r\nconst HEALTH_INFO_QUERY = gql`\r\nquery GetHealthInfo($personID: ID!) {\r\n person(id: $personID){\r\n _id\r\n lastName\r\n firstName\r\n customerID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n }\r\n GetPersonCov19VaxRecords(personID: $personID) {\r\n personID\r\n personName\r\n customerID\r\n customerName\r\n label\r\n order\r\n comment\r\n manufacturer\r\n date\r\n }\r\n}\r\n`\r\n\r\nconst WrappedCovidVaxDatesForm = Form.create void }>({\r\n onFieldsChange(props, _, allFields) {\r\n props.onFieldsChange(allFields);\r\n }\r\n})(CovidVaxDatesForm)\r\n\r\nconst CovidVaccineDates: React.FC = (props) => {\r\n\r\n const [ userGroups ] = useUserGroups();\r\n\r\n let canEditOrDelete = userGroups.includes('flytsuite.covid19vaxrecords.edit') && userGroups.includes('flytsuite.covid19vaxrecords.delete');\r\n\r\n const [ , setVaxFormFields ] = useState();\r\n\r\n let vaxFormRef = useRef(null);\r\n let resetFormFuncRef = useRef(null);\r\n\r\n const { data, error, refetch, networkStatus } = useQuery(HEALTH_INFO_QUERY, {\r\n variables: {\r\n personID: props.personID\r\n },\r\n fetchPolicy: 'cache-and-network',\r\n errorPolicy: 'all'\r\n })\r\n\r\n let personData = data?.person;\r\n\r\n let records = castArray(data?.GetPersonCov19VaxRecords);\r\n\r\n const [ submitVaxDates, { loading: submitVaxDatesLoading } ] = useCovidVaxDateFormSubmitter(records, {\r\n personID: props.personID,\r\n personName: getPersonFullName(personData),\r\n customerID: personData?.customerID?._id,\r\n customerName: personData?.customerID?.name,\r\n employerID: personData?.employerID?._id,\r\n employerName: personData?.employerID?.name,\r\n useOptimisticResponse: false,\r\n onMutationUpdate: (cache, newRecords) => {\r\n let vars = { personID: props.personID }\r\n let queryData: any = cache.readQuery({\r\n query: HEALTH_INFO_QUERY,\r\n variables: vars\r\n })\r\n\r\n let newQueryData = {\r\n ...queryData,\r\n GetPersonCov19VaxRecords: newRecords\r\n }\r\n\r\n cache.writeQuery({\r\n query: HEALTH_INFO_QUERY,\r\n variables: vars,\r\n data: newQueryData\r\n })\r\n refetch()\r\n },\r\n onCompleted: () => message.success('Successfully updated vaccine date information'),\r\n onError: () => message.error('Failed to update vaccine date info due to an error')\r\n })\r\n\r\n return
\r\n {error ? : null}\r\n }>\r\n \r\n {vaxFormRef.current?.isFieldsTouched() ? <>\r\n {\r\n if (resetFormFuncRef.current){\r\n resetFormFuncRef.current();\r\n }\r\n }}\r\n >\r\n Cancel\r\n \r\n submitVaxDates(vaxFormRef.current)}\r\n >\r\n {submitVaxDatesLoading ? 'Saving' : 'Save'}\r\n \r\n \r\n : null}\r\n refetch()}\r\n />\r\n
\r\n }\r\n style={{ height: '100%' }}\r\n >\r\n {!canEditOrDelete ? (\r\n \r\n ) : null}\r\n setVaxFormFields(fields)}\r\n ref={vaxFormRef}\r\n data={records}\r\n allowRemoveOrClearRecord={canEditOrDelete}\r\n disabled={!canEditOrDelete}\r\n resetFormFunc={(resetFormFunc) => resetFormFuncRef.current = resetFormFunc}\r\n />\r\n \r\n
\r\n \r\n}\r\n\r\nexport default CovidVaccineDates;","import { QueryResult } from \"@apollo/react-common\";\r\nimport { createContext } from \"react\";\r\n\r\nconst QueryResultContext = createContext(null)\r\n\r\nexport default QueryResultContext;","import React, { Component } from 'react';\r\nimport { Button, Divider, Popconfirm } from 'antd';\r\nimport PropTypes from 'prop-types';\r\n\r\nclass EditControl extends Component {\r\n save = () => {\r\n this.props.onSave();\r\n this.props.onChange(false);\r\n }\r\n cancel = () => {\r\n this.props.onCancel()\r\n this.props.onChange(false);\r\n }\r\n setEditing = (editing) => this.props.onChange(editing)\r\n render() {\r\n const { editing } = this.props;\r\n if (!editing){\r\n return (\r\n
\r\n this.setEditing(true)}\r\n >Edit\r\n \r\n this.props.onRemove && this.props.onRemove()}\r\n >\r\n \r\n \r\n
\r\n )\r\n }\r\n return (\r\n
\r\n this.save()}\r\n >Save\r\n \r\n this.cancel()}\r\n >Cancel\r\n
\r\n );\r\n }\r\n}\r\n\r\nEditControl.propTypes = {\r\n onSave: PropTypes.func.isRequired,\r\n onChange: PropTypes.func.isRequired,\r\n onCancel: PropTypes.func.isRequired,\r\n editing: PropTypes.bool,\r\n onRemove: PropTypes.func\r\n}\r\n \r\nexport default EditControl;","import React, { Component } from 'react';\r\nimport { Form, Input, DatePicker, Button } from 'antd';\r\nimport PropTypes from 'prop-types';\r\nimport moment from 'moment';\r\n\r\nconst formItemLayout = {\r\n labelCol: {\r\n xs: { span: 24 },\r\n sm: { span: 8 },\r\n },\r\n wrapperCol: {\r\n xs: { span: 24 },\r\n sm: { span: 16 },\r\n },\r\n style: {\r\n margin: 0\r\n }\r\n};\r\n\r\nclass EditForm extends Component {\r\n render() {\r\n const { dateFormat=\"YYYY-MM-DD\", hasKey=true, hasExpiration=true, needsButton=false } = this.props;\r\n const { getFieldDecorator, setFieldsValue, getFieldValue } = this.props.form;\r\n return (\r\n
\r\n {hasKey ? \r\n {getFieldDecorator('key')()}\r\n : null}\r\n {hasExpiration ? \r\n {getFieldDecorator('expiration')()}\r\n : null}\r\n {needsButton ? : null}\r\n
\r\n );\r\n }\r\n}\r\n\r\nconst WithForm = Form.create({\r\n mapPropsToFields: ({ credKey, expiration }) => ({\r\n key: credKey && Form.createFormField({\r\n ...credKey,\r\n value: credKey.value\r\n }),\r\n expiration: expiration && Form.createFormField({\r\n ...credKey,\r\n value: expiration.value\r\n })\r\n }),\r\n onFieldsChange(props, changedFields){\r\n if (props.onChange)\r\n props.onChange(changedFields)\r\n }\r\n})(EditForm);\r\n\r\nWithForm.propTypes = {\r\n fields: PropTypes.object,\r\n credKey: PropTypes.object,\r\n expiration: PropTypes.object,\r\n onChange: PropTypes.func,\r\n hasKey: PropTypes.bool,\r\n hasExpiration: PropTypes.bool,\r\n needsButton: PropTypes.bool\r\n}\r\n \r\nexport default WithForm;","import React, { Component } from 'react';\r\nimport { Card, Spin, Alert } from 'antd';\r\nimport EditControl from './EditControl';\r\nimport PropTypes from 'prop-types';\r\nimport EditForm from './EditForm';\r\nimport moment from 'moment';\r\n\r\nconst CredItem = ({ label, value }) => (\r\n
\r\n {label}: {value}\r\n
\r\n)\r\n\r\nconst DATE_FORMAT = 'YYYY-MM-DD'\r\n\r\nclass Credential extends Component {\r\n static propTypes = {\r\n loading: PropTypes.bool,\r\n error: PropTypes.object,\r\n credKey: PropTypes.string,\r\n person: PropTypes.object,\r\n expiration: PropTypes.string,\r\n showPerson: PropTypes.bool,\r\n disableEditing: PropTypes.bool,\r\n cardProps: PropTypes.object,\r\n editing: PropTypes.bool,\r\n onChange: PropTypes.func,\r\n onRemove: PropTypes.func,\r\n hasExpiration: PropTypes.bool,\r\n needsButton: PropTypes.bool,\r\n hasKey: PropTypes.bool,\r\n title: PropTypes.any\r\n }\r\n state = {\r\n editing: false,\r\n fields: {}\r\n }\r\n onSave = () => {\r\n const { form } = this.refs;\r\n form.validateFieldsAndScroll((err, values) => {\r\n if (!err){\r\n this.props.onSave && this.props.onSave({\r\n key: values.key,\r\n expiration: values.expiration && values.expiration.format(DATE_FORMAT)\r\n })\r\n }\r\n })\r\n \r\n }\r\n editDisabled = () => this.props.disableEditing ? true : false\r\n isEditing = () => {\r\n if (typeof this.props.editing === \"boolean\"){\r\n return this.props.editing;\r\n }else{\r\n return this.state.editing\r\n }\r\n }\r\n setEditing = (value) => {\r\n if (this.props.onChange){\r\n this.props.onChange({\r\n editing: value\r\n })\r\n }\r\n this.setState({ editing: value })\r\n }\r\n onFormChange = (fields) => {\r\n this.setState({ fields: {\r\n ...this.state.fields,\r\n ...fields\r\n } })\r\n }\r\n setFieldsFromProps = () => {\r\n this.setState({\r\n fields: {\r\n key: {\r\n value: this.props.credKey\r\n },\r\n expiration: {\r\n value: moment(this.props.expiration)\r\n }\r\n }\r\n })\r\n }\r\n componentDidMount(){\r\n this.setFieldsFromProps()\r\n }\r\n render() {\r\n const {\r\n loading=false,\r\n error,\r\n type,\r\n credKey,\r\n person,\r\n expiration,\r\n showPerson,\r\n disableEditing,\r\n onSave,\r\n onChange,\r\n hasKey=true,\r\n hasExpiration=true,\r\n needsButton=false,\r\n title='Unknown Credential',\r\n ...restProps\r\n } = this.props;\r\n\r\n if (error){\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n const editing = this.isEditing();\r\n const extra = !disableEditing ? (\r\n this.setEditing(v)}\r\n onSave={this.onSave}\r\n onCancel={this.setFieldsFromProps}\r\n onRemove={() => this.props.onRemove && this.props.onRemove()}\r\n />\r\n ) : null\r\n return (\r\n \r\n \r\n {editing ? (\r\n
\r\n \r\n
\r\n ) : (\r\n
\r\n {hasKey ? : null}\r\n {hasExpiration ? : null}\r\n
\r\n )}\r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default Credential;","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery CredentialQuery(\r\n $filter: CredentialFilterInput!\r\n $withPerson: Boolean!\r\n){\r\n credentials(\r\n filter: $filter\r\n limit: 1\r\n ){\r\n docs {\r\n _id\r\n ... on Credential {\r\n key\r\n type\r\n expiration\r\n personID @include(if: $withPerson) {\r\n _id\r\n lastName\r\n firstName\r\n }\r\n }\r\n }\r\n }\r\n}\r\n`","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nmutation SaveCredentialMutation(\r\n $_id: ID\r\n $key: String\r\n $expiration: AWSDateTime\r\n $type: CredentialType\r\n $personID: ID!\r\n $tpID: ID!\r\n $customerID: ID\r\n){\r\n credential(\r\n _id: $_id\r\n key: $key\r\n expiration: $expiration\r\n type: $type\r\n personID: $personID\r\n tpID: $tpID\r\n customerID: $customerID\r\n ){\r\n _id\r\n key\r\n expiration\r\n type\r\n }\r\n}\r\n`","// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default {\r\n 'HUET_CARD': {\r\n hasKey: false,\r\n hasExpiration: true,\r\n label: 'HUET Card'\r\n },\r\n 'EBS_CARD': {\r\n hasKey: false,\r\n hasExpiration: true,\r\n label: 'EBS Card'\r\n },\r\n 'ISN': {\r\n hasKey: true,\r\n hasExpiration: false,\r\n label: 'ISN'\r\n },\r\n 'PASSPORT': {\r\n hasKey: true,\r\n hasExpiration: true,\r\n label: 'Passport'\r\n },\r\n 'PASSPORT_CARD': {\r\n hasKey: true,\r\n hasExpiration: true,\r\n label: 'Passport Card'\r\n },\r\n 'SAFETY_CARD': {\r\n hasKey: false,\r\n hasExpiration: true,\r\n label: 'Safety Card',\r\n needsButton: true\r\n },\r\n 'TWIC': {\r\n hasKey: true,\r\n hasExpiration: true ,\r\n label: 'TWIC Card' \r\n },\r\n 'US_DRIVERS_LICENSE': {\r\n hasKey: true,\r\n hasExpiration: true,\r\n label: 'U.S. Driver\\'s License'\r\n },\r\n}","import { graphql } from 'react-apollo';\r\nimport compose from 'lodash.flowright';\r\nimport Credential from './Credential';\r\nimport CredentialQuery from './CredentialQuery';\r\nimport SaveCredentialMutation from './SaveCredentialMutation';\r\n\r\nexport default compose(\r\n graphql(\r\n CredentialQuery,\r\n {\r\n options: props => ({\r\n variables: {\r\n filter: {\r\n credentialIds: [props.id]\r\n },\r\n withPerson: Boolean(props.withPerson)\r\n },\r\n fetchPolicy: 'cache-first',\r\n skip: props => !props.id\r\n }),\r\n props: props => {\r\n var key, type, expiration, person, credLen = 0, cred;\r\n const { data, ...restProps } = props;\r\n try{\r\n credLen = props.data.credentials.docs.length\r\n }\r\n catch(err){}\r\n if (credLen){\r\n cred = props.data.credentials.docs[0]\r\n }\r\n if (cred){\r\n key = cred.key;\r\n type = cred.type;\r\n person = cred.personID;\r\n expiration = cred.expiration;\r\n }\r\n return {\r\n ...restProps,\r\n loading: data && data.loading,\r\n error: data && data.error,\r\n credKey: key,\r\n type,\r\n expiration,\r\n person\r\n }\r\n }\r\n }\r\n ),\r\n graphql(\r\n SaveCredentialMutation,\r\n {\r\n name: 'save'\r\n }\r\n )\r\n)(Credential)","import { Button, DatePicker, Form, Input, Select } from 'antd';\r\nimport moment from 'moment';\r\nimport PropTypes from 'prop-types';\r\nimport React, { Component } from 'react';\r\nimport credentialTypes from '../../credentialTypes';\r\n\r\nconst { Option } = Select;\r\n\r\nconst formItemLayout = {\r\n labelCol: {\r\n xs: { span: 24 },\r\n sm: { span: 8 },\r\n },\r\n wrapperCol: {\r\n xs: { span: 24 },\r\n sm: { span: 16 },\r\n },\r\n};\r\n\r\nconst tailFormItemLayout = {\r\n wrapperCol: {\r\n xs: {\r\n span: 24,\r\n offset: 0,\r\n },\r\n sm: {\r\n span: 16,\r\n offset: 8,\r\n },\r\n },\r\n};\r\n\r\nconst DATE_FORMAT = 'YYYY-MM-DD'\r\n\r\nclass CredentialForm extends Component {\r\n validateType = (rule, value, callback) => {\r\n const { takenTypes=[], typeTakenMessage=\"This person already has this type of credential\" } = this.props;\r\n if (takenTypes.includes(value)){\r\n callback(typeTakenMessage)\r\n }else{\r\n callback()\r\n }\r\n }\r\n render() { \r\n const { getFieldDecorator, getFieldValue, setFieldsValue } = this.props.form;\r\n const { submitText = 'Submit', resetText = 'Reset', showActions=false, lockType } = this.props;\r\n const chosenType = credentialTypes[getFieldValue('type')];\r\n return (\r\n
this.props.onSave && this.props.onSave(data)}>\r\n \r\n {\r\n getFieldDecorator('type', {\r\n rules: [\r\n {\r\n required: true, message: 'Type is required'\r\n },\r\n {\r\n validator: this.validateType\r\n }\r\n ]\r\n })(\r\n \r\n )\r\n }\r\n \r\n {chosenType && chosenType.hasKey ? \r\n {\r\n getFieldDecorator('key', {\r\n rules: [\r\n {\r\n required: true, message: 'Key is required'\r\n }\r\n ]\r\n })(\r\n \r\n )\r\n }\r\n : null}\r\n {chosenType && chosenType.hasExpiration ? \r\n {\r\n getFieldDecorator('expiration', {\r\n rules: [\r\n {\r\n required: true, message: 'Expiration is required'\r\n }\r\n ]\r\n })(\r\n \r\n )\r\n }\r\n : null}\r\n {chosenType && chosenType.needsButton ? : null}\r\n {showActions ? (\r\n \r\n \r\n \r\n \r\n ) : null}\r\n
\r\n );\r\n }\r\n}\r\n\r\nconst CredentialFormWithForm = Form.create({\r\n onFieldsChange(props, changedFields) {\r\n if (props.onChange)\r\n props.onChange(changedFields)\r\n },\r\n mapPropsToFields(props) {\r\n let { fields={} } = props;\r\n return {\r\n type: Form.createFormField({\r\n ...fields.type,\r\n value: props.lockType ? props.lockType : fields.type?.value\r\n }),\r\n key: Form.createFormField({\r\n ...fields.key\r\n }),\r\n expiration: Form.createFormField({\r\n ...fields.expiration\r\n })\r\n }\r\n }\r\n})(CredentialForm)\r\n\r\nCredentialFormWithForm.propTypes = {\r\n typeTakenMessage: PropTypes.string,\r\n takenTypes: PropTypes.arrayOf(PropTypes.string),\r\n onSubmit: PropTypes.func,\r\n onChange: PropTypes.func,\r\n fields: PropTypes.arrayOf(PropTypes.object)\r\n}\r\n \r\nexport default CredentialFormWithForm;","import React, { Component } from 'react';\r\nimport { Row, Col, Icon, Button, Modal } from 'antd';\r\nimport { Credential } from '../Credential';\r\nimport PropTypes from 'prop-types';\r\nimport pluralize from 'pluralize';\r\nimport { CredentialForm } from '../CredentialForm';\r\nimport moment from 'moment';\r\nimport credentialTypes from '../../credentialTypes';\r\n\r\nclass CredentialManager extends Component {\r\n state = {\r\n currentCredId: null,\r\n showForm: false,\r\n formFields: {}\r\n }\r\n resetFormFields = () => {\r\n this.setState({ formFields: {} })\r\n }\r\n setFormFields = (fields) => {\r\n this.setState({\r\n formFields: {\r\n ...this.state.formFields,\r\n ...fields\r\n }\r\n })\r\n }\r\n getCredentials = () => {\r\n var credentials = this.props.credentials;\r\n if (!Array.isArray(credentials)){\r\n credentials = [];\r\n }\r\n return credentials\r\n }\r\n getCredentialByType = (type) => {\r\n return this.getCredentials().find(c => c.type === type)\r\n }\r\n setFormVisibility = (val) => this.setState({ showForm: val })\r\n onSave = (data, isNew) => {\r\n if (this.props.onSave)\r\n this.props.onSave(data, isNew)\r\n }\r\n typeAlreadyExists = () => {\r\n const type = this.getFormField('type');\r\n return this.getCredentialByType(type) ? true : false\r\n }\r\n getFormField = (field, attr='value') => {\r\n try{\r\n return this.state.formFields[field][attr]\r\n }catch(error){\r\n return\r\n }\r\n }\r\n render() {\r\n var { showAdd=true } = this.props;\r\n const { colProps={}, showCount=false, disabled=false } = this.props;\r\n const credentials = this.getCredentials()\r\n .filter((cred) => credentialTypes[cred.type]);\r\n return (\r\n
\r\n {showCount ? (\r\n

{`${credentials.length} ${pluralize('Credential', credentials.length)}`}

\r\n ) : null}\r\n \r\n {credentials.map(cred => {\r\n const editing = cred._id === this.state.currentCredId;\r\n const credType = credentialTypes[cred.type];\r\n return (\r\n \r\n
\r\n {\r\n const currentCredId = editing ? cred._id : null;\r\n this.setState({\r\n ...this.state,\r\n currentCredId\r\n })\r\n }}\r\n onSave={(data) => this.onSave({\r\n ...cred,\r\n ...data\r\n }, false)}\r\n onRemove={() => this.props.onRemove && this.props.onRemove(cred._id)}\r\n />\r\n
\r\n \r\n )\r\n })}\r\n {showAdd && !disabled ? (\r\n \r\n \r\n \r\n ) : null}\r\n
\r\n {\r\n this.setFormVisibility(false);\r\n this.resetFormFields();\r\n }}\r\n footer={[\r\n {\r\n this.refs.form.validateFieldsAndScroll((err, values) => {\r\n if (!err){\r\n this.setFormVisibility(false);\r\n this.onSave({\r\n ...values,\r\n expiration: moment(values.expiration).format('YYYY-MM-DD')\r\n }, true);\r\n this.resetFormFields();\r\n }\r\n })\r\n }}\r\n >Add Credential,\r\n \r\n ]}\r\n >\r\n type)}\r\n fields={this.state.formFields}\r\n onChange={(fields) => this.setState({ formFields: {\r\n ...this.state.formFields,\r\n ...fields\r\n } })}\r\n ref=\"form\"\r\n />\r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nCredentialManager.propTypes = {\r\n credentials: PropTypes.arrayOf(PropTypes.object),\r\n showAdd: PropTypes.bool,\r\n onSave: PropTypes.func,\r\n onRemove: PropTypes.func\r\n}\r\n \r\nexport default CredentialManager;","import React, { Component } from 'react';\r\nimport { Alert, Button } from 'antd';\r\n\r\nclass ErrorCatch extends Component {\r\n state = {\r\n error: null\r\n }\r\n componentDidCatch(error){\r\n this.setState({ error })\r\n }\r\n resetState = () => {\r\n this.setState({ error: null })\r\n }\r\n render() { \r\n const { error } = this.state;\r\n const { message, description, children, ...restProps } = this.props;\r\n if (error){\r\n const alertProps = {\r\n message: message || 'An error occurred in the application',\r\n description: (\r\n
\r\n

{description || error.message}

\r\n \r\n
\r\n ),\r\n showIcon: true,\r\n onClose: this.resetState,\r\n closable: true,\r\n type: 'error',\r\n ...restProps\r\n }\r\n return (\r\n \r\n )\r\n }\r\n return children\r\n }\r\n}\r\n \r\n// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default (options={}) => (Component) => props => (\r\n \r\n \r\n \r\n);","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery PersonCredentials(\r\n $personId: ID!\r\n){\r\n personCredentials(\r\n personId: $personId\r\n ){\r\n _id\r\n key\r\n type\r\n expiration\r\n }\r\n}\r\n`","import React from 'react';\r\nimport { Spin, Icon } from 'antd';\r\n\r\nconst LoadingContent = ({text = 'Loading', style={}}) => (\r\n
\r\n } />\r\n

{text}

\r\n
\r\n)\r\n\r\nexport default LoadingContent","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nmutation SaveCredential(\r\n $_id: ID\r\n $key: String\r\n $expiration: AWSDate\r\n $type: CredentialType\r\n $personID: ID!\r\n $tpID: ID!\r\n $customerID: ID\r\n $paxID: ID\r\n){\r\n setCredential(\r\n _id: $_id\r\n key: $key\r\n expiration: $expiration\r\n type: $type\r\n personID: $personID\r\n tpID: $tpID\r\n customerID: $customerID\r\n paxID: $paxID\r\n ){\r\n _id\r\n key\r\n expiration\r\n personID {\r\n _id\r\n }\r\n type\r\n }\r\n}\r\n`","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nmutation RemoveCredential(\r\n $_id: ID\r\n $tpID: ID!\r\n){\r\n setCredential(\r\n _id: $_id\r\n deleted: true\r\n tpID: $tpID\r\n ){\r\n _id\r\n key\r\n expiration\r\n personID {\r\n _id\r\n }\r\n type\r\n }\r\n}\r\n`","import React from 'react';\r\nimport { Query, Mutation } from 'react-apollo';\r\nimport compose from 'lodash.flowright';\r\n// import CredentialGrid from './CredentialGrid';\r\n// import withLoading from '../WithLoading';\r\n// import withError from '../WithError';\r\nimport withErrorCatch from '../withErrorCatch';\r\nimport Credentials from '../../Queries/Credentials';\r\nimport PropTypes from 'prop-types';\r\nimport LoadingContent from '../LoadingContent';\r\nimport { Alert, message } from 'antd';\r\nimport CredentialManager from './CredentialManager';\r\nimport withOrgData from '../WithOrgData';\r\nimport { SaveCredential, RemoveCredential } from './Mutations';\r\nimport gql from 'graphql-tag';\r\nimport { withUserGroups } from '../userGroup';\r\n\r\nconst credTypePrefix = {\r\n 'US_DRIVERS_LICENSE': 'DRV',\r\n 'TWIC': 'TWI',\r\n 'SAFETY_CARD': 'SFC',\r\n 'PASSPORT': 'PSP',\r\n 'PASSPORT_CARD': 'PPC',\r\n 'HUET_CARD': 'HUT',\r\n 'ISN': 'ISN',\r\n 'EBS_CARD': 'EBS'\r\n}\r\n\r\nconst computeID = (type, personId) => {\r\n const idEnd = personId.replace('PER-', '');\r\n const prefix = credTypePrefix[type];\r\n if (prefix){\r\n return `${prefix}-${idEnd}`\r\n }\r\n throw Error(`Could not find prefix for type '${type}'`)\r\n}\r\n \r\nconst CredentialManagerWithData = ({ personId, paxID, orgData, requireUserGroups=['flytsuite.master.all', 'flytsuite.master.credential.edit'], userGroups, ...restProps }) => {\r\n const variables = {\r\n personId,\r\n limit: 999\r\n }\r\n const hasPermission = requireUserGroups.find((group) => userGroups.includes(group)) ? true : false;\r\n return (\r\n \r\n {\r\n ({ data, loading, error }) => {\r\n if (loading) return \r\n if (error) return (\r\n \r\n )\r\n var credentials;\r\n try{\r\n credentials = data.personCredentials;\r\n }\r\n catch(err){\r\n credentials = [];\r\n }\r\n return (\r\n \r\n {(save) => (\r\n \r\n {(remove) => (\r\n
\r\n {!hasPermission ? (\r\n \r\n ) : null}\r\n {\r\n const credId = isNew ? computeID(data.type, personId) : data._id;\r\n const org = orgData.transporter || orgData.employer;\r\n const orgID = org && org._id;\r\n save({\r\n variables: {\r\n _id: isNew ? undefined : credId,\r\n key: data.key,\r\n expiration: data.expiration,\r\n type: data.type,\r\n tpID: orgID,\r\n customerID: orgData.customer && orgData.customer._id,\r\n personID: personId,\r\n paxID: paxID || undefined\r\n },\r\n update: (cache, { data: { setCredential } }) => {\r\n if (isNew){\r\n const { personCredentials } = cache.readQuery({\r\n query: Credentials,\r\n variables\r\n });\r\n const newCreds = personCredentials.concat([setCredential])\r\n .sort((a, b) => ('' + a.type).localeCompare('' + b.type))\r\n \r\n cache.writeQuery({\r\n query: Credentials,\r\n variables,\r\n data: {\r\n personCredentials: newCreds\r\n }\r\n })\r\n }else{\r\n cache.writeFragment({\r\n id: credId,\r\n fragment: gql`\r\n fragment Cred on Credential {\r\n _id\r\n type\r\n personID {\r\n _id\r\n }\r\n key\r\n expiration\r\n }\r\n `,\r\n data: {\r\n __typename: 'Credential',\r\n _id: credId,\r\n key: data.key,\r\n expiration: data.expiration,\r\n type: data.type,\r\n personID: {\r\n __typename: 'Person',\r\n _id: personId\r\n }\r\n }\r\n })\r\n }\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setCredential: {\r\n __typename: 'Credential',\r\n _id: credId,\r\n key: data.key,\r\n expiration: data.expiration,\r\n type: data.type,\r\n personID: {\r\n __typename: 'Person',\r\n _id: personId\r\n }\r\n }\r\n }\r\n })\r\n .then(() => message.success('Credential saved successfully'))\r\n .catch(() => message.error('Failed to save credential'))\r\n }}\r\n onRemove={(credId) => {\r\n const cred = credentials.find(({ _id }) => _id === credId) || {};\r\n const org = orgData.transporter || orgData.employer;\r\n const orgID = org && org._id;\r\n remove({\r\n variables: {\r\n _id: credId,\r\n tpID: orgID\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setCredential: {\r\n __typename: 'Credential',\r\n ...cred,\r\n personID: {\r\n __typename: 'Person',\r\n _id: personId\r\n }\r\n }\r\n },\r\n update: (cache, { data: { setCredential } }) => {\r\n const { personCredentials } = cache.readQuery({\r\n query: Credentials,\r\n variables\r\n });\r\n \r\n cache.writeQuery({\r\n query: Credentials,\r\n variables,\r\n data: {\r\n personCredentials: personCredentials.filter(cred => cred._id !== setCredential._id)\r\n }\r\n })\r\n }\r\n })\r\n .then(() => message.success('Credential removed successfully'))\r\n .catch(() => message.error('Failed to remove credential'))\r\n }}\r\n {...restProps}\r\n />\r\n
\r\n )\r\n } \r\n
\r\n )}\r\n
\r\n )\r\n }\r\n }\r\n
\r\n )\r\n}\r\n\r\nCredentialManagerWithData.propTypes = {\r\n personId: PropTypes.string.isRequired\r\n}\r\n\r\nexport default compose(\r\n withErrorCatch(),\r\n withOrgData,\r\n withUserGroups\r\n)(CredentialManagerWithData)","import { Avatar, Button, Col, Descriptions, message, Row, Tabs, Input } from 'antd';\r\nimport { CountryCodeSelect } from 'components/form/select/CountryCodeSelect';\r\nimport EmployerSelectWithData from 'components/form/select/EmployerSelect';\r\nimport CovidVaccineDates from 'components/PassengerEditor/CovidVaccineDates';\r\nimport { withUserGroups } from 'components/userGroup';\r\nimport QueryResultContext from 'context/query-result-context';\r\nimport gql from 'graphql-tag';\r\nimport compose from 'lodash.flowright';\r\nimport PropTypes from 'prop-types';\r\nimport React, { Component, useState } from 'react';\r\nimport { Mutation, withApollo } from 'react-apollo';\r\nimport WithOrgData from '../../components/WithOrgData';\r\nimport { CredentialManagerWithData } from '../CredentialManager';\r\nimport './PassengerEditor.less';\r\n\r\n\r\nconst SET_PERSON = gql`\r\n\r\n mutation SetPerson(\r\n $payload: PersonInput!,\r\n $orgID: ID!\r\n ){\r\n setPerson(\r\n payload: $payload\r\n orgID: $orgID\r\n ){\r\n _id\r\n dob\r\n nation\r\n notes\r\n employerID {\r\n _id\r\n name\r\n }\r\n contactInfo {\r\n phone {\r\n number\r\n type\r\n }\r\n }\r\n }\r\n }\r\n`\r\n\r\nclass PassengerEditor extends Component {\r\n state = {\r\n error: false\r\n }\r\n setPicError = (error) => {\r\n this.setState({ error: error })\r\n }\r\n\r\n renderPicture = () => {\r\n const { data } = this.props;\r\n const personId = data.personID._id;\r\n const path = \"https://s3.amazonaws.com/df-web-img/pax/\" + personId + \"/\" + personId + \"_prof.jpeg\";\r\n if (this.state.error) {\r\n return (\r\n No Image Found\r\n )\r\n }\r\n else {\r\n return (\r\n this.setPicError(true)} />\r\n )\r\n }\r\n }\r\n\r\n\r\n\r\n renderNationSelect = () => {\r\n const { data, edit } = this.props;\r\n\r\n return (\r\n message.success('Passenger nation successfuly updated')}\r\n onError={() => message.error('Failed to update passenger\\'s nation. An error has occurred.')}\r\n >\r\n {(mutate) => {\r\n return (\r\n {\r\n mutate({\r\n variables: {\r\n payload: {\r\n _id: this.props.data.personID._id,\r\n nation\r\n },\r\n orgID: this.props.orgData.getOrgByType('transporter')._id\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setPerson: {\r\n __typename: 'Person',\r\n ...this.props.data.personID,\r\n nation\r\n }\r\n }\r\n })\r\n }}\r\n >\r\n \r\n )\r\n }}\r\n \r\n )\r\n }\r\n\r\n renderInfo = () => {\r\n const { data, edit } = this.props;\r\n return (\r\n \r\n \r\n \r\n {this.renderPicture()}\r\n \r\n \r\n \r\n {data.personID.dob}\r\n \r\n {data.personID?.contactInfo?.phone?.number ? (\r\n `${data.personID.contactInfo.phone.number} (${data.personID.contactInfo.phone.type})`\r\n ) : null}\r\n \r\n {this.renderNationSelect()}\r\n \r\n \r\n {(queryResult) => (\r\n {\r\n message.success('Passenger employer successfuly updated')\r\n console.log('queryResult', queryResult);\r\n if (queryResult) {\r\n queryResult.refetch();\r\n }\r\n }}\r\n onError={() => message.error('Failed to update passenger\\'s employer. An error has occurred.')}\r\n >\r\n {(mutate) => {\r\n return (\r\n {\r\n let empObj = {\r\n _id: e.key,\r\n name: e.label,\r\n __typename: 'Employer'\r\n }\r\n mutate({\r\n variables: {\r\n personPayload: {\r\n _id: this.props.data.personID._id,\r\n employerID: e.key\r\n },\r\n paxPayload: {\r\n _id: this.props.data._id,\r\n employerID: e.key,\r\n tpID: this.props.orgData.getOrgByType('transporter')._id\r\n },\r\n orgID: this.props.orgData.getOrgByType('transporter')._id\r\n },\r\n update: (cache, { data: { setPaxNode } }) => {\r\n cache.writeFragment({\r\n fragment: gql`\r\n fragment Pax on PaxNode {\r\n _id\r\n employerID {\r\n _id\r\n name\r\n }\r\n }\r\n `,\r\n id: 'PaxNode:' + setPaxNode._id,\r\n data: {\r\n ...setPaxNode,\r\n __typename: 'PaxNode',\r\n employerID: empObj\r\n }\r\n })\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setPerson: {\r\n __typename: 'Person',\r\n ...this.props.data.personID,\r\n employerID: empObj\r\n },\r\n setPaxNode: {\r\n __typename: 'PaxNode',\r\n ...this.props.data,\r\n personID: {\r\n ...this.props.data.personID,\r\n employerID: empObj\r\n },\r\n employerID: empObj\r\n }\r\n }\r\n })\r\n }}\r\n placeholder=\"Select an Employer\"\r\n >\r\n \r\n )\r\n }}\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n }\r\n\r\n renderCredentials = () => {\r\n const { data } = this.props;\r\n\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n\r\n\r\n render() {\r\n const { data, style, className, userGroups } = this.props;\r\n return (\r\n
\r\n {data && (\r\n

{`${data.lastName}, ${data.firstName}`}

\r\n )}\r\n \r\n {this.renderInfo()}\r\n {this.renderCredentials()}\r\n {userGroups.includes('flytsuite.covid19vaxrecords.read') ? (\r\n \r\n \r\n \r\n ) : null}\r\n {this.renderPersonalNotes()}\r\n \r\n
\r\n );\r\n }\r\n\r\n handleNotesChange = (event) => {\r\n this.setState({ changedNotes: event.target.value });\r\n }\r\n\r\n resetNotes = () => {\r\n this.setState({ changedNotes: undefined });\r\n }\r\n\r\n\r\n renderPersonalNotes = () => {\r\n\r\n const { data, edit } = this.props;\r\n\r\n /*If there are NO NOTES , then PULL (CURRENT PERSON) NOTES FROM PERSON RECORD*/\r\n let textAreaValue = this.state.changedNotes || data.personID.notes;\r\n\r\n return (\r\n \r\n {\r\n message.success('Passenger notes successfuly updated');\r\n this.setState({ changedNotes: undefined });\r\n }}\r\n onError={() => message.error('Failed to update passenger\\'s notes. An error has occurred.')}\r\n >\r\n {(mutate, { loading }) => {\r\n return (\r\n <>\r\n \r\n\r\n \r\n\r\n \r\n \r\n Reset edits\r\n \r\n \r\n {\r\n mutate({\r\n variables: {\r\n payload: {\r\n _id: this.props.data.personID._id,\r\n notes: this.state.changedNotes\r\n },\r\n orgID: this.props.orgData.getOrgByType('transporter')._id\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setPerson: {\r\n __typename: 'Person',\r\n ...this.props.data.personID,\r\n notes: this.state.changedNotes\r\n }\r\n }\r\n })\r\n }}>Save post\r\n \r\n \r\n \r\n \r\n )\r\n }}\r\n \r\n \r\n )\r\n }\r\n}\r\n\r\n\r\n\r\n\r\n\r\nPassengerEditor.propTypes = {\r\n data: PropTypes.object.isRequired,\r\n onSave: PropTypes.func.isRequired,\r\n onChange: PropTypes.func.isRequired,\r\n onCancel: PropTypes.func.isRequired,\r\n editing: PropTypes.string,\r\n onRemove: PropTypes.func\r\n\r\n}\r\n\r\n\r\nexport default compose(\r\n withApollo,\r\n WithOrgData,\r\n withUserGroups\r\n)(PassengerEditor)","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery PassengerQuery(\r\n $_id: ID!\r\n){\r\n getPassenger(\r\n _id: $_id\r\n ){\r\n _id\r\n firstName\r\n lastName\r\n personID {\r\n _id\r\n dob\r\n nation\r\n notes\r\n contactInfo {\r\n phone {\r\n number\r\n type\r\n }\r\n }\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n }\r\n}\r\n`","import React, { Component } from 'react';\r\nimport { Query } from 'react-apollo';\r\nimport PassengerEditor from './PassengerEditor';\r\nimport PassengerQuery from './PassengerQuery';\r\nimport PropTypes from 'prop-types';\r\nimport LoadingContent from '../LoadingContent';\r\nimport { Alert } from 'antd';\r\n\r\n/*this is a WRAPPER around the PassengerEditor.js (only this includes a QUERY around it)*/\r\nclass PassengerEditorWithData extends Component {\r\n render() {\r\n const { paxId, edit, onCancel, loadingStyle, ...restProps } = this.props;\r\n return (\r\n \r\n {({ data, loading, error }) => {\r\n if (loading && (!data || !data.getPassenger)) return \r\n return (\r\n <>\r\n {error ? (\r\n \r\n ) : null}\r\n {data && data.getPassenger ? : null}\r\n \r\n )\r\n }}\r\n \r\n );\r\n }\r\n}\r\n\r\nPassengerEditorWithData.propTypes = {\r\n paxId: PropTypes.string.isRequired\r\n}\r\n \r\nexport default PassengerEditorWithData;","import React, { CSSProperties } from 'react';\r\nimport { Row, Col, Icon } from 'antd';\r\n\r\nconst defTitle = 'Not Authorized'\r\nconst defDesciption = 'You do not have the permissions needed to access this page'\r\nconst defStyle = {\r\n maxWidth: '30rem',\r\n margin: '5rem auto'\r\n}\r\n\r\nexport interface NotAuthorizedProps {\r\n title?: React.ReactNode,\r\n desciption?: React.ReactNode,\r\n icon?: string,\r\n style?: CSSProperties,\r\n extra?: React.ReactNode\r\n}\r\n\r\nconst NotAuthorized: React.FC = ({ title=defTitle, desciption = defDesciption, icon = \"lock\", style, extra }) => (\r\n \r\n \r\n \r\n \r\n \r\n

{title}

\r\n

\r\n {desciption}\r\n

\r\n {extra ?
{extra}
: null}\r\n \r\n
\r\n)\r\n\r\nexport default NotAuthorized","import React from 'react';\r\nimport { Button, Drawer, Alert, Form, Select, Input, message, Popconfirm, Icon } from 'antd';\r\nimport { graphql } from 'react-apollo';\r\nimport compose from 'lodash.flowright';\r\nimport gql from 'graphql-tag';\r\nimport LoadingContent from '../LoadingContent';\r\nimport WithOrgData from '../WithOrgData';\r\nimport { withUserGroups } from '../userGroup';\r\nimport NotAuthorized from '../NotAuthorized';\r\n\r\nconst PASSENGER = gql`\r\nquery Passenger($_id: ID!){\r\n getPassenger(_id: $_id){\r\n _id\r\n lastName\r\n firstName\r\n authorization {\r\n onWhiteList\r\n brdRestriction_SafetyCard {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_HuetCard {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_SteelToes {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_Twic {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_NonPreferred {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_Hazmat {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_NoFlyListed {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_EbsCard {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_Illness {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_Quarantined {\r\n status\r\n type\r\n notes\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst OVERRIDE = gql`\r\nmutation Override($_id: ID! $tpID: ID! $restrictionType: String! $overrideType: BrdRestrictionType! $notes: String){\r\n overridePassengerRestriction(\r\n _id: $_id\r\n tpID: $tpID\r\n restrictionType: $restrictionType\r\n overrideType: $overrideType\r\n notes: $notes\r\n ){\r\n _id\r\n authorization {\r\n onWhiteList\r\n brdRestriction_SafetyCard {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_HuetCard {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_SteelToes {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_Twic {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_NonPreferred {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_Hazmat {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_NoFlyListed {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_EbsCard {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_Illness {\r\n status\r\n type\r\n notes\r\n }\r\n brdRestriction_Quarantined {\r\n status\r\n type\r\n notes\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst restrictionMap = {\r\n 'brdRestriction_SafetyCard': 'Safety Card',\r\n 'brdRestriction_HuetCard': 'Huet Card',\r\n 'brdRestriction_SteelToes': 'Steel Toes',\r\n 'brdRestriction_Twic': 'TWIC',\r\n 'brdRestriction_NonPreferred': 'Non-Preferred',\r\n 'brdRestriction_Hazmat': 'Hazmat',\r\n 'brdRestriction_NoFlyListed': 'No-Fly Listed',\r\n 'brdRestriction_EbsCard': 'EBS Card',\r\n 'brdRestriction_Illness': 'Illness',\r\n 'brdRestriction_Quarantined': 'Quarantined'\r\n}\r\n\r\nclass BoardingRestrictionsOverride extends React.Component {\r\n state = {\r\n submitting: false\r\n }\r\n submit = () => {\r\n const { id, form, orgData: { transporter }, restriction } = this.props;\r\n form.validateFieldsAndScroll((err, values) => {\r\n if (!err) {\r\n this.setState({ submitting: true })\r\n this.props.override({\r\n variables: {\r\n _id: id,\r\n tpID: transporter._id,\r\n restrictionType: restriction,\r\n ...values\r\n }\r\n })\r\n .then(() => {\r\n message.success(\"Boarding restriction updated successfully\");\r\n if (this.props.onClose) this.props.onClose();\r\n })\r\n .catch(error => {\r\n message.error(\"Failed to update boarding restriction\")\r\n console.error(error)\r\n })\r\n .then(() => this.setState({ submitting: false }))\r\n }\r\n })\r\n }\r\n renderContent = () => {\r\n if (!this.props.userGroups.includes('flytsuite.restriction.override')) {\r\n return \r\n }\r\n const { getPassenger, loading, error } = this.props.data;\r\n if (loading) return \r\n if (error) return \r\n \r\n const { getFieldDecorator, getFieldValue } = this.props.form;\r\n const formItemLayout = {\r\n labelCol: {\r\n xs: { span: 24 },\r\n sm: { span: 8 },\r\n },\r\n wrapperCol: {\r\n xs: { span: 24 },\r\n sm: { span: 16 },\r\n },\r\n };\r\n const tailFormItemLayout = {\r\n wrapperCol: {\r\n xs: {\r\n span: 24,\r\n offset: 0,\r\n },\r\n sm: {\r\n span: 20,\r\n offset: 8,\r\n },\r\n },\r\n };\r\n\r\n const typeMap = [\r\n ['MANUALLY_VERIFIED', 'Manually Verified'],\r\n ['MANAGEMENT_OVERRIDE', 'Management Override'],\r\n ['CUSTOMER_NOT_ENFORCING', 'Customer Not Enforcing'],\r\n ['DO_NOT_OVERRIDE', 'Do Not Override'],\r\n ['USER_ERROR', 'User Error']\r\n ]\r\n\r\n var initialOverrideType = null;\r\n var initialOverrideNotes = null;\r\n if (getPassenger.authorization && getPassenger.authorization[this.props.restriction]){\r\n initialOverrideType = getPassenger.authorization[this.props.restriction].type\r\n initialOverrideNotes = getPassenger.authorization[this.props.restriction].notes\r\n }\r\n\r\n const overrideType = getFieldDecorator('overrideType', {\r\n initialValue: initialOverrideType,\r\n rules: [\r\n { required: true, message: 'This field is required!' }\r\n ]\r\n })(\r\n \r\n )\r\n\r\n const notes = getFieldDecorator('notes', {\r\n initialValue: initialOverrideNotes\r\n })(\r\n \r\n )\r\n\r\n return (\r\n
\r\n {overrideType}\r\n {notes}\r\n \r\n {getFieldValue('overrideType') === 'DO_NOT_OVERRIDE' ?\r\n \r\n :\r\n Are you sure you want to override?
This action cannot be undone.} \r\n icon={}\r\n okText=\"OVERRIDE\"\r\n onConfirm={() => this.submit()}>\r\n \r\n
}\r\n
\r\n
\r\n )\r\n }\r\n render(){\r\n if (!this.props.data) return null\r\n const { getPassenger, loading, error } = this.props.data;\r\n var title = null;\r\n if (getPassenger && !error){\r\n title = `Override ${restrictionMap[this.props.restriction]} for ${getPassenger.lastName}, ${getPassenger.firstName}`\r\n }\r\n else if (error){\r\n title = 'Error'\r\n }\r\n else if (!getPassenger && loading){\r\n title = 'Loading'\r\n }\r\n if (!this.props.restriction){\r\n this.props.form.resetFields()\r\n }\r\n return (\r\n \r\n {this.renderContent()}\r\n \r\n )\r\n }\r\n}\r\n\r\nexport default compose(\r\n withUserGroups,\r\n WithOrgData,\r\n Form.create(),\r\n graphql(\r\n PASSENGER,\r\n {\r\n options: props => ({\r\n variables: {\r\n _id: props.id\r\n },\r\n fetchPolicy: 'network-only'\r\n }),\r\n skip: props => !props.id\r\n }\r\n ),\r\n graphql(\r\n OVERRIDE,\r\n {\r\n name: 'override'\r\n }\r\n )\r\n)(BoardingRestrictionsOverride)","import { Alert, Button, Drawer, message, Modal, Table } from 'antd';\r\nimport { CredentialForm } from 'components/CredentialForm';\r\nimport { SaveCredential } from 'components/CredentialManager/Mutations';\r\nimport credentialTypes from 'credentialTypes';\r\nimport gql from 'graphql-tag';\r\nimport compose from 'lodash.flowright';\r\nimport moment from 'moment';\r\nimport React from 'react';\r\nimport { graphql, Mutation } from 'react-apollo';\r\nimport LoadingContent from '../LoadingContent';\r\nimport { withUserGroups } from '../userGroup';\r\nimport WithOrgData from '../WithOrgData';\r\nimport BoardingRestrictionsOverride from './BoardingRestrictionsOverride';\r\n\r\nconst PASSENGER = gql`\r\nquery Passenger($_id: ID!){\r\n getPassenger(_id: $_id){\r\n _id\r\n lastName\r\n firstName\r\n personID {\r\n _id\r\n }\r\n authorization {\r\n onWhiteList\r\n brdRestriction_SafetyCard {\r\n status\r\n type\r\n }\r\n brdRestriction_HuetCard {\r\n status\r\n type\r\n }\r\n brdRestriction_SteelToes {\r\n status\r\n type\r\n }\r\n brdRestriction_Twic {\r\n status\r\n type\r\n }\r\n brdRestriction_NonPreferred {\r\n status\r\n type\r\n }\r\n brdRestriction_Hazmat {\r\n status\r\n type\r\n }\r\n brdRestriction_NoFlyListed {\r\n status\r\n type\r\n }\r\n brdRestriction_EbsCard {\r\n status\r\n type\r\n }\r\n brdRestriction_Illness {\r\n status\r\n type\r\n }\r\n brdRestriction_Quarantined {\r\n status\r\n type\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst restrictionMap = {\r\n 'brdRestriction_SafetyCard': 'Safety Card',\r\n 'brdRestriction_HuetCard': 'Huet Card',\r\n 'brdRestriction_SteelToes': 'Steel Toes',\r\n 'brdRestriction_Twic': 'TWIC',\r\n 'brdRestriction_NonPreferred': 'Non-Preferred',\r\n 'brdRestriction_Hazmat': 'Hazmat',\r\n 'brdRestriction_NoFlyListed': 'No-Fly Listed',\r\n 'brdRestriction_EbsCard': 'EBS Card',\r\n 'brdRestriction_Illness': 'Illness',\r\n 'brdRestriction_Quarantined': 'Quarantined'\r\n}\r\n\r\nclass BoardingRestrictionDrawer extends React.Component {\r\n constructor(props){\r\n super(props);\r\n this.credFormRef = React.createRef();\r\n }\r\n state = {\r\n selectedRestriction: null,\r\n credForm: {\r\n show: false,\r\n type: null,\r\n formFields: {}\r\n }\r\n }\r\n renderOverride = () => {\r\n const { data: { getPassenger, loading, error }, orgData: { transporter } } = this.props;\r\n if (!transporter) return null\r\n if (loading || error) return null\r\n return (\r\n this.setState({ selectedRestriction: null })} />\r\n )\r\n }\r\n renderContent = () => {\r\n const { getPassenger, loading, error } = this.props.data;\r\n const { transporter } = this.props.orgData;\r\n if (loading) return \r\n if (error) return \r\n\r\n if (!getPassenger.authorization) return 'No Restriction information available';\r\n const restrictions = Object.entries(restrictionMap).map(r => ({\r\n name: r[1],\r\n rType: r[0],\r\n ...getPassenger.authorization[r[0]]\r\n }))\r\n const hasPermission = this.props.userGroups.includes('flytsuite.restriction.override')\r\n\r\n return (\r\n record.rType}\r\n pagination={false}\r\n size=\"middle\"\r\n columns={[\r\n {\r\n title: 'Restriction',\r\n key: 'Restriction',\r\n dataIndex: 'name'\r\n },\r\n {\r\n title: 'Status',\r\n key: 'status',\r\n dataIndex: 'status',\r\n render: (status, record) => {\r\n const statusMap = {\r\n 'NOT_APPLICABLE': Not Applicable,\r\n 'MET_REQUIREMENT': Met Requirement,\r\n 'NEEDS_OVERRIDE': (\r\n
\r\n Needs Override\r\n {hasPermission && transporter && }\r\n {record.rType === 'brdRestriction_SafetyCard' ? (\r\n this.setState({ credForm: { show: true, type: 'SAFETY_CARD' } })}\r\n >Add Safety Card\r\n ) : null}\r\n
\r\n ),\r\n 'OVERRIDDEN': (\r\n
\r\n Overridden\r\n {hasPermission && transporter && }\r\n
\r\n )\r\n }\r\n return statusMap[status] || '-'\r\n }\r\n },\r\n {\r\n title: 'Override Type',\r\n key: 'type',\r\n dataIndex: 'type',\r\n render: type => {\r\n const typeMap = {\r\n 'MANUALLY_VERIFIED': 'Manually Verified',\r\n 'MANAGEMENT_OVERRIDE': 'Management Override',\r\n 'CUSTOMER_NOT_ENFORCING': 'Customer Not Enforcing',\r\n 'DO_NOT_OVERRIDE': 'Do Not Override',\r\n 'USER_ERROR': 'User Error'\r\n }\r\n return typeMap[type] || '-'\r\n }\r\n }\r\n ]}\r\n />\r\n )\r\n }\r\n setCredFormVisibility = (val) => this.setState({ credForm: { ...this.state.credForm, show: val } })\r\n resetCredFormFields = () => {\r\n this.setState({ credForm: { ...this.state.credForm, formFields: {} } })\r\n }\r\n handleCancelCredential = () => {\r\n this.setState({\r\n credForm: {\r\n ...this.state.credForm,\r\n show: false\r\n }\r\n })\r\n }\r\n render(){\r\n if (!this.props.data) return null\r\n const { getPassenger, loading, error } = this.props.data;\r\n const { orgData, userGroups, ...restProps } = this.props;\r\n var title = null;\r\n if (getPassenger && !error){\r\n title = `Boarding Restrictions for ${getPassenger.lastName}, ${getPassenger.firstName}`\r\n }\r\n else if (error){\r\n title = 'Error'\r\n }\r\n else if (!getPassenger && loading){\r\n title = 'Loading'\r\n }\r\n return (\r\n \r\n {this.renderContent()}\r\n {this.renderOverride()}\r\n {\r\n message.success('Successfully added ' + credentialTypes[this.state.credForm.type]?.label + ' credential.')\r\n this.setCredFormVisibility(false);\r\n this.resetCredFormFields();\r\n this.props.data.refetch();\r\n }}\r\n onError={(err) => {\r\n console.error('Failed to save safety card: ' + err);\r\n message.error('Failed to add credential. An error occurred');\r\n }}\r\n >\r\n {(save, { loading }) => (\r\n this.resetCredFormFields()}\r\n footer={[\r\n {\r\n e.preventDefault();\r\n this.credFormRef.current.validateFieldsAndScroll((err, data) => {\r\n if (!err){\r\n this.setCredFormVisibility(false);\r\n const org = orgData.transporter || orgData.employer;\r\n save({\r\n variables: {\r\n key: data.key,\r\n expiration: moment(data.expiration).format('YYYY-MM-DD'),\r\n type: data.type,\r\n tpID: org?._id,\r\n customerID: orgData.customer?._id,\r\n personID: getPassenger.personID._id,\r\n paxID: getPassenger?._id\r\n }\r\n })\r\n this.resetCredFormFields();\r\n }\r\n })\r\n }}\r\n >Add {credentialTypes[this.state.credForm.type]?.label},\r\n \r\n ]}\r\n >\r\n this.setState({\r\n credForm: {\r\n ...this.state.credForm,\r\n formFields: {\r\n ...this.state.credForm.formFields,\r\n ...fields\r\n }\r\n }\r\n })}\r\n ref={this.credFormRef}\r\n />\r\n \r\n )}\r\n \r\n \r\n )\r\n }\r\n}\r\n\r\nexport default compose(\r\n withUserGroups,\r\n WithOrgData,\r\n graphql(\r\n PASSENGER,\r\n {\r\n options: props => ({\r\n variables: {\r\n _id: props.id\r\n },\r\n fetchPolicy: 'network-only',\r\n pollInterval: 5000\r\n }),\r\n skip: props => !props.id\r\n }\r\n )\r\n)(BoardingRestrictionDrawer)","import React from 'react';\r\nimport BoardingRestrictionsDrawer from './boarding-restrictions/BoardingRestrictionsDrawer';\r\n\r\nclass BoardingRestrictionDrawerWrapper extends React.Component {\r\n state = {\r\n visible: false,\r\n paxId: ''\r\n }\r\n open = (paxId, drawerComponent) => {\r\n if (drawerComponent){\r\n this.setDrawerComponent(drawerComponent)\r\n }\r\n this.setState({ paxId, visible: true })\r\n }\r\n close = () => {\r\n this.setState({ visible: false })\r\n }\r\n setDrawerComponent = (drawerComponent) => {\r\n this.setState({ drawerComponent })\r\n }\r\n render(){\r\n const { component: Component, ...rest } = this.props;\r\n return (\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n}\r\n\r\n// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default (Component) => {\r\n return props => (\r\n \r\n )\r\n}","import React from 'react';\r\nimport { Input, Row, Col, Button } from 'antd';\r\n\r\nconst FilterDropdown = ({ setSelectedKeys, selectedKeys, confirm, clearFilters, placeholder, ...restProps }) => (\r\n
\r\n
\r\n restProps.setSearchInputRef && restProps.setSearchInputRef(ele)}\r\n placeholder={placeholder}\r\n value={selectedKeys ? selectedKeys[0] : null}\r\n onChange={e => setSelectedKeys(e.target.value ? [e.target.value] : [])}\r\n onPressEnter={confirm}\r\n style={{ width: \"100%\" }}\r\n />\r\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 FilterDropdown","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\n{\r\n highlightFiltered @client\r\n}\r\n`","import React from 'react';\r\n\r\nconst highlightText = (content='', filterText='') => (\r\n \r\n {content.split(new RegExp(`(${filterText})`, 'gi')).map((fragment, i) => (\r\n fragment.toLowerCase() === filterText.toLowerCase()\r\n ? {fragment} : fragment\r\n ))}\r\n \r\n)\r\n\r\nexport default highlightText","import { Alert, Button, Switch, Table } from 'antd';\r\nimport Search from 'antd/lib/input/Search';\r\nimport { deepEqual } from 'assert';\r\nimport compose from 'lodash.flowright';\r\nimport sortedUniqBy from 'lodash/sortedUniqBy';\r\nimport PropTypes from 'prop-types';\r\nimport React, { Component } from 'react';\r\nimport { graphql, withApollo } from 'react-apollo';\r\nimport FilterDropdown from './FilterDropdown';\r\nimport GetHighlightStateQuery from './GetHighlightStateQuery';\r\nimport highlightText from './highlightText';\r\n\r\nclass FilterableTable extends Component {\r\n state = {\r\n filters: null,\r\n visibleData: []\r\n }\r\n componentDidUpdate(prevProps){\r\n if (this.props.filters){\r\n try{\r\n deepEqual(this.props.filters, prevProps.filters)\r\n }\r\n catch(error){\r\n if (error.name === 'AssertionError'){\r\n this.setState({ filters: this.props.filters })\r\n }\r\n }\r\n }\r\n }\r\n highlightEnabled = () => {\r\n const { highlightState } = this.props;\r\n if (highlightState){\r\n return Boolean(highlightState.highlightFiltered)\r\n }\r\n return false\r\n }\r\n setHighlight = (value) => {\r\n const { client } = this.props;\r\n client.writeData({\r\n data: {\r\n highlightFiltered: value\r\n }\r\n })\r\n }\r\n getFilters = () => this.state.filters || {}\r\n hasFilters = () => {\r\n const { filters } = this.state;\r\n if (!filters) return false\r\n return Object.values(this.state.filters).find(x => x ? x.length : null)\r\n }\r\n onFilterDropdownVisibleChange = (filterType) => (visible) => {\r\n if (visible) {\r\n setTimeout(() => {\r\n const input = this[filterType + 'SearchInput'];\r\n if (input) input.focus()\r\n });\r\n }\r\n }\r\n clearFilters = () => {\r\n this.onTableChange(\r\n this.state.pagination,\r\n null,\r\n this.state.sorter\r\n )\r\n }\r\n onTableChange = (pagination, filters, sorter, extra) => {\r\n if (this.props.onChange) this.props.onChange(pagination, filters, sorter, extra);\r\n this.setState({ pagination, filters, sorter, visibleData: extra ? extra.currentDataSource: []})\r\n }\r\n setSearchInputRef = (filterType) => (ref) => this[filterType + 'SearchInput'] = ref\r\n getColumns = () => {\r\n const filters = this.getFilters();\r\n const { columns, dataSource=[] } = this.props;\r\n if (!columns) return null;\r\n return columns.map(col => {\r\n \r\n const newCol = {\r\n ...col,\r\n render: (text, record, index) => {\r\n var name;\r\n if (col.render){\r\n name = col.render(text, record, index);\r\n }else{\r\n name = text;\r\n }\r\n if (col.useSearchFilter && typeof name === 'string' && this.highlightEnabled() && this.state.filters && this.state.filters[col.key]){\r\n return highlightText(name, this.state.filters[col.key][0])\r\n }\r\n return name;\r\n },\r\n filteredValue: filters[col.key] || null\r\n }\r\n if (col.onFilter){ //If a column can be filtered then a list of filters will be built from the dataSource\r\n \r\n if (col.useSearchFilter){\r\n newCol.onFilterDropdownVisibleChange = this.onFilterDropdownVisibleChange(col.key);\r\n newCol.filterDropdown = (props) => (\r\n \r\n )\r\n }else if (!col.filters){\r\n var getValueFunc = (record) => record[col.key];\r\n // Get a specific value from a table record.\r\n if (col.getValue) { \r\n getValueFunc = col.getValue;\r\n // Override default getValue function if the column has a getValue function.\r\n }else {\r\n if (col.dataIndex) getValueFunc = (record) => record[col.dataIndex];\r\n // Use dataIndex field if column does not have a getValue function defined.\r\n }\r\n const colData = dataSource\r\n .map((record) => {\r\n const val = getValueFunc(record);\r\n return val;\r\n })\r\n // Use the getValue to narrow down the dataSource to a basic type that the sortedUniq function can use.\r\n .filter(item => {\r\n return item\r\n })\r\n // Filter out null values.\r\n .sort((a, b) => ('' + a).toLowerCase().localeCompare(('' + b).toLowerCase()));\r\n // Sort results\r\n const filterChoices = sortedUniqBy(colData, (item) => {\r\n if (typeof item === 'string') return item.toLowerCase();\r\n return item\r\n });\r\n // Use lodash to remove duplicate filter choices from dataSource\r\n if (filterChoices.length){\r\n newCol.filters = filterChoices.map(text => ({\r\n text,\r\n value: text\r\n }));\r\n }\r\n }\r\n }\r\n return newCol\r\n })\r\n }\r\n render() {\r\n const { showFilterBar=true, ...restProps } = this.props;\r\n return (\r\n \r\n {this.hasFilters() && showFilterBar ? (\r\n \r\n Filters are applied. \r\n {this.props.applyChargeCode ? \r\n \r\n this.props.applyChargeCode(value, this.state.visibleData)}\r\n />\r\n \r\n :\r\n this.props.showHighlightMatches === undefined || this.props.showHighlightMatches === true ? (\r\n \r\n Highlight matches \r\n \r\n \r\n ) : null}\r\n \r\n \r\n }\r\n {...this.props.filterBarProps}\r\n />\r\n ) : null}\r\n \r\n \r\n )\r\n }\r\n}\r\n\r\nFilterableTable.propTypes = {\r\n columns: PropTypes.arrayOf(PropTypes.object),\r\n showFilterBar: PropTypes.bool\r\n}\r\n\r\nexport default compose(\r\n withApollo,\r\n graphql(\r\n GetHighlightStateQuery,\r\n {\r\n options: {\r\n errorPolicy: 'ignore'\r\n },\r\n name: 'highlightState'\r\n }\r\n )\r\n)(FilterableTable)","import React, { Component } from 'react';\r\nimport './Attribute.less';\r\n\r\nclass Atrribute extends Component {\r\n render() { \r\n const { label, value, altVal = 'None' } = this.props;\r\n return (\r\n
\r\n
\r\n {label}:\r\n
\r\n {value || altVal}\r\n
\r\n )\r\n }\r\n}\r\n \r\nexport default Atrribute;","import React, { Component } from 'react';\r\nimport { List, Avatar, Row, Col } from 'antd';\r\nimport Attribute from '../Attribute';\r\nimport moment from 'moment';\r\nimport IsnCheckStatusButton from '../../IsnCheckStatusButton';\r\nimport BoardingRestrictionButton from '../../boarding-restrictions/BoardingRestrictionButton';\r\n\r\nclass PassengerItem extends Component {\r\n render() { \r\n const { data } = this.props;\r\n const name = `${data.lastName}, ${data.firstName}`;\r\n const { checkedInTime } = data;\r\n var citDisplay;\r\n if (checkedInTime){\r\n const citMoment = moment(checkedInTime)\r\n citDisplay= citMoment.isSameOrBefore(moment('1970-01-01')) ? null : `Checked in ${citMoment.format('YYYY-MM-DD HH:mm:ss')}`\r\n }\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n

{name}

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {(data.employerID && data.employerID.name) || 'Unknown Employer'}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {citDisplay}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\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 PassengerItem;","import React, { Component } from 'react';\r\nimport { List } from 'antd';\r\nimport PassengerItem from './PassengerItem';\r\n\r\nclass PassengerList extends Component {\r\n render() {\r\n return (\r\n \r\n )} />;\r\n }\r\n}\r\n \r\nexport default PassengerList;","import React, { Component } from 'react';\r\nimport { List, Row, Col } from 'antd';\r\nimport Attribute from '../Attribute';\r\nimport moment from 'moment';\r\n\r\nclass CargoItem extends Component {\r\n render() { \r\n const { data } = this.props;\r\n const { checkedInTime } = data;\r\n var citDisplay;\r\n if (checkedInTime){\r\n const citMoment = moment(checkedInTime)\r\n citDisplay= citMoment.isSameOrBefore(moment('1970-01-01')) ? null : `Checked in ${citMoment.format('YYYY-MM-DD HH:mm:ss')}`\r\n }\r\n var hazmat;\r\n const renderHazmat = (text) => {text}\r\n if (data.hazmat){\r\n if (data.hazmatUnCode){\r\n hazmat = renderHazmat(data.hazmatUnCode)\r\n }else{\r\n hazmat = renderHazmat('Yes (No Code)')\r\n }\r\n }else{\r\n hazmat = 'No'\r\n }\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n

{data.name}

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {(data.customerID && data.customerID.name) || 'Unknown Customer'}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {citDisplay}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {data.deliveredBy && `Delivered By ${data.deliveredBy}`}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n \r\nexport default CargoItem;","import React, { Component } from 'react';\r\nimport { List } from 'antd';\r\nimport CargoItem from './CargoItem';\r\n\r\nclass CargoList extends Component {\r\n render() {\r\n return (\r\n \r\n )} />;\r\n }\r\n}\r\n \r\nexport default CargoList;","import React, { Component } from 'react';\r\nimport PassengerList from '../passenger/PassengerList';\r\nimport { Tabs } from 'antd';\r\nimport CargoList from '../cargo/CargoList';\r\n\r\nclass LegItem extends Component {\r\n render() { \r\n const { data } = this.props;\r\n const pax = data.paxIDs || [];\r\n const cgo = data.cgoIDs || [];\r\n return (\r\n
\r\n \r\n \r\n {pax.length ? (\r\n \r\n ) : 'No Passengers'}\r\n \r\n \r\n {cgo.length ? (\r\n \r\n ) : 'No Cargo'}\r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n \r\nexport default LegItem","import React, { Component } from 'react';\r\nimport { Collapse, Icon, Divider, Row, Col, Tooltip } from 'antd';\r\nimport LegItem from './LegItem';\r\n\r\nconst { Panel } = Collapse;\r\n\r\nconst PanelHeader = (props) => (\r\n \r\n
\r\n Leg {props.order || 1}\r\n \r\n {props.departure}\r\n \r\n {props.destination}\r\n \r\n \r\n \r\n {props.paxCount || 0}/{props.paxWeight || 0}\r\n \r\n \r\n \r\n {props.bagCount || 0}/{props.bagWeight || 0}\r\n \r\n \r\n \r\n {props.cgoCount || 0}/{props.cgoWeight || 0}\r\n \r\n \r\n \r\n Total Wt: {(props.paxWeight || 0) + (props.bagWeight || 0) + (props.cgoWeight || 0)}\r\n \r\n \r\n \r\n)\r\n\r\nclass CollapsibleLegs extends Component {\r\n render() { \r\n let { data } = this.props;\r\n if (!data) data = []\r\n return (\r\n \r\n {data.map((leg, idx) => (\r\n \r\n }>\r\n \r\n \r\n ))}\r\n \r\n );\r\n }\r\n}\r\n \r\nexport default CollapsibleLegs;","import { Alert, Button, Card, Col, Divider, Row, Spin, Tabs, Typography } from 'antd';\r\nimport FlightState from 'components/flight/FlightState';\r\nimport gql from 'graphql-tag';\r\nimport moment from 'moment';\r\nimport React from 'react';\r\nimport { Query } from 'react-apollo';\r\n// import PassengerTable from '../tables/PassengerTable';\r\nimport commonColumns from '../../common/table/columns';\r\nimport { getFlightDeparture } from '../../common/util';\r\nimport CollapsibleLegs from '../lists/legs/CollapsibleLegs';\r\nimport { FilterableTable } from '../tables/FilterableTable';\r\nimport './FlightPreview.less';\r\n\r\nconst FLIGHT = gql`\r\nquery Flight($id: ID!){\r\n getFlight(_id: $id) {\r\n _id\r\n desig\r\n legs\r\n timeOfDeparture\r\n state\r\n legsArray {\r\n departure\r\n destination\r\n seats\r\n paxWeight\r\n bagWeight\r\n bagCount\r\n cgoWeight\r\n paxIDs {\r\n _id,\r\n firstName,\r\n lastName,\r\n paxWeight,\r\n bagWeight,\r\n bagCount,\r\n customerID {\r\n _id\r\n name\r\n },\r\n employerID {\r\n _id\r\n name\r\n }\r\n tpID {\r\n _id\r\n name\r\n }\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n checkedInTime\r\n transitType\r\n lastIsnResultWithHeader {\r\n error_message\r\n selectedResult {\r\n quickCheckStatus\r\n isnStatus {\r\n shortLabel\r\n }\r\n reason\r\n }\r\n }\r\n isnCheckError {\r\n message\r\n }\r\n authorization {\r\n onWhiteList\r\n noFlyListed\r\n brdRestriction_Isn {\r\n status\r\n }\r\n brdRestriction_SafetyCard {\r\n status\r\n }\r\n brdRestriction_HuetCard {\r\n status\r\n }\r\n brdRestriction_SteelToes {\r\n status\r\n }\r\n brdRestriction_Twic {\r\n status\r\n }\r\n brdRestriction_NonPreferred {\r\n status\r\n }\r\n brdRestriction_Hazmat {\r\n status\r\n }\r\n brdRestriction_NoFlyListed {\r\n status\r\n }\r\n brdRestriction_EbsCard {\r\n status\r\n }\r\n brdRestriction_Illness {\r\n status\r\n }\r\n brdRestriction_Quarantined {\r\n status\r\n }\r\n }\r\n }\r\n cgoIDs {\r\n _id\r\n name\r\n approvedBy\r\n customerID {\r\n _id\r\n name\r\n }\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n deliveredBy\r\n attentionTo\r\n weight\r\n hazmat\r\n hazmatUnCode\r\n checkedInTime\r\n transitType\r\n currentCarrierID {\r\n _id\r\n desig\r\n }\r\n }\r\n },\r\n pilot {\r\n _id\r\n name {\r\n firstName,\r\n lastName\r\n },\r\n },\r\n copilot {\r\n _id\r\n name {\r\n firstName,\r\n lastName\r\n },\r\n },\r\n contract {\r\n _id\r\n name\r\n },\r\n sequence,\r\n paxIDList {\r\n _id,\r\n firstName,\r\n lastName,\r\n paxWeight,\r\n bagWeight,\r\n customerID {\r\n _id\r\n name\r\n },\r\n employerID {\r\n _id\r\n name\r\n }\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n checkedInTime\r\n transitType\r\n authorization {\r\n onWhiteList\r\n noFlyListed\r\n brdRestriction_Isn {\r\n status\r\n }\r\n brdRestriction_SafetyCard {\r\n status\r\n }\r\n brdRestriction_HuetCard {\r\n status\r\n }\r\n brdRestriction_SteelToes {\r\n status\r\n }\r\n brdRestriction_Twic {\r\n status\r\n }\r\n brdRestriction_NonPreferred {\r\n status\r\n }\r\n brdRestriction_Hazmat {\r\n status\r\n }\r\n brdRestriction_NoFlyListed {\r\n status\r\n }\r\n brdRestriction_EbsCard {\r\n status\r\n }\r\n brdRestriction_Illness {\r\n status\r\n }\r\n brdRestriction_Quarantined {\r\n status\r\n }\r\n }\r\n },\r\n cgoIDList {\r\n _id\r\n name\r\n approvedBy\r\n customerID {\r\n _id\r\n name\r\n }\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n deliveredBy\r\n attentionTo\r\n weight\r\n hazmat\r\n hazmatUnCode\r\n checkedInTime\r\n transitType\r\n currentCarrierID {\r\n _id\r\n desig\r\n }\r\n },\r\n aircraftID {\r\n _id,\r\n model,\r\n tailNum,\r\n maxSeats,\r\n maxLoad\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst Property = ({ field, value, altVal = 'None' }) => {\r\n return (\r\n
\r\n
\r\n {field}:\r\n
\r\n {value || altVal}\r\n
\r\n )\r\n}\r\n\r\n// const renderPanel = ({ title, content, key, hideIfEmpty=false }) => {\r\n// if (!content && hideIfEmpty) return null\r\n// return (\r\n// \r\n// {content ? content : 'Nothing to display'}\r\n// \r\n// )\r\n// }\r\n\r\nconst Section = ({ title, children }) => (\r\n
\r\n

{title}

\r\n
{children}
\r\n
\r\n)\r\n\r\n// class FlightPreview extends Component {\r\n// render() {\r\n// if (!this.props.data) return null\r\n// const { getFlight } = this.props.data;\r\n// const pilot = getFlight.pilot;\r\n// const copilot = getFlight.copilot;\r\n// const departure = getFlightDeparture(getFlight);\r\n// const legs = getFlight.legsArray || [];\r\n// const destinations = legs.map(leg => leg.destination);\r\n \r\n// return (\r\n//
\r\n//

{getFlight.desig}

\r\n// \r\n// \r\n//
\r\n//
\r\n// \r\n// \r\n//
\r\n// \r\n// \r\n//
\r\n// \r\n// \r\n//
\r\n// \r\n// \r\n//
\r\n// \r\n//
\r\n// \r\n// {getFlight.aircraftID ? (\r\n// \r\n//
\r\n// \r\n// \r\n// \r\n// \r\n//
\r\n// \r\n// ) : null}\r\n \r\n// \r\n// \r\n// \r\n// \r\n// \r\n// \r\n// \r\n// {\r\n// getFlight.paxIDList && getFlight.paxIDList.length ? (\r\n// record._id}\r\n// size=\"small\"\r\n// pagination={false}\r\n// scroll={{ x: 1500 }}\r\n// columns={commonColumns.pax.except(['assignedFlight'])}\r\n// />\r\n// ) : 'No Passengers'\r\n// }\r\n// \r\n// \r\n// {\r\n// getFlight.cgoIDList && getFlight.cgoIDList.length ? (\r\n// record._id}\r\n// size=\"small\"\r\n// pagination={false}\r\n// scroll={{ x: 1500 }}\r\n// columns={commonColumns.cgo.except(['assignedFlight'])}\r\n// />\r\n// ) : 'No Cargo'\r\n// }\r\n// \r\n// \r\n// \r\n// )\r\n// }\r\n// }\r\n\r\nconst FlightPreview = ({ id }) => {\r\n\r\n return (\r\n \r\n {\r\n ({ data, loading, error, refetch }) => {\r\n const getFlight = data && data.getFlight;\r\n if (loading && !getFlight) return (\r\n
\r\n \r\n
\r\n )\r\n const pilot = getFlight && getFlight.pilot;\r\n const copilot = getFlight && getFlight.copilot;\r\n const departure = getFlight && getFlightDeparture(getFlight);\r\n const legs = (getFlight && getFlight.legsArray) || [];\r\n const destinations = getFlight && legs.map(leg => leg.destination);\r\n return (\r\n
\r\n {error ? : null}\r\n {getFlight ? (\r\n
\r\n \r\n
\r\n

{getFlight.desig}

\r\n \r\n {getFlight.state !== 'ACTIVE' ? (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ) : null}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n \r\n \r\n
\r\n \r\n \r\n
\r\n \r\n \r\n
\r\n \r\n \r\n
\r\n \r\n {getFlight.aircraftID ? (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n ) : null}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n getFlight.paxIDList && getFlight.paxIDList.length ? (\r\n record._id}\r\n size=\"small\"\r\n pagination={false}\r\n scroll={{ x: 1500 }}\r\n columns={[\r\n ...commonColumns.pax.some(['name', 'transporter', 'employer']),\r\n {\r\n ...commonColumns.pax.columns.weight,\r\n width: 100\r\n },\r\n {\r\n ...commonColumns.pax.columns.bagCount,\r\n width: 100\r\n },\r\n {\r\n ...commonColumns.pax.columns.bagWeight,\r\n width: 100\r\n },\r\n ...commonColumns.pax.some(['checkedIn', 'transitType', 'departure', 'destination', 'tsa', 'restrictions', 'isn'])\r\n ]}\r\n />\r\n ) : 'No Passengers'\r\n }\r\n \r\n \r\n {\r\n getFlight.cgoIDList && getFlight.cgoIDList.length ? (\r\n record._id}\r\n size=\"small\"\r\n pagination={false}\r\n scroll={{ x: 1500 }}\r\n columns={commonColumns.cgo.except(['assignedFlight'])}\r\n />\r\n ) : 'No Cargo'\r\n }\r\n \r\n \r\n \r\n ) : null}\r\n \r\n )\r\n }\r\n }\r\n \r\n )\r\n}\r\n\r\nexport default FlightPreview\r\n \r\n// export default compose(\r\n// graphql(\r\n// FLIGHT,\r\n// {\r\n// options: ({ id }) => ({\r\n// variables: {\r\n// id\r\n// },\r\n// fetchPolicy: 'cache-and-network',\r\n// pollInterval: 5000\r\n// }),\r\n// skip: props => !props.id\r\n// }\r\n// ),\r\n// withLoading({ style: { margin: '10rem 0' } }),\r\n// withError()\r\n// )(FlightPreview)","import { Drawer } from 'antd';\r\nimport { DrawerProps } from 'antd/lib/drawer';\r\nimport React, { Component } from 'react';\r\nimport FlightPreview from './flight/FlightPreview';\r\n\r\nexport interface HasFlightDrawer {\r\n flightDrawer: {\r\n open: (flightId: string) => void,\r\n close: () => void\r\n }\r\n}\r\n\r\nexport interface WithFlightDrawerOptions {\r\n drawerProps?: DrawerProps\r\n}\r\n\r\nexport interface WithFlightDrawerProps {\r\n options?: WithFlightDrawerOptions,\r\n component?: any\r\n}\r\n\r\nclass FlightDrawerWrapper extends Component {\r\n state = {\r\n visible: false,\r\n flight: null\r\n }\r\n open = (flight) => this.setState({ flight, visible: true })\r\n close = () => this.setState({ visible: false })\r\n render(){\r\n const { component: Component, options } = this.props;\r\n const drawerProps = options ? options.drawerProps : {};\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n }\r\n}\r\n\r\nconst withFlightDrawer = (options?: WithFlightDrawerOptions) => (Component) => (props) => (\r\n \r\n)\r\n\r\nexport default withFlightDrawer","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Row, Col, Card } from 'antd';\r\nimport './override-card.less';\r\nimport moment from 'moment-timezone';\r\nimport { getLocalizedMoment } from 'common/util-ts';\r\nimport IsnOverrideFileUploader from 'components/isn-override-file-uploader';\r\n\r\nconst statusMap = {\r\n 'MANUALLY_VERIFIED': 'Manually Verified',\r\n 'MANAGEMENT_OVERRIDE': 'Management Override',\r\n 'CUSTOMER_NOT_ENFORCING': 'Customer Not Enforcing',\r\n 'DO_NOT_OVERRIDE': 'Do Not Override'\r\n}\r\n\r\nconst RedWhiteOverride = ({ value }) => {\r\n let color = 'gray';\r\n let textColor = 'white';\r\n let label = '';\r\n switch (value) {\r\n case 'RED':\r\n color = 'red';\r\n label = ' (training)';\r\n break;\r\n case 'WHITE':\r\n color = 'white';\r\n textColor = 'black';\r\n label = ' (white listed)';\r\n default:\r\n break;\r\n }\r\n return {value}{label}\r\n}\r\n\r\nclass OverrideCard extends Component {\r\n render() {\r\n const { data, paxData, ...restProps } = this.props;\r\n\r\n const hasNewFieldsAndOverriderName = ((data.overriderFirstName || data.overriderLastName) &&\r\n (data.overriderTitle || data.overriderReason ||\r\n data.approverFirstName || data.approverLastName ||\r\n data.redWhiteOverride))\r\n \r\n const hasOverriderNameOnly = ((data.overriderFirstName || data.overriderLastName) &&\r\n !(data.overriderTitle || data.overriderReason ||\r\n data.approverFirstName || data.approverLastName ||\r\n data.redWhiteOverride))\r\n\r\n return (\r\n \r\n \r\n \r\n Override Type:\r\n \r\n \r\n {statusMap[data.type] || data.type}\r\n \r\n \r\n {hasNewFieldsAndOverriderName ? (\r\n <>\r\n \r\n \r\n Overrider Title:\r\n \r\n \r\n {data.overriderTitle}\r\n \r\n \r\n \r\n \r\n Overrider Reason:\r\n \r\n \r\n {data.overriderReason}\r\n \r\n \r\n \r\n \r\n Training or Whitelist Override:\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Overrider Name:\r\n \r\n \r\n {data.overriderFirstName} {data.overriderLastName}\r\n \r\n \r\n \r\n \r\n Approver Name:\r\n \r\n \r\n {data.approverFirstName} {data.approverLastName}\r\n \r\n \r\n \r\n ) : null}\r\n {hasOverriderNameOnly ? (\r\n \r\n \r\n Overrider Name:\r\n \r\n \r\n {data.overriderFirstName} {data.overriderLastName}\r\n \r\n \r\n ) : null}\r\n \r\n \r\n Notes:\r\n \r\n \r\n {data.notes}\r\n \r\n \r\n \r\n \r\n Override Time:\r\n \r\n \r\n {data.createdTs ? getLocalizedMoment(data.createdTs, paxData).format('MMMM Do, YYYY H:mm z') : null}\r\n \r\n \r\n \r\n \r\n Attached Files:\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nOverrideCard.propTypes = {\r\n data: PropTypes.shape({\r\n type: PropTypes.string,\r\n notes: PropTypes.string\r\n }).isRequired\r\n}\r\n \r\nexport default OverrideCard;","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Row, Col, Button, Popconfirm, Card, Icon } from 'antd';\r\nimport moment from 'moment';\r\n\r\nconst qcStatusColor = (status) => {\r\n if (typeof status === 'string'){\r\n switch (status.toUpperCase()) {\r\n case 'RED':\r\n case 'RED – SUSPENDED':\r\n case 'RED SUSPENDED':\r\n return '#f5222d'\r\n case 'GREEN':\r\n case 'GREEN – WAIVED':\r\n case 'GREEN WAIVED':\r\n return '#52c41a'\r\n case 'MULTI':\r\n return '#faad14'\r\n case 'OVERRIDDEN':\r\n return '#1890ff'\r\n default:\r\n return null\r\n }\r\n }\r\n return 'inherit'\r\n}\r\n\r\nconst companyGradeColor = (grade) => {\r\n switch (grade) {\r\n case 'F':\r\n return '#f5222d'\r\n default:\r\n return null;\r\n }\r\n}\r\n\r\nclass QCCard extends Component {\r\n setActive = () => {\r\n this.props.onActivated(this.props.data)\r\n }\r\n render() {\r\n const { data, active, allowSetActive } = this.props;\r\n const selectedColor = '#1890ff';\r\n var style = {\r\n marginBottom: '1rem'\r\n }\r\n if (active){\r\n style = {\r\n ...style,\r\n borderColor: selectedColor\r\n }\r\n }\r\n \r\n return (\r\n \r\n \r\n \r\n

Quick Check Status:

\r\n {data.quickCheckStatus}\r\n \r\n {(!data.allowed) ?

Reason:

{data.reasonsForNonCompliance || data.reason || 'Not specified'}: null}\r\n {(data.errorMessage) ?

Error Message:

{data.errorMessage}: null}\r\n

Name:

{`${data.lastName}, ${data.firstName}`}\r\n

Training Status:

{data.trainingStatus || 'N/A'}\r\n {data.scCompanyGrade ? (\r\n

Company Grade:

\r\n {data.scCompanyGrade}{` `}\r\n {data.scCompanyGradeSince ? \r\n as of {moment(data.scCompanyGradeSince).format('MMM Do YYYY')}\r\n : null}\r\n \r\n ) : null}\r\n

ISN ID:

{data.isnId}\r\n

Company:

{data.companyName}{data.companyID && ` (${data.companyID})`}\r\n

Next Expiration:

\r\n {(data.mostRecentTrainingQualificationExpirationName) ? \r\n `${data.mostRecentTrainingQualificationExpirationName} expires ${data.mostRecentTrainingExpirationDate}` : 'Not defined'\r\n }\r\n \r\n {data.trainingQualificationProject ? (\r\n \r\n

Training Qualification Project:

{data.trainingQualificationProject.name}\r\n \r\n ) : null}\r\n {data.operatorQualificationProject ? (\r\n \r\n

Operator Qualification Project:

{data.operatorQualificationProject.name}\r\n \r\n ) : null}\r\n {data.onlineTrainingQualificationProject ? (\r\n \r\n

Online Training Qualification Project:

{data.onlineTrainingQualificationProject.name}\r\n \r\n ) : null}\r\n \r\n \r\n \r\n {(!active) ? (\r\n allowSetActive ? (\r\n \r\n \r\n \r\n ) : null\r\n )\r\n :
Active
}\r\n
\r\n \r\n \r\n {data.dataAsOf &&\r\n \r\n }\r\n \r\n )\r\n }\r\n}\r\n\r\nQCCard.propTypes = {\r\n data: PropTypes.object.isRequired,\r\n onActivated: PropTypes.func.isRequired,\r\n active: PropTypes.bool\r\n}\r\n\r\nexport default QCCard","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Alert, Card } from 'antd';\r\nimport { QCCard } from '../QCCard';\r\n\r\nclass QCResult extends Component {\r\n render() {\r\n const { data, allowSelection=true } = this.props;\r\n var selectedIndex = -1;\r\n var error;\r\n \r\n if (data){\r\n try{\r\n data.qc_result.forEach((result, i) => {\r\n if (data.selectedResult && result){\r\n if (data.selectedResult.isnId === result.isnId && \r\n data.selectedResult.quickCheckStatus === result.quickCheckStatus &&\r\n data.selectedResult.companyID === result.companyID){\r\n selectedIndex = i;\r\n }\r\n }\r\n });\r\n\r\n if (selectedIndex === -1) {\r\n var qcs;\r\n if (data.selectedResult){\r\n qcs = data.selectedResult.quickCheckStatus;\r\n }\r\n if (typeof qcs === 'string') {\r\n qcs = qcs.toLowerCase();\r\n }\r\n if (data.qc_result.length <= 0)\r\n if (qcs !== 'multi'){\r\n switch (data.qc_result.length) {\r\n case 0:\r\n selectedIndex = -2;\r\n break;\r\n case 1:\r\n selectedIndex = 0;\r\n break;\r\n default:\r\n selectedIndex = -1;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n catch(err)\r\n {\r\n selectedIndex = -2;\r\n try{\r\n error = err.stack;\r\n }catch(err2){\r\n error = err.message;\r\n }\r\n }\r\n\r\n const renderAlert = () => {\r\n var style = {\r\n marginBottom: '1rem'\r\n }\r\n if (selectedIndex === -2 && data.qc_result.length){\r\n return \r\n }else if (selectedIndex === -1 && allowSelection){\r\n return \r\n }\r\n }\r\n \r\n return \r\n {renderAlert()}\r\n \r\n
\r\n Customer: {data.isn_customer}\r\n
\r\n
\r\n Success: {data.success ? 'Yes' : 'No'}\r\n
\r\n {data.error_message ?
\r\n Error Message: {data.error_message}\r\n
: null}\r\n {data.isn_ownerid ?
\r\n Owner ID: {data.isn_ownerid}\r\n
: null}\r\n
\r\n Result Count: {data.qc_count}\r\n
\r\n
\r\n {(data.qc_result.length) === 0 ? (\r\n \r\n No Results\r\n \r\n ) : null}\r\n {(selectedIndex !== -2) ? data.qc_result.map((result, i) => {\r\n const active = i === selectedIndex;\r\n return (\r\n \r\n )\r\n }) : null}\r\n
\r\n }\r\n return 'No ISN data available'\r\n }\r\n}\r\n\r\nQCResult.propTypes = {\r\n data: PropTypes.object,\r\n onResultActivated: PropTypes.func,\r\n runISNCheck: PropTypes.func,\r\n isnCheckRunning: PropTypes.bool,\r\n allowSelection: PropTypes.bool\r\n}\r\n\r\nexport default QCResult","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery ISNResultQuery($_id: ID!){\r\n getPassenger(_id: $_id){\r\n _id\r\n _rev\r\n lastName\r\n firstName\r\n authorization{\r\n onWhiteList\r\n brdRestriction_Isn {\r\n type\r\n notes\r\n status\r\n reason\r\n createdBy\r\n createdTs\r\n }\r\n }\r\n lastIsnResultWithHeader {\r\n success\r\n qc_count\r\n isn_customer\r\n isn_ownerid\r\n error_message\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n trainingStatus\r\n allowed\r\n companyID\r\n quickCheckStatus\r\n errorMessage\r\n isnId\r\n firstName\r\n lastName\r\n companyName\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n dataAsOf\r\n reason\r\n reasonsForNonCompliance\r\n scCompanyGrade\r\n scCompanyGradeSince\r\n trainingQualificationProject {\r\n id\r\n name\r\n }\r\n operatorQualificationProject {\r\n id\r\n name\r\n }\r\n onlineTrainingQualificationProject {\r\n id\r\n name\r\n }\r\n },\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n allowed\r\n companyID\r\n quickCheckStatus\r\n trainingStatus\r\n errorMessage\r\n isnId\r\n firstName\r\n lastName\r\n companyName\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n dataAsOf\r\n reason\r\n reasonsForNonCompliance\r\n scCompanyGrade\r\n scCompanyGradeSince\r\n trainingQualificationProject {\r\n id\r\n name\r\n }\r\n operatorQualificationProject {\r\n id\r\n name\r\n }\r\n onlineTrainingQualificationProject {\r\n id\r\n name\r\n }\r\n }\r\n }\r\n }\r\n}\r\n`","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nmutation SetPaxSelectedISNResult($_id: ID!, $_rev: ID!, $payload: AWSJSON!){\r\n setIsnSelection(_id: $_id, _rev: $_rev, payload: $payload){\r\n _id\r\n _rev\r\n lastIsnResultWithHeader {\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n allowed\r\n companyID\r\n quickCheckStatus\r\n trainingStatus\r\n errorMessage\r\n isnId\r\n firstName\r\n lastName\r\n companyName\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n dataAsOf\r\n reason\r\n }\r\n }\r\n }\r\n}\r\n`","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nmutation IsnCheck($_id: ID! $tpID: ID!){\r\n setPassengerIsnCheck(_id: $_id tpID: $tpID){\r\n _id\r\n lastName\r\n firstName\r\n lastIsnResultWithHeader {\r\n isn_customer\r\n isn_ownerid\r\n success\r\n error_message\r\n quick_check_status\r\n reason\r\n qc_count\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n }\r\n authorization {\r\n onWhiteList\r\n brdRestriction_Isn {\r\n type\r\n status\r\n }\r\n }\r\n }\r\n}\r\n`","import React, { Component } from 'react';\r\nimport { Query, Mutation } from 'react-apollo';\r\nimport PropTypes from 'prop-types';\r\nimport ISNResultQuery from '../../../Queries/ISNResultQuery';\r\nimport QCResult from './QCResult';\r\nimport SetPaxSelectedISNResult from '../../../Mutations/SetPaxSelectedISNResult';\r\nimport { message, Alert, Spin, Button, Divider } from 'antd';\r\nimport LoadingContent from '../../LoadingContent';\r\nimport ISNCheck from '../../../Mutations/ISNCheck';\r\nimport WithOrgData from '../../WithOrgData';\r\nimport { withUserGroups } from '../../userGroup';\r\n\r\nclass QCResultWithData extends Component {\r\n render() {\r\n const { paxId, fetchPolicy, showISNCheck=true, orgData, userGroups, ...restProps } = this.props;\r\n return (\r\n \r\n {({ data, loading, error }) => {\r\n const passenger = data && data.getPassenger;\r\n if (!passenger && loading ) return \r\n const isnData = passenger && passenger.lastIsnResultWithHeader;\r\n const renderQCResult = () => (\r\n \r\n {error ? (\r\n \r\n ) : null}\r\n \r\n {\r\n (setActive) => (\r\n {\r\n const payload = {\r\n allowed: data.allowed,\r\n assignedActivities: data.assignedActivities,\r\n companyID: data.companyID,\r\n companyName: data.companyName,\r\n dataAsOf: data.dataAsOf,\r\n errorMessage: data.errorMessage,\r\n firstName: data.firstName,\r\n isnId: data.isnId,\r\n lastName: data.lastName,\r\n mostRecentTrainingExpirationDate: data.mostRecentTrainingExpirationDate,\r\n mostRecentTrainingQualificationExpirationName: data.mostRecentTrainingQualificationExpirationName,\r\n quickCheckStatus: data.quickCheckStatus,\r\n reason: data.reason,\r\n trainingStatus: data.trainingStatus\r\n }\r\n setActive({\r\n variables: {\r\n _id: passenger._id,\r\n _rev: passenger._rev,\r\n payload: JSON.stringify(payload)\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setIsnSelection: {\r\n __typename: 'PaxNode',\r\n ...passenger,\r\n _id: passenger._id,\r\n lastIsnResultWithHeader: {\r\n __typename: 'IsnResultWithHeader',\r\n ...isnData,\r\n selectedResult: {\r\n __typename: 'IsnQcResult',\r\n ...payload\r\n }\r\n }\r\n }\r\n }\r\n })\r\n .then(() => message.success('Successfully updated selected ISN result'))\r\n .catch(() => message.error('Failed to update selected ISN result'))\r\n }}\r\n {...restProps}\r\n />\r\n )\r\n }\r\n \r\n \r\n )\r\n if (showISNCheck){\r\n return (\r\n \r\n {(runISNCheck, { loading, error }) => (\r\n
\r\n
\r\n {runISNCheck ? (\r\n
\r\n {\r\n var org;\r\n switch (orgData.organization.classType) {\r\n case 'flytsuite.employer':\r\n org = orgData.employer;\r\n break;\r\n case 'flytsuite.transporter':\r\n case 'flytsuite.customer':\r\n org = orgData.transporter\r\n break;\r\n default:\r\n org = orgData.organization;\r\n break;\r\n }\r\n runISNCheck({\r\n variables: {\r\n _id: paxId,\r\n tpID: org && org._id\r\n }\r\n })}}\r\n >Run ISN Check\r\n
\r\n ) : null}\r\n {!loading && error ? (\r\n \r\n ) : null}\r\n \r\n
\r\n {renderQCResult()}\r\n
\r\n \r\n )}\r\n \r\n )\r\n }\r\n return renderQCResult();\r\n }}\r\n \r\n );\r\n }\r\n}\r\n\r\nQCResultWithData.propTypes = {\r\n paxId: PropTypes.string.isRequired,\r\n fetchPolicy: PropTypes.string,\r\n showISNCheck: PropTypes.bool\r\n}\r\n \r\nexport default WithOrgData( withUserGroups( QCResultWithData) );","import React from 'react';\r\nimport { Auth } from '@aws-amplify/auth';\r\n\r\nclass UserInfoWrapper extends React.Component {\r\n state = {\r\n loading: false\r\n }\r\n componentDidMount(){\r\n this.getUser()\r\n }\r\n getUser = () => {\r\n this.setState({ loading: true })\r\n Auth.currentUserInfo()\r\n .then(user => this.setState({ user }))\r\n .catch(error => this.setState({ error }))\r\n .then(() => this.setState({ loading: false }))\r\n }\r\n render(){\r\n const { component: Component } = this.props;\r\n return (\r\n \r\n )\r\n }\r\n}\r\n\r\nconst withUserInfo = (component) => {\r\n return props => (\r\n \r\n )\r\n}\r\n\r\nexport default withUserInfo","import React from 'react';\r\nimport { Button, Alert, Select, Input, Form, Popconfirm, Icon } from 'antd';\r\nimport { Mutation } from 'react-apollo';\r\nimport gql from 'graphql-tag';\r\nimport WithOrgData from './WithOrgData';\r\nimport { UserGroup } from './userGroup';\r\nimport NotAuthorized from './NotAuthorized';\r\nimport withUserInfo from 'components/withUserInfo';\r\nimport { validateFirstLastName } from 'formValidators';\r\nimport IsnOverrideFileUploader from 'components/isn-override-file-uploader';\r\n\r\nconst OVERRIDE_MUTATION = gql`\r\nmutation OverrideMutation($_id: ID!, $_rev: ID!, $notes: String, $reason: String, $type: BrdRestrictionType, $orgID: ID!,\r\n $overriderTitle: String, $overriderReason: String, $overriderFirstName: String, $overriderLastName: String,\r\n $redWhiteOverride: String, $approverFirstName: String, $approverLastName: String){\r\n paxOverride(_id: $_id,_rev: $_rev, notes: $notes, reason: $reason, type: $type, orgID: $orgID,\r\n overriderTitle: $overriderTitle, overriderReason: $overriderReason, overriderFirstName: $overriderFirstName, overriderLastName: $overriderLastName,\r\n redWhiteOverride: $redWhiteOverride, approverFirstName: $approverFirstName, approverLastName: $approverLastName){\r\n _id\r\n _rev\r\n authorization{\r\n brdRestriction_Isn {\r\n type\r\n notes\r\n status\r\n reason\r\n overriderTitle\r\n overriderReason\r\n redWhiteOverride\r\n overriderFirstName\r\n overriderLastName\r\n approverFirstName\r\n approverLastName\r\n createdBy\r\n createdTs\r\n }\r\n }\r\n lastIsnResultWithHeader {\r\n success\r\n qc_count\r\n isn_customer\r\n isn_ownerid\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n trainingStatus\r\n allowed\r\n companyID\r\n quickCheckStatus\r\n errorMessage\r\n isnId\r\n firstName\r\n lastName\r\n companyName\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n dataAsOf\r\n reason\r\n },\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n allowed\r\n companyID\r\n quickCheckStatus\r\n trainingStatus\r\n errorMessage\r\n isnId\r\n firstName\r\n lastName\r\n companyName\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n dataAsOf\r\n reason\r\n }\r\n }\r\n }\r\n}`\r\n\r\nconst FirstLastNameInput = (props) => {\r\n\r\n let { value, onChange } = props;\r\n\r\n const handleChange = (type) => (e) => {\r\n onChange?.({ ...value, [type]: e.target.value });\r\n }\r\n\r\n return \r\n \r\n \r\n \r\n}\r\n\r\nclass Override extends React.Component {\r\n requireNewFields = () => {\r\n return this.props.orgData.organization.requireOverrideFields1;\r\n }\r\n submit = (paxOverride) => {\r\n this.props.form.validateFieldsAndScroll((err, values) => {\r\n if (!err) {\r\n const { isnData: {_id, _rev} } = this.props;\r\n const { type, notes, overriderTitle, overriderReason, overriderName, approverName, redWhiteOverride } = values;\r\n const orgID = this.props.orgData.organization._id;\r\n paxOverride({ \r\n variables: {\r\n _id, _rev, type, notes, orgID,\r\n overriderTitle, overriderReason, redWhiteOverride,\r\n overriderFirstName: overriderName?.firstName,\r\n overriderLastName: overriderName?.lastName,\r\n approverFirstName: approverName?.firstName,\r\n approverLastName: approverName?.lastName\r\n }\r\n });\r\n }\r\n });\r\n }\r\n render() {\r\n const { getFieldDecorator } = this.props.form;\r\n const formItemLayout = {\r\n labelCol: {\r\n xs: { span: 24 },\r\n sm: { span: 6 },\r\n },\r\n wrapperCol: {\r\n xs: { span: 24 },\r\n sm: { span: 18 },\r\n },\r\n };\r\n const tailFormItemLayout = {\r\n wrapperCol: {\r\n xs: {\r\n span: 24,\r\n offset: 0,\r\n },\r\n sm: {\r\n span: 20,\r\n offset: 6,\r\n },\r\n },\r\n };\r\n const statusList = [\r\n {\r\n value: 'MANUALLY_VERIFIED',\r\n text: 'Manually Verified'\r\n },\r\n {\r\n value: 'MANAGEMENT_OVERRIDE',\r\n text: 'Management Override'\r\n },\r\n {\r\n value: 'CUSTOMER_NOT_ENFORCING',\r\n text: 'Customer Not Enforcing'\r\n },\r\n {\r\n value: 'DO_NOT_OVERRIDE',\r\n text: 'Do Not Override'\r\n }\r\n ]\r\n try{\r\n return (\r\n console.log('Override Complete:', data)}>\r\n {\r\n (paxOverride, { error, loading, data }) => {\r\n if (error) {console.error(error)}\r\n if (data) {console.log(\"DATA\", data)}\r\n return (\r\n \r\n {error && }\r\n
\r\n \r\n {getFieldDecorator('type', {\r\n rules: [\r\n {\r\n required: true, message: 'Please choose a reason for the override'\r\n }\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('overriderTitle', {\r\n rules: [{ required: this.requireNewFields(), message: 'This organization requires an Overrider Title' }]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('redWhiteOverride', {\r\n rules: [{ required: this.requireNewFields(), message: 'This organization requires a Training or Whitelist Override' }]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('overriderReason', {\r\n rules: [{ required: this.requireNewFields(), message: 'This organization requires an Overrider Reason' }]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('overriderName', {\r\n rules: [{\r\n required: this.requireNewFields(),\r\n message: 'This organization requires an Overrider First/Last Name',\r\n validator: validateFirstLastName\r\n }],\r\n initialValue: {\r\n firstName: this.props.userinfo.user?.attributes.given_name,\r\n lastName: this.props.userinfo.user?.attributes.family_name\r\n }\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('approverName', {\r\n rules: [{\r\n required: this.requireNewFields(),\r\n message: 'This organization requires an Approver First/Last Name',\r\n validator: validateFirstLastName\r\n }]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('notes')(\r\n \r\n )\r\n }\r\n \r\n \r\n \r\n \r\n \r\n Are you sure you want to override?
This action cannot be undone.} \r\n icon={}\r\n okText=\"OVERRIDE\" cancelText=\"Cancel\"\r\n onConfirm={() => this.submit(paxOverride)}>\r\n \r\n
\r\n
\r\n \r\n
\r\n )\r\n }\r\n }\r\n \r\n
\r\n )\r\n }catch(err){\r\n return \r\n }\r\n }\r\n}\r\n\r\n\r\n// class Override extends React.Component {\r\n// constructor(props) {\r\n// super(props);\r\n// this.form = React.createRef();\r\n// this.state = {\r\n// graphErrors: [],\r\n// isSubmitting: false\r\n// }\r\n// }\r\n// handleSubmit = () => {\r\n// this.props.form.validateFieldsAndScroll((err, values) => {\r\n// if (!err) {\r\n// const { currentIsn: {_id, _rev} } = this.props;\r\n// this.setState({ isSubmitting: true, graphErrors: [] });\r\n\r\n// API.graphql(graphqlOperation(overrideMutation, {_id, _rev, ...values}))\r\n// .then(resp => {\r\n// this.setState({ isSubmitting: false });\r\n// // console.log('overridden', resp);\r\n// this.props.setPax(resp.data.paxOverride);\r\n// })\r\n// .catch(({errors}) => {\r\n// console.error(errors);\r\n// this.setState({ isSubmitting: false, graphErrors: errors });\r\n// });\r\n// }\r\n// });\r\n// }\r\n// render() {\r\n// const { getFieldDecorator } = this.props.form;\r\n// const formItemLayout = {\r\n// labelCol: {\r\n// xs: { span: 24 },\r\n// sm: { span: 4 },\r\n// },\r\n// wrapperCol: {\r\n// xs: { span: 24 },\r\n// sm: { span: 20 },\r\n// },\r\n// };\r\n// const tailFormItemLayout = {\r\n// wrapperCol: {\r\n// xs: {\r\n// span: 24,\r\n// offset: 0,\r\n// },\r\n// sm: {\r\n// span: 20,\r\n// offset: 4,\r\n// },\r\n// },\r\n// };\r\n// const statusList = [\r\n// {\r\n// value: 'MANUALLY_VERIFIED',\r\n// text: 'Manually Verified'\r\n// },\r\n// {\r\n// value: 'MANAGEMENT_OVERRIDE',\r\n// text: 'Management Override'\r\n// },\r\n// {\r\n// value: 'CUSTOMER_NOT_ENFORCING',\r\n// text: 'Customer Not Enforcing'\r\n// },\r\n// {\r\n// value: 'DO_NOT_OVERRIDE',\r\n// text: 'Do Not Override'\r\n// }\r\n// ]\r\n// try{\r\n// return (\r\n// \r\n// {this.state.graphErrors.map((err, i) => \r\n// \r\n// )}\r\n//
\r\n// \r\n// {getFieldDecorator('type', {\r\n// rules: [\r\n// {\r\n// required: true, message: 'Please choose a reason for the override'\r\n// }\r\n// ]\r\n// })(\r\n// \r\n// )}\r\n// \r\n// \r\n// {getFieldDecorator('notes')\r\n// ()\r\n// }\r\n// \r\n// \r\n// Are you sure you want to override?
This action cannot be undone.} \r\n// icon={}\r\n// okText=\"OVERRIDE\" cancelText=\"Cancel\"\r\n// onConfirm={this.handleSubmit}>\r\n// \r\n//
\r\n//
\r\n// \r\n//
\r\n// )\r\n// }catch(err){\r\n// return \r\n// }\r\n\r\n\r\n// }\r\n// }\r\n\r\n// const mapStateToProps = state => ({\r\n// currentIsn: state.appPages.passenger.currentIsn\r\n// })\r\n\r\n// const mapDispatchToProps = dispatch => ({\r\n// setPax: (payload) => dispatch(setCurrentIsn(payload))\r\n// })\r\n\r\nconst OverrideWithWrappers = withUserInfo(WithOrgData(Form.create()(Override)))\r\n\r\nconst WithPermissions = (props) => (\r\n \r\n }>\r\n \r\n \r\n)\r\n\r\nexport default WithPermissions","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { OverrideCard } from '../OverrideCard';\r\nimport { Tabs, Button } from 'antd';\r\nimport { QCResultWithData } from '../QCResult';\r\nimport Override from '../../Override';\r\nimport WithOrgData from '../../WithOrgData';\r\n\r\nconst renderOverrideTab = (data) => {\r\n try{\r\n var isGreen = false;\r\n var isOverridden = false;\r\n try{\r\n const quickCheckStatus = data.lastIsnResultWithHeader.selectedResult.quickCheckStatus;\r\n try{\r\n isGreen = quickCheckStatus.toLowerCase() === 'green';\r\n }\r\n catch(err){\r\n console.error(err.message);\r\n }\r\n }catch(err){\r\n console.error(err.message)\r\n }\r\n\r\n try{\r\n const brdStatus = data.authorization.brdRestriction_Isn.status;\r\n isOverridden = brdStatus === 'OVERRIDDEN';\r\n }catch(err){\r\n console.error(err.message)\r\n }\r\n\r\n if (!(isGreen || isOverridden)){\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n }\r\n catch(err){console.error(err.message);}\r\n return null;\r\n}\r\n\r\nclass PaxISN extends Component {\r\n hasOverride = () => {\r\n try{\r\n return this.props.data.authorization.brdRestriction_Isn.status === 'OVERRIDDEN'\r\n }\r\n catch(err){\r\n return false\r\n }\r\n }\r\n getOverride = () => {\r\n try{\r\n return this.props.data.authorization.brdRestriction_Isn\r\n }\r\n catch(err){\r\n return null\r\n }\r\n }\r\n render() {\r\n const { data, showISNCheck=true, orgData } = this.props;\r\n return (\r\n
\r\n {this.hasOverride() ? (\r\n \r\n ) : null}\r\n this.props.runISNCheck(data._id)}\r\n loading={this.props.isnCheckRunning}\r\n >Run ISN Check\r\n ) : null\r\n }\r\n >\r\n \r\n \r\n \r\n {orgData.transporter ? renderOverrideTab(data) : null}\r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nPaxISN.propTypes = {\r\n data: PropTypes.shape({\r\n _id: PropTypes.string.isRequired\r\n }).isRequired,\r\n showISNCheck: PropTypes.bool,\r\n runISNCheck: PropTypes.func,\r\n isnCheckRunning: PropTypes.bool\r\n}\r\n \r\nexport default WithOrgData(PaxISN);","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery PaxQuery($_id: ID!){\r\n getPassenger(_id: $_id){\r\n _id\r\n _rev\r\n lastName\r\n firstName\r\n lastIsnResultWithHeader {\r\n success\r\n qc_count\r\n isn_customer\r\n isn_ownerid\r\n error_message\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n trainingStatus\r\n allowed\r\n companyID\r\n quickCheckStatus\r\n errorMessage\r\n isnId\r\n firstName\r\n lastName\r\n companyName\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n dataAsOf\r\n reason\r\n reasonsForNonCompliance\r\n scCompanyGrade\r\n scCompanyGradeSince\r\n trainingQualificationProject {\r\n id\r\n name\r\n }\r\n operatorQualificationProject {\r\n id\r\n name\r\n }\r\n onlineTrainingQualificationProject {\r\n id\r\n name\r\n }\r\n },\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n allowed\r\n companyID\r\n quickCheckStatus\r\n trainingStatus\r\n errorMessage\r\n isnId\r\n firstName\r\n lastName\r\n companyName\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n dataAsOf\r\n reason\r\n reasonsForNonCompliance\r\n scCompanyGrade\r\n scCompanyGradeSince\r\n trainingQualificationProject {\r\n id\r\n name\r\n }\r\n operatorQualificationProject {\r\n id\r\n name\r\n }\r\n onlineTrainingQualificationProject {\r\n id\r\n name\r\n }\r\n }\r\n }\r\n authorization {\r\n onWhiteList\r\n brdRestriction_Isn {\r\n status\r\n type\r\n notes\r\n reason\r\n overriderTitle\r\n overriderReason\r\n redWhiteOverride\r\n overriderFirstName\r\n overriderLastName\r\n approverFirstName\r\n approverLastName\r\n createdTs\r\n }\r\n }\r\n getTzName\r\n }\r\n}\r\n`","import React, { Component } from 'react';\r\nimport { Query } from 'react-apollo';\r\nimport PaxQuery from './PaxQuery';\r\nimport PropTypes from 'prop-types';\r\nimport { Alert, Spin } from 'antd';\r\nimport LoadingContent from '../../LoadingContent';\r\nimport PaxISN from './PaxISN';\r\n\r\nclass PaxISNWithData extends Component {\r\n render() {\r\n const { paxId, fetchPolicy, showISNCheck=true, ...restProps } = this.props;\r\n return (\r\n \r\n {({ data, loading, error }) => {\r\n const passenger = data && data.getPassenger;\r\n if (!passenger && loading ) return \r\n return (\r\n \r\n {error ? (\r\n \r\n ) : null}\r\n {passenger ? (\r\n \r\n ) : null}\r\n \r\n )\r\n }}\r\n \r\n );\r\n }\r\n}\r\n\r\nPaxISNWithData.propTypes = {\r\n paxId: PropTypes.string.isRequired,\r\n fetchPolicy: PropTypes.string,\r\n showISNCheck: PropTypes.bool\r\n}\r\n \r\nexport default PaxISNWithData;","import React, { Component } from 'react';\r\nimport withBoardingRestrictionDrawer from '../withBoardingRestrictionDrawer';\r\nimport { FilterableTable } from './FilterableTable';\r\nimport withFlightDrawer from '../WithFlightDrawer';\r\nimport { compose } from 'recompose';\r\nimport { Query } from 'react-apollo';\r\nimport { Drawer, Alert } from 'antd';\r\nimport { PaxISNWithData } from '../isn/PaxISN';\r\nimport gql from 'graphql-tag';\r\nimport { classNames } from 'common/util';\r\nimport './PassengerTable-style.less';\r\nimport { replaceColumn } from 'common/table/columns';\r\n\r\nclass PassengerTable extends Component {\r\n state = {\r\n isnDrawer: {\r\n visible: false,\r\n id: null\r\n }\r\n }\r\n ColorizedRow = (props) => {\r\n let pax = this.props.dataSource && this.props.dataSource.find((pax) => pax?._id === props['data-row-key']);\r\n let cn = classNames(props.className, 'mc-table-passengers-row-' + String(pax.checkInType).toLowerCase());\r\n return
\r\n }\r\n setIsnDrawer = (visible, id) => {\r\n this.setState({\r\n ...this.state,\r\n isnDrawer: {\r\n visible,\r\n id: id || this.state.isnDrawer.id\r\n }\r\n })\r\n }\r\n render() {\r\n let { columns, ...restProps } = this.props;\r\n const isn = columns.find(col => col.key === 'isnStatus');\r\n const restriction = columns.find(col => col.key === 'restrictions');\r\n if (isn){\r\n columns = replaceColumn(columns, 'isnStatus', {\r\n render: (text, record, index) => (isn.render(text, record, index, () => this.setIsnDrawer(true, record._id)))\r\n })\r\n }\r\n if (restriction){\r\n columns = replaceColumn(columns, 'restrictions', {\r\n render: (text, record, index) => (\r\n restriction.render(text, record, index, () => this.props.boardingRestrictionsDrawer.open(record._id))\r\n )\r\n })\r\n }\r\n return (\r\n \r\n \r\n \r\n {({ data, loading, error }) => {\r\n const passenger = data && data.getPassenger;\r\n var title;\r\n title = passenger ? `${passenger.lastName}, ${passenger.firstName}` : '';\r\n if (loading){\r\n title = 'Loading...'\r\n }\r\n return (\r\n {\r\n this.props.refetch && this.props.refetch()\r\n this.setIsnDrawer(false)\r\n }}\r\n closable\r\n >\r\n {error ? : null}\r\n {passenger ? : null}\r\n \r\n )\r\n }}\r\n \r\n \r\n );\r\n }\r\n}\r\n \r\nexport default compose(\r\n withFlightDrawer(),\r\n withBoardingRestrictionDrawer\r\n)(PassengerTable)","import { Alert, Button, Card, Col, message, Modal, Row } from 'antd';\r\nimport RadioGroup from 'antd/lib/radio/group';\r\nimport RadioButton from 'antd/lib/radio/radioButton';\r\nimport { EditableCell, EditableFormRow } from 'components/EditableTable';\r\nimport { withUserGroups } from 'components/userGroup';\r\nimport withOrgData from 'components/WithOrgData';\r\nimport gql from 'graphql-tag';\r\nimport PropTypes from 'prop-types';\r\nimport React, { Component } from 'react';\r\nimport { withApollo } from 'react-apollo';\r\nimport { compose } from 'redux';\r\nimport commonColumns from '../../../common/table/columns';\r\nimport { GlobalFilterWithWrapper } from '../../GlobalFilter';\r\nimport { Paginator } from '../../Paginator';\r\nimport { PassengerEditorWithData } from '../../PassengerEditor';\r\nimport PassengerTable from '../../tables/PassengerTable';\r\n\r\n/**\r\n * Displays a real-time filterable table of the current active passengers for the selected transportation provider and customer.\r\n */\r\n\r\nconst SET_PASSENGER = gql`\r\nmutation SetPassenger($payload: PaxNodeInput!){\r\n setPaxNode(\r\n payload: $payload\r\n ){\r\n _id\r\n lastName,\r\n firstName,\r\n personID {\r\n _id\r\n extraBroadState\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n },\r\n tpID {\r\n _id\r\n name\r\n }\r\n paxWeight,\r\n bagWeight,\r\n bagCount,\r\n checkedInTime,\r\n scheduledFlightDate,\r\n destinationID {\r\n _id, name\r\n }\r\n departureID {\r\n _id, name\r\n },\r\n transitType\r\n lastIsnResultWithHeader {\r\n success,\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n quickCheckStatus\r\n errorMessage\r\n reason\r\n }\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n quickCheckStatus,\r\n errorMessage\r\n reason\r\n }\r\n },\r\n authorization {\r\n onWhiteList\r\n noFlyListed\r\n brdRestriction_Isn {\r\n status\r\n }\r\n brdRestriction_SafetyCard {\r\n status\r\n }\r\n brdRestriction_HuetCard {\r\n status\r\n }\r\n brdRestriction_SteelToes {\r\n status\r\n }\r\n brdRestriction_Twic {\r\n status\r\n }\r\n brdRestriction_NonPreferred {\r\n status\r\n }\r\n brdRestriction_Hazmat {\r\n status\r\n }\r\n brdRestriction_NoFlyListed {\r\n status\r\n }\r\n brdRestriction_EbsCard {\r\n status\r\n }\r\n brdRestriction_Illness {\r\n status\r\n }\r\n brdRestriction_Quarantined {\r\n status\r\n }\r\n }\r\n currentCarrierID {\r\n _id\r\n desig\r\n }\r\n }\r\n}`\r\nclass LivePassengers extends Component {\r\n state = {\r\n editing: \"\",\r\n editPaxModal: {\r\n visible: false, // Modal will appear when true\r\n id: null // Passenger ID of pax to display in modal\r\n }\r\n }\r\n getActiveTab = () => {\r\n return this.props.activeTab || 'outbound'\r\n }\r\n onTableChange = (_, filters) => {\r\n this.setState({ filters })\r\n }\r\n onTabChange = (activeTab) => this.props.onTabChange && this.props.onTabChange(activeTab)\r\n getColumns = () => {\r\n const activeTab = this.getActiveTab();\r\n const { customer, employer, transporter } = this.props.orgData;\r\n\r\n // Create custom set of columns for display in the table\r\n const columns = [\r\n {\r\n ...commonColumns.pax.columns.assignedFlight,\r\n defaultSortOrder: 'ascend'\r\n },\r\n {\r\n ...commonColumns.pax.columns.name,\r\n render: (text, record) => {\r\n const name = commonColumns.pax.columns.name.render(text, record);\r\n return \r\n }\r\n },\r\n !employer && commonColumns.pax.columns.employer,\r\n !customer && commonColumns.pax.columns.customer,\r\n !customer && !transporter ? commonColumns.pax.columns.transporter : undefined,\r\n ...commonColumns.pax.except(['name', 'assignedFlight', 'transitType', 'isn', 'restrictions', 'customer', 'employer', 'transporter']),\r\n {\r\n ...commonColumns.pax.columns.restrictions,\r\n width: 100\r\n },\r\n\r\n // ISN Column will only display when the Outbound tab is selected.\r\n // Inbound/Transfer passengers do not require an ISN status.\r\n activeTab === 'outbound' && {\r\n ...commonColumns.pax.columns.isn\r\n }\r\n ].filter(col => col)\r\n return columns\r\n }\r\n\r\n // Set visibility and current passenger ID to be displayed in popup modal.\r\n setPaxModal = (visible, id) => {\r\n this.setState({\r\n ...this.state,\r\n editPaxModal: {\r\n visible,\r\n id: id || this.state.editPaxModal.id\r\n }\r\n })\r\n }\r\n render() {\r\n const { passengers=[], loading=false, error, refetch, skip, setSkip, userGroups } = this.props;\r\n const activeTab = this.getActiveTab();\r\n const onKeyDown = (e) => {\r\n const specialCharRegex = new RegExp(\"[a-zA-Z]\");\r\n const pressedKey = e.key\r\n if ((pressedKey !== \"Tab\" && pressedKey !== \"Backspace\" && pressedKey !== \"Delete\") && specialCharRegex.test(pressedKey)) {\r\n e.preventDefault();\r\n return false;\r\n }\r\n }\r\n const columns = this.getColumns().map(col => {\r\n if (activeTab !== \"inbound\" || !col.editable) {\r\n return col;\r\n }\r\n return {\r\n ...col,\r\n onCell: record => ({\r\n inputProps: {\r\n onKeyDown,\r\n onBlur: e => {\r\n if(!e.target.value){\r\n e.target.value = record[col.dataIndex]\r\n return;\r\n }\r\n if(e.target.value === record[col.dataIndex]){\r\n return;\r\n }\r\n if(e.target.value !== 0 && e.target.value < 90){\r\n e.target.value = record[col.dataIndex]\r\n message.warn(record['lastName'] + \", \" + record[\"firstName\"] + \" weight must be 0 or greater than 90.\")\r\n return;\r\n }\r\n const payload = {\r\n _id: record['_id'],\r\n paxWeight: e.target.value,\r\n tpID: this.props.orgData.transporter._id\r\n }\r\n\r\n this.props.client.mutate({\r\n mutation: SET_PASSENGER,\r\n variables: {payload},\r\n optimisticResponse:{\r\n __typename: 'Mutation',\r\n setPaxNode: {\r\n __typename: 'PaxNode',\r\n ...record,\r\n paxWeight: e.target.value\r\n }\r\n }\r\n })\r\n .then(() => {\r\n message.success(record['lastName'] + \", \" + record[\"firstName\"] + \" has been successfully saved.\")\r\n })\r\n .catch((err) => {\r\n message.error(\"Error saving \" + record['lastName'] + \", \" + record[\"firstName\"] + \": \" + err)\r\n })\r\n }\r\n },\r\n record,\r\n ...col,\r\n cancelButton: true,\r\n editable: col.editable,\r\n editing: true,\r\n dataIndex: col.dataIndex,\r\n title: col.title,\r\n handleSave: this.handleSave,\r\n })\r\n };\r\n });;\r\n return (\r\n
\r\n {/* Displays global filter banner. Controls filtering of data in PassengerTable */}\r\n \r\n\r\n

Passengers

\r\n {error ? (\r\n \r\n ) : null}\r\n\r\n {/* OUTBOUND/TRANSFER/INBOUND tabs and other actions. */}\r\n \r\n
\r\n this.onTabChange(e.target.value)} value={activeTab} buttonStyle=\"solid\">\r\n \r\n Outbound\r\n \r\n \r\n Inbound/Transfer\r\n \r\n \r\n \r\n \r\n \r\n \r\n {userGroups.includes('flytsuite.live.passenger') ?\r\n \r\n \r\n : null}\r\n \r\n \r\n\r\n {/* Paginator to control the current page displayed in the PassengerTable below */}\r\n \r\n setSkip(skip)}\r\n size=\"small\"\r\n loading={loading}\r\n />\r\n \r\n\r\n {/* Displays table of passengers that can be filtered and paginated. */}\r\n record._id}\r\n dataSource={passengers} \r\n onChange={this.onTableChange}\r\n columns={columns}\r\n scroll={{ x: 'max-content' }}\r\n size=\"small\"\r\n />\r\n this.setPaxModal(false)}\r\n width=\"50rem\"\r\n title=\"Edit Passenger\"\r\n footer={false}\r\n >\r\n {this.state.editPaxModal.id ? this.setPaxModal(false)} /> : null}\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nLivePassengers.propTypes = {\r\n passengers: PropTypes.arrayOf(PropTypes.object),\r\n loading: PropTypes.bool,\r\n activeTab: PropTypes.any,\r\n onTabChange: PropTypes.func,\r\n refetch: PropTypes.func\r\n}\r\n \r\nexport default compose(\r\n withApollo,\r\n withOrgData,\r\n withUserGroups\r\n)(LivePassengers);","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery GetPax(\r\n $filter: PassengersFilterInput\r\n $bookmark: String\r\n $limit: Int\r\n $skip: Int\r\n){\r\n passengers(\r\n filter: $filter\r\n bookmark: $bookmark\r\n limit: $limit\r\n skip: $skip\r\n ) {\r\n docs {\r\n _id,\r\n ... on PaxNode {\r\n lastName,\r\n firstName,\r\n personID {\r\n _id\r\n extraBroadState\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n },\r\n tpID {\r\n _id\r\n name\r\n }\r\n paxWeight,\r\n bagWeight,\r\n bagCount,\r\n checkedInTime,\r\n scheduledFlightDate,\r\n destinationID {\r\n _id, name\r\n }\r\n departureID {\r\n _id, name\r\n },\r\n transitType\r\n lastIsnResultWithHeader {\r\n success,\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n quickCheckStatus\r\n errorMessage\r\n reason\r\n }\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n quickCheckStatus,\r\n errorMessage\r\n reason\r\n }\r\n },\r\n authorization {\r\n onWhiteList\r\n noFlyListed\r\n brdRestriction_Isn {\r\n status\r\n }\r\n brdRestriction_SafetyCard {\r\n status\r\n }\r\n brdRestriction_HuetCard {\r\n status\r\n }\r\n brdRestriction_SteelToes {\r\n status\r\n }\r\n brdRestriction_Twic {\r\n status\r\n }\r\n brdRestriction_NonPreferred {\r\n status\r\n }\r\n brdRestriction_Hazmat {\r\n status\r\n }\r\n brdRestriction_NoFlyListed {\r\n status\r\n }\r\n brdRestriction_EbsCard {\r\n status\r\n }\r\n brdRestriction_Illness {\r\n status\r\n }\r\n brdRestriction_Quarantined {\r\n status\r\n }\r\n }\r\n currentCarrierID {\r\n _id\r\n desig\r\n }\r\n }\r\n }\r\n }\r\n}`","import React from 'react';\r\nimport gql from 'graphql-tag';\r\nimport { Query } from 'react-apollo';\r\n\r\nconst withGlobalFilter = (Component) => ({ data, ...restProps }) => {\r\n return (\r\n \r\n {({ data }) => {\r\n return \r\n }}\r\n \r\n )\r\n}\r\n\r\nexport default withGlobalFilter","import React, { Component } from 'react';\r\nimport { Query, graphql } from 'react-apollo';\r\nimport compose from 'lodash.flowright';\r\nimport PaxQuery from './PaxQuery';\r\nimport WithOrgData from '../../WithOrgData';\r\nimport LivePassengers from './LivePassengers';\r\nimport withGlobalFilter from '../../withGlobalFilter';\r\nimport PaginationLimit from '../../../Queries/PaginationLimit';\r\n\r\n/**\r\n * Wrapper for LivePassengers component. Handles querying of data and inserting that data into LivePassengers.\r\n * Handles loading and error states of current query and passes it to LivePassengers.\r\n */\r\nclass LivePassengersWithData extends Component {\r\n state = {\r\n activeTab: 'outbound', // Current selected tab. Possible values: 'outbound', 'inbound', 'transfer'.\r\n skip: 0 // Used for pagination. How many passengers to skip from the beginning of the data set.\r\n }\r\n\r\n // Convert current tab selection to a valid transitType to use in query\r\n getTransitType = () => {\r\n const { activeTab } = this.state;\r\n switch (activeTab) {\r\n case 'outbound':\r\n return ['OUTBOUND']\r\n case 'inbound':\r\n return ['INBOUND', 'TRANSFER']\r\n default:\r\n return null;\r\n }\r\n }\r\n render() {\r\n const { customer, transporter } = this.props.orgData;\r\n const { globalFilter, paginationLimit } = this.props;\r\n return (\r\n key) : customer && [customer._id],\r\n transporters: globalFilter.transporter && globalFilter.transporter.length ? globalFilter.transporter.map(({ key }) => key) : transporter && [transporter._id],\r\n employers: globalFilter.employer && globalFilter.employer.map(({ key }) => key),\r\n departures: globalFilter.departure && globalFilter.departure.map(({ key }) => key),\r\n destinations: globalFilter.destination && globalFilter.destination.map(({ key }) => key),\r\n transitTypes: this.getTransitType(),\r\n onlyShowLive: true\r\n },\r\n skip: this.state.skip,\r\n limit: paginationLimit\r\n }}\r\n fetchPolicy=\"cache-and-network\"\r\n pollInterval={60000}\r\n >\r\n {({ data, loading, error, refetch }) => {\r\n const passengers = (data && data.passengers && data.passengers.docs) || [];\r\n return (\r\n this.setState({ activeTab })}\r\n refetch={refetch}\r\n skip={this.state.skip}\r\n setSkip={(skip) => this.setState({ skip })}\r\n />\r\n )\r\n }}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default compose(\r\n withGlobalFilter,\r\n WithOrgData,\r\n graphql(\r\n PaginationLimit,\r\n {\r\n props: props => ({\r\n paginationLimit: (props.data && props.data.paginationLimit) || 200\r\n })\r\n }\r\n )\r\n)(LivePassengersWithData)","import React, { cloneElement, useEffect, useRef, useState } from \"react\";\r\nimport { Button, Col, Icon, Row, Tooltip } from \"antd\";\r\nimport makeCancelable from \"makecancelable\";\r\nimport \"./BlueprintTableInfiniteScroller.css\";\r\nimport { ITableProps } from \"@blueprintjs/table\";\r\nimport usePromise from \"../../hooks/usePromise\";\r\n\r\ninterface LoaderProps {\r\n loadMoreMessage: string;\r\n}\r\n\r\ninterface ErrorMsgProps {\r\n title?: string,\r\n message: string\r\n}\r\n\r\nconst Loader: React.FC = ({ loadMoreMessage }) =>{\r\n const style: React.CSSProperties = {\r\n margin: 12,\r\n background: 'rgba(0, 0, 0, 0.7)',\r\n color: 'white',\r\n borderRadius: '3px',\r\n position: 'absolute',\r\n bottom: 0,\r\n left: 0,\r\n minWidth: '12rem',\r\n padding: '6px 12px',\r\n boxShadow: '1px 0 3px rgba(0,0,0,0.1)'\r\n }\r\n return
\r\n \r\n {loadMoreMessage ? loadMoreMessage :'Loading more data...'}\r\n
\r\n}\r\n\r\nconst ErrorMsg: React.FC = ({ title, message }) => {\r\n const style: React.CSSProperties = {\r\n margin: 12,\r\n background: 'rgba(255, 0, 0, 0.7)',\r\n color: 'white',\r\n borderRadius: '3px',\r\n position: 'absolute',\r\n bottom: 0,\r\n left: 0,\r\n minWidth: '12rem',\r\n padding: '6px 12px',\r\n boxShadow: '1px 0 3px rgba(0,0,0,0.1)'\r\n }\r\n const titleText = title ? title : 'Failed to get next page';\r\n return
\r\n \r\n
\r\n \r\n \r\n \r\n {titleText}\r\n
{message}
\r\n \r\n \r\n \r\n}\r\n\r\nfunction scrollElementToBottom(element: HTMLElement, offset: number=0){\r\n element.scrollTop = element.scrollHeight - offset;\r\n}\r\n\r\nexport interface BlueprintTableInfiniteScrollerProps extends React.HTMLAttributes {\r\n loading?: boolean,\r\n loadMore?: () => Promise,\r\n loadMoreMessage?: string,\r\n hasMore?: boolean,\r\n children: React.ReactElement,\r\n offset?: number\r\n}\r\n\r\nconst BlueprintTableInfiniteScroller: React.FC = ({\r\n loading = false,\r\n loadMore: _loadMore,\r\n loadMoreMessage,\r\n hasMore,\r\n children: tableComponent,\r\n offset=1000,\r\n ...restProps\r\n}) => {\r\n const tableRef = useRef(null);\r\n const [ prevScroll, setPrevScroll ] = useState(0);\r\n const [ shouldLoadMore, setShouldLoadMore ] = useState(false);\r\n // const [ canScroll, setCanScroll ] = useState(false);\r\n const [ startedNextPageWithBtn, setStartedNextPageWithBtn ] = useState(false);\r\n const [ error, setError ] = useState(null);\r\n\r\n const loadMore = usePromise(_loadMore);\r\n\r\n console.debug('hasMore', hasMore);\r\n \r\n const handleError = (err, timeout=5000) => {\r\n setError(err);\r\n new Promise(resolve => setTimeout(resolve, timeout))\r\n .then(() => setError(null));\r\n }\r\n\r\n const isEmpty = () => {\r\n console.log(tableRef);\r\n if (tableRef.current){\r\n return tableRef.current.props.numRows <= 0;\r\n }\r\n return false;\r\n }\r\n\r\n const handleSuccess = () => {\r\n console.debug('successful response');\r\n }\r\n\r\n const nextPage = () => {\r\n if (loadMore.loading){\r\n return;\r\n }\r\n setShouldLoadMore(true);\r\n }\r\n\r\n // useEffect(() => {\r\n // const allowScroll = () => {\r\n // setCanScroll(true);\r\n // }\r\n // const waitForTimeout = () => new Promise(resolve => {\r\n // setTimeout(resolve, 1000);\r\n // })\r\n // const cancelTimeout = makeCancelable(\r\n // waitForTimeout(),\r\n // allowScroll\r\n // )\r\n // return () => cancelTimeout();\r\n // }, [])\r\n\r\n useEffect(() => {\r\n if (shouldLoadMore){\r\n setShouldLoadMore(false);\r\n setError(null);\r\n if (typeof loadMore.call !== 'function') return;\r\n\r\n const cancelRequest = makeCancelable(\r\n loadMore.call(),\r\n handleSuccess,\r\n handleError\r\n )\r\n return () => cancelRequest();\r\n }\r\n // eslint-disable-next-line\r\n }, [ shouldLoadMore ])\r\n\r\n // eslint-disable-next-line\r\n useEffect(() => {\r\n if (!loadMore.loading && startedNextPageWithBtn){\r\n setStartedNextPageWithBtn(false);\r\n scrollElementToBottom(tableRef.current.scrollContainerElement, 50);\r\n }\r\n })\r\n\r\n const handleScroll = () => {\r\n const tableState = tableRef.current.state;\r\n const totalHeight = tableState.rowHeights.reduce((total: number, num: number) => total + num, 0);\r\n const viewportTop = tableState.viewportRect.top;\r\n const viewportHeight = tableState.viewportRect.height;\r\n const scrollDelta = viewportTop - prevScroll;\r\n\r\n const viewportBottom = totalHeight - (viewportTop + viewportHeight) - offset;\r\n\r\n if (scrollDelta === 0){\r\n return;\r\n }\r\n const scrollingDown = scrollDelta >= 0;\r\n if (viewportTop !== prevScroll){\r\n setPrevScroll(viewportTop);\r\n }\r\n\r\n if (viewportBottom <= 0 && scrollingDown && !loadMore.loading && hasMore && !isEmpty()){\r\n nextPage();\r\n }\r\n }\r\n\r\n const renderMsg = () => {\r\n if (loading){\r\n return \r\n }\r\n if (loadMore.loading){\r\n return \r\n }\r\n if (error){\r\n return \r\n }\r\n return null;\r\n }\r\n\r\n const renderNextPageBtn = () => {\r\n if (!hasMore || loadMore.loading) return null;\r\n return \r\n {\r\n scrollElementToBottom(tableRef.current.scrollContainerElement);\r\n setStartedNextPageWithBtn(true);\r\n nextPage();\r\n }}\r\n style={{\r\n position: 'absolute',\r\n bottom: '1rem',\r\n right: '1rem'\r\n }}\r\n />\r\n \r\n }\r\n\r\n useEffect(() => {\r\n if (tableRef.current?.scrollContainerElement){\r\n tableRef.current.scrollContainerElement.addEventListener('scroll', handleScroll);\r\n }\r\n return () => {\r\n tableRef.current?.scrollContainerElement.removeEventListener('scroll', handleScroll);\r\n }\r\n // So this was a PINA to find. The handleScroll function was always using a stale version of the \"hasMore\" prop.\r\n // To solve the issue, I had to add hasMore as a dependency to this useEffect so the handleScroll function is properly\r\n // refreshed on the event listener\r\n }, [tableRef.current?.scrollContainerElement, hasMore, loadMore])\r\n\r\n if (tableRef.current){\r\n tableRef.current.handleRootScroll(e => console.debug('handleRootScroll', e));\r\n }\r\n\r\n return
\r\n {cloneElement(tableComponent, { ref: tableRef })}\r\n {renderMsg()}\r\n {renderNextPageBtn()}\r\n
\r\n}\r\n\r\nexport default BlueprintTableInfiniteScroller","import {useState} from \"react\";\r\n\r\nexport default function usePromise Promise, E=any>(promiseFunc: T){\r\n\r\n const [ result, setResult ] = useState>>(null);\r\n const [ loading, setLoading ] = useState(false);\r\n const [ error, setError ] = useState(null);\r\n\r\n function resolve(result: Awaited>){\r\n setLoading(false);\r\n setResult(result);\r\n }\r\n\r\n function reject(err: E){\r\n setLoading(false);\r\n setError(err);\r\n }\r\n\r\n return {\r\n call(...args) {\r\n setResult(null);\r\n setError(null);\r\n setLoading(true);\r\n\r\n const prom = promiseFunc(...args);\r\n prom\r\n .then(resolve)\r\n .catch(reject)\r\n return prom\r\n },\r\n result: loading ? result : null,\r\n error: loading ? error : null,\r\n loading\r\n }\r\n}","import { Alert, Button, Col, Divider, Layout, Popconfirm, Row, Tooltip } from 'antd';\r\nimport useUserGroups from 'hooks/useUserGroups';\r\nimport React, { CSSProperties, HTMLAttributes, ReactNode, useEffect } from 'react';\r\nimport './details.less';\r\nimport './masterdata.less';\r\n\r\nconst DEFAULT_MD_DEL_USR_GRPS = ['flytsuite.master.all', 'flytsuite.master.delete'];\r\nconst DEFAULT_MD_EDIT_USR_GRPS = ['flytsuite.master.all', 'flytsuite.master.edit', 'flytsuite.master.person.all'];\r\n\r\nexport interface MDDetailsProps extends Pick, 'className' | 'style'> {\r\n title?: any,\r\n strTitle?: string,\r\n saving?: boolean,\r\n deleting?: boolean,\r\n onCancel?: () => void,\r\n onSave?: () => void,\r\n onDelete?:() => void,\r\n onReset?: () => void,\r\n showReset?: boolean,\r\n contentWidth?: string | number,\r\n contentStyle?: CSSProperties,\r\n disableSave?: boolean,\r\n isNewEntry?: boolean,\r\n hideSaveBtn?: boolean,\r\n saveBtnText?: ReactNode,\r\n deleteUserGroups?: string[],\r\n editUserGroups?: string[]\r\n /**\r\n * Add extra buttons or content to the right side of the header\r\n */\r\n extra?: Array\r\n}\r\n\r\nexport function getDetailsTitle(title: ReactNode, isNewEntry: boolean, newEntryText: string='New Entry') {\r\n if (isNewEntry) return newEntryText\r\n return title\r\n}\r\n\r\nconst MDDetails: React.FC = (props) => {\r\n const [ userGroups ] = useUserGroups();\r\n const delUserGroups = props.deleteUserGroups ? [...props.deleteUserGroups, ...DEFAULT_MD_DEL_USR_GRPS] : DEFAULT_MD_DEL_USR_GRPS;\r\n const editUserGroups = props.editUserGroups ? [...props.editUserGroups, ...DEFAULT_MD_EDIT_USR_GRPS] : DEFAULT_MD_EDIT_USR_GRPS;\r\n\r\n let userHasDeletePerm = false;\r\n for (const i in userGroups) {\r\n let group = userGroups[i];\r\n if (delUserGroups.includes(group)){\r\n userHasDeletePerm = true;\r\n break;\r\n }\r\n }\r\n\r\n let userHasEditPerm = false;\r\n for (const i in userGroups) {\r\n let group = userGroups[i];\r\n if (editUserGroups.includes(group)){\r\n userHasEditPerm = true;\r\n break;\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n if (!props.onSave && !props.hideSaveBtn){\r\n console.warn('MDDetails must have the onSave prop defined to save.');\r\n }\r\n // eslint-disable-next-line\r\n }, [ props.onSave ])\r\n\r\n function renderDeleteBtn(){\r\n if (props.isNewEntry || !props.onDelete){\r\n return null;\r\n }\r\n if (userHasDeletePerm){\r\n return \r\n \r\n {props.deleting ? 'Deleting' : 'Delete'}\r\n \r\n \r\n }\r\n return \r\n \r\n \r\n }\r\n\r\n const { style, className } = props;\r\n\r\n let contentStyle: CSSProperties = {\r\n width: props.contentWidth,\r\n ...props.contentStyle\r\n }\r\n\r\n return \r\n \r\n
\r\n
{props.title}
\r\n \r\n {props.onDelete && !props.isNewEntry ?\r\n \r\n {renderDeleteBtn()}\r\n \r\n : null}\r\n
\r\n {props.extra?.length > 0 ? (\r\n <>\r\n {props.extra.map(node =>
{node})}\r\n \r\n \r\n ) : null}\r\n {props.showReset ? (\r\n \r\n \r\n \r\n ) : null}\r\n \r\n \r\n \r\n \r\n \r\n {!props.hideSaveBtn ? (\r\n \r\n props.onSave()}\r\n type=\"primary\">{props.saving ? 'Saving' : (props.saveBtnText || 'Save')}\r\n \r\n ) : null}\r\n \r\n \r\n \r\n
\r\n {!userHasEditPerm ? (\r\n <>\r\n \r\n
\r\n {props.children}\r\n
\r\n \r\n ) : props.children}\r\n
\r\n \r\n}\r\n\r\nexport default MDDetails","import { Alert, Button, Icon, Spin } from 'antd';\r\nimport { AlertProps } from 'antd/lib/alert';\r\nimport React, { HTMLAttributes } from 'react';\r\nimport { useQuery } from 'react-apollo';\r\n\r\nconst LoadIndicator = () => {\r\n return
\r\n } tip=\"Checking for existing records\" />\r\n
\r\n}\r\n\r\nconst Error = ({ refetch }) => {\r\n return
\r\n
\r\n
Could not check for existing records.
\r\n
\r\n}\r\n\r\nexport interface DuplicationCheckerProps extends Pick, 'style' | 'className'> {\r\n variables: any,\r\n query: any,\r\n getData: (data: any) => Array,\r\n renderItems(items: Array): JSX.Element,\r\n skip?: boolean,\r\n renderMessage?(items: Array): JSX.Element,\r\n title?: string,\r\n alertProps?: Partial\r\n}\r\n\r\nconst DuplicationChecker: React.FC = (props) => {\r\n const { variables, query, skip, getData, renderItems, renderMessage, style, className } = props;\r\n\r\n const { data, error, networkStatus, refetch } = useQuery(query, {\r\n variables,\r\n fetchPolicy: 'network-only',\r\n notifyOnNetworkStatusChange: true,\r\n skip\r\n })\r\n\r\n if (networkStatus <= 4){\r\n return \r\n }\r\n if (error){\r\n console.error('Duplicate Search failed!', error);\r\n return \r\n }\r\n if (!data) return null;\r\n let items = getData ? getData(data) : [];\r\n if (!Array.isArray(items)){\r\n items = [];\r\n }\r\n if (!items.length) return null;\r\n let messageBeginning = {items.length} records have been found that are\r\n if (items.length === 1){\r\n messageBeginning = A record has been found that is\r\n }\r\n if (typeof renderMessage === 'function'){\r\n var message = renderMessage(items);\r\n }\r\n else\r\n {\r\n message =

{messageBeginning} similar to what you have entered.\r\n It is highly recommended that you edit an existing record by clicking an item below.\r\n

\r\n }\r\n return \r\n {message}\r\n {renderItems(items)}\r\n \r\n }\r\n {...props.alertProps}\r\n />\r\n}\r\n\r\nexport default DuplicationChecker","import { Button, Col, Icon, Row, Tooltip } from 'antd';\r\nimport Input, { SearchProps } from 'antd/lib/input';\r\nimport React from 'react';\r\nimport './header.css';\r\nimport './masterdata.less';\r\n\r\nexport interface MDHeaderProps extends Pick, 'className' | 'style'> {\r\n searchInputProps?: SearchProps,\r\n inputElement?: JSX.Element,\r\n showReloadButton?: boolean,\r\n reloading?: boolean,\r\n newEntryText?: string,\r\n onNewEntry?(): void,\r\n onReload?(): void,\r\n hasFiltersApplied?: boolean,\r\n onFiltersClear?(): void,\r\n title?: string\r\n}\r\n\r\nconst MDHeader: React.FC = (props) => {\r\n return \r\n {props.title ? (\r\n
\r\n

{props.title}

\r\n \r\n ) : null}\r\n \r\n {props.inputElement ? props.inputElement : }\r\n \r\n {props.hasFiltersApplied && props.onFiltersClear ? (\r\n \r\n \r\n \r\n ) : null}\r\n
\r\n {props.showReloadButton || true ? (\r\n
\r\n \r\n props.onReload && props.onReload()}\r\n >\r\n \r\n \r\n \r\n \r\n ) : null}\r\n {props.onNewEntry ? (\r\n \r\n props.onNewEntry()}\r\n type=\"primary\"\r\n >{props.newEntryText ? props.newEntryText : 'New Entry'}\r\n \r\n ) : null}\r\n \r\n}\r\n\r\nexport default MDHeader","import React, { ReactNode } from 'react';\r\nimport { UseMasterDataStateReturnProps, UseMasterDataStateReturnNoQueryHookProps } from \"./hook\";\r\nimport { AlertProps } from \"antd/lib/alert\";\r\nimport { Cell } from \"@blueprintjs/table\";\r\nimport { MDLayoutProps } from './layout';\r\nimport { NoResults } from '.';\r\nimport { MDHeaderProps } from './header';\r\nimport { BlueprintTableInfiniteScrollerProps } from 'components/BlueprintTableInfiniteScroller';\r\nimport { MDTableProps } from './table';\r\nimport { MDDetailsProps, getDetailsTitle } from './details';\r\nimport { formFieldsIsTouched } from 'common/form';\r\nimport { mapValues, isObject } from 'lodash';\r\nimport { cleanGraphQLErrorMsg } from 'common/util';\r\nimport { NetworkStatus } from 'apollo-client';\r\n\r\nexport function isNSLoading(networkStatus: number){\r\n return [1, 4].includes(networkStatus);\r\n}\r\n\r\nexport function isNSReloading(networkStatus: number){\r\n return [2, 3, 6].includes(networkStatus);\r\n}\r\n\r\nexport interface MasterDataProps {\r\n pollInterval?: number,\r\n dataPaginationLimit?: number\r\n}\r\n\r\nexport function searchValuesToQuerySearchPayload(searchValues: {[key: string]: any}): { [key: string]: any } {\r\n let payloadArray = Object.entries(searchValues).filter((([_, value]) => value)).map(([key, value]) => {\r\n let valueJson: string;\r\n if (typeof value === 'string' && key !== '_id'){\r\n valueJson = value.toLowerCase();\r\n }\r\n else if (value?.key){\r\n // LabelInValue object\r\n valueJson = value.key;\r\n }\r\n else {\r\n valueJson = value;\r\n }\r\n return {\r\n key,\r\n value: JSON.stringify(valueJson)\r\n }\r\n })\r\n return payloadArray.length ? payloadArray : undefined\r\n}\r\n\r\nexport function getAlertPropsFromMDState(MDState: UseMasterDataStateReturnProps | UseMasterDataStateReturnNoQueryHookProps): AlertProps{\r\n let alertProps: AlertProps;\r\n if (MDState.queryError){\r\n alertProps = {\r\n message: 'Failed to get entries',\r\n description: cleanGraphQLErrorMsg(MDState.queryError.message),\r\n type: 'error'\r\n }\r\n }\r\n if (MDState.saveError){\r\n let message = 'Failed to save entry';\r\n let description = cleanGraphQLErrorMsg(MDState.saveError.message);\r\n if (description.includes('Document update conflict')){\r\n message = 'Entry already exists';\r\n description = 'The entry that you are trying to create already exists';\r\n }\r\n if (description.includes('Not Authorized')){\r\n description = 'Not Authorized: You do not have permission to do this action.'\r\n }\r\n alertProps = {\r\n message,\r\n description,\r\n type: 'error'\r\n }\r\n }\r\n if (MDState.savedData && !MDState.saveError && !MDState.saving){\r\n alertProps = {\r\n type: 'success',\r\n message: 'Entry saved successfully!'\r\n }\r\n }\r\n if(MDState.deletePressed){\r\n if (MDState.deleteError){\r\n let message = 'Failed to delete entry';\r\n let description = MDState.deleteError.message;\r\n if (description.includes('Document update conflict')){\r\n message = 'Entry was edited before deletion.';\r\n description = 'The entry that you are trying to delete was edited before your deletion.';\r\n }\r\n alertProps = {\r\n message,\r\n description,\r\n type: 'error'\r\n }\r\n }\r\n if (MDState.deletedData && !MDState.deleteError && !MDState.deleting){\r\n alertProps = {\r\n type: 'success',\r\n message: 'Entry deleted successfully!'\r\n }\r\n }\r\n }\r\n return alertProps\r\n}\r\n\r\nexport function findSelectedIndexByID(data: Array, id: string){\r\n return data.findIndex((row) => row._id === id)\r\n}\r\n\r\nexport function renderCellFromKeyIndex(data: Array, key: string){\r\n return (idx: number) => {data[idx][key]}\r\n}\r\n\r\nexport function MDStateHasNoData(MDState: UseMasterDataStateReturnProps | UseMasterDataStateReturnNoQueryHookProps){\r\n return !MDState.queryError && MDState.data.length <= 0 && !(MDState.queryNetworkStatus === NetworkStatus.loading || MDState.queryNetworkStatus === NetworkStatus.setVariables)\r\n}\r\n\r\nexport function MDStateToLayoutProps(MDState: UseMasterDataStateReturnProps | UseMasterDataStateReturnNoQueryHookProps): Partial{\r\n return {\r\n alertProps: getAlertPropsFromMDState(MDState),\r\n displayNoData: MDStateHasNoData(MDState),\r\n detailsVisible: MDState.isEditing\r\n }\r\n}\r\n\r\nexport function MDStateToHeaderProps(MDState: UseMasterDataStateReturnProps | UseMasterDataStateReturnNoQueryHookProps): Partial{\r\n return {\r\n onReload: () => MDState.reload(),\r\n reloading: MDState.reloading,\r\n onNewEntry: MDState.isEditing ? null : () => MDState.editFromNew()\r\n }\r\n}\r\n\r\nexport function MDStateToTableScrollerProps(MDState: UseMasterDataStateReturnProps): Partial{\r\n return {\r\n loadMore: MDState.pagination.loadMore,\r\n hasMore: MDState.pagination.hasMore\r\n }\r\n}\r\n\r\nexport function getMDTableProps(data: Array, MDState: UseMasterDataStateReturnProps | UseMasterDataStateReturnNoQueryHookProps, pk: (string)='_id'): Partial{\r\n return {\r\n numRows: data.length,\r\n selectedRowIndex: findSelectedIndexByID(data, MDState.getEntryFieldValue(pk)),\r\n onEditRow: idx => MDState.editFromExisting(data[idx]),\r\n onEditCancel: () => MDState.cancelEditing()\r\n }\r\n}\r\n\r\nexport function MDStateToDetailsProps(MDState: UseMasterDataStateReturnProps | UseMasterDataStateReturnNoQueryHookProps, detailsTitleEntryFieldName?: string | ((entryValues: any) => ReactNode)): Partial{\r\n let detailsTitle: ReactNode;\r\n if (typeof detailsTitleEntryFieldName === 'function'){\r\n detailsTitle = MDState.initEntryValues && detailsTitleEntryFieldName(MDState.initEntryValues)\r\n }\r\n else {\r\n detailsTitle = MDState.initEntryValues && MDState.initEntryValues[detailsTitleEntryFieldName]\r\n }\r\n return {\r\n title: detailsTitleEntryFieldName && getDetailsTitle(detailsTitle, MDState.isNewEntry),\r\n onCancel: () => MDState.cancelEditing(),\r\n saving: MDState.saving,\r\n deleting: MDState.deleting,\r\n showReset: formFieldsIsTouched(MDState.entryFields, true),\r\n onReset: () => MDState.resetEntryFields(),\r\n isNewEntry: MDState.isNewEntry\r\n }\r\n}\r\n\r\nexport function renderNoData(MDState: UseMasterDataStateReturnProps | UseMasterDataStateReturnNoQueryHookProps, onNewEntry: () => Promise){\r\n if (MDState.loading) return null\r\n return {\r\n onNewEntry && onNewEntry()\r\n .then(() => {\r\n MDState.clearSearchValues();\r\n })\r\n .catch(() => null);\r\n }}\r\n />\r\n}\r\n\r\nexport function trimString(str: string){\r\n if (typeof str === 'string'){\r\n return str.trim();\r\n }\r\n return str\r\n}\r\n\r\nexport function trimObjectStringValues(obj: T, recursive: boolean=false){\r\n if (!isObject(obj)){\r\n return obj\r\n }\r\n return mapValues(obj, (value: any) => {\r\n if (typeof value === 'string'){\r\n return value.trim();\r\n }\r\n if (recursive && isObject(value)){\r\n return trimObjectStringValues(value, recursive);\r\n }\r\n return value\r\n })\r\n}\r\n\r\nexport function updateQueryWithFetchMoreResult(dataKey: string){\r\n return (prev: any, fetchMoreResult: any) => ({\r\n ...prev,\r\n [dataKey]: {\r\n ...prev[dataKey],\r\n docs: [\r\n ...prev[dataKey].docs,\r\n ...fetchMoreResult[dataKey].docs\r\n ]\r\n }\r\n })\r\n}\r\n\r\nexport const renderOrgCell = (data: Array, key: string) => (idx: number) => {\r\n let record = data[idx];\r\n return {record && record[key] && record[key].name}\r\n}","import { useState, useEffect } from \"react\";\r\nimport { createFormFields, getFormFieldValue, formFieldsIsTouched } from \"common/form\";\r\nimport { Modal } from \"antd\";\r\nimport { QueryResult, useQuery, useMutation, MutationResult } from \"react-apollo\";\r\nimport { DEFUALT_POLL_INTERVAL } from '.';\r\nimport { isNSLoading, isNSReloading } from './util';\r\nimport { ApolloError, WatchQueryFetchPolicy } from 'apollo-client';\r\nimport { pickBy, identity } from 'lodash';\r\n\r\nexport interface UseMasterDataStateOptions {\r\n queryGQL: any,\r\n getQueryVariables: (searchValues: SearchValues) => any,\r\n saveMutationGQL: any,\r\n deleteMutationGQL: any,\r\n getQueryData: (queryResult: QueryResult | any) => Array,\r\n pollInterval?: number,\r\n fetchPolicy?: WatchQueryFetchPolicy,\r\n paginationLimit?: number,\r\n updateQueryAfterFetchMore(prevResult: any, fetchMoreResult: any)\r\n tpID?: string,\r\n transformEditFromExisting?: (values: any) => Promise | any,\r\n lockFieldsToValue?: { [key: string]: any },\r\n onEditFromNew?: (defaultValues?: {[key: string]: any}) => void,\r\n}\r\n\r\nexport interface UseMasterDataStateOptionsNoQueryHook {\r\n data: Array,\r\n queryResult: QueryResult,\r\n // queryGQL: any,\r\n // getQueryVariables: (searchValues: SearchValues) => any,\r\n onSave?: (newValues: any) => Promise,\r\n saveMutationResult?: Pick,\r\n deleteMutationResult?: Pick,\r\n onDelete?: (newValues: any) => Promise,\r\n onReload?: () => void,\r\n onCancel?: () => void,\r\n closeAfterSave?: boolean,\r\n // saveMutationGQL: any,\r\n // deleteMutationGQL: any,\r\n // getQueryData: (queryResult: QueryResult | any) => Array,\r\n // pollInterval?: number,\r\n // fetchPolicy?: WatchQueryFetchPolicy,\r\n // paginationLimit?: number,\r\n // updateQueryAfterFetchMore(prevResult: any, fetchMoreResult: any)\r\n // tpID?: string,\r\n transformEditFromExisting?: (values: any) => any,\r\n lockFieldsToValue?: { [key: string]: any }\r\n}\r\n\r\nexport type SearchValues = {\r\n [key: string]: any\r\n}\r\n\r\nexport interface UseMasterDataStateReturnProps {\r\n entryFields: any,\r\n setEntryFields(values: any): void,\r\n getEntryFieldValue(fieldName: string): any,\r\n resetEntryFields(): void,\r\n isEditing: boolean,\r\n // setIsEditing: (editing: boolean, isNew?: boolean) => void,\r\n editFromExisting(values: any, confirmUnsaved?: boolean): void,\r\n editFromNew(defaultValues?: {[key: string]: any}): Promise,\r\n cancelEditing(comfirm?: boolean): Promise,\r\n initEntryValues: any,\r\n // queryResult: QueryResult,\r\n queryError: ApolloError,\r\n loading: boolean,\r\n reloading: boolean,\r\n data: Array,\r\n save(values: any): Promise,\r\n saving: boolean,\r\n saveError: ApolloError,\r\n queryNetworkStatus: number,\r\n savedData: any,\r\n delete?(values: any): void,\r\n deleting?: boolean,\r\n deleteError?: ApolloError,\r\n deletedData?: any,\r\n deletePressed?:any,\r\n deletingId?: string,\r\n reload: () => void,\r\n getSearchValue(key: string): any,\r\n searchValues: {[key: string]: any},\r\n isNewEntry: boolean,\r\n onSearchValueChange: (key: string, value: any, preserveCase?: boolean) => void,\r\n clearSearchValues(): void,\r\n pagination: {\r\n hasMore: boolean,\r\n loadMore: () => Promise,\r\n offset: number\r\n }\r\n}\r\n\r\nexport interface UseMasterDataStateReturnNoQueryHookProps {\r\n entryFields: any,\r\n setEntryFields(values: any): void,\r\n getEntryFieldValue(fieldName: string): any,\r\n resetEntryFields(): void,\r\n isEditing: boolean,\r\n // setIsEditing: (editing: boolean, isNew?: boolean) => void,\r\n editFromExisting(values: any, confirmUnsaved?: boolean, cancelPrevious?: boolean): void,\r\n editFromNew(defaultValues?: {[key: string]: any}): Promise,\r\n cancelEditing(comfirm?: boolean): Promise,\r\n initEntryValues: any,\r\n // queryResult: QueryResult,\r\n queryError: ApolloError,\r\n loading: boolean,\r\n reloading: boolean,\r\n data: Array,\r\n save(values: any, getValues?: (obj) => any): Promise,\r\n saving: boolean,\r\n saveError: ApolloError,\r\n queryNetworkStatus: number,\r\n savedData: any,\r\n delete?(values: any): void,\r\n deleting?: boolean,\r\n deleteError?: ApolloError,\r\n deletedData?: any,\r\n deletePressed?:any,\r\n reload: () => void,\r\n getSearchValue(key: string): any,\r\n searchValues: {[key: string]: any},\r\n isNewEntry: boolean,\r\n onSearchValueChange: (key: string, value: any, preserveCase?: boolean) => void,\r\n clearSearchValues(): void\r\n}\r\n\r\nfunction useMasterDataState(options: UseMasterDataStateOptions): UseMasterDataStateReturnProps {\r\n // const [ searchValue, setSearchValue ] = useState(null);\r\n\r\n function getQueryData(resultData: any){\r\n try {\r\n let data = options.getQueryData(resultData);\r\n if (Array.isArray(data)) return data;\r\n }\r\n catch(err){\r\n console.error('Error while calling getQueryData:', err);\r\n }\r\n return [];\r\n }\r\n\r\n const [ searchValues, setSearchValues ] = useState({});\r\n const [ forcedUpdateCnt, setForcedUpdateCnt ] = useState(0);\r\n const [ paginationOffset, setPaginationOffset ] = useState(0);\r\n const [ paginationHasMore, setPaginationHasMore ] = useState(false);\r\n const [ isInitalQuery, setIsInitialQuery ] = useState(true);\r\n\r\n // // Had to do this because paginationState didn't re-render component upon being changed\r\n // useEffect(() => {\r\n // setForcedUpdateCnt(prev => prev + 1);\r\n // }, [ paginationState.offset, paginationState.hasMore ])\r\n\r\n const paginationLimit = options.paginationLimit || 100\r\n\r\n const queryResult = useQuery(options.queryGQL, {\r\n variables: {\r\n ...options.getQueryVariables(searchValues),\r\n limit: paginationLimit\r\n },\r\n fetchPolicy: options.fetchPolicy || 'network-only',\r\n pollInterval: (['cache-only', 'cache-first'].includes(options.fetchPolicy)) ? undefined : options.pollInterval || DEFUALT_POLL_INTERVAL,\r\n notifyOnNetworkStatusChange: true,\r\n context: {\r\n debounceKey: 'md-aircraft',\r\n debounceTimeout: 1000\r\n },\r\n onCompleted: (data) => {\r\n if (getQueryData(data).length >= paginationLimit && isInitalQuery){\r\n console.debug('onCompleted called');\r\n setPaginationHasMore(true);\r\n setIsInitialQuery(false);\r\n }\r\n }\r\n });\r\n\r\n const [ initEntryValues, setInitEntryValues ] = useState(null);\r\n const [ entryFields, setEntryFields ] = useState(null);\r\n const [ isEditing, setIsEditing ] = useState(false);\r\n const [deletePressed, setDeletePressed] = useState(false);\r\n const [ deleteId, setDeleteId ] = useState(null);\r\n\r\n const [ invokeSave, { loading: saving, error: saveError, data: savedData } ] = useMutation(options.saveMutationGQL, {\r\n onCompleted: () => {\r\n if (!initEntryValues){\r\n queryResult.refetch();\r\n }\r\n handleCancel();\r\n }\r\n });\r\n\r\n const [ invokeDelete, { loading: deleting, error: deleteError, data: deletedData } ] = useMutation(options.deleteMutationGQL, {\r\n onCompleted: () => {\r\n queryResult.refetch();\r\n setDeleteId(null);\r\n handleCancel();\r\n },\r\n onError: () => {\r\n setDeleteId(null);\r\n }\r\n });\r\n\r\n\r\n const loading = isNSLoading(queryResult.networkStatus);\r\n const reloading = isNSReloading(queryResult.networkStatus);\r\n\r\n let data: Array = !loading && queryResult.data ? getQueryData(queryResult.data) : [];\r\n if (!Array.isArray(data)){\r\n data = [];\r\n }\r\n\r\n function handleCancel(){\r\n setInitEntryValues(null);\r\n setEntryFields(null);\r\n setIsEditing(false);\r\n }\r\n\r\n function handleSave(values: any){\r\n setDeletePressed(false);\r\n return invokeSave({\r\n variables: {\r\n tpID: options.tpID,\r\n ...values\r\n }\r\n })\r\n .then(() => queryResult.refetch())\r\n }\r\n\r\n function handleDelete(values: any){\r\n setDeletePressed(true);\r\n let id;\r\n if ('id' in values){\r\n id = values.id;\r\n }\r\n else if ('_id' in values){\r\n id = values._id;\r\n }\r\n setDeleteId(id);\r\n \r\n invokeDelete({\r\n variables: {\r\n tpID: options.tpID,\r\n ...values\r\n }\r\n })\r\n }\r\n\r\n function cancelEditing(confirm: boolean=true) {\r\n return new Promise((resolve, reject) => {\r\n if (confirm && formFieldsIsTouched(entryFields, true)){\r\n Modal.confirm({\r\n title: 'Cancel current changes',\r\n content: 'Are you sure you want to cancel your current changes?',\r\n onOk: () => {\r\n handleCancel();\r\n resolve();\r\n },\r\n onCancel: () => reject()\r\n })\r\n }\r\n else{\r\n handleCancel();\r\n resolve();\r\n }\r\n })\r\n }\r\n\r\n console.debug('hasMore', paginationHasMore);\r\n\r\n function loadMore(){\r\n let nextOffset = paginationOffset + paginationLimit;\r\n return queryResult.fetchMore({\r\n variables: {\r\n skip: nextOffset\r\n },\r\n updateQuery: (prev, { fetchMoreResult }) => {\r\n if (!fetchMoreResult) return prev;\r\n if (options.getQueryData(fetchMoreResult).length < 1){\r\n setPaginationOffset(nextOffset);\r\n setPaginationHasMore(false);\r\n }\r\n else\r\n {\r\n setPaginationOffset(nextOffset);\r\n setPaginationHasMore(true);\r\n }\r\n return options.updateQueryAfterFetchMore(prev, fetchMoreResult)\r\n }\r\n })\r\n }\r\n\r\n return {\r\n queryNetworkStatus: queryResult.networkStatus,\r\n entryFields,\r\n setEntryFields: (values: any) => {\r\n let newValues = values;\r\n if (options.lockFieldsToValue){\r\n newValues = {\r\n ...values,\r\n ...pickBy(options.lockFieldsToValue, identity)\r\n }\r\n }\r\n setEntryFields(createFormFields(newValues));\r\n },\r\n resetEntryFields: () => {\r\n setEntryFields(createFormFields(initEntryValues))\r\n },\r\n getEntryFieldValue: (fieldName: string) => getFormFieldValue(entryFields && entryFields[fieldName]),\r\n isEditing,\r\n // setIsEditing: (editing, isNew=false) => {\r\n // setIsEditing(editing);\r\n // setIsNewEntry(isNew);\r\n // },\r\n async editFromExisting(values, confirmUnsaved: boolean=true) {\r\n let finalValues = values;\r\n if (options.transformEditFromExisting){\r\n finalValues = await Promise.resolve(options.transformEditFromExisting(values));\r\n }\r\n if (options.lockFieldsToValue){\r\n finalValues = {\r\n ...finalValues,\r\n ...pickBy(options.lockFieldsToValue, identity)\r\n }\r\n }\r\n cancelEditing(confirmUnsaved).then(() => {\r\n setInitEntryValues(finalValues);\r\n setEntryFields(createFormFields(finalValues))\r\n setIsEditing(true);\r\n })\r\n .catch((err) => console.error(err))\r\n },\r\n editFromNew(defaultValues=undefined){\r\n return new Promise((resolve, reject) => {\r\n cancelEditing().then(() => {\r\n setInitEntryValues(null);\r\n setEntryFields({\r\n ...defaultValues,\r\n ...pickBy(options.lockFieldsToValue, identity)\r\n });\r\n options.onEditFromNew?.(defaultValues);\r\n setIsEditing(true);\r\n resolve();\r\n })\r\n .catch(() => {\r\n console.log('Changes preserved');\r\n reject();\r\n });\r\n })\r\n },\r\n cancelEditing,\r\n initEntryValues,\r\n loading,\r\n reloading,\r\n data,\r\n saving,\r\n saveError,\r\n save: handleSave,\r\n delete: handleDelete,\r\n deletePressed,\r\n deleting,\r\n deleteError,\r\n deletedData,\r\n savedData,\r\n queryError: queryResult.error,\r\n reload: () => {\r\n setPaginationOffset(0);\r\n setIsInitialQuery(true);\r\n queryResult.refetch()\r\n },\r\n getSearchValue: (key) => searchValues[key],\r\n searchValues,\r\n onSearchValueChange: (key, value, preserveCase=false) => {\r\n let finalValue = value;\r\n if (typeof value === 'string' && !preserveCase){\r\n finalValue = value.toUpperCase();\r\n }\r\n setSearchValues({ ...searchValues, [key]: finalValue });\r\n },\r\n clearSearchValues: () => setSearchValues({}),\r\n isNewEntry: isEditing && !initEntryValues ? true : false,\r\n deletingId: deleteId,\r\n pagination: {\r\n hasMore: paginationHasMore,\r\n offset: paginationOffset,\r\n loadMore: loadMore\r\n }\r\n }\r\n}\r\n\r\nexport default useMasterDataState\r\n\r\nexport function useMasterDataStateNoQueryHook(options: UseMasterDataStateOptionsNoQueryHook): UseMasterDataStateReturnNoQueryHookProps {\r\n // const [ searchValue, setSearchValue ] = useState(null);\r\n\r\n const queryResult = options.queryResult;\r\n\r\n const [ searchValues, setSearchValues ] = useState({});\r\n\r\n const [ initEntryValues, setInitEntryValues ] = useState(null);\r\n const [ entryFields, setEntryFields ] = useState(null);\r\n const [ isEditing, setIsEditing ] = useState(false);\r\n const [deletePressed, setDeletePressed] = useState(false);\r\n const [ handleSaveParams, setHandleSaveParams ] = useState({ values: null, getValues: null });\r\n\r\n const loading = isNSLoading(queryResult.networkStatus);\r\n const reloading = isNSReloading(queryResult.networkStatus);\r\n\r\n let data: Array = !loading && options.data ? options.data : [];\r\n if (!Array.isArray(data)){\r\n data = [];\r\n }\r\n\r\n useEffect(() => {\r\n if (options.saveMutationResult && !options.saveMutationResult.error && !options.saveMutationResult.loading && options.saveMutationResult.data){\r\n // Must be a successful save.\r\n afterSuccessfulSave();\r\n }\r\n // eslint-disable-next-line\r\n }, [options.saveMutationResult?.data, options.saveMutationResult?.loading, options.saveMutationResult?.error])\r\n\r\n function handleCancel(){\r\n setInitEntryValues(null);\r\n setEntryFields(null);\r\n setIsEditing(false);\r\n options.onCancel?.();\r\n }\r\n\r\n function editFromExisting(values, confirmUnsaved: boolean=true, cancelPrevious: boolean=true) {\r\n let finalValues = values;\r\n if (options.transformEditFromExisting){\r\n finalValues = options.transformEditFromExisting(values);\r\n }\r\n if (options.lockFieldsToValue){\r\n finalValues = {\r\n ...finalValues,\r\n ...pickBy(options.lockFieldsToValue, identity)\r\n }\r\n }\r\n if (initEntryValues && cancelPrevious){\r\n cancelEditing(confirmUnsaved).then(() => {\r\n setInitEntryValues(finalValues);\r\n setEntryFields(createFormFields(finalValues))\r\n setIsEditing(true);\r\n })\r\n .catch((err) => console.error(err))\r\n }\r\n else\r\n {\r\n setInitEntryValues(finalValues);\r\n setEntryFields(createFormFields(finalValues))\r\n setIsEditing(true);\r\n }\r\n }\r\n\r\n function handleSave(values: any, getValues?: (obj) => any){\r\n setDeletePressed(false);\r\n setHandleSaveParams({ values, getValues })\r\n return options.onSave && options.onSave(values);\r\n }\r\n\r\n function afterSuccessfulSave(){\r\n let values = handleSaveParams.values;\r\n let getValues = handleSaveParams.getValues;\r\n if (!initEntryValues){\r\n queryResult.refetch();\r\n }\r\n if (options.closeAfterSave !== undefined && options.closeAfterSave !== null ? options.closeAfterSave : true){\r\n handleCancel();\r\n }\r\n else\r\n {\r\n setInitEntryValues(null);\r\n setEntryFields(null);\r\n editFromExisting(getValues ? getValues(values) : values, false, false);\r\n }\r\n }\r\n\r\n function handleDelete(values: any){\r\n setDeletePressed(true);\r\n options.onDelete && options.onDelete(values)\r\n .then(() => {\r\n queryResult.refetch();\r\n handleCancel();\r\n })\r\n }\r\n\r\n function cancelEditing(confirm: boolean=true) {\r\n return new Promise((resolve, reject) => {\r\n if (confirm && formFieldsIsTouched(entryFields, true)){\r\n Modal.confirm({\r\n title: 'Cancel current changes',\r\n content: 'Are you sure you want to cancel your current changes?',\r\n onOk: () => {\r\n handleCancel();\r\n resolve();\r\n },\r\n onCancel: () => reject()\r\n })\r\n }\r\n else{\r\n handleCancel();\r\n resolve();\r\n }\r\n })\r\n }\r\n\r\n return {\r\n queryNetworkStatus: queryResult.networkStatus,\r\n entryFields,\r\n setEntryFields: (values: any) => {\r\n let newValues = values;\r\n if (options.lockFieldsToValue){\r\n newValues = {\r\n ...values,\r\n ...pickBy(options.lockFieldsToValue, identity)\r\n }\r\n }\r\n setEntryFields(createFormFields(newValues));\r\n },\r\n resetEntryFields: () => {\r\n setEntryFields(createFormFields(initEntryValues))\r\n },\r\n getEntryFieldValue: (fieldName: string) => getFormFieldValue(entryFields && entryFields[fieldName]),\r\n isEditing,\r\n // setIsEditing: (editing, isNew=false) => {\r\n // setIsEditing(editing);\r\n // setIsNewEntry(isNew);\r\n // },\r\n editFromExisting,\r\n editFromNew(defaultValues=undefined){\r\n return new Promise((resolve, reject) => {\r\n cancelEditing().then(() => {\r\n setInitEntryValues(null);\r\n let entryFields = {\r\n ...defaultValues,\r\n ...pickBy(options.lockFieldsToValue, identity)\r\n }\r\n setEntryFields(entryFields);\r\n setIsEditing(true);\r\n resolve();\r\n })\r\n .catch(() => {\r\n console.log('Changes preserved');\r\n reject();\r\n });\r\n })\r\n },\r\n cancelEditing,\r\n initEntryValues,\r\n loading,\r\n reloading,\r\n data,\r\n saving: options.saveMutationResult && options.saveMutationResult.loading,\r\n saveError: options.saveMutationResult && options.saveMutationResult.error,\r\n save: handleSave,\r\n delete: handleDelete,\r\n deletePressed,\r\n deleting: options.deleteMutationResult && options.deleteMutationResult.loading,\r\n deleteError: options.deleteMutationResult && options.deleteMutationResult.error,\r\n deletedData: options.deleteMutationResult && options.deleteMutationResult.data,\r\n savedData: options.saveMutationResult && options.saveMutationResult.data,\r\n queryError: queryResult.error,\r\n reload: () => {\r\n options.onReload && options.onReload();\r\n },\r\n getSearchValue: (key) => searchValues[key],\r\n searchValues,\r\n onSearchValueChange: (key, value, preserveCase=false) => {\r\n let finalValue = value;\r\n if (typeof value === 'string' && !preserveCase){\r\n finalValue = value.toUpperCase();\r\n }\r\n setSearchValues({ ...searchValues, [key]: finalValue });\r\n },\r\n clearSearchValues: () => setSearchValues({}),\r\n isNewEntry: isEditing && !initEntryValues ? true : false\r\n }\r\n}","import { Layout } from 'antd';\r\nimport Alert, { AlertProps } from 'antd/lib/alert';\r\nimport { LayoutProps } from 'antd/lib/layout';\r\nimport { ResultProps } from 'antd/lib/result';\r\nimport React, { ReactElement, useEffect, useState } from 'react';\r\nimport { MDDetailsProps } from './details';\r\nimport { MDHeaderProps } from './header';\r\nimport './layout.less';\r\nimport { MDTableProps } from './table';\r\nimport cn from 'classnames';\r\n\r\nexport interface MDLayoutProps extends LayoutProps {\r\n alertProps?: AlertProps,\r\n headerElement?: ReactElement | Array>,\r\n tableElement?: ReactElement | Array>,\r\n detailsElement?: ReactElement | Array>,\r\n noDataElement?: ReactElement | Array>,\r\n detailsVisible?: boolean,\r\n displayNoData?: boolean\r\n}\r\n\r\nconst MDLayout: React.FC = (props) => {\r\n const [ alertClosed, setAlertClosed ] = useState(false);\r\n useEffect(() => {\r\n if (alertClosed){\r\n setAlertClosed(false);\r\n }\r\n // eslint-disable-next-line\r\n }, [\r\n // eslint-disable-next-line\r\n props.alertProps && props.alertProps.message,\r\n // eslint-disable-next-line\r\n props.alertProps && props.alertProps.description,\r\n // eslint-disable-next-line\r\n props.alertProps && props.alertProps.type\r\n ])\r\n\r\n let bodyCls = cn({\r\n \"mc-masterdata-body\": true,\r\n \"mc-masterdata-body-details-open\": props.detailsVisible\r\n })\r\n\r\n return \r\n
\r\n {props.headerElement}\r\n {props.alertProps ? (\r\n setAlertClosed(true)} />\r\n ) : null}\r\n {!props.displayNoData && props.tableElement}\r\n {props.displayNoData && props.noDataElement}\r\n
\r\n {props.detailsVisible ? (\r\n
\r\n {props.detailsElement}\r\n
\r\n ) : null}\r\n
\r\n}\r\n\r\nexport default MDLayout","import React from 'react';\r\nimport { ResultProps } from 'antd/lib/result';\r\nimport { Result, Icon, Button } from 'antd';\r\n\r\nexport interface NoResultsProps extends Omit {\r\n onNewEntryButtonClicked?(): void\r\n}\r\n\r\nconst NoResults: React.FC = (props) => {\r\n return }\r\n title=\"Your search query returned no results\"\r\n extra={props.onNewEntryButtonClicked ? (\r\n \r\n ) : null\r\n }\r\n/>\r\n}\r\n\r\nexport default NoResults","import { IIndexedResizeCallback } from '@blueprintjs/table/lib/esm/interactions/resizable';\r\nimport {Dispatch, SetStateAction, useEffect, useState} from 'react';\r\n\r\nexport const DEFAULT_COL_WIDTH = 134;\r\n\r\nexport const ColWidths = {\r\n CHECKBOX: 40\r\n}\r\n\r\nexport function getColWidths(colCount: number, widths?: { [idx: number]: number }, defaultWidth: number=DEFAULT_COL_WIDTH): number[]{\r\n let colWidths = new Array(colCount);\r\n colWidths.fill(defaultWidth);\r\n\r\n function setWidth([ idx, width ]: [ string, number ]): void {\r\n colWidths[idx] = width;\r\n }\r\n\r\n if (widths){\r\n Object.entries(widths).forEach(setWidth);\r\n }\r\n return colWidths\r\n}\r\n\r\nexport type ColWidthsValues = [ Array, Dispatch>>, IIndexedResizeCallback ]\r\n\r\nexport function useColWidths(colCount: number, widths?: { [idx: number]: number }, defaultWidth: number=DEFAULT_COL_WIDTH): ColWidthsValues {\r\n const [ colWidths, setColWidths ] = useState>(getColWidths(colCount, widths, defaultWidth));\r\n\r\n useEffect(() => {\r\n setColWidths(getColWidths(colCount, colWidths, defaultWidth))\r\n console.log('default width changed: ' + defaultWidth);\r\n }, [ defaultWidth ]);\r\n\r\n const updateColWidth: IIndexedResizeCallback = (idx, size) => {\r\n setColWidths(colWidths.map((item, itemIdx) => {\r\n if (itemIdx !== idx) return item;\r\n return size\r\n }))\r\n }\r\n if (colWidths.length !== colCount){\r\n let newColWidths = getColWidths(colCount, widths, defaultWidth);\r\n setColWidths(newColWidths);\r\n return [ newColWidths, setColWidths, updateColWidth ]\r\n }\r\n return [ colWidths, setColWidths, updateColWidth ]\r\n}\r\n\r\nexport function getDisplayName(WrappedComponent) {\r\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\r\n}\r\n","import React, { ReactElement } from 'react';\r\nimport { Table, Column, ITableProps, Cell, IColumnProps, SelectionModes } from '@blueprintjs/table';\r\nimport { Tooltip, Divider, Popconfirm, Icon, Spin, Button } from 'antd';\r\nimport { ACTION_COL_WIDTH } from '.';\r\nimport { getColWidths, useColWidths, ColWidthsValues } from 'common/table';\r\nimport useUserGroups from 'hooks/useUserGroups';\r\nimport { ButtonProps } from 'antd/lib/button';\r\n\r\nconst DEFAULT_MD_DEL_USR_GRPS = ['flytsuite.master.all', 'flytsuite.master.delete'];\r\n\r\nexport interface ActionCellRendererOptions {\r\n deleting: boolean,\r\n handleDelete(idx: number): void,\r\n selected: boolean,\r\n handleEdit(idx: number): void\r\n idx: number\r\n}\r\n\r\nexport const ActionColumn: React.FC = (props) => {\r\n return \r\n}\r\n\r\nexport interface ActionCellProps {\r\n deleting?: boolean,\r\n\r\n /**\r\n * Whether or not the row being deleted is not this row (disables other delete buttons)\r\n */\r\n deletingOther?: boolean,\r\n handleDelete?(idx: number): void,\r\n selected?: boolean,\r\n handleEdit?(idx: number): void,\r\n handleCancelEdit?(idx: number): void,\r\n hideDelete?: boolean,\r\n deleteBtnProps?: ButtonProps,\r\n deleteDisabled?: boolean,\r\n idx: number\r\n}\r\n\r\nconst ActionBtnStyle: React.CSSProperties = {\r\n padding: 0,\r\n width: 'auto',\r\n height: 'auto',\r\n fontSize: '11px'\r\n}\r\n\r\nexport function renderActionCell(props: ActionCellProps){\r\n\r\n function renderDelete(){\r\n if (props.hideDelete) return null;\r\n if (props.deleteDisabled){\r\n return <>\r\n \r\n \r\n \r\n \r\n \r\n }\r\n return (\r\n <>\r\n \r\n {props.deleting ? (\r\n } />\r\n ) : (\r\n props.handleDelete && props.handleDelete(props.idx)}>\r\n \r\n \r\n )}\r\n \r\n \r\n \r\n )\r\n }\r\n\r\n return \r\n {renderDelete()}\r\n {!props.selected ? (\r\n \r\n \r\n \r\n )}\r\n \r\n}\r\n\r\nexport const ActionCell: React.FC = (props) => {\r\n return \r\n \r\n {props.deleting ? (\r\n } />\r\n ) : (\r\n props.handleDelete && props.handleDelete(props.idx)}>\r\n \r\n \r\n )}\r\n \r\n \r\n {!props.selected ? (\r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n \r\n )}\r\n \r\n}\r\n\r\nexport interface MDTableProps extends ITableProps {\r\n selectedRowIndex?: number,\r\n onEditRow?(idx: number): void,\r\n onEditCancel?(): void,\r\n hideDelete?: boolean,\r\n onDelete?: (idx: number) => void,\r\n deleteLoadingIdx?: number,\r\n colWidthsHookValues?: ColWidthsValues,\r\n deleteUserGroups?: string[]\r\n}\r\n\r\nconst MDTable: React.FC = React.forwardRef(({ children, ...props }, ref: React.LegacyRef
) => {\r\n const [ userGroups ] = useUserGroups();\r\n let delUserGroups = props.deleteUserGroups || DEFAULT_MD_DEL_USR_GRPS;\r\n\r\n delUserGroups = [ ...delUserGroups, ...DEFAULT_MD_DEL_USR_GRPS ];\r\n\r\n let userHasDeletePerm = false;\r\n for (const i in userGroups) {\r\n let group = userGroups[i];\r\n if (delUserGroups.includes(group)){\r\n userHasDeletePerm = true;\r\n break;\r\n }\r\n }\r\n\r\n let highlightedRow = props.selectedRowIndex;\r\n // @ts-ignore TODO: Remove this ts-ignore\r\n let childrenArray = React.Children.toArray>(children);\r\n childrenArray.unshift(\r\n {\r\n return renderActionCell({\r\n idx,\r\n selected: props.selectedRowIndex === idx,\r\n handleEdit: (idx) => {\r\n if (props.onEditRow) props.onEditRow(idx)\r\n // MDState.editFromExisting(data[idx]);\r\n // MDState.setIsEditing(true);\r\n // MDState.setEntryFields(data[idx]);\r\n },\r\n handleCancelEdit: () => {\r\n if (props.onEditCancel) props.onEditCancel()\r\n },\r\n hideDelete: props.hideDelete,\r\n handleDelete: (idx) => props.onDelete?.(idx),\r\n deleteDisabled: !userHasDeletePerm,\r\n deleting: props.deleteLoadingIdx === idx,\r\n deletingOther: props.deleteLoadingIdx && props.deleteLoadingIdx !== -1 && props.deleteLoadingIdx !== idx\r\n })\r\n }} />\r\n )\r\n let initialColWidths = [ACTION_COL_WIDTH]\r\n if (props.hideDelete){\r\n initialColWidths[0] = ACTION_COL_WIDTH - 40;\r\n }\r\n if (props.columnWidths){\r\n initialColWidths.push(...props.columnWidths)\r\n }\r\n else {\r\n initialColWidths.push(...getColWidths(React.Children.count(children)))\r\n }\r\n\r\n let [ colWidths, , updateColWidth ] = props.colWidthsHookValues ? \r\n props.colWidthsHookValues : \r\n // eslint-disable-next-line\r\n useColWidths(initialColWidths.length, initialColWidths);\r\n\r\n return {\r\n if (regions[0].cols[0] === 0) return;\r\n let selectedRow = regions[0].rows[0];\r\n if (selectedRow !== highlightedRow){\r\n if (props.onEditRow) props.onEditRow(selectedRow)\r\n }\r\n else {\r\n if (props.onEditCancel) props.onEditCancel()\r\n }\r\n }}\r\n columnWidths={colWidths}\r\n numFrozenColumns={1 + (props.numFrozenColumns || 0)}\r\n enableMultipleSelection={false}\r\n selectionModes={SelectionModes.ROWS_AND_CELLS}\r\n onColumnWidthChanged={updateColWidth}\r\n >\r\n {/* @ts-ignore TODO: Remove this ts-ignore */}\r\n {childrenArray}\r\n
\r\n})\r\n\r\nexport default MDTable","import React from 'react';\r\nimport { Spin, Icon } from 'antd';\r\n\r\nconst TableLoading: React.FC> = (props) => {\r\n return
\r\n } />\r\n
\r\n}\r\n\r\nexport default TableLoading","import React, { ReactElement } from 'react';\r\nimport { UseMasterDataStateReturnProps } from './hook';\r\nimport TableLoading from './TableLoading';\r\nimport { Spin, Icon } from 'antd';\r\n\r\nexport interface TableLoaderProps {\r\n mdState: UseMasterDataStateReturnProps,\r\n children?: ReactElement\r\n}\r\n\r\nconst TableLoader: React.FC = (props) => {\r\n const { mdState: MDState, children } = props;\r\n if (MDState.queryError){\r\n return null\r\n }\r\n if (MDState.loading){\r\n return \r\n }\r\n if (MDState.queryNetworkStatus === 2){\r\n return } >\r\n {children}\r\n \r\n }\r\n return children\r\n}\r\n\r\nexport default TableLoader","\r\nexport { default as MDDetails, getDetailsTitle } from './details';\r\nexport { default as DuplicationChecker } from './DuplicationChecker';\r\nexport { default as MDHeader } from './header';\r\nexport { default as useMasterDataState } from './hook';\r\nexport { default as MDLayout } from './layout';\r\nexport { default as NoResults } from './NoResults';\r\nexport { default as MDTable } from './table';\r\nexport { default as TableLoader } from './TableLoader';\r\nexport { default as TableLoading } from './TableLoading';\r\n\r\nexport const ACTION_COL_WIDTH = 75\r\nexport const DEFUALT_POLL_INTERVAL = undefined","import { FormComponentProps, FormCreateOption } from \"antd/lib/form\";\r\nimport { createFormFields, uppercaseFields } from \"common/form\";\r\nimport { useEffect } from \"react\";\r\n\r\nexport interface EntryFormProps extends Partial {\r\n formFields?: any,\r\n onFieldsChange?: (fields: any, allFields: any) => void,\r\n onValuesChange?: (changedValues: any, allValues: any) => void,\r\n uppercaseFields?: Array,\r\n dupeChecker?: JSX.Element,\r\n autoFocus?: boolean,\r\n isNewEntry?:boolean\r\n}\r\n\r\nexport function entryFormOptions(): FormCreateOption{\r\n return {\r\n mapPropsToFields(props){\r\n return createFormFields(props.formFields)\r\n },\r\n onFieldsChange(props, fields, allFields) {\r\n return props.onFieldsChange && props.onFieldsChange(uppercaseFields(fields, props.uppercaseFields), uppercaseFields(allFields, props.uppercaseFields));\r\n },\r\n onValuesChange(props, changedValues, allValues) {\r\n return props.onValuesChange && props.onValuesChange(uppercaseFields(changedValues, props.uppercaseFields), uppercaseFields(allValues, props.uppercaseFields));\r\n }\r\n }\r\n}\r\n\r\n// TODO: This function is problematic b/c it tends to not work at all and/or steals focus away while a user is typing in another field.\r\n// I have disabled it for now until we can either get it working properly or remove it entirely. - Austin\r\nexport function useAutoFocus(autoFocusProp: boolean, inputElement: HTMLInputElement){\r\n return;\r\n\r\n /*\r\n useEffect(() => {\r\n console.debug('autoFocusProp: ' + autoFocusProp + ' inputElement: ', inputElement)\r\n if (autoFocusProp && inputElement){\r\n console.debug('autofocusing element', inputElement);\r\n inputElement.focus();\r\n }\r\n }, [ autoFocusProp, inputElement ])\r\n */\r\n}","import { Form, Input, InputNumber } from 'antd';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\nimport { formItemLayout } from 'common/form';\r\nimport React, { forwardRef, LegacyRef, useRef } from 'react';\r\nimport { entryFormOptions, EntryFormProps, useAutoFocus } from '.';\r\n\r\nexport interface AircraftEntryFormProps extends EntryFormProps {\r\n\r\n}\r\n\r\nconst AircraftEntryForm: React.FC = forwardRef((props, ref: LegacyRef
) => {\r\n const inputRef = useRef(null);\r\n const { getFieldDecorator } = props.form;\r\n\r\n useAutoFocus(props.autoFocus, inputRef.current)\r\n\r\n return \r\n \r\n {getFieldDecorator('tailNum', {\r\n rules: [\r\n { required: true, message: 'Tail Num is required' }\r\n ]\r\n })()}\r\n \r\n \r\n {getFieldDecorator('model', {\r\n rules: [\r\n { required: true, message: 'Model is required' }\r\n ]\r\n })()}\r\n \r\n {props.dupeChecker}\r\n \r\n {getFieldDecorator('maxSeats', {\r\n initialValue: 0\r\n })()}\r\n \r\n \r\n {getFieldDecorator('maxLoad', {\r\n initialValue: 0\r\n })()}\r\n \r\n
\r\n})\r\n\r\nexport default Form.create(entryFormOptions())(AircraftEntryForm);","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nmutation DeleteEntity($_id: ID!, $_rev: ID, $tpID: ID!) {\r\n deleteEntity(_id: $_id, _rev: $_rev, tpID: $tpID)\r\n}\r\n`","import { Column } from '@blueprintjs/table';\r\nimport { Button, Divider, Input, List } from 'antd';\r\nimport BlueprintTableInfiniteScroller from 'components/BlueprintTableInfiniteScroller';\r\nimport WithOrgData, { WithOrgDataProps } from 'components/WithOrgData';\r\nimport gql from 'graphql-tag';\r\nimport React, { useRef } from 'react';\r\nimport { DuplicationChecker, MDDetails, MDHeader, MDLayout, MDTable, useMasterDataState } from '..';\r\nimport AircraftEntryForm from '../entryForms/aircraft';\r\nimport TableLoader from '../TableLoader';\r\nimport { getMDTableProps, MasterDataProps, MDStateToDetailsProps, MDStateToHeaderProps, MDStateToLayoutProps, MDStateToTableScrollerProps, renderCellFromKeyIndex, renderNoData, searchValuesToQuerySearchPayload, trimString } from '../util';\r\nimport DeleteEntity from 'Mutations/DeleteEntity';\r\n\r\n\r\n\r\nexport interface MDAircraftProps extends WithOrgDataProps, MasterDataProps {\r\n\r\n}\r\n\r\nconst QUERY = gql`\r\n query AircraftQuery($filter: [FilterByKeyValueInput!], $search: [FilterByKeyValueInput!], $limit: Int, $skip: Int) {\r\n MasterDataAircrafts(filter: $filter, search: $search, limit: $limit, skip: $skip) {\r\n docs {\r\n ... on Aircraft {\r\n _id\r\n _rev\r\n tailNum\r\n model\r\n maxSeats\r\n maxLoad\r\n }\r\n }\r\n }\r\n }\r\n`\r\n\r\nconst MUTATION = gql`\r\n mutation AircraftMutation(\r\n $_id: ID\r\n $tailNum: String!\r\n $model: String!\r\n $maxSeats: Int!\r\n $maxLoad: Int!\r\n $tpID: ID!\r\n ){\r\n setAircraft(\r\n _id: $_id\r\n tailNum: $tailNum\r\n model: $model\r\n maxSeats: $maxSeats\r\n maxLoad: $maxLoad\r\n tpID: $tpID\r\n ){\r\n _id\r\n _rev\r\n tailNum\r\n model\r\n maxSeats\r\n maxLoad\r\n tpID {\r\n _id\r\n name\r\n }\r\n }\r\n }\r\n`\r\n\r\nconst MDAircraft: React.FC = (props) => {\r\n\r\n const formRef = useRef(null);\r\n\r\n let tpID = props.orgData.getOrgIDByType('transporter');\r\n\r\n const MDState = useMasterDataState({\r\n getQueryData: (data: any) => data.MasterDataAircrafts.docs,\r\n getQueryVariables: (searchValues) => ({\r\n filter: [\r\n {\r\n key: 'tpID',\r\n value: JSON.stringify(tpID)\r\n }\r\n ],\r\n search: searchValuesToQuerySearchPayload(searchValues)\r\n }),\r\n queryGQL: QUERY,\r\n saveMutationGQL: MUTATION,\r\n deleteMutationGQL: DeleteEntity,\r\n tpID: tpID,\r\n paginationLimit: props.dataPaginationLimit,\r\n pollInterval: props.pollInterval,\r\n updateQueryAfterFetchMore: (prev, fetchMoreResult) => {\r\n return {\r\n ...prev,\r\n MasterDataAircrafts: {\r\n ...prev.MasterDataAircrafts,\r\n docs: [\r\n ...prev.MasterDataAircrafts.docs,\r\n ...fetchMoreResult.MasterDataAircrafts.docs\r\n ]\r\n }\r\n }\r\n }\r\n })\r\n\r\n // const [ save, { loading: saving, error: saveError, data: savedData } ] = useMutation(MUTATION, {\r\n // onCompleted: () => {\r\n // MDState.cancelEditing(false);\r\n // }\r\n // });\r\n\r\n const data = MDState.data;\r\n\r\n return {\r\n return MDState.editFromNew({\r\n tailNum: MDState.getSearchValue('tailNum'),\r\n model: MDState.getSearchValue('model')\r\n })\r\n })}\r\n headerElement={\r\n MDState.onSearchValueChange('tailNum', e.target.value)} placeholder=\"Search by Tail Number\"\r\n value={MDState.getSearchValue('tailNum')}\r\n style={{ width:'15rem' }}\r\n allowClear\r\n />\r\n MDState.onSearchValueChange('model', e.target.value)} placeholder=\"By Model\"\r\n value={MDState.getSearchValue('model')}\r\n style={{ width:'15rem' }}\r\n allowClear\r\n />\r\n \r\n }\r\n />}\r\n tableElement={\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n detailsElement={ {\r\n formRef.current.validateFieldsAndScroll((err, values) => {\r\n if (!err){\r\n MDState.save({\r\n ...values,\r\n tailNum: trimString(values.tailNum),\r\n model: trimString(values.model),\r\n maxSeats: values.maxSeats || 0,\r\n maxLoad: values.maxLoad || 0,\r\n _id: MDState.getEntryFieldValue('_id')\r\n })\r\n }\r\n })\r\n }}\r\n >\r\n MDState.setEntryFields(fields)}\r\n uppercaseFields={['tailNum', 'model']}\r\n autoFocus\r\n ref={formRef}\r\n dupeChecker={MDState.isNewEntry ? (\r\n data && data.MasterDataAircrafts && data.MasterDataAircrafts.docs}\r\n renderItems={(items) => {\r\n return \r\n {items.map((craft) =>\r\n \r\n {\r\n e.preventDefault();\r\n MDState.editFromExisting(craft, false)\r\n }}\r\n >\r\n Tail Num: {craft.tailNum}\r\n \r\n Model: {craft.model}\r\n \r\n \r\n )}\r\n \r\n }}\r\n query={QUERY}\r\n variables={{\r\n filter: [\r\n {\r\n key: 'tpID',\r\n value: JSON.stringify(props.orgData.getOrgIDByType('transporter'))\r\n }\r\n ],\r\n search: [\r\n {\r\n key: 'tailNum',\r\n value: JSON.stringify(trimString(MDState.getEntryFieldValue('tailNum')))\r\n }\r\n ]\r\n }}\r\n />\r\n ) : null\r\n }\r\n />\r\n \r\n }\r\n />\r\n}\r\n\r\nexport default WithOrgData(MDAircraft)","import { Checkbox, DatePicker, Form, Input } from 'antd';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\nimport { formItemLayout } from 'common/form';\r\nimport { LocationSelect } from 'components/form/select/LocationSelect';\r\nimport { OrganizationSelect } from 'components/form/select/OrganizationSelect';\r\nimport React, { forwardRef, LegacyRef, useRef } from 'react';\r\nimport { entryFormOptions, EntryFormProps, useAutoFocus } from '.';\r\n\r\nexport interface ContractEntryFormProps extends EntryFormProps {\r\n\r\n}\r\n\r\nconst ContractEntryForm: React.FC = forwardRef((props, ref: LegacyRef
) => {\r\n const nameInputRef = useRef(null);\r\n const { getFieldDecorator, getFieldValue } = props.form;\r\n\r\n useAutoFocus(props.autoFocus, nameInputRef.current)\r\n\r\n return \r\n \r\n {getFieldDecorator('name', {\r\n rules: [\r\n { required: true, message: 'Name is required' }\r\n ]\r\n })()}\r\n \r\n \r\n {getFieldDecorator('customerID', {\r\n rules: [\r\n { required: true, message: 'Customer is required' }\r\n ]\r\n })()}\r\n \r\n \r\n {getFieldDecorator('locationID')()}\r\n \r\n {props.dupeChecker}\r\n \r\n {getFieldDecorator('startDate', {\r\n rules: [\r\n { required: true, message: 'Start Date is required' }\r\n ]\r\n })()}\r\n \r\n \r\n {getFieldDecorator('doesntExpire', {\r\n valuePropName: 'checked',\r\n initialValue: false\r\n })()}\r\n \r\n {!getFieldValue('doesntExpire') ? (\r\n \r\n {getFieldDecorator('endDate', {\r\n rules: [\r\n { required: true, message: 'End Date is required' }\r\n ]\r\n })()}\r\n \r\n ) : null}\r\n \r\n {getFieldDecorator('active', {\r\n initialValue: true,\r\n valuePropName: 'checked'\r\n })()}\r\n \r\n
\r\n})\r\n\r\nexport default Form.create(entryFormOptions())(ContractEntryForm)","import { Cell, Column } from '@blueprintjs/table';\r\nimport { Button, Checkbox, Divider, Input, List, Tooltip, Typography } from 'antd';\r\nimport { getLabelInValue, getLabelInValueKey } from 'common/form';\r\nimport { safeGet } from 'common/util';\r\nimport BlueprintTableInfiniteScroller from 'components/BlueprintTableInfiniteScroller';\r\nimport { OrganizationSelect } from 'components/form/select/OrganizationSelect';\r\nimport gql from 'graphql-tag';\r\nimport moment from 'moment';\r\nimport DeleteEntity from 'Mutations/DeleteEntity';\r\nimport React, { useRef } from 'react';\r\nimport {\r\n DuplicationChecker, MDDetails, MDHeader, MDLayout, MDTable, TableLoader, useMasterDataState\r\n} from '..';\r\nimport WithOrgData, { WithOrgDataProps } from '../../WithOrgData';\r\nimport ContractEntryForm from '../entryForms/contract';\r\nimport {\r\n getMDTableProps, MasterDataProps, MDStateToDetailsProps, MDStateToHeaderProps, MDStateToLayoutProps, MDStateToTableScrollerProps, renderCellFromKeyIndex, renderNoData, searchValuesToQuerySearchPayload, trimString\r\n} from '../util';\r\n\r\n\r\n\r\n\r\nexport interface MDContractsProps extends WithOrgDataProps, MasterDataProps {\r\n startDateFormat?: string,\r\n endDateFormat?: string\r\n}\r\n\r\nconst QUERY = gql`\r\nquery ContractsQuery($currDate: AWSDate!, $filter: [FilterByKeyValueInput!], $search: [FilterByKeyValueInput!], $limit: Int, $skip: Int) {\r\n MasterDataContracts(currDate: $currDate, filter: $filter, search: $search, limit: $limit, skip: $skip) {\r\n docs {\r\n ... on Contract {\r\n _id\r\n _rev\r\n name\r\n customerID {\r\n _id\r\n name\r\n }\r\n startDate\r\n endDate\r\n locationID {\r\n _id\r\n name\r\n }\r\n active\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst MUTATION = gql`\r\n mutation ContractMutation(\r\n $_id: ID\r\n $name: String!\r\n $customerID: ID!\r\n $startDate: AWSDate!\r\n $endDate: AWSDate!\r\n $locationID: ID\r\n $active: Boolean!\r\n $tpID: ID!\r\n ){\r\n setContract(\r\n _id: $_id\r\n name: $name\r\n customerID: $customerID\r\n startDate: $startDate\r\n endDate: $endDate\r\n locationID: $locationID\r\n active: $active\r\n tpID: $tpID\r\n ){\r\n _id\r\n _rev\r\n name\r\n customerID {\r\n _id\r\n name\r\n }\r\n startDate\r\n endDate\r\n locationID {\r\n _id\r\n name\r\n }\r\n active\r\n }\r\n }\r\n`\r\n\r\nconst MDContract: React.FC = (props) => {\r\n const formRef = useRef(null);\r\n let tpID = props.orgData.getOrgIDByType('transporter');\r\n\r\n const MDState = useMasterDataState({\r\n getQueryData: (data: any) => data.MasterDataContracts.docs,\r\n getQueryVariables: (searchValues) => ({\r\n filter: [\r\n {\r\n key: 'tpID',\r\n value: JSON.stringify(tpID)\r\n }\r\n ],\r\n search: searchValuesToQuerySearchPayload(searchValues),\r\n currDate: moment().format('YYYY-MM-DD')\r\n }),\r\n queryGQL: QUERY,\r\n saveMutationGQL: MUTATION,\r\n deleteMutationGQL: DeleteEntity,\r\n tpID: tpID,\r\n paginationLimit: props.dataPaginationLimit,\r\n pollInterval: props.pollInterval,\r\n updateQueryAfterFetchMore: (prev, fetchMoreResult) => ({\r\n ...prev,\r\n MasterDataContracts: {\r\n ...prev.MasterDataContracts,\r\n docs: [\r\n ...prev.MasterDataContracts.docs,\r\n ...fetchMoreResult.MasterDataContracts.docs\r\n ]\r\n }\r\n }),\r\n transformEditFromExisting: (values) => {\r\n return {\r\n ...values,\r\n startDate: values.startDate && moment(values.startDate),\r\n endDate: values.endDate && moment(values.endDate),\r\n customerID: getLabelInValue(values.customerID, 'name'),\r\n locationID: getLabelInValue(values.locationID, 'name')\r\n }\r\n }\r\n })\r\n const data = MDState.data;\r\n return {\r\n return MDState.editFromNew({\r\n name: MDState.getSearchValue('name')\r\n })\r\n })}\r\n headerElement={\r\n MDState.onSearchValueChange('name', e.target.value)}\r\n placeholder=\"Search by name\"\r\n value={MDState.getSearchValue('name')}\r\n style={{ width: '15rem' }}\r\n allowClear\r\n />\r\n MDState.onSearchValueChange('customerID', value)}\r\n classTypes={['flytsuite.customer']}\r\n placeholder=\"Filter customer\"\r\n value={MDState.getSearchValue('customerID')}\r\n style={{ width: '15rem' }}\r\n labelInValue\r\n allowClear\r\n />\r\n \r\n MDState.onSearchValueChange('showGood', e.target.checked)}\r\n checked={MDState.getSearchValue('showGood')}\r\n >Show 'good' contracts\r\n \r\n }\r\n />}\r\n tableElement={\r\n \r\n \r\n \r\n {\r\n let record = data[idx];\r\n let customerName = record && record.customerID && record.customerID.name;\r\n return {customerName}\r\n }} />\r\n {\r\n let record = data[idx];\r\n return {moment(record.startDate).format('YYYY-MM-DD')}\r\n }} />\r\n {\r\n let record = data[idx];\r\n let content = [{moment(record.endDate).format('YYYY-MM-DD')}{` `}]\r\n if (moment().startOf('day').isAfter(moment(record.endDate).startOf('day'))){\r\n content.push((Expired))\r\n }\r\n else if (moment().startOf('day').isSame(moment(record.endDate).startOf('day'))){\r\n content.push((Expires TODAY))\r\n }\r\n else if (moment().add(1, 'month').isAfter(moment(record.endDate))){\r\n content.push((Expires in {moment(record.endDate).diff(moment().startOf('day'), 'days')} days))\r\n }\r\n return {content}\r\n }} />\r\n {\r\n let record = data[idx];\r\n let locationName = safeGet(['locationID', 'name'], record);\r\n return {locationName}\r\n }} />\r\n {\r\n let record = data[idx];\r\n let active = record && record.active;\r\n return {active ? 'Yes' : 'No'}\r\n }} />\r\n \r\n \r\n }\r\n detailsElement={ {\r\n formRef.current.validateFieldsAndScroll((err, values) => {\r\n if (!err){\r\n let saveData = {\r\n ...values,\r\n _id: MDState.getEntryFieldValue('_id'),\r\n name: trimString(values.name),\r\n startDate: values.startDate && moment(values.startDate).format(props.startDateFormat || 'YYYY-MM-DD'),\r\n endDate: values.endDate ? \r\n moment(values.endDate).endOf('day').format(props.endDateFormat || 'YYYY-MM-DD') :\r\n moment().add(100, 'years').format(props.endDateFormat || 'YYYY-MM-DD'),\r\n customerID: getLabelInValueKey(values.customerID),\r\n locationID: getLabelInValueKey(values.locationID),\r\n active: values.active ? true : false\r\n }\r\n MDState.save(saveData)\r\n }\r\n })\r\n }}\r\n >\r\n MDState.setEntryFields(fields)}\r\n uppercaseFields={['name']}\r\n autoFocus\r\n ref={formRef}\r\n dupeChecker={MDState.isNewEntry ? (\r\n data && data.MasterDataContracts && data.MasterDataContracts.docs}\r\n query={QUERY}\r\n variables={{\r\n filter: [\r\n {\r\n key: 'tpID',\r\n value: JSON.stringify(tpID)\r\n }\r\n ],\r\n search: [\r\n {\r\n key: 'name',\r\n value: JSON.stringify(trimString(MDState.getEntryFieldValue('name')))\r\n },\r\n {\r\n key: 'customerID',\r\n value: JSON.stringify(getLabelInValueKey(MDState.getEntryFieldValue('customerID')))\r\n },\r\n {\r\n key: 'locationID',\r\n value: JSON.stringify(getLabelInValueKey(MDState.getEntryFieldValue('locationID')))\r\n }\r\n ]\r\n }}\r\n renderItems={(items) => {\r\n return \r\n {items.map((contract, idx) => \r\n \r\n {\r\n e.preventDefault();\r\n MDState.editFromExisting(contract, false);\r\n }}\r\n >\r\n Name: {contract.name}\r\n \r\n Customer: {safeGet(['customerID', 'name'], contract)}\r\n \r\n Heliport: {safeGet(['locationID', 'name'], contract)}\r\n \r\n \r\n {contract && contract.startDate && moment(contract).format('YYYY-MM-DD')}\r\n - \r\n {contract && contract.endDate && moment(contract).format('YYYY-MM-DD')}\r\n \r\n \r\n )}\r\n \r\n }}\r\n />\r\n ) : null}\r\n >\r\n\r\n \r\n \r\n \r\n }\r\n />\r\n}\r\n\r\nexport default WithOrgData(MDContract)","import React from 'react';\r\nimport { TransferProps } from 'antd/lib/transfer';\r\nimport { Transfer } from 'antd';\r\nimport { useQuery } from 'react-apollo';\r\nimport { Spin } from 'antd';\r\nimport CountryCodeQuery from 'components/form/select/CountryCodeSelect/CountryCodeQuery';\r\n// import './style.less';\r\n\r\nconst CountryCheckTransfer: React.FC> = (props) => {\r\n\r\n const { data, loading } = useQuery(CountryCodeQuery, {\r\n onError: error => {console.error(error); throw Error(\"Failed to fetch countries\")}\r\n });\r\n\r\n if (loading) return \r\n const dataSource = data.getCountryCodes.countries.map(({ Name }) => ({\r\n key: Name,\r\n name: Name\r\n }))\r\n\r\n return option.name.toLowerCase().indexOf(inputValue.toLowerCase()) > -1}\r\n dataSource={dataSource}\r\n titles={['Available', 'Selected']}\r\n render={item => item.name}\r\n />\r\n}\r\n\r\nexport default CountryCheckTransfer","import React from 'react';\r\nimport Transfer, { TransferProps } from 'antd/lib/transfer';\r\nimport gql from 'graphql-tag';\r\nimport { useQuery } from 'react-apollo';\r\nimport { Spin } from 'antd';\r\n// import './style.less';\r\n\r\nconst ALL_LOCATIONS = gql`\r\nquery AllLocations {\r\n getLocations {\r\n _id\r\n name\r\n }\r\n}\r\n`\r\n\r\nconst SteelToeDestinationsTransfer: React.FC> = (props) => {\r\n\r\n const { data, loading } = useQuery(ALL_LOCATIONS, {\r\n onError: error => {console.error(error); throw Error(\"Failed to fetch locations\")}\r\n });\r\n\r\n if (loading) return \r\n const dataSource = data.getLocations.map(({ _id, name }) => ({\r\n key: _id,\r\n name\r\n }))\r\n\r\n return option.name.toLowerCase().indexOf(inputValue.toLowerCase()) > -1}\r\n dataSource={dataSource}\r\n titles={['Available', 'Selected']}\r\n render={item => item.name}\r\n />\r\n}\r\n\r\nexport default SteelToeDestinationsTransfer","import { AvailableNotifier } from \"common/types/available-notifier\"\r\nimport gql from \"graphql-tag\"\r\nimport { QueryHookOptions, useQuery } from \"react-apollo\"\r\n\r\ninterface ListAvailableNotifiersResp {\r\n availableNotifiers: AvailableNotifier[],\r\n availableNotifierCount: number\r\n}\r\n\r\ninterface ListAvailableNotifiersData {\r\n ListAvailableNotifiers: ListAvailableNotifiersResp\r\n}\r\n\r\nconst query = gql`\r\nquery ListAvailableNotifiers($filter: String){\r\n ListAvailableNotifiers(filter: $filter){\r\n availableNotifiers {\r\n notificationType,\r\n description,\r\n category,\r\n triggeringDataType\r\n }\r\n availableNotifierCount\r\n }\r\n}\r\n`\r\n\r\nexport interface ListAvailableNotifiersVariables {\r\n filter?: string\r\n}\r\n\r\nfunction useListAvailableNotifiers(\r\n queryOptions?: QueryHookOptions\r\n) {\r\n const { data, ...rest } = useQuery(query, {\r\n ...queryOptions,\r\n fetchPolicy: 'cache-and-network',\r\n errorPolicy: 'all'\r\n });\r\n\r\n let notifiers = data?.ListAvailableNotifiers;\r\n\r\n return {\r\n notifiers: notifiers,\r\n ...rest\r\n }\r\n}\r\n\r\nexport default useListAvailableNotifiers","import { OrgEmailListItem } from \"common/types/org-email-list\";\r\nimport emailValidator from 'email-validator';\r\n\r\nexport function validateOrgNotifEmailListEditor(_, value: OrgEmailListItem[], callback: Function) {\r\n\r\n let errors = [];\r\n\r\n if (!value) {\r\n callback();\r\n return;\r\n }\r\n\r\n for (let item of value) {\r\n if (item?.email && !emailValidator.validate(item?.email)) {\r\n errors.push(`'${item.email}' is not a valid email`);\r\n }\r\n\r\n if (item?.options) {\r\n validateOptIn(null, item.options, (msg) => msg && errors.push(msg));\r\n }\r\n }\r\n\r\n if (errors.length > 0) {\r\n callback(errors.join('\\n'));\r\n return false\r\n }\r\n callback();\r\n return true\r\n}\r\n\r\nexport function validateOptIn(_, value, callback) {\r\n if (value?.optInAll) { callback(); return; }\r\n if (!value?.optIn || (Array.isArray(value?.optIn) && value.optIn.length === 0)) { callback(\"You must choose at least one notification type.\") }\r\n else callback();\r\n}","import useListAvailableNotifiers from 'Queries/list-available-notifiers';\r\nimport { Button, Checkbox, Col, Collapse, Divider, Form, Icon, Input, List, Row, Select, Typography } from 'antd';\r\nimport { ButtonProps } from 'antd/lib/button';\r\nimport { FormComponentProps, WrappedFormUtils } from 'antd/lib/form/Form';\r\nimport { ListProps } from 'antd/lib/list';\r\nimport { SelectProps } from 'antd/lib/select';\r\nimport { createFormField, createFormFields, validateEmail } from 'common/form';\r\nimport { OrgEmailListItem, OrgEmailListItemOptions } from 'common/types/org-email-list';\r\nimport useControlledState from 'hooks/useControlledState';\r\nimport React, { CSSProperties, useState } from 'react';\r\nimport { validateOptIn } from './validator';\r\nimport { CollapseProps } from 'antd/lib/collapse';\r\n\r\nexport interface OrgNotifSelectProps {\r\n onFilterChange?: (filter: string) => void,\r\n filter?: string,\r\n onChange?: (value: OrgEmailListItemOptions) => void,\r\n value?: OrgEmailListItemOptions,\r\n style?: CSSProperties\r\n}\r\n\r\nconst OrgNotifSelect: React.FC = (props) => {\r\n const [ filter, setFilter ] = useControlledState(null, props.filter, props.onFilterChange);\r\n const [ value, setValue ] = useControlledState(null, props.value, props.onChange);\r\n\r\n const { notifiers, loading, error } = useListAvailableNotifiers();\r\n \r\n let errorMsg = error ? (\r\n Failed to load options\r\n ) : null\r\n\r\n function handleChange(v: string[]){\r\n setValue({ optInAll: false, optIn: v });\r\n }\r\n \r\n let cols = [\r\n \r\n setValue({ ...value, optInAll: e.target.checked })}\r\n style={{ marginRight: '6px' }}\r\n >Opt-In All\r\n \r\n ];\r\n \r\n if (!value.optInAll)\r\n cols.push(\r\n \r\n \r\n loading={notifiers?.availableNotifiers ? false : loading}\r\n notFoundContent={errorMsg}\r\n onSearch={(value) => setFilter(value)}\r\n filterOption={val => filter ? true : String(val).includes(String(filter))}\r\n mode='multiple'\r\n value={value.optIn}\r\n onChange={handleChange}\r\n placeholder=\"Choose notification types\"\r\n style={props.style}\r\n dropdownRender={menu => (\r\n
\r\n {menu}\r\n \r\n {value.optIn.length < notifiers?.availableNotifiers?.length && ( \r\n e.preventDefault()}\r\n onClick={() => handleChange(notifiers?.availableNotifiers?.map(n => n.notificationType))}\r\n >\r\n Add All\r\n \r\n )}\r\n {value.optIn.length > 0 && (\r\n e.preventDefault()}\r\n onClick={() => handleChange([])}\r\n >\r\n Remove All\r\n \r\n )}\r\n
\r\n )}\r\n >\r\n {notifiers?.availableNotifiers?.map(n => (\r\n {n.description}\r\n ))}\r\n \r\n \r\n )\r\n \r\n return {cols}\r\n}\r\n\r\nexport interface OrgNotifEmailListEditorProps {\r\n value?: OrgEmailListItem[],\r\n onChange?: (value: OrgEmailListItem[]) => void,\r\n listProps?: ListProps,\r\n addEmailButtonProps?: ButtonProps,\r\n form?: WrappedFormUtils,\r\n onFormChange?: (fields: any, allFields: any) => void,\r\n formFields?: any,\r\n style?: React.CSSProperties,\r\n collapseProps?: CollapseProps\r\n}\r\n\r\nconst OrgNotifEmailListEditor_Internal: React.FC = (props) => {\r\n\r\n const [ emailList, setEmailList ] = useControlledState([], props.value, props.onChange);\r\n const [ openPanels, setOpenPanels ] = useState(new Set());\r\n\r\n function updateEmailItem(index: number, item: OrgEmailListItem){\r\n\r\n let emailListCopy = [...emailList];\r\n emailListCopy[index] = item;\r\n \r\n setEmailList(emailListCopy);\r\n }\r\n\r\n function addBlankEmailItem(){\r\n let newItem = {\r\n email: '',\r\n options: {\r\n optIn: [],\r\n optInAll: false\r\n }\r\n }\r\n setEmailList([...emailList, newItem]);\r\n let newSet = new Set(openPanels);\r\n newSet.add(emailList.length.toString());\r\n setOpenPanels(newSet);\r\n }\r\n\r\n function removeEmailItem(index: number){\r\n let emailListCopy = [...emailList];\r\n emailListCopy.splice(index, 1);\r\n setEmailList(emailListCopy);\r\n\r\n let newSet = new Set(openPanels);\r\n newSet.delete((emailList.length-1).toString());\r\n setOpenPanels(newSet);\r\n }\r\n\r\n let rows = emailList.map((item, i) => {\r\n \r\n return \r\n \r\n {props.form.getFieldDecorator(i.toString() + '-email', {\r\n rules: [{ validator: validateEmail }],\r\n initialValue: item.email\r\n })(\r\n updateEmailItem(i, { ...item, email: e.target.value })}\r\n placeholder='Enter email address'\r\n style={{ display: 'block', flex: 1, width: '100%' }}\r\n onClick={(e) => e.stopPropagation()}\r\n />\r\n )}\r\n \r\n {item.options.optInAll ? 'All ' : item.options.optIn.length} triggers\r\n {e.stopPropagation(); removeEmailItem(i) }}\r\n style={{ marginLeft: 'auto' }}\r\n />\r\n \r\n }>\r\n
\r\n \r\n \r\n {props.form.getFieldDecorator(i.toString() + '-options', {\r\n rules: [{ validator: validateOptIn }],\r\n initialValue: item.options\r\n })(\r\n {\r\n let options: OrgEmailListItemOptions = {\r\n optInAll: false,\r\n optIn: [],\r\n ...value\r\n }\r\n updateEmailItem(i, {\r\n ...item,\r\n options: options\r\n })\r\n }}\r\n />\r\n )}\r\n \r\n
\r\n
;\r\n })\r\n\r\n return
\r\n Add Email\r\n {rows.length ? (\r\n {\r\n let newSet = new Set(keys);\r\n setOpenPanels(newSet);\r\n }}\r\n {...props.collapseProps}\r\n style={{\r\n marginTop: '12px',\r\n ...props.collapseProps?.style\r\n }}\r\n >\r\n {[...rows].reverse()}\r\n \r\n ) : null}\r\n
\r\n}\r\n\r\nconst OrgNotifEmailListEditor = Form.create({\r\n onFieldsChange(props, fields, allFields){\r\n props.onFormChange?.(fields, allFields);\r\n },\r\n mapPropsToFields(props){\r\n return createFormFields(props.formFields)\r\n }\r\n})(OrgNotifEmailListEditor_Internal)\r\n\r\nOrgNotifEmailListEditor.displayName = 'OrgNotifEmailListEditor'\r\n\r\nexport default OrgNotifEmailListEditor;","import OrgNotifEmailListEditor from \"./org-notif-email-list-editor\";\r\nexport { validateOrgNotifEmailListEditor } from './validator';\r\nexport default OrgNotifEmailListEditor;","import { Checkbox, Col, Form, Input, InputNumber, Row } from 'antd';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\nimport CountryCheckTransfer from 'components/transfer/CountryCheckTransfer';\r\nimport SteelToeDestinationsTransfer from 'components/transfer/SteelToeDestinationsTransfer';\r\nimport React, { forwardRef, LegacyRef, useRef } from 'react';\r\nimport { entryFormOptions, EntryFormProps, useAutoFocus } from '.';\r\nimport OrgNotifEmailListEditor, { validateOrgNotifEmailListEditor } from 'components/org-notif-email-list-editor';\r\nimport useUserGroups from 'hooks/useUserGroups';\r\n\r\nexport interface CustomerEntryFormProps extends EntryFormProps {\r\n\r\n}\r\n\r\nconst CustomerEntryForm: React.FC = forwardRef((props, ref: LegacyRef
) => {\r\n const [ userGroups ] = useUserGroups();\r\n\r\n const nameInputRef = useRef(null);\r\n const ebsAirCanisterRequiredCheckBoxRef = useRef(null);\r\n const extraBroadCheckRequiredCheckBoxRef = useRef(null);\r\n const illnessCheckRequiredCheckBoxRef = useRef(null);\r\n const quarantinedCheckRequiredCheckBoxRef = useRef(null);\r\n const quarantineTravelPeriodInputRef = useRef(null);\r\n const askHaveYouBeenVaccinatedQuestionCheckBoxRef = useRef(null);\r\n const { getFieldDecorator, getFieldValue } = props.form;\r\n\r\n useAutoFocus(props.autoFocus, nameInputRef.current);\r\n\r\n return \r\n \r\n {getFieldDecorator('name', {\r\n rules: [\r\n { required: true, message: 'Name is required' }\r\n ]\r\n })()}\r\n \r\n {userGroups.includes('dataflyt.superuser') ?\r\n \r\n {getFieldDecorator('notificationEmailList', {\r\n rules: [{\r\n validator: validateOrgNotifEmailListEditor\r\n }]\r\n })\r\n ()}\r\n \r\n : null}\r\n {props.dupeChecker}\r\n \r\n \r\n \r\n {getFieldDecorator('ebsAirCanisterRequired')(EBS Air Canister Required)}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('illnessCheckRequired')(Illness Check Required)}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('askHaveYouBeenVaccinatedQuestion')(Vaccine Check Required)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {getFieldDecorator('extraBroadCheckRequired')(Extra Broad Check Required)}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('quarantinedCheckRequired')(Quarantine Check Required)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {getFieldDecorator('quarantineTravelPeriod', {\r\n initialValue: 14\r\n })()}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('quarantinedCountries', {\r\n valuePropName: 'targetKeys'\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('steelToeIDDestinations', {\r\n valuePropName: 'targetKeys'\r\n })(\r\n \r\n )}\r\n \r\n
\r\n})\r\n\r\nexport default Form.create(entryFormOptions())(CustomerEntryForm)","import React, { useRef } from 'react';\r\nimport WithOrgData, { WithOrgDataProps } from 'components/WithOrgData';\r\nimport { MasterDataProps, searchValuesToQuerySearchPayload, MDStateToLayoutProps, renderNoData, MDStateToHeaderProps, MDStateToTableScrollerProps, getMDTableProps, renderCellFromKeyIndex, MDStateToDetailsProps, trimString } from '../util';\r\nimport gql from 'graphql-tag';\r\nimport { useMasterDataState, MDLayout, MDHeader, TableLoader, MDTable, MDDetails, DuplicationChecker } from '..';\r\nimport BlueprintTableInfiniteScroller from 'components/BlueprintTableInfiniteScroller';\r\nimport { Column, Cell } from '@blueprintjs/table';\r\nimport { getColWidths } from 'common/table';\r\nimport { List, Tooltip, Icon, Button } from 'antd';\r\nimport CustomerEntryForm from '../entryForms/customer';\r\nimport DeleteEntity from 'Mutations/DeleteEntity';\r\nimport { OrgEmailListItem } from 'common/types/org-email-list';\r\nimport { removeTypename } from 'common/util';\r\n\r\nexport interface MDCustomerProps extends WithOrgDataProps, MasterDataProps {\r\n\r\n}\r\n\r\nconst QUERY = gql`\r\nquery CustomersQuery($filter: [FilterByKeyValueInput!], $search: [FilterByKeyValueInput!], $limit: Int, $skip: Int) {\r\n MasterDataCustomers(filter: $filter, search: $search, limit: $limit, skip: $skip) {\r\n docs {\r\n ... on Customer {\r\n _id\r\n _rev\r\n name\r\n extraBroadCheckRequired\r\n ebsAirCanisterRequired\r\n illnessCheckRequired\r\n quarantinedCheckRequired\r\n quarantineTravelPeriod\r\n quarantinedCountries\r\n askHaveYouBeenVaccinatedQuestion\r\n notificationEmailList {\r\n email\r\n options {\r\n optInAll\r\n optIn\r\n }\r\n }\r\n steelToeIDDestinations {\r\n _id\r\n name\r\n }\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst MUTATION = gql`\r\nmutation CustomerMutation(\r\n $_id: ID\r\n $name: String!\r\n $steelToeIDDestinations: [ID!]!\r\n $tpID: ID!\r\n $ebsAirCanisterRequired: Boolean\r\n $extraBroadCheckRequired: Boolean\r\n $illnessCheckRequired: Boolean\r\n $quarantinedCheckRequired: Boolean\r\n $quarantineTravelPeriod: Int\r\n $askHaveYouBeenVaccinatedQuestion: Boolean\r\n $quarantinedCountries: [String]\r\n $notificationEmailList: [OrgEmailListItemInput!]\r\n ){\r\n setCustomer(\r\n _id: $_id\r\n name: $name\r\n steelToeIDDestinations: $steelToeIDDestinations\r\n tpID: $tpID\r\n extraBroadCheckRequired: $extraBroadCheckRequired\r\n ebsAirCanisterRequired: $ebsAirCanisterRequired\r\n illnessCheckRequired: $illnessCheckRequired\r\n quarantinedCheckRequired: $quarantinedCheckRequired\r\n quarantineTravelPeriod: $quarantineTravelPeriod\r\n quarantinedCountries :$quarantinedCountries\r\n askHaveYouBeenVaccinatedQuestion: $askHaveYouBeenVaccinatedQuestion\r\n notificationEmailList: $notificationEmailList\r\n ){\r\n _id\r\n _rev\r\n name\r\n extraBroadCheckRequired\r\n ebsAirCanisterRequired\r\n illnessCheckRequired\r\n quarantinedCheckRequired\r\n quarantineTravelPeriod\r\n quarantinedCountries\r\n askHaveYouBeenVaccinatedQuestion\r\n steelToeIDDestinations {\r\n _id\r\n name\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst MDCustomer: React.FC = (props) => {\r\n const formRef = useRef(null);\r\n let tpID = props.orgData.getOrgIDByType('transporter');\r\n\r\n const MDState = useMasterDataState({\r\n getQueryData: data => data.MasterDataCustomers.docs,\r\n getQueryVariables: (searchValues) => ({\r\n search: searchValuesToQuerySearchPayload(searchValues)\r\n }),\r\n queryGQL: QUERY,\r\n saveMutationGQL: MUTATION,\r\n deleteMutationGQL: DeleteEntity,\r\n tpID,\r\n paginationLimit: props.dataPaginationLimit,\r\n pollInterval: props.pollInterval,\r\n updateQueryAfterFetchMore: (prev, fetchMoreResult) => ({\r\n ...prev,\r\n MasterDataCustomers: {\r\n ...prev.MasterDataCustomers,\r\n docs: [\r\n ...prev.MasterDataCustomers.docs,\r\n ...fetchMoreResult.MasterDataCustomers.docs\r\n ]\r\n }\r\n }),\r\n transformEditFromExisting: (values) => {\r\n return {\r\n ...values,\r\n steelToeIDDestinations: values.steelToeIDDestinations && values.steelToeIDDestinations.map((item) => item && item._id).filter(id => id)\r\n }\r\n }\r\n })\r\n\r\n const data = MDState.data;\r\n\r\n return {\r\n return MDState.editFromNew({\r\n name: MDState.getSearchValue('name')\r\n })\r\n })}\r\n headerElement={ MDState.onSearchValueChange('name', e.target.value),\r\n placeholder: 'Search by name',\r\n value: MDState.getSearchValue('name'),\r\n style: { width: '30rem' },\r\n allowClear: true\r\n }}\r\n />}\r\n tableElement={\r\n \r\n \r\n \r\n {\r\n let record = data[idx];\r\n let destinations = record.steelToeIDDestinations;\r\n return \r\n {destinations.map((item: any, idx: number) => {\r\n let text = item && item.name;\r\n if (!item){\r\n text = \r\n Deleted\r\n \r\n }\r\n return {text}{idx !== destinations.length - 1 ? ', ' : null}\r\n })}\r\n \r\n }} />\r\n \r\n \r\n }\r\n detailsElement={ {\r\n formRef.current.validateFieldsAndScroll((err, values) => {\r\n if (!err){\r\n\r\n let notificationEmailList: OrgEmailListItem[] = values.notificationEmailList;\r\n\r\n if (notificationEmailList){\r\n // Clean any entries that have blank email fields\r\n notificationEmailList = notificationEmailList.filter(item => item.email);\r\n notificationEmailList = removeTypename(notificationEmailList);\r\n }\r\n\r\n let saveData = {\r\n ...values,\r\n name: trimString(values.name),\r\n steelToeIDDestinations: values.steelToeIDDestinations || [],\r\n quarantinedCountries: values.quarantinedCountries || [],\r\n _id: MDState.getEntryFieldValue('_id'),\r\n ebsAirCanisterRequired: values.ebsAirCanisterRequired || false,\r\n extraBroadCheckRequired: values.extraBroadCheckRequired || false,\r\n illnessCheckRequired: values.illnessCheckRequired || false,\r\n quarantinedCheckRequired: values.quarantinedCheckRequired || false,\r\n askHaveYouBeenVaccinatedQuestion: values.askHaveYouBeenVaccinatedQuestion || false,\r\n quarantineTravelPeriod: values.quarantineTravelPeriod || 14,\r\n notificationEmailList: notificationEmailList\r\n }\r\n MDState.save(saveData)\r\n }\r\n })\r\n }}\r\n >\r\n MDState.setEntryFields(fields)}\r\n uppercaseFields={['name']}\r\n autoFocus\r\n ref={formRef}\r\n dupeChecker={MDState.isNewEntry ? (\r\n data && data.MasterDataCustomers && data.MasterDataCustomers.docs}\r\n query={QUERY}\r\n variables={{\r\n search: [\r\n {\r\n key: 'name',\r\n value: JSON.stringify(trimString(MDState.getEntryFieldValue('name')))\r\n }\r\n ]\r\n }}\r\n renderItems={(items) => {\r\n return \r\n {items.map((customer, idx) => \r\n \r\n {\r\n e.preventDefault();\r\n MDState.editFromExisting(customer, false);\r\n }}\r\n >\r\n {customer.name}\r\n \r\n )}\r\n \r\n }}\r\n />\r\n ) : null}\r\n />\r\n \r\n }\r\n />\r\n}\r\n\r\nexport default WithOrgData(MDCustomer)","import React, { useRef, forwardRef, LegacyRef } from 'react';\r\nimport { EntryFormProps, entryFormOptions, useAutoFocus } from '.';\r\nimport { Form, Input } from 'antd';\r\nimport { formItemLayout } from 'common/form';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\nimport OrgNotifEmailListEditor, { validateOrgNotifEmailListEditor } from 'components/org-notif-email-list-editor';\r\nimport useUserGroups from 'hooks/useUserGroups';\r\n\r\nexport interface EmployerEntryFormProps extends EntryFormProps {\r\n\r\n}\r\n\r\nconst EmployerEntryForm: React.FC = forwardRef((props, ref: LegacyRef
) => {\r\n const [ userGroups ] = useUserGroups();\r\n const nameInputRef = useRef(null);\r\n const { getFieldDecorator } = props.form;\r\n useAutoFocus(props.autoFocus, nameInputRef.current);\r\n \r\n return \r\n \r\n {getFieldDecorator('name', {\r\n rules: [ { required: true, message: 'Name is required' } ]\r\n })()}\r\n \r\n {userGroups.findIndex(g =>\r\n g === 'flytsuite.management.emailtriggers.all' ||\r\n g === 'flytsuite.management.all' ||\r\n g === 'flytsuite.master.all'\r\n ) > -1 ?\r\n \r\n {getFieldDecorator('notificationEmailList', {\r\n rules: [{\r\n validator: validateOrgNotifEmailListEditor\r\n }]\r\n })\r\n ()}\r\n \r\n : null}\r\n {props.dupeChecker}\r\n
\r\n})\r\n\r\nexport default Form.create(entryFormOptions())(EmployerEntryForm)","import React, { useRef } from 'react';\r\nimport WithOrgData, { WithOrgDataProps } from 'components/WithOrgData';\r\nimport { MDLayout, MDHeader, useMasterDataState, TableLoader, MDTable, MDDetails, DuplicationChecker } from '..';\r\nimport { searchValuesToQuerySearchPayload, MDStateToLayoutProps, MDStateToHeaderProps, renderNoData, MDStateToTableScrollerProps, getMDTableProps, renderCellFromKeyIndex, MDStateToDetailsProps, trimString, MasterDataProps } from '../util';\r\nimport gql from 'graphql-tag';\r\nimport BlueprintTableInfiniteScroller from 'components/BlueprintTableInfiniteScroller';\r\nimport { Column } from '@blueprintjs/table';\r\nimport { getColWidths } from 'common/table';\r\nimport EmployerEntryForm from '../entryForms/employer';\r\nimport { removeTypename, safeGet } from 'common/util';\r\nimport { List } from 'antd';\r\nimport DeleteEntity from 'Mutations/DeleteEntity';\r\nimport { Button } from 'antd';\r\nimport { OrgEmailListItem } from 'common/types/org-email-list';\r\n\r\nexport interface MDEmployerProps extends WithOrgDataProps, MasterDataProps {\r\n\r\n}\r\n\r\nconst QUERY = gql`\r\nquery EmployersQuery($filter: [FilterByKeyValueInput!], $search: [FilterByKeyValueInput!], $limit: Int, $skip: Int) {\r\n MasterDataEmployers(filter: $filter, search: $search, limit: $limit, skip: $skip) {\r\n docs {\r\n ... on Employer {\r\n _id\r\n _rev\r\n name\r\n notificationEmailList {\r\n email\r\n options {\r\n optInAll\r\n optIn\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst MUTATION = gql`\r\nmutation EmployerMutation(\r\n $tpID: ID!\r\n $payload: EmployerInput!\r\n ){\r\n setEmployer(\r\n tpID: $tpID\r\n payload: $payload\r\n ){\r\n _id\r\n name\r\n }\r\n}\r\n`\r\n\r\nconst DELETE_USER_GROUPS = ['flytsuite.master.employer.delete'];\r\nconst EDIT_USER_GROUPS = ['flytsuite.master.employer.edit'];\r\n\r\nconst MDEmployer: React.FC = (props) => {\r\n\r\n const formRef = useRef(null);\r\n let tpID = props.orgData.getOrgIDByType('transporter');\r\n\r\n const MDState = useMasterDataState({\r\n getQueryData: data => data.MasterDataEmployers.docs,\r\n getQueryVariables: (searchValues) => ({\r\n search: searchValuesToQuerySearchPayload(searchValues)\r\n }),\r\n queryGQL: QUERY,\r\n saveMutationGQL: MUTATION,\r\n deleteMutationGQL: DeleteEntity,\r\n tpID,\r\n paginationLimit: props.dataPaginationLimit,\r\n pollInterval: props.pollInterval,\r\n updateQueryAfterFetchMore: (prev, fetchMoreResult) => ({\r\n ...prev,\r\n MasterDataEmployers: {\r\n ...prev.MasterDataEmployers,\r\n docs: [\r\n ...prev.MasterDataEmployers.docs,\r\n ...fetchMoreResult.MasterDataEmployers.docs\r\n ]\r\n }\r\n })\r\n })\r\n\r\n const data = MDState.data;\r\n\r\n return {\r\n return MDState.editFromNew({\r\n name: MDState.getSearchValue('name')\r\n })\r\n })}\r\n headerElement={\r\n MDState.onSearchValueChange('name', e.target.value),\r\n placeholder: 'Search by name',\r\n value: MDState.getSearchValue('name'),\r\n style: { width: '30rem' },\r\n allowClear: true\r\n }}\r\n />\r\n }\r\n tableElement={\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n detailsElement={\r\n {\r\n formRef.current.validateFieldsAndScroll((err, values) => {\r\n if (!err){\r\n let notificationEmailList: OrgEmailListItem[] = values.notificationEmailList;\r\n\r\n if (notificationEmailList){\r\n // Clean any entries that have blank email fields\r\n notificationEmailList = notificationEmailList.filter(item => item.email);\r\n notificationEmailList = removeTypename(notificationEmailList);\r\n }\r\n\r\n let saveData = {\r\n payload: {\r\n ...values,\r\n name: trimString(values.name),\r\n _id: MDState.getEntryFieldValue('_id'),\r\n notificationEmailList: notificationEmailList\r\n }\r\n }\r\n MDState.save(saveData)\r\n }\r\n })\r\n }}\r\n deleteUserGroups={DELETE_USER_GROUPS}\r\n editUserGroups={EDIT_USER_GROUPS}\r\n >\r\n MDState.setEntryFields(fields)}\r\n uppercaseFields={['name']}\r\n autoFocus\r\n ref={formRef}\r\n dupeChecker={MDState.isNewEntry ? (\r\n safeGet(['MasterDataEmployers', 'docs'], data)}\r\n query={QUERY}\r\n variables={{\r\n search: [\r\n {\r\n key: 'name',\r\n value: JSON.stringify(trimString(MDState.getEntryFieldValue('name')))\r\n }\r\n ]\r\n }}\r\n renderItems={(items) => {\r\n return \r\n {items.map((employer, idx) => \r\n \r\n {\r\n e.preventDefault();\r\n MDState.editFromExisting(employer, false);\r\n }}\r\n >\r\n {employer.name}\r\n \r\n )}\r\n \r\n }}\r\n />\r\n ) : null}\r\n />\r\n \r\n \r\n }\r\n />\r\n}\r\n\r\nexport default WithOrgData(MDEmployer)","import React, { useRef, forwardRef, LegacyRef } from 'react';\r\nimport { EntryFormProps, entryFormOptions, useAutoFocus } from '.';\r\nimport { Form, Input } from 'antd';\r\nimport { formItemLayout } from 'common/form';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\n\r\nexport interface VesselEntryFormProps extends EntryFormProps {\r\n\r\n}\r\n\r\nconst VesselEntryForm: React.FC = forwardRef((props, ref: LegacyRef
) => {\r\n const nameInputRef = useRef(null);\r\n const { getFieldDecorator } = props.form;\r\n useAutoFocus(props.autoFocus, nameInputRef.current);\r\n \r\n return \r\n \r\n {getFieldDecorator('name', {\r\n rules: [ { required: true, message: 'Name is required' } ]\r\n })()}\r\n \r\n {props.dupeChecker}\r\n
\r\n})\r\n\r\nexport default Form.create(entryFormOptions())(VesselEntryForm)","import { Column } from '@blueprintjs/table';\r\nimport { Button, Divider, Input, List } from 'antd';\r\nimport BlueprintTableInfiniteScroller from 'components/BlueprintTableInfiniteScroller';\r\nimport WithOrgData, { WithOrgDataProps } from 'components/WithOrgData';\r\nimport gql from 'graphql-tag';\r\nimport React, { useRef } from 'react';\r\nimport { DuplicationChecker, MDDetails, MDHeader, MDLayout, MDTable, useMasterDataState } from '..';\r\nimport VesselEntryForm from '../entryForms/vessel';\r\nimport TableLoader from '../TableLoader';\r\nimport { getMDTableProps, MasterDataProps, MDStateToDetailsProps, MDStateToHeaderProps, MDStateToLayoutProps, MDStateToTableScrollerProps, renderCellFromKeyIndex, renderNoData, searchValuesToQuerySearchPayload, trimString } from '../util';\r\nimport DeleteEntity from 'Mutations/DeleteEntity';\r\n\r\n\r\n\r\nexport interface MDVesselProps extends WithOrgDataProps, MasterDataProps {\r\n\r\n}\r\n\r\nconst QUERY = gql`\r\n query VesselQuery($filter: [FilterByKeyValueInput!], $search: [FilterByKeyValueInput!], $limit: Int, $skip: Int) {\r\n MasterDataVessels(filter: $filter, search: $search, limit: $limit, skip: $skip) {\r\n docs {\r\n ... on Vessel {\r\n _id\r\n _rev\r\n name\r\n }\r\n }\r\n }\r\n }\r\n`\r\n\r\nconst MUTATION = gql`\r\n mutation VesselMutation(\r\n $_id: ID\r\n $name: String!\r\n $tpID: ID!\r\n $customerID: ID!\r\n ){\r\n setVessel(\r\n _id: $_id\r\n name: $name\r\n tpID: $tpID\r\n customerID: $customerID\r\n ){\r\n _id\r\n _rev\r\n name\r\n tpID\r\n customerID\r\n }\r\n }\r\n`\r\n\r\nconst MDVessel: React.FC = (props) => {\r\n\r\n const formRef = useRef(null);\r\n\r\n let tpID = props.orgData.getOrgIDByType('transporter');\r\n\r\n //> THIS WILL FILTER OUR LIST to ONLY ALLOW (Our USERS COMPANY 'VESSELS' to SHOW in LIST)\r\n let customerID = props.orgData.getOrgIDByType('customer');\r\n\r\n\r\n const MDState = useMasterDataState({\r\n getQueryData: (data: any) => data.MasterDataVessels.docs,\r\n getQueryVariables: (searchValues) => ({\r\n filter: [\r\n {\r\n key: 'tpID',\r\n value: JSON.stringify(tpID)\r\n },\r\n {\r\n key: 'customerID',\r\n value: JSON.stringify(customerID)\r\n }\r\n ],\r\n search: searchValuesToQuerySearchPayload(searchValues)\r\n }),\r\n queryGQL: QUERY,\r\n saveMutationGQL: MUTATION,\r\n deleteMutationGQL: DeleteEntity,\r\n tpID: tpID,\r\n paginationLimit: props.dataPaginationLimit,\r\n pollInterval: props.pollInterval,\r\n updateQueryAfterFetchMore: (prev, fetchMoreResult) => {\r\n return {\r\n ...prev,\r\n MasterDataVessels: {\r\n ...prev.MasterDataVessels,\r\n docs: [\r\n ...prev.MasterDataVessels.docs,\r\n ...fetchMoreResult.MasterDataVessels.docs\r\n ]\r\n }\r\n }\r\n }\r\n })\r\n\r\n // const [ save, { loading: saving, error: saveError, data: savedData } ] = useMutation(MUTATION, {\r\n // onCompleted: () => {\r\n // MDState.cancelEditing(false);\r\n // }\r\n // });\r\n\r\n const data = MDState.data;\r\n\r\n return {\r\n return MDState.editFromNew({\r\n name: MDState.getSearchValue('name')\r\n })\r\n })}\r\n headerElement={\r\n MDState.onSearchValueChange('name', e.target.value)} placeholder=\"Search by Name\"\r\n value={MDState.getSearchValue('name')}\r\n style={{ width:'15rem' }}\r\n allowClear\r\n />\r\n \r\n }\r\n />}\r\n tableElement={\r\n \r\n \r\n \r\n \r\n \r\n }\r\n detailsElement={ {\r\n formRef.current.validateFieldsAndScroll((err, values) => {\r\n if (!err){\r\n MDState.save({\r\n ...values,\r\n name: trimString(values.name),\r\n _id: MDState.getEntryFieldValue('_id'),\r\n customerID: customerID\r\n })\r\n }\r\n })\r\n }}\r\n >\r\n MDState.setEntryFields(fields)}\r\n uppercaseFields={['name']}\r\n autoFocus\r\n ref={formRef}\r\n dupeChecker={MDState.isNewEntry ? (\r\n data && data.MasterDataVessels && data.MasterDataVessels.docs}\r\n renderItems={(items) => {\r\n return \r\n {items.map((craft) =>\r\n \r\n {\r\n e.preventDefault();\r\n MDState.editFromExisting(craft, false)\r\n }}\r\n >\r\n Name: {craft.name}\r\n \r\n \r\n \r\n )}\r\n \r\n }}\r\n query={QUERY}\r\n variables={{\r\n filter: [\r\n {\r\n key: 'tpID',\r\n value: JSON.stringify(props.orgData.getOrgIDByType('transporter'))\r\n }\r\n ],\r\n search: [\r\n {\r\n key: 'name',\r\n value: JSON.stringify(trimString(MDState.getEntryFieldValue('name')))\r\n }\r\n ]\r\n }}\r\n />\r\n ) : null\r\n }\r\n />\r\n \r\n }\r\n />\r\n}\r\n\r\nexport default WithOrgData(MDVessel)","import React, { useRef, forwardRef, LegacyRef, useState, useEffect } from 'react';\r\nimport { EntryFormProps, entryFormOptions, useAutoFocus } from '.';\r\nimport { Form, Input, Select, Checkbox, Tooltip, Typography, Alert } from 'antd';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\nimport {FormItemClassNames, formItemLayout, tailFormItemLayout} from 'common/form';\r\nimport { composeValidators, validateAlphaNumeric, validateDecimal, validateOtherFieldIsFilledIn } from 'formValidators';\r\nimport useUserGroups from \"../../../hooks/useUserGroups\";\r\n\r\nexport interface LocationEntryFormProps extends EntryFormProps {\r\n areaBlockDuplicationChecker?: React.ReactElement,\r\n autoFocusLatitude?: boolean\r\n}\r\n\r\nconst LocationEntryForm: React.FC = forwardRef((props, ref: LegacyRef
)=> {\r\n const [ nameInputRef, setNameInputRef ] = useState(null);\r\n const [ latitudeInputRef, setLatitudeInputRef ] = useState(null);\r\n const [ userGroups ] = useUserGroups();\r\n\r\n const isSuperUser = userGroups.includes('dataflyt.superuser');\r\n\r\n const { getFieldDecorator, getFieldValue, setFieldsValue } = props.form;\r\n useAutoFocus(props.autoFocus && !props.autoFocusLatitude, nameInputRef);\r\n useAutoFocus(props.autoFocusLatitude, latitudeInputRef);\r\n\r\n useEffect(() => {\r\n let long = getFieldValue('longitude');\r\n\r\n if (typeof long === 'string' && long.length > 0 && !long.startsWith('-')){\r\n long = \"-\" + long; // Remove negative\r\n setFieldsValue({ longitude: long });\r\n }\r\n\r\n }, [ getFieldValue('longitude') ])\r\n\r\n // Type field needs to be disabled because all \"rigs\" must be an off-shore location.\r\n let isRig = getFieldValue('getRig') ? true : false;\r\n\r\n return \r\n \r\n {getFieldDecorator('name', {\r\n rules: [ { required: true, message: 'Name is required' } ]\r\n })( setNameInputRef(r)} />)}\r\n \r\n {props.dupeChecker}\r\n \r\n {getFieldDecorator('ownerOrg', {\r\n rules: [ { required: true, message: 'Organization is required' } ]\r\n })()}\r\n \r\n \r\n \r\n {getFieldDecorator('type', {\r\n initialValue: null,\r\n rules: [ { required: true, message: 'Type is required' } ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {isSuperUser ? (\r\n \r\n {getFieldDecorator('hasDataflytHardware', {\r\n valuePropName: 'checked'\r\n })(\r\n \r\n )}\r\n \r\n }\r\n type=\"error\"\r\n showIcon={false}\r\n style={{\r\n marginBottom: 24\r\n }}\r\n />\r\n ) : null}\r\n {getFieldValue('type') === 'OFFSHORE' ? (\r\n <>\r\n \r\n {getFieldDecorator('block', {\r\n rules: [\r\n { required: true, message: 'Area is required' },\r\n { validator: validateAlphaNumeric }\r\n ]\r\n })()}\r\n \r\n \r\n {getFieldDecorator('field', {\r\n rules: [\r\n { required: true, message: 'Block is required' },\r\n { validator: validateAlphaNumeric }\r\n ]\r\n })()}\r\n \r\n {props.areaBlockDuplicationChecker}\r\n \r\n {getFieldDecorator('twicRequired', {\r\n valuePropName: 'checked'\r\n })()}\r\n \r\n \r\n ) : null}\r\n \r\n {getFieldDecorator('isOneOff', {\r\n valuePropName: 'checked'\r\n })()}\r\n \r\n \r\n NOTE: Changing the lat/long below will override the lat/long from BlockInfo. To update these coordinates on BlockInfo please go to blockinfo.com}\r\n />\r\n \r\n \r\n NOTE: Only western hemisphere locations are supported at this time.}\r\n />\r\n \r\n Ex: LCH is 30.123651125777588}>\r\n {getFieldDecorator('latitude', {\r\n rules: [\r\n { validator: composeValidators(validateDecimal, validateOtherFieldIsFilledIn(props.form, 'longitude', 'Longitude')) }\r\n ]\r\n })( setLatitudeInputRef(r)} />)}\r\n \r\n Ex: LCH is -93.2210574153492}>\r\n {getFieldDecorator('longitude', {\r\n rules: [\r\n { validator: composeValidators(validateDecimal, validateOtherFieldIsFilledIn(props.form, 'latitude', 'Latitude')) }\r\n ]\r\n })()}\r\n \r\n \r\n})\r\n\r\nexport default Form.create(entryFormOptions())(LocationEntryForm)","import { useMutation } from '@apollo/react-hooks';\r\nimport {Cell, Column, ColumnHeaderCell} from '@blueprintjs/table';\r\nimport { Button, Divider, Input, List, message, Popconfirm, Select, Tooltip, Typography } from 'antd';\r\nimport { getColWidths } from 'common/table';\r\nimport { castArray, safeGet } from 'common/util';\r\nimport BlueprintTableInfiniteScroller from 'components/BlueprintTableInfiniteScroller';\r\nimport MCIcon from 'components/icon';\r\nimport WithOrgData, { WithOrgDataProps } from 'components/WithOrgData';\r\nimport gql from 'graphql-tag';\r\nimport _ from 'lodash';\r\nimport DeleteEntity from 'Mutations/DeleteEntity';\r\nimport React, { useEffect, useRef, useState } from 'react';\r\nimport { getDetailsTitle, MDDetails, MDHeader, MDLayout, MDTable, TableLoader, useMasterDataState } from '..';\r\nimport DuplicationChecker, { DuplicationCheckerProps } from '../DuplicationChecker';\r\nimport LocationEntryForm from '../entryForms/location';\r\nimport { getMDTableProps, MasterDataProps, MDStateToDetailsProps, MDStateToHeaderProps, MDStateToLayoutProps, MDStateToTableScrollerProps, renderCellFromKeyIndex, renderNoData, searchValuesToQuerySearchPayload, trimString } from '../util';\r\nimport useUserGroups from 'hooks/useUserGroups';\r\nimport { NetworkStatus } from 'apollo-client';\r\nimport { useLocation } from 'react-router-dom';\r\nimport qs from 'qs';\r\n\r\nexport interface MDLocationProps extends WithOrgDataProps, MasterDataProps {\r\n \r\n}\r\n\r\nconst QUERY = gql`\r\nquery LocationsQuery($filter: [FilterByKeyValueInput!], $search: [FilterByKeyValueInput!], $limit: Int, $skip: Int, $twicRequired: Boolean, $isOneOff: Boolean, $hasDataflytHardware: Boolean) {\r\n MasterDataLocations(filter: $filter, search: $search, limit: $limit, skip: $skip, twicRequired: $twicRequired, isOneOff: $isOneOff, hasDataflytHardware: $hasDataflytHardware) {\r\n docs {\r\n ... on Location {\r\n _id\r\n _rev\r\n name\r\n ownerOrg\r\n block\r\n field\r\n type\r\n twicRequired\r\n isOneOff\r\n latitude\r\n longitude\r\n hasDataflytHardware\r\n getRig {\r\n _id\r\n }\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst MUTATION = gql`\r\nmutation LocationMutation(\r\n $tpID: ID!\r\n $payload: LocationInput!\r\n ){\r\n setLocation(\r\n tpID: $tpID\r\n payload: $payload\r\n ){\r\n _id\r\n name\r\n ownerOrg\r\n block\r\n field\r\n type\r\n latitude\r\n longitude\r\n twicRequired\r\n hasDataflytHardware\r\n }\r\n}`\r\n\r\nconst MAKE_RIG_MUT = gql`\r\n mutation MakeRig($locationID: ID!){\r\n CreateRigFromLoc(locationID: $locationID){\r\n _id\r\n }\r\n }\r\n`\r\n\r\nconst DELETE_USER_GROUPS = ['flytsuite.master.location.delete'];\r\nconst EDIT_USER_GROUPS = ['flytsuite.master.location.edit'];\r\n\r\nconst MDLocation: React.FC = (props) => {\r\n\r\n const formRef = useRef(null);\r\n let tpID = props.orgData.getOrgIDByType('transporter');\r\n let routerLocation = useLocation();\r\n\r\n let editIDByDefault: string;\r\n let autoFocusLatitude: boolean;\r\n\r\n if (routerLocation && routerLocation.search){\r\n const params = qs.parse(routerLocation.search, { ignoreQueryPrefix: true });\r\n editIDByDefault = params.locationID;\r\n autoFocusLatitude = params.autoFocusLatitude === 'true';\r\n }\r\n\r\n const [ duplicatesFound, setDuplicatesFound ] = useState>([]);\r\n const [ loadingDone, setLoadingDone ] = useState(false);\r\n const [ userGroups ] = useUserGroups();\r\n\r\n const isSuperUser = userGroups.includes('dataflyt.superuser');\r\n\r\n function findDuplicate(name: string){\r\n if (!name) return undefined;\r\n return duplicatesFound.find((loc) => loc && loc.name === trimString(name));\r\n }\r\n\r\n const MDState = useMasterDataState({\r\n getQueryData: data => data.MasterDataLocations.docs,\r\n getQueryVariables: (searchValues) => {\r\n let newSearchValues = {...searchValues};\r\n if ('twicRequired' in searchValues){\r\n var twicRequired = searchValues.twicRequired;\r\n delete newSearchValues.twicRequired;\r\n }\r\n if (\"isOneOff\" in searchValues){\r\n var isOneOff = searchValues.isOneOff;\r\n delete newSearchValues.isOneOff;\r\n }\r\n if (\"hasDataflytHardware\" in searchValues){\r\n var hasDataflytHardware = searchValues.hasDataflytHardware;\r\n delete newSearchValues.hasDataflytHardware;\r\n }\r\n let search = searchValuesToQuerySearchPayload(newSearchValues);\r\n return {\r\n twicRequired,\r\n isOneOff,\r\n hasDataflytHardware,\r\n search\r\n }\r\n },\r\n queryGQL: QUERY,\r\n saveMutationGQL: MUTATION,\r\n deleteMutationGQL: DeleteEntity,\r\n paginationLimit: props.dataPaginationLimit,\r\n pollInterval: props.pollInterval,\r\n tpID,\r\n updateQueryAfterFetchMore: (prev, fetchMoreResult) => ({\r\n ...prev,\r\n MasterDataLocations: {\r\n ...prev.MasterDataLocations,\r\n docs: [\r\n ...prev.MasterDataLocations.docs,\r\n ...fetchMoreResult.MasterDataLocations.docs\r\n ]\r\n }\r\n })\r\n })\r\n\r\n useEffect(() => {\r\n if (MDState.queryNetworkStatus === NetworkStatus.loading){\r\n setLoadingDone(false);\r\n }\r\n else\r\n {\r\n setLoadingDone(true);\r\n }\r\n }, [ MDState.queryNetworkStatus ])\r\n\r\n useEffect(() => {\r\n if (editIDByDefault){\r\n MDState.onSearchValueChange('_id', editIDByDefault, true);\r\n }\r\n }, [ editIDByDefault ])\r\n\r\n useEffect(() => {\r\n if (editIDByDefault && loadingDone){\r\n const loc = MDState.data.find((loc) => loc._id === editIDByDefault);\r\n console.debug('data', MDState.data);\r\n if (loc){\r\n MDState.editFromExisting(loc)\r\n }\r\n }\r\n }, [ editIDByDefault, loadingDone ])\r\n\r\n const [ makeRig, { loading: makeRigLoading } ] = useMutation(MAKE_RIG_MUT, {\r\n onError: () => message.error('Failed to make this location into a rig')\r\n });\r\n\r\n function renderDupeChecker(searchMode?: boolean, props?: Partial){\r\n return {\r\n let dataArray = safeGet(['MasterDataLocations', 'docs'], data);\r\n if (Array.isArray(dataArray)){\r\n if (!_(dataArray).xorWith(duplicatesFound, _.isEqual).isEmpty()){\r\n setDuplicatesFound(castArray(dataArray))\r\n }\r\n }\r\n else\r\n {\r\n if (duplicatesFound.length > 0){\r\n setDuplicatesFound([]);\r\n }\r\n }\r\n return dataArray\r\n }}\r\n query={QUERY}\r\n variables={{\r\n [searchMode ? 'search' : 'filter']: [\r\n {\r\n key: 'name',\r\n value: JSON.stringify(trimString(MDState.getEntryFieldValue('name')))\r\n }\r\n ]\r\n }}\r\n renderItems={(items) => {\r\n return \r\n {items.map((loc) =>\r\n \r\n {\r\n e.preventDefault();\r\n MDState.editFromExisting(loc, false)\r\n }}\r\n >\r\n Name: {loc.name}\r\n \r\n Type: {loc.type}\r\n {loc.block ? (<>\r\n \r\n Area: {loc.block}\r\n ) : null}\r\n {loc.field ? (<>\r\n \r\n Block: {loc.field}\r\n ) : null}\r\n \r\n \r\n )}\r\n \r\n }}\r\n />\r\n }\r\n\r\n const isLocOffShore = MDState.data.findIndex(d => d._id === MDState.getEntryFieldValue('_id') && d.type === 'OFFSHORE') > -1\r\n\r\n const selectedLoc = MDState.data.find(loc => loc._id === MDState.getEntryFieldValue('_id'))\r\n\r\n return {\r\n return MDState.editFromNew({\r\n name: MDState.getSearchValue('name'),\r\n ownerOrg: MDState.getSearchValue('ownerOrg'),\r\n type: MDState.getSearchValue('type'),\r\n block: MDState.getSearchValue('block'),\r\n field: MDState.getSearchValue('field'),\r\n twicRequired: MDState.getSearchValue('twicRequired')\r\n })\r\n })}\r\n headerElement={\r\n \r\n
\r\n Search: \r\n \r\n MDState.onSearchValueChange('name', e.target.value)}\r\n placeholder=\"By name\"\r\n value={MDState.getSearchValue('name')}\r\n style={{ width: '15rem' }}\r\n allowClear\r\n />\r\n MDState.onSearchValueChange('_id', e.target.value, true)}\r\n placeholder=\"By ID\"\r\n value={MDState.getSearchValue('_id')}\r\n style={{ width: '10rem' }}\r\n allowClear\r\n />\r\n MDState.onSearchValueChange('ownerOrg', e.target.value)}\r\n placeholder=\"By Organization\"\r\n value={MDState.getSearchValue('ownerOrg')}\r\n style={{ width: '15rem' }}\r\n allowClear\r\n />\r\n MDState.onSearchValueChange('block', e.target.value)}\r\n placeholder=\"By Area\"\r\n value={MDState.getSearchValue('block')}\r\n style={{ width: '8rem' }}\r\n allowClear\r\n />\r\n MDState.onSearchValueChange('field', e.target.value)}\r\n placeholder=\"By Block\"\r\n value={MDState.getSearchValue('field')}\r\n style={{ width: '8rem' }}\r\n allowClear\r\n />\r\n \r\n
\r\n
\r\n Filter: \r\n \r\n MDState.onSearchValueChange('type', value)}\r\n value={MDState.getSearchValue('type') || null}\r\n style={{ width: '15rem' }}\r\n placeholder=\"By type\"\r\n allowClear\r\n showAction={[\"focus\", \"click\"]}\r\n >\r\n Any Type\r\n Off Shore\r\n On Shore\r\n \r\n {\r\n MDState.onSearchValueChange('twicRequired', typeof value === 'string' ? JSON.parse(value) : undefined);\r\n }}\r\n value={( typeof MDState.getSearchValue('twicRequired') === 'boolean' && String(MDState.getSearchValue('twicRequired'))) || null}\r\n style={{ width: '15rem' }}\r\n placeholder=\"By TWIC\"\r\n allowClear\r\n showAction={[\"focus\", \"click\"]}\r\n >\r\n Don't filter TWIC\r\n TWIC Required\r\n TWIC Not Required\r\n \r\n {\r\n MDState.onSearchValueChange('isOneOff', typeof value === 'string' ? JSON.parse(value) : undefined);\r\n }}\r\n value={( typeof MDState.getSearchValue('isOneOff') === 'boolean' && String(MDState.getSearchValue('isOneOff'))) || null}\r\n style={{ width: '15rem' }}\r\n placeholder=\"One Off\"\r\n allowClear\r\n showAction={[\"focus\", \"click\"]}\r\n >\r\n Don't filter One-Off\r\n Is One-Off\r\n Is Not One-Off\r\n \r\n {isSuperUser ? (\r\n {\r\n MDState.onSearchValueChange('hasDataflytHardware', typeof value === 'string' ? JSON.parse(value) : undefined);\r\n }}\r\n value={( typeof MDState.getSearchValue('hasDataflytHardware') === 'boolean' && String(MDState.getSearchValue('hasDataflytHardware'))) || null}\r\n style={{ width: '15rem' }}\r\n placeholder=\"Has DF Hardware\"\r\n allowClear\r\n showAction={[\"focus\", \"click\"]}\r\n >\r\n Don't filter DataFlyt Hardware\r\n Has DataFlyt Hardware\r\n No DataFlyt Hardware\r\n \r\n )\r\n : null}\r\n \r\n
\r\n \r\n }\r\n />\r\n }\r\n tableElement={\r\n \r\n \r\n {\r\n let entry = MDState.data[idx];\r\n MDState.delete({ _id: entry['_id'] });\r\n }}\r\n deleteUserGroups={DELETE_USER_GROUPS}\r\n deleteLoadingIdx={MDState.deleting ? (MDState.data?.findIndex(pil => pil._id === MDState.deletingId)) || -1 : -1}\r\n >\r\n {\r\n let isRig = MDState.data[idx].getRig ? true : false;\r\n return \r\n {isRig ? \r\n \r\n : null}\r\n {MDState.data[idx].name}\r\n \r\n }} />\r\n \r\n \r\n \r\n {isSuperUser ? (\r\n (\r\n Has DF Hardware}\r\n />\r\n )}\r\n cellRenderer={(idx) => {\r\n let record = MDState.data[idx];\r\n let hardware = record?.hasDataflytHardware;\r\n let text = hardware ? 'Yes' : 'No';\r\n return {text}\r\n }} />\r\n ) : null}\r\n {\r\n let record = MDState.data[idx];\r\n let twicRequired = record && record.twicRequired;\r\n return {twicRequired ? 'Yes' : 'No'}\r\n }} />\r\n \r\n {\r\n let record = MDState.data[idx];\r\n let isOneOff = record && record.isOneOff;\r\n return {isOneOff ? 'Yes' : 'No'}\r\n }} />\r\n \r\n \r\n \r\n }\r\n detailsElement={\r\n \r\n {selectedLoc?.getRig ? (\r\n \r\n \r\n \r\n ) : null}\r\n {getDetailsTitle(MDState.getEntryFieldValue('name'), MDState.isNewEntry)}\r\n }\r\n strTitle={MDState.getEntryFieldValue('name')}\r\n deleteUserGroups={DELETE_USER_GROUPS}\r\n editUserGroups={EDIT_USER_GROUPS}\r\n onSave={() => {\r\n formRef.current.validateFieldsAndScroll((err, values) => {\r\n\r\n const payload = {\r\n ...values,\r\n name: trimString(values.name),\r\n ownerOrg: trimString(values.ownerOrg),\r\n block: trimString(values.block),\r\n field: trimString(values.field),\r\n twicRequired: values.twicRequired ? true : false,\r\n isOneOff: values.isOneOff ? true : false,\r\n latitude: values.latitude,\r\n longitude: values.longitude,\r\n _id: MDState.getEntryFieldValue('_id'),\r\n } as any;\r\n\r\n if (isSuperUser){\r\n payload.hasDataflytHardware = values.hasDataflytHardware;\r\n }\r\n\r\n if (!err){\r\n let saveData = {\r\n payload: payload\r\n }\r\n MDState.save(saveData)\r\n }\r\n })\r\n }}\r\n onDelete={\r\n\r\n // Prevent rig locations from being deleted\r\n selectedLoc?.getRig ? undefined :\r\n\r\n () => {\r\n let delData = {\r\n _id: MDState.getEntryFieldValue('_id'),\r\n tpID: props.orgData.getOrgIDByType('transporter')\r\n }\r\n MDState.delete(delData)\r\n }\r\n }\r\n extra={\r\n !MDState.isNewEntry && !selectedLoc?.getRig && userGroups.includes('dataflyt.superuser') ? [\r\n \r\n \r\n Are you sure you want to make {selectedLoc?.name} a rig?
\r\n You cannot undo this action!
\r\n Any edits you made below WILL BE LOST.\r\n \r\n }\r\n onConfirm={() => {\r\n makeRig({\r\n variables: {\r\n locationID: MDState.getEntryFieldValue('_id')\r\n },\r\n update: (cache, { data: { CreateRigFromLoc } }) => {\r\n MDState.resetEntryFields();\r\n let locID = 'Location:' + MDState.getEntryFieldValue('_id');\r\n let f = gql`\r\n fragment L on Location {\r\n _id\r\n _id\r\n _rev\r\n name\r\n ownerOrg\r\n block\r\n field\r\n type\r\n twicRequired\r\n latitude\r\n longitude\r\n getRig {\r\n _id\r\n }\r\n }\r\n `;\r\n \r\n cache.writeFragment({\r\n fragment: f,\r\n id: locID,\r\n data: {\r\n getRig: CreateRigFromLoc\r\n }\r\n })\r\n }\r\n });\r\n }}\r\n >\r\n \r\n
\r\n
\r\n ] : null}\r\n >\r\n MDState.setEntryFields(fields)}\r\n uppercaseFields={['name', 'ownerOrg', 'block', 'field']}\r\n autoFocus\r\n autoFocusLatitude={autoFocusLatitude}\r\n isNewEntry={MDState.isNewEntry}\r\n ref={formRef}\r\n dupeChecker={MDState.isNewEntry ? <>\r\n {!findDuplicate(MDState.getEntryFieldValue('name')) ? renderDupeChecker(true, { title: 'Warning: Possible Duplication' }) : null}\r\n {findDuplicate(MDState.getEntryFieldValue('name')) ? renderDupeChecker(false, {\r\n alertProps: {\r\n type: 'error'\r\n },\r\n title: \"Duplication Error\",\r\n renderMessage: (items) => {\r\n if (!items.length) return null;\r\n let messageBeginning = {items.length} locations have been found that have\r\n if (items.length === 1){\r\n messageBeginning = A location has been found that has\r\n }\r\n let message =

{messageBeginning} the same name as what you have entered.\r\n Duplicate locations are not allowed. Please edit an existing location by clicking an item below.\r\n

\r\n return message\r\n }\r\n }) : null}\r\n : null}\r\n areaBlockDuplicationChecker={\r\n {\r\n let messageBeginning = {items.length} locations have been found that have\r\n if (items.length === 1){\r\n messageBeginning = A location has been found that has\r\n }\r\n let message =

{messageBeginning} the same area and block as what is entered.\r\n It is highly recommended that you edit an existing location by clicking an item below.\r\n

\r\n return message\r\n }}\r\n skip={\r\n MDState.getEntryFieldValue('type') !== 'OFFSHORE' ||\r\n !MDState.getEntryFieldValue('block') ||\r\n !MDState.getEntryFieldValue('field')\r\n }\r\n getData={data => {\r\n let dataArray = safeGet(['MasterDataLocations', 'docs'], data);\r\n if (Array.isArray(dataArray) && !MDState.isNewEntry){\r\n dataArray = dataArray.filter((loc) => loc._id !== MDState.getEntryFieldValue('_id'));\r\n }\r\n return dataArray\r\n }}\r\n query={QUERY}\r\n variables={{\r\n filter: [\r\n {\r\n key: 'type',\r\n value: JSON.stringify('OFFSHORE')\r\n },\r\n {\r\n key: 'block',\r\n value: JSON.stringify(MDState.getEntryFieldValue('block'))\r\n },\r\n {\r\n key: 'field',\r\n value: JSON.stringify(MDState.getEntryFieldValue('field'))\r\n }\r\n ]\r\n }}\r\n renderItems={(items) => {\r\n return \r\n {items.map((loc) =>\r\n \r\n {\r\n e.preventDefault();\r\n MDState.editFromExisting(loc, false)\r\n }}\r\n >\r\n Name: {loc.name}\r\n \r\n Type: {loc.type}\r\n {loc.block ? (<>\r\n \r\n Area: {loc.block}\r\n ) : null}\r\n {loc.field ? (<>\r\n \r\n Block: {loc.field}\r\n ) : null}\r\n \r\n \r\n )}\r\n \r\n }}\r\n />\r\n }\r\n />\r\n \r\n \r\n }\r\n />\r\n}\r\n\r\nexport default WithOrgData(MDLocation)","import React from 'react';\r\nimport { Input } from \"antd\";\r\nimport { InputProps } from 'antd/lib/input';\r\n\r\nexport interface InputPhoneNumberProps extends Omit {\r\n onChange?: (value: string) => void,\r\n value?: string\r\n}\r\n\r\nexport function formatPhoneNumber(number: string){\r\n let x: RegExpMatchArray;\r\n x = number.replace(/\\D/g, '').match(/(\\d{0,3})(\\d{0,3})(\\d{0,4})/);\r\n return (!x[2] ? x[1] : '(' + x[1] + ') ' + x[2] + (x[3] ? '-' + x[3] : ''));\r\n}\r\n\r\nconst InputPhoneNumber: React.FC = (props) => {\r\n var { value, onChange, ...restProps } = props;\r\n const onInputChange = (e) => {\r\n value = formatPhoneNumber(e.target.value);\r\n onChange && onChange(value);\r\n }\r\n return \r\n}\r\n\r\nexport default InputPhoneNumber","// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default [\r\n {\r\n \"key\": \"WORK\",\r\n \"label\": \"Work\"\r\n },\r\n {\r\n \"key\": \"HOME\",\r\n \"label\": \"Home\"\r\n },\r\n {\r\n \"key\": \"MOBILE\",\r\n \"label\": \"Mobile\"\r\n },\r\n {\r\n \"key\": \"OTHER\",\r\n \"label\": \"Other\"\r\n }\r\n]","import React from 'react';\r\nimport { Select, Input, Button, Tooltip } from 'antd';\r\nimport { InputPhoneNumber } from '../InputPhoneNumber';\r\nimport globalPhoneTypes from './phoneTypes';\r\nimport { SelectProps } from 'antd/lib/select';\r\n\r\nexport interface Phone {\r\n type: string,\r\n number: string\r\n}\r\n\r\nexport interface PhoneType {\r\n key: string,\r\n label: String\r\n}\r\n\r\nexport interface InputPhoneProps {\r\n types?: Array,\r\n inputPhoneNumberProps?: any,\r\n phoneTypeProps?: SelectProps,\r\n onChange?(value: Phone): void,\r\n value?: Phone\r\n}\r\n\r\nconst InputPhone: React.FC & { validator: (rules: any, value: any, callback: any) => void } = ({ types, onChange, value, inputPhoneNumberProps={}, phoneTypeProps={}, ...restProps }) => {\r\n const handleChange = (key, getValue=(v) => v) => (obj) => {\r\n if (typeof onChange !== 'function') return;\r\n onChange && onChange({\r\n type: value && value.type,\r\n number: value && value.number,\r\n [key]: getValue(obj)\r\n })\r\n }\r\n const clear = () => {\r\n if (typeof onChange !== 'function') return;\r\n onChange({\r\n type: undefined,\r\n number: undefined\r\n })\r\n }\r\n var phTypes = types;\r\n if (!phTypes){\r\n phTypes = globalPhoneTypes;\r\n }\r\n return (\r\n \r\n e)}\r\n showAction={[\"focus\", \"click\"]}\r\n {...phoneTypeProps}\r\n >\r\n {phTypes.map(t => {\r\n return {t.label}\r\n })}\r\n \r\n v)}\r\n style={{\r\n width: '8rem'\r\n }}\r\n {...inputPhoneNumberProps}\r\n />\r\n {value && (value.type || value.number) ? (\r\n \r\n \r\n )}\r\n \r\n }}\r\n />\r\n ) : null}\r\n />\r\n \r\n \r\n }\r\n />\r\n}\r\n\r\nexport default WithOrgData(MDPilot)","import React from 'react';\r\nimport { Input, Select, Tooltip, Button } from 'antd';\r\nimport usStates from './usStates';\r\nimport pluralize from 'pluralize'\r\nimport { englishList } from 'common/util';\r\n\r\nconst stateOptions = Object.entries(usStates).map(([ key, value ]) => {`${key} (${value})`});\r\n\r\nconst InputAddress = React.forwardRef((props, ref) => {\r\n // eslint-disable-next-line\r\n let { value={}, onChange, style={}, ...restProps } = props;\r\n if (value === null){\r\n value = {};\r\n }\r\n const handleChange = (fieldKey) => (event) => {\r\n if (event.target){\r\n var v = event.target.value;\r\n }\r\n else\r\n {\r\n v = event;\r\n }\r\n if (typeof onChange === 'function'){\r\n onChange({\r\n street: value.street,\r\n city: value.city,\r\n state: value.state,\r\n zipCode: value.zipCode,\r\n [fieldKey]: v \r\n });\r\n }\r\n }\r\n const clear = () => {\r\n if (typeof onChange !== 'function') return;\r\n onChange({\r\n street: undefined,\r\n city: undefined,\r\n state: undefined,\r\n zipCode: undefined\r\n })\r\n }\r\n const createInput = (key, placeholder, cmpt, inputProps) => {\r\n let Component = cmpt || Input;\r\n let inputStyle = {\r\n display: 'inline-block',\r\n width: 'auto',\r\n ...((inputProps && inputProps.style) || {})\r\n }\r\n return \r\n }\r\n\r\n let stateSelectProps = {\r\n children: stateOptions,\r\n showSearch: true,\r\n optionFilterProp: '',\r\n showAction: \"focus\",\r\n filterOption: (input, option) => {\r\n console.log(option.props.children);\r\n return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0\r\n },\r\n style: {\r\n minWidth: '10rem'\r\n }\r\n }\r\n\r\n let inputs = [\r\n createInput('street', 'Street'),\r\n createInput('city', 'City'),\r\n createInput('state', 'State', Select, stateSelectProps),\r\n createInput('zipCode', 'ZIP Code')\r\n ]\r\n return \r\n {inputs}\r\n {value && (value.street || value.city || value.state || value.zipCode) ? (\r\n \r\n \r\n \r\n}\r\n\r\nconst DuplicationChecker = ({ variables, query, skip, getData, renderItems, renderMessage, style }) => {\r\n if (typeof getData !== 'function'){\r\n throw Error('You must pass a function to the getData prop.');\r\n }\r\n if (typeof renderItems !== 'function'){\r\n throw Error('You must pass a function to the renderItems prop.');\r\n }\r\n return \r\n {({ data, error, networkStatus, refetch }) => {\r\n if (networkStatus <= 4){\r\n return \r\n }\r\n if (error){\r\n console.error('Duplicate Search failed!', error);\r\n return \r\n }\r\n if (!data) return null;\r\n let items = getData ? getData(data) : [];\r\n if (!Array.isArray(items)){\r\n items = [];\r\n }\r\n if (!items.length) return null;\r\n let messageBeginning = {items.length} records have been found that are\r\n if (items.length === 1){\r\n messageBeginning = A record has been found that is\r\n }\r\n if (typeof renderMessage === 'function'){\r\n var message = renderMessage(items);\r\n }\r\n else\r\n {\r\n message =

{messageBeginning} similar to what you have entered.\r\n If the record that you are trying to create is in this list below, it is highly recommended that you edit the existing record by clicking an item below.\r\n

\r\n }\r\n return \r\n {message}\r\n {renderItems(items)}\r\n \r\n } />\r\n }}\r\n
\r\n}\r\n\r\nexport default DuplicationChecker","import React, { useRef } from 'react';\r\nimport { Input, Row, Col, DatePicker } from 'antd';\r\nimport moment from 'moment';\r\n\r\nexport const CredentialInput = ({\r\n value={},\r\n onChange=() => null,\r\n showKey=true,\r\n showExpiration=true,\r\n inputProps={},\r\n style\r\n}) => {\r\n const keyInput = useRef(null);\r\n const expInput = useRef(null);\r\n const inputStyle = inputProps.style || {};\r\n\r\n const onInputChange = (type, getValue=(e) => e.target.value) => (e) => {\r\n onChange({\r\n ...value,\r\n [type]: getValue(e)\r\n })\r\n }\r\n\r\n const renderInput = (title, render) => {\r\n return (\r\n \r\n \r\n {title}\r\n \r\n \r\n {render}\r\n \r\n \r\n )\r\n }\r\n\r\n return (\r\n \r\n {showKey ? (\r\n \r\n {renderInput('Key', (\r\n \r\n ))}\r\n \r\n ) : null}\r\n {showExpiration ? (\r\n \r\n {renderInput('Expiration', (\r\n value.format('YYYY-MM-DD'))}\r\n format=\"YYYY-MM-DD\"\r\n />\r\n ))}\r\n \r\n ) : null}\r\n \r\n )\r\n}","import { Button, Card, Col, DatePicker, Form, Icon, Input, List, Row, Spin } from 'antd';\r\nimport gql from 'graphql-tag';\r\nimport debounce from 'lodash/debounce';\r\nimport moment from 'moment';\r\nimport React, { useEffect, useRef, useState } from 'react';\r\nimport { Query } from 'react-apollo';\r\nimport { getOrgISNName } from '../../common/util';\r\nimport { validateISNNumber } from '../../formValidators';\r\nimport ContactInfoForm from '../form/ContactInfoForm';\r\nimport { OrganizationSelect } from '../form/select/OrganizationSelect';\r\nimport ISNChecker from '../ISNChecker';\r\nimport DuplicationChecker from '../masterdata/DuplicationChecker';\r\nimport WithOrgData from '../WithOrgData';\r\nimport { CredentialInput } from './CredentialInput';\r\n\r\nconst formItemLayout = {\r\n labelCol: {\r\n xs: { span: 24 },\r\n sm: { span: 4 },\r\n },\r\n wrapperCol: {\r\n xs: { span: 24 },\r\n sm: { span: 20 },\r\n },\r\n style: {\r\n marginBottom: 0\r\n }\r\n};\r\n\r\nconst defaultMessage = 'This field is required';\r\n\r\nconst defaultContactValues = (person) => {\r\n console.log(\"Here 1\")\r\n return {\r\n \"name\":{\r\n \"firstName\": person.firstName,\r\n \"lastName\": person.lastName\r\n },\r\n \"phone\":{\r\n \"type\": (person.contactInfo && person.contactInfo.phone && person.contactInfo.phone.type) || \"HOME\",\r\n \"number\": (person.contactInfo && person.contactInfo.phone && person.contactInfo.phone.number) || \"\"\r\n },\r\n \"email\":{\r\n \"type\": (person.contactInfo && person.contactInfo.email && person.contactInfo.email.type) || \"PERSONAL\",\r\n \"address\": (person.contactInfo && person.contactInfo.email && person.contactInfo.email.address) || \"\"\r\n },\r\n \"address\":{\r\n \"street\": (person.contactInfo && person.contactInfo.address && person.contactInfo.address.street) || \"\",\r\n \"city\": (person.contactInfo && person.contactInfo.address && person.contactInfo.address.city) || \"\",\r\n \"state\": (person.contactInfo && person.contactInfo.address && person.contactInfo.address.state) || \"\",\r\n \"zipCode\": (person.contactInfo && person.contactInfo.address && person.contactInfo.address.zipCode) || \"\"\r\n }\r\n }\r\n}\r\n\r\nconst defaultEmergencyContactValues = (person) => {\r\n console.log(\"Here 2\")\r\n return {\r\n \"name\":{\r\n \"firstName\": person.firstName,\r\n \"lastName\": person.lastName\r\n },\r\n \"phone\":{\r\n \"type\": (person.emergencyContactInfo && person.emergencyContactInfo.phone && person.emergencyContactInfo.phone.type) || \"HOME\",\r\n \"number\": (person.emergencyContactInfo && person.emergencyContactInfo.phone && person.emergencyContactInfo.phone.number) || \"\"\r\n },\r\n \"email\":{\r\n \"type\": (person.emergencyContactInfo && person.emergencyContactInfo.email && person.emergencyContactInfo.email.type) || \"PERSONAL\",\r\n \"address\": (person.emergencyContactInfo && person.emergencyContactInfo.email && person.emergencyContactInfo.email.address) || \"\"\r\n },\r\n \"address\":{\r\n \"street\": (person.emergencyContactInfo && person.emergencyContactInfo.address && person.emergencyContactInfo.address.street) || \"\",\r\n \"city\": (person.emergencyContactInfo && person.emergencyContactInfo.address && person.emergencyContactInfo.address.city) || \"\",\r\n \"state\": (person.emergencyContactInfo && person.emergencyContactInfo.address && person.emergencyContactInfo.address.state) || \"\",\r\n \"zipCode\": (person.emergencyContactInfo && person.emergencyContactInfo.address && person.emergencyContactInfo.address.zipCode) || \"\"\r\n }\r\n }\r\n}\r\n\r\nconst initializeOrg = (org, personOrg) => {\r\n if (!personOrg && !org) return;\r\n let init;\r\n if (personOrg){\r\n init = personOrg;\r\n }\r\n if (!init){\r\n init = org;\r\n }\r\n if (init){\r\n init = {\r\n key: init._id,\r\n label: init.name\r\n }\r\n return {...init};\r\n }\r\n return init\r\n}\r\n\r\nfunction ContactInfoCards({ person, form, ...restProps }){\r\n\r\n const { getFieldDecorator, getFieldValue, setFields } = form;\r\n const [ tabKey, setTabKey ] = useState('contactInfo');\r\n const contactFormRef = useRef(null);\r\n const eContactFormRef = useRef(null);\r\n\r\n const getFormErrors = (formRef) => () => formRef.current.getFieldsError();\r\n\r\n getFieldDecorator('contactInfo');\r\n getFieldDecorator('emergencyContactInfo');\r\n getFieldDecorator('contactInfoFields');\r\n getFieldDecorator('emergencyContactInfoFields');\r\n const contactInfoFields = getFieldValue('contactInfoFields');\r\n const eContactInfoFields = getFieldValue('emergencyContactInfoFields');\r\n \r\n const updateFields = (key, formErrorsFunc) => (fields) => {\r\n // console.log(form.getFieldsError());\r\n let errors;\r\n if (typeof formErrorsFunc === 'function'){\r\n let fieldErrors = formErrorsFunc();\r\n let values = Object.values(fieldErrors);\r\n for (let index = 0; index < values.length; index++) {\r\n const value = values[index];\r\n if (Array.isArray(value) && value.length > 0){\r\n if (Array.isArray(errors)){\r\n errors.push(...value);\r\n }\r\n else\r\n {\r\n errors = value;\r\n }\r\n } \r\n }\r\n }\r\n setFields({ [key]: {\r\n value: fields,\r\n errors\r\n } });\r\n // let newFields = {};\r\n // Object.entries(fields).forEach(([ key, value ]) => {\r\n // newFields[key] = value\r\n // })\r\n // setFieldsValue({ [key]: { ...getFieldValue(key), ...newFields } });\r\n // return newFields\r\n }\r\n\r\n const renderTabWarning = (formName) => {\r\n if (form.getFieldError(formName)){\r\n return \r\n }\r\n return null;\r\n }\r\n \r\n return {renderTabWarning('contactInfoFields')} Contact Info,\r\n key: 'contactInfo'\r\n },\r\n {\r\n tab: {renderTabWarning('emergencyContactInfoFields')} Emergency Contact Info,\r\n key: 'emergencyContactInfo'\r\n }\r\n ]} {...restProps}>\r\n \r\n \r\n \r\n}\r\n\r\nconst DuplicateSearch = ({ lastName, firstName, employers, onItemClick, style }) => {\r\n const handleItemClick = (personId) => {\r\n if (typeof onItemClick === 'function'){\r\n onItemClick(personId);\r\n }\r\n }\r\n return data && data.persons && data.persons.docs}\r\n style={style}\r\n renderItems={(items) => \r\n {items.map((person) =>\r\n \r\n \r\n \r\n )}\r\n }\r\n Z/>\r\n}\r\n\r\nlet PersonEditor = ({ form: { getFieldDecorator, getFieldValue }, form, person, orgData={}, employers, onDupeSearchItemClicked }) => {\r\n const [ dupeSearchState, setDupeSearchState ] = useState({ lastName: null, firstName: null });\r\n\r\n const handleDupeSearchStateUpdate = debounce((state) => setDupeSearchState(state), 1000);\r\n\r\n var credentials = {};\r\n if (Array.isArray(person && person.credentials)){\r\n for (let index = 0; index < person.credentials.length; index++) {\r\n const element = person.credentials[index];\r\n credentials[element.type] = element;\r\n }\r\n }\r\n let customer = orgData.customer;\r\n let employer = orgData.employer;\r\n let orgClassType = orgData.organization.classType;\r\n let initialCustomer = initializeOrg(customer, person && person.customerID);\r\n let initialEmployer = initializeOrg(employer, person && person.employerID);\r\n\r\n useEffect(() => {\r\n handleDupeSearchStateUpdate({\r\n lastName: form.getFieldValue('lastName'),\r\n firstName: form.getFieldValue('firstName')\r\n })\r\n // eslint-disable-next-line\r\n }, [ form.getFieldValue('lastName'), form.getFieldValue('firstName') ])\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n {getFieldDecorator('lastName', {\r\n initialValue: person && person.lastName,\r\n rules: [\r\n {required: true, message: defaultMessage}\r\n ]\r\n })()}\r\n \r\n \r\n {getFieldDecorator('customerID', {\r\n initialValue: initialCustomer,\r\n rules: [\r\n {required: true, message: defaultMessage}\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('dob', {\r\n initialValue: person && person.dob && moment(person.dob),\r\n rules: [\r\n {required: true, message: defaultMessage}\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('firstName', {\r\n initialValue: person && person.firstName,\r\n rules: [\r\n {required: true, message: defaultMessage}\r\n ]\r\n })()}\r\n \r\n \r\n {getFieldDecorator('employerID', {\r\n initialValue: initialEmployer,\r\n rules: [\r\n {required: true, message: defaultMessage}\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {!person ? (\r\n {\r\n if (typeof onDupeSearchItemClicked === 'function'){\r\n onDupeSearchItemClicked(personId);\r\n }\r\n }}\r\n lastName={dupeSearchState.lastName}\r\n firstName={dupeSearchState.firstName}\r\n style={{ marginBottom: 12 }}\r\n />\r\n ) : null}\r\n \r\n \r\n \r\n \r\n \r\n {getFieldDecorator('credential-US_DRIVERS_LICENSE', {\r\n initialValue: credentials.US_DRIVERS_LICENSE\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('credential-PASSPORT', {\r\n initialValue: credentials.PASSPORT\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('credential-PASSPORT_CARD', {\r\n initialValue: credentials.PASSPORT_CARD\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('credential-TWIC', {\r\n initialValue: credentials.TWIC\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('credential-SAFETY_CARD', {\r\n initialValue: credentials.SAFETY_CARD\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('credential-HUET_CARD', {\r\n initialValue: credentials.HUET_CARD\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('credential-EBS_CARD', {\r\n initialValue: credentials.EBS_CARD\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('credential-ISN', {\r\n initialValue: credentials.ISN,\r\n rules: [\r\n {validator: (rule, value, callback) => validateISNNumber(rule, value && value.key, callback)}\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {getFieldDecorator('extraBroadState', {\r\n initialValue: (person && person.extraBroadState) || \"\"\r\n })(\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport function getFormCredentials(form, getCredAttrs){\r\n const fields = Object.entries(form.getFieldsValue());\r\n let creds = {};\r\n fields.filter(([field]) => field.startsWith('credential-'))\r\n .forEach(([field, cred]) => {\r\n const fieldName = field.replace('credential-', '');\r\n if (typeof getCredAttrs === 'function' && cred){\r\n creds[fieldName] = getCredAttrs(cred);\r\n return;\r\n }\r\n creds[fieldName] = cred;\r\n });\r\n return creds\r\n}\r\n\r\nexport default Form.create({\r\n onFieldsChange(props, _, fields){\r\n if (typeof props.onFieldsChange !== 'function') return;\r\n props.onFieldsChange(fields);\r\n }\r\n})( WithOrgData( PersonEditor ) )","import { SelectProps, SelectValue } from 'antd/lib/select';\r\nimport gql from 'graphql-tag';\r\nimport React, { useState } from 'react';\r\nimport { SearchSelectWithData } from '../SearchSelect';\r\nimport { Select } from 'antd';\r\nimport './style.less';\r\n\r\nexport interface RigSelectProps extends SelectProps {\r\n}\r\n\r\nconst QUERY = gql`\r\n query Rigs {\r\n getRigs {\r\n _id\r\n locationID {\r\n _id\r\n name\r\n }\r\n }\r\n }\r\n`\r\n\r\nconst RigSelect: React.FC = (props) => {\r\n const [ searchValue, setSearchValue ] = useState(null);\r\n\r\n return (\r\n data && data.getRigs && data.getRigs\r\n .filter(r => {\r\n if (!searchValue) return true;\r\n let locName = String(r?.locationID?.name).toUpperCase();\r\n if (locName){\r\n return locName.includes(String(searchValue).toUpperCase());\r\n }\r\n return false\r\n })\r\n .sort((a, b) => {\r\n let aName = String(a?.locationID?.name);\r\n let bName = String(b?.locationID?.name);\r\n return aName.localeCompare(bName)\r\n })\r\n }\r\n onSearch={(v) => setSearchValue(v)}\r\n onDataItem={(item) => {item?.locationID?.name}}\r\n\r\n />\r\n )\r\n}\r\n\r\nexport default RigSelect","import { Card, Icon } from 'antd';\r\nimport { CardProps } from 'antd/lib/card';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\nimport ContactInfoForm from 'components/form/ContactInfoForm';\r\nimport React, { useRef, useState } from 'react';\r\n\r\nexport interface ContactInfoCardsProps extends FormComponentProps, CardProps {\r\n\r\n}\r\n\r\nconst ContactInfoCards: React.FC = ({ form, ...restProps }) => {\r\n\r\n const { getFieldDecorator, getFieldValue, setFields } = form;\r\n const [ tabKey, setTabKey ] = useState('contactInfo');\r\n const contactFormRef = useRef(null);\r\n const eContactFormRef = useRef(null);\r\n\r\n const getFormErrors = (formRef) => () => formRef.current.getFieldsError();\r\n\r\n getFieldDecorator('contactInfo');\r\n getFieldDecorator('emergencyContactInfo');\r\n const contactInfoFields = getFieldValue('contactInfo');\r\n const eContactInfoFields = getFieldValue('emergencyContactInfo');\r\n const updateFields = (key, formErrorsFunc?: any) => (fields) => {\r\n // console.log(form.getFieldsError());\r\n let errors;\r\n if (typeof formErrorsFunc === 'function'){\r\n let fieldErrors = formErrorsFunc();\r\n let values = Object.values(fieldErrors);\r\n for (let index = 0; index < values.length; index++) {\r\n const value = values[index];\r\n if (Array.isArray(value) && value.length > 0){\r\n if (Array.isArray(errors)){\r\n errors.push(...value);\r\n }\r\n else\r\n {\r\n errors = value;\r\n }\r\n } \r\n }\r\n }\r\n setFields({ [key]: {\r\n value: fields,\r\n errors\r\n } });\r\n // let newFields = {};\r\n // Object.entries(fields).forEach(([ key, value ]) => {\r\n // newFields[key] = value\r\n // })\r\n // setFieldsValue({ [key]: { ...getFieldValue(key), ...newFields } });\r\n // return newFields\r\n }\r\n\r\n const renderTabWarning = (formName) => {\r\n if (form.getFieldError(formName)){\r\n return \r\n }\r\n return null;\r\n }\r\n \r\n return {renderTabWarning('contactInfo')} Contact Info,\r\n key: 'contactInfo'\r\n },\r\n {\r\n tab: {renderTabWarning('emergencyContactInfo')} Emergency Contact Info,\r\n key: 'emergencyContactInfo'\r\n }\r\n ]} {...restProps}>\r\n \r\n \r\n \r\n}\r\n\r\nexport default ContactInfoCards","import React, { useRef, CSSProperties } from 'react';\r\nimport { Input, Row, Col, DatePicker } from 'antd';\r\nimport moment from 'moment';\r\n\r\nexport interface CredentialInputProps {\r\n showKey?: boolean,\r\n showExpiration?: boolean,\r\n inputProps?: any,\r\n style?: CSSProperties,\r\n value?: any,\r\n onChange?(value: any): void\r\n}\r\n\r\nexport const CredentialInput: React.FC = ({\r\n value={},\r\n onChange=() => null,\r\n showKey=true,\r\n showExpiration=true,\r\n inputProps={},\r\n style\r\n}) => {\r\n const keyInput = useRef(null);\r\n const expInput = useRef(null);\r\n const inputStyle = inputProps.style || {};\r\n\r\n const onInputChange = (type, getValue=(e) => e.target.value) => (e) => {\r\n onChange({\r\n ...value,\r\n [type]: getValue(e)\r\n })\r\n }\r\n\r\n const renderInput = (title, render) => {\r\n return (\r\n \r\n \r\n {title}\r\n \r\n \r\n {render}\r\n \r\n \r\n )\r\n }\r\n\r\n return (\r\n \r\n {showKey ? (\r\n \r\n {renderInput('Key', (\r\n \r\n ))}\r\n \r\n ) : null}\r\n {showExpiration ? (\r\n \r\n {renderInput('Expiration', (\r\n value && value.format('YYYY-MM-DD'))}\r\n format=\"MM-DD-YYYY\"\r\n />\r\n ))}\r\n \r\n ) : null}\r\n \r\n )\r\n}","import { Alert, Button, Card, Col, DatePicker, Form, Input, Radio, Row, Select, Spin } from 'antd';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\nimport RadioGroup from 'antd/lib/radio/group';\r\nimport { getLabelInValueKey } from 'common/form';\r\nimport { getOrgISNName } from 'common/util';\r\nimport CovidVaxDatesForm from 'components/covid-vax-date-form';\r\nimport { PersonCovidVaxRecord } from 'components/covid-vax-date-list';\r\nimport { OrganizationSelect } from 'components/form/select/OrganizationSelect';\r\nimport RigSelect from 'components/form/select/RigSelect';\r\nimport ISNChecker from 'components/ISNChecker';\r\nimport {validateCredWithExpiration, validateISNNumber} from 'formValidators';\r\nimport gql from 'graphql-tag';\r\nimport React, { forwardRef, LegacyRef } from 'react';\r\nimport { Query } from 'react-apollo';\r\nimport { entryFormOptions, EntryFormProps } from '..';\r\nimport ContactInfoCards from './ContactInfoCards';\r\nimport { CredentialInput } from './CredentialInput';\r\n\r\nconst formItemLayout = {\r\n labelCol: {\r\n xs: { span: 24 },\r\n sm: { span: 4 },\r\n },\r\n wrapperCol: {\r\n xs: { span: 24 },\r\n sm: { span: 20 },\r\n },\r\n style: {\r\n marginBottom: 0\r\n }\r\n};\r\n\r\nexport interface PersonEntryFormProps extends EntryFormProps {\r\n disableCustomer?: boolean\r\n disableEmployer?: boolean,\r\n showCovidForm?: boolean,\r\n disableCovidForm?: boolean,\r\n covid19VaxDateRecords?: PersonCovidVaxRecord[]\r\n \r\n}\r\n\r\nconst PersonEntryForm_Internal: React.FC = forwardRef((props, ref: LegacyRef
) => {\r\n\r\n let showCovidForm = props.showCovidForm || false;\r\n let disableCovidForm = props.disableCovidForm || false;\r\n \r\n const { getFieldDecorator, getFieldValue , setFieldsValue} = props.form;\r\n\r\n const hasAtLeastOneCred = (\r\n (\r\n getFieldValue('credential-US_DRIVERS_LICENSE') &&\r\n getFieldValue('credential-US_DRIVERS_LICENSE').key &&\r\n getFieldValue('credential-US_DRIVERS_LICENSE').key !== \"\" &&\r\n getFieldValue('credential-US_DRIVERS_LICENSE').expiration &&\r\n getFieldValue('credential-US_DRIVERS_LICENSE').expiration !== \"\"\r\n ) ||\r\n (\r\n getFieldValue('credential-PASSPORT') &&\r\n getFieldValue('credential-PASSPORT').key &&\r\n getFieldValue('credential-PASSPORT').key !== \"\" &&\r\n getFieldValue('credential-PASSPORT').expiration &&\r\n getFieldValue('credential-PASSPORT').expiration !== \"\"\r\n ) ||\r\n (\r\n getFieldValue('credential-PASSPORT_CARD') &&\r\n getFieldValue('credential-PASSPORT_CARD').key &&\r\n getFieldValue('credential-PASSPORT_CARD').key !== \"\" &&\r\n getFieldValue('credential-PASSPORT_CARD').expiration &&\r\n getFieldValue('credential-PASSPORT_CARD').expiration !== \"\"\r\n ) ||\r\n (\r\n getFieldValue('credential-TWIC') &&\r\n getFieldValue('credential-TWIC').key &&\r\n getFieldValue('credential-TWIC').key !== \"\" &&\r\n getFieldValue('credential-TWIC').expiration &&\r\n getFieldValue('credential-TWIC').expiration !== \"\"\r\n )\r\n );\r\n\r\n return \r\n \r\n \r\n \r\n \r\n \r\n \r\n {getFieldDecorator('lastName', {\r\n rules: [\r\n {required: true, message: 'Last name is required'}\r\n ]\r\n })()}\r\n \r\n \r\n {getFieldDecorator('customerID', {\r\n rules: [\r\n {required: true, message: 'Customer is required'}\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('dob', {\r\n rules: [\r\n {required: true, message: 'DOB is required'}\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('firstName', {\r\n rules: [\r\n {required: true, message: 'First name is required'}\r\n ]\r\n })()}\r\n \r\n \r\n {getFieldDecorator('employerID', {\r\n rules: [\r\n {required: true, message: 'Employer is required'}\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {props.dupeChecker}\r\n \r\n {showCovidForm ? (\r\n \r\n {disableCovidForm ? (\r\n \r\n ) : null}\r\n \r\n \r\n ) : null}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('credential-US_DRIVERS_LICENSE', {\r\n rules: [{\r\n validator: validateCredWithExpiration,\r\n required: !hasAtLeastOneCred\r\n }]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('credential-PASSPORT', {\r\n rules: [{\r\n validator: validateCredWithExpiration,\r\n required: !hasAtLeastOneCred\r\n }]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('credential-PASSPORT_CARD', {\r\n rules: [{\r\n validator: validateCredWithExpiration,\r\n required: !hasAtLeastOneCred\r\n }]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('credential-TWIC', {\r\n rules: [{\r\n validator: validateCredWithExpiration,\r\n required: !hasAtLeastOneCred\r\n }]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('credential-SAFETY_CARD')(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('credential-HUET_CARD')(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('credential-EBS_CARD')(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('credential-ISN', {\r\n rules: [\r\n {validator: (rule, value, callback) => validateISNNumber(rule, value && value.key, callback)}\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('extraBroadState')(\r\n \r\n YES\r\n NO\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n {getFieldDecorator('essentialOn')(\r\n \r\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 PersonEntryForm = Form.create(entryFormOptions())(PersonEntryForm_Internal);\r\n\r\nPersonEntryForm.displayName = \"PersonEntryForm\";\r\n\r\nexport default PersonEntryForm","import { Cell, Column } from '@blueprintjs/table';\r\nimport { Button, Col, Divider, Input, List, message, Row } from 'antd';\r\nimport { getLabelInValue, getLabelInValueKey } from 'common/form';\r\nimport { getColWidths } from 'common/table';\r\nimport { castArray, getFirstElArrayOrNull, safeGet } from 'common/util';\r\nimport BlueprintTableInfiniteScroller from 'components/BlueprintTableInfiniteScroller';\r\nimport { buildBulkMutation } from 'components/covid-vax-date-form/submitter';\r\nimport { PersonCovidVaxRecord } from 'components/covid-vax-date-list';\r\nimport { OrganizationSelect } from 'components/form/select/OrganizationSelect';\r\nimport { getFormCredentials } from 'components/PersonEditor';\r\nimport WithOrgData, { WithOrgDataProps } from 'components/WithOrgData';\r\nimport credentialTypes from 'credentialTypes';\r\nimport gql from 'graphql-tag';\r\nimport useUserGroups from 'hooks/useUserGroups';\r\nimport { sha256 } from 'js-sha256';\r\nimport { isEmpty, keyBy, mapKeys, omit } from 'lodash';\r\nimport moment from 'moment';\r\nimport DeleteEntity from 'Mutations/DeleteEntity';\r\nimport pluralize from 'pluralize';\r\nimport React, { useEffect, useRef, useState } from 'react';\r\nimport { useApolloClient } from 'react-apollo';\r\nimport { DuplicationChecker, MDDetails, MDHeader, MDLayout, MDTable, TableLoader, useMasterDataState } from '../..';\r\nimport PersonEntryForm from '../../entryForms/person';\r\nimport { getMDTableProps, MasterDataProps, MDStateToDetailsProps, MDStateToHeaderProps, MDStateToLayoutProps, MDStateToTableScrollerProps, renderCellFromKeyIndex, renderNoData, renderOrgCell, searchValuesToQuerySearchPayload, trimObjectStringValues, trimString, updateQueryWithFetchMoreResult } from '../../util';\r\n\r\nexport type HidableColumnTypes = 'customer' | 'employer'\r\n\r\nexport interface MDPersonnelProps extends WithOrgDataProps, MasterDataProps {\r\n\r\n}\r\n\r\nconst defaultContactValues = (person, info) => {\r\n return {\r\n \"name\":{\r\n \"firstName\": person.firstName,\r\n \"lastName\": person.lastName\r\n },\r\n \"phone\":{\r\n \"type\": (info && info.phone && info.phone.value && info.phone.value.type) || \"HOME\",\r\n \"number\": (info && info.phone && info.phone.value && info.phone.value.number) || \"\"\r\n },\r\n \"email\":{\r\n \"type\": (info && info.email && info.email.value && info.email.value.type) || \"PERSONAL\",\r\n \"address\": (info && info.email && info.email.value && info.email.value.address) || \"\"\r\n },\r\n \"address\":{\r\n \"street\": (info && info.address && info.address.value && info.address.value.street) || \"\",\r\n \"city\": (info && info.address && info.address.value && info.address.value.city) || \"\",\r\n \"state\": (info && info.address && info.address.value && info.address.value.state) || \"\",\r\n \"zipCode\": (info && info.address && info.address.value && info.address.value.zipCode) || \"\"\r\n }\r\n }\r\n}\r\n\r\nconst QUERY = gql`\r\nquery PersonnelQuery($filter: [FilterByKeyValueInput!], $search: [FilterByKeyValueInput!], $credFilter: String!, $filteringByID: Boolean!, $limit: Int, $skip: Int) {\r\n MasterDataPersonnel(filter: $filter, search: $search, limit: $limit, skip: $skip) @skip(if: $filteringByID) {\r\n docs {\r\n ... on Person {\r\n _id\r\n _rev\r\n firstName\r\n lastName\r\n dob\r\n extraBroadState\r\n contactInfo {\r\n address {\r\n street\r\n city\r\n state\r\n zipCode\r\n }\r\n email {\r\n address\r\n type\r\n }\r\n phone {\r\n number\r\n type\r\n }\r\n }\r\n credentials {\r\n _id\r\n type\r\n key\r\n expiration\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n essentialOn {\r\n _id\r\n locationID {\r\n _id\r\n name\r\n }\r\n }\r\n }\r\n }\r\n }\r\n getPersonsByCred (\r\n search: $credFilter\r\n ) @include(if: $filteringByID) {\r\n _id\r\n _rev\r\n firstName\r\n lastName\r\n dob\r\n extraBroadState\r\n contactInfo {\r\n address {\r\n street\r\n city\r\n state\r\n zipCode\r\n }\r\n email {\r\n address\r\n type\r\n }\r\n phone {\r\n number\r\n type\r\n }\r\n }\r\n credentials {\r\n _id\r\n type\r\n key\r\n expiration\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst SAVE_COVID_MUTATION = gql`\r\nmutation SetPerson(\r\n $payload: PersonInput!,\r\n $orgID: ID!,\r\n $credentialMap: CredentialFormInput\r\n $modifyVaxRecords: Boolean!\r\n $modifiedVaxRecords: [BulkUpdatePersonCov19VaxRecordInput!]!\r\n $deleteVaxRecords: Boolean!\r\n $deletedVaxRecords: [BulkDeletePersonCov19VaxRecordInput!]!\r\n $essentialOn: ID\r\n $updatePersonEssentialOn: Boolean\r\n){\r\n bulkUpdatePersonCovid19VaxDate(input: $modifiedVaxRecords) @include(if: $modifyVaxRecords){ \r\n personID\r\n personName\r\n date\r\n manufacturer\r\n comment\r\n }\r\n bulkDeletePersonCovid19VaxDate(input: $deletedVaxRecords) @include(if: $deleteVaxRecords){ \r\n personID\r\n personName\r\n date\r\n manufacturer\r\n comment\r\n }\r\n setPerson(\r\n payload: $payload\r\n orgID: $orgID\r\n credentialMap: $credentialMap\r\n essentialOn: $essentialOn\r\n updatePersonEssentialOn: $updatePersonEssentialOn\r\n ){\r\n _id\r\n firstName\r\n lastName\r\n nation\r\n contactInfo {\r\n address {\r\n city\r\n state\r\n street\r\n zipCode\r\n }\r\n email {\r\n type\r\n address\r\n }\r\n name {\r\n firstName\r\n lastName\r\n }\r\n phone {\r\n number\r\n type\r\n }\r\n }\r\n emergencyContactInfo {\r\n address {\r\n city\r\n state\r\n street\r\n zipCode\r\n }\r\n email {\r\n type\r\n address\r\n }\r\n name {\r\n firstName\r\n lastName\r\n }\r\n phone {\r\n number\r\n type\r\n }\r\n }\r\n extraBroadState\r\n credentials {\r\n _id\r\n type\r\n key\r\n expiration\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n essentialOn {\r\n _id\r\n locationID {\r\n _id\r\n name\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst SAVE_MUTATION = gql`\r\nmutation SetPerson(\r\n $payload: PersonInput!,\r\n $orgID: ID!,\r\n $credentialMap: CredentialFormInput\r\n $essentialOn: ID\r\n $updatePersonEssentialOn: Boolean\r\n){\r\n setPerson(\r\n payload: $payload\r\n orgID: $orgID\r\n credentialMap: $credentialMap\r\n essentialOn: $essentialOn\r\n updatePersonEssentialOn: $updatePersonEssentialOn\r\n ){\r\n _id\r\n firstName\r\n lastName\r\n nation\r\n contactInfo {\r\n address {\r\n city\r\n state\r\n street\r\n zipCode\r\n }\r\n email {\r\n type\r\n address\r\n }\r\n name {\r\n firstName\r\n lastName\r\n }\r\n phone {\r\n number\r\n type\r\n }\r\n }\r\n emergencyContactInfo {\r\n address {\r\n city\r\n state\r\n street\r\n zipCode\r\n }\r\n email {\r\n type\r\n address\r\n }\r\n name {\r\n firstName\r\n lastName\r\n }\r\n phone {\r\n number\r\n type\r\n }\r\n }\r\n extraBroadState\r\n credentials {\r\n _id\r\n type\r\n key\r\n expiration\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n essentialOn {\r\n _id\r\n locationID {\r\n _id\r\n name\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst MDPersonnel: React.FC = (props) => {\r\n const formRef = useRef(null);\r\n\r\n const apolloClient = useApolloClient();\r\n\r\n const [ userGroups ] = useUserGroups();\r\n\r\n const [ credKey, setCredKey ] = useState();\r\n const [ personVaxRecords, setPersonVaxRecords ] = useState(null);\r\n\r\n let canModifyAndDeleteVaxRecords = userGroups.includes('flytsuite.covid19vaxrecords.edit') &&\r\n userGroups.includes('flytsuite.covid19vaxrecords.delete')\r\n\r\n let canReadVaxRecords = userGroups.includes('flytsuite.covid19vaxrecords.read')\r\n\r\n const state = {\r\n queryGQL: QUERY,\r\n saveMutationGQL: canModifyAndDeleteVaxRecords ? SAVE_COVID_MUTATION : SAVE_MUTATION,\r\n deleteMutationGQL: DeleteEntity,\r\n getQueryData: data => {\r\n if (credKey){\r\n return data.getPersonsByCred;\r\n }\r\n return data.MasterDataPersonnel.docs;\r\n },\r\n getQueryVariables: (searchValues) => {\r\n let filter = [];\r\n \r\n if (props.orgData.getOrgIDByType('employer')){\r\n filter.push({\r\n key: 'employerID',\r\n value: JSON.stringify(props.orgData.getOrgIDByType('employer'))\r\n })\r\n }else if (searchValues.employer){\r\n filter.push({\r\n key: 'employerID',\r\n value: JSON.stringify(getLabelInValueKey(searchValues.employer))\r\n })\r\n }\r\n if (props.orgData.getOrgIDByType('customer')){\r\n filter.push({\r\n key: 'customerID',\r\n value: JSON.stringify(props.orgData.getOrgIDByType('customer'))\r\n })\r\n }\r\n else if (searchValues.customer){\r\n filter.push({\r\n key: 'customerID',\r\n value: JSON.stringify(getLabelInValueKey(searchValues.customer))\r\n })\r\n }\r\n return {\r\n filter: filter.length ? filter : undefined,\r\n search: searchValuesToQuerySearchPayload(omit(searchValues, ['employer', 'customer'])),\r\n filteringByID: searchValues.credKey ? true : false,\r\n credFilter: searchValues.credKey + \"\"\r\n }\r\n \r\n },\r\n paginationLimit: props.dataPaginationLimit,\r\n pollInterval: 0,\r\n updateQueryAfterFetchMore: updateQueryWithFetchMoreResult('MasterDataPersonnel'),\r\n onEditFromNew: () => {\r\n setPersonVaxRecords(null);\r\n },\r\n transformEditFromExisting: async (values) => {\r\n let customerID: any;\r\n let employerID: any\r\n if (props.orgData.getOrgByType('customer')){\r\n customerID = getLabelInValue(props.orgData.getOrgByType('customer'), 'name');\r\n }\r\n else\r\n {\r\n customerID = getLabelInValue(values.customerID, 'name');\r\n }\r\n\r\n if (props.orgData.getOrgByType('employer')){\r\n employerID = getLabelInValue(props.orgData.getOrgByType('employer'), 'name');\r\n }\r\n else\r\n {\r\n employerID = getLabelInValue(values.employerID, 'name');\r\n }\r\n let query = gql`\r\n query GetPersonCov19VaxRecordsQuery($personID: ID!){\r\n GetPersonCov19VaxRecords(personID: $personID) {\r\n personID\r\n personName\r\n customerID\r\n customerName\r\n employerID\r\n employerName\r\n comment\r\n manufacturer\r\n date\r\n label\r\n order\r\n }\r\n }\r\n `;\r\n\r\n let result;\r\n\r\n if (userGroups.includes('flytsuite.covid19vaxrecords.read') && values['_id']){\r\n try{\r\n result = await apolloClient.query({\r\n query: query,\r\n variables: {\r\n personID: values['_id']\r\n },\r\n fetchPolicy: 'network-only',\r\n });\r\n }\r\n catch(err){\r\n message.error('Failed to load covid vax data')\r\n setPersonVaxRecords(null);\r\n }\r\n }\r\n\r\n setPersonVaxRecords(null);\r\n if (result?.data?.GetPersonCov19VaxRecords){\r\n setPersonVaxRecords(result.data.GetPersonCov19VaxRecords);\r\n }\r\n\r\n return {\r\n ...values,\r\n dob: values.dob && moment(values.dob),\r\n employerID,\r\n customerID,\r\n essentialOn: values.essentialOn && values.essentialOn[0] && (\r\n {\r\n key: values.essentialOn[0]._id,\r\n label: values.essentialOn[0]?.locationID?.name\r\n }\r\n ),\r\n ...mapKeys(keyBy(values.credentials, 'type'), (_, key) => 'credential-' + key)\r\n }\r\n },\r\n lockFieldsToValue: {\r\n customerID: getLabelInValue(props.orgData.getOrgByType('customer'), 'name'),\r\n employerID: getLabelInValue(props.orgData.getOrgByType('employer'), 'name')\r\n }\r\n }\r\n\r\n const MDState = useMasterDataState({\r\n ...state\r\n })\r\n\r\n useEffect(() => {\r\n setCredKey(MDState.getSearchValue('credKey'));\r\n // eslint-disable-next-line\r\n }, [ MDState.getSearchValue('credKey') ])\r\n\r\n let columnElements = [\r\n ,\r\n ,\r\n {\r\n let record = MDState.data[idx];\r\n return {record.dob && moment(record.dob).format('MM-DD-YYYY')}\r\n }} />\r\n ]\r\n\r\n if(!props.orgData.getOrgIDByType('employer')){\r\n columnElements.push(\r\n \r\n )\r\n }\r\n\r\n if (!props.orgData.getOrgIDByType('customer')){\r\n columnElements.push(\r\n \r\n )\r\n }\r\n\r\n columnElements.push(\r\n {\r\n let record = MDState.data[idx];\r\n let city = safeGet(['contactInfo', 'address', 'city'], record)\r\n let state = safeGet(['contactInfo', 'address', 'state'], record)\r\n let text: string;\r\n if (city && !state) text = city\r\n else if (state && !city) text = state\r\n else if (!state && !city) text = null\r\n else text = `${city}, ${state}`\r\n return {text}\r\n }} />\r\n )\r\n\r\n columnElements.push(\r\n {\r\n let text: React.ReactText | React.ReactElement = null;\r\n let record = MDState.data[idx];\r\n let creds: Array = castArray(record.credentials).filter(cred => cred);\r\n if (!creds.length){\r\n text = 'No Credentials'\r\n }\r\n else\r\n {\r\n let credCount = `${creds.length} ${pluralize('Credentials', creds.length)}`;\r\n let credList = creds.map((cred) => cred && credentialTypes[cred.type] ? credentialTypes[cred.type].label : cred.type).join(', ');\r\n text = {credCount}: {credList}\r\n }\r\n return {text}\r\n }} />\r\n )\r\n\r\n function getLabelHeaderStyle(){\r\n let style: React.CSSProperties = {\r\n marginBottom: 0,\r\n marginRight: 12\r\n }\r\n if (MDState.isEditing){\r\n style = {\r\n ...style,\r\n textAlign: 'right',\r\n width: '4rem'\r\n }\r\n }\r\n return style\r\n }\r\n\r\n return {\r\n return MDState.editFromNew({\r\n lastName: MDState.getSearchValue('lastName'),\r\n firstName: MDState.getSearchValue('firstName'),\r\n employer: MDState.getSearchValue('employer'),\r\n customer: MDState.getSearchValue('customer')\r\n })\r\n })}\r\n headerElement={\r\n MDState.clearSearchValues()}\r\n {...MDStateToHeaderProps(MDState)}\r\n inputElement={\r\n \r\n \r\n \r\n

Search:

\r\n \r\n \r\n {\r\n MDState.onSearchValueChange('credKey', null)\r\n MDState.onSearchValueChange('lastName', e.target.value)\r\n }}\r\n placeholder=\"By last name\"\r\n value={MDState.getSearchValue('lastName')}\r\n style={{ width: '10rem' }}\r\n allowClear\r\n />\r\n {\r\n MDState.onSearchValueChange('credKey', null)\r\n MDState.onSearchValueChange('firstName', e.target.value)\r\n }}\r\n placeholder=\"By first name\"\r\n value={MDState.getSearchValue('firstName')}\r\n style={{ width: '10rem' }}\r\n allowClear\r\n />\r\n \r\n \r\n
\r\n \r\n

Search:

\r\n \r\n {\r\n MDState.onSearchValueChange('firstName', null)\r\n MDState.onSearchValueChange('lastName', null)\r\n MDState.onSearchValueChange('credKey', e.target.value)}\r\n }\r\n placeholder=\"By ID\"\r\n value={MDState.getSearchValue('credKey')}\r\n style={{ width: '10rem' }}\r\n allowClear\r\n />\r\n \r\n
\r\n \r\n {!(MDState.isEditing) ? : null}\r\n \r\n \r\n

Filter:

\r\n \r\n \r\n {!props.orgData.getOrgIDByType('employer') ? \r\n MDState.onSearchValueChange('employer', value)}\r\n value={MDState.getSearchValue('employer')}\r\n placeholder=\"By employer\"\r\n style={{ width: '10rem' }}\r\n labelInValue\r\n />\r\n : null }\r\n \r\n {!props.orgData.getOrgIDByType('customer') ? (\r\n \r\n MDState.onSearchValueChange('customer', value)}\r\n value={MDState.getSearchValue('customer')}\r\n placeholder=\"By customer\"\r\n style={{ width: '10rem' }}\r\n labelInValue\r\n />\r\n \r\n ) : null}\r\n \r\n \r\n
\r\n \r\n
\r\n }\r\n />\r\n }\r\n tableElement={\r\n \r\n \r\n \r\n {columnElements}\r\n \r\n \r\n \r\n }\r\n detailsElement={\r\n `${entry.lastName}, ${entry.firstName}`)}\r\n contentWidth=\"68rem\"\r\n onSave={() => {\r\n formRef.current.validateFieldsAndScroll(async (err, values) => {\r\n let originalData = MDState.data.find(d => d._id === MDState.getEntryFieldValue('_id'));\r\n let essentialOnChanged = values.essentialOn?.key !== getFirstElArrayOrNull(originalData?.essentialOn)?._id;\r\n if (err) return;\r\n let contactInfo = defaultContactValues(values, values.contactInfo);\r\n let emergencyContactInfo = defaultContactValues(values, values.emergencyContactInfo);\r\n let credentialMap = getFormCredentials(formRef.current, (cred) => ({ key: cred.key || undefined, expiration: cred.expiration || undefined }));\r\n\r\n // Trim whitespace off object string values\r\n contactInfo = trimObjectStringValues(contactInfo);\r\n emergencyContactInfo = trimObjectStringValues(emergencyContactInfo);\r\n credentialMap = trimObjectStringValues(credentialMap);\r\n\r\n let payload = {\r\n lastName: trimString(values.lastName),\r\n firstName: trimString(values.firstName),\r\n contactInfo: contactInfo || null,\r\n emergencyContactInfo: emergencyContactInfo || null,\r\n dob: moment(values.dob).format('YYYY-MM-DD'),\r\n customerID: getLabelInValueKey(values.customerID),\r\n employerID: getLabelInValueKey(values.employerID),\r\n extraBroadState : values.extraBroadState || \"NOT_CHECKED\",\r\n _id: MDState.getEntryFieldValue('_id')\r\n }\r\n\r\n let saveData: any = {\r\n payload,\r\n orgID: props.orgData.getActiveOrgID(),\r\n credentialMap,\r\n personID: MDState.getEntryFieldValue('_id'),\r\n updatePersonEssentialOn: essentialOnChanged,\r\n essentialOn: values.essentialOn?.key\r\n }\r\n\r\n if (canModifyAndDeleteVaxRecords){\r\n let personID = payload._id;\r\n if (MDState.isNewEntry){\r\n // We are going to need to generate a new ID since this is a new entry\r\n personID = \"PER-\" + sha256(payload.lastName + payload.firstName + payload.dob);\r\n }\r\n\r\n // ------------------------------------------------------------------\r\n // Prepare bulk write of vax records\r\n let { variables: vars } = await buildBulkMutation(\r\n {\r\n personID: personID,\r\n personName: payload.lastName + ', ' + payload.firstName,\r\n customerID: MDState.getEntryFieldValue('customerID')?.key,\r\n customerName: MDState.getEntryFieldValue('customerID')?.label,\r\n employerID: MDState.getEntryFieldValue('employerID')?.key,\r\n employerName: MDState.getEntryFieldValue('employerID')?.label,\r\n originalVaxRecords: personVaxRecords\r\n },\r\n formRef.current\r\n )\r\n // ------------------------------------------------------------------\r\n \r\n saveData = {\r\n ...saveData,\r\n modifyVaxRecords: vars.modifyVaxRecords,\r\n deleteVaxRecords: vars.deleteVaxRecords,\r\n modifiedVaxRecords: vars.modifiedVaxRecords,\r\n deletedVaxRecords: vars.deletedVaxRecords\r\n }\r\n }\r\n\r\n MDState.save(saveData)\r\n })\r\n }}\r\n >\r\n MDState.setEntryFields(fields)}\r\n uppercaseFields={['lastName', 'firstName']}\r\n autoFocus\r\n ref={formRef}\r\n disableCustomer={props.orgData.getOrgIDByType('customer') ? true : false}\r\n disableEmployer={props.orgData.getOrgIDByType('employer') ? true : false}\r\n dupeChecker={(MDState.isNewEntry) ? (\r\n {\r\n if (!data) return null;\r\n if (MDState.getSearchValue('credKey')){\r\n return data.getPersonsByCred?.docs;\r\n }\r\n return data.MasterDataPersonnel?.docs\r\n }}\r\n style={{ marginBottom: 12 }}\r\n renderItems={(items) => \r\n {items.map((person) =>\r\n \r\n MDState.editFromExisting(person)}>\r\n {person.lastName} {person.firstName} (Customer: {person.customerID && person.customerID.name}, Employer: {person.employerID && person.employerID.name})\r\n \r\n \r\n )}\r\n }\r\n />\r\n ) : null}\r\n />\r\n \r\n \r\n }\r\n />\r\n}\r\n\r\nexport default WithOrgData(MDPersonnel)","const windowSizes = {\r\n large: 1340,\r\n medium: 1048,\r\n small: 850,\r\n mobile: 560\r\n}\r\n\r\nexport default windowSizes","import React, { useEffect, useRef } from 'react'\r\nimport { debounce } from 'lodash';\r\n\r\nexport interface DebouncedFieldProps {\r\n value?: T,\r\n onChange: (value: T) => void,\r\n getValueFromChangeEvent: (e: any) => T,\r\n children: React.ReactElement,\r\n valuePropName?: string,\r\n debounceTime?: number,\r\n initializeValueOnce?: boolean\r\n}\r\n\r\nconst DebouncedField: React.FC = (props) => {\r\n const [ value, setValue ] = React.useState();\r\n \r\n const refState = useRef({ initialized: false })\r\n\r\n useEffect(() => {\r\n if (props.initializeValueOnce && refState.current.initialized){\r\n return;\r\n }\r\n // prop value changed. Update internal state.\r\n setValue(props.value);\r\n refState.current.initialized = true;\r\n }, [ props.value ])\r\n\r\n const debouncedOnChange = debounce(props.onChange, props.debounceTime || 300);\r\n\r\n let cloned = React.cloneElement(props.children, {\r\n [props.valuePropName || 'value']: value,\r\n onChange: (e: any) => {\r\n let value = props.getValueFromChangeEvent(e);\r\n setValue(value);\r\n debouncedOnChange(value);\r\n }\r\n })\r\n\r\n return cloned;\r\n}\r\n\r\nexport default DebouncedField","import { Alert, Button, Card, Icon, Input, List, Typography, message } from 'antd'\r\nimport { OrgEmailListItem } from 'common/types/org-email-list'\r\nimport { removeTypename } from 'common/util'\r\nimport CenteredLoadingScreen from 'components/CenteredLoadingScreen'\r\nimport OrgNotifEmailListEditor from 'components/org-notif-email-list-editor'\r\nimport 'css/Border.less'\r\nimport gql from 'graphql-tag'\r\nimport React, { Component, LegacyRef, MutableRefObject, useContext, useEffect, useRef, useState } from 'react'\r\nimport { MutationResult, QueryResult, useMutation, useQuery } from 'react-apollo'\r\nimport { debounce } from 'lodash'\r\nimport { NetworkStatus } from 'apollo-client'\r\nimport NonIdealState from 'components/NonIdealState'\r\nimport { OrgNotifEmailListEditorProps } from 'components/org-notif-email-list-editor/org-notif-email-list-editor'\r\nimport { FormComponentProps } from 'antd/lib/form'\r\nimport { OrgDataContext } from 'context/orgData'\r\nimport DebouncedField from 'components/decounced-field/debounced-field'\r\n\r\ninterface EmployerStub {\r\n _id: string,\r\n name: string,\r\n notificationEmailList: OrgEmailListItem[]\r\n}\r\n\r\nconst EMPLOYER_QUERY = gql`\r\nquery GetEmployersEmailLists(\r\n $limit: Int\r\n $skip: Int\r\n $bookmark: Int\r\n $search: [FilterByKeyValueInput!]\r\n $filter: [FilterByKeyValueInput!]\r\n){\r\n MasterDataEmployers(\r\n limit: $limit\r\n skip: $skip\r\n bookmark: $bookmark\r\n search: $search\r\n filter: $filter\r\n ){\r\n docs {\r\n ... on Employer {\r\n _id\r\n name\r\n notificationEmailList {\r\n email\r\n options {\r\n optInAll\r\n optIn\r\n }\r\n }\r\n }\r\n }\r\n bookmark\r\n }\r\n}\r\n`\r\n\r\nconst SET_EMPLOYER = gql`\r\nmutation SetEmployerEmailList($payload: EmployerInput!, $tpID: ID!){\r\n setEmployer(payload: $payload, tpID: $tpID){\r\n _id\r\n name\r\n notificationEmailList {\r\n email\r\n options {\r\n optIn\r\n optInAll\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nfunction useGetEmployersEmailList(search: string): [ EmployerStub[], QueryResult ]{\r\n const result = useQuery(EMPLOYER_QUERY, {\r\n fetchPolicy: 'cache-and-network',\r\n variables: {\r\n limit: 20,\r\n search: [\r\n {\r\n key: 'name',\r\n value: JSON.stringify(String(search).toLowerCase())\r\n }\r\n ]\r\n }\r\n })\r\n\r\n let employerEmailList = result.data?.MasterDataEmployers.docs || []\r\n \r\n return [ employerEmailList, result ]\r\n}\r\n\r\nfunction useSetEmployerEmailList(): [(employerID: string, emailList: OrgEmailListItem[]) => Promise, MutationResult] {\r\n const [ mutate, result ] = useMutation(SET_EMPLOYER);\r\n const orgData = useContext(OrgDataContext);\r\n\r\n function updateEmailList(employerID: string, emailList: OrgEmailListItem[]){\r\n return mutate({\r\n variables: {\r\n payload: {\r\n _id: employerID,\r\n notificationEmailList: emailList\r\n },\r\n tpID: orgData.getOrgIDByType('transporter')\r\n },\r\n update: (cache, { data: { SetEmployer } }) => {\r\n const data = cache.readQuery({ query: EMPLOYER_QUERY });\r\n let empList = data?.MasterDataEmployers || [];\r\n\r\n empList = empList.map((e) => {\r\n if (e._id === SetEmployer.payload._id){\r\n return {\r\n ...e,\r\n ...SetEmployer\r\n }\r\n }\r\n return e\r\n })\r\n\r\n cache.writeQuery({\r\n query: EMPLOYER_QUERY,\r\n data: {\r\n MasterDataEmployers: empList\r\n }\r\n })\r\n }\r\n })\r\n }\r\n\r\n return [ updateEmailList, result ]\r\n}\r\n\r\ninterface EmployerEmailTriggersEditorProps {\r\n data: {\r\n _id: string,\r\n name: string,\r\n notificationEmailList: OrgEmailListItem[]\r\n },\r\n editorRef?: MutableRefObject\r\n}\r\n\r\nconst EmailListContext = React.createContext<{\r\n emailListUpdating?: boolean,\r\n data: {\r\n dirty: boolean,\r\n data: OrgEmailListItem[],\r\n },\r\n setData: (data: {\r\n dirty: boolean,\r\n data: OrgEmailListItem[],\r\n }) => void\r\n}>\r\n({ data: { dirty: false, data: [] }, setData: null })\r\n\r\nconst EmployerEmailTriggersEditor: React.FC = (props) => {\r\n\r\n const { data: emailListState, setData: setEmailListState } = useContext(EmailListContext);\r\n\r\n function resetEmailListState(){\r\n setEmailListState({ dirty: false, data: props.data.notificationEmailList });\r\n }\r\n\r\n useEffect(() => {\r\n // Whenever the emailList query changes, update what the user sees\r\n if (props.data){\r\n resetEmailListState();\r\n }\r\n }, [ props.data ])\r\n\r\n function handleEmailListChange(_emailList: OrgEmailListItem[]){\r\n setEmailListState({ dirty: true, data: _emailList })\r\n }\r\n\r\n return (\r\n \r\n )\r\n}\r\n\r\nconst EmployerEmailTriggers: React.FC<{}> = (props) => {\r\n const [ selectedEmp, _setSelectedEmp ] = useState(null);\r\n const [ employerSearch, setEmployerSearch ] = useState('');\r\n\r\n const [ emailListState, setEmailListState ] =\r\n useState<{ dirty: boolean, data: OrgEmailListItem[] }>({ dirty: false, data: [] });\r\n\r\n const [ employers, { networkStatus, error, refetch } ] = useGetEmployersEmailList(employerSearch);\r\n\r\n const [ setEmailList, { loading: emailListUpdating } ] = useSetEmployerEmailList();\r\n\r\n const emailEditorRef = useRef(null);\r\n\r\n function handleSave(){\r\n // When user saves, update the email list in the db\r\n if (!emailEditorRef.current) return \r\n \r\n emailEditorRef.current.validateFieldsAndScroll((err: any) => {\r\n if (!err){\r\n let processed = emailListState.data.filter(i => i.email);\r\n processed = removeTypename(processed);\r\n setEmailList(selectedEmp._id, processed)\r\n .then(() => {\r\n message.success(\"Email triggers for \" + selectedEmp.name + \" updated successfully\");\r\n clearSelectedEmp();\r\n })\r\n .catch(() => message.error(\"Failed to update email triggers for \" + selectedEmp.name))\r\n }\r\n else\r\n {\r\n console.log(err)\r\n message.warning(
\r\n

No can do. You have some issues with the form you need to fix first.

\r\n {Object.keys(err).map((key) => {\r\n let idx = Number(key.split('-')[0]);\r\n let item = emailListState.data[idx];\r\n return

A field for '{item.email}' is invalid'

\r\n })}\r\n
, 5)\r\n }\r\n })\r\n }\r\n\r\n function setSelectedEmp(empData: EmployerStub){\r\n _setSelectedEmp(empData);\r\n setEmailListState({ dirty: false, data: [] });\r\n }\r\n\r\n function clearSelectedEmp(){\r\n _setSelectedEmp(null);\r\n setEmailListState({ dirty: false, data: [] });\r\n }\r\n\r\n let extra = []\r\n\r\n const refetchBtn = ,\r\n \r\n ]\r\n }\r\n else {\r\n cardBody =
\r\n String(e.target.value).toUpperCase()}\r\n initializeValueOnce={true}\r\n >\r\n \r\n \r\n {employerSearch ? \r\n {employers.map(e => (\r\n setSelectedEmp(e)}>\r\n \r\n \r\n ))}\r\n : (\r\n )}\r\n
\r\n extra = [refetchBtn];\r\n }\r\n\r\n return (\r\n Email triggers for {selectedEmp ? selectedEmp.name : 'employers'}}\r\n style={{ marginBottom: 12 }}\r\n extra={[\r\n
{extra}
\r\n ]}\r\n children={cardBody}\r\n />\r\n )\r\n}\r\n\r\nexport default EmployerEmailTriggers","import { Alert, Button, Card, Icon, Spin, message } from 'antd'\r\nimport { OrgEmailListItem } from 'common/types/org-email-list'\r\nimport { removeTypename } from 'common/util'\r\nimport CenteredLoadingScreen from 'components/CenteredLoadingScreen'\r\nimport OrgNotifEmailListEditor from 'components/org-notif-email-list-editor'\r\nimport 'css/Border.less'\r\nimport gql from 'graphql-tag'\r\nimport React, { useEffect, useRef, useState } from 'react'\r\nimport { MutationResult, QueryResult, useMutation, useQuery } from 'react-apollo'\r\n\r\nconst USER_ORG_QUERY = gql`\r\nquery GetUserOrgEmailList{\r\n GetUserOrganization {\r\n ... on Customer {\r\n _id\r\n name\r\n notificationEmailList {\r\n email\r\n options {\r\n optIn\r\n optInAll\r\n }\r\n }\r\n }\r\n ... on Employer {\r\n _id\r\n name\r\n notificationEmailList {\r\n email\r\n options {\r\n optIn\r\n optInAll\r\n }\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst SET_USER_ORG_EMAIL_LIST = gql`\r\nmutation SetUserOrgEmailList($emailList: [OrgEmailListItemInput!]!){\r\n SetUserOrgNotificationEmailList(emailList: $emailList){ \r\n ... on Customer {\r\n _id\r\n name\r\n notificationEmailList {\r\n email\r\n options {\r\n optIn\r\n optInAll\r\n }\r\n }\r\n }\r\n ... on Employer {\r\n _id\r\n name\r\n notificationEmailList {\r\n email\r\n options {\r\n optIn\r\n optInAll\r\n }\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nfunction useGetUserOrgEmailList(): [ OrgEmailListItem[], QueryResult ]{\r\n const result = useQuery(USER_ORG_QUERY, {\r\n fetchPolicy: 'cache-and-network'\r\n })\r\n\r\n let emailList = []\r\n\r\n if (result.data?.GetUserOrganization?.notificationEmailList){\r\n emailList = result.data.GetUserOrganization.notificationEmailList\r\n }\r\n return [ emailList, result ]\r\n}\r\n\r\nfunction useSetUserOrgEmailList(): [(emailList: OrgEmailListItem[]) => Promise, MutationResult] {\r\n const [ mutate, result ] = useMutation(SET_USER_ORG_EMAIL_LIST)\r\n\r\n function updateEmailList(emailList: OrgEmailListItem[]){\r\n return mutate({\r\n variables: { emailList },\r\n update: (cache, { data: { SetUserOrgNotificationEmailList } }) => {\r\n const data = cache.readQuery({ query: USER_ORG_QUERY });\r\n const org = data?.GetUserOrganization;\r\n\r\n if (!org) return;\r\n\r\n cache.writeQuery({\r\n query: USER_ORG_QUERY,\r\n data: {\r\n GetUserOrganization: {\r\n ...org,\r\n notificationEmailList: SetUserOrgNotificationEmailList?.notificationEmailList\r\n }\r\n }\r\n })\r\n }\r\n })\r\n }\r\n\r\n return [ updateEmailList, result ]\r\n}\r\n\r\nconst UserOrgEmailTriggers: React.FC<{}> = (props) => {\r\n const [ emailListState, setEmailListState ] =\r\n useState<{ dirty: boolean, data: OrgEmailListItem[] }>({ dirty: false, data: [] });\r\n \r\n const editorRef = useRef();\r\n\r\n const [ emailList, { data: queryData, loading, error, refetch } ] = useGetUserOrgEmailList();\r\n const [ setEmailList, { loading: emailListUpdating } ] = useSetUserOrgEmailList();\r\n\r\n function resetEmailListState(){\r\n setEmailListState({ dirty: false, data: emailList });\r\n }\r\n\r\n useEffect(() => {\r\n // Whenever the emailList query changes, update what the user sees\r\n if (emailList){\r\n resetEmailListState();\r\n }\r\n }, [ emailList ])\r\n\r\n const orgName = queryData?.GetUserOrganization?.name;\r\n\r\n function handleSave(){\r\n // When user saves, update the email list in the db\r\n if (!editorRef.current) return \r\n \r\n editorRef.current.validateFieldsAndScroll((err: any) => {\r\n if (!err){\r\n let processed = emailListState.data.filter(i => i.email);\r\n processed = removeTypename(processed);\r\n setEmailList(processed)\r\n .then(() => message.success(\"Email triggers for \" + orgName + \" updated successfully\"))\r\n .catch(() => message.error(\"Failed to update email triggers for \" + orgName))\r\n }\r\n else\r\n {\r\n console.log(err)\r\n message.warning(
\r\n

No can do. You have some issues with the form you need to fix first.

\r\n {Object.keys(err).map((key) => {\r\n let idx = Number(key.split('-')[0]);\r\n let item = emailListState.data[idx];\r\n return

A field for '{item.email}' is invalid'

\r\n })}\r\n
, 5)\r\n }\r\n })\r\n }\r\n\r\n function handleEmailListChange(_emailList: OrgEmailListItem[]){\r\n setEmailListState({ dirty: true, data: _emailList })\r\n }\r\n\r\n let editor = null;\r\n\r\n if (!error) editor = (\r\n \r\n )\r\n else editor = (\r\n \r\n )\r\n\r\n let extra = []\r\n\r\n if (emailListState.dirty){\r\n extra = [\r\n ,\r\n \r\n ]\r\n }\r\n else\r\n {\r\n extra = [\r\n )\r\n\r\n if (typeof props.renderSubmitBtn === 'function'){\r\n submitBtn = props.renderSubmitBtn(handleSubmitBtnClick);\r\n }\r\n\r\n function renderContent(){\r\n if (addPax){\r\n return \r\n \r\n \r\n \r\n \r\n

Passenger Editor

\r\n \r\n \r\n paxEditor.current.resetFields()}\r\n >Reset\r\n {submitBtn}\r\n \r\n
\r\n \r\n \r\n {hasSubmitSuccess ? (\r\n setHasSubmitSuccess(false)}\r\n />\r\n ) : null}\r\n {hasSubmitError ? (\r\n setHasSubmitError(false)}\r\n />\r\n ) : null}\r\n \r\n {({ data, loading, error, refetch }) => {\r\n if(refetchPerson){\r\n setRefetchPerson(false);\r\n refetch()\r\n }\r\n if (loading) return (\r\n
\r\n } />\r\n
\r\n )\r\n if (error){\r\n return \r\n }\r\n return (\r\n \r\n )\r\n }}\r\n \r\n
\r\n
\r\n
\r\n }\r\n if (hasSearched){\r\n return
\r\n setAddPax(true)}>Add New Passenger}\r\n />\r\n
\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 {props.onBackClicked ? (\r\n \r\n \r\n \r\n ) : null}\r\n \r\n \r\n \r\n \r\n {\r\n setAddPax(true);\r\n if (props.onPersonSelect){\r\n props.onPersonSelect(personId);\r\n }else{\r\n setSelectedPerson(personId);\r\n }\r\n }}\r\n tableMinHeight={750}\r\n onSearch={() => setHasSearched(true)}\r\n />\r\n \r\n \r\n \r\n {renderContent()}\r\n \r\n )\r\n}\r\n \r\nexport default PaxCheckIn;","import React, { useContext, useState, useEffect } from 'react';\r\nimport { Layout, Menu } from 'antd';\r\nimport { useHistory, useLocation } from 'react-router-dom';\r\nimport { GlobalAppStateContext } from 'context/global-app-state';\r\nimport windowSizes from 'common/windowSizes';\r\n\r\nconst { Sider } = Layout;\r\n\r\nconst DocksNav = () => {\r\n const { state: { sidebarCollapsed }, setState } = useContext(GlobalAppStateContext);\r\n const [ hasExpanded, setHasExpanded ] = useState(false);\r\n\r\n useEffect(() => {\r\n if (!sidebarCollapsed && !hasExpanded){\r\n setHasExpanded(true);\r\n }\r\n }, [ sidebarCollapsed ])\r\n\r\n const history = useHistory();\r\n const { pathname } = useLocation();\r\n\r\n function handleMenuClick({ key }){\r\n history.push(`/app/${key}`);\r\n if (window.innerWidth <= windowSizes.small){\r\n setState({ sidebarCollapsed: true })\r\n }\r\n }\r\n const pathArray = pathname.split('/').filter(path => path);\r\n\r\n var key;\r\n if (pathname.startsWith('/app/masterdata')){\r\n key = `${pathArray[1]}/${pathArray[2]}`\r\n }\r\n else{\r\n key = pathArray[1];\r\n }\r\n\r\n let menu = \r\n \r\n Boats\r\n \r\n \r\n Check In\r\n \r\n \r\n Locations\r\n Employers\r\n Vessels\r\n \r\n \r\n\r\n if (!hasExpanded) menu = null;\r\n\r\n return (\r\n \r\n {menu}\r\n \r\n )\r\n\r\n}\r\n\r\nexport default DocksNav","import React from 'react';\r\nimport { withApollo } from 'react-apollo';\r\nimport WithOrgData from './WithOrgData';\r\nimport gql from 'graphql-tag';\r\n\r\nconst PAX_ISN_CHECK = gql`\r\nmutation PaxIsnCheck($_id: ID! $tpID: ID!){\r\n setPassengerIsnCheck(_id: $_id tpID: $tpID){\r\n _id\r\n lastIsnResultWithHeader {\r\n isn_customer\r\n isn_ownerid\r\n success\r\n error_message\r\n quick_check_status\r\n reason\r\n qc_count\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst CREW_ISN_CHECK = gql`\r\nmutation CrewIsnCheck($_id: ID! $tpID: ID!){\r\n setBoatCrewIsnCheck(_id: $_id tpID: $tpID){\r\n _id\r\n lastIsnResultWithHeader {\r\n isn_customer\r\n isn_ownerid\r\n success\r\n error_message\r\n quick_check_status\r\n reason\r\n qc_count\r\n qc_result {\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n selectedResult {\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nclass IsnChecker extends React.Component {\r\n state = {\r\n results: []\r\n }\r\n isnCheckRunning = () => {\r\n const runningIsnChecks = this.state.results.filter(item => item && item.running)\r\n return runningIsnChecks.length > 0\r\n }\r\n run = async (passengers) => {\r\n if (this.isnCheckRunning()) return\r\n const outbound = passengers.filter(pax => pax.transitType !== 'INBOUND')\r\n const results = outbound.map(pax => ({\r\n _id: pax._id,\r\n running: true,\r\n error: null\r\n }))\r\n await this.setState({ results })\r\n const runPax = outbound.map(pax => {\r\n return this.checkPassenger(pax)\r\n })\r\n return Promise.all(runPax)\r\n }\r\n checkPassenger = (pax) => {\r\n const { client, orgData } = this.props;\r\n return client.mutate({\r\n mutation: pax.__typename === 'BoatCrew' ? CREW_ISN_CHECK : PAX_ISN_CHECK,\r\n variables: {\r\n _id: pax._id,\r\n tpID: orgData.transporter._id\r\n }\r\n })\r\n .then(result => {\r\n const newResults = this.state.results.map(item => {\r\n if (item && item._id === pax._id){\r\n return {\r\n _id: pax._id,\r\n running: false,\r\n error: null,\r\n result\r\n }\r\n }\r\n return item\r\n })\r\n this.setState({ results: newResults })\r\n })\r\n .catch(error => {\r\n const newResults = this.state.results.map(item => {\r\n if (item && item._id === pax._id){\r\n return {\r\n _id: pax._id,\r\n running: false,\r\n error\r\n }\r\n }\r\n return item\r\n })\r\n this.setState({ results: newResults })\r\n })\r\n }\r\n clearResultError = (id) => {\r\n const results = this.state.results.map(result => {\r\n if (result._id === id){\r\n return {\r\n ...result,\r\n error: null\r\n }\r\n }\r\n return result\r\n })\r\n this.setState({ results })\r\n }\r\n render(){\r\n const { component: Component, ...rest } = this.props;\r\n return (\r\n \r\n )\r\n }\r\n}\r\n\r\nconst IsnCheckerWithData = WithOrgData( withApollo(IsnChecker) )\r\n\r\n// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default (component) => {\r\n return props => (\r\n \r\n )\r\n}","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery GetCrewMember($_id: ID!){\r\n getBoatCrew(_id: $_id){\r\n _id\r\n _rev\r\n contactInfo {\r\n name {\r\n firstName\r\n lastName\r\n }\r\n }\r\n lastIsnResultWithHeader {\r\n success\r\n qc_count\r\n isn_customer\r\n isn_ownerid\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n trainingStatus\r\n allowed\r\n companyID\r\n quickCheckStatus\r\n errorMessage\r\n isnId\r\n firstName\r\n lastName\r\n companyName\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n dataAsOf\r\n reason\r\n }\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n allowed\r\n companyID\r\n quickCheckStatus\r\n trainingStatus\r\n errorMessage\r\n isnId\r\n firstName\r\n lastName\r\n companyName\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n dataAsOf\r\n reason\r\n }\r\n }\r\n authorization {\r\n onWhiteList\r\n brdRestriction_Isn {\r\n status\r\n type\r\n notes\r\n reason\r\n }\r\n }\r\n }\r\n}\r\n`","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nmutation PaxMutation($_id: ID!, $_rev: ID!, $payload: AWSJSON!){\r\n setBoatCrewISNSelection(_id: $_id, _rev: $_rev, payload: $payload){\r\n _id\r\n lastIsnResultWithHeader {\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n allowed\r\n companyID\r\n quickCheckStatus\r\n trainingStatus\r\n errorMessage\r\n isnId\r\n firstName\r\n lastName\r\n companyName\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n dataAsOf\r\n reason\r\n }\r\n }\r\n }\r\n}\r\n`","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nmutation CrewIsnCheck($_id: ID! $tpID: ID!){\r\n setBoatCrewIsnCheck(_id: $_id tpID: $tpID){\r\n _id\r\n lastIsnResultWithHeader {\r\n isn_customer\r\n isn_ownerid\r\n success\r\n error_message\r\n quick_check_status\r\n reason\r\n qc_count\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n }\r\n }\r\n}\r\n`","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery CrewISNResultQuery($_id: ID!){\r\n getBoatCrew(_id: $_id){\r\n _id\r\n _rev\r\n contactInfo {\r\n name {\r\n firstName\r\n lastName\r\n }\r\n }\r\n lastIsnResultWithHeader {\r\n success\r\n qc_count\r\n isn_customer\r\n isn_ownerid\r\n error_message\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n trainingStatus\r\n allowed\r\n companyID\r\n quickCheckStatus\r\n errorMessage\r\n isnId\r\n firstName\r\n lastName\r\n companyName\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n dataAsOf\r\n reason\r\n },\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n allowed\r\n companyID\r\n quickCheckStatus\r\n trainingStatus\r\n errorMessage\r\n isnId\r\n firstName\r\n lastName\r\n companyName\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n dataAsOf\r\n reason\r\n }\r\n }\r\n }\r\n}\r\n`","import React, { Component } from 'react';\r\nimport { Query, Mutation } from 'react-apollo';\r\nimport PropTypes from 'prop-types';\r\nimport { QCResult } from '../QCResult';\r\nimport SetCrewISNSelectionMutation from './SetCrewISNSelectionMutation';\r\nimport { message, Alert, Spin, Button, Divider } from 'antd';\r\nimport LoadingContent from '../../LoadingContent';\r\nimport ISNCheck from './ISNCheck';\r\nimport WithOrgData from '../../WithOrgData';\r\nimport CrewISNResultQuery from './CrewISNResultQuery';\r\n\r\nclass QCResultWithData extends Component {\r\n render() {\r\n const { crewId, fetchPolicy, showISNCheck=true, orgData, ...restProps } = this.props;\r\n return (\r\n \r\n {({ data, loading, error }) => {\r\n const crewMember = data && data.getBoatCrew;\r\n if (!crewMember && loading ) return \r\n const isnData = crewMember && crewMember.lastIsnResultWithHeader;\r\n const renderQCResult = () => (\r\n \r\n {error ? (\r\n \r\n ) : null}\r\n \r\n {\r\n (setActive) => (\r\n {\r\n const payload = {\r\n allowed: data.allowed,\r\n assignedActivities: data.assignedActivities,\r\n companyID: data.companyID,\r\n companyName: data.companyName,\r\n dataAsOf: data.dataAsOf,\r\n errorMessage: data.errorMessage,\r\n firstName: data.firstName,\r\n isnId: data.isnId,\r\n lastName: data.lastName,\r\n mostRecentTrainingExpirationDate: data.mostRecentTrainingExpirationDate,\r\n mostRecentTrainingQualificationExpirationName: data.mostRecentTrainingQualificationExpirationName,\r\n quickCheckStatus: data.quickCheckStatus,\r\n reason: data.reason,\r\n trainingStatus: data.trainingStatus\r\n }\r\n setActive({\r\n variables: {\r\n _id: crewMember._id,\r\n _rev: crewMember._rev,\r\n payload: JSON.stringify(payload)\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setIsnSelection: {\r\n __typename: 'BoatCrew',\r\n _id: crewMember._id,\r\n lastIsnResultWithHeader: {\r\n __typename: 'IsnResultWithHeader',\r\n selectedResult: {\r\n __typename: 'IsnQcResult',\r\n ...payload\r\n }\r\n }\r\n }\r\n }\r\n })\r\n .then(() => message.success('Successfully updated selected ISN result'))\r\n .catch(() => message.error('Failed to update selected ISN result'))\r\n }}\r\n {...restProps}\r\n />\r\n )\r\n }\r\n \r\n \r\n )\r\n if (showISNCheck){\r\n return (\r\n \r\n {(runISNCheck, { loading, error }) => (\r\n
\r\n
\r\n {runISNCheck ? (\r\n
\r\n runISNCheck()}\r\n >Run ISN Check\r\n
\r\n ) : null}\r\n {!loading && error ? (\r\n \r\n ) : null}\r\n \r\n
\r\n {renderQCResult()}\r\n
\r\n \r\n )}\r\n \r\n )\r\n }\r\n return renderQCResult();\r\n }}\r\n \r\n );\r\n }\r\n}\r\n\r\nQCResultWithData.propTypes = {\r\n crewId: PropTypes.string.isRequired,\r\n fetchPolicy: PropTypes.string,\r\n showISNCheck: PropTypes.bool\r\n}\r\n \r\nexport default WithOrgData(QCResultWithData);","import React, { Component } from 'react';\r\nimport { Query, Mutation } from 'react-apollo';\r\nimport PropTypes from 'prop-types';\r\nimport ISNResultQuery from '../../../Queries/ISNResultQuery';\r\nimport { QCResult } from '../QCResult';\r\nimport SetPaxSelectedISNResult from '../../../Mutations/SetPaxSelectedISNResult';\r\nimport { message, Alert, Spin, Button, Divider } from 'antd';\r\nimport LoadingContent from '../../LoadingContent';\r\nimport ISNCheck from '../../../Mutations/ISNCheck';\r\nimport WithOrgData from '../../WithOrgData';\r\n\r\nclass QCResultWithData extends Component {\r\n render() {\r\n const { paxId, fetchPolicy, showISNCheck=true, orgData, ...restProps } = this.props;\r\n return (\r\n \r\n {({ data, loading, error }) => {\r\n const passenger = data && data.getPassenger;\r\n if (!passenger && loading ) return \r\n const isnData = passenger && passenger.lastIsnResultWithHeader;\r\n const selectedResult = isnData?.selectedResult;\r\n if (selectedResult?.reason === 'WHITELISTED'){\r\n return 'Whitelisted';\r\n }\r\n const renderQCResult = () => (\r\n \r\n {error ? (\r\n \r\n ) : null}\r\n \r\n {\r\n (setActive) => (\r\n {\r\n const payload = {\r\n allowed: data.allowed,\r\n assignedActivities: data.assignedActivities,\r\n companyID: data.companyID,\r\n companyName: data.companyName,\r\n dataAsOf: data.dataAsOf,\r\n errorMessage: data.errorMessage,\r\n firstName: data.firstName,\r\n isnId: data.isnId,\r\n lastName: data.lastName,\r\n mostRecentTrainingExpirationDate: data.mostRecentTrainingExpirationDate,\r\n mostRecentTrainingQualificationExpirationName: data.mostRecentTrainingQualificationExpirationName,\r\n quickCheckStatus: data.quickCheckStatus,\r\n reason: data.reason,\r\n trainingStatus: data.trainingStatus\r\n }\r\n setActive({\r\n variables: {\r\n _id: passenger._id,\r\n _rev: passenger._rev,\r\n payload: JSON.stringify(payload)\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setIsnSelection: {\r\n __typename: 'PaxNode',\r\n _id: passenger._id,\r\n lastIsnResultWithHeader: {\r\n __typename: 'IsnResultWithHeader',\r\n selectedResult: {\r\n __typename: 'IsnQcResult',\r\n ...payload\r\n }\r\n }\r\n }\r\n }\r\n })\r\n .then(() => message.success('Successfully updated selected ISN result'))\r\n .catch(() => message.error('Failed to update selected ISN result'))\r\n }}\r\n {...restProps}\r\n />\r\n )\r\n }\r\n \r\n \r\n )\r\n if (showISNCheck){\r\n return (\r\n \r\n {(runISNCheck, { loading, error }) => (\r\n
\r\n
\r\n {runISNCheck ? (\r\n
\r\n runISNCheck()}\r\n >Run ISN Check\r\n
\r\n ) : null}\r\n {!loading && error ? (\r\n \r\n ) : null}\r\n \r\n
\r\n {renderQCResult()}\r\n
\r\n \r\n )}\r\n \r\n )\r\n }\r\n return renderQCResult();\r\n }}\r\n \r\n );\r\n }\r\n}\r\n\r\nQCResultWithData.propTypes = {\r\n paxId: PropTypes.string.isRequired,\r\n fetchPolicy: PropTypes.string,\r\n showISNCheck: PropTypes.bool\r\n}\r\n \r\nexport default WithOrgData(QCResultWithData);","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { OverrideCard } from '../OverrideCard';\r\nimport { Tabs, Button } from 'antd';\r\nimport Override from '../../Override';\r\nimport { CrewQCResult } from '../CrewQCResult';\r\nimport { PaxQCResult } from '../PaxQCResult';\r\n\r\nconst renderOverrideTab = (data) => {\r\n try{\r\n var isGreen = false;\r\n var isOverridden = false;\r\n try{\r\n const quickCheckStatus = data.lastIsnResultWithHeader.selectedResult.quickCheckStatus;\r\n try{\r\n isGreen = quickCheckStatus.toLowerCase() === 'green';\r\n }\r\n catch(err){\r\n console.error(err.message);\r\n }\r\n }catch(err){\r\n console.error(err.message)\r\n }\r\n\r\n try{\r\n const brdStatus = data.authorization.brdRestriction_Isn.status;\r\n isOverridden = brdStatus === 'OVERRIDDEN';\r\n }catch(err){\r\n console.error(err.message)\r\n }\r\n\r\n if (!(isGreen || isOverridden)){\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n }\r\n catch(err){console.error(err.message);}\r\n return null;\r\n}\r\n\r\nclass ISNManager extends Component {\r\n hasOverride = () => {\r\n try{\r\n return this.props.data.authorization.brdRestriction_Isn.status === 'OVERRIDDEN'\r\n }\r\n catch(err){\r\n return false\r\n }\r\n }\r\n getOverride = () => {\r\n try{\r\n return this.props.data.authorization.brdRestriction_Isn\r\n }\r\n catch(err){\r\n return null\r\n }\r\n }\r\n render() {\r\n const { data, showISNCheck=true } = this.props;\r\n const dataType = (data && data.__typename) || 'PaxNode';\r\n return (\r\n
\r\n {this.hasOverride() ? (\r\n \r\n ) : null}\r\n this.props.runISNCheck(data._id)}\r\n loading={this.props.isnCheckRunning}\r\n >Run ISN Check\r\n ) : null\r\n }\r\n >\r\n \r\n {dataType === 'PaxNode' ? (\r\n \r\n ) : null}\r\n {dataType === 'BoatCrew' ? (\r\n \r\n ) : null}\r\n \r\n {renderOverrideTab(data)}\r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nISNManager.propTypes = {\r\n data: PropTypes.shape({\r\n _id: PropTypes.string.isRequired\r\n }).isRequired,\r\n showISNCheck: PropTypes.bool,\r\n runISNCheck: PropTypes.func,\r\n isnCheckRunning: PropTypes.bool\r\n}\r\n \r\nexport default ISNManager;","import React, { Component } from 'react';\r\nimport { Query } from 'react-apollo';\r\nimport CrewQuery from './CrewQuery';\r\nimport PropTypes from 'prop-types';\r\nimport { Alert, Spin } from 'antd';\r\nimport LoadingContent from '../../LoadingContent';\r\nimport { ISNManager } from '../ISNManager';\r\n\r\nclass CrewISN extends Component {\r\n render() {\r\n const { crewId, fetchPolicy, showISNCheck=true, ...restProps } = this.props;\r\n return (\r\n \r\n {({ data, loading, error }) => {\r\n const crewMember = data && data.getBoatCrew;\r\n if (!crewMember && loading ) return \r\n return (\r\n \r\n {error ? (\r\n \r\n ) : null}\r\n {crewMember ? (\r\n \r\n ) : null}\r\n \r\n )\r\n }}\r\n \r\n );\r\n }\r\n}\r\n\r\nCrewISN.propTypes = {\r\n crewId: PropTypes.string.isRequired,\r\n fetchPolicy: PropTypes.string,\r\n showISNCheck: PropTypes.bool\r\n}\r\n \r\nexport default CrewISN;","import Button, { ButtonProps } from 'antd/lib/button';\r\nimport MCIcon from 'components/icon';\r\nimport React from 'react';\r\nimport cn from 'classnames';\r\nimport './style.less';\r\n\r\nexport interface LiveColoredButtonProps extends Omit {\r\n clickable?: boolean,\r\n type?: string\r\n}\r\n\r\nconst LiveColoredButton: React.FC = ({ type, clickable=true, children, className, ...props }) => {\r\n let clsName = 'mc-live-colored-button';\r\n if (type){\r\n clsName += (' mc-live-colored-button-' + type)\r\n }\r\n if (!clickable){\r\n clsName += ' mc-live-colored-button-unclickable';\r\n }\r\n let btn;\r\n if (clickable){\r\n btn = \r\n }\r\n else\r\n {\r\n btn =
\r\n {children}\r\n
\r\n }\r\n return btn;\r\n}\r\n\r\nexport default LiveColoredButton","import React from 'react';\r\n\r\nfunction ColorKey({ type, text, ...restProps }){\r\n return
\r\n \r\n {text}\r\n
\r\n}\r\n\r\nexport default ColorKey;","import React from 'react';\r\nimport { Breadcrumb, Spin, Alert, Card, Row, Col, Table, Button, Popconfirm, message, Popover, Icon, Badge, Drawer, Modal, Tooltip, Dropdown, Menu } from 'antd';\r\nimport gql from 'graphql-tag';\r\nimport LoadingContent from '../../../LoadingContent';\r\nimport { graphql, Query } from 'react-apollo';\r\nimport compose from 'lodash.flowright';\r\nimport { Link, withRouter } from 'react-router-dom';\r\nimport commonColumns from '../../../../common/table/columns';\r\nimport withISNCheck from '../../../withISNCheck';\r\nimport IsnCheckStatusButton from '../../../IsnCheckStatusButton';\r\nimport WithOrgData from '../../../WithOrgData';\r\nimport { PaxISNWithData } from '../../../isn/PaxISN';\r\nimport { PassengerEditorWithData } from '../../../PassengerEditor';\r\nimport { CrewISN } from '../../../isn/CrewISN';\r\nimport pluralize from 'pluralize';\r\nimport { withUserGroups } from '../../../userGroup';\r\nimport withBoardingRestrictionDrawer from 'components/withBoardingRestrictionDrawer';\r\nimport ETable from 'components/enchanced-antd-table';\r\nimport LiveColoredButton from 'components/live-2/LiveColoredButton';\r\nimport ColorKey from 'components/live-2/ColorKey';\r\nimport {getISNPassFail} from \"common/isn\";\r\n\r\nconst FINALIZE = gql`\r\nmutation FinalizeBoat($_id: ID! $tpID: ID!){\r\n finalizeBoat(_id: $_id tpID: $tpID){\r\n _id\r\n dockState\r\n state\r\n paxIDList {\r\n _id\r\n nodeState\r\n }\r\n cgoIDList {\r\n _id\r\n nodeState\r\n approvedBy\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst BOAT = gql`\r\nquery Boat($_id: ID!){\r\n getBoat(_id: $_id){\r\n _id\r\n desig\r\n boatCrewIDs {\r\n _id\r\n __typename\r\n contactInfo {\r\n name {\r\n firstName\r\n lastName\r\n }\r\n }\r\n locationID {\r\n _id\r\n name\r\n }\r\n authorization {\r\n onWhiteList\r\n brdRestriction_Isn {\r\n status\r\n type\r\n notes\r\n reason\r\n }\r\n brdRestriction_Illness {\r\n status\r\n type\r\n notes\r\n reason\r\n }\r\n brdRestriction_Quarantined {\r\n status\r\n type\r\n notes\r\n reason\r\n }\r\n }\r\n lastIsnResultWithHeader {\r\n isn_customer\r\n isn_ownerid\r\n success\r\n error_message\r\n quick_check_status\r\n reason\r\n qc_count\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n }\r\n }\r\n paxIDList {\r\n _id\r\n __typename\r\n employerID {\r\n _id\r\n name\r\n }\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n personID {\r\n _id\r\n dob\r\n nation\r\n }\r\n paxWeight\r\n bagWeight\r\n bagCount\r\n lastName\r\n firstName\r\n transitType\r\n checkedInTime\r\n checkInType\r\n authorization {\r\n onWhiteList\r\n brdRestriction_Isn {\r\n status\r\n type\r\n notes\r\n reason\r\n }\r\n brdRestriction_Illness {\r\n status\r\n type\r\n notes\r\n reason\r\n }\r\n brdRestriction_Quarantined {\r\n status\r\n type\r\n notes\r\n reason\r\n }\r\n }\r\n lastIsnResultWithHeader {\r\n isn_customer\r\n isn_ownerid\r\n success\r\n error_message\r\n quick_check_status\r\n reason\r\n qc_count\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n }\r\n }\r\n destinationIDs {\r\n _id\r\n name\r\n type\r\n block\r\n field\r\n ownerOrg\r\n modifiedTs\r\n }\r\n departureIDs {\r\n _id\r\n name\r\n type\r\n block\r\n field\r\n ownerOrg\r\n modifiedTs\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst REMOVE_PAX = gql`\r\nmutation RemPaxFromBoat(\r\n $boatID: ID!\r\n $paxIDs: [ID]!\r\n $tpID: ID!\r\n){\r\n removePassengersFromBoat(\r\n boatID: $boatID\r\n paxIDs: $paxIDs\r\n tpID: $tpID\r\n ) {\r\n _id\r\n paxIDList {\r\n _id\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst MUTATION_MAKE_PAX_ONSITE = gql`\r\nmutation MakePaxOnSite($paxID: ID!){\r\n ChangePaxCheckInType(paxID: $paxID, newCheckInType: \"WEBDOCKS\"){\r\n _id\r\n checkInType\r\n }\r\n}\r\n`\r\n\r\nclass BoatDetail extends React.Component {\r\n state = {\r\n tabKey: 'pax',\r\n finalizing: false,\r\n isnDrawer: {\r\n id: null,\r\n visible : null,\r\n type: null\r\n },\r\n editPaxModal: {\r\n id: null,\r\n visible: null\r\n },\r\n selectedPax: [],\r\n makingPaxOnSite: null\r\n }\r\n\r\n getPaxPassFail = (pax) => {\r\n let isnCheckPax = this.props.isncheck.results.find(res => res._id === pax);\r\n return getISNPassFail(isnCheckPax || pax)\r\n }\r\n\r\n setIsnDrawer = (visible, id, type) => {\r\n this.setState({\r\n isnDrawer: {\r\n id: id || this.state.id,\r\n visible,\r\n type\r\n }\r\n })\r\n }\r\n setPaxModal = (visible, id) => {\r\n this.setState({\r\n editPaxModal: {\r\n id: id || this.state.editPaxModal.id,\r\n visible\r\n }\r\n })\r\n }\r\n componentDidMount(){\r\n this.props.data.startPolling(5000)\r\n }\r\n\r\n // Validate pax before finalizing\r\n validatePax = () => {\r\n if (!this.props.data || !this.props.data.getBoat){\r\n return null;\r\n }\r\n const { getBoat: { paxIDList } } = this.props.data;\r\n\r\n for (const pax of paxIDList){\r\n const passFail = this.getPaxPassFail(pax);\r\n if (!passFail.passed){\r\n return {\r\n valid: false,\r\n reason: 'One or more passengers has a bad ISN status. All passengers with a bad ISN status must be overridden first.'\r\n };\r\n }\r\n }\r\n\r\n return {\r\n valid: true\r\n };\r\n }\r\n\r\n finalize = () => {\r\n const { mutate, history } = this.props;\r\n this.setState({ finalizing: true })\r\n\r\n const paxValResult = this.validatePax();\r\n if (!paxValResult.valid){\r\n message.error(paxValResult.reason, 10);\r\n return;\r\n }\r\n\r\n mutate()\r\n .then(() => {\r\n message.success(\"Boat successfully finalized\")\r\n history.push('/app/boats')\r\n })\r\n .catch(error => {\r\n message.error(\"Failed to finalize boat\")\r\n })\r\n .then(() => this.setState({ finalizing: false }))\r\n }\r\n handleISNCheck = async () => {\r\n const startTab = this.state.tabKey === 'crew' ? 'crew' : 'pax';\r\n const endtab = startTab === 'pax' ? 'crew' : 'pax';\r\n const { getBoat: { paxIDList, boatCrewIDs } } = this.props.data;\r\n this.props.data.stopPolling()\r\n const runIsnCheck = (currentTab) => {\r\n this.setState({ tabKey: currentTab });\r\n if (currentTab === 'pax'){\r\n return this.props.isncheck.run(paxIDList)\r\n }else if (boatCrewIDs.length){\r\n return this.props.isncheck.run(boatCrewIDs)\r\n }\r\n }\r\n await runIsnCheck(startTab);\r\n await runIsnCheck(endtab);\r\n this.setState({ tabKey: startTab })\r\n \r\n this.props.data.startPolling(5000)\r\n }\r\n renderDesig = () => {\r\n const { data: { getBoat, loading } } = this.props;\r\n return (loading && !getBoat) ? Loading : getBoat && getBoat.desig\r\n }\r\n removePassengers = () => {\r\n const { removePassengers } = this.props;\r\n const { data: { getBoat: boat } } = this.props;\r\n const { selectedPax } = this.state;\r\n removePassengers({\r\n variables: {\r\n paxIDs: this.state.selectedPax,\r\n boatID: this.props.match.params.boatid,\r\n tpID: this.props.orgData.transporter._id\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n removePassengersFromBoat: {\r\n __typename: 'BoatNode',\r\n _id: boat._id,\r\n paxIDList: boat.paxIDList.filter(pax => !selectedPax.includes(pax._id))\r\n }\r\n }\r\n })\r\n .then(() => {\r\n message.success('Boat successfully updated');\r\n this.setState({ selectedPax: [] })\r\n })\r\n .catch(() => message.error('Failed to update boat due to error'))\r\n }\r\n makePaxOnSite = (paxID) => {\r\n const { makePaxOnSite } = this.props;\r\n this.setState({ makingPaxOnSite: paxID });\r\n\r\n makePaxOnSite({\r\n variables: {\r\n paxID: paxID\r\n }\r\n })\r\n .then(() => {\r\n this.setState({ makingPaxOnSite: null });\r\n message.success(\"Passenger made on-site successfully.\");\r\n })\r\n .catch(() => {\r\n this.setState({ makingPaxOnSite: null });\r\n message.error(\"Failed to make passenger on-site due to an error.\")\r\n })\r\n }\r\n renderContent = () => {\r\n const { data: { getBoat, loading, error }, isncheck, userGroups } = this.props;\r\n if (loading) return \r\n if (error) return \r\n const destLen = getBoat.destinationIDs ? getBoat.destinationIDs.length : 0;\r\n const departLen = getBoat.departureIDs ? getBoat.departureIDs.length : 0;\r\n const paxLen = getBoat.paxIDList ? getBoat.paxIDList.length : 0;\r\n const crewLen = getBoat.boatCrewIDs ? getBoat.boatCrewIDs.length : 0;\r\n const renderCrew = (crewMembers) => (\r\n record._id}\r\n size=\"small\"\r\n className=\"mc-table\"\r\n pagination={false}\r\n columns={[\r\n ...commonColumns.crew.some(['name', 'location']),\r\n {\r\n ...commonColumns.crew.columns.isn,\r\n render: (text, record) => {\r\n const isnCheckResult = isncheck.results.find(res => res._id === record._id);\r\n if (isnCheckResult){\r\n if (isnCheckResult.running){\r\n return (\r\n Checking\r\n )\r\n }\r\n else if (isnCheckResult.error){\r\n const message = isnCheckResult.error.message.replace('GraphQL error: NotFoundError: ', '')\r\n const content = {message}\r\n return (\r\n \r\n \r\n Error\r\n \r\n {\r\n isncheck.clearResultError(record._id)\r\n }}>\r\n \r\n )\r\n }\r\n }\r\n if (record.transitType !== 'INBOUND'){\r\n return {\r\n this.setIsnDrawer(true, record._id, 'crew')\r\n }} />\r\n }\r\n return null\r\n }\r\n }\r\n ]}\r\n />\r\n )\r\n const renderPassengers = (passengers) => {\r\n const canRemovePax = userGroups.includes('flytsuite.docks.removepassenger');\r\n const restriction = commonColumns.pax.columns.restrictions;\r\n return (\r\n
\r\n
\r\n {canRemovePax ? (\r\n \r\n Are you sure you want to remove these passengers from this boat? This action cannot be undone!\r\n \r\n }\r\n onConfirm={() => this.removePassengers()}\r\n >\r\n \r\n {this.state.selectedPax.length ? \r\n `Remove ${this.state.selectedPax.length} ${pluralize('Passenger', this.state.selectedPax.length)}` :\r\n 'Remove Passengers'\r\n }\r\n \r\n \r\n ) : (\r\n \r\n You do not have permission to remove passengers\r\n \r\n )}\r\n \r\n
\r\n

Pax Name Color Legend

\r\n \r\n \r\n
\r\n \r\n \r\n }\r\n >\r\n \r\n \r\n
\r\n record._id}\r\n size=\"small\"\r\n className=\"mc-table mc-table-scroll-auto mc-table-header-nowrap\"\r\n style={{ maxWidth: '100%' }}\r\n flexMode\r\n bordered\r\n pagination={false}\r\n rowSelection={ canRemovePax && {\r\n selectedRowKeys: this.state.selectedPax,\r\n onChange: (keys) => this.setState({ selectedPax: keys })\r\n }}\r\n columns={[\r\n {\r\n ...commonColumns.pax.columns.name,\r\n render: (_, record) => (\r\n \r\n this.setPaxModal(true, record._id)}>{`${record.lastName}, ${record.firstName}`}\r\n \r\n )\r\n },\r\n ...commonColumns.pax.some(['employer', 'weight', 'bagWeight', 'bagCount', 'checkedIn', 'departure', 'destination']),\r\n {\r\n ...commonColumns.pax.columns.restrictions,\r\n render: (text, record, index) => (\r\n restriction.render(text, record, index, () => this.props.boardingRestrictionsDrawer.open(record._id))\r\n )\r\n },\r\n {\r\n ...commonColumns.pax.columns.isn,\r\n render: (text, record) => {\r\n const isnCheckResult = isncheck.results.find(res => res._id === record._id);\r\n if (isnCheckResult){\r\n if (isnCheckResult.running){\r\n return (\r\n Checking\r\n )\r\n }\r\n else if (isnCheckResult.error){\r\n const message = isnCheckResult.error.message.replace('GraphQL error: NotFoundError: ', '')\r\n const content = {message}\r\n return (\r\n \r\n \r\n Error\r\n \r\n {\r\n isncheck.clearResultError(record._id)\r\n }}>\r\n \r\n )\r\n }\r\n }\r\n if (record.transitType !== 'INBOUND'){\r\n return {\r\n this.setIsnDrawer(true, record._id, 'pax')\r\n }} />\r\n }\r\n return null\r\n }\r\n },\r\n {\r\n title: 'Actions',\r\n key: 'actions',\r\n width: 40,\r\n render: (_, record) => {\r\n if (record.checkInType === 'EXPECTED'){\r\n return \r\n this.makePaxOnSite(record._id)}\r\n >\r\n Make On-Site\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 renderLocations = (locations) => (\r\n record._id}\r\n size=\"small\"\r\n className=\"mc-table\"\r\n pagination={false}\r\n columns={commonColumns.location.all()}\r\n />\r\n )\r\n const tabContent = {\r\n depart: renderLocations(getBoat.departureIDs),\r\n dest: renderLocations(getBoat.destinationIDs),\r\n pax: renderPassengers(getBoat.paxIDList),\r\n crew: renderCrew(getBoat.boatCrewIDs)\r\n }\r\n const Count = (props) => \r\n return (\r\n \r\n Passengers\r\n \r\n \r\n )\r\n },\r\n {\r\n key: 'crew',\r\n tab: (\r\n
\r\n Crew Members\r\n \r\n
\r\n )\r\n },\r\n {\r\n key: 'depart',\r\n tab: (\r\n
\r\n Departures\r\n \r\n
\r\n )\r\n },\r\n {\r\n key: 'dest',\r\n tab: (\r\n
\r\n Destinations\r\n \r\n
\r\n )\r\n }\r\n ]}\r\n onTabChange={(tabKey) => this.setState({ tabKey })}\r\n activeTabKey={this.state.tabKey}\r\n >\r\n {tabContent[this.state.tabKey]}\r\n \r\n )\r\n }\r\n render(){\r\n const { isncheck } = this.props;\r\n\r\n let cannotFinalizeReason = null;\r\n\r\n const paxValResult = this.validatePax();\r\n\r\n if (paxValResult && !paxValResult.valid){\r\n cannotFinalizeReason = paxValResult.reason;\r\n }\r\n\r\n console.debug(paxValResult, cannotFinalizeReason);\r\n\r\n return (\r\n
\r\n
\r\n \r\n \r\n Live Boats\r\n \r\n \r\n {this.renderDesig()}\r\n \r\n \r\n \r\n \r\n

{this.renderDesig()}

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Finalize\r\n \r\n \r\n \r\n \r\n
\r\n {cannotFinalizeReason ? (\r\n \r\n

{cannotFinalizeReason}

\r\n Re-run ISN Check\r\n
\r\n }\r\n />\r\n ) : null}\r\n
\r\n {this.renderContent()}\r\n
\r\n
\r\n this.setPaxModal(false)}\r\n width=\"50rem\"\r\n title=\"Edit Passenger\"\r\n footer={false}\r\n >\r\n {this.state.editPaxModal.id ? this.setPaxModal(false)} /> : null}\r\n \r\n {this.state.isnDrawer.type === 'pax' ? (\r\n \r\n {({ data, loading, error }) => {\r\n const crewMember = data && data.getPassenger;\r\n var title;\r\n title = crewMember ? `${crewMember.lastName}, ${crewMember.firstName}` : '';\r\n if (loading){\r\n title = 'Loading...'\r\n }\r\n return (\r\n this.setIsnDrawer(false)}\r\n closable\r\n >\r\n {error ? : null}\r\n {crewMember ? : null}\r\n \r\n )\r\n }}\r\n \r\n ) : null}\r\n {this.state.isnDrawer.type === 'crew' ? (\r\n \r\n {({ data, loading, error }) => {\r\n const crewMember = data && data.getBoatCrew;\r\n const contactInfo = crewMember && crewMember.contactInfo;\r\n const name = contactInfo && contactInfo.name;\r\n var title;\r\n title = crewMember ? `${name.lastName}, ${name.firstName}` : '';\r\n if (loading){\r\n title = 'Loading...'\r\n }\r\n return (\r\n this.setIsnDrawer(false)}\r\n closable\r\n >\r\n {error ? : null}\r\n {crewMember ? : null}\r\n \r\n )\r\n }}\r\n \r\n ) : null}\r\n \r\n )\r\n }\r\n}\r\n\r\nconst BoatDetailWithData = compose(\r\n withRouter,\r\n withISNCheck,\r\n WithOrgData,\r\n withUserGroups,\r\n withBoardingRestrictionDrawer,\r\n graphql(\r\n BOAT,\r\n {\r\n options: props => {\r\n return {\r\n variables: {\r\n _id: props.match.params.boatid\r\n },\r\n fetchPolicy: 'network-only'\r\n }\r\n }\r\n }\r\n ),\r\n graphql(\r\n FINALIZE,\r\n {\r\n options: props => {\r\n return {\r\n variables: {\r\n _id: props.match.params.boatid,\r\n tpID: props.orgData.transporter._id\r\n }\r\n }\r\n }\r\n }\r\n ),\r\n graphql(\r\n REMOVE_PAX,\r\n {\r\n name: 'removePassengers'\r\n }\r\n ),\r\n graphql(\r\n MUTATION_MAKE_PAX_ONSITE,\r\n {\r\n name: 'makePaxOnSite'\r\n }\r\n )\r\n)(BoatDetail)\r\n\r\nexport default BoatDetailWithData","import React from 'react';\r\nimport { Table, Alert } from 'antd';\r\nimport { graphql } from 'react-apollo';\r\nimport gql from 'graphql-tag';\r\nimport WithOrgData from '../../../WithOrgData';\r\nimport LoadingContent from '../../../LoadingContent';\r\nimport { withRouter } from 'react-router-dom';\r\nimport commonColumns from '../../../../common/table/columns';\r\nimport ETable from 'components/enchanced-antd-table';\r\n\r\nclass Boats extends React.Component {\r\n renderContent = () => {\r\n const { data: { getBoats, loading, error } } = this.props;\r\n if (error) return \r\n if (loading) return \r\n if (getBoats){\r\n return (\r\n record._id}\r\n pagination={false}\r\n size=\"small\"\r\n onRow={record => ({\r\n onClick: () => this.props.history.push(`/app/boats/${record._id}`),\r\n style: {\r\n cursor: 'pointer'\r\n }\r\n })}\r\n columns={commonColumns.boat.all()}\r\n />\r\n )\r\n }\r\n }\r\n render(){\r\n return (\r\n
\r\n

Live Boats

\r\n
\r\n {this.renderContent()}\r\n
\r\n
\r\n )\r\n }\r\n}\r\n\r\nconst BOATS = gql`\r\nquery Boats($tpID: ID! $customerID: ID){\r\n getBoats(tpID: $tpID customerID: $customerID){\r\n _id\r\n desig\r\n departureIDs {\r\n _id\r\n name\r\n }\r\n destinationIDs {\r\n _id\r\n name\r\n }\r\n vesselID {\r\n _id\r\n name\r\n }\r\n boatCrewIDs {\r\n _id\r\n }\r\n paxIDList {\r\n _id\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst BoatsWithData = graphql(\r\n BOATS,\r\n {\r\n options: props => {\r\n const { transporter, customer } = props.orgData;\r\n return {\r\n fetchPolicy: 'network-only',\r\n pollInterval: 5000,\r\n variables: {\r\n tpID: transporter._id,\r\n customerID: customer && customer._id\r\n }\r\n }\r\n }\r\n }\r\n)(Boats)\r\n\r\nexport default withRouter( WithOrgData(BoatsWithData) )","import React, { useContext } from 'react';\r\nimport { Button, Layout, Tooltip } from 'antd';\r\nimport cn from 'classnames';\r\nimport { MDEmployer, MDLocation, MDVessel } from 'components/masterdata-2-0/pages';\r\nimport MobileScreenAlert from 'components/MobileScreenWarningAlert';\r\nimport { GlobalAppStateContext } from 'context/global-app-state';\r\nimport { Mutation } from 'react-apollo';\r\nimport { Redirect, Route, Switch } from 'react-router-dom';\r\nimport { CheckInPassengerDocks } from '../../Mutations/CheckInPassenger';\r\nimport CurrentOrg from '../CurrentOrg';\r\nimport { PaxCheckIn } from '../PaxCheckIn';\r\nimport PrivateRoute from '../PrivateRoute';\r\nimport DocksNav from './nav';\r\nimport BoatDetail from './pages/boats/boatDetail';\r\nimport Boats from './pages/boats/boats';\r\n\r\n/** Removes padding from child component by using negative margins */\r\nconst removePadding = (Cp) => (props) => {\r\n return
\r\n \r\n
\r\n}\r\n\r\nconst basePath = '/app/'\r\n\r\nconst { Content } = Layout;\r\n\r\nconst renderLayout = (component) => (props) => {\r\n const cmp = React.cloneElement(component, props);\r\n return (\r\n
\r\n {cmp}\r\n
\r\n )\r\n}\r\n\r\n/** Render PaxCheckIn with personId from route url */\r\nconst renderCheckIn = (props) => {\r\n const personId = props.match.params.personId;\r\n return renderLayout(\r\n \r\n {(checkIn, { data, loading, error }) => {\r\n return (\r\n \r\n {({ transporter }) => {\r\n return (\r\n props.history.push(basePath + 'checkin/' + id)}\r\n renderSubmitBtn={(submitFn) => {\r\n return <>\r\n submitFn({ expected: true })}\r\n style={{ marginLeft: 12 }}\r\n disabled={loading}\r\n className=\"mc-btn-green\"\r\n type=\"primary\">Check In Expected\r\n \r\n submitFn()}\r\n style={{ marginLeft: 12 }}\r\n disabled={loading}\r\n type=\"primary\">Check In\r\n \r\n \r\n }}\r\n onSubmit={(values) => {\r\n let expected = false;\r\n if ('expected' in values){\r\n expected = values.expected;\r\n delete values.expected;\r\n }\r\n checkIn({\r\n variables: {\r\n payload: {\r\n ...values,\r\n tpID: transporter && transporter._id\r\n },\r\n expected: expected\r\n }\r\n })\r\n }}\r\n onClearSelection={() => props.history.push(basePath + 'checkin')}\r\n submitting={loading}\r\n submitError={error}\r\n submitSuccess={data && !loading && !error}\r\n submittedPassengerData={data && data.CheckInPassengerDocks}\r\n />\r\n )\r\n }}\r\n \r\n )\r\n }}\r\n \r\n )(props)\r\n}\r\n\r\nconst DocksRoutes = React.memo(() => {\r\n return <>\r\n {/* Displays warning when using on a small screen for unoptimized 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\n {/* } /> */}\r\n \r\n \r\n \r\n})\r\n\r\n/**\r\n * Handles navigation and routes of docks branch of the application.\r\n */\r\nconst DocksMain = () => {\r\n const { state: { sidebarCollapsed }, setState } = useContext(GlobalAppStateContext);\r\n\r\n return \r\n
setState({ sidebarCollapsed: true })} />\r\n \r\n \r\n \r\n \r\n \r\n}\r\n\r\nexport default DocksMain","import React from 'react';\r\nimport gql from 'graphql-tag';\r\nimport { Query } from 'react-apollo';\r\n\r\nconst FINALIZED_FLIGHTS = gql`\r\nquery FinalizedFlights($tpID: ID!, $customerID: ID, $startDate: AWSDate!, $endDate: AWSDate!, $departureID: ID){\r\n getFinalizedFlights(\r\n tpID: $tpID\r\n customerID: $customerID\r\n startDate: $startDate\r\n endDate: $endDate\r\n departureID: $departureID\r\n ){\r\n execution_stats {\r\n execution_time_ms\r\n results_returned\r\n total_keys_examined\r\n total_docs_examined\r\n total_quorum_docs_examined\r\n }\r\n docs {\r\n _id\r\n modifiedTs\r\n modifiedBy\r\n ... on HistoryFlightNode {\r\n _id\r\n originalFlightID\r\n desig\r\n legs\r\n timeOfDeparture\r\n scheduledFlightDate\r\n scheduleType\r\n firstLegUsableWt\r\n lastKnownController {\r\n _id\r\n name\r\n }\r\n legsArray {\r\n flightTime\r\n order\r\n departure\r\n departureID\r\n destination\r\n destinationID\r\n paxCount\r\n paxWeight\r\n cgoCount\r\n paxIDs {\r\n _id,\r\n firstName,\r\n lastName,\r\n paxWeight,\r\n chargeCode,\r\n individualLegTime,\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n transitType\r\n }\r\n cgoIDs {\r\n _id\r\n name\r\n approvedBy\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n weight\r\n transitType\r\n deliveredBy\r\n }\r\n },\r\n pilot {\r\n _id\r\n name {\r\n firstName,\r\n lastName\r\n },\r\n },\r\n copilot {\r\n _id\r\n name {\r\n firstName,\r\n lastName\r\n },\r\n },\r\n contract {\r\n _id\r\n name\r\n },\r\n paxIDList {\r\n _id,\r\n firstName,\r\n lastName,\r\n chargeCode,\r\n individualLegTime,\r\n departureID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n transitType\r\n },\r\n cgoIDList {\r\n _id\r\n name\r\n chargeCode,\r\n approvedBy\r\n individualLegTime,\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n weight\r\n transitType\r\n deliveredBy\r\n },\r\n aircraftID {\r\n _id,\r\n model,\r\n tailNum,\r\n maxSeats,\r\n maxLoad\r\n }\r\n }\r\n }\r\n}}`\r\n\r\nexport interface WithAllFinalizedFlightsDataProps {\r\n variables?: any\r\n}\r\n\r\nconst withAllFinalizedFlightsData =

(Component: React.ComponentType

) => {\r\n return (props: P & WithAllFinalizedFlightsDataProps) => (\r\n \r\n {\r\n ({ data, loading }) => {\r\n if (!loading && data?.getFinalizedFlights){\r\n return \r\n }\r\n return null\r\n }\r\n }\r\n \r\n )\r\n}\r\n\r\nexport default withAllFinalizedFlightsData","import { FlightLeg } from 'schema';\r\nimport forEachRight from 'lodash/forEachRight';\r\nimport uniqBy from 'lodash/uniqBy';\r\nimport { safeGet } from 'common/util';\r\nimport {Location} from \"../types/location\";\r\n\r\nexport interface Entity {\r\n departure: Location,\r\n destination: Location,\r\n transitType: string,\r\n classType: string,\r\n [x: string]: any\r\n}\r\n\r\nexport function entitiesToFlightLegs(entities: Entity[]){\r\n if (!entities || !entities.length) return [];\r\n let flightPath: Location[] = [];\r\n entities.forEach(entity => {\r\n const isInbound = entity.transitType === 'INBOUND';\r\n let departure = isInbound ? entity.destination : entity.departure;\r\n let destination = isInbound ? entity.departure : entity.destination;\r\n if (flightPath.length === 0){\r\n flightPath.push(...[\r\n departure,\r\n destination\r\n ])\r\n return;\r\n }\r\n const departureIndex = flightPath.findIndex(p => p._id === departure._id);\r\n const destinationIndex = flightPath.findIndex(p => p._id === destination._id);\r\n if (departureIndex === -1){\r\n flightPath.push(departure)\r\n }\r\n if (destinationIndex === -1){\r\n flightPath.push(destination)\r\n }\r\n });\r\n let origin = flightPath[0];\r\n // let endpoint = flightPath[flightPath.length - 1];\r\n // function returnsToOrigin(){\r\n // return endpoint._id === origin._id\r\n // }\r\n // if (!returnsToOrigin()){\r\n // flightPath.forEach((p, idx) => {\r\n // if (idx > 0 && p._id === origin._id){\r\n // if (idx !== flightPath.length - 1){\r\n // flightPath.splice(idx, 1);\r\n // flightPath.push(p);\r\n // }\r\n // }\r\n // })\r\n // }\r\n // if (!returnsToOrigin()){\r\n // flightPath.push(origin);\r\n // }\r\n let legs: FlightLeg[] = [];\r\n flightPath.forEach((loc, pathIdx) => {\r\n let nextLoc = flightPath[pathIdx + 1] || origin;\r\n // if (!nextLoc){\r\n // return;\r\n // }\r\n let entitiesOnLeg = entities.filter((entity) => {\r\n if (entity.transitType === 'INBOUND') return false;\r\n let depIdx = flightPath.findIndex(p => p._id === entity.departure._id);\r\n let destIdx = flightPath.findIndex(p => p._id === entity.destination._id);\r\n let isOnLeg = pathIdx >= depIdx && pathIdx < destIdx;\r\n return isOnLeg;\r\n });\r\n let pax = entitiesOnLeg.filter((entity) => entity.classType === 'flytsuite.paxnode');\r\n let cgo = entitiesOnLeg.filter((entity) => entity.classType === 'flytsuite.cgonode');\r\n let leg: FlightLeg = {\r\n order: pathIdx,\r\n departure: loc.name,\r\n departureID: loc._id,\r\n destination: nextLoc.name,\r\n destinationID: nextLoc._id,\r\n paxIDs: pax,\r\n cgoIDs: cgo,\r\n paxCount: pax.length,\r\n cgoCount: cgo.length,\r\n bagCount: pax.reduce((acc, { bagCount=0 }) => acc + bagCount, 0),\r\n paxWeight: pax.reduce((acc, { paxWeight=0 }) => acc + paxWeight, 0),\r\n bagWeight: pax.reduce((acc, { bagWeight=0 }) => acc + bagWeight, 0),\r\n cgoWeight: cgo.reduce((acc, { weight=0 }) => acc + weight, 0)\r\n }\r\n legs[pathIdx] = leg\r\n })\r\n forEachRight(flightPath, (_, pathIdx) => {\r\n let entitiesOnLeg = entities.filter((entity) => {\r\n if (entity.transitType !== 'INBOUND') return false;\r\n const depIdx = flightPath.findIndex(p => p._id === entity.departure._id)\r\n var destIdx = flightPath.length;\r\n if (entity.destination._id !== origin._id){\r\n destIdx = flightPath.findIndex(p => p._id === entity.destination._id)\r\n }\r\n const isOnLeg = pathIdx >= depIdx && pathIdx < destIdx;\r\n return isOnLeg;\r\n })\r\n let existingLeg = legs[pathIdx];\r\n let pax = [...existingLeg.paxIDs, ...entitiesOnLeg.filter((entity) => entity.classType === 'flytsuite.paxnode')];\r\n let cgo = [...existingLeg.cgoIDs, ...entitiesOnLeg.filter((entity) => entity.classType === 'flytsuite.cgonode')];\r\n let leg: FlightLeg = {\r\n ...existingLeg,\r\n paxIDs: pax,\r\n cgoIDs: cgo,\r\n paxCount: pax.length,\r\n cgoCount: cgo.length,\r\n bagCount: pax.reduce((acc, { bagCount=0 }) => acc + bagCount, 0),\r\n paxWeight: pax.reduce((acc, { paxWeight=0 }) => acc + paxWeight, 0),\r\n bagWeight: pax.reduce((acc, { bagWeight=0 }) => acc + bagWeight, 0),\r\n cgoWeight: cgo.reduce((acc, { weight=0 }) => acc + weight, 0)\r\n }\r\n legs[pathIdx] = leg;\r\n })\r\n return legs\r\n}\r\n\r\nexport const getDestinationsFromEntities = (entities: Entity[]) => {\r\n let origin = entities[0].departure;\r\n var locations = []\r\n entities.forEach(entity => {\r\n const destinationIndex = locations.findIndex(p => p._id === entity.destination._id);\r\n if (destinationIndex === -1 && entity.destination._id !== origin._id){\r\n locations.push(entity.destination);\r\n }\r\n\r\n })\r\n locations.push(origin);\r\n return locations;\r\n}\r\n\r\nexport function reorderFlightLegs(initialLegs: FlightLeg[], dragIndex: number, hoverIndex: number){\r\n let entities: Entity[] = [];\r\n initialLegs.forEach((leg) => {\r\n if (Array.isArray(leg && leg.paxIDs) && leg.paxIDs.length){\r\n entities.push(...leg.paxIDs);\r\n }\r\n if (Array.isArray(leg && leg.cgoIDs) && leg.cgoIDs.length){\r\n entities.push(...leg.cgoIDs);\r\n }\r\n })\r\n entities = uniqBy(entities, (e: Entity) => e._id);\r\n let reorderError = new Error();\r\n reorderError.name = 'ReorderError';\r\n if (dragIndex === initialLegs.length -1){\r\n reorderError.message = 'The last flight leg cannot be reordered';\r\n throw reorderError\r\n }\r\n if (hoverIndex === initialLegs.length - 1){\r\n reorderError.message = 'The last flight leg must be a return to the flight departure location';\r\n throw reorderError;\r\n }\r\n let destinations = getDestinationsFromEntities(entities);\r\n const startSlice = dragIndex < hoverIndex ? dragIndex : hoverIndex;\r\n const endSlice = dragIndex > hoverIndex ? dragIndex : hoverIndex;\r\n let reorderedDestinations: Location[] = [\r\n ...destinations.slice(0, startSlice),\r\n destinations[endSlice],\r\n ...destinations.slice(startSlice + 1, endSlice),\r\n destinations[startSlice], ...destinations.slice(endSlice + 1)\r\n ]\r\n reorderedDestinations = reorderedDestinations.filter(loc => loc !== undefined && loc !== null);\r\n let newEntityList = new Array(entities.length);\r\n console.log('reorderedDestinations', reorderedDestinations);\r\n reorderedDestinations.forEach(location => {\r\n function filterTransitType(tt: string){\r\n return function (entity: Entity){\r\n return entity.transitType === tt;\r\n }\r\n }\r\n let entitiesInLeg = entities.filter(entity => safeGet(['destination', '_id'], entity) === location._id);\r\n let outbound = entitiesInLeg.filter(filterTransitType('OUTBOUND'));\r\n let inbound = entitiesInLeg.filter(filterTransitType('INBOUND'));\r\n let transfer = entitiesInLeg.filter(filterTransitType('TRANSFER'));\r\n let sortedEntities: Entity[] = [...outbound, ...transfer, ...inbound];\r\n newEntityList.push(...sortedEntities);\r\n })\r\n return entitiesToFlightLegs(newEntityList);\r\n}\r\n\r\nexport function getEntitiesFromFlightLegs(legs: FlightLeg[]): T[]{\r\n let entities: T[] = [];\r\n legs.forEach((leg) => {\r\n if (Array.isArray(leg && leg.paxIDs) && leg.paxIDs.length){\r\n entities.push(...leg.paxIDs);\r\n }\r\n if (Array.isArray(leg && leg.cgoIDs) && leg.cgoIDs.length){\r\n entities.push(...leg.cgoIDs);\r\n }\r\n })\r\n entities = uniqBy(entities, (e: T) => {\r\n if (typeof e === 'object'){\r\n return e && e._id\r\n }\r\n return e\r\n });\r\n return entities\r\n}\r\n\r\nexport function getFlightDeparture(flight: any): { _id: string, name: string } {\r\n let legs: Array;\r\n if (Array.isArray(flight.legsArray)){\r\n legs = flight.legsArray;\r\n }\r\n else if (typeof flight.legs === 'string')\r\n {\r\n legs = Object.values(JSON.parse(flight.legs))\r\n }\r\n else if (typeof flight.legs === 'object' && flight.legs !== null){\r\n legs = Object.values(flight.legs);\r\n }\r\n if (legs){\r\n let firstLeg = legs[0];\r\n if (!firstLeg){\r\n return;\r\n }\r\n return {\r\n _id: legs[0].departureID,\r\n name: legs[0].departure\r\n }\r\n }\r\n}\r\n\r\nexport function getFlightDestinations(flight: any): Array<{ _id: string, name: string }> {\r\n let legs: Array = [];\r\n if (Array.isArray(flight.legsArray)){\r\n legs = flight.legsArray;\r\n }\r\n else if (typeof flight.legs === 'string')\r\n {\r\n legs = Object.values(JSON.parse(flight.legs))\r\n }\r\n else if (typeof flight.legs === 'object' && flight.legs !== null){\r\n legs = Object.values(flight.legs);\r\n }\r\n return legs.map(leg => {\r\n return {\r\n _id: leg.destinationID,\r\n name: leg.destination\r\n }\r\n })\r\n}","import { Card, Col, Collapse, Divider, Form, Icon, Input, Row, Tooltip } from 'antd';\r\nimport commonColumns from 'common/table/columns';\r\nimport { FilterableTable } from 'components/tables/FilterableTable';\r\nimport React, { Component } from 'react';\r\n\r\nconst { Panel } = Collapse;\r\n\r\nconst PanelHeader = (props) => (\r\n \r\n \r\n Leg {props.order || 1}\r\n \r\n {props.departure}\r\n \r\n {props.destination}\r\n \r\n \r\n {props.paxCount || 0}\r\n \r\n \r\n \r\n {props.cgoCount || 0}\r\n \r\n \r\n \r\n \r\n \r\n {props.form.getFieldDecorator('flightTime_' + ((props.order && props.order-1) || '0'), {\r\n initialValue: props.flightTime\r\n })(\r\n e.stopPropagation()} type=\"number\" size=\"small\" />\r\n )}\r\n \r\n \r\n \r\n \r\n)\r\n\r\nclass LegTimeEntry extends Component {\r\n render() { \r\n let { data } = this.props;\r\n if (!data) data = []\r\n return (\r\n

\r\n {data.map((leg, idx) => (\r\n this.props.pax ?\r\n \r\n \r\n }>\r\n record._id}\r\n size=\"small\"\r\n pagination={false}\r\n columns={commonColumns.paxAndCgo.some(['name', 'departure', 'destination'])}\r\n />\r\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 LegTimeEntry;","import React from 'react';\r\nimport { Table } from 'antd';\r\nimport { DragSource, DropTarget } from 'react-dnd';\r\nimport ETable from 'components/enchanced-antd-table';\r\n\r\nexport function dragDirection(\r\n dragIndex,\r\n hoverIndex,\r\n initialClientOffset,\r\n clientOffset,\r\n sourceClientOffset,\r\n) {\r\n const hoverMiddleY = (initialClientOffset.y - sourceClientOffset.y) / 2;\r\n const hoverClientY = clientOffset.y - sourceClientOffset.y;\r\n if (dragIndex < hoverIndex && hoverClientY > hoverMiddleY) {\r\n return 'downward';\r\n }\r\n if (dragIndex > hoverIndex && hoverClientY < hoverMiddleY) {\r\n return 'upward';\r\n }\r\n}\r\n\r\nexport class BodyRow extends React.Component {\r\n render() {\r\n const {\r\n isOver,\r\n connectDragSource,\r\n connectDropTarget,\r\n moveRow,\r\n dragRow,\r\n clientOffset,\r\n sourceClientOffset,\r\n initialClientOffset,\r\n ...restProps\r\n } = this.props;\r\n const style = { ...restProps.style, cursor: 'grab' };\r\n\r\n let className = restProps.className;\r\n if (isOver && initialClientOffset) {\r\n const direction = dragDirection(\r\n dragRow.index,\r\n restProps.index,\r\n initialClientOffset,\r\n clientOffset,\r\n sourceClientOffset\r\n );\r\n if (direction === 'downward') {\r\n className += ' drop-over-downward';\r\n }\r\n if (direction === 'upward') {\r\n className += ' drop-over-upward';\r\n }\r\n }\r\n\r\n return connectDragSource(\r\n connectDropTarget(\r\n \r\n )\r\n );\r\n }\r\n}\r\n\r\nconst rowSource = {\r\n beginDrag(props) {\r\n return {\r\n index: props.index,\r\n };\r\n },\r\n};\r\n\r\nconst rowTarget = {\r\n drop(props, monitor) {\r\n console.log('getItem', monitor.getItem())\r\n const dragIndex = monitor.getItem().index;\r\n const hoverIndex = props.index;\r\n\r\n // Don't replace items with themselves\r\n if (dragIndex === hoverIndex) {\r\n return;\r\n }\r\n\r\n // Time to actually perform the action\r\n props.moveRow(dragIndex, hoverIndex);\r\n\r\n // Note: we're mutating the monitor item here!\r\n // Generally it's better to avoid mutations,\r\n // but it's good here for the sake of performance\r\n // to avoid expensive index searches.\r\n monitor.getItem().index = hoverIndex;\r\n },\r\n};\r\n\r\nexport const DraggableBodyRow = DropTarget('row', rowTarget, (connect, monitor) => {\r\n return {\r\n connectDropTarget: connect.dropTarget(),\r\n isOver: monitor.isOver(),\r\n sourceClientOffset: monitor.getSourceClientOffset(),\r\n }\r\n})(\r\n DragSource('row', rowSource, (connect, monitor) => {\r\n return {\r\n connectDragSource: connect.dragSource(),\r\n dragRow: monitor.getItem(),\r\n clientOffset: monitor.getClientOffset(),\r\n initialClientOffset: monitor.getInitialClientOffset(),\r\n }\r\n })(BodyRow)\r\n);\r\n\r\nexport const DraggableBodyRowOutbound = DropTarget('outbound', rowTarget, (connect, monitor) => {\r\n return {\r\n connectDropTarget: connect.dropTarget(),\r\n isOver: monitor.isOver(),\r\n sourceClientOffset: monitor.getSourceClientOffset(),\r\n }\r\n})(\r\n DragSource('outbound', rowSource, (connect, monitor) => {\r\n return {\r\n connectDragSource: connect.dragSource(),\r\n dragRow: monitor.getItem(),\r\n clientOffset: monitor.getClientOffset(),\r\n initialClientOffset: monitor.getInitialClientOffset(),\r\n }\r\n })(BodyRow)\r\n);\r\n\r\nexport const DraggableBodyRowInbound = DropTarget('inbound', rowTarget, (connect, monitor) => {\r\n return {\r\n connectDropTarget: connect.dropTarget(),\r\n isOver: monitor.isOver(),\r\n sourceClientOffset: monitor.getSourceClientOffset(),\r\n }\r\n})(\r\n DragSource('inbound', rowSource, (connect, monitor) => {\r\n return {\r\n connectDragSource: connect.dragSource(),\r\n dragRow: monitor.getItem(),\r\n clientOffset: monitor.getClientOffset(),\r\n initialClientOffset: monitor.getInitialClientOffset(),\r\n }\r\n })(BodyRow)\r\n);\r\n\r\nconst DraggableTable = props => {\r\n function onRow(...args) {\r\n let rowProps = {\r\n index: args[1],\r\n moveRow: () => null\r\n }\r\n\r\n if (typeof props.onRow === 'function'){\r\n rowProps = { ...rowProps, ...props.onRow(...args) };\r\n }\r\n\r\n if (typeof props.onMoveRow === 'function'){\r\n rowProps.moveRow = props.onMoveRow\r\n }\r\n \r\n return rowProps\r\n }\r\n let className;\r\n if ( typeof props.onMoveRow === 'function' ){\r\n className = 'draggable-table'\r\n }\r\n if (props.className){\r\n className += ' ' + props.className\r\n }\r\n return \r\n}\r\n\r\n\r\nexport const DraggableTableOutbound = props => (\r\n ({\r\n index,\r\n moveRow: props.onMoveRow\r\n })} \r\n {...props}/>\r\n)\r\n\r\n\r\nexport const DraggableTableInbound = props => (\r\n ({\r\n index,\r\n moveRow: props.onMoveRow\r\n })} \r\n {...props}/>\r\n)\r\n\r\n\r\n\r\nexport default DraggableTable","import React from 'react';\r\nimport { Row, Col, Button, Table, Form, Input, Popconfirm } from 'antd';\r\nimport commonColumns from 'common/table/columns';\r\nimport { paxOnFlightLeg } from 'common/util';\r\nimport { FilterableTable } from 'components/tables/FilterableTable';\r\n\r\nclass FlightManualLegsAssign extends React.Component {\r\n onAddToLegs = () => {\r\n const getFlight = this.props.flight;\r\n let resultLegs\r\n if(this.props.type === 'PAX'){\r\n const passengers = getFlight.paxIDList.filter(pax => this.props.selectedPaxCgo.includes(pax._id))\r\n \r\n resultLegs = getFlight.legsArray;\r\n this.props.selectedLegs.forEach(idx => {\r\n var leg = resultLegs[idx]\r\n //This sets up the leg, but it was made to save it directly after\r\n resultLegs[idx] = paxOnFlightLeg(leg, passengers.concat(leg.paxIDs), leg.cgoIDs)\r\n //This un maps the pax and cgo from _id only back to their object\r\n resultLegs[idx].paxIDs = passengers.concat(leg.paxIDs)\r\n resultLegs[idx].cgoIDs = leg.cgoIDs\r\n \r\n })\r\n }else if (this.props.type === 'CGO'){\r\n const cgo = getFlight.cgoIDList.filter(cgo => this.props.selectedPaxCgo.includes(cgo._id))\r\n \r\n resultLegs = getFlight.legsArray;\r\n this.props.selectedLegs.forEach(idx => {\r\n var leg = resultLegs[idx]\r\n //This sets up the leg, but it was made to save it directly after\r\n resultLegs[idx] = paxOnFlightLeg(leg, leg.paxIDs, cgo.concat(leg.cgoIDs))\r\n //This un maps the pax and cgo from _id only back to their object\r\n resultLegs[idx].cgoIDs = cgo.concat(leg.cgoIDs)\r\n resultLegs[idx].paxIDs = leg.paxIDs\r\n \r\n })\r\n }\r\n \r\n getFlight.legsArray = resultLegs;\r\n\r\n this.props.editFlight(getFlight)\r\n this.props.clearSelection('pax')\r\n }\r\n\r\n onRemoveFromLegs = () => {\r\n const getFlight = this.props.flight;\r\n let resultLegs;\r\n if(this.props.type === 'PAX'){\r\n const passengers = getFlight.paxIDList.filter(pax => this.props.selectedPaxCgo.includes(pax._id))\r\n \r\n resultLegs = getFlight.legsArray;\r\n getFlight.legsArray.forEach((leg, idx) => {\r\n //This sets up the leg, but it was made to save it directly after\r\n resultLegs[idx] = paxOnFlightLeg(leg, leg.paxIDs.filter(pax => !passengers.map(p => p._id).includes(pax._id)), leg.cgoIDs)\r\n //This un maps the pax and cgo from _id only back to their object\r\n resultLegs[idx].paxIDs = leg.paxIDs.filter(pax => !passengers.map(p => p._id).includes(pax._id))\r\n resultLegs[idx].cgoIDs = leg.cgoIDs\r\n \r\n })\r\n }else if (this.props.type === 'CGO'){\r\n const cgo = getFlight.cgoIDList.filter(cgo => this.props.selectedPaxCgo.includes(cgo._id))\r\n \r\n resultLegs = getFlight.legsArray;\r\n getFlight.legsArray.forEach((leg, idx) => {\r\n //This sets up the leg, but it was made to save it directly after\r\n resultLegs[idx] = paxOnFlightLeg(leg, leg.paxIDs, leg.cgoIDs.filter(cgos => !cgo.map(c => c._id).includes(cgos._id)))\r\n //This un maps the pax and cgo from _id only back to their object\r\n resultLegs[idx].cgoIDs = leg.cgoIDs.filter(cgos => !cgo.map(c => c._id).includes(cgos._id))\r\n resultLegs[idx].paxIDs = leg.paxIDs\r\n \r\n })\r\n }\r\n \r\n getFlight.legsArray = resultLegs;\r\n\r\n this.props.editFlight(getFlight)\r\n this.props.clearSelection('pax')\r\n }\r\n render(){\r\n const { title = 'Flight Legs', flight, selectedLegs = [0], selectedPaxCgo, paxRowSelection, legRowSelection, type} = this.props;\r\n\r\n const legColumns = [\r\n {\r\n title: '#',\r\n key: '#',\r\n render: (_, __, index) => index + 1\r\n },\r\n {\r\n title: 'Dep',\r\n key: 'dep',\r\n dataIndex: 'departure'\r\n },\r\n {\r\n title: 'Dest',\r\n key: 'dest',\r\n dataIndex: 'destination'\r\n },\r\n {\r\n title: 'Pax',\r\n key: 'pax',\r\n dataIndex: 'paxCount'\r\n },\r\n {\r\n title: 'Cgo',\r\n key: 'cgo',\r\n dataIndex: 'cgoCount'\r\n }\r\n ]\r\n\r\n var columns;\r\n if(type === 'PAX'){\r\n columns = commonColumns.historyPax.some(['name', 'employer', 'departure', 'destination']);\r\n }else if (type === 'CGO'){\r\n columns = commonColumns.historyCgo.some(['name', 'weight', 'departure', 'destination'])\r\n }\r\n columns.unshift({\r\n title: 'Legs',\r\n key: 'legs',\r\n width: 50,\r\n render: (val, row) => {\r\n var legs;\r\n this.props.flight.legsArray.forEach((leg, idx) => {\r\n if(type === 'PAX'){\r\n if(leg.paxIDs.map(pax => pax._id).includes(row._id)){\r\n if(legs){\r\n legs = legs + \", \" + (idx+1)\r\n }else {\r\n legs = (idx+1)\r\n }\r\n }\r\n }else if(type === 'CGO'){\r\n if(leg.cgoIDs.map(cgo => cgo._id).includes(row._id)){\r\n if(legs){\r\n legs = legs + \", \" + (idx+1)\r\n }else {\r\n legs = (idx+1)\r\n }\r\n }\r\n }\r\n })\r\n return legs\r\n }\r\n })\r\n columns.push({\r\n title: 'Charge Code',\r\n key: 'chargeCode',\r\n dataIndex: 'chargeCode',\r\n editable: true,\r\n render: (code, row) => {\r\n return (\r\n {this.props.form.getFieldDecorator('chargeCode_' + row._id, {\r\n initialValue: code && code.toUpperCase()\r\n })(\r\n \r\n )}\r\n )\r\n }\r\n })\r\n \r\n return (\r\n \r\n \r\n {selectedLegs.length > 0 && selectedPaxCgo.length > 0 && (\r\n \r\n \r\n \r\n )\r\n }\r\n {selectedPaxCgo.length > 0 && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n

{type}

\r\n \r\n record._id} \r\n size=\"small\" \r\n pagination={false}\r\n applyChargeCode={this.props.applyChargeCode}\r\n />\r\n \r\n \r\n \r\n

{title}

\r\n \r\n index} \r\n size=\"small\" \r\n pagination={false}\r\n />\r\n \r\n
\r\n
\r\n )\r\n }\r\n}\r\n\r\nexport default FlightManualLegsAssign","import {FlightLeg} from \"../../schema\";\r\nimport {getOptimalFlightPathSubset} from \"./flight-leg-manager\";\r\n\r\nexport interface FlightPathOptionalArgs {\r\n\r\n /**\r\n * @default false\r\n */\r\n preventDupeNodeInsertion?: boolean\r\n}\r\n\r\n\r\nexport class FlightPath {\r\n\r\n private origin: string;\r\n private originalOrigin: string;\r\n private path: Array = [];\r\n public preventDupeNodeInsertion = false;\r\n\r\n constructor(origin?: string, optionalArgs?: FlightPathOptionalArgs) {\r\n this.origin = origin;\r\n\r\n if (typeof optionalArgs?.preventDupeNodeInsertion === 'boolean'){\r\n this.preventDupeNodeInsertion = optionalArgs.preventDupeNodeInsertion;\r\n }\r\n }\r\n\r\n static fromFlightLegs(legs: FlightLeg[], overrideOrigin?: string, optionalArgs?: FlightPathOptionalArgs): FlightPath {\r\n\r\n let origin = overrideOrigin || legs[0]?.departureID;\r\n\r\n let originOverridden = overrideOrigin && overrideOrigin !== legs[0]?.departureID;\r\n let originalOrigin = legs[0]?.departureID;\r\n\r\n let flightPath = new FlightPath(origin, optionalArgs);\r\n flightPath.originalOrigin = originalOrigin;\r\n if (legs.length === 0) return flightPath;\r\n\r\n legs.forEach((leg, idx) => {\r\n\r\n // If the leg destination is equal to the original origin, change it to the overridden origin.\r\n let legDest = originalOrigin === leg.destinationID && originOverridden ? origin : leg.destinationID;\r\n\r\n if (idx === legs.length - 1 && legDest === origin) {\r\n // Skip if last leg is the same as the origin\r\n return;\r\n } else {\r\n flightPath.addNextNode(legDest);\r\n }\r\n })\r\n\r\n return flightPath;\r\n }\r\n\r\n static fromLocationList(locations: T[], optionalArgs?: FlightPathOptionalArgs): FlightPath {\r\n\r\n let flightPath = new FlightPath(undefined, optionalArgs);\r\n\r\n locations.forEach((loc) => {\r\n let id = loc?._id;\r\n flightPath.addNextNode(id);\r\n })\r\n\r\n return flightPath;\r\n }\r\n\r\n removeNode(locID: string) {\r\n if (locID === this.origin) {\r\n // If there is only one location in the round trip and you remove the leg that is inbound to the origin,\r\n // remove the location from the path.\r\n if (this.path.length === 1) {\r\n this.path = [];\r\n }\r\n // Otherwise we can't remove the origin\r\n return;\r\n }\r\n let nodeIdx = this.path.findIndex((node) => locID === node);\r\n if (nodeIdx > -1) {\r\n this.path.splice(nodeIdx, 1);\r\n }\r\n }\r\n\r\n /**\r\n * Adds a new location node in the path if not in path.\r\n * If origin was not defined, then this node will become the origin.\r\n * @param locID\r\n * @param forceAdd If true, forces a location to be added to the path.\r\n * @returns Index of location node in flight path\r\n */\r\n addNextNode(locID: string, forceAdd?: boolean): number {\r\n if (!this.origin) {\r\n this.origin = locID;\r\n return 0;\r\n } else if (this.path.includes(locID) && this.preventDupeNodeInsertion && !forceAdd) {\r\n return this.path.findIndex((id) => id === locID) + 1 // +1 taking into account the origin\r\n } else if (locID === this.origin && !forceAdd) {\r\n return 0; // This is the origin, so don't insert anything.\r\n } else {\r\n this.path.push(locID);\r\n return this.path.length // Why not subtract 1? We are taking into account the origin, so -1 + 1 = 0;\r\n }\r\n }\r\n\r\n insertNode(departure: string, destination: string) {\r\n let subset = this.getNodeSubset(departure, destination);\r\n if (subset && subset.length > 0) {\r\n // A route for this departure and destination exists. No need to insert anything new\r\n return;\r\n }\r\n let depIdx = this.getNodeIdx(departure);\r\n let destIdx = this.getNodeIdx(destination);\r\n\r\n if (depIdx > destIdx && destIdx > -1) {\r\n // Departure and destination indexes for this entity are in reverse order.\r\n // Insert a new destination after the entity departure\r\n this.path.splice(depIdx, 0, destination);\r\n } else if (depIdx > -1) {\r\n // Departure exists in route. Insert destination to route.\r\n this.path.push(destination);\r\n } else if (destIdx > -1) {\r\n // Destination exists in route, but not departure. Insert departure before destination.\r\n this.path.splice(destIdx - 1, 0, departure);\r\n } else {\r\n // Neither departure nor destination are in the route. Insert both into route.\r\n this.path.push(departure);\r\n this.path.push(destination);\r\n }\r\n }\r\n\r\n getNodeIdxInSubset(locID: string, startIdx: number, endIdx: number) {\r\n let idx = this.path\r\n .slice(startIdx, endIdx)\r\n .findIndex((id) => id === locID);\r\n return idx === -1 ? -1 : startIdx + idx + 1;\r\n }\r\n\r\n getNodeIdx(locID: string) {\r\n if (locID === this.origin) return 0;\r\n\r\n let idx = this.path.findIndex((id) => id === locID);\r\n return idx === -1 ? -1 : idx + 1;\r\n }\r\n\r\n getNodeIdxs(locID: string) {\r\n if (locID === this.origin) return [0];\r\n let idxs: number[] = [];\r\n this.path.forEach((node, idx) => {\r\n if (node === locID) {\r\n idxs.push(idx + 1);\r\n }\r\n })\r\n return idxs;\r\n }\r\n\r\n getNodeSubset(startLoc: string, endLoc: string) {\r\n\r\n const path = this.getRoundTripPath();\r\n\r\n const [startIdx, endIdx] = getOptimalFlightPathSubset(path, startLoc, endLoc);\r\n\r\n if (endIdx - startIdx >= Infinity) {\r\n return []\r\n }\r\n\r\n return path.slice(startIdx, endIdx + 1)\r\n }\r\n\r\n // getNodeSubset(startLoc: string, endLoc: string){\r\n // let startIdx = this.getNodeIdx(startLoc);\r\n // let endIdx = this.getNodeIdx(endLoc);\r\n //\r\n // if (startIdx > endIdx){\r\n // // Reverse order found. Does the endLoc have duplicates?\r\n // let idxs = this.getNodeIdxs(endLoc);\r\n // if (idxs.length > 1){\r\n // // Duplicate found. Find the next index that is larger than the starting index\r\n // for (let i = 0; i < idxs.length; i++) {\r\n // const secondEndIdx = idxs[i];\r\n // if (secondEndIdx > startIdx){\r\n // endIdx = secondEndIdx;\r\n // break;\r\n // }\r\n // }\r\n // }\r\n // }\r\n //\r\n // if (startIdx === -1 || endIdx === -1){\r\n // return undefined;\r\n // }\r\n //\r\n // if (startIdx === 0){\r\n // // This is the origin\r\n // return [ this.origin, ...this.path.slice(0, endIdx) ]\r\n // }\r\n // if (endIdx === 0){\r\n // return [...this.path.slice(startIdx-1, this.path.length), this.origin ]\r\n // }\r\n // else if (endIdx === 0){\r\n // return undefined\r\n // }\r\n // return this.path.slice(startIdx-1, endIdx)\r\n // }\r\n\r\n isRoundTrip() {\r\n return this.path[-1] === this.origin\r\n }\r\n\r\n getPath() {\r\n // If there is no origin, then there shouldn't be any other nodes\r\n if (!this.origin || this.path.length === 0) return []\r\n\r\n return [this.origin, ...this.path]\r\n }\r\n\r\n getRoundTripPath() {\r\n // If there is no origin, then there shouldn't be any other nodes\r\n if (!this.origin || this.path.length === 0) return []\r\n\r\n if (this.path[this.path.length-1] === this.origin) {\r\n // Path is already returning to origin\r\n return [\r\n this.origin,\r\n ...this.path\r\n ]\r\n }\r\n\r\n return [\r\n this.origin,\r\n ...this.path,\r\n this.origin\r\n ]\r\n }\r\n\r\n getOrigin() {\r\n return this.origin;\r\n }\r\n\r\n setOrigin(locID: string) {\r\n this.origin = locID;\r\n }\r\n\r\n /**\r\n * Move node to a particular index in the path\r\n * @param locID Location ID to move\r\n * @param displaceLocID Location ID to push out of the way\r\n * @returns Reason of move failure. If undefined, then move was successful.\r\n */\r\n moveNode(locID: string, displaceLocID: string): string {\r\n let nodeIdx = this.getNodeIdx(locID);\r\n let insertAt = this.getNodeIdx(displaceLocID);\r\n if (nodeIdx === 0) {\r\n return \"Cannot move origin.\";\r\n }\r\n if (insertAt === 0) {\r\n return \"Cannot move location before origin.\";\r\n }\r\n this.path.splice(nodeIdx - 1, 1);\r\n this.path.splice(insertAt - 1, 0, locID);\r\n return;\r\n }\r\n\r\n getOriginalOrigin() {\r\n return this.originalOrigin;\r\n }\r\n}","import {FlightLeg} from \"schema\";\r\nimport {computeLegWeightsAndCounts} from \"./util\";\r\nimport {FlightPath, FlightPathOptionalArgs} from \"./flight-path\";\r\nimport {union} from \"lodash\";\r\n\r\nexport interface FlightPax {\r\n _id: string,\r\n departureID: string,\r\n destinationID: string,\r\n paxWeight: number,\r\n bagWeight: number,\r\n bagCount: number\r\n}\r\n\r\nexport interface FlightCgo {\r\n _id: string,\r\n departureID: string,\r\n destinationID: string,\r\n weight: number\r\n}\r\n\r\n/**\r\n * Algorithm that finds the shortest subset of locations a pax can visit.\r\n * @param path List of locations a flight will visit\r\n * @param startLoc Departing location of the pax\r\n * @param endLoc Destination of the pax\r\n * @returns [startIdx, endIdx]\r\n */\r\nexport function getOptimalFlightPathSubset(path: string[], startLoc: string, endLoc: string){\r\n // start index and end index\r\n let si = 0;\r\n let ei = 1;\r\n\r\n // Last start index and last end index\r\n let lsi = -Infinity;\r\n let lei = 0;\r\n\r\n let moveStart = false;\r\n\r\n let loops = 0;\r\n let maxLoops = 10000;\r\n\r\n while (si < path.length - 1 && ei < path.length){\r\n loops++;\r\n if (loops > maxLoops){\r\n throw Error(\"Max loops exceeded.\");\r\n }\r\n if (path[ei] === endLoc && ei > lei && moveStart === false){\r\n moveStart = true;\r\n }\r\n if (si === ei-1 && moveStart === true){\r\n // Start index is right behind end index. Cannot move further.\r\n moveStart = false;\r\n }\r\n if (path[ei] === endLoc && path[si] === startLoc && ei-si < lei-lsi){\r\n lsi = si;\r\n lei = ei;\r\n continue;\r\n }\r\n\r\n if (moveStart)\r\n si++;\r\n else\r\n ei++;\r\n }\r\n\r\n return [lsi, lei]\r\n}\r\n\r\nfunction updateEntityDepDest(originalOrigin: string, overrideOrigin: string, entity: FlightPax | FlightCgo){\r\n let entityCopy = {...entity};\r\n if (originalOrigin === overrideOrigin) return entityCopy;\r\n\r\n if (entityCopy.departureID === originalOrigin){\r\n entityCopy.departureID = overrideOrigin;\r\n }\r\n if (entityCopy.destinationID === originalOrigin){\r\n entityCopy.destinationID = overrideOrigin;\r\n }\r\n return entityCopy;\r\n}\r\n\r\ntype FlightLegManagerArgsBase = {\r\n /**\r\n * Maps the location ID to a human-readable name. REQUIRED FOR 'departure' and 'destination' fields in flight legs to be populated!!!\r\n */\r\n locationIDToNameMap?: Map,\r\n\r\n /**\r\n * Optional arguments to pass to the FlightPath\r\n */\r\n flightPathOptionalArgs?: FlightPathOptionalArgs,\r\n\r\n /**\r\n * Override the origin location of the flight path.\r\n */\r\n overrideOrigin?: string\r\n}\r\n\r\nexport type FlightLegManagerArgs = ({\r\n\r\n /**\r\n * Set the initial flight legs\r\n */\r\n initialLegs: FlightLeg[],\r\n\r\n /**\r\n * Pax objects in initialLegs\r\n */\r\n paxObjs: FlightPax[],\r\n\r\n /**\r\n * Cgo objects in initialLegs\r\n */\r\n cgoObjs: FlightCgo[],\r\n} & FlightLegManagerArgsBase) | FlightLegManagerArgsBase\r\n\r\nclass FlightLegManager {\r\n\r\n flightPath: FlightPath;\r\n initialLegs: FlightLeg[];\r\n allPax: Map = new Map();\r\n allCgo: Map = new Map();\r\n private locIDToNameMap: Map = new Map();\r\n\r\n private manAssignedPax = new Map();\r\n private manAssignedCgo = new Map();\r\n\r\n constructor(args: FlightLegManagerArgs){\r\n\r\n if (args.locationIDToNameMap){\r\n this.locIDToNameMap = args.locationIDToNameMap;\r\n }\r\n\r\n if ('initialLegs' in args){\r\n this.initialLegs = args.initialLegs;\r\n this.flightPath = FlightPath.fromFlightLegs(args.initialLegs, args.overrideOrigin, args.flightPathOptionalArgs);\r\n args.paxObjs.forEach((obj) => {\r\n let newObj = updateEntityDepDest(this.flightPath.getOriginalOrigin(), args.overrideOrigin, obj) as FlightPax;\r\n this.allPax.set(obj._id, newObj);\r\n })\r\n args.cgoObjs.forEach((obj) => {\r\n let newObj = updateEntityDepDest(this.flightPath.getOriginalOrigin(), args.overrideOrigin, obj) as FlightCgo;\r\n this.allCgo.set(obj._id, newObj);\r\n })\r\n }\r\n else {\r\n this.flightPath = new FlightPath(args.overrideOrigin, args.flightPathOptionalArgs);\r\n }\r\n }\r\n\r\n // public insertPaxCgo(\r\n // departureID: string,\r\n // destinationID: string,\r\n // paxObjs: FlightPax[],\r\n // cgoObjs: FlightCgo[]\r\n // ){\r\n // this.flightPath.insertNode(departureID, destinationID);\r\n // paxObjs.forEach((obj) => this.allPax.set(obj._id, obj))\r\n // cgoObjs.forEach((obj) => this.allCgo.set(obj._id, obj))\r\n // }\r\n\r\n // Sees if a passenger's departure and destination includes this flight leg\r\n isOnLeg(pax: FlightPax | FlightCgo, legDepIdx: number, legDestIdx: number){\r\n let paxDep = pax.departureID;\r\n let paxDest = pax.destinationID;\r\n const path = this.flightPath.getRoundTripPath();\r\n const [ startIdx, endIdx ] = getOptimalFlightPathSubset(path, paxDep, paxDest);\r\n\r\n const isOnLeg = (\r\n startIdx > -1 && endIdx > -1 &&\r\n legDepIdx >= startIdx &&\r\n endIdx >= legDestIdx\r\n );\r\n\r\n return isOnLeg;\r\n }\r\n\r\n private cleanRedundantNodes(){\r\n let scanned = new Set();\r\n Array.from(this.allPax.values()).forEach((pax) => {\r\n scanned.add(pax.departureID);\r\n scanned.add(pax.destinationID);\r\n })\r\n Array.from(this.allCgo.values()).forEach((cgo) => {\r\n scanned.add(cgo.departureID);\r\n scanned.add(cgo.destinationID);\r\n })\r\n\r\n let redundantNodes = [];\r\n\r\n let path = this.flightPath.getPath();\r\n path.forEach((node) => {\r\n if (!scanned.has(node)){\r\n redundantNodes.push(node);\r\n }\r\n })\r\n\r\n redundantNodes.forEach((node) => this.flightPath.removeNode(node))\r\n }\r\n\r\n /**\r\n * Checks if a location in the flight path is no longer needed.\r\n * @param locID \r\n * @returns true if the leg is redundant. False if not redundant.\r\n */\r\n public isLocationRedundant(locID: string){\r\n if (!locID) return false;\r\n let scanned = new Set();\r\n\r\n if (this.getOrigin() === locID){\r\n // Locations that are the origin of the flight path\r\n // are not redundant, even though no pax/cgo are flying on it\r\n return false;\r\n }\r\n\r\n Array.from(this.allPax.values()).forEach((pax) => {\r\n scanned.add(pax.departureID);\r\n scanned.add(pax.destinationID);\r\n })\r\n Array.from(this.allCgo.values()).forEach((cgo) => {\r\n scanned.add(cgo.departureID);\r\n scanned.add(cgo.destinationID);\r\n })\r\n if (!scanned.has(locID)){\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Removes a node from the flight path if it is not in anyone's flight path\r\n * @param locID \r\n * @returns true if leg was removed. False if leg still remains.\r\n */\r\n public removeLocationIfRedundant(locID: string){\r\n if (this.isLocationRedundant(locID)){\r\n this.flightPath.removeNode(locID);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n addPassenger(pax: FlightPax, args?: { updateFlightPath?: boolean }){\r\n this.allPax.set(pax._id, pax);\r\n if (typeof args?.updateFlightPath === 'boolean' ? args.updateFlightPath : true){\r\n this.flightPath.insertNode(pax.departureID, pax.destinationID);\r\n }\r\n }\r\n\r\n addCgo(cgo: FlightCgo, args?: { updateFlightPath?: boolean }){\r\n this.allCgo.set(cgo._id, cgo);\r\n if (typeof args?.updateFlightPath === 'boolean' ? args.updateFlightPath : true) {\r\n this.flightPath.insertNode(cgo.departureID, cgo.destinationID);\r\n }\r\n }\r\n\r\n removePassenger(id: string){\r\n // let pax = this.allPax.get(id);\r\n this.allPax.delete(id);\r\n // this.removeLocationIfRedundant(pax.destinationID);\r\n }\r\n\r\n removeCgo(id: string){\r\n // let cgo = this.allCgo.get(id);\r\n this.allCgo.delete(id);\r\n // this.removeLocationIfRedundant(cgo.destinationID);\r\n }\r\n\r\n doesEntityHaveALeg(entity: FlightPax | FlightCgo) {\r\n let subset = this.flightPath.getNodeSubset(entity.departureID, entity.destinationID);\r\n if (!subset || subset.length === 0){\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n // If two destinations, A → B, are reordered to B → A, and a TRANSFER pax/cgo travels from A → B, and A and B do not contain an origin,\r\n // then this pax/cgo no longer has a viable path in the flight path.\r\n // What we need to do is detect these pax/cgo that are in this situation and add a NEW leg that goes from A → B for them.\r\n // Thus, this will create a third destination with the path B → A → B\r\n private findAndCreateMissingLegs(){\r\n const putDestConditionally = (entity: FlightPax | FlightCgo) => {\r\n let hasLeg = this.doesEntityHaveALeg(entity);\r\n if (!hasLeg){\r\n this.flightPath.insertNode(entity.departureID, entity.destinationID);\r\n }\r\n }\r\n\r\n let pax = Array.from(this.allPax.values());\r\n let cgo = Array.from(this.allCgo.values());\r\n\r\n pax.forEach(putDestConditionally);\r\n cgo.forEach(putDestConditionally);\r\n }\r\n\r\n findUnassigned(){\r\n let paxList = Array.from(this.allPax.values());\r\n let cgoList = Array.from(this.allCgo.values());\r\n\r\n return {\r\n pax: paxList.filter((pax) => !this.doesEntityHaveALeg(pax)),\r\n cgo: cgoList.filter((cgo) => !this.doesEntityHaveALeg(cgo))\r\n }\r\n }\r\n\r\n buildFlightLegs(args?: {\r\n disableCreateMissingLegs: boolean,\r\n getInfo?: (infoData: {\r\n paxIds?: string[],\r\n cgoIds?: string[]\r\n }) => void\r\n }): FlightLeg[] {\r\n\r\n if (!args?.disableCreateMissingLegs){\r\n this.findAndCreateMissingLegs();\r\n }\r\n\r\n let paxIdsOnFlight = [];\r\n let cgoIdsOnFlight = [];\r\n\r\n function addEntityInfo(entityType: 'PaxNode' | 'CargoNode'){\r\n return (entity: FlightPax | FlightCgo) => {\r\n if (!args?.getInfo){\r\n return;\r\n }\r\n if (entityType === 'PaxNode'){\r\n paxIdsOnFlight = union(paxIdsOnFlight, [entity._id]);\r\n }\r\n else\r\n {\r\n cgoIdsOnFlight = union(cgoIdsOnFlight, [entity._id]);\r\n }\r\n }\r\n }\r\n\r\n let path = this.flightPath.getRoundTripPath();\r\n\r\n if (path.length <= 1){\r\n return [];\r\n }\r\n\r\n let legs: FlightLeg[] = [];\r\n\r\n path.forEach((dest, idx) => {\r\n if (idx === 0) return;\r\n\r\n let departIdx = idx-1;\r\n let paxOnLeg = Array.from(this.allPax.values())\r\n .filter((pax) => this.isOnLeg(pax, departIdx, idx));\r\n let cgoOnLeg = Array.from(this.allCgo.values())\r\n .filter((cgo) => this.isOnLeg(cgo, departIdx, idx));\r\n\r\n paxOnLeg.forEach(addEntityInfo('PaxNode'));\r\n cgoOnLeg.forEach(addEntityInfo('CargoNode'));\r\n\r\n legs.push({\r\n order: idx-1,\r\n paxIDs: paxOnLeg.map(obj => obj._id),\r\n cgoIDs: cgoOnLeg.map(obj => obj._id),\r\n departureID: path[departIdx],\r\n departure: this.locIDToNameMap.get(path[departIdx]),\r\n destinationID: dest,\r\n destination: this.locIDToNameMap.get(dest),\r\n ...computeLegWeightsAndCounts(paxOnLeg as any[], cgoOnLeg as any[])\r\n })\r\n })\r\n\r\n if (args?.getInfo){\r\n args.getInfo({\r\n paxIds: paxIdsOnFlight,\r\n cgoIds: cgoIdsOnFlight\r\n })\r\n }\r\n\r\n return legs;\r\n }\r\n\r\n getPaxIDList(){\r\n return Array.from(this.allPax.values())\r\n .map(obj => obj._id)\r\n }\r\n\r\n getCgoIDList(){\r\n return Array.from(this.allCgo.values())\r\n .map(obj => obj._id)\r\n }\r\n\r\n moveDestination(grabDest: string, hoverDest: string){\r\n // let error = this.flightPath.moveNode(grabDest, hoverDest);\r\n // if (!error){\r\n // // Reodering may cause some nodes in the flight route to become redundant.\r\n // this.cleanRedundantNodes();\r\n // }\r\n return this.flightPath.moveNode(grabDest, hoverDest);\r\n }\r\n\r\n getOrigin(){\r\n return this.flightPath.getOrigin();\r\n }\r\n\r\n setOrigin(locID: string){\r\n this.flightPath.setOrigin(locID);\r\n }\r\n\r\n getLocationName(locID: string){\r\n return this.locIDToNameMap.get(locID);\r\n }\r\n}\r\n\r\nexport default FlightLegManager","import { FlightLeg } from \"schema\";\r\nimport FlightLegManager, { FlightCgo, FlightPax } from \"./flight-leg-manager\";\r\nimport {CgoNode, PaxNode} from \"../types/carriable\";\r\nimport {LocationName} from \"../types/location\";\r\nimport { difference } from \"lodash\";\r\nimport {FlightPathOptionalArgs} from \"./flight-path\";\r\n\r\nexport function graphqlPaxToFlightManPax(gPax: any): FlightPax {\r\n return {\r\n _id: gPax._id,\r\n paxWeight: gPax.paxWeight,\r\n bagCount: gPax.bagCount,\r\n bagWeight: gPax.bagWeight,\r\n departureID: gPax.departureID?._id,\r\n destinationID: gPax.destinationID?._id\r\n }\r\n}\r\n\r\nexport function graphqlCgoToFlightManCgo(gCgo: any): FlightCgo {\r\n return {\r\n _id: gCgo._id,\r\n departureID: gCgo.departureID?._id,\r\n destinationID: gCgo.destinationID?._id,\r\n weight: gCgo.weight\r\n }\r\n}\r\n\r\nexport function buildLocNameMapFromPaxCgoLists(paxObjs?: any[], cgoObjs?: any[], flightLegs?: FlightLeg[]){\r\n let locIDToNameMap = new Map();\r\n\r\n // Get location names from pax list\r\n paxObjs?.forEach((pax) => {\r\n if (pax.departureID?._id){\r\n locIDToNameMap.set(pax.departureID._id, pax.departureID.name)\r\n }\r\n if (pax.destinationID?._id){\r\n locIDToNameMap.set(pax.destinationID._id, pax.destinationID.name);\r\n }\r\n })\r\n\r\n // Get location names from cgo list\r\n cgoObjs?.forEach((cgo) => {\r\n if (cgo.departureID?._id && !locIDToNameMap.has(cgo.departureID._id)){\r\n locIDToNameMap.set(cgo.departureID._id, cgo.departureID.name)\r\n }\r\n if (cgo.destinationID?._id && !locIDToNameMap.has(cgo.destinationID._id)){\r\n locIDToNameMap.set(cgo.destinationID._id, cgo.destinationID.name);\r\n }\r\n })\r\n\r\n // Get location names from flight legs\r\n if (flightLegs && typeof flightLegs === 'string'){\r\n flightLegs = JSON.parse(flightLegs);\r\n }\r\n if (flightLegs){\r\n Object.values(flightLegs).forEach((leg) => {\r\n if (leg.departureID && !locIDToNameMap.has(leg.departureID)){\r\n locIDToNameMap.set(leg.departureID, leg.departure);\r\n }\r\n if (leg.destinationID && !locIDToNameMap.has(leg.destinationID)){\r\n locIDToNameMap.set(leg.destinationID, leg.destination);\r\n }\r\n })\r\n }\r\n return locIDToNameMap;\r\n}\r\n\r\n// Example use: let flManager = getFlightLegManagerFromFlightQuery(this.props.data.getFlight, newLocNames);\r\nexport function getFlightLegManagerFromFlightQuery(\r\n flight: any,\r\n additionalLocIDToNameMap?: Map,\r\n overrideOrigin?: { id: string, name: string },\r\n flightPathArgs?: FlightPathOptionalArgs\r\n): FlightLegManager {\r\n let paxList = (flight.paxIDList || []).map(graphqlPaxToFlightManPax);\r\n let cgoList = (flight.cgoIDList || []).map(graphqlCgoToFlightManCgo);\r\n let parsedLegs: FlightLeg[] = [];\r\n try{\r\n if (typeof flight.legs === 'string'){\r\n parsedLegs = Object.values(JSON.parse(flight.legs));\r\n }\r\n else if (Array.isArray(flight.legs)){\r\n parsedLegs = flight.legs;\r\n }\r\n else {\r\n parsedLegs = Array.from(Object.values(flight.legs))\r\n }\r\n }\r\n catch(err){\r\n console.error('[FlightLegManager] Failed to parse flight legs');\r\n }\r\n let nameMap = buildLocNameMapFromPaxCgoLists(flight.paxIDList, flight.cgoIDList, parsedLegs);\r\n if (flight.departureID){\r\n nameMap.set(flight.departureID._id, flight.departureID.name);\r\n }\r\n if (flight.destinationID){\r\n nameMap.set(flight.destinationID._id, flight.destinationID.name);\r\n }\r\n additionalLocIDToNameMap?.forEach((val, key) => !nameMap.has(key) ? nameMap.set(key, val) : null);\r\n \r\n if (overrideOrigin?.id){\r\n nameMap.set(overrideOrigin.id, overrideOrigin.name);\r\n }\r\n\r\n return new FlightLegManager({\r\n initialLegs: parsedLegs,\r\n paxObjs: paxList,\r\n cgoObjs: cgoList,\r\n overrideOrigin: overrideOrigin?.id || flight.departureID?._id,\r\n locationIDToNameMap: nameMap,\r\n flightPathOptionalArgs: flightPathArgs\r\n })\r\n}\r\n\r\nexport function computeLegWeightsAndCounts<\r\n P extends Pick,\r\n C extends Pick>(\r\n paxNodes: P[],\r\n cgoNodes: C[]\r\n){\r\n return {\r\n paxCount: paxNodes.length,\r\n cgoCount: cgoNodes.length,\r\n paxWeight: paxNodes.reduce((acc, pax) => acc + (pax?.paxWeight || 0), 0),\r\n cgoWeight: cgoNodes.reduce((acc, cgo) => acc + (cgo?.weight || 0), 0),\r\n bagCount: paxNodes.reduce((acc, pax) => acc + (pax?.bagCount || 0), 0),\r\n bagWeight: paxNodes.reduce((acc, pax) => acc + (pax?.bagWeight || 0), 0)\r\n }\r\n}\r\n\r\nexport function createEmptyLeg(order: number, departure: LocationName, destination: LocationName): FlightLeg{\r\n return {\r\n order: order,\r\n departureID: departure._id,\r\n departure: departure.name,\r\n destinationID: destination._id,\r\n destination: destination.name,\r\n paxIDs: [],\r\n cgoIDs: [],\r\n paxWeight: 0,\r\n bagWeight: 0,\r\n paxCount: 0,\r\n bagCount: 0,\r\n cgoWeight: 0,\r\n cgoCount: 0\r\n }\r\n}\r\n\r\n/**\r\n * Find pax/cgo who don't exist anywhere in the new flight leg path.\r\n * @param oldLegs\r\n * @param newLegs\r\n */\r\nexport function findDroppedPaxCgoInLegs(oldLegs: FlightLeg[], newLegs: FlightLeg[]){\r\n const oldPaxIds = new Set();\r\n const oldCgoIds = new Set();\r\n const newPaxIds = new Set();\r\n const newCgoIds = new Set();\r\n\r\n function scan(set: Set, listType: 'pax' | 'cgo'){\r\n return (leg: FlightLeg) => {\r\n const list = listType === 'pax' ? 'paxIDs' : 'cgoIDs';\r\n\r\n leg[list]?.forEach((entity) => {\r\n let id = entity?._id || typeof entity === 'string' ? entity : undefined;\r\n if (id){\r\n set.add(entity);\r\n }\r\n })\r\n }\r\n }\r\n\r\n oldLegs?.forEach(scan(oldPaxIds, 'pax'));\r\n oldLegs?.forEach(scan(oldCgoIds, 'cgo'));\r\n newLegs?.forEach(scan(newPaxIds, 'pax'));\r\n newLegs?.forEach(scan(newCgoIds, 'cgo'));\r\n\r\n function diff(set1: Set, set2: Set){\r\n return difference(Array.from(set1), Array.from(set2));\r\n }\r\n\r\n const droppedPax = diff(oldPaxIds, newPaxIds);\r\n const droppedCgo = diff(oldCgoIds, newCgoIds);\r\n\r\n return {\r\n droppedPaxIds: droppedPax,\r\n droppedCgoIds: droppedCgo,\r\n dropCount: droppedPax.length + droppedCgo.length\r\n }\r\n}","import { Alert, Icon, List } from 'antd';\r\nimport { FlightCgo, FlightPax } from 'common/flight-leg/flight-leg-manager';\r\nimport { getFlightLegManagerFromFlightQuery } from 'common/flight-leg/util';\r\nimport { getPersonFullName } from 'common/util';\r\nimport React, { useState } from 'react';\r\n\r\nexport interface UnassignedPaxCgoWarningProps {\r\n flightData: any\r\n}\r\n\r\ninterface State {\r\n showPaxList: boolean,\r\n showCgoList: boolean\r\n}\r\n\r\nconst UnassignedPaxCgoWarning: React.FC = (props) => {\r\n let [ state, _setState ] = useState({\r\n showPaxList: false,\r\n showCgoList: false\r\n })\r\n\r\n function setState(newState) { _setState({ ...state, ...newState }) }\r\n\r\n function resolvePax(p: FlightPax): any{ props.flightData.paxIDList.find(pax => pax._id === p._id) }\r\n function resolveCgo(c: FlightCgo): any{ props.flightData.cgoIDList.find(cgo => cgo._id === c._id) }\r\n\r\n let flManager = getFlightLegManagerFromFlightQuery(props.flightData);\r\n let { pax, cgo } = flManager.findUnassigned();\r\n\r\n let render = [];\r\n\r\n if (pax.length > 0 || cgo.length > 0) return <>;\r\n \r\n if (pax.length > 0){\r\n let paxData = pax.map(resolvePax);\r\n\r\n render.push(\r\n \r\n {pax.departureID?.name}\r\n \r\n {pax.destinationID?.name}\r\n \r\n }>{getPersonFullName(pax)}}\r\n />\r\n }\r\n />\r\n )\r\n }\r\n\r\n return <>{render};\r\n}\r\n\r\nexport default UnassignedPaxCgoWarning","import { Alert, Button, Card, Col, Row, Tabs, Form, Input, message, Select, Table, Popconfirm, Icon, Modal } from 'antd';\r\nimport React, { Component } from 'react';\r\nimport moment from 'moment';\r\nimport commonColumns from 'common/table/columns';\r\nimport { getFlightDeparture } from 'common/flight';\r\nimport { FilterableTable } from 'components/tables/FilterableTable';\r\nimport LegTimeEntry from 'components/flights/times/LegTimeEntry';\r\nimport gql from 'graphql-tag';\r\nimport { graphql, Mutation, Query } from 'react-apollo';\r\nimport { compose } from 'redux';\r\nimport WithOrgData from 'components/WithOrgData';\r\nimport { LocationSelect } from 'components/form/select/LocationSelect';\r\nimport { locationListToFlightLegs } from 'common/util';\r\nimport { DraggableBodyRow } from 'components/TableDragSorting';\r\nimport FlightManualLegsAssign from 'components/flights/times/FlightManualLegsAssign';\r\nimport { UserGroup } from 'components/userGroup';\r\nimport PilotSelect from 'components/form/PilotSelect';\r\nimport ContractSelect from 'components/form/ContractSelect';\r\nimport AircraftSelect from 'components/form/AircraftSelect';\r\nimport UnassignedPaxCgoWarning from 'components/flights/times/UnassignedPaxCgoWarning';\r\nconst { Option } = Select;\r\n\r\nconst SaveFlightTimes = gql`\r\nmutation SaveFlightTimes(\r\n $tpID: ID!\r\n $flightID: ID!\r\n $payload: AWSJSON!\r\n){\r\n save_flight_times(\r\n tpID: $tpID\r\n flightID: $flightID\r\n payload: $payload\r\n ){\r\n _id\r\n _rev\r\n desig\r\n timeOfDeparture\r\n scheduledFlightDate\r\n scheduleType\r\n originalFlightID\r\n customerID {\r\n _id\r\n name\r\n }\r\n state\r\n legs\r\n legsArray {\r\n flightTime\r\n departure\r\n departureID\r\n destination\r\n destinationID\r\n seats\r\n paxWeight\r\n bagWeight\r\n bagCount\r\n cgoWeight\r\n paxIDs {\r\n _id,\r\n firstName,\r\n lastName,\r\n paxWeight,\r\n bagWeight,\r\n chargeCode,\r\n individualLegTime,\r\n customerDoc {\r\n _id\r\n name\r\n },\r\n employerDoc {\r\n _id\r\n name\r\n }\r\n tpID {\r\n _id\r\n name\r\n }\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n checkedInTime\r\n transitType\r\n }\r\n cgoIDs {\r\n _id\r\n name\r\n approvedBy\r\n customerDoc {\r\n _id\r\n name\r\n }\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n deliveredBy\r\n attentionTo\r\n weight\r\n hazmat\r\n hazmatUnCode\r\n checkedInTime\r\n transitType\r\n currentCarrierID {\r\n _id\r\n desig\r\n }\r\n }\r\n },\r\n pilot {\r\n _id\r\n name {\r\n firstName,\r\n lastName\r\n },\r\n },\r\n copilot {\r\n _id\r\n name {\r\n firstName,\r\n lastName\r\n },\r\n },\r\n contract {\r\n _id\r\n name\r\n },\r\n sequence,\r\n paxIDList {\r\n _id,\r\n firstName,\r\n lastName,\r\n paxWeight,\r\n bagWeight,\r\n chargeCode,\r\n individualLegTime,\r\n customerDoc {\r\n _id\r\n name\r\n },\r\n employerDoc {\r\n _id\r\n name\r\n }\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n checkedInTime\r\n modifiedTs\r\n transitType\r\n },\r\n cgoIDList {\r\n _id\r\n name\r\n scheduledOrder\r\n scheduledGroup\r\n approvedBy\r\n chargeCode,\r\n individualLegTime,\r\n customerDoc {\r\n _id\r\n name\r\n }\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n deliveredBy\r\n attentionTo\r\n weight\r\n hazmat\r\n initials\r\n notes\r\n hazmatUnCode\r\n checkedInTime\r\n transitType\r\n currentCarrierID {\r\n _id\r\n desig\r\n }\r\n },\r\n aircraftID {\r\n _id,\r\n model,\r\n tailNum,\r\n maxSeats,\r\n maxLoad\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst EditFlightHistory = gql`\r\nmutation EditFlightHistory(\r\n $tpID: ID!\r\n $flightID: ID!\r\n $times: AWSJSON!\r\n $flight: FlightNodeInput!\r\n $orgID: ID!\r\n){\r\n editFlightHistory(\r\n tpID: $tpID\r\n flightID: $flightID\r\n times: $times\r\n flight: $flight\r\n orgID: $orgID\r\n ){\r\n _id\r\n desig\r\n timeOfDeparture\r\n scheduledFlightDate\r\n scheduleType\r\n originalFlightID\r\n customerID {\r\n _id\r\n name\r\n }\r\n state\r\n legsArray {\r\n flightTime\r\n departure\r\n departureID\r\n destination\r\n destinationID\r\n seats\r\n paxWeight\r\n bagWeight\r\n bagCount\r\n cgoWeight\r\n paxIDs {\r\n _id,\r\n firstName,\r\n lastName,\r\n paxWeight,\r\n bagWeight,\r\n chargeCode,\r\n individualLegTime,\r\n customerDoc {\r\n _id\r\n name\r\n },\r\n employerDoc {\r\n _id\r\n name\r\n }\r\n tpID {\r\n _id\r\n name\r\n }\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n checkedInTime\r\n transitType\r\n }\r\n cgoIDs {\r\n _id\r\n name\r\n approvedBy\r\n customerDoc {\r\n _id\r\n name\r\n }\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n deliveredBy\r\n attentionTo\r\n weight\r\n hazmat\r\n hazmatUnCode\r\n checkedInTime\r\n transitType\r\n currentCarrierID {\r\n _id\r\n desig\r\n }\r\n }\r\n },\r\n pilot {\r\n _id\r\n name {\r\n firstName,\r\n lastName\r\n },\r\n },\r\n copilot {\r\n _id\r\n name {\r\n firstName,\r\n lastName\r\n },\r\n },\r\n contract {\r\n _id\r\n name\r\n },\r\n sequence,\r\n paxIDList {\r\n _id,\r\n firstName,\r\n lastName,\r\n paxWeight,\r\n bagWeight,\r\n chargeCode,\r\n individualLegTime,\r\n customerDoc {\r\n _id\r\n name\r\n },\r\n employerDoc {\r\n _id\r\n name\r\n }\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n checkedInTime\r\n modifiedTs\r\n transitType\r\n },\r\n cgoIDList {\r\n _id\r\n name\r\n scheduledOrder\r\n scheduledGroup\r\n chargeCode,\r\n approvedBy\r\n individualLegTime,\r\n customerDoc {\r\n _id\r\n name\r\n }\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n deliveredBy\r\n attentionTo\r\n weight\r\n hazmat\r\n initials\r\n notes\r\n hazmatUnCode\r\n checkedInTime\r\n transitType\r\n currentCarrierID {\r\n _id\r\n desig\r\n }\r\n },\r\n aircraftID {\r\n _id,\r\n model,\r\n tailNum,\r\n maxSeats,\r\n maxLoad\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst RevertFlightHistory = gql`\r\nmutation RevertFlightHistory(\r\n $flightID: ID!\r\n){\r\n revertFlightHistory(\r\n flightID: $flightID\r\n ){\r\n _id\r\n desig\r\n timeOfDeparture\r\n scheduledFlightDate\r\n scheduleType\r\n originalFlightID\r\n customerID {\r\n _id\r\n name\r\n }\r\n state\r\n legsArray {\r\n flightTime\r\n departure\r\n departureID\r\n destination\r\n destinationID\r\n seats\r\n paxWeight\r\n bagWeight\r\n bagCount\r\n cgoWeight\r\n paxIDs {\r\n _id,\r\n firstName,\r\n lastName,\r\n paxWeight,\r\n bagWeight,\r\n chargeCode,\r\n individualLegTime,\r\n customerDoc {\r\n _id\r\n name\r\n },\r\n employerDoc {\r\n _id\r\n name\r\n }\r\n tpID {\r\n _id\r\n name\r\n }\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n checkedInTime\r\n transitType\r\n }\r\n cgoIDs {\r\n _id\r\n name\r\n approvedBy\r\n customerDoc {\r\n _id\r\n name\r\n }\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n deliveredBy\r\n attentionTo\r\n weight\r\n hazmat\r\n hazmatUnCode\r\n checkedInTime\r\n transitType\r\n currentCarrierID {\r\n _id\r\n desig\r\n }\r\n }\r\n },\r\n pilot {\r\n _id\r\n name {\r\n firstName,\r\n lastName\r\n },\r\n },\r\n copilot {\r\n _id\r\n name {\r\n firstName,\r\n lastName\r\n },\r\n },\r\n contract {\r\n _id\r\n name\r\n },\r\n sequence,\r\n paxIDList {\r\n _id,\r\n firstName,\r\n lastName,\r\n paxWeight,\r\n bagWeight,\r\n chargeCode,\r\n individualLegTime,\r\n customerDoc {\r\n _id\r\n name\r\n },\r\n employerDoc {\r\n _id\r\n name\r\n }\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n checkedInTime\r\n modifiedTs\r\n transitType\r\n },\r\n cgoIDList {\r\n _id\r\n name\r\n scheduledOrder\r\n scheduledGroup\r\n chargeCode,\r\n approvedBy\r\n individualLegTime,\r\n customerDoc {\r\n _id\r\n name\r\n }\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n deliveredBy\r\n attentionTo\r\n weight\r\n hazmat\r\n initials\r\n notes\r\n hazmatUnCode\r\n checkedInTime\r\n transitType\r\n currentCarrierID {\r\n _id\r\n desig\r\n }\r\n },\r\n aircraftID {\r\n _id,\r\n model,\r\n tailNum,\r\n maxSeats,\r\n maxLoad\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst FINALIZED_FLIGHT = gql`\r\n query Flight($_id: ID!){\r\n getFlightHistory(_id: $_id){\r\n _id\r\n modifiedTs\r\n modifiedBy\r\n originalFlightID\r\n desig\r\n legs\r\n timeOfDeparture\r\n scheduledFlightDate\r\n scheduleType\r\n firstLegUsableWt\r\n lastKnownController {\r\n _id\r\n name\r\n }\r\n legs\r\n legsArray {\r\n flightTime\r\n order\r\n departure\r\n departureID\r\n destination\r\n destinationID\r\n paxCount\r\n paxWeight\r\n cgoCount\r\n paxIDs {\r\n _id,\r\n firstName,\r\n lastName,\r\n paxWeight,\r\n chargeCode,\r\n individualLegTime,\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n transitType\r\n }\r\n cgoIDs {\r\n _id\r\n name\r\n approvedBy\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n weight\r\n transitType\r\n deliveredBy\r\n }\r\n },\r\n pilot {\r\n _id\r\n name {\r\n firstName,\r\n lastName\r\n },\r\n },\r\n copilot {\r\n _id\r\n name {\r\n firstName,\r\n lastName\r\n },\r\n },\r\n contract {\r\n _id\r\n name\r\n },\r\n paxIDList {\r\n _id,\r\n firstName,\r\n lastName,\r\n chargeCode,\r\n individualLegTime,\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n employerDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n transitType\r\n },\r\n cgoIDList {\r\n _id\r\n name\r\n chargeCode,\r\n approvedBy\r\n individualLegTime,\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n weight\r\n transitType\r\n deliveredBy\r\n },\r\n aircraftID {\r\n _id,\r\n model,\r\n tailNum,\r\n maxSeats,\r\n maxLoad\r\n }\r\n }\r\n }\r\n `\r\n\r\nconst Property = ({ field, value, altVal = 'None' }) => {\r\n return (\r\n
\r\n
\r\n {field}:\r\n
\r\n {value || altVal}\r\n
\r\n )\r\n}\r\n\r\nconst Section = ({ title, children }) => (\r\n
\r\n

{title}

\r\n
{children}
\r\n
\r\n)\r\n\r\nconst getFlightTime = ({flight, form}) => {\r\n var flightTimeTotal = 0;\r\n flight.legsArray.forEach((leg, idx) => {\r\n if(Number.isInteger(Number.parseInt(form.getFieldValue('flightTime_' + idx)))){\r\n flightTimeTotal += Number.parseInt(form.getFieldValue('flightTime_' + idx));\r\n }else if(Number.isInteger(leg.flightTime)){\r\n flightTimeTotal += leg.flightTime\r\n }\r\n })\r\n\r\n return flightTimeTotal;\r\n}\r\nclass FlightTimesEntryDrawer extends Component {\r\n\r\n componentDidUpdate(prevProps){\r\n if (prevProps.flightID !== this.props.flightID){\r\n this.props.reset();\r\n }\r\n }\r\n\r\n addLocationToFlight = (flight, locations) => {\r\n var pax = [];\r\n var cgo = [];\r\n \r\n //We want ALL the pax.\r\n pax.push(...flight.paxIDList)\r\n cgo.push(...flight.cgoIDList)\r\n \r\n var newLegs = locationListToFlightLegs([...locations], pax, cgo)\r\n \r\n flight.legsArray = newLegs;\r\n\r\n this.props.editFlight(flight)\r\n }\r\n\r\n getLocationsFromLegs = (legs) => {\r\n var arr = [];\r\n\r\n legs.forEach(leg => {\r\n arr.push({\r\n key: leg.departureID,\r\n label: leg.departure\r\n })\r\n })\r\n\r\n if(legs.length > 0){\r\n arr.push({\r\n key: legs[legs.length-1].destinationID,\r\n label: legs[legs.length-1].destination\r\n })\r\n }\r\n \r\n return arr\r\n }\r\n\r\n clearSelection = (e) => {\r\n switch(e){\r\n case 'pax':\r\n case 'cgo':\r\n this.props.changeWidth('105rem')\r\n break;\r\n default:\r\n this.props.changeWidth('60rem')\r\n }\r\n this.props.selectLegs([])\r\n this.props.selectPaxCgo([])\r\n }\r\n\r\n render() {\r\n return \r\n {({ data }) => {\r\n if(data){\r\n return {\r\n console.error(error);\r\n message.error('Failed to update flight times and charge codes')\r\n }\r\n }\r\n onCompleted= {() => {\r\n message.success('Flight times and charge codes updated successfully')\r\n this.props.onClose(true);\r\n }}\r\n >\r\n {(save_flight_times, { loading: save_flight_times_loading }) => {\r\n const flightData = this.props.editingFlight ? this.props.editedFlight : data.getFlightHistory\r\n const pilot = flightData && flightData.pilot;\r\n const copilot = flightData && flightData.copilot;\r\n const departure = flightData && getFlightDeparture(flightData);\r\n const legs = (flightData && flightData.legsArray) || [];\r\n const destinations = flightData && legs.map(leg => leg.destination);\r\n const orgData = this.props.orgData;\r\n const {selectedPaxCgo, selectedLegs} = this.props;\r\n const submit = (props) => {\r\n props.form.validateFieldsAndScroll((err, values) => {\r\n if (!err) {\r\n save_flight_times({\r\n variables: {\r\n tpID: orgData.activeOrg._id,\r\n flightID: flightData._id,\r\n payload: JSON.stringify(values)\r\n }\r\n })\r\n }\r\n })\r\n }\r\n\r\n const chargeCodeCol = {\r\n title: 'Charge Code',\r\n key: 'chargeCode',\r\n dataIndex: 'chargeCode',\r\n editable: true,\r\n width:200,\r\n render: (code, row) => {\r\n if (!this.props.editMode) return code;\r\n return (\r\n {this.props.form.getFieldDecorator('chargeCode_' + row._id, {\r\n initialValue: code && code.toUpperCase()\r\n })(\r\n \r\n )}\r\n )\r\n }\r\n }\r\n const paxColumns = commonColumns.historyPax.some(['name', 'employer', 'departure', 'destination']);\r\n paxColumns.push(chargeCodeCol)\r\n const cgoColumns = commonColumns.historyCgo.some(['name', 'weight', 'departure', 'destination', 'deliveredBy'])\r\n cgoColumns.push(chargeCodeCol)\r\n\r\n var locations = this.getLocationsFromLegs((flightData && flightData.legsArray) || [])\r\n\r\n const paxRowSelection = {\r\n selectedRowKeys: selectedPaxCgo,\r\n onChange: (selectedRowKeys, selectedRows) => {\r\n console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);\r\n this.props.selectPaxCgo(selectedRowKeys)\r\n }\r\n };\r\n\r\n const legRowSelection = {\r\n selectedRowKeys: selectedLegs,\r\n onChange: (selectedRowKeys, selectedRows) => {\r\n console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);\r\n this.props.selectLegs(selectedRowKeys)\r\n }\r\n };\r\n return (\r\n
\r\n
\r\n {!flightData ? : null}\r\n {flightData ? (\r\n
\r\n
\r\n

{flightData.desig}

\r\n {this.props.editMode ? \r\n
\r\n {this.props.editingFlight ? \r\n \r\n \r\n {flightData && flightData.originalFlightID ?\r\n {\r\n console.error(error);\r\n message.error('Failed to revert flight times and charge codes')\r\n }\r\n }\r\n onCompleted= {() => {\r\n message.success('Flight times and charge codes reverted successfully')\r\n this.props.onClose(true);\r\n }}\r\n >\r\n {(revertFlightHistory, { data, loading, error }) => {\r\n return {\r\n revertFlightHistory({\r\n variables: {\r\n flightID: flightData._id\r\n }\r\n })\r\n }}>\r\n \r\n \r\n }}\r\n : null} \r\n \r\n :\r\n \r\n \r\n \r\n }\r\n
\r\n : null}\r\n {this.props.editingFlight? {\r\n console.error(error);\r\n message.error('Failed to update flight times and charge codes')\r\n }\r\n }\r\n onCompleted= {() => {\r\n message.success('Flight times and charge codes updated successfully')\r\n this.props.onClose(true);\r\n }}\r\n >\r\n {(editFlightHistory, { data, loading, error }) => {\r\n return {\r\n this.props.form.validateFieldsAndScroll((err, values) => {\r\n if (!err) {\r\n var assignedPaxCgo = []\r\n for(var leg of flightData.legsArray){\r\n assignedPaxCgo.push(...leg.paxIDs.map(p => p._id), ...leg.cgoIDs.map(c => c._id))\r\n }\r\n var uniquePaxCgo = [...new Set(assignedPaxCgo)]\r\n var diffOfPaxCgo = [...flightData.paxIDList.map(p => p._id), ...flightData.cgoIDList.map(c => c._id)].filter(paxCgo => !uniquePaxCgo.includes(paxCgo))\r\n\r\n if(diffOfPaxCgo.length !== 0){\r\n Modal.error({\r\n title: 'Unassigned Pax or Cargo',\r\n content:
The following items are not assigned to a leg.
Please assign them before continuing.
\r\n {diffOfPaxCgo.map(d => [...flightData.paxIDList, ...flightData.cgoIDList].filter(f => f._id === d).map(m => m.__typename === \"HistoryPaxNode\" ?
{m.lastName + \", \" + m.firstName}
:
{m.name}
))}\r\n
\r\n })\r\n }else {\r\n var flight = {\r\n _id: flightData._id,\r\n aircraftID: values.aircraftID,\r\n contractID: values.contractID,\r\n pilotID: values.pilotID || null,\r\n copilotID: values.copilotID || null,\r\n originalFlightID: flightData.originalFlightID || null,\r\n legs: JSON.stringify(Object.assign({}, flightData.legs)),\r\n customerID: orgData.customer._id,\r\n tpID: orgData.activeOrg._id\r\n }\r\n editFlightHistory({\r\n variables: {\r\n tpID: orgData.activeOrg._id,\r\n flightID: flightData._id,\r\n times: JSON.stringify(values),\r\n flight: flight,\r\n orgID: orgData.activeOrg._id\r\n }\r\n })\r\n }\r\n }\r\n })\r\n }}>Save\r\n }}\r\n \r\n :\r\n }\r\n
\r\n {this.props.editingFlight ?
\r\n \r\n \r\n
\r\n \r\n {this.props.form.getFieldDecorator('pilotID', {\r\n initialValue: flightData.pilot && flightData.pilot._id\r\n })(\r\n ,\r\n )}\r\n \r\n \r\n {this.props.form.getFieldDecorator('copilotID', {\r\n initialValue: flightData.copilot && flightData.copilot._id\r\n })(\r\n ,\r\n )}\r\n \r\n \r\n {this.props.form.getFieldDecorator('contractID', {\r\n initialValue: flightData.contract && flightData.contract._id,\r\n rules: [\r\n {required: true, message: 'Contract is required'}\r\n ]\r\n \r\n })(\r\n \r\n )}\r\n \r\n {flightData.aircraftID ? (\r\n \r\n {this.props.form.getFieldDecorator('aircraftID', {\r\n initialValue: flightData.aircraftID && flightData.aircraftID._id,\r\n rules: [\r\n {required: true, message: 'Aircraft is required'}\r\n ]\r\n })(\r\n ,\r\n )}\r\n \r\n ) : null}\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n this.clearSelection(e)}>\r\n \r\n
\r\n \r\n \r\n \r\n \r\n {\r\n value[\"new\"] = true\r\n locations.push(value)\r\n return this.addLocationToFlight(flightData, locations)}\r\n }\r\n labelInValue\r\n style={{minWidth: '10rem'}}\r\n />\r\n \r\n \r\n \r\n
\r\n Drag to reorder flight locations\r\n \r\n (\r\n \r\n \r\n {locations.length > 2 ?\r\n {\r\n locations.splice(index, 1)\r\n this.addLocationToFlight(flightData, locations)\r\n }}>\r\n \r\n \r\n : null}\r\n \r\n \r\n ),\r\n width: 60\r\n },{\r\n title: '#',\r\n key: '#',\r\n render: (_, __, index) => index + 1,\r\n width: 25\r\n },{\r\n title: \"Name\",\r\n key: \"name\",\r\n dataIndex: \"label\"\r\n }]} \r\n rowKey={(_, index) => index} \r\n size=\"small\" \r\n pagination={false}\r\n components={{\r\n body: {\r\n row: DraggableBodyRow\r\n }\r\n }}\r\n onRow={(row, index) => {\r\n const rowProps = {\r\n moveRow: (dragIndex, hoverIndex) => {\r\n var arr = [...locations]\r\n arr.splice(hoverIndex, 0, arr.splice(dragIndex, 1)[0]);\r\n locations = arr\r\n this.addLocationToFlight(flightData, locations)\r\n },\r\n onClick: () => {console.log(locations)},\r\n index\r\n }\r\n return { ...rowProps}\r\n }}/>\r\n \r\n \r\n \r\n \r\n {this.props.form.getFieldDecorator('scheduleType', {\r\n initialValue: flightData.scheduleType\r\n })(\r\n ,\r\n )}\r\n \r\n \r\n \r\n \r\n
\r\n \r\n {\r\n flightData.paxIDList && flightData.paxIDList.length ? (\r\n
\r\n \r\n {this.props.form.getFieldDecorator('defaultChargeCode')(\r\n \r\n )}\r\n \r\n \r\n {\r\n data.forEach(row => {\r\n this.props.form.setFieldsValue({['chargeCode_' + row._id]: chargeCode})\r\n })\r\n }}\r\n />\r\n
\r\n ) : 'No Passengers'\r\n }\r\n
\r\n \r\n {\r\n flightData.cgoIDList && flightData.cgoIDList.length ? (\r\n
\r\n \r\n {this.props.form.getFieldDecorator('defaultChargeCode')(\r\n \r\n )}\r\n \r\n {\r\n data.forEach(row => {\r\n this.props.form.setFieldsValue({['chargeCode_' + row._id]: chargeCode})\r\n })\r\n }}\r\n />\r\n
\r\n ) : 'No Cargo'\r\n }\r\n
\r\n
\r\n
\r\n :\r\n
\r\n \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n \r\n \r\n
\r\n \r\n \r\n
\r\n \r\n \r\n
\r\n \r\n \r\n \r\n
\r\n \r\n {flightData.aircraftID ? (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n ) : null}\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n {this.props.form.getFieldDecorator('scheduleType', {\r\n initialValue: flightData.scheduleType\r\n })(\r\n ,\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n flightData.paxIDList && flightData.paxIDList.length ? (\r\n
\r\n \r\n {this.props.form.getFieldDecorator('defaultChargeCode')(\r\n \r\n )}\r\n \r\n record._id}\r\n size=\"small\"\r\n pagination={false}\r\n columns={paxColumns}\r\n applyChargeCode={(chargeCode, data) => {\r\n data.forEach(row => {\r\n this.props.form.setFieldsValue({['chargeCode_' + row._id]: chargeCode})\r\n })\r\n }}\r\n />\r\n
\r\n ) : 'No Passengers'\r\n }\r\n
\r\n \r\n {\r\n flightData.cgoIDList && flightData.cgoIDList.length ? (\r\n
\r\n \r\n {this.props.form.getFieldDecorator('defaultChargeCode')(\r\n \r\n )}\r\n \r\n record._id}\r\n size=\"small\"\r\n pagination={false}\r\n columns={cgoColumns}\r\n applyChargeCode={(chargeCode, data) => {\r\n data.forEach(row => {\r\n this.props.form.setFieldsValue({['chargeCode_' + row._id]: chargeCode})\r\n })\r\n }}\r\n />\r\n
\r\n ) : 'No Cargo'\r\n }\r\n
\r\n
\r\n
\r\n }
\r\n ) : null}\r\n
\r\n
\r\n )\r\n }}\r\n \r\n }\r\n return null\r\n }}\r\n \r\n }\r\n}\r\n\r\nexport default compose(\r\n WithOrgData\r\n)(FlightTimesEntryDrawer)","import React, { Component } from 'react';\r\nimport { Alert, Drawer, Form } from 'antd';\r\nimport FlightTimesEntryDrawer from 'components/flights/times/FlightTimesEntryDrawer';\r\nimport { cloneDeep } from \"lodash\";\r\n\r\nclass FlightTimesEntryDrawerWrapper extends Component {\r\n state = {\r\n visible: false,\r\n flightID: null,\r\n refetch: null,\r\n editedFlight: null,\r\n selectedPaxCgo: [],\r\n selectedLegs: [],\r\n width:'60rem'\r\n }\r\n\r\n open = (flightID, refetch) => this.setState({ flightID, visible: true, refetch })\r\n close = () => this.setState({ flight:null, visible: false, refetch: null, editedFlight: null, selectedPaxCgo: [], selectedLegs: [], width: '60rem'})\r\n changeWidth = (width) => this.setState({width})\r\n editFlight = (editedFlight) => {\r\n const copy = cloneDeep(editedFlight);\r\n copy.legs = {}\r\n copy.legsArray.forEach(leg => {\r\n var newLeg = {...leg}\r\n newLeg.paxIDs = newLeg.paxIDs.map(p => p._id)\r\n newLeg.cgoIDs = newLeg.cgoIDs.map(p => p._id)\r\n copy.legs[leg.order] = newLeg\r\n })\r\n this.setState({editedFlight: copy});\r\n }\r\n selectPaxCgo = (selectedPaxCgo) => this.setState({selectedPaxCgo})\r\n selectLegs = (selectedLegs) => this.setState({selectedLegs})\r\n reset = () => {\r\n this.props.form.resetFields()\r\n this.setState({ width:'60rem', editedFlight: null, selectedPaxCgo: [], selectedLegs: []})\r\n }\r\n render(){\r\n const { component: Component, options } = this.props;\r\n const drawerProps = options ? options.drawerProps : {};\r\n return (\r\n \r\n \r\n \r\n {\r\n if(refetch){\r\n this.state.refetch();\r\n }\r\n this.close()\r\n }}\r\n flightID={this.state.flightID}\r\n // flight={this.state.editedFlight ? this.state.editedFlight : this.state.flight}\r\n editedFlight={this.state.editedFlight}\r\n changeWidth={this.changeWidth}\r\n editFlight={this.editFlight}\r\n reset={this.reset} \r\n selectedPaxCgo={this.state.selectedPaxCgo}\r\n selectedLegs={this.state.selectedLegs}\r\n selectPaxCgo={this.selectPaxCgo}\r\n selectLegs={this.selectLegs}\r\n form={this.props.form}\r\n editingFlight={this.state.editedFlight}\r\n editMode={options.editMode}\r\n />\r\n \r\n \r\n )\r\n }\r\n}\r\n\r\nconst WithForm = Form.create()(FlightTimesEntryDrawerWrapper)\r\nconst withFlightTimesEntryDrawer = (options) => (Component) => (props) => (\r\n \r\n)\r\n\r\nexport default withFlightTimesEntryDrawer","import {produce} from \"immer\";\r\nimport {ApolloQueryAdapter, ApolloQueryAdapterArgs} from \"./apollo-query-adapter\";\r\nimport {LoadArgs, SideEffect} from \"../infinite-scroller\";\r\nimport {QueryResult} from \"react-apollo\";\r\nimport {MangoQueryResult} from \"../../../common/types/couchdb/mango-query-result\";\r\nimport React, {Dispatch} from \"react\";\r\nimport {DocumentNode} from \"apollo-link\";\r\nimport {NetworkStatus} from \"apollo-boost\";\r\nimport {cloneDeep} from \"lodash\";\r\n\r\nconst CouchFindAdapterInitState = {\r\n lastBookmark: null as string,\r\n currentBookmark: null as string,\r\n prevNetStat: null as NetworkStatus,\r\n currNetStat: null as NetworkStatus\r\n}\r\n\r\ntype State = typeof CouchFindAdapterInitState;\r\n\r\ntype Action = {\r\n type: \"INIT_BOOKMARK\"\r\n} |\r\n{\r\n type: \"UPDATE_NETWORK_STATUS\",\r\n status: NetworkStatus\r\n} |\r\n{\r\n type: 'ON_PAGE_LOADED',\r\n bookmark: string\r\n}\r\n\r\ninterface CouchdbFindAdapterArgs extends ApolloQueryAdapterArgs {\r\n getMangoQueryResult: (data: unknown) => MangoQueryResult,\r\n}\r\n\r\n/**\r\n * Implements pagination for CouchDB's mango queries using CouchDB's server-side pagination via bookmarks.\r\n */\r\nexport class CouchdbMangoAdapter extends ApolloQueryAdapter {\r\n initState = CouchFindAdapterInitState;\r\n sideEffect: SideEffect;\r\n getLoading = (queryResult: QueryResult) => {\r\n return queryResult.networkStatus === NetworkStatus.fetchMore ||\r\n queryResult.networkStatus === NetworkStatus.loading;\r\n }\r\n getMangoQueryResult: (data: unknown) => MangoQueryResult;\r\n\r\n constructor(args: CouchdbFindAdapterArgs) {\r\n super(args);\r\n this.getMangoQueryResult = args.getMangoQueryResult;\r\n }\r\n\r\n /**\r\n * State machine used for keeping track of the current bookmark and the last bookmark, and tracks query NetworkStatus.\r\n * Eventually the currentBookmark and lastBookmark will be compared to check if the last page has been reached.\r\n */\r\n reducer(state: State, action: Action){\r\n switch (action.type){\r\n case \"ON_PAGE_LOADED\":\r\n return produce(state, (draft) => {\r\n draft.lastBookmark = draft.currentBookmark;\r\n draft.currentBookmark = action.bookmark;\r\n })\r\n case \"INIT_BOOKMARK\":\r\n return produce(state, (draft) => {\r\n draft.lastBookmark = null;\r\n draft.currentBookmark = null;\r\n });\r\n case \"UPDATE_NETWORK_STATUS\":\r\n return produce(state, (draft) => {\r\n draft.prevNetStat = draft.currNetStat;\r\n draft.currNetStat = action.status;\r\n })\r\n default:\r\n return state;\r\n }\r\n }\r\n\r\n onLoadMore(state: State, dispatch: React.Dispatch) {\r\n this.queryResult.fetchMore({\r\n variables: {\r\n ...this.queryResult.variables,\r\n bookmark: state.currentBookmark\r\n },\r\n query: this.query,\r\n\r\n // When the next page is fetched, update the cached query. This will\r\n // subsequently update the UI subscribed to this cache as well.\r\n updateQuery: (prevData: any, args) => {\r\n const prevClone = cloneDeep(prevData);\r\n\r\n const fetchMoreData = args.fetchMoreResult;\r\n const prevResult = this.getMangoQueryResult(prevClone);\r\n const currResult = this.getMangoQueryResult(fetchMoreData);\r\n prevResult.docs.push(...currResult.docs);\r\n prevResult.bookmark = currResult.bookmark;\r\n\r\n dispatch({ type: 'ON_PAGE_LOADED', bookmark: currResult.bookmark });\r\n\r\n return prevClone;\r\n }\r\n })\r\n }\r\n\r\n getLoadArgs(state: State, dispatch: Dispatch): LoadArgs {\r\n\r\n /**\r\n * Dispatches state actions when certain network status changes happen.\r\n */\r\n this.sideEffect = {\r\n deps: [this.queryResult.networkStatus, state.currNetStat, state.prevNetStat],\r\n callback: () => {\r\n if (state.currNetStat !== this.queryResult.networkStatus){\r\n // Update query network status\r\n dispatch({ type: 'UPDATE_NETWORK_STATUS', status: this.queryResult.networkStatus });\r\n }\r\n if (state.currNetStat === NetworkStatus.ready && state.prevNetStat === NetworkStatus.loading){\r\n // Query just finished loading\r\n const result = this.getMangoQueryResult(this.queryResult.data);\r\n if (result.bookmark === undefined){\r\n console.warn(\r\n \"Bookmark is undefined in MangoQueryResult. \" +\r\n \"Make sure you have selected the 'bookmark' field in your query!\"\r\n );\r\n }\r\n dispatch({ type: 'ON_PAGE_LOADED', bookmark: result.bookmark });\r\n }\r\n if (\r\n (state.currNetStat === NetworkStatus.ready && state.prevNetStat === NetworkStatus.refetch) ||\r\n (state.currNetStat === NetworkStatus.ready && state.prevNetStat === NetworkStatus.setVariables)\r\n ){\r\n // Query just finished reloading due to refetch or variable change\r\n const result = this.getMangoQueryResult(this.queryResult.data);\r\n dispatch({ type: 'INIT_BOOKMARK' });\r\n dispatch({ type: 'ON_PAGE_LOADED', bookmark: result.bookmark });\r\n }\r\n }\r\n }\r\n\r\n // If the current and last bookmarks are the same, then we have reached the last page.\r\n const hasNextPage = state.lastBookmark !== state.currentBookmark;\r\n\r\n return {\r\n ...super.getLoadArgs(state, dispatch),\r\n hasNextPage: hasNextPage\r\n }\r\n }\r\n}","import {LoadArgs, InfiniteScrollAdapter} from \"../infinite-scroller\";\r\nimport {QueryResult} from \"react-apollo\";\r\nimport {Dispatch} from \"react\";\r\nimport {DocumentNode} from \"apollo-link\";\r\n\r\nexport interface ApolloQueryAdapterArgs {\r\n queryResult: QueryResult,\r\n query: DocumentNode,\r\n getLoading?: (queryResult: QueryResult) => boolean\r\n}\r\n\r\n/**\r\n * Abstract class that implements storing the query result from an Apollo Graphql query.\r\n * This class does not implement pagination itself, but it standardizes the storage of the query among child classes.\r\n */\r\nexport class ApolloQueryAdapter implements InfiniteScrollAdapter {\r\n initState = null;\r\n queryResult: QueryResult = null;\r\n query: DocumentNode = null;\r\n getLoading = (queryResult: QueryResult) => queryResult.loading;\r\n\r\n constructor(args: ApolloQueryAdapterArgs) {\r\n this.queryResult = args.queryResult;\r\n this.query = args.query;\r\n this.getLoading = args.getLoading;\r\n }\r\n\r\n // This implementation doesn't need a state machine.\r\n reducer(state: S, action: A){\r\n return state;\r\n }\r\n\r\n /**\r\n * Executes when a new page needs to be fetched. This is where you should modify the query in the cache using\r\n * the \"fetchMore\" function of the QueryResult.\r\n * @param state Current state of state machine\r\n * @param dispatch Action dispatcher for state machine\r\n */\r\n onLoadMore(state: S, dispatch: Dispatch){}\r\n\r\n getLoadArgs(state: S, dispatch: Dispatch): LoadArgs {\r\n return {\r\n loading: this.getLoading(this.queryResult),\r\n hasNextPage: false,\r\n disabled: Boolean(this.queryResult.error),\r\n onLoadMore: () => this.onLoadMore(state, dispatch)\r\n };\r\n }\r\n}","import {Alert, Button, Card, Col, Icon, message, Row, Spin, Table} from \"antd\";\r\nimport Text from 'antd/lib/typography/Text';\r\nimport { cleanGraphQLErrorMsg, safeGet } from 'common/util';\r\nimport withAllFinalizedFlightsData from \"components/flights/times/WithAllFinalizedFlightsData\";\r\nimport withFlightTimesEntryDrawer from 'components/flights/times/WithFlightTimesEntryDrawer';\r\nimport useManifestPrintout from 'components/scheduling/Printout/useManifestPrintout';\r\nimport withCognitoUser from 'components/WithCognitoUser';\r\nimport WithOrgData from \"components/WithOrgData\";\r\nimport gql from 'graphql-tag';\r\nimport moment, { Moment } from \"moment\";\r\nimport React, { useState } from 'react';\r\nimport { graphql, Query, useApolloClient, useLazyQuery, useQuery, withApollo } from 'react-apollo';\r\nimport { compose } from 'redux';\r\nimport { useInfiniteScroll } from \"hooks/infinite-scroller/infinite-scroller\";\r\nimport {CouchdbMangoAdapter} from \"../../../hooks/infinite-scroller/adapter/couchdb-mango-adapter\";\r\nimport {NetworkStatus} from \"apollo-boost\";\r\nimport CenteredLoadingScreen from \"../../CenteredLoadingScreen\";\r\n\r\nconst FINALIZED_FLIGHTS = gql`\r\nquery FinalizedFlights(\r\n $tpID: ID!, \r\n $customerID: ID, \r\n $startDate: AWSDate!, \r\n $endDate: AWSDate!, \r\n $departureID: ID,\r\n $bookmark: String\r\n){\r\n getFinalizedFlights(\r\n tpID: $tpID\r\n customerID: $customerID\r\n startDate: $startDate\r\n endDate: $endDate\r\n departureID: $departureID\r\n limit: 100\r\n bookmark: $bookmark\r\n ){\r\n execution_stats {\r\n execution_time_ms\r\n results_returned\r\n total_keys_examined\r\n total_docs_examined\r\n total_quorum_docs_examined\r\n }\r\n bookmark\r\n docs {\r\n _id\r\n modifiedTs\r\n modifiedBy\r\n ... on HistoryFlightNode {\r\n _id\r\n desig\r\n legs\r\n firstLegUsableWt\r\n scheduledFlightDate\r\n lastKnownController {\r\n _id\r\n name\r\n }\r\n legsArray {\r\n paxCount\r\n paxWeight\r\n flightTime\r\n },\r\n paxIDList {\r\n _id\r\n chargeCode\r\n transitType\r\n },\r\n cgoIDList {\r\n _id\r\n chargeCode\r\n transitType\r\n },\r\n aircraftID {\r\n _id\r\n tailNum\r\n maxSeats\r\n maxLoad\r\n }\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst FlightTable = ({data, flightDrawer, refetch}, ...rest) => {\r\n const columns = [\r\n {\r\n title: 'Name',\r\n key: 'desig',\r\n render: (_, record) => {\r\n return `${record.desig}`\r\n },\r\n defaultSortOrder: 'descend',\r\n sorter: (a, b) => {\r\n if(a.desig.toLowerCase() > b.desig.toLowerCase()){\r\n return -1;\r\n }\r\n if(a.desig.toLowerCase() < b.desig.toLowerCase()){\r\n return 1;\r\n }\r\n return 0;\r\n },\r\n },\r\n {\r\n title: 'Tail No.',\r\n key: 'tailNum',\r\n render: (_, record) => record?.aircraftID?.tailNum\r\n },\r\n {\r\n title: 'Departure',\r\n key:'departure',\r\n render: (_, record) => {\r\n var legs = JSON.parse(record.legs);\r\n if('0' in legs){\r\n return legs['0'].departure;\r\n }\r\n\r\n return 'None';\r\n },\r\n sorter: (a, b) => {\r\n var legsA = JSON.parse(a.legs);\r\n var legsB = JSON.parse(b.legs);\r\n\r\n var depA = \"None\";\r\n var depB = \"None\";\r\n if('0' in legsA){\r\n depA = legsA['0'].departure;\r\n }\r\n if('0' in legsB){\r\n depB = legsB['0'].departure;\r\n }\r\n\r\n if(depA.toLowerCase() > depB.toLowerCase()){\r\n return -1;\r\n }\r\n if(depA.toLowerCase() < depB.toLowerCase()){\r\n return 1;\r\n }\r\n return 0;\r\n },\r\n },\r\n {\r\n title: 'Pax Out',\r\n key:'paxOut',\r\n render: (_, record) => {\r\n var count = 0;\r\n record.paxIDList.forEach(pax => {\r\n if(pax.transitType === \"OUTBOUND\"){\r\n count+=1;\r\n }\r\n })\r\n return count;\r\n }\r\n },\r\n {\r\n title: 'Pax In',\r\n key:'paxIn',\r\n render: (_, record) => {\r\n var count = 0;\r\n record.paxIDList.forEach(pax => {\r\n if(pax.transitType === \"INBOUND\"){\r\n count+=1;\r\n }\r\n })\r\n return count;\r\n }\r\n },\r\n {\r\n title: 'Cgo Out',\r\n key:'cgoOut',\r\n render: (_, record) => {\r\n var count = 0;\r\n record.cgoIDList.forEach(cgo => {\r\n if(cgo.transitType === \"OUTBOUND\"){\r\n count+=1;\r\n }\r\n })\r\n return count;\r\n }\r\n },\r\n {\r\n title: 'Cgo In',\r\n key:'cgoIn',\r\n render: (_, record) => {\r\n var count = 0;\r\n record.cgoIDList.forEach(cgo => {\r\n if(cgo.transitType === \"INBOUND\"){\r\n count+=1;\r\n }\r\n })\r\n return count;\r\n }\r\n },\r\n {\r\n title: 'Seat %',\r\n key: 'seatPercent',\r\n render: (_, record) => {\r\n if (!record || !record.aircraftID){\r\n return null\r\n }\r\n if(record.legsArray && record.legsArray[0] && record.aircraftID.maxSeats){\r\n const seats = record.aircraftID.maxSeats || 0\r\n const paxCount = record.legsArray[0].paxCount\r\n\r\n const num = ((paxCount/seats)*100).toFixed(2)\r\n\r\n if(num === 'NaN' || num === 'Infinity' || num < 0){\r\n return null\r\n }\r\n\r\n return num\r\n }\r\n\r\n return null;\r\n }\r\n },\r\n {\r\n title: 'Weight %',\r\n key: 'weightPercent',\r\n render: (_, record) => {\r\n if (!record){\r\n return null\r\n }\r\n if(record.legsArray && record.legsArray[0]){\r\n const paxWeight = record.legsArray[0].paxWeight\r\n const firstLegUsableWeight = record.firstLegUsableWt || 0\r\n const aircraftMaxLoad = record?.aircraftID?.maxLoad || 0;\r\n\r\n // If the user didn't enter a firstLegUsableWt, then use the aircraft maxLoad instead.\r\n // From https://dataflyt.atlassian.net/browse/MCR-1116\r\n let usefulLoad = firstLegUsableWeight;\r\n if (firstLegUsableWeight <= 0){\r\n usefulLoad = aircraftMaxLoad;\r\n }\r\n\r\n const num = ((paxWeight/usefulLoad)*100).toFixed(2)\r\n \r\n if(num === 'NaN' || num === 'Infinity' || num < 0){\r\n return null\r\n }\r\n \r\n return num\r\n }\r\n\r\n return null;\r\n }\r\n },\r\n {\r\n title: 'Flight Time',\r\n key:'flightTime',\r\n render: (_, record) => {\r\n var legs = record.legsArray;\r\n var noTimeEntered = legs.every(leg => leg.flightTime === null || leg.flightTime === 0);\r\n var paxNCgo = record.paxIDList.concat(record.cgoIDList)\r\n var noChargeCode = paxNCgo.length > 0 && paxNCgo.some(obj => !obj.chargeCode || obj.chargeCode === null)\r\n if(noTimeEntered){\r\n return {\r\n props: {\r\n style: {background:'red', color: 'black'}\r\n },\r\n children: noChargeCode ? \"Missing Charge Codes. No Time Entered.\" : \"No Time Entered\"\r\n }\r\n }\r\n\r\n var legNoTime = legs.some(leg => leg.flightTime === null || leg.flightTime === 0);\r\n var time = 0;\r\n legs.forEach(leg => {\r\n if(Number.isInteger(leg.flightTime)){\r\n time += leg.flightTime;\r\n }\r\n })\r\n if(legNoTime){\r\n return {\r\n props: {\r\n style: {background: noChargeCode? 'red' : 'yellow', color: 'black'}\r\n },\r\n children: noChargeCode ? time + \" | Leg With No Time. Missing Charge Codes\" : time + \" | Leg With No Time\"\r\n }\r\n }\r\n\r\n if(noChargeCode){\r\n return {\r\n props: {\r\n style: {background:'red', color: 'black'}\r\n },\r\n children: \"Missing Charge Codes\"\r\n }\r\n }\r\n\r\n return {\r\n props: {\r\n style: {background:'green', color:'white'}\r\n },\r\n children: time\r\n }\r\n }\r\n }\r\n ]\r\n return (\r\n record._id}\r\n onRow={(record, rowIndex) => {\r\n return {\r\n onClick: event => {\r\n flightDrawer.open(record._id, refetch)\r\n },\r\n style: { cursor: 'pointer' }\r\n }\r\n }}\r\n pagination={false}\r\n size=\"middle\"\r\n style={{marginBottom: '1rem'}}\r\n bordered\r\n footer={flightData => {\r\n var totalFlightTime = 0;\r\n flightData.forEach((flight) => {\r\n flight.legsArray.forEach(leg => {\r\n if(Number.isInteger(leg.flightTime)){\r\n totalFlightTime += Number.parseInt(leg.flightTime)\r\n }\r\n })\r\n })\r\n return (
\r\n Total Daily Flight Time: \r\n {totalFlightTime}\r\n
);\r\n\r\n }}\r\n {...rest}\r\n />\r\n )\r\n}\r\n\r\nconst DayGroupCard = ({data, flightDrawer, refetch}, ...rest ) => {\r\n return (\r\n {data[0]}}\r\n {...rest}\r\n >\r\n \r\n \r\n )\r\n}\r\n\r\nconst FlightTimes = (props) => {\r\n const queryResult = useQuery(FINALIZED_FLIGHTS,\r\n {\r\n variables: {\r\n tpID: props.orgData.transporter._id,\r\n customerID: props.orgData.customer._id,\r\n startDate: props.dateRange[0].format('YYYY-MM-DD'),\r\n endDate: props.dateRange[1].format('YYYY-MM-DD'),\r\n departureID: props.departureID && props.departureID.key\r\n },\r\n fetchPolicy: 'network-only',\r\n notifyOnNetworkStatusChange: true\r\n });\r\n\r\n const mangoAdapter = new CouchdbMangoAdapter({\r\n query: FINALIZED_FLIGHTS,\r\n getMangoQueryResult: (data) => data?.getFinalizedFlights,\r\n queryResult: queryResult\r\n });\r\n\r\n const { sentryRef, hasNextPage } = useInfiniteScroll({\r\n adapterImpl: mangoAdapter,\r\n rootMargin: '0px 0px 600px 0px'\r\n });\r\n\r\n const { data, networkStatus, error, refetch } = queryResult;\r\n\r\n const loading = networkStatus === NetworkStatus.loading ||\r\n networkStatus === NetworkStatus.setVariables ||\r\n networkStatus === NetworkStatus.refetch;\r\n\r\n if (loading) return \r\n\r\n const getFinalizedFlights = data?.getFinalizedFlights;\r\n\r\n var groups = {};\r\n\r\n if(getFinalizedFlights && getFinalizedFlights.docs && getFinalizedFlights.docs.length > 0){\r\n getFinalizedFlights.docs.forEach(currentFlight => {\r\n if(!(currentFlight.scheduledFlightDate in groups)){\r\n groups[currentFlight.scheduledFlightDate] = [currentFlight];\r\n }else{\r\n groups[currentFlight.scheduledFlightDate].push(currentFlight);\r\n }\r\n });\r\n\r\n }\r\n\r\n return (\r\n
\r\n {error ? \r\n : null}\r\n {!error && Object.keys(groups).length === 0 ? \"No Finalized Flights Found.\" : null}\r\n {!error && Object.keys(groups).length > 0 ? (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {Object.entries(groups).map((group, i) => {\r\n return \r\n })}\r\n \r\n {queryResult.networkStatus === NetworkStatus.fetchMore && hasNextPage ? (\r\n
\r\n
\r\n } />\r\n
\r\n
Above data may be incomplete.
\r\n
Please wait for next page.
\r\n
\r\n ) : null}\r\n {queryResult.networkStatus === NetworkStatus.ready && !hasNextPage ? (\r\n
End of results.
\r\n ) : null}\r\n
\r\n \r\n ) : null}\r\n\r\n
\r\n )\r\n}\r\n\r\nconst FINALIZED_FLIGHTS_FULL = gql`\r\nquery FinalizedFlights($tpID: ID!, $customerID: ID, $startDate: AWSDate!, $endDate: AWSDate!, $departureID: ID){\r\n getFinalizedFlights(\r\n tpID: $tpID\r\n customerID: $customerID\r\n startDate: $startDate\r\n endDate: $endDate\r\n departureID: $departureID\r\n ){\r\n execution_stats {\r\n execution_time_ms\r\n results_returned\r\n total_keys_examined\r\n total_docs_examined\r\n total_quorum_docs_examined\r\n }\r\n docs {\r\n _id\r\n modifiedTs\r\n modifiedBy\r\n ... on HistoryFlightNode {\r\n _id\r\n originalFlightID\r\n desig\r\n legs\r\n timeOfDeparture\r\n scheduledFlightDate\r\n scheduleType\r\n firstLegUsableWt\r\n lastKnownController {\r\n _id\r\n name\r\n }\r\n legsArray {\r\n flightTime\r\n order\r\n departure\r\n departureID\r\n destination\r\n destinationID\r\n paxCount\r\n paxWeight\r\n cgoCount\r\n paxIDs {\r\n _id,\r\n firstName,\r\n lastName,\r\n paxWeight,\r\n chargeCode,\r\n individualLegTime,\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n transitType\r\n }\r\n cgoIDs {\r\n _id\r\n name\r\n approvedBy\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n weight\r\n transitType\r\n deliveredBy\r\n }\r\n },\r\n pilot {\r\n _id\r\n name {\r\n firstName,\r\n lastName\r\n },\r\n },\r\n copilot {\r\n _id\r\n name {\r\n firstName,\r\n lastName\r\n },\r\n },\r\n contract {\r\n _id\r\n name\r\n },\r\n paxIDList {\r\n _id,\r\n firstName,\r\n lastName,\r\n chargeCode,\r\n individualLegTime,\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n employerDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n transitType\r\n },\r\n cgoIDList {\r\n _id\r\n name\r\n chargeCode,\r\n approvedBy\r\n individualLegTime,\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n }\r\n weight\r\n transitType\r\n deliveredBy\r\n },\r\n aircraftID {\r\n _id,\r\n model,\r\n tailNum,\r\n maxSeats,\r\n maxLoad\r\n }\r\n }\r\n }\r\n}}`\r\n\r\nvar PrintoutTimesButton = ({...props}) => {\r\n const [ fetchPrintout, fetching ] = useManifestPrintout('FlightTimes', 'FlightTimes');\r\n const [ printoutLoading, setPrintOutLoading ] = useState(false);\r\n const ApolloClient = useApolloClient();\r\n\r\n const userAttr = props.cognitoUser.attributes;\r\n const orgData = props.orgData;\r\n\r\n async function getFullFinalizedFlightsData(pageSizeWeeks=2){\r\n\r\n /** @type Moment */\r\n let startDate = props.dateRange[0];\r\n /** @type Moment */\r\n let endDate = props.dateRange[1];\r\n\r\n let duration = moment.duration(endDate.diff(startDate));\r\n let noWeeks = Math.ceil(duration.as('weeks'));\r\n\r\n setPrintOutLoading(true);\r\n function getDataPage(subStartDate, subEndDate){\r\n return {\r\n execute: () => {\r\n return ApolloClient.query({\r\n variables: {\r\n tpID: props.orgData.transporter._id,\r\n customerID: props.orgData.customer._id,\r\n startDate: subStartDate.format('YYYY-MM-DD'),\r\n endDate: subEndDate.format('YYYY-MM-DD'),\r\n departureID: props.departureID && props.departureID.key\r\n },\r\n query: FINALIZED_FLIGHTS_FULL,\r\n fetchPolicy: 'no-cache'\r\n })\r\n }\r\n };\r\n }\r\n\r\n // Fetch each page of data two pages at a time using two queues.\r\n const pageQueue = [];\r\n const results = [];\r\n let executeQueue = [];\r\n\r\n for (let pageNum = 0; pageNum <= noWeeks; pageNum+=pageSizeWeeks) {\r\n let subStartDate = moment(startDate).add(pageNum, 'weeks');\r\n if (pageNum !== 0){\r\n subStartDate.add(1, 'day'); // Prevent overlapping between pages\r\n }\r\n let subEndDateCandidate = moment(startDate)\r\n .add(pageNum + pageSizeWeeks, 'weeks');\r\n \r\n let subEndDate = subEndDateCandidate.isAfter(endDate, 'date') ? endDate : subEndDateCandidate;\r\n if (subStartDate.isAfter(subEndDate, 'date')){\r\n continue;\r\n }\r\n const page = getDataPage(subStartDate, subEndDate);\r\n pageQueue.push(page);\r\n }\r\n\r\n while (pageQueue.length){\r\n executeQueue.push(pageQueue.pop());\r\n if (executeQueue.length >= 3 || (!pageQueue.length && executeQueue.length)){\r\n results.push(...await Promise.all(executeQueue.map(p => p.execute())));\r\n executeQueue = [];\r\n }\r\n }\r\n\r\n let compiledResults = [];\r\n results.forEach((queryResult, idx) => {\r\n if (queryResult.error){\r\n console.error('Failed to fetch page ' + (idx + 1) + ' of results!', queryResult.error)\r\n return;\r\n }\r\n let data = queryResult.data.getFinalizedFlights.docs;\r\n compiledResults = compiledResults.concat(data);\r\n })\r\n return compiledResults;\r\n }\r\n\r\n return (\r\n \r\n {({ data }) => {\r\n const manifestPrintouts = safeGet(['getCustomer', 'manifestPrintout'], data) || [];\r\n const flightManifest = manifestPrintouts.find((m) => m.type === 'Flight'); \r\n const hessLayout = flightManifest && flightManifest.layouts.find((l) => l.name === 'Hess');\r\n const logoURL = hessLayout && hessLayout.logo;\r\n\r\n const handleClick = async () => {\r\n try {\r\n var flights = await getFullFinalizedFlightsData(1);\r\n }\r\n catch(err){\r\n setPrintOutLoading(false);\r\n console.error(err);\r\n message.error('One or more pages of data failed to be fetched. You may need to narrow your date range.', 6)\r\n return;\r\n }\r\n const body = {\r\n issuedBy: `${userAttr.given_name} ${userAttr.family_name}`,\r\n orgName: orgData.customer.name,\r\n logoURL: logoURL,\r\n flights: flights,\r\n layoutName: props.dateRange[0].format(\"MMMM DD, YYYY\") === props.dateRange[1].format(\"MMMM DD, YYYY\") ?\r\n props.dateRange[0].format(\"MMMM DD, YYYY\") + ` ${orgData.customer.name}`:\r\n props.dateRange[0].format(\"MMMM DD, YYYY\") +\" - \" + props.dateRange[1].format(\"MMMM DD, YYYY\") + ` ${orgData.customer.name}`\r\n }\r\n fetchPrintout(body, true, `${orgData.customer.name} Flight Manifest ${props.dateRange[0].format('MMM DD, YYYY')} - ${props.dateRange[1].format('MMM DD, YYYY')}.xlsx`)\r\n .then(() => setPrintOutLoading(false))\r\n .catch((err) => {\r\n setPrintOutLoading(false);\r\n message.error('Failed to download printout', 3).then(() => {\r\n message.error(err.message, 5);\r\n }, null)\r\n })\r\n }\r\n return (\r\n \r\n )\r\n }}\r\n \r\n )\r\n}\r\n\r\nvar PrintoutPercentageButton = ({...props}) => {\r\n const [ fetchPrintout, fetching ] = useManifestPrintout('FlightPercentages', 'FlightPercentages');\r\n const ApolloClient = useApolloClient();\r\n const [ printoutLoading, setPrintOutLoading ] = useState(false);\r\n const userAttr = props.cognitoUser.attributes\r\n const orgData = props.orgData;\r\n\r\n async function getFullFinalizedFlightsData(pageSizeWeeks=2){\r\n\r\n /** @type Moment */\r\n let startDate = props.dateRange[0];\r\n /** @type Moment */\r\n let endDate = props.dateRange[1];\r\n\r\n let duration = moment.duration(endDate.diff(startDate));\r\n let noWeeks = Math.ceil(duration.as('weeks'));\r\n\r\n setPrintOutLoading(true);\r\n function getDataPage(subStartDate, subEndDate){\r\n return {\r\n execute: () => {\r\n return ApolloClient.query({\r\n variables: {\r\n tpID: props.orgData.transporter._id,\r\n customerID: props.orgData.customer._id,\r\n startDate: subStartDate.format('YYYY-MM-DD'),\r\n endDate: subEndDate.format('YYYY-MM-DD'),\r\n departureID: props.departureID && props.departureID.key\r\n },\r\n query: FINALIZED_FLIGHTS_FULL,\r\n fetchPolicy: 'no-cache'\r\n })\r\n }\r\n }\r\n }\r\n\r\n // Fetch each page of data two pages at a time using two queues.\r\n const pageQueue = [];\r\n const results = [];\r\n let executeQueue = [];\r\n\r\n for (let pageNum = 0; pageNum <= noWeeks; pageNum+=pageSizeWeeks) {\r\n let subStartDate = moment(startDate).add(pageNum, 'weeks');\r\n if (pageNum !== 0){\r\n subStartDate.add(1, 'day'); // Prevent overlapping between pages\r\n }\r\n let subEndDateCandidate = moment(startDate)\r\n .add(pageNum + pageSizeWeeks, 'weeks');\r\n\r\n let subEndDate = subEndDateCandidate.isAfter(endDate, 'date') ? endDate : subEndDateCandidate;\r\n if (subStartDate.isAfter(subEndDate, 'date')){\r\n continue;\r\n }\r\n pageQueue.push(getDataPage(subStartDate, subEndDate));\r\n }\r\n\r\n while (pageQueue.length){\r\n executeQueue.push(pageQueue.pop());\r\n if (executeQueue.length >= 3 || (!pageQueue.length && executeQueue.length)){\r\n results.push(...await Promise.all(executeQueue.map(p => p.execute())));\r\n executeQueue = [];\r\n }\r\n }\r\n\r\n let compiledResults = [];\r\n results.forEach((queryResult, idx) => {\r\n if (queryResult.error){\r\n console.error('Failed to fetch page ' + (idx + 1) + ' of results!', queryResult.error)\r\n return;\r\n }\r\n let data = queryResult.data.getFinalizedFlights.docs;\r\n compiledResults = compiledResults.concat(data);\r\n })\r\n return compiledResults;\r\n }\r\n \r\n return (\r\n \r\n {({ data }) => {\r\n const manifestPrintouts = safeGet(['getCustomer', 'manifestPrintout'], data) || [];\r\n const flightManifest = manifestPrintouts.find((m) => m.type === 'Flight'); \r\n const hessLayout = flightManifest && flightManifest.layouts.find((l) => l.name === 'Hess');\r\n const logoURL = hessLayout && hessLayout.logo;\r\n const handleClick = async () => {\r\n try {\r\n var flights = await getFullFinalizedFlightsData(1);\r\n }\r\n catch(err){\r\n setPrintOutLoading(false);\r\n console.error(err);\r\n message.error('One or more pages of data failed to be fetched. You may need to narrow your date range.', 6)\r\n return;\r\n }\r\n const body = {\r\n issuedBy: `${userAttr.given_name} ${userAttr.family_name}`,\r\n orgName: orgData.customer.name,\r\n logoURL: logoURL,\r\n flights: flights,\r\n layoutName: props.dateRange[0].format(\"MMMM DD, YYYY\") === props.dateRange[1].format(\"MMMM DD, YYYY\") ?\r\n `${orgData.customer.name} Flight Usage for ` + props.dateRange[0].format(\"MMMM DD, YYYY\"):\r\n `${orgData.customer.name} Flight Usage for ` + props.dateRange[0].format(\"MMMM DD, YYYY\") + \" - \" + props.dateRange[1].format(\"MMMM DD, YYYY\")\r\n }\r\n fetchPrintout(body, true, `${orgData.customer.name} Flight Usages ${props.dateRange[0].format('MMM DD, YYYY')} - ${props.dateRange[1].format('MMM DD, YYYY')}.xlsx`)\r\n .then(() => setPrintOutLoading(false))\r\n .catch((err) => {\r\n setPrintOutLoading(false);\r\n message.error('Failed to download printout', 3).then(() => {\r\n message.error(err.message, 5);\r\n }, null)\r\n })\r\n }\r\n return (\r\n \r\n )\r\n }}\r\n \r\n )\r\n}\r\n\r\nexport default compose(\r\n WithOrgData,\r\n withCognitoUser,\r\n withFlightTimesEntryDrawer({editMode: true})\r\n)(FlightTimes)","import {default as useInfiniteScrollLib, UseInfiniteScrollHookArgs as LibArgs} from \"react-infinite-scroll-hook\";\r\nimport {Dispatch, useEffect, useReducer} from \"react\";\r\n\r\nexport type LoadArgs = Pick;\r\n\r\nexport type SideEffect = {\r\n /**\r\n * When these variables change, callback will be called.\r\n */\r\n deps: any[],\r\n\r\n /**\r\n * Executes when any value in deps changes.\r\n */\r\n callback: () => void\r\n}\r\n\r\nexport interface InfiniteScrollAdapter {\r\n /**\r\n * Initial state of the state machine\r\n */\r\n initState: S,\r\n\r\n /**\r\n * Implements state transitions\r\n * @param prevState Previous state.\r\n * @param action Action to be performed to change the state.\r\n */\r\n reducer: (prevState: S, action: A) => S,\r\n\r\n /**\r\n * This is where the pagination is actually implemented. Returns arguments for the react-infinite-scroll-hook\r\n * to read.\r\n * @param state Current state of the state machine.\r\n * @param dispatcher Dispatch actions for the state machine.\r\n */\r\n getLoadArgs: (state: S, dispatcher: Dispatch) => LoadArgs,\r\n\r\n /**\r\n * Execute side effects when the query or state changes. Works much like useEffect.\r\n */\r\n sideEffect?: SideEffect\r\n}\r\n\r\nexport interface UseInfiniteScrollHookArgs extends Pick {\r\n adapterImpl: InfiniteScrollAdapter\r\n}\r\n\r\n/**\r\n * Wrapper for react-infinite-scroll-hook library. Uses \"adapters\" to implement various pagination systems.\r\n * @param adapterImpl Concrete implementation of InfiniteScrollAdapter class.\r\n * @param rest The rest of the props are sent to the react-infinite-scroll-hook library.\r\n * @example\r\n * const mangoAdapter = new CouchdbMangoAdapter({\r\n *\r\n * // Pass the query used for the useQuery hook. Will be used for updating the cache later.\r\n * query: FINALIZED_FLIGHTS,\r\n *\r\n * // Retrieves the actual MangoQueryResult structure from the query result.\r\n * getMangoQueryResult: (data) => data?.getFinalizedFlights,\r\n *\r\n * // queryResult from useQuery hook.\r\n * queryResult: queryResult\r\n * });\r\n *\r\n * const [ sentryRef ] = useInfiniteScroll({ adapterImpl: mangoAdapter });\r\n */\r\nexport function useInfiniteScroll({ adapterImpl, ...rest }: UseInfiniteScrollHookArgs){\r\n\r\n const [ state, dispatch ] = useReducer(adapterImpl.reducer, adapterImpl.initState);\r\n\r\n const loadArgs = adapterImpl.getLoadArgs(state, dispatch);\r\n\r\n useEffect(() => {\r\n adapterImpl.sideEffect?.callback();\r\n }, adapterImpl.sideEffect?.deps);\r\n\r\n const [ sentryRef ] = useInfiniteScrollLib({\r\n ...rest,\r\n disabled: rest.disabled || loadArgs.disabled,\r\n loading: loadArgs.loading,\r\n hasNextPage: loadArgs.hasNextPage,\r\n onLoadMore: loadArgs.onLoadMore\r\n });\r\n\r\n return {\r\n sentryRef: sentryRef,\r\n loading: loadArgs.loading,\r\n hasNextPage: loadArgs.hasNextPage\r\n }\r\n}","import { Col, DatePicker, Row } from 'antd';\r\nimport FlightTimes from 'components/flights/times/FlightTimes';\r\nimport { LocationSelect } from 'components/form/select/LocationSelect';\r\nimport moment from 'moment';\r\nimport React from 'react';\r\n\r\nconst { RangePicker } = DatePicker;\r\n\r\nclass FlightTimesHeader extends React.Component {\r\n state = {\r\n dateRange: [moment().subtract(1, 'day'), moment() ],\r\n departureID: null\r\n }\r\n render() {\r\n return (\r\n
\r\n \r\n \r\n {\r\n if(dates.length === 0){\r\n dates = [moment().subtract(1, 'day'), moment()]\r\n }\r\n this.setState({dateRange: dates})\r\n }}\r\n format=\"MMM DD, YY\"\r\n disabledDate={(current) => moment().isBefore(current, 'day')}\r\n ranges={{\r\n 'This Month': [\r\n moment().startOf('month'),\r\n moment().endOf('month')\r\n ],\r\n 'This Week': [\r\n moment().startOf('week'),\r\n moment().endOf('week')\r\n ],\r\n 'Last Month': [\r\n moment().subtract(1, 'month').startOf('month'),\r\n moment().subtract(1, 'month').endOf('month')\r\n ],\r\n 'Last Week': [\r\n moment().subtract(1, 'week').startOf('week'),\r\n moment().subtract(1, 'week').endOf('week')\r\n ],\r\n }}\r\n />\r\n \r\n \r\n Departure Location: this.setState({departureID: value})} value={this.state.departureID} labelInValue style={{minWidth: '10rem'}}/> \r\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 FlightTimesHeader;","import React, { ReactNode, ReactElement, HTMLAttributes } from 'react';\r\nimport './style.less';\r\nimport { TabsProps } from 'antd/lib/tabs';\r\nimport { classNames } from 'common/util';\r\nimport cn from 'classnames';\r\n\r\nexport interface LiveHeaderProps {\r\n title?: ReactNode,\r\n titleWrapperProps?: HTMLAttributes,\r\n subTitle?: ReactNode,\r\n tabs?: ReactElement,\r\n leftContent?: ReactNode | ReactNode[],\r\n middleContent?: ReactNode | ReactNode[],\r\n rightContent?: ReactNode | ReactNode[],\r\n verticallyCenterTitle?: boolean\r\n}\r\n\r\nconst baseClassName = \"mc-live-header\"\r\n\r\nconst LiveHeader: React.FC = (props) => {\r\n\r\n function renderContent(content: ReactNode | ReactNode[]){\r\n let contentItem = [];\r\n if (Array.isArray(content)){\r\n contentItem = content;\r\n }\r\n else if (content)\r\n {\r\n contentItem.push(content);\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n\r\n if (contentItem.length <= 0){\r\n return null\r\n }\r\n\r\n return contentItem.map((item: React.ReactNode, idx: number) => (\r\n
{item}
\r\n ))\r\n }\r\n\r\n let titleWrapperClassName = `${baseClassName}-title-wrapper ${baseClassName}-contain-item`;;\r\n\r\n if (props.verticallyCenterTitle){\r\n titleWrapperClassName = classNames(titleWrapperClassName, baseClassName + '-title-wrapper-centered');\r\n }\r\n\r\n let titleWrapperContent = []\r\n \r\n if (props.title){\r\n titleWrapperContent.push(\r\n {props.title}\r\n )\r\n }\r\n if (props.subTitle){\r\n titleWrapperContent.push(\r\n {props.subTitle}\r\n )\r\n }\r\n \r\n let titleWrapper = null;\r\n if (titleWrapperContent.length > 0){\r\n titleWrapper =
\r\n {titleWrapperContent}\r\n
\r\n }\r\n\r\n let tabs = null;\r\n if (props.tabs){\r\n tabs =
{props.tabs}
\r\n }\r\n\r\n let leftContent = renderContent(props.leftContent);\r\n let middleContent = renderContent(props.middleContent);\r\n let rightContent = renderContent(props.rightContent);\r\n\r\n return
\r\n
\r\n
\r\n {titleWrapper}\r\n {tabs}\r\n
\r\n {leftContent}\r\n
\r\n
\r\n {props.middleContent ? (\r\n
\r\n
\r\n {middleContent}\r\n
\r\n
\r\n ) : null}\r\n
\r\n
\r\n {rightContent}\r\n
\r\n
\r\n
\r\n
;\r\n}\r\n\r\nexport default LiveHeader\r\n","import { classNames } from 'common/util';\r\nimport React, { PropsWithChildren } from 'react';\r\nimport LiveHeader, { LiveHeaderProps } from '../LiveHeader';\r\nimport './style.less';\r\n\r\nexport interface LiveCardProps {\r\n headerProps?: LiveHeaderProps,\r\n contentNoBorder?: boolean,\r\n contentNoPadding?: boolean,\r\n hasTable?: boolean,\r\n animation?: {\r\n slideIn?: boolean\r\n }\r\n}\r\n\r\nconst LiveCard: React.FC> = (props) => {\r\n\r\n let cardClasses = ['mc-live-card'];\r\n\r\n let contentClasses = ['mc-live-content'];\r\n if (!props.contentNoPadding) contentClasses.push('mc-live-content-padded');\r\n if (props.hasTable) contentClasses.push('mc-live-content-has-table');\r\n \r\n if (!props.contentNoBorder) cardClasses.push('mc-live-card-bordered');\r\n if (props.animation?.slideIn) cardClasses.push('mc-live-card-slide-in');\r\n\r\n return
\r\n {props.headerProps ? (\r\n \r\n ) : null}\r\n
\r\n {props.children}\r\n
\r\n
\r\n}\r\n\r\nexport default LiveCard","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery GetCgo(\r\n $filter: CargoFilterInput\r\n $bookmark: String\r\n $limit: Int\r\n){\r\n cargo(\r\n filter: $filter\r\n bookmark: $bookmark\r\n limit: $limit\r\n ) {\r\n bookmark\r\n docs {\r\n _id,\r\n ... on CargoNode {\r\n name,\r\n customerID {\r\n _id\r\n name\r\n }\r\n approvedBy\r\n weight\r\n checkedInTime\r\n deliveredBy\r\n attentionTo\r\n groundPickup\r\n hazmat\r\n hazmatUnCode\r\n destinationID {\r\n _id\r\n name\r\n }\r\n departureID {\r\n _id\r\n name\r\n }\r\n transitType\r\n currentCarrierID {\r\n _id\r\n desig\r\n }\r\n }\r\n }\r\n }\r\n}`","import {Checkbox, Form, Input, InputNumber, Select} from 'antd';\r\nimport { FormComponentProps, FormItemProps } from 'antd/lib/form';\r\nimport { GetFieldDecoratorOptions, WrappedFormUtils } from 'antd/lib/form/Form';\r\nimport { createFormFields, formItemLayout } from 'common/form';\r\nimport React from 'react';\r\nimport ContractSelect from './ContractSelect';\r\nimport { LocationSelect } from './select/LocationSelect';\r\n\r\nexport interface CargoFormProps extends FormComponentProps {\r\n useFields?: (string | FieldDecorator)[],\r\n excludeFields?: string[],\r\n formItemProps?: FormItemProps,\r\n fieldComponentPropsMap?: {\r\n [id: string]: any\r\n },\r\n onFieldsChange?(fields: any): void,\r\n fields?: any,\r\n renderExtra?: (form: WrappedFormUtils) => JSX.Element\r\n}\r\n\r\ninterface FieldDecorator {\r\n id: string,\r\n label: string,\r\n options?: GetFieldDecoratorOptions,\r\n extraProps?: any,\r\n component?: JSX.Element\r\n}\r\n\r\nconst CargoForm: React.FC = (props) => {\r\n const { getFieldDecorator, getFieldValue } = props.form;\r\n \r\n\r\n function getComponentProps(id: string){\r\n if (props.fieldComponentPropsMap){\r\n return props.fieldComponentPropsMap[id];\r\n }\r\n return {}\r\n }\r\n\r\n function getFormItems(formItemProps: FormItemProps={}): FieldDecorator[] {\r\n let formItems: FieldDecorator[] = [\r\n {\r\n id: 'name',\r\n label: 'Name',\r\n options: {\r\n rules: [\r\n { required: true, message: 'Name is required' }\r\n ]\r\n },\r\n component: ,\r\n extraProps: formItemProps\r\n },\r\n {\r\n id: 'weight',\r\n label: 'Weight',\r\n component: ,\r\n extraProps: formItemProps,\r\n options: {\r\n initialValue: 0,\r\n rules: [\r\n {\r\n required: true, message: 'Weight is required'\r\n },\r\n {\r\n validator: (_, value, callback) => {\r\n if (value < 1){\r\n callback('Weight must be greater than zero');\r\n }\r\n else{\r\n callback()\r\n }\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n id: 'lastKnownController',\r\n label: 'Heliport',\r\n extraProps: formItemProps,\r\n options: {\r\n rules: [\r\n {\r\n required: true, message: 'Please select a heliport'\r\n }\r\n ]\r\n },\r\n component: \r\n },{\r\n id: 'departureID',\r\n label: 'Departure Location',\r\n extraProps: formItemProps,\r\n options: {\r\n rules: [\r\n {\r\n required: true, message: 'Please select a departure location'\r\n }\r\n ]\r\n },\r\n component: \r\n },\r\n {\r\n id: 'destinationID',\r\n label: 'Destination Location',\r\n extraProps: formItemProps,\r\n options: {\r\n rules: [\r\n {\r\n required: true, message: 'Please select a destination location'\r\n }\r\n ]\r\n },\r\n component: \r\n },\r\n {\r\n id: 'contractID',\r\n label: 'Contract',\r\n extraProps: formItemProps,\r\n options: {\r\n rules: [\r\n {\r\n required: false, message: 'Please select a contract'\r\n }\r\n ]\r\n },\r\n component: \r\n },\r\n {\r\n id: 'transitType',\r\n label: 'TransitType',\r\n extraProps: formItemProps,\r\n options: {\r\n initialValue: 'INBOUND',\r\n rules: [{ required: true, message: 'Transit Type is required' }]\r\n },\r\n component: \r\n },\r\n {\r\n id: 'hazmat',\r\n label: 'Hazmat',\r\n extraProps: formItemProps,\r\n options: {\r\n valuePropName: 'checked',\r\n initialValue: false\r\n },\r\n component: \r\n \r\n },\r\n {\r\n id: 'customer',\r\n label: 'Customer',\r\n extraProps: formItemProps,\r\n options: {\r\n rules: [\r\n {\r\n required: true, message: 'Customer is required'\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n id: 'attentionTo',\r\n label: 'Attention',\r\n extraProps: formItemProps,\r\n options: {\r\n rules: [\r\n {\r\n required: true, message: 'Attention is required'\r\n }\r\n ]\r\n },\r\n component: \r\n },\r\n {\r\n id: 'approvedBy',\r\n label: 'Approved',\r\n extraProps: formItemProps,\r\n options: {\r\n valuePropName: 'checked',\r\n initialValue: false\r\n },\r\n component: {getFieldValue('approvedBy')}\r\n },\r\n {\r\n id: 'notes',\r\n label: 'Notes',\r\n extraProps: formItemProps,\r\n component: \r\n }\r\n ]\r\n\r\n let hazmatIndex = formItems.findIndex((fi) => fi.id === 'hazmat');\r\n if (getFieldValue('hazmat') && hazmatIndex !== -1){\r\n formItems.splice(hazmatIndex + 1, 0,\r\n {\r\n id: 'hazmatUnCode',\r\n label: 'Hazmat UN Code',\r\n component: ,\r\n extraProps: formItemProps,\r\n }\r\n )\r\n }\r\n\r\n return formItems\r\n }\r\n\r\n var formItems = getFormItems(props.formItemProps || formItemLayout);\r\n \r\n if (props.useFields){\r\n formItems = formItems.filter((fi) => props.useFields.includes(fi.id))\r\n }\r\n if (props.excludeFields){\r\n formItems = formItems.filter((fi) => !props.excludeFields.includes(fi.id))\r\n }\r\n\r\n function renderFormItem(fd: FieldDecorator): JSX.Element{\r\n return \r\n {getFieldDecorator(fd.id, fd.options)(React.cloneElement(fd.component, getComponentProps(fd.id)))}\r\n \r\n }\r\n\r\n var formItemElements = formItems.map(renderFormItem)\r\n\r\n return
\r\n {formItemElements}\r\n {props.renderExtra ? props.renderExtra(props.form) : null}\r\n
\r\n}\r\n\r\nexport function formatCargoFormValues(values: any) {\r\n const {\r\n name,\r\n weight,\r\n hazmat,\r\n hazmatUnCode,\r\n attentionTo,\r\n notes,\r\n customerID,\r\n contractID,\r\n departureID,\r\n destinationID,\r\n lastKnownController,\r\n groundPickup,\r\n approvedBy,\r\n initials\r\n } = values;\r\n const formattedValues = {\r\n name,\r\n weight,\r\n hazmat,\r\n hazmatUnCode,\r\n attentionTo,\r\n notes,\r\n customerID: customerID && customerID.key,\r\n departureID: departureID && departureID.key,\r\n destinationID: destinationID && destinationID.key,\r\n contractID,\r\n lastKnownController: lastKnownController && lastKnownController.key,\r\n deliveredBy: departureID && departureID.label,\r\n groundPickup: groundPickup || false,\r\n approvedBy: approvedBy || null,\r\n initials: initials\r\n }\r\n return formattedValues;\r\n}\r\n\r\nCargoForm.defaultProps = {\r\n useFields: [\r\n 'name',\r\n 'weight',\r\n 'lastKnownController',\r\n 'departureID',\r\n 'destinationID',\r\n 'contractID',\r\n 'hazmat',\r\n 'customer',\r\n 'attentionTo',\r\n 'approvedBy',\r\n 'notes',\r\n 'hazmat'\r\n ]\r\n}\r\n\r\nexport default Form.create({\r\n mapPropsToFields(props){\r\n if (!props.fields){\r\n return undefined;\r\n }\r\n return createFormFields(props.fields)\r\n },\r\n onFieldsChange(props, _, fields){\r\n if (props.onFieldsChange){\r\n props.onFieldsChange(fields);\r\n }\r\n },\r\n onValuesChange(props, changedValues, allValues){\r\n if(changedValues[\"lastKnownController\"]){\r\n props.form.setFieldsValue({\"contractID\": \"\"})\r\n }\r\n }\r\n})(CargoForm)\r\n\r\n","import { Button, Col, Input, Row } from 'antd';\r\nimport useControlledState from 'hooks/useControlledState';\r\nimport React from 'react';\r\nimport './PaxCgoScheduler.less';\r\n\r\nexport interface CargoFooterProps {\r\n onSubmit?(initials: string): void,\r\n buttonDisabled?: boolean,\r\n editMode?: boolean,\r\n onEditCancel?(): void,\r\n initials?: string,\r\n onInitialsChange?(value: string): void,\r\n isSubmitting?: boolean\r\n}\r\n\r\nconst CargoFooter: React.FC = (props) => {\r\n const [ initials, setInitials ] = useControlledState(undefined, props.initials, props.onInitialsChange);\r\n\r\n function handleInitialsChange(e: React.ChangeEvent){\r\n let value = e.target.value;\r\n value = value.toUpperCase().replace(/[^a-zA-Z]/, '').trim();\r\n setInitials(value);\r\n }\r\n\r\n function handleButtonClick(){\r\n if (props.onSubmit && initials){\r\n props.onSubmit(initials);\r\n }\r\n }\r\n\r\n return \r\n \r\n \r\n \r\n \r\n \r\n {props.isSubmitting ? (\r\n \r\n ) : (\r\n {props.editMode ? 'Apply Changes' : 'Add Cargo'}\r\n )}\r\n \r\n {props.editMode ? (\r\n \r\n \r\n \r\n ) : null}\r\n \r\n}\r\n\r\nexport default CargoFooter","import React, { useRef, useEffect, useState } from 'react';\r\nimport CargoForm from 'components/form/CargoForm';\r\nimport CargoFooter from './CargoFooter';\r\nimport WithOrgData, { WithOrgDataProps } from 'components/WithOrgData';\r\nimport uuidv4 from 'uuid/v4';\r\nimport { createFormFields } from 'common/form';\r\nimport {WrappedFormUtils} from \"antd/lib/form/Form\";\r\n\r\nexport interface CargoSiderTabProps extends WithOrgDataProps {\r\n clearOnSubmit?: boolean,\r\n clearOnClose?:boolean,\r\n departureID?: string,\r\n destintationID?: string,\r\n onSubmit?(values: any): void,\r\n editingFields?: any,\r\n onEditCancel?(): void,\r\n useFields?: string[],\r\n isSubmitting?: boolean,\r\n fields?: any,\r\n renderExtra?: (form: WrappedFormUtils) => JSX.Element\r\n}\r\n\r\nexport const formatCargoValues = (values) => {\r\n const {\r\n name,\r\n weight,\r\n hazmat,\r\n hazmatUnCode,\r\n attentionTo,\r\n notes,\r\n customerID,\r\n contractID,\r\n departureID,\r\n destinationID,\r\n lastKnownController,\r\n groundPickup,\r\n approvedBy,\r\n transitType\r\n } = values;\r\n const formattedValues = {\r\n name,\r\n weight,\r\n hazmat,\r\n hazmatUnCode,\r\n attentionTo,\r\n notes,\r\n customerID: customerID && customerID.key,\r\n departureID: departureID && departureID.key,\r\n destinationID: destinationID && destinationID.key,\r\n contractID,\r\n lastKnownController: lastKnownController && lastKnownController.key,\r\n deliveredBy: departureID && departureID.label,\r\n groundPickup: groundPickup || false,\r\n approvedBy: approvedBy || null,\r\n transitType: transitType\r\n }\r\n return formattedValues;\r\n}\r\n\r\nconst CargoSiderTab_Internal: React.FC = (props) => {\r\n const cargoFormRef = useRef(null);\r\n const [ fields, setFields ] = useState(props.fields);\r\n const [ editMode, setEditMode ] = useState(false);\r\n const [ initials, setInitials ] = useState(undefined);\r\n\r\n useEffect(() => {\r\n if (editMode && fields){\r\n cargoFormRef.current.validateFields();\r\n }\r\n // eslint-disable-next-line\r\n }, [ props.editingFields ])\r\n\r\n useEffect(() => {\r\n if(props.clearOnClose){\r\n cargoFormRef.current.resetFields();\r\n }\r\n }, [props.clearOnClose])\r\n\r\n useEffect(() => {\r\n if(props.fields){\r\n setFields(props.fields)\r\n }\r\n }, [props.fields])\r\n\r\n useEffect(() => {\r\n if (props.editingFields && !editMode){\r\n setFields(createFormFields(props.editingFields));\r\n if (props.editingFields.initials){\r\n setInitials(props.editingFields.initials);\r\n }\r\n setEditMode(true);\r\n }\r\n if (!props.editingFields && editMode){\r\n setFields(undefined);\r\n setInitials(undefined);\r\n setEditMode(false);\r\n }\r\n // eslint-disable-next-line\r\n }, [ props.editingFields ])\r\n\r\n return
\r\n
\r\n setFields(newFields)}\r\n fields={fields}\r\n />\r\n setInitials(value)}\r\n onSubmit={(i) => {\r\n cargoFormRef.current.validateFieldsAndScroll((err: any, values: any) => {\r\n if (!err && props.onSubmit) {\r\n const formattedValues = formatCargoValues(values)\r\n if(formattedValues.approvedBy && !formattedValues.name){\r\n props.onSubmit({\r\n approvedBy: formattedValues.approvedBy\r\n })\r\n }else {\r\n props.onSubmit({\r\n ...formattedValues,\r\n _id: (props.editingFields && props.editingFields._id) ? props.editingFields._id : `CGO-${uuidv4()}`,\r\n customerID: props.orgData.getOrgIDByType('customer'),\r\n tpID: props.orgData.getOrgIDByType('transporter'),\r\n initials: i,\r\n transitType: formattedValues.transitType || 'INBOUND',\r\n classType: 'flytsuite.cgonode'\r\n })\r\n }\r\n if (props.clearOnSubmit){\r\n cargoFormRef.current.resetFields();\r\n setInitials(undefined);\r\n }\r\n }\r\n })\r\n }}\r\n />\r\n
\r\n
\r\n}\r\n\r\nconst CargoSiderTab = WithOrgData(CargoSiderTab_Internal);\r\n\r\nCargoSiderTab.displayName = 'WithOrgData(CargoSiderTab)';\r\n\r\nexport default CargoSiderTab","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nmutation CheckInInboundCargo($payload: CargoNodeInput!){\r\n setCargoNode(payload: $payload){\r\n _id\r\n name\r\n }\r\n}\r\n`","import {ColumnProps} from \"antd/lib/table\";\r\nimport {ColumnConfig} from \"./index\";\r\nimport {RegisterNodeFunction} from \"../util\";\r\nimport React from 'react';\r\n\r\nfunction createTitleKey(column: ColumnProps){\r\n return 'title-' + column.key;\r\n}\r\n\r\nfunction createRenderKey(column: ColumnProps, rowIndex: number){\r\n return 'data-' + column.key + '-row-' + rowIndex\r\n}\r\n\r\n/**\r\n * Converts an AntD column's props into {@link ColumnConfig}.\r\n * @param column AntD Column\r\n * @param getNodeTextFunc Callback from {@link reactNodeTextGetter.getNodeText}\r\n */\r\nexport function convertAntdColumn(column: ColumnProps, getNodeTextFunc: (nodeId: string) => string): ColumnConfig {\r\n\r\n let titleId = createTitleKey(column);\r\n let titleText = getNodeTextFunc(titleId);\r\n\r\n return {\r\n name: titleText,\r\n path: column.dataIndex ? [column.dataIndex] : [],\r\n render: column.render ? (value: any, row: any, index: number) => {\r\n const renderId = createRenderKey(column, index);\r\n return getNodeTextFunc(renderId);\r\n } : null\r\n }\r\n}\r\n\r\n/**\r\n * Registers an AntD column component in the {@link reactNodeTextGetter} function.\r\n * @param column AntD column.\r\n * @param registerNode Callback provided from {@link reactNodeTextGetter.registerNode}\r\n */\r\nexport function registerAntdColumn(column: ColumnProps, registerNode: RegisterNodeFunction){\r\n\r\n let title = column.title;\r\n title = registerNode(title, createTitleKey(column));\r\n\r\n let enhancedRender: (value: any, record: any, index: any, ...rest: any[]) => React.ReactNode | undefined;\r\n\r\n // We have to cast this to an any for now. Some of the columns defined in the src/common/table/columns.js pass a fourth\r\n // parameter for onClick events that the Ant-Design ColumnProps.render interface does not support. (used by 'isnStatus' and 'restrictions' columns.\r\n const renderFunc = column.render as any;\r\n\r\n if (renderFunc){\r\n enhancedRender = (value: any, record: any, index: any, ...rest) => {\r\n const node = renderFunc(value, record, index, ...rest);\r\n return registerNode(node, createRenderKey(column, index));\r\n };\r\n }\r\n\r\n\r\n return {\r\n ...column,\r\n title: title,\r\n render: enhancedRender\r\n }\r\n}","import {exportDataAsCsv} from \"./csv-converter\";\r\nimport {convertAntdColumn, registerAntdColumn} from \"./antd-converter\";\r\n\r\n\r\nexport type ExportDataFunction = (data: T[], filename: string, config: any) => void\r\n\r\nexport type ColumnConfigRenderFunction = (value: any, row: any, rowIndex: number) => string\r\n\r\nexport interface ColumnConfig {\r\n /** Human-readable name of the column. */\r\n name: string,\r\n\r\n /** Path to find the value to display. */\r\n path?: string[],\r\n\r\n /** Overrides behavior of path. Allows to pass custom function to display the value. */\r\n render?: ColumnConfigRenderFunction\r\n}\r\n\r\n/**\r\n * Recursively traverses object in accordance to the path specified. Returns the value if found.\r\n * @param path List of strings representing the object keys to traverse.\r\n * @param obj Object to traverse.\r\n */\r\nexport function resolvePath(path: string[], obj: any){\r\n if (path.length == 0 || !obj)\r\n return obj;\r\n\r\n let currProp = path[0];\r\n\r\n if (!obj[currProp])\r\n return null;\r\n\r\n if (obj[currProp] && typeof obj[currProp] === 'object'){\r\n return resolvePath(path.slice(1, path.length), obj[currProp]);\r\n }\r\n\r\n if (path.length !== 1)\r\n return null;\r\n\r\n return obj[currProp] || null;\r\n}\r\n\r\n/**\r\n * Retrieves a value based on the {@link ColumnConfig}. First it calls {@link resolvePath}, then it calls the render function if available.\r\n * @param obj Object to process\r\n * @param config The {@link ColumnConfig}\r\n * @param rowIndex Index of the current row\r\n */\r\nexport function resolveColumnValue(obj: any, config: ColumnConfig, rowIndex: number){\r\n if (!config.path && !config.render)\r\n return '';\r\n\r\n const value = config.path ? resolvePath(config.path, obj) : null;\r\n\r\n if (config.render){\r\n return config.render(value, obj, rowIndex);\r\n }\r\n return value;\r\n}\r\n\r\n/**\r\n * Creates a file out of string and downloads it in the browser.\r\n * @param text Contents of file\r\n * @param filename File name\r\n * @param contentType Mime Type (e.g. \"text/csv\" or \"application/json\")\r\n * @param target Target window (current window by default)\r\n */\r\nexport function exportToFile(text: string, filename: string, contentType: string, target=window){\r\n const blob = new Blob([text], { type: contentType + \";charset=UTF-8\" });\r\n const downloadLink = target.document.createElement('a');\r\n\r\n downloadLink.download = filename;\r\n downloadLink.href = URL.createObjectURL(blob);\r\n downloadLink.style.display = \"none\";\r\n target.document.body.appendChild(downloadLink);\r\n downloadLink.click();\r\n downloadLink.remove();\r\n}\r\n\r\nconst DataExport = {\r\n exportDataAsCsv,\r\n Utils: {\r\n convertAntdColumn,\r\n registerAntdColumn\r\n }\r\n}\r\n\r\nexport default DataExport","import {ColumnConfig, exportToFile, resolveColumnValue} from \"./index\";\r\n\r\nexport interface CsvConfig {\r\n columns: ColumnConfig[]\r\n delimiter?: string\r\n}\r\n\r\n/**\r\n * Converts array of objects to a CSV string\r\n * @param data List of objects\r\n * @param config Set up column configurations\r\n */\r\nfunction csvConverter(data: T[], config: CsvConfig) {\r\n\r\n const { columns } = config;\r\n\r\n const delimiter = config?.delimiter || '\\t';\r\n\r\n let csvRows = [];\r\n csvRows.push(\"sep=\" + delimiter);\r\n\r\n // Write header row\r\n const names = columns.map(config => config.name);\r\n csvRows.push(names.join(delimiter));\r\n\r\n function processRow(row: T, rowIndex: number){\r\n\r\n let csvRow = [];\r\n\r\n for (let colConfig of config.columns){\r\n const value = resolveColumnValue(row, colConfig, rowIndex);\r\n csvRow.push(value);\r\n }\r\n\r\n csvRows.push(csvRow.join(delimiter));\r\n }\r\n\r\n // Build data rows\r\n for (let i = 0; i < data.length; i++) {\r\n processRow(data[i], i);\r\n }\r\n\r\n // Returning the array joining with new line\r\n return csvRows.join('\\n');\r\n}\r\n\r\n/**\r\n * Exports an array of objects into a CSV file and downloads it in the browser.\r\n * @param data Array of objects\r\n * @param filename Filename without extension (.csv will be added)\r\n * @param config Set up column configurations\r\n */\r\nexport function exportDataAsCsv(data: T[], filename: string, config: CsvConfig){\r\n let convertedCsv = csvConverter(data, config);\r\n\r\n filename = filename.replace('.csv', '');\r\n filename = filename + '.csv';\r\n\r\n exportToFile(convertedCsv, filename, 'text/csv');\r\n}","import React, {useContext, useReducer} from 'react';\r\nimport {GlobalFilterWithWrapper} from 'components/GlobalFilter';\r\nimport {Alert, Button, Checkbox, Col, Divider, Drawer, Dropdown, Icon, Menu, Row, Spin, Tabs, Tooltip} from 'antd';\r\nimport LiveCard from '../LiveCard';\r\nimport {NetworkStatus} from 'apollo-boost';\r\nimport useAutoPaginatedQuery from 'hooks/apollo-extensions/useAutoPaginatedQuery';\r\nimport CARGO_QUERY from './query';\r\nimport getGenericStateReducer from 'common/reducer/generic-state-reducer';\r\nimport {GlobalFilterContext} from 'context/global-filter';\r\nimport {OrgDataContext} from 'context/orgData';\r\nimport {fetchMoreAndGetToken} from '../util';\r\nimport pluralize from 'pluralize';\r\nimport {GlobalAppStateContext} from 'context/global-app-state';\r\nimport commonColumns from 'common/table/columns';\r\nimport {cleanGraphQLErrorMsg, reactNodeTextGetter} from 'common/util';\r\nimport {FilterableTable} from 'components/tables/FilterableTable';\r\nimport useUserGroups from 'hooks/useUserGroups';\r\nimport CargoSiderTab from 'components/scheduling/PaxCgoScheduler/CargoSiderTab';\r\nimport CheckInInboundCargo from 'Mutations/CheckInInboundCargo';\r\nimport {useMutation} from 'react-apollo';\r\nimport moment from 'moment';\r\nimport './style.less';\r\nimport withUserInfo from 'components/withUserInfo';\r\nimport DataExport from \"common/data-export\";\r\nimport {ColumnProps} from \"antd/lib/table\";\r\n\r\nexport interface LiveCargoProps {\r\n\r\n}\r\n\r\ninterface ReducerState {\r\n activeTab?: string,\r\n error: any,\r\n errorClosed: boolean,\r\n tableSettingsDropdownVisible: boolean,\r\n drawer: {\r\n error?: any,\r\n visible: boolean\r\n },\r\n approvalDrawer: {\r\n error?: any,\r\n visible: boolean,\r\n fields: any\r\n }\r\n}\r\n\r\nconst DEFUALT_STATE: ReducerState = {\r\n activeTab: 'outbound',\r\n error: null,\r\n errorClosed: false,\r\n tableSettingsDropdownVisible: false,\r\n drawer: {\r\n error: null,\r\n visible: false\r\n },\r\n approvalDrawer: {\r\n error: null,\r\n visible: false,\r\n fields: null\r\n }\r\n}\r\n\r\nconst ACTION_TYPES = {\r\n UPDATE_DRAWER_STATE: 'UPDATE_DRAWER_STATE',\r\n UPDATE_APPROVAL_DRAWER_STATE: 'UPDATE_APPROVAL_DRAWER_STATE'\r\n}\r\n\r\nfunction reducer(state: ReducerState, type: string, payload: any) {\r\n switch (type) {\r\n case ACTION_TYPES.UPDATE_DRAWER_STATE:\r\n return {\r\n ...state,\r\n drawer: {\r\n ...state.drawer,\r\n ...payload\r\n }\r\n }\r\n case ACTION_TYPES.UPDATE_APPROVAL_DRAWER_STATE:\r\n return {\r\n ...state,\r\n approvalDrawer: {\r\n ...state.approvalDrawer,\r\n ...payload\r\n }\r\n\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst LiveCargo: React.FC = (props: any) => {\r\n const globalFilter = useContext(GlobalFilterContext);\r\n const globalAppState = useContext(GlobalAppStateContext);\r\n const { customer, transporter } = useContext(OrgDataContext);\r\n const [userGroups] = useUserGroups();\r\n const { userinfo } = props;\r\n const [state, dispatch] = useReducer(getGenericStateReducer(reducer), DEFUALT_STATE);\r\n\r\n const queryVars = {\r\n filter: {\r\n customers: globalFilter.customer && globalFilter.customer.length ? globalFilter.customer.map(({ key }) => key) : customer && [customer._id],\r\n transporter: globalFilter.transporter && globalFilter.transporter.length ? globalFilter.transporter.map(({ key }) => key)[0] : transporter && transporter._id,\r\n departures: globalFilter.departure && globalFilter.departure.map(({ key }) => key),\r\n destinations: globalFilter.destination && globalFilter.destination.map(({ key }) => key),\r\n transitTypes: ['OUTBOUND', 'INBOUND', 'TRANSFER'],\r\n // groundPickup: getGroundPickup(),\r\n onlyShowLive: true\r\n },\r\n limit: 100\r\n }\r\n\r\n const {\r\n data, fetchMore,\r\n networkStatus, paginating,\r\n pageCount, refetch,\r\n error, paginationError\r\n } = useAutoPaginatedQuery(CARGO_QUERY, {\r\n variables: queryVars,\r\n fetchPolicy: 'cache-and-network',\r\n errorPolicy: 'all',\r\n pollInterval: 20000,\r\n supressDataUpdates: true,\r\n onError: (err) => dispatch({ newState: { error: err, errorClosed: false } }),\r\n onPaginationError: (err) => dispatch({ newState: { error: err, errorClosed: false } }),\r\n getNextToken: async (token) => await fetchMoreAndGetToken(fetchMore, queryVars, token, 'cargo'),\r\n getTokenFromData: (data) => {\r\n let token = data?.cargo?.bookmark;\r\n if (token === 'nil') {\r\n token = null;\r\n }\r\n return token;\r\n }\r\n })\r\n\r\n const [setCargoNode, { loading: cargoSubmitting }] = useMutation(CheckInInboundCargo, {\r\n onCompleted: () => {\r\n dispatch({\r\n newState: {\r\n activeTab: state.approvalDrawer.visible ? \"outbound\" : \"inbound\",\r\n drawer: {\r\n ...state.drawer,\r\n visible: false\r\n },\r\n approvalDrawer: {\r\n ...state.approvalDrawer,\r\n fields: null,\r\n visible: false\r\n }\r\n }\r\n })\r\n refetch();\r\n },\r\n onError: (error) => {\r\n dispatch({\r\n type: ACTION_TYPES.UPDATE_DRAWER_STATE,\r\n payload: {\r\n error\r\n }\r\n })\r\n dispatch({\r\n type: ACTION_TYPES.UPDATE_APPROVAL_DRAWER_STATE,\r\n payload: {\r\n error\r\n }\r\n })\r\n }\r\n });\r\n\r\n const cargo = (data?.cargo?.docs) || []\r\n let outbound = cargo.filter(cgo => cgo?.transitType === 'OUTBOUND' && !cgo?.groundPickup);\r\n let inboundTransfer = cargo.filter(cgo => (cgo?.transitType === 'INBOUND' || cgo?.transitType === 'TRANSFER') && !cgo?.groundPickup);\r\n let groundPickupCgo = cargo.filter(cgo => cgo?.transitType === 'OUTBOUND' && cgo?.groundPickup);\r\n const tableSettings = globalAppState.getTableSettings('liveCargo');\r\n\r\n let dataSource = [];\r\n\r\n switch (state.activeTab) {\r\n case 'outbound':\r\n dataSource = outbound;\r\n break;\r\n case 'inbound':\r\n dataSource = inboundTransfer;\r\n break;\r\n case 'groundpickup':\r\n dataSource = groundPickupCgo;\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n function getColumns() {\r\n const columns = [\r\n {\r\n ...commonColumns.cgo.columns.assignedFlight,\r\n defaultSortOrder: 'ascend'\r\n },\r\n commonColumns.cgo.columns.name,\r\n !customer && commonColumns.cgo.columns.customer,\r\n ...commonColumns.cgo.except(['name', 'assignedFlight', 'customer', 'employer'])\r\n ].filter(col => col)\r\n return columns as ColumnProps[]\r\n }\r\n\r\n function renderOptionsContent() {\r\n function isChecked(key: string) {\r\n return tableSettings\r\n ?.settings?.hiddenColumns?.includes(key)\r\n ? false : true\r\n }\r\n\r\n let columns = getColumns().map(col => ({ key: String(col.key), title: String(col.title) }))\r\n\r\n return {\r\n cp.domEvent.stopPropagation();\r\n globalAppState.setTableColumnVisibility(\r\n 'liveCargo',\r\n cp.key,\r\n !isChecked(cp.key)\r\n );\r\n }}\r\n >\r\n \r\n {columns.map(col => (\r\n \r\n {(\r\n \r\n )}\r\n {col.title}\r\n \r\n ))}\r\n \r\n \r\n }\r\n\r\n function renderCargoApprovalDrawer() {\r\n return {\r\n dispatch({\r\n type: ACTION_TYPES.UPDATE_APPROVAL_DRAWER_STATE,\r\n payload: {\r\n error: null,\r\n visible: false,\r\n fields: null\r\n }\r\n })\r\n }}\r\n width=\"50rem\"\r\n title={\r\n \r\n Approve {state.approvalDrawer.fields ? state.approvalDrawer.fields.name : \"Cargo\"}\r\n \r\n }>\r\n {state.approvalDrawer.error && }\r\n {\r\n dispatch({\r\n type: ACTION_TYPES.UPDATE_APPROVAL_DRAWER_STATE,\r\n payload: {\r\n error: null,\r\n visible: false,\r\n fields: null\r\n }\r\n })\r\n }}\r\n clearOnSubmit\r\n clearOnClose={!state.approvalDrawer.visible}\r\n onSubmit={(values) => {\r\n dispatch({\r\n type: ACTION_TYPES.UPDATE_APPROVAL_DRAWER_STATE,\r\n payload: {\r\n error: null,\r\n fields: state.approvalDrawer.fields\r\n }\r\n })\r\n var payload = {\r\n _id: state.approvalDrawer.fields._id,\r\n approvedBy: values.approvedBy ? (state.approvalDrawer.fields.approvedBy ? state.approvalDrawer.fields.approvedBy : userinfo.user.attributes.email) : \"\"\r\n }\r\n\r\n setCargoNode({\r\n variables: { payload }\r\n })\r\n }}\r\n />\r\n \r\n }\r\n\r\n function renderCargoCheckinDrawer() {\r\n return {\r\n dispatch({\r\n type: ACTION_TYPES.UPDATE_DRAWER_STATE,\r\n payload: {\r\n error: null,\r\n visible: false\r\n }\r\n })\r\n }}\r\n width=\"50rem\"\r\n title={\r\n \r\n Add Cargo\r\n \r\n }>\r\n {state.drawer.error && }\r\n {\r\n dispatch({\r\n type: ACTION_TYPES.UPDATE_DRAWER_STATE,\r\n payload: {\r\n error: null,\r\n visible: false\r\n }\r\n })\r\n }}\r\n clearOnSubmit\r\n onSubmit={(values) => {\r\n dispatch({\r\n type: ACTION_TYPES.UPDATE_DRAWER_STATE,\r\n payload: {\r\n error: null\r\n }\r\n })\r\n delete values['_id']\r\n values.name = values.name.toUpperCase().trim();\r\n values.attentionTo = values.attentionTo.toUpperCase().trim();\r\n\r\n var payload = {\r\n ...values,\r\n tpID: transporter._id,\r\n transitType: values.transitType,\r\n receivedLocationID: values[\"lastKnownController\"],\r\n checkInType: \"WEB\",\r\n firstCheckInType: \"WEB\",\r\n nodeState: \"CHECKED_IN\",\r\n cargoType: \"CARGO\",\r\n checkedInTime: moment().toISOString(),\r\n scheduledFlightDate: moment().format(\"YYYY-MM-DD\")\r\n }\r\n setCargoNode({\r\n variables: { payload }\r\n })\r\n }}\r\n />\r\n \r\n }\r\n\r\n function renderTabs() {\r\n return (\r\n dispatch({ newState: { activeTab: tab } })}\r\n className=\"mc-tabs-pill\"\r\n >\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n\r\n let columns = getColumns().filter((col: any) => {\r\n return !tableSettings?.settings?.hiddenColumns?.includes(col.key)\r\n });\r\n\r\n const { getNodeText, registerNode } = reactNodeTextGetter();\r\n columns = columns.map((col) => DataExport.Utils.registerAntdColumn(col, registerNode));\r\n\r\n let rightContent = [\r\n ,\r\n ];\r\n\r\n if (![NetworkStatus.setVariables, NetworkStatus.loading].includes(networkStatus)) {\r\n rightContent.unshift(\r\n {`${dataSource.length} ${pluralize('Result', dataSource.length)}`}\r\n );\r\n }\r\n\r\n if (userGroups.includes('flytsuite.live.cargo')) {\r\n rightContent = [\r\n ...rightContent,\r\n ,\r\n \r\n ]\r\n }\r\n\r\n rightContent = [\r\n ...rightContent,\r\n dispatch({ newState: { tableSettingsDropdownVisible: visible } })}\r\n >\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 api.addFlight.setVisible(false)}\r\n width=\"35rem\"\r\n closable\r\n >\r\n {renderContent()}\r\n \r\n}\r\n\r\nexport default Form.create({\r\n mapPropsToFields(props){\r\n return props.uiState.addFlight.formData\r\n },\r\n onFieldsChange:(props, changedFields, allFields) => {\r\n const data = produce(allFields, (draft: any) => {\r\n if(\r\n 'lastKnownController' in changedFields &&\r\n changedFields.lastKnownController?.value !== props.form.getFieldValue('lastKnownController')){\r\n draft.contractID.value = null;\r\n }\r\n });\r\n\r\n props.api.addFlight.formData.set(data);\r\n }})(AddFlightDrawer)","import LiveFlightsPage from \"./live-flights-page\";\r\nexport default LiveFlightsPage;","import {Alert, Button, Checkbox, Divider, Dropdown, Icon, Menu, Spin, Tooltip} from 'antd';\r\nimport {ApolloError, NetworkStatus} from 'apollo-boost';\r\nimport commonColumns from 'common/table/columns';\r\nimport {cleanGraphQLErrorMsg, reactNodeTextGetter} from 'common/util';\r\nimport {GlobalFilterWithWrapper} from 'components/GlobalFilter';\r\nimport {FilterableTable} from 'components/tables/FilterableTable';\r\nimport withFlightDrawer, {HasFlightDrawer} from 'components/WithFlightDrawer';\r\nimport {GlobalAppStateContext} from 'context/global-app-state';\r\nimport {GlobalFilterContext} from 'context/global-filter';\r\nimport {OrgDataContext} from 'context/orgData';\r\nimport pluralize from 'pluralize';\r\nimport React, {useContext} from 'react';\r\nimport {useHistory} from 'react-router-dom';\r\nimport ColorKey from '../ColorKey';\r\nimport LiveCard from '../LiveCard';\r\nimport LiveColoredButton from '../LiveColoredButton';\r\nimport '../style.less';\r\nimport './style.less';\r\nimport DataExport from \"../../../common/data-export\";\r\nimport {ColumnProps} from \"antd/lib/table\";\r\nimport {useLiveFlightsState} from \"./state\";\r\nimport AddFlightDrawer from \"./add-flight-drawer\";\r\nimport useUserGroups from \"../../../hooks/useUserGroups\";\r\n\r\nexport interface LiveFlightsProps extends HasFlightDrawer {\r\n\r\n}\r\n\r\ninterface ReducerState {\r\n error: ApolloError,\r\n tableSettingsDropdownVisible: boolean,\r\n errorClosed: boolean\r\n}\r\n\r\nlet DEFAULT_STATE: ReducerState = {\r\n error: null,\r\n tableSettingsDropdownVisible: false,\r\n errorClosed: false\r\n}\r\n\r\nconst LiveFlightsPage: React.FC = (props) => {\r\n const globalFilter = useContext(GlobalFilterContext);\r\n const globalAppState = useContext(GlobalAppStateContext);\r\n const [ userGroups ] = useUserGroups();\r\n const { customer, transporter } = useContext(OrgDataContext);\r\n const history = useHistory();\r\n\r\n const [ { uiState, queryResult }, api ] = useLiveFlightsState();\r\n\r\n const {\r\n data,\r\n networkStatus, paginating,\r\n pageCount, refetch,\r\n error, paginationError\r\n } = queryResult;\r\n\r\n let flights: any[] = (data?.flights?.docs) || []\r\n if (globalFilter.destination && globalFilter.destination.length){\r\n flights = flights.filter(flight => {\r\n if (flight?.legsArray){\r\n return flight.legsArray.findIndex(leg => globalFilter.destination.map(dest => dest?.key).includes(leg.destinationID)) > -1;\r\n }\r\n return false;\r\n })\r\n }\r\n const tableSettings = globalAppState.getTableSettings('liveFlights');\r\n\r\n function getColumns() {\r\n const columns = [\r\n {\r\n ...commonColumns.flight.columns.designation,\r\n render: (desig, record) => {\r\n const handleClick = () => {\r\n if (customer){\r\n history.push(`/app/flights/${record._id}`)\r\n }\r\n }\r\n let btn = {desig}\r\n\r\n if (record.state){\r\n return {btn}
\r\n }\r\n return btn\r\n }\r\n },\r\n ...commonColumns.flight.some(['departureWeight', 'passengers', 'departure', 'destinations', 'seatPercent', 'weightPercent', 'status']),\r\n {\r\n title: 'Action',\r\n key: 'action',\r\n width: 150,\r\n render: (text, record) => (\r\n \r\n )\r\n\r\n }\r\n ].filter(col => col)\r\n return columns as ColumnProps[]\r\n }\r\n\r\n function renderOptionsContent(){\r\n function isChecked(key: string){\r\n return tableSettings\r\n ?.settings?.hiddenColumns?.includes(key)\r\n ? false : true\r\n }\r\n\r\n let columns = getColumns().map(col => ({ key: String(col.key), title: String(col.title) }))\r\n .filter(col => col.key !== 'action');\r\n\r\n return {\r\n cp.domEvent.stopPropagation();\r\n globalAppState.setTableColumnVisibility(\r\n 'liveFlights',\r\n cp.key,\r\n !isChecked(cp.key)\r\n );\r\n }}\r\n style={{ display: 'flex' }}\r\n >\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n {columns.map(col => (\r\n \r\n {(\r\n \r\n )}\r\n {col.title}\r\n \r\n ))}\r\n \r\n \r\n }\r\n\r\n let columns = getColumns().filter((col: any) => {\r\n if (col.key === 'action') return true;\r\n return !tableSettings?.settings?.hiddenColumns?.includes(col.key)\r\n });\r\n\r\n const { getNodeText, registerNode } = reactNodeTextGetter();\r\n columns = columns.map((col) => DataExport.Utils.registerAntdColumn(col, registerNode));\r\n\r\n let rightContent = [\r\n ,\r\n ];\r\n\r\n if (![NetworkStatus.setVariables, NetworkStatus.loading].includes(networkStatus)){\r\n rightContent.unshift(\r\n {`${flights.length} ${pluralize('Result', flights.length)}`}\r\n );\r\n }\r\n\r\n if (userGroups.includes('flytsuite.live.flight') && customer) {\r\n // Add Flight button will only appear for customer accounts who have the right permission\r\n rightContent = [\r\n ...rightContent,\r\n api.addFlight.setVisible(true)}\r\n >Add Flight,\r\n \r\n ]\r\n }\r\n\r\n rightContent = [\r\n ...rightContent,\r\n api.tableSettingsDropdown.setVisible(visible)}\r\n >\r\n \r\n
\r\n})\r\n\r\nEditableText.displayName = 'EditableText'\r\n\r\nexport default EditableText;","import gql from \"graphql-tag\";\r\n\r\nexport const PAX_QUERY = gql`\r\nquery GetPax(\r\n $filter: PassengersFilterInput\r\n $bookmark: String\r\n $limit: Int\r\n $skip: Int\r\n){\r\n passengers(\r\n filter: $filter\r\n bookmark: $bookmark\r\n limit: $limit\r\n skip: $skip\r\n ) {\r\n bookmark\r\n docs {\r\n _id,\r\n ... on PaxNode {\r\n lastName,\r\n firstName,\r\n personID {\r\n _id\r\n extraBroadState\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n },\r\n tpID {\r\n _id\r\n name\r\n }\r\n paxWeight,\r\n bagWeight,\r\n checkInType,\r\n bagCount,\r\n checkedInTime,\r\n scheduledFlightDate,\r\n destinationID {\r\n _id, name\r\n }\r\n departureID {\r\n _id, name\r\n },\r\n transitType\r\n lastIsnResultWithHeader {\r\n success,\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n quickCheckStatus\r\n errorMessage\r\n reason\r\n }\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n quickCheckStatus,\r\n errorMessage\r\n reason\r\n }\r\n },\r\n authorization {\r\n onWhiteList\r\n noFlyListed\r\n brdRestriction_Isn {\r\n status\r\n }\r\n brdRestriction_SafetyCard {\r\n status\r\n }\r\n brdRestriction_HuetCard {\r\n status\r\n }\r\n brdRestriction_SteelToes {\r\n status\r\n }\r\n brdRestriction_Twic {\r\n status\r\n }\r\n brdRestriction_NonPreferred {\r\n status\r\n }\r\n brdRestriction_Hazmat {\r\n status\r\n }\r\n brdRestriction_NoFlyListed {\r\n status\r\n }\r\n brdRestriction_EbsCard {\r\n status\r\n }\r\n brdRestriction_Illness {\r\n status\r\n }\r\n brdRestriction_Quarantined {\r\n status\r\n }\r\n }\r\n currentCarrierID {\r\n _id\r\n desig\r\n state\r\n }\r\n }\r\n }\r\n }\r\n}`","import { ExecutionResult } from '@apollo/react-common';\r\nimport { useMutation } from '@apollo/react-hooks';\r\nimport { Alert, Button, Checkbox, Divider, Dropdown, Icon, InputNumber, Menu, message, Modal, Spin, Tabs, Tooltip } from 'antd';\r\nimport { gql, NetworkStatus } from 'apollo-boost';\r\nimport commonColumns, { replaceColumn } from 'common/table/columns';\r\nimport {\r\n cleanGraphQLErrorMsg,\r\n isPaxNodeLockedOrDeparted,\r\n reactNodeTextGetter\r\n} from 'common/util';\r\nimport EditableText from 'components/editable-text';\r\nimport { GlobalFilterWithWrapper } from 'components/GlobalFilter';\r\nimport { PassengerEditorWithData } from 'components/PassengerEditor';\r\nimport PassengerTable from 'components/tables/PassengerTable';\r\nimport { GlobalAppStateContext } from 'context/global-app-state';\r\nimport { GlobalFilterContext } from 'context/global-filter';\r\nimport { OrgDataContext } from 'context/orgData';\r\nimport useAutoPaginatedQuery from 'hooks/apollo-extensions/useAutoPaginatedQuery';\r\nimport useUserGroups from 'hooks/useUserGroups';\r\nimport pluralize from 'pluralize';\r\nimport React, { useContext, useReducer } from 'react';\r\nimport { useApolloClient } from 'react-apollo';\r\nimport { useHistory } from 'react-router-dom';\r\nimport ColorKey from '../ColorKey';\r\nimport LiveCard from '../LiveCard';\r\nimport LiveColoredButton from '../LiveColoredButton';\r\nimport '../style.less';\r\nimport { fetchMoreAndGetToken } from '../util';\r\nimport { PAX_QUERY } from './query';\r\nimport './style.less';\r\nimport DataExport from \"../../../common/data-export\";\r\nimport DataExportWrapper from \"../../../component-wrappers/data-export-wrapper/data-export-wrapper\";\r\n\r\nexport interface LivePassengersProps {\r\n activeTab?: ActiveTab,\r\n onActiveTabChange?: (tab: ActiveTab) => void\r\n}\r\n\r\ntype ActiveTab = 'outbound' | 'inbound/transfer'\r\n\r\ninterface ReducerState {\r\n editPaxModal: {\r\n id?: string,\r\n visible: boolean\r\n },\r\n errorClosed?: boolean,\r\n tableSettingsDropdownVisible: boolean\r\n}\r\n\r\nconst INIT_REDUCER_STATE: ReducerState = {\r\n editPaxModal: {\r\n id: null,\r\n visible: false\r\n },\r\n errorClosed: false,\r\n tableSettingsDropdownVisible: false\r\n}\r\n\r\nconst TYPES = {\r\n SET_ACTIVE_TAB: 'SET_ACTIVE_TAB',\r\n OPEN_PAX_EDITOR: 'OPEN_PAX_EDITOR',\r\n CLOSE_PAX_EDITOR: 'CLOSE_PAX_EDITOR',\r\n CLOSE_ERROR_MSG: 'CLOSE_ERROR_MSG',\r\n OPEN_ERROR_MSG: 'OPEN_ERROR_MSG',\r\n SET_SETTING_DD_VIS: 'SET_SETTING_DD_VIS'\r\n}\r\n\r\nconst SET_PASSENGER = gql`\r\nmutation SetPassenger($payload: PaxNodeInput!){\r\n setPaxNode(\r\n payload: $payload\r\n ){\r\n _id\r\n lastName,\r\n firstName,\r\n personID {\r\n _id\r\n extraBroadState\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n },\r\n tpID {\r\n _id\r\n name\r\n }\r\n paxWeight,\r\n bagWeight,\r\n bagCount,\r\n checkedInTime,\r\n scheduledFlightDate,\r\n destinationID {\r\n _id, name\r\n }\r\n departureID {\r\n _id, name\r\n },\r\n transitType\r\n lastIsnResultWithHeader {\r\n success,\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n quickCheckStatus\r\n errorMessage\r\n reason\r\n }\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n quickCheckStatus,\r\n errorMessage\r\n reason\r\n }\r\n },\r\n authorization {\r\n onWhiteList\r\n noFlyListed\r\n brdRestriction_Isn {\r\n status\r\n }\r\n brdRestriction_SafetyCard {\r\n status\r\n }\r\n brdRestriction_HuetCard {\r\n status\r\n }\r\n brdRestriction_SteelToes {\r\n status\r\n }\r\n brdRestriction_Twic {\r\n status\r\n }\r\n brdRestriction_NonPreferred {\r\n status\r\n }\r\n brdRestriction_Hazmat {\r\n status\r\n }\r\n brdRestriction_NoFlyListed {\r\n status\r\n }\r\n brdRestriction_EbsCard {\r\n status\r\n }\r\n brdRestriction_Illness {\r\n status\r\n }\r\n brdRestriction_Quarantined {\r\n status\r\n }\r\n }\r\n currentCarrierID {\r\n _id\r\n desig\r\n state\r\n }\r\n }\r\n}`\r\n\r\nfunction reducer(state: ReducerState, action: { type: string, payload?: any }): ReducerState{\r\n switch (action.type) {\r\n case TYPES.OPEN_PAX_EDITOR:\r\n return { ...state, editPaxModal: { id: action.payload.id, visible: true } }\r\n case TYPES.CLOSE_PAX_EDITOR:\r\n return { ...state, editPaxModal: { id: state.editPaxModal.id, visible: false } }\r\n case TYPES.CLOSE_ERROR_MSG:\r\n return { ...state, errorClosed: true }\r\n case TYPES.OPEN_ERROR_MSG:\r\n return { ...state, errorClosed: false }\r\n case TYPES.SET_SETTING_DD_VIS:\r\n return { ...state, tableSettingsDropdownVisible: action.payload }\r\n default:\r\n break;\r\n }\r\n}\r\n\r\nconst LivePassengers: React.FC = (props) => {\r\n const [ state, dispatch ] = useReducer(reducer, INIT_REDUCER_STATE);\r\n const { customer, transporter } = useContext(OrgDataContext);\r\n const globalFilter = useContext(GlobalFilterContext);\r\n const globalAppState = useContext(GlobalAppStateContext);\r\n const [ userGroups ] = useUserGroups();\r\n const orgData = useContext(OrgDataContext);\r\n const client = useApolloClient();\r\n const history = useHistory();\r\n\r\n let queryVars = {\r\n filter: {\r\n customers: globalFilter.customer && globalFilter.customer.length ? globalFilter.customer.map(({ key }) => key) : customer && [customer._id],\r\n transporters: globalFilter.transporter && globalFilter.transporter.length ? globalFilter.transporter.map(({ key }) => key) : transporter && [transporter._id],\r\n employers: globalFilter.employer && globalFilter.employer.map(({ key }) => key),\r\n departures: globalFilter.departure && globalFilter.departure.map(({ key }) => key),\r\n destinations: globalFilter.destination && globalFilter.destination.map(({ key }) => key),\r\n transitTypes: ['OUTBOUND', 'INBOUND', 'TRANSFER'],\r\n onlyShowLive: true\r\n },\r\n limit: 100\r\n }\r\n\r\n const [ setPassengerMutation ] = useMutation(gql`\r\n mutation SetPaxNode($payload: PaxNodeInput!){\r\n setPaxNode(payload: $payload){\r\n _id\r\n paxWeight\r\n bagWeight\r\n bagCount\r\n }\r\n }\r\n `)\r\n\r\n function updatePaxField(paxObj: any, fieldName: string, value: any): Promise>{\r\n return setPassengerMutation({\r\n variables: {\r\n payload: {\r\n _id: paxObj._id,\r\n paxWeight: paxObj.paxWeight,\r\n bagWeight: paxObj.bagWeight,\r\n bagCount: paxObj.bagCount,\r\n [fieldName]: value,\r\n tpID: orgData.transporterID\r\n }\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setPaxNode: {\r\n __typename: 'PaxNode',\r\n _id: paxObj._id,\r\n paxWeight: paxObj.paxWeight,\r\n bagWeight: paxObj.bagWeight,\r\n bagCount: paxObj.bagCount,\r\n [fieldName]: value\r\n }\r\n }\r\n })\r\n }\r\n\r\n const { data, networkStatus, error, refetch, paginating, pageCount, paginationError, fetchMore } = useAutoPaginatedQuery(PAX_QUERY, {\r\n variables: queryVars,\r\n fetchPolicy: 'cache-and-network',\r\n errorPolicy: 'all',\r\n pollInterval: 20000,\r\n supressDataUpdates: true,\r\n onError: () => dispatch({ type: TYPES.OPEN_ERROR_MSG }),\r\n onPaginationError: () => dispatch({ type: TYPES.OPEN_ERROR_MSG }),\r\n getNextToken: async (token) => await fetchMoreAndGetToken(fetchMore, queryVars, token, 'passengers'),\r\n getTokenFromData: (data) => {\r\n let token = data?.passengers?.bookmark;\r\n if (token === 'nil'){\r\n token = null;\r\n }\r\n return token;\r\n }\r\n })\r\n\r\n const passengers: any[] = (data?.passengers?.docs) || [];\r\n const outbound = passengers.filter(pax => pax?.transitType === 'OUTBOUND');\r\n const inboundTransfer = passengers.filter(pax => pax?.transitType === 'INBOUND' || pax?.transitType === 'TRANSFER');\r\n\r\n let dataSource = [];\r\n\r\n switch (props.activeTab) {\r\n case 'outbound':\r\n dataSource = outbound;\r\n break;\r\n case 'inbound/transfer':\r\n dataSource = inboundTransfer;\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n const tableSettings = globalAppState.getTableSettings('livePassengers');\r\n\r\n function getColumns() {\r\n const activeTab = props.activeTab;\r\n const { customer, employer, transporter } = orgData;\r\n\r\n // Create custom set of columns for display in the table\r\n const columns = [\r\n {\r\n ...commonColumns.pax.columns.assignedFlight,\r\n defaultSortOrder: 'ascend'\r\n },\r\n {\r\n ...commonColumns.pax.columns.name,\r\n render: (text, record) => {\r\n const name = commonColumns.pax.columns.name.render(text, record);\r\n const handleClick = () => dispatch({ type: TYPES.OPEN_PAX_EDITOR, payload: { id: record._id } });\r\n let btn = {name}\r\n if (record.checkedInTime){\r\n return {btn}\r\n }\r\n return btn\r\n }\r\n },\r\n !employer && commonColumns.pax.columns.employer,\r\n !customer && commonColumns.pax.columns.customer,\r\n !customer && !transporter ? commonColumns.pax.columns.transporter : undefined,\r\n ...commonColumns.pax.except(['name', 'assignedFlight', 'transitType', 'isn', 'restrictions', 'customer', 'employer', 'transporter']),\r\n {\r\n ...commonColumns.pax.columns.restrictions,\r\n width: 150\r\n },\r\n\r\n // ISN Column will only display when the Outbound tab is selected.\r\n // Inbound/Transfer passengers do not require an ISN status.\r\n activeTab === 'outbound' && {\r\n ...commonColumns.pax.columns.isn\r\n }\r\n ].filter(col => col)\r\n return columns\r\n }\r\n\r\n const onKeyDown = (e) => {\r\n const specialCharRegex = new RegExp(\"[a-zA-Z]\");\r\n const pressedKey = e.key\r\n if ((pressedKey !== \"Tab\" && pressedKey !== \"Backspace\" && pressedKey !== \"Delete\") && specialCharRegex.test(pressedKey)) {\r\n e.preventDefault();\r\n return false;\r\n }\r\n }\r\n\r\n function renderOptionsContent(){\r\n function isChecked(key: string){\r\n return tableSettings\r\n ?.settings?.hiddenColumns?.includes(key)\r\n ? false : true\r\n }\r\n\r\n let columns = getColumns().map(col => ({ key: String(col.key), title: String(col.title) }))\r\n\r\n return {\r\n globalAppState.setTableColumnVisibility(\r\n 'livePassengers',\r\n cp.key,\r\n !isChecked(cp.key)\r\n );\r\n }}\r\n style={{ display: 'flex' }}\r\n >\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n {columns.map(col => (\r\n \r\n {(\r\n \r\n )}\r\n {col.title}\r\n \r\n ))}\r\n \r\n \r\n }\r\n\r\n function renderTabs(){\r\n return (\r\n props.onActiveTabChange?.(tab)}\r\n className=\"mc-tabs-pill\"\r\n >\r\n \r\n \r\n \r\n )\r\n }\r\n\r\n let columns = getColumns().map((col: any) => {\r\n if (props.activeTab !== \"inbound/transfer\" || !col.editable) {\r\n return col;\r\n }\r\n return {\r\n ...col,\r\n onCell: record => ({\r\n inputProps: {\r\n onKeyDown,\r\n onBlur: e => {\r\n if(!e.target.value){\r\n e.target.value = record[col.dataIndex]\r\n return;\r\n }\r\n if(e.target.value === record[col.dataIndex]){\r\n return;\r\n }\r\n if(e.target.value !== 0 && e.target.value < 90){\r\n e.target.value = record[col.dataIndex]\r\n message.warn(record['lastName'] + \", \" + record[\"firstName\"] + \" weight must be 0 or greater than 90.\")\r\n return;\r\n }\r\n const payload = {\r\n _id: record['_id'],\r\n paxWeight: e.target.value,\r\n tpID: orgData.transporter._id\r\n }\r\n\r\n client.mutate({\r\n mutation: SET_PASSENGER,\r\n variables: {payload},\r\n optimisticResponse:{\r\n __typename: 'Mutation',\r\n setPaxNode: {\r\n __typename: 'PaxNode',\r\n ...record,\r\n paxWeight: e.target.value\r\n }\r\n }\r\n })\r\n .then(() => {\r\n message.success(record['lastName'] + \", \" + record[\"firstName\"] + \" has been successfully saved.\")\r\n })\r\n .catch((err) => {\r\n message.error(\"Error saving \" + record['lastName'] + \", \" + record[\"firstName\"] + \": \" + err)\r\n })\r\n }\r\n },\r\n record,\r\n ...col,\r\n cancelButton: true,\r\n editable: col.editable,\r\n editing: true,\r\n dataIndex: col.dataIndex,\r\n title: col.title\r\n })\r\n };\r\n });\r\n\r\n columns = columns.filter((col) => {\r\n return !tableSettings?.settings?.hiddenColumns?.includes(col.key)\r\n })\r\n\r\n if (props.activeTab === 'inbound/transfer'){\r\n columns = replaceColumn(columns, 'weight', {\r\n render: (value, record) => isPaxNodeLockedOrDeparted(record) ? (\r\n \r\n {value || 0}\r\n \r\n ) : (\r\n }\r\n onValueChange={(value) => {\r\n updatePaxField(record, 'paxWeight', value)\r\n .then(() => message.success(\"Successfully updated passenger weight\"))\r\n .catch((err) => message.error(\"Failed to update passenger weight due to an error: \" + err))\r\n }}\r\n />\r\n )\r\n })\r\n\r\n columns = replaceColumn(columns, 'bagWeight', {\r\n render: (value, record) => isPaxNodeLockedOrDeparted(record) ? (\r\n \r\n {value || 0}\r\n \r\n ) : (\r\n }\r\n onValueChange={(value) => {\r\n updatePaxField(record, 'bagWeight', value)\r\n .then(() => message.success(\"Successfully updated passenger bag weight\"))\r\n .catch((err) => message.error(\"Failed to update passenger bag weight due to an error: \" + err))\r\n }}\r\n />\r\n )\r\n })\r\n\r\n columns = replaceColumn(columns, 'bagCount', {\r\n render: (value, record) => isPaxNodeLockedOrDeparted(record) ? (\r\n \r\n {value || 0}\r\n \r\n ) : (\r\n }\r\n onValueChange={(value) => {\r\n updatePaxField(record, 'bagCount', value)\r\n .then(() => message.success(\"Successfully updated passenger bag count\"))\r\n .catch((err) => message.error(\"Failed to update passenger bag count due to an error: \" + err))\r\n }}\r\n />\r\n )\r\n })\r\n }\r\n\r\n const { getNodeText, registerNode } = reactNodeTextGetter();\r\n columns = columns.map((col) => DataExport.Utils.registerAntdColumn(col, registerNode));\r\n\r\n let rightContent = [\r\n ,\r\n ];\r\n\r\n if (![NetworkStatus.setVariables, NetworkStatus.loading].includes(networkStatus)){\r\n rightContent.unshift(\r\n {`${dataSource.length} ${pluralize('Result', dataSource.length)}`}\r\n );\r\n }\r\n\r\n if (userGroups.includes('flytsuite.live.passenger')) {\r\n rightContent = [\r\n ...rightContent,\r\n ,\r\n \r\n ]\r\n }\r\n\r\n rightContent = [\r\n ...rightContent,\r\n dispatch({ type: TYPES.SET_SETTING_DD_VIS, payload: visible })}\r\n >\r\n \r\n ]}\r\n destroyOnClose\r\n >\r\n {state.editPaxModal.id ? (\r\n dispatch({ type: TYPES.CLOSE_PAX_EDITOR })}\r\n style={{\r\n height: '30rem',\r\n overflow: 'auto'\r\n }}\r\n loadingStyle={{\r\n height: '30rem',\r\n margin: 0,\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n justifyContent: 'center'\r\n }}\r\n />\r\n ) : null}\r\n \r\n \r\n}\r\n\r\n\r\nexport default LivePassengers","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAMAAAC3Ycb+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAwBQTFRF4ebsN0tgbn2NVWZ5srvFoKq20NfeSFpuWmp8RlhsL0RZgY6dprC82+DnuMHLztXcYXGCg5CfzNPb4OXrydDYtr/Jnqm1xMzUpK662N7lvMTOqLK9UGJ1fYqZXm+AfoyaNkpfiZakeIaV0tngTF5xV2h6PVBl4ujtO05jcoGQXGx+r7jCdIOSmaSw1tzjwsrTrLbBwMjRTmBzjpuohZKgLEJXs7zGqrS/UmR3x87XaXiJkZyqLUJYSl1wP1JniJSilKCtQVRooq247O/1m6ayRFdrwcjStL3Hl6KvdoWUZXSGNUpfv8bQkp6rOExhytHZ7fH2mqWyOExgcH+PQlVpk56s0dffbHuMytHahpShhpKhK0BWv8fQa3qLe4mYZXWG4eXsZ3aILEFX7PD14uft6+/0NUle5+zxLkNZNEhd5Onv4+juMUZb6u7zMUVb6e3z5+vxjJmm1dvi6O3yMEVaQ1Zq5erv6/D1NEhe5uvwMkdcM0dd5env6e3yLUFX5urwL0NZMkZc6+/1NEle6e7z6OzyLkJYL0Ra5Onu4ufs5Oju6u/0LkNY6OzxNUlfM0hd6u704+ft5erwNkpgM0dc3+TqjJimy9LaMEVbusLMWGl7193kxs3WZnaH1NrhZHSFanmKP1NnPE9kNktgkJyp3OLo3eLp5uvxusPM3uPpPlFm4ubswsnSmKOw3ePpyM/YMUZclqGurrfCvsbPprC73+Xrc4KSMkZb2t/mtb7Ijpqn3OHo2N3kmqWxaHeIjZmnz9XdrLXA5+zynai0cYCQo6656/D0u8PM3uPqcX+QQFNowcrSxMvUw8vUjZqn2d/mt8DKOU1iPVFllaGu1dvjc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8yNJtUtNz7zFKOUrq9o1NK+OFgTeq86/hL6faO8rXZS9UfHjU0r0uJF+047lDwi5nnu1QtKl5N6bpx1KFiFee8pVPU+j+fofYJjlO6vcTeMmHUOnWKilWu24qsPKd0e4m7OvHOkv4vKtY5jqyqMCNp1RuCwaxzvv6VxNQx7d22esjRS/bq7ak/cdb2W1HRq9z9wN+LBTjY3iNU+3fc5uqftf++e4eOzkFKt8+SmCtWfdgPRcWeLl2kdPtHknpj3F221j7mEH8b6126mkoi/vLYiD4UFZvkjD/joEtXS9rEh3o9PGop2/8veUjp9jc9w6Of9mJ41KK8cH66iJSuCgSkg2mDwqxgGRTD0TNRunghCvBI+WN3hjGpyG9bqGa0S4subgu1glVlmoUcour0TCqGVMEy1d7x2rPIIWpAuZT36q0rWJYRp4zoQ9QIv5g5cP/Nk44lryStgBzaYf23j2/+79eSNfno7dGSFb+WbyHIYxBES6TVEASCAAgCQQAEgSAAgkAQCAJBIAgEgSAAgkAQAEEgCIAgEASnBEEgCASBIACCQBAAQSAIgCAQBEAQCHKV3wkwACwhx4e0+AZhAAAAAElFTkSuQmCC\"","import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport React from 'react';\r\n\r\n\r\nexport interface InTransitListProps {\r\n data: any[]\r\n style?: React.CSSProperties,\r\n onInTransitLocClick?: (id: string, name: string, classType: string) => void,\r\n selectedID?: string\r\n}\r\n\r\n/* ------------------ LOOP OVER LOCATION QUERY --------------------*/\r\nconst InTransitList: React.FC = (props) => {\r\n return <>\r\n
\r\n
\r\n
In Transit\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n {/* ------------------ CREATE CLICK LISTENER FOR EACH ROW ITEM --------------------*/}\r\n {props.data.map(item => (\r\n
props.onInTransitLocClick?.(item.carrierID, item.carrierName, item.classType)}>\r\n \r\n {item.carrierName}\r\n
\r\n {item.expectedCount}\r\n
\r\n
\r\n ))}\r\n
\r\n
\r\n \r\n}\r\n\r\n\r\nexport default InTransitList\r\n\r\n\r\n","import React, { HTMLAttributes } from 'react';\r\n\r\n//---------------------------------------------------\r\n//> THIS IS WHERE WE ADD THE 'OVAL' ALERT HIGHLIGHTS\r\nexport interface QmAlertProps extends HTMLAttributes{\r\n type?: 'none' | 'warning' | 'critical',\r\n children?: React.ReactNode\r\n}\r\n\r\n//---------------------------------------------------\r\nconst QmAlert: React.FC = ({type, children, ...restProps})=> {\r\n let className=\"destinfo\"\r\n if(restProps){\r\n className = className + \" \" + type\r\n }\r\n return {children}\r\n}\r\n\r\nexport default QmAlert","import React from 'react';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport QmAlert from '../qmAlert';\r\nimport { Tooltip } from 'antd';\r\n\r\nexport interface OffshoreLocListProps {\r\n data: any[]\r\n style?: React.CSSProperties\r\n onOffshoreLocClick?: (id: string, name: string, classType: string) => void,\r\n selectedID?: string\r\n}\r\n\r\n\r\nconst OffshoreLocList: React.FC = (props) => {\r\n return (\r\n
\r\n
\r\n
Offshore Location\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n\r\n {/* ------------------ LOOP OVER LOCATION QUERY -------------------- */}\r\n {props.data.map(item => {\r\n\r\n let bedCountAlert;\r\n let expectedAlert;\r\n let departingAlert;\r\n let onboardAlert;\r\n\r\n let bedCountTooltip = \"\";\r\n\r\n /* ---------------------------- */\r\n if (item.expectedCount === 0) {\r\n expectedAlert = 'none'\r\n }\r\n /* ---------------------------- */\r\n if (item.departingCount === 0) {\r\n departingAlert = 'none'\r\n }\r\n /* ---------------------------- */\r\n if (item.onboardCount === 0) {\r\n onboardAlert = 'none'\r\n }\r\n /* ---------------------------- */\r\n if (item.bedCount === 0) {\r\n bedCountAlert = 'critical'\r\n bedCountTooltip = \"No Beds Available\"\r\n } else if (item.bedCount < 5) {\r\n bedCountAlert = 'warning'\r\n bedCountTooltip = \"Few Beds Available\"\r\n }\r\n\r\n /* ------------------------------------------------------ */\r\n /* item list (ACTIVE) for highlighting) */\r\n return
props.onOffshoreLocClick?.(item.locationID, item.locationName, item.classType)}>\r\n \r\n {item.locationName}\r\n
\r\n\r\n {item.onboardCount}\r\n\r\n \r\n {item.bedCount}\r\n \r\n\r\n {item.expectedCount}\r\n {item.departingCount}\r\n
\r\n
\r\n })}\r\n
\r\n
\r\n )\r\n}\r\n\r\n\r\nexport default OffshoreLocList\r\n\r\n\r\n","import { library } from '@fortawesome/fontawesome-svg-core';\r\nimport { faBed, faHelicopter, faLevelDownAlt, faLevelUpAlt, faMapMarkerAlt, faShip, faUsers } from '@fortawesome/free-solid-svg-icons';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { Avatar, Card, Col, Layout, List, Row } from 'antd';\r\nimport config from 'config';\r\nimport { OrgDataContext } from 'context/orgData';\r\nimport escapeStringRegexp from 'escape-string-regexp';\r\nimport gql from 'graphql-tag';\r\n\r\nimport { dateMtimeMtoMoment, dateMtimeMtoZuluStr, dateToZulu, detectInvalidDate } from 'common/util';\r\n\r\nimport defaultAvatarImg from 'img/default-avatar.png';\r\nimport React, { useContext, useState } from 'react';\r\nimport { useQuery } from 'react-apollo';\r\nimport InTransitList from '../inTransitList';\r\nimport OffshoreLocList from '../offshoreLocList';\r\nimport moment from 'moment'\r\nimport './quartermaster.less';\r\nimport { ConsoleLogger } from '@aws-amplify/core';\r\n\r\n\r\nlibrary.add(faMapMarkerAlt, faUsers, faBed, faLevelUpAlt, faLevelDownAlt, faHelicopter, faShip);\r\n\r\nconst { Sider, Header } = Layout;\r\n\r\n\r\n//--------------------------------------------\r\n//> RETURN A LIST OF (POB-NODE) \r\n//> (POBNODE is IMPLIED)\r\n//--------------------------------------------\r\nconst LOCATIONS_QUERY = gql`\r\n query getLocations($customerID:String!){\r\n GetCustomerLocationDocs(customerID:$customerID){\r\n \r\n _id\r\n checkInType\r\n firstName\r\n lastName\r\n checkedIn\r\n createdTs\r\n personID{\r\n _id\r\n }\r\n currentCarrierID{\r\n ... on FlightNode{\r\n _id\r\n desig\r\n legsArray{\r\n destinationID\r\n }\r\n classType\r\n }\r\n ... on BoatNode{\r\n _id\r\n desig\r\n classType\r\n }\r\n }\r\n lastKnownController {\r\n _id\r\n name\r\n getRig{\r\n _id\r\n bedQuartersIds\r\n }\r\n }\r\n }\r\n }\r\n`\r\n\r\n\r\n//--------------------------------------------\r\n//> [ SAVE FOR MULTI CLASS QUERY EXAMPLE ] QUERY getLocations Query\r\n/*const LOCATIONS_QUERY = gql`\r\n query getLocations($customerID:String!){\r\n GetCustomerLocationDocs(customerID:$customerID){\r\n pob {\r\n _id\r\n destinationID {\r\n _id\r\n name\r\n }\r\n }\r\n flight {\r\n _id\r\n desig\r\n }\r\n boat {\r\n _id\r\n vesselID {\r\n _id\r\n name\r\n }\r\n }\r\n }\r\n }\r\n`*/\r\n\r\n\r\n//--------------------------------------------\r\nexport interface QuartermasterMainPageProps {\r\n}\r\n\r\n\r\n//--------------------------------------------\r\n//> [GRAPH QL] Appolo Run Query\r\nconst QuartermasterMainPage: React.FC = (props) => {\r\n\r\n //------------------------------------------------------------\r\n let locationInfoArray = [];\r\n let listOfInTransits = []\r\n\r\n\r\n //----------------------------------------------------\r\n //> (useState) saves 'persists' lsit selection info\r\n const [selectedColumOne, setSelectedColumOne] = useState({\r\n id: null,\r\n name: null,\r\n classType: null\r\n })\r\n\r\n\r\n let [searchValue, setSearchValue] = useState(\"\")\r\n\r\n\r\n const orgData = useContext(OrgDataContext)\r\n\r\n\r\n // console.log(\"[DEBUG] ---------------------- selectedColumOne state = \", selectedColumOne)\r\n\r\n //--------------------------------------------------------------------------\r\n //> This will AUTO-UPDATE the SCREEN LOGIC (every 30000 ms = (30 seconds))\r\n const result = useQuery(LOCATIONS_QUERY, {\r\n variables: {\r\n customerID: orgData.customer._id\r\n },\r\n fetchPolicy: \"cache-and-network\",\r\n pollInterval: 30000\r\n })\r\n\r\n\r\n\r\n //-------------------------------------------------------\r\n // FUNCTION: Handle Location/Transit LIST(s) Selections\r\n //> If Already Selected - then CLEAR ALL SELECTIONS\r\n function handleListSelect(id: string, name: string, classType: string) {\r\n if (id === selectedColumOne.id) {\r\n setSelectedColumOne({ id: null, name: null, classType: null })\r\n } else {\r\n setSelectedColumOne({ id, name, classType })\r\n }\r\n }\r\n\r\n //-------------------------------------------------------\r\n function sortPobs(pobA: any, pobB: any) {\r\n let pobAName = '' + pobA.lastName + pobA.firstName;\r\n let pobBName = '' + pobB.lastName + pobB.firstName;\r\n return pobAName.localeCompare(pobBName)\r\n }\r\n\r\n\r\n\r\n //--------------------------------------------------------------------\r\n //> PREDICATE (FILTERS 'IN TRANSIT' LIST WHEN LOCATION IS SELECTED)\r\n function filterTransitByLocations(carrierInfo: any) {\r\n //---------------------------------------------\r\n if (!selectedColumOne.classType) {\r\n return true;\r\n }\r\n //---------------------------------------------\r\n let hasLegWithLoc = false;\r\n //---------------------------------------------\r\n if (selectedColumOne.classType === \"flytsuite.location\") {\r\n carrierInfo.legsArray.forEach((leg: any) => {\r\n if (leg.destinationID === selectedColumOne.id) {\r\n hasLegWithLoc = true;\r\n }\r\n })\r\n } else {\r\n return true;\r\n }\r\n return hasLegWithLoc;\r\n }\r\n\r\n\r\n\r\n\r\n //--------------------------------------------------------------------\r\n //> PREDICATE (FILTERS 'IN TRANSIT' LIST WHEN LOCATION IS SELECTED)\r\n function filterLocationsByCarrier(locInfo: any) {\r\n //---------------------------------------------\r\n if (!selectedColumOne.classType) {\r\n return true;\r\n }\r\n\r\n //---------------------------------------------\r\n let hasFlightWithLoc = false;\r\n\r\n //---------------------------------------------\r\n if (selectedColumOne.classType !== \"flytsuite.location\") {\r\n let carrierObj = carrierIdToCarrierObj.get(selectedColumOne.id)\r\n //---------------------------------------------\r\n // console.log(\"[DEBUG] carrier.desig = \", carrierObj.desig)\r\n if (carrierObj.classType === \"flytsuite.flightnode\") {\r\n carrierObj.legsArray.forEach((leg: any) => {\r\n\r\n console.log(\"[DEBUG] leg.destinationID = \", leg.destinationID)\r\n console.log(\"[DEBUG] locInfo.locationID = \", locInfo.locationID)\r\n\r\n if (leg.destinationID === locInfo.locationID) {\r\n hasFlightWithLoc = true;\r\n }\r\n })\r\n }\r\n\r\n } else {\r\n return true;\r\n }\r\n return hasFlightWithLoc;\r\n }\r\n\r\n\r\n //-------------------------------------------------------\r\n //> [SARCH BOX] List Filter\r\n function filterInfoBySearchValue(info: any) {\r\n if (!searchValue) {\r\n return true;\r\n }\r\n //-------------------------------------\r\n let regex = new RegExp(escapeStringRegexp('' + searchValue), 'gi');\r\n\r\n //-------------------------------------\r\n if (info.classType !== \"flytsuite.location\") {\r\n // console.log(\"[DEBUG] ---search-- NOT LOCATION \" + info.carrierName)\r\n return regex.test(info.carrierName);\r\n\r\n } else {\r\n // console.log(\"[DEBUG] ---search-- LOCATION \" + info.locationName)\r\n return regex.test(info.locationName);\r\n }\r\n }\r\n\r\n //-------------------------------------------------------\r\n //> PREDICATE for Filtering POB lists upon Click\r\n function filterPobListsBySelection(pob: any) {\r\n //------------------------------------\r\n if (!selectedColumOne.classType) {\r\n return true;\r\n\r\n } else if (selectedColumOne.classType !== \"flytsuite.location\") {\r\n return (selectedColumOne.id === pob.currentCarrierID?._id);\r\n\r\n } else {\r\n if (!selectedColumOne.id || pob.lastKnownController?._id === selectedColumOne.id) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n\r\n function buildPobProfImgUrl(pob: any) {\r\n return config.dfS3WebImages\r\n + \"pax/\"\r\n + pob.personID._id\r\n + \"/\"\r\n + pob.personID._id\r\n + \"_thum.jpeg\"\r\n }\r\n\r\n\r\n //---------------------------------------\r\n //> (OLD) BUILD LIST (FILTER OUT NULL ITEMS (using .filter)\r\n // let locations = result.data?.GetCustomerLocationDocs?.map(item => {\r\n // return { \r\n // locationName: item?.lastKnownController?.name\r\n // }\r\n // })\r\n // .filter(item => item.locationName)\r\n // .sort(( a, b )=> a.locationName.localeCompare(b.locationName)) //> SORTS THE LOCATION NAMES LIST (in alphab. order)\r\n\r\n\r\n\r\n //-------------------------------------------------------------------------------------\r\n //> GENERATE (POPULATE) LOCATION-TO_POBNODE MAP MAP >\r\n let locIdToPobNodeMap = new Map()\r\n let locIdToLocNameMap = new Map()\r\n let locIdToRigDocMap = new Map()\r\n\r\n let carrierIdCountMap = new Map();\r\n let carrierIdToCarrierObj = new Map();\r\n\r\n let allListedPobsExpected = []\r\n let allListedPobsOnboard = []\r\n let allListedPobsDeparting = []\r\n\r\n result.data?.GetCustomerLocationDocs?.forEach(pobNodeItem => {\r\n\r\n if (!pobNodeItem?.lastKnownController?._id) {\r\n //> IF LOCATION IS (UNDEFINED) \r\n return;\r\n\r\n } else if (!(locIdToPobNodeMap.has(pobNodeItem.lastKnownController._id))) {\r\n //> IF LOCATION NOT IN MAP, THEN ADD NEW LOCATION ID ( '=' will SET out LOCid KEY )\r\n locIdToPobNodeMap.set(pobNodeItem?.lastKnownController?._id, new Map([[pobNodeItem?._id, pobNodeItem]]))\r\n\r\n } else {\r\n //> IF LOCATION IS ALREADY IN MAP, THEN ADD NEW LOCATION ID ( '=' will SET out POB-MAP )\r\n locIdToPobNodeMap.get(pobNodeItem?.lastKnownController?._id).set(pobNodeItem?._id, pobNodeItem)\r\n }\r\n\r\n //-----------------------------------------------\r\n //> ADD Pob-LastKnwCont NAME to LocIdToLocNameMap\r\n locIdToLocNameMap.set(pobNodeItem.lastKnownController._id, pobNodeItem.lastKnownController.name)\r\n locIdToRigDocMap.set(pobNodeItem.lastKnownController._id, pobNodeItem.lastKnownController.getRig)\r\n })\r\n\r\n\r\n //------------------------------------------------------------\r\n //> TRANSFORM locIdToPobNodeMap into a KeyValueArray of \r\n locIdToPobNodeMap.forEach((pobNodeMapValue, locIdKey) => {\r\n\r\n //------------------------------------------------\r\n //> GET THE List-Of-POBS for 'this' LOCATION \r\n let listOfPobs = Array.from(pobNodeMapValue, ([name, value]) => value)\r\n\r\n // Sort pob list by lastName, firstName\r\n listOfPobs = listOfPobs.sort(sortPobs)\r\n\r\n //------------------------------------------------\r\n //> ((FILTERED)) List-Of-POBS for 'this' LOCATION \r\n let listOfPobsExpected = listOfPobs.filter(pobNode => pobNode.checkInType === \"EXPECTED\")\r\n let listOfPobsOnboard = listOfPobs.filter(pobNode => pobNode.checkInType === \"ONBOARD\")\r\n let listOfPobsDeparting = listOfPobs.filter(pobNode => pobNode.checkInType === \"DEPARTED\")\r\n\r\n //---------------------------------------------------\r\n //> APPEND to ALL-EXPECTED-POBS-LISTINGs (BY TYPE)\r\n allListedPobsExpected = allListedPobsExpected.concat(listOfPobsExpected)\r\n allListedPobsOnboard = allListedPobsOnboard.concat(listOfPobsOnboard)\r\n allListedPobsDeparting = allListedPobsDeparting.concat(listOfPobsDeparting)\r\n\r\n //----------------------------------------------------\r\n //> GET THE (RIG's) TOTAL-BEDCOUNT - POBS on BOARD\r\n let bedcnt = 0;\r\n\r\n if (locIdToRigDocMap.has(locIdKey)) {\r\n bedcnt = (locIdToRigDocMap.get(locIdKey)?.bedQuartersIds.length || 0) - listOfPobsOnboard.length\r\n if (bedcnt < 0) {\r\n bedcnt = 0;\r\n }\r\n }\r\n\r\n //-----------------------------\r\n locationInfoArray.push({\r\n locationID: locIdKey,\r\n locationName: locIdToLocNameMap.get(locIdKey),\r\n pobNodes: listOfPobs,\r\n bedCount: bedcnt,\r\n expectedCount: listOfPobsExpected.length,\r\n departingCount: listOfPobsDeparting.length,\r\n onboardCount: listOfPobsOnboard.length + listOfPobsDeparting.length,\r\n classType: \"flytsuite.location\"\r\n })\r\n\r\n //-----------------------------\r\n listOfPobsExpected.forEach(pob => {\r\n\r\n if (carrierIdCountMap.has(pob.currentCarrierID._id)) {\r\n carrierIdCountMap.set(pob.currentCarrierID._id, carrierIdCountMap.get(pob.currentCarrierID._id) + 1)\r\n\r\n } else {\r\n // console.log(\"[DEBUG] ------ CRATE NEW KEY FOR COUNT-MAP -------- \")\r\n carrierIdCountMap.set(pob.currentCarrierID._id, 1)\r\n }\r\n\r\n carrierIdToCarrierObj.set(pob.currentCarrierID._id, pob.currentCarrierID)\r\n })\r\n });\r\n\r\n\r\n //-----------------------------------------------------------\r\n //> DO filtering based on Predicate\r\n allListedPobsOnboard = allListedPobsOnboard.filter(filterPobListsBySelection);\r\n allListedPobsExpected = allListedPobsExpected.filter(filterPobListsBySelection);\r\n allListedPobsDeparting = allListedPobsDeparting.filter(filterPobListsBySelection);\r\n\r\n\r\n //-----------------------------------------------------------\r\n Array.from(carrierIdCountMap.entries()).forEach(item => {\r\n listOfInTransits.push({\r\n carrierID: item[0],\r\n expectedCount: item[1],\r\n carrierName: carrierIdToCarrierObj.get(item[0]).desig,\r\n legsArray: carrierIdToCarrierObj.get(item[0]).legsArray,\r\n classType: carrierIdToCarrierObj.get(item[0]).classType,\r\n })\r\n })\r\n\r\n //------------------------------------------------------------\r\n //> FILTER TRANSITS by SLECTED LOCATIONS\r\n listOfInTransits = listOfInTransits\r\n .filter(filterTransitByLocations)\r\n .filter(filterInfoBySearchValue);\r\n\r\n //------------------------------------------------------------\r\n //> SORT LOCATION NAMES ARRAY, THEN FILTER LOCATION by SLECTED TRANSIT\r\n locationInfoArray =\r\n locationInfoArray\r\n .sort((a, b) => a.locationName.localeCompare(b.locationName)) //> SORTS THE LOCATION NAMES LIST (in alphab. order)\r\n .filter(filterLocationsByCarrier)\r\n .filter(filterInfoBySearchValue)\r\n\r\n\r\n //---------------------------------------\r\n //> (OLD) BUILD LIST (FILTER OUT NULL ITEMS (using .filter)\r\n // let locations = result.data?.GetCustomerLocationDocs?.map(item => item?.lastKnownController?.name)\r\n // .filter(locName => locName) // check for locNames that are NULL\r\n // .sort(( a, b )=> a.localeCompare(b)) //> SORTS THE LOCATION NAMES LIST (in alphab. order)\r\n\r\n //---------------------------------------\r\n // // and filter NON-UNIQUE ITEMS (using 'uniq' from lodash)\r\n // if (!locations) {\r\n // locations = []\r\n // } else {\r\n // locations = uniqBy(locations, 'locationName')\r\n // locations.map(item=> {\r\n // return { \r\n // ...item, \r\n // pobCount: result.data?.GetCustomerLocationDocs\r\n // }\r\n // })\r\n // }\r\n\r\n //---------------------------------------\r\n console.log(result) // debug - print to screen results\r\n\r\n //---------------------------------------\r\n return \r\n\r\n {/*========================================== LEFT-MOST PANEL ========================================== */}\r\n \r\n
\r\n setSearchValue(event.target.value)} />\r\n
\r\n < OffshoreLocList\r\n data={locationInfoArray}\r\n style={{ flex: 1 }}\r\n onOffshoreLocClick={handleListSelect}\r\n selectedID={selectedColumOne.id}\r\n\r\n />\r\n < InTransitList\r\n data={listOfInTransits}\r\n style={{ flex: 1 }}\r\n onInTransitLocClick={handleListSelect}\r\n selectedID={selectedColumOne.id}\r\n />\r\n
\r\n\r\n \r\n
\r\n {selectedColumOne.name || \"Displaying All Data\"}\r\n
\r\n\r\n \r\n \r\n\r\n {/*========================================== CENTER PANEL ========================================== */}\r\n \r\n\r\n\r\n {/* ----------------------------- CENTER TOP----------------------------------- */}\r\n \r\n\r\n \r\n\r\n \r\n Onboard Passengers} extra={allListedPobsOnboard.length} size=\"small\" >\r\n\r\n \r\n {allListedPobsOnboard.map(pobItem => {\r\n return \r\n }\r\n avatar={} src={buildPobProfImgUrl(pobItem)} />}\r\n title={{pobItem.lastName + \", \" + pobItem.firstName}}\r\n description=\"Rig Engineer\"\r\n />\r\n \r\n })}\r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n {/*========================================== RIGHT-MOST PANEL ========================================== */}\r\n \r\n\r\n {/* ----------------------------- RIGHT TOP----------------------------------- */}\r\n \r\n\r\n \r\n\r\n \r\n Expected Passengers} extra={allListedPobsExpected.length} size=\"small\" >\r\n \r\n {allListedPobsExpected.map(pobItem => {\r\n return \r\n }\r\n avatar={} src={buildPobProfImgUrl(pobItem)} />}\r\n title={{pobItem.lastName + \", \" + pobItem.firstName}}\r\n description=\"Rig Engineer\"\r\n />\r\n \r\n })}\r\n \r\n \r\n \r\n\r\n {/* ----------------------------- CENTER BOTTOM----------------------------------- */}\r\n \r\n \r\n Departing Passengers} extra={allListedPobsDeparting.length} size=\"small\" >\r\n \r\n {allListedPobsDeparting.map(pobItem => {\r\n return \r\n }\r\n avatar={} src={buildPobProfImgUrl(pobItem)} />}\r\n title={{pobItem.lastName + \", \" + pobItem.firstName}}\r\n description=\"Rig Engineer\"\r\n />\r\n \r\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 QuartermasterMainPage\r\n\r\n\r\n\r\n\r\n//--------------------------------------------\r\n//> [GRAPH QL] Appolo Run Query\r\n/*const QuartermasterMainPage: React.FC = (props) => {\r\n const result = useQuery(LOCATIONS_QUERY, {\r\n variables: {\r\n customerID: \"CUS-15b4b71dbd2c263e2b4082928429132e3f6dedea18bd08e33ec4303611fa19f1\"\r\n }\r\n })\r\n\r\n //---------------------------------------\r\n //> BUILD LIST (FILTER OUT NULL ITEMS (using .filter)\r\n let locations = result.data?.pob?.map(item => item?.destinationID?.name)\r\n .filter(locName => locName)\r\n\r\n //---------------------------------------\r\n // and filter NON-UNIQUE ITEMS (using 'uniq' from lodash)\r\n if(!locations){\r\n locations = []\r\n } else{\r\n locations = uniq(locations)\r\n }\r\n\r\n //---------------------------------------\r\n console.log(result) // debug - print to screen results\r\n\r\n //---------------------------------------\r\n return
\r\n

Welcome to Quartermaster

\r\n

{JSON.stringify(locations)}

\r\n
\r\n}\r\nexport default QuartermasterMainPage*/\r\n\r\n\r\n//--------------------------------------------","import { useRef, useEffect, EffectCallback, DependencyList } from 'react';\r\n\r\n/**\r\n * Extension of the useEffect hook. Runs only when the dependencies change, not on mount.\r\n *\r\n * @param effect Imperative function that can return a cleanup function\r\n * @param deps If present, effect will only activate if the values in the list change.\r\n *\r\n * @version 16.8.0\r\n * @see https://reactjs.org/docs/hooks-reference.html#useeffect\r\n */\r\nfunction useDelayedEffect(effect: EffectCallback, deps?: DependencyList): void{\r\n\r\n const didMount = useRef(false);\r\n\r\n useEffect(() => {\r\n if (didMount.current === false){\r\n didMount.current = true;\r\n return;\r\n }\r\n\r\n return effect();\r\n }, deps);\r\n}\r\n\r\nexport default useDelayedEffect;","import { WrappedFormUtils } from \"antd/lib/form/Form\";\r\n\r\nconst invalidMsg = 'Must have at least Amount and/or PSID filled in.';\r\n\r\nlet nully = [undefined, null, ''];\r\n\r\nexport function getValidateAmountValidator(form: WrappedFormUtils){\r\n return function validateAmount(rule, value, callback) {\r\n if (nully.includes(value) && nully.includes(form.getFieldValue('psid'))){\r\n callback(invalidMsg)\r\n }\r\n else\r\n {\r\n callback();\r\n }\r\n }\r\n}\r\n\r\nexport function getValidatePSIDValidator(form: WrappedFormUtils){\r\n return function validatePSID(rule, value, callback) {\r\n if (nully.includes(value) && nully.includes(form.getFieldValue('amount'))){\r\n callback(invalidMsg)\r\n }\r\n else\r\n {\r\n callback();\r\n }\r\n }\r\n}","import { Button, Input, InputNumber, message } from 'antd';\r\nimport Form, { FormComponentProps } from 'antd/lib/form';\r\nimport { WrappedFormUtils } from 'antd/lib/form/Form';\r\nimport Modal, { ModalProps } from 'antd/lib/modal';\r\nimport { requiredRule } from 'common/form';\r\nimport { cleanGraphQLErrorMsg, dateMtimeMtoMoment } from 'common/util';\r\nimport DateTimePicker from 'components/date-time-picker';\r\nimport AircraftSelect from 'components/form/AircraftSelect';\r\nimport ContractSelect from 'components/form/ContractSelect';\r\nimport LocationSelect2 from 'components/form/select/LocationSelect/LocationSelect2';\r\nimport { OrgDataContext } from 'context/orgData';\r\nimport { validateDateTimePicker } from 'formValidators';\r\nimport gql from 'graphql-tag';\r\nimport useDelayedEffect from 'hooks/useDelayedEffect';\r\nimport moment, { Moment } from 'moment';\r\nimport React, { useContext, useEffect, useState } from 'react';\r\nimport { useMutation } from 'react-apollo';\r\nimport { getValidateAmountValidator, getValidatePSIDValidator } from './form';\r\n\r\nexport interface AddFuelTakenFormFields {\r\n amount: number,\r\n dateTimeTaken: { date: Moment, time: Moment },\r\n flightIdName: string,\r\n contractId: string,\r\n aircraftId: string,\r\n psid: number\r\n}\r\n\r\nexport interface AddFuelTakenFormProps extends FormComponentProps {\r\n date?: moment.Moment,\r\n onCancel?: () => void,\r\n onSubmit?: (values: AddFuelTakenFormFields, form: WrappedFormUtils) => void,\r\n submitting?: boolean,\r\n error?: any\r\n}\r\n\r\nexport interface AddFuelTakenFormSubmitterProps {\r\n children: React.ReactElement>,\r\n onSuccess?: (fuelTakenData: any, form: WrappedFormUtils) => void\r\n}\r\n\r\n// Wraps AddFuelTakenForm component to add submission functionality\r\nconst FuelTakenFormSubmitter: React.FC = (props) => {\r\n\r\n const { transporterID } = useContext(OrgDataContext);\r\n\r\n const MUTATION = gql`\r\n mutation AddFuelTaken($tpID: String!, $fuelTaken: FuelTakenInput!){\r\n UploadFuelTaken(\r\n tpID: $tpID\r\n fuelTaken: $fuelTaken\r\n overwriteExisting: false\r\n ){\r\n locationId\r\n dateTimeTaken\r\n flightIdName\r\n amount\r\n psid\r\n aircraftId\r\n contractId\r\n }\r\n }\r\n `\r\n\r\n const [ submit, { loading } ] = useMutation(MUTATION);\r\n\r\n return React.cloneElement(props.children, {\r\n submitting: loading,\r\n onSubmit: (values, form) => {\r\n let dtt = dateMtimeMtoMoment(values.dateTimeTaken).format('YYYY-MM-DD HH:mm');\r\n submit({\r\n variables: {\r\n tpID: transporterID,\r\n fuelTaken: {\r\n ...values,\r\n dateTimeTaken: dtt\r\n }\r\n }\r\n })\r\n .then(() => {\r\n props.onSuccess?.(values, form);\r\n message.success(\"Successfully added fuel taken record.\");\r\n })\r\n .catch((e) => {\r\n message.error(\"Failed to add fuel taken due to an error: \" + cleanGraphQLErrorMsg(e.message), 5);\r\n })\r\n }\r\n });\r\n}\r\n\r\n// Displays a form for adding a new fuel taken object. Doesn't submit anything on its own,\r\n// must be wrapped by FuelTakenForm.Submitter component.\r\nconst AddFuelTakenForm_Internal: React.FC = (props) => {\r\n\r\n const values = props.form.getFieldsValue();\r\n\r\n useDelayedEffect(() => {\r\n props.form.validateFields();\r\n }, [ values.amount, values.psid ])\r\n\r\n return
{\r\n e.preventDefault();\r\n\r\n props.form.validateFieldsAndScroll((err, values) => {\r\n if (!err){\r\n props.onSubmit?.(values, props.form);\r\n }\r\n })\r\n }}>\r\n
\r\n \r\n {props.form.getFieldDecorator('locationId', { rules: requiredRule() })(\r\n \r\n )}\r\n \r\n \r\n {props.form.getFieldDecorator('amount', { rules: [{ validator: getValidateAmountValidator(props.form) }] })(\r\n \r\n )}\r\n \r\n \r\n {props.form.getFieldDecorator('dateTimeTaken', {\r\n initialValue: { date: props.date || moment(), time: undefined },\r\n rules: [{ required: true, message: 'This field is required', validator: validateDateTimePicker }] \r\n })(\r\n \r\n )}\r\n \r\n \r\n {props.form.getFieldDecorator('flightIdName')(\r\n \r\n )}\r\n \r\n \r\n {props.form.getFieldDecorator('contractId')(\r\n \r\n )}\r\n \r\n \r\n {props.form.getFieldDecorator('aircraftId')(\r\n \r\n )}\r\n \r\n \r\n {props.form.getFieldDecorator('psid', { rules: [{ validator: getValidatePSIDValidator(props.form) }] })(\r\n \r\n )}\r\n \r\n
\r\n
\r\n Add\r\n \r\n
\r\n
\r\n}\r\n\r\nconst AddFuelTakenForm_temp = Form.create()(AddFuelTakenForm_Internal);\r\n\r\ntype AddFuelTakenFormType = { Submitter: React.FC } & typeof AddFuelTakenForm_temp;\r\n\r\nconst AddFuelTakenForm: AddFuelTakenFormType = Object.assign(AddFuelTakenForm_temp, {\r\n Submitter: FuelTakenFormSubmitter\r\n})\r\n\r\nAddFuelTakenForm.displayName = 'Form(AddFuelTakenForm)';\r\nAddFuelTakenForm.Submitter.displayName = 'AddFuelTakenForm.Sumbitter';\r\n\r\nexport default AddFuelTakenForm;","import { ApolloError } from 'apollo-client';\r\nimport { OrgDataContext } from 'context/orgData';\r\nimport gql from 'graphql-tag';\r\nimport moment from 'moment';\r\nimport React, { useContext, useState } from 'react';\r\nimport { MutationHookOptions, MutationResult, OperationVariables, useMutation } from 'react-apollo';\r\n\r\nconst MUTATION = gql`\r\nmutation DeleteFuelTaken($tpID: String!, $fuelTaken: FuelTakenInput!){\r\n DeleteFuelTaken(\r\n tpID: $tpID\r\n fuelTaken: $fuelTaken\r\n ){\r\n locationId\r\n dateTimeTaken\r\n }\r\n }\r\n`\r\n\r\ninterface UseDeleteFuelTakenOptions {\r\n onCompleted?: () => void,\r\n onError?: (err: ApolloError) => void,\r\n additionalMutationOptions?: MutationHookOptions\r\n}\r\n\r\ntype FuelTakenObj = any & { locationId: string, dateTimeTaken: string };\r\n\r\ninterface ItemDeleted {\r\n locationId: string,\r\n dateTimeTaken: string\r\n}\r\n\r\ntype ReturnType = [ (fuelTaken: FuelTakenObj) => void, MutationResult, ItemDeleted ];\r\n\r\nfunction useDeleteFuelTaken(options?: UseDeleteFuelTakenOptions): ReturnType {\r\n\r\n const { transporterID } = useContext(OrgDataContext);\r\n const [ itemDeleted, setItemDeleted ] = useState(null);\r\n \r\n const [ mutate, mutationResult ] = useMutation(MUTATION, {\r\n onCompleted: options?.onCompleted,\r\n onError: options?.onError,\r\n ...options.additionalMutationOptions\r\n });\r\n\r\n function deleteFunc(fuelTaken: FuelTakenObj){\r\n setItemDeleted({\r\n locationId: fuelTaken.locationId,\r\n dateTimeTaken: fuelTaken.dateTimeTaken\r\n })\r\n mutate({\r\n variables: {\r\n tpID: transporterID,\r\n fuelTaken: {\r\n ...fuelTaken,\r\n dateTimeTaken: fuelTaken.dateTimeTaken\r\n }\r\n },\r\n optimisticResponse: 'optimisticResponse' in options.additionalMutationOptions ? options.additionalMutationOptions.optimisticResponse :\r\n {\r\n __typename: 'Mutation',\r\n DeleteFuelTaken: fuelTaken\r\n }\r\n })\r\n }\r\n\r\n return [ deleteFunc, mutationResult, itemDeleted ]\r\n}\r\n\r\nexport default useDeleteFuelTaken","import { ApolloError } from 'apollo-client';\r\nimport { OrgDataContext } from 'context/orgData';\r\nimport gql from 'graphql-tag';\r\nimport moment from 'moment';\r\nimport React, { useContext, useState } from 'react';\r\nimport { MutationHookOptions, MutationResult, OperationVariables, useMutation } from 'react-apollo';\r\n\r\nconst MUTATION = gql`\r\nmutation UpdateFuelTaken($tpID: String!, $fuelTaken: FuelTakenInput!){\r\n UploadFuelTaken(\r\n tpID: $tpID\r\n fuelTaken: $fuelTaken\r\n overwriteExisting: true\r\n ){\r\n locationId\r\n dateTimeTaken\r\n flightIdName\r\n amount\r\n psid\r\n aircraftId\r\n contractId\r\n name\r\n }\r\n }\r\n`\r\n\r\ninterface UseUpdateFuelTakenOptions {\r\n onCompleted?: () => void,\r\n onError?: (err: ApolloError) => void,\r\n additionalMutationOptions?: MutationHookOptions\r\n}\r\n\r\ntype FuelTakenObj = any & { locationId: string, dateTimeTaken: string };\r\n\r\ninterface ItemUpdating {\r\n locationId: string,\r\n dateTimeTaken: string\r\n}\r\n\r\ntype ReturnType = [ (fuelTaken: FuelTakenObj) => void, MutationResult, ItemUpdating ];\r\n\r\nfunction useUpdateFuelTaken(options?: UseUpdateFuelTakenOptions): ReturnType {\r\n\r\n const { transporterID } = useContext(OrgDataContext);\r\n const [ itemUpdating, setItemUpdating ] = useState(null);\r\n \r\n const [ mutate, mutationResult ] = useMutation(MUTATION, {\r\n onCompleted: options?.onCompleted,\r\n onError: options?.onError,\r\n ...options.additionalMutationOptions\r\n });\r\n\r\n function updateFunc(fuelTaken: FuelTakenObj){\r\n setItemUpdating({\r\n locationId: fuelTaken.locationId,\r\n dateTimeTaken: fuelTaken.dateTimeTaken\r\n })\r\n mutate({\r\n variables: {\r\n tpID: transporterID,\r\n fuelTaken: {\r\n ...fuelTaken,\r\n dateTimeTaken: fuelTaken.dateTimeTaken\r\n }\r\n },\r\n optimisticResponse: 'optimisticResponse' in options.additionalMutationOptions ? options.additionalMutationOptions.optimisticResponse :\r\n {\r\n __typename: 'Mutation',\r\n UploadFuelTaken: fuelTaken\r\n }\r\n })\r\n }\r\n\r\n return [ updateFunc, mutationResult, itemUpdating ]\r\n}\r\n\r\nexport default useUpdateFuelTaken","import { Alert, Button, Card, DatePicker, Drawer, Form, Icon, Input, InputNumber, Layout, message, Popconfirm, Tooltip } from 'antd';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\nimport { ColumnProps } from 'antd/lib/table';\r\nimport { NetworkStatus } from 'apollo-client';\r\nimport { castArray, cleanGraphQLErrorMsg, dateMtimeMtoMoment } from 'common/util';\r\nimport CenteredLoadingScreen from 'components/CenteredLoadingScreen';\r\nimport DateTimePicker, { strToDateTimePickerValue } from 'components/date-time-picker';\r\nimport ETable, { ETableTotals } from 'components/enchanced-antd-table';\r\nimport AircraftSelect from 'components/form/AircraftSelect';\r\nimport ContractSelect from 'components/form/ContractSelect';\r\nimport LocationSelect2 from 'components/form/select/LocationSelect/LocationSelect2';\r\nimport NonIdealState from 'components/NonIdealState';\r\nimport { DataExporter, REColumnSet } from 'components/reporting/export';\r\nimport { OrgDataContext } from 'context/orgData';\r\nimport { validateDateTimePicker } from 'formValidators';\r\nimport gql from 'graphql-tag';\r\nimport useDelayedEffect from 'hooks/useDelayedEffect';\r\nimport moment, { Moment } from 'moment-timezone';\r\nimport React, { CSSProperties, useContext, useState } from 'react';\r\nimport { useQuery } from 'react-apollo';\r\nimport { useHistory } from 'react-router-dom';\r\nimport AddFuelTakenForm from './add-fuel-taken-form';\r\nimport useDeleteFuelTaken from './delete-fuel-taken';\r\nimport { getValidateAmountValidator, getValidatePSIDValidator } from './form';\r\nimport './fuel-taken.less';\r\nimport useUpdateFuelTaken from './update-fuel-taken';\r\n\r\nexport interface FuelTakenPageProps {\r\n style?: CSSProperties,\r\n date?: Moment | string,\r\n reportType: 'detail' | 'summary',\r\n tz: string,\r\n onDateChange?: (date: Moment) => void,\r\n onReportTypeChange: (reportType: 'detail' | 'summary') => void,\r\n onTzChange: (tz: string) => void\r\n}\r\n\r\nconst BASE_CLS = 'mc-fw-fuel-taken';\r\n\r\nconst POLL_INTERVAL = 10000;\r\n\r\nconst QUERY = gql`\r\nquery GetFuelTaken($tpID: String!, $startDateTime: String!, $endDateTime: String! $reportType: String!){\r\n GetFuelTaken(tpID: $tpID, startDateTime: $startDateTime, endDateTime: $endDateTime, reportType: $reportType)\r\n}`\r\n\r\nconst FuelTakenPage_Internal: React.FC = (props) => {\r\n\r\n const history = useHistory();\r\n const orgData = useContext(OrgDataContext);\r\n const [ exportOpen, setExportOpen ] = useState(false);\r\n const [ addFuelTakenVisible, setAddFuelTakenVisible ] = useState(false);\r\n\r\n const [ editing, setEditing ] = useState<{ locID: string, datetime: string }>();\r\n\r\n function isRowEditing(data: any){\r\n return data.locationId === editing?.locID && data.dateTimeTaken === editing?.datetime\r\n }\r\n\r\n let date = moment();\r\n\r\n if (moment.isMoment(props.date) && props.date){\r\n date = props.date;\r\n }\r\n else if (typeof props.date === 'string'){\r\n date = moment(props.date);\r\n }\r\n\r\n let queryVars = {\r\n tpID: orgData.transporterID,\r\n startDateTime: moment.utc(date).startOf('day').toISOString(),\r\n endDateTime: moment.utc(date).endOf('day').toISOString(),\r\n reportType: props.reportType\r\n // startDateTime: moment().utcOffset(0).startOf('day').toISOString(),\r\n // endDateTime: moment().utcOffset(0).endOf('day').toISOString()\r\n }\r\n\r\n const { data: queryData, error, networkStatus, refetch, startPolling, stopPolling } = useQuery(QUERY,\r\n {\r\n variables: queryVars,\r\n fetchPolicy: 'cache-and-network',\r\n errorPolicy: 'all',\r\n pollInterval: POLL_INTERVAL\r\n })\r\n\r\n const [ deleteFuelTaken, deleteResult, deletedFuelTaken ] = useDeleteFuelTaken({\r\n onCompleted: () => refetch(),\r\n onError: (e) => message.error(\"Failed to delete due to an error: \" + cleanGraphQLErrorMsg(e.message), 5),\r\n additionalMutationOptions: {\r\n optimisticResponse: undefined,\r\n update: (cache, { data: { DeleteFuelTaken }, }) => {\r\n\r\n let parsedFuelTaken = queryData.GetFuelTaken ? JSON.parse(queryData.GetFuelTaken) : null;\r\n\r\n if (!parsedFuelTaken) return;\r\n\r\n let newFuelTaken = parsedFuelTaken.filter(ft => !(ft.locationId === DeleteFuelTaken?.locationId && ft.dateTimeTaken === DeleteFuelTaken?.dateTimeTaken))\r\n\r\n cache.writeQuery({\r\n query: QUERY,\r\n variables: queryVars,\r\n data: {\r\n ...queryData,\r\n GetFuelTaken: JSON.stringify(newFuelTaken)\r\n }\r\n })\r\n }\r\n }\r\n })\r\n\r\n const [ updateFuelTaken, updateResult, updatedFuelTaken ] = useUpdateFuelTaken({\r\n onCompleted: () =>{ setEditing(undefined); refetch(); },\r\n onError: (e) => message.error(\"Failed to update due to an error: \" + cleanGraphQLErrorMsg(e.message), 5),\r\n additionalMutationOptions: {\r\n optimisticResponse: undefined,\r\n update: (cache, { data: { UploadFuelTaken }, }) => {\r\n\r\n let parsedFuelTaken = queryData.GetFuelTaken ? JSON.parse(queryData.GetFuelTaken) : null;\r\n\r\n if (!parsedFuelTaken) return;\r\n\r\n let newFuelTaken = parsedFuelTaken.map(ft => {\r\n if (ft.locationId === UploadFuelTaken?.locationId && ft.dateTimeTaken === UploadFuelTaken?.dateTimeTaken){\r\n return { ...UploadFuelTaken }\r\n }\r\n return ft;\r\n })\r\n\r\n cache.writeQuery({\r\n query: QUERY,\r\n variables: queryVars,\r\n data: {\r\n ...queryData,\r\n GetFuelTaken: JSON.stringify(newFuelTaken)\r\n }\r\n })\r\n }\r\n }\r\n })\r\n\r\n function handleEditFuelTaken(){\r\n props.form.validateFieldsAndScroll((err, values) => {\r\n if (!err){\r\n let dtt = dateMtimeMtoMoment(values.dateTimeTaken).format('YYYY-MM-DD HH:mm');\r\n updateFuelTaken({\r\n ...values,\r\n locationId: values.locationId?.key,\r\n contractId: values.contractId?.key,\r\n aircraftId: values.aircraftId?.key,\r\n dateTimeTaken: dtt\r\n })\r\n }\r\n })\r\n }\r\n\r\n function isBeingDeleted(record){\r\n if (!deletedFuelTaken || !deleteResult.loading){\r\n return false;\r\n }\r\n return record.locationId === deletedFuelTaken.locationId && record.dateTimeTaken === deletedFuelTaken.dateTimeTaken\r\n }\r\n\r\n function isBeingUpdated(record){\r\n if (!updatedFuelTaken || !updateResult.loading){\r\n return false;\r\n }\r\n return record.locationId === updatedFuelTaken.locationId && record.dateTimeTaken === updatedFuelTaken.dateTimeTaken\r\n }\r\n\r\n function editRow(data: any){\r\n stopPolling();\r\n setEditing({\r\n locID: data.locationId,\r\n datetime: data.dateTimeTaken\r\n })\r\n }\r\n\r\n function cancelEdit(){\r\n startPolling(POLL_INTERVAL);\r\n setEditing(undefined);\r\n }\r\n\r\n let reportType = props.reportType;\r\n\r\n function getColumnSets(data){\r\n const d_columnSets: REColumnSet[] = [{\r\n setName: 'Billing Report',\r\n key: 'billing',\r\n columns: [\r\n {\r\n label: 'Location',\r\n key: 'name'\r\n },\r\n {\r\n label: 'Amount',\r\n key: 'amount'\r\n },\r\n {\r\n label: 'Date/Time Taken (Local Time)',\r\n key: 'dateTimeTaken'\r\n },\r\n {\r\n label: 'Flight ID',\r\n key: 'flightIdName'\r\n },\r\n {\r\n label: 'Contract',\r\n key: 'contractName'\r\n },\r\n {\r\n label: 'AC Tail',\r\n key: 'aircraftName'\r\n },\r\n {\r\n label: 'PSID',\r\n key: 'psid'\r\n }\r\n ]\r\n }];\r\n\r\n const s_columnSets: REColumnSet[] = [{\r\n setName: 'Billing Report',\r\n key: 'billing',\r\n columns: [\r\n {\r\n label: 'Location',\r\n key: 'name'\r\n },\r\n {\r\n label: 'Total Amount',\r\n key: 'totalAmount'\r\n }\r\n ]\r\n }]\r\n\r\n let columnSets = d_columnSets;\r\n\r\n if (reportType === \"summary\"){\r\n columnSets = s_columnSets;\r\n }\r\n\r\n return columnSets;\r\n }\r\n\r\n const reduceDetail = (prev, curr) => {\r\n if (isRowEditing(curr) && typeof props.form.getFieldValue('amount') === 'number'){\r\n return prev + props.form.getFieldValue('amount');\r\n }\r\n return prev + curr.amount;\r\n };\r\n const reduceSummary = (prev, curr) => prev + curr.totalAmount;\r\n\r\n // Validate form when amount or psid field changes\r\n\r\n const values = props.form.getFieldsValue();\r\n\r\n useDelayedEffect(() => {\r\n props.form.validateFields();\r\n }, [ values.amount, values.psid ])\r\n\r\n // -------------------------------------------------\r\n\r\n function renderContent(data){\r\n if (networkStatus === NetworkStatus.loading || networkStatus === NetworkStatus.setVariables){\r\n return \r\n }\r\n\r\n const d_columns: ColumnProps[] = [\r\n {\r\n title: 'Location',\r\n key: 'location',\r\n dataIndex: 'locationName',\r\n render: (name, record) => isRowEditing(record) ? \r\n \r\n {props.form.getFieldDecorator('locationId', {\r\n initialValue: { key: record.locationId, label: name },\r\n rules: [{ required: true, message: 'Location is required' }]\r\n })(\r\n \r\n )}\r\n \r\n : (name || record.name)\r\n },\r\n {\r\n title: 'Amount',\r\n key: 'amount',\r\n dataIndex: 'amount',\r\n render: (amount, record) => isRowEditing(record) ?\r\n \r\n {props.form.getFieldDecorator('amount', { initialValue: amount, rules: [{ validator: getValidateAmountValidator(props.form) }] })(\r\n \r\n )}\r\n \r\n : amount\r\n },\r\n {\r\n title: 'Date/Time Taken (Local Time)',\r\n key: 'dateTimeTaken',\r\n dataIndex: 'dateTimeTaken',\r\n render: (dt, record) => isRowEditing(record) ?\r\n \r\n {props.form.getFieldDecorator('dateTimeTaken', {\r\n initialValue: strToDateTimePickerValue(dt),\r\n rules: [{ required: true, message: 'This field is required', validator: validateDateTimePicker }] \r\n })(\r\n \r\n )}\r\n \r\n : dt ? moment(dt).format('MMM Do, YYYY H:mm') : null\r\n },\r\n {\r\n title: 'Flight ID',\r\n key: 'flightid',\r\n dataIndex: 'flightIdName',\r\n render: (text, record) => isRowEditing(record) ?\r\n \r\n {props.form.getFieldDecorator('flightIdName', { initialValue: text })(\r\n \r\n )}\r\n \r\n : text\r\n },\r\n {\r\n title: 'Contract',\r\n key: 'contract',\r\n dataIndex: 'contractName',\r\n render: (name, record) => isRowEditing(record) ? \r\n \r\n {props.form.getFieldDecorator('contractId', {\r\n initialValue: { key: record.contractId, label: name }\r\n })(\r\n \r\n )}\r\n \r\n : name\r\n },\r\n {\r\n title: 'AC Tail',\r\n key: 'tail',\r\n dataIndex: 'aircraftName',\r\n render: (name, record) => isRowEditing(record) ? \r\n \r\n {props.form.getFieldDecorator('aircraftId', {\r\n initialValue: { key: record.aircraftId, label: name }\r\n })(\r\n \r\n )}\r\n \r\n : name\r\n },\r\n {\r\n title: 'PSID',\r\n key: 'psid',\r\n dataIndex: 'psid',\r\n render: (psid, record) => isRowEditing(record) ?\r\n \r\n {props.form.getFieldDecorator('psid', { initialValue: psid, rules: [{ validator: getValidatePSIDValidator(props.form) }] })(\r\n \r\n )}\r\n \r\n : psid\r\n },\r\n {\r\n title: '',\r\n key: 'edit',\r\n render: (_, record) => {\r\n if (isRowEditing(record)){\r\n return
\r\n cancelEdit()}\r\n >Cancel\r\n handleEditFuelTaken()}\r\n disabled={isBeingUpdated(record)}\r\n >{isBeingUpdated(record) ? : \"Save\"}\r\n
\r\n }\r\n return
\r\n \r\n editRow(record)}\r\n type=\"primary\"\r\n />\r\n \r\n \r\n Are you sure you want to delete this record? THIS CANNOT BE UNDONE!!}\r\n onConfirm={() => deleteFuelTaken({\r\n locationId: record.locationId,\r\n dateTimeTaken: record.dateTimeTaken\r\n })}\r\n placement=\"topLeft\"\r\n >\r\n \r\n \r\n \r\n
\r\n }\r\n }\r\n ]\r\n\r\n const s_columns: ColumnProps[] = [\r\n {\r\n title: 'Location',\r\n key: 'location',\r\n dataIndex: 'name',\r\n width: 40\r\n },\r\n {\r\n title: 'Total Amount',\r\n key: 'totalAmount',\r\n dataIndex: 'totalAmount',\r\n width: 500\r\n }\r\n ]\r\n\r\n const d_totals: ETableTotals = {\r\n label: 'Total Fuel Taken:',\r\n masterLabel: 'Grand Total:',\r\n colNum: 0,\r\n masterSticky: true,\r\n renderTdFromGroup: (data) => {\r\n return [{data.reduce(reduceDetail, 0)}]\r\n },\r\n renderMasterTotalTd: (data) => {\r\n return [{data.reduce(reduceDetail, 0)}]\r\n }\r\n }\r\n\r\n const s_totals: ETableTotals = {\r\n label: 'Grand Total:',\r\n colNum: 0,\r\n sticky: true,\r\n td: [{data.reduce(reduceSummary, 0)}]\r\n }\r\n\r\n let columns = d_columns;\r\n let totals = d_totals;\r\n\r\n if (reportType === 'summary'){\r\n columns = s_columns;\r\n totals = s_totals;\r\n }\r\n \r\n return \r\n }\r\n\r\n let data = queryData?.GetFuelTaken;\r\n\r\n if (typeof data == 'string'){\r\n data = JSON.parse(data);\r\n }\r\n\r\n data = castArray(data);\r\n\r\n let total = 0;\r\n\r\n if (reportType === 'summary'){\r\n total = data.reduce(reduceSummary, 0);\r\n }\r\n else\r\n {\r\n total = data.reduce(reduceDetail, 0);\r\n }\r\n\r\n return \r\n \r\n

Fuel Taken

\r\n \r\n { e.preventDefault(); history.push('/app/flytwatch/fuel-taken') }}\r\n >Daily
\r\n { e.preventDefault(); history.push('/app/flytwatch/fuel-taken/report') }}\r\n >Report\r\n \r\n props?.onDateChange?.(d)}\r\n />\r\n \r\n { e.preventDefault(); props.onReportTypeChange?.('detail') }}\r\n >Detail\r\n { e.preventDefault(); props.onReportTypeChange?.('summary') }}\r\n >Summary\r\n \r\n {networkStatus !== NetworkStatus.loading ?

Grand Total: {total}

: null}\r\n refetch()}\r\n icon={ networkStatus === NetworkStatus.loading || networkStatus == NetworkStatus.refetch || networkStatus == NetworkStatus.poll ? 'loading' : 'reload'}\r\n />\r\n setAddFuelTakenVisible(!addFuelTakenVisible)}\r\n >\r\n Add Fuel Taken\r\n \r\n \r\n \r\n \r\n {error ? : null}\r\n {addFuelTakenVisible ? (\r\n \r\n {\r\n setAddFuelTakenVisible(false);\r\n refetch();\r\n }}\r\n >\r\n setAddFuelTakenVisible(false)}\r\n />\r\n \r\n \r\n ) : null}\r\n {(!data || data.length === 0) && networkStatus === NetworkStatus.loading ? (\r\n \r\n ) : null}\r\n {data && data.length > 0 ? \r\n renderContent(data) :\r\n \r\n }\r\n \r\n setExportOpen(false)}\r\n title={Export Report}\r\n width={600}\r\n bodyStyle={{ height: 'calc(100% - 56px)' }}\r\n >\r\n \r\n \r\n \r\n}\r\n\r\nconst FuelTakenPage = Form.create()(FuelTakenPage_Internal);\r\n\r\nFuelTakenPage.defaultProps = {\r\n reportType: 'detail'\r\n}\r\n\r\nexport default FuelTakenPage;","import FuelTakenPage from './fuel-taken';\r\n\r\nexport default FuelTakenPage;","import { Button, DatePicker, Divider, Form, Radio, Tooltip, Typography } from 'antd';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\nimport { createFormFields, FormField, tailFormItemLayout } from 'common/form';\r\nimport { maxTimeMoment, zeroTimeMoment } from 'common/util';\r\nimport DateTimePicker, { DateTimePickerValue } from 'components/date-time-picker';\r\nimport TimezonePicker from 'components/form/select/timezone-picker';\r\nimport moment from 'moment-timezone';\r\nimport React, { HTMLAttributes } from 'react';\r\n\r\nexport interface FWBRCriteriaFormProps extends FormComponentProps {\r\n formFields?: { [key: string]: any },\r\n onFieldsChange?: (fields: { [key: string]: FormField }, changedFields: { [key: string]: FormField }) => void\r\n}\r\n\r\nexport const fieldLabelMap = {\r\n \"startDateTime\": \"Starting Date\",\r\n \"endDateTime\": \"Ending Date\",\r\n \"tz\": \"Time Zone\",\r\n \"reportType\": \"Report Type\"\r\n}\r\n\r\nconst formItemLayout = {\r\n labelCol: {\r\n xs: { span: 24 },\r\n sm: { span: 8 },\r\n },\r\n wrapperCol: {\r\n xs: { span: 24 },\r\n sm: { span: 16 },\r\n },\r\n};\r\n\r\nexport const GroupAndSortMap = {\r\n contract: \"contract\",\r\n aircraft: \"aircraft\",\r\n // timeOff: \"timeOff\"\r\n}\r\n\r\nexport const ReportTypeMap = {\r\n summary: \"summary\",\r\n detail: \"detail\"\r\n}\r\n\r\nconst dateLabelProps: HTMLAttributes = {\r\n style: { display: 'none' }\r\n}\r\n\r\nconst timeLabelProps: HTMLAttributes = {\r\n style: { width: \"2.2rem\", display: 'inline-block', flex: 1, textAlign: 'right', marginRight: '6px' }\r\n}\r\n\r\nconst dtPickerStyle: React.CSSProperties = {\r\n display: 'flex',\r\n justifyContent: 'center'\r\n}\r\n\r\nconst FWBRCriteriaForm_Internal: React.FC = (props) => {\r\n let { form: { getFieldDecorator, getFieldValue, setFieldsValue } } = props;\r\n\r\n function today(){\r\n setFieldsValue({\r\n startDateTime: {\r\n date: moment(),\r\n time: zeroTimeMoment(moment())\r\n },\r\n endDateTime: {\r\n date: moment(),\r\n time: maxTimeMoment(moment())\r\n }\r\n })\r\n }\r\n\r\n return
\r\n \r\n {getFieldDecorator('startDateTime', {\r\n rules: [ { required: true, message: 'Start date is required' } ],\r\n initialValue: new DateTimePickerValue(moment(), zeroTimeMoment(moment()))\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('endDateTime', {\r\n rules: [ { required: true, message: 'Ending date is required' } ],\r\n initialValue: new DateTimePickerValue(moment(), maxTimeMoment(moment()))\r\n })(\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n NOTE: The time range entered will return results in local time as entered by the operator\r\n
\r\n \r\n {getFieldDecorator('reportType', {\r\n rules: [ { required: true, message: 'Report type is required' } ],\r\n initialValue: ReportTypeMap.summary\r\n })(\r\n \r\n Summary\r\n Detail\r\n \r\n )}\r\n \r\n
\r\n}\r\n\r\nFWBRCriteriaForm_Internal.displayName = \"FWBRCriteriaForm\"\r\n\r\nconst FWBRCriteriaForm = Form.create({\r\n mapPropsToFields(props){\r\n return createFormFields(props.formFields)\r\n },\r\n onFieldsChange(props, changedFields, allFields){\r\n props.onFieldsChange(allFields, changedFields);\r\n }\r\n})(FWBRCriteriaForm_Internal);\r\n\r\nexport default FWBRCriteriaForm","import { Button, Checkbox } from 'antd';\r\nimport { ColumnProps } from 'antd/lib/table';\r\nimport { createFormField } from 'common/form';\r\nimport { castArray, dateMtimeMtoMoment, getReportCriteriaValue, maxTimeMoment, zeroTimeMoment } from 'common/util';\r\nimport { ContextProviderWrapperProps } from 'component-wrappers/wrap-ctx-provider';\r\nimport { DateTimePickerValue } from 'components/date-time-picker';\r\nimport ETable, { ETableTotals } from 'components/enchanced-antd-table';\r\nimport ReportUI from 'components/reporting-2/report-ui';\r\nimport { REColumnSet, ReportExporter } from 'components/reporting/export';\r\nimport moment from 'moment-timezone';\r\nimport React, { CSSProperties } from 'react';\r\nimport { useHistory } from 'react-router-dom';\r\nimport CriteriaForm, { fieldLabelMap } from './criteria-form';\r\n\r\nexport interface FuelTakenReportPageProps extends ContextProviderWrapperProps {\r\n style?: CSSProperties\r\n}\r\n\r\nfunction getReportType(reportData: any){\r\n let criteria = castArray(reportData?.criteria);\r\n\r\n let c_reportType = criteria.find(c => c.key === \"reportType\");\r\n\r\n let parsed = 'detail';\r\n\r\n if (c_reportType?.value){\r\n try{\r\n parsed = JSON.parse(c_reportType.value);\r\n }\r\n catch(e){\r\n console.error(\"Failed to parse report type value!!!:\", e);\r\n }\r\n }\r\n\r\n return parsed;\r\n}\r\n\r\nconst FuelTakenReportPage: React.FC = (props) => {\r\n \r\n const history = useHistory();\r\n \r\n return \r\n

Fuel Taken

\r\n }\r\n contentFlexMode\r\n headerExtra={{\r\n left: \r\n { e.preventDefault(); history.push('/app/flytwatch/fuel-taken') }}\r\n >Daily\r\n { e.preventDefault(); history.push('/app/flytwatch/fuel-taken/report') }}\r\n >Report\r\n \r\n }}\r\n contextProviderProps={{\r\n persistenceName: 'flytwatch.fuel-taken-report.criteria-form',\r\n reportName: 'Fuel Taken Report',\r\n reportType: 'DISPATCH_FUEL_TAKEN_S3',\r\n submitReportHandler: (formValues, submitFn) => {\r\n return submitFn({\r\n name: 'Fuel Taken Report',\r\n criteria: Object.entries(formValues).map(([ key, value ]) => {\r\n let display_value;\r\n if (key === 'startDateTime' || key === 'endDateTime'){\r\n let dt = dateMtimeMtoMoment(value);\r\n value = dt.toISOString();\r\n display_value = dt.format('MMM Do, YYYY H:mm:ss')\r\n }\r\n return {\r\n key,\r\n value,\r\n label: fieldLabelMap[key],\r\n display_value: display_value\r\n }\r\n })\r\n })\r\n },\r\n convertPersistentFormData: (unconverted, updateTs) => {\r\n // moment fields are converted to a string when saved in localstorage.\r\n // We need to convert them back to a moment.\r\n let convertedData = unconverted;\r\n if (convertedData.startDateTime?.value){\r\n convertedData.startDateTime.value = new DateTimePickerValue(\r\n moment(convertedData.startDateTime.value.date),\r\n moment(convertedData.startDateTime.value.time)\r\n )\r\n }\r\n else if (convertedData.startDateTime){\r\n convertedData.startDateTime = createFormField(new DateTimePickerValue(\r\n moment(convertedData.startDateTime.date),\r\n moment(convertedData.startDateTime.time)\r\n ));\r\n }\r\n if (convertedData.endDateTime?.value){\r\n convertedData.endDateTime.value = new DateTimePickerValue(\r\n moment(convertedData.endDateTime.value.date),\r\n moment(convertedData.endDateTime.value.time)\r\n )\r\n }\r\n else if (convertedData.endDateTime){\r\n convertedData.endDateTime = createFormField(new DateTimePickerValue(\r\n moment(convertedData.endDateTime.date),\r\n moment(convertedData.endDateTime.time)\r\n ));\r\n }\r\n \r\n if (moment(updateTs).startOf('day').isBefore(moment().startOf('day'))){\r\n // If it is the next day, reset the start date/time and end date/time to current day.\r\n convertedData.startDateTime = createFormField(new DateTimePickerValue(moment(), zeroTimeMoment(moment())));\r\n convertedData.endDateTime = createFormField(new DateTimePickerValue(moment(), maxTimeMoment(moment())));\r\n }\r\n return convertedData;\r\n }\r\n }}\r\n renderCriteriaForm={(ref, formFields, onFieldsChange) => {\r\n return \r\n }}\r\n renderTable={({ reportDetails }) => {\r\n\r\n let data = castArray(reportDetails?.reportData?.result?.docs);\r\n\r\n let timeZone = 'America/Chicago';\r\n\r\n reportDetails?.reportData?.criteria?.forEach((c) => {\r\n if (c.key == \"tz\"){\r\n try {\r\n timeZone = JSON.parse(c.value);\r\n } catch(err){\r\n console.error('Failed to parse timeZone criteria:', err);\r\n timeZone = c.value;\r\n }\r\n }\r\n })\r\n\r\n const d_columns: ColumnProps[] = [\r\n {\r\n title: 'Location',\r\n key: 'location',\r\n dataIndex: 'name'\r\n },\r\n {\r\n title: 'Amount',\r\n key: 'amount',\r\n dataIndex: 'amount'\r\n },\r\n {\r\n title: 'Date/Time Taken (Local Time)',\r\n key: 'dateTimeTaken',\r\n dataIndex: 'dateTimeTaken',\r\n render: (dt) => dt ? moment(dt).format('MMM Do, YYYY H:mm') : null\r\n },\r\n {\r\n title: 'Flight ID',\r\n key: 'flightid',\r\n dataIndex: 'flightIdName'\r\n },\r\n {\r\n title: 'Contract',\r\n key: 'contract',\r\n dataIndex: 'contractName'\r\n },\r\n {\r\n title: 'AC Tail',\r\n key: 'tail',\r\n dataIndex: 'aircraftName'\r\n },\r\n {\r\n title: 'PSID',\r\n key: 'psid',\r\n dataIndex: 'psid'\r\n }\r\n ]\r\n\r\n const s_columns: ColumnProps[] = [\r\n {\r\n title: 'Location',\r\n key: 'location',\r\n dataIndex: 'name',\r\n width: 40\r\n },\r\n {\r\n title: 'Total Amount',\r\n key: 'totalAmount',\r\n dataIndex: 'totalAmount',\r\n width: 500\r\n }\r\n ]\r\n\r\n const d_totals: ETableTotals = {\r\n label: 'Total Fuel Taken:',\r\n masterLabel: 'Grand Total:',\r\n colNum: 0,\r\n masterSticky: true,\r\n includeTotalOnTop: true,\r\n renderTdFromGroup: (data) => {\r\n return [{data.reduce((prev, curr) => prev + curr.amount, 0)}]\r\n },\r\n renderMasterTotalTd: (data) => {\r\n return [{data.reduce((prev, curr) => prev + curr.amount, 0)}]\r\n }\r\n }\r\n\r\n const s_totals: ETableTotals = {\r\n label: 'Grand Total:',\r\n colNum: 0,\r\n sticky: true,\r\n td: [{data.reduce((prev, curr) => prev + curr.totalAmount, 0)}]\r\n }\r\n\r\n const reportType = getReportType(reportDetails?.reportData);\r\n\r\n let columns = d_columns;\r\n let totals = d_totals;\r\n\r\n if (reportType === 'summary'){\r\n columns = s_columns;\r\n totals = s_totals;\r\n }\r\n \r\n return \r\n }}\r\n setReportExporterProps={(reportData) => {\r\n\r\n let reportType = getReportType(reportData);\r\n let data = castArray(reportData?.result?.docs);\r\n\r\n const d_columnSets: REColumnSet[] = [{\r\n setName: 'Billing Report',\r\n key: 'billing',\r\n columns: [\r\n {\r\n label: 'Location',\r\n key: 'name'\r\n },\r\n {\r\n label: 'Amount',\r\n key: 'amount'\r\n },\r\n {\r\n label: 'Date/Time Taken',\r\n key: 'dateTimeTaken'\r\n },\r\n {\r\n label: 'Flight ID',\r\n key: 'flightIdName'\r\n },\r\n {\r\n label: 'Contract',\r\n key: 'contractName'\r\n },\r\n {\r\n label: 'AC Tail',\r\n key: 'aircraftName'\r\n },\r\n {\r\n label: 'PSID',\r\n key: 'psid'\r\n }\r\n ]\r\n }];\r\n\r\n const s_columnSets: REColumnSet[] = [{\r\n setName: 'Billing Report',\r\n key: 'billing',\r\n columns: [\r\n {\r\n label: 'Location',\r\n key: 'name'\r\n },\r\n {\r\n label: 'Total Amount',\r\n key: 'totalAmount'\r\n }\r\n ]\r\n }]\r\n\r\n let columnSets = d_columnSets;\r\n\r\n if (reportType === \"summary\"){\r\n columnSets = s_columnSets;\r\n }\r\n\r\n let startDate = getReportCriteriaValue(reportData, 'startDateTime');\r\n let endDate = getReportCriteriaValue(reportData, 'endDateTime');\r\n\r\n let startMoment = startDate ? moment(startDate).format('MMMM Do YYYY H:mm') : 'Unknown';\r\n let endMoment = endDate ? moment(endDate).format('MMMM Do YYYY H:mm') : 'Unknown';\r\n\r\n let title = \"Fuel taken report from \" + startMoment + \" to \" + endMoment;\r\n\r\n return {\r\n report_id: reportData?._id,\r\n report_type: \"DISPATCH_FUEL_TAKEN_S3\",\r\n column_sets: columnSets,\r\n data: data,\r\n titleRowText: title,\r\n export_name: title\r\n }\r\n }}\r\n style={props.style}\r\n />\r\n}\r\n\r\nexport default FuelTakenReportPage","import { Modal } from \"antd\";\r\nimport { castArray } from \"common/util\";\r\nimport gql from \"graphql-tag\";\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport { useApolloClient, useQuery } from \"react-apollo\";\r\n\r\ninterface GetAllContractIDsOptions {\r\n customerID?: string\r\n}\r\n\r\nconst CONTRACT_QUERY = gql`\r\nquery ContractQuery(\r\n $filter: ContractsFilterInput\r\n $limit: Int\r\n $bookmark: String\r\n){\r\n contracts(\r\n filter: $filter\r\n limit: $limit\r\n bookmark: $bookmark\r\n ){\r\n bookmark\r\n docs {\r\n _id\r\n ... on Contract {\r\n name\r\n tpID {\r\n _id\r\n name\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n locationID {\r\n _id\r\n name\r\n }\r\n startDate\r\n endDate\r\n active\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst QUERY_GET_USER = gql`\r\nquery GetCognitoUser($username: String!){\r\n AdminCognitoGetUser(Username: $username) {\r\n Username\r\n mappedAttributes {\r\n organization\r\n organizationName\r\n email\r\n }\r\n userSettings {\r\n contracts\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst MUTATION_UPDATE_USER_CONTRACTS = gql`\r\nmutation UpdateUserContracts($username: String!, $email: String!, $contracts: [ID!]){\r\n AdminUpdateUserSettings(cognitoUsername: $username, email: $email, contracts: $contracts, createNew: false){\r\n _id\r\n _rev\r\n contracts\r\n contractDocs {\r\n _id\r\n name\r\n tpID {\r\n _id\r\n name\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n locationID {\r\n _id\r\n name\r\n }\r\n startDate\r\n endDate\r\n active\r\n }\r\n }\r\n}\r\n`\r\n\r\nfunction useGetUser(username: string){\r\n const { data, loading, error } = useQuery(QUERY_GET_USER, {\r\n variables: {\r\n username: username\r\n },\r\n fetchPolicy: 'cache-and-network',\r\n skip: !username\r\n })\r\n\r\n return {\r\n user: data?.AdminCognitoGetUser,\r\n loading: loading,\r\n error: error\r\n }\r\n}\r\n\r\nfunction useApplyAllContractsToUser(username: string){\r\n const apolloClient = useApolloClient();\r\n const [ applying, setApplying ] = useState(false);\r\n const [ error, setError ] = useState(null);\r\n \r\n const cRef = useRef({ cancelled: false });\r\n\r\n function setCancelled(cancelled: boolean){\r\n cRef.current.cancelled = cancelled;\r\n }\r\n\r\n function isCancelled(){ return cRef.current.cancelled }\r\n\r\n const { user } = useGetUser(username);\r\n\r\n const canApply = user && String(user.mappedAttributes?.organization).startsWith('CUS');\r\n\r\n\r\n // Set cancelled state when unmounted\r\n useEffect(() => {\r\n return () => setCancelled(true);\r\n }, [])\r\n\r\n // Get all contract results using pagination\r\n async function getAllContractIDs(options: GetAllContractIDsOptions){\r\n let lastBookmark = undefined;\r\n let currBookmark = null;\r\n\r\n let allContractIDs = [];\r\n\r\n\r\n while(lastBookmark !== currBookmark){\r\n if (isCancelled()) break;\r\n\r\n let result = await apolloClient.query({\r\n query: CONTRACT_QUERY,\r\n fetchPolicy: 'network-only',\r\n variables: {\r\n filter: {\r\n customerID: options?.customerID\r\n },\r\n limit: 100,\r\n bookmark: currBookmark\r\n }\r\n });\r\n \r\n lastBookmark = currBookmark;\r\n currBookmark = result.data?.contracts?.bookmark || null;\r\n\r\n let contractsPage = castArray(result.data?.contracts?.docs);\r\n let contractIds = contractsPage\r\n .map(doc => doc._id)\r\n\r\n // Filter contracts already selected\r\n .filter(id => !(user?.userSettings?.contracts || []).includes(id));\r\n\r\n allContractIDs.push(...contractIds);\r\n }\r\n\r\n \r\n\r\n return allContractIDs;\r\n }\r\n\r\n async function mutateUserContracts(contractIDs: string[]){\r\n await apolloClient.mutate({\r\n mutation: MUTATION_UPDATE_USER_CONTRACTS,\r\n variables: {\r\n username: username,\r\n email: user.mappedAttributes.email,\r\n contracts: contractIDs\r\n },\r\n fetchPolicy: 'no-cache'\r\n })\r\n\r\n return contractIDs;\r\n }\r\n\r\n async function apply(){\r\n if (!canApply){\r\n console.error('Cannot apply all contracts to a non-customer user at this time!');\r\n return false;\r\n }\r\n\r\n setApplying(true);\r\n setCancelled(false);\r\n setError(null);\r\n let contractIDs: string[];\r\n\r\n if (!user){\r\n setError(new Error(\"User object is empty\"))\r\n setApplying(false);\r\n return false;\r\n }\r\n\r\n let mutationResult: any[];\r\n\r\n try{\r\n contractIDs = await getAllContractIDs({\r\n customerID: user.mappedAttributes.organization\r\n });\r\n\r\n if (contractIDs.length === 0){\r\n setApplying(false);\r\n throw Error(`[NO_PREFIX]No unassigned contracts for the customer '${user.mappedAttributes.organizationName}' found.`);\r\n }\r\n\r\n try{\r\n await new Promise((resolve, reject) => {\r\n Modal.confirm({\r\n title: `This will add ${contractIDs.length} contracts to this user. Continue?`,\r\n onOk: () => resolve(true),\r\n onCancel: () => reject()\r\n })\r\n })\r\n }\r\n catch(e){\r\n setApplying(false);\r\n throw new Error(\"Apply all contracts cancelled.\");\r\n }\r\n\r\n if (isCancelled()) {\r\n setApplying(false);\r\n throw new Error(\"Apply all contracts cancelled.\");\r\n }\r\n mutationResult = await mutateUserContracts(contractIDs);\r\n }\r\n catch(err){\r\n setError(err);\r\n let msg = '';\r\n if (err.message.includes('[NO_PREFIX]')){\r\n err.message = err.message.replace('[NO_PREFIX]', '');\r\n msg = err.message;\r\n }\r\n else\r\n {\r\n msg = 'Failed to apply all contracts! ' + err;\r\n }\r\n console.error(msg);\r\n throw new Error(msg);\r\n }\r\n\r\n setApplying(false);\r\n\r\n return mutationResult;\r\n }\r\n \r\n \r\n return {\r\n isApplying: applying,\r\n error,\r\n canApply: canApply,\r\n apply: apply\r\n }\r\n}\r\n\r\nexport default useApplyAllContractsToUser","import { Button, Checkbox, Col, Divider, List, Row, Tooltip, Typography } from 'antd';\r\nimport { castArray } from 'common/util';\r\nimport ContractSelect, { ContractDescription } from 'components/form/ContractSelect';\r\nimport React, { ReactElement, useEffect, useState } from 'react';\r\nimport './style.less';\r\n\r\nexport interface UserContractManagerProps {\r\n username?: string,\r\n loading?: boolean,\r\n contractData?: any[],\r\n onAddContracts?: (contractId: string[]) => Promise,\r\n onRemoveContracts?: (contractIds: string[]) => Promise,\r\n updatingData?: boolean,\r\n isAdding?: boolean,\r\n isRemoving?: boolean\r\n\r\n extraHeaderComponents?: ReactElement[]\r\n}\r\n\r\nconst UserContractManager: React.FC = (props) => {\r\n\r\n const [ selSearchContracts, setSelSearchContracts ] = useState([]);\r\n const [ selListContracts, setSelListContracts ] = useState([]);\r\n const [ adding, setAdding ] = useState(false);\r\n\r\n async function handleContractsAdd() {\r\n if (!selSearchContracts.length) return;\r\n\r\n setAdding(true);\r\n try {\r\n await props.onAddContracts?.(selSearchContracts);\r\n }\r\n catch(err){\r\n setAdding(false);\r\n }\r\n setAdding(false);\r\n setSelSearchContracts([]);\r\n }\r\n\r\n useEffect(() => {\r\n if (!props.contractData && !props.loading && !props.username){\r\n console.warn('UserContractManager must at least have the \\'username\\' prop defined or have the \\'contractData\\' prop set as an array.')\r\n }\r\n }, [props.contractData, props.loading, props.username])\r\n\r\n let contracts = castArray(props.contractData);\r\n let contractIds = contracts.map((ct) => ct?._id);\r\n\r\n function toggleSelectAll(){\r\n if (selListContracts.length > 0){\r\n setSelListContracts([]);\r\n }\r\n else\r\n {\r\n setSelListContracts(contractIds);\r\n }\r\n }\r\n\r\n return (\r\n <>\r\n \r\n \r\n setSelSearchContracts(sc)}\r\n loading={adding}\r\n filterOption={({ _id }) => !contractIds.includes(_id)}\r\n detailedDescriptions\r\n onInputKeyDown={(e) => {\r\n if (e.key === 'Enter'){\r\n handleContractsAdd();\r\n }\r\n }}\r\n disabled={props.isAdding}\r\n disableFilterByOrg\r\n allowClear\r\n />\r\n \r\n \r\n \r\n handleContractsAdd()}\r\n />\r\n \r\n \r\n \r\n \r\n {props.extraHeaderComponents ? props.extraHeaderComponents.map((comp) => {comp}) : null}\r\n
\r\n {selListContracts.length > 0 ? (\r\n props.onRemoveContracts?.(selListContracts)\r\n .then(() => setSelListContracts([]))\r\n }\r\n loading={props.isRemoving}\r\n disabled={props.isAdding}\r\n >Remove Contracts\r\n ) : null}\r\n \r\n \r\n \r\n
\r\n \r\n {\r\n return \r\n {\r\n let sel = e.target.checked;\r\n if (sel){\r\n setSelListContracts([...selListContracts, item._id ]);\r\n }\r\n else\r\n {\r\n setSelListContracts(selListContracts.filter(id => id !== item._id));\r\n }\r\n }}\r\n />\r\n \r\n ]}\r\n >\r\n {item.name === 'Deleted contract' ? (\r\n Deleted contract ({item._id})\r\n ) : (\r\n \r\n )}\r\n \r\n }} />\r\n \r\n )\r\n}\r\n\r\nexport default UserContractManager","import { Button, Checkbox, Col, Collapse, Divider, Form, Input, Row, Select } from \"antd\";\r\nimport { CollapsePanelProps } from 'antd/lib/collapse';\r\nimport { FormComponentProps, FormProps } from \"antd/lib/form\";\r\nimport { formFieldsIsTouched, formItemLayout, tailFormItemLayout } from 'common/form';\r\nimport InputCognitoPhoneNumber from 'components/form/InputCognitoPhoneNumber';\r\nimport CognitoPhoneNumber from 'components/form/InputCognitoPhoneNumber/CognitoPhoneNumber';\r\nimport { validateCognitoPhoneNumber } from 'components/form/InputCognitoPhoneNumber/validator';\r\nimport { entryFormOptions, EntryFormProps, useAutoFocus } from \"components/masterdata-2-0/entryForms\";\r\nimport { UseMasterDataStateReturnNoQueryHookProps } from 'components/masterdata-2-0/hook';\r\nimport SignUpOrganizationSearch from 'components/SignUpOrganizationSearch';\r\nimport React, { forwardRef, LegacyRef, ReactNode, useEffect, useReducer, useRef } from 'react';\r\n/*\r\nexport interface UserEntryFormProps extends EntryFormProps, Pick {\r\n allowCompanyPhoneNumberClear?: boolean\r\n}\r\n*/\r\nexport interface UserEntryFormProps extends EntryFormProps, Pick {\r\n allowCompanyPhoneNumberClear?: boolean,\r\n collapsePanelProps?: { [panelIdx: number]: CollapsePanelProps },\r\n MDState: UseMasterDataStateReturnNoQueryHookProps,\r\n saveUserLoading?: boolean,\r\n collapsePanelChildren?: ReactNode | ReactNode[],\r\n onStateChange?: (state: UserFormReducerState) => void\r\n}\r\n\r\nconst FORM_ITEM_CLASS = 'ant-form-item-less-margin'\r\n/*\r\nconst UserEntryForm: React.FC = forwardRef((props, ref: LegacyRef
) => {\r\n const { autoFocus } = props;\r\n const emailRef = useRef(null);\r\n const { getFieldDecorator } = props.form;\r\n useAutoFocus(autoFocus, emailRef.current);\r\n\r\n return \r\n \r\n {getFieldDecorator('email', {\r\n rules: [\r\n { required: true, message: 'Email is required' }\r\n ]\r\n })()}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('given_name', {\r\n rules: [\r\n { required: true, message: 'Given Name is required' }\r\n ]\r\n })()}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('family_name', {\r\n rules: [\r\n { required: true, message: 'Family Name is required' }\r\n ]\r\n })()}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('organization', {\r\n rules: [\r\n { required: true, message: 'Organization is required' }\r\n ],\r\n \r\n })()}\r\n \r\n \r\n {getFieldDecorator('phone_number', {\r\n rules: [\r\n { validator: validateCognitoPhoneNumber, required: true }\r\n ]\r\n })()}\r\n \r\n \r\n {getFieldDecorator('company_phone_number', {\r\n rules: [\r\n { validator: validateCognitoPhoneNumber }\r\n ]\r\n })()}\r\n \r\n \r\n \r\n \r\n
\r\n})*/\r\n\r\nexport interface UserFormReducerState {\r\n collapseActiveKeys?: string | string[],\r\n useCustomTempPass?: boolean,\r\n pswdVisibility?: boolean\r\n}\r\n\r\nconst INIT_REDUCER_STATE: UserFormReducerState = {\r\n collapseActiveKeys: ['ua', 'ot', 'ug'],\r\n useCustomTempPass: false,\r\n pswdVisibility: false\r\n}\r\n\r\nfunction reducer(state: UserFormReducerState, action): UserFormReducerState {\r\n let keys, idx;\r\n switch (action.type) {\r\n case 'SET_CUSTOM_TEMP_PASS':\r\n keys = state.collapseActiveKeys;\r\n idx = keys.indexOf('pw');\r\n if (idx > -1 && !action.value){\r\n keys.splice(idx, idx + 1);\r\n }\r\n else if (action.value){\r\n keys = [...keys, 'pw']\r\n }\r\n return { ...state, useCustomTempPass: action.value, collapseActiveKeys: keys }\r\n \r\n case 'SET_COLLAPSE_ACTIVE_KEYS':\r\n keys = action.value;\r\n idx = keys.indexOf('pw');\r\n return { ...state, collapseActiveKeys: action.value, useCustomTempPass: idx === -1 ? false : true }\r\n case 'TOGGLE_PSWD_VISIBILITY':\r\n return { ...state, pswdVisibility: !state.pswdVisibility }\r\n default:\r\n break;\r\n }\r\n}\r\n\r\nconst UserEntryForm: React.FC = forwardRef((props, ref: LegacyRef
) => {\r\n const { autoFocus } = props;\r\n const emailRef = useRef(null);\r\n const { getFieldDecorator } = props.form;\r\n useAutoFocus(autoFocus, emailRef.current);\r\n const [ state, dispatch ] = useReducer(reducer, INIT_REDUCER_STATE);\r\n\r\n useEffect(() => {\r\n props.onStateChange?.(state);\r\n // eslint-disable-next-line\r\n }, [state.pswdVisibility, state.collapseActiveKeys, state.useCustomTempPass])\r\n\r\n const { MDState, saveUserLoading } = props;\r\n\r\n function renderFormExtra(){\r\n if (MDState.isNewEntry) return [];\r\n let extra = [];\r\n let formTouched = formFieldsIsTouched(MDState.entryFields, true);\r\n if (formTouched && !saveUserLoading){\r\n extra.push(\r\n <>\r\n {\r\n e.stopPropagation();\r\n MDState.resetEntryFields();\r\n }}\r\n >Reset\r\n \r\n \r\n )\r\n }\r\n extra.push(\r\n {\r\n e.stopPropagation();\r\n }}\r\n >{saveUserLoading ? 'Saving' : 'Save'}\r\n )\r\n return extra;\r\n }\r\n\r\n return \r\n dispatch({type: 'SET_COLLAPSE_ACTIVE_KEYS', value: keys})}\r\n >\r\n \r\n \r\n {getFieldDecorator('email', {\r\n rules: [\r\n { required: true, message: 'Email is required' }\r\n ]\r\n })()}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('given_name', {\r\n rules: [\r\n { required: true, message: 'Given Name is required' }\r\n ]\r\n })()}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('family_name', {\r\n rules: [\r\n { required: true, message: 'Family Name is required' }\r\n ]\r\n })()}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('organization', {\r\n rules: [\r\n { required: true, message: 'Organization is required' }\r\n ]\r\n })()}\r\n \r\n \r\n {getFieldDecorator('phone_number', {\r\n rules: [\r\n { validator: validateCognitoPhoneNumber, required: true }\r\n ],\r\n initialValue: new CognitoPhoneNumber('+1', '')\r\n })()}\r\n \r\n \r\n {getFieldDecorator('company_phone_number', {\r\n rules: [\r\n { validator: validateCognitoPhoneNumber }\r\n ],\r\n initialValue: new CognitoPhoneNumber('+1', '')\r\n })()}\r\n \r\n \r\n \r\n \r\n \r\n {MDState.isNewEntry ? (\r\n \r\n \r\n {getFieldDecorator('preferredDeliveryMediums', {\r\n initialValue: ['EMAIL'],\r\n rules: [\r\n {\r\n required: true, message: 'Please select a delivery medium'\r\n }\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n ) : null}\r\n {MDState.isNewEntry ? (\r\n {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n dispatch({ type: 'SET_CUSTOM_TEMP_PASS', value: !state.useCustomTempPass });\r\n }}>\r\n Use custom temporary password\r\n \r\n }>\r\n \r\n \r\n {getFieldDecorator('tempPassword', {\r\n rules: [{\r\n required: state.useCustomTempPass ? true : false,\r\n message: 'You must type in a password'\r\n }]\r\n })(\r\n \r\n )}\r\n dispatch({type: 'TOGGLE_PSWD_VISIBILITY'})}\r\n />\r\n \r\n \r\n \r\n ) : null}\r\n {props.collapsePanelChildren}\r\n \r\n \r\n})\r\n\r\nexport default Form.create(entryFormOptions())(UserEntryForm)","import { Typography } from 'antd';\r\nimport Select, { SelectProps } from 'antd/lib/select';\r\nimport { NetworkStatus } from 'apollo-boost';\r\nimport { castArray } from 'common/util';\r\nimport gql from 'graphql-tag';\r\nimport React from 'react';\r\nimport { useQuery } from 'react-apollo';\r\n\r\nexport interface UserGroupSelectProps extends SelectProps {\r\n data?: Array,\r\n filterItem?: (item: any) => boolean\r\n}\r\n\r\nexport interface UserGroupSelectPropsWrapper extends UserGroupSelectProps {\r\n \r\n}\r\n\r\nconst QUERY = gql`\r\n query GetUserGroups($limit: Int, $nextToken: String){\r\n AdminCognitoListGroups(limit: $limit, nextToken: $nextToken){\r\n groups {\r\n GroupName\r\n Description\r\n }\r\n nextToken\r\n }\r\n }\r\n`\r\n// TODO: Implement pagination\r\n\r\nconst UserGroupSelectNoQuery: React.FC = (props) => {\r\n const { data, filterItem, ...restProps } = props;\r\n let groups = castArray(data);\r\n\r\n if (filterItem){\r\n groups = groups.filter(filterItem);\r\n }\r\n\r\n return \r\n {groups.map(group => (\r\n \r\n {group.GroupName}\r\n {group.Description}\r\n \r\n ))}\r\n \r\n}\r\n\r\nconst UserGroupSelect: React.FC & {NoQuery?: React.FunctionComponent} = (props) => {\r\n const { data, networkStatus } = useQuery(QUERY, {\r\n fetchPolicy: 'cache-and-network'\r\n });\r\n let groups = castArray(data?.AdminCognitoListGroups?.groups);\r\n return \r\n}\r\n\r\nUserGroupSelect.NoQuery = UserGroupSelectNoQuery;\r\n\r\nexport default UserGroupSelect","import { Button, Col, Collapse, Divider, Dropdown, Icon, List, Menu, message, Popconfirm, Row, Spin, Tooltip, Typography } from 'antd';\r\nimport { ApolloError, NetworkStatus } from 'apollo-boost';\r\nimport { DataProxy } from 'apollo-cache/lib/types/DataProxy';\r\nimport { getLabelInValueKey } from 'common/form';\r\nimport { castArray } from 'common/util';\r\nimport CognitoPhoneNumber from 'components/form/InputCognitoPhoneNumber/CognitoPhoneNumber';\r\nimport MDDetails, { MDDetailsProps } from 'components/masterdata-2-0/details';\r\nimport { UseMasterDataStateReturnNoQueryHookProps } from 'components/masterdata-2-0/hook';\r\nimport { MDStateToDetailsProps } from 'components/masterdata-2-0/util';\r\nimport gql from 'graphql-tag';\r\nimport useApplyAllContractsToUser from 'hooks/useApplyAllContractsToUser';\r\nimport React, { useReducer, useRef } from 'react';\r\nimport { useApolloClient, useMutation, useQuery } from 'react-apollo';\r\nimport UserContractManager from './userContractManager';\r\nimport UserEntryForm, { UserFormReducerState } from './userForm';\r\nimport UserGroupSelect from './userGroupSelect';\r\n\r\nconst QUERY_USER_DETAILS = gql`\r\nquery UserDetails($username: String!, $groupsLimit: Int, $groupsNextToken: String, $listGroupsLimit: Int, $listGroupsNextToken: String){\r\n AdminCognitoListUserGroups(username: $username, limit: $groupsLimit, nextToken: $groupsNextToken){\r\n groups {\r\n GroupName\r\n Description\r\n }\r\n nextToken\r\n }\r\n AdminCognitoListGroups(limit: $listGroupsLimit, nextToken: $listGroupsNextToken){\r\n groups {\r\n GroupName\r\n Description\r\n }\r\n nextToken\r\n }\r\n AdminCognitoGetUser(Username: $username) {\r\n Username\r\n approvalStatus\r\n mappedAttributes {\r\n email\r\n organization\r\n organizationName\r\n }\r\n userSettings {\r\n _id\r\n _rev\r\n contracts\r\n contractDocs {\r\n _id\r\n name\r\n tpID {\r\n _id\r\n name\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n locationID {\r\n _id\r\n name\r\n }\r\n startDate\r\n endDate\r\n active\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst MUTATION_UPDATE_USER_GROUPS = gql`\r\nmutation UpdateUserGroups($username: String!, $addGroups: [String!], $removeGroups: [String!]){\r\n AdminCognitoUpdateUserGroups(username: $username, addGroups: $addGroups, removeGroups: $removeGroups)\r\n}\r\n`\r\n\r\nconst MUTATION_APPROVE_USER = gql`\r\nmutation ApproveUser($username: String!){\r\n AdminCognitoApproveUser(Username: $username)\r\n}\r\n`\r\n\r\nconst MUTATION_REVOKE_APPROVAL = gql`\r\nmutation RevokeApproval($username: String!){\r\n AdminCognitoRevokeApproval(Username: $username)\r\n}\r\n`\r\n\r\nconst MUTATION_DENY_USER = gql`\r\nmutation DenyUser($username: String!){\r\n AdminCognitoDenyUser(Username: $username)\r\n}\r\n`\r\n\r\nconst MUTATION_UPDATE_USER_CONTRACTS = gql`\r\nmutation UpdateUserContracts($username: String!, $email: String!, $contracts: [ID!]){\r\n AdminUpdateUserSettings(cognitoUsername: $username, email: $email, contracts: $contracts, createNew: false){\r\n _id\r\n _rev\r\n contracts\r\n contractDocs {\r\n _id\r\n name\r\n tpID {\r\n _id\r\n name\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n locationID {\r\n _id\r\n name\r\n }\r\n startDate\r\n endDate\r\n active\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst contractFragment = gql`\r\n fragment contract on Contract {\r\n _id\r\n name\r\n active\r\n tpID {\r\n _id\r\n name\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n locationID {\r\n _id\r\n name\r\n }\r\n startDate\r\n endDate\r\n }\r\n`\r\n\r\nexport interface UserMDDetailsProps extends MDDetailsProps {\r\n selectedUser?: any,\r\n MDState: UseMasterDataStateReturnNoQueryHookProps,\r\n onDisableUser?: () => void,\r\n disableUserLoading?: boolean,\r\n deleteUserLoading?: boolean,\r\n saveUserLoading?: boolean,\r\n onDeleteUser?: () => void,\r\n onUserGroupsChange?: (cache: DataProxy, userGroups: Array) => void\r\n}\r\n\r\ninterface ReducerState {\r\n nextToken?: string,\r\n groupSelectValues?: Array,\r\n useCustomTempPass?: boolean,\r\n collapseActiveKeys?: string[],\r\n pswdVisibility?: boolean,\r\n\r\n /** Current state of the form. Cannot be modified by parent. */\r\n formState?: UserFormReducerState,\r\n userSaveError?: ApolloError\r\n}\r\n\r\nconst INITIAL_STATE: ReducerState = {\r\n nextToken: null,\r\n groupSelectValues: [],\r\n useCustomTempPass: false,\r\n collapseActiveKeys: ['2', '3'],\r\n pswdVisibility: false,\r\n formState: null,\r\n userSaveError: null\r\n}\r\n\r\nconst REDUCER_TYPES = {\r\n NextToken: 'NEXT_TOKEN',\r\n ClearToken: 'CLEAR_TOKEN',\r\n SetGroupSelect: 'SET_GROUP_SELECT',\r\n SetFormState: 'SET_FORM_STATE'\r\n}\r\n\r\nfunction reducer(state: ReducerState, action): ReducerState{\r\n switch(action.type){\r\n case REDUCER_TYPES.NextToken:\r\n return {...state, nextToken: action.value }\r\n case REDUCER_TYPES.ClearToken:\r\n return { ...state, nextToken: undefined }\r\n case REDUCER_TYPES.SetGroupSelect:\r\n return { ...state, groupSelectValues: action.value }\r\n case REDUCER_TYPES.SetFormState:\r\n return { ...state, formState: { ...state?.formState, ...action.value } }\r\n default:\r\n return state\r\n }\r\n}\r\n\r\nconst UserMDDetails: React.FC = (props) => {\r\n const formRef = useRef(null);\r\n\r\n const [state, dispatch] = useReducer(reducer, INITIAL_STATE);\r\n const client = useApolloClient();\r\n \r\n const { selectedUser, MDState, disableUserLoading, deleteUserLoading, saveUserLoading, extra=[] } = props;\r\n\r\n console.log(selectedUser?.mappedAttributes?.email, selectedUser);\r\n\r\n let queryVars = {\r\n username: selectedUser?.Username,\r\n groupsNextToken: state.nextToken\r\n }\r\n\r\n const { apply, canApply, isApplying } = useApplyAllContractsToUser(selectedUser?.Username);\r\n\r\n const { data, refetch, networkStatus } = useQuery(QUERY_USER_DETAILS, {\r\n variables: queryVars,\r\n fetchPolicy: 'cache-and-network',\r\n notifyOnNetworkStatusChange: true,\r\n skip: !selectedUser,\r\n onError: () => message.error('Failed to load user details. Check console for details.')\r\n });\r\n\r\n console.log(data?.AdminCognitoGetUser)\r\n console.log('end query')\r\n\r\n const [ approveUser, { loading: approveUserLoading } ] = useMutation(MUTATION_APPROVE_USER, {\r\n onError: () => message.error('Failed to approve user. Check console for details.'),\r\n onCompleted: () => message.success('User approved successfully')\r\n })\r\n\r\n const [ revokeApproval, { loading: revokeApprovalLoading } ] = useMutation(MUTATION_REVOKE_APPROVAL, {\r\n onError: () => message.error('Failed to unapprove user. Check console for details.'),\r\n onCompleted: () => message.success('User unapproved successfully')\r\n })\r\n\r\n const [ denyUser, { loading: denyUserLoading } ] = useMutation(MUTATION_DENY_USER, {\r\n onError: () => message.error('Failed to deny user. Check console for details.'),\r\n onCompleted: () => message.success('User denied successfully')\r\n })\r\n\r\n const [ updateUserGroupsMut, { loading: updateUserGroupsLoading } ] = useMutation(MUTATION_UPDATE_USER_GROUPS, {\r\n onError: () => message.error('Failed to update user groups. Check console for details.'),\r\n onCompleted: () => message.success('User groups updated successfully')\r\n });\r\n\r\n const [ addUserContractsMut, { loading: isAddingContracts } ] = useMutation(MUTATION_UPDATE_USER_CONTRACTS, {\r\n onError: () => message.error('Failed to add user contracts. Check console for details.'),\r\n onCompleted: () => message.success('User contracts added successfully')\r\n });\r\n\r\n const [ removeUserContractsMut, { loading: isRemovingContracts } ] = useMutation(MUTATION_UPDATE_USER_CONTRACTS, {\r\n onError: () => message.error('Failed to update user contracts. Check console for details.'),\r\n onCompleted: () => message.success('User contracts updated successfully')\r\n });\r\n\r\n let user = data?.AdminCognitoGetUser;\r\n \r\n const groups = castArray(data?.AdminCognitoListUserGroups?.groups);\r\n const contractDocs = castArray(user?.userSettings.contractDocs);\r\n const contractIds = castArray(user?.userSettings.contracts)\r\n // Remove contract IDs that aren't in contractDocs. If a contractID is not in contractDocs is must've been deleted.\r\n .filter((id) => contractDocs.find(doc => doc._id === id) ? true : false)\r\n\r\n function reload(){\r\n dispatch({ type: 'CLEAR_TOKEN' })\r\n refetch();\r\n }\r\n\r\n function handleFormSubmit(){\r\n formRef.current.validateFieldsAndScroll()\r\n .then(values => {\r\n let mappedAttrs: any = {}\r\n if (selectedUser){\r\n mappedAttrs = {...selectedUser.mappedAttributes};\r\n mappedAttrs['custom:organization'] = mappedAttrs.organization;\r\n mappedAttrs['custom:company_phone_number'] = mappedAttrs.company_phone_number;\r\n delete mappedAttrs.organization;\r\n delete mappedAttrs.company_phone_number;\r\n }\r\n\r\n let attrs = {\r\n email: values.email,\r\n family_name: values.family_name,\r\n given_name: values.given_name,\r\n phone_number: CognitoPhoneNumber.clean(values.phone_number && values.phone_number.countryCode && values.phone_number.number ? '+' + values.phone_number.countryCode + values.phone_number.number : undefined),\r\n organization: getLabelInValueKey(values.organization),\r\n company_phone_number: CognitoPhoneNumber.clean(values.company_phone_number && values.company_phone_number.countryCode && values.company_phone_number.number ? '+' + values.company_phone_number.countryCode + values.company_phone_number.number : undefined),\r\n email_verified: 'true',\r\n phone_number_verified: 'true'\r\n }\r\n let localAttrs = {\r\n ...selectedUser?.mappedAttributes,\r\n ...attrs,\r\n __typename: 'DFCognitoUserMappedAtrributes',\r\n organizationName: values.organization?.label\r\n }\r\n\r\n attrs['custom:organization'] = attrs.organization;\r\n attrs['custom:company_phone_number'] = attrs.company_phone_number;\r\n attrs['custom:org_id'] = '1'\r\n delete attrs.organization\r\n delete attrs.company_phone_number\r\n\r\n let deletedAttrs = [];\r\n Object.entries(attrs).forEach(([k, v]) => {\r\n if (k in mappedAttrs){\r\n\r\n // Add field to deletedAttrs\r\n if (mappedAttrs[k] && !v){\r\n deletedAttrs.push(k);\r\n delete attrs[k];\r\n }\r\n\r\n // If the value did not change, do not add the entry to the attrs object\r\n else if (mappedAttrs[k] === v){\r\n delete attrs[k];\r\n }\r\n }\r\n })\r\n MDState.save({\r\n attrs,\r\n localAttrs,\r\n deletedAttrs,\r\n tempPassword: MDState.isNewEntry && state.formState?.useCustomTempPass ? values.tempPassword : undefined,\r\n desiredDeliveryMediums: MDState.isNewEntry ? values.preferredDeliveryMediums : undefined\r\n }, () => localAttrs)\r\n .then(() => {\r\n\r\n let newMappedAttrs = {\r\n ...localAttrs,\r\n organization: getLabelInValueKey(values.organization),\r\n organizationName: values.organization.label\r\n }\r\n\r\n client.writeQuery({\r\n query: QUERY_USER_DETAILS,\r\n variables: queryVars,\r\n data: {\r\n ...data,\r\n AdminCognitoGetUser: {\r\n ...data.AdminCognitoGetUser,\r\n mappedAttributes: newMappedAttrs\r\n }\r\n }\r\n })\r\n });\r\n })\r\n }\r\n\r\n function renderActions(){\r\n let overlay = \r\n props.onDeleteUser?.()}>Delete Account\r\n \r\n return \r\n \r\n \r\n }\r\n\r\n function addGroups(groups: Array){\r\n updateUserGroupsMut({\r\n variables: {\r\n username: selectedUser?.Username,\r\n addGroups: groups\r\n },\r\n update: (cache) => {\r\n let newGroups = [\r\n ...castArray(data?.AdminCognitoListUserGroups?.groups),\r\n ...groups.map((group) => ({\r\n __typename: 'CognitoUserGroup',\r\n GroupName: group,\r\n Description: castArray(data?.AdminCognitoListGroups?.groups)\r\n .find(g => g.GroupName === group)?.Description\r\n }))\r\n .sort((a, b) => String(a.GroupName).localeCompare(b.GroupName))\r\n ]\r\n cache.writeQuery({\r\n query: QUERY_USER_DETAILS,\r\n variables: {\r\n username: selectedUser?.Username,\r\n groupsNextToken: state.nextToken\r\n },\r\n data: {\r\n ...data,\r\n AdminCognitoListUserGroups: {\r\n ...data.AdminCognitoListUserGroups,\r\n groups: newGroups\r\n }\r\n }\r\n })\r\n props.onUserGroupsChange?.(cache, newGroups);\r\n }\r\n })\r\n .then(() => dispatch({ type: 'SET_GROUP_SELECT', value: [] }))\r\n }\r\n\r\n function removeGroups(rGroups: string[]){\r\n updateUserGroupsMut({\r\n variables: {\r\n username: selectedUser?.Username,\r\n removeGroups: rGroups\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n AdminCognitoUpdateUserGroups: JSON.stringify({\r\n removed: rGroups.map(group => {\r\n return {\r\n GroupName: group,\r\n ok: true\r\n }\r\n })\r\n })\r\n },\r\n update: (cache) => {\r\n let newGroups = groups.filter((g) => rGroups.findIndex(rg => g.GroupName === rg) < 0);\r\n cache.writeQuery({\r\n query: QUERY_USER_DETAILS,\r\n variables: {\r\n username: selectedUser?.Username,\r\n groupsNextToken: state.nextToken\r\n },\r\n data: {\r\n ...data,\r\n AdminCognitoListUserGroups: {\r\n ...data.AdminCognitoListUserGroups,\r\n groups: newGroups\r\n }\r\n }\r\n });\r\n props.onUserGroupsChange?.(cache, newGroups);\r\n }\r\n })\r\n }\r\n\r\n function addUserContractsMutQueryCache(ids: string[]){\r\n let newContractDocs = ids.map((id) => client.readFragment({\r\n fragment: contractFragment,\r\n id: 'Contract:' + id\r\n }))\r\n\r\n let uniqueCDocs = new Map();\r\n\r\n const setCon = con => uniqueCDocs.set(con._id, con);\r\n\r\n contractDocs.forEach(setCon)\r\n newContractDocs.forEach(setCon);\r\n\r\n let mergedIDs = Array.from(uniqueCDocs.keys());\r\n let mergedDocs = Array.from(uniqueCDocs.values());\r\n\r\n let newUserSettings = {\r\n ...data.AdminCognitoGetUser.userSettings,\r\n contracts: mergedIDs,\r\n contractDocs: mergedDocs\r\n }\r\n return addUserContractsMut({\r\n variables: {\r\n username: selectedUser?.Username,\r\n email: selectedUser?.mappedAttributes.email,\r\n contracts: newUserSettings.contracts\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n AdminUpdateUserSettings: {\r\n __typename: 'WebUserSettings',\r\n ...newUserSettings\r\n }\r\n },\r\n update: (cache) => {\r\n let queryData = {\r\n ...data,\r\n AdminCognitoGetUser: {\r\n ...data.AdminCognitoGetUser,\r\n userSettings: newUserSettings\r\n }\r\n }\r\n cache.writeQuery({\r\n query: QUERY_USER_DETAILS,\r\n variables: queryVars,\r\n data: queryData\r\n })\r\n }\r\n })\r\n }\r\n\r\n function handleRemoveContracts(ctIds){\r\n let newUserSettings = {\r\n ...data.AdminCognitoGetUser.userSettings,\r\n contracts: contractIds.filter((idStr) => !ctIds.includes(idStr)),\r\n contractDocs: contractDocs.filter(doc => !ctIds.includes(doc._id))\r\n }\r\n return removeUserContractsMut({\r\n variables: {\r\n username: selectedUser?.Username,\r\n email: selectedUser?.mappedAttributes.email,\r\n contracts: newUserSettings.contracts\r\n },\r\n update: (cache) => {\r\n let queryData = {\r\n ...data,\r\n AdminCognitoGetUser: {\r\n ...data.AdminCognitoGetUser,\r\n userSettings: newUserSettings\r\n }\r\n }\r\n cache.writeQuery({\r\n query: QUERY_USER_DETAILS,\r\n variables: queryVars,\r\n data: queryData\r\n })\r\n }\r\n })\r\n }\r\n\r\n return {\r\n if (entryValues){\r\n let name = `${entryValues.given_name} ${entryValues.family_name}`;\r\n if (selectedUser?.Enabled){\r\n\r\n let approvalStatus = null;\r\n\r\n if (user?.approvalStatus === 'awaiting_approval'){\r\n approvalStatus = AWAITING APPROVAL\r\n }\r\n else if (user?.approvalStatus === 'denied'){\r\n approvalStatus = DENIED\r\n }\r\n else if (user?.approvalStatus === 'approved'){\r\n approvalStatus = APPROVED\r\n }\r\n\r\n return {name} {approvalStatus}\r\n }\r\n else\r\n {\r\n return \r\n {name}\r\n \r\n }\r\n }\r\n return null\r\n })}\r\n saving={saveUserLoading}\r\n contentWidth=\"45rem\"\r\n hideSaveBtn={MDState.isNewEntry ? false : true}\r\n saveBtnText={MDState.isNewEntry ? 'Create User' : undefined}\r\n onSave={() => {\r\n handleFormSubmit();\r\n }}\r\n showReset={MDState.isNewEntry ? true : false}\r\n extra={[\r\n ...(props.MDState.isNewEntry ? [] : [\r\n props.onDisableUser?.()}\r\n >\r\n \r\n ,\r\n renderActions(),\r\n reload()}\r\n />,\r\n ]),\r\n ...extra\r\n ]}\r\n >\r\n } tip=\"Deleting user...\">\r\n MDState.setEntryFields(fields)}\r\n autoFocus\r\n onSubmit={(e) => {\r\n e.preventDefault();\r\n handleFormSubmit();\r\n }}\r\n onStateChange={(state) => dispatch({ type: REDUCER_TYPES.SetFormState, value: state })}\r\n saveUserLoading={saveUserLoading}\r\n collapsePanelChildren={\r\n [\r\n !props.MDState.isNewEntry ? (\r\n \r\n \r\n

Add all of {data?.AdminCognitoGetUser?.mappedAttributes?.organizationName}'s contracts to this user.

\r\n

NOTE: If you changed this user's organization above, click the save button first before clicking this!

\r\n }\r\n >\r\n apply()\r\n .then(addUserContractsMutQueryCache)\r\n .catch((err) => {\r\n if (String(err.message).includes('No unassigned contracts')){\r\n message.info(err.message);\r\n }\r\n else if (!String(err.message).includes('cancelled')){\r\n message.error(\"Failed to apply all customer contracts due to an error: \" + err.message);\r\n }\r\n })}\r\n >\r\n Add Cust. Contracts\r\n \r\n \r\n ]}\r\n onAddContracts={addUserContractsMutQueryCache}\r\n onRemoveContracts={handleRemoveContracts}\r\n />\r\n
\r\n ) : null,\r\n !props.MDState.isNewEntry ? (\r\n \r\n \r\n {\r\n e.stopPropagation();\r\n denyUser({\r\n variables: { username: selectedUser.Username }\r\n })\r\n .then(() => refetch())\r\n }}\r\n onCancel={e => e.stopPropagation()}\r\n >\r\n e.stopPropagation()}\r\n type=\"danger\"\r\n disabled={denyUserLoading || approveUserLoading}\r\n size=\"small\"\r\n style={{ marginRight: '6px' }}\r\n >Deny User\r\n \r\n \r\n \r\n {\r\n e.stopPropagation();\r\n approveUser({\r\n variables: { username: selectedUser.Username }\r\n })\r\n .then(() => refetch())\r\n }}\r\n disabled={approveUserLoading || denyUserLoading}\r\n size=\"small\"\r\n >Approve User\r\n \r\n : (\r\n \r\n {\r\n e.stopPropagation();\r\n revokeApproval({\r\n variables: { username: selectedUser.Username }\r\n })\r\n .then(() => refetch())\r\n }}\r\n disabled={revokeApprovalLoading}\r\n size=\"small\"\r\n >{user?.approvalStatus === 'approved' ? 'Disapprove User' : 'Un-deny user'}\r\n \r\n )\r\n ]}>\r\n \r\n \r\n {\r\n // Filter out user groups that are already applied\r\n return groups.findIndex((g) => g.GroupName === item.GroupName) === -1\r\n }}\r\n onChange={(value) => dispatch({ type: 'SET_GROUP_SELECT', value })}\r\n value={state.groupSelectValues}\r\n style={{ width: '100%' }}\r\n />\r\n \r\n \r\n \r\n }\r\n banner\r\n />\r\n )\r\n }\r\n if (filtersApplied && !paginating) {\r\n render.push(\r\n {`${filteredUsers.length} results found.`}{restQueryResult.wasStopped ? <> : null}}\r\n banner\r\n />\r\n )\r\n }\r\n if (error || paginationError) {\r\n render.push(\r\n \r\n )\r\n }\r\n render.push(renderTable())\r\n return render;\r\n }\r\n\r\n function toggleAscending() {\r\n setSortAscending(!sortAscending);\r\n }\r\n\r\n function renderExtra() {\r\n const filterLabel = Filter:\r\n const refetchBtn = \r\n \r\n ,\r\n \r\n \r\n ]\r\n }\r\n\r\n // Disable user mutation\r\n const [disableUser, { loading: disableUserLoading }] = useMutation(MUTATION_DISABLE_USER, {\r\n variables: {\r\n enableUser: !selectedUser?.Enabled,\r\n username: selectedUser?.Username\r\n },\r\n onError: () => message.error(\"Failed to disable/enable user. Check console for details.\"),\r\n update: (cache, { data: { AdminCognitoDisableUser: disabled } }) => {\r\n cache.writeQuery({\r\n query: QUERY_USERS,\r\n data: {\r\n AdminCognitoListUsers: {\r\n ...data.AdminCognitoListUsers,\r\n users: data.AdminCognitoListUsers.users.map(user => {\r\n if (user.Username === selectedUser?.Username) {\r\n return {\r\n ...user,\r\n Enabled: !disabled\r\n }\r\n }\r\n return user;\r\n })\r\n }\r\n }\r\n })\r\n setSelectedUser({\r\n ...selectedUser,\r\n Enabled: !disabled\r\n })\r\n }\r\n });\r\n\r\n function confirmDeleteAccount() {\r\n Modal.confirm({\r\n title: 'Are you sure you want to delete this user account?',\r\n content: 'THIS ACTION CANNOT BE REVERSED!',\r\n okText: 'Delete',\r\n okType: 'danger',\r\n onOk: () => {\r\n setUserToBeDeleted(selectedUser);\r\n }\r\n })\r\n }\r\n\r\n function handleUserGroupChange(cache: DataProxy, userGroups: Array) {\r\n cache.writeQuery({\r\n query: QUERY_USERS,\r\n data: {\r\n AdminCognitoListUsers: {\r\n ...data.AdminCognitoListUsers,\r\n users: data.AdminCognitoListUsers.users.map(user => {\r\n if (user.Username === selectedUser?.Username) {\r\n\r\n let newUser = { ...user };\r\n user.groups = userGroups;\r\n\r\n return newUser;\r\n }\r\n return user;\r\n })\r\n }\r\n }\r\n })\r\n }\r\n\r\n return \r\n }\r\n detailsElement={\r\n confirmDeleteAccount()}\r\n onDisableUser={() => disableUser()}\r\n disableUserLoading={disableUserLoading}\r\n deleteUserLoading={deleteUserLoading}\r\n saveUserLoading={userSaveLoading}\r\n onUserGroupsChange={handleUserGroupChange}\r\n />\r\n }\r\n tableElement={renderBody()}\r\n />\r\n\r\n}\r\n\r\nexport default AdminUserPage;","import { Button, DatePicker, Form, Radio, Tooltip, Typography } from 'antd';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\nimport { createFormFields, FormField, tailFormItemLayout } from 'common/form';\r\nimport { maxTimeMoment, zeroTimeMoment } from 'common/util';\r\nimport DateTimePicker from 'components/date-time-picker';\r\nimport TimezonePicker from 'components/form/select/timezone-picker';\r\nimport moment from 'moment-timezone';\r\nimport React, { HTMLAttributes } from 'react';\r\n\r\nexport interface FWBRCriteriaFormProps extends FormComponentProps {\r\n formFields?: { [key: string]: any },\r\n onFieldsChange?: (fields: { [key: string]: FormField }, changedFields: { [key: string]: FormField }) => void\r\n}\r\n\r\nexport const fieldLabelMap = {\r\n \"startDate\": \"Starting Date\",\r\n \"endDate\": \"Ending Date\",\r\n \"tz\": \"Time Zone\",\r\n \"reportType\": \"Report Type\"\r\n}\r\n\r\nconst formItemLayout = {\r\n labelCol: {\r\n xs: { span: 24 },\r\n sm: { span: 8 },\r\n },\r\n wrapperCol: {\r\n xs: { span: 24 },\r\n sm: { span: 16 },\r\n },\r\n};\r\n\r\nexport const GroupAndSortMap = {\r\n contract: \"contract\",\r\n aircraft: \"aircraft\",\r\n // timeOff: \"timeOff\"\r\n}\r\n\r\nexport const ReportTypeMap = {\r\n summary: \"summary\",\r\n detail: \"detail\"\r\n}\r\n\r\nconst FWBRCriteriaForm_Internal: React.FC = (props) => {\r\n let { form: { getFieldDecorator, getFieldValue, setFieldsValue } } = props;\r\n\r\n function thisweek(){\r\n setFieldsValue({\r\n startDate: moment().subtract(1, 'week'),\r\n endDate: moment()\r\n })\r\n }\r\n\r\n return
\r\n \r\n {getFieldDecorator('startDate', {\r\n rules: [ { required: true, message: 'Start date is required' } ],\r\n initialValue: moment().subtract(1, 'week')\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('endDate', {\r\n rules: [ { required: true, message: 'End date is required' } ],\r\n initialValue: moment()\r\n })(\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n}\r\n\r\nFWBRCriteriaForm_Internal.displayName = \"FWBRCriteriaForm\"\r\n\r\nconst FWBRCriteriaForm = Form.create({\r\n mapPropsToFields(props){\r\n return createFormFields(props.formFields)\r\n },\r\n onFieldsChange(props, changedFields, allFields){\r\n props.onFieldsChange(allFields, changedFields);\r\n }\r\n})(FWBRCriteriaForm_Internal);\r\n\r\nexport default FWBRCriteriaForm","import { Typography } from 'antd';\r\nimport { ColumnProps } from 'antd/lib/table';\r\nimport { createFormField } from 'common/form';\r\nimport { castArray, getReportCriteriaValue, maxTimeMoment, zeroTimeMoment } from 'common/util';\r\nimport { ContextProviderWrapperProps } from 'component-wrappers/wrap-ctx-provider';\r\nimport ETable, { ETableTotals } from 'components/enchanced-antd-table';\r\nimport ReportUI from 'components/reporting-2/report-ui';\r\nimport { REColumnSet, ReportExporter } from 'components/reporting/export';\r\nimport moment from 'moment-timezone';\r\nimport React, { CSSProperties } from 'react';\r\nimport CriteriaForm, { fieldLabelMap } from './criteria-form';\r\n\r\nexport interface FWChangesByConsoleReportPageProps extends ContextProviderWrapperProps {\r\n style?: CSSProperties\r\n}\r\n\r\nconst FWChangesByConsoleReportPage: React.FC = (props) => {\r\n return {\r\n let options;\r\n try {\r\n options = {\r\n name: 'Changes By Console',\r\n criteria: Object.entries(formValues).map(([ key, value ]) => {\r\n let display_value;\r\n if (key === 'startDate'){\r\n value = moment(value).startOf('day').toISOString(false);\r\n }\r\n if (key === 'endDate'){\r\n value = moment(value).endOf('day').toISOString(false);\r\n }\r\n if (key === 'startDate' || key === 'endDate'){\r\n display_value = moment(value).format('MMM Do, YYYY');\r\n }\r\n return {\r\n key,\r\n value,\r\n label: fieldLabelMap[key],\r\n display_value: display_value\r\n }\r\n })\r\n }\r\n }\r\n catch(err){\r\n console.error(err);\r\n return undefined\r\n }\r\n return submitFn(options);\r\n },\r\n convertPersistentFormData: (unconverted) => {\r\n let convertedData = unconverted;\r\n convertedData.startDate = moment(convertedData.startDate?.value);\r\n convertedData.endDate = moment(convertedData.endDate?.value);\r\n return convertedData;\r\n }\r\n }}\r\n renderCriteriaForm={(ref, formFields, onFieldsChange) => {\r\n return \r\n }}\r\n renderTable={({ reportDetails }) => {\r\n\r\n let data = castArray(reportDetails?.reportData?.result?.docs);\r\n\r\n const columns: ColumnProps[] = [\r\n {\r\n title: 'Console',\r\n key: 'console',\r\n dataIndex: 'console',\r\n render: (console) => console ? console : Unknown\r\n },\r\n {\r\n title: 'Platform',\r\n key: 'platform',\r\n dataIndex: 'isWeb',\r\n render: (isWeb) => isWeb ? 'WEB' : 'LOCAL CONSOLE'\r\n },\r\n {\r\n title: 'Flights created',\r\n key: 'flightsCreatedCt',\r\n dataIndex: 'numCreated'\r\n },\r\n {\r\n title: 'Last Modified Flights',\r\n key: 'flightsModifiedCt',\r\n dataIndex: 'numModified'\r\n }\r\n ]\r\n \r\n return \r\n }}\r\n setReportExporterProps={(reportData) => {\r\n\r\n let data = castArray(reportData?.result?.docs);\r\n\r\n const columnSets: REColumnSet[] = [{\r\n setName: 'Billing Report',\r\n key: 'billing',\r\n columns: [\r\n {\r\n label: 'Location',\r\n key: 'name'\r\n },\r\n {\r\n label: 'Amount',\r\n key: 'amount'\r\n },\r\n {\r\n label: 'Date/Time Taken (Local Time)',\r\n key: 'dateTimeTaken'\r\n },\r\n {\r\n label: 'AC Tail',\r\n key: 'aircraftName'\r\n },\r\n {\r\n label: 'AC Model',\r\n key: 'aircraftModel'\r\n }\r\n ]\r\n }];\r\n\r\n let startDate = getReportCriteriaValue(reportData, 'startDateTime');\r\n let endDate = getReportCriteriaValue(reportData, 'endDateTime');\r\n\r\n let startMoment = startDate ? moment(startDate).format('MMMM Do YYYY H:mm') : 'Unknown';\r\n let endMoment = endDate ? moment(endDate).format('MMMM Do YYYY H:mm') : 'Unknown';\r\n\r\n let title = \"Changes by console report from \" + startMoment + \" to \" + endMoment;\r\n\r\n return {\r\n report_id: reportData?._id,\r\n report_type: \"DISPATCH_CHANGES_BY_CONSOLE\",\r\n column_sets: columnSets,\r\n data: data,\r\n titleRowText: title,\r\n export_name: title\r\n }\r\n }}\r\n style={props.style}\r\n />\r\n}\r\n\r\nexport default FWChangesByConsoleReportPage","import { Button, DatePicker, Form, Tooltip } from 'antd';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\nimport { createFormFields, FormField, tailFormItemLayout } from 'common/form';\r\nimport { OrganizationSelect } from 'components/form/select/OrganizationSelect';\r\nimport TimezonePicker from 'components/form/select/timezone-picker';\r\nimport moment from 'moment-timezone';\r\nimport React from 'react';\r\n\r\nexport interface FWBRCriteriaFormProps extends FormComponentProps {\r\n formFields?: { [key: string]: any },\r\n onFieldsChange?: (fields: { [key: string]: FormField }, changedFields: { [key: string]: FormField }) => void\r\n}\r\n\r\nexport const fieldLabelMap = {\r\n \"startDate\": \"Starting Date\",\r\n \"endDate\": \"Ending Date\",\r\n \"tz\": \"Time Zone\",\r\n \"aircraftID\": \"Aircraft\",\r\n \"pilotID\": \"Pilot\",\r\n \"departingID\": \"Departing\",\r\n \"destinationID\": \"Destination\",\r\n \"contractID\": \"Contract\",\r\n \"groupAndSort\": \"Group and sort by\",\r\n \"reportType\": \"Report Type\",\r\n \"transporter\": \"Transporter\"\r\n}\r\n\r\nconst formItemLayout = {\r\n labelCol: {\r\n xs: { span: 24 },\r\n sm: { span: 8 },\r\n },\r\n wrapperCol: {\r\n xs: { span: 24 },\r\n sm: { span: 16 },\r\n },\r\n};\r\n\r\nexport const GroupAndSortMap = {\r\n contract: \"contract\",\r\n aircraft: \"aircraft\",\r\n // timeOff: \"timeOff\"\r\n}\r\n\r\nexport const ReportTypeMap = {\r\n summary: \"summary\",\r\n detail: \"detail\"\r\n}\r\n\r\nconst FWBRCriteriaForm_Internal: React.FC = (props) => {\r\n let { form: { getFieldDecorator, getFieldValue, setFieldsValue } } = props;\r\n\r\n function thisweek(){\r\n setFieldsValue({\r\n startDate: moment().subtract(1, 'week'),\r\n endDate: moment()\r\n })\r\n }\r\n\r\n return
\r\n \r\n {getFieldDecorator('transporter', {\r\n rules: [ { required: true, message: 'Transporter is required' } ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('startDate', {\r\n rules: [ { required: true, message: 'Start date is required' } ],\r\n initialValue: moment().subtract(1, 'week')\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('endDate', {\r\n rules: [ { required: true, message: 'Ending date is required' } ],\r\n initialValue: moment()\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('tz', {\r\n rules: [ { required: true, message: 'Time zone is required' } ],\r\n initialValue: moment.tz.guess() || \"America/Chicago\"\r\n })(\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n}\r\n\r\nFWBRCriteriaForm_Internal.displayName = \"FWBRCriteriaForm\"\r\n\r\nconst FWBRCriteriaForm = Form.create({\r\n mapPropsToFields(props){\r\n return createFormFields(props.formFields)\r\n },\r\n onFieldsChange(props, changedFields, allFields){\r\n props.onFieldsChange(allFields, changedFields);\r\n }\r\n})(FWBRCriteriaForm_Internal);\r\n\r\nexport default FWBRCriteriaForm","import { message } from 'antd';\r\nimport { createFormField, FormFields } from 'common/form';\r\nimport getGenericStateReducer from 'common/reducer/generic-state-reducer';\r\nimport { maxTimeMoment, momentOrNull, zeroTimeMoment } from 'common/util';\r\nimport useReportDetails, { ReportDetailsResult } from 'components/reporting/hooks/report-details';\r\nimport useReportSubmitter from 'components/reporting/hooks/report-submitter';\r\nimport { OrgDataContext } from 'context/orgData';\r\nimport usePersistence from 'hooks/persistence';\r\nimport moment from 'moment-timezone';\r\nimport React, { createContext, PropsWithChildren, useContext, useEffect, useReducer, useRef, useState } from 'react';\r\nimport { fieldLabelMap } from './criteria-form';\r\n\r\nexport interface FWBRContextInterface {\r\n criteriaFormFields?: { [key: string]: any },\r\n onCriteriaFieldsChange?: (values: { [key: string]: any }) => void,\r\n resetCriteriaForm?: () => void,\r\n formRef?: any,\r\n reportID?: string,\r\n displayReportCriteria?: boolean,\r\n reportSubmitting?: boolean,\r\n submitReport?: (reportData: any) => Promise,\r\n reportDetails?: ReportDetailsResult\r\n}\r\n\r\nconst DEFAULT_CONTEXT_VALUE: FWBRContextInterface = {\r\n \r\n}\r\n\r\nexport const FWBRContext = createContext(DEFAULT_CONTEXT_VALUE);\r\n\r\nexport interface FWBRContextProviderProps {\r\n reportID?: string\r\n}\r\n\r\ninterface ReducerState {\r\n reportId: string\r\n}\r\n\r\nconst ACTION_TYPES = {\r\n SET_CRITERIA_FORM_FIELDS: 'SET_CRITERIA_FORM_FIELDS'\r\n}\r\n\r\nfunction reducer(state: ReducerState, type: string, payload: any){\r\n switch (type){\r\n case ACTION_TYPES.SET_CRITERIA_FORM_FIELDS:\r\n return {\r\n ...state,\r\n criteriaFormFields: payload\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst DEFAULT_STATE: ReducerState = {\r\n reportId: null\r\n}\r\n\r\nexport const FWBRContextProvider: React.FC> = (props) => {\r\n const [ state, dispatch ] = useReducer(getGenericStateReducer(reducer), DEFAULT_STATE);\r\n const { transporterID } = useContext(OrgDataContext);\r\n\r\n const reportDetails = useReportDetails(state.reportId);\r\n const [ submitReport, { loading: reportSubmitting } ] = useReportSubmitter('DISPATCH_BILLING', transporterID, {\r\n onCompleted: ({ id }) => {\r\n console.log('Report submitted. report id: ' + id)\r\n dispatch({ newState: { reportId: id } })\r\n },\r\n onError: (error) => {\r\n console.error('Failed to submit report: ', error);\r\n message.error(\"Failed to submit report due to an error\");\r\n }\r\n });\r\n\r\n const { lastUpdate, persistentData, setPersistentValues, updateTs } = usePersistence('flytwatch.billing.criteria-form');\r\n\r\n const formRef = useRef();\r\n\r\n return {\r\n setPersistentValues(fields);\r\n },\r\n resetCriteriaForm: () => {\r\n setPersistentValues({});\r\n },\r\n formRef,\r\n reportID: state.reportId,\r\n submitReport: (formValues: any) => {\r\n\r\n dispatch({ newState: { reportId: null } })\r\n\r\n return submitReport({\r\n name: 'FlytWatch Billing Report for ' + formValues.transporter.label,\r\n criteria: Object.entries(formValues).map(([ key, value ]) => {\r\n let display_value;\r\n let c_val = value;\r\n\r\n if (key === 'transporter'){\r\n c_val = value.key;\r\n display_value = value.label;\r\n }\r\n\r\n return {\r\n key,\r\n value: c_val,\r\n label: fieldLabelMap[key],\r\n display_value: display_value\r\n }\r\n })\r\n })\r\n },\r\n reportSubmitting: reportSubmitting,\r\n reportDetails: reportDetails\r\n\r\n }}>\r\n {props.children}\r\n \r\n}","import { ColumnProps } from 'antd/lib/table';\r\nimport { capitalize, castArray, getPilotName } from 'common/util';\r\nimport moment from 'moment-timezone';\r\nimport React, { PropsWithChildren, useContext, useEffect, useState } from 'react';\r\nimport { FWBRContext } from './context';\r\nimport ETable, { ETableTotals } from 'components/enchanced-antd-table';\r\n\r\nexport interface FWBillingReportTableProps {\r\n data: any[],\r\n totalAircraft: number\r\n}\r\n\r\nexport const FWBRTContextConsumer: React.FC<{ children: React.ReactElement }> = (props) => {\r\n const ctx = useContext(FWBRContext);\r\n\r\n let summary = ctx.reportDetails?.reportData?.result?.summary;\r\n if (summary){\r\n summary = JSON.parse(summary);\r\n }\r\n\r\n return React.cloneElement(props.children, {\r\n data: ctx.reportDetails?.reportData?.result?.docs || [],\r\n totalAircraft: summary?.total_aircraft_count || '?'\r\n })\r\n}\r\n\r\nconst FWBillingReportTable: React.FC> =\r\n({ data, totalAircraft }) => {\r\n\r\n let totals: ETableTotals = {\r\n label: 'Total',\r\n colNum: 0,\r\n sticky: true,\r\n td: [{totalAircraft}]\r\n };\r\n\r\n let columns: ColumnProps[] = [\r\n {\r\n title: 'Flight Date',\r\n key: 'flightDate',\r\n dataIndex: 'flightDate'\r\n },\r\n {\r\n title: 'Aircraft Count',\r\n key: 'aircraftCount',\r\n dataIndex: 'aircraftCount'\r\n },\r\n {\r\n title: 'Active Aircraft',\r\n key: 'activeAircraft',\r\n render: (_, record) => record.activeAircraft ? record.activeAircraft.join(' ') : null\r\n }\r\n ]\r\n\r\n return \r\n}\r\n\r\nexport default FWBillingReportTable","import { library } from '@fortawesome/fontawesome-svg-core';\r\nimport { faFileAlt } from '@fortawesome/free-solid-svg-icons';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { Alert, Button, Drawer, Icon, Layout, PageHeader } from 'antd';\r\nimport wrapCtxProvider, { WithContextOverrideProps } from 'component-wrappers/wrap-ctx-provider';\r\nimport CenteredLoadingScreen from 'components/CenteredLoadingScreen';\r\nimport NonIdealState from 'components/NonIdealState';\r\nimport { getReportRuntimeFromNow } from 'components/reporting/hooks/report-details';\r\nimport { Criteria } from 'components/reporting/ReportDetails/Criteria';\r\nimport React, { CSSProperties, useContext, useEffect, useRef, useState } from 'react';\r\nimport { FWBRContext, FWBRContextInterface, FWBRContextProvider } from './context';\r\nimport FWBRCriteriaForm from './criteria-form';\r\nimport './index.less';\r\nimport FWBillingReportTable, { FWBRTContextConsumer } from './table';\r\nimport cn from 'classnames';\r\nimport { ReportExporter, REColumnSet } from 'components/reporting/export';\r\n\r\n\r\nlibrary.add(faFileAlt);\r\n\r\nconst BASE_CLS = 'mc-fw-billing-report'\r\n\r\nconst { Sider, Header, Content } = Layout;\r\n\r\n\r\nexport interface FWBillingReportPageProps extends WithContextOverrideProps {\r\n style?: CSSProperties,\r\n reportId?: string\r\n}\r\n\r\nconst FWBillingReportPage_Internal: React.FC = (props) => {\r\n const {\r\n formRef,\r\n criteriaFormFields,\r\n onCriteriaFieldsChange,\r\n resetCriteriaForm,\r\n submitReport,\r\n reportSubmitting,\r\n reportDetails: { reportData, reportState },\r\n reportID\r\n } = useContext(props.overrideContext || FWBRContext);\r\n\r\n const [ showReportCriteria, setShowReportCriteria ] = useState(false);\r\n const [ showCriteriaSider, setShowCriteriaSider ] = useState(true);\r\n const [ showExportDrawer, setShowExportDrawer ] = useState(false);\r\n const [ forceUpdateCount, setForceUpdateCount ] = useState(0);\r\n const forceUpdateInterval = useRef({ prevVal: 0, interval: null });\r\n\r\n useEffect(() => {\r\n console.debug('REPORT STATE CHANGED TO \"' + reportState + '\"')\r\n console.debug('has interval: ', forceUpdateInterval.current);\r\n\r\n function intervalFunc(){\r\n setForceUpdateCount(forceUpdateInterval.current.prevVal + 1);\r\n forceUpdateInterval.current.prevVal++;\r\n }\r\n\r\n if (reportState === 'IN_PROGRESS' && !forceUpdateInterval.current.interval){\r\n forceUpdateInterval.current = {\r\n prevVal: forceUpdateCount,\r\n interval: setInterval(intervalFunc, 1000)\r\n }\r\n }\r\n if (reportState !== 'IN_PROGRESS'){\r\n console.debug('CLEARING INTERVAL');\r\n if (forceUpdateInterval.current){\r\n clearInterval(forceUpdateInterval.current.interval);\r\n forceUpdateInterval.current.interval = null;\r\n }\r\n }\r\n \r\n }, [ reportState ])\r\n\r\n useEffect(() => {\r\n if (reportState === 'NOT_STARTED' && showReportCriteria){\r\n setShowReportCriteria(false);\r\n }\r\n if ((reportState === 'IN_PROGRESS') && !showReportCriteria){\r\n setShowReportCriteria(true);\r\n }\r\n // eslint-disable-next-line\r\n }, [ reportState ])\r\n\r\n function renderContent(){\r\n return <>\r\n {reportState === 'QUERY_FAILED' || reportState === 'DOWNLOAD_FAILED' ? : null}\r\n {reportState === 'COMPLETE' && reportData?.status === 'ERROR' ? (\r\n \r\n ) : null}\r\n {reportState === 'IN_PROGRESS' ? (\r\n \r\n
\r\n Report is being generated. Please wait.\r\n
\r\n {getReportRuntimeFromNow(reportData) >= 120/* seconds */ ? (\r\n \r\n ) : null}\r\n \r\n }\r\n />\r\n ) : null}\r\n {reportState === 'DOWNLOADING' ? (\r\n Downloading Report}\r\n />\r\n ) : null}\r\n {reportState === 'NOT_STARTED' ? (\r\n \r\n
Use the left panel to choose your criteria. Then click \"Generate Report\" to run the report.
\r\n \r\n }\r\n style={{ height: '100%' }}\r\n icon={}\r\n type=\"primary\"\r\n />\r\n ) : null}\r\n {reportState === 'COMPLETE' ? (\r\n \r\n \r\n \r\n ) : null}\r\n \r\n }\r\n\r\n return \r\n
\r\n

FlytWatch Billing Report

\r\n
\r\n {reportData ? (\r\n setShowCriteriaSider(!showCriteriaSider)}\r\n icon={showCriteriaSider ? 'menu-fold' : 'menu-unfold'}\r\n >{showCriteriaSider ? 'Hide Criteria' : 'Show Criteria'}\r\n ) : null}\r\n
\r\n {reportState === 'COMPLETE' ? (\r\n \r\n ) : null}\r\n
\r\n \r\n \r\n
\r\n setShowReportCriteria(false)} title=\"CRITERIA\" className={BASE_CLS + '-form-title'} />\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n setShowReportCriteria(true)}>Show Criteria : null}\r\n />\r\n
\r\n \r\n
\r\n
\r\n {\r\n formRef.current.validateFieldsAndScroll((err, values) => {\r\n if (!err){\r\n submitReport(values);\r\n }\r\n })\r\n }}\r\n loading={reportSubmitting}\r\n >Generate Report\r\n
\r\n {formRef.current?.isFieldsTouched() ? (\r\n
\r\n \r\n
\r\n ) : null}\r\n
\r\n
\r\n \r\n {renderContent()}\r\n \r\n
\r\n Export Report}\r\n width={600}\r\n onClose={() => setShowExportDrawer(false)}\r\n bodyStyle={{ height: 'calc(100% - 56px)' }}\r\n >\r\n {reportData ? (\r\n \r\n ) : null}\r\n \r\n
\r\n}\r\n\r\nFWBillingReportPage_Internal.displayName = 'FWBillingReportPage'\r\n\r\nconst FWBillingReportPage = wrapCtxProvider({\r\n providerComponent: FWBRContextProvider\r\n})(FWBillingReportPage_Internal)\r\n\r\nexport default FWBillingReportPage","import { Col, Form, Input, Row } from 'antd';\r\nimport { GetFieldDecoratorOptions, WrappedFormUtils } from 'antd/lib/form/Form';\r\nimport ContractSelect from 'components/form/ContractSelect';\r\nimport React from 'react';\r\nimport AircraftSelect from '../form/AircraftSelect';\r\nimport PilotSelect from '../form/PilotSelect';\r\n\r\nexport interface FlightEditorFormProps {\r\n scheduledFlightDate?: any,\r\n desig?: any,\r\n contract?: any,\r\n pilot?: any,\r\n copilot?: any,\r\n aircraft?: any,\r\n form: WrappedFormUtils,\r\n showScheduledFlightDate?: boolean,\r\n onChange?(fields: any): void,\r\n disabled?: boolean,\r\n editing?: boolean,\r\n locationID?: string\r\n}\r\n\r\nfunction getFieldOptions(label: string, required: boolean): GetFieldDecoratorOptions {\r\n return {\r\n rules: [\r\n {\r\n required: required, message: label + ' is required'\r\n }\r\n ]\r\n }\r\n}\r\n\r\nconst FlightEditorForm: React.FunctionComponent = (props) => {\r\n const renderColumns = (formItems: JSX.Element[]): JSX.Element[] => {\r\n return formItems.map((item) => {item})\r\n }\r\n const { getFieldDecorator } = props.form;\r\n return
\r\n \r\n {renderColumns([\r\n Designation:} colon={false}>\r\n {getFieldDecorator('desig', getFieldOptions('Designation', true))(\r\n \r\n )}\r\n ,\r\n Aircraft:} colon={false}>\r\n {getFieldDecorator('aircraft', getFieldOptions('Aircraft', true))(\r\n \r\n )}\r\n ,\r\n Contract:} colon={false}>\r\n {getFieldDecorator('contract', getFieldOptions('Contract', true))(\r\n \r\n )}\r\n ,\r\n Pilot:} colon={false}>\r\n {getFieldDecorator('pilot', getFieldOptions('Pilot', false))(\r\n \r\n )}\r\n ,\r\n Co-Pilot:} colon={false}>\r\n {getFieldDecorator('copilot', getFieldOptions('Copilot', false))(\r\n \r\n )}\r\n \r\n ])}\r\n \r\n
\r\n}\r\n\r\nexport default Form.create({\r\n mapPropsToFields(props: FlightEditorFormProps){\r\n const createFormFieldFromProp = (field: any) => {\r\n if (typeof field === 'object'){\r\n return Form.createFormField({\r\n ...field,\r\n value: field.value\r\n })\r\n }\r\n }\r\n return {\r\n scheduledFlightDate: createFormFieldFromProp(props.scheduledFlightDate),\r\n desig: createFormFieldFromProp(props.desig),\r\n contract: createFormFieldFromProp(props.contract),\r\n pilot: createFormFieldFromProp(props.pilot),\r\n copilot: createFormFieldFromProp(props.copilot),\r\n aircraft: createFormFieldFromProp(props.aircraft)\r\n }\r\n },\r\n onFieldsChange(props, changedFields){\r\n props.onChange && props.onChange(changedFields)\r\n }\r\n})(FlightEditorForm)","import React, { useRef, useState, useEffect } from 'react';\r\nimport FlightEditorForm, { FlightEditorFormProps } from './FlightEditorForm';\r\nimport { Row, Col, Button } from 'antd';\r\n\r\nexport interface FlightEditorFormWrapperProps extends FlightEditorFormProps {\r\n onSave?(values: any): void,\r\n editing?: boolean,\r\n onEditChange?(editing: boolean): void,\r\n saving?: boolean,\r\n disabled?: boolean,\r\n locationID?: string\r\n}\r\n\r\nconst FlightEditorFormWrapper: React.FC = (props) => {\r\n const form = useRef(null);\r\n const [ editing, setEditing ] = useState(false);\r\n\r\n useEffect(() => {\r\n if (props.disabled){\r\n setEditing(false);\r\n }\r\n }, [ props.disabled ])\r\n\r\n useEffect(() => {\r\n if (props.onEditChange){\r\n props.onEditChange(editing);\r\n }\r\n // eslint-disable-next-line\r\n }, [ editing ])\r\n\r\n useEffect(() => {\r\n if (props.editing !== undefined){\r\n setEditing(props.editing);\r\n }\r\n }, [props.editing])\r\n\r\n const { onSave, ...restProps } = props;\r\n return \r\n \r\n \r\n \r\n {(editing || props.onSave) && !props.disabled ? (\r\n \r\n {!editing ? (\r\n \r\n \r\n \r\n ) : <>\r\n \r\n \r\n \r\n \r\n {\r\n if (!form) return;\r\n form.current.validateFieldsAndScroll((err: any, values: any) => {\r\n if (!err){\r\n props.onSave(values)\r\n }\r\n })\r\n }}\r\n type=\"primary\"\r\n >Save\r\n \r\n }\r\n \r\n ) : null}\r\n \r\n}\r\n\r\nexport default FlightEditorFormWrapper","import React from 'react';\r\nimport { FlightLeg } from '../../schema';\r\nimport { Card, Icon, Tooltip, Typography } from 'antd';\r\nimport { CardProps } from 'antd/lib/card';\r\nimport { TableRowSelection } from 'antd/lib/table';\r\nimport DraggableTable from '../TableDragSorting';\r\n\r\nexport interface FlightLegsTableProps {\r\n legs: FlightLeg[],\r\n legsCardProps?: CardProps,\r\n rowSelection?: TableRowSelection,\r\n onRow?(record: any, index: number): any,\r\n onMoveRow?(dragIndex: number, hoverIndex: number): void,\r\n checkLegIsRedundant?: (leg: any) => boolean\r\n}\r\n\r\nconst FlightLegsTable: React.FC = (props) => {\r\n return \r\n String(index)}\r\n onMoveRow={props.onMoveRow}\r\n columns={[\r\n {\r\n title: 'Dep',\r\n key: 'dep',\r\n dataIndex: 'departure'\r\n },\r\n {\r\n title: 'Dest',\r\n key: 'dest',\r\n dataIndex: 'destination'\r\n },\r\n {\r\n title: 'Pax',\r\n key: 'pax',\r\n dataIndex: 'paxCount'\r\n },\r\n {\r\n title: 'Cgo',\r\n key: 'cgo',\r\n dataIndex: 'cgoCount'\r\n },\r\n {\r\n title: '',\r\n key: 'redundantWarning',\r\n render: (_, record) => props.checkLegIsRedundant?.(record) ? \r\n \r\n \r\n \r\n : null\r\n }\r\n ]}\r\n onRow={props.onRow}\r\n rowSelection={props.rowSelection}\r\n />\r\n \r\n}\r\n\r\nexport default FlightLegsTable","import React from 'react';\r\nimport { FlightLeg } from '../../schema';\r\nimport { Card, Table } from 'antd';\r\nimport { ColumnProps, TableRowSelection } from 'antd/lib/table';\r\nimport { CardProps } from 'antd/lib/card';\r\nimport ETable from 'components/enchanced-antd-table';\r\n\r\nexport interface LegContentProps {\r\n leg: FlightLeg,\r\n paxColumns?: ColumnProps[],\r\n cgoColumns?: ColumnProps[],\r\n showOrder?: boolean,\r\n showScheduledGroup?: boolean,\r\n rowSelection?: Omit, 'selectedRowKeys' | 'onChange'> & {\r\n selectedRowKeys: string[],\r\n onChange: (keys: string[]) => void\r\n },\r\n onLegTabChange?(key: any): void,\r\n legTabKey?: any,\r\n cardProps?: CardProps,\r\n renderTitle?: (legTitle: string) => any\r\n}\r\n\r\nconst LegContent: React.FC = (props) => {\r\n const legData = props.leg;\r\n let paxColumns = props.paxColumns;\r\n if (!paxColumns){\r\n\r\n paxColumns = [\r\n {\r\n title: 'Name',\r\n key: 'name',\r\n render: (_, record) => record && `${record.lastName}, ${record.firstName}`\r\n },\r\n {\r\n title: 'Employer',\r\n key: 'employer',\r\n dataIndex: 'employerID',\r\n render: (e) => e && e.name\r\n },\r\n {\r\n title: 'Weight',\r\n key: 'paxWeight',\r\n dataIndex: 'paxWeight'\r\n },\r\n {\r\n title: 'Bag Weight',\r\n key: 'bagWeight',\r\n dataIndex: 'bagWeight'\r\n },\r\n {\r\n title: 'Bag Count',\r\n key: 'bagCount',\r\n dataIndex: 'bagCount'\r\n },\r\n {\r\n title: 'Departure',\r\n key: 'departure',\r\n dataIndex: 'departureID',\r\n render: (l) => l && l.name\r\n },\r\n {\r\n title: 'Destination',\r\n key: 'destination',\r\n dataIndex: 'destinationID',\r\n render: (l) => l && l.name\r\n },\r\n {\r\n title: 'Transit Type',\r\n key: 'transitType',\r\n dataIndex: 'transitType'\r\n }\r\n ]\r\n\r\n if (props.showOrder){\r\n paxColumns.unshift({\r\n title: 'Order',\r\n key: 'scheduledOrder',\r\n dataIndex: 'scheduledOrder',\r\n render: (o: number, _, index) => o || (index + 1)\r\n })\r\n }\r\n \r\n if (props.showScheduledGroup){\r\n paxColumns.unshift({\r\n title: 'Scheduled Group',\r\n key: 'scheduledGroup',\r\n dataIndex: 'scheduledGroup'\r\n })\r\n }\r\n }\r\n\r\n let cgoColumns = props.cgoColumns;\r\n if (!cgoColumns){\r\n cgoColumns = [\r\n {\r\n title: 'Name',\r\n key: 'name',\r\n dataIndex: 'name'\r\n },\r\n {\r\n title: 'Weight',\r\n key: 'weight',\r\n dataIndex: 'weight'\r\n },\r\n {\r\n title: 'Departure',\r\n key: 'departure',\r\n dataIndex: 'departureID',\r\n render: (l) => l && l.name\r\n },\r\n {\r\n title: 'Destination',\r\n key: 'destination',\r\n dataIndex: 'destinationID',\r\n render: (l) => l && l.name\r\n },\r\n {\r\n title: 'Delivered By',\r\n key: 'deliveredBy',\r\n dataIndex: 'deliveredBy'\r\n },\r\n {\r\n title: 'Attention To',\r\n key: 'attentionTo',\r\n dataIndex: 'attentionTo'\r\n },\r\n {\r\n title: 'Approved By',\r\n key: 'approvedBy',\r\n dataIndex: 'approvedBy'\r\n },\r\n {\r\n title: 'Transit Type',\r\n key: 'transitType',\r\n dataIndex: 'transitType'\r\n }\r\n ]\r\n }\r\n\r\n function renderTitle(){\r\n let t = `${legData.departure} to ${legData.destination}`;\r\n if (props.renderTitle){\r\n return props.renderTitle(t);\r\n }\r\n return t;\r\n }\r\n\r\n\r\n return \r\n {props.legTabKey === 'pax' ? (\r\n row._id}\r\n // className=\"borderless marginless\"\r\n rowSelection={props.rowSelection}\r\n />\r\n ) : \r\n (\r\n row._id}\r\n className=\"borderless marginless mc-table\"\r\n rowSelection={props.rowSelection}\r\n /> \r\n )}\r\n \r\n}\r\n\r\nexport default LegContent","import React from 'react';\r\nimport { FlightLeg } from '../../schema';\r\nimport { Card, Table, Tabs } from 'antd';\r\nimport { ColumnProps, TableRowSelection } from 'antd/lib/table';\r\nimport { CardProps } from 'antd/lib/card';\r\nimport ETable from 'components/enchanced-antd-table';\r\n\r\nexport interface LegManualAssignContentProps {\r\n legs: FlightLeg[],\r\n paxColumns?: ColumnProps[],\r\n cgoColumns?: ColumnProps[],\r\n showOrder?: boolean,\r\n showScheduledGroup?: boolean,\r\n rowSelection?: Omit, 'selectedRowKeys' | 'onChange'> & {\r\n selectedRowKeys: string[],\r\n onChange: (keys: string[]) => void\r\n },\r\n onLegTabChange?(key: any): void,\r\n legTabKey?: any,\r\n cardProps?: CardProps\r\n}\r\n\r\nconst LegManualAssignContent: React.FC = (props) => {\r\n\r\n const renderLegData = (legData) => {\r\n return \r\n {props.legTabKey === 'pax' ? (\r\n row._id}\r\n // className=\"borderless marginless\"\r\n rowSelection={props.rowSelection}\r\n />\r\n ) : \r\n (\r\n row._id}\r\n className=\"borderless marginless mc-table\"\r\n rowSelection={props.rowSelection}\r\n /> \r\n )}\r\n \r\n\r\n }\r\n\r\n const legsData = props.legs;\r\n let paxColumns = props.paxColumns;\r\n if (!paxColumns){\r\n\r\n paxColumns = [\r\n {\r\n title: 'Name',\r\n key: 'name',\r\n render: (_, record) => record && `${record.lastName}, ${record.firstName}`\r\n },\r\n {\r\n title: 'Employer',\r\n key: 'employer',\r\n dataIndex: 'employerID',\r\n render: (e) => e && e.name\r\n },\r\n {\r\n title: 'Weight',\r\n key: 'paxWeight',\r\n dataIndex: 'paxWeight'\r\n },\r\n {\r\n title: 'Bag Weight',\r\n key: 'bagWeight',\r\n dataIndex: 'bagWeight'\r\n },\r\n {\r\n title: 'Bag Count',\r\n key: 'bagCount',\r\n dataIndex: 'bagCount'\r\n },\r\n {\r\n title: 'Departure',\r\n key: 'departure',\r\n dataIndex: 'departureID',\r\n render: (l) => l && l.name\r\n },\r\n {\r\n title: 'Destination',\r\n key: 'destination',\r\n dataIndex: 'destinationID',\r\n render: (l) => l && l.name\r\n },\r\n {\r\n title: 'Transit Type',\r\n key: 'transitType',\r\n dataIndex: 'transitType'\r\n }\r\n ]\r\n\r\n if (props.showOrder){\r\n paxColumns.unshift({\r\n title: 'Order',\r\n key: 'scheduledOrder',\r\n dataIndex: 'scheduledOrder',\r\n render: (o: number, _, index) => o || (index + 1)\r\n })\r\n }\r\n \r\n if (props.showScheduledGroup){\r\n paxColumns.unshift({\r\n title: 'Scheduled Group',\r\n key: 'scheduledGroup',\r\n dataIndex: 'scheduledGroup'\r\n })\r\n }\r\n }\r\n\r\n let cgoColumns = props.cgoColumns;\r\n if (!cgoColumns){\r\n cgoColumns = [\r\n {\r\n title: 'Name',\r\n key: 'name',\r\n dataIndex: 'name'\r\n },\r\n {\r\n title: 'Weight',\r\n key: 'weight',\r\n dataIndex: 'weight'\r\n },\r\n {\r\n title: 'Departure',\r\n key: 'departure',\r\n dataIndex: 'departureID',\r\n render: (l) => l && l.name\r\n },\r\n {\r\n title: 'Destination',\r\n key: 'destination',\r\n dataIndex: 'destinationID',\r\n render: (l) => l && l.name\r\n },\r\n {\r\n title: 'Delivered By',\r\n key: 'deliveredBy',\r\n dataIndex: 'deliveredBy'\r\n },\r\n {\r\n title: 'Attention To',\r\n key: 'attentionTo',\r\n dataIndex: 'attentionTo'\r\n },\r\n {\r\n title: 'Approved By',\r\n key: 'approvedBy',\r\n dataIndex: 'approvedBy'\r\n },\r\n {\r\n title: 'Transit Type',\r\n key: 'transitType',\r\n dataIndex: 'transitType'\r\n }\r\n ]\r\n }\r\n\r\n if (legsData.length <= 0) return null\r\n\r\n return (\r\n \r\n {legsData.map(leg => (\r\n \r\n {renderLegData(leg)}\r\n )\r\n )}\r\n \r\n )\r\n}\r\n\r\nexport default LegManualAssignContent","import React from 'react';\r\n\r\nconst DepartingHelicopter = () => {\r\n return \r\n \r\n \r\n}\r\n\r\nexport default DepartingHelicopter","import { Cell, Column } from '@blueprintjs/table';\r\nimport { Checkbox, Icon, Spin, Tooltip } from 'antd';\r\nimport { CheckboxProps } from 'antd/lib/checkbox';\r\nimport { safeGet } from 'common/util';\r\nimport { IsSelected, ToggleSelection } from 'hooks/useMultiSelectByID';\r\nimport React from 'react';\r\n\r\nexport function hasCarrier(entity: any, carrier: string, include: boolean=false){\r\n let carrierId = safeGet(['currentCarrierID', '_id'], entity);\r\n if (!carrier){\r\n return true;\r\n }\r\n if(!include){\r\n if (carrierId === carrier){\r\n return false\r\n }\r\n }else {\r\n if(carrierId && carrierId !== carrier){\r\n return false\r\n }\r\n }\r\n return true;\r\n}\r\n\r\nexport function renderCheckboxColumn(rows: any[], isSelected?: IsSelected, toggleSelection?: ToggleSelection, checkboxDisabledText?: string, carrierID?: string){\r\n return {\r\n const record = rows[idx];\r\n if(record){\r\n let checked = isSelected ? isSelected(record._id) : false;\r\n const checkProps: CheckboxProps = {\r\n checked,\r\n onClick: () => {\r\n if (toggleSelection){\r\n toggleSelection(record._id);\r\n }\r\n }\r\n }\r\n let checkbox = ;\r\n if (record && record.currentCarrierID && record.currentCarrierID['_id'] !== carrierID){\r\n checkbox = \r\n if (checkboxDisabledText){\r\n checkbox = {checkbox};\r\n }\r\n }\r\n return {checkbox}\r\n }\r\n return \r\n }} />\r\n}\r\n\r\nexport function renderAssignedFlightColumn(rows: any[]){\r\n return {\r\n const record = rows[idx];\r\n let text = safeGet(['currentCarrierID', 'desig'], record);\r\n let cellStyle: React.CSSProperties = {};\r\n if (!text){\r\n text = 'Not Assigned'\r\n }\r\n else\r\n {\r\n cellStyle = {\r\n background: '#ff000054'\r\n }\r\n }\r\n return {text}\r\n }} />\r\n}\r\n\r\nexport function LoadingIndicator(){\r\n return
\r\n } />\r\n
\r\n}\r\n\r\nexport function shouldRenderLoadingIndicator(networkStatus: number){\r\n return networkStatus === 1 || networkStatus === 4;\r\n}","import React, { CSSProperties } from 'react';\r\nimport { Cell, ICellProps } from '@blueprintjs/table';\r\nimport { getISNStatus } from 'common/isn';\r\nimport { Spin, Icon } from 'antd';\r\nimport './IsnStatusCell.less';\r\nimport { classNames } from 'common/util';\r\n\r\nexport interface IsnStatusCellProps {\r\n data: any,\r\n isnCheckRunningKey?: string,\r\n disableClick?: boolean,\r\n onClick?: (id: string) => void\r\n}\r\n\r\nconst OnClickChild = props => (\r\n
\r\n {props.isnStatus.text}\r\n
\r\n);\r\n\r\nfunction getClassNameFromISNStatusText(text: string): string {\r\n let classNamePrefix = 'cell-isn-status-';\r\n let mapping = {\r\n 'RED': classNamePrefix + 'red',\r\n 'GREEN': classNamePrefix + 'green',\r\n 'MULTIPLE RESULTS': classNamePrefix + 'multi',\r\n 'OVERRIDDEN': classNamePrefix + 'override'\r\n }\r\n return mapping[text] || ''\r\n}\r\n\r\nconst IsnStatusCell: React.FC = (props) => {\r\n const { data, isnCheckRunningKey, onClick, ...cellProps } = props;\r\n let checking: boolean = data[isnCheckRunningKey || 'isnCheckRunning'];\r\n function handleClick(){\r\n if (onClick && !props.disableClick){\r\n onClick(data._id);\r\n }\r\n }\r\n\r\n let isnStatus = getISNStatus(data);\r\n let style: CSSProperties = {\r\n ...cellProps.style\r\n }\r\n let children: string | JSX.Element;\r\n if (!data){\r\n children = 'NO DATA'\r\n }\r\n else if (checking){\r\n children = } />\r\n }\r\n else {\r\n children = \r\n }\r\n\r\n let className = 'cell-isn-status'\r\n if (onClick && !props.disableClick){\r\n className = classNames(className, 'cell-isn-status-selectable');\r\n }\r\n className = classNames(className, getClassNameFromISNStatusText(isnStatus.text), props.className);\r\n \r\n return \r\n {children}\r\n
\r\n}\r\n\r\nexport default IsnStatusCell","import { Cell, Column, IColumnProps } from \"@blueprintjs/table\";\r\nimport React from 'react';\r\n\r\nexport type CellElementRenderer = (row: any, index?: number) => JSX.Element\r\n\r\nexport interface RenderCellElementMap {\r\n [key: string]: CellElementRenderer\r\n}\r\n\r\nexport interface CellPropsMap {\r\n [key: string]: any\r\n}\r\n\r\nexport interface BlueprintColumnSetOptions {\r\n renderCellElement?: CellElementRenderer,\r\n renderCellElementMap?: RenderCellElementMap\r\n}\r\n\r\nexport default class BlueprintColumnSet {\r\n constructor(data: any[], options?: BlueprintColumnSetOptions, paxEdit?: boolean){\r\n this.data = data;\r\n if (options){\r\n if (options.renderCellElement){\r\n this.renderCellElement = options.renderCellElement;\r\n }\r\n if (options.renderCellElementMap){\r\n this.renderCellElementMap = options.renderCellElementMap\r\n }\r\n }\r\n this.paxEdit = paxEdit\r\n }\r\n\r\n protected paxEdit = null;\r\n protected renderCellElement: CellElementRenderer = () => \r\n protected renderCellElementMap = null\r\n protected renderColumn(props: IColumnProps): JSX.Element{\r\n return \r\n }\r\n protected getCellElement(row: any, index: number, columnID?: string): JSX.Element {\r\n if (!row) return ;\r\n if (columnID && this.renderCellElementMap !== null && this.renderCellElementMap[columnID]){\r\n return this.renderCellElementMap[columnID](row, index);\r\n }\r\n return this.renderCellElement(row, index);\r\n }\r\n protected getRow(idx: number){\r\n return this.data[idx];\r\n }\r\n\r\n protected basicCellRenderer = (colID: string, renderRow: (row: any) => any, valuePropName='children') => {\r\n return (idx: number) => {\r\n let row = this.getRow(idx);\r\n let cellProps = {\r\n [valuePropName]: row ? renderRow(row) : null\r\n }\r\n let cell = React.cloneElement(this.getCellElement(row, idx, colID), cellProps);\r\n return cell\r\n }\r\n }\r\n\r\n data: any[] = [];\r\n columns: IColumnProps[] = []\r\n get(id: string | number){\r\n return this.columns.find((col) => col.id === id);\r\n }\r\n all(): JSX.Element[]{\r\n return this.columns.map(this.renderColumn);\r\n }\r\n some(colIDs: (string | number)[]): JSX.Element[]{\r\n return colIDs.map((id) => this.columns.find((col) => col.id === id)).filter((col) => colIDs.includes(col && col.id)).map(this.renderColumn);\r\n }\r\n except(colIDs: (string | number)[]): JSX.Element[]{\r\n return this.columns.filter((col) => !colIDs.includes(col && col.id)).map(this.renderColumn);\r\n }\r\n}","import { Cell, ICellProps, IColumnProps } from '@blueprintjs/table';\r\nimport { Button, Modal } from 'antd';\r\nimport { PassengerEditor } from 'components/PassengerEditor';\r\nimport moment from 'moment';\r\nimport React, { useState } from 'react';\r\nimport { safeGet } from \"../util\";\r\nimport IsnStatusCell from './blueprintcells/IsnStatusCell';\r\nimport BlueprintColumnSet from \"./blueprintcolumnset\";\r\n\r\nexport class CommonColumnSet extends BlueprintColumnSet {\r\n columns: IColumnProps[] = []\r\n commonColumns: IColumnProps[] = [\r\n {\r\n id: 'nation',\r\n name: 'Nation',\r\n cellRenderer: this.basicCellRenderer('nation', row => {\r\n if (row.personID) {\r\n return safeGet(['personID', 'nation'], row);\r\n } else {\r\n return row.nation;\r\n }\r\n })\r\n },\r\n {\r\n id: 'transporterName',\r\n name: 'Transporter',\r\n cellRenderer: this.basicCellRenderer('transporterName', row => safeGet(['tpID', 'name'], row))\r\n },\r\n {\r\n id: 'customerName',\r\n name: 'Customer',\r\n cellRenderer: this.basicCellRenderer('customerName', row => safeGet(['customerID', 'name'], row))\r\n },\r\n {\r\n id: 'employerName',\r\n name: 'Employer',\r\n cellRenderer: this.basicCellRenderer('employerName', row => safeGet(['employerID', 'name'], row))\r\n },\r\n {\r\n id: 'departureName',\r\n name: 'Departure',\r\n cellRenderer: this.basicCellRenderer('departureName', row => safeGet(['departureID', 'name'], row))\r\n },\r\n {\r\n id: 'destinationName',\r\n name: 'Destination',\r\n cellRenderer: this.basicCellRenderer('destinationName', row => safeGet(['destinationID', 'name'], row))\r\n },\r\n {\r\n id: 'transitType',\r\n name: 'Transit Type',\r\n cellRenderer: this.basicCellRenderer('transitType', row => row.transitType)\r\n },\r\n {\r\n id: 'assignedFlight',\r\n name: 'Assigned Flight',\r\n cellRenderer: (idx) => {\r\n let row = this.getRow(idx);\r\n let flight = row && row.currentCarrierID;\r\n let cellProps = {\r\n children: flight && flight.desig\r\n }\r\n return React.cloneElement(this.getCellElement(row, idx, 'assignedFlight'), cellProps)\r\n }\r\n },\r\n {\r\n id: 'checkedIn',\r\n name: 'Checked In',\r\n cellRenderer: (idx) => {\r\n let row = this.getRow(idx);\r\n let time = row && row.checkedInTime;\r\n let cellProps = {\r\n children: moment(time).format('YYYY-MM-DD HH:mm:ss')\r\n }\r\n return React.cloneElement(this.getCellElement(row, idx, 'checkedIn'), cellProps);\r\n }\r\n },\r\n {\r\n id: 'personName',\r\n name: 'Name',\r\n cellRenderer: (idx) => {\r\n return \r\n }\r\n },\r\n {\r\n id: 'basicName',\r\n name: 'Name',\r\n cellRenderer: this.basicCellRenderer('name', (row) => row.name)\r\n },\r\n {\r\n id: 'isnStatus',\r\n name: 'ISN Status',\r\n cellRenderer: (idx) => {\r\n let row = this.getRow(idx);\r\n if (this.renderCellElementMap && this.renderCellElementMap.isnStatus) {\r\n return this.renderCellElementMap.isnStatus(row);\r\n }\r\n return \r\n }\r\n }\r\n ]\r\n\r\n getCommonColumnSet(colId: React.ReactText): IColumnProps {\r\n return this.commonColumns.find(({ id }) => id === colId);\r\n }\r\n\r\n getCommonColumnSets(colIds: React.ReactText[]): IColumnProps[] {\r\n if (colIds.length < 1) {\r\n return this.commonColumns\r\n }\r\n return this.commonColumns.filter(({ id }) => colIds.includes(id));\r\n }\r\n}\r\n\r\nexport interface PaxEditCellProps {\r\n row: any,\r\n paxEdit: boolean\r\n}\r\n\r\nconst PaxModalState = (visible = false, paxId = null) => {\r\n return { visible, paxId }\r\n}\r\n\r\nconst PaxEditChild = props => (\r\n props.paxEdit ?
{props.modal}
\r\n :\r\n
{ExtraBroadFlair(props)}
\r\n);\r\n\r\nconst ExtraBroadFlair = (props) => {\r\n let name = `${props.row.lastName}, ${props.row.firstName}`\r\n let xbr = props.row.extraBroadState;\r\n\r\n if (props.row.personID) {\r\n xbr = props.row.personID.extraBroadState;\r\n }\r\n if (xbr === 'FAIL') {\r\n name = `\\u2194 ${props.row.lastName}, ${props.row.firstName}`\r\n } else if (xbr === 'PASS') {\r\n name = `\\uc6c3 ${props.row.lastName}, ${props.row.firstName}`\r\n }\r\n\r\n return name;\r\n}\r\n\r\nconst PaxEditCell: React.FC = (props) => {\r\n const { row, paxEdit, ...cellProps } = props;\r\n const [paxModal, setPaxModal] = useState(PaxModalState());\r\n var data;\r\n let children;\r\n\r\n if (row) {\r\n if (row.__typename === 'Person') {\r\n data = {\r\n ...row,\r\n personID: { ...row }\r\n }\r\n } else {\r\n data = row\r\n }\r\n\r\n if (paxEdit) {\r\n children = setPaxModal(PaxModalState(false, paxModal.paxId))}\r\n footer={null}\r\n width=\"50rem\"\r\n >\r\n setPaxModal(PaxModalState(false, paxModal.paxId))}\r\n />\r\n } />;\r\n } else {\r\n children = \r\n }\r\n }\r\n\r\n return \r\n {children}\r\n \r\n}\r\n\r\nexport class PersonColumnSet extends CommonColumnSet {\r\n columns: IColumnProps[] = this.getCommonColumnSets([\r\n 'personName',\r\n 'customerName',\r\n 'transporterName',\r\n 'employerName'\r\n ])\r\n}\r\n\r\nexport class PaxNodeColumnSet extends CommonColumnSet {\r\n columns: IColumnProps[] = [\r\n ...this.getCommonColumnSets([\r\n 'personName',\r\n 'checkedIn',\r\n 'assignedFlight',\r\n 'customerName',\r\n 'employerName',\r\n 'departureName',\r\n 'destinationName',\r\n 'transitType'\r\n ]),\r\n {\r\n id: 'paxWeight',\r\n name: 'Passenger Weight',\r\n cellRenderer: this.basicCellRenderer('paxWeight', row => row.paxWeight || 0, 'value')\r\n },\r\n {\r\n id: 'bagWeight',\r\n name: 'Bag Weight',\r\n cellRenderer: this.basicCellRenderer('bagWeight', row => row.bagWeight || 0, 'value')\r\n },\r\n {\r\n id: 'bagCount',\r\n name: 'Bag Count',\r\n cellRenderer: this.basicCellRenderer('bagCount', row => row.bagCount || 0, 'value')\r\n },\r\n {\r\n id: 'chargeCode',\r\n name: 'Charge Code',\r\n cellRenderer: this.basicCellRenderer('chargeCode', row => row.chargeCode, 'value')\r\n }\r\n ]\r\n}\r\n\r\nexport class CargoNodeColumns extends CommonColumnSet {\r\n columns: IColumnProps[] = [\r\n ...this.getCommonColumnSets([\r\n 'basicName',\r\n 'checkedIn',\r\n 'assignedFlight',\r\n 'transporterName',\r\n 'customerName',\r\n 'departureName',\r\n 'destinationName',\r\n 'transitType'\r\n ]),\r\n {\r\n id: 'weight',\r\n name: 'Weight',\r\n cellRenderer: this.basicCellRenderer('weight', (row) => row.weight || 0, 'value')\r\n },\r\n {\r\n id: 'isHazmat',\r\n name: 'Hazmat',\r\n cellRenderer: this.basicCellRenderer('isHazmat', row => row.hazmat ? 'Yes' : 'No')\r\n },\r\n {\r\n id: 'hazmat',\r\n name: 'Hazmat',\r\n cellRenderer: this.basicCellRenderer('hazmat', row => {\r\n let text = row.hazmat ? 'Yes' : 'No';\r\n let code = row.hazmatUnCode;\r\n if (code) {\r\n text = text.concat(` (${code})`)\r\n }\r\n return text\r\n })\r\n },\r\n {\r\n id: 'hazmatUnCode',\r\n name: 'Hazmat UN Code',\r\n cellRenderer: this.basicCellRenderer('hazmatUnCode', row => row.hazmatUnCode, 'value')\r\n },\r\n {\r\n id: 'attentionTo',\r\n name: 'Attention',\r\n cellRenderer: this.basicCellRenderer('attentionTo', row => row.attentionTo)\r\n },\r\n {\r\n id: 'approvedBy',\r\n name: 'Approved By',\r\n cellRenderer: this.basicCellRenderer('approvedBy', row => row.approvedBy)\r\n },\r\n {\r\n id: 'deliveredBy',\r\n name: 'Delivered By',\r\n cellRenderer: this.basicCellRenderer('deliveredBy', row => row.deliveredBy)\r\n },\r\n {\r\n id: 'initials',\r\n name: 'Initials',\r\n cellRenderer: this.basicCellRenderer('initials', row => row.initials)\r\n },\r\n {\r\n id: 'notes',\r\n name: 'Notes',\r\n cellRenderer: (idx) => {\r\n let row = this.getRow(idx);\r\n let cellProps = {\r\n children: row && row.notes,\r\n tooltip: row.notes,\r\n truncated: true\r\n }\r\n return React.cloneElement(this.getCellElement(row, idx, 'notes'), cellProps);\r\n }\r\n }\r\n ];\r\n}\r\n\r\nexport class LivePaxColumns extends CommonColumnSet {\r\n columns: IColumnProps[] = [\r\n ...this.getCommonColumnSets([\r\n 'assignedFlight',\r\n 'personName',\r\n 'employerName'\r\n ]),\r\n {\r\n id: 'paxWeight',\r\n name: 'PAX WT',\r\n cellRenderer: this.basicCellRenderer('paxWeight', row => row.paxWeight || 0, 'value')\r\n },\r\n {\r\n id: 'bagWeight',\r\n name: 'Bag WT',\r\n cellRenderer: this.basicCellRenderer('bagWeight', row => row.bagWeight || 0, 'value')\r\n },\r\n {\r\n id: 'bagCount',\r\n name: 'Bag Count',\r\n cellRenderer: this.basicCellRenderer('bagCount', row => row.bagCount || 0, 'value')\r\n },\r\n ...this.getCommonColumnSets([\r\n 'checkedIn',\r\n 'departureName',\r\n 'destinationName'\r\n ]),\r\n {\r\n id: 'tsa',\r\n name: 'TSA',\r\n cellRenderer: (idx) => {\r\n let row = this.getRow(idx);\r\n let cellProps: any = {}\r\n cellProps.children = 'Not checked';\r\n if (row.authorization) {\r\n cellProps.intent = row.authorization.noFlyListed ? 'danger' : 'success'\r\n cellProps.children = row.authorization.noFlyListed ? 'On No-Fly List' : 'Allowed'\r\n }\r\n return React.cloneElement(this.getCellElement(row, idx, 'tsa'), cellProps)\r\n }\r\n },\r\n ...this.getCommonColumnSets([\r\n 'isnStatus'\r\n ]),\r\n ]\r\n}\r\n\r\n// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default {\r\n PaxNodeColumnSet,\r\n CargoNodeColumns,\r\n PersonColumnSet,\r\n LivePaxColumns\r\n}","import useControlledState from './useControlledState';\r\n\r\nexport interface MultiSelectByIDOptions {\r\n selectedItems?: string[],\r\n onSelection?(selectedItems: string[]): void\r\n}\r\n\r\nexport type IsSelected = (name: string) => boolean\r\nexport type ToggleSelection = (name: string) => void\r\nexport type ClearAll = () => void\r\nexport type SetSelectedItems = (items: string[]) => void\r\nexport type SelectedItems = string[]\r\n\r\nexport interface MultiSelectByIDReturn {\r\n isSelected?: IsSelected,\r\n toggleSelection?: ToggleSelection,\r\n clearAll?: ClearAll,\r\n setSelectedItems: SetSelectedItems,\r\n selectedItems: SelectedItems\r\n}\r\n\r\nexport function useMultiSelectByID(options?: MultiSelectByIDOptions): MultiSelectByIDReturn {\r\n const [ selectedItems, setSelectedItems ] = useControlledState([], options && options.selectedItems, options && options.onSelection);\r\n \r\n function isSelected(name: string): boolean {\r\n return selectedItems.findIndex((item) => {\r\n return item === name;\r\n }) !== -1;\r\n }\r\n function toggleSelection(name: string): void {\r\n let selected = isSelected(name);\r\n if (selected){\r\n setSelectedItems(selectedItems.filter((item) => {\r\n return item !== name;\r\n }))\r\n }\r\n else\r\n {\r\n setSelectedItems([ ...selectedItems, name ])\r\n }\r\n }\r\n function clearAll(){\r\n setSelectedItems([]);\r\n }\r\n return {\r\n isSelected,\r\n toggleSelection,\r\n clearAll,\r\n setSelectedItems,\r\n selectedItems\r\n }\r\n}","import { Button, Divider } from 'antd';\r\nimport pluralize from 'pluralize';\r\nimport React from 'react';\r\n\r\nexport interface ISelectionCountProps extends React.HTMLAttributes {\r\n onClear?(): void,\r\n items?: any[] | number,\r\n itemName?: string,\r\n renderMessage?: (count: number) => React.ReactNode\r\n}\r\n\r\nconst SelectionCount: React.FC = (props) => {\r\n const {\r\n onClear,\r\n items,\r\n itemName=\"item\",\r\n renderMessage = (count) => {count} Selected {pluralize(itemName, count)},\r\n ...restProps\r\n } = props;\r\n\r\n let count = 0;\r\n if (Array.isArray(items)){\r\n count = items.length;\r\n }\r\n else if (typeof items === 'number'){\r\n count = items;\r\n }\r\n function handleClear(){\r\n if (onClear){\r\n onClear();\r\n }\r\n }\r\n return \r\n {renderMessage(count)}\r\n {onClear ? <>\r\n \r\n \r\n : null}\r\n \r\n}\r\n\r\nexport default SelectionCount","import React from 'react';\r\nimport '../search.less';\r\nimport { Row, Col, Button, Icon, Spin } from 'antd';\r\nimport SelectionCount from '../SelectionCount';\r\n\r\nexport interface ISearchHeaderProps extends React.HTMLAttributes {\r\n forceRefresh?: boolean,\r\n onForceRefresh?(fr: boolean): void,\r\n selectedItems?: any[],\r\n showSelectedItemsCount?: boolean,\r\n children?: React.ReactNode,\r\n networkStatus?: number,\r\n onRefresh?(): void,\r\n onClear?(): void\r\n}\r\n\r\nconst SearchHeader: React.FC = (props) => {\r\n const { forceRefresh, onForceRefresh, selectedItems, showSelectedItemsCount, children, networkStatus, onRefresh, onClear, ...restProps } = props;\r\n\r\n if(forceRefresh){\r\n onForceRefresh(false)\r\n onRefresh()\r\n }\r\n const shouldRenderSI = selectedItems && selectedItems.length > 0 && showSelectedItemsCount;\r\n const shouldRenderRefresh = onRefresh ? true : false;\r\n\r\n const shouldRenderLoadingIcon = networkStatus <= 4;\r\n\r\n function renderLoadingIcon(){\r\n if (shouldRenderLoadingIcon){\r\n return } />\r\n }\r\n return null\r\n }\r\n return
\r\n \r\n \r\n {children}\r\n \r\n {shouldRenderSI || shouldRenderRefresh || shouldRenderLoadingIcon ? (\r\n \r\n {shouldRenderSI ? (\r\n \r\n ) : null}\r\n {shouldRenderRefresh ? (\r\n \r\n ) : renderLoadingIcon()}\r\n \r\n ) : null}\r\n \r\n
\r\n}\r\n\r\nexport default SearchHeader","import { RenderMode, SelectionModes, Table } from '@blueprintjs/table';\r\nimport { Alert, Col, Icon, Input, Row, Spin } from 'antd';\r\nimport Checkbox from 'antd/lib/checkbox';\r\nimport gql from 'graphql-tag';\r\nimport { compact } from 'lodash';\r\nimport React from 'react';\r\nimport { Query, QueryResult } from 'react-apollo';\r\nimport { hasCarrier, renderAssignedFlightColumn, renderCheckboxColumn } from '..';\r\nimport { CargoNodeColumns } from '../../../common/table/blueprintcolumns';\r\nimport { safeGet } from '../../../common/util';\r\nimport useControlledState from '../../../hooks/useControlledState';\r\nimport { useMultiSelectByID } from '../../../hooks/useMultiSelectByID';\r\nimport BlueprintTableInfiniteScroller from '../../BlueprintTableInfiniteScroller';\r\nimport NonIdealState from '../../NonIdealState';\r\nimport WithOrgData, { WithOrgDataProps } from '../../WithOrgData';\r\nimport { SearchProps } from '../interface';\r\nimport '../search.less';\r\nimport SearchHeader from '../SearchHeader';\r\n\r\nconst CGO_QUERY = gql`\r\nquery SearchCgo($filter: CargoFilterInput, $skip: Int, $limit: Int){\r\n cargo(filter: $filter, skip: $skip, limit: $limit){\r\n docs {\r\n _id\r\n ... on CargoNode {\r\n name\r\n currentCarrierID {\r\n _id\r\n desig\r\n }\r\n approvedBy\r\n customerID {\r\n _id\r\n name\r\n }\r\n tpID {\r\n _id\r\n name\r\n }\r\n checkedInTime\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n deliveredBy\r\n attentionTo\r\n weight\r\n transitType\r\n hazmat\r\n hazmatUnCode\r\n transitType\r\n approvedBy\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nexport interface SearchState {\r\n name?: string,\r\n includeOtherCarriers: boolean,\r\n offset: number\r\n}\r\n\r\nexport const initialSearchState = {\r\n name: null,\r\n includeOtherCarriers: false,\r\n offset: 0\r\n}\r\n\r\n\r\nexport interface ForceRefresh {\r\n onForceRefresh(fr: boolean): void,\r\n forceRefresh?: boolean\r\n}\r\n\r\nconst CgoSearch: React.FC> = ({\r\n forceRefresh,\r\n onForceRefresh,\r\n pageLimit=50,\r\n onSelection,\r\n filterOptions,\r\n selectedItems: selectedItemsProps,\r\n orgData,\r\n showSelectedItemsCount=true,\r\n onSearchStateChange,\r\n searchState: searchStateProp,\r\n excludeCarrier,\r\n ...restProps\r\n}) => {\r\n const [ searchState, setSearchState ] = useControlledState(initialSearchState, searchStateProp, onSearchStateChange);\r\n const { isSelected, toggleSelection, selectedItems, clearAll } = useMultiSelectByID({ selectedItems: selectedItemsProps, onSelection });\r\n // const inputDirty = searchState.name ? true : false;\r\n let customer = orgData.getOrgIDByType('customer');\r\n let transporter = orgData.getOrgIDByType('transporter');\r\n let employer = orgData.getOrgIDByType('employer');\r\n let variables = {\r\n filter: {\r\n name: searchState.name,\r\n customers: customer ? [customer] : undefined,\r\n employers: employer ? [employer] : undefined,\r\n transporter: transporter,\r\n onlyUnassigned: !searchState.includeOtherCarriers\r\n },\r\n limit: pageLimit\r\n }\r\n if (filterOptions){\r\n variables.filter = {\r\n ...variables.filter,\r\n ...filterOptions\r\n }\r\n }\r\n\r\n function setName(value: string){\r\n setSearchState({ ...searchState, name: value });\r\n }\r\n\r\n const handleInputValueChange = (value: string) => {\r\n setName(value);\r\n }\r\n\r\n const handleInputPressEnter = (e: React.KeyboardEvent) => {\r\n setName(e.currentTarget.value);\r\n }\r\n\r\n function renderTable({ data, networkStatus, error, fetchMore }: QueryResult){\r\n if (networkStatus === 1 || networkStatus === 4){\r\n return
\r\n } />\r\n
\r\n }\r\n // if (!inputDirty || (!data && networkStatus > 3 && !error)){\r\n // return \r\n // }\r\n if (error) return \r\n let rows = safeGet(['cargo', 'docs'], data);\r\n if (!Array.isArray(rows)){\r\n rows = [];\r\n }\r\n if (!rows.length){\r\n return \r\n }\r\n rows = rows.filter((row: any) => hasCarrier(row, excludeCarrier));\r\n const ColumnSet = new CargoNodeColumns(rows);\r\n let colList = ['basicName', 'checkedIn', 'departureName', 'destinationName', 'transitType', 'approvedBy', 'deliveredBy'];\r\n if (orgData.userOrgIsOfType('flytsuite.transporter')){\r\n colList.splice(1, 0, 'customerName');\r\n }\r\n let columns = [\r\n renderCheckboxColumn(\r\n rows,\r\n isSelected,\r\n toggleSelection,\r\n 'You must remove this cargo from it\\'s assigned flight (highlighted in red) first before re-assigning.'\r\n ),\r\n ...ColumnSet.some(colList)\r\n ]\r\n columns.splice(2, 0, renderAssignedFlightColumn(rows))\r\n let colWidths = new Array(columns.length);\r\n colWidths.fill(200);\r\n colWidths[0] = 40;\r\n colWidths[2] = 134;\r\n colWidths[3] = 134;\r\n colWidths[4] = 120;\r\n colWidths[5] = 120;\r\n return = pageLimit + searchState.offset}\r\n loadMore={() => {\r\n let nextOffset = searchState.offset + pageLimit;\r\n return fetchMore({\r\n variables: {\r\n skip: nextOffset\r\n },\r\n updateQuery: (prev, { fetchMoreResult }) => {\r\n if (!fetchMoreResult) return prev;\r\n setSearchState({ ...searchState, offset: nextOffset });\r\n return {\r\n ...prev,\r\n cargo: {\r\n ...prev.cargo,\r\n docs: [\r\n ...prev.cargo.docs,\r\n ...fetchMoreResult.cargo.docs\r\n ]\r\n }\r\n }\r\n }\r\n })\r\n }}\r\n >\r\n {\r\n if (isSelected(row._id)){\r\n return {\r\n rows: [ idx, idx ]\r\n }\r\n }\r\n return null\r\n }))}\r\n >\r\n {columns}\r\n \r\n \r\n }\r\n\r\n function renderHeaderContent(){\r\n return \r\n \r\n handleInputValueChange(e.target.value)}\r\n onPressEnter={handleInputPressEnter}\r\n value={searchState.name}\r\n />\r\n \r\n \r\n {\r\n setSearchState({ ...searchState, includeOtherCarriers: !searchState.includeOtherCarriers })\r\n onForceRefresh(true)\r\n }}\r\n >Include CGO on other flights
\r\n \r\n
\r\n }\r\n\r\n return
\r\n \r\n {(result: QueryResult) => {\r\n function handleRefresh(){\r\n setSearchState({ ...searchState, offset: 0 });\r\n result.refetch()\r\n }\r\n return <>\r\n clearAll()}\r\n >\r\n {renderHeaderContent()}\r\n \r\n
\r\n {renderTable(result)}\r\n
\r\n \r\n }}\r\n \r\n
\r\n}\r\n\r\nexport default WithOrgData(CgoSearch)","import { RenderMode, SelectionModes, Table } from '@blueprintjs/table';\r\nimport { Alert, Col, Icon, Input, Row, Spin } from 'antd';\r\nimport Checkbox from 'antd/lib/checkbox';\r\nimport gql from 'graphql-tag';\r\nimport { compact } from 'lodash';\r\nimport React from 'react';\r\nimport { Query, QueryResult } from 'react-apollo';\r\nimport { hasCarrier, renderAssignedFlightColumn, renderCheckboxColumn } from '..';\r\nimport { PaxNodeColumnSet } from '../../../common/table/blueprintcolumns';\r\nimport { safeGet } from '../../../common/util';\r\nimport useControlledState from '../../../hooks/useControlledState';\r\nimport { useMultiSelectByID } from '../../../hooks/useMultiSelectByID';\r\nimport BlueprintTableInfiniteScroller from '../../BlueprintTableInfiniteScroller';\r\nimport NonIdealState from '../../NonIdealState';\r\nimport WithOrgData, { WithOrgDataProps } from '../../WithOrgData';\r\nimport { SearchProps } from '../interface';\r\nimport '../search.less';\r\nimport SearchHeader from '../SearchHeader';\r\n\r\nconst PAX_QUERY = gql`\r\nquery PaxSearch($filter: PassengersFilterInput, $limit: Int, $skip: Int){\r\n passengers(filter: $filter, limit: $limit, skip: $skip){\r\n docs {\r\n ... on PaxNode {\r\n _id\r\n lastName\r\n firstName\r\n checkedInTime\r\n employerID {\r\n _id\r\n name\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n currentCarrierID {\r\n _id\r\n desig\r\n }\r\n transitType\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nexport interface SearchState {\r\n lastName?: string,\r\n firstName?: string,\r\n includeOtherCarriers: boolean,\r\n offset: number\r\n}\r\n\r\nexport const initialSearchState: SearchState = {\r\n lastName: null,\r\n firstName: null,\r\n includeOtherCarriers: false,\r\n offset: 0\r\n}\r\n\r\nexport interface ForceRefresh {\r\n onForceRefresh(fr: boolean): void,\r\n forceRefresh?: boolean\r\n}\r\n\r\nconst PaxSearch: React.FC> = ({\r\n forceRefresh,\r\n onForceRefresh,\r\n pageLimit=50,\r\n onSelection,\r\n filterOptions,\r\n selectedItems: selectedItemsProps,\r\n orgData,\r\n showSelectedItemsCount=true,\r\n searchState: searchStateProp,\r\n onSearchStateChange,\r\n excludeCarrier,\r\n includeCarrier,\r\n ...restProps\r\n}) => {\r\n const [ searchState, setSearchState ] = useControlledState(initialSearchState, searchStateProp, onSearchStateChange);\r\n const { isSelected, toggleSelection, selectedItems, clearAll } = useMultiSelectByID({ selectedItems: selectedItemsProps, onSelection });\r\n\r\n // const inputDirty = searchState.lastName || searchState.firstName ? true : false;\r\n let customer = orgData.getOrgIDByType('customer');\r\n let transporter = orgData.getOrgIDByType('transporter');\r\n let employer = orgData.getOrgIDByType('employer');\r\n let variables = {\r\n filter: {\r\n lastName: searchState.lastName,\r\n firstName: searchState.firstName,\r\n customers: customer ? [customer] : undefined,\r\n employers: employer ? [employer] : undefined,\r\n transporter: transporter,\r\n onlyUnassigned: includeCarrier ? false : !searchState.includeOtherCarriers\r\n },\r\n limit: pageLimit\r\n }\r\n if (filterOptions){\r\n variables.filter = {\r\n ...variables.filter,\r\n ...filterOptions\r\n }\r\n }\r\n\r\n const handleInputValueChange = (key: string, value: string) => {\r\n setSearchState({ ...searchState, [key]: value })\r\n }\r\n\r\n const handleInputPressEnter = (key: string, value: string) => {\r\n setSearchState({ ...searchState, [key]: value })\r\n }\r\n\r\n function renderTable({ data, networkStatus, error, fetchMore }: QueryResult){\r\n if (networkStatus === 1 || networkStatus === 4){\r\n return
\r\n } />\r\n
\r\n }\r\n // if (!inputDirty || (!data && networkStatus > 3 && !error)){\r\n // return \r\n // }\r\n if (error) return \r\n let rows = safeGet(['passengers', 'docs'], data);\r\n if (!Array.isArray(rows)){\r\n rows = [];\r\n }\r\n if (!rows.length){\r\n return \r\n }\r\n if(includeCarrier){\r\n rows = rows.filter((row: any) => hasCarrier(row, includeCarrier, true));\r\n }else {\r\n rows = rows.filter((row: any) => hasCarrier(row, excludeCarrier));\r\n }\r\n const ColumnSet = new PaxNodeColumnSet(rows);\r\n let colList = ['personName', 'checkedIn', 'employerName','departureName', 'destinationName', 'transitType'];\r\n if (orgData.userOrgIsOfType('flytsuite.transporter')){\r\n colList.splice(2, 0, 'customerName');\r\n }\r\n let columns = [\r\n renderCheckboxColumn(\r\n rows,\r\n isSelected,\r\n toggleSelection,\r\n 'You must remove this passenger from their assigned flight (highlighted in red) first before re-assigning.',\r\n includeCarrier\r\n ),\r\n ...ColumnSet.some(colList)\r\n ]\r\n columns.splice(2, 0, renderAssignedFlightColumn(rows))\r\n let colWidths = new Array(columns.length);\r\n colWidths.fill(200);\r\n colWidths[0] = 40;\r\n colWidths[2] = 134;\r\n colWidths[3] = 134;\r\n return = pageLimit + searchState.offset}\r\n loadMore={() => {\r\n let nextOffset = searchState.offset + pageLimit;\r\n return fetchMore({\r\n variables: {\r\n skip: nextOffset\r\n },\r\n updateQuery: (prev, { fetchMoreResult }) => {\r\n if (!fetchMoreResult) return prev;\r\n setSearchState({ ...searchState, offset: nextOffset });\r\n return {\r\n ...prev,\r\n passengers: {\r\n ...prev.passengers,\r\n docs: [\r\n ...prev.passengers.docs,\r\n ...fetchMoreResult.passengers.docs\r\n ]\r\n }\r\n }\r\n }\r\n })\r\n }}\r\n >\r\n {\r\n if (isSelected(row._id)){\r\n return {\r\n rows: [ idx, idx ]\r\n }\r\n }\r\n return null\r\n }))}\r\n >\r\n {columns}\r\n \r\n \r\n }\r\n\r\n function renderHeaderContent(){\r\n return <>\r\n \r\n \r\n \r\n handleInputValueChange('lastName', e.target.value)}\r\n onPressEnter={(e) => handleInputPressEnter('lastName', e.currentTarget.value)}\r\n value={searchState.lastName}\r\n />\r\n handleInputValueChange('firstName', e.target.value)}\r\n onPressEnter={(e) => handleInputPressEnter('firstName', e.currentTarget.value)}\r\n value={searchState.firstName}\r\n />\r\n \r\n \r\n \r\n {\r\n setSearchState({ ...searchState, includeOtherCarriers: !searchState.includeOtherCarriers })\r\n onForceRefresh(true)\r\n }}\r\n >Include PAX on other flights
\r\n \r\n \r\n \r\n }\r\n\r\n return
\r\n \r\n {(result: QueryResult) => {\r\n function handleRefresh(){\r\n setSearchState({ ...searchState, offset: 0 });\r\n result.refetch()\r\n }\r\n return <>\r\n clearAll()}\r\n >\r\n {renderHeaderContent()}\r\n \r\n
\r\n {renderTable(result)}\r\n
\r\n \r\n }}\r\n \r\n
\r\n\r\n}\r\n\r\nexport default WithOrgData(PaxSearch)","import { Divider, Tabs } from 'antd';\r\nimport { TabsProps } from 'antd/lib/tabs';\r\nimport React, { useState } from 'react';\r\nimport '../../../css/Tabs.css';\r\nimport useControlledState from '../../../hooks/useControlledState';\r\nimport CgoSearch from '../CgoSearch';\r\nimport { initialSearchState as cgoInitialSearchState, SearchState as CgoSearchState } from '../CgoSearch/index';\r\nimport '../combinedSearch.css';\r\nimport PaxSearch from '../PaxSearch';\r\nimport { initialSearchState as paxInitialSearchState, SearchState as PaxSearchState } from '../PaxSearch/index';\r\n\r\nexport interface SearchOptions {\r\n filter?: any,\r\n excludeCarrier?: string\r\n}\r\n\r\nexport interface PaxCgoSearchProps extends React.HTMLAttributes {\r\n forceRefresh?: boolean,\r\n onForceRefresh?(fr: boolean): void,\r\n paxSearchOptions?: SearchOptions,\r\n cgoSearchOptions?: SearchOptions,\r\n onEntitySelect?(ss: SelectState): void,\r\n selectedEntities?: SelectState,\r\n searchState?: SearchState,\r\n onSearchStateChange?(ss: SearchState): void,\r\n tabsProps?: TabsProps,\r\n currentCarrier?: string\r\n}\r\n\r\nexport interface SelectState {\r\n pax: string[],\r\n cgo: string[]\r\n}\r\n\r\nexport interface SearchState {\r\n pax: PaxSearchState,\r\n cgo: CgoSearchState\r\n}\r\n\r\nexport type TabState = 'pax' | 'cgo'\r\n\r\nexport let initialSelectState: SelectState = {\r\n pax: [],\r\n cgo: []\r\n}\r\n\r\nexport let initialSearchState: SearchState = {\r\n pax: paxInitialSearchState,\r\n cgo: cgoInitialSearchState\r\n}\r\n\r\nconst PaxCgoSearch: React.FC = (props) => {\r\n const {\r\n forceRefresh,\r\n onForceRefresh,\r\n tabsProps, \r\n selectedEntities, \r\n searchState: searchStateProp, \r\n onEntitySelect, \r\n onSearchStateChange, \r\n paxSearchOptions,\r\n cgoSearchOptions,\r\n currentCarrier,\r\n ...restProps \r\n } = props;\r\n const [ tab, setTab ] = useState('pax');\r\n const [ selectState, setSelectState ] = useControlledState(initialSelectState, selectedEntities, onEntitySelect);\r\n const [ searchState, setSearchState ] = useControlledState(initialSearchState, searchStateProp, onSearchStateChange);\r\n\r\n if (tabsProps && tabsProps.tabBarExtraContent){\r\n var tabBarExtraContent = tabsProps.tabBarExtraContent;\r\n }\r\n else\r\n {\r\n tabBarExtraContent = <>\r\n {selectState.pax.length > 0 ? (\r\n {selectState.pax.length} PAX\r\n ) : null}\r\n {selectState.pax.length > 0 && selectState.cgo.length > 0 ? (\r\n \r\n ) : null}\r\n {selectState.cgo.length > 0 ? (\r\n {selectState.cgo.length} CGO\r\n ) : null}\r\n {selectState.pax.length > 0 || selectState.cgo.length > 0 ? (\r\n selected\r\n ) : null}\r\n \r\n }\r\n\r\n return
\r\n \r\n \r\n setSelectState({ ...selectState, pax: s })}\r\n searchState={searchState.pax}\r\n onSearchStateChange={(ss) => setSearchState({ ...searchState, pax: ss })}\r\n includeCarrier={currentCarrier}\r\n />\r\n \r\n \r\n setSelectState({ ...selectState, cgo: s })}\r\n searchState={searchState.cgo}\r\n onSearchStateChange={(ss) => setSearchState({ ...searchState, cgo: ss })}\r\n includeCarrier={currentCarrier}\r\n />\r\n \r\n \r\n
\r\n}\r\n\r\nexport default PaxCgoSearch","import { Button, Col, Icon, Popconfirm, Row, Table } from 'antd';\r\nimport { createNewLeg, locationListToFlightLegs, paxOnFlightLeg } from 'common/util';\r\nimport { LocationSelect } from 'components/form/select/LocationSelect';\r\nimport { DraggableBodyRow } from 'components/TableDragSorting';\r\nimport React, { useState } from 'react';\r\nimport { FlightLeg } from 'schema';\r\n\r\nexport interface LiveLegsAddProps extends React.HTMLAttributes {\r\n forceRefresh?: boolean,\r\n onForceRefresh?(fr: boolean): void,\r\n onSave?(ss: FlightLeg[]): void,\r\n resultLegs?: FlightLeg[],\r\n}\r\n\r\nconst getLocationsFromLegs = (legs) => {\r\n var arr = [];\r\n\r\n legs.forEach(leg => {\r\n arr.push({\r\n key: leg.departureID,\r\n label: leg.departure,\r\n locked: leg.order === 0 ? true : false\r\n })\r\n })\r\n\r\n if(legs.length > 0){\r\n arr.push({\r\n key: legs[legs.length-1].destinationID,\r\n label: legs[legs.length-1].destination,\r\n locked: true\r\n })\r\n }\r\n \r\n return arr\r\n}\r\n\r\nconst removeStopFromLeg = (legs, locs, index) => {\r\n var newLegs = []\r\n\r\n var oldLegs = [...legs]\r\n //index-1 is destination in Leg, index is Departure in Leg\r\n var samePax = oldLegs[index-1].paxIDs.filter(pax => oldLegs[index].paxIDs.map(p => p._id).includes(pax._id))\r\n var sameCgo = oldLegs[index-1].cgoIDs.filter(cgo => oldLegs[index].cgoIDs.map(c => c._id).includes(cgo._id))\r\n \r\n //Remove the location from the locs list\r\n locs.splice(index, 1)\r\n\r\n oldLegs.splice(index, 1)\r\n oldLegs[index-1] = paxOnFlightLeg(oldLegs[index-1], samePax, sameCgo)\r\n //Create new legs from those locations\r\n for(var i=0; i < locs.length-1; i++){\r\n newLegs.push(createNewLeg(i, locs[i], locs[i+1]))\r\n }\r\n newLegs.forEach(leg => {\r\n leg = {\r\n ...oldLegs[leg.order],\r\n destinationID: leg.destinationID,\r\n departureID: leg.departureID,\r\n departure: leg.departure,\r\n destination: leg.destination\r\n }\r\n })\r\n newLegs[index-1] = {\r\n ...oldLegs[index-1],\r\n destinationID: newLegs[index-1].destinationID,\r\n departureID: newLegs[index-1].departureID,\r\n departure: newLegs[index-1].departure,\r\n destination: newLegs[index-1].destination\r\n }\r\n\r\n return newLegs;\r\n}\r\n\r\nconst addStopToLeg = (legs, locs, index) => {\r\n var result = []\r\n var newLegs = []\r\n\r\n var oldLegs = [...legs]\r\n \r\n //Create new legs from those locations\r\n for(var i=0; i < locs.length-1; i++){\r\n newLegs.push(createNewLeg(i, locs[i], locs[i+1]))\r\n }\r\n //Make the legs the same for everything up to index -1, which is always the second to last and last leg.\r\n newLegs.forEach(leg => {\r\n if(leg.order < index-1){\r\n result.push({\r\n ...oldLegs[leg.order],\r\n destinationID: leg.destinationID,\r\n departureID: leg.departureID,\r\n departure: leg.departure,\r\n destination: leg.destination\r\n })\r\n }\r\n })\r\n \r\n //Set the second to last leg. Basically copy all values except for order, dest, and depart\r\n result.push({\r\n ...oldLegs[index-1],\r\n order: newLegs[index-1].order,\r\n destinationID: newLegs[index-1].destinationID,\r\n departureID: newLegs[index-1].departureID,\r\n departure: newLegs[index-1].departure,\r\n destination: newLegs[index-1].destination\r\n })\r\n \r\n //Set the last leg. Basically copy all values except for order, dest, and depart\r\n result.push({\r\n ...oldLegs[index-1],\r\n order: newLegs[index].order,\r\n destinationID: newLegs[index].destinationID,\r\n departureID: newLegs[index].departureID,\r\n departure: newLegs[index].departure,\r\n destination: newLegs[index].destination\r\n })\r\n return result;\r\n}\r\n\r\n//Run Auto Assign\r\nconst moveStop = (legs, locs) => {\r\n\r\n var pax = [];\r\n var cgo = [];\r\n\r\n legs.forEach(leg => {\r\n pax.push(...leg.paxIDs.filter(px => !pax.map(p => p._id).includes(px._id)))\r\n cgo.push(...leg.cgoIDs.filter(cg => !cgo.map(c => c._id).includes(cg._id)))\r\n })\r\n\r\n var newLegs = locationListToFlightLegs(locs, pax, cgo)\r\n\r\n return newLegs;\r\n}\r\n\r\nconst LiveLegsAdd: React.FC = (props) => {\r\n const {\r\n forceRefresh,\r\n onForceRefresh,\r\n resultLegs, \r\n onSave,\r\n ...restProps \r\n } = props;\r\n const [ resultingLegs, setResultingLegs ] = useState(resultLegs);\r\n const [resultingLocations, setResultinglocations] = useState(getLocationsFromLegs(resultLegs))\r\n\r\n //Get locations from the legs. Use them in the table\r\n\r\n return
\r\n \r\n \r\n \r\n Search: {\r\n if(value){\r\n value.locked = false;\r\n var arr = [...resultingLocations]\r\n arr.splice(arr.length-1, 0, value)\r\n setResultinglocations(arr)\r\n setResultingLegs(addStopToLeg(resultingLegs, arr, arr.length-2))\r\n }\r\n }} labelInValue style={{minWidth: '10rem'}}/>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Resulting Legs\r\n index + 1,\r\n width: 25\r\n },{\r\n title: \"Departure\",\r\n key: \"departure\",\r\n dataIndex: \"departure\"\r\n },{\r\n title: \"Destination\",\r\n key: \"destination\",\r\n dataIndex: \"destination\"\r\n },{\r\n title: \"Pax #\",\r\n key: \"pax\",\r\n dataIndex: \"paxCount\"\r\n },{\r\n title: \"Cgo #\",\r\n key: \"cgo\",\r\n dataIndex: \"cgoCount\"\r\n }]} \r\n rowKey={(_, index) => String(index)} \r\n size=\"small\" \r\n pagination={false}\r\n />\r\n \r\n \r\n Travel Locations\r\n {\r\n if(!rec.locked){\r\n return {\r\n setResultingLegs(removeStopFromLeg(resultingLegs, resultingLocations, resultingLocations.indexOf(rec)))\r\n }}>\r\n \r\n \r\n }\r\n return null\r\n }\r\n },{\r\n title: '#',\r\n key: 'key',\r\n width: '5em',\r\n render: (_, __, index) => {\r\n var ret;\r\n if(index === 0){\r\n ret = 'Depart'\r\n }else {\r\n ret = 'Stop ' + index\r\n }\r\n return ret\r\n },\r\n },{\r\n title: \"Name\",\r\n key: \"name\",\r\n dataIndex: \"label\"\r\n }]} \r\n rowKey={(_, index) => String(index)} \r\n size=\"small\" \r\n pagination={false}\r\n components={{\r\n body: {\r\n row: DraggableBodyRow\r\n }\r\n }}\r\n onRow={(row, index) => {\r\n const rowProps = {\r\n moveRow: (dragIndex, hoverIndex) => {\r\n var arr = resultingLocations\r\n if(!arr[dragIndex].locked){\r\n if(arr[hoverIndex].locked){\r\n return;\r\n }\r\n arr.splice(hoverIndex, 0, arr.splice(dragIndex, 1)[0]);\r\n setResultinglocations(arr)\r\n setResultingLegs(moveStop(resultingLegs, arr))\r\n }\r\n },\r\n index\r\n }\r\n return { ...rowProps}\r\n }}/>\r\n \r\n \r\n
\r\n}\r\n\r\nexport default LiveLegsAdd","import gql from \"graphql-tag\";\r\nimport {LocationFragment} from \"../../Queries/Location\";\r\nimport {OrganizationFragment} from \"../../Queries/Organization\";\r\n\r\nconst LiveFlightEditorFlightFragment = gql`\r\nfragment LiveFlightEditorFlightFragment on FlightNode {\r\n _id\r\n state\r\n desig\r\n scheduledFlightDate\r\n callSign\r\n liveEditedState\r\n paxIDList {\r\n _id\r\n _rev\r\n lastName\r\n firstName\r\n scheduledOrder\r\n scheduledGroup\r\n chargeCode\r\n employerID {\r\n _id\r\n name\r\n }\r\n transitType\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n paxWeight\r\n bagWeight\r\n bagCount\r\n classType\r\n }\r\n cgoIDList {\r\n _id\r\n name\r\n scheduledOrder\r\n scheduledGroup\r\n transitType\r\n chargeCode\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n weight\r\n attentionTo\r\n initials\r\n notes\r\n classType\r\n }\r\n legs\r\n legsArray {\r\n bagCount\r\n bagWeight\r\n cgoCount\r\n cgoWeight\r\n chosen\r\n departure\r\n departureID\r\n destination\r\n destinationID\r\n order\r\n paxCount\r\n paxWeight\r\n usefulLoad\r\n seats\r\n paxIDs {\r\n _id\r\n lastName\r\n firstName\r\n classType\r\n employerID {\r\n _id\r\n name\r\n }\r\n chargeCode\r\n paxWeight\r\n bagWeight\r\n bagCount\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n personID {\r\n _id\r\n dob\r\n nation\r\n credentials {\r\n _id\r\n key\r\n type\r\n expiration\r\n }\r\n }\r\n transitType\r\n },\r\n cgoIDs {\r\n _id\r\n name\r\n weight\r\n approvedBy\r\n checkedInTime\r\n classType\r\n chargeCode\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n deliveredBy\r\n attentionTo\r\n transitType\r\n }\r\n }\r\n tpID {\r\n ...OrganizationFragment\r\n }\r\n pilot {\r\n _id\r\n name {\r\n lastName\r\n firstName\r\n }\r\n }\r\n copilot {\r\n _id\r\n name {\r\n lastName\r\n firstName\r\n }\r\n }\r\n contract {\r\n _id\r\n name\r\n }\r\n aircraftID {\r\n _id\r\n tailNum\r\n model\r\n maxSeats\r\n maxLoad\r\n }\r\n departureID {\r\n ...LocationFragment\r\n }\r\n}\r\n${OrganizationFragment}\r\n${LocationFragment}\r\n`\r\n\r\nexport const GET_FLIGHT = gql`\r\n query GetFlight(\r\n $flightId: ID!\r\n ){\r\n getFlight(_id: $flightId){\r\n ...LiveFlightEditorFlightFragment\r\n }\r\n }\r\n ${LiveFlightEditorFlightFragment}\r\n`\r\n\r\nexport const SET_FLIGHT = gql`\r\n mutation SetFlight(\r\n $payload: FlightNodeInput!\r\n $orgID: ID!\r\n ){\r\n setFlight(payload: $payload, orgID: $orgID){\r\n ...LiveFlightEditorFlightFragment\r\n }\r\n }\r\n ${LiveFlightEditorFlightFragment}\r\n`\r\n\r\nexport const SET_LOCKED_STATE = gql`\r\nmutation LiveFlightEditor_SetLockedState($flightID: ID!, $locked: Boolean!) {\r\n setFlightLocked(flightID: $flightID, locked: $locked){\r\n ...LiveFlightEditorFlightFragment\r\n }\r\n}\r\n${LiveFlightEditorFlightFragment}\r\n`","\r\nimport { Alert, Button, Card, Col, Divider, Drawer, Icon, Layout, message, Modal, PageHeader, Popconfirm, Row, Spin, Tabs, Tooltip } from 'antd';\r\nimport { IconProps } from 'antd/lib/icon';\r\nimport { LayoutProps } from 'antd/lib/layout';\r\nimport { TooltipProps } from 'antd/lib/tooltip';\r\nimport { isEditable } from 'common/carriable';\r\nimport { getEntitiesFromFlightLegs } from 'common/flight';\r\nimport { FlightCgo, FlightPax } from 'common/flight-leg/flight-leg-manager';\r\nimport { buildLocNameMapFromPaxCgoLists, getFlightLegManagerFromFlightQuery, graphqlCgoToFlightManCgo, graphqlPaxToFlightManPax } from 'common/flight-leg/util';\r\nimport { getContractName, getDestinationsFromLegs, getFlightDeparture, getLabelInValue, getPilotName, mergeDataWithFormFields, paxListToFlightLegs, paxOnFlightLeg, safeGet } from 'common/util';\r\nimport FlightEditorFormWrapper from 'components/flighteditor/FlightEditorFormWrapper';\r\nimport FlightLegsTable from 'components/flighteditor/FlightLegsTable';\r\nimport LegContent from 'components/flighteditor/LegContent';\r\nimport LegManualAssignContent from 'components/flighteditor/LegManualAssignContent';\r\nimport DepartingHelicopter from 'components/icons/DepartingHeli';\r\nimport PaxCgoSearch, { initialSearchState, initialSelectState, SearchState, SelectState } from 'components/search/PaxCgoSearch';\r\nimport withCognitoUser from 'components/WithCognitoUser';\r\nimport { default as withOrgData, default as WithOrgData, WithOrgDataProps } from 'components/WithOrgData';\r\nimport 'css/Drawer.css';\r\nimport gql from 'graphql-tag';\r\nimport uniqBy from 'lodash/uniqBy';\r\nimport React, { useEffect, useState } from 'react';\r\nimport {Mutation, Query, QueryResult, useApolloClient, useMutation, withApollo, WithApolloClient} from 'react-apollo';\r\nimport { FlightLeg } from 'schema';\r\nimport useManifestPrintout from '../../components/scheduling/Printout/useManifestPrintout';\r\nimport './LiveFlightEditor.less';\r\nimport LiveLegsAdd from './LiveLegsAdd';\r\nimport {GET_FLIGHT, SET_FLIGHT, SET_LOCKED_STATE} from \"./graphql\";\r\nimport useUserGroups from \"../../hooks/useUserGroups\";\r\n\r\nconst { Content } = Layout;\r\n\r\nexport interface LiveFlightEditorProps extends WithOrgDataProps {\r\n flightId: string,\r\n style?: React.CSSProperties,\r\n onBack?: (e: React.MouseEvent) => void,\r\n onIDChange?(newID: string, prevID?: string): void\r\n}\r\n\r\nconst renderEditDisableIcon = (props?: { tooltipProps?: TooltipProps } & IconProps) => {\r\n let { tooltipProps, ...rest } = props;\r\n tooltipProps = {\r\n placement: 'bottom',\r\n ...tooltipProps\r\n }\r\n return \r\n \r\n \r\n}\r\n\r\ninterface SelectedEntitiesState {\r\n pax: string[],\r\n cgo: string[]\r\n}\r\n\r\nvar PrintoutButton = ({flight, manifestType, buttonText, ...restProps}) => {\r\n const [ fetchPrintout, fetching ] = useManifestPrintout('FlightWithLegs', manifestType);\r\n const userAttr = restProps.cognitoUser.attributes\r\n const orgData = restProps.orgData\r\n return (\r\n \r\n {({ data }): any => {\r\n const manifestPrintouts = safeGet(['getCustomer', 'manifestPrintout'], data) || [];\r\n const flightManifest = manifestPrintouts.find((m) => m.type === 'Flight'); \r\n const hessLayout = flightManifest && flightManifest.layouts.find((l) => l.name === 'Hess');\r\n const logoURL = hessLayout && hessLayout.logo;\r\n const handleClick = () => {\r\n if (!flight){\r\n return;\r\n }\r\n const legs = flight.legsArray || [];\r\n const body = {\r\n issuedBy: `${userAttr.given_name} ${userAttr.family_name}`,\r\n orgName: orgData.customer.name,\r\n logoURL: logoURL,\r\n desig: flight.desig,\r\n departure: flight.departureID ? flight.departureID.name : legs && legs[0] && legs[0].departure,\r\n aircraftNo: flight.aircraftID && flight.aircraftID.tailNum,\r\n scheduledFlightDate: flight.scheduledFlightDate,\r\n legs: legs.map((leg) => {\r\n return {\r\n departure: leg.departure,\r\n destination: leg.destination,\r\n passengers: leg.paxIDs.map((pax) => {\r\n return {\r\n _id: pax._id,\r\n lastName: pax.lastName,\r\n firstName: pax.firstName,\r\n employer: pax.employerID && pax.employerID.name,\r\n chargeCode: pax.chargeCode && pax.chargeCode.toUpperCase(),\r\n paxWeight: pax.paxWeight,\r\n bagWeight: pax.bagWeight,\r\n departure: pax.departureID && pax.departureID.name,\r\n destination: pax.destinationID && pax.destinationID.name,\r\n dob: pax.personID && pax.personID.dob,\r\n nation: pax.personID && pax.personID.nation,\r\n credentials: pax.personID && pax.personID.credentials\r\n }\r\n }),\r\n cargo: leg.cgoIDs.map((cgo) => {\r\n return {\r\n _id: cgo._id,\r\n name: cgo.name,\r\n weight: cgo.weight,\r\n chargeCode: cgo.chargeCode && cgo.chargeCode.toUpperCase(),\r\n departure: cgo.departureID && cgo.departureID.name,\r\n destination: cgo.destinationID && cgo.destinationID.name,\r\n attentionTo: cgo.attentionTo,\r\n deliveredBy: cgo.deliveredBy,\r\n transitType: cgo.transitType,\r\n approvedBy: cgo.approvedBy\r\n }\r\n })\r\n }\r\n })\r\n }\r\n fetchPrintout(body, true, `${orgData.customer.name} Flight Manifest.xlsx`)\r\n .catch((err) => {\r\n message.error('Failed to download printout', 3).then(() => {\r\n message.error(err.message, 5);\r\n }, null)\r\n })\r\n }\r\n return (\r\n \r\n )\r\n }}\r\n \r\n )\r\n}\r\n\r\nPrintoutButton = WithOrgData(withCognitoUser(PrintoutButton))\r\n\r\nconst LiveFlightEditorInternal: React.FC> = (props) => {\r\n const [ selectedLeg, setSelectedLeg ] = useState('0');\r\n const [ selectedLegs, setSelectedLegs ] = useState([]);\r\n const [ legTabKey, setLegTabKey ] = useState<'pax' | 'cgo'>('pax');\r\n const [ selectedEntities, setSelectedEntities ] = useState({pax: [], cgo: []})\r\n const [ formFields, setFormFields ] = useState({});\r\n const [ editingForm, setEditingForm ] = useState(false);\r\n const [ assignerOpen, setAssignerOpen ] = useState(false);\r\n const [ addLegOpen, setAddLegOpen ] = useState(false);\r\n const [ searchSelections, setSearchSelections ] = useState(initialSelectState);\r\n const [ searchState, setSearchState ] = useState(initialSearchState);\r\n const [ assigning, setAssigning ] = useState(false);\r\n const [ forceRefresh, setForceRefresh ] = useState(false);\r\n const [ removingEntities, setRemovingEntities ] = useState(false);\r\n const [ tabState, setTabState] = useState('auto')\r\n\r\n const [ userGroups ] = useUserGroups();\r\n const [ setFlight, setFlightResult ] = useMutation(SET_FLIGHT);\r\n const [ setLockedState, setLockedStateResult ] = useMutation(SET_LOCKED_STATE, {\r\n onError: () => message.error('Failed to set locked status')\r\n });\r\n\r\n useEffect(() => {\r\n setSelectedEntities({ pax: [], cgo: [] });\r\n }, [ selectedLeg ])\r\n\r\n const handleEditingForm = (editing: boolean, data: any) => {\r\n setEditingForm(editing);\r\n setFormFields(data);\r\n }\r\n \r\n return \r\n {({ data, loading, error, refetch }: QueryResult) => {\r\n\r\n const actionsDisabled = loading || setFlightResult.loading || setLockedStateResult.loading;\r\n\r\n let flightData: any;\r\n if (data && data.getFlight){\r\n flightData = data.getFlight || {};\r\n if(!flightData.departureID){\r\n flightData.departureID = {}\r\n flightData.departureID[\"_id\"] = flightData.legsArray[0].departureID\r\n flightData.departureID[\"name\"] = flightData.legsArray[0].departure\r\n }\r\n }\r\n let formFieldsWithValues: any;\r\n if (!editingForm){\r\n formFieldsWithValues = flightData && mergeDataWithFormFields({\r\n scheduledFlightDate: flightData.scheduledFlightDate,\r\n desig: flightData.desig,\r\n contract: flightData.contract && getLabelInValue('_id', null, getContractName)(flightData.contract),\r\n pilot: flightData.pilot && getLabelInValue('_id', null, getPilotName)(flightData.pilot),\r\n copilot: flightData.copilot && getLabelInValue('_id', null, getPilotName)(flightData.copilot),\r\n aircraft: flightData.aircraftID && getLabelInValue('_id', 'tailNum')(flightData.aircraftID)\r\n }, formFields);\r\n }\r\n else {\r\n formFieldsWithValues = formFields\r\n }\r\n\r\n let paxIDMap = new Map();\r\n flightData?.paxIDList?.forEach(pax => paxIDMap.set(pax._id, pax));\r\n let cgoIDMap = new Map();\r\n flightData?.cgoIDList?.forEach(cgo => cgoIDMap.set(cgo._id, cgo));\r\n\r\n let flightState: string = flightData && flightData.state;\r\n let liveEditedState: string = flightData && flightData.liveEditedState\r\n\r\n let subTitle: JSX.Element | string;\r\n if (flightData && flightData.desig){\r\n subTitle = flightData.desig;\r\n }\r\n let subTitleIcon: JSX.Element;\r\n if (flightState === 'LOCKED'){\r\n subTitleIcon = renderEditDisableIcon({ tooltipProps: { title: 'Flight is locked. Editing is disabled.' } });\r\n }\r\n if (flightState === 'DEPARTED'){\r\n subTitleIcon = renderEditDisableIcon({ component: DepartingHelicopter, type: null, tooltipProps: { title: 'Flight has departed. Editing is disabled.' } })\r\n }\r\n if (flightState === 'OVERNIGHT'){\r\n subTitleIcon = renderEditDisableIcon({ tooltipProps: { title: 'Flight is overnight. Editing is disabled.' } });\r\n }\r\n if(liveEditedState === \"BLESSED\"){\r\n subTitleIcon = renderEditDisableIcon({ tooltipProps: { title: 'Flight has been approved. Editing is disabled. Please contact a CSR to make changes.' } });\r\n }\r\n if (subTitleIcon){\r\n subTitle = {subTitle} {subTitleIcon}\r\n }\r\n else if (loading){\r\n subTitle = } />\r\n }\r\n let editable = isEditable(flightData);\r\n\r\n if (!editable) {\r\n if (selectedEntities.pax.length || selectedEntities.cgo.length){\r\n setSelectedEntities({ pax: [], cgo: [] });\r\n }\r\n if (assignerOpen){\r\n setAssignerOpen(false);\r\n }\r\n }\r\n\r\n function checkEditable(){\r\n let t = '';\r\n if (flightState){\r\n t = t.toLowerCase();\r\n t = t.charAt(0).toUpperCase() + t.substring(1);\r\n }\r\n if (!editable){\r\n message.warning(`${t} flights cannot be edited.`)\r\n }\r\n return editable;\r\n }\r\n\r\n async function removeRedundantDestination(locID){\r\n let flManager = getFlightLegManagerFromFlightQuery(flightData);\r\n \r\n if (!flManager.removeLocationIfRedundant(locID)){\r\n return;\r\n }\r\n \r\n let legs = flManager.buildFlightLegs();\r\n \r\n let flightid = flightData._id;\r\n\r\n let legsJson = JSON.stringify( Object.assign({}, legs) );\r\n \r\n try{\r\n var res = await setFlight({\r\n variables: {\r\n payload: {\r\n _id: flightid,\r\n legs: legsJson,\r\n tpID: props.orgData.transporter._id,\r\n customerID: props.orgData.customer._id\r\n },\r\n orgID: props.orgData.getActiveOrgID()\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setFlight: {\r\n ...flightData,\r\n __typename: 'FlightNode',\r\n _id: flightid,\r\n legs: legsJson,\r\n legsArray: legs\r\n }\r\n }\r\n })\r\n }\r\n catch(err){\r\n console.error(err);\r\n message.error(\"Failed to remove redundant destination.\");\r\n return;\r\n }\r\n message.success('Successfully removed redundant destination.');\r\n refetch();\r\n return res;\r\n }\r\n\r\n function toggleLockState() {\r\n\r\n let locked = true;\r\n\r\n if (flightData.state === 'LOCKED') {\r\n locked = false;\r\n }\r\n else if (flightData.state !== 'ACTIVE') {\r\n return;\r\n }\r\n\r\n setLockedState({\r\n variables: {\r\n flightID: props.flightId,\r\n locked: locked\r\n }\r\n })\r\n }\r\n\r\n function handleFlightLegsChange(legs: FlightLeg[], paxObjList: FlightPax[], cgoObjList: FlightCgo[], useOptimisticResponse: boolean=false, liveEditedState: String=\"IS_EDITING\") {\r\n if (!checkEditable()) return\r\n let formattedLegs = legs.map((leg) => {\r\n let objID = (obj: any) => obj && typeof obj === 'object' && obj._id ? obj._id : obj;\r\n return {\r\n ...leg,\r\n paxIDs: leg.paxIDs.map(objID),\r\n cgoIDs: leg.cgoIDs.map(objID)\r\n }\r\n })\r\n let json = JSON.stringify(Object.assign({}, formattedLegs));\r\n return props.client.mutate({\r\n mutation: gql`\r\n mutation SetFlightLegs($payload: FlightNodeInput!, $orgID: ID!){\r\n setFlight(payload: $payload, orgID: $orgID){\r\n _id\r\n desig\r\n legs\r\n paxIDList {\r\n _id\r\n lastName\r\n firstName\r\n scheduledOrder\r\n scheduledGroup\r\n employerID {\r\n _id\r\n name\r\n }\r\n transitType\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n paxWeight\r\n bagWeight\r\n bagCount\r\n classType\r\n }\r\n cgoIDList {\r\n _id\r\n name\r\n scheduledOrder\r\n approvedBy\r\n scheduledGroup\r\n transitType\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n weight\r\n attentionTo\r\n initials\r\n notes\r\n classType\r\n }\r\n legsArray {\r\n bagCount\r\n bagWeight\r\n cgoCount\r\n cgoWeight\r\n chosen\r\n departure\r\n departureID\r\n destination\r\n destinationID\r\n order\r\n paxCount\r\n paxWeight\r\n usefulLoad\r\n seats\r\n paxIDs {\r\n _id\r\n lastName\r\n firstName\r\n classType\r\n employerID {\r\n _id\r\n name\r\n }\r\n chargeCode\r\n paxWeight\r\n bagWeight\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n personID {\r\n _id\r\n dob\r\n }\r\n transitType\r\n },\r\n cgoIDs {\r\n _id\r\n name\r\n weight\r\n approvedBy\r\n checkedInTime\r\n chargeCode\r\n classType\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n deliveredBy\r\n attentionTo\r\n transitType\r\n approvedBy\r\n }\r\n }\r\n }\r\n }\r\n `,\r\n variables: {\r\n payload: {\r\n _id: props.flightId,\r\n customerID: props.orgData.getOrgIDByType('customer'),\r\n tpID: props.orgData.getActiveOrgID(),\r\n legs: json,\r\n paxIDList: paxObjList.map(obj => obj._id),\r\n cgoIDList: cgoObjList.map(obj => obj._id),\r\n liveEditedState: liveEditedState\r\n },\r\n orgID: props.orgData.getActiveOrgID()\r\n },\r\n optimisticResponse: useOptimisticResponse ? {\r\n __typename: 'Mutation',\r\n setFlight: {\r\n __typename: 'FlightNode',\r\n ...flightData,\r\n _id: props.flightId,\r\n paxIDList: paxObjList,\r\n cgoIDList: cgoObjList,\r\n legs: json,\r\n legsArray: legs\r\n }\r\n } : undefined\r\n })\r\n .then(() => {\r\n message.success('Flight updated successfully!');\r\n refetch();\r\n })\r\n .catch((err) => {\r\n message.error('Failed to update flight.', 2, () => {\r\n message.error(err.message, 5);\r\n })\r\n })\r\n }\r\n\r\n const onLegsReorder = (dragIndex, hoverIndex) => {\r\n const { legs } = data.getFlight;\r\n if (!legs) return null;\r\n\r\n let flManager = getFlightLegManagerFromFlightQuery(data.getFlight);\r\n\r\n // const departureID = getFlightDeparture(data.getFlight);\r\n const parsedLegs = Object.values(JSON.parse(legs));\r\n if (dragIndex === parsedLegs.length - 1){\r\n message.warn(\"The last flight leg cannot be reordered\")\r\n return null\r\n }\r\n if (hoverIndex === parsedLegs.length -1){\r\n message.warn(\"The last flight leg must be a return to the flight departure location\")\r\n return null\r\n }\r\n \r\n const destinations = getDestinationsFromLegs(parsedLegs);\r\n\r\n flManager.moveDestination(destinations[dragIndex]._id, destinations[hoverIndex]._id);\r\n\r\n // const startSlice = dragIndex < hoverIndex ? dragIndex : hoverIndex;\r\n // const endSlice = dragIndex > hoverIndex ? dragIndex : hoverIndex;\r\n // const reorderedDestinations = [...destinations.slice(0, startSlice), destinations[endSlice], ...destinations.slice(startSlice + 1, endSlice), destinations[startSlice], ...destinations.slice(endSlice + 1)]\r\n // var newAllList = [];\r\n \r\n // const filteredDestinations = reorderedDestinations.filter((loc, idx, arr) => {\r\n // if(idx !== arr.length -1){\r\n // if(arr[idx+1]._id === loc._id){\r\n // return false;\r\n // }\r\n // }\r\n // return loc; \r\n // });\r\n \r\n // filteredDestinations.forEach(location => {\r\n // const sortPaxByOrder = (a, b) => {\r\n // return a.scheduledOrder - b.scheduledOrder\r\n // }\r\n // var newList = [];\r\n // if(paxIDList && paxIDList.length > 0){\r\n // newList = newList.concat(paxIDList.filter(pax => pax.destinationID._id === location._id));\r\n // }\r\n // if(cgoIDList && cgoIDList.length > 0){\r\n // newList = newList.concat(cgoIDList.filter(cgo => cgo.destinationID._id === location._id));\r\n // }\r\n // const outbound = newList.filter(pax => pax.transitType === 'OUTBOUND').sort(sortPaxByOrder);\r\n // const transfer = newList.filter(pax => pax.transitType === 'TRANSFER').sort(sortPaxByOrder);\r\n // const inbound = newList.filter(pax => pax.transitType === 'INBOUND').sort(sortPaxByOrder);\r\n // newAllList = newAllList.concat(outbound);\r\n // newAllList = newAllList.concat(transfer);\r\n // newAllList = newAllList.concat(inbound);\r\n // })\r\n\r\n // newAllList = Array.from(new Set(newAllList));\r\n // const newPaxList = newAllList.filter(pax => pax.classType === 'flytsuite.paxnode' );\r\n // const newCgoList = newAllList.filter(cgo => cgo.classType === 'flytsuite.cgonode' );\r\n // const newLegs = paxListToFlightLegs(departureID, newPaxList, newCgoList, filteredDestinations);\r\n const newLegs = flManager.buildFlightLegs();\r\n\r\n return newLegs;\r\n }\r\n\r\n const handleRemoveFromLegSelectedEntities = async () => {\r\n if (!checkEditable()) return\r\n let legs: FlightLeg[] = flightData.legsArray;\r\n const paxIDList = flightData.paxIDList;\r\n const cgoIDList = flightData.cgoIDList;\r\n\r\n // Remove selected pax/cgo nodes from the selected legs ----------------------------------------------------\r\n selectedLegs.forEach(order => {\r\n let leg = legs[order];\r\n const newPaxList = leg.paxIDs.filter(pax => !selectedEntities.pax.includes(pax._id));\r\n const newCgoList = leg.cgoIDs.filter(cgo => !selectedEntities.cgo.includes(cgo._id));\r\n legs[order] = paxOnFlightLeg(leg, newPaxList, newCgoList);\r\n })\r\n // ---------------------------------------------------------------------------------------------------------\r\n\r\n // Traverse leg list and collect set of pax and cgo IDs ----------------------------------------------------\r\n const discoveredEntities = new Set();\r\n\r\n for (let leg of legs) {\r\n leg.paxIDs.forEach((id) => discoveredEntities.add(id));\r\n leg.cgoIDs.forEach((id) => discoveredEntities.add(id));\r\n }\r\n // ---------------------------------------------------------------------------------------------------------\r\n\r\n // Remove pax/cgo in paxIDList and cgoIDList if they are not in discoveredEntities -------------------------\r\n function shouldIncludeEntity(entity) {\r\n return discoveredEntities.has(entity._id);\r\n }\r\n const newPaxList = paxIDList.filter(shouldIncludeEntity);\r\n const newCgoList = cgoIDList.filter(shouldIncludeEntity);\r\n // ---------------------------------------------------------------------------------------------------------\r\n\r\n setRemovingEntities(true);\r\n return handleFlightLegsChange(legs, newPaxList, newCgoList, true)\r\n .then(() => {\r\n setRemovingEntities(false);\r\n setSelectedEntities({ pax: [], cgo: [] });\r\n message.success('Successfully removed PAX/CGO from flight.')\r\n })\r\n .catch((err) => {\r\n setRemovingEntities(false);\r\n message.error('Failed to remove PAX/CGO from flight.', 2).then(() => {\r\n message.error(err.message, 5);\r\n }, null)\r\n })\r\n }\r\n\r\n const handleRemoveSelectedEntities = async () => {\r\n if (!checkEditable()) return\r\n // let legs: FlightLeg[] = flightData.legsArray;\r\n // let newEntities = getEntitiesFromFlightLegs(legs);\r\n // newEntities = newEntities.map((e) => {\r\n // return {\r\n // ...e,\r\n // departure: e.departureID,\r\n // destination: e.destinationID\r\n // }\r\n // })\r\n // let combinedSelectedEntities: (string | number)[] = [...selectedEntities.pax, ...selectedEntities.cgo];\r\n // newEntities = newEntities.filter((e) => {\r\n // if (!e) return false;\r\n // return !combinedSelectedEntities.includes(e._id);\r\n // })\r\n // const departureID = getFlightDeparture(data.getFlight);\r\n // const newPaxList = newEntities.filter(pax => pax.classType === 'flytsuite.paxnode' );\r\n // const newCgoList = newEntities.filter(cgo => cgo.classType === 'flytsuite.cgonode' );\r\n // if(selectedLegs.length > 0) {\r\n // let newLegs: any = []\r\n // legs.forEach(leg => {\r\n // newLegs.push(paxOnFlightLeg(leg, leg.paxIDs.filter(pax => newPaxList.map(p => p._id).includes(pax._id)), leg.cgoIDs.filter(cgo => newCgoList.map(c => c._id).includes(cgo))))\r\n // })\r\n // legs = newLegs;\r\n // }else {\r\n // legs = paxListToFlightLegs(departureID, newPaxList, newCgoList);\r\n // }\r\n\r\n let flManager = getFlightLegManagerFromFlightQuery(flightData);\r\n selectedEntities.pax.forEach((id) => flManager.removePassenger(id));\r\n selectedEntities.cgo.forEach((id) => flManager.removeCgo(id));\r\n\r\n let legs = flManager.buildFlightLegs();\r\n\r\n setRemovingEntities(true);\r\n return handleFlightLegsChange(\r\n legs,\r\n flManager.getPaxIDList().map((id) => paxIDMap.get(id)),\r\n flManager.getCgoIDList().map((id) => cgoIDMap.get(id)),\r\n true\r\n )\r\n .then(() => {\r\n setRemovingEntities(false);\r\n setSelectedEntities({ pax: [], cgo: [] });\r\n message.success('Successfully removed PAX/CGO from flight.')\r\n })\r\n .catch((err) => {\r\n setRemovingEntities(false);\r\n message.error('Failed to remove PAX/CGO from flight.', 2).then(() => {\r\n message.error(err.message, 5);\r\n }, null)\r\n })\r\n }\r\n\r\n function renderHeader(){\r\n return ,\r\n ,\r\n \r\n ]}\r\n />\r\n }\r\n\r\n let layoutProps: LayoutProps = {\r\n style: { ...(props.style || {}), overflow: 'hidden' }\r\n }\r\n\r\n if (!flightData && loading){\r\n return \r\n {renderHeader()}\r\n \r\n
\r\n } />\r\n
\r\n
\r\n
\r\n }\r\n let legsArray: FlightLeg[] = [];\r\n if (flightData?.legs){\r\n let parsedLegs = JSON.parse(flightData.legs);\r\n parsedLegs = Array.from(Object.values(parsedLegs).values());\r\n legsArray = parsedLegs;\r\n }\r\n legsArray = legsArray.map((leg: FlightLeg) => {\r\n let paxIDs = (leg && leg.paxIDs) || [];\r\n let cgoIDs = (leg && leg.cgoIDs) || [];\r\n function locIDToObj(id: any){\r\n let obj = flightData.paxIDList.find(pax => pax._id === id);\r\n if (!obj){\r\n obj = flightData.cgoIDList.find(cgo => cgo._id === id);\r\n }\r\n return {\r\n ...obj,\r\n departure: obj.departureID,\r\n destination: obj.destinationID\r\n }\r\n }\r\n paxIDs = paxIDs.map(locIDToObj);\r\n cgoIDs = cgoIDs.map(locIDToObj);\r\n return {\r\n ...leg,\r\n paxIDs,\r\n cgoIDs\r\n }\r\n })\r\n const handleAssignEntities = async () => {\r\n if (!checkEditable()) return\r\n setAssigning(true);\r\n try{\r\n let entities: any = [];\r\n let paxList: any[] = [];\r\n let cgoList: any[] = [];\r\n \r\n // legsArray.forEach((leg) => {\r\n // if (Array.isArray(leg && leg.paxIDs) && leg.paxIDs.length){\r\n // entities.push(...leg.paxIDs);\r\n // }\r\n // if (Array.isArray(leg && leg.cgoIDs) && leg.cgoIDs.length){\r\n // entities.push(...leg.cgoIDs);\r\n // }\r\n // })\r\n\r\n if (searchSelections.pax.length){\r\n var { data: { resolve_entity_ids: pax } } = await props.client.query({\r\n variables: {\r\n ids: searchSelections.pax\r\n },\r\n query: gql`\r\n query ResolvePax($ids: [ID!]!){\r\n resolve_entity_ids(ids: $ids, typename: \"PaxNode\"){\r\n ... on PaxNode {\r\n _id\r\n lastName\r\n firstName\r\n classType\r\n chargeCode\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n paxWeight\r\n bagWeight\r\n bagCount\r\n transitType\r\n }\r\n }\r\n }\r\n `\r\n })\r\n paxList.push(...pax);\r\n }\r\n if (searchSelections.cgo.length){\r\n var { data: { resolve_entity_ids: cgo } } = await props.client.query({\r\n variables: {\r\n ids: searchSelections.cgo\r\n },\r\n query: gql`\r\n query ResolvePax($ids: [ID!]!){\r\n resolve_entity_ids(ids: $ids, typename: \"CargoNode\"){\r\n ... on CargoNode {\r\n _id\r\n name\r\n classType\r\n approvedBy\r\n chargeCode\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n transitType\r\n weight\r\n deliveredBy\r\n attentionTo\r\n approvedBy\r\n }\r\n }\r\n }\r\n `\r\n })\r\n cgoList.push(...cgo);\r\n }\r\n // entities = entities.map(e => {\r\n // return {\r\n // ...e,\r\n // departure: e.departureID,\r\n // destination: e.destinationID\r\n // }\r\n // })\r\n // entities = uniqBy(entities, (item: any) => item && item._id);\r\n\r\n const departureID = getFlightDeparture(data.getFlight);\r\n let legs = null;\r\n\r\n let newPaxList = [...flightData.paxIDList, ...paxList];\r\n let newCgoList = [...flightData.cgoIDList, ...cgoList];\r\n\r\n let paxIDMap = new Map();\r\n let cgoIDMap = new Map();\r\n\r\n newPaxList.forEach(obj => paxIDMap.set(obj._id, obj));\r\n newCgoList.forEach(obj => cgoIDMap.set(obj._id, obj));\r\n \r\n if(selectedLegs.length > 0 ){\r\n const paxSearch = paxList.filter(pax => searchSelections.pax.includes(pax._id))\r\n const cgoSearch = cgoList.filter(cgo => searchSelections.cgo.includes(cgo._id))\r\n const resultLegs = legsArray;\r\n selectedLegs.forEach(idx => {\r\n var leg = resultLegs[Number.parseInt(idx)]\r\n var pax = paxSearch.concat(leg.paxIDs).filter((v, i, a) => a.map(e => e._id).indexOf(v._id) === i) //Filter out dupes\r\n var cgo = cgoSearch.concat(leg.cgoIDs).filter((v, i, a) => a.map(e => e._id).indexOf(v._id) === i) //Filter out dupes\r\n resultLegs[idx] = paxOnFlightLeg(leg, pax, cgo)\r\n })\r\n legs = resultLegs;\r\n }else {\r\n let flManager = getFlightLegManagerFromFlightQuery(flightData, buildLocNameMapFromPaxCgoLists(paxList, cgoList));\r\n paxList.forEach((pax) => flManager.addPassenger(graphqlPaxToFlightManPax(pax)));\r\n cgoList.forEach((cgo) => flManager.addCgo(graphqlCgoToFlightManCgo(cgo)));\r\n newPaxList = flManager.getPaxIDList().map(id => paxIDMap.get(id));\r\n newCgoList = flManager.getCgoIDList().map(id => cgoIDMap.get(id));\r\n legs = flManager.buildFlightLegs();\r\n }\r\n\r\n handleFlightLegsChange(legs, newPaxList, newCgoList, false)\r\n .then(() => {\r\n setAssignerOpen(false);\r\n setAssigning(false);\r\n setSearchSelections(initialSelectState);\r\n setSearchState(initialSearchState);\r\n })\r\n .catch(() => {\r\n setAssigning(false);\r\n });\r\n }\r\n catch(err){\r\n console.error(err);\r\n message.error('Failed to assign PAX/CGO', 2)\r\n .then(() => message.error(err.message, 5), () => null);\r\n setAssigning(false);\r\n }\r\n }\r\n function renderContent(){\r\n\r\n let flManager = getFlightLegManagerFromFlightQuery(flightData);\r\n\r\n return <>\r\n {error ? (\r\n \r\n ) : null}\r\n \r\n {\r\n message.success('Flight saved succsessfuly!');\r\n setEditingForm(false);\r\n if (data.setFlight && data.setFlight._id !== flightData._id && props.onIDChange){\r\n props.onIDChange(data.setFlight._id, flightData._id);\r\n }\r\n }}\r\n >\r\n {(saveForm: any, { loading: saving }) => {\r\n const handleFormSave = (fields: any, mutation: any, flightData: any, tpID: string, customerID: string) => {\r\n if (!checkEditable()) return\r\n if (!fields || !flightData || !mutation) return;\r\n const variables = {\r\n payload: {\r\n _id: props.flightId,\r\n desig: safeGet(['desig', 'value'], formFieldsWithValues),\r\n aircraftID: safeGet(['aircraft', 'value', 'key'], formFieldsWithValues),\r\n contractID: safeGet(['contract', 'value', 'key'], formFieldsWithValues),\r\n pilotID: safeGet(['pilot', 'value', 'key'], formFieldsWithValues),\r\n copilotID: safeGet(['copilot', 'value', 'key'], formFieldsWithValues),\r\n tpID,\r\n customerID,\r\n legs: flightData.legs\r\n },\r\n orgID: props.orgData.getActiveOrgID()\r\n }\r\n saveForm({ variables })\r\n }\r\n return handleEditingForm(editing, formFieldsWithValues)}\r\n onChange={(changedFields) => setFormFields({ ...formFields, ...changedFields })}\r\n editing={editingForm}\r\n onSave={props.orgData.customer && props.orgData.transporter && ((fields) => handleFormSave(fields, saveForm, flightData, props.orgData.transporter._id, props.orgData.customer._id))}\r\n saving={saving}\r\n disabled={!editable}\r\n />\r\n }}\r\n \r\n \r\n \r\n {\r\n setTabState(tab)\r\n if(tab === 'auto'){\r\n setSelectedLegs([])\r\n }\r\n }}>\r\n \r\n \r\n flManager.isLocationRedundant(leg.destinationID) : null}\r\n onMoveRow={(di, hi) => {\r\n try {\r\n let newLegs = onLegsReorder(di, hi);\r\n if (newLegs){\r\n handleFlightLegsChange(newLegs, flightData.paxIDList, flightData.cgoIDList, true);\r\n }\r\n }\r\n catch(err){\r\n console.error(err);\r\n if (err.name === 'ReorderError'){\r\n message.warning(err.message);\r\n }\r\n else\r\n {\r\n message.error('An error occurred while reordering legs', 2, () => {\r\n message.error(err.message, 5);\r\n });\r\n }\r\n }\r\n }}\r\n onRow={(_, index) => {\r\n return {\r\n onClick: () => setSelectedLeg(String(index)),\r\n style: { cursor: String(index) !== selectedLeg ? 'pointer' : 'default' }\r\n }\r\n }}\r\n rowSelection={{\r\n onChange: (keys: string[]) => setSelectedLeg(keys[0]),\r\n selectedRowKeys: [ selectedLeg ],\r\n type: 'radio'\r\n }}\r\n />\r\n \r\n \r\n {legsArray[Number(selectedLeg)] ? (\r\n \r\n {title}\r\n {\r\n flManager.isLocationRedundant(flightData?.legs ? JSON.parse(flightData.legs)[selectedLeg].destinationID : undefined)\r\n && editable\r\n ? (\r\n \r\n Modal.confirm({\r\n title: 'Are you sure you want to remove this redundant leg?',\r\n onOk: () => removeRedundantDestination(JSON.parse(flightData.legs)[selectedLeg].destinationID),\r\n okButtonProps: {\r\n children: 'Remove',\r\n type: 'danger'\r\n }\r\n })}\r\n >Remove Redundant Leg\r\n \r\n ) : null}\r\n }\r\n cardProps={{\r\n extra: <>\r\n {selectedEntities.pax.length > 0 ? (\r\n {selectedEntities.pax.length} PAX\r\n ) : null}\r\n {selectedEntities.pax.length > 0 && selectedEntities.cgo.length > 0 ? (\r\n \r\n ) : null}\r\n {selectedEntities.cgo.length > 0 ? (\r\n {selectedEntities.cgo.length} CGO\r\n ) : null}\r\n {selectedEntities.pax.length > 0 || selectedEntities.cgo.length > 0 ? (\r\n selected\r\n ) : null}\r\n {selectedEntities.pax.length > 0 || selectedEntities.cgo.length > 0 ? (\r\n <>\r\n \r\n \r\n \r\n ) : null}\r\n {selectedEntities.pax.length > 0 || selectedEntities.cgo.length > 0 ? (\r\n \r\n \r\n \r\n ) : null}\r\n \r\n }}\r\n rowSelection={!editable ? null : legTabKey === 'pax' ? {\r\n selectedRowKeys: selectedEntities.pax,\r\n onChange: (keys) => setSelectedEntities({ ...selectedEntities, pax: keys })\r\n } : {\r\n selectedRowKeys: selectedEntities.cgo,\r\n onChange: (keys) => setSelectedEntities({ ...selectedEntities, cgo: keys })\r\n }}\r\n />\r\n ) : null}\r\n \r\n \r\n \r\n \r\n {\r\n setAddLegOpen(true)\r\n setForceRefresh(true)\r\n }} type=\"primary\">Modify Legs : undefined\r\n }}\r\n legs={legsArray}\r\n onMoveRow={(di, hi) => {}}\r\n onRow={(_, index) => {\r\n return {\r\n onClick: () => {},\r\n style: { cursor: 'default' }\r\n }\r\n }}\r\n rowSelection={{\r\n onChange: (keys: string[]) => {\r\n setSelectedEntities({ pax: [], cgo: [] })\r\n setSelectedLegs(keys)\r\n },\r\n selectedRowKeys: selectedLegs\r\n }}\r\n />\r\n \r\n \r\n {legsArray.filter(leg => selectedLegs.includes(String(leg.order))) ? (\r\n selectedLegs.includes(String(leg.order)))}\r\n onLegTabChange={setLegTabKey}\r\n legTabKey={legTabKey}\r\n cardProps={{\r\n extra: <>\r\n {selectedEntities.pax.length > 0 ? (\r\n {selectedEntities.pax.length} PAX\r\n ) : null}\r\n {selectedEntities.pax.length > 0 && selectedEntities.cgo.length > 0 ? (\r\n \r\n ) : null}\r\n {selectedEntities.cgo.length > 0 ? (\r\n {selectedEntities.cgo.length} CGO\r\n ) : null}\r\n {selectedEntities.pax.length > 0 || selectedEntities.cgo.length > 0 ? (\r\n selected\r\n ) : null}\r\n {selectedEntities.pax.length > 0 || selectedEntities.cgo.length > 0 ? (\r\n <>\r\n \r\n \r\n \r\n ) : null}\r\n {selectedEntities.pax.length > 0 || selectedEntities.cgo.length > 0 ? (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ) : null}\r\n \r\n }}\r\n rowSelection={!editable ? null : legTabKey === 'pax' ? {\r\n selectedRowKeys: selectedEntities.pax,\r\n onChange: (keys) => setSelectedEntities({ ...selectedEntities, pax: keys })\r\n } : {\r\n selectedRowKeys: selectedEntities.cgo,\r\n onChange: (keys) => setSelectedEntities({ ...selectedEntities, cgo: keys })\r\n }}\r\n />\r\n ) : null}\r\n \r\n setAddLegOpen(false)}\r\n width=\"65%\"\r\n bodyStyle={{ display: 'flex', flexDirection: 'column' }}\r\n style={{ display: 'flex', flexDirection: 'column' }}\r\n className=\"ant-drawer-flex ant-drawer-body-no-padding\"\r\n >\r\n setForceRefresh(fr)}\r\n onSave={(ss) => {\r\n console.log(ss)\r\n handleFlightLegsChange(ss, flightData.paxIDList, flightData.cgoIDList, true)\r\n setAddLegOpen(false)\r\n }}\r\n resultLegs={legsArray}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n\r\n let extraElements = [\r\n \r\n ,\r\n \r\n ];\r\n\r\n if (editable) {\r\n extraElements.unshift(\r\n {\r\n handleFlightLegsChange(\r\n flightData.legsArray,\r\n flightData.paxIDList,\r\n flightData.cgoIDList,\r\n true,\r\n \"BLESSED\"\r\n )\r\n }}\r\n disabled={actionsDisabled}\r\n >Bless Flight\r\n )\r\n }\r\n\r\n if (userGroups.includes('flytsuite.flight.lockandunlock') && flightData) {\r\n let btnText = '';\r\n let btnIcon = '';\r\n\r\n if (flightData.state === 'LOCKED' && !setLockedStateResult.loading) {\r\n btnText = 'Unlock';\r\n btnIcon = 'unlock';\r\n }\r\n if (flightData.state === 'LOCKED' && setLockedStateResult.loading) {\r\n btnText = 'Unlocking...';\r\n btnIcon = 'unlock';\r\n }\r\n else if (flightData.state === 'ACTIVE' && !setLockedStateResult.loading) {\r\n btnText = 'Lock';\r\n btnIcon = 'lock';\r\n }\r\n else if (flightData.state === 'ACTIVE' && setLockedStateResult.loading) {\r\n btnText = 'Locking...';\r\n btnIcon = 'lock';\r\n }\r\n\r\n if (btnText) {\r\n extraElements.unshift(\r\n \r\n )\r\n extraElements.unshift(\r\n \r\n {btnText}\r\n \r\n )\r\n }\r\n }\r\n\r\n if (editable) {\r\n extraElements.push(\r\n {\r\n setAssignerOpen(true)\r\n setForceRefresh(true)\r\n }} type=\"primary\">Assign PAX/CGO\r\n )\r\n }\r\n\r\n return \r\n \r\n \r\n {renderContent()}\r\n \r\n setAssignerOpen(false)}\r\n width=\"65%\"\r\n bodyStyle={{ display: 'flex', flexDirection: 'column' }}\r\n style={{ display: 'flex', flexDirection: 'column' }}\r\n className=\"ant-drawer-flex ant-drawer-body-no-padding\"\r\n >\r\n setForceRefresh(fr)}\r\n style={{ flex: 1, minHeight: 0 }}\r\n paxSearchOptions={{\r\n filter: { onlyShowLive: true }\r\n }}\r\n cgoSearchOptions={{\r\n filter: { onlyShowLive: true, groundPickup: false }\r\n }}\r\n onEntitySelect={(ss) => setSearchSelections(ss)}\r\n selectedEntities={searchSelections}\r\n searchState={searchState}\r\n onSearchStateChange={(ss) => setSearchState(ss)}\r\n\r\n // If uncommented, was causing the bug in here: https://dataflyt.atlassian.net/browse/MCR-1342\r\n // currentCarrier={tabState === 'manual' ? flightData._id: null}\r\n\r\n tabsProps={{\r\n tabBarExtraContent:
\r\n {searchSelections.pax.length > 0 ? (\r\n {searchSelections.pax.length} PAX\r\n ) : null}\r\n {searchSelections.pax.length > 0 && searchSelections.cgo.length > 0 ? (\r\n \r\n ) : null}\r\n {searchSelections.cgo.length > 0 ? (\r\n {searchSelections.cgo.length} CGO\r\n ) : null}\r\n {searchSelections.pax.length > 0 || searchSelections.cgo.length > 0 ? (\r\n selected\r\n ) : null}\r\n Assign To Flight\r\n
\r\n }}\r\n />\r\n \r\n
\r\n }}\r\n \r\n}\r\n\r\nconst LiveFlightEditor = withApollo( withOrgData(LiveFlightEditorInternal) )\r\nLiveFlightEditor.displayName = 'LiveFlightEditor';\r\n\r\nexport default LiveFlightEditor","\r\nexport function isEditable(c: any){\r\n let state = c && c.state;\r\n let liveEditedState = c && c.liveEditedState;\r\n if (state === 'LOCKED' || state === 'DEPARTED' || state === 'OVERNIGHT' || liveEditedState === 'BLESSED'){\r\n return false\r\n }\r\n return true\r\n}","import { MultiSelectReturn } from \"../../../hooks/useMultiSelect\";\r\nimport { ColumnProps } from \"antd/lib/table\";\r\nimport { Badge, Checkbox, Menu, Tooltip } from \"antd\";\r\nimport React from \"react\";\r\n\r\ntype TEMP_TYPE_Pax = any;\r\ntype TEMP_TYPE_Cgo = any;\r\ntype TEMP_TYPE_Entity = TEMP_TYPE_Pax | TEMP_TYPE_Cgo\r\n\r\nexport function createLegListSelectColumn(multiSelect: NonNullable>, legEntities: NonNullable){\r\n\r\n // Contains ONLY the selectedEntities for this leg\r\n const selectedEntities = multiSelect.selectedItems\r\n .filter(e => Boolean(legEntities.find(ce => e._id === ce._id )));\r\n\r\n // Contains everything except the entities in this leg\r\n const selectedItemsDifference = multiSelect.selectedItems\r\n .filter(e => !legEntities.find(se => e._id === se._id))\r\n\r\n // Contains everything plus the entities from this leg\r\n const selectedItemsAddAll = [\r\n ...selectedItemsDifference,\r\n ...legEntities\r\n ]\r\n\r\n // True if there are entities that could be added to selectedItems\r\n const hasEntitiesToAdd = selectedEntities.length + selectedItemsDifference.length < selectedItemsAddAll.length;\r\n\r\n const toggleAll = () => {\r\n if (hasEntitiesToAdd){\r\n multiSelect.setSelectedItems(selectedItemsAddAll);\r\n }\r\n else{\r\n multiSelect.setSelectedItems(selectedItemsDifference);\r\n }\r\n }\r\n\r\n const column: ColumnProps = {\r\n title: 0 && selectedEntities.length < legEntities.length}\r\n onChange={toggleAll}\r\n />,\r\n key: 'selection',\r\n fixed: 'left',\r\n width: 50,\r\n render: (record: TEMP_TYPE_Entity) => multiSelect.toggleSelection(record)} />\r\n }\r\n\r\n return column;\r\n}\r\n\r\nexport function selectByScheduledGroup(\r\n multiSelect: NonNullable>,\r\n allEntities: TEMP_TYPE_Entity[],\r\n groupName: string\r\n){\r\n const entitiesToSelect = allEntities.filter(e => e.groupName === groupName);\r\n\r\n // Remove selected items already in the list\r\n const difference = multiSelect.selectedItems.filter(e => !entitiesToSelect.find(se => se._id === e._id));\r\n\r\n multiSelect.setSelectedItems([...difference, ...entitiesToSelect]);\r\n}\r\n\r\nexport function getGroupNames(entities: TEMP_TYPE_Entity[]){\r\n let groups = new Set();\r\n\r\n entities.forEach(e => groups.add(e.scheduledGroup));\r\n\r\n return Array.from(groups)\r\n .sort();\r\n}\r\n\r\nexport function renderGroupNameMenuItems(\r\n multiSelect: MultiSelectReturn,\r\n entities: TEMP_TYPE_Entity[]\r\n){\r\n let groupNames = getGroupNames(entities)\r\n\r\n function handleMenuClick(groupName: string){\r\n\r\n const selected = entities.filter(e => e.scheduledGroup === groupName);\r\n\r\n const difference = multiSelect.selectedItems\r\n .filter(e => !selected.find(se => se._id === e._id));\r\n\r\n multiSelect.setSelectedItems([...difference, ...selected]);\r\n }\r\n\r\n return groupNames.map((name) => (\r\n handleMenuClick(name)}>{name}\r\n ));\r\n}\r\n\r\nexport const SelectedEntityCounter: React.FC<{ legSelectedEntities: TEMP_TYPE_Entity[] }> = (props) => {\r\n if (!props.legSelectedEntities.length){\r\n return null;\r\n }\r\n return (\r\n \r\n \r\n \r\n )\r\n}","import {Alert, Button, Checkbox, Col, Icon, Popconfirm, Row, Table, Tabs, Typography} from 'antd';\r\nimport gql from 'graphql-tag';\r\nimport React from 'react';\r\nimport {Query, QueryResult} from 'react-apollo';\r\nimport LoadingContent from '../../LoadingContent';\r\n\r\nimport { library } from '@fortawesome/fontawesome-svg-core';\r\nimport { faBoxOpen } from '@fortawesome/free-solid-svg-icons';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport ETable from 'components/enchanced-antd-table';\r\nimport {FlightLeg} from \"schema\";\r\nimport {MultiSelectReturn} from \"../../../hooks/useMultiSelect\";\r\nimport {ColumnProps} from \"antd/lib/table\";\r\nimport {createLegListSelectColumn} from \"./FlightScheduleUtils\";\r\n\r\nlibrary.add(faBoxOpen);\r\n\r\nconst GET_PAXNODE_LIST = gql`\r\nquery GetPaxNodeSet($paxIds: [ID], $cgoIds: [ID]){\r\n getPaxNodeList(ids: $paxIds){\r\n _id\r\n createdBy\r\n createdTs\r\n modifiedTs\r\n modifiedBy\r\n lastName\r\n firstName\r\n employerID {\r\n _id\r\n name\r\n }\r\n paxWeight\r\n bagWeight\r\n bagCount\r\n scheduledGroup\r\n scheduledOrder\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n transitType\r\n classType\r\n }\r\n getCargoNodeList(ids: $cgoIds){\r\n _id\r\n createdBy\r\n createdTs\r\n modifiedTs\r\n modifiedBy\r\n name\r\n weight\r\n scheduledGroup\r\n scheduledOrder\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n transitType\r\n classType\r\n }\r\n}\r\n`\r\n\r\ntype TEMP_TYPE_Pax = any;\r\ntype TEMP_TYPE_Cgo = any;\r\ntype TEMP_TYPE_Entity = TEMP_TYPE_Pax | TEMP_TYPE_Cgo\r\n\r\ntype TEMP_TYPE_Pax_Cgo_Query = {\r\n getPaxNodeList: TEMP_TYPE_Cgo[],\r\n getCargoNodeList: TEMP_TYPE_Cgo[]\r\n}\r\n\r\nexport interface FlightManualScheduleLegPaxProps {\r\n selectedLegs: FlightLeg[],\r\n multiSelect?: MultiSelectReturn\r\n}\r\n\r\nconst FlightManualScheduleLegPax: React.FC = (props) => {\r\n\r\n const { multiSelect, selectedLegs } = props;\r\n\r\n function renderLegData(selectedLeg: FlightLeg) {\r\n\r\n if (!selectedLeg) {\r\n return

No leg data available

\r\n }\r\n\r\n const { departure, destination, paxIDs, cgoIDs } = selectedLeg;\r\n\r\n const columns: ColumnProps[] = [\r\n {\r\n title: 'Scheduled Group',\r\n key: 'scheduledGroup',\r\n dataIndex: 'scheduledGroup'\r\n },\r\n {\r\n title: 'Name',\r\n key: 'name',\r\n render: (_, record) => {\r\n let iconStyle = {\r\n marginRight: 6\r\n }\r\n if (record.__typename === 'CargoNode') {\r\n return {record.name}\r\n }\r\n return {record.lastName}, {record.firstName}\r\n }\r\n },\r\n {\r\n title: 'Employer',\r\n key: 'employer',\r\n render: (_, record) => {\r\n if (record.classType === 'flytsuite.paxnode') {\r\n return record.employerID ? record.employerID.name :\r\n Not Found\r\n } else if (record.classType === 'flytsuite.cgonode') {\r\n return N/A\r\n }\r\n return null\r\n }\r\n },\r\n {\r\n title: 'Weight',\r\n key: 'weight',\r\n render: (_, record) => {\r\n if (record.__typename === 'CargoNode') {\r\n return `${record.weight}`\r\n }\r\n return `${record.paxWeight}`\r\n }\r\n },\r\n {\r\n title: 'Bag Weight',\r\n key: 'bagWeight',\r\n dataIndex: 'bagWeight'\r\n },\r\n {\r\n title: 'Bag Count',\r\n key: 'bagCount',\r\n dataIndex: 'bagCount'\r\n },\r\n {\r\n title: 'Destination',\r\n key: 'destination',\r\n render: (_, record) => record.destinationID ? record.destinationID.name :\r\n Not Found\r\n },\r\n {\r\n title: 'Transit Type',\r\n key: 'transitType',\r\n dataIndex: 'transitType'\r\n },\r\n {\r\n title: 'Created By',\r\n key: 'createdBy',\r\n dataIndex: 'createdBy'\r\n }\r\n ]\r\n\r\n return (\r\n query={GET_PAXNODE_LIST} variables={{paxIds: paxIDs, cgoIds: cgoIDs}}>\r\n {\r\n ({ data, loading, error }) => {\r\n if (loading) return \r\n if (error) return \r\n\r\n let combinedList: TEMP_TYPE_Entity[] = []\r\n if(data.getPaxNodeList.length > 0){\r\n combinedList = combinedList.concat(data.getPaxNodeList)\r\n }\r\n if(data.getCargoNodeList.length > 0){\r\n combinedList = combinedList.concat(data.getCargoNodeList)\r\n }\r\n\r\n if (multiSelect){\r\n columns.unshift(createLegListSelectColumn(multiSelect, combinedList));\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n

\r\n {departure && destination ?\r\n `${departure} to ${destination}` :\r\n ''\r\n }\r\n

\r\n \r\n
\r\n \r\n record._id}\r\n onRowClick={(record: TEMP_TYPE_Entity) => {\r\n multiSelect?.toggleSelection(record);\r\n }}\r\n rowClassName={() => \"mc-cursor-pointer\"}\r\n size=\"small\"\r\n pagination={false}\r\n scroll={{\r\n x: 'max-content'\r\n }}\r\n />\r\n \r\n
\r\n )\r\n }\r\n }\r\n \r\n )\r\n }\r\n\r\n if (!selectedLegs || selectedLegs.length === 0){\r\n return

No legs selected

\r\n }\r\n return (\r\n \r\n {selectedLegs.map(leg => (\r\n \r\n {renderLegData(leg)}\r\n )\r\n )}\r\n \r\n )\r\n}\r\n\r\nexport default FlightManualScheduleLegPax;","import React from 'react';\r\nimport { Row, Col, Button, Table, Checkbox } from 'antd';\r\nimport { DraggableBodyRow } from '../../TableDragSorting';\r\nimport ETable from 'components/enchanced-antd-table';\r\nimport {SelectedEntityCounter} from \"components/flights/scheduling/FlightScheduleUtils\";\r\n\r\nclass FlightManualScheduleLegs extends React.Component {\r\n render(){\r\n const {\r\n title = 'Flight Legs',\r\n extra=[],\r\n data,\r\n selectedLegs = [0],\r\n onLegChange\r\n } = this.props;\r\n\r\n const columns = [{\r\n title: \"[]\",\r\n key: \"checkbox\",\r\n render: (_, __, index) => {\r\n e.stopPropagation();\r\n onLegChange?.(index);\r\n }}\r\n checked={selectedLegs.includes(index)}\r\n />\r\n },\r\n {\r\n title: '#',\r\n key: '#',\r\n render: (_, __, index) => index + 1\r\n },\r\n {\r\n title: 'Dep',\r\n key: 'dep',\r\n dataIndex: 'departure'\r\n },\r\n {\r\n title: 'Dest',\r\n key: 'dest',\r\n dataIndex: 'destination'\r\n },\r\n {\r\n title: 'Pax',\r\n key: 'pax',\r\n dataIndex: 'paxCount'\r\n },\r\n {\r\n title: 'Bags',\r\n key: 'bags',\r\n dataIndex: 'bagCount'\r\n },\r\n {\r\n title: 'CGO',\r\n key: 'cgo',\r\n dataIndex: 'cgoCount'\r\n },\r\n {\r\n title: 'Total Wt',\r\n key: 'totalWt',\r\n render: (_, record, index) => {\r\n // Selected entities for just this leg\r\n let legSelectedEntities = this.props.selectedEntities\r\n .filter(e => record.paxIDs?.includes(e._id) || record.cgoIDs?.includes(e._id));\r\n\r\n return <>\r\n \r\n {Number(record.paxWeight) + Number(record.bagWeight) + Number(record.cgoWeight)}\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

{title}

\r\n \r\n {Array.isArray(extra) ? (\r\n extra.map((node) => {node})\r\n ) : null}\r\n
\r\n {!data.length && (\r\n

Create new flight legs by adding scheduled passengers

\r\n )}\r\n {data.length ? (\r\n index} \r\n size=\"small\" \r\n pagination={false}\r\n components={!this.props.disabled ? {\r\n body: {\r\n row: DraggableBodyRow\r\n }\r\n } : undefined}\r\n onRow={(row, index) => {\r\n const rowProps = {\r\n moveRow: (dragIndex, hoverIndex) => {},\r\n onClick: () => onLegChange && onLegChange(index),\r\n index\r\n }\r\n if (selectedLegs.includes(index)){\r\n return {\r\n ...rowProps,\r\n className: 'selected'\r\n }\r\n }\r\n return {\r\n ...rowProps,\r\n style: {\r\n cursor: 'pointer'\r\n }\r\n }\r\n }}\r\n />\r\n ) : null\r\n }\r\n
\r\n )\r\n }\r\n}\r\n\r\nexport default FlightManualScheduleLegs","import LocationSelect2 from 'components/form/select/LocationSelect/LocationSelect2';\r\nimport React from 'react';\r\n\r\nclass LocationOnshoreSelect extends React.Component{\r\n render(){\r\n return (\r\n \r\n )\r\n }\r\n}\r\n\r\nexport default LocationOnshoreSelect","import React from 'react';\r\nimport { Row, Col, Divider, Form, Breadcrumb, Layout } from 'antd';\r\nimport { Link } from 'react-router-dom';\r\nimport { Route } from 'antd/lib/breadcrumb/Breadcrumb';\r\nimport './MainHeader.less';\r\n\r\nconst { Header } = Layout;\r\n\r\n// TODO: Remove the title property. Keeping it for now so things don't break.\r\nexport type RouteWithTitle = Omit & ({ title: string } | { breadcrumbName: string })\r\n\r\nexport interface MainHeaderProps {\r\n routes?: RouteWithTitle[],\r\n afterRoutes?: React.ReactNode,\r\n actions?: JSX.Element,\r\n formitems?: JSX.Element\r\n}\r\n\r\nclass MainHeader extends React.Component {\r\n renderBreadcrumb = (route: RouteWithTitle) => {\r\n const { routes } = this.props;\r\n const last = routes.indexOf(route) === routes.length - 1;\r\n const title = 'title' in route ? route.title : route.breadcrumbName;\r\n return last ? {title} : {title};\r\n }\r\n render(){\r\n const { routes, actions, formitems } = this.props;\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n {this.props.afterRoutes ? (\r\n \r\n {this.props.afterRoutes}\r\n \r\n ) : null}\r\n \r\n \r\n {\r\n formitems && (\r\n
\r\n {formitems}\r\n
\r\n )\r\n }\r\n {actions && formitems && }\r\n {actions}\r\n
\r\n \r\n
\r\n
\r\n )\r\n }\r\n}\r\n\r\nexport default MainHeader","\r\nimport gql from \"graphql-tag\";\r\nimport {LocationFragment} from \"./Location\";\r\n\r\nexport const ScheduledPaxNodeFragment = gql`\r\nfragment ScheduledPaxNodeFragment on PaxNode {\r\n _id\r\n _rev\r\n createdBy\r\n createdTs\r\n modifiedTs\r\n modifiedBy\r\n lastName\r\n firstName\r\n transitType\r\n scheduledOrder\r\n scheduledGroup\r\n classType\r\n paxWeight\r\n bagWeight\r\n bagCount\r\n chargeCode\r\n notesForPilot\r\n personID {\r\n _id\r\n dob\r\n nation\r\n extraBroadState\r\n credentials {\r\n _id\r\n key\r\n type\r\n expiration\r\n }\r\n contactInfo {\r\n phone {\r\n number\r\n type\r\n }\r\n }\r\n lastPaxWeight\r\n lastBagWeight\r\n lastBagCount\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n tpID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n departureID {\r\n ...LocationFragment\r\n }\r\n destinationID {\r\n ...LocationFragment\r\n }\r\n lastKnownController {\r\n ...LocationFragment\r\n }\r\n currentCarrierID {\r\n _id\r\n desig\r\n state\r\n }\r\n authorization {\r\n onWhiteList\r\n brdRestriction_Isn {\r\n status\r\n type\r\n notes\r\n reason\r\n }\r\n }\r\n isnCheckError {\r\n message\r\n }\r\n lastIsnResultWithHeader {\r\n isn_customer\r\n isn_ownerid\r\n success\r\n error_message\r\n quick_check_status\r\n reason\r\n qc_count\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n }\r\n}\r\n${LocationFragment}\r\n`\r\n\r\nexport const ScheduledCgoNodeFragment = gql`\r\nfragment ScheduledCgoNodeFragment on CargoNode {\r\n _id\r\n _rev\r\n createdBy\r\n createdTs\r\n modifiedTs\r\n modifiedBy\r\n name\r\n classType\r\n transitType\r\n scheduledOrder\r\n scheduledGroup\r\n weight\r\n hazmat\r\n hazmatUnCode\r\n departureID {\r\n ...LocationFragment\r\n }\r\n lastKnownController {\r\n ...LocationFragment\r\n }\r\n destinationID {\r\n ...LocationFragment\r\n }\r\n currentCarrierID {\r\n _id\r\n desig\r\n state\r\n }\r\n attentionTo\r\n initials\r\n notes\r\n notesForPilot\r\n customerID {\r\n _id\r\n name\r\n }\r\n tpID {\r\n _id\r\n name\r\n }\r\n}\r\n${LocationFragment}\r\n`\r\n\r\nexport const ScheduledFlightFragment = gql`\r\nfragment ScheduledFlightFragment on FlightNode {\r\n _id\r\n createdBy\r\n createdTs\r\n modifiedTs\r\n modifiedBy\r\n desig\r\n scheduledFlightDate\r\n callSign\r\n state\r\n lastKnownController {\r\n ...LocationFragment\r\n }\r\n paxIDList {\r\n ...ScheduledPaxNodeFragment\r\n }\r\n cgoIDList {\r\n ...ScheduledCgoNodeFragment\r\n }\r\n pilot {\r\n _id\r\n name {\r\n lastName\r\n firstName\r\n }\r\n }\r\n copilot {\r\n _id\r\n name {\r\n lastName\r\n firstName\r\n }\r\n }\r\n legs\r\n legsArray {\r\n departure\r\n destination\r\n departureID\r\n destinationID\r\n bagCount\r\n bagWeight\r\n cgoCount\r\n cgoWeight\r\n order\r\n paxWeight\r\n paxCount\r\n cgoIDs{\r\n ...ScheduledCgoNodeFragment\r\n }\r\n paxIDs {\r\n ...ScheduledPaxNodeFragment\r\n }\r\n }\r\n tpID {\r\n _id\r\n name\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n contract {\r\n _id\r\n name\r\n }\r\n aircraftID {\r\n _id\r\n tailNum\r\n }\r\n departureID {\r\n ...LocationFragment\r\n }\r\n}\r\n${ScheduledPaxNodeFragment}\r\n${ScheduledCgoNodeFragment}\r\n${LocationFragment}\r\n`\r\n\r\nexport const ScheduledPaxCgoGroupV2Fragment = gql`\r\nfragment ScheduledPaxCgoGroupV2Fragment on ScheduledPaxCgoGroupV2 {\r\n scheduledFlightDate\r\n scheduledGroup\r\n lastKnownController {\r\n _id\r\n name\r\n }\r\n paxOutbound\r\n paxTransfer\r\n paxInbound\r\n cgoOutbound\r\n cgoTransfer\r\n cgoInbound\r\n paxOutboundOnFlight\r\n paxTransferOnFlight\r\n paxInboundOnFlight\r\n cgoOutboundOnFlight\r\n cgoTransferOnFlight\r\n cgoInboundOnFlight\r\n legCount\r\n legs {\r\n departureID\r\n destinationID\r\n departureDoc {\r\n ...LocationFragment\r\n }\r\n destinationDoc {\r\n ...LocationFragment\r\n }\r\n scheduledOrder\r\n paxnodeIDs\r\n cgonodeIDs\r\n paxnodeDocs {\r\n ...ScheduledPaxNodeFragment\r\n }\r\n cgonodeDocs {\r\n ...ScheduledCgoNodeFragment\r\n }\r\n totalWeight\r\n totalPaxWeight\r\n totalCgoWeight\r\n totalBagWeight\r\n totalBagCount\r\n }\r\n}\r\n${ScheduledPaxNodeFragment}\r\n${ScheduledCgoNodeFragment}\r\n${LocationFragment}\r\n`\r\n\r\nexport const ResolveScheduledPaxNodeIdsQuery = gql`\r\nquery ResolveScheduledPaxNodeIds($ids: [ID!]!){\r\n resolve_entity_ids(ids: $ids, typename: \"PaxNode\"){\r\n ...ScheduledPaxNodeFragment\r\n }\r\n}\r\n${ScheduledPaxNodeFragment}\r\n`\r\n\r\nexport const ResolveScheduledCgoNodeIdsQuery = gql`\r\n query ResolveScheduledCgoNodeIds($ids: [ID!]!){\r\n resolve_entity_ids(ids: $ids, typename: \"CargoNode\"){\r\n ...ScheduledCgoNodeFragment\r\n }\r\n }\r\n ${ScheduledCgoNodeFragment}\r\n`\r\n\r\nexport const Phase1StepQuery = gql`\r\n query Phase1StepQuery {\r\n getPhase1Step @client\r\n }\r\n`\r\n\r\nexport const ScheduleHistoryListItemFragment = gql`\r\n fragment ScheduleHistoryListItemFragment on ScheduleHistoryListItem {\r\n groupName\r\n date\r\n createdBy\r\n lastKnownController\r\n paxInboundCount\r\n paxOutboundCount\r\n paxTransferCount\r\n paxCount\r\n }\r\n`\r\n\r\nexport const ScheduleHistoryDetailFragment = gql`\r\n fragment ScheduleHistoryDetailFragment on ScheduleHistoryDetail {\r\n groupName\r\n date\r\n createdBy\r\n lastKnownController\r\n paxInboundCount\r\n paxOutboundCount\r\n paxTransferCount\r\n paxList {\r\n ...ScheduledPaxNodeFragment\r\n }\r\n }\r\n ${ScheduledPaxNodeFragment}\r\n`\r\n\r\nexport const QueryGetPhase1ListDateRange = gql`\r\n query GetPhase1ListDateRange {\r\n getPhase1ListDateRange @client\r\n }\r\n`","import React from 'react';\r\nimport {Layout, Breadcrumb, Select, Dropdown, Menu} from 'antd';\r\nimport { basePath } from '../../flights/scheduling/main';\r\nimport { Link, withRouter } from 'react-router-dom';\r\nimport { withUserGroups } from '../../userGroup';\r\nimport './SchedulingStepsHeader.less';\r\nimport {isTruey} from \"../../../common/util-ts\";\r\nimport {graphql} from \"react-apollo\";\r\nimport {gql} from \"apollo-boost\";\r\nimport compose from 'lodash.flowright';\r\nimport {Phase1StepQuery} from \"../../../Queries/Scheduling\";\r\nimport withOrgData from \"../../WithOrgData\";\r\n\r\nconst { Header } = Layout;\r\n\r\nconst breadcrumbItems = [\r\n {\r\n select: [\r\n {\r\n text: 'Passenger Sets',\r\n to: '/app/scheduling/sets',\r\n userGroup: ['flytsuite.schedule.sets'],\r\n requireV1Scheduler: true,\r\n isSelected: (props) => {\r\n return props.data.getPhase1Step === 'sets';\r\n }\r\n },\r\n {\r\n text: 'History',\r\n to: '/app/scheduling/history',\r\n requireV1Scheduler: false,\r\n isSelected: (props) => {\r\n return props.data.getPhase1Step === 'history';\r\n }\r\n }\r\n ]\r\n },\r\n {\r\n text: 'Scheduled Passengers and Cargo',\r\n to: '/app/scheduling/groups',\r\n userGroup: ['flytsuite.schedule.passenger', 'flytsuite.schedule.passenger.view']\r\n },\r\n {\r\n text: 'Scheduled Flights',\r\n to: '/app/scheduling/flight',\r\n userGroup: ['flytsuite.schedule.flight']\r\n }\r\n]\r\n\r\nclass SchedulingStepsHeader_Internal extends React.Component{\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.unlisten = React.createRef(null);\r\n }\r\n\r\n getPathName = () => {\r\n let pathname = this.props.location.pathname;\r\n if (pathname.startsWith('/app/scheduling/schedule')){\r\n // Keep highlight when on V2 scheduling page\r\n pathname = pathname.replace('/app/scheduling/schedule', '/app/scheduling/groups')\r\n }\r\n\r\n return pathname;\r\n }\r\n\r\n onRouteChanged = (location) => {\r\n if (location.pathname === '/app/scheduling/history'){\r\n this.props.setPhase1Step({\r\n variables: {\r\n step: 'history'\r\n }\r\n })\r\n }\r\n\r\n if (location.pathname === '/app/scheduling/sets'){\r\n this.props.setPhase1Step({\r\n variables: {\r\n step: 'sets'\r\n }\r\n })\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n this.unlisten.current = this.props.history.listen(this.onRouteChanged);\r\n }\r\n\r\n componentWillUnmount() {\r\n this.unlisten.current();\r\n }\r\n\r\n // componentDidUpdate() {\r\n //\r\n // const routeHistory = this.props.history;\r\n // const currentLocation = routeHistory[-1];\r\n // const lastLocation = routeHistory[-2];\r\n // const currPathName = currentLocation?.pathname;\r\n // const lastPathName = lastLocation?.pathname;\r\n //\r\n // if (lastPathName !== currPathName){\r\n // if (this.props.location.pathname === '/app/scheduling/history'){\r\n // this.props.setPhase1Step({\r\n // variables: {\r\n // step: 'history'\r\n // }\r\n // })\r\n // }\r\n //\r\n // if (this.props.location.pathname === '/app/scheduling/sets'){\r\n // this.props.setPhase1Step({\r\n // variables: {\r\n // step: 'sets'\r\n // }\r\n // })\r\n // }\r\n //\r\n // this.setState({ lastPathName: this.props.location.pathname })\r\n // }\r\n // }\r\n\r\n renderBreadcrumbs = () => (\r\n breadcrumbItems.map((item, index) => {\r\n let pathname = this.getPathName();\r\n\r\n const renderText = (config) => {\r\n var style = {}\r\n\r\n if (pathname.startsWith(config.to)){\r\n style = {\r\n color: '#1890ff'\r\n }\r\n }\r\n\r\n return {config.text}\r\n }\r\n\r\n const renderLink = (config) => {\r\n const text = renderText(config);\r\n\r\n if (text) return {text}\r\n return ;\r\n }\r\n\r\n /**\r\n * @type {React.ReactNode}\r\n */\r\n let link;\r\n\r\n if (item.select){\r\n\r\n const configs = item.select\r\n .filter((config) => (\r\n config.requireV1Scheduler ? (\r\n this.props.orgData.customer?.useV1Scheduler\r\n ) : true\r\n ))\r\n\r\n if (configs.length === 1){\r\n link = renderLink(configs[0]);\r\n }\r\n else {\r\n const menu = \r\n {configs.map((config) => (\r\n \r\n {renderLink(config)}\r\n \r\n ))}\r\n \r\n\r\n const selected = configs.find(\r\n (config) => config.isSelected ?\r\n config.isSelected(this.props) :\r\n pathname.startsWith(config.to)\r\n ) || configs[0];\r\n\r\n link = (\r\n \r\n {renderLink(selected)}\r\n \r\n )\r\n }\r\n }\r\n else\r\n {\r\n link = renderLink(item);\r\n }\r\n\r\n return (\r\n \r\n {link}\r\n \r\n )\r\n })\r\n )\r\n render(){\r\n return (\r\n
\r\n \">\r\n \r\n {/**/}Start\r\n \r\n {this.renderBreadcrumbs()}\r\n \r\n
\r\n )\r\n }\r\n}\r\n\r\nconst SET_PHASE1_STEP = gql`\r\nmutation SchedulingStepsHeaderSetPhase1Step($step: Phase1Step) {\r\n setPhase1Step(step: $step) @client\r\n}\r\n`\r\n\r\nconst SchedulingStepsHeader = compose(\r\n graphql(Phase1StepQuery, { options: { fetchPolicy: 'network-only' } }),\r\n graphql(SET_PHASE1_STEP, { name: 'setPhase1Step' })\r\n)(withRouter( withUserGroups( withOrgData( SchedulingStepsHeader_Internal ) )))\r\n\r\nSchedulingStepsHeader.displayName = 'SchedulingStepsHeader';\r\n\r\nexport default SchedulingStepsHeader","import React from 'react';\r\nimport SchedulingStepsHeader from '../SchedulingStepsHeader';\r\nimport { Layout } from 'antd';\r\nimport './MainLayout.less';\r\n\r\nconst MainLayout = ({ children }) => (\r\n \r\n \r\n {children} \r\n \r\n)\r\n\r\nexport default MainLayout","\r\nexport function validateNote(note: string){\r\n\r\n let result = note;\r\n\r\n // Limit number of spaces\r\n result = result.replace(/ +/g, ' ');\r\n\r\n return result;\r\n}","import {Dispatch, ReducerAction} from \"react\";\r\nimport {produce, WritableDraft} from \"immer\";\r\nimport {validateNote} from \"../validation\";\r\n\r\nexport const DEFAULT_STATE = {\r\n open: false,\r\n editMode: false,\r\n originalText: '',\r\n modifiedText: ''\r\n}\r\n\r\nexport type State = typeof DEFAULT_STATE;\r\n\r\nexport type Dispatcher = Dispatch>;\r\n\r\nexport type Action =\r\n{\r\n type: 'INIT_TEXT',\r\n text: string\r\n} |\r\n{\r\n type: 'SET_TEXT',\r\n text: string\r\n} |\r\n{\r\n type: 'RESET_TEXT'\r\n} |\r\n{\r\n type: 'MOUSE_TRIGGER',\r\n value: boolean\r\n} |\r\n{\r\n type: 'EDIT_MODE',\r\n value: boolean,\r\n close?: boolean\r\n}\r\n\r\nexport function Reducer(_state: Readonly, action: Action){\r\n return produce(_state, (state) => {\r\n\r\n const Text = {\r\n Reset(){\r\n state.modifiedText = state.originalText;\r\n }\r\n }\r\n\r\n switch (action.type){\r\n case 'INIT_TEXT':\r\n state.originalText = action.text ?? '';\r\n state.modifiedText = action.text ?? '';\r\n break;\r\n case 'RESET_TEXT':\r\n Text.Reset();\r\n break;\r\n case 'SET_TEXT':\r\n state.modifiedText = validateNote(action.text) ?? '';\r\n break;\r\n case 'MOUSE_TRIGGER':\r\n state.open = action.value;\r\n if (!action.value){\r\n // Reset text back to original if closed.\r\n Text.Reset();\r\n state.editMode = false;\r\n }\r\n break;\r\n case 'EDIT_MODE':\r\n state.editMode = action.value;\r\n if (action.close){\r\n state.open = false;\r\n Text.Reset();\r\n }\r\n break;\r\n }\r\n })\r\n}","import React, {useEffect, useReducer, useRef} from 'react';\r\nimport {Button, Col, Divider, Dropdown, Input, Row, Typography} from \"antd\";\r\nimport {DEFAULT_STATE, Dispatcher, Reducer, State} from \"./state\";\r\nimport './style.less';\r\nimport cn from 'classnames';\r\nimport {DropDownProps} from \"antd/lib/dropdown\";\r\nimport {ButtonProps} from \"antd/lib/button\";\r\nimport uuidv4 from 'uuid/v4';\r\nimport {ScheduleNode} from \"components/scheduling/types\";\r\nimport {InputProps, TextAreaProps} from \"antd/lib/input\";\r\n\r\n// TODO: Split this out into its own component. A pop-out text area would be useful in more places.\r\n\r\nexport interface NotesForPilotQuickEditProps {\r\n scheduleNodeData: ScheduleNode,\r\n previewProps?: ButtonProps,\r\n textAreaProps?: Omit,\r\n placeholderText?: string,\r\n readOnly?: boolean,\r\n disabled?: boolean,\r\n popupContainer?: HTMLElement,\r\n\r\n renderExtra?: (props: NotesForPilotQuickEditProps['overrideState']) => React.ReactNode[],\r\n\r\n renderAccept?: (options: { onConfirm: (...args: unknown[]) => void, buttonProps: ButtonProps }) => React.ReactNode,\r\n renderCancel?: (options: { onCancel: () => void, buttonProps: ButtonProps }) => React.ReactNode,\r\n\r\n onConfirm?: (newText: string, ...args: unknown[]) => void,\r\n\r\n // Allows the internal state to be overwritten with an external state\r\n overrideState?: {\r\n state: State,\r\n dispatch: Dispatcher\r\n }\r\n}\r\n\r\n/**\r\n * Displays an editable TextArea when the user hovers their mouse over tet displayed from the notesForPilot field.\r\n */\r\nexport const NotesForPilotQuickEdit: React.FC = (props) => {\r\n\r\n const ClassNames = new ClassNameBuilder(props);\r\n\r\n const notesForPilot = props.scheduleNodeData?.notesForPilot || '';\r\n\r\n const componentId = \"notes-for-pilot:\" + uuidv4();\r\n\r\n let [ state, dispatch ] = useReducer(Reducer, DEFAULT_STATE);\r\n\r\n if (props.overrideState){\r\n state = props.overrideState.state;\r\n dispatch = props.overrideState.dispatch;\r\n }\r\n\r\n const textAreaRef = useRef(null);\r\n\r\n function handleConfirm(){\r\n props?.onConfirm?.(state.modifiedText);\r\n dispatch({ type: 'EDIT_MODE', value: false, close: true });\r\n }\r\n\r\n function handleCancel(){\r\n dispatch({ type: 'EDIT_MODE', value: false, close: true });\r\n }\r\n\r\n let renderAccept: NotesForPilotQuickEditProps['renderAccept'] =\r\n ({ onConfirm, buttonProps }) => {\r\n return \r\n \r\n ) : (\r\n !props.readOnly ? Click to edit : null\r\n )}\r\n \r\n {footer}\r\n \r\n\r\n let triggers: DropDownProps['trigger'] = ['click'];\r\n\r\n if (!state.editMode){\r\n triggers.push('hover');\r\n }\r\n\r\n if (!notesForPilot && props.readOnly){\r\n triggers = [];\r\n }\r\n\r\n if (props.disabled){\r\n triggers = [];\r\n }\r\n\r\n let placeholderText = \"Click to add pilot notes\";\r\n\r\n if (props.placeholderText){\r\n placeholderText = props.placeholderText;\r\n }\r\n else if (props.readOnly){\r\n placeholderText = '—';\r\n }\r\n\r\n return <>\r\n {\r\n return props.popupContainer\r\n }}\r\n onVisibleChange={(visible) => {\r\n if (!props.disabled) {\r\n dispatch({ type: 'MOUSE_TRIGGER', value: visible });\r\n }\r\n }}\r\n align={{\r\n offset: [-12, -36]\r\n }}\r\n overlayStyle={{\r\n width: '400px'\r\n }}\r\n placement=\"bottomLeft\"\r\n mouseEnterDelay={0}\r\n >\r\n e.stopPropagation()}\r\n >\r\n {notesForPilot ? notesForPilot : {placeholderText}}\r\n \r\n \r\n \r\n}\r\n\r\n/**\r\n * Builds the classnames used for the NotesFroPilotRenderer component based on props.\r\n */\r\nclass ClassNameBuilder {\r\n\r\n private disabled = false;\r\n\r\n constructor(props: NotesForPilotQuickEditProps) {\r\n this.disabled = Boolean(props.readOnly);\r\n };\r\n\r\n private getDisabledSuffix(className: string){\r\n if (this.disabled)\r\n return className + ' ' + className + '-disabled';\r\n return className\r\n }\r\n\r\n Base = 'notes-for-pilot-quickedit';\r\n Wrapper = this.Base + '-wrapper';\r\n Preview = this.getDisabledSuffix(this.Base + '-preview');\r\n Body = this.Base + '-body';\r\n TextArea = this.Base + '-textarea';\r\n PreviewDisabled = this.Base + '-preview-disabled';\r\n}","import {ColumnProps} from \"antd/lib/table\";\r\nimport {FontAwesomeIcon} from \"@fortawesome/react-fontawesome\";\r\nimport {faBoxOpen} from \"@fortawesome/free-solid-svg-icons\";\r\nimport {Icon, Tooltip, Typography} from \"antd\";\r\nimport React from \"react\";\r\nimport {NotesForPilotQuickEdit} from \"./notes-for-pilot/quickedit/notes-for-pilot-quick-edit\";\r\nimport {FlightLeg} from \"../../../schema\";\r\n\r\ntype TEMP_TYPE_Pax = any;\r\ntype TEMP_TYPE_Cgo = any;\r\ntype TEMP_TYPE_Entity = TEMP_TYPE_Pax | TEMP_TYPE_Cgo\r\n\r\nexport function createScheduledEntityColumns(leg: FlightLeg=null, options?: { containerRef?: HTMLElement, reviewMode?: boolean }){\r\n\r\n const { containerRef, reviewMode } = options;\r\n\r\n const columns: ColumnProps[] = [\r\n {\r\n title: 'Scheduled Group',\r\n key: 'scheduledGroup',\r\n dataIndex: 'scheduledGroup'\r\n },\r\n {\r\n title: 'Name',\r\n key: 'name',\r\n render: (_, record: TEMP_TYPE_Entity) => {\r\n let iconStyle = {\r\n marginRight: 6\r\n }\r\n\r\n let icons = [];\r\n\r\n const name = record.__typename === 'CargoNode' ? 'CGO' : 'PAX';\r\n let paxDep = record.departureID?._id;\r\n let paxDest = record.destinationID?._id;\r\n // if (record.transitType === 'INBOUND'){\r\n // let tmp = paxDest;\r\n // paxDest = paxDep;\r\n // paxDep = tmp;\r\n // }\r\n\r\n if (leg && paxDep === leg.departureID){\r\n icons.push(\r\n \r\n )\r\n }\r\n\r\n if (leg && paxDest === leg.destinationID){\r\n icons.push(\r\n \r\n )\r\n }\r\n\r\n let text;\r\n\r\n if(record.__typename === 'CargoNode'){\r\n text = {record.name}\r\n }\r\n else {\r\n text = {record.lastName}, {record.firstName}\r\n }\r\n return <>\r\n {icons.map((el, index) => {el})}\r\n {text}\r\n \r\n }\r\n },\r\n {\r\n title: 'Employer',\r\n key: 'employer',\r\n render: (_, record: TEMP_TYPE_Entity) => {\r\n if (record.classType === 'flytsuite.paxnode'){\r\n return record.employerID ? record.employerID.name : Not Found\r\n }\r\n else if (record.classType === 'flytsuite.cgonode'){\r\n return N/A\r\n }\r\n return null\r\n }\r\n },\r\n {\r\n title: 'Controlling Heliport',\r\n key: 'lastKnownController',\r\n dataIndex: 'lastKnownController',\r\n render: (doc) => doc?.name\r\n },\r\n {\r\n title: 'Weight',\r\n key: 'weight',\r\n render: (_, record: TEMP_TYPE_Entity) => {\r\n if(record.__typename === 'CargoNode'){\r\n return `${record.weight}`\r\n }\r\n return `${record.paxWeight}`\r\n }\r\n },\r\n {\r\n title: 'Bag Weight',\r\n key: 'bagWeight',\r\n dataIndex: 'bagWeight'\r\n },\r\n {\r\n title: 'Bag Count',\r\n key: 'bagCount',\r\n dataIndex: 'bagCount'\r\n },\r\n {\r\n title: 'Departure',\r\n key: 'departure',\r\n render: (_, record: TEMP_TYPE_Entity) => record.departureID ? record.departureID.name : Not Found\r\n },\r\n {\r\n title: 'Destination',\r\n key: 'destination',\r\n render: (_, record: TEMP_TYPE_Entity) => record.destinationID ? record.destinationID.name : Not Found\r\n },\r\n {\r\n title: 'Transit Type',\r\n key: 'transitType',\r\n dataIndex: 'transitType'\r\n },\r\n {\r\n title: 'Pilot Notes',\r\n key: 'pilotNotes',\r\n render: (_, row: TEMP_TYPE_Entity) => {\r\n return \r\n }\r\n },\r\n {\r\n title: 'Created By',\r\n key: 'createdBy',\r\n dataIndex: 'createdBy'\r\n }\r\n ]\r\n\r\n return columns;\r\n}","import React, {useRef} from \"react\";\r\nimport {\r\n Button,\r\n Checkbox,\r\n Col, Dropdown,\r\n Icon, Menu,\r\n Modal, Popconfirm,\r\n Row,\r\n Tooltip,\r\n Typography,\r\n} from \"antd\";\r\nimport \"./FlightScheduleLegPax.less\";\r\n\r\nimport { library } from \"@fortawesome/fontawesome-svg-core\";\r\nimport { faBoxOpen } from \"@fortawesome/free-solid-svg-icons\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport ETable from \"components/enchanced-antd-table\";\r\nimport { MultiSelectReturn } from \"hooks/useMultiSelect\";\r\nimport { ColumnProps } from \"antd/lib/table\";\r\nimport {createScheduledEntityColumns} from \"./columns\";\r\nimport {createLegListSelectColumn, renderGroupNameMenuItems} from \"./FlightScheduleUtils\";\r\nimport {FlightLeg} from \"../../../schema\";\r\n\r\nlibrary.add(faBoxOpen);\r\n\r\ntype TEMP_TYPE_Flight = any;\r\ntype TEMP_TYPE_Pax = any;\r\ntype TEMP_TYPE_Cgo = any;\r\ntype TEMP_TYPE_Entity = TEMP_TYPE_Pax | TEMP_TYPE_Cgo\r\n\r\nexport interface FlightScheduleLegPaxProps {\r\n flight: TEMP_TYPE_Flight,\r\n selectedLegIndex: number,\r\n departureName: string;\r\n destinationName: string;\r\n multiSelect?: MultiSelectReturn,\r\n events: {\r\n onRemoveRedundantLeg?: () => void\r\n }\r\n}\r\n\r\nconst FlightScheduleLegPax: React.FC = (props) => {\r\n const {\r\n selectedLegIndex,\r\n flight,\r\n departureName,\r\n destinationName,\r\n multiSelect ,\r\n events\r\n } = props;\r\n\r\n const legs: FlightLeg[] = (flight.legs && Object.values(JSON.parse(flight.legs))) || []\r\n const selectedLeg = legs?.[selectedLegIndex];\r\n const containerRef = useRef(null);\r\n const allEntities = [...flight.paxIDList, ...flight.cgoIDList];\r\n\r\n const paxObjList: TEMP_TYPE_Pax[] = flight?.paxIDList?.filter(p => selectedLeg?.paxIDs?.includes(p._id));\r\n const cgoObjList: TEMP_TYPE_Cgo[] = flight?.cgoIDList?.filter(c => selectedLeg?.cgoIDs?.includes(c._id));\r\n\r\n if (!(paxObjList || cgoObjList)){\r\n return

No leg data available

\r\n }\r\n\r\n let paxSortedList = [...paxObjList];\r\n let cgoSortedList = [...cgoObjList];\r\n\r\n paxSortedList.sort((a, b) => String(a.lastName + ', ' + a.firstName).localeCompare(String(b.lastName + ', ' + b.firstName)))\r\n cgoSortedList.sort((a, b) => String(a.name).localeCompare(String(b)))\r\n\r\n let combinedList = []\r\n if(paxSortedList?.length > 0){\r\n combinedList = combinedList.concat(paxSortedList)\r\n }\r\n if(cgoSortedList?.length > 0){\r\n combinedList = combinedList.concat(cgoSortedList)\r\n }\r\n\r\n const columns = createScheduledEntityColumns(selectedLeg, { containerRef: containerRef.current });\r\n\r\n if (multiSelect){\r\n columns.unshift(createLegListSelectColumn(multiSelect, combinedList));\r\n }\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n

\r\n {departureName && destinationName ?\r\n `${departureName} to ${destinationName}` :\r\n ''\r\n }\r\n

\r\n \r\n {props.events?.onRemoveRedundantLeg ? (\r\n \r\n \r\n Modal.confirm({\r\n title: 'Are you sure you want to remove this redundant leg?',\r\n onOk: () => props.events?.onRemoveRedundantLeg(),\r\n okButtonProps: {\r\n children: 'Remove',\r\n type: 'danger'\r\n }\r\n })}\r\n >Remove Redundant Leg\r\n \r\n \r\n ) : null}\r\n
\r\n \r\n {\r\n multiSelect?.toggleSelection(record);\r\n }}\r\n rowClassName={() => \"mc-cursor-pointer\"}\r\n rowKey={(record: TEMP_TYPE_Entity) => record._id}\r\n size=\"small\"\r\n // scroll={{\r\n // x: 'max-content'\r\n // }}\r\n pagination={false}\r\n />\r\n \r\n
\r\n
\r\n )\r\n}\r\n\r\nexport default FlightScheduleLegPax","import React from 'react';\r\nimport {Row, Col, Button, Table, Icon, Typography, Tooltip, Checkbox, Badge} from 'antd';\r\nimport { DraggableBodyRow } from '../../TableDragSorting';\r\nimport ETable from 'components/enchanced-antd-table';\r\nimport {SelectedEntityCounter} from \"components/flights/scheduling/FlightScheduleUtils\";\r\n\r\nclass FlightScheduleLegs extends React.Component {\r\n render(){\r\n const columns = [\r\n {\r\n title: '#',\r\n key: '#',\r\n render: (_, __, index) => index + 1\r\n },\r\n {\r\n title: 'Dep',\r\n key: 'dep',\r\n dataIndex: 'departure'\r\n },\r\n {\r\n title: 'Dest',\r\n key: 'dest',\r\n dataIndex: 'destination'\r\n },\r\n {\r\n title: 'Pax',\r\n key: 'pax',\r\n dataIndex: 'paxCount'\r\n },\r\n {\r\n title: 'Bags',\r\n key: 'bags',\r\n dataIndex: 'bagCount'\r\n },\r\n {\r\n title: 'CGO',\r\n key: 'cgo',\r\n dataIndex: 'cgoCount'\r\n },\r\n {\r\n title: 'Total Wt',\r\n key: 'totalWt',\r\n render: (_, record) => Number(record.paxWeight) + Number(record.bagWeight) + Number(record.cgoWeight)\r\n },\r\n {\r\n title: '',\r\n key: 'redundantWarning',\r\n render: (_, record) => {\r\n\r\n // Selected entities for just this leg\r\n let legSelectedEntities = this.props.selectedEntities\r\n .filter(e => record.paxIDs?.includes(e._id) || record.cgoIDs?.includes(e._id))\r\n\r\n return (\r\n <>\r\n {this.props.checkLegIsRedundant?.(record) ?\r\n \r\n \r\n \r\n : null}\r\n \r\n \r\n )\r\n }\r\n }\r\n ]\r\n const { title = 'Flight Legs', extra=[], data, selectedLeg = 0, onLegChange } = this.props;\r\n return (\r\n \r\n \r\n \r\n

{title}

\r\n \r\n {extra?.length ? extra.map((item) => (\r\n \r\n {item}\r\n \r\n )\r\n )\r\n : null\r\n }\r\n
\r\n {!data.length && (\r\n

Create new flight legs by adding scheduled passengers

\r\n )}\r\n {data.length ? (\r\n index} \r\n size=\"small\" \r\n pagination={false}\r\n components={!this.props.disabled ? {\r\n body: {\r\n row: DraggableBodyRow\r\n }\r\n } : undefined}\r\n onRow={(row, index) => {\r\n const rowProps = {\r\n moveRow: (dragIndex, hoverIndex) => this.props.onReorder && !this.props.disabled && this.props.onReorder(dragIndex, hoverIndex),\r\n onClick: () => onLegChange && onLegChange(index),\r\n index\r\n }\r\n if (index === selectedLeg){\r\n return {\r\n ...rowProps,\r\n className: 'selected'\r\n }\r\n }\r\n return {\r\n ...rowProps,\r\n style: {\r\n cursor: 'pointer'\r\n }\r\n }\r\n }}\r\n />\r\n ) : null\r\n }\r\n
\r\n )\r\n }\r\n}\r\n\r\nexport default FlightScheduleLegs","import useControlledState from './useControlledState';\r\n\r\nexport interface MultiSelectOptions {\r\n selectedItems?: T[],\r\n primaryKey?: any,\r\n onSelection?(selectedItems: T[]): void\r\n}\r\n\r\nexport type IsSelected = (key: any) => boolean\r\nexport type ToggleSelection = (item: T) => void\r\nexport type ClearAll = () => void\r\nexport type SetSelectedItems = (items: T[]) => void\r\nexport type SelectedItems = T[]\r\n\r\nexport interface MultiSelectReturn {\r\n isSelected?: IsSelected,\r\n toggleSelection?: ToggleSelection,\r\n clearAll?: ClearAll,\r\n setSelectedItems: SetSelectedItems,\r\n selectedItems: SelectedItems,\r\n selectedKeys: any[]\r\n}\r\n\r\nexport function getPrimaryKey(item: T, pk?: any): any {\r\n if (pk){\r\n return item[pk]\r\n }\r\n return item\r\n}\r\n\r\nexport function useMultiSelect(options?: MultiSelectOptions): MultiSelectReturn {\r\n const [ selectedItems, setSelectedItems ] = useControlledState>([], options && options.selectedItems, options && options.onSelection);\r\n\r\n function isSelected(key: any): boolean {\r\n let idx = selectedItems.findIndex((item) => {\r\n return getPrimaryKey(item, options.primaryKey) === key;\r\n });\r\n return idx !== -1\r\n }\r\n function toggleSelection(item: T): void {\r\n let key = getPrimaryKey(item, options.primaryKey);\r\n let selected = isSelected(key);\r\n if (selected){\r\n setSelectedItems(selectedItems.filter((si) => {\r\n return getPrimaryKey(si, options.primaryKey) !== key\r\n }))\r\n }\r\n else\r\n {\r\n setSelectedItems([ ...selectedItems, item ])\r\n }\r\n }\r\n function clearAll(){\r\n setSelectedItems([]);\r\n }\r\n return {\r\n isSelected,\r\n toggleSelection,\r\n clearAll,\r\n setSelectedItems,\r\n selectedItems,\r\n selectedKeys: selectedItems.map((item) => getPrimaryKey(item, options.primaryKey))\r\n }\r\n}","import {ScheduledGroup, ScheduledPaxCgoGroupV2Leg} from \"common/types/schedule\";\r\nimport React from \"react\";\r\nimport {produce, WritableDraft} from \"immer\";\r\nimport {difference, union} from \"lodash\";\r\nimport {PaxNode} from \"common/types/carriable\";\r\n\r\n// ---------------------------------------------------------------------------------------------------------------------\r\n// State Machine for the scheduled-pax-cgo-adder component\r\n// ---------------------------------------------------------------------------------------------------------------------\r\n\r\nexport const SearchEventTypes = {\r\n 'LOCATION': 'Location',\r\n 'NAME': 'Name',\r\n 'EMPLOYER': 'Employer'\r\n} as const;\r\n\r\n// Events when a user clicks a button to perform an action\r\nexport type ActionEvent =\r\n{\r\n type: 'FLIGHT',\r\n action: 'UPDATE',\r\n payload: {\r\n paxnodeIds: string[],\r\n cgonodeIds: string[]\r\n }\r\n} |\r\n{\r\n type: 'COLLAPSE.GROUPS',\r\n action: 'SET',\r\n payload: {\r\n panelKeys: string | string[]\r\n }\r\n} |\r\n{\r\n type: 'COLLAPSE.LEGS',\r\n action: 'SET',\r\n payload: {\r\n group: ScheduledGroup,\r\n panelKeys: string | string[]\r\n }\r\n} |\r\n{\r\n type: 'MODAL.PAX' | 'DRAWER.ISN',\r\n action: 'OPEN',\r\n payload: {\r\n paxData: PaxNode\r\n }\r\n} |\r\n{\r\n type: 'MODAL.PAX' | 'DRAWER.ISN',\r\n action: 'CLOSE'\r\n} |\r\n{\r\n type: 'ACTIVE.SEARCH',\r\n action: 'SET',\r\n payload: {\r\n activeSearch: SearchEvent['type']\r\n }\r\n} |\r\n{\r\n // Clear all search\r\n type: 'SEARCH',\r\n action: 'CLEAR'\r\n}\r\n\r\n// Events when a user types into a search box\r\nexport type SearchEvent = {\r\n type: keyof typeof SearchEventTypes,\r\n action: 'SET',\r\n payload: {\r\n text: string\r\n }\r\n} |\r\n{\r\n type: keyof typeof SearchEventTypes,\r\n action: 'CLEAR'\r\n}\r\n\r\n// Events when a user selects something\r\nexport type SelectionEvent = {\r\n type: 'ENTITY',\r\n action: 'ADD' | 'REMOVE' | 'SET' | 'TOGGLE'\r\n payload: {\r\n keys: string[]\r\n }\r\n} |\r\n{\r\n type: 'ENTITY',\r\n action: 'CLEAR'\r\n}\r\n\r\nexport type AbstractEvent = {\r\n type: string,\r\n action: string,\r\n payload?: any\r\n}\r\n\r\nexport const DEFAULT_STATE = {\r\n selectedEntities: [] as string[],\r\n search: {} as Record,\r\n activeSearch: 'LOCATION' as SearchEvent['type'],\r\n openGroupPanels: [] as string[],\r\n openLegPanels: {} as {\r\n [groupID: string]: string[]\r\n },\r\n paxModal: {\r\n open: false,\r\n paxData: null as PaxNode\r\n },\r\n isnDrawer: {\r\n open: false,\r\n paxData: null as PaxNode\r\n }\r\n}\r\n\r\nexport type State = typeof DEFAULT_STATE\r\n\r\nexport type Event =\r\n { category: 'SELECTION' } & SelectionEvent |\r\n { category: 'SEARCH' } & SearchEvent |\r\n { category: 'ACTION' } & ActionEvent\r\n\r\nvar EventHandlers = {\r\n SearchEventHandler(state: WritableDraft, event: SearchEvent){\r\n if (event.action === 'SET'){\r\n state.search[event.type] = event.payload.text;\r\n }\r\n if (event.action === 'CLEAR' && state.search[event.type]){\r\n delete state.search[event.type];\r\n }\r\n },\r\n SelectionEventHandler(state: WritableDraft, event: SelectionEvent){\r\n\r\n switch (event.type){\r\n case 'ENTITY':\r\n {\r\n if (event.action === 'CLEAR'){\r\n state.selectedEntities = Helper.ApplyCSRAT(event.action, state.selectedEntities);\r\n }\r\n else {\r\n state.selectedEntities = Helper.ApplyCSRAT(event.action, state.selectedEntities, event.payload.keys);\r\n }\r\n }\r\n }\r\n return;\r\n },\r\n ActionEventHandler: (state: WritableDraft, event: ActionEvent) => {\r\n\r\n function getPanelKeys(keys: string | string[]){\r\n if (Array.isArray(keys))\r\n return keys;\r\n else\r\n return [keys];\r\n }\r\n\r\n switch (event.type){\r\n case 'COLLAPSE.GROUPS':\r\n {\r\n if (event.action === 'SET'){\r\n state.openGroupPanels = getPanelKeys(event.payload.panelKeys);\r\n const legPanelsCopy = [].concat(state.openLegPanels);\r\n for (const key in legPanelsCopy){\r\n // Collapse any leg panels if not found in panelKeys\r\n if (!state.openGroupPanels.includes(key)){\r\n delete state.openLegPanels[key]\r\n }\r\n }\r\n }\r\n return;\r\n }\r\n case 'COLLAPSE.LEGS':\r\n {\r\n if (event.action === 'SET'){\r\n const group = event.payload.group;\r\n const groupID = Helper.panelKey.stringify(group);\r\n\r\n state.openLegPanels[groupID] = getPanelKeys(event.payload.panelKeys);\r\n }\r\n return;\r\n }\r\n case 'MODAL.PAX':\r\n case 'DRAWER.ISN':\r\n {\r\n const keyNames = {\r\n 'MODAL.PAX': 'paxModal',\r\n 'DRAWER.ISN': 'isnDrawer'\r\n };\r\n\r\n // If payload.paxData is null, then close the modal/drawer\r\n\r\n if (event.action === 'OPEN' && event.payload?.paxData){\r\n state[keyNames[event.type]] = {\r\n open: true,\r\n paxData: event.payload.paxData\r\n }\r\n }\r\n if (event.action === 'CLOSE' || !event.payload?.paxData){\r\n state[keyNames[event.type]] = {\r\n open: false,\r\n paxData: state[keyNames[event.type]].paxData\r\n }\r\n }\r\n return;\r\n }\r\n case 'ACTIVE.SEARCH':\r\n {\r\n if (event.action === 'SET'){\r\n state.activeSearch = event.payload.activeSearch;\r\n }\r\n return;\r\n }\r\n case 'SEARCH':\r\n {\r\n if (event.action === 'CLEAR'){\r\n state.search = DEFAULT_STATE.search;\r\n }\r\n return;\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport class Helper {\r\n\r\n // Applies the clear, set, remove, and add operations to a list of strings.\r\n static ApplyCSRAT(action: 'CLEAR' | 'SET' | 'REMOVE' | 'ADD' | 'TOGGLE', stringArray: string[], payload?: string[]){\r\n if (!Array.isArray(payload) && action !== 'CLEAR') return stringArray;\r\n\r\n switch (action){\r\n case 'CLEAR':\r\n stringArray = [];\r\n break;\r\n case 'SET':\r\n stringArray = payload;\r\n break;\r\n case 'REMOVE':\r\n stringArray = difference(stringArray, payload);\r\n break;\r\n case 'ADD':\r\n stringArray = union(stringArray, payload);\r\n break;\r\n case 'TOGGLE':\r\n payload.forEach(str => {\r\n if (stringArray.includes(str)){\r\n stringArray = difference(stringArray, payload);\r\n }\r\n else {\r\n stringArray = union(stringArray, payload);\r\n }\r\n })\r\n break;\r\n }\r\n return stringArray;\r\n };\r\n\r\n static panelKey = {\r\n stringify: (group: ScheduledGroup) => [group.scheduledGroup, group.scheduledFlightDate, group.lastKnownController?._id].join('::'),\r\n parse: (str: string) => {\r\n const data = str.split(\"::\");\r\n if (data.length >= 3){\r\n return {\r\n groupName: data[0],\r\n groupDate: data[1],\r\n lastKnownController: data[2]\r\n }\r\n }\r\n }\r\n }\r\n\r\n static legKey = {\r\n stringify: (leg: ScheduledPaxCgoGroupV2Leg) => [leg.departureDoc?.name, leg.destinationDoc?.name].join('::'),\r\n parse: (str: string) => {\r\n const data = str.split(\"::\");\r\n if (data.length >= 3){\r\n return {\r\n departureName: data[0],\r\n destinationName: data[1],\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport const Reducer: React.Reducer = (state, action) => {\r\n return produce(state, (draftState) => {\r\n switch (action.category) {\r\n case 'SELECTION': {\r\n EventHandlers.SelectionEventHandler(draftState, action);\r\n return;\r\n }\r\n case 'SEARCH': {\r\n EventHandlers.SearchEventHandler(draftState, action);\r\n return;\r\n }\r\n case 'ACTION':\r\n EventHandlers.ActionEventHandler(draftState, action);\r\n return;\r\n }\r\n });\r\n}","import gql from \"graphql-tag\";\r\nimport {\r\n ScheduledCgoNodeFragment,\r\n ScheduledFlightFragment,\r\n ScheduledPaxCgoGroupV2Fragment,\r\n ScheduledPaxNodeFragment\r\n} from \"Queries/Scheduling\";\r\nimport {ScheduledGroup} from \"../../../../common/types/schedule\";\r\nimport {DocumentNode} from \"apollo-link\";\r\n\r\n// Queries\r\nconst GetScheduledGroups = gql`\r\n query GetGroups(\r\n $flightid: ID!\r\n $tpID: ID!\r\n $customerID: ID!\r\n $scheduledFlightDate: AWSDate!\r\n ){\r\n flight: getFlight(_id: $flightid){\r\n ...ScheduledFlightFragment\r\n }\r\n groups: GetScheduledPaxCgoGroups(\r\n tpID: $tpID\r\n customerID: $customerID\r\n startDate: $scheduledFlightDate\r\n endDate: $scheduledFlightDate\r\n noCurrentCarrier: true\r\n ){\r\n \r\n ...ScheduledPaxCgoGroupV2Fragment\r\n }\r\n }\r\n${ScheduledFlightFragment}\r\n${ScheduledPaxCgoGroupV2Fragment}\r\n`\r\n\r\n// Mutations\r\nconst AddPaxToFlight = gql`\r\n mutation AddPaxAndCgoToFlight($flight: FlightNodeInput!, $paxIDs: [ID]!, $cgoIDs: [ID]!, $tpID: ID!){\r\n result: addPaxAndCgoToFlight(flight: $flight, paxIDs: $paxIDs, cgoIDs: $cgoIDs, tpID: $tpID){\r\n ...ScheduledFlightFragment\r\n }\r\n }\r\n${ScheduledFlightFragment}\r\n`;\r\n\r\nexport type QueryTypes = {\r\n GetScheduledGroups: {\r\n Vars: {\r\n flightid: string,\r\n tpID: string,\r\n customerID: string,\r\n scheduledFlightDate: string\r\n },\r\n Data: {\r\n flight?: any,\r\n groups?: ScheduledGroup[]\r\n }\r\n }\r\n}\r\n\r\nexport type MutationTypes = {\r\n AddPaxToFlight: {\r\n Vars: {\r\n flight: any,\r\n paxIDs: string[],\r\n cgoIDs: string[],\r\n tpID: string\r\n },\r\n Data: {\r\n result: any\r\n }\r\n }\r\n}\r\n\r\nexport const Queries = {\r\n GetScheduledGroups\r\n} as const;\r\n\r\nexport const Mutations = {\r\n AddPaxToFlight\r\n} as const;","import {useApolloClient} from \"react-apollo\";\r\nimport {\r\n ScheduledCgoNodeFragment,\r\n ScheduledPaxNodeFragment\r\n} from \"../Queries/Scheduling\";\r\nimport {CgoNode, PaxNode} from \"../common/types/carriable\";\r\nimport gql from \"graphql-tag\";\r\nimport {DocumentNode} from \"apollo-link\";\r\nimport {FetchPolicy} from \"apollo-client\";\r\nimport {LocationFragment} from \"../Queries/Location\";\r\nimport { Location } from \"common/types/location\";\r\n\r\n/*\r\n-------------------------------------------------------------------------------------------------\r\nThis section is a bit weird and exists for the resolveEntityIdsByType helper function.\r\nThe goal of RESOLVE_TYPE_MAPPING is to provide a mapping of an arbitrary string to arguments for\r\nthe resolveEntityIds function. ResolveKeyMapping maps the keys of RESOLVE_TYPE_MAPPING to a Manifest Central\r\nentity type (such as PaxNode, CargoNode, etc) so that resolveEntityIdsByType can return the correct type to the callee.\r\n\r\nThe keys of RESOLVE_TYPE_MAPPING can be arbitrary, however it is recommended to name it after the Fragment it uses.\r\nFor example: 'ScheduledPaxNode' is named from 'ScheduledPaxNodeFragment' without the \"Fragment\" part.\r\n*/\r\nconst RESOLVE_TYPE_MAPPING = {\r\n 'ScheduledPaxNode': {\r\n typename: 'PaxNode',\r\n fragment: ScheduledPaxNodeFragment,\r\n fragmentName: 'ScheduledPaxNodeFragment'\r\n },\r\n 'ScheduledCgoNode': {\r\n typename: 'CargoNode',\r\n fragment: ScheduledCgoNodeFragment,\r\n fragmentName: 'ScheduledCgoNodeFragment'\r\n },\r\n 'Location': {\r\n typename: 'Location',\r\n fragment: LocationFragment,\r\n fragmentName: 'LocationFragment'\r\n }\r\n}\r\n\r\ntype ResolveTypeMappingKeys = keyof typeof RESOLVE_TYPE_MAPPING;\r\n\r\ntype DefineResolveKeyType = {\r\n 'ScheduledPaxNode': PaxNode,\r\n 'ScheduledCgoNode': CgoNode,\r\n 'Location': Location\r\n}\r\n\r\n// If an error shows up here, that means DefineResolveKeyType is missing a mapping of a RESOLVE_TYPE_MAPPING key!\r\ntype ResolveKeyMapping = {\r\n [K in ResolveTypeMappingKeys]: DefineResolveKeyType[K]\r\n}\r\n\r\n// ----------------------------------------------------------------------------------------------\r\n\r\nfunction useApolloClientHelper(){\r\n const client = useApolloClient();\r\n\r\n return new class {\r\n /**\r\n * Asynchronously converts a list of IDs to a list of documents.\r\n * If one or more IDs are not found in the cache, a Query will be executed using the resolve_entity_ids query.\r\n * If all IDs are found in the cache, it will be immediately returned.\r\n */\r\n resolveEntityIds = async (args: {\r\n /**\r\n * List of IDs to convert into documents.\r\n */\r\n ids: string[],\r\n\r\n /**\r\n * GraphQL type name (e.g. PaxNode)\r\n */\r\n typename: string,\r\n\r\n /**\r\n * Fragment of fields to return\r\n */\r\n fragment: DocumentNode,\r\n\r\n /**\r\n * Name of the fragment (must be the same as fragment)\r\n */\r\n fragmentName: string,\r\n\r\n /**\r\n * Customize the fetch policy used.\r\n * @default cache-first\r\n */\r\n fetchPolicy?: FetchPolicy\r\n }): Promise => {\r\n const query = gql`\r\n query ResolveEntityIds($ids: [ID!]!, $typename: String!){\r\n resolve_entity_ids(ids: $ids, typename: $typename){\r\n ...${args.fragmentName}\r\n }\r\n }\r\n ${args.fragment}\r\n `;\r\n\r\n const result = await client.query({\r\n query: query,\r\n variables: {\r\n ids: args.ids,\r\n typename: args.typename\r\n },\r\n fetchPolicy: args.fetchPolicy || 'cache-first'\r\n });\r\n\r\n return result?.data?.resolve_entity_ids || [];\r\n }\r\n\r\n /**\r\n * This is a wrapper around resolveEntityIds in which a key is converted to arguments for resolveEntityIds.\r\n * @see resolveEntityIds\r\n */\r\n resolveEntityIdsByType = (\r\n ids: string[],\r\n type: T,\r\n args?: {\r\n fetchPolicy?: FetchPolicy\r\n }\r\n ) => (\r\n this.resolveEntityIds({\r\n ids: ids,\r\n fetchPolicy: args?.fetchPolicy,\r\n ...RESOLVE_TYPE_MAPPING[type]\r\n })\r\n );\r\n\r\n getScheduledPaxByIds = async (ids: string[]) =>\r\n (await this.resolveEntityIdsByType(ids, 'ScheduledPaxNode'))\r\n .filter((pax) => pax.classType === 'flytsuite.paxnode');\r\n\r\n getScheduledCgoByIds = async (ids: string[]) =>\r\n (await this.resolveEntityIdsByType(ids, 'ScheduledCgoNode'))\r\n .filter((cgo) => cgo.classType === 'flytsuite.cgonode');\r\n }\r\n}\r\n\r\nexport default useApolloClientHelper;","\r\nconst CollapseClassNames = {\r\n Rounded: \"mc-collapse-rounded\",\r\n RoundedWithTable: \"mc-collapse-rounded mc-collapse-rounded-has-table\"\r\n}\r\n\r\nexport default CollapseClassNames;","\r\nexport const BASE_CLS = 'scheduled-paxcgo-adder';","import React from 'react';\r\nimport {Icon} from \"antd\";\r\n\r\n/**\r\n * Computes the possible width of a LegRoute component given a departure and destination location name.\r\n * @see {LegRoute}\r\n * @param items\r\n * @returns Width in pixels\r\n */\r\nexport function approximateLegRouteColumnWidth(items: { departureName: string, destinationName: string }[]){\r\n const charWidth = 9.2;\r\n const arrowWidth = 38;\r\n const sidePadding = 24;\r\n\r\n let maxWidth = 0;\r\n\r\n for (let item of items) {\r\n const numChars = String(item.departureName).length + String(item.destinationName).length;\r\n const width = (numChars * charWidth) + arrowWidth + (sidePadding * 2);\r\n maxWidth = Math.max(width, maxWidth);\r\n }\r\n\r\n return maxWidth;\r\n}\r\n\r\n/**\r\n * Displays an arrow pointing from the departure name to the destination name.\r\n * Example: SS198 -> WC122\r\n * @param props\r\n * @constructor\r\n */\r\nexport const LegRoute = (props: { departureName: React.ReactNode, destinationName: React.ReactNode }) => {\r\n return <>\r\n {props.departureName}\r\n \r\n {props.destinationName}\r\n \r\n}\r\n\r\n","export type { Location } from '__generated__/graphql/types'\r\n\r\nexport enum LocationType {\r\n ONSHORE='ONSHORE',\r\n OFFSHORE='OFFSHORE'\r\n}","import {Location, LocationType} from \"../types/location\";\r\nimport {TransitType} from \"../types/carriable\";\r\n\r\n/**\r\n * Returns the transit type given the departure and destination.\r\n * Reads the \"type\" field specifically ot infer the transitType.\r\n */\r\nexport function getTransitType(departure: Location, destination: Location) {\r\n if (departure.type === destination.type)\r\n return TransitType.TRANSFER\r\n\r\n if (departure.type === LocationType.ONSHORE && destination.type === LocationType.OFFSHORE) {\r\n return TransitType.OUTBOUND;\r\n }\r\n\r\n return TransitType.INBOUND;\r\n}","import {useApolloClient, useQuery} from \"react-apollo\";\r\nimport gql from \"graphql-tag\";\r\nimport moment from 'moment';\r\nimport _ from 'lodash';\r\nimport {ScheduleNode} from \"./types\";\r\n\r\nexport function zerofixed(v: number) {\r\n if (v < 10) {\r\n return `0${v}`;\r\n }\r\n return `${v}`;\r\n}\r\n\r\ntype MomentRange = [ moment.Moment, moment.Moment ]\r\n\r\nexport function usePersistentDateRange(): [MomentRange, (range: MomentRange) => void]{\r\n const client = useApolloClient();\r\n var { data } = useQuery(gql`\r\n query GetScheduleDateRange {\r\n schedulingDateRange @client\r\n }\r\n `)\r\n\r\n function setDateRange(range: MomentRange){\r\n client.writeData({\r\n data: {\r\n schedulingDateRange: range.map(date => date.format('YYYY-MM-DD'))\r\n }\r\n })\r\n }\r\n\r\n let dateRange: MomentRange;\r\n if (Array.isArray(data && data.schedulingDateRange) && data.schedulingDateRange.length > 0 && _.every(dateRange, _.isString)){\r\n dateRange = data.schedulingDateRange.map((dateStr: string) => dateStr && moment(dateStr));\r\n }\r\n else\r\n {\r\n dateRange = [ moment(), moment().add(1, 'month') ]\r\n }\r\n // Check if date range in store is out of bounds. If it is, offset the range until within bounds.\r\n if (dateRange[0].isBefore(moment(), 'month')){\r\n let dayDiff = dateRange[1].diff(dateRange[0], 'days');\r\n let newDateRange: MomentRange = [ moment(), moment().add(dayDiff, 'days') ];\r\n setDateRange(newDateRange);\r\n dateRange = newDateRange\r\n }\r\n return [\r\n dateRange,\r\n range => setDateRange(range)\r\n ]\r\n}\r\n\r\n// Gets the ID of a ScheduleNode (could be __temp_id or _id)\r\nexport function getSNodeID(node: ScheduleNode) {\r\n return node?._id || node?.__temp_id;\r\n}","import React, {useEffect, useRef} from \"react\";\r\nimport {Helper} from './state';\r\nimport * as Hook from './hook';\r\nimport {ScheduledGroup, ScheduledPaxCgoGroupV2Leg} from \"common/types/schedule\";\r\nimport {Button, Checkbox, Collapse, Divider, Icon, Spin, Tooltip} from \"antd\";\r\nimport CollapseClassNames from \"../../../../common/style/collapse\";\r\nimport './style.less';\r\nimport {BASE_CLS} from \"./util\";\r\nimport {CollapseProps} from \"antd/lib/collapse\";\r\nimport {approximateLegRouteColumnWidth, LegRoute} from \"../util\";\r\nimport {PaxNode} from \"../../../../common/types/carriable\";\r\nimport {getTransitType} from \"../../../../common/carriable/util\";\r\nimport ETable from \"../../../enchanced-antd-table\";\r\nimport MCIcon from \"../../../icon\";\r\nimport IsnCheckStatusButton from \"../../../IsnCheckStatusButton\";\r\nimport {union} from 'lodash';\r\nimport {ApiInterface} from \"./api\";\r\nimport {ScheduleNode} from \"../../../scheduling/types\";\r\nimport {getSNodeID} from \"../../../scheduling/util\";\r\nimport {NotesForPilotQuickEdit} from \"../notes-for-pilot/quickedit/notes-for-pilot-quick-edit\";\r\n\r\n// These props are intended to be used with the \"componentProps\" property of useScheduledPaxCgoAdderState in ./hook.tsx\r\n// Use without useScheduledPaxCgoAdderState is not recommended.\r\nexport interface ScheduledPaxCgoAdderProps {\r\n data: ApiInterface['data'],\r\n selectionEvent?: ApiInterface['selection'],\r\n\r\n collapseGroupKeys?: ApiInterface['action']['groupCollapseKeys'],\r\n collapseLegKeys?: ApiInterface['action']['legCollapseKeys'],\r\n onPaxNameClicked?: (paxData: PaxNode) => void,\r\n onIsnButtonClicked?: (paxData: PaxNode) => void,\r\n onAddEntitiesToFlight?: ApiInterface['action']['flight']['addEntities'],\r\n\r\n isAddingToFlight?: boolean\r\n}\r\n\r\nexport type ScheduledPaxCgoAdderType = React.FC & {\r\n useState: typeof Hook.useScheduledPaxCgoAdderState\r\n}\r\n\r\n/**\r\n * Displays a list of scheduled groups that can be expanded and collapsed. Each scheduled group displays flight legs,\r\n * and each leg displays a list of pax/cgo.\r\n */\r\nconst ScheduledPaxCgoAdder: ScheduledPaxCgoAdderType = (props) => {\r\n\r\n const groups = props.data.groups.get();\r\n const containerRef = useRef(null);\r\n\r\n const legRouteColumnWidth = approximateLegRouteColumnWidth(\r\n groups.map((item) => ({\r\n departureName: item.departureID?.name,\r\n destinationName: item.destinationID?.name\r\n }))\r\n );\r\n\r\n function renderAddEntitiesButton(paxIds: string[], cgoIds: string[]){\r\n return (\r\n \r\n {\r\n e.stopPropagation();\r\n props.onAddEntitiesToFlight?.(\r\n paxIds,\r\n cgoIds\r\n )\r\n }}\r\n >Add {paxIds.length + cgoIds.length} PAX/CGO\r\n \r\n )\r\n }\r\n\r\n function renderPaxTable(leg: ScheduledPaxCgoGroupV2Leg){\r\n\r\n const columns = [\r\n {\r\n title: PAX ({leg.paxnodeIDs.length}),\r\n key: 'action',\r\n width: 73,\r\n render: () => {\r\n return (\r\n
\r\n \r\n
\r\n )\r\n }\r\n },\r\n {\r\n title: 'Name',\r\n key: 'name',\r\n render: (_, record) => {\r\n let xbr;\r\n let icon = null;\r\n\r\n var data;\r\n if (record.__typename === 'Person')\r\n {\r\n data = {\r\n ...record,\r\n personID: { ...record }\r\n }\r\n }\r\n else\r\n {\r\n data = record\r\n }\r\n if(data.personID){\r\n xbr = data.personID.extraBroadState;\r\n }else {\r\n xbr = record.extraBroadState;\r\n }\r\n let name = `${record.lastName}, ${record.firstName}`\r\n if(xbr === 'FAIL'){\r\n name = `\\u2194 ${record.lastName}, ${record.firstName}`\r\n }else if(xbr === 'PASS'){\r\n name = `\\uc6c3 ${record.lastName}, ${record.firstName}`\r\n }\r\n return (\r\n \r\n {icon}\r\n \r\n \r\n )\r\n }\r\n },\r\n {\r\n title: 'Nation',\r\n key: 'nation',\r\n render: (_, row) => row.personID && row.personID.nation\r\n },\r\n {\r\n title: 'Employer',\r\n key: 'employer',\r\n render: (_, record) => record.employerID && record.employerID.name\r\n },\r\n {\r\n title: 'Pax Weight',\r\n key: 'paxWeight',\r\n dataIndex: 'paxWeight'\r\n },\r\n {\r\n title: 'Bag Weight',\r\n key: 'bagWeight',\r\n dataIndex: 'bagWeight'\r\n },\r\n {\r\n title: 'Bag Count',\r\n key: 'bagCount',\r\n dataIndex: 'bagCount'\r\n },\r\n {\r\n title: 'Charge Code',\r\n key: 'chargeCode',\r\n dataIndex: 'chargeCode',\r\n },\r\n {\r\n title: 'Pilot Notes',\r\n key: 'pilotNotes',\r\n render: (_, row) => \r\n },\r\n {\r\n title: 'ISN Status',\r\n key: 'isnStatus',\r\n render: (_, row) => {\r\n\r\n if (row.transitType !== 'OUTBOUND') return '—';\r\n\r\n return {\r\n e.stopPropagation();\r\n props?.onIsnButtonClicked?.(row);\r\n }}\r\n />\r\n }\r\n },\r\n ]\r\n\r\n if (!leg.paxnodeIDs.length) return null;\r\n\r\n return {\r\n return {\r\n onClick: () => {\r\n props.selectionEvent?.('ENTITY').toggle([record._id])\r\n },\r\n className: BASE_CLS + '-table-row-selectable'\r\n }\r\n }}\r\n pagination={false}\r\n rowKey={record => getSNodeID(record)}\r\n size=\"small\"\r\n />\r\n }\r\n\r\n function renderCgoTable(leg: ScheduledPaxCgoGroupV2Leg){\r\n\r\n const cgo = leg.cgonodeDocs;\r\n\r\n const columns = [\r\n {\r\n title: CGO ({cgo.length}),\r\n key: 'action',\r\n width: 73,\r\n render: () => {\r\n\r\n return (\r\n
\r\n \r\n
\r\n )\r\n }\r\n },\r\n {\r\n title: 'Name',\r\n key: 'name',\r\n dataIndex: 'name'\r\n },\r\n {\r\n title: 'Weight',\r\n key: 'weight',\r\n dataIndex: 'weight'\r\n },\r\n {\r\n title: 'HazMat',\r\n key: 'hazmat',\r\n render: (_, record) => record.hazmat ? record.hazmatUnCode || \"YES\" : null\r\n },\r\n {\r\n title: 'Attention',\r\n key: 'attentionTo',\r\n dataIndex: 'attentionTo'\r\n },\r\n {\r\n title: 'Initials',\r\n key: 'initials',\r\n dataIndex: 'initials'\r\n },\r\n {\r\n title: 'Notes',\r\n key: 'notes',\r\n dataIndex: 'notes'\r\n },\r\n {\r\n title: 'Pilot Notes',\r\n key: 'pilotNotes',\r\n render: (_, row) => \r\n },\r\n ]\r\n\r\n if (!cgo.length) return null;\r\n\r\n return {\r\n return {\r\n onClick: () => {\r\n props.selectionEvent?.('ENTITY').toggle([record._id]);\r\n },\r\n className: BASE_CLS + '-table-row-selectable'\r\n }\r\n }}\r\n pagination={false}\r\n rowKey={record => getSNodeID(record)}\r\n size=\"small\"\r\n />\r\n }\r\n\r\n function renderLegPanel(leg: ScheduledPaxCgoGroupV2Leg){\r\n\r\n\r\n const pax = leg.paxnodeDocs;\r\n const cgo = leg.cgonodeDocs;\r\n const all = [...pax, ...cgo];\r\n const allIds = [...leg.paxnodeIDs, ...leg.cgonodeIDs];\r\n\r\n const selectedEntityIds = props.selectionEvent?.('ENTITY').get()\r\n .filter(entityId => leg.cgonodeIDs.includes(entityId) || leg.paxnodeIDs.includes(entityId));\r\n\r\n const intermediate = selectedEntityIds.length < all.length && selectedEntityIds.length > 0;\r\n const canSelectAll = intermediate || selectedEntityIds.length === 0;\r\n\r\n function handleCheckbox(){\r\n if (canSelectAll){\r\n props.selectionEvent?.('ENTITY').add(allIds);\r\n }\r\n else\r\n {\r\n props.selectionEvent?.('ENTITY').remove(allIds);\r\n }\r\n }\r\n\r\n const header = (\r\n <>\r\n {\r\n e.stopPropagation();\r\n handleCheckbox();\r\n }}\r\n />\r\n
\r\n = all.length}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n handleCheckbox();\r\n }}\r\n />\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n {getTransitType(leg.departureDoc, leg.destinationDoc)}\r\n \r\n \r\n {pax.length} PAX\r\n \r\n {cgo.length} CGO\r\n \r\n \r\n \r\n
{leg.totalWeight}
Wt\r\n
\r\n \r\n
{leg.totalPaxWeight}
Pax Wt\r\n
\r\n \r\n
{leg.totalCgoWeight}
Cgo Wt\r\n
\r\n \r\n
{leg.totalBagWeight}
Bag Wt\r\n
\r\n \r\n
{leg.totalCgoWeight}
Bag Ct\r\n
\r\n \r\n \r\n \r\n )\r\n\r\n const legKey = Helper.legKey.stringify(leg);\r\n\r\n return (\r\n \r\n \r\n {renderPaxTable(leg)}\r\n {renderCgoTable(leg)}\r\n \r\n \r\n )\r\n }\r\n\r\n function renderGroupPanel(group: ScheduledGroup) {\r\n\r\n const key = Helper.panelKey.stringify(group);\r\n\r\n // Creates a list of unique pax and cgo IDs from all legs in this group.\r\n const paxIds = group.legs.reduce(\r\n function(entityList: string[], leg: ScheduledPaxCgoGroupV2Leg){\r\n return union(entityList, leg.paxnodeIDs);\r\n },\r\n []\r\n )\r\n const cgoIds = group.legs.reduce(\r\n function(entityList: string[], leg: ScheduledPaxCgoGroupV2Leg){\r\n return union(entityList, leg.cgonodeIDs);\r\n },\r\n []\r\n )\r\n const entityIds = [...paxIds, ...cgoIds];\r\n\r\n const selectedEntityIds = props.selectionEvent?.('ENTITY').get()\r\n .filter(entityId => entityIds.includes(entityId));\r\n\r\n const intermediate = selectedEntityIds.length < entityIds.length && selectedEntityIds.length > 0;\r\n const canSelectAll = intermediate || selectedEntityIds.length === 0;\r\n\r\n function handleCheckbox(){\r\n if (canSelectAll){\r\n props.selectionEvent?.('ENTITY').add(entityIds);\r\n }\r\n else\r\n {\r\n props.selectionEvent?.('ENTITY').remove(entityIds);\r\n }\r\n }\r\n\r\n const header = (\r\n <>\r\n {\r\n e.stopPropagation();\r\n handleCheckbox();\r\n }}\r\n />\r\n
\r\n = entityIds.length}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n handleCheckbox();\r\n }}\r\n />\r\n
\r\n
\r\n
\r\n {group.scheduledGroup}\r\n
\r\n
\r\n Heliport:\r\n {group.lastKnownController?.name}\r\n
\r\n
\r\n {group.legCount} Legs\r\n
\r\n
\r\n {group.paxOutbound + group.cgoOutbound}{' '}OB\r\n \r\n {group.paxTransfer + group.cgoTransfer}{' '}TR\r\n \r\n {group.paxInbound + group.cgoInbound}{' '}IB\r\n
\r\n
\r\n \r\n )\r\n\r\n let collapseControl: Partial = {};\r\n if (props.collapseLegKeys) {\r\n collapseControl = {\r\n activeKey: props.collapseLegKeys?.get?.(group) || [],\r\n onChange: (keys) => props.collapseLegKeys?.set?.(group, keys)\r\n }\r\n }\r\n\r\n const panels = group.legs.map(renderLegPanel);\r\n\r\n const legCollapse = (\r\n \r\n {panels}\r\n \r\n )\r\n\r\n return (\r\n \r\n {legCollapse}\r\n \r\n )\r\n }\r\n\r\n const panels = groups.map(renderGroupPanel);\r\n\r\n let collapseControl = {};\r\n if (props.collapseGroupKeys) {\r\n collapseControl = {\r\n activeKey: props.collapseGroupKeys?.get?.() || [],\r\n onChange: props.collapseGroupKeys?.set\r\n }\r\n }\r\n\r\n const loading = Boolean(props.data?.loading || props?.isAddingToFlight);\r\n\r\n return }\r\n className=\"ant-spin-fill-height\"\r\n >\r\n
\r\n \r\n {panels}\r\n \r\n
\r\n
\r\n}\r\n\r\nScheduledPaxCgoAdder.useState = Hook.useScheduledPaxCgoAdderState;\r\n\r\nexport default ScheduledPaxCgoAdder;","import React, {useContext, useReducer} from \"react\";\r\nimport {useApolloClient, useMutation, useQuery} from \"react-apollo\";\r\nimport {OrgDataContext} from \"../../../../context/orgData\";\r\nimport {Mutations, MutationTypes, Queries, QueryTypes} from \"./graphql\";\r\nimport * as State from './state';\r\nimport {Helper, SearchEvent, SearchEventTypes} from './state';\r\nimport {ApiInterface} from \"./api\";\r\nimport ScheduledPaxCgoAdder, {ScheduledPaxCgoAdderProps} from \"./scheduled-paxcgo-adder\";\r\nimport {ScheduledGroup, ScheduledPaxCgoGroupV2Leg} from \"../../../../common/types/schedule\";\r\nimport {PassengerEditor} from \"../../../PassengerEditor\";\r\nimport {Alert, Button, Drawer, Input, message, Modal, Select} from \"antd\";\r\nimport {PaxISNWithData} from \"../../../isn/PaxISN\";\r\nimport {cloneDeep, intersection} from \"lodash\";\r\nimport {CgoNode, PaxNode} from \"../../../../common/types/carriable\";\r\nimport {\r\n buildLocNameMapFromPaxCgoLists, computeLegWeightsAndCounts,\r\n getFlightLegManagerFromFlightQuery,\r\n graphqlCgoToFlightManCgo,\r\n graphqlPaxToFlightManPax\r\n} from \"../../../../common/flight-leg/util\";\r\nimport {ButtonProps} from \"antd/lib/button\";\r\nimport {SearchProps} from \"antd/lib/input\";\r\nimport {SelectProps} from \"antd/lib/select\";\r\nimport {AlertProps} from \"antd/lib/alert\";\r\nimport {cleanGraphQLErrorMsg} from \"../../../../common/util\";\r\nimport {FlightLeg} from \"../../../../schema\";\r\nimport {ScheduledCgoNodeFragment, ScheduledPaxNodeFragment} from \"../../../../Queries/Scheduling\";\r\nimport useApolloClientHelper from \"../../../../hooks/useApolloClientHelper\";\r\n\r\ntype RenderFunc = (props?: Partial) => React.ReactElement\r\n\r\ntype ReturnType = {\r\n api: ApiInterface,\r\n\r\n /**\r\n * Enhances the ScheduledPaxCgoAdder component to consume the ApiInterface.\r\n * Usage: spread the componentProps object into the props of the ScheduledPaxCgoAdder component.\r\n * Example:\r\n * \r\n */\r\n componentProps: ScheduledPaxCgoAdderProps,\r\n\r\n /**\r\n * Renders child components for the UI.\r\n * These components are optional and not necessary for the hook to work.\r\n *\r\n * TODO: This is probably an anti-pattern now that I look at it. Change each of these into components that we can\r\n * spread props into similar to \"componentProps\"\r\n */\r\n render: {\r\n /**\r\n * Displays passenger editor popup\r\n */\r\n paxModal: () => React.ReactElement,\r\n\r\n /**\r\n * Displays passenger ISN panel\r\n */\r\n isnDrawer: () => React.ReactElement,\r\n\r\n /**\r\n * Button that allows user to add selected passengers/cargo to the flight.\r\n */\r\n addButton: RenderFunc,\r\n\r\n /**\r\n * Search query used to filter results\r\n */\r\n searchInput: RenderFunc,\r\n\r\n /**\r\n * Allows user to change the fields used to compare against their search query.\r\n */\r\n searchTypeSelect: RenderFunc,\r\n\r\n /**\r\n * Shows an alert saying filters are applied with the option to clear them.\r\n */\r\n filtersAppliedAlert: RenderFunc,\r\n\r\n /**\r\n * Displays and error if the data fetch failed\r\n */\r\n errorAlert: RenderFunc,\r\n }\r\n}\r\n\r\nexport type PartialFlightLeg = Pick\r\n\r\nexport interface PartialFlight {\r\n paxIDList: string[],\r\n cgoIDList: string[],\r\n legs: PartialFlightLeg[]\r\n}\r\n\r\ninterface Options {\r\n\r\n /**\r\n * Callback when the flight gets updated successfully\r\n */\r\n onFlightUpdated?: () => void,\r\n\r\n /**\r\n * Override specific behaviors of the scheduled-paxcgo-adder\r\n */\r\n override?: {\r\n\r\n /**\r\n * Overrides how a flight computes legs and paxIDList and cgoIDList.\r\n * Uses auto-assign algorithm by default to compute legs.\r\n * @param paxnodes List of PaxNodes being added\r\n * @param cgonodes List of CgoNodes being added\r\n * @returns A partial flight object.\r\n */\r\n addEntitiesToFlight?: (paxnodes: PaxNode[], cgonodes: CgoNode[]) => Promise\r\n }\r\n}\r\n\r\n/**\r\n * Build a map of an entity ID to its object for future reference.\r\n * @param groups\r\n */\r\nfunction buildEntityIDMap(groups: ScheduledGroup[]){\r\n const map = new Map();\r\n\r\n function add(entity: PaxNode | CgoNode){\r\n map.set(entity._id, entity);\r\n }\r\n\r\n for (let group of groups) {\r\n for (let leg of group.legs) {\r\n leg.paxnodeDocs.forEach(add);\r\n leg.cgonodeDocs.forEach(add);\r\n }\r\n }\r\n\r\n return map;\r\n}\r\n\r\n/**\r\n * React hook that allows child components to consume the ApiInterface as defined in api.ts.\r\n */\r\nexport function useScheduledPaxCgoAdderState(flightId: string, flightDate: string, options?: Options): ReturnType{\r\n\r\n const [ state, dispatch ] = useReducer(State.Reducer, State.DEFAULT_STATE);\r\n const orgData = useContext(OrgDataContext);\r\n const apolloHelper = useApolloClientHelper();\r\n\r\n const queryResult = useQuery<\r\n QueryTypes['GetScheduledGroups']['Data'],\r\n QueryTypes['GetScheduledGroups']['Vars']\r\n >(Queries.GetScheduledGroups, {\r\n variables: {\r\n flightid: flightId,\r\n tpID: orgData.getOrgIDByType('transporter'),\r\n customerID: orgData.getOrgIDByType('customer'),\r\n scheduledFlightDate: flightDate\r\n },\r\n skip: !flightId || !flightDate,\r\n pollInterval: 10000,\r\n fetchPolicy: 'network-only'\r\n });\r\n\r\n const flight = queryResult.data?.flight;\r\n const groups = queryResult.data?.groups || [];\r\n\r\n const [ addPaxToFlightMutation, { loading: saving } ] = useMutation<\r\n MutationTypes['AddPaxToFlight']['Data'],\r\n MutationTypes['AddPaxToFlight']['Vars']\r\n >(Mutations.AddPaxToFlight);\r\n\r\n /**\r\n * Adds pax/cgo to a flight.\r\n * @param paxnodeIDs\r\n * @param cgonodeIDs\r\n */\r\n async function handleAddEntities(paxnodeIDs: string[], cgonodeIDs: string[]){\r\n\r\n let partialFlightData: PartialFlight = {\r\n paxIDList: [],\r\n cgoIDList: [],\r\n legs: []\r\n }\r\n\r\n const paxnodes = await apolloHelper.getScheduledPaxByIds(paxnodeIDs);\r\n const cgonodes = await apolloHelper.getScheduledCgoByIds(cgonodeIDs);\r\n\r\n if (options?.override?.addEntitiesToFlight){\r\n partialFlightData = await options.override.addEntitiesToFlight(paxnodes, cgonodes);\r\n if (!partialFlightData) return;\r\n }\r\n else {\r\n\r\n let flManager = getFlightLegManagerFromFlightQuery(flight, buildLocNameMapFromPaxCgoLists(paxnodes, cgonodes));\r\n if (paxnodes?.length > 0){\r\n paxnodes.forEach((pax) => {\r\n flManager.addPassenger(graphqlPaxToFlightManPax(pax))\r\n })\r\n }\r\n if (cgonodes?.length > 0){\r\n cgonodes.forEach((cgo) => {\r\n flManager.addCgo(graphqlCgoToFlightManCgo(cgo))\r\n })\r\n }\r\n\r\n var departureID = flManager.getOrigin();\r\n if (!departureID){\r\n message.error(\"Cannot add a group with no departure on a flight.\")\r\n return\r\n }\r\n let newLegs = flManager.buildFlightLegs();\r\n\r\n partialFlightData = {\r\n paxIDList: flManager.getPaxIDList(),\r\n cgoIDList: flManager.getCgoIDList(),\r\n legs: newLegs\r\n }\r\n }\r\n\r\n const legs = await Promise.all(\r\n partialFlightData.legs.map(async (partialLeg) => {\r\n const paxNodes = await apolloHelper.getScheduledPaxByIds(partialLeg.paxIDs);\r\n const cgoNodes = await apolloHelper.getScheduledCgoByIds(partialLeg.cgoIDs);\r\n\r\n return {\r\n ...partialLeg,\r\n ...computeLegWeightsAndCounts(paxNodes, cgoNodes)\r\n }\r\n })\r\n )\r\n\r\n const legsStr = JSON.stringify(Object.assign({}, legs));\r\n\r\n await addPaxToFlightMutation({\r\n variables: {\r\n flight: {\r\n _id: flight._id,\r\n customerID: flight.customerID._id,\r\n departureID: departureID,\r\n tpID: orgData.transporter._id,\r\n ...partialFlightData,\r\n legs: legsStr\r\n },\r\n paxIDs: intersection(partialFlightData.paxIDList, paxnodeIDs),\r\n cgoIDs: intersection(partialFlightData.cgoIDList, cgonodeIDs),\r\n tpID: orgData.getOrgIDByType('transporter')\r\n }\r\n })\r\n .then(() => {\r\n options?.onFlightUpdated?.();\r\n dispatch({ category: 'SELECTION', type: 'ENTITY', action: 'CLEAR' });\r\n queryResult.refetch();\r\n })\r\n .catch((err) => {\r\n message.error(\"Failed to add PAX/CGO to flight\");\r\n console.error('Failed to add entities to flight', err);\r\n })\r\n }\r\n\r\n // Consumes groups list and filters according to user filters.\r\n function getGroups() {\r\n // Apply filters if necessary\r\n let userFilter = state.search[state.activeSearch]?.split(/[,| ]/) ?? [];\r\n\r\n // Filter out empty strings\r\n userFilter = userFilter.filter(query => query);\r\n\r\n function match(str: string){\r\n if (!userFilter.length) return true;\r\n return userFilter.every(word => str?.includes(word))\r\n }\r\n\r\n const entityFilters = [\r\n function filterEntityByName(entity: PaxNode | CgoNode){\r\n if (!userFilter || state.activeSearch !== 'NAME') return true;\r\n\r\n let name = entity.name as string;\r\n\r\n if (!name){\r\n // Might be a PaxNode. Get the last and first name.\r\n name = `${entity.lastName} ${entity.firstName}`;\r\n }\r\n\r\n name = name.trim().toLowerCase();\r\n\r\n return match(name)\r\n },\r\n function filterEntityByEmployer(entity: PaxNode | CgoNode){\r\n if (!userFilter || state.activeSearch !== 'EMPLOYER') return true;\r\n\r\n const name = String(entity.employerID?.name)\r\n .trim()\r\n .toLowerCase();\r\n\r\n return match(name)\r\n }\r\n ]\r\n\r\n // List of filters that can be applied to legs\r\n const legFilters = [\r\n function filterLegByAnything(leg: ScheduledPaxCgoGroupV2Leg) {\r\n if (!userFilter|| state.activeSearch !== 'LOCATION') return true;\r\n\r\n return (\r\n match(String(leg.departureDoc?.name).toLowerCase()) ||\r\n match(String(leg.destinationDoc?.name).toLowerCase())\r\n )\r\n }\r\n ]\r\n\r\n function transformLeg(leg: ScheduledPaxCgoGroupV2Leg){\r\n const legCpy = cloneDeep(leg) as ScheduledPaxCgoGroupV2Leg;\r\n legCpy.cgonodeIDs = [];\r\n legCpy.cgonodeDocs = [];\r\n legCpy.paxnodeIDs = [];\r\n legCpy.paxnodeDocs = [];\r\n\r\n function addEntity(entity: PaxNode | CgoNode){\r\n if (!entity) return;\r\n\r\n const ctMap = {\r\n 'flytsuite.paxnode': 'paxnode',\r\n 'flytsuite.cgonode': 'cgonode'\r\n }\r\n\r\n const type = ctMap[entity.classType];\r\n if (!type) return;\r\n\r\n legCpy[type + 'Docs'].push(entity);\r\n legCpy[type + 'IDs'].push(entity._id);\r\n }\r\n\r\n const entityList = [...leg.paxnodeDocs, ...leg.cgonodeDocs];\r\n\r\n for (let entity of entityList) {\r\n let shouldAdd = true;\r\n for (let entityFilter of entityFilters) {\r\n if (!entityFilter(entity)){\r\n shouldAdd = false;\r\n break;\r\n }\r\n }\r\n if (shouldAdd){\r\n addEntity(entity);\r\n }\r\n }\r\n\r\n return legCpy;\r\n }\r\n\r\n function transformGroup(group: ScheduledGroup){\r\n const groupCpy = cloneDeep(group);\r\n groupCpy.legs = [];\r\n\r\n for (let leg of group.legs) {\r\n for (let legFilter of legFilters) {\r\n if (legFilter(leg)){\r\n const legCpy = transformLeg(leg);\r\n if (legCpy.paxnodeIDs.length || legCpy.cgonodeIDs.length){\r\n groupCpy.legs.push(legCpy);\r\n }\r\n else\r\n {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return groupCpy;\r\n }\r\n\r\n return groups.map(transformGroup)\r\n\r\n // Filter out groups with no legs\r\n .filter(group => group.legs.length)\r\n\r\n }\r\n\r\n // Implement ApiInterface\r\n const api: ApiInterface = {\r\n data: {\r\n loading: queryResult.loading,\r\n error: queryResult.error,\r\n refetch: queryResult.refetch,\r\n flight: {\r\n get: () => flight\r\n },\r\n groups: {\r\n get: getGroups,\r\n }\r\n },\r\n selection: (type) => ({\r\n get: () => {\r\n switch (type){\r\n case \"ENTITY\":\r\n return state.selectedEntities;\r\n }\r\n },\r\n set: (keys) => (\r\n dispatch({ category: 'SELECTION', type: type, action: 'SET', payload: { keys } })\r\n ),\r\n add: (keys) => (\r\n dispatch({ category: 'SELECTION', type: type, action: 'ADD', payload: { keys } })\r\n ),\r\n remove: (keys) => (\r\n dispatch({ category: 'SELECTION', type: type, action: 'REMOVE', payload: { keys } })\r\n ),\r\n clear: () => {\r\n dispatch({ category: 'SELECTION', type: type, action: 'CLEAR' })\r\n },\r\n toggle: (keys) => {\r\n dispatch({ category: 'SELECTION', type: type, action: 'TOGGLE', payload: { keys } })\r\n }\r\n }),\r\n\r\n /**\r\n * Actions that a user wants to happen such as clicking a button to add pax to a flight.\r\n */\r\n action: {\r\n flight: {\r\n addEntities: handleAddEntities,\r\n addSelectedEntities: async () => {\r\n const paxNodes = (await apolloHelper.getScheduledPaxByIds(state.selectedEntities))\r\n .map(({ _id }) => _id);\r\n const cgoNodes = (await apolloHelper.getScheduledCgoByIds(state.selectedEntities))\r\n .map(({ _id }) => _id);\r\n\r\n await handleAddEntities(paxNodes, cgoNodes);\r\n },\r\n\r\n // True while the flight is being updated\r\n saving: saving\r\n },\r\n groupCollapseKeys: {\r\n get: () => state.openGroupPanels,\r\n set: (keys) => (\r\n dispatch({\r\n category: 'ACTION',\r\n type: 'COLLAPSE.GROUPS',\r\n action: 'SET',\r\n payload: { panelKeys: keys }\r\n })\r\n )\r\n },\r\n legCollapseKeys: {\r\n get: (group) => state.openLegPanels[Helper.panelKey.stringify(group)],\r\n set: (group, keys) => (\r\n dispatch({\r\n category: 'ACTION',\r\n type: 'COLLAPSE.LEGS',\r\n action: 'SET',\r\n payload: {\r\n group: group,\r\n panelKeys: keys\r\n }\r\n })\r\n )\r\n },\r\n collapse: new class {\r\n expandAll = () => {\r\n const groupKeys = groups.map(Helper.panelKey.stringify);\r\n dispatch({\r\n category: 'ACTION',\r\n type: 'COLLAPSE.GROUPS',\r\n action: 'SET',\r\n payload: { panelKeys: groupKeys }\r\n });\r\n\r\n for (let group of groups) {\r\n const legKeys = group.legs.map(Helper.legKey.stringify);\r\n dispatch({\r\n category: 'ACTION',\r\n type: 'COLLAPSE.LEGS',\r\n action: 'SET',\r\n payload: {\r\n group: group,\r\n panelKeys: legKeys\r\n }\r\n })\r\n }\r\n };\r\n\r\n collapseAll = () => {\r\n dispatch({\r\n category: 'ACTION',\r\n type: 'COLLAPSE.GROUPS',\r\n action: 'SET',\r\n payload: { panelKeys: [] }\r\n });\r\n for (let group of groups) {\r\n dispatch({\r\n category: 'ACTION',\r\n type: 'COLLAPSE.LEGS',\r\n action: 'SET',\r\n payload: {\r\n group: group,\r\n panelKeys: []\r\n }\r\n })\r\n }\r\n };\r\n\r\n toggleAll = () => {\r\n if (this.isAllExpanded())\r\n this.collapseAll();\r\n else\r\n this.expandAll()\r\n };\r\n\r\n isAllExpanded = () => {\r\n return state.openGroupPanels.length >= groups.length\r\n }\r\n },\r\n paxModal: {\r\n open: (paxData) => dispatch({\r\n category: 'ACTION',\r\n type: 'MODAL.PAX',\r\n action: 'OPEN',\r\n payload: {\r\n paxData: paxData\r\n }\r\n }),\r\n close: () => dispatch({\r\n category: 'ACTION',\r\n type: 'MODAL.PAX',\r\n action: 'CLOSE'\r\n }),\r\n isOpen: state.paxModal.open,\r\n paxData: state.paxModal.paxData\r\n },\r\n isnDrawer: {\r\n open: (paxData) => dispatch({\r\n category: 'ACTION',\r\n type: 'DRAWER.ISN',\r\n action: 'OPEN',\r\n payload: {\r\n paxData: paxData\r\n }\r\n }),\r\n close: () => dispatch({\r\n category: 'ACTION',\r\n type: 'DRAWER.ISN',\r\n action: 'CLOSE'\r\n }),\r\n isOpen: state.isnDrawer.open,\r\n paxData: state.isnDrawer.paxData\r\n }\r\n },\r\n search: {\r\n get: (type) => ({\r\n get: () => {\r\n return state.search[type] || ''\r\n },\r\n set: (text) => (\r\n dispatch({ category: 'SEARCH', type: type, action: 'SET', payload: { text } })\r\n )\r\n }),\r\n clearAll: () => (\r\n dispatch({ category: 'ACTION', type: 'SEARCH', action: 'CLEAR' })\r\n ),\r\n filterApplied: () => (\r\n !!Object.values(state.search)\r\n .filter(v => v)\r\n .length\r\n )\r\n },\r\n activeSearch: {\r\n get: () => state.activeSearch,\r\n getName: () => SearchEventTypes[state.activeSearch],\r\n set: (type: SearchEvent['type']) => (\r\n dispatch({ category: 'ACTION', type: 'ACTIVE.SEARCH', action: 'SET', payload: { activeSearch: type } })\r\n ),\r\n list: () => Object.entries(SearchEventTypes)\r\n .map(([ type, name ]) => (\r\n {\r\n type: type as keyof typeof SearchEventTypes,\r\n name\r\n }\r\n ))\r\n }\r\n }\r\n\r\n const componentProps = {\r\n data: api.data,\r\n selectionEvent: api.selection,\r\n collapseGroupKeys: api.action.groupCollapseKeys,\r\n collapseLegKeys: api.action.legCollapseKeys,\r\n onAddEntitiesToFlight: api.action.flight.addEntities,\r\n onPaxNameClicked: (paxData) => (\r\n api.action.paxModal.open(paxData)\r\n ),\r\n onIsnButtonClicked: (paxData) => (\r\n api.action.isnDrawer.open(paxData)\r\n ),\r\n isAddingToFlight: saving\r\n }\r\n\r\n return {\r\n api: api,\r\n componentProps: componentProps,\r\n render: {\r\n paxModal: () => (\r\n \r\n \r\n \r\n ),\r\n isnDrawer: () => {\r\n let pax = api.action.isnDrawer.paxData;\r\n let title = pax ? `${pax.lastName}, ${pax.firstName}` : '';\r\n return (\r\n \r\n \r\n \r\n )\r\n },\r\n addButton: (props) => {\r\n return (\r\n \r\n Add {api.selection('ENTITY').get().length} Selected PAX/CGO\r\n \r\n )\r\n },\r\n searchInput: (props) => {\r\n return (\r\n (\r\n api.search.get(\r\n api.activeSearch.get()\r\n ).set(e.target.value)\r\n )}\r\n value={api.search.get(\r\n api.activeSearch.get()\r\n ).get()}\r\n placeholder={`Search by ${api.activeSearch.getName().toLowerCase()}`}\r\n enterButton\r\n allowClear\r\n {...props}\r\n style={{\r\n width: 300,\r\n ...props?.style\r\n }}\r\n />\r\n )\r\n },\r\n searchTypeSelect: (props) => {\r\n return (\r\n \r\n {api.activeSearch.list().map(({ type, name }) => (\r\n By {name}\r\n ))}\r\n \r\n )\r\n },\r\n filtersAppliedAlert: (props) => {\r\n if (!api.search.filterApplied()) return null;\r\n\r\n return (\r\n \r\n Results are filtered\r\n Clear filter\r\n \r\n }\r\n {...props}\r\n style={{\r\n marginBottom: 16,\r\n ...(props?.style)\r\n }}\r\n />\r\n )\r\n },\r\n errorAlert: (props) => {\r\n if (!api.data.error) return null;\r\n\r\n return (\r\n \r\n )\r\n }\r\n }\r\n }\r\n}","import useWindowSize from \"./useWindowSize\";\r\nimport {useEffect, useRef, useState} from \"react\";\r\n\r\n// Must be the same as src/theme/layout.less\r\n\r\n/*\r\n@screen-size-large: 1340px;\r\n@screen-size-medium: 1048px;\r\n@screen-size-small: 850px;\r\n@screen-size-mobile: 560px;\r\n */\r\n\r\ntype ScreenType = 'large' | 'medium' | 'small' | 'mobile';\r\n\r\nenum ScreenTypeEnum {\r\n mobile=560,\r\n small=850,\r\n medium=1048,\r\n large=1340\r\n}\r\n\r\nconst large = ScreenTypeEnum.large;\r\nconst medium = ScreenTypeEnum.medium;\r\nconst small = ScreenTypeEnum.small;\r\nconst mobile = ScreenTypeEnum.mobile;\r\n\r\ntype WidthSource = HTMLElement | Window;\r\n\r\nexport interface UseBreakpointsOptions {\r\n widthSource?: WidthSource,\r\n\r\n // Number to add to width\r\n widthOffset?: number\r\n}\r\n\r\n/**\r\n * Watches either the Window or an HTML element for resize changes, then reports the screen size breakpoint.\r\n *\r\n * Breakpoints:\r\n * - large\r\n * - medium\r\n * - small\r\n * - mobile\r\n *\r\n * @param options\r\n */\r\nfunction useBreakpoints(options?: UseBreakpointsOptions) {\r\n\r\n const [ source, setSource ] = useState(null);\r\n const [ offset, setOffset ] = useState(0);\r\n const [ screen, setScreen ] = useState();\r\n const lastWidth = useRef(0);\r\n\r\n setWidthSource(options?.widthSource);\r\n setWidthOffset(options?.widthOffset);\r\n\r\n function handleResize(){\r\n let screenType: ScreenType = 'large';\r\n\r\n let width: number;\r\n\r\n if (source instanceof Window){\r\n width = source.innerWidth + offset;\r\n }\r\n else\r\n {\r\n width = (Number(source.clientWidth) ?? 0) + offset;\r\n }\r\n\r\n if (width === lastWidth.current){\r\n return;\r\n }\r\n\r\n lastWidth.current = width;\r\n\r\n if (width <= mobile) screenType = 'mobile';\r\n else if (width <= small) screenType = 'small';\r\n else if (width <= medium) screenType = 'medium';\r\n\r\n console.debug('width changed!', width, screenType);\r\n\r\n setScreen(ScreenTypeEnum[screenType]);\r\n }\r\n\r\n useEffect(() => {\r\n\r\n if (!source) return;\r\n\r\n // Call handleResize once\r\n // Reason: Need to initialize screen state before the resize event listener is called.\r\n handleResize();\r\n\r\n if (source instanceof Window){\r\n // Use window resize event if window\r\n window.addEventListener('resize', handleResize);\r\n return () => {\r\n window.removeEventListener('resize', handleResize);\r\n }\r\n }\r\n\r\n // Otherwise use ResizeObserver\r\n const observer = new ResizeObserver((entries) => {\r\n if (entries.length <= 0) return;\r\n\r\n handleResize();\r\n })\r\n\r\n observer.observe(source);\r\n return () => observer.unobserve(source as HTMLElement);\r\n }, [source])\r\n\r\n /**\r\n * Sets the source element that wil be measured.\r\n * Defaults to window if not provided.\r\n * @param widthSource HTML element or window\r\n * @param widthOffset Gets added to the width measurement\r\n */\r\n function setWidthSource(widthSource: WidthSource, widthOffset?: number) {\r\n if (!widthSource) widthSource = window;\r\n\r\n if (widthSource !== source){\r\n setSource(widthSource);\r\n }\r\n if (widthOffset){\r\n setWidthOffset(widthOffset);\r\n }\r\n }\r\n\r\n /**\r\n * Adds an offset to the width measurement of the source element/window.\r\n * @param widthOffset Gets added to the width measurement\r\n */\r\n function setWidthOffset(widthOffset: number) {\r\n if (\r\n typeof widthOffset !== 'number' ||\r\n widthOffset === offset\r\n ) return;\r\n setOffset(widthOffset);\r\n }\r\n\r\n return {\r\n // Current breakpoint of the screen/element\r\n breakpoint: screen,\r\n\r\n /**\r\n * Returns true for breakpoints bigger than the input.\r\n * @param breakpoint Breakpoint input\r\n */\r\n max: (breakpoint: ScreenType) => {\r\n return ScreenTypeEnum[breakpoint] > screen\r\n },\r\n\r\n /**\r\n * Returns true for breakpoints smaller than or equal the input.\r\n * @param breakpoint Breakpoint input\r\n */\r\n min: (breakpoint: ScreenType) => {\r\n return ScreenTypeEnum[breakpoint] <= screen\r\n },\r\n\r\n /**\r\n * Sizes in pixels for each breakpoint type\r\n */\r\n sizes: {\r\n large: large,\r\n medium: medium,\r\n small: small,\r\n mobile: mobile\r\n },\r\n setWidthSource: setWidthSource,\r\n setWidthOffset: setWidthOffset\r\n }\r\n}\r\n\r\nexport default useBreakpoints;","import ScheduledPaxCgoAdder from \"./scheduled-paxcgo-adder\";\r\nexport default ScheduledPaxCgoAdder;","import {EntityId, NoteId, NoteMessage, State} from \"./state\";\r\nimport {WritableDraft} from \"immer\";\r\nimport {ScheduleNode} from \"../../../../scheduling/types\";\r\nimport {getSNodeID} from \"../../../../scheduling/util\";\r\n\r\nexport const BASE_CLS = 'notes-for-pilot-editor';\r\n\r\nexport function buildEntityMap(entityList: ScheduleNode[]){\r\n const entityMap = new Map();\r\n\r\n for (let entity of entityList) {\r\n entityMap.set(getSNodeID(entity), entity);\r\n }\r\n\r\n return entityMap;\r\n}\r\n\r\nexport function getValidNotes(noteMap: Map){\r\n const newMap = new Map();\r\n\r\n const entries = Array.from(noteMap.entries());\r\n for (let [ noteId, message ] of entries) {\r\n if (!message)\r\n continue;\r\n\r\n newMap.set(noteId, message);\r\n }\r\n\r\n return newMap;\r\n}\r\n\r\nexport function buildNotes(entityList: ScheduleNode[]){\r\n\r\n let nextNoteId = 0;\r\n const noteIdToMsg = new Map();\r\n const msgToNoteId = new Map();\r\n\r\n for (const entity of entityList) {\r\n\r\n const message = entity.notesForPilot;\r\n\r\n if (!message || msgToNoteId.has(message)){\r\n continue;\r\n }\r\n\r\n noteIdToMsg.set(nextNoteId, message);\r\n msgToNoteId.set(message, nextNoteId);\r\n\r\n nextNoteId++;\r\n }\r\n\r\n return {\r\n noteIdToMsg: noteIdToMsg,\r\n msgToNoteId: msgToNoteId\r\n };\r\n}\r\n\r\nexport function getNextNoteId(noteMap: Map){\r\n const entryList = Array.from(noteMap.entries());\r\n return entryList.reduce((prev, entry) => Math.max(prev, entry[0]), -1) + 1;\r\n}\r\n\r\nexport function addNote(noteMap: WritableDraft>, message: string){\r\n const nextNoteId = getNextNoteId(noteMap);\r\n noteMap.set(nextNoteId, message);\r\n}\r\n\r\nexport function buildEntityToNotes(entityList: ScheduleNode[]){\r\n const { msgToNoteId } = buildNotes(entityList);\r\n const entityToNote = new Map();\r\n\r\n for (let entity of entityList) {\r\n if (msgToNoteId.has(entity.notesForPilot)){\r\n entityToNote.set(getSNodeID(entity), msgToNoteId.get(entity.notesForPilot));\r\n }\r\n }\r\n\r\n return entityToNote;\r\n}\r\n\r\nexport function getEntityNoteMsg(entity: ScheduleNode, state: State){\r\n if (!state.entityIdToNote.has(getSNodeID(entity))){\r\n return;\r\n }\r\n\r\n const noteId = state.entityIdToNote.get(getSNodeID(entity));\r\n\r\n return state.notes.get(noteId);\r\n}\r\n\r\nexport function findUnassignedNoteIds(state: State){\r\n\r\n const noteIds = Array.from(state.notes.keys());\r\n\r\n function entityListIsMissingNote(noteId: number){\r\n const entityNoteList = Array.from(state.entityIdToNote.values());\r\n const foundNoteIdx = entityNoteList.findIndex(_noteId => noteId === _noteId);\r\n\r\n return foundNoteIdx === -1;\r\n }\r\n\r\n return noteIds.filter(entityListIsMissingNote)\r\n}\r\n\r\nexport function getEntityName(entity: ScheduleNode){\r\n let name: string;\r\n if (entity.classType === 'flytsuite.paxnode'){\r\n name = `${entity.lastName}, ${entity.firstName}`;\r\n }\r\n else {\r\n name = entity.name;\r\n }\r\n\r\n return name;\r\n}\r\n\r\nexport function getEntityIcon(entity: ScheduleNode){\r\n const iconType = entity.classType === 'flytsuite.paxnode' ?\r\n \"user\" : \"cargo\";\r\n return iconType;\r\n}","import {Dispatcher, State} from \"./state\";\r\nimport * as Util from './util';\r\nimport {Card, Col, Divider, Dropdown, Layout, List, Row, Select} from \"antd\";\r\nimport MCIcon from \"../../../../icon\";\r\nimport { BASE_CLS as PARENT_BASE_CLS } from './util';\r\nimport {SelectProps} from \"antd/lib/select\";\r\nimport {PropsWithChildren} from \"react\";\r\nimport {ScheduleNode} from \"../../../../scheduling/types\";\r\nimport {getSNodeID} from \"../../../../scheduling/util\";\r\n\r\nconst BASE_CLS = PARENT_BASE_CLS + '-note-assigner';\r\n\r\nexport interface NoteAssignerProps {\r\n state: State,\r\n dispatch: Dispatcher\r\n}\r\n\r\ninterface EntityWithNote {\r\n entity: ScheduleNode,\r\n noteId: number | undefined\r\n}\r\n\r\nconst NoteAssigner: React.FC = ({ state, dispatch }) => {\r\n\r\n let entitiesWithNote: EntityWithNote[] = Array.from(state.origEntities.values())\r\n .map((entity) => {\r\n const noteId = state.entityIdToNote.get(getSNodeID(entity));\r\n\r\n if (noteId < 0){\r\n return {\r\n entity: entity,\r\n noteId: undefined\r\n }\r\n }\r\n\r\n return {\r\n entity: entity,\r\n noteId: noteId\r\n }\r\n });\r\n\r\n entitiesWithNote.sort((a, b) => {\r\n const aName = Util.getEntityName(a.entity);\r\n const bName = Util.getEntityName(b.entity);\r\n\r\n return String(aName).localeCompare(bName)\r\n })\r\n\r\n function getNoteSelectorProps(){\r\n const options = Array.from(state.notes.entries())\r\n .map(([ noteId, message ]) => {\r\n if (!message) return null;\r\n\r\n return (\r\n \r\n {message}\r\n \r\n )\r\n })\r\n\r\n return {\r\n style: {\r\n minWidth: 200,\r\n maxWidth: 200\r\n },\r\n placeholder: 'Unassigned',\r\n allowClear: true,\r\n dropdownRender: (menu) => (\r\n
\r\n {menu}\r\n
\r\n ),\r\n children: options\r\n } as PropsWithChildren>\r\n }\r\n\r\n function renderNoteSelector(entityWithNote: EntityWithNote){\r\n\r\n return {\r\n dispatch({\r\n type: 'ASSIGN_ENTITY_TO_NOTE',\r\n noteId: noteId,\r\n entityId: getSNodeID(entityWithNote.entity)\r\n });\r\n }}\r\n {...getNoteSelectorProps()}\r\n />\r\n }\r\n\r\n function renderEntity(entityWithNote: EntityWithNote){\r\n const name = Util.getEntityName(entityWithNote.entity);\r\n const icon = Util.getEntityIcon(entityWithNote.entity);\r\n const noteSelector = renderNoteSelector(entityWithNote);\r\n\r\n return (\r\n \r\n
\r\n \r\n {name}\r\n
\r\n \r\n )\r\n }\r\n\r\n const items = entitiesWithNote.map(renderEntity);\r\n\r\n const allNoteIds = Array.from(state.entityIdToNote.values());\r\n\r\n const bulkAssignerValue = allNoteIds\r\n .reduce((prev, noteId) => {\r\n const noteMessage = state.notes.get(noteId);\r\n\r\n if (!prev && noteId > -1){\r\n return {\r\n key: noteId,\r\n label: noteMessage\r\n };\r\n }\r\n\r\n if (prev.key !== noteId){\r\n return {\r\n key: -1,\r\n label: 'Mixed'\r\n };\r\n }\r\n\r\n return {\r\n key: noteId,\r\n label: noteMessage\r\n };\r\n\r\n }, undefined as { key: number, label: string })\r\n\r\n let bulkAssigner = (\r\n <>\r\n \r\n \r\n Assign All:\r\n \r\n \r\n \r\n {\r\n dispatch({\r\n type: 'ASSIGN_ENTITY_TO_NOTE',\r\n noteId: noteValue.key,\r\n entityId: Array.from(state.origEntities.keys())\r\n })\r\n }}\r\n labelInValue\r\n {...getNoteSelectorProps()}\r\n />\r\n \r\n \r\n \r\n \r\n )\r\n\r\n return <>\r\n {bulkAssigner}\r\n \r\n \r\n {items}\r\n \r\n \r\n \r\n}\r\n\r\nexport default NoteAssigner;","import {produce} from \"immer\";\r\nimport {Dispatch, ReducerAction} from \"react\";\r\nimport { difference, unionBy, differenceBy } from \"lodash\";\r\nimport * as Util from './util';\r\nimport {ScheduleNode} from \"../../../../scheduling/types\";\r\nimport {validateNote} from \"../validation\";\r\n\r\nexport type EntityId = string;\r\nexport type NoteId = number;\r\nexport type NoteMessage = string;\r\n\r\nexport const DEFAULT_STATE = {\r\n origEntities: new Map(),\r\n notes: new Map(),\r\n entityIdToNote: new Map(),\r\n visibleNotes: [] as number[],\r\n noteAssigner: {\r\n open: false,\r\n noteId: null as number | null\r\n }\r\n}\r\n\r\nexport type State = typeof DEFAULT_STATE;\r\n\r\nexport type Action =\r\n{\r\n type: 'INIT',\r\n entities: ScheduleNode[]\r\n} |\r\n{\r\n type: 'UPDATE_NOTE',\r\n noteId: number,\r\n newMessage: string\r\n} |\r\n{\r\n type: 'RESET'\r\n} |\r\n{\r\n type: 'ADD_EMPTY_NOTE'\r\n} |\r\n{\r\n type: 'REMOVE_NOTE',\r\n noteId: number\r\n} |\r\n{\r\n type: 'CLEAR'\r\n} |\r\n{\r\n type: 'SET_VISIBLE_NOTES',\r\n noteIds: number[]\r\n} |\r\n{\r\n type: 'OPEN_NOTE_ASSIGNER',\r\n noteId?: number,\r\n open: boolean\r\n} |\r\n{\r\n type: 'ASSIGN_ENTITY_TO_NOTE',\r\n noteId: number | null | undefined,\r\n entityId: string | string[]\r\n}\r\n\r\nexport type Dispatcher = Dispatch>;\r\n\r\nexport const Reducer: React.Reducer, Action> = (prevState, action) => {\r\n\r\n function validateState(state: State){\r\n return produce(state, (currState) => {\r\n\r\n // Ensure keys in entityIdToNote don't refer to a non-existent entity in origEntities\r\n Array.from(currState.entityIdToNote.keys())\r\n .forEach(entityId => {\r\n if (!currState.origEntities.has(entityId)){\r\n currState.entityIdToNote.delete(entityId);\r\n }\r\n })\r\n\r\n // Ensure entities are not assigned to a deleted note.\r\n currState.entityIdToNote.forEach((noteId, entityId) => {\r\n if (!currState.notes.has(noteId)){\r\n currState.entityIdToNote.delete(entityId);\r\n }\r\n })\r\n\r\n // Ensure the noteId does not have a value if noteAssigner is closed.\r\n currState.noteAssigner = produce(currState.noteAssigner, (naState) => {\r\n if (naState.open && !currState.notes.size){\r\n naState.open = false;\r\n naState.noteId = null;\r\n }\r\n })\r\n })\r\n }\r\n\r\n const nextState = produce(prevState, (newState) => {\r\n\r\n function validateVisibleNotes(){\r\n newState.visibleNotes = newState.visibleNotes.filter((noteId) => {\r\n return newState.notes.has(noteId)\r\n });\r\n }\r\n\r\n switch (action.type){\r\n case \"INIT\":\r\n newState.origEntities = Util.buildEntityMap(action.entities);\r\n newState.notes = Util.buildNotes(action.entities).noteIdToMsg;\r\n newState.entityIdToNote = Util.buildEntityToNotes(action.entities);\r\n validateVisibleNotes();\r\n break;\r\n case \"RESET\":\r\n newState.notes = Util.buildNotes(Array.from(prevState.origEntities.values())).noteIdToMsg;\r\n validateVisibleNotes();\r\n break;\r\n case \"UPDATE_NOTE\":\r\n if (prevState.notes.has(action.noteId)){\r\n const message = validateNote(action.newMessage);\r\n newState.notes.set(action.noteId, message);\r\n }\r\n break;\r\n case 'ADD_EMPTY_NOTE':\r\n Util.addNote(newState.notes, '');\r\n break;\r\n case 'REMOVE_NOTE':\r\n newState.notes.delete(action.noteId);\r\n newState.visibleNotes = difference(newState.visibleNotes, [action.noteId]);\r\n break;\r\n case 'CLEAR':\r\n newState.notes = new Map();\r\n newState.visibleNotes = [];\r\n break;\r\n case 'SET_VISIBLE_NOTES':\r\n newState.visibleNotes = action.noteIds;\r\n break;\r\n case 'OPEN_NOTE_ASSIGNER':\r\n newState.noteAssigner.open = action.open;\r\n\r\n if (action.open){\r\n newState.noteAssigner.noteId = action.noteId || null;\r\n }\r\n else {\r\n newState.noteAssigner.noteId = null;\r\n }\r\n\r\n break;\r\n case 'ASSIGN_ENTITY_TO_NOTE':\r\n\r\n let entityIds = Array.isArray(action.entityId) ? action.entityId : [action.entityId];\r\n\r\n for (let entityId of entityIds) {\r\n if ([null, undefined].includes(action.noteId)){\r\n // Remove entity from note if noteId is null or undefined\r\n newState.entityIdToNote.delete(entityId);\r\n continue;\r\n }\r\n\r\n // Assign note to entity\r\n newState.entityIdToNote.set(entityId, action.noteId);\r\n }\r\n break;\r\n }\r\n\r\n })\r\n\r\n return validateState(nextState)\r\n}","import {useEffect, useReducer} from \"react\";\r\nimport {DEFAULT_STATE, Reducer} from \"./state\";\r\nimport {ScheduleNode} from \"../../../../scheduling/types\";\r\nimport {difference, union} from \"lodash\";\r\nimport {NotesForPilotEditorProps} from \"./notes-for-pilot-editor\";\r\n\r\nexport type NotesForPilotEditorApiProps = Pick\r\nexport type NotesForPilotEditorApi = ReturnType\r\n\r\nexport function useNotesForPilotEditorApi(props: NotesForPilotEditorApiProps){\r\n\r\n let [ state, dispatch ] = useReducer(Reducer, DEFAULT_STATE);\r\n\r\n if (props.overrideState){\r\n state = props.overrideState.state;\r\n dispatch = props.overrideState.dispatch;\r\n }\r\n\r\n useEffect(() => {\r\n dispatch({ type: 'INIT', entities: props.entities });\r\n }, [props.entities, props.readOnly]);\r\n\r\n const api = {\r\n state: state,\r\n dispatch: dispatch,\r\n readOnly: props.readOnly,\r\n updateNote: (noteId: number, message: string) => {\r\n dispatch({\r\n type: 'UPDATE_NOTE',\r\n noteId: noteId,\r\n newMessage: message\r\n })\r\n },\r\n removeNote: (noteId: number) => {\r\n dispatch({\r\n type: 'REMOVE_NOTE',\r\n noteId: noteId\r\n })\r\n },\r\n getNotes: () => state.notes,\r\n getNoteById: (noteId: number) => state.notes.get(noteId),\r\n getEntitiesWithNote: (noteId: number) => {\r\n const entityEntries = Array.from(state.entityIdToNote.entries());\r\n const entityList: ScheduleNode[] = [];\r\n\r\n for (let [ entityId, entityNoteId ] of entityEntries) {\r\n if (entityNoteId !== noteId)\r\n continue;\r\n\r\n const entity = state.origEntities.get(entityId);\r\n if (entity){\r\n entityList.push(entity);\r\n }\r\n }\r\n\r\n return entityList;\r\n },\r\n noteAssigner: {\r\n open: (noteId?: number) => dispatch({ type: 'OPEN_NOTE_ASSIGNER', open: true, noteId }),\r\n close: () => dispatch({ type: 'OPEN_NOTE_ASSIGNER', open: false }),\r\n isOpen: () => state.noteAssigner.open\r\n },\r\n visibleNotes: {\r\n get: () => state.visibleNotes as number[],\r\n set: (keys: number[]) => dispatch({ type: 'SET_VISIBLE_NOTES', noteIds: keys }),\r\n add: (keys: number[]) => api.visibleNotes.set(union(state.visibleNotes, keys)),\r\n remove: (keys: number[]) => api.visibleNotes.set(difference(state.visibleNotes, keys)),\r\n toggle: (key: number) => {\r\n if (state.visibleNotes.includes(key)){\r\n api.visibleNotes.remove([key]);\r\n return;\r\n }\r\n api.visibleNotes.add([key]);\r\n }\r\n },\r\n getComponentProps: () => {\r\n return {\r\n entities: props.entities,\r\n readOnly: props.readOnly\r\n } as NotesForPilotEditorProps\r\n }\r\n }\r\n\r\n return api;\r\n}","import {State, Dispatcher, Reducer, DEFAULT_STATE, EntityId} from \"./state\";\r\nimport {useEffect, useReducer} from \"react\";\r\nimport {Button, Col, Collapse, Drawer, Icon, Input, List, Row, Typography} from \"antd\";\r\nimport CollapseClassNames from \"common/style/collapse\";\r\nimport { union, difference } from \"lodash\";\r\nimport cn from 'classnames';\r\nimport './style.less';\r\nimport MCIcon from \"components/icon\";\r\nimport * as Util from './util';\r\nimport NoteAssigner from \"./note-assigner\";\r\nimport {BASE_CLS} from \"./util\";\r\nimport {ScheduleNode} from \"components/scheduling/types\";\r\nimport {NotesForPilotEditorApi, useNotesForPilotEditorApi} from \"./api\";\r\n\r\nexport interface NotesForPilotEditorProps {\r\n\r\n entities: ScheduleNode[],\r\n\r\n // Enable read-only mode to prevent user edits.\r\n readOnly?: boolean,\r\n\r\n /**\r\n * Allows this component to display the NoteAssigner drawer.\r\n * If you want to control the PaxCgoAdder drawer externally, set this to false.\r\n * Defaults to true.\r\n */\r\n displayNoteAssignerDrawer?: boolean,\r\n\r\n // Allows the internal state to be overwritten with an external state\r\n overrideState?: {\r\n state: State,\r\n dispatch: Dispatcher\r\n },\r\n\r\n api?: NotesForPilotEditorApi\r\n}\r\n\r\nexport const NotesForPilotEditor: React.FC = (props) => {\r\n const internalApi = useNotesForPilotEditorApi(props);\r\n let api = props.api ?? internalApi;\r\n\r\n const notes = api.getNotes();\r\n\r\n function renderEntity(entity: ScheduleNode){\r\n\r\n const name = Util.getEntityName(entity);\r\n\r\n const iconType = Util.getEntityIcon(entity);\r\n\r\n return (\r\n \r\n ) : null\r\n }\r\n >\r\n
\r\n \r\n {name}\r\n
\r\n \r\n )\r\n }\r\n\r\n function renderNote(noteId: number){\r\n\r\n const message = api.getNoteById(noteId);\r\n const entities = api.getEntitiesWithNote(noteId);\r\n\r\n const visible = api.visibleNotes.get().includes(noteId);\r\n\r\n let body = (\r\n \r\n \r\n {entities.length} PAX/CGO Assigned\r\n \r\n \r\n \r\n {entities.map(Util.getEntityName).join(', ')}\r\n \r\n \r\n (Click to view names)\r\n \r\n \r\n \r\n );\r\n\r\n if (visible){\r\n body = (\r\n <>\r\n {body}\r\n \r\n {entities.map(renderEntity)}\r\n \r\n \r\n )\r\n }\r\n\r\n return (\r\n \r\n \r\n {!props.readOnly ? (\r\n e.stopPropagation()}\r\n style={{ width: '100%' }}\r\n onChange={(e) => {\r\n api.updateNote(noteId, e.target.value);\r\n }}\r\n />\r\n ) : (\r\n {message}\r\n )}\r\n \r\n {!props.readOnly ? (\r\n \r\n {\r\n e.stopPropagation();\r\n api.removeNote(noteId);\r\n }}\r\n />\r\n \r\n ) : null}\r\n \r\n }\r\n >\r\n api.visibleNotes.toggle(noteId)}\r\n className={BASE_CLS + '-collapse-handle'}\r\n >\r\n \r\n
\r\n {body}\r\n
\r\n \r\n \r\n )\r\n }\r\n\r\n const openKeys = Array.from(notes.keys());\r\n\r\n let noteAssigner = null;\r\n if (props.displayNoteAssignerDrawer){\r\n noteAssigner = (\r\n \r\n \r\n \r\n )\r\n }\r\n\r\n return (\r\n <>\r\n \r\n {Array.from(notes.keys()).map(renderNote)}\r\n \r\n {noteAssigner}\r\n \r\n )\r\n}\r\n\r\nNotesForPilotEditor.defaultProps = {\r\n displayNoteAssignerDrawer: true\r\n}","import { State, Dispatcher } from \"./state\";\r\nimport {Button, Col, Row} from \"antd\";\r\nimport {HTMLAttributes} from \"react\";\r\nimport * as Util from './util';\r\n\r\nexport interface ToolbarProps extends HTMLAttributes {\r\n state: State,\r\n dispatch: Dispatcher\r\n}\r\n\r\nconst Toolbar: React.FC = ({ state, dispatch, ...rest }) => {\r\n\r\n function addEmpty(){\r\n dispatch({ type: 'ADD_EMPTY_NOTE' });\r\n }\r\n\r\n function clear(){\r\n dispatch({ type: 'CLEAR' });\r\n }\r\n\r\n function reset(){\r\n dispatch({ type: 'RESET' });\r\n }\r\n\r\n function openNoteAssigner(){\r\n dispatch({ type: 'OPEN_NOTE_ASSIGNER', open: true });\r\n }\r\n\r\n let assignNoteBtn = null;\r\n if (Util.getValidNotes(state.notes).size){\r\n assignNoteBtn = (\r\n \r\n Assign PAX/CGO\r\n \r\n )\r\n }\r\n\r\n return \r\n \r\n Add Note\r\n \r\n {assignNoteBtn}\r\n \r\n \r\n Delete All\r\n \r\n \r\n Reset\r\n \r\n \r\n}\r\n\r\nexport default Toolbar;","import {useEffect, useState} from \"react\";\r\n\r\nexport type StateWrapperFunc = (options: { state: S, setState: (s: S) => void }) => JSX.Element\r\n\r\nexport type StateWrapperProps = {\r\n children: StateWrapperFunc,\r\n onStateChanged?: (newState: S) => void,\r\n state?: S,\r\n defaultState?: S\r\n}\r\n\r\n/**\r\n * Wrapper around JSX code that can add statefulness without having to move that code to a new component.\r\n */\r\nconst StateWrapper = (props: StateWrapperProps) => {\r\n const [ state, setState ] = useState(props?.defaultState);\r\n\r\n useEffect(() => {\r\n if (props.state){\r\n setState(props.state);\r\n }\r\n }, [props.state]);\r\n\r\n return props.children?.({\r\n state: state,\r\n setState: (newState) => {\r\n setState(currState => {\r\n const merged = { ...currState, ...newState };\r\n props?.onStateChanged(merged);\r\n return merged;\r\n });\r\n }\r\n })\r\n}\r\n\r\nexport default StateWrapper;","import React from \"react\";\r\nimport {produce} from \"immer\";\r\nimport {FlightPath} from \"../../../../common/flight-leg/flight-path\";\r\nimport {message} from \"antd\";\r\nimport {CreateUndoRedoReducer, UndoRedoState} from \"common/reducer/undo-redo\";\r\n\r\nexport const DefaultState = {\r\n initPath: [] as string[],\r\n path: {\r\n present: [],\r\n past: [],\r\n future: []\r\n } as UndoRedoState,\r\n redoSteps: [],\r\n changed: false\r\n}\r\n\r\nexport type State = typeof DefaultState;\r\n\r\nexport type Action = {\r\n type: 'INIT',\r\n payload: {\r\n flightPath: string[],\r\n }\r\n} | {\r\n type: 'RESET'\r\n} | {\r\n type: 'UPDATE_ROUTE',\r\n payload: {\r\n removeIndex?: number,\r\n add?: {\r\n locId: string,\r\n insertIndex?: number\r\n }\r\n }\r\n} | {\r\n type: 'MOVE',\r\n payload: {\r\n startIndex: number,\r\n endIndex: number\r\n }\r\n} | {\r\n type: 'UNDO' | 'REDO'\r\n}\r\n\r\nexport const Reducer: React.Reducer = (prevState, action) => {\r\n return produce(prevState, (state) => {\r\n\r\n const PathReducer = CreateUndoRedoReducer();\r\n\r\n switch (action.type){\r\n case \"INIT\": {\r\n const fp = [...action.payload.flightPath];\r\n state.initPath = fp;\r\n state.path = {\r\n past: [],\r\n present: [...fp],\r\n future: []\r\n }\r\n state.changed = false;\r\n return state;\r\n }\r\n case \"RESET\": {\r\n state.path = {\r\n past: [],\r\n present: [...state.initPath],\r\n future: []\r\n };\r\n state.changed = false;\r\n return state;\r\n }\r\n case \"UPDATE_ROUTE\": {\r\n const fp = [...state.path.present];\r\n if (action.payload.removeIndex) {\r\n fp.splice(action.payload.removeIndex, 1);\r\n }\r\n if (action.payload.add) {\r\n fp.splice(\r\n action.payload.add.insertIndex || fp.length,\r\n 0,\r\n action.payload.add.locId\r\n )\r\n }\r\n state.path = PathReducer(prevState.path, { type: 'UPDATE', payload: fp })\r\n break;\r\n }\r\n case \"MOVE\": {\r\n const {startIndex, endIndex} = action.payload;\r\n if (\r\n startIndex === endIndex ||\r\n startIndex < 0 ||\r\n endIndex >= state.path.present.length\r\n ) return state;\r\n\r\n const fp = [...state.path.present];\r\n\r\n let error: string;\r\n\r\n if (endIndex === 0 || startIndex === 0){\r\n error = 'Cannot displace flight departure.';\r\n }\r\n\r\n const items = fp.splice(startIndex, 1);\r\n fp.splice(endIndex, 0, ...items);\r\n\r\n if (error) {\r\n message.error(error);\r\n return state;\r\n }\r\n\r\n state.path = PathReducer(prevState.path, { type: 'UPDATE', payload: fp });\r\n break;\r\n }\r\n case \"UNDO\":\r\n state.path = PathReducer(prevState.path, { type: 'UNDO' });\r\n break;\r\n case \"REDO\":\r\n state.path = PathReducer(prevState.path, { type: 'REDO' });\r\n break;\r\n default:\r\n return prevState;\r\n }\r\n state.changed = true;\r\n return state;\r\n })\r\n}","import {castDraft, produce} from \"immer\";\r\n\r\nexport interface UndoRedoState {\r\n present: T,\r\n past: T[],\r\n future: T[]\r\n}\r\n\r\nexport type UndoRedoAction = {\r\n type: 'UPDATE',\r\n payload: T\r\n} | {\r\n type: 'UNDO' | 'REDO'\r\n}\r\n\r\ninterface CreateUndoRedoReducerArgs {\r\n\r\n /**\r\n * Max number of versions kept in memory\r\n * @default 100\r\n */\r\n maxSteps?: number\r\n}\r\n\r\nexport function CreateUndoRedoReducer(args?: CreateUndoRedoReducerArgs){\r\n const maxSteps = args?.maxSteps || 100;\r\n\r\n return (prevState: UndoRedoState, action: UndoRedoAction) => {\r\n return produce(prevState, (state) => {\r\n switch (action.type){\r\n case \"UPDATE\":\r\n state.past.push(state.present);\r\n if (state.past.length > maxSteps){\r\n state.past = state.past.slice(state.past.length - maxSteps, state.past.length);\r\n }\r\n state.future = [];\r\n state.present = castDraft(action.payload);\r\n break\r\n case \"UNDO\":\r\n const nextPast = state.past.pop();\r\n state.future.splice(0, 0, state.present);\r\n state.present = nextPast;\r\n break;\r\n case \"REDO\":\r\n const nextFuture = state.future.splice(0, 1);\r\n state.past.push(state.present);\r\n state.present = nextFuture[0];\r\n break\r\n }\r\n\r\n return state;\r\n })\r\n }\r\n}","import {DefaultState, Reducer, State} from \"./state\";\r\nimport {Dispatch, ReducerAction, useEffect, useReducer} from \"react\";\r\n\r\nexport interface UseRouteEditorArgs {\r\n initFlightPath?: string[],\r\n overrideState?: State,\r\n overrideDispatch?: Dispatch>\r\n}\r\n\r\nfunction useRouteEditorApi(args?: UseRouteEditorArgs){\r\n const [ _state, _dispatch ] = useReducer(Reducer, DefaultState);\r\n\r\n const state = args?.overrideState || _state;\r\n const dispatch = args?.overrideDispatch || _dispatch;\r\n\r\n useEffect(() => {\r\n if (args?.initFlightPath){\r\n dispatch({ type: 'INIT', payload: { flightPath: args.initFlightPath } });\r\n }\r\n }, []);\r\n\r\n return {\r\n state: state,\r\n dispatch: dispatch,\r\n route: {\r\n get: () => state.path.present,\r\n reset: () => {\r\n dispatch({ type: 'RESET' })\r\n },\r\n remove: (index: number) => (\r\n dispatch({ type: 'UPDATE_ROUTE', payload: { removeIndex: index } })\r\n ),\r\n add: (locId: string, insertIndex?: number) => {\r\n if (!locId) return;\r\n\r\n dispatch({type: 'UPDATE_ROUTE', payload: {add: { locId, insertIndex } }});\r\n },\r\n move: (startIndex: number, endIndex: number) => {\r\n dispatch({ type: 'MOVE', payload: { startIndex, endIndex } })\r\n },\r\n undo: () => dispatch({ type: 'UNDO' }),\r\n redo: () => dispatch({ type: 'REDO' })\r\n }\r\n }\r\n}\r\n\r\nexport type Api = ReturnType\r\n\r\nexport default useRouteEditorApi;","import React, {Dispatch, ReducerAction, useEffect, useRef, useState} from \"react\";\r\nimport {Reducer, State} from './state';\r\nimport {Button, Col, Icon, message, Row, Spin} from \"antd\";\r\nimport {DraggableBodyRow} from \"../../../TableDragSorting\";\r\nimport {ColumnProps} from \"antd/lib/table\";\r\nimport {Location} from \"../../../../common/types/location\";\r\nimport CenteredLoadingScreen from \"../../../CenteredLoadingScreen\";\r\nimport useRouteEditorApi from \"./hook\";\r\nimport \"./route-editor.less\";\r\nimport {LocationSelect} from \"../../../form/select/LocationSelect\";\r\nimport useApolloClientHelper from \"../../../../hooks/useApolloClientHelper\";\r\nimport ETable from \"../../../enchanced-antd-table\";\r\n\r\nexport interface RouteEditorProps {\r\n initFlightPath?: string[],\r\n overrideState?: {\r\n state: State,\r\n dispatch: Dispatch>\r\n }\r\n}\r\n\r\n/**\r\n * Asynchronously turns a list of location IDs into location objects of the Location type\r\n * @param locIds list of location IDs\r\n */\r\nfunction useDereferencedLocations(locIds: string[]){\r\n const apolloHelper = useApolloClientHelper();\r\n const [ locationList, setLocationList ] = useState(null);\r\n const [ loading, setLoading ] = useState(false);\r\n\r\n // Holds the last locIds value (used for race condition)\r\n const currLocIds = useRef(locIds);\r\n\r\n async function updateLocationList(){\r\n setLoading(true);\r\n try{\r\n const locations = await apolloHelper.resolveEntityIdsByType(locIds, 'Location');\r\n if (currLocIds.current === locIds){\r\n // Prevents race condition by ensuring final change to locIds gets rendered\r\n setLocationList(locations);\r\n }\r\n }\r\n catch (err){\r\n const msg = 'Failed to load location data';\r\n console.error(msg, err);\r\n message.error(msg);\r\n }\r\n finally {\r\n if (currLocIds.current === locIds) {\r\n // Prevents race condition by ensuring only the final change to locIds turns off the loading state\r\n setLoading(false);\r\n }\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n currLocIds.current = locIds;\r\n updateLocationList();\r\n }, [ locIds ]);\r\n\r\n return {\r\n locationList: locationList,\r\n loading: loading\r\n };\r\n}\r\n\r\nconst RouteEditor: React.FC = (props) => {\r\n const api = useRouteEditorApi({\r\n initFlightPath: props.initFlightPath,\r\n overrideState: props.overrideState?.state,\r\n overrideDispatch: props.overrideState?.dispatch\r\n });\r\n\r\n const { locationList, loading } = useDereferencedLocations(api.route.get());\r\n\r\n const { state, route } = api;\r\n\r\n let table: React.ReactNode = \r\n\r\n function renderLocName(loc: Location){\r\n return loc.name + (loc.field && loc.block ? \" (\" + loc.block + \"-\" + loc.field + \")\" : \"\");\r\n }\r\n\r\n if (locationList !== null) {\r\n const columns: ColumnProps[] = [\r\n {\r\n title: '',\r\n key: 'delete',\r\n render: (_, __, index) => {\r\n if (index === 0) return null;\r\n return (\r\n route.remove(index)}\r\n />\r\n )\r\n },\r\n width: 50\r\n },\r\n {\r\n title: '#',\r\n key: '#',\r\n render: (_, __, index) => index + 1,\r\n width: 25\r\n },\r\n {\r\n title: \"Name\",\r\n width: 400,\r\n render: (_, loc) => (\r\n renderLocName(loc)\r\n )\r\n },\r\n {\r\n title: 'Type',\r\n key: 'type',\r\n dataIndex: 'type'\r\n },\r\n {\r\n title: '',\r\n render: (_, loc, index) => (\r\n \r\n {\r\n route.add(loc._id, index);\r\n }}\r\n />\r\n \r\n )\r\n }\r\n ]\r\n\r\n table = (\r\n \r\n className=\"draggable-table mc-table mc-table-bordered\"\r\n dataSource={locationList}\r\n columns={columns}\r\n rowKey={(_, index) => String(index)}\r\n size=\"small\"\r\n pagination={false}\r\n components={{\r\n body: {\r\n row: DraggableBodyRow\r\n }\r\n }}\r\n onRow={(row, index) => {\r\n const rowProps = {\r\n moveRow: route.move,\r\n index\r\n }\r\n return { ...rowProps}\r\n }}\r\n />\r\n )\r\n }\r\n\r\n return (\r\n
\r\n \r\n \r\n

Drag to reorder flight locations

\r\n \r\n \r\n Add location:\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n }>\r\n {table}\r\n \r\n
\r\n )\r\n}\r\n\r\nexport default RouteEditor;","import {\r\n Alert,\r\n Button,\r\n Card,\r\n Col,\r\n DatePicker, Divider,\r\n Drawer,\r\n Dropdown,\r\n Form,\r\n Icon,\r\n Input,\r\n Layout,\r\n Menu,\r\n message,\r\n Modal,\r\n Popconfirm, Radio,\r\n Row,\r\n Spin,\r\n Tabs, Tooltip,\r\n Typography\r\n} from 'antd';\r\nimport {\r\n buildLocNameMapFromPaxCgoLists,\r\n computeLegWeightsAndCounts, findDroppedPaxCgoInLegs,\r\n getFlightLegManagerFromFlightQuery,\r\n graphqlCgoToFlightManCgo, graphqlPaxToFlightManPax\r\n} from 'common/flight-leg/util';\r\nimport AddFuelStopToFlightDrawer from 'components/flights/scheduling/AddFuelStopToFlightDrawer';\r\nimport AddLegsToFlightDrawer from 'components/flights/scheduling/AddLegsToFlightDrawer';\r\nimport FlightManualScheduleLegPax from 'components/flights/scheduling/FlightManualScheduleLegPax';\r\nimport FlightManualScheduleLegs from 'components/flights/scheduling/FlightManualScheduleLegs';\r\nimport ContractSelect from 'components/form/ContractSelect';\r\nimport {LocationSelect} from 'components/form/select/LocationSelect';\r\nimport gql from 'graphql-tag';\r\nimport moment from 'moment';\r\nimport React, {CSSProperties, useContext, useMemo, useRef, useState} from 'react';\r\nimport {Mutation, Query, useApolloClient, useQuery} from 'react-apollo';\r\nimport {useHistory, useParams, withRouter} from 'react-router-dom';\r\nimport {castArray, createNewLeg, getDestinationsFromLegs, paxOnFlightLeg, safeGet} from '../../../common/util';\r\nimport AircraftSelect from '../../form/AircraftSelect';\r\nimport LocationOnshoreSelect from '../../form/LocationOnshoreSelect';\r\nimport PilotSelect from '../../form/PilotSelect';\r\nimport LoadingContent from '../../LoadingContent';\r\nimport NotAuthorized from '../../NotAuthorized';\r\nimport MainHeader, {MainHeaderProps} from '../../scheduling/MainHeader';\r\nimport MainLayout from '../../scheduling/MainLayout';\r\nimport useManifestPrintout from '../../scheduling/Printout/useManifestPrintout';\r\nimport {UserGroup} from '../../userGroup';\r\nimport withCognitoUser from '../../WithCognitoUser';\r\nimport WithOrgData, {OrgDataProps, WithOrgDataProps} from '../../WithOrgData';\r\nimport './FlightScheduleEdit.less';\r\nimport FlightScheduleLegPax from './FlightScheduleLegPax';\r\nimport FlightScheduleLegs from './FlightScheduleLegs';\r\nimport {OrgDataContext} from \"../../../context/orgData\";\r\nimport {useMutation} from \"@apollo/react-hooks\";\r\nimport {FlightLeg} from \"../../../schema\";\r\nimport {useMultiSelect} from \"../../../hooks/useMultiSelect\";\r\nimport {ButtonProps} from \"antd/lib/button\";\r\nimport {FormComponentProps} from \"antd/lib/form/Form\";\r\nimport {createScheduledEntityColumns} from \"./columns\";\r\nimport ETable from \"../../enchanced-antd-table\";\r\nimport {renderGroupNameMenuItems} from \"./FlightScheduleUtils\";\r\nimport {ScheduledFlightFragment} from \"../../../Queries/Scheduling\";\r\nimport {LocationFragment} from \"../../../Queries/Location\";\r\nimport ScheduledPaxCgoAdder from \"./scheduled-paxcgo-adder\";\r\nimport pluralize from 'pluralize';\r\nimport useBreakpoints from \"../../../hooks/useBreakpoints\";\r\nimport {NotesForPilotEditor} from \"./notes-for-pilot/editor/notes-for-pilot-editor\";\r\nimport {useNotesForPilotEditorApi} from \"./notes-for-pilot/editor\";\r\nimport { union } from \"lodash\";\r\nimport {PartialFlightLeg} from \"./scheduled-paxcgo-adder/hook\";\r\nimport {CgoNode, PaxNode} from \"../../../common/types/carriable\";\r\nimport {arrayToMap, isTruey} from \"../../../common/util-ts\";\r\nimport useApolloClientHelper from \"../../../hooks/useApolloClientHelper\";\r\nimport StateWrapper from \"../../../component-wrappers/state-wrapper\";\r\nimport useRouteEditorApi from \"./route-editor/hook\";\r\nimport RouteEditor from \"./route-editor/route-editor\";\r\nimport {Location} from \"../../../common/types/location\";\r\nimport {FlightPath} from \"../../../common/flight-leg/flight-path\";\r\n\r\nconst { Content } = Layout;\r\n\r\n// TODO: Replace me with a real interface\r\nexport type FlightScheduleEditProps = {\r\n orgData?: OrgDataProps\r\n};\r\n\r\ntype TEMP_TYPE_Flight = any;\r\n\r\ntype TEMP_TYPE_Flight_Query = {\r\n getFlight: TEMP_TYPE_Flight\r\n};\r\ntype TEMP_TYPE_Entity = PaxNode | CgoNode\r\ntype TEMP_TYPE_Location = {\r\n _id: string\r\n}\r\n\r\nconst FLIGHT = gql`\r\nquery Flight($_id: ID!){\r\n getFlight(_id: $_id){\r\n ...ScheduledFlightFragment\r\n }\r\n}\r\n${ScheduledFlightFragment}\r\n`\r\n\r\nconst UPDATE_FLIGHT_FORM = gql`\r\nmutation UpdateFlightForm($payload: FlightNodeInput!, $orgID: ID!){\r\n setFlight(payload: $payload, orgID: $orgID){\r\n ...ScheduledFlightFragment\r\n }\r\n}\r\n${ScheduledFlightFragment}\r\n`\r\n\r\nconst UPDATE_FLIGHT_LEGS = gql`\r\nmutation UpdateFlightLegs($payload: FlightNodeInput!, $orgID: ID!){\r\n setFlight(payload: $payload, orgID: $orgID){\r\n ...ScheduledFlightFragment\r\n }\r\n}\r\n${ScheduledFlightFragment}\r\n`\r\n\r\nconst UPDATE_FLIGHT_PASSENGER = gql`\r\nmutation UpdateFlightPassenger($flight: FlightNodeInput!, $orgID: ID!){\r\n setFlight(payload: $flight, orgID: $orgID){\r\n ...ScheduledFlightFragment\r\n }\r\n}\r\n${ScheduledFlightFragment}\r\n`\r\n\r\nconst DELETE_FLIGHT = gql`\r\nmutation DeleteFlight($_id: ID! $tpID: ID!){\r\n deleteFlight(_id: $_id tpID: $tpID){\r\n ...ScheduledFlightFragment\r\n }\r\n}\r\n${ScheduledFlightFragment}\r\n`\r\nconst SCHEDULED_TO_EXPECTED = gql`\r\nmutation ScheduledToExpected($flightID: String!){\r\n setScheduledToExpected(flightID: $flightID){\r\n ...ScheduledFlightFragment\r\n }\r\n}\r\n${ScheduledFlightFragment}\r\n`\r\n\r\nconst GET_LOCATION = gql`\r\nquery GetLocation($_id: ID!){\r\n getLocation(_id: $_id){\r\n ...LocationFragment\r\n }\r\n}\r\n${LocationFragment}\r\n`\r\n\r\nconst defaultRules = [\r\n {\r\n required: true,\r\n message: 'This field is required'\r\n }\r\n]\r\n\r\ninterface FlightFormProps extends FormComponentProps, WithOrgDataProps {\r\n flightid: string,\r\n editorProps: any,\r\n data: TEMP_TYPE_Flight\r\n}\r\n\r\nconst FlightForm_Internal: React.FC = (props) => {\r\n const {\r\n form: {getFieldDecorator, validateFields, isFieldsTouched, getFieldValue, resetFields},\r\n data,\r\n flightid,\r\n orgData,\r\n editorProps\r\n } = props;\r\n\r\n const client = useApolloClient();\r\n\r\n const defaultFieldProps = {\r\n size: 'default' as ('small' | 'default' | 'large')\r\n }\r\n\r\n const getPilotValue = (data) => {\r\n const pilot = data && data.pilot;\r\n if (!pilot)\r\n return null\r\n const pilotName = pilot.name;\r\n let name = '';\r\n if (pilotName){\r\n name = `${pilotName.lastName || ''}, ${pilotName.firstName || ''}`\r\n }\r\n return {\r\n key: pilot._id,\r\n label: name\r\n }\r\n }\r\n\r\n const getCoPilotValue = (data) => {\r\n const pilot = data && data.copilot;\r\n if (!pilot)\r\n return null\r\n const pilotName = pilot.name;\r\n let name = '';\r\n if (pilotName){\r\n name = `${pilotName.lastName || ''}, ${pilotName.firstName || ''}`\r\n }\r\n return {\r\n key: pilot._id,\r\n label: name\r\n }\r\n }\r\n\r\n const formFields = [\r\n {\r\n label: 'Scheduled Flight Date',\r\n key: 'scheduledFlightDate',\r\n component: current < moment().endOf('day')} format=\"YYYY-MM-DD\" />,\r\n getValue: (data) => moment(data.scheduledFlightDate),\r\n options: {\r\n rules: defaultRules\r\n }\r\n },\r\n {\r\n label: 'Flight Designation',\r\n key: 'desig',\r\n component: ,\r\n options: {\r\n rules: defaultRules\r\n }\r\n },\r\n {\r\n label: 'Controlling Heliport',\r\n key: 'lastKnownController',\r\n component: ,\r\n options: {\r\n rules: defaultRules\r\n },\r\n getValue: (data) => {\r\n const lastKnownController = data['lastKnownController']\r\n if (!lastKnownController){\r\n return null;\r\n }\r\n return {\r\n key: lastKnownController._id,\r\n label: lastKnownController.name\r\n }\r\n }\r\n },\r\n {\r\n label: 'Departure',\r\n key: 'departureID',\r\n component: ,\r\n options: {\r\n rules: defaultRules\r\n },\r\n getValue: (data) => {\r\n let departure = data['departureID']\r\n if (!departure){\r\n if(data.legsArray && data.legsArray[0]){\r\n departure = data.legsArray[0].departureID\r\n console.log(data.legsArray[0].departureID)\r\n }else {\r\n return null;\r\n }\r\n }\r\n return {\r\n key: departure._id,\r\n label: departure.name\r\n }\r\n }\r\n },\r\n {\r\n label: 'Aircraft',\r\n key: 'aircraftID',\r\n component: ,\r\n options: {\r\n rules: defaultRules\r\n },\r\n getValue: (data) => {\r\n const aircraft = data && data.aircraftID;\r\n if (!aircraft)\r\n return null;\r\n return {\r\n key: aircraft._id,\r\n label: aircraft.tailNum\r\n }\r\n }\r\n },\r\n {\r\n label: 'Contract',\r\n key: 'contractID',\r\n component: ,\r\n options: {\r\n rules: defaultRules\r\n },\r\n getValue: (data) => {\r\n const contract = data && data.contract;\r\n if (!contract)\r\n return null;\r\n return {\r\n key: contract._id,\r\n label: contract.name\r\n }\r\n }\r\n },\r\n {\r\n label: 'Pilot',\r\n key: 'pilotID',\r\n component: ,\r\n getValue: getPilotValue\r\n },\r\n {\r\n label: 'Co-Pilot',\r\n key: 'copilotID',\r\n component: ,\r\n getValue: getCoPilotValue\r\n }\r\n ]\r\n return (\r\n {\r\n console.error(error);\r\n message.error('Failed to update flight')\r\n }}>\r\n {\r\n (mutate) => (\r\n
{\r\n validateFields((err, values) => {\r\n if (!err && isFieldsTouched()){\r\n const startMutation = () => {\r\n let departure = values.departureID && {_id: values.departureID.key, name: values.departureID.label}\r\n // if(!departure){\r\n // departure = getFlightDeparture(data)\r\n // }\r\n // const newLegs = JSON.stringify( Object.assign({}, paxListToFlightLegs(departure, data.paxIDList, data.cgoIDList)) );\r\n const flManager = getFlightLegManagerFromFlightQuery(data, undefined, { id: departure?._id, name: departure?.name });\r\n const newLegs = JSON.stringify( Object.assign({}, flManager.buildFlightLegs()) )\r\n const variables = {\r\n payload: {\r\n _id: flightid,\r\n callSign: data.callSign,\r\n tpID: orgData.transporter._id,\r\n customerID: orgData.customer._id,\r\n desig: values.desig,\r\n scheduledFlightDate: values.scheduledFlightDate.format('YYYY-MM-DD'),\r\n pilotID: values.pilotID ? values.pilotID.key : undefined,\r\n copilotID: values.copilotID ? values.copilotID.key : undefined,\r\n aircraftID: values.aircraftID ? values.aircraftID.key : undefined,\r\n contractID: values.contractID ? values.contractID.key : undefined,\r\n departureID: departure && departure._id,\r\n lastKnownController: data['lastKnownController'] && data['lastKnownController']._id,\r\n legs: newLegs\r\n },\r\n orgID: orgData.getActiveOrgID()\r\n }\r\n const getPilotNameObj = (name) => {\r\n if(!name) return null\r\n const [ last, first ] = name.split(', ');\r\n return {\r\n __typename: 'Name',\r\n lastName: last,\r\n firstName: first\r\n }\r\n }\r\n const pilotName = getPilotNameObj(values.pilotID && values.pilotID.label);\r\n const copilotName = getPilotNameObj(values.copilotID && values.copilotID.label);\r\n\r\n let newPaxList = data.paxIDList.map((pax) => {\r\n let legPax = flManager.allPax.get(pax._id);\r\n return {\r\n ...pax,\r\n departureID: {\r\n __typename: 'Location',\r\n _id: legPax.departureID,\r\n name: flManager.getLocationName(legPax.departureID)\r\n },\r\n destinationID: {\r\n __typename: 'Location',\r\n _id: legPax.destinationID,\r\n name: flManager.getLocationName(legPax.destinationID)\r\n }\r\n }\r\n })\r\n\r\n let newCgoList = data.cgoIDList.map((cgo) => {\r\n let legCgo = flManager.allCgo.get(cgo._id);\r\n return {\r\n ...cgo,\r\n departureID: {\r\n __typename: 'Location',\r\n _id: legCgo.departureID,\r\n name: flManager.getLocationName(legCgo.departureID)\r\n },\r\n destinationID: {\r\n __typename: 'Location',\r\n _id: legCgo.destinationID,\r\n name: flManager.getLocationName(legCgo.destinationID)\r\n }\r\n }\r\n })\r\n\r\n return mutate({\r\n variables,\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setFlight: {\r\n __typename: 'FlightNode',\r\n _id: flightid,\r\n tpID: {\r\n __typename: 'Transporter',\r\n ...orgData.transporter\r\n },\r\n customerID: {\r\n __typename: 'Customer',\r\n ...orgData.customer\r\n },\r\n desig: values.desig,\r\n scheduledFlightDate: values.scheduledFlightDate.format('YYYY-MM-DD'),\r\n callSign: values.callSign,\r\n pilot: {\r\n __typename: 'Pilot',\r\n _id: values.pilotID && values.pilotID.key,\r\n name: pilotName\r\n },\r\n copilot: {\r\n __typename: 'Pilot',\r\n _id: values.copilotID && values.copilotID.key,\r\n name: copilotName\r\n },\r\n aircraftID: {\r\n __typename: 'Aircraft',\r\n _id: values.aircraftID && values.aircraftID.key,\r\n tailNum: values.aircraftID && values.aircraftID.label\r\n },\r\n contract: {\r\n __typename: 'Contract',\r\n _id: values.contractID && values.contractID.key,\r\n name: values.contractID && values.contractID.label\r\n },\r\n departureID: {\r\n __typename: 'Location',\r\n _id: (departure && departure._id) || data.departureID._id,\r\n name: (departure && departure.name) || data.departureID.name\r\n },\r\n legs: newLegs || data.legs,\r\n paxIDList: newPaxList,\r\n cgoIDList: newCgoList\r\n }\r\n }\r\n })\r\n }\r\n\r\n client.query({\r\n query: GET_LOCATION,\r\n variables: {\r\n _id: values.departureID && values.departureID.key\r\n }\r\n })\r\n .then(() => {\r\n // TODO: Is this needed anymore?\r\n startMutation()\r\n .then(() => editorProps.refetch())\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n startMutation()\r\n })\r\n\r\n }\r\n })\r\n }}>\r\n \r\n {formFields.map((field, i) => (\r\n \r\n \r\n {getFieldDecorator(field.key, {\r\n ...field.options,\r\n initialValue: field.getValue ? field.getValue(data) : data[field.key]\r\n })(\r\n field.component\r\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 FlightForm = WithOrgData( Form.create()( FlightForm_Internal ));\r\n\r\ninterface PrintoutButtonProps extends ButtonProps {\r\n flight: any,\r\n orgData?: any,\r\n cognitoUser?: any\r\n}\r\n\r\nvar PrintoutButton: React.FC = ({flight, orgData, cognitoUser, ...restProps}) => {\r\n const [ fetchPrintout, fetching ] = useManifestPrintout('FlightWithLegs', 'Hess');\r\n const userAttr = cognitoUser.attributes;\r\n return (\r\n \r\n {({ data }) => {\r\n const manifestPrintouts = safeGet(['getCustomer', 'manifestPrintout'], data) || [];\r\n const flightManifest = manifestPrintouts.find((m) => m.type === 'Flight'); \r\n const hessLayout = flightManifest && flightManifest.layouts.find((l) => l.name === 'Hess');\r\n const logoURL = hessLayout && hessLayout.logo;\r\n const handleClick = () => {\r\n if (!flight){\r\n return;\r\n }\r\n const legs = flight.legsArray || [];\r\n const body = {\r\n issuedBy: `${userAttr.given_name} ${userAttr.family_name}`,\r\n orgName: orgData.customer.name,\r\n logoURL: logoURL,\r\n desig: flight.desig,\r\n departure: flight.departureID && flight.departureID.name,\r\n aircraftNo: flight.aircraftID && flight.aircraftID.tailNum,\r\n scheduledFlightDate: flight.scheduledFlightDate,\r\n legs: legs.map((leg) => {\r\n return {\r\n departure: leg.departure,\r\n destination: leg.destination,\r\n passengers: leg.paxIDs.map((pax) => {\r\n return {\r\n _id: pax._id,\r\n lastName: pax.lastName,\r\n firstName: pax.firstName,\r\n employer: pax.employerID && pax.employerID.name,\r\n chargeCode: pax.chargeCode && pax.chargeCode.toUpperCase(),\r\n paxWeight: pax.paxWeight,\r\n bagWeight: pax.bagWeight,\r\n departure: pax.departureID && pax.departureID.name,\r\n destination: pax.destinationID && pax.destinationID.name,\r\n dob: pax.personID && pax.personID.dob,\r\n nation: pax.personID && pax.personID.nation,\r\n credentials: pax.personID && pax.personID.credentials\r\n }\r\n }),\r\n cargo: leg.cgoIDs.map((cgo) => {\r\n return {\r\n _id: cgo._id,\r\n name: cgo.name,\r\n weight: cgo.weight,\r\n departure: cgo.departureID && cgo.departureID.name,\r\n destination: cgo.destinationID && cgo.destinationID.name,\r\n attentionTo: cgo.attentionTo,\r\n deliveredBy: cgo.deliveredBy,\r\n transitType: cgo.transitType\r\n }\r\n })\r\n }\r\n })\r\n }\r\n fetchPrintout(body, true, `${orgData.customer.name} Flight Manifest.xlsx`)\r\n .catch((err) => {\r\n message.error('Failed to download printout', 3)\r\n .then(() => message.error(err.message), null)\r\n })\r\n }\r\n return (\r\n \r\n )\r\n }}\r\n \r\n )\r\n}\r\n\r\nPrintoutButton = WithOrgData( withCognitoUser( PrintoutButton ) )\r\n\r\nconst INIT_STATE = {\r\n selectedLeg: 0,\r\n selectedLegs: [],\r\n manualAssign: \"auto\",\r\n passengerDrawerOpen: false,\r\n routeEditorOpen: false,\r\n passengerModalOpen: false,\r\n deleting: false,\r\n manualLegs: []\r\n}\r\n\r\ninterface RouterParams {\r\n id: string\r\n}\r\n\r\ninterface ReviewChangesProps {\r\n entitiesToRemove: TEMP_TYPE_Entity[],\r\n entitiesToModify: TEMP_TYPE_Entity[],\r\n entitiesToAdd: TEMP_TYPE_Entity[],\r\n manualLegs?: FlightLeg[]\r\n}\r\n\r\nconst ReviewChanges: React.FC = (props) => {\r\n function renderEntityList(title: string, icon: React.ReactNode, rowColor: string, entities: TEMP_TYPE_Entity[]){\r\n if (!entities || !entities.length) return null;\r\n\r\n const columns = createScheduledEntityColumns(null, { reviewMode: true });\r\n\r\n columns.unshift({\r\n title: '',\r\n key: 'icon',\r\n render: () => icon\r\n })\r\n\r\n return
\r\n

{title}

\r\n record._id}\r\n onRow={() => ({ style: { backgroundColor: rowColor} })}\r\n size=\"small\"\r\n pagination={false}\r\n />\r\n
\r\n }\r\n\r\n function renderTitle(action: string, items: any[]){\r\n let title = `${action} ${items.length} items`;\r\n if (props.manualLegs){\r\n title += ' from legs: ' + props.manualLegs.map(\r\n function RenderLegText(leg){\r\n return `${leg.departure} → ${leg.destination}`;\r\n }\r\n ).join(', ')\r\n }\r\n return title;\r\n }\r\n\r\n return <>\r\n {renderEntityList(renderTitle('Removing', props.entitiesToRemove), , '#ff00003d', props.entitiesToRemove)}\r\n {renderEntityList(renderTitle('Modifying', props.entitiesToModify), , '#0084ff3d', props.entitiesToModify)}\r\n {renderEntityList(renderTitle('Adding', props.entitiesToAdd), , '#00ff003d', props.entitiesToAdd)}\r\n \r\n}\r\n\r\nconst FlightScheduleEdit_Internal: React.FC = (props) => {\r\n const [ state, _setState ] = useState(INIT_STATE);\r\n const orgData = useContext(OrgDataContext);\r\n const history = useHistory();\r\n const routerParams = useParams();\r\n const client = useApolloClient();\r\n const { resolveEntityIdsByType, getScheduledPaxByIds, getScheduledCgoByIds } = useApolloClientHelper();\r\n const drawerBreakpoints = useBreakpoints({\r\n widthOffset: 24\r\n });\r\n\r\n const entityMultiSelect = useMultiSelect({\r\n primaryKey: '_id'\r\n })\r\n\r\n // ---------------------------------------------------------------------------------\r\n // Queries and mutations\r\n // ---------------------------------------------------------------------------------\r\n const { data, loading, error, refetch } = useQuery(FLIGHT,\r\n {\r\n variables: {\r\n _id: routerParams.id\r\n },\r\n fetchPolicy: \"cache-and-network\",\r\n pollInterval: 10000\r\n }\r\n )\r\n\r\n const allEntities = useMemo(() =>\r\n [...castArray(data?.getFlight?.paxIDList), ...castArray(data?.getFlight?.cgoIDList)]\r\n , [data]);\r\n\r\n const notesForPilotApi = useNotesForPilotEditorApi({\r\n entities: allEntities\r\n });\r\n\r\n const routeEditorApi = useRouteEditorApi();\r\n\r\n function setState(newState: Partial){\r\n _setState(currState => ({...currState, ...newState}))\r\n }\r\n\r\n const paxCgoAdderState = ScheduledPaxCgoAdder.useState(routerParams.id, data?.getFlight?.scheduledFlightDate, {\r\n onFlightUpdated: () => setState({ passengerDrawerOpen: false }),\r\n override: {\r\n addEntitiesToFlight: async (paxnodes, cgonodes) => {\r\n if (!data?.getFlight) return;\r\n const flight = data.getFlight;\r\n if (state.manualAssign === 'manual'){\r\n // Manual assign\r\n\r\n const legs = Object.values(JSON.parse(flight.legs));\r\n\r\n const paxnodeIds = paxnodes.map(p => p._id);\r\n const cgonodeIds = cgonodes.map(c => c._id);\r\n\r\n for (let selectedLeg of state.selectedLegs) {\r\n const leg = legs[selectedLeg];\r\n if (!leg) continue;\r\n\r\n leg.paxIDs = union(leg.paxIDs, paxnodeIds);\r\n leg.cgoIDs = union(leg.cgoIDs, cgonodeIds);\r\n }\r\n\r\n return {\r\n paxIDList: union(flight.paxIDList.map((pax) => pax._id) || [], paxnodeIds),\r\n cgoIDList: union(flight.cgoIDList.map((cgo) => cgo._id) || [], cgonodeIds),\r\n legs: legs\r\n }\r\n }\r\n else\r\n {\r\n // Auto assign\r\n const computeAutoAssign = (createMissingLegs: boolean) =>{\r\n let flManager = getFlightLegManagerFromFlightQuery(\r\n flight,\r\n buildLocNameMapFromPaxCgoLists(paxnodes, cgonodes)\r\n );\r\n\r\n if (paxnodes?.length > 0){\r\n paxnodes.forEach((pax) => {\r\n flManager.addPassenger(graphqlPaxToFlightManPax(pax), { updateFlightPath: createMissingLegs })\r\n })\r\n }\r\n if (cgonodes?.length > 0){\r\n cgonodes.forEach((cgo) => {\r\n flManager.addCgo(graphqlCgoToFlightManCgo(cgo), { updateFlightPath: createMissingLegs })\r\n })\r\n }\r\n\r\n var departureID = flManager.getOrigin();\r\n if (!departureID){\r\n message.error(\"Cannot add a group with no departure on a flight.\")\r\n return\r\n }\r\n\r\n let paxIds = [];\r\n let cgoIds = [];\r\n\r\n const legs = flManager.buildFlightLegs({\r\n disableCreateMissingLegs: !createMissingLegs,\r\n getInfo: (data) => {\r\n paxIds = data.paxIds;\r\n cgoIds = data.cgoIds;\r\n }\r\n })\r\n\r\n return {\r\n legs: legs,\r\n paxIDList: paxIds,\r\n cgoIDList: cgoIds\r\n }\r\n }\r\n\r\n const origLegs = Object.values(JSON.parse(flight.legs));\r\n\r\n // Legs with createMissingLegs enabled\r\n const legsWithNew = computeAutoAssign(true);\r\n\r\n // Legs with createMissingLegs disabled\r\n const legsWithoutNew = computeAutoAssign(false);\r\n\r\n let addMissingLegs = true;\r\n\r\n try {\r\n await new Promise(async (resolve, reject) => {\r\n\r\n /*\r\n Then compare legsWithNew and legsWithoutNew to find pax/cgo who couldn't be added\r\n due to the flight path being incompatible.\r\n Give the user the option to allow it to add new legs for those incompatible pax/cgo, or ignore\r\n those pax/cgo.\r\n */\r\n const { dropCount, droppedPaxIds, droppedCgoIds } = findDroppedPaxCgoInLegs(legsWithNew.legs, legsWithoutNew.legs);\r\n if (!dropCount || !origLegs?.length){\r\n resolve();\r\n return;\r\n }\r\n\r\n const droppedPax = await resolveEntityIdsByType(droppedPaxIds, 'ScheduledPaxNode');\r\n const droppedCgo = await resolveEntityIdsByType(droppedCgoIds, 'ScheduledCgoNode');\r\n\r\n const paxList = droppedPax\r\n .sort((a, b) => {\r\n return `${a.lastName}, ${a.firstName}` > `${b.lastName}, ${b.firstName}` ? 1 : -1;\r\n })\r\n .map((pax) => (\r\n
  • \r\n {pax.lastName}, {pax.firstName}\r\n \r\n \r\n {pax.departureID?.name}\r\n \r\n {pax.destinationID?.name}\r\n \r\n \r\n
  • \r\n ))\r\n\r\n const cgoList = droppedCgo\r\n .sort((a, b) => {\r\n return a.name > b.name ? 1 : -1;\r\n })\r\n .map((cgo) => (\r\n
  • \r\n {cgo.name}\r\n \r\n \r\n {cgo.departureID?.name}\r\n \r\n {cgo.destinationID?.name}\r\n \r\n \r\n
  • \r\n ))\r\n\r\n const radioStyle: CSSProperties = {\r\n height: '30px',\r\n lineHeight: '3opx'\r\n }\r\n\r\n const whatsThisText = <>\r\n

    Adding PAX/CGO to the flight will no longer automatically alter the flight path.

    \r\n

    \r\n You are now given the choice to preserve your current flight path by ignoring PAX/CGO\r\n that are incompatible.\r\n

    \r\n \r\n\r\n Modal.confirm({\r\n title: \"Some PAX/CGO are incompatible with this flight path\",\r\n width: 550,\r\n content: addMissingLegs = radioValue}\r\n defaultState={{\r\n radioValue: true\r\n }}\r\n >\r\n {({ state, setState }) => {\r\n return <>\r\n

    \r\n \r\n \r\n What's this?\r\n \r\n \r\n

    \r\n

    \r\n {paxList.length ? (\r\n

    \r\n \r\n \r\n {paxList.length} incompatible passengers\r\n \r\n \r\n
    \r\n ) : null}\r\n {cgoList.length ? (\r\n
    \r\n \r\n \r\n {cgoList.length} incompatible cargo\r\n \r\n \r\n
    \r\n ) : null}\r\n

    \r\n \r\n setState({radioValue: e.target.value})}\r\n >\r\n \r\n Create legs from incompatible PAX/CGO\r\n (default)\r\n \r\n \r\n Ignore incompatible PAX/CGO\r\n \r\n \r\n \r\n

    New Legs:

    \r\n \r\n },\r\n {\r\n title: 'Dest',\r\n key: 'destination',\r\n dataIndex: 'destination'\r\n }\r\n ]}\r\n />\r\n {state.radioValue ? (\r\n
    \r\n \r\n You can reorder the flight legs after applying\r\n \r\n
    \r\n ) : null}\r\n \r\n }}\r\n ,\r\n onOk: () => resolve(),\r\n onCancel: () => reject('Canceled'),\r\n okText: 'Apply'\r\n });\r\n })\r\n } catch (reason) {\r\n return;\r\n }\r\n\r\n return addMissingLegs ? legsWithNew : legsWithoutNew;\r\n }\r\n }\r\n }\r\n });\r\n\r\n const [updateFlightMutation, updateFlightMutationResult] = useMutation(UPDATE_FLIGHT_PASSENGER);\r\n const [updateFlightLegsMutation, updateFlightLegsResult] = useMutation(UPDATE_FLIGHT_LEGS);\r\n\r\n // ---------------------------------------------------------------------------------\r\n\r\n function openPassengerDrawer() {\r\n setState({passengerDrawerOpen: true})\r\n }\r\n\r\n function closePassengerDrawer() {\r\n setState({passengerDrawerOpen: false})\r\n }\r\n\r\n const routeEditor = {\r\n open: () => {\r\n routeEditorApi.route.reset();\r\n setState({routeEditorOpen: true})\r\n },\r\n close: () => {\r\n setState({routeEditorOpen: false});\r\n routeEditorApi.route.reset();\r\n }\r\n }\r\n\r\n function deleteFlight() {\r\n const {_id} = data.getFlight;\r\n setState({deleting: true})\r\n client.mutate({\r\n mutation: DELETE_FLIGHT,\r\n variables: {\r\n _id,\r\n tpID: orgData.transporter._id\r\n }\r\n })\r\n .then(() => {\r\n history.push('/app/scheduling/flight')\r\n })\r\n .catch(error => {\r\n console.error(error);\r\n setState({ deleting: false });\r\n message.error(`Failed to delete flight: ${error.message}`);\r\n })\r\n }\r\n\r\n async function derefEntity(type: 'pax' | 'cgo'){\r\n\r\n }\r\n\r\n async function removeEntitiesRecalLegs(entities: TEMP_TYPE_Entity[]){\r\n return new Promise(async (resolve, reject) => {\r\n const entityIdMap = arrayToMap(\r\n [...entities, ],\r\n \"_id\"\r\n );\r\n const { customer, transporter } = props.orgData;\r\n const { _id: flightid, legs: jsonLegs } = data.getFlight;\r\n\r\n const legs = Object.values(JSON.parse(jsonLegs));\r\n\r\n const entityIds = entities.map(e => e._id);\r\n\r\n const partialFlight = {\r\n paxIDList: [] as string[],\r\n cgoIDList: [] as string[],\r\n legs: [] as FlightLeg[]\r\n }\r\n\r\n if (state.manualAssign === 'manual'){\r\n partialFlight.legs = legs.map((leg, idx) => {\r\n if (!state.selectedLegs.includes(idx)){\r\n return leg;\r\n }\r\n\r\n const paxIds = leg.paxIDs\r\n .filter((pId) => !entityIds.includes(pId));\r\n const cgoIds = leg.cgoIDs\r\n .filter((cId) => !entityIds.includes(cId));\r\n\r\n return {\r\n ...leg,\r\n paxIDs: paxIds,\r\n cgoIDs: cgoIds\r\n }\r\n })\r\n partialFlight.paxIDList = partialFlight.legs\r\n .reduce((paxIds: string[], leg) => {\r\n return union(paxIds, leg.paxIDs);\r\n }, []);\r\n\r\n partialFlight.cgoIDList = partialFlight.legs\r\n .reduce((cgoIds: string[], leg) => {\r\n return union(cgoIds, leg.cgoIDs);\r\n }, [])\r\n }\r\n else {\r\n let flManager = getFlightLegManagerFromFlightQuery(data.getFlight);\r\n\r\n for (let entity of entities) {\r\n flManager.removePassenger(entity._id);\r\n flManager.removeCgo(entity._id);\r\n }\r\n\r\n partialFlight.legs = flManager.buildFlightLegs();\r\n partialFlight.paxIDList = flManager.getPaxIDList();\r\n partialFlight.cgoIDList = flManager.getCgoIDList();\r\n }\r\n\r\n partialFlight.legs = await Promise.all(\r\n partialFlight.legs.map(async (leg) => {\r\n\r\n const paxList = await getScheduledPaxByIds(leg.paxIDs);\r\n const cgoList = await getScheduledCgoByIds(leg.cgoIDs);\r\n\r\n return {\r\n ...leg,\r\n ...computeLegWeightsAndCounts(\r\n paxList,\r\n cgoList\r\n )\r\n }\r\n })\r\n )\r\n\r\n const flightPayload = {\r\n _id: flightid,\r\n paxIDList: partialFlight.paxIDList,\r\n cgoIDList: partialFlight.cgoIDList,\r\n customerID: customer._id,\r\n tpID: transporter._id,\r\n legs: JSON.stringify(Object.assign({}, partialFlight.legs))\r\n }\r\n\r\n Modal.confirm({\r\n title: 'Review Changes',\r\n maskClosable: false,\r\n content: partialFlight.legs[index])\r\n\r\n // Remove null legs\r\n .filter(l => l)\r\n })()\r\n }\r\n />,\r\n width: 'fit-content',\r\n onOk: () => {\r\n updateFlightMutation({\r\n variables: {\r\n flight: flightPayload,\r\n orgID: props.orgData.getActiveOrgID()\r\n }\r\n })\r\n .then(() => {\r\n message.success('Successfully removed from flight');\r\n refetch();\r\n paxCgoAdderState.api.data.refetch();\r\n resolve(true);\r\n })\r\n .catch(error => {\r\n console.error(error);\r\n message.error('Failed to remove from flight.');\r\n reject(error);\r\n })\r\n }\r\n })\r\n })\r\n }\r\n\r\n function removesAllPaxFromLegReOrder(locations: TEMP_TYPE_Location[]) {\r\n const { orgData } = props;\r\n const { _id: flightid } = data.getFlight;\r\n\r\n var newLegs = [];\r\n for(var i = 0; i < locations.length-1; i++){\r\n newLegs.push(createNewLeg(i, locations[i], locations[i+1]))\r\n }\r\n var legsObj = null\r\n if (newLegs.length) legsObj = JSON.stringify(Object.assign({}, newLegs))\r\n\r\n updateFlightLegsMutation({\r\n variables: {\r\n payload: {\r\n _id: flightid,\r\n paxIDList: [],\r\n cgoIDList: [],\r\n departureID: locations[0]._id,\r\n legs: legsObj,\r\n tpID: orgData.transporter._id,\r\n customerID: orgData.customer._id\r\n },\r\n orgID: orgData.getActiveOrgID()\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setFlight: {\r\n __typename: 'FlightNode',\r\n _id: flightid,\r\n paxIDList: [],\r\n cgoIDList: [],\r\n legs: legsObj\r\n }\r\n }\r\n })\r\n .then(() => message.success('Flight legs successfully updated'))\r\n .catch(error => {\r\n console.error(error);\r\n message.error('Failed to update flight legs')\r\n })\r\n }\r\n\r\n function addFuelStops(locations: TEMP_TYPE_Location[]) {\r\n const { orgData } = props;\r\n const { _id: flightid, legsArray } = data.getFlight;\r\n\r\n var newLegs = [];\r\n for(var i = 0; i < locations.length-1; i++){\r\n newLegs.push(createNewLeg(i, locations[i], locations[i+1]))\r\n }\r\n\r\n var depIdx = 0\r\n var destIdx = 0\r\n\r\n legsArray.forEach(leg => {\r\n depIdx = newLegs.slice(destIdx).findIndex(newLeg => newLeg.departureID === leg.departureID) + destIdx\r\n destIdx = newLegs.slice(destIdx).findIndex(newLeg => newLeg.destinationID === leg.destinationID) + destIdx\r\n\r\n for(var i = depIdx; i <= destIdx; i++){\r\n var newLeg = {\r\n ...leg,\r\n paxIDs: leg.paxIDs.map(pax => pax._id),\r\n cgoIDs: leg.cgoIDs.map(cgo => cgo._id),\r\n order: i,\r\n departureID: newLegs[i].departureID,\r\n departure: newLegs[i].departure,\r\n destinationID: newLegs[i].destinationID,\r\n destination: newLegs[i].destination\r\n }\r\n delete newLeg.__typename\r\n newLegs[i] = newLeg\r\n }\r\n })\r\n\r\n var legsObj = null\r\n if (newLegs.length) legsObj = JSON.stringify(Object.assign({}, newLegs))\r\n\r\n updateFlightLegsMutation({\r\n variables: {\r\n payload: {\r\n _id: flightid,\r\n legs: legsObj,\r\n tpID: orgData.transporter._id,\r\n customerID: orgData.customer._id\r\n },\r\n orgID: orgData.getActiveOrgID()\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setFlight: {\r\n __typename: 'FlightNode',\r\n _id: flightid,\r\n legs: legsObj\r\n }\r\n }\r\n })\r\n .then(() => message.success('Flight legs successfully updated'))\r\n .catch(error => {\r\n console.error(error);\r\n message.error('Failed to update flight legs')\r\n })\r\n }\r\n\r\n function onLegsReorder(dragIndex: number, hoverIndex: number) {\r\n const { orgData } = props;\r\n const { _id: flightid, legs, paxIDList, cgoIDList, departureID } = data.getFlight;\r\n if (!legs) return null;\r\n\r\n let flManager = getFlightLegManagerFromFlightQuery(\r\n data.getFlight,\r\n undefined,\r\n undefined,\r\n {\r\n preventDupeNodeInsertion: true\r\n }\r\n );\r\n\r\n const parsedLegs = Object.values(JSON.parse(legs));\r\n\r\n if (dragIndex === parsedLegs.length - 1){\r\n message.warn(\"The last flight leg cannot be reordered\")\r\n return null\r\n }\r\n if (hoverIndex === parsedLegs.length -1){\r\n message.warn(\"The last flight leg must be a return to the flight departure location\")\r\n return null\r\n }\r\n\r\n const destinations = getDestinationsFromLegs(parsedLegs);\r\n\r\n flManager.moveDestination(destinations[dragIndex]._id, destinations[hoverIndex]._id);\r\n\r\n const startSlice = dragIndex < hoverIndex ? dragIndex : hoverIndex;\r\n const endSlice = dragIndex > hoverIndex ? dragIndex : hoverIndex;\r\n const reorderedDestinations = [\r\n ...destinations.slice(0, startSlice),\r\n destinations[endSlice],\r\n ...destinations.slice(startSlice + 1, endSlice),\r\n destinations[startSlice],\r\n ...destinations.slice(endSlice + 1)\r\n ]\r\n\r\n let newAllList = [];\r\n\r\n const filteredDestinations = reorderedDestinations.filter((loc, idx, arr) => {\r\n if(idx !== arr.length -1){\r\n if(arr[idx+1]._id !== loc._id){\r\n return loc;\r\n }\r\n return false\r\n }else {\r\n return loc;\r\n }\r\n });\r\n\r\n filteredDestinations.forEach(location => {\r\n const sortPaxByOrder = (a, b) => {\r\n return a.scheduledOrder - b.scheduledOrder\r\n }\r\n var newList = [];\r\n if(paxIDList && paxIDList.length > 0){\r\n newList = newList.concat(paxIDList.filter(pax => pax.destinationID._id === location._id));\r\n }\r\n if(cgoIDList && cgoIDList.length > 0){\r\n newList = newList.concat(cgoIDList.filter(cgo => cgo.destinationID._id === location._id));\r\n }\r\n const outbound = newList.filter(pax => pax.transitType === 'OUTBOUND').sort(sortPaxByOrder);\r\n const transfer = newList.filter(pax => pax.transitType === 'TRANSFER').sort(sortPaxByOrder);\r\n const inbound = newList.filter(pax => pax.transitType === 'INBOUND').sort(sortPaxByOrder);\r\n const sortedAll = [...outbound, ...transfer, ...inbound]\r\n newAllList.push(...sortedAll);\r\n })\r\n\r\n // @ts-ignore TODO: Remove ts-ignore\r\n newAllList = [...new Set(newAllList)];\r\n\r\n const newPaxList = newAllList.filter(pax => pax.classType === 'flytsuite.paxnode' );\r\n const newCgoList = newAllList.filter(cgo => cgo.classType === 'flytsuite.cgonode' );\r\n // const newPaxIDList = newPaxList.map(pax => pax._id);\r\n // const newCgoIDList = newCgoList.map(cgo => cgo._id);\r\n const newLegs = flManager.buildFlightLegs();\r\n let newLegsJson = JSON.stringify( Object.assign({}, newLegs) )\r\n\r\n let newLegsArray = newLegs.map(leg => {\r\n return {\r\n ...leg,\r\n paxIDs: leg.paxIDs.map(id => newPaxList.find(p => p._id === id)),\r\n cgoIDs: leg.cgoIDs.map(id => newCgoList.find(c => c._id === id))\r\n }\r\n })\r\n\r\n updateFlightLegsMutation({\r\n variables: {\r\n payload: {\r\n _id: flightid,\r\n // paxIDList: newPaxIDList,\r\n // cgoIDList: newCgoIDList,\r\n legs: newLegsJson,\r\n tpID: orgData.transporter._id,\r\n customerID: orgData.customer._id\r\n },\r\n orgID: orgData.getActiveOrgID()\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setFlight: {\r\n __typename: 'FlightNode',\r\n _id: flightid,\r\n // paxIDList: newPaxList,\r\n // cgoIDList: newCgoList,\r\n legs: newLegsJson,\r\n legsArray: newLegsArray\r\n }\r\n }\r\n })\r\n .then(() => message.success('Flight legs successfully updated'))\r\n .catch(error => {\r\n console.error(error);\r\n message.error('Failed to update flight legs')\r\n })\r\n }\r\n\r\n function getSelectedLegsFromLegs(legs: FlightLeg[]) {\r\n var arr = [];\r\n state.selectedLegs.sort().forEach(legIdx => {\r\n if (legs.length <= legIdx) return;\r\n arr.push(legs[legIdx])\r\n })\r\n\r\n return arr;\r\n }\r\n\r\n function getLocationsFromLegs(legs: FlightLeg[]) {\r\n if (!legs) return [];\r\n var arr = [];\r\n\r\n legs.forEach(leg => {\r\n arr.push(leg.departureID);\r\n })\r\n\r\n if(legs.length > 0){\r\n arr.push(legs[legs.length-1].destinationID);\r\n }\r\n\r\n\r\n return arr\r\n }\r\n\r\n async function removeRedundantDestination(locID: string){\r\n let flManager = getFlightLegManagerFromFlightQuery(data.getFlight);\r\n\r\n if (!flManager.removeLocationIfRedundant(locID)){\r\n return;\r\n }\r\n\r\n let legs = flManager.buildFlightLegs();\r\n\r\n let flightid = data.getFlight._id;\r\n\r\n try{\r\n var res = await updateFlightLegsMutation({\r\n variables: {\r\n payload: {\r\n _id: flightid,\r\n legs: JSON.stringify( Object.assign({}, legs) ),\r\n tpID: props.orgData.transporter._id,\r\n customerID: props.orgData.customer._id\r\n },\r\n orgID: props.orgData.getActiveOrgID()\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setFlight: {\r\n __typename: 'FlightNode',\r\n _id: flightid\r\n }\r\n }\r\n })\r\n }\r\n catch(err){\r\n console.error(err);\r\n message.error(\"Failed to remove redundant destination.\");\r\n return;\r\n }\r\n message.success('Successfully removed redundant destination.');\r\n refetch();\r\n return res;\r\n }\r\n\r\n async function handleModifyRoute(){\r\n\r\n const locList = await resolveEntityIdsByType(routeEditorApi.route.get(), 'Location');\r\n\r\n const locMap = arrayToMap(\r\n locList,\r\n '_id',\r\n (loc) => loc.name\r\n );\r\n\r\n const flManager = getFlightLegManagerFromFlightQuery(data.getFlight, locMap);\r\n flManager.flightPath = FlightPath.fromLocationList(locList);\r\n\r\n let paxIds: string[] = [];\r\n let cgoIds: string[] = [];\r\n\r\n const legsWithoutNew = flManager.buildFlightLegs({\r\n disableCreateMissingLegs: true,\r\n getInfo: (info) => {\r\n paxIds = info.paxIds;\r\n cgoIds = info.cgoIds;\r\n }\r\n });\r\n\r\n const legsWithNew = flManager.buildFlightLegs({\r\n disableCreateMissingLegs: false\r\n });\r\n\r\n /*\r\n Then compare legsWithNew and legsWithoutNew to find pax/cgo who couldn't be added\r\n due to the flight path being incompatible. Warn the user if this is about to happen.\r\n */\r\n const { dropCount, droppedPaxIds, droppedCgoIds } = findDroppedPaxCgoInLegs(legsWithNew, legsWithoutNew);\r\n\r\n const droppedPax = await resolveEntityIdsByType(droppedPaxIds, 'ScheduledPaxNode');\r\n const droppedCgo = await resolveEntityIdsByType(droppedCgoIds, 'ScheduledCgoNode');\r\n\r\n const paxList = droppedPax\r\n .sort((a, b) => {\r\n return `${a.lastName}, ${a.firstName}` > `${b.lastName}, ${b.firstName}` ? 1 : -1;\r\n })\r\n .map((pax) => (\r\n
  • \r\n {pax.lastName}, {pax.firstName}\r\n \r\n \r\n {pax.departureID?.name} {pax.destinationID?.name}\r\n \r\n \r\n
  • \r\n ))\r\n\r\n const cgoList = droppedCgo\r\n .sort((a, b) => {\r\n return a.name > b.name ? 1 : -1;\r\n })\r\n .map((cgo) => (\r\n
  • \r\n {cgo.name}\r\n \r\n \r\n {cgo.departureID?.name} {cgo.destinationID?.name}\r\n \r\n \r\n
  • \r\n ))\r\n\r\n async function afterConfirm(){\r\n\r\n const legsJson = JSON.stringify(Object.assign({}, legsWithoutNew));\r\n\r\n try {\r\n await updateFlightLegsMutation({\r\n variables: {\r\n payload: {\r\n _id: data.getFlight._id,\r\n paxIDList: paxIds,\r\n cgoIDList: cgoIds,\r\n legs: legsJson,\r\n tpID: orgData.transporter._id,\r\n customerID: orgData.customer._id\r\n },\r\n orgID: orgData.getActiveOrgID()\r\n }\r\n })\r\n message.success('Flight legs successfully updated');\r\n routeEditor.close();\r\n paxCgoAdderState.api.data.refetch();\r\n }\r\n catch (err){\r\n console.error(error);\r\n message.error('Failed to update flight legs')\r\n }\r\n }\r\n\r\n const dropWarnings: React.ReactNode[] = [];\r\n\r\n if (dropCount > 0){\r\n if (paxList.length){\r\n dropWarnings.push(\r\n
    \r\n \r\n \r\n {paxList.length} incompatible passengers\r\n \r\n \r\n
    \r\n )\r\n }\r\n if (cgoList.length){\r\n dropWarnings.push(\r\n
    \r\n \r\n \r\n {cgoList.length} incompatible cargo\r\n \r\n \r\n
    \r\n )\r\n }\r\n }\r\n\r\n Modal.confirm({\r\n title: 'PAX/CGO leg assignments will be recalculated',\r\n width: 500,\r\n content: <>\r\n WARNING:
    \r\n

    \r\n Modifying the flight route will recalculate PAX/CGO leg assignments.{' '}\r\n Manual assignments will be lost/changed.\r\n

    \r\n {dropWarnings.length ? (\r\n \r\n

    Hover to view

    \r\n {dropWarnings}\r\n \r\n }\r\n />\r\n ) : null}\r\n ,\r\n onOk: async () => {\r\n await afterConfirm();\r\n }\r\n })\r\n }\r\n\r\n function renderContent() {\r\n const {orgData} = props;\r\n\r\n if (error) return \r\n\r\n if (loading && !data) return \r\n if (!data || !data.getFlight) return

    No data returned

    \r\n if (data.getFlight.tpID._id !== orgData.transporter._id) {\r\n return

    Transportation providers do not match

    \r\n }\r\n const legs: FlightLeg[] = (data.getFlight.legs && Object.values(JSON.parse(data.getFlight.legs))) || []\r\n const selectedLeg = legs?.[state.selectedLeg];\r\n\r\n let flManager = getFlightLegManagerFromFlightQuery(data.getFlight);\r\n\r\n return (\r\n \r\n \r\n
    \r\n \r\n {entityMultiSelect.selectedItems.length > 0 ?\r\n \r\n {entityMultiSelect.selectedItems.length} selected\r\n entityMultiSelect.clearAll()}\r\n size=\"small\"\r\n >Clear\r\n \r\n : null}\r\n \r\n entityMultiSelect.setSelectedItems(allEntities)}>Select\r\n All\r\n entityMultiSelect.clearAll()}>Select\r\n None\r\n \r\n {renderGroupNameMenuItems(entityMultiSelect, allEntities)}\r\n \r\n }\r\n >\r\n \r\n \r\n entityMultiSelect.selectedItems.length > 0 && removeEntitiesRecalLegs(entityMultiSelect.selectedItems)\r\n .then(() => entityMultiSelect.clearAll())}\r\n >\r\n Remove Selected\r\n \r\n \r\n \r\n setState({manualAssign: tab})}\r\n className=\"scheduling-flight-edit-legs-tabs\"\r\n >\r\n \r\n \r\n
    \r\n \r\n \r\n setState({selectedLeg: index})}\r\n checkLegIsRedundant={(leg: FlightLeg) => flManager.isLocationRedundant(leg.destinationID)}\r\n onReorder={onLegsReorder}\r\n extra={[\r\n \r\n Auto-Assign PAX/CGO\r\n \r\n ]}\r\n />\r\n \r\n \r\n }\r\n spinning={updateFlightMutationResult.loading}>\r\n removeRedundantDestination(selectedLeg.destinationID) : 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 var arr = state.selectedLegs;\r\n const idx = arr.indexOf(index);\r\n if (idx > -1) {\r\n arr.splice(idx, 1);\r\n setState({selectedLegs: arr})\r\n } else {\r\n setState({selectedLegs: [...state.selectedLegs, index]})\r\n }\r\n }}\r\n extra={[\r\n !state.selectedLegs.length ? (\r\n Auto-Assign PAX/CGO\r\n ) : null,\r\n state.selectedLegs.length ? (\r\n \r\n Manual Assign PAX/CGO\r\n \r\n ) : null,\r\n \r\n ].filter(isTruey)}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n {notesForPilotApi.getNotes().size > 0 ? (\r\n <>\r\n

    \r\n Notes For Pilot\r\n \r\n ({notesForPilotApi.getNotes().size} Notes)\r\n \r\n

    \r\n \r\n \r\n ) : (\r\n <>\r\n

    \r\n Notes For Pilot\r\n

    \r\n No data\r\n \r\n )}\r\n \r\n \r\n

    Select PAX/CGO to add to\r\n {data?.getFlight?.desig}\r\n

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

    Select PAX/CGO to add to\r\n {data?.getFlight?.desig}\r\n

    \r\n \r\n \r\n {paxCgoAdderState.render.searchTypeSelect()}\r\n \r\n \r\n {paxCgoAdderState.render.searchInput()}\r\n \r\n \r\n {paxCgoAdderState.render.addButton()}\r\n \r\n \r\n \r\n }\r\n visible={state.passengerDrawerOpen}\r\n closable\r\n width={drawerBreakpoints.max('large') ? '100%' : 1000}\r\n onClose={closePassengerDrawer}\r\n className=\"ant-drawer-flex\"\r\n >\r\n \r\n View legs and PAX/CGO by clicking on the rows\r\n \r\n \r\n \r\n \r\n {paxCgoAdderState.api.data.groups.get().length}\r\n {pluralize('Group', paxCgoAdderState.api.data.groups.get().length)}\r\n \r\n \r\n \r\n \r\n {paxCgoAdderState.api.action.collapse.isAllExpanded() ? (\r\n \"Collapse All\"\r\n ) :\r\n (\r\n \"Expand All\"\r\n )}\r\n \r\n \r\n \r\n {paxCgoAdderState.render.filtersAppliedAlert()}\r\n {paxCgoAdderState.render.errorAlert()}\r\n \r\n {paxCgoAdderState.render.paxModal()}\r\n {paxCgoAdderState.render.isnDrawer()}\r\n \r\n \r\n \r\n

    Modify Flight Route

    \r\n \r\n {routeEditorApi.state.changed ? (\r\n \r\n Reset\r\n \r\n ) : null}\r\n \r\n Save\r\n \r\n \r\n }\r\n >\r\n \r\n

    \r\n \r\n Modifying the flight route will recalculate PAX/CGO leg assignments.{' '}\r\n Manual assignments will be lost.\r\n \r\n

    \r\n \r\n
    \r\n )\r\n }\r\n\r\n const checkIfToday = (date) => {\r\n var d = new Date()\r\n var today = d.getFullYear() + \"-\" + (d.getMonth()+1+\"\").padStart(2, \"0\")+\"-\" + (d.getDate()+\"\").padStart(2, \"0\")\r\n return date === today\r\n }\r\n\r\n const mainHeaderProps: MainHeaderProps = {\r\n routes: [\r\n {\r\n path: '/app/scheduling/flight',\r\n title: 'Scheduled Flights',\r\n breadcrumbName: 'Scheduled Flights'\r\n },\r\n {\r\n path: null,\r\n breadcrumbName: loading ? : data && data.getFlight && data.getFlight.desig\r\n }\r\n ],\r\n actions: (\r\n \r\n \r\n \r\n \r\n \r\n \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 {renderContent()}\r\n \r\n \r\n )\r\n}\r\n\r\nconst NotAuth = () => (\r\n \r\n \r\n \r\n)\r\n\r\nconst FlightScheduleEdit = props => (\r\n }>\r\n \r\n \r\n)\r\n\r\nexport default withRouter( WithOrgData( FlightScheduleEdit ) )","import React from 'react';\r\nimport { withRouter } from 'react-router-dom';\r\n\r\nclass LinkWrapper extends React.Component {\r\n handleClick = () => {\r\n const { to, history } = this.props;\r\n history.push(to);\r\n }\r\n render(){\r\n return (\r\n
    \r\n {this.props.children}\r\n
    \r\n )\r\n }\r\n}\r\n\r\nexport default withRouter( LinkWrapper )","import React from 'react';\r\nimport { Row, Col, Card, Button } from 'antd';\r\nimport LinkWrapper from '../../LinkWrapper';\r\n\r\nconst cardLinkStyle = {\r\n position: 'absolute',\r\n bottom: 24,\r\n right: 24\r\n}\r\n\r\nclass WorkFlowCard extends React.Component {\r\n constructor(props){\r\n super(props);\r\n this.state = {\r\n showDetailedDesc: false\r\n }\r\n }\r\n render(){\r\n const { number, title, description, detaileddescription, path, disabled, ...rest } = this.props;\r\n const { showDetailedDesc } = this.state;\r\n var cardStyle = {}\r\n if (disabled){\r\n cardStyle = {\r\n opacity: 0.5\r\n }\r\n }\r\n const renderCard = () => (\r\n this.setState({ showDetailedDesc: true })}\r\n onMouseLeave={() => this.setState({ showDetailedDesc: false })}\r\n >\r\n \r\n \r\n
    {number}
    \r\n \r\n \r\n

    {title}

    \r\n

    {description}

    \r\n {showDetailedDesc && !disabled && detaileddescription && detaileddescription}\r\n \r\n
    \r\n
    \r\n {!disabled && }\r\n {disabled && You are not authorized to perform this function}\r\n
    \r\n
    \r\n )\r\n if (!disabled){\r\n return (\r\n \r\n {renderCard()}\r\n \r\n )\r\n }\r\n return renderCard()\r\n }\r\n}\r\n\r\n// const WorkFlowCard = ({ number, title, description, path, disabled, ...rest }) => {\r\n// var cardStyle = {}\r\n// if (disabled){\r\n// cardStyle = {\r\n// opacity: 0.5\r\n// }\r\n// }\r\n// const renderCard = () => (\r\n// \r\n// \r\n// \r\n//
    {number}
    \r\n// \r\n// \r\n//

    {title}

    \r\n//

    {description}

    \r\n// \r\n//
    \r\n//
    \r\n// {!disabled && Click here to begin}\r\n// {disabled && You are not authorized to perform this function}\r\n//
    \r\n//
    \r\n// )\r\n// if (!disabled){\r\n// return (\r\n// \r\n// {renderCard()}\r\n// \r\n// )\r\n// }\r\n// return renderCard()\r\n// }\r\n\r\nexport default WorkFlowCard","import React, {useContext} from 'react';\r\nimport {Row, Col, Divider} from 'antd';\r\nimport { withUserGroups, UserGroup } from '../../userGroup';\r\nimport NotAuthorized from '../../NotAuthorized';\r\nimport WorkFlowCard from './WorkflowCard';\r\nimport './MainScheduling.less';\r\nimport {OrgDataContext} from \"../../../context/orgData\";\r\n\r\nconst paxSetsDesc = `\r\nIt is recommended that if you have reoccurring sets of personnel travelling between specific locations on a \r\nregular basis that you construct a passenger set which you can \r\nthen use to schedule the persons as passengers quickly by supplying a flight date.\r\n`\r\n\r\nconst scheduledPaxDesc = `\r\nIf you have a non-reoccurring or un-planned person travelling, \r\nyou do not need to create a passenger set, \r\nbut rather you can go directly to Step 2 (Scheduled Passengers and Cargo) \r\nand schedule the person as a passenger without going \r\nthrough the unneeded effort of creating a passenger set.\r\n`\r\n\r\nconst basePath = '/app/scheduling/';\r\n\r\nconst MainScheduling = ({ userGroups }) => {\r\n\r\n const orgData = useContext(OrgDataContext);\r\n\r\n const customer = orgData.customer;\r\n\r\n const usesV1Scheduler = customer.useV1Scheduler || false;\r\n\r\n let step1 = null;\r\n\r\n if (usesV1Scheduler){\r\n step1 = <>\r\n \r\n OR\r\n \r\n }\r\n\r\n step1 = <>\r\n {step1}\r\n \r\n \r\n\r\n let step2 = \r\n\r\n let step3 = \r\n\r\n return (\r\n }>\r\n

    Scheduling Workflow

    \r\n
    The scheduling process consists of the following steps:
    \r\n \r\n \r\n {step1}\r\n \r\n \r\n {step2}\r\n \r\n \r\n {step3}\r\n \r\n \r\n
    \r\n )\r\n}\r\n\r\nexport default withUserGroups( MainScheduling )","import React from 'react';\r\nimport { Button } from 'antd';\r\nimport { withRouter } from 'react-router-dom';\r\n\r\nconst ButtonLink = (props) => {\r\n const { children, to, staticContext, ...rest } = props;\r\n return (\r\n \r\n )\r\n}\r\n\r\nexport default withRouter(ButtonLink)","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nmutation DeleteEntity($_id: ID!, $tpID: ID!) {\r\n deleteEntity(_id: $_id, tpID: $tpID)\r\n}\r\n`","import React from 'react';\r\nimport MainLayout from '../MainLayout';\r\nimport { Layout, Row, Button, Col, Form, Select, Input, Table, Popconfirm, Tooltip, Alert, message } from 'antd';\r\nimport MainHeader from '../MainHeader';\r\nimport gql from 'graphql-tag';\r\nimport { Query, Mutation } from 'react-apollo';\r\nimport LoadingContent from '../../LoadingContent';\r\nimport WithOrgData from '../../WithOrgData';\r\nimport withCognitoUser from '../../WithCognitoUser';\r\nimport { Link } from 'react-router-dom';\r\nimport moment from 'moment';\r\nimport ButtonLink from '../../ButtonLink';\r\nimport DeleteEntity from '../../../Queries/DeleteEntity';\r\nimport NotAuthorized from '../../NotAuthorized';\r\nimport { UserGroup } from '../../userGroup';\r\n\r\nconst ALL_SETS = gql`\r\nquery AllSets($customerID: ID! $tpID: ID! $owner: String){\r\n getPersonSets(\r\n customerID: $customerID\r\n tpID: $tpID\r\n owner: $owner\r\n ){\r\n _id\r\n name\r\n outbound {\r\n _id\r\n }\r\n inbound {\r\n _id\r\n }\r\n owner\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n owner\r\n modifiedTs\r\n }\r\n}\r\n`\r\nconst OWNER_FILTER = gql`\r\n{\r\n userFilter @client {\r\n paxSets {\r\n owner\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst SET_OWNER_FILTER = gql`\r\nmutation SetOwnerFilter($payload: String!){\r\n setPaxSetsOwnerFilter(payload: $payload) @client\r\n}\r\n`\r\n\r\nconst { Content } = Layout;\r\n\r\nconst SetTable = ({ customerID, tpID, owner, filterOwner, org, searchFilter }) => {\r\n const columns = [\r\n {\r\n title: 'Name',\r\n key: 'name',\r\n dataIndex: 'name',\r\n render: (name, record) => {name}\r\n },\r\n {\r\n title: 'Departure',\r\n key: 'departure',\r\n dataIndex: 'departureID',\r\n render: dep => dep && dep.name\r\n },\r\n {\r\n title: 'Destination',\r\n key: 'destination',\r\n dataIndex: 'destinationID',\r\n render: dest => dest && dest.name\r\n },\r\n {\r\n title: 'PAX Outbound',\r\n key: 'outbound',\r\n dataIndex: 'outbound',\r\n render: items => Array.isArray(items) && items.length\r\n },\r\n {\r\n title: 'PAX Inbound',\r\n key: 'inbound',\r\n dataIndex: 'inbound',\r\n render: items => Array.isArray(items) && items.length\r\n },\r\n {\r\n title: 'Modified',\r\n key: 'modified',\r\n dataIndex: 'modifiedTs',\r\n render: modified => moment(modified).format('DD-MMM-YYYY HH:mm:ss')\r\n },\r\n {\r\n title: 'Owned By',\r\n key: 'owner',\r\n dataIndex: 'owner',\r\n render: email => email === owner ? 'You' : email\r\n },\r\n {\r\n title: 'Actions',\r\n key: 'actions',\r\n render: (_, record) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n message.success('Set deleted successfully');\r\n }}\r\n onError={(error) => {\r\n console.error(error)\r\n message.error('Failed to delete set')\r\n }}>\r\n {\r\n (deleteEntity, { loading }) => (\r\n deleteEntity()} >\r\n \r\n \r\n );\r\n }\r\n\r\n const PaxColSet = [\r\n {\r\n title:'',\r\n key: 'action',\r\n render: (_, row) => {\r\n const record = paxData.find((pax) => pax._id === row._id);\r\n let checked = record ? isSelected(record._id) : false;\r\n const checkProps: CheckboxProps = {\r\n checked,\r\n onClick: () => {\r\n toggleSelection(record);\r\n }\r\n }\r\n return \r\n }\r\n },\r\n {\r\n title: 'Name',\r\n key: 'name',\r\n render: (_, record) => {\r\n let xbr;\r\n\r\n let icon = null;\r\n\r\n let spanClassName = record.currentCarrierID ? BASE_CLS + '-on-flight' : '';\r\n\r\n if (record.currentCarrierID){\r\n icon = \r\n {\r\n e.preventDefault();\r\n history.push(\"/app/scheduling/flight/\" + record.currentCarrierID?._id)\r\n }}\r\n style={{ marginRight: '6px', position: 'relative' }}\r\n >\r\n \r\n \r\n \r\n }\r\n\r\n if(!props.editMode){\r\n var data;\r\n if (record.__typename === 'Person')\r\n {\r\n data = {\r\n ...record,\r\n personID: { ...record }\r\n }\r\n }\r\n else\r\n {\r\n data = record\r\n }\r\n if(data.personID){\r\n xbr = data.personID.extraBroadState;\r\n }else {\r\n xbr = record.extraBroadState;\r\n }\r\n let name = `${record.lastName}, ${record.firstName}`\r\n if(xbr === 'FAIL'){\r\n name = `\\u2194 ${record.lastName}, ${record.firstName}`\r\n }else if(xbr === 'PASS'){\r\n name = `\\uc6c3 ${record.lastName}, ${record.firstName}`\r\n }\r\n return \r\n {icon}\r\n \r\n \r\n }\r\n xbr = record.extraBroadState || (record.personID && record.personID.extraBroadState)\r\n\r\n let text;\r\n if(xbr === 'FAIL'){\r\n text = `\\u2194 ${record.lastName}, ${record.firstName}`\r\n }else if(xbr === 'PASS'){\r\n text = `\\uc6c3 ${record.lastName}, ${record.firstName}`\r\n }else {\r\n let name = record.lastName + \", \" + record.firstName\r\n text = {name}\r\n }\r\n\r\n return \r\n {icon}\r\n {text}\r\n ;\r\n }\r\n },\r\n {\r\n title: 'Nation',\r\n key: 'nation',\r\n render: (_, row) => row.personID && row.personID.nation\r\n },\r\n {\r\n title: 'Employer',\r\n key: 'employer',\r\n render: (_, record) => record.employerID && record.employerID.name\r\n },\r\n {\r\n title: 'Pax Weight',\r\n key: 'paxWeight',\r\n dataIndex: 'paxWeight',\r\n editable: true,\r\n render: (weight, row) => {\r\n if (!props.editMode) return weight || 0;\r\n return props.onCellEdit(row._id, 'paxWeight', value || 0)}\r\n size=\"small\"\r\n value={weight || 0}\r\n disabled={!!row?.currentCarrierID}\r\n />\r\n }\r\n },\r\n {\r\n title: 'Bag Weight',\r\n key: 'bagWeight',\r\n dataIndex: 'bagWeight',\r\n editable: true,\r\n render: (weight, row) => {\r\n if (!props.editMode) return weight || 0;\r\n return props.onCellEdit(row._id, 'bagWeight', value || 0)}\r\n size=\"small\"\r\n value={weight || 0}\r\n disabled={!!row?.currentCarrierID}\r\n />\r\n }\r\n },\r\n {\r\n title: 'Bag Count',\r\n key: 'bagCount',\r\n dataIndex: 'bagCount',\r\n editable: true,\r\n render: (count, row) => {\r\n if (!props.editMode) return count || 0;\r\n return props.onCellEdit(row._id, 'bagCount', value || 0)}\r\n size=\"small\"\r\n value={count || 0}\r\n disabled={!!row?.currentCarrierID}\r\n />\r\n }\r\n },\r\n {\r\n title: 'Charge Code',\r\n key: 'chargeCode',\r\n dataIndex: 'chargeCode',\r\n editable: true,\r\n render: (code, row) => {\r\n if (!props.editMode) return code && code.toUpperCase();\r\n return (\r\n props.onCellEdit(row._id, 'chargeCode', event.target.value && event.target.value.split(\" \").join(\"\").toUpperCase())}\r\n size=\"small\"\r\n />\r\n )\r\n }\r\n },\r\n {\r\n title: 'ISN Status',\r\n key: 'isnStatus',\r\n render: (_, row) => {\r\n return {\r\n if (!props.editMode) {\r\n setIsnDrawer(IsnDrawerState(true, row._id))\r\n }\r\n }}\r\n />\r\n }\r\n },\r\n {\r\n title: 'Assigned Flight',\r\n key: 'assignedFlight',\r\n width: 200,\r\n render: renderFlight\r\n }\r\n ]\r\n\r\n const CgoColSet = [\r\n {\r\n title:'',\r\n key: 'action',\r\n render: (_, row) => {\r\n const record = cgoData.find((cgo) => cgo._id === row._id);\r\n let checked = record ? isSelected(record._id) : false;\r\n const checkProps: CheckboxProps = {\r\n checked,\r\n onClick: () => {\r\n toggleSelection(record);\r\n }\r\n }\r\n return \r\n }\r\n },\r\n {\r\n title: 'Name',\r\n key: 'name',\r\n render: (_, record) => {\r\n\r\n let spanClassName = record.currentCarrierID ? BASE_CLS + '-on-flight' : '';\r\n\r\n if (record.currentCarrierID){\r\n return \r\n \r\n \r\n \r\n {record.name}\r\n \r\n }\r\n\r\n return {record.name}\r\n }\r\n },\r\n {\r\n title: 'Weight',\r\n key: 'weight',\r\n dataIndex: 'weight',\r\n editable: true,\r\n render: (weight, row) => {\r\n if (!props.editMode) return weight || 0;\r\n return props.onCellEdit(row._id, 'weight', value || 0)}\r\n size=\"small\"\r\n value={weight || 0}\r\n disabled={!!row?.currentCarrierID}\r\n />\r\n }\r\n },\r\n {\r\n title: 'HazMat',\r\n key: 'hazmat',\r\n render: (_, record) => record.hazmat ? record.hazmatUnCode || \"YES\" : null\r\n },\r\n {\r\n title: 'Attention',\r\n key: 'attentionTo',\r\n render: (_, record) => record.attentionTo\r\n },\r\n {\r\n title: 'Initials',\r\n key: 'initials',\r\n render: (_, record) => record.initials\r\n },\r\n {\r\n title: 'Notes',\r\n key: 'notes',\r\n render: (_, record) => record.notes\r\n },\r\n {\r\n title: 'Assigned Flight',\r\n key: 'assignedFlight',\r\n width: 200,\r\n render: renderFlight\r\n }\r\n ]\r\n\r\n return <>\r\n \r\n \r\n \r\n {\r\n if(!props.editMode && col.key === 'action'){\r\n return false;\r\n }\r\n if(!hasOutboundPax && col.key === 'isnStatus'){\r\n return false;\r\n }\r\n return true;\r\n })}\r\n pagination={false}\r\n rowKey={record => record._id}\r\n size=\"small\"\r\n />\r\n \r\n \r\n {\r\n if (v){\r\n return weight + v.weight\r\n }\r\n else\r\n {\r\n return weight\r\n }\r\n }, 0)}`}\r\n >\r\n {\r\n if(!props.editMode && col.key === 'action'){\r\n return false;\r\n }\r\n return true;\r\n })}\r\n pagination={false}\r\n rowKey={record => record._id}\r\n size=\"small\"\r\n />\r\n \r\n \r\n setPaxModal(PaxModalState(false, paxModal.paxId))}\r\n footer={null}\r\n width=\"50rem\"\r\n >\r\n p._id === paxModal.paxId)}\r\n onCancel={() => setPaxModal(PaxModalState(false, paxModal.paxId))}\r\n />\r\n \r\n {!props.editMode ? renderIsnDrawer() : null}\r\n \r\n {({ data, loading }) => {\r\n let name: string;\r\n if (data && data.getPassenger){\r\n let pax = data.getPassenger;\r\n name = `${pax.lastName}, ${pax.firstName}`\r\n }\r\n return setIsnCheckDrawer({ ...isnCheckDrawer, open: false })}\r\n title={!loading && name ? name : } /> }\r\n visible={isnCheckDrawer.open}\r\n width=\"40rem\"\r\n >\r\n \r\n \r\n }}\r\n \r\n setFlightPreviewState({ ...flightPreviewState, flightID: null })}\r\n >\r\n \r\n \r\n \r\n}\r\n\r\nexport default PaxCgoSchedulerTable","import React from 'react';\r\nimport { Form, Input, Row, Col, DatePicker } from 'antd';\r\nimport { LocationSelect } from '../../form/select/LocationSelect';\r\n\r\nconst SetForm = ({ form, showDate=false, dateFormat=\"YYYY-MM-DD\", useGroupName=false, disabled=false }) => {\r\n const { getFieldDecorator } = form;\r\n return (\r\n
    \r\n \r\n {showDate ? (\r\n \r\n \r\n {getFieldDecorator('date', {\r\n rules: [\r\n { required: true, message: 'Flight date is required' }\r\n ]\r\n })()}\r\n \r\n \r\n ) : null}\r\n \r\n \r\n {getFieldDecorator('name', {\r\n rules: [\r\n { required: true, message: 'Set name is required' }\r\n ]\r\n })( {\r\n e.target.value = e.target.value.trimStart().replace(/[^\\S ]/gm, '')}} style={{ width: '100%' }} disabled={disabled} />)}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('lastKnownController', {\r\n rules: [\r\n { required: true, message: 'You must enter a controlling heliport' }\r\n ]\r\n })()}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('departure', {\r\n rules: [\r\n { required: true, message: 'Departure Location is required' }\r\n ]\r\n })()}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('destination', {\r\n rules: [\r\n { required: true, message: 'Destination Location is required' }\r\n ]\r\n })()}\r\n \r\n \r\n \r\n
    \r\n )\r\n}\r\n\r\nexport default Form.create({\r\n onFieldsChange(props, changedFields, allFields){\r\n if (!props.onChange) return;\r\n props.onChange(changedFields, allFields);\r\n },\r\n mapPropsToFields(props) {\r\n const date = props.date || {};\r\n const name = props.name || {};\r\n const lkc = props.lastKnownController || {};\r\n const departure = props.departure || {};\r\n const destination = props.destination || {};\r\n return {\r\n date: Form.createFormField({\r\n ...date,\r\n value: date.value\r\n }),\r\n name: Form.createFormField({\r\n ...name,\r\n value: name.value\r\n }),\r\n lastKnownController: Form.createFormField({\r\n ...lkc,\r\n value: lkc.value\r\n }),\r\n departure: Form.createFormField({\r\n ...departure,\r\n value: departure.value\r\n }),\r\n destination: Form.createFormField({\r\n ...destination,\r\n value: destination.value\r\n })\r\n }\r\n }\r\n})(SetForm)","import { Cell, Column, RenderMode, SelectionModes, Table } from '@blueprintjs/table';\r\nimport { Alert, Button, Col, Divider, Icon, Input, Row, Tooltip } from 'antd';\r\nimport Checkbox from 'antd/lib/checkbox';\r\nimport { getLabelInValueKey } from 'common/form';\r\nimport { useColWidths } from 'common/table';\r\nimport { PersonColumnSet } from 'common/table/blueprintcolumns';\r\nimport { safeGet } from 'common/util';\r\nimport BlueprintTableInfiniteScroller from 'components/BlueprintTableInfiniteScroller';\r\nimport EmployerSelectWithData from 'components/form/select/EmployerSelect';\r\nimport { OrganizationSelect } from 'components/form/select/OrganizationSelect';\r\nimport NonIdealState from 'components/NonIdealState';\r\nimport WithOrgData, { WithOrgDataProps } from 'components/WithOrgData';\r\nimport gql from 'graphql-tag';\r\nimport useControlledState from 'hooks/useControlledState';\r\nimport { useMultiSelectByID } from 'hooks/useMultiSelectByID';\r\nimport { compact } from 'lodash';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { useQuery } from 'react-apollo';\r\nimport { LoadingIndicator, shouldRenderLoadingIndicator } from '..';\r\nimport { SearchProps } from '../interface';\r\nimport '../search.less';\r\nimport SelectionCount from '../SelectionCount';\r\n\r\nconst PERSON_SEARCH_QUERY = gql`\r\nquery PersonSearch(\r\n $filter: PersonFilterInput\r\n $advancedFilter: [FilterByKeyValueInput!]\r\n $advancedFilterOr: [FilterByKeyValueInput!]\r\n $search: [FilterByKeyValueInput!]\r\n $bookmark: String\r\n $limit: Int!\r\n $skip: Int\r\n) {\r\n persons(\r\n filter: $filter\r\n bookmark: $bookmark\r\n advancedFilter: $advancedFilter\r\n advancedFilterOr: $advancedFilterOr\r\n search: $search\r\n limit: $limit\r\n skip: $skip\r\n ){\r\n bookmark\r\n docs {\r\n _id\r\n ... on Person {\r\n lastName\r\n firstName\r\n extraBroadState\r\n customerID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n dob\r\n nation\r\n contactInfo {\r\n phone {\r\n number\r\n type\r\n }\r\n }\r\n python_backend_isNonPreferred\r\n lastPaxWeight\r\n lastBagWeight\r\n lastBagCount\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nexport interface SearchState {\r\n lastName?: string,\r\n firstName?: string,\r\n offset: number\r\n}\r\n\r\nexport const initialSearchState: SearchState = {\r\n lastName: null,\r\n firstName: null,\r\n offset: 0\r\n}\r\n\r\ninterface LabelInValue {\r\n key: string,\r\n label: string\r\n}\r\n\r\nexport interface AdvancedFilterState {\r\n customer?: LabelInValue[],\r\n employer?: LabelInValue[]\r\n}\r\n\r\nexport const initialAdvancedFilterState: AdvancedFilterState = {\r\n customer: [],\r\n employer: []\r\n}\r\n\r\nexport interface PersonSearchProps extends SearchProps, WithOrgDataProps, React.HTMLAttributes {\r\n filterResults?(rows: any[]): any[],\r\n showCustomerColumn?: boolean,\r\n showEmployerColumn?: boolean,\r\n\r\n}\r\n\r\nconst PersonSearch: React.FC = ({\r\n pageLimit = 50,\r\n onSelection,\r\n filterOptions,\r\n selectedItems: selectedItemsProps,\r\n orgData,\r\n showSelectedItemsCount = true,\r\n searchState: searchStateProp,\r\n onSearchStateChange,\r\n excludeCarrier,\r\n showCustomerColumn = true,\r\n showEmployerColumn = true,\r\n filterResults,\r\n ...restProps\r\n}) => {\r\n const [searchState, setSearchState] = useControlledState(initialSearchState, searchStateProp, onSearchStateChange);\r\n const { isSelected, toggleSelection, selectedItems, clearAll } = useMultiSelectByID({ selectedItems: selectedItemsProps, onSelection });\r\n const [showMoreFilters, setShowMoreFilters] = useState(false);\r\n const [advFilterState, setAdvFilterState] = useState(initialAdvancedFilterState);\r\n\r\n let colCount = 2;\r\n\r\n if (showCustomerColumn) colCount++;\r\n if (showEmployerColumn) colCount++;\r\n\r\n useEffect(() => {\r\n if (!showEmployerColumn && advFilterState.employer.length) {\r\n setAdvFilterState({ employer: [] });\r\n }\r\n if (!showCustomerColumn && advFilterState.customer.length) {\r\n setAdvFilterState({ customer: [] });\r\n }\r\n if (!showEmployerColumn && !showCustomerColumn && showMoreFilters) {\r\n setShowMoreFilters(false);\r\n }\r\n // eslint-disable-next-line\r\n }, [showEmployerColumn, showCustomerColumn])\r\n\r\n const inputDirty = (\r\n searchState.lastName ||\r\n searchState.firstName ||\r\n advFilterState.employer.length ||\r\n advFilterState.customer.length\r\n ) ? true : false;\r\n\r\n function getAdvFilterValues(): { [key: string]: string[] } {\r\n let keys = Object.keys(advFilterState);\r\n let keyValues = {};\r\n keys.forEach(key => {\r\n let value = advFilterState[key];\r\n if (Array.isArray(value)) {\r\n keyValues[key] = value.map(valItem => getLabelInValueKey(valItem))\r\n }\r\n else {\r\n return;\r\n }\r\n })\r\n return keyValues\r\n }\r\n\r\n function hideMoreFilters() {\r\n setShowMoreFilters(false);\r\n }\r\n\r\n let variables = {\r\n filter: {\r\n lastName: searchState.lastName,\r\n firstName: searchState.firstName,\r\n employer: null,\r\n customer: null\r\n },\r\n limit: pageLimit,\r\n advancedFilter: null\r\n }\r\n\r\n const advFilterValues = getAdvFilterValues();\r\n variables.advancedFilter = [];\r\n if (advFilterValues.employer.length) {\r\n variables.filter.employer = advFilterValues.employer;\r\n }\r\n if (advFilterValues.customer.length) {\r\n variables.filter.customer = advFilterValues.customer;\r\n }\r\n\r\n const queryResult = useQuery(PERSON_SEARCH_QUERY, {\r\n variables,\r\n fetchPolicy: 'cache-and-network',\r\n skip: !inputDirty,\r\n context: {\r\n debounceKey: 'personsearch',\r\n debounceTimeout: 1000\r\n }\r\n })\r\n\r\n function handleRefresh() {\r\n setSearchState({ ...searchState, offset: 0 });\r\n queryResult.refetch()\r\n }\r\n\r\n function handleInputValueChange(key: string, value: string) {\r\n setSearchState({ ...searchState, [key]: value })\r\n }\r\n\r\n function handleInputPressEnter(key: string, value: string) {\r\n setSearchState({ ...searchState, [key]: value })\r\n }\r\n\r\n const [colWidths, , updateColWidth] = useColWidths(colCount, { 0: 40 }, 200);\r\n\r\n function renderTable() {\r\n const { data, error, networkStatus, fetchMore } = queryResult;\r\n if (shouldRenderLoadingIndicator(networkStatus)) {\r\n return \r\n }\r\n\r\n if (!inputDirty || (!data && networkStatus > 3 && !error)) {\r\n return \r\n }\r\n\r\n if (error) return \r\n\r\n let rows: any[] = safeGet(['persons', 'docs'], data);\r\n if (!Array.isArray(rows)) {\r\n rows = [];\r\n }\r\n if (!rows.length) {\r\n return \r\n }\r\n\r\n if (filterResults) {\r\n rows = filterResults(rows)\r\n }\r\n console.log('------');\r\n const ColumnSet = new PersonColumnSet(rows);\r\n let colNames = [];\r\n if (showEmployerColumn) {\r\n colNames.push('employerName');\r\n }\r\n if (showCustomerColumn) {\r\n colNames.push('customerName');\r\n }\r\n let columns = [\r\n {\r\n const record = rows[idx];\r\n if (record) {\r\n let checked = isSelected ? isSelected(record._id) : false\r\n console.log('checked: ', checked);\r\n return \r\n {\r\n if (toggleSelection) {\r\n toggleSelection(record._id);\r\n }\r\n }}\r\n />\r\n \r\n }\r\n return \r\n }} />,\r\n {\r\n let row = rows[idx];\r\n let nonPrefIcon = null;\r\n\r\n if (row.python_backend_isNonPreferred) {\r\n nonPrefIcon = \r\n }\r\n\r\n return \r\n \r\n
    \r\n {row.lastName + ' ' + row.firstName}\r\n {nonPrefIcon}\r\n
    \r\n
    \r\n
    \r\n }}\r\n />,\r\n ...ColumnSet.some(colNames)\r\n ]\r\n return = pageLimit + searchState.offset}\r\n loadMore={() => {\r\n let nextOffset = searchState.offset + pageLimit;\r\n return fetchMore({\r\n variables: {\r\n skip: nextOffset\r\n },\r\n updateQuery: (prev: any, { fetchMoreResult }) => {\r\n if (!fetchMoreResult) return prev;\r\n setSearchState({ ...searchState, offset: nextOffset });\r\n return {\r\n ...prev,\r\n persons: {\r\n ...prev.persons,\r\n docs: [\r\n ...prev.persons.docs,\r\n ...fetchMoreResult.persons.docs\r\n ]\r\n }\r\n }\r\n }\r\n })\r\n }}\r\n >\r\n {\r\n if (isSelected(row._id)) {\r\n return {\r\n rows: [idx, idx]\r\n }\r\n }\r\n return null\r\n }))}\r\n >\r\n {columns}\r\n \r\n \r\n }\r\n\r\n function numAdvFiltersApplied() {\r\n let values = Object.values(advFilterState);\r\n values = values.filter(value => {\r\n if (Array.isArray(value)) {\r\n return value.length > 0\r\n }\r\n return value\r\n });\r\n return values.length\r\n }\r\n\r\n return
    \r\n
    \r\n \r\n \r\n
    \r\n \r\n handleInputValueChange('lastName', e.target.value)}\r\n onPressEnter={(e) => handleInputPressEnter('lastName', e.currentTarget.value)}\r\n value={searchState.lastName}\r\n />\r\n handleInputValueChange('firstName', e.target.value)}\r\n onPressEnter={(e) => handleInputPressEnter('firstName', e.currentTarget.value)}\r\n value={searchState.firstName}\r\n />\r\n \r\n
    \r\n {showMoreFilters && (showCustomerColumn || showEmployerColumn) ? (\r\n <>\r\n {showCustomerColumn ? (\r\n
    \r\n
    Filter customers
    \r\n setAdvFilterState({ ...advFilterState, customer: value })}\r\n />\r\n
    \r\n ) : null}\r\n {showEmployerColumn ? (\r\n
    \r\n
    Filter employers
    \r\n setAdvFilterState({ ...advFilterState, employer: e })}\r\n style={{ maxWidth: '22rem' }}\r\n className=\"search-header-input\"\r\n placeholder=\"Search by name\"\r\n labelInValue\r\n />\r\n
    \r\n ) : null}\r\n \r\n ) : null}\r\n \r\n \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n {(showCustomerColumn || showEmployerColumn) ? (\r\n <>\r\n \r\n {!showMoreFilters ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n ) : null}\r\n \r\n {selectedItems.length > 0 ? (\r\n \r\n clearAll()}\r\n itemName=\"person\"\r\n />\r\n \r\n ) : null}\r\n \r\n
    \r\n
    \r\n {renderTable()}\r\n
    \r\n
    \r\n}\r\n\r\nexport default WithOrgData(PersonSearch)","import { Cell, Column, RenderMode, SelectionModes, Table } from '@blueprintjs/table';\r\nimport { Alert, Button, Col, Icon, Input, Row } from 'antd';\r\nimport Checkbox from 'antd/lib/checkbox';\r\nimport { useColWidths } from 'common/table';\r\nimport { PersonColumnSet } from 'common/table/blueprintcolumns';\r\nimport BlueprintTableInfiniteScroller from 'components/BlueprintTableInfiniteScroller';\r\nimport NonIdealState from 'components/NonIdealState';\r\nimport WithOrgData, { WithOrgDataProps } from 'components/WithOrgData';\r\nimport gql from 'graphql-tag';\r\nimport useControlledState from 'hooks/useControlledState';\r\nimport { useMultiSelectByID } from 'hooks/useMultiSelectByID';\r\nimport { compact } from 'lodash';\r\nimport React from 'react';\r\nimport { useQuery } from 'react-apollo';\r\nimport { LoadingIndicator, shouldRenderLoadingIndicator } from '..';\r\nimport { SearchProps } from '../interface';\r\nimport '../search.less';\r\nimport SelectionCount from '../SelectionCount';\r\n\r\nconst PERSON_SEARCH_BY_CRED_QUERY = gql`\r\nquery PersonSearchByCred(\r\n $search: String!\r\n) {\r\n getPersonsByCred(\r\n search: $search\r\n ){\r\n _id\r\n lastName\r\n firstName\r\n extraBroadState\r\n customerID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n dob\r\n nation\r\n contactInfo {\r\n phone {\r\n number\r\n type\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nexport interface CredSearchState {\r\n credKey?: string,\r\n offset: number\r\n}\r\n\r\nexport const initialSearchCredState: CredSearchState = {\r\n credKey: null,\r\n offset: 0\r\n}\r\n\r\nexport interface PersonSearchByCredProps extends SearchProps, WithOrgDataProps, React.HTMLAttributes {\r\n filterResults?(rows: any[]): any[],\r\n showCustomerColumn?: boolean,\r\n showEmployerColumn?: boolean,\r\n\r\n}\r\n\r\nconst PersonSearchByCred: React.FC = ({\r\n pageLimit=50,\r\n onSelection,\r\n filterOptions,\r\n selectedItems: selectedItemsProps,\r\n orgData,\r\n showSelectedItemsCount=true,\r\n searchState: searchStateProp,\r\n onSearchStateChange,\r\n excludeCarrier,\r\n showCustomerColumn=true,\r\n showEmployerColumn=true,\r\n filterResults,\r\n ...restProps\r\n}) => {\r\n const [ searchState, setSearchState ] = useControlledState(initialSearchCredState, searchStateProp, onSearchStateChange);\r\n const { isSelected, toggleSelection, selectedItems, clearAll } = useMultiSelectByID({ selectedItems: selectedItemsProps, onSelection });\r\n \r\n let colCount = 2;\r\n\r\n if (showCustomerColumn) colCount++;\r\n if (showEmployerColumn) colCount++;\r\n\r\n const inputDirty = (\r\n searchState.credKey\r\n ) ? true : false;\r\n\r\n let variables = {\r\n search: searchState.credKey\r\n }\r\n\r\n const queryResult = useQuery(PERSON_SEARCH_BY_CRED_QUERY, {\r\n variables,\r\n fetchPolicy: 'cache-and-network',\r\n context: {\r\n debounceKey: 'getPersonsByCred',\r\n debounceTimeout: 1000\r\n }\r\n })\r\n\r\n function handleRefresh(){\r\n setSearchState({ ...searchState, offset: 0 });\r\n queryResult.refetch()\r\n }\r\n\r\n function handleInputValueChange(key: string, value: string) {\r\n setSearchState({ ...searchState, [key]: value })\r\n }\r\n\r\n function handleInputPressEnter(key: string, value: string) {\r\n setSearchState({ ...searchState, [key]: value })\r\n }\r\n\r\n const [ colWidths, , updateColWidth ] = useColWidths(colCount, { 0: 40 }, 200);\r\n\r\n function renderTable(){\r\n const { data, error, networkStatus, loading} = queryResult;\r\n console.log(queryResult)\r\n if (loading || shouldRenderLoadingIndicator(networkStatus)){\r\n return \r\n }\r\n\r\n if (!inputDirty || (!data && networkStatus > 3 && !error)){\r\n return \r\n }\r\n\r\n if (error) return \r\n\r\n let rows: any[] = data.getPersonsByCred\r\n\r\n if (!Array.isArray(rows)){\r\n rows = [];\r\n }\r\n if (!rows.length){\r\n return \r\n }\r\n\r\n const ColumnSet = new PersonColumnSet(rows);\r\n let colNames = ['personName'];\r\n if (showEmployerColumn){\r\n colNames.push('employerName');\r\n }\r\n if (showCustomerColumn){\r\n colNames.push('customerName');\r\n }\r\n let columns = [\r\n {\r\n const record = rows[idx];\r\n if(record){\r\n let checked = isSelected ? isSelected(record._id) : false\r\n console.log('checked: ', checked);\r\n return \r\n {\r\n if (toggleSelection){\r\n toggleSelection(record._id);\r\n }\r\n }}\r\n />\r\n \r\n }\r\n return \r\n }} />,\r\n ...ColumnSet.some(colNames)\r\n ]\r\n \r\n return = pageLimit + searchState.offset}\r\n >\r\n {\r\n if (isSelected(row._id)){\r\n return {\r\n rows: [ idx, idx ]\r\n }\r\n }\r\n return null\r\n }))}\r\n >\r\n {columns}\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 console.log(e.target.value)\r\n handleInputValueChange('credKey', e.target.value)\r\n }\r\n }\r\n onPressEnter={(e) => handleInputPressEnter('credKey', e.currentTarget.value)}\r\n value={searchState.credKey}\r\n />\r\n \r\n
    \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n {selectedItems.length > 0 ? (\r\n \r\n clearAll()} />\r\n \r\n ) : null}\r\n \r\n
    \r\n
    \r\n {renderTable()}\r\n
    \r\n
    \r\n}\r\n\r\nexport default WithOrgData(PersonSearchByCred)","import React from 'react';\r\nimport { Form, Input, Row, Col, DatePicker } from 'antd';\r\nimport { LocationSelect } from '../../form/select/LocationSelect';\r\n\r\nconst SetForm = ({ form, showDate=false, dateFormat=\"YYYY-MM-DD\", useGroupName=false, disabled=false }) => {\r\n const { getFieldDecorator } = form;\r\n return (\r\n
    \r\n \r\n {showDate ? (\r\n \r\n \r\n {getFieldDecorator('date', {\r\n rules: [\r\n { required: true, message: 'Flight date is required' }\r\n ]\r\n })()}\r\n \r\n \r\n ) : null}\r\n \r\n \r\n {getFieldDecorator('name', {\r\n rules: [\r\n { required: true, message: 'Set name is required' }\r\n ]\r\n })()}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('departure', {\r\n rules: [\r\n { required: true, message: 'Heliport is required' }\r\n ]\r\n })()}\r\n \r\n \r\n \r\n \r\n {getFieldDecorator('destination', {\r\n rules: [\r\n { required: true, message: 'Off Shore Location is required' }\r\n ]\r\n })()}\r\n \r\n \r\n \r\n
    \r\n )\r\n}\r\n\r\nexport default Form.create({\r\n onFieldsChange(props, changedFields, allFields){\r\n if (!props.onChange) return;\r\n props.onChange(changedFields, allFields);\r\n },\r\n mapPropsToFields(props) {\r\n const date = props.date || {};\r\n const name = props.name || {};\r\n const departure = props.departure || {};\r\n const destination = props.destination || {};\r\n return {\r\n date: Form.createFormField({\r\n ...date,\r\n value: date.value\r\n }),\r\n name: Form.createFormField({\r\n ...name,\r\n value: name.value\r\n }),\r\n departure: Form.createFormField({\r\n ...departure,\r\n value: departure.value\r\n }),\r\n destination: Form.createFormField({\r\n ...destination,\r\n value: destination.value\r\n })\r\n }\r\n }\r\n})(SetForm)","import React from 'react';\r\nimport { Spin, Icon, Input, InputNumber } from 'antd';\r\nimport DraggableTable from '../../TableDragSorting';\r\nimport './SetsTable.less';\r\n\r\nconst SetsTable = ({\r\n data,\r\n isScheduling=false,\r\n selectedRowKeys,\r\n isEditing=false,\r\n previewData=[],\r\n previewLoading=false,\r\n onMoveRow=() => null,\r\n onRowSelectChange=() => null,\r\n onPersonsToScheduleChange=() => null,\r\n defaultChargeCode\r\n}) => {\r\n const filterPreview = (item) => {\r\n return !data.find(dItem => dItem._id === item._id);\r\n }\r\n const mapPreview = item => ({ ...item, preview: true });\r\n let dataWithPreview = [\r\n ...data,\r\n ...previewData.filter(filterPreview).map(mapPreview)\r\n ]\r\n\r\n const handleInputChange = (person_id, field, value) => {\r\n const newData = data.map((per) => {\r\n if (per._id === person_id) {\r\n return {\r\n ...per,\r\n [field]: value\r\n }\r\n }\r\n return per\r\n });\r\n onPersonsToScheduleChange(newData);\r\n }\r\n\r\n const renderNumberInput = (personId, field, val) => (\r\n handleInputChange(personId, field, value)}\r\n size=\"small\"\r\n value={val || 0}\r\n />\r\n )\r\n\r\n const columns = [\r\n {\r\n title: 'Order',\r\n key: 'order',\r\n render: (_, __, index) => {\r\n return index + 1\r\n }\r\n },\r\n {\r\n title: 'Name',\r\n key: 'name',\r\n render: (_, { lastName, firstName }) => {\r\n return `${lastName}, ${firstName}`\r\n }\r\n },\r\n {\r\n title: 'Employer',\r\n key: 'employer',\r\n dataIndex: 'employerID',\r\n render: (obj) => obj && obj.name\r\n }\r\n ]\r\n if (isScheduling){\r\n columns.push(...[\r\n {\r\n title: 'Weight',\r\n key: 'paxWeight',\r\n dataIndex: 'paxWeight',\r\n render: (val, record) => renderNumberInput(record._id, 'paxWeight', val)\r\n },\r\n {\r\n title: 'Bag Weight',\r\n key: 'bagWeight',\r\n dataIndex: 'bagWeight',\r\n render: (val, record) => renderNumberInput(record._id, 'bagWeight', val)\r\n },\r\n {\r\n title: 'Bag Count',\r\n key: 'bagCount',\r\n dataIndex: 'bagCount',\r\n render: (val, record) => renderNumberInput(record._id, 'bagCount', val)\r\n },\r\n {\r\n title: 'Charge Code',\r\n key: 'chargeCode',\r\n dataIndex: 'chargeCode',\r\n render: (val, record) => (\r\n handleInputChange(record._id, 'chargeCode', e.target.value && e.target.value.split(\" \").join(\"\").toUpperCase())}\r\n size=\"small\"\r\n value={val}\r\n placeholder={defaultChargeCode && defaultChargeCode.toUpperCase()}\r\n />\r\n )\r\n }\r\n ])\r\n }\r\n return (\r\n \r\n record._id}\r\n onRow={(record, index) => (isEditing ? {\r\n index,\r\n moveRow: onMoveRow,\r\n className: record.preview ? \"scheduling-sets-table-row-highlighted\" : undefined\r\n } : null)}\r\n rowSelection={isEditing && previewData.length <= 0 ? {\r\n selectedRowKeys: selectedRowKeys,\r\n onChange: onRowSelectChange\r\n } : null}\r\n />\r\n {previewLoading ? (\r\n
    \r\n } />\r\n
    \r\n ) : null}\r\n
    \r\n )\r\n}\r\n\r\nexport default SetsTable","import { Alert, Button, Col, Dropdown, Icon, Input, Layout, Menu, Modal, Radio, Row, Spin, Tabs } from 'antd';\r\nimport CargoSiderTab from 'components/scheduling/PaxCgoScheduler/CargoSiderTab';\r\nimport QueryPersonnelIDs from 'components/scheduling/PaxCgoScheduler/QueryPersonnelIDs';\r\nimport PaxCgoSchedulerTable from 'components/scheduling/PaxCgoScheduler/table';\r\nimport SetFormShedule from 'components/scheduling/SetsEditor/SetFormShedule';\r\nimport PersonSearch from 'components/search/PersonSearch';\r\nimport PersonSearchByCred from 'components/search/PersonSearchByCred';\r\nimport gql from 'graphql-tag';\r\nimport { useMultiSelect } from 'hooks/useMultiSelect';\r\nimport React, { useEffect, useRef, useState } from 'react';\r\nimport { Query } from 'react-apollo';\r\nimport { ReflexContainer, ReflexElement, ReflexSplitter } from 'react-reflex';\r\nimport { safeGet } from '../../../common/util';\r\nimport MainHeader from '../MainHeader';\r\nimport MainLayout from '../MainLayout';\r\nimport SetForm from './SetForm';\r\nimport './SetsEditor.less';\r\n// import PersonSearch from '../../PersonSearch/PersonSearch';\r\nimport SetsTable from './SetsTable';\r\n\r\nconst defaultTableRowKeys = {\r\n OUTBOUND: [],\r\n INBOUND: []\r\n}\r\n\r\nconst SetsEditor = ({\r\n setData,\r\n isEditing=false,\r\n isNew=true,\r\n isScheduling=false,\r\n onEditChange=() => null,\r\n onSave=() => null,\r\n renderTable=null,\r\n onPersonsAdd,\r\n onPersonsRemove,\r\n onPersonsMove,\r\n onPersonsReorder,\r\n onFormChange,\r\n saving=false,\r\n saveError=null,\r\n mainHeaderRoutes,\r\n onScheduleChange,\r\n addPersonsLoading=false,\r\n selectedPersonKeys=[],\r\n selectedTableRowKeys=defaultTableRowKeys,\r\n transitType=\"OUTBOUND\",\r\n onSelectedPersonKeysChange=() => null,\r\n onSelectedTableRowKeysChange=() => null,\r\n onTransitTypeChange=() => null,\r\n personsToSchedule=[],\r\n cargoToSchedule=[],\r\n onScheduledUpdate=() => null,\r\n onPersonsToScheduleChange=() => null,\r\n onPersonsToScheduleMove=() => null,\r\n onCargoToScheduleChange=() => null,\r\n onSchedule=() => null,\r\n onDefaultChargeCodeChange=() => null,\r\n defaultChargeCode,\r\n onDelete,\r\n deleting=false\r\n}) => {\r\n const setsForm = useRef(null);\r\n \r\n const multiSelect = useMultiSelect({ primaryKey: '_id' });\r\n \r\n const [ cargoEditState, setCargoEditState ] = useState();\r\n\r\n const initialFormFields = {\r\n name: {\r\n value: safeGet(['data', 'getPersonSet', 'name'], setData)\r\n },\r\n departure: {\r\n value: {\r\n key: safeGet(['data', 'getPersonSet', 'departureID', '_id'], setData),\r\n label: safeGet(['data', 'getPersonSet', 'departureID', 'name'], setData)\r\n }\r\n },\r\n destination: {\r\n value: {\r\n key: safeGet(['data', 'getPersonSet', 'destinationID', '_id'], setData),\r\n label: safeGet(['data', 'getPersonSet', 'destinationID', 'name'], setData)\r\n }\r\n }\r\n }\r\n\r\n const [ formFields, setFormFields ] = useState(initialFormFields)\r\n\r\n const handleFormChange = (_, newFields) => {\r\n setFormFields(newFields);\r\n if (onFormChange){\r\n onFormChange(newFields);\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n setFormFields(initialFormFields);\r\n // eslint-disable-next-line\r\n }, [ setData.loading ])\r\n\r\n useEffect(() => {\r\n if (!isEditing) {\r\n if (selectedPersonKeys.length > 0 ){\r\n onSelectedPersonKeysChange([]);\r\n }\r\n onSelectedTableRowKeysChange(defaultTableRowKeys);\r\n setFormFields(initialFormFields);\r\n }\r\n // eslint-disable-next-line\r\n }, [isEditing])\r\n\r\n const handlePersonsAdd = () => {\r\n if (onPersonsAdd){\r\n onPersonsAdd(selectedPersonKeys, transitType);\r\n }\r\n }\r\n\r\n const handlePersonsRemove = () => {\r\n if (onPersonsRemove) {\r\n onPersonsRemove(selectedTableRowKeys[transitType], transitType);\r\n }\r\n }\r\n\r\n const handleSchedulingRemove = () => {\r\n if(onPersonsToScheduleChange){\r\n onPersonsToScheduleChange(personsToSchedule[transitType].filter(item => !multiSelect.selectedKeys.includes(item._id)))\r\n onCargoToScheduleChange(cargoToSchedule[\"INBOUND\"].filter(item => !multiSelect.selectedKeys.includes(item._id)))\r\n }\r\n multiSelect.clearAll()\r\n }\r\n\r\n const handleSchedulingPersonsMove = () => {\r\n if (onPersonsToScheduleMove){\r\n const destTT = transitType === 'OUTBOUND' ? 'INBOUND' : 'OUTBOUND';\r\n const selected = personsToSchedule[transitType].filter(item => multiSelect.selectedKeys.includes(item._id))\r\n onPersonsToScheduleMove(personsToSchedule[destTT].concat(selected), destTT)\r\n }\r\n multiSelect.clearAll()\r\n }\r\n\r\n const handlePersonsMove = () => {\r\n if (onPersonsMove){\r\n const destTT = transitType === 'OUTBOUND' ? 'INBOUND' : 'OUTBOUND';\r\n onPersonsMove(selectedTableRowKeys[transitType], destTT);\r\n }\r\n }\r\n\r\n const handleMoveRow = (dragIndex, hoverIndex) => {\r\n if (onPersonsReorder){\r\n onPersonsReorder(dragIndex, hoverIndex, transitType)\r\n }\r\n }\r\n\r\n const handleSave = () => {\r\n setsForm.current.validateFields((err, values) => {\r\n if (!err){\r\n onSave(values)\r\n }\r\n })\r\n }\r\n\r\n const handleSchedule = () => {\r\n setsForm.current.validateFields((err) => {\r\n if (!err){\r\n onSchedule({\r\n date: formFields.date.value,\r\n name: formFields.name.value.trim(),\r\n lastKnownController: isScheduling ? safeGet(['lastKnownController', 'value', 'key'], formFields) : undefined,\r\n departureID: safeGet(['departure', 'value', 'key'], formFields),\r\n destinationID: safeGet(['destination', 'value', 'key'], formFields)\r\n })\r\n }\r\n })\r\n }\r\n\r\n let personList;\r\n try{\r\n personList = setData.data.getPersonSet[transitType.toLowerCase()] || []\r\n personList = personList.filter(p => p);\r\n }\r\n catch(err){\r\n personList = []\r\n }\r\n\r\n let mainHeaderProps = {\r\n routes: mainHeaderRoutes,\r\n actions: (\r\n \r\n {onDelete ? (\r\n \r\n Modal.confirm({\r\n title: 'Are you sure?',\r\n content: 'Are you sure you want to delete this set?',\r\n onOk: () => onDelete(setData.data.getPersonSet._id)\r\n })}\r\n >\r\n Delete\r\n \r\n \r\n ) : null}\r\n {onScheduleChange ? (\r\n \r\n \r\n \r\n ) : null}\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n\r\n if (isEditing){\r\n mainHeaderProps.actions = (\r\n \r\n \r\n \r\n \r\n {isScheduling ? (\r\n \r\n \r\n \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 renderContent = () => {\r\n if (setData.loading){\r\n return (\r\n
    \r\n } />\r\n
    \r\n )\r\n }\r\n\r\n let outbound = (setData.data && setData.data.getPersonSet && setData.data.getPersonSet.outbound) || [];\r\n outbound = outbound.filter(p => p);\r\n let inbound = (setData.data && setData.data.getPersonSet && setData.data.getPersonSet.inbound) || [];\r\n inbound = inbound.filter(p => p);\r\n\r\n return (\r\n \r\n {setData.error ? (\r\n \r\n ) : null}\r\n \r\n {!isScheduling ? (\r\n onTransitTypeChange(e.target.value)}>\r\n {`Outbound (${outbound.length})`}\r\n {`Inbound (${inbound.length})`}\r\n \r\n ) : null}\r\n \r\n {isEditing && selectedTableRowKeys[transitType].length ? (\r\n \r\n Remove\r\n \r\n {transitType === 'OUTBOUND' ? 'Move to inbound' : 'Move to outbound'}\r\n \r\n \r\n }\r\n >\r\n \r\n \r\n ) : isScheduling && multiSelect.selectedItems.length ? (\r\n \r\n Remove\r\n \r\n {transitType === 'OUTBOUND' ? 'Move to inbound' : 'Move to outbound'}\r\n \r\n \r\n }\r\n >\r\n \r\n ) : null}\r\n \r\n {isScheduling ? (\r\n \r\n Default Charge Code: \r\n onDefaultChargeCodeChange(e.target.value.split(\" \").join(\"\"))}\r\n value={defaultChargeCode}\r\n />\r\n \r\n ) : null}\r\n {!isScheduling ? (selectedPersonKeys.length ? (\r\n \r\n {`Add ${selectedPersonKeys.length} people to ${transitType.toLowerCase()}`}\r\n \r\n ) : null): null}\r\n \r\n {renderTable ? renderTable({\r\n data: setData.data.getPersonSet[transitType.toLowerCase()]\r\n }) :\r\n \r\n {({ data, loading }) => {\r\n return ( isScheduling ?(\r\n \r\n {\r\n if (!data){\r\n setCargoEditState(undefined);\r\n }\r\n else\r\n {\r\n setCargoEditState(data);\r\n }\r\n }}\r\n cargoEditID={cargoEditState && cargoEditState._id}\r\n paxData={personsToSchedule[transitType]}\r\n cgoData={cargoToSchedule[\"INBOUND\"]}\r\n multiSelect={{\r\n toggleSelection: multiSelect.toggleSelection,\r\n isSelected: multiSelect.isSelected\r\n }}\r\n onCellEdit={(id, fieldKey, value) => {\r\n onScheduledUpdate(personsToSchedule[transitType].map((row) => {\r\n if (row._id === id){\r\n return {\r\n ...row,\r\n [fieldKey]: value\r\n }\r\n }\r\n return row\r\n }), transitType, \"PAX\")\r\n onScheduledUpdate(cargoToSchedule[\"INBOUND\"].map((row) => {\r\n if (row._id === id){\r\n return {\r\n ...row,\r\n [fieldKey]: value\r\n }\r\n }\r\n return row\r\n }), \"INBOUND\", \"CGO\")\r\n }}\r\n renderPaxPanelExtra={selectedPersonKeys.length ? (\r\n \r\n {({ data, loading, error }) => {\r\n return }>\r\n {error ? (\r\n \r\n Failed to load selected personnel\r\n \r\n ) : null}\r\n {\r\n e.stopPropagation();\r\n handlePersonsAdd(e)\r\n }}\r\n >\r\n Add {selectedPersonKeys.length} PAX to {transitType.charAt(0).toUpperCase() + transitType.slice(1).toLowerCase()}\r\n \r\n \r\n }}\r\n \r\n ) : null}\r\n paxPanelHeader={\r\n <>\r\n Passengers\r\n {\r\n onTransitTypeChange(e.target.value)}\r\n }>\r\n {`Outbound (${personsToSchedule[\"OUTBOUND\"].length})`}\r\n {`Inbound (${personsToSchedule[\"INBOUND\"].length})`}\r\n \r\n \r\n }\r\n />\r\n ) : (\r\n \r\n onSelectedTableRowKeysChange({ ...selectedTableRowKeys, [transitType]: sr })}\r\n onMoveRow={handleMoveRow}\r\n onPersonsToScheduleChange={onPersonsToScheduleChange}\r\n defaultChargeCode={defaultChargeCode}\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 getPersonId = (per) => per && per._id;\r\n\r\n // let outbound = safeGet(['getPersonSet', 'outbound'], setData) || [];\r\n // let inbound = safeGet(['getPersonSet', 'inbound'], setData) || [];\r\n // outbound = outbound.map(getPersonId);\r\n // inbound = inbound.map(getPersonId);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {isScheduling ? (\r\n \r\n \r\n \r\n onSelectedPersonKeysChange(sp)}\r\n />\r\n \r\n \r\n onSelectedPersonKeysChange(sp)}\r\n />\r\n \r\n \r\n \r\n \r\n {\r\n let obj = {\r\n ...values,\r\n classType: 'flytsuite.cgonode'\r\n }\r\n onCargoToScheduleChange(cargoToSchedule[\"INBOUND\"].concat(obj))\r\n }}\r\n />\r\n \r\n ) : (isEditing ? (\r\n
    \r\n

    Search Personnel

    \r\n \r\n \r\n onSelectedPersonKeysChange(sp)}\r\n />\r\n \r\n \r\n onSelectedPersonKeysChange(sp)}\r\n />\r\n \r\n \r\n
    \r\n ) : null)}\r\n
    \r\n {isEditing ? : null}\r\n \r\n {setData.loading ? (\r\n
    \r\n } />\r\n
    \r\n ) : null}\r\n {saveError && isEditing && !setData.loading ? (\r\n \r\n ) : null}\r\n {/* {disableSave && isEditing && !setData.loading && !setData.error ? (\r\n \r\n ) : null} */}\r\n {!setData.loading ? (\r\n \r\n {isScheduling ? (\r\n \r\n ) : (\r\n \r\n )}\r\n {renderContent()}\r\n \r\n ) : null}\r\n
    \r\n
    \r\n
    \r\n
    \r\n )\r\n}\r\n\r\nexport default SetsEditor","import gql from 'graphql-tag';\r\n\r\nexport default gql`\r\nmutation SchedulePassengers(\r\n $tpID: ID!\r\n $customerID: ID!\r\n $departureID: ID!\r\n $destinationID: ID!\r\n $scheduledFlightDate: AWSDate!\r\n $lastKnownController: String\r\n $scheduledGroup: String!\r\n $persons: [PersonScheduleInput]\r\n $inboundCargo: [ScheduledInboundCargoInput]\r\n){\r\n schedulePassengers(\r\n tpID: $tpID\r\n customerID: $customerID\r\n departureID: $departureID\r\n destinationID: $destinationID\r\n scheduledFlightDate: $scheduledFlightDate\r\n lastKnownController: $lastKnownController\r\n scheduledGroup: $scheduledGroup\r\n persons: $persons\r\n inboundCargo: $inboundCargo\r\n ){\r\n _id\r\n lastName\r\n firstName\r\n transitType\r\n scheduledOrder\r\n paxWeight\r\n bagWeight\r\n bagCount\r\n chargeCode\r\n customerID {\r\n _id\r\n }\r\n tpID {\r\n _id\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n lastKnownController {\r\n _id\r\n name\r\n }\r\n authorization {\r\n onWhiteList\r\n brdRestriction_Isn {\r\n status\r\n type\r\n notes\r\n reason\r\n }\r\n }\r\n isnCheckError {\r\n message\r\n }\r\n lastIsnResultWithHeader {\r\n isn_customer\r\n isn_ownerid\r\n success\r\n error_message\r\n quick_check_status\r\n reason\r\n qc_count\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n }\r\n }\r\n}\r\n`","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nmutation SetPersonSet($payload: PersonSetInput!){\r\n setPersonSet(payload: $payload){\r\n _id\r\n name\r\n outbound {\r\n _id\r\n firstName\r\n lastName\r\n employerID {\r\n _id\r\n name\r\n }\r\n vip\r\n dob\r\n }\r\n inbound {\r\n _id\r\n firstName\r\n lastName\r\n employerID {\r\n _id\r\n name\r\n }\r\n vip\r\n dob\r\n }\r\n owner\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n owner\r\n }\r\n}\r\n`","import gql from 'graphql-tag';\r\n\r\nexport default gql`\r\nquery PersonSet($setId: ID!){\r\n getPersonSet(_id: $setId){\r\n _id\r\n name\r\n outbound {\r\n _id\r\n firstName\r\n lastName\r\n employerID {\r\n _id\r\n name\r\n }\r\n vip\r\n dob\r\n }\r\n inbound {\r\n _id\r\n firstName\r\n lastName\r\n employerID {\r\n _id\r\n name\r\n }\r\n vip\r\n dob\r\n }\r\n owner\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n }\r\n}\r\n`","import gql from 'graphql-tag';\r\n\r\nexport default gql`\r\nquery PersonSetCached($setId: ID!){\r\n getPersonSet(_id: $setId) @client{\r\n _id\r\n name\r\n outbound {\r\n _id\r\n firstName\r\n lastName\r\n employerID {\r\n _id\r\n name\r\n }\r\n vip\r\n dob\r\n }\r\n inbound {\r\n _id\r\n firstName\r\n lastName\r\n employerID {\r\n _id\r\n name\r\n }\r\n vip\r\n dob\r\n }\r\n owner\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n owner\r\n }\r\n}\r\n`","import { message } from 'antd';\r\nimport gql from 'graphql-tag';\r\nimport update from 'immutability-helper';\r\nimport lodash from 'lodash';\r\nimport moment from 'moment';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { Mutation, Query } from 'react-apollo';\r\nimport { compose } from 'recompose';\r\nimport { safeGet } from '../common/util';\r\nimport checkScheduledPax from '../components/scheduling/checkScheduledPax';\r\nimport SetsEditor from '../components/scheduling/SetsEditor/SetsEditor';\r\nimport withCognitoUser from '../components/WithCognitoUser';\r\nimport WithOrgData from '../components/WithOrgData';\r\nimport DeleteEntity from '../Mutations/DeleteEntity';\r\nimport SchedulePassengersMutation from '../Mutations/SchedulePassengersMutation';\r\nimport SetPersonSet from '../Mutations/SetPersonSet';\r\nimport GetPersonSetQuery from '../Queries/GetPersonSetQuery';\r\nimport GetPersonSetQueryCached from '../Queries/GetPersonSetQueryCached';\r\n\r\nconst defaultTableRowKeys = {\r\n OUTBOUND: [],\r\n INBOUND: []\r\n}\r\n\r\nconst SetsEditorContainer = ({\r\n setId: origSetId,\r\n isEditing=false,\r\n isScheduling=false,\r\n isNew=true,\r\n createRoutes=() => null,\r\n onEditChange,\r\n onScheduleChange,\r\n onSaved,\r\n onScheduled,\r\n orgData,\r\n cognitoUser,\r\n onDeleted\r\n}) => {\r\n\r\n const [ addPersonsLoading, setAPL ] = useState(false);\r\n const [ selectedPersonKeys, setSPK ] = useState([]);\r\n const [ selectedTableRowKeys, setSTRK ] = useState(defaultTableRowKeys);\r\n const [ transitType, setTT ] = useState('OUTBOUND');\r\n\r\n const [ unsavedCreated, setUnsavedCreated ] = useState(false);\r\n\r\n const [ personsToSchedule, setPTS ] = useState({\r\n OUTBOUND: [],\r\n INBOUND: []\r\n });\r\n\r\n const [ cargoToSchedule, setCTS ] = useState({\r\n INBOUND: []\r\n });\r\n\r\n const [ defaultChargeCode, setDefaultCC ] = useState(null);\r\n\r\n useEffect(() => {\r\n if (!isEditing){\r\n setUnsavedCreated(false);\r\n }\r\n }, [isEditing])\r\n\r\n return (\r\n \r\n {\r\n props => {\r\n let setId = origSetId;\r\n\r\n const getExistingPTS = (perId, transitType) => {\r\n return personsToSchedule[transitType].find(per => per._id === perId);\r\n }\r\n\r\n const initScheduledPerson = (tt) => (person) => {\r\n return getExistingPTS(person._id, tt) || {\r\n ...person,\r\n _id: person._id,\r\n lastName: person.lastName,\r\n firstName: person.firstName,\r\n paxWeight: 0,\r\n bagWeight: 0,\r\n bagCount: 0,\r\n chargeCode: null\r\n }\r\n }\r\n\r\n const initPersonsToSchedule = () => {\r\n const { getPersonSet } = props.client.readQuery({\r\n query: GetPersonSetQueryCached,\r\n variables: { setId }\r\n })\r\n const { outbound, inbound } = getPersonSet;\r\n \r\n setPTS({\r\n OUTBOUND: outbound.filter(p => p).map(initScheduledPerson('OUTBOUND')),\r\n INBOUND: inbound.filter(p => p).map(initScheduledPerson('INBOUND'))\r\n })\r\n }\r\n\r\n const routes = createRoutes({\r\n loading: props.loading,\r\n setName: safeGet(['data', 'getPersonSet', 'name'], props)\r\n })\r\n if (isEditing){\r\n setId = 'unsaved-person-set';\r\n }\r\n if (!isScheduling && personsToSchedule.OUTBOUND.length !== 0 && personsToSchedule.INBOUND.length !== 0){\r\n setPTS({\r\n OUTBOUND: [],\r\n INBOUND: []\r\n })\r\n }\r\n if (isEditing && !unsavedCreated) {\r\n\r\n /*\r\n Create and use an unsaved version of the person set in the cache.\r\n Ensures that the original version of the person set is preserved in case the user cancels changes.\r\n */\r\n let personSet = {\r\n name: null,\r\n outbound: [],\r\n inbound: [],\r\n departureID: null,\r\n destinationID: null,\r\n owner: null\r\n }\r\n if (!isNew){\r\n personSet = props.data && props.data.getPersonSet\r\n }\r\n if (!props.loading && !props.error){\r\n props.client.writeQuery({\r\n query: GetPersonSetQuery,\r\n variables: { setId },\r\n data: {\r\n getPersonSet: {\r\n ...personSet,\r\n __typename: 'PersonSet',\r\n _id: setId\r\n }\r\n }\r\n });\r\n setUnsavedCreated(true);\r\n }\r\n if (isScheduling && !props.loading && !props.error){\r\n initPersonsToSchedule()\r\n }\r\n }\r\n\r\n const addPersons = () => {\r\n setAPL(true);\r\n props.client.query({\r\n variables: { ids: selectedPersonKeys },\r\n query: gql`\r\n query ResolvePersons($ids: [ID!]!){\r\n resolve_entity_ids(\r\n ids: $ids\r\n typename: \"Person\"\r\n ){\r\n ... on Person {\r\n _id\r\n firstName\r\n lastName\r\n employerID {\r\n _id\r\n name\r\n }\r\n vip\r\n dob\r\n }\r\n }\r\n }\r\n `\r\n })\r\n .then(({ data }) => {\r\n setAPL(false);\r\n const personsToAdd = (data && data.resolve_entity_ids) || [];\r\n \r\n const { getPersonSet } = props.client.readQuery({\r\n query: GetPersonSetQuery,\r\n variables: {\r\n setId\r\n }\r\n })\r\n \r\n let outbound = getPersonSet.outbound;\r\n let inbound = getPersonSet.inbound;\r\n \r\n if (transitType === 'OUTBOUND'){\r\n outbound = [...outbound, ...personsToAdd];\r\n outbound = lodash.uniqBy(outbound, (per) => per._id);\r\n }\r\n else\r\n {\r\n inbound = [...inbound, ...personsToAdd];\r\n inbound = lodash.uniqBy(inbound, (per) => per._id);\r\n }\r\n \r\n props.client.writeQuery({\r\n query: GetPersonSetQuery,\r\n variables: {\r\n setId\r\n },\r\n data: {\r\n getPersonSet: {\r\n ...getPersonSet,\r\n inbound,\r\n outbound\r\n }\r\n }\r\n })\r\n initPersonsToSchedule();\r\n setSPK([]);\r\n })\r\n .catch((err) => {\r\n message.error('Failed to add people to set', 3)\r\n .then(() => message.error(err.message, 5));\r\n setAPL(false)\r\n })\r\n }\r\n \r\n const removePersons = () => {\r\n const { getPersonSet } = props.client.readQuery({\r\n query: GetPersonSetQuery,\r\n variables: {\r\n setId\r\n }\r\n })\r\n\r\n const personKeys = selectedTableRowKeys[transitType];\r\n \r\n let outbound = getPersonSet.outbound;\r\n let inbound = getPersonSet.inbound;\r\n \r\n if (transitType === 'OUTBOUND'){\r\n outbound = outbound.filter(per => !personKeys.includes(per._id));\r\n }\r\n else\r\n {\r\n inbound = inbound.filter(per => !personKeys.includes(per._id));\r\n }\r\n \r\n props.client.writeQuery({\r\n query: GetPersonSetQuery,\r\n variables: {\r\n setId\r\n },\r\n data: {\r\n getPersonSet: {\r\n ...getPersonSet,\r\n inbound,\r\n outbound\r\n }\r\n }\r\n })\r\n initPersonsToSchedule();\r\n setSTRK(defaultTableRowKeys);\r\n }\r\n\r\n const movePersons = (selectedKeys = selectedTableRowKeys[transitType]) => {\r\n const { getPersonSet } = props.client.readQuery({\r\n query: GetPersonSetQuery,\r\n variables: {\r\n setId\r\n }\r\n })\r\n\r\n const toTT = transitType === 'OUTBOUND' ? 'INBOUND' : 'OUTBOUND';\r\n\r\n const personKeys = selectedKeys;\r\n \r\n let personData = {\r\n outbound: getPersonSet.outbound,\r\n inbound: getPersonSet.inbound\r\n }\r\n \r\n if (toTT === 'OUTBOUND'){\r\n const personList = personData.inbound.filter(per => personKeys.includes(per._id));\r\n personData.inbound = personData.inbound.filter(per => !personKeys.includes(per._id));\r\n personData.outbound = [...personData.outbound, ...personList];\r\n }\r\n else\r\n {\r\n const personList = personData.outbound.filter(per => personKeys.includes(per._id));\r\n personData.outbound = personData.outbound.filter(per => !personKeys.includes(per._id));\r\n personData.inbound = [...personData.inbound, ...personList];\r\n }\r\n \r\n props.client.writeQuery({\r\n query: GetPersonSetQuery,\r\n variables: {\r\n setId\r\n },\r\n data: {\r\n getPersonSet: {\r\n ...getPersonSet,\r\n inbound: personData.inbound,\r\n outbound: personData.outbound\r\n }\r\n }\r\n })\r\n if (isScheduling){\r\n const personsToAdd = personData[toTT.toLowerCase()].filter(per => personKeys.includes(per._id)).map(initScheduledPerson(transitType));\r\n setPTS({\r\n [transitType]: personsToSchedule[transitType].filter(per => !personKeys.includes(per._id)),\r\n [toTT]: [ ...personsToSchedule[toTT], ...personsToAdd ]\r\n })\r\n }\r\n setSTRK(defaultTableRowKeys)\r\n setTT(toTT);\r\n }\r\n\r\n const reorderPersons = (dragIndex, hoverIndex) => {\r\n const { getPersonSet } = props.client.readQuery({\r\n query: GetPersonSetQuery,\r\n variables: {\r\n setId\r\n }\r\n })\r\n \r\n const listKey = transitType === 'OUTBOUND' ? 'outbound' : 'inbound';\r\n \r\n const data = getPersonSet[listKey] || [];\r\n \r\n const dragRow = data[dragIndex];\r\n const newData = update(data, {\r\n $splice: [[dragIndex, 1], [hoverIndex, 0, dragRow]]\r\n });\r\n \r\n const newPersonSet = {\r\n ...getPersonSet,\r\n [listKey]: newData\r\n }\r\n \r\n props.client.writeQuery({\r\n query: GetPersonSetQuery,\r\n variables: {\r\n setId\r\n },\r\n data: {\r\n getPersonSet: newPersonSet\r\n }\r\n })\r\n initPersonsToSchedule()\r\n }\r\n\r\n const updateAttributes = ({ name, departure, destination, lastKnownController }) => {\r\n const { getPersonSet } = props.client.readQuery({\r\n query: GetPersonSetQuery,\r\n variables: {\r\n setId\r\n }\r\n })\r\n props.client.writeQuery({\r\n query: GetPersonSetQuery,\r\n variables: {\r\n setId\r\n },\r\n data: {\r\n getPersonSet: {\r\n ...getPersonSet,\r\n name,\r\n departureID: {\r\n __typename: 'Location',\r\n ...departure,\r\n _id: departure._id,\r\n name: departure.name\r\n },\r\n lastKnownController: {\r\n __typename: 'Location',\r\n ...departure,\r\n _id: lastKnownController._id,\r\n name: lastKnownController.name\r\n },\r\n destinationID: {\r\n __typename: 'Location',\r\n ...destination,\r\n _id: destination._id,\r\n name: destination.name\r\n }\r\n }\r\n }\r\n })\r\n }\r\n \r\n const handleFormChange = (formFields) => {\r\n const name = safeGet(['name', 'value'], formFields)\r\n const lkc = {\r\n _id: safeGet(['lastKnownController', 'value', 'key'], formFields),\r\n name: safeGet(['lastKnownController', 'value', 'label'], formFields)\r\n }\r\n const departure = {\r\n _id: safeGet(['departure', 'value', 'key'], formFields),\r\n name: safeGet(['departure', 'value', 'label'], formFields)\r\n }\r\n const destination = {\r\n _id: safeGet(['destination', 'value', 'key'], formFields),\r\n name: safeGet(['destination', 'value', 'label'], formFields)\r\n }\r\n updateAttributes({name, departure, destination, lastKnownController: lkc});\r\n }\r\n\r\n const handleScheduledUpdate = (updatedItemList, TT = transitType, type) => {\r\n if(type === \"PAX\"){\r\n setPTS({\r\n ...personsToSchedule,\r\n [TT]: updatedItemList\r\n })\r\n }else {\r\n setCTS({\r\n ...cargoToSchedule,\r\n [TT]: updatedItemList\r\n })\r\n }\r\n }\r\n\r\n const handlePersonsToScheduleChange = (persons, TT = transitType) => {\r\n setPTS({\r\n ...personsToSchedule,\r\n [TT]: persons\r\n })\r\n }\r\n\r\n const handlePersonsToScheduleMove = (persons, destTT) => {\r\n setPTS({\r\n [transitType]: personsToSchedule[transitType].filter(item => !persons.map(i => i._id).includes(item._id)),\r\n [destTT]: persons\r\n })\r\n setTT(destTT);\r\n }\r\n\r\n const handleCargoToScheduleChange = (cargo) => {\r\n setCTS({\r\n ...cargoToSchedule,\r\n INBOUND: cargo\r\n })\r\n }\r\n\r\n return (\r\n \r\n {(cachedData) => {\r\n const setData = { ...props, data: isEditing ? cachedData.data : props.data};\r\n return (\r\n \r\n {(saveSet, saveProps) => {\r\n return (\r\n \r\n {(scheduleSet, scheduleProps) => {\r\n return (\r\n \r\n {(deleteSet, deleteProps) => {\r\n const getPersonId = (per) => per._id\r\n const handleSave = () => {\r\n const inbound = setData.data.getPersonSet.inbound.map(getPersonId);\r\n const outbound = setData.data.getPersonSet.outbound.map(getPersonId);\r\n saveSet({\r\n variables: {\r\n payload: {\r\n _id: origSetId,\r\n name: setData.data.getPersonSet.name.trim(),\r\n tpID: orgData.transporter && orgData.transporter._id,\r\n customerID: orgData.customer && orgData.customer._id,\r\n outbound: outbound,\r\n inbound: inbound,\r\n owner: !isNew ? setData.data.getPersonSet.owner : cognitoUser.attributes.email,\r\n departureID: safeGet(['data', 'getPersonSet', 'departureID', '_id'], setData),\r\n destinationID: safeGet(['data', 'getPersonSet', 'destinationID', '_id'], setData)\r\n }\r\n }\r\n })\r\n }\r\n const handleSchedule = (scheduleData) => {\r\n const dateString = moment(scheduleData.date).format('YYYY-MM-DD');\r\n const toPersonScheduleInput = (tt) => (per, i) => {\r\n return {\r\n personID: per._id,\r\n paxWeight: per.paxWeight || 0,\r\n bagWeight: per.bagWeight || 0,\r\n bagCount: per.bagCount || 0,\r\n chargeCode: (per.chargeCode && per.chargeCode.toUpperCase()) || (defaultChargeCode && defaultChargeCode.toUpperCase()),\r\n scheduledOrder: i,\r\n transitType: tt\r\n }\r\n }\r\n const outbound = personsToSchedule.OUTBOUND.map(toPersonScheduleInput('OUTBOUND'));\r\n const inbound = personsToSchedule.INBOUND.map(toPersonScheduleInput('INBOUND'));\r\n const persons = [...outbound, ...inbound];\r\n const { customer, transporter } = orgData;\r\n const cargo = cargoToSchedule[\"INBOUND\"].map(item => {\r\n return {\r\n ...item,\r\n receivedLocationID: safeGet(['data', 'getPersonSet', 'departureID', '_id'], setData)\r\n }\r\n })\r\n checkScheduledPax(persons, () => {\r\n scheduleSet({\r\n variables: {\r\n scheduledFlightDate: dateString,\r\n scheduledGroup: scheduleData.name,\r\n lastKnownController: scheduleData.lastKnownController,\r\n departureID: scheduleData.departureID,\r\n destinationID: scheduleData.destinationID,\r\n persons: persons,\r\n inboundCargo: cargo,\r\n customerID: customer && customer._id,\r\n tpID: transporter && transporter._id\r\n }\r\n })\r\n .then(() => {\r\n if (!onScheduled) return;\r\n console.log('onScheduled', scheduleData.lastKnownController);\r\n onScheduled({\r\n date: dateString,\r\n group: scheduleData.name,\r\n lastKnownController: scheduleData.lastKnownController,\r\n departureID: scheduleData.departureID,\r\n destinationID: scheduleData.destinationID\r\n })\r\n })\r\n })\r\n }\r\n const handleDelete = () => {\r\n deleteSet({\r\n variables: {\r\n _id: setData.data.getPersonSet._id,\r\n tpID: orgData.transporter && orgData.transporter._id\r\n }\r\n })\r\n }\r\n return (\r\n addPersons()}\r\n onPersonsRemove={() => removePersons()}\r\n onPersonsMove={() => movePersons()}\r\n onPersonsReorder={(dragIndex, hoverIndex) => reorderPersons(dragIndex, hoverIndex)}\r\n onFormChange={handleFormChange}\r\n onSave={handleSave}\r\n saving={saveProps.loading || scheduleProps.loading}\r\n saveError={saveProps.error || scheduleProps.error}\r\n onScheduleChange={onScheduleChange}\r\n addPersonsLoading={addPersonsLoading}\r\n selectedPersonKeys={selectedPersonKeys}\r\n selectedTableRowKeys={selectedTableRowKeys}\r\n onSelectedPersonKeysChange={setSPK}\r\n onSelectedTableRowKeysChange={setSTRK}\r\n transitType={transitType}\r\n onTransitTypeChange={setTT}\r\n onSchedule={handleSchedule}\r\n personsToSchedule={personsToSchedule}\r\n cargoToSchedule={cargoToSchedule}\r\n onPersonsToScheduleChange={handlePersonsToScheduleChange}\r\n onScheduledUpdate={handleScheduledUpdate}\r\n onPersonsToScheduleMove={handlePersonsToScheduleMove}\r\n onCargoToScheduleChange={handleCargoToScheduleChange}\r\n defaultChargeCode={defaultChargeCode}\r\n onDefaultChargeCodeChange={setDefaultCC}\r\n onDelete={handleDelete}\r\n deleting={deleteProps.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 \r\n )\r\n}\r\n\r\nexport default compose(\r\n WithOrgData,\r\n withCognitoUser\r\n)(SetsEditorContainer)","import React, { useState, useEffect } from 'react';\r\nimport { withApollo } from 'react-apollo';\r\nimport ISNCheck from '../Mutations/ISNCheck';\r\nimport WithOrgData from './WithOrgData';\r\n\r\nexport const useBulkISNChecker = (client, orgID, onCompleted=null) => {\r\n const [ status, setStatus ] = useState(null);\r\n const [ paxArray, setPaxArray ] = useState(null);\r\n const [ checking, setChecking ] = useState(false);\r\n const [ returnedIsnStatus, setReturnedIsnStatus ] = useState(null);\r\n let running = false;\r\n if (status){\r\n const itemLoading = status.find(({ loading }) => loading === true);\r\n running = itemLoading ? true : false;\r\n }\r\n\r\n const runISNCheck = (paxId) => new Promise((resolve, reject) => {\r\n client.mutate({\r\n mutation: ISNCheck,\r\n variables: {\r\n _id: paxId,\r\n tpID: orgID\r\n }\r\n })\r\n .then(({ data: { setPassengerIsnCheck } }) => {\r\n console.log(`ISN Check for ${setPassengerIsnCheck.lastName}, ${setPassengerIsnCheck.firstName} (${paxId}) is complete!`);\r\n resolve({ id: paxId, data: setPassengerIsnCheck.lastIsnResultWithHeader});\r\n })\r\n .catch((err) => {\r\n console.warn(`ISN Check for pax ID ${paxId} has failed! Check error log below.`);\r\n console.error(err);\r\n reject({ id: paxId, error: err});\r\n })\r\n })\r\n\r\n const setStatusComplete = (paxId, data) => {\r\n return setStatus(status.map((item) => {\r\n if (item.id === paxId){\r\n return {\r\n id: item.id,\r\n loading: false,\r\n data: data\r\n }\r\n }\r\n return item\r\n }))\r\n }\r\n\r\n const setStatusError = (personID, error) => {\r\n return setStatus(status.map((item) => {\r\n if (item.id === personID){\r\n return {\r\n id: item.id,\r\n loading: false,\r\n error: error\r\n }\r\n }\r\n return item;\r\n }))\r\n }\r\n\r\n const initStatus = (paxIds) => {\r\n setStatus(paxIds.map((id) => {\r\n return {\r\n id: id,\r\n loading: true\r\n }\r\n }))\r\n }\r\n\r\n useEffect(() => {\r\n if (checking){\r\n const promises = paxArray.map((paxId) => {\r\n runISNCheck(paxId)\r\n .then(setReturnedIsnStatus)\r\n .catch(setReturnedIsnStatus);\r\n });\r\n\r\n Promise.all(promises)\r\n .then(() => onCompleted?.());\r\n }\r\n // eslint-disable-next-line\r\n }, [ checking ])\r\n\r\n useEffect(() => {\r\n if (!running){\r\n setChecking(false);\r\n }\r\n }, [ running ])\r\n\r\n useEffect(() => {\r\n if (returnedIsnStatus){\r\n const { id, data, error } = returnedIsnStatus;\r\n if (error){\r\n setStatusError(id, error);\r\n }\r\n if (data){\r\n setStatusComplete(id, data);\r\n }\r\n }\r\n // eslint-disable-next-line\r\n }, [ returnedIsnStatus ])\r\n\r\n const runChecks = async (paxIds) => {\r\n initStatus(paxIds);\r\n setPaxArray(paxIds);\r\n setChecking(true);\r\n }\r\n\r\n const getCheckStatus = (paxId) => {\r\n return status && status.find(({ id }) => id === paxId)\r\n }\r\n\r\n return {\r\n runChecks,\r\n status,\r\n running: running,\r\n checkStatus: getCheckStatus,\r\n checkLoading: (paxId) => {\r\n const s = getCheckStatus(paxId);\r\n return s && s.loading\r\n },\r\n checkError: (paxId) => {\r\n const s = getCheckStatus(paxId);\r\n return s && s.error\r\n },\r\n checkData: (paxId) => {\r\n const s = getCheckStatus(paxId);\r\n return s && s.data\r\n }\r\n }\r\n}\r\n\r\nexport const withBulkISNChecker = Component => withApollo( WithOrgData( ({ client, orgData, ...rest }) => {\r\n const isnCheckerProps = useBulkISNChecker(client, orgData.getActiveOrgID());\r\n return \r\n}))\r\n\r\nconst BulkISNChecker = ({ children, client, orgData }) => {\r\n const { runChecks, ...restProps } = useBulkISNChecker(client, orgData.getActiveOrgID());\r\n\r\n return children(runChecks, restProps );\r\n}\r\n\r\nexport default withApollo( WithOrgData( BulkISNChecker) )","import React from 'react';\r\nimport { Query, QueryResult, QueryComponentOptions } from 'react-apollo';\r\nimport gql from 'graphql-tag';\r\n\r\n\r\nexport interface ResolveEntityIDResult extends QueryResult {\r\n data: any | any[]\r\n}\r\n\r\nexport interface ResolveEntityIDProps {\r\n db?: string,\r\n typename: string,\r\n gqlFields: string,\r\n ids: string[] | string,\r\n children(result: ResolveEntityIDResult): JSX.Element,\r\n queryProps?: QueryComponentOptions\r\n}\r\n\r\nconst ResolveEntityID: React.FC = (props) => {\r\n let isArray = Array.isArray(props.ids);\r\n return console.error('Failed to resolve entitities: ', error)}\r\n >\r\n {(result: QueryResult) => {\r\n let data: any | any[];\r\n if (result.data && result.data.resolve_entity_ids){\r\n if(isArray){\r\n data = result.data.resolve_entity_ids;\r\n }\r\n else if (Array.isArray(result.data.resolve_entity_ids))\r\n {\r\n data = result.data.resolve_entity_ids[0];\r\n }\r\n }\r\n return props.children({\r\n ...result,\r\n data\r\n })\r\n }}\r\n \r\n}\r\n\r\nexport default ResolveEntityID","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nmutation CreatePersonSet(\r\n $payload: PersonSetInput!\r\n){\r\n setPersonSet(\r\n payload: $payload\r\n ){\r\n _id\r\n }\r\n}\r\n`","import React from 'react';\r\nimport { Form, Input, Spin, Button } from 'antd';\r\nimport { LocationSelect } from '../../form/select/LocationSelect';\r\nimport { formItemLayout, tailFormItemLayout } from '../../../common/form';\r\nimport gql from 'graphql-tag';\r\nimport { Query } from 'react-apollo';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\n\r\nconst { Item } = Form;\r\n\r\nconst GET_LOCATIONS = gql`\r\nquery GetLocations($departureID: ID!, $getDeparture: Boolean, $destinationID: ID!, $getDestination: Boolean){\r\n departure: getLocation(_id: $departureID) @include(if: $getDeparture){\r\n _id\r\n name\r\n }\r\n destination: getLocation(_id: $destinationID) @include(if: $getDestination){\r\n _id\r\n name\r\n }\r\n}\r\n`\r\n\r\nexport interface SetFormProps extends FormComponentProps {\r\n defaultName?: string,\r\n defaultDepartureID?: string,\r\n defaultDestinationID?: string,\r\n loading?: boolean,\r\n onSubmit?(values: any): void\r\n}\r\n\r\nconst SetForm = ({ form, defaultName, defaultDepartureID, defaultDestinationID, loading: propLoading, onSubmit }) => {\r\n const { getFieldDecorator, validateFieldsAndScroll } = form;\r\n const submit = () => {\r\n validateFieldsAndScroll((err, values) => {\r\n if (!err && onSubmit) {\r\n onSubmit(values)\r\n }\r\n })\r\n }\r\n return (\r\n
    \r\n \r\n {getFieldDecorator('name', {\r\n initialValue: defaultName,\r\n rules: [\r\n {required: true, message: 'Name is required'}\r\n ]\r\n })()}\r\n \r\n \r\n {({ data, loading }) => {\r\n return (\r\n \r\n \r\n {getFieldDecorator('departure', {\r\n initialValue: {\r\n key: data && data.departure && data.departure._id,\r\n label: data && data.departure && data.departure.name\r\n },\r\n rules: [\r\n {required: true, message: 'Heliport is required'}\r\n ]\r\n })()\r\n }\r\n \r\n \r\n {getFieldDecorator('destination', {\r\n initialValue: {\r\n key: data && data.destination && data.destination._id,\r\n label: data && data.destination && data.destination.name\r\n },\r\n rules: [\r\n {required: true, message: 'Off Shore Location is required'}\r\n ]\r\n })()\r\n }\r\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 Form.create()(SetForm)","import React from 'react';\r\nimport { withUserGroups, WithUserGroupsProps } from 'components/userGroup';\r\nimport { Tooltip, Button, Drawer, Alert } from 'antd';\r\nimport useControlledState from 'hooks/useControlledState';\r\nimport { DrawerProps } from 'antd/lib/drawer';\r\nimport { Mutation } from 'react-apollo';\r\nimport CreatePersonSetQuery from './mutation/CreatePersonSet';\r\nimport { SetForm } from '../SetForm';\r\nimport withCognitoUser, { WithCognitoUserProps } from 'components/WithCognitoUser';\r\nimport WithOrgData, { WithOrgDataProps } from 'components/WithOrgData';\r\nimport { GroupData } from '.';\r\n\r\nexport interface CreatePersonSetProps extends Partial, Partial, Partial {\r\n drawerVisible?: boolean,\r\n onDrawerChange?(visible: boolean): void,\r\n drawerProps?: DrawerProps,\r\n buttonDisabled?: boolean,\r\n groupData: GroupData,\r\n paxData: any[],\r\n onNewSetClicked?(setID: string): void\r\n}\r\n\r\nconst CreatePersonSet: React.FC = (props) => {\r\n const [ drawerVisible, setDrawerVisible ] = useControlledState(false, props.drawerVisible, props.onDrawerChange);\r\n\r\n if (!props.userGroups.includes('flytsuite.schedule.sets')){\r\n return \r\n \r\n \r\n }\r\n return <>\r\n setDrawerVisible(true)}\r\n >Create Set\r\n setDrawerVisible(false)}\r\n >\r\n \r\n {(createPersonSet, { loading, error, data }: any) => {\r\n const { orgData: { customer, transporter }, cognitoUser } = props;\r\n const alreadyExists = (error && error.message.includes('conflict')) || false;\r\n var errMessage = error && error.message;\r\n if (alreadyExists){\r\n errMessage = \"This set already exists\"\r\n }\r\n return (\r\n \r\n {error ? (\r\n \r\n ) : null}\r\n {!error && !loading && data && props.onNewSetClicked ? (\r\n Click to view the new set!\r\n )}\r\n />\r\n ) : null}\r\n {\r\n const payload = {\r\n customerID: customer && customer._id,\r\n tpID: transporter && transporter._id,\r\n name: values.name.trim(),\r\n departureID: values.departure.key,\r\n destinationID: values.destination.key,\r\n outbound: props.paxData.filter(pax => pax.transitType === 'OUTBOUND').map(pax => pax.personID && pax.personID._id),\r\n inbound: props.paxData.filter(pax => pax.transitType === 'INBOUND').map(pax => pax.personID && pax.personID._id),\r\n owner: cognitoUser.attributes.email\r\n }\r\n createPersonSet({\r\n variables: {\r\n payload\r\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 withUserGroups(\r\n WithOrgData(\r\n withCognitoUser(CreatePersonSet)\r\n )\r\n)","import React, { CSSProperties } from 'react';\r\nimport { Form, DatePicker, Input } from 'antd';\r\nimport { FormComponentProps, FormProps } from 'antd/lib/form';\r\nimport { LocationSelect } from 'components/form/select/LocationSelect';\r\nimport { createFormFields } from 'common/form';\r\nimport moment from 'moment';\r\n\r\nexport interface IGroupFormProps extends FormComponentProps {\r\n formElementProps?: FormProps,\r\n disabled?: boolean,\r\n formData?: any,\r\n onFieldsChange?(fields: any): void,\r\n onValuesChange?(values: any): void\r\n}\r\n\r\nlet selectStyle: CSSProperties = {\r\n minWidth: '10rem'\r\n}\r\n\r\nconst GroupForm: React.FC = React.forwardRef((props, ref: React.LegacyRef
    ) => {\r\n const { getFieldDecorator } = props.form;\r\n let formElement = \r\n \r\n {getFieldDecorator('date', {\r\n rules: [\r\n { required: true, message: 'You must enter a flight date' }\r\n ]\r\n })( current && current < moment().startOf('day')} />)}\r\n \r\n \r\n {getFieldDecorator('name', {\r\n rules: [\r\n { required: true, message: 'You must enter a group name' }\r\n ]\r\n })( {\r\n e.target.value = e.target.value.trimStart().replace(/[^\\S ]/gm, '')}} disabled={props.disabled} />)}\r\n \r\n \r\n {getFieldDecorator('lastKnownController', {\r\n rules: [\r\n { required: true, message: 'You must enter a controlling heliport' }\r\n ]\r\n })()}\r\n \r\n \r\n {getFieldDecorator('departure', {\r\n rules: [\r\n { required: true, message: 'You must enter a departure location' }\r\n ]\r\n })()}\r\n \r\n \r\n {getFieldDecorator('destination', {\r\n rules: [\r\n { required: true, message: 'You must enter an off shore location' }\r\n ]\r\n })()}\r\n \r\n
    \r\n return formElement\r\n})\r\n\r\nexport default Form.create({\r\n mapPropsToFields(props){\r\n if (!props.formData) return undefined\r\n return createFormFields(props.formData);\r\n },\r\n onFieldsChange(props, _, fields){\r\n if (props.onFieldsChange){\r\n props.onFieldsChange(fields);\r\n }\r\n },\r\n onValuesChange(props, _, values){\r\n if (props.onValuesChange){\r\n props.onValuesChange(values);\r\n }\r\n }\r\n})(GroupForm)","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery GetCustomerManifestPrintout($id: ID!){\r\n getCustomer(_id: $id){\r\n _id\r\n name\r\n manifestPrintout {\r\n type\r\n layouts {\r\n name\r\n logo\r\n }\r\n }\r\n }\r\n}\r\n`","import React from 'react';\r\nimport { Form, Input } from 'antd';\r\nimport { formItemLayout } from '../../../common/form';\r\nimport AircraftSelect from '../../form/AircraftSelect';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\n\r\nexport interface PrintoutFormProps extends FormComponentProps {\r\n onChange(changedFields: any): void,\r\n flightName: any,\r\n aircraft: any\r\n}\r\n\r\nconst PrintoutForm = ({ form }) => {\r\n const { getFieldDecorator } = form;\r\n return (\r\n
    \r\n \r\n {getFieldDecorator('flightName', {\r\n rules: [\r\n {required: true, message: 'Flight Name is required'}\r\n ]\r\n })()}\r\n \r\n \r\n {getFieldDecorator('aircraft', {\r\n rules: [\r\n {required: true, message: 'Aircraft is required'}\r\n ]\r\n })()}\r\n \r\n
    \r\n )\r\n}\r\n\r\nexport default Form.create({\r\n onFieldsChange(props, changedFields) {\r\n props.onChange && props.onChange(changedFields)\r\n },\r\n mapPropsToFields(props) {\r\n const flightName = props.flightName || {};\r\n const aircraft = props.aircraft || {};\r\n return {\r\n flightName: Form.createFormField({\r\n ...flightName,\r\n value: flightName.value\r\n }),\r\n aircraft: Form.createFormField({\r\n ...aircraft,\r\n value: aircraft.value\r\n })\r\n }\r\n }\r\n})(PrintoutForm)","import React, { useRef, useState } from 'react';\r\nimport GetCustomerManifestPrintout from './query/GetCustomerManifestPrintout';\r\nimport { Query } from 'react-apollo';\r\nimport { safeGet } from 'common/util';\r\nimport { Button, Modal, Alert } from 'antd';\r\nimport PrintoutForm from '../Printout/PrintoutForm';\r\nimport useManifestPrintout from '../Printout/useManifestPrintout';\r\nimport WithOrgData, { WithOrgDataProps } from 'components/WithOrgData';\r\nimport withCognitoUser, { WithCognitoUserProps } from 'components/WithCognitoUser';\r\nimport { GroupData } from '.';\r\nimport { ButtonProps } from 'antd/lib/button';\r\n\r\nexport interface ManifestPrintoutProps extends WithOrgDataProps, WithCognitoUserProps {\r\n customerID: string,\r\n paxData: any[],\r\n cgoData: any[],\r\n departureName: string,\r\n destinationName: string,\r\n groupData: GroupData,\r\n buttonProps?: ButtonProps\r\n}\r\n\r\nconst ManifestPrintout: React.FC = (props) => {\r\n const printoutForm = useRef(null);\r\n\r\n const [ fetchPrintout, printoutLoading, printoutError, clearPrintoutError ] = useManifestPrintout('BasicFlight', 'Hess');\r\n\r\n const [ printoutFormFields, setPrintoutFormFields ] = useState({\r\n flightName: null,\r\n aircraft: null\r\n });\r\n\r\n const [ modalVisible, setModalVisible ] = useState();\r\n\r\n return \r\n {({ data, loading, error }: any) => {\r\n const manifestPrintouts = safeGet(['getCustomer', 'manifestPrintout'], data) || [];\r\n const flightManifest = manifestPrintouts.find((m) => m.type === 'Flight'); \r\n const hessLayout = flightManifest && flightManifest.layouts.find((l) => l.name === 'Hess');\r\n const logoURL = hessLayout && hessLayout.logo;\r\n if (props.buttonProps && props.buttonProps.disabled){\r\n var buttonDisabled = props.buttonProps && props.buttonProps.disabled;\r\n }\r\n else\r\n {\r\n buttonDisabled = (!Array.isArray(props.paxData)) || (loading && error && !data && !data.getCustomer)\r\n }\r\n return (\r\n \r\n setModalVisible(true)}\r\n >Download Printout\r\n {\r\n setModalVisible(false);\r\n // setPrintoutFormFields(null);\r\n clearPrintoutError();\r\n }}\r\n // cancelButtonDisabled={printoutLoading}\r\n cancelButtonProps={{\r\n disabled: printoutLoading\r\n }}\r\n onOk={() => {\r\n printoutForm.current.validateFieldsAndScroll((err: any, values: { flightName: any; aircraft: { label: any; }; }) => {\r\n const { customer } = props.orgData;\r\n const { attributes: userAttr={} } = props.cognitoUser;\r\n const payload = {\r\n orgName: customer.name,\r\n logoURL: logoURL,\r\n desig: values.flightName,\r\n issuedBy: `${userAttr.given_name} ${userAttr.family_name}`,\r\n departure: props.departureName,\r\n destination: props.destinationName,\r\n aircraftNo: values.aircraft.label,\r\n scheduledFlightDate: props.groupData.date,\r\n paxList: props.paxData.map((pax) => {\r\n return {\r\n _id: pax._id,\r\n lastName: pax.lastName,\r\n firstName: pax.firstName,\r\n employer: pax.employerID && pax.employerID.name,\r\n chargeCode: pax.chargeCode && pax.chargeCode.toUpperCase(),\r\n paxWeight: pax.paxWeight,\r\n bagWeight: pax.bagWeight,\r\n transitType: pax.transitType,\r\n departure: pax.departureID && pax.departureID.name,\r\n destination: pax.destinationID && pax.destinationID.name,\r\n dob: pax.personID && pax.personID.dob,\r\n nation: pax.personID && pax.personID.nation,\r\n credentials: pax.personID && pax.personID.credentials\r\n }\r\n }),\r\n cgoList: props.cgoData.map((cgo) => {\r\n return {\r\n _id: cgo._id,\r\n name: cgo.name,\r\n weight: cgo.weight,\r\n departure: cgo.departureID && cgo.departureID.name,\r\n destination: cgo.destinationID && cgo.destinationID.name,\r\n attentionTo: cgo.attentionTo,\r\n deliveredBy: cgo.deliveredBy,\r\n transitType: cgo.transitType\r\n }\r\n })\r\n }\r\n if (!err){\r\n fetchPrintout(payload, true, `${customer && customer.name} Flight Manifest.xlsx`)\r\n .then(() => {\r\n setModalVisible(false);\r\n // setPrintoutFormFields(null);\r\n })\r\n }\r\n })\r\n }}\r\n okText=\"Download\"\r\n confirmLoading={printoutLoading}\r\n >\r\n {printoutError ? (\r\n clearPrintoutError()}\r\n />\r\n ) : null}\r\n setPrintoutFormFields({ ...printoutFormFields, ...changedFields })}\r\n />\r\n \r\n \r\n )\r\n }}\r\n \r\n}\r\n\r\nexport default WithOrgData(\r\n withCognitoUser(\r\n ManifestPrintout\r\n )\r\n)","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nmutation SchedulePaxInbCgo(\r\n $customerID: ID!\r\n $orgID: ID!\r\n $departureID: ID!\r\n $destinationID: ID!\r\n $lastKnownController: ID!\r\n $scheduledFlightDate: AWSDate!\r\n $scheduledGroup: String!\r\n $passengers: [ScheduledPassengerInput!]!\r\n $inboundCargo: [ScheduledInboundCargoInput!]!\r\n $deletedEntities: [DeletedScheduledEntityInput!]\r\n){\r\n schedulePaxInbCgo(\r\n customerID: $customerID\r\n orgID: $orgID\r\n departureID: $departureID\r\n destinationID: $destinationID\r\n lastKnownController: $lastKnownController\r\n scheduledFlightDate: $scheduledFlightDate\r\n scheduledGroup: $scheduledGroup\r\n passengers: $passengers\r\n inboundCargo: $inboundCargo\r\n deletedEntities: $deletedEntities\r\n ){\r\n cgonodes {\r\n _id\r\n _rev\r\n name\r\n classType\r\n transitType\r\n scheduledOrder\r\n weight\r\n hazmat\r\n hazmatUnCode\r\n lastKnownController {\r\n _id\r\n name\r\n }\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n attentionTo\r\n initials\r\n notes\r\n customerID {\r\n _id\r\n name\r\n }\r\n tpID {\r\n _id\r\n name\r\n }\r\n }\r\n paxnodes {\r\n _id\r\n _rev\r\n lastName\r\n firstName\r\n transitType\r\n scheduledOrder\r\n classType\r\n paxWeight\r\n bagWeight\r\n bagCount\r\n chargeCode\r\n lastKnownController {\r\n _id\r\n name\r\n }\r\n personID {\r\n _id\r\n dob\r\n extraBroadState\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n tpID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n authorization {\r\n onWhiteList\r\n brdRestriction_Isn {\r\n status\r\n type\r\n notes\r\n reason\r\n }\r\n }\r\n isnCheckError {\r\n message\r\n }\r\n lastIsnResultWithHeader {\r\n isn_customer\r\n isn_ownerid\r\n success\r\n error_message\r\n quick_check_status\r\n reason\r\n qc_count\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n }\r\n }\r\n }\r\n}\r\n`","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery GetScheduledPaxInbCgo(\r\n $tpID: ID!\r\n $customerID: ID!\r\n $scheduledFlightDate: AWSDate!\r\n $scheduledGroup: String!\r\n $departureID: ID!\r\n $destinationID: ID!\r\n $lastKnownController: ID!\r\n){\r\n getTransporter(\r\n _id: $tpID\r\n ){\r\n _id\r\n name\r\n }\r\n getCustomer(\r\n _id: $customerID\r\n ){\r\n _id\r\n name\r\n }\r\n getDeparture: getLocation(\r\n _id: $departureID\r\n ){\r\n _id\r\n name\r\n }\r\n getDestination: getLocation(\r\n _id: $destinationID\r\n ){\r\n _id\r\n name\r\n }\r\n getLastKnownController: getLocation(\r\n _id: $lastKnownController\r\n ){\r\n _id\r\n name\r\n }\r\n getScheduledPaxInbCgo(\r\n tpID: $tpID\r\n customerID: $customerID\r\n scheduledFlightDate: $scheduledFlightDate\r\n scheduledGroup: $scheduledGroup\r\n departureID: $departureID\r\n destinationID: $destinationID\r\n ){\r\n cgonodes {\r\n _id\r\n _rev\r\n name\r\n classType\r\n transitType\r\n scheduledOrder\r\n weight\r\n hazmat\r\n hazmatUnCode\r\n departureID {\r\n _id\r\n name\r\n }\r\n lastKnownController {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n attentionTo\r\n initials\r\n notes\r\n customerID {\r\n _id\r\n name\r\n }\r\n tpID {\r\n _id\r\n name\r\n }\r\n currentCarrierID {\r\n _id\r\n desig\r\n }\r\n }\r\n paxnodes {\r\n _id\r\n _rev\r\n lastName\r\n firstName\r\n transitType\r\n scheduledOrder\r\n classType\r\n paxWeight\r\n bagWeight\r\n bagCount\r\n chargeCode\r\n personID {\r\n _id\r\n dob\r\n nation\r\n extraBroadState\r\n credentials {\r\n _id\r\n key\r\n type\r\n expiration\r\n }\r\n contactInfo {\r\n phone {\r\n number\r\n type\r\n }\r\n }\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n tpID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n lastKnownController {\r\n _id\r\n name\r\n }\r\n authorization {\r\n onWhiteList\r\n brdRestriction_Isn {\r\n status\r\n type\r\n notes\r\n reason\r\n }\r\n }\r\n isnCheckError {\r\n message\r\n }\r\n currentCarrierID {\r\n _id\r\n desig\r\n }\r\n lastIsnResultWithHeader {\r\n isn_customer\r\n isn_ownerid\r\n success\r\n error_message\r\n quick_check_status\r\n reason\r\n qc_count\r\n qc_result {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n isnId\r\n lastName\r\n firstName\r\n companyID\r\n companyName\r\n trainingStatus\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n quickCheckStatus\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n reason\r\n }\r\n }\r\n }\r\n }\r\n}\r\n`","import uuidv4 from 'uuid/v4';\r\n\r\nfunction personToPassenger(\r\n person: any,\r\n paxData: {\r\n scheduledOrder?: number,\r\n transitType?: 'OUTBOUND' | 'INBOUND' | 'TRANSFER',\r\n customerID?: any,\r\n tpID?: any,\r\n departureID?: any,\r\n destinationID?: any,\r\n paxWeight?: number,\r\n bagWeight?: number,\r\n bagCount?: number,\r\n chargeCode?: string\r\n }\r\n ){\r\n const {\r\n scheduledOrder=null,\r\n transitType,\r\n customerID,\r\n tpID,\r\n departureID,\r\n destinationID,\r\n paxWeight,\r\n bagCount,\r\n bagWeight,\r\n chargeCode\r\n } = paxData;\r\n const pax = {\r\n ...person,\r\n\r\n // ID is temporary and should not saved in database\r\n _id: `PAX-${uuidv4()}`,\r\n\r\n personID: person,\r\n classType: 'flytsuite.paxnode',\r\n scheduledOrder,\r\n transitType,\r\n customerID,\r\n tpID,\r\n departureID,\r\n destinationID,\r\n paxWeight: paxWeight || person.lastPaxWeight || 0,\r\n bagWeight: bagWeight || person.lastBagWeight || 0,\r\n bagCount: bagCount || person.lastBagCount || 0,\r\n chargeCode\r\n }\r\n if ('_rev' in person){\r\n delete pax['_rev'];\r\n }\r\n return pax\r\n}\r\n\r\nexport default personToPassenger","import { createFormField, getFormFieldValue, getLabelInValue, getLabelInValueKey } from 'common/form';\r\nimport { personToPassenger } from 'common/person';\r\nimport { getMaxScheduledOrder } from 'common/util';\r\nimport useControlledState from 'hooks/useControlledState';\r\nimport { isEqual, uniqBy } from 'lodash';\r\nimport moment from 'moment';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { GroupData } from '.';\r\n\r\nexport interface QueryData {\r\n loading: boolean,\r\n entities: any[],\r\n departure: any,\r\n lastKnownController: any,\r\n destination: any,\r\n customer: any,\r\n transporter: any,\r\n error?: any\r\n}\r\n\r\nexport interface UseSchedulerParams {\r\n groupData?: GroupData,\r\n queryData?: QueryData,\r\n editing?: boolean,\r\n onEditingChange?(editing: boolean): void,\r\n onRefetch?(): void\r\n}\r\n\r\nexport type AddPersonnelType = (persons: any[], transitType: 'OUTBOUND' | 'INBOUND') => void\r\n\r\nexport interface UseSchedulerStateReturnProps {\r\n editing: boolean,\r\n setEditing(editing: boolean): void,\r\n saving: boolean,\r\n saveError: Error,\r\n data: any[],\r\n setData(newData: any): void,\r\n initialData: any[],\r\n groupFormData: any,\r\n setGroupFormData(fields: any): void,\r\n resetGroupFormData(): void,\r\n groupData: GroupData,\r\n addPersonnel: AddPersonnelType,\r\n removeEntities(ids: string[]): void,\r\n movePassengers(ids: string[], transitType: 'INBOUND' | 'OUTBOUND'): void,\r\n defaultChargeCode: string,\r\n setDefaultChargeCode(value: string): void,\r\n clearChargeCodes(): void,\r\n deletedData: any[],\r\n refetch(): void\r\n}\r\n\r\nexport function useSchedulerState(params: UseSchedulerParams): UseSchedulerStateReturnProps {\r\n const [ editing, setEditing ] = useControlledState(params.editing || false, params.editing, params.onEditingChange);\r\n const [ data, setData ] = useState([]);\r\n const [ deletedData, setDeletedData ] = useState([]);\r\n const [ groupFormData, setGroupFormData ] = useState(null);\r\n\r\n const [ saving ] = useState(false);\r\n const [ saveError ] = useState(null);\r\n const [ defaultChargeCode, setDefaultChargeCode ] = useState(null);\r\n\r\n // function isGroupFormDataTouched(){\r\n // function compareGDProperty(property: string){\r\n // let formValue = groupFormData && groupFormData[property];\r\n // if (formValue){\r\n // formValue = formValue.value;\r\n // }\r\n // return (params.groupData && params.groupData[property] === formValue) || groupFormData === null || groupFormData === undefined\r\n // }\r\n // return compareGDProperty('tpID') &&\r\n // compareGDProperty('customerID') &&\r\n // compareGDProperty('date') &&\r\n // compareGDProperty('name') &&\r\n // compareGDProperty('departureID') &&\r\n // compareGDProperty('destinationID')\r\n // }\r\n\r\n const { queryData, groupData } = params;\r\n\r\n function resetGroupFormData(){\r\n setGroupFormData({\r\n date: createFormField(groupData && groupData.date && moment(groupData.date), true),\r\n name: createFormField(groupData && groupData.name, true),\r\n departure: createFormField(getLabelInValue(queryData && queryData.departure, 'name'), true),\r\n lastKnownController: createFormField(getLabelInValue(queryData && queryData.lastKnownController, 'name'), true),\r\n destination: createFormField(getLabelInValue(queryData && queryData.destination, 'name'), true)\r\n })\r\n }\r\n\r\n useEffect(() => {\r\n // While not edit mode this makes sure that the data state is equal to the query entities list.\r\n if (!editing && !isEqual(queryData.entities, data)){\r\n setData(queryData.entities);\r\n }\r\n // eslint-disable-next-line\r\n }, [ editing, queryData && queryData.entities ])\r\n\r\n useEffect(() => {\r\n if (queryData && !queryData.loading && queryData.entities){\r\n resetGroupFormData();\r\n setData(queryData.entities);\r\n }\r\n // eslint-disable-next-line\r\n }, [ queryData && queryData.loading ])\r\n\r\n useEffect(() => {\r\n if (!editing && queryData && queryData.entities){\r\n setData(queryData.entities);\r\n }\r\n // eslint-disable-next-line\r\n }, [ editing ])\r\n\r\n const addPersonnel: AddPersonnelType = (persons, transitType) => {\r\n const largestScheduledOrder = getMaxScheduledOrder(data.filter(item => item && item.classType === 'flytsuite.cgonode'))\r\n const pax = persons.map((p, i) => {\r\n let order = i;\r\n if (largestScheduledOrder !== null){\r\n order = (largestScheduledOrder + 1) + order;\r\n }\r\n return personToPassenger(\r\n p,\r\n {\r\n scheduledOrder: order,\r\n transitType,\r\n customerID: queryData && queryData.customer,\r\n tpID: queryData && queryData.transporter,\r\n departureID: queryData && queryData.departure,\r\n destinationID: queryData && queryData.destination,\r\n paxWeight: 0,\r\n bagWeight: 0,\r\n bagCount: 0,\r\n chargeCode: null\r\n }\r\n )\r\n });\r\n setData(\r\n uniqBy([\r\n ...data,\r\n ...pax\r\n ], (item: any) => item && item._id))\r\n }\r\n\r\n function deleteData(keys: string[]){\r\n let newData = data.filter((entity) => entity && !keys.includes(entity._id));\r\n setDeletedData(data.filter((entity => entity && keys.includes(entity._id))))\r\n setData(newData);\r\n return newData\r\n }\r\n\r\n function removeEntities(ids: string[]){\r\n return deleteData(ids);\r\n }\r\n\r\n function movePassengers(ids: string[], currentTransitType: 'INBOUND' | 'OUTBOUND'){\r\n let destTransitType = currentTransitType === 'OUTBOUND' ? 'INBOUND' : 'OUTBOUND';\r\n\r\n function changeTransitType(pax: any){\r\n return {\r\n ...pax,\r\n transitType: destTransitType\r\n }\r\n }\r\n\r\n let pax = data.filter((entity) => entity && ids.includes(entity._id));\r\n let newData = pax.map(changeTransitType)\r\n\r\n setData(uniqBy([\r\n ...newData,\r\n ...data\r\n ], (item: any) => item && item._id));\r\n }\r\n\r\n function clearChargeCodes(){\r\n setData(\r\n data.map((entity) => {\r\n if (entity.classType === 'flytsuite.paxnode'){\r\n return {\r\n ...entity,\r\n chargeCode: null\r\n }\r\n }\r\n return entity\r\n })\r\n )\r\n }\r\n\r\n function handleRefetch(){\r\n if (params.onRefetch){\r\n params.onRefetch();\r\n }\r\n }\r\n\r\n return {\r\n editing,\r\n setEditing,\r\n data,\r\n setData,\r\n initialData: queryData && queryData.entities,\r\n saving,\r\n saveError,\r\n groupData: groupFormData ? {\r\n date: moment(getFormFieldValue(groupFormData.date)).toISOString(),\r\n name: getFormFieldValue(groupFormData.name),\r\n departureID: getLabelInValueKey(getFormFieldValue(groupFormData.departure)),\r\n destinationID: getLabelInValueKey(getFormFieldValue(groupFormData.destination)),\r\n lastKnownController: getLabelInValueKey(getFormFieldValue(groupFormData.lastKnownController)),\r\n tpID: groupData && groupData.tpID,\r\n customerID: groupData && groupData.customerID\r\n }: groupData,\r\n groupFormData,\r\n setGroupFormData,\r\n // isGroupFormDataTouched,\r\n resetGroupFormData,\r\n addPersonnel,\r\n removeEntities,\r\n movePassengers,\r\n defaultChargeCode,\r\n setDefaultChargeCode,\r\n clearChargeCodes,\r\n deletedData,\r\n refetch: handleRefetch\r\n }\r\n}\r\n\r\nexport interface WithSchedulerProps {\r\n schedulerProps: UseSchedulerStateReturnProps\r\n}\r\n\r\nexport type getParams

    = (props: P) => UseSchedulerParams\r\n\r\nexport interface SchedulerStateWrapperProps

    {\r\n component: React.ComponentType

    ,\r\n componentProps: P,\r\n getParams: getParams

    \r\n}\r\n\r\nexport function SchedulerStateWrapper

    (props: SchedulerStateWrapperProps

    ) {\r\n const schedulerProps = useSchedulerState(props.getParams(props.componentProps));\r\n const Comp = props.component;\r\n return \r\n}\r\n\r\nexport const withSchedulerState =

    >(getParams: ((props: P) => UseSchedulerParams)) => (Component: React.ComponentType

    ) => {\r\n return (props: P) => \r\n component={Component}\r\n getParams={getParams}\r\n componentProps={props}\r\n />\r\n}","import { Alert, Button, Col, Divider, Dropdown, Icon, Input, Layout, Menu, message, Modal, Radio, Row, Spin, Tabs, Tooltip } from 'antd';\r\nimport { AlertProps } from 'antd/lib/alert';\r\nimport { Route } from 'antd/lib/breadcrumb/Breadcrumb';\r\nimport { WatchQueryFetchPolicy } from 'apollo-boost';\r\nimport { FormField, getFormFieldsValues, LabelInValue } from 'common/form';\r\nimport { useBulkISNChecker } from 'components/BulkISNChecker';\r\nimport ResolveEntityID from 'components/ResolveEntityID';\r\nimport MainHeader, { MainHeaderProps } from 'components/scheduling/MainHeader';\r\nimport MainLayout from 'components/scheduling/MainLayout';\r\nimport CreatePersonSet from 'components/scheduling/PaxCgoScheduler/CreatePersonSet';\r\nimport PersonSearch, { initialSearchState, SearchState } from 'components/search/PersonSearch';\r\nimport PersonSearchByCred, { CredSearchState, initialSearchCredState } from 'components/search/PersonSearchByCred';\r\nimport SelectionCount from 'components/search/SelectionCount';\r\nimport { withUserGroups, WithUserGroupsProps } from 'components/userGroup';\r\nimport WithOrgData, { OrgDataProps, WithOrgDataProps } from 'components/WithOrgData';\r\nimport QueryResultContext from 'context/query-result-context';\r\nimport 'css/Tabs.css';\r\nimport { useMultiSelect } from 'hooks/useMultiSelect';\r\nimport { useMultiSelectByID } from 'hooks/useMultiSelectByID';\r\nimport compose from 'lodash.flowright';\r\nimport moment from 'moment';\r\nimport pluralize from 'pluralize';\r\nimport React, { useEffect, useRef, useState } from 'react';\r\nimport { graphql, Mutation, withApollo, WithApolloClient } from 'react-apollo';\r\nimport { ReflexContainer, ReflexElement, ReflexSplitter } from 'react-reflex';\r\nimport checkScheduledPax from '../checkScheduledPax';\r\nimport CargoSiderTab from './CargoSiderTab';\r\nimport GroupForm from './GroupForm';\r\nimport ManifestPrintout from './ManifestPrintout';\r\nimport SaveScheduledPaxInbCgo from './mutation/SaveScheduledPaxInbCgo';\r\nimport './PaxCgoScheduler.less';\r\nimport GetScheduledPaxInbCgo from './query/GetScheduledPaxInbCgo';\r\nimport QueryPersonnelIDs from './QueryPersonnelIDs';\r\nimport { AddPersonnelType, WithSchedulerProps, withSchedulerState } from './schedulerStateHook';\r\nimport PaxCgoSchedulerTable from './table';\r\nimport MCIcon from \"../../icon\";\r\nimport ButtonLink from \"../../ButtonLink\";\r\n\r\n\r\nconst { Content } = Layout;\r\n\r\nexport interface GroupData {\r\n tpID: string,\r\n customerID: string,\r\n date: string,\r\n name: string,\r\n departureID: string,\r\n destinationID: string,\r\n lastKnownController: string\r\n}\r\n\r\nexport interface GroupFields {\r\n tpID: FormField,\r\n customerID: FormField,\r\n date: FormField,\r\n name: FormField,\r\n departureID: FormField,\r\n destinationID: FormField,\r\n lastKnownController: FormField\r\n}\r\n\r\nexport interface OnSaveSuccessfulParams {\r\n variables: any,\r\n data: any[]\r\n}\r\n\r\nexport interface PaxCgoSchedulerProps extends WithUserGroupsProps, WithOrgDataProps, WithSchedulerProps {\r\n groupData?: GroupData,\r\n mainHeaderRoutes?: Route[],\r\n onEditingChange?(editing: boolean): void,\r\n data?: any,\r\n onSave?(data: {\r\n checkWhiteListed?: boolean,\r\n customerID: string,\r\n orgID: string,\r\n departureID: string,\r\n destinationID: string,\r\n lastKnownController: string,\r\n scheduledFlightDate: string,\r\n scheduledGroup: string,\r\n passengers: any[],\r\n inboundCargo: any[]\r\n }): void,\r\n onDeleteGroup?(data: {\r\n customerID: string,\r\n orgID: string,\r\n departureID: string,\r\n destinationID: string,\r\n lastKnownController: string,\r\n scheduledFlightDate: string,\r\n scheduledGroup: string,\r\n deletedEntities: any[]\r\n }): void,\r\n onDeleteGroupSuccessful?(): void,\r\n deletingGroup: boolean,\r\n deleteErrorMessage?: string,\r\n saving?: boolean\r\n saveErrorMessage?: string,\r\n saveSuccessAlertProps?: Pick,\r\n onSaveSuccessful?(data: OnSaveSuccessfulParams): void,\r\n onBackToList?(): void,\r\n onToScheduledFlights?(): void,\r\n editing?: boolean,\r\n paxEdit?: boolean,\r\n onCancel?(): void,\r\n onNewSetClicked?(setID: string): void,\r\n fetchPolicy?: WatchQueryFetchPolicy,\r\n pollInterval?: number,\r\n}\r\n\r\nexport interface SaveStatus {\r\n saving: boolean,\r\n error?: Error,\r\n data?: any\r\n}\r\n\r\nexport interface SchedulerState {\r\n saveStatus: SaveStatus,\r\n showSetsDrawer: boolean\r\n}\r\n\r\nexport const initalSaveStatus = {\r\n saving: false,\r\n error: null,\r\n data: null\r\n}\r\n\r\ntype TransitType = 'OUTBOUND' | 'INBOUND'\r\n\r\nexport interface IUIState {\r\n showSetsDrawer: boolean,\r\n showPersonAssign: boolean,\r\n transitType?: TransitType,\r\n siderTab: string\r\n}\r\n\r\nexport const initialUIState: IUIState = {\r\n showSetsDrawer: false,\r\n showPersonAssign: true,\r\n transitType: 'OUTBOUND',\r\n siderTab: 'personsearch'\r\n}\r\n\r\nexport interface IGroupDataState {\r\n tpID?: string,\r\n customerID?: string,\r\n date?: string,\r\n name?: string,\r\n departureID?: string,\r\n destinationID?: string,\r\n lastKnownController?: string\r\n}\r\n\r\nexport const initialGroupDataState: IGroupDataState = {\r\n tpID: null,\r\n customerID: null,\r\n date: null,\r\n name: null,\r\n departureID: null,\r\n destinationID: null,\r\n lastKnownController: null\r\n}\r\n\r\nexport interface MultiSelectClassType {\r\n _id: string,\r\n classType: string\r\n}\r\n\r\nexport function preparePassengerForSchedule(pax: any){\r\n return {\r\n _id: pax._id,\r\n _rev: pax._rev,\r\n personID: pax.personID._id,\r\n transitType: pax.transitType,\r\n paxWeight: pax.paxWeight,\r\n bagWeight: pax.bagWeight,\r\n bagCount: pax.bagCount,\r\n chargeCode: pax.chargeCode && pax.chargeCode.toUpperCase(),\r\n scheduledOrder: pax.scheduledOrder\r\n }\r\n}\r\n\r\nexport function prepareCargoForSchedule(cgo: any){\r\n return {\r\n _id: cgo._id,\r\n _rev: cgo._rev,\r\n name: cgo.name,\r\n weight: cgo.weight,\r\n hazmat: cgo.hazmat,\r\n hazmatUnCode: cgo.hazmatUnCode,\r\n attentionTo: cgo.attentionTo,\r\n notes: cgo.notes,\r\n receivedLocationID: cgo.receivedLocationID,\r\n scheduledOrder: cgo.scheduledOrder,\r\n initials: cgo.initials\r\n }\r\n}\r\n\r\nexport function createSaveMutationVars(orgData: OrgDataProps, groupFieldsValues: {\r\n lastKnownController: string,\r\n departureID: string,\r\n destinationID: string,\r\n group: string,\r\n date: any\r\n}, data: any[], deletedData?: any[], defaultChargeCode?: string){\r\n function applyDefChgCode(obj: any){\r\n return {\r\n ...obj,\r\n chargeCode: (obj.chargeCode && obj.chargeCode.toUpperCase()) || (defaultChargeCode && defaultChargeCode.toUpperCase())\r\n }\r\n }\r\n return {\r\n customerID: orgData.getOrgIDByType('customer'),\r\n orgID: orgData.getActiveOrgID(),\r\n departureID: groupFieldsValues.departureID,\r\n destinationID: groupFieldsValues.destinationID,\r\n lastKnownController: groupFieldsValues.lastKnownController,\r\n scheduledGroup: groupFieldsValues.group,\r\n scheduledFlightDate: moment(groupFieldsValues.date).format('YYYY-MM-DD'),\r\n passengers: data.filter(item => item.classType === 'flytsuite.paxnode').map(applyDefChgCode).map(preparePassengerForSchedule),\r\n inboundCargo: data.filter(item => item.classType === 'flytsuite.cgonode')\r\n .map((cgo) => ({...cgo, receivedLocationID: groupFieldsValues.departureID }))\r\n .map(prepareCargoForSchedule),\r\n deletedEntities: deletedData && deletedData.filter(item => item._rev ? true : false).map(item => ({ _id: item._id, _rev: item._rev, classType: item.classType }))\r\n }\r\n}\r\n \r\nconst PaxCgoScheduler: React.FC> = (props) => {\r\n const [ searchState ] = useState(initialSearchState);\r\n const [ searchStateCred ] = useState(initialSearchCredState);\r\n const multiSelect = useMultiSelect({ primaryKey: '_id' });\r\n const personSearchMultiSelect = useMultiSelectByID();\r\n let [ UIState, S_setUIState ] = useState(initialUIState);\r\n const [ cargoEditState, setCargoEditState ] = useState();\r\n const bulkISNChecker = useBulkISNChecker(props.client, props.orgData.getActiveOrgID())\r\n const groupFormRef = useRef(null);\r\n const [ hideSaveErrorMessage, setHideSaveErrorMessage ] = useState(false);\r\n const [ hideSaveSuccessAlert, setHideSaveSuccessAlert ] = useState(false);\r\n const paxEdit = props.paxEdit\r\n\r\n const {\r\n data, \r\n setData, \r\n groupFormData, \r\n setGroupFormData, \r\n resetGroupFormData,\r\n // isGroupFormDataTouched,\r\n groupData, \r\n addPersonnel, \r\n removeEntities, \r\n movePassengers,\r\n defaultChargeCode,\r\n setDefaultChargeCode,\r\n clearChargeCodes,\r\n deletedData,\r\n editing,\r\n setEditing\r\n } = props.schedulerProps;\r\n\r\n useEffect(() => {\r\n if (!props.saveErrorMessage || props.saving){\r\n setHideSaveErrorMessage(true);\r\n }\r\n else\r\n {\r\n setHideSaveErrorMessage(false);\r\n }\r\n }, [ props.saveErrorMessage, props.saving ])\r\n useEffect(() => {\r\n setHideSaveSuccessAlert(!props.saveSuccessAlertProps || props.saving || editing ? true : false);\r\n // eslint-disable-next-line\r\n }, [\r\n // eslint-disable-next-line\r\n props.saveSuccessAlertProps && props.saveSuccessAlertProps.message,\r\n // eslint-disable-next-line\r\n props.saveSuccessAlertProps && props.saveSuccessAlertProps.description,\r\n props.saving,\r\n editing\r\n ])\r\n\r\n let loading = props.data && props.data.loading;\r\n let queryError = props.data && props.data.error;\r\n\r\n function setUIState(changes: Partial): void {\r\n S_setUIState({\r\n ...UIState,\r\n ...changes\r\n })\r\n }\r\n\r\n let outboundPaxData: any[] = data.filter((row) => row && row.classType === 'flytsuite.paxnode' && row.transitType === 'OUTBOUND')\r\n\r\n const handleAddPersonnel: AddPersonnelType = (persons, transitType) => {\r\n addPersonnel(persons, transitType);\r\n personSearchMultiSelect.clearAll();\r\n }\r\n\r\n function handleMovePassengers(){\r\n movePassengers(\r\n multiSelect.selectedItems\r\n .map((item) => data.find((entity) => entity && entity.classType === 'flytsuite.paxnode' && entity._id === item._id))\r\n .filter((pax: any) => pax && pax.transitType === UIState.transitType)\r\n .map((pax) => pax._id),\r\n UIState.transitType\r\n )\r\n multiSelect.clearAll();\r\n setUIState({ transitType: UIState.transitType === 'OUTBOUND' ? 'INBOUND' : 'OUTBOUND' })\r\n }\r\n\r\n function runIsnCheck () {\r\n if (editing){\r\n message.error('Cannot run ISN check in edit mode');\r\n return;\r\n }\r\n bulkISNChecker.runChecks(outboundPaxData.map((pax) => pax._id));\r\n }\r\n\r\n function getTransitTypeCount(entities: any[], type: TransitType): number {\r\n function reducer(count: number, v: any){\r\n if (v && v.transitType === type){\r\n return count + 1\r\n }\r\n else\r\n {\r\n return count\r\n }\r\n }\r\n return entities.reduce(reducer, 0)\r\n }\r\n\r\n function getTransitTypeWeightCount(entities: any[], type: TransitType): number {\r\n function reducer(weight: number, v: any){\r\n if (v && v.transitType === type){\r\n return weight + v.paxWeight + v.bagWeight\r\n }\r\n else\r\n {\r\n return weight\r\n }\r\n }\r\n return entities.reduce(reducer, 0)\r\n }\r\n\r\n const paxData = data\r\n .filter(entity => entity.classType === 'flytsuite.paxnode')\r\n .map((pax) => {\r\n if (pax.transitType === 'INBOUND'){\r\n return pax;\r\n }\r\n let err = bulkISNChecker.checkError(pax._id);\r\n if (pax.isnCheckError && !err){\r\n err = pax.isnCheckError;\r\n }\r\n return {\r\n ...pax,\r\n isnCheckRunning: bulkISNChecker.checkLoading(pax._id),\r\n isnCheckError: err\r\n }\r\n })\r\n \r\n const viewablePaxData = paxData.filter((row) => {\r\n return row && UIState.transitType === row.transitType && row.classType === 'flytsuite.paxnode'\r\n })\r\n\r\n const cgoData = data.filter((row) => {\r\n return row && row.classType === 'flytsuite.cgonode'\r\n })\r\n\r\n function handleCancel(){\r\n if (typeof props.onCancel === 'function'){\r\n props.onCancel();\r\n }\r\n }\r\n\r\n function saveAndCheckPaxValues(){\r\n let passengers: any[] = data.filter((item) => item.classType === 'flytsuite.paxnode');\r\n checkScheduledPax(passengers, () => {\r\n groupFormRef.current.props.form.validateFieldsAndScroll((err, values) => {\r\n if (!err){\r\n let saveData = createSaveMutationVars(\r\n props.orgData,\r\n {\r\n date: values.date,\r\n lastKnownController: values.lastKnownController.key,\r\n departureID: values.departure.key,\r\n destinationID: values.destination.key,\r\n group: values.name\r\n },\r\n data,\r\n deletedData,\r\n defaultChargeCode\r\n );\r\n console.log('save data', saveData);\r\n props.onSave(saveData)\r\n }\r\n })\r\n });\r\n }\r\n\r\n function renderMainHeader(){\r\n let mainHeaderProps: MainHeaderProps = {\r\n routes: props.mainHeaderRoutes,\r\n actions: (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n }\r\n if (!editing){\r\n\r\n let deleteScheduleDisabled = false;\r\n\r\n let paxOnFlight = data.filter(pax => pax.currentCarrierID);\r\n\r\n if (bulkISNChecker.running || paxOnFlight.length)\r\n deleteScheduleDisabled = true;\r\n\r\n let deleteScheduleBtn = (\r\n {\r\n Modal.confirm({\r\n title: 'Are you sure?',\r\n content: `Are you sure you want to delete ${data.length} passengers/cargo?`,\r\n onOk() {\r\n props.onDeleteGroup(createSaveMutationVars(\r\n props.orgData,\r\n {\r\n date: props.groupData.date,\r\n lastKnownController: props.groupData.lastKnownController,\r\n departureID: props.groupData.departureID,\r\n destinationID: props.groupData.destinationID,\r\n group: props.groupData.name\r\n },\r\n [],\r\n data\r\n ))\r\n }\r\n })\r\n }}\r\n >\r\n Delete Schedule\r\n \r\n );\r\n let deleteScheduleBtnWrapped = deleteScheduleBtn;\r\n\r\n if (paxOnFlight.length){\r\n deleteScheduleBtnWrapped = (\r\n \r\n

    {paxOnFlight.length} PAX/CGO are on a flight. They need to be removed from their flight before you can do this.

    \r\n Click on the{' '}{' '}icon to go to their assigned flight.\r\n \r\n }>\r\n {deleteScheduleBtn}\r\n
    \r\n )\r\n }\r\n\r\n if (!props.userGroups.includes('flytsuite.schedule.passenger')){\r\n deleteScheduleBtnWrapped = (\r\n \r\n {deleteScheduleBtn}\r\n \r\n )\r\n }\r\n\r\n mainHeaderProps.actions = (\r\n \r\n \r\n \r\n \r\n \r\n {deleteScheduleBtnWrapped}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {({ data, loading, error }: any) => {\r\n return \r\n \r\n \r\n }}\r\n \r\n \r\n \r\n {props.userGroups.includes('flytsuite.schedule.passenger') ? (\r\n runIsnCheck()}>Run ISN Check\r\n ) : (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n {props.userGroups.includes('flytsuite.schedule.passenger') ? (\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 function renderLayoutContent(){\r\n if (loading){\r\n return
    \r\n } />\r\n
    \r\n }\r\n if (queryError){\r\n return \r\n }\r\n\r\n let collapserIcon = 'menu-fold';\r\n let collapserTooltipText = 'Hide personnel search';\r\n if (!UIState.showPersonAssign) {\r\n collapserIcon = 'menu-unfold';\r\n collapserTooltipText = 'Show personnel search';\r\n }\r\n\r\n function renderContent(){\r\n return \r\n {editing && props.saveErrorMessage && !hideSaveErrorMessage ? (\r\n setHideSaveErrorMessage(true)}\r\n />\r\n ) : null}\r\n {props.saveSuccessAlertProps && !hideSaveSuccessAlert ? (\r\n \r\n {props.saveSuccessAlertProps.description ? (\r\n

    {props.saveSuccessAlertProps.description}

    \r\n ) : null}\r\n
    \r\n {\r\n if (props.onBackToList) {\r\n props.onBackToList();\r\n }\r\n }}\r\n >\r\n Done\r\n \r\n {\r\n runIsnCheck();\r\n setHideSaveSuccessAlert(true);\r\n }}\r\n type=\"link\"\r\n >\r\n Run ISN Check\r\n \r\n\r\n
    \r\n \r\n }\r\n closable\r\n onClose={() => setHideSaveSuccessAlert(true)}\r\n />\r\n ) : null}\r\n {editing ? (\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Default Charge Code: \r\n setDefaultChargeCode(e.target.value.split(\" \").join(\"\"))}\r\n value={defaultChargeCode}\r\n />\r\n \r\n
    \r\n {multiSelect.selectedItems.length ? (\r\n <>\r\n \r\n \r\n \r\n \r\n ) : null}\r\n \r\n ) : null}\r\n \r\n \r\n setGroupFormData(fields)}\r\n />\r\n \r\n {groupFormRef.current && groupFormRef.current.props.form.isFieldsTouched() ? (\r\n \r\n \r\n \r\n \r\n }}\r\n \r\n ) : null}\r\n paxPanelHeader={\r\n <>\r\n Passengers\r\n {\r\n setUIState({ transitType: e.target.value })}\r\n }>\r\n {`Outbound (${getTransitTypeCount(paxData, 'OUTBOUND')}). Weight: ${getTransitTypeWeightCount(paxData, 'OUTBOUND')}`}\r\n {`Inbound (${getTransitTypeCount(paxData, 'INBOUND')}). Weight: ${getTransitTypeWeightCount(paxData, 'INBOUND')}`}\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 setUIState({ siderTab: key })}\r\n style={{\r\n height: '100%'\r\n }}\r\n >\r\n \r\n \r\n \r\n personSearchMultiSelect.setSelectedItems(rows)}\r\n filterResults={(rows) => rows.filter((person) => paxData.findIndex((row) => row.personID === person._id) === -1)}\r\n />\r\n \r\n \r\n personSearchMultiSelect.setSelectedItems(rows)}\r\n />\r\n \r\n \r\n \r\n \r\n setCargoEditState(undefined)}\r\n clearOnSubmit\r\n onSubmit={(values) => {\r\n let obj = {\r\n ...values,\r\n classType: 'flytsuite.cgonode'\r\n }\r\n let newData = [ ...data ];\r\n let eIdx = data.findIndex((row) => row && row._id === obj._id);\r\n if (eIdx !== -1){\r\n newData[eIdx] = obj;\r\n }\r\n else\r\n {\r\n newData.push(obj);\r\n }\r\n setData(newData);\r\n setCargoEditState(undefined);\r\n }}\r\n />\r\n \r\n \r\n \r\n {editing && UIState.showPersonAssign ? : null}\r\n \r\n {renderContent()}\r\n \r\n \r\n \r\n }\r\n // let newScheduleEditorMessage = null;\r\n //\r\n // if (!props.groupData){\r\n // newScheduleEditorMessage = (\r\n // \r\n // Try the new V2 scheduling tool.\r\n // Try it\r\n // \r\n // }\r\n // banner\r\n // />\r\n // )\r\n // }\r\n\r\n return \r\n \r\n {renderMainHeader()}\r\n {/*{newScheduleEditorMessage}*/}\r\n {renderLayoutContent()}\r\n \r\n \r\n}\r\n\r\nfunction getQueryVars(groupData: any){\r\n return groupData ? {\r\n tpID: groupData.tpID,\r\n customerID: groupData.customerID,\r\n scheduledFlightDate:groupData.date,\r\n scheduledGroup: groupData.name,\r\n departureID: groupData.departureID,\r\n destinationID: groupData.destinationID,\r\n lastKnownController: groupData.lastKnownController\r\n } : null\r\n}\r\n\r\nconst withSave = (Scheduler: React.ComponentType) => (props: PaxCgoSchedulerProps) => {\r\n return {\r\n let formFieldValues = getFormFieldsValues(props.schedulerProps.groupFormData);\r\n if (props.onSaveSuccessful){\r\n props.onSaveSuccessful({\r\n data: data.schedulePaxInbCgo,\r\n variables: createSaveMutationVars(\r\n props.orgData,\r\n {\r\n date: formFieldValues.date,\r\n departureID: formFieldValues.departure.key,\r\n destinationID: formFieldValues.destination.key,\r\n lastKnownController: formFieldValues.lastKnownController.key,\r\n group: formFieldValues.name\r\n },\r\n props.schedulerProps.data,\r\n props.schedulerProps.deletedData,\r\n props.schedulerProps.defaultChargeCode\r\n )\r\n })\r\n }\r\n }}\r\n >\r\n {(schedulePaxInbCgo: (arg0: { variables: { checkWhiteListed?: boolean; customerID: string; orgID: string; departureID: string; destinationID: string; lastKnownController: string; scheduledFlightDate: string; scheduledGroup: string; passengers: any[]; inboundCargo: any[]; }; }) => void, { data, loading, error }: any) => {\r\n let paxCount = 0;\r\n let cgoCount = 0;\r\n if (!loading && !error && data){\r\n paxCount = data.schedulePaxInbCgo.paxnodes.length;\r\n cgoCount = data.schedulePaxInbCgo.cgonodes.length;\r\n }\r\n let saveSuccessMsg: String;\r\n if (paxCount > 0 || cgoCount > 0){\r\n saveSuccessMsg = 'Successfully saved'\r\n }\r\n if (paxCount > 0){\r\n saveSuccessMsg +=` ${paxCount} ${pluralize('passenger', paxCount)}`\r\n }\r\n if (paxCount > 0 && cgoCount > 0){\r\n saveSuccessMsg += ` and`\r\n }\r\n if (cgoCount > 0){\r\n saveSuccessMsg += ` ${cgoCount} cargo`\r\n }\r\n return {\r\n console.log('onSave called!', data);\r\n return schedulePaxInbCgo({\r\n variables: data\r\n });\r\n }}\r\n />\r\n }}\r\n \r\n}\r\n\r\nconst withDelete = (Scheduler: React.ComponentType) => (props: PaxCgoSchedulerProps) => {\r\n return {\r\n if (props.onDeleteGroupSuccessful){\r\n props.onDeleteGroupSuccessful();\r\n }\r\n }}\r\n >\r\n {(deleteGroup: (arg0: { variables: { customerID: string; orgID: string; departureID: string; destinationID: string; lastKnownController: string; scheduledFlightDate: string; scheduledGroup: string; deletedEntities: any[]; }; }) => void, { loading, error }: any) => {\r\n return {\r\n deleteGroup({\r\n variables: data\r\n })\r\n }}\r\n />\r\n }}\r\n \r\n}\r\n\r\nexport default compose(\r\n withApollo,\r\n withUserGroups,\r\n WithOrgData,\r\n graphql(\r\n GetScheduledPaxInbCgo,\r\n {\r\n options: props => {\r\n return {\r\n variables: getQueryVars(props.groupData),\r\n fetchPolicy: props.fetchPolicy || 'network-only',\r\n pollInterval: !props.editing ? props.pollInterval || 20000 : undefined\r\n }\r\n },\r\n skip: props => !props.groupData\r\n }\r\n ),\r\n withSchedulerState(props => ({\r\n groupData: {\r\n name: props.groupData && props.groupData.name,\r\n date: props.groupData && props.groupData.date,\r\n departureID: props.groupData && props.groupData.departureID,\r\n lastKnownController: props.groupData && props.groupData.lastKnownController,\r\n destinationID: props.groupData && props.groupData.destinationID,\r\n customerID: props.groupData ? props.groupData.customerID : props.orgData.getOrgIDByType('customer'),\r\n tpID: props.groupData ? props.groupData.tpID : props.orgData.getOrgIDByType('transporter')\r\n },\r\n queryData: props.data && {\r\n loading: props.data.loading,\r\n entities: props.data.getScheduledPaxInbCgo ? [...props.data.getScheduledPaxInbCgo.paxnodes, ...props.data.getScheduledPaxInbCgo.cgonodes] : [],\r\n departure: props.data.getDeparture,\r\n destination: props.data.getDestination,\r\n lastKnownController: props.data.getLastKnownController,\r\n customer: props.data.getCustomer,\r\n transporter: props.data.getTransporter\r\n },\r\n editing: props.editing,\r\n onEditingChange: props.onEditingChange,\r\n onRefetch: () => props.data.refetch()\r\n })),\r\n withSave,\r\n withDelete\r\n)(PaxCgoScheduler)","import { Calendar, Select } from 'antd';\r\nimport 'css/Calendar.less';\r\nimport 'css/Drawer.css';\r\nimport moment, { Moment } from 'moment';\r\nimport React from 'react';\r\nimport { zerofixed } from '../util';\r\nimport './ScheduleCalendar.css';\r\n\r\n\r\n// Renders a list of select options of the current month and all months ahead.\r\n// Does not list months before the current month.\r\nexport function getMonthOptions(date: Moment){\r\n let monthOptions = [];\r\n\r\n for (let index = -12; index <= 12; index++) {\r\n let offset = date.clone().add(index, 'months');\r\n if (offset.isBefore(moment(), 'month')){\r\n continue\r\n }\r\n let text = offset.format('MMMM - YY');\r\n monthOptions.push(\r\n \r\n {text}\r\n ,\r\n );\r\n }\r\n\r\n return monthOptions;\r\n}\r\n\r\nexport interface SchedulingCalendarProps {\r\n value?: moment.Moment,\r\n data?: Array,\r\n renderDateCell?(data: Array): { title: React.ReactElement | React.ReactText, content: React.ReactElement },\r\n onCellClick?(date: moment.Moment, data: Array): void,\r\n getDataDate(dataItem: DataType): moment.Moment | string\r\n}\r\n\r\nconst SchedulingCalendar: (props: SchedulingCalendarProps) => React.ReactElement> = (props) => {\r\n \r\n function getData(date: moment.Moment){\r\n return props.data.filter((dataItem) => {\r\n if (dataItem && date.isSame(props.getDataDate(dataItem), 'day')){\r\n return true\r\n }\r\n return false\r\n })\r\n }\r\n\r\n return <>\r\n {\r\n return null\r\n }}\r\n value={props.value}\r\n dateFullCellRender={(date: moment.Moment) => {\r\n let dateData = getData(date);\r\n let cellData: { title: React.ReactElement | React.ReactText, content: React.ReactElement };\r\n if (props.renderDateCell && dateData.length)\r\n cellData = props.renderDateCell(dateData);\r\n \r\n return {\r\n if (dateData.length && props.onCellClick){\r\n props.onCellClick(date, dateData)\r\n }\r\n }}\r\n >\r\n
    \r\n {(cellData && cellData.title) ?
    {cellData.title}
    : null}\r\n
    {zerofixed(date.date())}
    \r\n
    \r\n
    \r\n {cellData && cellData.content}\r\n
    \r\n \r\n }}\r\n />\r\n \r\n}\r\n\r\nexport default SchedulingCalendar","import React from 'react';\r\nimport { Input, Button, Select } from 'antd';\r\nimport { getMonthOptions } from '.';\r\nimport moment from 'moment';\r\nimport useControlledState from 'hooks/useControlledState';\r\n\r\nexport interface MonthSelectProps {\r\n value?: any,\r\n onChange?(value: moment.Moment): void,\r\n style?: React.CSSProperties\r\n}\r\n\r\nconst MonthSelect: React.FC = (props) => {\r\n const [ value, setValue ] = useControlledState(moment(), props.value, props.onChange);\r\n\r\n return \r\n {\r\n let offset = value.clone().subtract(1, 'month');\r\n if (offset.isSameOrAfter(moment(), 'month')){\r\n setValue(offset)\r\n }\r\n }}\r\n disabled={value.clone().subtract(1, 'month').isBefore(moment(), 'month')}\r\n />\r\n {\r\n // const newValue = value.clone();\r\n // newValue.month(parseInt(selectedMonth, 10) - 1);\r\n let newValue = moment(selectedMonth, 'YYYY-MM');\r\n setValue(value.clone().month(newValue.month()).year(newValue.year()));\r\n }}\r\n showAction={[\"focus\", \"click\"]}\r\n >\r\n {getMonthOptions(value)}\r\n \r\n \r\n \r\n \r\n })}\r\n \r\n }\r\n }}\r\n />\r\n setExpandedDay(null)}\r\n visible={expandedDay ? true : false}\r\n width=\"1000px\"\r\n >\r\n {expandedDay && expandedDay.data.length ? (\r\n props.onGroupClicked && props.onGroupClicked(transformGroup(group))}\r\n />\r\n ) : null}\r\n \r\n \r\n}\r\n\r\nexport default ScheduledGroupsCalendar","import gql from \"graphql-tag\";\r\nimport {LocationFragment} from \"Queries/Location\";\r\nimport {\r\n ScheduledCgoNodeFragment,\r\n ScheduledPaxCgoGroupV2Fragment,\r\n ScheduledPaxNodeFragment\r\n} from \"Queries/Scheduling\";\r\n\r\nexport const Queries = {\r\n GetScheduledPaxCgoGroups: gql`\r\n query GetScheduledPaxCgoGroups(\r\n $tpID: ID!\r\n $customerID: ID!\r\n $startDate: AWSDate!\r\n $endDate: AWSDate!\r\n ){\r\n getScheduledPaxInbCgoGroups(\r\n tpID: $tpID\r\n customerID: $customerID\r\n startDate: $startDate\r\n endDate: $endDate\r\n ){\r\n scheduledFlightDate\r\n scheduledGroup\r\n departureID {\r\n ...LocationFragment\r\n }\r\n destinationID {\r\n ...LocationFragment\r\n }\r\n lastKnownController {\r\n ...LocationFragment\r\n }\r\n paxOutbound\r\n paxTransfer\r\n paxInbound\r\n cgoOutbound\r\n cgoTransfer\r\n cgoInbound\r\n paxOutboundOnFlight\r\n paxTransferOnFlight\r\n paxInboundOnFlight\r\n cgoOutboundOnFlight\r\n cgoTransferOnFlight\r\n cgoInboundOnFlight\r\n }\r\n GetScheduledPaxCgoGroupsV2(\r\n tpID: $tpID\r\n customerID: $customerID\r\n startDate: $startDate\r\n endDate: $endDate\r\n ){\r\n ...ScheduledPaxCgoGroupV2Fragment\r\n }\r\n }\r\n ${LocationFragment}\r\n ${ScheduledPaxCgoGroupV2Fragment}\r\n `\r\n}","import React from 'react';\r\nimport {Icon, List, Table} from 'antd';\r\nimport moment from 'moment';\r\nimport {groupBy} from 'lodash';\r\nimport {castArray} from 'common/util';\r\nimport {ScheduledPacCgoGroupVersioned} from \"./types\";\r\nimport './style.less';\r\nimport useBreakpoints from \"../../../../hooks/useBreakpoints\";\r\nimport {ColumnProps} from \"antd/lib/table\";\r\n\r\nexport interface ScheduledGroupsListProps {\r\n onGroupClicked?: (group: ScheduledPacCgoGroupVersioned, index: number) => void,\r\n data?: ScheduledPacCgoGroupVersioned[],\r\n\r\n /**\r\n * Shows the \"X on flight\" next to pax/cgo counts\r\n * @default true\r\n */\r\n showOnFlight?: boolean\r\n}\r\n\r\nconst BASE_CLS = 'mc-scheduled-groups-list';\r\n\r\nfunction getFlightStatusClassName(paxCount: number, paxOnFlightCount: number){\r\n const base = BASE_CLS + \"-pill\";\r\n if (paxOnFlightCount <= 0){\r\n return `${base} ${base + '-no-pax'}`;\r\n }\r\n if (paxCount <= paxOnFlightCount){\r\n return `${base} ${base + '-all-pax'}`;\r\n }\r\n return `${base} ${base + '-some-pax'}`;\r\n}\r\n\r\nconst ScheduledGroupsList: React.FC = (props) => {\r\n\r\n const bp = useBreakpoints();\r\n\r\n let grouped = groupBy(castArray(props.data), 'scheduledFlightDate');\r\n let data: [ string, ScheduledPacCgoGroupVersioned[] ][] = Object.entries(grouped);\r\n\r\n const columns: ColumnProps[] = [\r\n {\r\n key: 'name',\r\n title: 'Schedule Name',\r\n dataIndex: 'scheduledGroup',\r\n width: bp.min(\"medium\") ? 230 : undefined,\r\n },\r\n {\r\n key: 'flightLegs',\r\n title: 'Legs',\r\n width: bp.min(\"medium\") ? 380 : undefined,\r\n render: (_, record) => {\r\n\r\n let legs = [];\r\n\r\n if (record.scheduledVersion === 'V2'){\r\n legs = record?.legs?.map(leg => (\r\n {\r\n departureName: leg.departureDoc?.name,\r\n destinationName: leg.destinationDoc?.name,\r\n scheduledOrder: leg.scheduledOrder\r\n })\r\n ) || [];\r\n }\r\n else\r\n {\r\n legs = [\r\n {\r\n departureName: record.departureID?.name,\r\n destinationName: record.destinationID?.name,\r\n scheduledOrder: 0\r\n }\r\n ]\r\n }\r\n\r\n legs.sort((a, b) => {\r\n console.log(a.scheduledOrder - b.scheduledOrder, a ,b)\r\n return a.scheduledOrder - b.scheduledOrder;\r\n })\r\n\r\n return legs?.map(leg => {\r\n return
    \r\n {leg.departureName} {leg.destinationName}\r\n
    \r\n }) || null\r\n }\r\n }\r\n ]\r\n\r\n if (bp.min('medium')){\r\n columns.push(...[\r\n {\r\n key: 'outbound',\r\n title: 'Outbound',\r\n render: (_, record) => {\r\n const pax = record.paxOutbound;\r\n const cgo = record.cgoOutbound;\r\n const sum = pax + cgo;\r\n const onFlight =\r\n record.paxOutboundOnFlight + record.cgoOutboundOnFlight;\r\n return \r\n {pax} pax | {cgo} cgo\r\n {props.showOnFlight ? (\r\n {`${onFlight} on flight`}\r\n ) : null}\r\n ;\r\n }\r\n },\r\n {\r\n key: 'transfer',\r\n title: 'Transfer',\r\n render: (_, record) => {\r\n const pax = record.paxTransfer;\r\n const cgo = record.cgoTransfer;\r\n const sum = pax + cgo;\r\n const onFlight =\r\n record.paxTransferOnFlight + record.cgoTransferOnFlight;\r\n return \r\n {pax} pax | {cgo} cgo\r\n {props.showOnFlight ? (\r\n {`${onFlight} on flight`}\r\n ): null}\r\n ;\r\n }\r\n },\r\n {\r\n key: 'inbound',\r\n title: 'Inbound',\r\n render: (_, record) => {\r\n const pax = record.paxInbound;\r\n const cgo = record.cgoInbound;\r\n const sum = pax + cgo;\r\n const onFlight =\r\n record.paxInboundOnFlight + record.cgoInboundOnFlight;\r\n return \r\n {pax} pax | {cgo} cgo\r\n {props.showOnFlight ? (\r\n {`${onFlight} on flight`}\r\n ) : null}\r\n ;\r\n }\r\n }\r\n ])\r\n }\r\n\r\n return {\r\n let itemData = item[1];\r\n return \r\n
    \r\n

    {item[0] && moment(item[0]).format('MMMM DD, YYYY (dddd)')}

    \r\n {\r\n if (!record) return undefined;\r\n let dep = record.departureID && record.departureID._id;\r\n let dest = record.destinationID && record.destinationID._id;\r\n let lkc = record.lastKnownController && record.lastKnownController._id;\r\n return `${record.scheduledFlightDate}${record.scheduledGroup}${dep}${dest}${lkc}`\r\n }}\r\n pagination={false}\r\n dataSource={itemData}\r\n onRow={() => {\r\n return {\r\n style: {\r\n cursor: props.onGroupClicked ? 'pointer' : 'default'\r\n }\r\n }\r\n }}\r\n onRowClick={(record, index) => {\r\n if (props.onGroupClicked){\r\n props.onGroupClicked(record, index);\r\n }\r\n }}\r\n size=\"small\"\r\n columns={columns}\r\n />\r\n
    \r\n
    \r\n }}\r\n />\r\n}\r\n\r\nScheduledGroupsList.defaultProps = {\r\n showOnFlight: true\r\n}\r\n\r\nexport default ScheduledGroupsList","import ScheduledGroupsList from \"./scheduled-groups-list\";\r\n\r\nexport type { ScheduledPacCgoGroupVersioned } from './types';\r\nexport default ScheduledGroupsList;","import { Alert, Button, Col, DatePicker, Divider, Icon, Input, Layout, Radio, Row, Spin } from 'antd';\r\nimport { castArray } from 'common/util';\r\nimport ButtonLink from 'components/ButtonLink';\r\nimport MainHeader from 'components/scheduling/MainHeader';\r\nimport MainLayout from 'components/scheduling/MainLayout';\r\nimport { UserGroup, withUserGroups } from 'components/userGroup';\r\nimport WithOrgData, { WithOrgDataProps } from 'components/WithOrgData';\r\nimport gql from 'graphql-tag';\r\nimport moment from 'moment';\r\nimport React, {useContext, useState} from 'react';\r\nimport { useApolloClient, useQuery } from 'react-apollo';\r\nimport MonthSelect from '../calendar/monthselect';\r\nimport { usePersistentDateRange } from '../util';\r\nimport ScheduledGroupsCalendar from './calendar';\r\nimport './style.less';\r\nimport {OrgDataContext} from \"../../../context/orgData\";\r\nimport {Queries} from \"./graphql\";\r\nimport GroupList, { ScheduledPacCgoGroupVersioned } from 'components/scheduling/scheduled-groups/list'\r\n\r\nconst { Content } = Layout;\r\n\r\nconst { RangePicker } = DatePicker;\r\n\r\nconst dividerStyle = {\r\n height: '3rem',\r\n margin: '0 1rem'\r\n}\r\n\r\nexport interface ScheduledGroupsListProps extends WithOrgDataProps {\r\n onGroupClicked?(group: { date: string, name: string, lkc: string, departureID: string, destinationID: string })\r\n}\r\n\r\nfunction formatDate(date: moment.Moment){\r\n return date.format('YYYY-MM-DD')\r\n}\r\n\r\nconst ScheduledGroupsList: React.FC = (props) => {\r\n\r\n const [ calValue, setCalValue ] = useState(moment());\r\n // const [ listDateRange, setListDateRange ] = useState<[moment.Moment, moment.Moment]>([ moment(), moment().add(1, 'month')]);\r\n const [ listSearch, setListSearch ] = useState('');\r\n const orgData = useContext(OrgDataContext);\r\n\r\n const client = useApolloClient();\r\n var { data: viewData } = useQuery(gql`\r\n query GetCalendarView {\r\n schedulingCalendarView @client\r\n }\r\n `)\r\n\r\n const [ dateRange, setDateRange ] = usePersistentDateRange();\r\n\r\n const view = (viewData && viewData.schedulingCalendarView) || '0'\r\n\r\n function setView(value: string){\r\n client.writeData({\r\n data: {\r\n schedulingCalendarView: value\r\n }\r\n })\r\n }\r\n\r\n if (view === '1'){\r\n var startDate = formatDate(calValue.clone().startOf('month'));\r\n var endDate = formatDate(calValue.clone().endOf('month'));\r\n }\r\n else\r\n {\r\n startDate = formatDate(dateRange[0]);\r\n endDate = formatDate(dateRange[1]);\r\n }\r\n\r\n const { loading, error, data: queryData } = useQuery(Queries.GetScheduledPaxCgoGroups, {\r\n fetchPolicy: 'network-only',\r\n pollInterval: 5000,\r\n variables: {\r\n tpID: props.orgData.getOrgIDByType('transporter'),\r\n customerID: props.orgData.getOrgIDByType('customer'),\r\n startDate,\r\n endDate\r\n }\r\n\r\n })\r\n\r\n let data: ScheduledPacCgoGroupVersioned[] = castArray(queryData?.getScheduledPaxInbCgoGroups)\r\n .map((entity) => ({...entity, scheduledVersion: \"V1\"}));\r\n data = data.concat(\r\n (queryData?.GetScheduledPaxCgoGroupsV2 || [])\r\n .map((entity) => ({...entity, scheduledVersion: \"V2\"}))\r\n );\r\n\r\n data.sort((a, b) => {\r\n return a.scheduledFlightDate > b.scheduledFlightDate ? 1 : -1;\r\n })\r\n\r\n if (view === '0' && listSearch.length > 0){\r\n data = data.filter((item) => item.scheduledGroup.toLowerCase().includes(listSearch.toLowerCase().trim()))\r\n }\r\n\r\n let content: React.ReactElement;\r\n\r\n let viewActions: React.ReactElement;\r\n\r\n switch (view) {\r\n case '0':\r\n viewActions = \r\n \r\n setDateRange(dates) }\r\n format=\"MMM DD, YY\"\r\n disabledDate={(current) => moment().isAfter(current, 'month')}\r\n />\r\n \r\n \r\n }\r\n value={listSearch}\r\n onChange={(e) => setListSearch(e.target.value)}\r\n allowClear\r\n />\r\n \r\n \r\n content =
    \r\n (\r\n props.onGroupClicked?.({\r\n date: group.scheduledFlightDate,\r\n name: group.scheduledGroup,\r\n lkc: group.lastKnownController?._id,\r\n departureID: group.departureID?._id,\r\n destinationID: group.destinationID?._id\r\n })\r\n )}\r\n />\r\n
    \r\n break;\r\n case '1':\r\n default:\r\n viewActions = \r\n \r\n \r\n \r\n \r\n setCalValue(value)}\r\n />\r\n \r\n \r\n content = props.onGroupClicked && props.onGroupClicked(group)}\r\n />\r\n break;\r\n }\r\n\r\n let newScheduleUrl = `/app/scheduling/passenger/quickschedule`;\r\n if (!orgData.organization?.useV1Scheduler){\r\n newScheduleUrl = `/app/scheduling/schedule/new`;\r\n }\r\n\r\n return \r\n \r\n \r\n setView(e.target.value)}\r\n value={view}\r\n >\r\n List\r\n Calendar\r\n \r\n \r\n \r\n \r\n {viewActions}\r\n \r\n \r\n \r\n \r\n New Schedule\r\n \r\n \r\n
    \r\n }\r\n />\r\n \r\n {error ? : null}\r\n
    \r\n }>\r\n {content}\r\n \r\n
    \r\n
    \r\n \r\n}\r\n\r\nexport default WithOrgData(withUserGroups( ScheduledGroupsList))","import moment, {Moment} from \"moment\";\r\nimport gql from \"graphql-tag\";\r\nimport {ScheduledFlightFragment} from \"../../../Queries/Scheduling\";\r\nimport {useQuery} from \"react-apollo\";\r\nimport {FlightNode, QueryGetScheduledFlightsArgs} from \"../../../__generated__/graphql/types\";\r\nimport {momentOrNull} from \"../../../common/util\";\r\n\r\nconst QUERY = gql`\r\n query UseGenerateFlightDesig_GetFlights(\r\n $tpID: ID!\r\n $customerID: ID!\r\n $startDate: AWSDate!\r\n $endDate: AWSDate!\r\n ){\r\n getScheduledFlights(\r\n tpID: $tpID\r\n customerID: $customerID\r\n startDate: $startDate\r\n endDate: $endDate\r\n ){\r\n ...ScheduledFlightFragment\r\n }\r\n }\r\n ${ScheduledFlightFragment}\r\n`\r\n\r\nexport interface UseGenerateFlightDesigArgs {\r\n scheduledFlightDate: string | Moment,\r\n contractName: string,\r\n tpID: string,\r\n customerID: string\r\n}\r\n\r\ntype Data = {\r\n getScheduledFlights: FlightNode[]\r\n}\r\n\r\ntype Variables = QueryGetScheduledFlightsArgs\r\n\r\n/**\r\n * Generates a flight desig from a contract name. If there already exists a flight within the same scheduled\r\n * flight date with the same desig, a number will be appended to the end of the name.\r\n * Example 1:\r\n *\r\n * contractName: TALOS 20\r\n *\r\n * Existing flights:\r\n * - TALOS 20\r\n * - TALOS 20 #1\r\n *\r\n * returns TALOS 20 #2\r\n *\r\n * Example 2:\r\n *\r\n * contractName: MURPHY 10\r\n *\r\n * No existing flights\r\n *\r\n * returns MURPHY 10 #1\r\n *\r\n * @param args\r\n */\r\nexport function useGenerateFlightDesig(args: UseGenerateFlightDesigArgs){\r\n\r\n const { scheduledFlightDate, contractName, tpID, customerID } = args;\r\n\r\n const date = momentOrNull(scheduledFlightDate);\r\n\r\n const result = useQuery(QUERY, {\r\n variables: {\r\n tpID: tpID,\r\n customerID: customerID,\r\n startDate: date.startOf('day').format('YYYY-MM-DD'),\r\n endDate: date.endOf('day').format('YYYY-MM-DD')\r\n },\r\n skip: !date\r\n });\r\n\r\n const desig = createFlightDesig(contractName, result?.data?.getScheduledFlights);\r\n\r\n return {\r\n loading: result.loading,\r\n desig: result.loading && !result.error ? null : desig,\r\n error: result.error\r\n }\r\n}\r\n\r\nexport function createFlightDesig(contractName: string, flights: FlightNode[]) {\r\n // Return null if contractName is null or undefined\r\n if (!contractName) {\r\n return null;\r\n }\r\n\r\n // If flights is null or empty, return the first designation\r\n if (!flights || flights.length === 0) {\r\n return `${contractName} #1`;\r\n }\r\n\r\n // Regex to match designations in the format \"contractName #\"\r\n const regex = new RegExp(`^${contractName} #(\\\\d+)$`);\r\n\r\n // Extract numbers from matching designations\r\n const matchingNumbers = flights\r\n .map(flight => {\r\n const match = flight.desig?.match(regex);\r\n return match ? parseInt(match[1], 10) : null;\r\n })\r\n .filter(num => num !== null) as number[];\r\n\r\n // Determine the next number\r\n const nextNumber = matchingNumbers.length > 0 ? Math.max(...matchingNumbers) + 1 : 1;\r\n\r\n // Construct and return the new designation\r\n return `${contractName} #${nextNumber}`;\r\n}\r\n","import { Alert, Button, Col, DatePicker, Drawer, Form, Input, Row } from 'antd';\r\nimport { DrawerProps } from 'antd/lib/drawer';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\nimport ContractSelect from 'components/form/ContractSelect';\r\nimport { LocationSelect } from 'components/form/select/LocationSelect';\r\nimport gql from 'graphql-tag';\r\nimport moment from 'moment';\r\nimport React, {useCallback} from 'react';\r\nimport { useMutation } from 'react-apollo';\r\nimport AircraftSelect from '../../form/AircraftSelect';\r\nimport LocationOnshoreSelect from '../../form/LocationOnshoreSelect';\r\nimport PilotSelect from '../../form/PilotSelect';\r\nimport WithOrgData, { WithOrgDataProps } from '../../WithOrgData';\r\nimport {useGenerateFlightDesig} from \"../../scheduling/util/use-generate-flight-desig\";\r\n\r\nconst formItemLayout = {\r\n labelCol: {\r\n xs: { span: 24 },\r\n sm: { span: 8 },\r\n },\r\n wrapperCol: {\r\n xs: { span: 24 },\r\n sm: { span: 16 },\r\n },\r\n};\r\nconst tailFormItemLayout = {\r\n wrapperCol: {\r\n xs: {\r\n span: 24,\r\n offset: 0,\r\n },\r\n sm: {\r\n span: 16,\r\n offset: 8,\r\n },\r\n },\r\n};\r\n\r\nconst CREATE_FLIGHT = gql`\r\nmutation CreateFlight($payload: FlightNodeInput!, $orgID: ID!){\r\n setFlight(\r\n payload: $payload,\r\n orgID: $orgID\r\n ){\r\n _id\r\n }\r\n}\r\n`\r\n\r\nconst defaultFormOptions = (initialValue = '', required = true) => ({\r\n rules: [\r\n {\r\n required,\r\n message: 'This field is required'\r\n }\r\n ],\r\n initialValue\r\n})\r\n\r\nexport interface NewFlightDrawerProps extends Partial, WithOrgDataProps, DrawerProps {\r\n onCompleted?(data: any): void\r\n}\r\n\r\nconst NewFlightDrawer: React.FC = (props) => {\r\n\r\n const { onCompleted, orgData, form, ...restProps } = props;\r\n\r\n const generatedDesigResult = useGenerateFlightDesig({\r\n tpID: orgData.getOrgIDByType('transporter'),\r\n customerID: orgData.getOrgIDByType('customer'),\r\n contractName: form.getFieldValue('contractID')?.label,\r\n scheduledFlightDate: moment(form.getFieldValue('scheduledFlightDate')).format('YYYY-MM-DD')\r\n })\r\n \r\n const [ createFlight, { loading, error } ] = useMutation(CREATE_FLIGHT, {\r\n onCompleted: (data) => props.onCompleted && props.onCompleted(data && data.setFlight)\r\n })\r\n\r\n function submit(e: React.FormEvent){\r\n e.preventDefault();\r\n form.validateFieldsAndScroll((err, values) => {\r\n if (!err) {\r\n createFlight({\r\n variables: {\r\n payload: {\r\n ...values,\r\n contractID: values.contractID?.key,\r\n customerID: orgData.getOrgIDByType('customer'),\r\n tpID: orgData.getOrgIDByType('transporter'),\r\n lastKnownController: values.lastKnownController,\r\n departureID: values.departureID.key,\r\n scheduledFlightDate: moment(values.scheduledFlightDate).format('YYYY-MM-DD'),\r\n desig: values.desig || generatedDesigResult.desig\r\n },\r\n orgID: orgData.getActiveOrgID()\r\n }\r\n })\r\n }\r\n });\r\n }\r\n\r\n const validateDesig = useCallback((rule, value, callback) => {\r\n if (!value && !generatedDesigResult.desig && rule.required){\r\n callback(rule.message);\r\n return;\r\n }\r\n callback();\r\n }, [form, generatedDesigResult.desig])\r\n\r\n function renderContent(){\r\n const { getFieldDecorator, getFieldValue } = form;\r\n return (\r\n
    \r\n {error && }\r\n \r\n {getFieldDecorator('scheduledFlightDate', defaultFormOptions(undefined))(\r\n current < moment().startOf('day')} format=\"YYYY-MM-DD\" />\r\n )}\r\n \r\n \r\n {getFieldDecorator('desig', {\r\n initialValue: '',\r\n rules: [\r\n {\r\n message: 'Please enter a flight desig or assign a contract.',\r\n required: true,\r\n validator: validateDesig\r\n }\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('lastKnownController', defaultFormOptions())(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('departureID', defaultFormOptions())(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('aircraftID', defaultFormOptions())(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('contractID', defaultFormOptions())(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('pilotID', defaultFormOptions('', false))(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('copilotID', defaultFormOptions('', false))(\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n }\r\n return \r\n {renderContent()}\r\n \r\n}\r\n\r\nexport default Form.create({\r\n onValuesChange:(props, changedValues, allValues) => {\r\n if(changedValues[\"lastKnownController\"]){\r\n props.form.setFieldsValue({\"contractID\": \"\"})\r\n }\r\n }})(WithOrgData(NewFlightDrawer))","import { Cell, Column, SelectionModes, Table } from '@blueprintjs/table';\r\nimport { Button } from 'antd';\r\nimport { getFlightDeparture, getFlightDestinations } from 'common/flight';\r\nimport { useColWidths } from 'common/table';\r\nimport React, { forwardRef, LegacyRef } from 'react';\r\nimport { ScheduledFlight } from '../interface';\r\n\r\nconst tableCellStyle: React.CSSProperties = {\r\n display: 'flex',\r\n alignItems: 'center',\r\n fontSize: '14px'\r\n}\r\n\r\nexport interface ScheduledFlightsTableProps {\r\n data: Array,\r\n onViewFlight?(group: ScheduledFlight): void\r\n}\r\n\r\nconst ScheduledFlightsTable: React.FC = forwardRef((props, ref: LegacyRef) => {\r\n const [ colWidths, , updateColWidth ] = useColWidths(5, [200, 200, 200, 200, 200])\r\n return \r\n {\r\n const record = props.data[idx];\r\n return {record && record.desig}\r\n }} />\r\n {\r\n let record = props.data[idx];\r\n return {record && record.aircraftID && record.aircraftID.tailNum}\r\n }} />\r\n {\r\n return {getFlightDeparture(props.data[idx])}\r\n }} />\r\n {\r\n let dests = getFlightDestinations(props.data[idx]);\r\n let destNames = dests.map(dest => dest.name).join(', ');\r\n return {destNames}\r\n }} />\r\n {\r\n return \r\n {props.onViewFlight ? (\r\n props.onViewFlight(props.data[idx])}\r\n block\r\n size=\"small\"\r\n >View Schedule\r\n ) : null}\r\n \r\n }} />\r\n
    \r\n})\r\n\r\nexport default ScheduledFlightsTable","import { Button, Drawer } from 'antd';\r\nimport 'css/Calendar.less';\r\nimport 'css/Drawer.css';\r\nimport moment from 'moment';\r\nimport React, { useState } from 'react';\r\nimport SchedulingCalendar from '../calendar';\r\nimport '../calendar/ScheduleCalendar.css';\r\nimport { ScheduledFlight } from '../interface';\r\n// import ScheduledGroupsTable from './table';\r\nimport pluralize from 'pluralize';\r\nimport { getFlightDeparture, getFlightDestinations } from 'common/flight';\r\nimport ScheduledFlightsTable from './table';\r\n\r\nexport interface ScheduledFlightsCalendarProps {\r\n onFlightClicked?(flight: ScheduledFlight): void,\r\n value?: moment.Moment,\r\n data?: Array\r\n}\r\n\r\nconst ScheduledFlightsCalendar: React.FC = (props) => {\r\n const [ expandedDay, setExpandedDay ] = useState<{ date: moment.Moment, data: Array }>(null);\r\n\r\n return <>\r\n \r\n data={props.data}\r\n value={props.value}\r\n getDataDate={(dataItem) => dataItem.scheduledFlightDate}\r\n onCellClick={(date, data) => setExpandedDay({ date, data })}\r\n renderDateCell={(data) => {\r\n return {\r\n title: `${data.length} ${pluralize('schedule', data.length)}`,\r\n content:
      \r\n {data.map((flight, idx) => {\r\n let buttonTooltip = `Flight Designation: ${flight.desig}`;\r\n buttonTooltip += `\\nAircraft Tail Num: ${flight.aircraftID && flight.aircraftID.tailNum}`\r\n buttonTooltip += `\\nDeparture: ${getFlightDeparture(flight) && getFlightDeparture(flight).name}`;\r\n buttonTooltip += `\\nDestinations: ${getFlightDestinations(flight).map(dest => dest.name).join(', ')}`;\r\n buttonTooltip += '\\n\\nClick to view schedule'\r\n return
    • \r\n {\r\n e.stopPropagation();\r\n if (props.onFlightClicked)\r\n props.onFlightClicked(flight);\r\n }}\r\n title={buttonTooltip}\r\n >{flight.desig}\r\n
    • \r\n })}\r\n
    \r\n }\r\n }}\r\n />\r\n setExpandedDay(null)}\r\n visible={expandedDay ? true : false}\r\n width=\"1000px\"\r\n >\r\n {expandedDay && expandedDay.data.length ? (\r\n props.onFlightClicked && props.onFlightClicked(flight)}\r\n />\r\n ) : null}\r\n \r\n \r\n}\r\n\r\nexport default ScheduledFlightsCalendar","import { List, Table } from 'antd';\r\nimport { castArray } from 'common/util';\r\nimport DestinationList from 'components/DestinationList';\r\nimport { groupBy } from 'lodash';\r\nimport moment from 'moment';\r\nimport React from 'react';\r\nimport { ScheduledFlight } from '../interface';\r\n\r\nexport interface ScheduledGroupsListProps {\r\n onFlightClicked?(flight: ScheduledFlight),\r\n data?: Array\r\n}\r\n\r\nconst ScheduledGroupsList: React.FC = (props) => {\r\n let grouped = groupBy(castArray(props.data), 'scheduledFlightDate');\r\n let data: Array = Object.entries(grouped);\r\n return {\r\n let itemData: Array = item[1];\r\n return \r\n
    \r\n

    {item[0] && moment(item[0]).format('MMMM DD, YYYY (dddd)')}

    \r\n record && record._id}\r\n pagination={false}\r\n dataSource={itemData}\r\n onRow={() => {\r\n return {\r\n style: {\r\n cursor: 'pointer'\r\n }\r\n }\r\n }}\r\n onRowClick={(record) => {\r\n if (props.onFlightClicked){\r\n props.onFlightClicked(record)\r\n }\r\n }}\r\n size=\"small\"\r\n className=\"mc-table\"\r\n columns={[\r\n {\r\n title: 'Flight Designation',\r\n key: 'desig',\r\n dataIndex: 'desig'\r\n },\r\n {\r\n title: 'Aircraft',\r\n key: 'aircraft',\r\n render: (_, record) => record.aircraftID ? record.aircraftID.tailNum : Not Found\r\n },\r\n {\r\n title: 'Departure',\r\n key: 'departure',\r\n render: (_, record) => {\r\n const legs = record.legsArray;\r\n if (legs && legs.length){\r\n return legs[0].departure;\r\n }\r\n return null\r\n }\r\n },\r\n {\r\n title: 'Destinations',\r\n key: 'destinations',\r\n render: (_, record) => {\r\n const legs = record.legsArray;\r\n if (legs && legs.length){\r\n return leg.destination)} />\r\n }\r\n return null\r\n }\r\n },\r\n {\r\n title: 'Created By',\r\n key: 'createdBy',\r\n dataIndex: 'createdBy'\r\n }\r\n ]}\r\n />\r\n
    \r\n
    \r\n }}\r\n />\r\n}\r\n\r\nexport default ScheduledGroupsList","import { Alert, Button, Col, DatePicker, Divider, Icon, Input, Layout, Radio, Row, Spin } from 'antd';\r\nimport { castArray } from 'common/util';\r\nimport NewFlightDrawer from 'components/flights/scheduling/NewFlightDrawer';\r\nimport MainHeader from 'components/scheduling/MainHeader';\r\nimport MainLayout from 'components/scheduling/MainLayout';\r\nimport WithOrgData, { WithOrgDataProps } from 'components/WithOrgData';\r\nimport gql from 'graphql-tag';\r\nimport moment from 'moment';\r\nimport React, { useState } from 'react';\r\nimport { useApolloClient, useQuery } from 'react-apollo';\r\nimport MonthSelect from '../calendar/monthselect';\r\nimport { ScheduledFlight } from '../interface';\r\nimport { usePersistentDateRange } from '../util';\r\nimport ScheduledFlightsCalendar from './calendar';\r\nimport GroupList from './list';\r\nexport interface ScheduledFlightsListProps extends WithOrgDataProps {\r\n onFlightClicked?(flight: ScheduledFlight): void,\r\n onNewFlightSubmitted?(flightId: string): void\r\n}\r\n\r\nconst { Content } = Layout;\r\n\r\nconst { RangePicker } = DatePicker;\r\n\r\nconst dividerStyle = {\r\n height: '3rem',\r\n margin: '0 1rem',\r\n background: '#dcdcdc'\r\n}\r\n\r\nconst GET_FLIGHTS = gql`\r\nquery GetFlights(\r\n $tpID: ID!\r\n $customerID: ID!\r\n $startDate: AWSDate!\r\n $endDate: AWSDate!\r\n){\r\n getScheduledFlights(\r\n tpID: $tpID\r\n customerID: $customerID\r\n startDate: $startDate\r\n endDate: $endDate\r\n ){\r\n _id\r\n createdBy\r\n createdTs\r\n modifiedTs\r\n modifiedBy\r\n aircraftID {\r\n _id\r\n tailNum\r\n }\r\n scheduledFlightDate\r\n desig\r\n legsArray {\r\n departureID\r\n departure\r\n destinationID\r\n destination\r\n }\r\n }\r\n}\r\n`\r\n\r\nfunction formatDate(date: moment.Moment){\r\n return date.format('YYYY-MM-DD')\r\n}\r\n\r\nconst ScheduledFlightsList: React.FC = (props) => {\r\n const [ calValue, setCalValue ] = useState(moment());\r\n const [ listSearch, setListSearch ] = useState('');\r\n const [ newFlightOpen, setNewFlightOpen ] = useState(false);\r\n\r\n const client = useApolloClient();\r\n var { data: viewData } = useQuery(gql`\r\n query GetCalendarView {\r\n schedulingCalendarView @client\r\n }\r\n `)\r\n\r\n const [ dateRange, setDateRange ] = usePersistentDateRange();\r\n\r\n const view = (viewData && viewData.schedulingCalendarView) || '0'\r\n\r\n function setView(value: string){\r\n client.writeData({\r\n data: {\r\n schedulingCalendarView: value\r\n }\r\n })\r\n }\r\n\r\n if (view === '1'){\r\n var startDate = formatDate(calValue.clone().startOf('month'));\r\n var endDate = formatDate(calValue.clone().endOf('month'));\r\n }\r\n else\r\n {\r\n startDate = formatDate(dateRange[0]);\r\n endDate = formatDate(dateRange[1]);\r\n }\r\n\r\n const { loading, error, data: queryData } = useQuery(GET_FLIGHTS, {\r\n fetchPolicy: 'network-only',\r\n pollInterval: 5000,\r\n variables: {\r\n tpID: props.orgData.getOrgIDByType('transporter'),\r\n customerID: props.orgData.getOrgIDByType('customer'),\r\n startDate,\r\n endDate\r\n }\r\n\r\n })\r\n\r\n let data: Array = castArray(queryData && queryData.getScheduledFlights);\r\n\r\n if (view === '0' && listSearch.length > 0){\r\n data = data.filter((item) => item.desig.toLowerCase().includes(listSearch.toLowerCase().trim()))\r\n }\r\n\r\n let content: React.ReactElement;\r\n\r\n let viewActions: React.ReactElement;\r\n\r\n switch (view) {\r\n case '0':\r\n viewActions = \r\n \r\n setDateRange(dates)}\r\n format=\"MMM DD, YY\"\r\n disabledDate={(current) => moment().isAfter(current, 'month')}\r\n />\r\n \r\n \r\n }\r\n value={listSearch}\r\n onChange={(e) => setListSearch(e.target.value)}\r\n allowClear\r\n />\r\n \r\n \r\n content =
    \r\n props.onFlightClicked && props.onFlightClicked(flight)} />\r\n
    \r\n break;\r\n case '1':\r\n default:\r\n viewActions = \r\n \r\n \r\n \r\n \r\n setCalValue(value)}\r\n />\r\n \r\n \r\n content = props.onFlightClicked && props.onFlightClicked(flight)}\r\n />\r\n break;\r\n }\r\n\r\n return \r\n \r\n \r\n setView(e.target.value)}\r\n value={view}\r\n >\r\n List\r\n Calendar\r\n \r\n \r\n \r\n \r\n {viewActions}\r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n />\r\n \r\n {error ? : null}\r\n
    \r\n }>\r\n {content}\r\n \r\n
    \r\n
    \r\n setNewFlightOpen(false)}\r\n onCompleted={(data) => props.onNewFlightSubmitted(data._id)}\r\n />\r\n
    \r\n}\r\n\r\nexport default WithOrgData(ScheduledFlightsList)","import ApolloClient from \"apollo-client\";\r\nimport {ResolveLocationIdsQuery} from \"Queries/Location\";\r\nimport {Location} from \"common/types/location\";\r\nimport moment from \"moment\";\r\nimport {OrgDataProviderContext} from \"../../../../context/orgData\";\r\nimport {\r\n DeleteEntityInput,\r\n DepDestListItem,\r\n GroupData,\r\n GroupFormData, Phase2EntityFormData, Phase2ScheduledPaxNode,\r\n Phase2ScheduleNode,\r\n ScheduleVariables\r\n} from \"./types\";\r\nimport {createFormField, FormField, getFormFieldsValues} from \"../../../../common/form\";\r\nimport {momentOrNull} from \"../../../../common/util\";\r\nimport {v4 as uuidv4} from 'uuid';\r\nimport {ScheduledCgoNode, ScheduledPaxNode, ScheduleNode} from \"../../../../components/scheduling/types\";\r\nimport {FlightNode} from \"../../../../__generated__/graphql/types\";\r\nimport {getSNodeID} from \"../../../../components/scheduling/util\";\r\n\r\nexport const BASE_CLS = 'phase-2-scheduler';\r\n\r\nexport async function deRefLocations(apolloClient:ApolloClient, locationIds: string[]){\r\n const { data, errors } = await apolloClient.query({\r\n query: ResolveLocationIdsQuery,\r\n errorPolicy: 'all',\r\n fetchPolicy: 'cache-first',\r\n variables: {\r\n ids: locationIds\r\n }\r\n })\r\n\r\n return {\r\n data: (data?.resolve_entity_ids || []) as Location[],\r\n errors: errors || []\r\n }\r\n}\r\n\r\nexport function preparePassengerForSchedule(pax: ScheduledPaxNode){\r\n return {\r\n _id: pax._id,\r\n _rev: pax._rev,\r\n personID: pax.personID._id,\r\n transitType: pax.transitType,\r\n paxWeight: pax.paxWeight,\r\n bagWeight: pax.bagWeight,\r\n bagCount: pax.bagCount,\r\n chargeCode: pax.chargeCode && pax.chargeCode.toUpperCase(),\r\n departureID: pax.departureID?._id,\r\n destinationID: pax.destinationID?._id,\r\n scheduledOrder: pax.scheduledOrder,\r\n notesForPilot: pax.notesForPilot\r\n }\r\n}\r\n\r\nexport function prepareCargoForSchedule(cgo: ScheduledCgoNode){\r\n return {\r\n _id: cgo._id,\r\n _rev: cgo._rev,\r\n name: cgo.name,\r\n weight: cgo.weight,\r\n hazmat: cgo.hazmat,\r\n hazmatUnCode: cgo.hazmatUnCode,\r\n attentionTo: cgo.attentionTo,\r\n notes: cgo.notes,\r\n receivedLocationID: cgo.receivedLocationID,\r\n scheduledOrder: cgo.scheduledOrder,\r\n departureID: cgo.departureID?._id,\r\n destinationID: cgo.destinationID?._id,\r\n initials: cgo.initials,\r\n transitType: cgo.transitType,\r\n notesForPilot: cgo.notesForPilot\r\n }\r\n}\r\n\r\nexport type PreparedScheduledPax = ReturnType;\r\nexport type PreparedScheduledCgo = ReturnType;\r\n\r\nexport function createSaveMutationVars(\r\n orgData: OrgDataProviderContext,\r\n groupFieldsValues: {\r\n lastKnownController: string,\r\n group: string,\r\n date: any\r\n },\r\n data: Phase2ScheduleNode[],\r\n deletedData: Phase2ScheduleNode[],\r\n entityFormData: { [entityId: string]: Phase2EntityFormData },\r\n defaultChargeCode?: string\r\n): ScheduleVariables {\r\n function applyDefChgCode(obj: Phase2ScheduledPaxNode): ScheduledPaxNode {\r\n const chargeCode = entityFormData[getSNodeID(obj)]?.chargeCode?.value;\r\n return {\r\n ...obj,\r\n chargeCode: (chargeCode && chargeCode.toUpperCase()) || (defaultChargeCode && defaultChargeCode.toUpperCase())\r\n }\r\n }\r\n return {\r\n customerID: orgData.getOrgIDByType('customer'),\r\n tpID: orgData.getOrgIDByType('transporter'),\r\n lastKnownController: groupFieldsValues.lastKnownController,\r\n scheduledGroup: groupFieldsValues.group,\r\n scheduledFlightDate: moment(groupFieldsValues.date).format('YYYY-MM-DD'),\r\n modifiedPax: data.filter(item => item.classType === 'flytsuite.paxnode')\r\n .map(applyDefChgCode)\r\n .map(preparePassengerForSchedule),\r\n modifiedCgo: data.filter(item => item.classType === 'flytsuite.cgonode')\r\n // .map((cgo: ScheduledCgoNode) => ({\r\n // ...cgo,\r\n // receivedLocationID: cgo.transitType === TransitType.INBOUND ? cgo.departureID?._id : undefined\r\n // }))\r\n .map(prepareCargoForSchedule),\r\n deletedEntities: deletedData && deletedData\r\n .filter(item => !!item._rev)\r\n .map(item => ({ _id: item._id, _rev: item._rev, classType: item.classType }) as DeleteEntityInput)\r\n }\r\n}\r\n\r\nexport function sortByScheduledOrder(a: ScheduleNode, b: ScheduleNode){\r\n if (b.scheduledOrder === null) return -1;\r\n if (a.scheduledOrder === null) return 1;\r\n\r\n const diff = (a.scheduledOrder || 0) - (b.scheduledOrder || 0);\r\n if (diff === 0){\r\n // scheduledOrders are equal. Put paxnodes before cgonodes.\r\n return a.classType === 'flytsuite.paxnode' && b.classType === 'flytsuite.cgonode' ? -1 : 1;\r\n }\r\n return diff;\r\n}\r\n\r\nexport function updateScheduledOrder(entity: Phase2ScheduleNode, index: number){\r\n return {\r\n ...entity,\r\n scheduledOrder: index\r\n }\r\n}\r\n\r\nexport class DepDestList {\r\n static build(scheduleNodes: Phase2ScheduleNode[]){\r\n\r\n // Ordered map\r\n const depDestList = new Map();\r\n\r\n // Used for building key for depDestList\r\n function hashLeg(departure: Location, destination: Location){\r\n return departure?._id + ':' + destination?._id\r\n }\r\n\r\n // Create a copy b/c sort sorts in-place.\r\n const scheduleNodesCopy = [...scheduleNodes];\r\n // First, sort by scheduled order:\r\n scheduleNodesCopy.sort(sortByScheduledOrder);\r\n\r\n let order = 0;\r\n for (const node of scheduleNodesCopy) {\r\n const hash = hashLeg(node.departureID, node.destinationID);\r\n if (!depDestList.has(hash)){\r\n // Create new entry with this node in it\r\n depDestList.set(hash, {\r\n departure: node.departureID,\r\n destination: node.destinationID,\r\n rangeStart: order,\r\n rangeEnd: order,\r\n pax: [node].filter(e => e.classType === 'flytsuite.paxnode') as ScheduledPaxNode[],\r\n cgo: [node].filter(e => e.classType === 'flytsuite.cgonode') as ScheduledCgoNode[],\r\n all: [node]\r\n })\r\n }\r\n else\r\n {\r\n const leg = depDestList.get(hash);\r\n\r\n // Will be updated if a pax/cgo has a greater scheduledOrder.\r\n let nextRangeEnd = leg.rangeEnd;\r\n\r\n // Insert node into existing list\r\n if (node.classType === 'flytsuite.paxnode'){\r\n leg.pax.push(node as ScheduledPaxNode);\r\n nextRangeEnd = Math.max(nextRangeEnd, order);\r\n }\r\n else if (node.classType === 'flytsuite.cgonode'){\r\n leg.cgo.push(node as ScheduledCgoNode);\r\n nextRangeEnd = Math.max(nextRangeEnd,order);\r\n }\r\n leg.all.push(node);\r\n\r\n // Update rangeEnd\r\n leg.rangeEnd = nextRangeEnd;\r\n }\r\n\r\n order++;\r\n }\r\n\r\n return Array.from(depDestList.values());\r\n }\r\n\r\n static toEntities(legs: DepDestListItem[]): Phase2ScheduleNode[] {\r\n\r\n const entityList: Phase2ScheduleNode[] = [];\r\n\r\n let order = 0;\r\n for (let leg of legs) {\r\n for (let entity of leg.all) {\r\n entityList.push({\r\n ...entity,\r\n scheduledOrder: order\r\n })\r\n order++;\r\n }\r\n }\r\n\r\n return entityList;\r\n }\r\n}\r\n\r\n\r\nexport function findLegIdx(list: DepDestListItem[], leg: DepDestListItem){\r\n return list.findIndex(item => (\r\n item.departure?._id === leg.departure?._id ||\r\n item.destination?._id === leg.destination?._id\r\n ))\r\n}\r\n\r\nexport function initFormData(groupData: GroupData): GroupFormData {\r\n return {\r\n name: createFormField(groupData.name),\r\n date: createFormField(momentOrNull(groupData.date)),\r\n lastKnownController: createFormField(groupData.lastKnownControllerObj ? ({\r\n key: groupData.lastKnownControllerObj._id,\r\n label: groupData.lastKnownControllerObj.name\r\n }) : null)\r\n }\r\n}\r\n\r\nexport function getFormDataAsDeps(formData: { [key: string]: FormField }){\r\n const deps = [];\r\n\r\n for (let key in formData) {\r\n const value = formData[key]?.value;\r\n deps.push(value);\r\n }\r\n\r\n return deps;\r\n}\r\n\r\nexport function formTouched(formData: { [key: string]: FormField }){\r\n for (let key in formData) {\r\n if (formData[key]?.touched){\r\n return true\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nexport function allRequiredFieldsHaveValue(formData: { [key: string]: FormField }, requiredFieldNames: string[]){\r\n const touchedFieldNames: string[] = [];\r\n\r\n for (let key in formData) {\r\n if (formData[key]?.value){\r\n touchedFieldNames.push(key);\r\n }\r\n }\r\n\r\n for (let requiredFieldName of requiredFieldNames) {\r\n if (!touchedFieldNames.includes(requiredFieldName)){\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n}\r\n\r\nexport function genTempID(){\r\n return 'TEMP-' + uuidv4()\r\n}\r\n\r\nexport function getNoteMap(entities: ScheduleNode[]){\r\n /* Gather all notesForPilot values from pax and cargo and create a dictionary of them with this structure:\r\n {\r\n : ScheduleNode[]\r\n }\r\n */\r\n\r\n const noteMap: Record = {};\r\n\r\n for (let entity of entities) {\r\n const msg = entity.notesForPilot;\r\n if (!msg) continue;\r\n\r\n if (msg in noteMap){\r\n noteMap[msg].push(entity);\r\n }\r\n else\r\n {\r\n noteMap[msg] = [entity];\r\n }\r\n }\r\n\r\n return noteMap;\r\n}\r\n\r\n/**\r\n * Merges the Phase2ScheduleNode object with the Phase2EntityFormData data\r\n */\r\nexport function toScheduleNode(phase2ScheduleNode: Phase2ScheduleNode, formDataMap: { [entityId: string]: Phase2EntityFormData }){\r\n const formData = formDataMap[phase2ScheduleNode._id];\r\n\r\n const values = getFormFieldsValues(formData);\r\n\r\n return {\r\n ...phase2ScheduleNode,\r\n ...values\r\n } as ScheduleNode;\r\n}\r\n\r\n/**\r\n * Ensures the charge code doesn't have spaces and stays in all caps.\r\n */\r\nexport function formatChargeCode(chargeCode: string){\r\n return chargeCode?.split(\" \").join(\"\").toUpperCase();\r\n}\r\n\r\nexport function isFlightScheduled>(flightNode: T){\r\n if (!flightNode) return false;\r\n return ['SCHEDULED', 'NONE'].includes(flightNode.state);\r\n}","import gql from \"graphql-tag\";\r\nimport {\r\n ScheduledCgoNodeFragment,\r\n ScheduledFlightFragment,\r\n ScheduledPaxNodeFragment\r\n} from \"../../../../../Queries/Scheduling\";\r\n\r\nexport const GetFlightQuery = gql`\r\n mutation PurgeEntitiesFromFlightTool_GetFlight($flightID: ID!){\r\n getFlight(flightID: $flightID){\r\n ...ScheduledFlightFragment\r\n }\r\n }\r\n ${ScheduledFlightFragment}\r\n`\r\n\r\nexport const RemovePaxCgoFromFlightMutation = gql`\r\nmutation PurgeEntitiesFromFlightTool_RemovePaxCgoFromFlight($flightID: ID!, $paxIDs: [ID!]!, $cgoIDs: [ID!]!){\r\n removePaxCgoFromFlight(flightID: $flightID, paxIDs: $paxIDs, cgoIDs: $cgoIDs){\r\n flight {\r\n ...ScheduledFlightFragment\r\n }\r\n paxNodes {\r\n ...ScheduledPaxNodeFragment\r\n }\r\n cgoNodes {\r\n ...ScheduledCgoNodeFragment\r\n }\r\n }\r\n}\r\n${ScheduledFlightFragment}\r\n${ScheduledPaxNodeFragment}\r\n${ScheduledCgoNodeFragment}\r\n`","import {Phase2Api} from \"../api\";\r\nimport {useApolloClient} from \"react-apollo\";\r\nimport {RemovePaxCgoFromFlightMutation} from \"./graphql\";\r\nimport useApolloClientHelper from \"../../../../../hooks/useApolloClientHelper\";\r\nimport {ScheduledFlightFragment} from \"../../../../../Queries/Scheduling\";\r\nimport {arrayToMapAccumulate} from \"../../../../../common/util-ts\";\r\nimport {useContext} from \"react\";\r\nimport {OrgDataContext} from \"../../../../../context/orgData\";\r\nimport {isFlightScheduled} from \"../util\";\r\nimport {FlightNode} from \"../../../../../__generated__/graphql/types\";\r\nimport {getSNodeID} from \"../../../../../components/scheduling/util\";\r\n\r\nexport function usePurgeFromFlight(api: Phase2Api){\r\n const apolloClient = useApolloClient();\r\n const apolloHelper = useApolloClientHelper();\r\n const orgData = useContext(OrgDataContext);\r\n\r\n const dispatch = api.getDispatch();\r\n\r\n return async function start(){\r\n\r\n dispatch({ type: 'PURGE_TOOL.SET_PURGE_STATUS', payload: { status: 'LOADING' } });\r\n\r\n try {\r\n const flightIDList = getFlightIDList(api);\r\n\r\n const flights = await apolloHelper.resolveEntityIds({\r\n ids: flightIDList,\r\n typename: 'FlightNode',\r\n fragment: ScheduledFlightFragment,\r\n fragmentName: 'ScheduledFlightFragment',\r\n fetchPolicy: 'network-only'\r\n });\r\n\r\n // Flights that are not scheduled or uninitalized should not be modified.\r\n const ineligibleFlights = flights\r\n .filter((flight) => {\r\n return !isFlightScheduled(flight)\r\n })\r\n .map((f) => f._id);\r\n\r\n const entitiesOnFlight = getSelectedEntities(api)\r\n .filter((entity) => entity.currentCarrierID?._id);\r\n\r\n const flightsWithEntities = arrayToMapAccumulate(\r\n entitiesOnFlight,\r\n (entity) => entity.currentCarrierID?._id\r\n );\r\n\r\n const flightsUpdating = Array.from(flightsWithEntities.entries())\r\n // Exclude ineligble flights\r\n .filter(([flightId]) => !ineligibleFlights.includes(flightId))\r\n .map(([flightId, entities]) => {\r\n return apolloClient.mutate({\r\n mutation: RemovePaxCgoFromFlightMutation,\r\n variables: {\r\n flightID: flightId,\r\n paxIDs: entities\r\n .filter((e) => e.classType === 'flytsuite.paxnode')\r\n .map((e) => e._id),\r\n cgoIDs: entities\r\n .filter((e) => e.classType === 'flytsuite.cgonode')\r\n .map((e) => e._id)\r\n }\r\n });\r\n })\r\n\r\n await Promise.all(flightsUpdating);\r\n\r\n dispatch({ type: 'PURGE_TOOL.SET_PURGE_STATUS', payload: { status: 'SUCCESS' } });\r\n }\r\n catch (error){\r\n console.error('Failed to purge pax/cgo from flight:', error);\r\n dispatch({ type: 'PURGE_TOOL.SET_PURGE_STATUS', payload: { status: 'ERROR' , error: error } });\r\n throw error;\r\n }\r\n\r\n }\r\n}\r\n\r\nfunction getSelectedEntities(api: Phase2Api){\r\n return api.data.originalEntities.get()\r\n .filter((entity) => api.purgeEntitiesFromFlightTool.selectedEntityIds.includes(getSNodeID(api.toScheduleNode(entity))))\r\n}\r\n\r\nfunction getFlightIDList(api: Phase2Api){\r\n const carrierIDList = new Set();\r\n getSelectedEntities(api)\r\n .filter((entity) => entity.currentCarrierID?._id && String(entity.currentCarrierID._id).startsWith('FLT-'))\r\n .forEach((entity) => carrierIDList.add(entity.currentCarrierID._id));\r\n\r\n return Array.from(carrierIDList);\r\n}","import React, {Dispatch} from \"react\";\r\nimport {produce} from \"immer\";\r\nimport {Actions, ActionType, State, VisibleLegsAction, VisibleLegsReducer} from \"../state\";\r\nimport {AddPrefixToKeys} from \"../../../../../common/util/ts-helpers\";\r\nimport * as Util from \"../util\";\r\nimport {difference, union} from \"lodash\";\r\nimport {Phase2ScheduleNode} from \"../types\";\r\nimport {getSNodeID} from \"../../../../../components/scheduling/util\";\r\nimport {ScheduleNode} from \"../../../../../components/scheduling/types\";\r\nimport {usePurgeFromFlight} from \"./purge-from-flight\";\r\nimport {Phase2Api} from \"../api\";\r\nimport {message} from \"antd\";\r\nimport {isFlightScheduled} from \"../util\";\r\n\r\nexport const DefaultState = {\r\n modal: {\r\n open: false\r\n },\r\n data: {\r\n entities: [] as Phase2ScheduleNode[]\r\n },\r\n selection: {\r\n selectedEntityIds: [] as string[]\r\n },\r\n editor: {\r\n visibleLegs: [] as { departureID: string, destinationID: string }[]\r\n },\r\n purgeStatus: {\r\n flightIsUpdating: false,\r\n error: null as Error\r\n }\r\n}\r\n\r\nexport type PurgeToolState = typeof DefaultState;\r\n\r\nexport type PurgeToolAction = {\r\n type: 'PURGE_TOOL.SET_VISIBLE',\r\n payload: {\r\n open: boolean\r\n }\r\n} | {\r\n type: 'PURGE_TOOL.SET_SELECTED_ENTITY_IDS',\r\n add?: typeof DefaultState.selection.selectedEntityIds,\r\n remove?: typeof DefaultState.selection.selectedEntityIds,\r\n set?: typeof DefaultState.selection.selectedEntityIds\r\n} | AddPrefixToKeys |\r\n{\r\n type: 'PURGE_TOOL.SET_PURGE_STATUS',\r\n payload: {\r\n status: 'LOADING' | 'SUCCESS'\r\n } | {\r\n status: 'ERROR',\r\n error: Error\r\n }\r\n}\r\n\r\nexport const useApi = (api: Phase2Api) => {\r\n\r\n const state = api.getState();\r\n const dispatch = api.getDispatch();\r\n const purgeToolState = state.purgeEntitiesFromFlightTool;\r\n\r\n const startPurge = usePurgeFromFlight(api);\r\n\r\n const purgeToolApi = {\r\n modal: {\r\n isOpen: () => purgeToolState.modal.open,\r\n setOpen: (open: boolean) => dispatch({\r\n type: 'PURGE_TOOL.SET_VISIBLE',\r\n payload: { open: open }\r\n })\r\n },\r\n startPurge: () => {\r\n startPurge()\r\n .then(() => {\r\n message.success('Pax/Cgo successfully purged from flight(s)');\r\n purgeToolApi.modal.setOpen(false);\r\n api.data.refetch();\r\n })\r\n .catch(() => message.error('Failed to purge pax/cgo from flight. View console for details.'))\r\n },\r\n isPurging: () => purgeToolState.purgeStatus.flightIsUpdating,\r\n selectedEntityIds: state.purgeEntitiesFromFlightTool.selection.selectedEntityIds as\r\n Readonly\r\n }\r\n\r\n return purgeToolApi;\r\n}\r\n\r\nexport type Api = ReturnType\r\n\r\nexport const Reducer: React.Reducer\r\n = (state, action) => produce(state, (draft) => {\r\n\r\n const purgeToolState = draft.purgeEntitiesFromFlightTool;\r\n\r\n function initData(){\r\n const entitiesOnValidFlightOnly = state.data.originalEntities\r\n .filter((entity) => isFlightScheduled(entity.currentCarrierID));\r\n\r\n purgeToolState.data.entities = entitiesOnValidFlightOnly;\r\n\r\n purgeToolState.selection.selectedEntityIds = [];\r\n\r\n const data = Util.DepDestList.build(entitiesOnValidFlightOnly);\r\n\r\n const depDestList = data\r\n .map(item => ({\r\n departureID: item.departure._id,\r\n destinationID: item.destination._id\r\n }));\r\n\r\n purgeToolState.editor.visibleLegs = depDestList;\r\n }\r\n\r\n switch (action.type){\r\n case ActionType.INIT_DATA:\r\n if (!state.purgeEntitiesFromFlightTool.modal.open) return;\r\n initData();\r\n break;\r\n case ActionType.RESET_DATA:\r\n if (!state.purgeEntitiesFromFlightTool.modal.open) return;\r\n initData();\r\n break;\r\n case \"PURGE_TOOL.SET_VISIBLE\":\r\n if (action.payload.open == purgeToolState.modal.open) return;\r\n purgeToolState.modal.open = action.payload.open;\r\n initData();\r\n\r\n // Select all entities upon opening\r\n purgeToolState.selection.selectedEntityIds = purgeToolState\r\n .data.entities.map(entity => getSNodeID(entity as ScheduleNode));\r\n break;\r\n case \"PURGE_TOOL.SET_VISIBLE_LEGS\":\r\n purgeToolState.editor.visibleLegs = VisibleLegsReducer(purgeToolState.editor.visibleLegs, {\r\n ...action,\r\n type: ActionType.SET_VISIBLE_LEGS\r\n })\r\n break;\r\n case \"PURGE_TOOL.SET_SELECTED_ENTITY_IDS\":\r\n if (!action.add && !action.remove && !action.set) return;\r\n\r\n let newSelEntityIds = purgeToolState.selection.selectedEntityIds;\r\n\r\n if (action.set){\r\n newSelEntityIds = action.set;\r\n }\r\n if (action.remove){\r\n newSelEntityIds = difference(newSelEntityIds, action.remove);\r\n }\r\n if (action.add){\r\n newSelEntityIds = union(newSelEntityIds, action.add);\r\n }\r\n\r\n purgeToolState.selection.selectedEntityIds = newSelEntityIds;\r\n break;\r\n case \"PURGE_TOOL.SET_PURGE_STATUS\":\r\n const { purgeStatus } = draft.purgeEntitiesFromFlightTool;\r\n\r\n switch (action.payload.status){\r\n case 'SUCCESS':\r\n purgeStatus.flightIsUpdating = false;\r\n purgeStatus.error = null;\r\n break;\r\n case 'LOADING':\r\n purgeStatus.flightIsUpdating = true;\r\n purgeStatus.error = null;\r\n break;\r\n case 'ERROR':\r\n purgeStatus.flightIsUpdating = false;\r\n purgeStatus.error = action.payload.error;\r\n }\r\n break;\r\n }\r\n})","import {AddPrefixToKeys} from \"../../../../../common/util/ts-helpers\";\r\nimport {VisibleLegsAction} from \"../state\";\r\nimport {DefaultState} from \"./state\";\r\n\r\nconst prefix = 'SCHED_TO_EXP_PAXCGO' as const;\r\n\r\nfunction defineType(name: Name){\r\n return `${prefix}.${name}` as `${typeof prefix}.${Name}`;\r\n}\r\n\r\nexport const SET_VISIBLE = defineType('SET_VISIBLE');\r\nexport const SET_SELECTED_ENTITY_IDS = defineType('SET_SELECTED_ENTITY_IDS');\r\nexport const SET_STATUS = defineType('SET_STATUS');\r\nexport const SET_VISIBLE_LEGS = defineType('SET_VISIBLE_LEGS');\r\n\r\nexport type SchedToExpAction = {\r\n type: typeof SET_VISIBLE,\r\n payload: {\r\n open: boolean\r\n }\r\n} | {\r\n type: typeof SET_SELECTED_ENTITY_IDS,\r\n add?: typeof DefaultState.selection.selectedEntityIds,\r\n remove?: typeof DefaultState.selection.selectedEntityIds,\r\n set?: typeof DefaultState.selection.selectedEntityIds\r\n} | AddPrefixToKeys |\r\n {\r\n type: typeof SET_STATUS,\r\n payload: {\r\n status: 'LOADING' | 'SUCCESS'\r\n } | {\r\n status: 'ERROR',\r\n error: Error\r\n }\r\n }","import gql from \"graphql-tag\";\r\nimport {\r\n ScheduledCgoNodeFragment,\r\n ScheduledPaxNodeFragment\r\n} from \"../../../../../Queries/Scheduling\";\r\nimport {ScheduledToExpectedPaxCgoResponse} from \"../../../../../__generated__/graphql/types\";\r\n\r\nexport const ScheduledToExpectedPaxCgoMutation = gql`\r\n mutation ScheduledToExpectedPaxCgoTool($paxIDs: [ID!], $cgoIDs: [ID!]){\r\n ScheduledToExpectedPaxCgo(paxIDs: $paxIDs, cgoIDs: $cgoIDs){\r\n paxNodes {\r\n ...ScheduledPaxNodeFragment\r\n }\r\n cgoNodes {\r\n ...ScheduledCgoNodeFragment\r\n }\r\n }\r\n }\r\n ${ScheduledPaxNodeFragment}\r\n ${ScheduledCgoNodeFragment}\r\n`","import {Phase2Api} from \"../api\";\r\nimport {getSNodeID} from \"../../../../../components/scheduling/util\";\r\n\r\nexport function getSelectedEntities(api: Phase2Api){\r\n return api.data.originalEntities.get()\r\n .filter((entity) => api.scheduledToExpectedPaxCgo.selectedEntityIds.includes(getSNodeID(api.toScheduleNode(entity))))\r\n}","import React from \"react\";\r\nimport {produce} from \"immer\";\r\nimport {Actions, ActionType, State, VisibleLegsReducer} from \"../state\";\r\nimport * as Util from \"../util\";\r\nimport {isFlightScheduled} from \"../util\";\r\nimport {difference, union} from \"lodash\";\r\nimport {Phase2ScheduleNode} from \"../types\";\r\nimport {getSNodeID} from \"../../../../../components/scheduling/util\";\r\nimport {ScheduleNode} from \"../../../../../components/scheduling/types\";\r\nimport {Phase2Api} from \"../api\";\r\nimport {SET_SELECTED_ENTITY_IDS, SET_STATUS, SET_VISIBLE, SET_VISIBLE_LEGS} from \"./action\";\r\nimport {useMutationDispatcher} from \"./invoke-mutation\";\r\nimport {useHistory} from \"react-router-dom\";\r\nimport {getSelectedEntities} from \"./util\";\r\nimport {message} from \"antd\";\r\n\r\nexport type { SchedToExpAction } from './action';\r\n\r\nexport const DefaultState = {\r\n modal: {\r\n open: false\r\n },\r\n data: {\r\n entities: [] as Phase2ScheduleNode[]\r\n },\r\n selection: {\r\n selectedEntityIds: [] as string[]\r\n },\r\n editor: {\r\n visibleLegs: [] as { departureID: string, destinationID: string }[]\r\n },\r\n status: {\r\n isLoading: false,\r\n error: null as Error\r\n }\r\n}\r\n\r\nexport type SchedToExpState = typeof DefaultState;\r\n\r\nexport const useApi = (api: Phase2Api) => {\r\n\r\n const _state = api.getState();\r\n const dispatch = api.getDispatch();\r\n const state = _state.scheduledToExpectedPaxCgo;\r\n const history = useHistory();\r\n\r\n const dispatchMutation = useMutationDispatcher(api);\r\n\r\n const scheduledToExpectedPaxCgoApi = {\r\n modal: {\r\n isOpen: () => state.modal.open,\r\n setOpen: (open: boolean) => dispatch({\r\n type: SET_VISIBLE,\r\n payload: { open: open }\r\n })\r\n },\r\n isLoading: state.status.isLoading,\r\n selectedEntityIds: state.selection.selectedEntityIds as Readonly,\r\n start: () => {\r\n const selectedEntities = getSelectedEntities(api);\r\n const allEntities = state.data.entities;\r\n\r\n const hasPax = selectedEntities.findIndex((e) => e.classType === 'flytsuite.paxnode') > -1;\r\n const hasCgo = selectedEntities.findIndex((e) => e.classType === 'flytsuite.cgonode') > -1;\r\n\r\n dispatchMutation()\r\n .then(() => {\r\n message.success(`Successfully made ${allEntities.length} PAX/CGO Expected.`);\r\n if (selectedEntities.length === allEntities.length){\r\n // All entities were modified. This schedule no longer exists. Redirect to pax or cgo grids.\r\n if (!hasPax && hasCgo){\r\n history.push('/app/cargo');\r\n }\r\n else {\r\n history.push('/app/passengers');\r\n }\r\n return;\r\n }\r\n // Otherwise stay on the current screen and refresh the data.\r\n scheduledToExpectedPaxCgoApi.modal.setOpen(false);\r\n api.data?.refetch();\r\n })\r\n .catch((err) => {\r\n console.error(err);\r\n message.error(\"Failed to make pax/cgo expected. View console for details.\");\r\n })\r\n }\r\n }\r\n\r\n return scheduledToExpectedPaxCgoApi;\r\n}\r\n\r\nexport type Api = ReturnType\r\n\r\nexport const Reducer: React.Reducer\r\n = (prevState, action) => produce(prevState, (draft) => {\r\n\r\n const state = draft.scheduledToExpectedPaxCgo;\r\n\r\n function initData(){\r\n const entitiesNotOnValidFlightOnly = prevState.data.originalEntities\r\n .filter((entity) => !isFlightScheduled(entity.currentCarrierID));\r\n\r\n state.data.entities = entitiesNotOnValidFlightOnly;\r\n\r\n state.selection.selectedEntityIds = [];\r\n\r\n const data = Util.DepDestList.build(entitiesNotOnValidFlightOnly);\r\n\r\n const depDestList = data\r\n .map(item => ({\r\n departureID: item.departure._id,\r\n destinationID: item.destination._id\r\n }));\r\n\r\n state.editor.visibleLegs = depDestList;\r\n }\r\n\r\n switch (action.type){\r\n case ActionType.INIT_DATA:\r\n if (!prevState.scheduledToExpectedPaxCgo.modal.open) return;\r\n initData();\r\n break;\r\n case ActionType.RESET_DATA:\r\n if (!prevState.scheduledToExpectedPaxCgo.modal.open) return;\r\n initData();\r\n break;\r\n case SET_VISIBLE:\r\n if (action.payload.open == state.modal.open) return;\r\n state.modal.open = action.payload.open;\r\n initData();\r\n\r\n // Select all entities upon opening\r\n state.selection.selectedEntityIds = state\r\n .data.entities.map(entity => getSNodeID(entity as ScheduleNode));\r\n break;\r\n case SET_VISIBLE_LEGS:\r\n state.editor.visibleLegs = VisibleLegsReducer(state.editor.visibleLegs, {\r\n ...action,\r\n type: ActionType.SET_VISIBLE_LEGS\r\n })\r\n break;\r\n case SET_SELECTED_ENTITY_IDS:\r\n if (!action.add && !action.remove && !action.set) return;\r\n\r\n let newSelEntityIds = state.selection.selectedEntityIds;\r\n\r\n if (action.set){\r\n newSelEntityIds = action.set;\r\n }\r\n if (action.remove){\r\n newSelEntityIds = difference(newSelEntityIds, action.remove);\r\n }\r\n if (action.add){\r\n newSelEntityIds = union(newSelEntityIds, action.add);\r\n }\r\n\r\n state.selection.selectedEntityIds = newSelEntityIds;\r\n break;\r\n case SET_STATUS:\r\n const { status } = draft.scheduledToExpectedPaxCgo;\r\n\r\n switch (action.payload.status){\r\n case 'SUCCESS':\r\n status.isLoading = false;\r\n status.error = null;\r\n break;\r\n case 'LOADING':\r\n status.isLoading = true;\r\n status.error = null;\r\n break;\r\n case 'ERROR':\r\n status.isLoading = false;\r\n status.error = action.payload.error;\r\n }\r\n break;\r\n }\r\n})","import React from \"react\";\r\nimport {cloneDeep, difference, union, unionBy, uniqBy} from 'lodash';\r\nimport {\r\n CargoFormFields,\r\n GroupData,\r\n GroupFormData,\r\n NewLegFormFields,\r\n Phase2EntityFormData, Phase2ScheduledPaxNode,\r\n Phase2ScheduleNode\r\n} from \"./types\";\r\nimport {Phase2Api} from \"./api\";\r\nimport * as Util from './util';\r\nimport {Location} from 'common/types/location';\r\nimport {createFormField, createFormFields, FormErrors, FormField} from \"../../../../common/form\";\r\nimport {getTransitType} from \"../../../../common/carriable/util\";\r\nimport {produce} from \"immer\";\r\nimport * as NotesForPilot from '../../../../components/flights/scheduling/notes-for-pilot';\r\nimport {ScheduledCgoNode, ScheduleNode} from \"../../../../components/scheduling/types\";\r\nimport {getSNodeID} from \"../../../../components/scheduling/util\";\r\nimport {formatChargeCode, toScheduleNode} from \"./util\";\r\nimport * as PurgeEntitiesFromFlightTool from './purge-entities-from-flight-tool/state';\r\nimport * as ScheduledToExpectedPaxCgo from './scheduled-to-expected-paxcgo/state';\r\n\r\nexport enum ActionType {\r\n // Data manipulation\r\n SET_MODIFIED_ENTITIES='SET_MODIFIED_ENTITIES',\r\n INIT_DATA='INIT_DATA',\r\n RESET_DATA='RESET_DATA',\r\n\r\n // Forms\r\n RESET_FORM_DATA='RESET_FORM_DATA',\r\n SET_FORM_DATA='SET_FORM_DATA',\r\n SET_ENTITY_FORM_DATA='SET_ENTITY_FORM_DATA',\r\n\r\n // Query status\r\n SET_QUERY_STATUS='SET_QUERY_STATUS',\r\n\r\n // Save status\r\n SET_SAVE_STATUS='SET_SAVE_STATUS',\r\n DISMISS_SAVE_STATUS='DISMISS_SAVE_STATUS',\r\n\r\n // Passenger selection\r\n SET_SELECTED_PERSONNEL_IDS='SET_SELECTED_PERSONNEL_IDS',\r\n\r\n // Tab selection\r\n SET_CARRIABLE_SELECTOR_TAB='SET_CARRIABLE_SELECTOR_TAB',\r\n SET_EDIT_MODE='SET_EDIT_MODE',\r\n\r\n // CarrierSelector\r\n SET_CARRIABLE_SEL_SEARCH='SET_CARRIABLE_SEL_SEARCH',\r\n SET_HIDE_CARRIABLE_PANEL='SET_HIDE_CARRIABLE_PANEL',\r\n SET_LEG_SELECTOR='SET_LEG_SELECTOR',\r\n\r\n // Editor\r\n SET_SELECTED_ENTITY_IDS='SET_SELECTED_ENTITY_IDS',\r\n CLEAR_CHARGE_CODES='CLEAR_CHARGE_CODES',\r\n SET_DEFAULT_CHARGE_CODE='SET_DEFAULT_CHARGE_CODE',\r\n SET_ISN_DRAWER='SET_ISN_DRAWER',\r\n SET_VISIBLE_LEGS='SET_VISIBLE_LEGS',\r\n\r\n // Modals\r\n SET_PAXNODE_MODAL='SET_PAXNODE_MODAL',\r\n SET_NEW_LEG_MODAL='SET_NEW_LEG_MODAL',\r\n\r\n // Notes for pilot\r\n NOTES_FOR_PILOT_POPUP='NOTES_FOR_PILOT_POPUP',\r\n NOTES_FOR_PILOT_EDITOR='NOTES_FOR_PILOT_EDITOR',\r\n SUBMIT_NOTES_FOR_PILOT_EDITOR='SUBMIT_NOTES_FOR_PILOT_EDITOR'\r\n}\r\n\r\nexport const DEFAULT_STATE = {\r\n editMode: true,\r\n data: {\r\n originalEntities: [] as Phase2ScheduleNode[],\r\n modifiedEntities: [] as Phase2ScheduleNode[],\r\n deletedEntities: [] as Phase2ScheduleNode[],\r\n },\r\n formDataMap: {} as {\r\n [entityId: string]: Phase2EntityFormData\r\n },\r\n queryStatus: {\r\n loading: false,\r\n error: null as any\r\n },\r\n saveStatus: null as ({\r\n status: 'success' | 'error',\r\n message: string,\r\n description?: string\r\n }) | null,\r\n\r\n carriableSelector: {\r\n selectedPersonnelIds: [] as string[],\r\n upperTab: 'personSearch' as 'personSearch' | 'cargoForm',\r\n lowerTab: 'byName' as 'byName' | 'byId',\r\n legSelector: {\r\n departure: null as { key: string, label: string },\r\n destination: null as { key: string, label: string }\r\n },\r\n searchForm: {\r\n lastName: null as string,\r\n firstName: null as string,\r\n credId: null as string\r\n },\r\n hidePanel: true\r\n },\r\n forms: {\r\n initGroupForm: {\r\n date: null,\r\n name: null,\r\n lastKnownController: null\r\n } as GroupFormData,\r\n groupForm: {\r\n date: null,\r\n name: null,\r\n lastKnownController: null\r\n } as GroupFormData,\r\n cargoForm: {\r\n name: null,\r\n weight: null,\r\n hazmat: null,\r\n hazmatUnCode: null,\r\n attentionTo: null,\r\n notes: null\r\n } as CargoFormFields,\r\n newLegForm: {\r\n depDest: createFormField({\r\n departure: null,\r\n destination: null\r\n })\r\n } as NewLegFormFields\r\n },\r\n formErrors: {\r\n cargoFormErrors: {} as FormErrors\r\n },\r\n modal: {\r\n paxModal: {\r\n pax: null as Phase2ScheduleNode,\r\n visible: false\r\n },\r\n newLegFormModal: {\r\n visible: false,\r\n callback: null as (departure: Location, destination: Location) => void\r\n },\r\n messageModal: {\r\n visible: false\r\n }\r\n },\r\n editor: {\r\n selectedEntityIds: [] as string[],\r\n defaultChargeCode: '' as string,\r\n isnDrawer: {\r\n pax: null as Phase2ScheduledPaxNode,\r\n visible: false\r\n },\r\n visibleLegs: [] as { departureID: string, destinationID: string }[]\r\n },\r\n\r\n // Controls the \"Notes For Pilot\" column inputs\r\n // Because we are centralizing the state here, it won't be possible to have more than one input popup open at once.\r\n notesForPilotPopup: {\r\n entityId: null as string,\r\n ...NotesForPilot.QuickEdit.DEFAULT_STATE\r\n },\r\n\r\n notesForPilotEditor: {\r\n open: false,\r\n state: NotesForPilot.Editor.DEFAULT_STATE\r\n },\r\n purgeEntitiesFromFlightTool: PurgeEntitiesFromFlightTool.DefaultState as PurgeEntitiesFromFlightTool.PurgeToolState,\r\n scheduledToExpectedPaxCgo: ScheduledToExpectedPaxCgo.DefaultState as ScheduledToExpectedPaxCgo.SchedToExpState\r\n}\r\n\r\nexport type State = typeof DEFAULT_STATE;\r\n\r\nexport type Actions =\r\n // Data manipulation\r\n {\r\n type: ActionType.INIT_DATA,\r\n entities: ScheduleNode[],\r\n group: GroupData\r\n } |\r\n {\r\n type: ActionType.SET_MODIFIED_ENTITIES,\r\n add?: Phase2ScheduleNode[],\r\n remove?: string[]\r\n set?: Phase2ScheduleNode[]\r\n } |\r\n {\r\n type: ActionType.RESET_DATA\r\n } |\r\n\r\n // Forms\r\n {\r\n type: ActionType.RESET_FORM_DATA,\r\n cargo?: boolean,\r\n group?: boolean,\r\n newLeg?: boolean\r\n } |\r\n {\r\n type: ActionType.SET_FORM_DATA,\r\n group?: typeof DEFAULT_STATE.forms.groupForm\r\n cargo?: typeof DEFAULT_STATE.forms.cargoForm,\r\n newLeg?: typeof DEFAULT_STATE.forms.newLegForm\r\n } |\r\n {\r\n type: ActionType.SET_ENTITY_FORM_DATA,\r\n entityId: string,\r\n payload: Phase2EntityFormData\r\n } |\r\n\r\n // Query Status\r\n {\r\n type: ActionType.SET_QUERY_STATUS,\r\n payload: typeof DEFAULT_STATE.queryStatus\r\n } |\r\n\r\n // Save Status\r\n {\r\n type: ActionType.SET_SAVE_STATUS,\r\n payload: typeof DEFAULT_STATE.saveStatus\r\n } |\r\n {\r\n type: ActionType.DISMISS_SAVE_STATUS\r\n } |\r\n\r\n // Passenger selection\r\n {\r\n type: ActionType.SET_SELECTED_PERSONNEL_IDS,\r\n payload: string[]\r\n } |\r\n\r\n // Tab selection\r\n {\r\n type: ActionType.SET_CARRIABLE_SELECTOR_TAB,\r\n payload: {\r\n upperTab: typeof DEFAULT_STATE.carriableSelector.upperTab,\r\n lowerTab: typeof DEFAULT_STATE.carriableSelector.lowerTab\r\n }\r\n } |\r\n\r\n // Edit mode\r\n {\r\n type: ActionType.SET_EDIT_MODE,\r\n payload: boolean\r\n } |\r\n\r\n // Set CarriableSelector\r\n {\r\n type: ActionType.SET_CARRIABLE_SEL_SEARCH,\r\n payload: typeof DEFAULT_STATE.carriableSelector.searchForm\r\n } |\r\n {\r\n type: ActionType.SET_HIDE_CARRIABLE_PANEL,\r\n payload: boolean | undefined\r\n } |\r\n {\r\n type: ActionType.SET_LEG_SELECTOR,\r\n payload: {\r\n departure: typeof DEFAULT_STATE.carriableSelector.legSelector.departure,\r\n destination: typeof DEFAULT_STATE.carriableSelector.legSelector.destination,\r\n }\r\n } |\r\n\r\n // Editor\r\n {\r\n type: ActionType.SET_SELECTED_ENTITY_IDS,\r\n add?: typeof DEFAULT_STATE.editor.selectedEntityIds,\r\n remove?: typeof DEFAULT_STATE.editor.selectedEntityIds,\r\n set?: typeof DEFAULT_STATE.editor.selectedEntityIds\r\n } |\r\n {\r\n type: ActionType.CLEAR_CHARGE_CODES\r\n } |\r\n {\r\n type: ActionType.SET_DEFAULT_CHARGE_CODE,\r\n payload: string\r\n } |\r\n {\r\n type: ActionType.SET_ISN_DRAWER,\r\n payload: typeof DEFAULT_STATE.editor.isnDrawer\r\n } |\r\n VisibleLegsAction |\r\n // Modals\r\n {\r\n type: ActionType.SET_PAXNODE_MODAL,\r\n visible?: boolean,\r\n pax?: Phase2ScheduledPaxNode\r\n } |\r\n {\r\n type: ActionType.SET_NEW_LEG_MODAL,\r\n visible: boolean,\r\n newLegValue?: typeof DEFAULT_STATE.forms.newLegForm.depDest.value,\r\n callback?: typeof DEFAULT_STATE.modal.newLegFormModal.callback\r\n } |\r\n\r\n // Notes For Pilot\r\n {\r\n type: ActionType.NOTES_FOR_PILOT_POPUP,\r\n entityId: string,\r\n action: NotesForPilot.QuickEdit.Action\r\n } |\r\n {\r\n type: ActionType.NOTES_FOR_PILOT_EDITOR,\r\n open?: boolean,\r\n action?: NotesForPilot.Editor.Action\r\n } |\r\n {\r\n type: ActionType.SUBMIT_NOTES_FOR_PILOT_EDITOR\r\n } |\r\n PurgeEntitiesFromFlightTool.PurgeToolAction |\r\n ScheduledToExpectedPaxCgo.SchedToExpAction\r\n\r\nconst HelperFuncs = {\r\n depDestToString(item: { departureID: string, destinationID: string }, splitter: string='::'){\r\n return item.departureID + splitter + item.destinationID ;\r\n },\r\n depDestFromString(str: string, splitBy: string){\r\n const separated = String(str).split(splitBy);\r\n if (separated.length >= 2){\r\n return {\r\n departureID: separated[0],\r\n destinationID: separated[1]\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport type VisibleLegsAction = {\r\n type: ActionType.SET_VISIBLE_LEGS,\r\n mode: 'objects',\r\n action: 'set' | 'add',\r\n payload: typeof DEFAULT_STATE.editor.visibleLegs\r\n} |\r\n{\r\n type: ActionType.SET_VISIBLE_LEGS,\r\n mode: 'strings',\r\n action: 'set' | 'add',\r\n payload: string[],\r\n splitBy: string\r\n}\r\n\r\nexport type VisibleLegsState = State['editor']['visibleLegs'];\r\n\r\nexport const VisibleLegsReducer: React.Reducer = (state, action) => produce(state, (draft) => {\r\n switch (action.type){\r\n case ActionType.SET_VISIBLE_LEGS:\r\n\r\n let visibleLegs: typeof DEFAULT_STATE.editor.visibleLegs = [];\r\n\r\n if (action.mode === 'objects'){\r\n visibleLegs = action.payload;\r\n }\r\n else if (action.mode === 'strings')\r\n {\r\n for (let locIDCombined of action.payload) {\r\n const separated = HelperFuncs.depDestFromString(locIDCombined, action.splitBy);\r\n if (separated){\r\n visibleLegs.push({\r\n departureID: separated.departureID,\r\n destinationID: separated.destinationID\r\n })\r\n }\r\n }\r\n }\r\n\r\n if (action.action === 'set'){\r\n return visibleLegs;\r\n }\r\n else\r\n {\r\n return unionBy(\r\n visibleLegs,\r\n state,\r\n HelperFuncs.depDestToString\r\n )\r\n }\r\n }\r\n})\r\n\r\nexport const Reducer: React.Reducer = (state, action) => {\r\n\r\n function _toScheduleNode(phase2ScheduleNode: Phase2ScheduleNode){\r\n return toScheduleNode(phase2ScheduleNode, state.formDataMap);\r\n }\r\n\r\n class StateValidation {\r\n public static setVisibleLegs(visibleLegs: typeof DEFAULT_STATE.editor.visibleLegs){\r\n return {\r\n ...state,\r\n editor: {\r\n ...state.editor,\r\n visibleLegs\r\n }\r\n }\r\n }\r\n public static addVisibleLegs(visibleLegs: typeof DEFAULT_STATE.editor.visibleLegs){\r\n return this.setVisibleLegs(\r\n unionBy(\r\n visibleLegs,\r\n state.editor.visibleLegs,\r\n this.depDestToString\r\n )\r\n )\r\n }\r\n public static depDestToString(item: { departureID: string, destinationID: string }, splitter: string='::'){\r\n return item.departureID + splitter + item.destinationID ;\r\n }\r\n public static depDestFromString(str: string, splitBy: string){\r\n const separated = String(str).split(splitBy);\r\n if (separated.length >= 2){\r\n return {\r\n departureID: separated[0],\r\n destinationID: separated[1]\r\n }\r\n }\r\n }\r\n private static _MUTABLE_validateSelectedEntities(state: State){\r\n // DO NOT USE OUTSIDE HelperFuncs.validateState!\r\n\r\n // Make sure pax/cgo assigned to a flight don't end up selected.\r\n state.editor.selectedEntityIds = state.editor.selectedEntityIds.filter(id => {\r\n return !!state.data.modifiedEntities.find(e => getSNodeID(_toScheduleNode(e)) === id && !e.currentCarrierID)\r\n })\r\n }\r\n public static validateState(state: State){\r\n return produce(state, (draft) => {\r\n this._MUTABLE_validateSelectedEntities(draft);\r\n })\r\n }\r\n }\r\n\r\n let nextState = getNextState();\r\n nextState = PurgeEntitiesFromFlightTool.Reducer(nextState, action);\r\n nextState = ScheduledToExpectedPaxCgo.Reducer(nextState, action);\r\n return StateValidation.validateState(nextState);\r\n\r\n function getNextState(){\r\n switch (action.type){\r\n // Data manipulation\r\n case ActionType.INIT_DATA:\r\n const entities = [...action.entities];\r\n entities.sort(Util.sortByScheduledOrder);\r\n\r\n const formDataMap: { [entityId: string]: Phase2EntityFormData } = {}\r\n\r\n entities.forEach((entity) => {\r\n formDataMap[entity._id] = createFormFields({\r\n chargeCode: entity.chargeCode\r\n })\r\n });\r\n\r\n let groupForm = DEFAULT_STATE.forms.groupForm;\r\n if (action.group){\r\n groupForm = Util.initFormData(action.group);\r\n }\r\n\r\n return {\r\n ...state,\r\n data: {\r\n // Deep copy initial entity list to ensure original stat is preserved\r\n originalEntities: cloneDeep(entities),\r\n modifiedEntities: entities,\r\n deletedEntities: []\r\n },\r\n formDataMap: formDataMap,\r\n forms: {\r\n ...state.forms,\r\n initGroupForm: groupForm,\r\n groupForm: groupForm\r\n }\r\n }\r\n\r\n case ActionType.RESET_DATA:\r\n // Reset data back to their original\r\n return {\r\n ...state,\r\n data: {\r\n ...state.data,\r\n modifiedEntities: state.data.originalEntities,\r\n deletedEntities: []\r\n }\r\n }\r\n\r\n // Forms\r\n case ActionType.RESET_FORM_DATA: {\r\n let newState = {...state};\r\n\r\n const resetData = (\r\n reset: boolean,\r\n formName: keyof typeof DEFAULT_STATE.forms) => {\r\n\r\n if (!reset) return;\r\n\r\n newState = {\r\n ...newState,\r\n forms: {\r\n ...newState.forms,\r\n [formName]: DEFAULT_STATE[formName]\r\n }\r\n }\r\n }\r\n\r\n resetData(action.group, 'groupForm');\r\n resetData(action.cargo, 'cargoForm');\r\n resetData(action.newLeg, 'newLegForm');\r\n\r\n return newState;\r\n }\r\n case ActionType.SET_ENTITY_FORM_DATA: {\r\n return {\r\n ...state,\r\n formDataMap: {\r\n ...state.formDataMap,\r\n [action.entityId]: {\r\n ...action.payload,\r\n chargeCode: {\r\n ...action.payload.chargeCode,\r\n value: formatChargeCode(action.payload.chargeCode?.value)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n case ActionType.SET_FORM_DATA: {\r\n let newState = {...state};\r\n\r\n if (action.cargo) {\r\n let initials = action.cargo.initials?.value;\r\n if (initials) {\r\n initials = String(initials).toUpperCase();\r\n }\r\n\r\n if (action.cargo.initials?.value) {\r\n action.cargo.initials.value = initials;\r\n } else {\r\n action.cargo.initials = createFormField(initials);\r\n }\r\n\r\n newState = {\r\n ...newState,\r\n forms: {\r\n ...newState.forms,\r\n cargoForm: action.cargo\r\n }\r\n }\r\n }\r\n\r\n if (action.group) {\r\n newState = {\r\n ...newState,\r\n forms: {\r\n ...newState.forms,\r\n groupForm: action.group\r\n }\r\n }\r\n }\r\n\r\n if (action.newLeg) {\r\n newState = {\r\n ...newState,\r\n forms: {\r\n ...newState.forms,\r\n newLegForm: action.newLeg\r\n }\r\n }\r\n }\r\n\r\n return newState;\r\n }\r\n\r\n case ActionType.SET_MODIFIED_ENTITIES: {\r\n let newState = {...state};\r\n\r\n if (action.set) {\r\n newState = {\r\n ...newState,\r\n data: {\r\n ...newState.data,\r\n modifiedEntities: action.set\r\n .map(Util.updateScheduledOrder)\r\n }\r\n }\r\n }\r\n\r\n if (action.remove) {\r\n newState = {\r\n ...newState,\r\n data: {\r\n ...newState.data,\r\n modifiedEntities: newState.data.modifiedEntities.filter(e => !action.remove.includes(getSNodeID(_toScheduleNode(e))))\r\n .map(Util.updateScheduledOrder),\r\n deletedEntities: unionBy(\r\n // Make sure we aren't adding 'new' entities to the deleted list.\r\n // New entities being ones added by the user that weren't in the list originally.\r\n newState.data.originalEntities.filter(e => action.remove.includes(getSNodeID(_toScheduleNode(e)))),\r\n\r\n newState.data.deletedEntities,\r\n e => getSNodeID(_toScheduleNode(e))\r\n )\r\n },\r\n editor: {\r\n ...newState.editor,\r\n // Clear deleted items from the selection list\r\n selectedEntityIds: difference(newState.editor.selectedEntityIds, action.remove)\r\n }\r\n }\r\n }\r\n\r\n if (action.add) {\r\n\r\n let newEntities: Phase2ScheduleNode[] = unionBy(\r\n newState.data.modifiedEntities,\r\n action.add,\r\n (e) => getSNodeID(_toScheduleNode(e))\r\n );\r\n\r\n if (newEntities.length === newState.data.modifiedEntities.length) {\r\n\r\n // Workaround for editing existing entities weight values not working.\r\n newEntities.forEach((e: Phase2ScheduleNode, i: number) => {\r\n action.add.forEach(actionE => {\r\n if (getSNodeID(_toScheduleNode(e)) === getSNodeID(actionE as ScheduleNode)) {\r\n newEntities[i] = actionE;\r\n }\r\n })\r\n })\r\n\r\n // No new entities were added. Preserve their scheduledOrder.\r\n // Needed to do this because \"editing\" a passenger uses this, and it kept changing their order.\r\n newEntities.sort(Util.sortByScheduledOrder);\r\n } else {\r\n // Use to sort pax and cgo into groups\r\n const legs = Util.DepDestList.build(newEntities);\r\n\r\n let sorted = [];\r\n for (let leg of legs) {\r\n sorted = sorted.concat(leg.pax, leg.cgo);\r\n }\r\n\r\n newEntities = sorted.map(Util.updateScheduledOrder);\r\n\r\n // Check each cargo that was added. If one of the cargos has the same name as in the cargo form,\r\n // clear the cargo form.\r\n newEntities.forEach(entity => {\r\n if (entity.classType === 'flytsuite.cgonode' && (entity as ScheduledCgoNode).name === state.forms.cargoForm.name?.value) {\r\n newState = {\r\n ...newState,\r\n forms: {\r\n ...newState.forms,\r\n cargoForm: DEFAULT_STATE.forms.cargoForm\r\n }\r\n }\r\n }\r\n })\r\n }\r\n\r\n // Recalculate transitTypes\r\n newEntities = newEntities\r\n .map(entity => ({\r\n ...entity,\r\n transitType: getTransitType(entity.departureID, entity.destinationID)\r\n }))\r\n\r\n newState = {\r\n ...newState,\r\n editor: {\r\n ...newState.editor,\r\n visibleLegs: VisibleLegsReducer(state.editor.visibleLegs, {\r\n type: ActionType.SET_VISIBLE_LEGS,\r\n action: 'add',\r\n mode: 'objects',\r\n payload: action.add.map(p => (\r\n {\r\n departureID: p.departureID?._id,\r\n destinationID: p.destinationID?._id\r\n }\r\n ))\r\n })\r\n },\r\n carriableSelector: {\r\n ...newState.carriableSelector,\r\n selectedPersonnelIds: difference(\r\n newState.carriableSelector.selectedPersonnelIds,\r\n action.add.map((p: Phase2ScheduledPaxNode) => p.personID?._id)\r\n )\r\n },\r\n data: {\r\n ...newState.data,\r\n modifiedEntities: newEntities\r\n }\r\n }\r\n }\r\n\r\n return newState;\r\n }\r\n\r\n // Query status\r\n case ActionType.SET_QUERY_STATUS:\r\n return {\r\n ...state,\r\n queryStatus: action.payload\r\n }\r\n\r\n // Save status\r\n case ActionType.SET_SAVE_STATUS:\r\n return {\r\n ...state,\r\n saveStatus: action.payload\r\n }\r\n case ActionType.DISMISS_SAVE_STATUS:\r\n return {\r\n ...state,\r\n saveStatus: undefined\r\n }\r\n\r\n case ActionType.SET_SELECTED_PERSONNEL_IDS:\r\n return {\r\n ...state,\r\n carriableSelector: {\r\n ...state.carriableSelector,\r\n selectedPersonnelIds: action.payload\r\n }\r\n }\r\n case ActionType.SET_CARRIABLE_SELECTOR_TAB:\r\n return {\r\n ...state,\r\n carriableSelector: {\r\n ...state.carriableSelector,\r\n upperTab: action.payload.upperTab,\r\n lowerTab: action.payload.lowerTab\r\n }\r\n }\r\n case ActionType.SET_EDIT_MODE:\r\n return {\r\n ...state,\r\n editMode: action.payload,\r\n saveStatus: action.payload === true ? undefined : state.saveStatus,\r\n editor: {\r\n ...state.editor,\r\n selectedEntityIds: []\r\n }\r\n }\r\n case ActionType.SET_CARRIABLE_SEL_SEARCH:\r\n return {\r\n ...state,\r\n carriableSelector: {\r\n ...state.carriableSelector,\r\n searchForm: action.payload\r\n }\r\n }\r\n\r\n // If payload is undefined, then this state will toggle\r\n case ActionType.SET_HIDE_CARRIABLE_PANEL:\r\n return {\r\n ...state,\r\n carriableSelector: {\r\n ...state.carriableSelector,\r\n hidePanel: action.payload === undefined ? !state.carriableSelector.hidePanel : action.payload\r\n }\r\n }\r\n\r\n // Editor\r\n case ActionType.SET_SELECTED_ENTITY_IDS:\r\n if (!action.add && !action.remove && !action.set) return;\r\n\r\n let newSelEntityIds = state.editor.selectedEntityIds;\r\n\r\n if (action.set){\r\n newSelEntityIds = action.set;\r\n }\r\n if (action.remove){\r\n newSelEntityIds = difference(newSelEntityIds, action.remove);\r\n }\r\n if (action.add){\r\n newSelEntityIds = union(newSelEntityIds, action.add);\r\n }\r\n\r\n return {\r\n ...state,\r\n editor: {\r\n ...state.editor,\r\n selectedEntityIds: newSelEntityIds\r\n }\r\n }\r\n\r\n case ActionType.CLEAR_CHARGE_CODES:\r\n return produce(state, (draft) => {\r\n const clearEntityChargeCode = (entity: Phase2ScheduleNode) => {\r\n const foundFormData = state.formDataMap[entity._id];\r\n if (foundFormData && typeof foundFormData === 'object'){\r\n draft.formDataMap[entity._id].chargeCode = null;\r\n }\r\n }\r\n\r\n state.data.modifiedEntities.forEach(clearEntityChargeCode);\r\n })\r\n case ActionType.SET_DEFAULT_CHARGE_CODE:\r\n return {\r\n ...state,\r\n editor: {\r\n ...state.editor,\r\n defaultChargeCode: formatChargeCode(action.payload)\r\n }\r\n }\r\n case ActionType.SET_LEG_SELECTOR:\r\n return {\r\n ...state,\r\n carriableSelector: {\r\n ...state.carriableSelector,\r\n legSelector: {\r\n ...state.carriableSelector.legSelector,\r\n departure: action.payload.departure,\r\n destination: action.payload.destination\r\n }\r\n }\r\n }\r\n case ActionType.SET_ISN_DRAWER:\r\n return {\r\n ...state,\r\n editor: {\r\n ...state.editor,\r\n isnDrawer: {\r\n pax: action.payload.pax,\r\n visible: action.payload.visible\r\n }\r\n }\r\n }\r\n case ActionType.SET_VISIBLE_LEGS:\r\n return {\r\n ...state,\r\n editor: {\r\n ...state.editor,\r\n visibleLegs: VisibleLegsReducer(state.editor.visibleLegs, action)\r\n }\r\n }\r\n\r\n // Modals\r\n case ActionType.SET_PAXNODE_MODAL:\r\n\r\n let paxModal = {\r\n visible: action.visible !== undefined ? action.visible : state.modal.paxModal.visible,\r\n pax: action.pax !== undefined ? action.pax : state.modal.paxModal.pax\r\n }\r\n\r\n if (!paxModal.pax && paxModal.visible){\r\n // Can't be visible without pax data\r\n paxModal.visible = false;\r\n }\r\n\r\n return {\r\n ...state,\r\n modal: {\r\n ...state.modal,\r\n paxModal: paxModal\r\n }\r\n }\r\n case ActionType.SET_NEW_LEG_MODAL:\r\n\r\n let newLegForm = state.forms.newLegForm;\r\n if (action.newLegValue){\r\n newLegForm = {\r\n ...newLegForm,\r\n depDest: createFormField({\r\n departure: action.newLegValue.departure,\r\n destination: action.newLegValue.destination\r\n })\r\n }\r\n }\r\n\r\n return {\r\n ...state,\r\n modal: {\r\n ...state.modal,\r\n newLegFormModal: {\r\n ...state.modal.newLegFormModal,\r\n // Callback must be cleared if the modal is made non-visible\r\n callback: action.visible ? action.callback : null,\r\n visible: action.visible\r\n }\r\n },\r\n forms: {\r\n ...state.forms,\r\n newLegForm: newLegForm\r\n }\r\n }\r\n case ActionType.NOTES_FOR_PILOT_POPUP: {\r\n\r\n let entityId = action.entityId;\r\n\r\n if (action.action.type === 'EDIT_MODE' && !action.action.value) {\r\n // User is leaving edit mode. entityId can be cleared.\r\n entityId = null;\r\n }\r\n\r\n if (\r\n state.notesForPilotPopup.entityId !== action.entityId &&\r\n state.notesForPilotPopup.editMode\r\n ){\r\n // Cannot cancel editing of another while in edit mode.\r\n return state;\r\n }\r\n\r\n let newState = cloneDeep(state.notesForPilotPopup);\r\n\r\n newState = {\r\n ...newState,\r\n ...NotesForPilot.QuickEdit.Reducer(state.notesForPilotPopup, action.action)\r\n }\r\n\r\n // If the entityId is changed, reset the text states.\r\n if (action.entityId !== state.notesForPilotPopup.entityId){\r\n\r\n const origText = (state.data.modifiedEntities\r\n .find(entity => getSNodeID(entity as ScheduleNode) === entityId)?.notesForPilot) || '';\r\n\r\n newState = {\r\n ...newState,\r\n originalText: origText,\r\n modifiedText: origText\r\n }\r\n }\r\n\r\n return {\r\n ...state,\r\n notesForPilotPopup: {\r\n ...newState,\r\n entityId: entityId\r\n }\r\n }\r\n }\r\n case ActionType.NOTES_FOR_PILOT_EDITOR:\r\n {\r\n return produce(state, (newState) => {\r\n if (action.action){\r\n newState.notesForPilotEditor.state = NotesForPilot.Editor.Reducer(state.notesForPilotEditor.state, action.action);\r\n }\r\n\r\n // if (action.action.type === 'INIT' && state.notesForPilotEditor.open){\r\n // // Prevent spurious inits from triggering while open\r\n // newState.notesForPilotEditor.state = {...state.notesForPilotEditor.state};\r\n // }\r\n\r\n if (action.open !== undefined){\r\n newState.notesForPilotEditor.open = Boolean(action.open);\r\n }\r\n\r\n if (action.open === false){\r\n // Reset data when closed\r\n newState.notesForPilotEditor.state = NotesForPilot.Editor\r\n .Reducer(newState.notesForPilotEditor.state, { type: 'RESET' });\r\n }\r\n })\r\n }\r\n case ActionType.SUBMIT_NOTES_FOR_PILOT_EDITOR:\r\n {\r\n return produce(state, (newState) => {\r\n\r\n newState.data.modifiedEntities = newState.data.modifiedEntities\r\n .map(entity => (\r\n {\r\n ...entity,\r\n notesForPilot: (\r\n NotesForPilot.Editor.Util\r\n .getEntityNoteMsg(entity as ScheduleNode, newState.notesForPilotEditor.state)\r\n )\r\n }\r\n ))\r\n\r\n newState.notesForPilotEditor.state = NotesForPilot\r\n .Editor\r\n .Reducer(newState.notesForPilotEditor.state, {\r\n type: 'INIT',\r\n entities: newState.data.modifiedEntities as ScheduleNode[]\r\n });\r\n\r\n newState.notesForPilotEditor.open = false;\r\n })\r\n }\r\n default:\r\n return state;\r\n }\r\n }\r\n}\r\n\r\nexport interface ContextType {\r\n api: Phase2Api\r\n}\r\n\r\nexport const Context = React.createContext(null);\r\nexport const Provider = Context.Provider;","import {Phase2Api} from \"../api\";\r\nimport {useApolloClient} from \"react-apollo\";\r\nimport {SET_STATUS} from \"./action\";\r\nimport {ScheduledToExpectedPaxCgoMutation} from \"./graphql\";\r\nimport {getSelectedEntities} from \"./util\";\r\n\r\nexport function useMutationDispatcher(api: Phase2Api){\r\n const apolloClient = useApolloClient();\r\n\r\n const dispatch = api.getDispatch();\r\n\r\n return async function start(){\r\n\r\n dispatch({ type: SET_STATUS, payload: { status: 'LOADING' } });\r\n\r\n try {\r\n\r\n const entities = getSelectedEntities(api);\r\n\r\n const pax = entities.filter((e) => e.classType === 'flytsuite.paxnode');\r\n const cgo = entities.filter((e) => e.classType === 'flytsuite.cgonode');\r\n\r\n await apolloClient.mutate({\r\n mutation: ScheduledToExpectedPaxCgoMutation,\r\n variables: {\r\n paxIDs: pax.map((p) => p._id),\r\n cgoIDs: cgo.map((c) => c._id)\r\n }\r\n })\r\n\r\n dispatch({ type: SET_STATUS, payload: { status: 'SUCCESS' } });\r\n }\r\n catch (error){\r\n console.error('Failed to convert pax/cgo to expected:', error);\r\n dispatch({ type: SET_STATUS, payload: { status: 'ERROR' , error: error } });\r\n throw error;\r\n }\r\n\r\n }\r\n}","import {useEffect, useState} from \"react\";\r\nimport {LocationSelect} from \"components/form/select/LocationSelect\";\r\nimport {Button, Tooltip} from \"antd\";\r\nimport './style.less';\r\nimport {SelectProps} from \"antd/lib/select\";\r\nimport {ValidationRule} from \"antd/lib/form\";\r\n\r\nexport interface DepDestSelectValue {\r\n departure: { key: string, label: string } | null,\r\n destination: { key: string, label: string } | null\r\n}\r\n\r\nexport interface DepDestSelectProps {\r\n value?: DepDestSelectValue,\r\n onChange?: (value: DepDestSelectValue) => void,\r\n showSwap?: boolean,\r\n size?: 'small' | 'large' | 'default',\r\n departureSelectProps?: SelectProps,\r\n destinationSelectProps?: SelectProps\r\n}\r\n\r\ntype DepDestSelectType = React.FC & { validator: typeof validate}\r\n\r\nconst DEFAULT_VALUE = {\r\n departure: null,\r\n destination: null\r\n}\r\n\r\nconst BASE_CLS = 'dep-dest-select';\r\n\r\nconst DepDestSelect: DepDestSelectType = (props) => {\r\n\r\n const [ _state, _setState ] = useState(DEFAULT_VALUE);\r\n\r\n const controlledMode = props.value !== undefined;\r\n\r\n let state = _state;\r\n\r\n if (controlledMode){\r\n state = props.value;\r\n }\r\n\r\n function setState(newState: DepDestSelectValue){\r\n if (controlledMode && props.onChange){\r\n props.onChange(newState);\r\n return\r\n }\r\n\r\n _setState(newState);\r\n }\r\n\r\n function handleSelectChange(fieldName: keyof DepDestSelectValue, value: { key: string, label: string }){\r\n const newState = { ...state, [fieldName]: value }\r\n setState(newState);\r\n }\r\n\r\n function clear(){\r\n setState(DEFAULT_VALUE);\r\n }\r\n\r\n function swap(){\r\n setState({\r\n departure: state.destination,\r\n destination: state.departure\r\n })\r\n }\r\n\r\n return (\r\n
    \r\n handleSelectChange('departure', value)}\r\n labelInValue\r\n />\r\n handleSelectChange('destination', value)}\r\n labelInValue\r\n />\r\n \r\n \r\n \r\n
    \r\n )\r\n\r\n}\r\n\r\nDepDestSelect.defaultProps = {\r\n showSwap: true\r\n}\r\n\r\nfunction validate(rules: ValidationRule, value: any, callback: (msg?: React.ReactNode) => void){\r\n console.log('validating');\r\n\r\n // Dep and dest are filled out\r\n const isComplete = !!(value?.departure && value?.destination)\r\n\r\n if (!isComplete && rules.required){\r\n callback(rules.message || 'Please choose a departure and destination.');\r\n return;\r\n }\r\n\r\n // All is good\r\n callback();\r\n}\r\n\r\nDepDestSelect.validator = validate;\r\n\r\nexport default DepDestSelect;","import DepDestSelect from \"./dep-dest-select\";\r\nexport default DepDestSelect;","import React, {MutableRefObject, useContext, useEffect, useRef} from 'react';\r\nimport * as Phase2State from './state';\r\nimport {DEFAULT_STATE, State} from './state';\r\nimport {Button, Col, Divider, Form, Icon, Input, Radio, Row, Select, Tabs} from \"antd\";\r\nimport PersonSearch from \"../../../../components/search/PersonSearch\";\r\nimport PersonSearchByCred from \"../../../../components/search/PersonSearchByCred\";\r\nimport {Person} from \"common/types/carriable\";\r\nimport './phase-2-scheduler.less';\r\nimport * as Util from \"./util\";\r\nimport {LocationSelect} from \"../../../../components/form/select/LocationSelect\";\r\nimport CargoForm from \"../../../../components/form/CargoForm\";\r\nimport {FormErrors, formItemLayout} from \"../../../../common/form\";\r\nimport {formTouched} from \"./util\";\r\nimport {CargoFormData} from \"./types\";\r\nimport DepDestSelect from \"components/form/select/dep-dest-select\";\r\n\r\nconst BASE_CLS = Util.BASE_CLS;\r\n\r\nexport interface CarriableSelectorProps {\r\n cargoFormRef: MutableRefObject\r\n}\r\n\r\nconst CarriableSelector: React.FC = (props) => {\r\n\r\n const { api } = useContext(Phase2State.Context);\r\n const cargoFormRef = useRef(null);\r\n\r\n let personSearchContent = null;\r\n let tabBarExtra = null;\r\n\r\n const searchFormValues = api.forms.searchForm.get();\r\n\r\n const { upperTab, lowerTab } = api.carriableSelector.tabs.get();\r\n\r\n if (upperTab === 'personSearch'){\r\n tabBarExtra = (\r\n {\r\n let lowerT = e.target.value as typeof DEFAULT_STATE.carriableSelector.lowerTab;\r\n api.carriableSelector.tabs.set(upperTab, lowerT);\r\n }}\r\n >\r\n By Name\r\n By ID\r\n \r\n )\r\n }\r\n\r\n if (lowerTab === 'byName'){\r\n personSearchContent = (\r\n \r\n )\r\n }\r\n else if (lowerTab === 'byId'){\r\n personSearchContent = (\r\n \r\n )\r\n }\r\n\r\n let selectedPersonnelSelector = Please select a person;\r\n if (api.selection.personnelIds.get().length) {\r\n selectedPersonnelSelector = (\r\n api.selection.personnelIds.set(val.map(val => val?.key))}\r\n value={\r\n api.selection.personnelIds.getAsObjects()?.objects?.map((per) => {\r\n return {\r\n key: per._id,\r\n label: `${per.lastName}, ${per.firstName}`\r\n }\r\n })\r\n }\r\n >\r\n {api.selection.personnelIds.getAsObjects()?.objects?.map((per) => {\r\n return {`${per.lastName}, ${per.firstName}`}\r\n })}\r\n \r\n )\r\n }\r\n\r\n const departureValue = api.carriableSelector.legSelector.get().departure;\r\n const destinationValue = api.carriableSelector.legSelector.get().destination;\r\n\r\n const addUI = (\r\n \r\n \r\n (\r\n api.carriableSelector.legSelector.set(value?.departure, value?.destination)\r\n )}\r\n />\r\n \r\n \r\n {upperTab === 'personSearch' ? (\r\n api.selection.personnelIds.addToSchedule(departureValue?.key, destinationValue?.key)}\r\n >\r\n Add\r\n \r\n ) : (\r\n {\r\n api.forms.cargoForm.submit(\r\n departureValue?.key,\r\n destinationValue?.key\r\n )\r\n }}\r\n >\r\n Add\r\n \r\n )}\r\n\r\n \r\n \r\n );\r\n\r\n return (\r\n
    \r\n {\r\n api.carriableSelector.tabs.set(key as State['carriableSelector']['upperTab'], lowerTab);\r\n }}\r\n tabBarExtraContent={tabBarExtra}\r\n style={{\r\n height: '100%'\r\n }}\r\n >\r\n \r\n {personSearchContent}\r\n
    \r\n
    \r\n Adding {api.selection.personnelIds.get().length} personnel\r\n {api.selection.personnelIds.get().length ? (\r\n \r\n Clear All\r\n \r\n ) : null}\r\n
    \r\n \r\n \r\n {selectedPersonnelSelector}\r\n \r\n \r\n {addUI}\r\n
    \r\n
    \r\n \r\n {\r\n cargoFormRef.current = ref;\r\n if (props.cargoFormRef) {\r\n props.cargoFormRef.current = ref;\r\n }\r\n }}\r\n useFields={[\r\n 'name',\r\n 'weight',\r\n 'hazmat',\r\n 'hazmatUnCode',\r\n 'attentionTo',\r\n 'notes'\r\n ]}\r\n renderExtra={(form) => {\r\n return \r\n {form.getFieldDecorator('initials', {\r\n rules: [{ required: true, message: 'Initials is required' }]\r\n })()}\r\n \r\n }}\r\n onFieldsChange={api.forms.cargoForm.setFields}\r\n fields={api.forms.cargoForm.get()}\r\n />\r\n \r\n
    \r\n {addUI}\r\n
    \r\n \r\n \r\n
    \r\n )\r\n}\r\n\r\nexport default CarriableSelector;","import React, { CSSProperties } from 'react';\r\nimport { Form, DatePicker, Input } from 'antd';\r\nimport { FormComponentProps, FormProps } from 'antd/lib/form';\r\nimport { LocationSelect } from 'components/form/select/LocationSelect';\r\nimport {createFormFields} from 'common/form';\r\nimport moment from 'moment';\r\n\r\nexport interface IGroupFormProps extends FormComponentProps {\r\n formElementProps?: FormProps,\r\n disabled?: boolean,\r\n formData?: any,\r\n onFieldsChange?(fields: any): void,\r\n onValuesChange?(values: any): void\r\n}\r\n\r\nlet selectStyle: CSSProperties = {\r\n minWidth: '10rem'\r\n}\r\n\r\nconst GroupForm: React.FC = React.forwardRef((props, ref: React.LegacyRef
    ) => {\r\n const { getFieldDecorator } = props.form;\r\n let formElement = \r\n \r\n {getFieldDecorator('date', {\r\n rules: [\r\n { required: true, message: 'You must enter a flight date' }\r\n ]\r\n })( current && current < moment().startOf('day')} />)}\r\n \r\n \r\n {getFieldDecorator('name', {\r\n rules: [\r\n { required: true, message: 'You must enter a group name' }\r\n ]\r\n })( {\r\n e.target.value = e.target.value.trimStart().replace(/[^\\S ]/gm, '')}} disabled={props.disabled} />)}\r\n \r\n \r\n {getFieldDecorator('lastKnownController', {\r\n rules: [\r\n { required: true, message: 'You must enter a controlling heliport' }\r\n ]\r\n })(\r\n )}\r\n \r\n
    \r\n return formElement\r\n})\r\n\r\nexport default Form.create({\r\n mapPropsToFields(props){\r\n if (!props.formData) return undefined\r\n return createFormFields(props.formData);\r\n },\r\n onFieldsChange(props, _, fields){\r\n if (props.onFieldsChange){\r\n props.onFieldsChange(fields);\r\n }\r\n },\r\n onValuesChange(props, _, values){\r\n if (props.onValuesChange){\r\n props.onValuesChange(values);\r\n }\r\n }\r\n})(GroupForm)","import {CgoNode, PaxNode} from \"../../../common/types/carriable\";\r\n\r\nexport function calcTotalWeight(entities: (PaxNode | CgoNode)[]): number {\r\n\r\n function reducer(currWt: number, entity: PaxNode | CgoNode){\r\n if (entity.classType === 'flytsuite.paxnode'){\r\n return currWt + (entity.paxWeight || 0) + (entity.bagWeight || 0);\r\n }\r\n else if (entity.classType === 'flytsuite.cgonode'){\r\n return currWt + (entity.weight || 0)\r\n }\r\n return currWt;\r\n }\r\n\r\n return entities.reduce(reducer, 0);\r\n}\r\n\r\nexport function calcBagWeight(pax: PaxNode[]){\r\n\r\n function reducer(prevWeight: number, node: PaxNode){\r\n if (node.classType === 'flytsuite.paxnode'){\r\n return prevWeight + node.bagWeight;\r\n }\r\n return prevWeight;\r\n }\r\n\r\n return pax.reduce(reducer, 0);\r\n}\r\n\r\nexport function calcBagCount(pax: PaxNode[]){\r\n\r\n function reducer(prevCount: number, node: PaxNode){\r\n if (node.classType === 'flytsuite.paxnode'){\r\n return prevCount + node.bagCount;\r\n }\r\n return prevCount;\r\n }\r\n\r\n return pax.reduce(reducer, 0);\r\n}","import {\r\n Badge,\r\n Button,\r\n Collapse,\r\n Divider,\r\n Drawer,\r\n Dropdown, Form,\r\n Icon,\r\n Input,\r\n InputNumber,\r\n Menu,\r\n Modal,\r\n Popconfirm,\r\n Tooltip\r\n} from \"antd\";\r\nimport {BASE_CLS, formatChargeCode, toScheduleNode} from \"./util\";\r\nimport React, {useCallback, useContext, useEffect} from \"react\";\r\nimport * as Phase2State from './state';\r\nimport {DepDestListItem, Phase2EntityFormData, Phase2ScheduleNode} from \"./types\";\r\nimport ETable, {ETableProps} from \"../../../../components/enchanced-antd-table\";\r\nimport IsnCheckStatusButton from \"../../../../components/IsnCheckStatusButton\";\r\nimport {PaxISNWithData} from \"../../../../components/isn/PaxISN\";\r\nimport {PassengerEditor} from \"../../../../components/PassengerEditor\";\r\nimport NonIdealState from \"../../../../components/NonIdealState\";\r\nimport MCIcon from \"../../../../components/icon\";\r\nimport {stopPropagationProps} from \"../../../../common/util-ts\";\r\nimport {Location} from \"../../../../common/types/location\";\r\nimport {useHistory} from \"react-router-dom\";\r\nimport {\r\n approximateLegRouteColumnWidth,\r\n LegRoute\r\n} from \"../../../../components/flights/scheduling/util\";\r\nimport {calcBagCount, calcBagWeight, calcTotalWeight} from \"../../../../components/flights/scheduling/math\";\r\nimport {getTransitType} from \"../../../../common/carriable/util\";\r\nimport * as NotesForPilot from \"../../../../components/flights/scheduling/notes-for-pilot\";\r\nimport {Phase2Api} from \"./api\";\r\nimport {ScheduledCgoNode, ScheduledPaxNode, ScheduleNode} from \"../../../../components/scheduling/types\";\r\nimport {getSNodeID} from \"../../../../components/scheduling/util\";\r\nimport {FormComponentProps} from \"antd/lib/form\";\r\nimport {createFormField, FormItemClassNames} from \"../../../../common/form\";\r\nimport {createChargeCodeValidator} from \"./validation\";\r\nimport {ColumnProps} from \"antd/lib/table\";\r\n\r\nexport interface Phase2TableProps {\r\n containerElement?: HTMLElement,\r\n disableEditing?: boolean,\r\n allowSelection?: boolean,\r\n api: Phase2Api,\r\n modifyPaxColumns?: (api: Phase2Api, columns: ColumnProps[]) => ColumnProps[],\r\n modifyCgoColumns?: (api: Phase2Api, columns: ColumnProps[]) => ColumnProps[],\r\n onRow?: ETableProps['onRow']\r\n}\r\n\r\ntype Phase2TablePropsWithForm = FormComponentProps<{ [entityId: string]: Phase2EntityFormData }>\r\n & Phase2TableProps\r\n\r\nfunction createFormFieldKey(entityId: string, fieldName: string){\r\n return entityId + '::' + fieldName;\r\n}\r\n\r\nfunction splitFormFieldKey(formFieldKey: string){\r\n const elements = formFieldKey.split('::');\r\n\r\n if (elements.length == 2){\r\n return {\r\n entityId: elements[0],\r\n fieldName: elements[1]\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction NotesForPilotWrapper(props: {\r\n api: Phase2Api,\r\n entity: ScheduleNode,\r\n popupContainer: HTMLElement,\r\n disableEditing?: boolean\r\n}){\r\n\r\n const { api, entity, popupContainer } = props;\r\n const note = entity.notesForPilot;\r\n const noteMap = api.data.getNotesForPilot();\r\n\r\n const entitiesWithNote = (note ? noteMap[note] : undefined) || [];\r\n const editMode = props.disableEditing ? false : api.editMode.get();\r\n\r\n const renderAccept: NotesForPilot.QuickEdit.QuickEditProps['renderAccept'] =\r\n ({ onConfirm, buttonProps }) => {\r\n\r\n function handleConfirm(updateAllWithNote?: boolean){\r\n\r\n if (!entity){\r\n return;\r\n }\r\n\r\n let newEntities: ScheduleNode[] = [];\r\n\r\n function updateEntity(entity: ScheduleNode){\r\n return {\r\n ...entity,\r\n notesForPilot: api.notesForPilot.getModifiedText()\r\n }\r\n }\r\n\r\n if (updateAllWithNote){\r\n const oldNote = entity.notesForPilot;\r\n\r\n const noteMap = api.data.getNotesForPilot();\r\n if (!noteMap[oldNote]){\r\n return;\r\n }\r\n\r\n newEntities = noteMap[oldNote].map(updateEntity)\r\n }\r\n else\r\n {\r\n newEntities = [updateEntity(entity)];\r\n }\r\n\r\n api.data.modifiedEntities.add(newEntities);\r\n onConfirm();\r\n }\r\n\r\n if (entitiesWithNote.length > 1){\r\n const overlay = (\r\n \r\n handleConfirm()}\r\n >Update this item only\r\n {\r\n Modal.confirm({\r\n title: 'Review affected items',\r\n content: <>\r\n

    The following PAX/CGO will have their pilot notes changed:

    \r\n
      \r\n {entitiesWithNote.map(entity => {\r\n if (entity.classType === 'flytsuite.paxnode'){\r\n const pax = entity as ScheduledPaxNode;\r\n return
    • {pax.lastName}, {pax.firstName}
    • \r\n }\r\n else\r\n {\r\n const cgo = entity as ScheduledCgoNode;\r\n return
    • {cgo.name}
    • \r\n }\r\n })}\r\n
    \r\n ,\r\n okText: `Update ${entitiesWithNote.length} items`,\r\n onOk: () => handleConfirm(true)\r\n })\r\n }}\r\n >Update {entitiesWithNote.length} items\r\n
    \r\n )\r\n\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n\r\n return (\r\n handleConfirm()}\r\n />\r\n );\r\n }\r\n\r\n const readOnly = Boolean(entity.currentCarrierID) || !editMode;\r\n\r\n return (\r\n \r\n )\r\n}\r\n\r\nconst Phase2TableBase: React.FC = (props) => {\r\n\r\n // Hooks -----------------------------------------------------------------------------------------------------------\r\n const { api } = props;\r\n const history = useHistory();\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Event handlers---------------------------------------------------------------------------------------------------\r\n function handleCellEdit(entityId: string, fieldKey: string, value: any) {\r\n api.data.modifyEntity(entityId, { [fieldKey]: value });\r\n }\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // State helpers ---------------------------------------------------------------------------------------------------\r\n const hasSelectedPersonnel = !!api.selection.personnelIds.get().length;\r\n const editMode = props.disableEditing ? false : api.editMode.get();\r\n const selectionEnabled = editMode || props.allowSelection;\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n const data = api.data.getLegs();\r\n\r\n const entityCount = data.reduce((count, leg) => {\r\n return count + leg.all.length\r\n }, 0)\r\n\r\n // Utils -----------------------------------------------------------------------------------------------------------\r\n const legRouteColumnWidth = approximateLegRouteColumnWidth(\r\n data.map((item) => ({\r\n departureName: item.departure?.name,\r\n destinationName: item.destination?.name\r\n }))\r\n );\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n function renderPanel(item: DepDestListItem){\r\n\r\n const selectedItems = item.all\r\n .filter((entity) => api.selection.entityIds.get().includes(getSNodeID(api.toScheduleNode(entity))));\r\n\r\n const itemsOnFlight = item.all\r\n .filter((entity) => entity.currentCarrierID);\r\n\r\n const depName = item.departure?.name;\r\n const destName = item.destination?.name;\r\n\r\n const pax = item.pax;\r\n const cgo = item.cgo;\r\n\r\n const totWt = calcTotalWeight(item.all.map(api.toScheduleNode));\r\n const totPaxWt = calcTotalWeight(item.pax);\r\n const totCgoWt = calcTotalWeight(item.cgo);\r\n\r\n const totBagWt = calcBagWeight(item.pax);\r\n const totBagCt = calcBagCount(item.pax);\r\n\r\n let tooltipTitle = 'Click to show table';\r\n if (api.editor.visibleLegs.isLegVisible(item.departure._id, item.destination._id)){\r\n tooltipTitle = 'Click to hide table';\r\n }\r\n\r\n const tooltipContent = <>\r\n

    {tooltipTitle}

    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    PAX{pax.length}
    CGO{cgo.length}
    Transit{getTransitType(item.departure, item.destination)}
    Total Weight{totWt}
    Total PAX Weight{totPaxWt}
    Total CGO Weight{totCgoWt}
    Total Bag Weight{totBagWt}
    Total Bag Count{totBagCt}
    \r\n \r\n\r\n const header = (\r\n \r\n {selectedItems.length ? (\r\n \r\n
    \r\n \r\n
    \r\n
    \r\n ) : null}\r\n {itemsOnFlight.length && !selectedItems.length ? (\r\n \r\n
    \r\n \r\n
    \r\n
    \r\n ) : null}\r\n \r\n \r\n \r\n \r\n {getTransitType(item.departure, item.destination)}\r\n \r\n \r\n {pax.length} PAX\r\n \r\n {cgo.length} CGO\r\n \r\n \r\n Totals:\r\n {totWt} Wt\r\n \r\n {totPaxWt} Pax Wt\r\n \r\n {totCgoWt} Cgo Wt\r\n \r\n {totBagWt} Bag Wt\r\n \r\n {totBagCt} Bag Ct\r\n \r\n \r\n )\r\n\r\n const deleteBtn = (\r\n {\r\n api.data.removeLeg(item.departure._id, item.destination._id);\r\n }}\r\n placement=\"left\"\r\n >\r\n {\r\n e.stopPropagation();\r\n }}\r\n />\r\n \r\n )\r\n\r\n let addBtn = null;\r\n if (hasSelectedPersonnel && api.carriableSelector.tabs.get().upperTab === 'personSearch'){\r\n addBtn = (\r\n api.selection.personnelIds.addToSchedule(\r\n item.departure._id,\r\n item.destination._id\r\n )}\r\n >Add {api.selection.personnelIds.get().length} PAX\r\n )\r\n }\r\n else if (api.carriableSelector.tabs.get().upperTab === 'cargoForm'){\r\n addBtn = (\r\n {\r\n e.stopPropagation();\r\n api.forms.cargoForm.submit(\r\n item.departure._id,\r\n item.destination._id\r\n )\r\n }}\r\n >Add Cargo\r\n )\r\n }\r\n\r\n const reorderBtns = (\r\n \r\n \r\n = entityCount-1}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n api.data.swapLegs(item, 'down');\r\n }}\r\n />\r\n \r\n \r\n {\r\n e.stopPropagation();\r\n api.data.swapLegs(item, 'up');\r\n }}\r\n />\r\n \r\n \r\n )\r\n\r\n let moreBtn: JSX.Element;\r\n\r\n {\r\n const overlay = (\r\n \r\n {\r\n clickParam.domEvent.stopPropagation();\r\n api.editor.visibleLegs.show(item.departure?._id, item.destination?._id);\r\n api.selection.entityIds.add(item.all.map(e => getSNodeID(api.toScheduleNode(e))));\r\n }}\r\n >\r\n Select all\r\n \r\n {\r\n clickParam.domEvent.stopPropagation();\r\n api.selection.entityIds.remove(item.all.map(e => getSNodeID(api.toScheduleNode(e))));\r\n }}\r\n >\r\n De-select all\r\n \r\n \r\n {\r\n clickParam.domEvent.stopPropagation();\r\n const entityIds = item.all.map(e => getSNodeID(api.toScheduleNode(e)));\r\n api.data.setEntityLegs(\r\n entityIds,\r\n item.destination,\r\n item.departure\r\n );\r\n }}\r\n >\r\n Swap departure & destination\r\n \r\n \r\n {\r\n clickParam.domEvent.stopPropagation();\r\n const callback = (departure: Location, destination: Location) => {\r\n api.data.setEntityLegs(\r\n item.all.map(e => getSNodeID(api.toScheduleNode(e))),\r\n departure,\r\n destination\r\n )\r\n }\r\n\r\n api.modal.newLegFormModal.open(\r\n item.departure,\r\n item.destination,\r\n callback\r\n )\r\n }}\r\n >\r\n Change departure & destination...\r\n \r\n \r\n )\r\n\r\n moreBtn = (\r\n \r\n e.stopPropagation()}\r\n />\r\n \r\n )\r\n }\r\n\r\n let extra = [];\r\n\r\n if (editMode){\r\n extra = [\r\n addBtn,\r\n reorderBtns,\r\n moreBtn,\r\n deleteBtn\r\n ]\r\n }\r\n\r\n return \r\n
    \r\n \r\n {renderPaxTable(item)}\r\n {renderCgoTable(item)}\r\n \r\n
    \r\n \r\n }\r\n\r\n const chargeCodeValidator = useCallback(createChargeCodeValidator(api), [api]);\r\n\r\n function renderPaxTable(item: DepDestListItem){\r\n\r\n let columns: ColumnProps[] = [\r\n {\r\n title: PAX ({item.pax.length}),\r\n key: 'action',\r\n width: 73,\r\n fixed: 'left' as 'left',\r\n render: (_, row) => {\r\n\r\n if (!editMode) return (\r\n
    \r\n \r\n
    \r\n );\r\n\r\n const reorderBtns = [\r\n \r\n = item.pax.length}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n api.data.swapEntities(row.scheduledOrder, row.scheduledOrder + 1)\r\n }}\r\n />\r\n \r\n ,\r\n \r\n {\r\n e.stopPropagation();\r\n api.data.swapEntities(row.scheduledOrder, row.scheduledOrder - 1)\r\n }}\r\n />\r\n \r\n ]\r\n\r\n return (\r\n \r\n {reorderBtns}\r\n \r\n )\r\n }\r\n },\r\n {\r\n title: (\r\n \r\n OI \r\n \r\n ),\r\n key: 'oi',\r\n dataIndex: 'scheduledOrder',\r\n render: (order) => order + 1,\r\n width: 60\r\n },\r\n {\r\n title: 'Name',\r\n key: 'name',\r\n width: 200,\r\n render: (_, record) => {\r\n let xbr;\r\n\r\n let icon = null;\r\n\r\n let spanClassName = record.currentCarrierID ? BASE_CLS + '-table-on-flight' : '';\r\n\r\n if (record.currentCarrierID){\r\n icon = \r\n {\r\n e.preventDefault();\r\n history.push(\"/app/scheduling/flight/\" + record.currentCarrierID?._id)\r\n }}\r\n style={{ marginRight: '6px', position: 'relative' }}\r\n >\r\n \r\n \r\n \r\n }\r\n\r\n if(!editMode){\r\n var data;\r\n if (record.__typename === 'Person')\r\n {\r\n data = {\r\n ...record,\r\n personID: { ...record }\r\n }\r\n }\r\n else\r\n {\r\n data = record\r\n }\r\n if(data.personID){\r\n xbr = data.personID.extraBroadState;\r\n }else {\r\n xbr = record.extraBroadState;\r\n }\r\n let name = `${record.lastName}, ${record.firstName}`\r\n if(xbr === 'FAIL'){\r\n name = `\\u2194 ${record.lastName}, ${record.firstName}`\r\n }else if(xbr === 'PASS'){\r\n name = `\\uc6c3 ${record.lastName}, ${record.firstName}`\r\n }\r\n return \r\n {icon}\r\n \r\n \r\n }\r\n xbr = record.extraBroadState || (record.personID && record.personID.extraBroadState)\r\n\r\n let text;\r\n if(xbr === 'FAIL'){\r\n text = `\\u2194 ${record.lastName}, ${record.firstName}`\r\n }else if(xbr === 'PASS'){\r\n text = `\\uc6c3 ${record.lastName}, ${record.firstName}`\r\n }else {\r\n let name = record.lastName + \", \" + record.firstName\r\n text = {name}\r\n }\r\n\r\n return (\r\n \r\n {icon}\r\n {text}\r\n \r\n );\r\n }\r\n },\r\n {\r\n title: 'Notes for Pilot',\r\n key: 'notesForPilot',\r\n width: 150,\r\n render: (_, row) => (\r\n \r\n )\r\n },\r\n {\r\n title: 'Nation',\r\n key: 'nation',\r\n width: 70,\r\n render: (_, row) => row.personID && row.personID.nation\r\n },\r\n {\r\n title: 'Employer',\r\n key: 'employer',\r\n width: 120,\r\n render: (_, record) => record.employerID && record.employerID.name\r\n },\r\n {\r\n title: 'Pax Wt',\r\n key: 'paxWeight',\r\n dataIndex: 'paxWeight',\r\n width: 50,\r\n render: (weight: number, row) => {\r\n if (!editMode || row.currentCarrierID) return weight || 0;\r\n return \r\n handleCellEdit(getSNodeID(row), 'paxWeight', value || 0)}\r\n size=\"small\"\r\n value={weight || 0}\r\n {...stopPropagationProps()}\r\n />\r\n \r\n }\r\n },\r\n {\r\n title: 'Bag Wt',\r\n key: 'bagWeight',\r\n dataIndex: 'bagWeight',\r\n width: 50,\r\n render: (weight, row) => {\r\n if (!editMode || row.currentCarrierID) return weight || 0;\r\n return \r\n handleCellEdit(getSNodeID(row), 'bagWeight', value || 0)}\r\n size=\"small\"\r\n value={weight || 0}\r\n />\r\n \r\n }\r\n },\r\n {\r\n title: 'Bag Ct',\r\n key: 'bagCount',\r\n dataIndex: 'bagCount',\r\n width: 50,\r\n render: (count, row) => {\r\n if (!editMode || row.currentCarrierID) return count || 0;\r\n return \r\n handleCellEdit(getSNodeID(row), 'bagCount', value || 0)}\r\n size=\"small\"\r\n value={count || 0}\r\n />\r\n \r\n }\r\n },\r\n {\r\n title: 'Charge Code',\r\n key: 'chargeCode',\r\n dataIndex: 'chargeCode',\r\n width: 130,\r\n render: (code: string, row: Phase2ScheduleNode) => {\r\n if (!editMode || row.currentCarrierID) return code && code.toUpperCase();\r\n\r\n const fieldKey = createFormFieldKey(\r\n getSNodeID(api.toScheduleNode(row)),\r\n 'chargeCode'\r\n );\r\n\r\n return (\r\n \r\n {props.form.getFieldDecorator(fieldKey, {\r\n initialValue: code,\r\n rules: [\r\n {\r\n required: true,\r\n message: 'Charge code is required',\r\n validator: chargeCodeValidator\r\n }\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n )\r\n }\r\n },\r\n {\r\n title: 'ISN Status',\r\n key: 'isnStatus',\r\n render: (_, row) => {\r\n\r\n if (row.transitType !== 'OUTBOUND') return '—';\r\n\r\n const pax = {\r\n ...row,\r\n isnCheckError: api.bulkIsnChecker.checkError(getSNodeID(row)),\r\n isnCheckRunning: api.bulkIsnChecker.checkLoading(getSNodeID(row._id))\r\n }\r\n\r\n return {\r\n e.stopPropagation();\r\n api.drawer.isnDrawer.open(row);\r\n }}\r\n />\r\n }\r\n },\r\n {\r\n title: 'Created By',\r\n key: 'createdBy',\r\n dataIndex: 'createdBy'\r\n }\r\n ]\r\n\r\n if (typeof props.modifyPaxColumns === 'function'){\r\n columns = props.modifyPaxColumns(api, columns);\r\n }\r\n\r\n if (!item.pax.length) return null;\r\n\r\n return {\r\n return {\r\n onClick: () => {\r\n if (!selectionEnabled) return;\r\n api.selection.entityIds.toggle(getSNodeID(record));\r\n },\r\n className: selectionEnabled ? BASE_CLS + '-table-row' : '',\r\n disabled: !!record.currentCarrierID && !selectionEnabled\r\n }\r\n }}\r\n pagination={false}\r\n rowKey={record => getSNodeID(record)}\r\n size=\"small\"\r\n />\r\n }\r\n\r\n function renderCgoTable(item: DepDestListItem){\r\n\r\n const cgo = item.cgo.filter(e => e.classType === 'flytsuite.cgonode');\r\n\r\n let columns: ColumnProps[] = [\r\n {\r\n title: CGO ({cgo.length}),\r\n key: 'action',\r\n width: 73,\r\n fixed: 'left' as 'left',\r\n render: (_, row) => {\r\n\r\n if (!editMode) return (\r\n
    \r\n \r\n
    \r\n );\r\n\r\n const reorderBtns = [\r\n \r\n = item.all.length}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n api.data.swapEntities(row.scheduledOrder, row.scheduledOrder + 1);\r\n }}\r\n />\r\n \r\n ,\r\n \r\n {\r\n e.stopPropagation();\r\n api.data.swapEntities(row.scheduledOrder, row.scheduledOrder - 1);\r\n }}\r\n />\r\n \r\n ]\r\n\r\n return (\r\n \r\n {reorderBtns}\r\n \r\n )\r\n }\r\n },\r\n {\r\n title: (\r\n \r\n OI \r\n \r\n ),\r\n key: 'oi',\r\n dataIndex: 'scheduledOrder',\r\n render: (order) => order + 1,\r\n width: 60\r\n },\r\n {\r\n title: 'Name',\r\n key: 'name',\r\n width: 200,\r\n render: (_, record) => {\r\n let spanClassName = record.currentCarrierID ? BASE_CLS + '-table-on-flight' : '';\r\n\r\n if (record.currentCarrierID){\r\n return \r\n {\r\n e.preventDefault();\r\n history.push(\"/app/scheduling/flight/\" + record.currentCarrierID?._id)\r\n }}\r\n style={{marginRight: '6px', position: 'relative'}}\r\n >\r\n \r\n \r\n \r\n \r\n {record.name}\r\n \r\n }\r\n\r\n return record.name\r\n }\r\n },\r\n {\r\n title: 'Notes for Pilot',\r\n key: 'notesForPilot',\r\n width: 150,\r\n render: (_, row) => (\r\n \r\n )\r\n },\r\n {\r\n title: 'Weight',\r\n key: 'weight',\r\n dataIndex: 'weight',\r\n width: 70,\r\n render: (weight, row) => {\r\n if (!editMode || row.currentCarrierID) return weight || 0;\r\n return \r\n handleCellEdit(getSNodeID(row), 'weight', value || 0)}\r\n size=\"small\"\r\n value={weight || 0}\r\n />\r\n \r\n }\r\n },\r\n {\r\n title: 'HazMat',\r\n key: 'hazmat',\r\n width: 120,\r\n render: (_, record) => record.hazmat ? record.hazmatUnCode || \"YES\" : null\r\n },\r\n {\r\n title: 'Attention',\r\n key: 'attentionTo',\r\n width: 200,\r\n render: (_, record) => record.attentionTo\r\n },\r\n {\r\n title: 'Initials',\r\n key: 'initials',\r\n width: 130,\r\n render: (_, record) => record.initials\r\n },\r\n {\r\n title: 'Notes',\r\n key: 'notes',\r\n render: (_, record) => record.notes\r\n },\r\n {\r\n title: 'Created By',\r\n key: 'createdBy',\r\n dataIndex: 'createdBy'\r\n }\r\n ]\r\n\r\n if (typeof props.modifyCgoColumns === 'function'){\r\n columns = props.modifyCgoColumns(api, columns);\r\n }\r\n\r\n if (!cgo.length) return null;\r\n\r\n return {\r\n const onRowResult = typeof props.onRow === 'function' ? props.onRow(record, index) : {};\r\n return {\r\n onClick: () => {\r\n if (!selectionEnabled) return;\r\n api.selection.entityIds.toggle(getSNodeID(record));\r\n },\r\n className: selectionEnabled ? BASE_CLS + '-table-row' : '',\r\n disabled: !!record.currentCarrierID && !selectionEnabled,\r\n ...onRowResult\r\n }\r\n }}\r\n pagination={false}\r\n rowKey={record => getSNodeID(record)}\r\n size=\"small\"\r\n />\r\n }\r\n\r\n function renderIsnDrawer(){\r\n let pax = api.drawer.isnDrawer.get().pax;\r\n let title = pax ? `${pax.lastName}, ${pax.firstName}` : '';\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n\r\n function renderPaxModal(){\r\n const modalState = api.modal.paxModal.get();\r\n const modalActions = api.modal.paxModal;\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n\r\n const panels = data.map(renderPanel);\r\n\r\n let noDataMsg = null;\r\n let collapse = null;\r\n if (api.data.modifiedEntities.get().length) {\r\n collapse = (\r\n \r\n {panels}\r\n \r\n )\r\n }\r\n else if (editMode && !api.queryInfo.loading)\r\n {\r\n noDataMsg = \r\n

    Use the left panel to add PAX/CGO

    \r\n {api.carriableSelector.hideCarriablePanel.get() ? (\r\n Show Panel\r\n ) : null}\r\n \r\n }\r\n icon=\"usergroup-add\"\r\n style={{ flex: 1 }}\r\n />\r\n }\r\n else if (!api.queryInfo.loading) {\r\n noDataMsg = \r\n }\r\n\r\n return <>\r\n {collapse}\r\n {noDataMsg}\r\n {renderIsnDrawer()}\r\n {renderPaxModal()}\r\n \r\n}\r\n\r\nconst Phase2Table = Form.create({\r\n\r\n // Consumes form data from state manager and converts it into fields for each table row.\r\n mapPropsToFields({ api }){\r\n const entityIds = api.forms.entityForm.listEntityIds();\r\n\r\n const fields = {};\r\n\r\n entityIds.forEach((entityId) => {\r\n const formData = api.forms.entityForm.get(entityId);\r\n\r\n Object.entries(formData).forEach(([ key, value ]) => {\r\n fields[createFormFieldKey(entityId, key)] = createFormField(value)\r\n });\r\n })\r\n\r\n return fields;\r\n },\r\n\r\n // Converts individual form fields into the structure that the parent state manager expects\r\n onFieldsChange({ api }, _, allFields){\r\n\r\n const entityFormData: { [entityId: string]: Partial } = {};\r\n\r\n // Initialize entityFormData values\r\n Object.keys(allFields).forEach((key) => {\r\n const result = splitFormFieldKey(key);\r\n if (result){\r\n entityFormData[result.entityId] = {}\r\n }\r\n })\r\n\r\n // Add fields and values to each entityId\r\n Object.entries(allFields).forEach(([key, value]) => {\r\n const result = splitFormFieldKey(key);\r\n if (result){\r\n entityFormData[result.entityId][result.fieldName] = value;\r\n }\r\n })\r\n\r\n // Send final result to state manager\r\n Object.entries(entityFormData).forEach(([entityId, formData]) => {\r\n api.forms.entityForm.set(entityId, formData);\r\n })\r\n }\r\n})(Phase2TableBase)\r\n\r\nexport default Phase2Table","import {Phase2Api} from \"./api\";\r\nimport {ValidationRule} from \"antd/lib/form\";\r\nimport React from \"react\";\r\n\r\nexport function createChargeCodeValidator(api: Phase2Api){\r\n\r\n const defaultChargeCode = api.chargeCodes.getDefault();\r\n\r\n return (rule: ValidationRule, chargeCode: string, callback: (msg?: React.ReactNode) => void) => {\r\n if (defaultChargeCode){\r\n callback();\r\n return;\r\n }\r\n\r\n if (rule.required && !chargeCode){\r\n callback(rule.message);\r\n return;\r\n }\r\n\r\n callback();\r\n }\r\n}","import {FormComponentProps} from \"antd/lib/form\";\r\nimport {Col, Form, Row} from \"antd\";\r\nimport {createFormFields, FormItemClassNames} from \"../../../../common/form\";\r\nimport DepDestSelect from \"../../../../components/form/select/dep-dest-select\";\r\nimport {NewLegFormData, NewLegFormFields} from \"./types\";\r\n\r\n\r\nexport interface NewLegFormProps extends FormComponentProps{\r\n formData: NewLegFormFields,\r\n onFieldsChange: (fields: NewLegFormFields) => void,\r\n onValuesChange?: (fields: NewLegFormData) => void\r\n}\r\n\r\nconst NewLegForm: React.FC = (props) => {\r\n\r\n const { form } = props;\r\n\r\n const validator = DepDestSelect.validator;\r\n\r\n return
    \r\n \r\n {form.getFieldDecorator('depDest', {\r\n rules: [{\r\n required: true,\r\n validator: validator,\r\n message: 'Please choose a departure and destination.'\r\n }]\r\n })(\r\n \r\n )}\r\n \r\n
    \r\n}\r\n\r\nexport default Form.create({\r\n mapPropsToFields(props){\r\n if (!props.formData) return undefined\r\n return createFormFields(props.formData);\r\n },\r\n onFieldsChange(props, _, fields){\r\n if (props.onFieldsChange){\r\n props.onFieldsChange(fields);\r\n }\r\n },\r\n onValuesChange(props, _, values){\r\n if (props.onValuesChange){\r\n props.onValuesChange(values);\r\n }\r\n }\r\n})(NewLegForm)","import {Phase2Api} from \"./api\";\r\nimport {Button, Col, Divider, Dropdown, Icon, Input, Menu, Modal, Row, Tooltip} from \"antd\";\r\nimport {BASE_CLS} from \"./util\";\r\nimport {getSNodeID} from \"../../../../components/scheduling/util\";\r\nimport SelectionCount from \"../../../../components/search/SelectionCount\";\r\nimport React from \"react\";\r\nimport {Location} from \"../../../../__generated__/graphql/types\";\r\nimport useUserGroups from \"../../../../hooks/useUserGroups\";\r\n\r\ninterface BaseFeatureConfig {\r\n enabled: boolean\r\n}\r\n\r\ninterface FeatureConfig {\r\n collapseButton?: BaseFeatureConfig,\r\n editMenu?: BaseFeatureConfig,\r\n selectMenu?: BaseFeatureConfig & {\r\n forceVisible?: boolean\r\n },\r\n viewMenu?: BaseFeatureConfig,\r\n toolsMenu?: BaseFeatureConfig,\r\n pilotNodeEditorButton?: BaseFeatureConfig,\r\n defaultChargeCode?: BaseFeatureConfig,\r\n editButton?: BaseFeatureConfig,\r\n selectionCount?: BaseFeatureConfig\r\n}\r\n\r\ntype FeatureName = keyof FeatureConfig\r\n\r\nfunction getApiContext(api: Phase2Api){\r\n return {\r\n data: api.data,\r\n editMode: api.editMode.get(),\r\n hideCarrierPanel: api.carriableSelector.hideCarriablePanel,\r\n selectedEntityIds: api.selection.entityIds,\r\n scheduledPax: api.data.modifiedEntities\r\n .get()\r\n .filter(c => c.classType === 'flytsuite.paxnode'),\r\n chargeCodes: api.chargeCodes,\r\n hasData: !!api.data.modifiedEntities.get().length,\r\n }\r\n}\r\n\r\nexport const SelectMenu = React.memo<{ api: Phase2Api }>(\r\n function SelectMenu({ api }){\r\n const { hasData, selectedEntityIds } = getApiContext(api);\r\n\r\n function renderSelectLegMenu(){\r\n return \r\n {api.data.getLegs().map((leg) => {\r\n return (\r\n api.selection.entityIds.add(leg.all.map(e => getSNodeID(api.toScheduleNode(e))))}\r\n >\r\n {leg.departure.name + ' → ' + leg.destination.name}\r\n \r\n )\r\n })}\r\n \r\n }\r\n\r\n return \r\n = api.data.modifiedEntities.get().length}\r\n key=\"selectall\"\r\n onClick={selectedEntityIds.all}\r\n >Select All\r\n De-select All\r\n {renderSelectLegMenu()}\r\n \r\n }\r\n >\r\n \r\n \r\n }\r\n);\r\n\r\nexport interface ToolbarProps {\r\n api: Phase2Api,\r\n featureConfig?: FeatureConfig\r\n}\r\n\r\nexport const ToolsMenu: React.FC<{ api: Phase2Api }> = ({ api }) => {\r\n\r\n const menuItems: React.ReactNode[] = [];\r\n\r\n if (api.editMode.get()){\r\n menuItems.push(\r\n \r\n Edit Pilot Notes\r\n \r\n )\r\n }\r\n\r\n menuItems.push(\r\n api.purgeEntitiesFromFlightTool.modal.setOpen(true)}\r\n >\r\n Purge PAX/CGO from flight\r\n \r\n )\r\n\r\n if (!api.editMode.get()){\r\n menuItems.push(\r\n api.scheduledToExpectedPaxCgo.modal.setOpen(true)}\r\n >\r\n Make PAX/CGO Expected\r\n \r\n )\r\n }\r\n\r\n return \r\n \r\n {menuItems}\r\n \r\n }\r\n >\r\n \r\n \r\n \r\n}\r\n\r\nconst Toolbar: React.FC = (props) => {\r\n\r\n const { api } = props;\r\n\r\n const [ userGroups ] = useUserGroups();\r\n\r\n const {\r\n data,\r\n editMode,\r\n hideCarrierPanel,\r\n selectedEntityIds,\r\n scheduledPax,\r\n chargeCodes\r\n } = getApiContext(api);\r\n\r\n function getFeatureConfig(featureName: F){\r\n return props.featureConfig[featureName] as FeatureConfig[F];\r\n }\r\n\r\n function isFeatureEnabled(featureName: FeatureName){\r\n return props.featureConfig[featureName]?.enabled;\r\n }\r\n\r\n const renderFeature = (featureName: FeatureName) => (component: React.ReactElement) => {\r\n if (isFeatureEnabled(featureName)){\r\n return component\r\n }\r\n return null;\r\n }\r\n\r\n let collapserIcon = 'menu-fold';\r\n let collapserTooltipText = 'Hide personnel search';\r\n if (hideCarrierPanel) {\r\n collapserIcon = 'menu-unfold';\r\n collapserTooltipText = 'Show personnel search';\r\n }\r\n\r\n function renderMoveToMenu(){\r\n\r\n const firstID = selectedEntityIds.get()[0];\r\n const firstSelectedEntity = api.data.modifiedEntities.get().find(e => getSNodeID(api.toScheduleNode(e)) === firstID);\r\n\r\n return \r\n {\r\n\r\n const callback = (departure: Location, destination: Location) => {\r\n api.data.setEntityLegs(\r\n api.selection.entityIds.get(),\r\n departure,\r\n destination\r\n )\r\n }\r\n\r\n // Automatically fill in the departure and destination from\r\n // the first selected entity.\r\n if (firstSelectedEntity) {\r\n api.modal.newLegFormModal.open(\r\n firstSelectedEntity.departureID,\r\n firstSelectedEntity.destinationID,\r\n callback\r\n );\r\n }\r\n else {\r\n api.modal.newLegFormModal.open();\r\n }\r\n }}\r\n >\r\n New...\r\n \r\n \r\n \r\n \r\n \r\n {api.data.getLegs().map((leg) => {\r\n return (\r\n api.data.setEntityLegs(\r\n api.selection.entityIds.get(),\r\n leg.departure,\r\n leg.destination)\r\n }\r\n >\r\n {leg.departure.name + ' → ' + leg.destination.name}\r\n \r\n )\r\n })}\r\n \r\n }\r\n\r\n return (\r\n \r\n {editMode ? (\r\n <>\r\n {renderFeature('collapseButton')(\r\n <>\r\n \r\n \r\n \r\n \r\n )}\r\n \r\n ) : null}\r\n {getFeatureConfig('selectMenu')?.forceVisible || editMode ?\r\n renderFeature('selectMenu')() : null\r\n }\r\n {renderFeature('viewMenu')(\r\n \r\n \r\n Expand All Tables\r\n Collapse All Tables\r\n \r\n }\r\n >\r\n \r\n \r\n \r\n )}\r\n {renderFeature('toolsMenu')()}\r\n {editMode ? (\r\n renderFeature('pilotNodeEditorButton')(\r\n \r\n \r\n Pilot Note Editor\r\n \r\n \r\n )\r\n ) : null}\r\n {editMode ? (\r\n renderFeature('defaultChargeCode')(\r\n \r\n Default Charge Code: \r\n chargeCodes.setDefault(e.target.value.split(\" \").join(\"\"))}\r\n value={chargeCodes.getDefault()}\r\n />\r\n \r\n )\r\n ) : null}\r\n {!editMode ? (\r\n renderFeature('editButton')(\r\n userGroups.includes('flytsuite.schedule.passenger') ? (\r\n \r\n \r\n Edit\r\n \r\n \r\n ) : (\r\n \r\n \r\n \r\n \r\n \r\n )\r\n )\r\n ) : null}\r\n
    \r\n {renderFeature('selectionCount')(\r\n selectedEntityIds.get().length ? (\r\n <>\r\n \r\n \r\n \r\n \r\n ) : null\r\n )}\r\n \r\n )\r\n}\r\n\r\nconst enabled: BaseFeatureConfig = { enabled: true }\r\n\r\nexport const DefaultFeatureConfig = {\r\n collapseButton: enabled,\r\n editMenu: enabled,\r\n selectMenu: enabled,\r\n viewMenu: enabled,\r\n toolsMenu: enabled,\r\n pilotNodeEditorButton: enabled,\r\n defaultChargeCode: enabled,\r\n editButton: enabled,\r\n selectionCount: enabled\r\n} as const;\r\n\r\nToolbar.defaultProps = {\r\n featureConfig: DefaultFeatureConfig\r\n}\r\n\r\nexport default Toolbar;","import React, {CSSProperties, Dispatch, useCallback} from \"react\";\r\nimport {Col, Icon, Layout, Modal, Row, Spin} from \"antd\";\r\nimport Phase2Table from \"../table\";\r\nimport useBreakpoints from \"../../../../../hooks/useBreakpoints\";\r\nimport {Phase2Api} from \"../api\";\r\nimport {State} from \"../state\";\r\nimport {overrideTableApi} from \"./api-override\";\r\nimport Toolbar from \"../toolbar\";\r\nimport {BASE_CLS, isFlightScheduled} from \"../util\";\r\nimport '../phase-2-scheduler.less';\r\nimport {ColumnProps} from \"antd/lib/table\";\r\nimport {isTruey} from \"../../../../../common/util-ts\";\r\nimport {uniqBy} from \"lodash\";\r\nimport {getSNodeID} from \"../../../../../components/scheduling/util\";\r\nimport pluralize from \"pluralize\";\r\n\r\nconst { Content } = Layout;\r\n\r\nexport interface PurgeEntitiesFromFlightToolProps {\r\n state: State,\r\n api: Phase2Api\r\n}\r\n\r\nconst PurgeEntitiesFromFlightTool: React.FC = (props) => {\r\n\r\n const { state, api } = props;\r\n const bp = useBreakpoints();\r\n\r\n const apiOverride = useCallback(() => overrideTableApi(state, api), [ state, api ])();\r\n\r\n const selectedEntities = state.purgeEntitiesFromFlightTool.data.entities\r\n .filter((entity) => (\r\n state.purgeEntitiesFromFlightTool.selection.selectedEntityIds\r\n .includes(getSNodeID(api.toScheduleNode(entity)))\r\n ));\r\n\r\n const flights = uniqBy(\r\n selectedEntities\r\n .map((entity) => entity.currentCarrierID)\r\n .filter(isTruey),\r\n '_id'\r\n );\r\n\r\n function modifyEntityColumns(api, columns) {\r\n const nameIndex = columns\r\n .findIndex((col) => col.key === 'name');\r\n\r\n const assignedFlightColumn: ColumnProps = {\r\n key: 'assignedFlight',\r\n title: 'Flight Name',\r\n width: 150,\r\n render: (_, pax) => {\r\n return pax?.currentCarrierID?.desig;\r\n }\r\n }\r\n\r\n const newColumns = [...columns];\r\n newColumns.splice(nameIndex+1, 0, assignedFlightColumn);\r\n return newColumns;\r\n }\r\n\r\n return api.purgeEntitiesFromFlightTool.modal.setOpen(false)}\r\n okButtonProps={{\r\n type: 'danger',\r\n disabled: !selectedEntities.length,\r\n loading: api.purgeEntitiesFromFlightTool.isPurging()\r\n }}\r\n okText={`Purge ${selectedEntities.length} PAX/CGO from ${flights.length} ${pluralize('flight', flights.length)}`}\r\n onOk={api.purgeEntitiesFromFlightTool.startPurge}\r\n >\r\n \r\n \r\n \r\n }\r\n spinning={false}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n}\r\n\r\nexport default PurgeEntitiesFromFlightTool;","import PurgeEntitiesFromFlightTool from \"./component\";\r\nexport default PurgeEntitiesFromFlightTool;","import {State} from \"../state\";\r\nimport {Phase2Api} from \"../api\";\r\nimport {getSNodeID} from \"../../../../../components/scheduling/util\";\r\nimport * as Util from \"../util\";\r\n\r\n/**\r\n * Overrides v2-scheduler table api functions with those that manipulate the purge tool's state.\r\n * @param _state\r\n * @param api\r\n */\r\nexport function overrideTableApi(_state: State, api: Phase2Api): Phase2Api {\r\n\r\n const state = _state.purgeEntitiesFromFlightTool;\r\n const dispatch = api.getDispatch();\r\n\r\n const apiOverride = {\r\n ...api,\r\n data: {\r\n ...api.data,\r\n modifiedEntities: {\r\n ...api.data.modifiedEntities,\r\n get: () => state.data.entities\r\n },\r\n getLegs: () => Util.DepDestList.build(apiOverride.data.modifiedEntities.get())\r\n },\r\n selection: {\r\n ...api.selection,\r\n entityIds: {\r\n get: () => state.selection.selectedEntityIds,\r\n set: (newEntities) => dispatch({ type: 'PURGE_TOOL.SET_SELECTED_ENTITY_IDS', set: newEntities }),\r\n add: (newEntities) => dispatch({ type: 'PURGE_TOOL.SET_SELECTED_ENTITY_IDS', add: newEntities }),\r\n remove: (removedEntities) => dispatch({ type: 'PURGE_TOOL.SET_SELECTED_ENTITY_IDS', remove: removedEntities }),\r\n toggle(entityID){\r\n if (!state.selection.selectedEntityIds.includes(entityID))\r\n this.add([entityID]);\r\n else\r\n this.remove([entityID]);\r\n },\r\n clear: () => dispatch({ type: 'PURGE_TOOL.SET_SELECTED_ENTITY_IDS', set: [] }),\r\n all: () => {\r\n let entities = _state.data.modifiedEntities.map(e => getSNodeID(api.toScheduleNode(e)));\r\n dispatch({ type: 'PURGE_TOOL.SET_SELECTED_ENTITY_IDS', set: entities });\r\n }\r\n }\r\n },\r\n editor: {\r\n ...api.editor,\r\n visibleLegs: {\r\n get: () => state.editor.visibleLegs,\r\n show: (departureID, destinationID) => {\r\n const payload = {\r\n departureID: departureID,\r\n destinationID: destinationID\r\n }\r\n dispatch({ type: 'PURGE_TOOL.SET_VISIBLE_LEGS', mode: 'objects', action: 'add', payload: [payload] });\r\n },\r\n isLegVisible: (departureID, destinationID) => (\r\n Boolean(\r\n state.editor.visibleLegs.find((item) => (\r\n item.departureID === departureID && item.destinationID === destinationID)\r\n )\r\n )\r\n ),\r\n showAll: () => {\r\n const data = Util.DepDestList.build(_state.data.modifiedEntities);\r\n\r\n const depDestList = data\r\n .map(item => ({\r\n departureID: item.departure._id,\r\n destinationID: item.destination._id\r\n }));\r\n\r\n dispatch({ type: 'PURGE_TOOL.SET_VISIBLE_LEGS', mode: 'objects', action: 'set', payload: depDestList })\r\n },\r\n hideAll: () => {\r\n dispatch({ type: 'PURGE_TOOL.SET_VISIBLE_LEGS', mode: 'objects', action: 'set', payload: [] });\r\n },\r\n setAsStrings: (keys) => (\r\n dispatch({ type: 'PURGE_TOOL.SET_VISIBLE_LEGS', mode: 'strings', action: 'set', splitBy: '::', payload: keys })\r\n ),\r\n getAsStrings: () => {\r\n return state.editor.visibleLegs\r\n .map(item => `${item.departureID}::${item.destinationID}`)\r\n }\r\n }\r\n }\r\n }\r\n\r\n return apiOverride;\r\n}","import React, {CSSProperties, Dispatch, useCallback} from \"react\";\r\nimport {Col, Icon, Layout, Modal, Row, Spin} from \"antd\";\r\nimport Phase2Table from \"../table\";\r\nimport useBreakpoints from \"../../../../../hooks/useBreakpoints\";\r\nimport {Phase2Api} from \"../api\";\r\nimport {State} from \"../state\";\r\nimport {overrideTableApi} from \"./api-override\";\r\nimport Toolbar from \"../toolbar\";\r\nimport {BASE_CLS, isFlightScheduled} from \"../util\";\r\nimport '../phase-2-scheduler.less';\r\nimport {ColumnProps} from \"antd/lib/table\";\r\nimport {isTruey} from \"../../../../../common/util-ts\";\r\nimport {uniqBy} from \"lodash\";\r\nimport {getSNodeID} from \"../../../../../components/scheduling/util\";\r\nimport pluralize from \"pluralize\";\r\n\r\nconst { Content } = Layout;\r\n\r\nexport interface ScheduledToExpectedPaxCgoToolProps {\r\n state: State,\r\n api: Phase2Api\r\n}\r\n\r\nconst ScheduledToExpectedPaxCgoTool: React.FC = (props) => {\r\n\r\n const { state, api } = props;\r\n const bp = useBreakpoints();\r\n\r\n const apiOverride = useCallback(() => overrideTableApi(state, api), [ state, api ])();\r\n\r\n const selectedEntities = state.scheduledToExpectedPaxCgo.data.entities\r\n .filter((entity) => (\r\n state.scheduledToExpectedPaxCgo.selection.selectedEntityIds\r\n .includes(getSNodeID(api.toScheduleNode(entity)))\r\n ));\r\n\r\n return api.scheduledToExpectedPaxCgo.modal.setOpen(false)}\r\n okButtonProps={{\r\n type: 'danger',\r\n disabled: !selectedEntities.length,\r\n loading: api.scheduledToExpectedPaxCgo.isLoading\r\n }}\r\n okText={`Change ${selectedEntities.length} PAX/CGO to Expected`}\r\n onOk={api.scheduledToExpectedPaxCgo.start}\r\n >\r\n \r\n \r\n \r\n }\r\n spinning={false}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n}\r\n\r\nexport default ScheduledToExpectedPaxCgoTool;","import PurgeEntitiesFromFlightTool from \"./component\";\r\nexport default PurgeEntitiesFromFlightTool;","import {State} from \"../state\";\r\nimport {Phase2Api} from \"../api\";\r\nimport {getSNodeID} from \"../../../../../components/scheduling/util\";\r\nimport * as Util from \"../util\";\r\nimport {SET_SELECTED_ENTITY_IDS, SET_VISIBLE_LEGS} from \"./action\";\r\n\r\n/**\r\n * Overrides v2-scheduler table api functions with those that manipulate this tool's state.\r\n * @param _state\r\n * @param api\r\n */\r\nexport function overrideTableApi(_state: State, api: Phase2Api): Phase2Api {\r\n\r\n const state = _state.scheduledToExpectedPaxCgo;\r\n const dispatch = api.getDispatch();\r\n\r\n const apiOverride = {\r\n ...api,\r\n data: {\r\n ...api.data,\r\n modifiedEntities: {\r\n ...api.data.modifiedEntities,\r\n get: () => state.data.entities\r\n },\r\n getLegs: () => Util.DepDestList.build(apiOverride.data.modifiedEntities.get())\r\n },\r\n selection: {\r\n ...api.selection,\r\n entityIds: {\r\n get: () => state.selection.selectedEntityIds,\r\n set: (newEntities) => dispatch({ type: SET_SELECTED_ENTITY_IDS, set: newEntities }),\r\n add: (newEntities) => dispatch({ type: SET_SELECTED_ENTITY_IDS, add: newEntities }),\r\n remove: (removedEntities) => dispatch({ type: SET_SELECTED_ENTITY_IDS, remove: removedEntities }),\r\n toggle(entityID){\r\n if (!state.selection.selectedEntityIds.includes(entityID))\r\n this.add([entityID]);\r\n else\r\n this.remove([entityID]);\r\n },\r\n clear: () => dispatch({ type: SET_SELECTED_ENTITY_IDS, set: [] }),\r\n all: () => {\r\n let entities = _state.data.modifiedEntities.map(e => getSNodeID(api.toScheduleNode(e)));\r\n dispatch({ type: SET_SELECTED_ENTITY_IDS, set: entities });\r\n }\r\n }\r\n },\r\n editor: {\r\n ...api.editor,\r\n visibleLegs: {\r\n get: () => state.editor.visibleLegs,\r\n show: (departureID, destinationID) => {\r\n const payload = {\r\n departureID: departureID,\r\n destinationID: destinationID\r\n }\r\n dispatch({ type: SET_VISIBLE_LEGS, mode: 'objects', action: 'add', payload: [payload] });\r\n },\r\n isLegVisible: (departureID, destinationID) => (\r\n Boolean(\r\n state.editor.visibleLegs.find((item) => (\r\n item.departureID === departureID && item.destinationID === destinationID)\r\n )\r\n )\r\n ),\r\n showAll: () => {\r\n const data = Util.DepDestList.build(_state.data.modifiedEntities);\r\n\r\n const depDestList = data\r\n .map(item => ({\r\n departureID: item.departure._id,\r\n destinationID: item.destination._id\r\n }));\r\n\r\n dispatch({ type: SET_VISIBLE_LEGS, mode: 'objects', action: 'set', payload: depDestList })\r\n },\r\n hideAll: () => {\r\n dispatch({ type: SET_VISIBLE_LEGS, mode: 'objects', action: 'set', payload: [] });\r\n },\r\n setAsStrings: (keys) => (\r\n dispatch({ type: SET_VISIBLE_LEGS, mode: 'strings', action: 'set', splitBy: '::', payload: keys })\r\n ),\r\n getAsStrings: () => {\r\n return state.editor.visibleLegs\r\n .map(item => `${item.departureID}::${item.destinationID}`)\r\n }\r\n }\r\n }\r\n }\r\n\r\n return apiOverride;\r\n}","import React, {useContext, useRef} from \"react\";\r\nimport * as Phase2State from './state';\r\nimport {Alert, Button, Col, Divider, Dropdown, Icon, Input, Layout, Menu, message, Modal, Row, Tooltip} from \"antd\";\r\nimport {BASE_CLS, deRefLocations} from \"./util\";\r\nimport SelectionCount from \"../../../../components/search/SelectionCount\";\r\nimport GroupForm from \"./form\";\r\nimport {TransitType} from \"../../../../common/types/carriable\";\r\nimport './phase-2-scheduler.less';\r\nimport Phase2Table from \"./table\";\r\nimport useUserGroups from \"../../../../hooks/useUserGroups\";\r\nimport NewLegForm from \"./new-leg-form\";\r\nimport {useApolloClient} from \"react-apollo\";\r\nimport {Location} from \"common/types/location\";\r\nimport {NewLegFormData} from \"./types\";\r\nimport * as NotesForPilot from \"../../../../components/flights/scheduling/notes-for-pilot\";\r\nimport {getSNodeID} from \"../../../../components/scheduling/util\";\r\nimport {ScheduleNode} from \"../../../../components/scheduling/types\";\r\nimport PurgeEntitiesFromFlightTool from \"./purge-entities-from-flight-tool\";\r\nimport Toolbar from \"./toolbar\";\r\nimport ScheduledToExpectedPaxCgoTool from \"./scheduled-to-expected-paxcgo\";\r\n\r\nconst { Content } = Layout;\r\n\r\nexport interface Phase2EditorProps {\r\n groupFormRef: React.MutableRefObject\r\n}\r\n\r\nconst Phase2Editor: React.FC = (props) => {\r\n\r\n // Context API -----------------------------------------------------------------------------------------------------\r\n const { api } = useContext(Phase2State.Context);\r\n\r\n const editMode = api.editMode.get();\r\n const saveStatus = api.saveStatus;\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Hooks -----------------------------------------------------------------------------------------------------------\r\n const groupFormRef = React.useRef(null);\r\n const newLegModalFormRef = React.useRef(null);\r\n const apolloClient = useApolloClient();\r\n const popupContainerRef = useRef(null);\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // State helpers ---------------------------------------------------------------------------------------------------\r\n const scheduledPax = api.data.modifiedEntities.get().filter(c => c.classType === 'flytsuite.paxnode');\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n function runIsnCheck() {\r\n if (api.editMode.get()){\r\n message.error('Cannot run ISN check in edit mode');\r\n return;\r\n }\r\n api.bulkIsnChecker.runChecks(\r\n scheduledPax\r\n .filter(p => p.transitType === TransitType.OUTBOUND)\r\n .map((pax) => getSNodeID(api.toScheduleNode(pax)))\r\n );\r\n }\r\n\r\n // Form ------------------------------------------------------------------------------------------------------------\r\n const form = {\r\n groupFormRef.current = ref;\r\n if (props.groupFormRef){\r\n props.groupFormRef.current = ref;\r\n }\r\n }}\r\n disabled={!editMode}\r\n formData={api.forms.groupForm.get()}\r\n onFieldsChange={api.forms.groupForm.setFields}\r\n />\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Table header ----------------------------------------------------------------------------------------------------\r\n const tableHeader = (\r\n \r\n \r\n {form}\r\n \r\n {groupFormRef.current && groupFormRef.current.props.form.isFieldsTouched() ? (\r\n \r\n \r\n \r\n \r\n {\r\n runIsnCheck();\r\n }}\r\n type=\"link\"\r\n size=\"large\"\r\n >Run ISN Check\r\n \r\n }\r\n const desc = (\r\n <>\r\n {saveStatus.get().description ?

    {saveStatus.get().description}

    : null}\r\n {content}\r\n \r\n )\r\n\r\n saveStatusAlert = (\r\n \r\n )\r\n }\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n return \r\n \r\n \r\n {saveStatusAlert}\r\n {tableHeader}\r\n \r\n {\r\n newLegModalFormRef.current?.validateFieldsAndScroll(async (err, values: NewLegFormData) => {\r\n if (err) return;\r\n\r\n const departureID = values.depDest.departure?.key;\r\n const destinationID = values.depDest.destination?.key;\r\n\r\n // Convert the location IDs to real locations\r\n const result = await deRefLocations(apolloClient, [departureID, destinationID]);\r\n if (result.errors.length){\r\n message.error('Failed to get locations');\r\n return;\r\n }\r\n const [ departure, destination ] = result.data;\r\n\r\n // Call the callback and close the modal (which clears the callback too)\r\n api.modal.newLegFormModal.callback?.(departure, destination);\r\n api.modal.newLegFormModal.close();\r\n })\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\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 Phase2Editor","import gql from 'graphql-tag';\r\nimport {LocationFragment} from \"Queries/Location\";\r\nimport {\r\n ScheduledCgoNodeFragment,\r\n ScheduledPaxCgoGroupV2Fragment,\r\n ScheduledPaxNodeFragment\r\n} from \"Queries/Scheduling\";\r\n\r\n\r\nexport const Queries = {\r\n GetScheduledPaxCgoGroups: gql`\r\n query GetScheduledPaxCgoGroups(\r\n $tpID: ID!\r\n $customerID: ID!\r\n $startDate: AWSDate!\r\n $endDate: AWSDate!\r\n ){\r\n getScheduledPaxInbCgoGroups(\r\n tpID: $tpID\r\n customerID: $customerID\r\n startDate: $startDate\r\n endDate: $endDate\r\n ){\r\n scheduledFlightDate\r\n scheduledGroup\r\n departureID {\r\n ...LocationFragment\r\n }\r\n destinationID {\r\n ...LocationFragment\r\n }\r\n lastKnownController {\r\n ...LocationFragment\r\n }\r\n paxOutbound\r\n paxTransfer\r\n paxInbound\r\n cgoOutbound\r\n cgoTransfer\r\n cgoInbound\r\n paxOutboundOnFlight\r\n paxTransferOnFlight\r\n paxInboundOnFlight\r\n cgoOutboundOnFlight\r\n cgoTransferOnFlight\r\n cgoInboundOnFlight\r\n }\r\n GetScheduledPaxCgoGroupsV2(\r\n tpID: $tpID\r\n customerID: $customerID\r\n startDate: $startDate\r\n endDate: $endDate\r\n ){\r\n ...ScheduledPaxCgoGroupV2Fragment\r\n }\r\n }\r\n ${LocationFragment}\r\n ${ScheduledPaxCgoGroupV2Fragment}\r\n `,\r\n\r\n GetScheduledPaxCgoV2: gql`\r\n query GetScheduledPaxCgoV2(\r\n $tpID: ID!\r\n $customerID: ID!\r\n $scheduledFlightDate: AWSDate!\r\n $scheduledGroup: String!\r\n $lastKnownController: ID!\r\n ){\r\n getTransporter(\r\n _id: $tpID\r\n ){\r\n _id\r\n name\r\n }\r\n getCustomer(\r\n _id: $customerID\r\n ){\r\n _id\r\n name\r\n }\r\n getLastKnownController: getLocation(\r\n _id: $lastKnownController\r\n ){\r\n ...LocationFragment\r\n }\r\n GetScheduledPaxCgoV2(\r\n tpID: $tpID\r\n customerID: $customerID\r\n scheduledFlightDate: $scheduledFlightDate\r\n scheduledGroup: $scheduledGroup,\r\n lastKnownController: $lastKnownController\r\n ){\r\n cgonodes {\r\n ...ScheduledCgoNodeFragment\r\n }\r\n paxnodes {\r\n ...ScheduledPaxNodeFragment\r\n }\r\n }\r\n }\r\n ${LocationFragment}\r\n ${ScheduledPaxNodeFragment}\r\n ${ScheduledCgoNodeFragment}\r\n `\r\n}\r\n\r\nexport const Mutations = {\r\n SaveSchedulePaxCgoV2: gql`\r\n mutation SchedulePaxCgo_V2(\r\n $customerID: ID!\r\n $tpID: ID!\r\n $lastKnownController: ID!\r\n $scheduledFlightDate: AWSDate!\r\n $scheduledGroup: String!\r\n $modifiedPax: [ScheduledPassengerInput_V2!]!\r\n $modifiedCgo: [ScheduledCargoInput_V2!]!\r\n $deletedEntities: [DeletedScheduledEntityInput!]\r\n ){\r\n SchedulePaxCgo_V2(\r\n customerID: $customerID\r\n tpID: $tpID\r\n lastKnownController: $lastKnownController\r\n scheduledFlightDate: $scheduledFlightDate\r\n scheduledGroup: $scheduledGroup\r\n modifiedPax: $modifiedPax\r\n modifiedCgo: $modifiedCgo\r\n deletedEntities: $deletedEntities\r\n ){\r\n cgonodes {\r\n ...ScheduledCgoNodeFragment\r\n }\r\n paxnodes {\r\n ...ScheduledPaxNodeFragment\r\n }\r\n }\r\n }\r\n ${ScheduledPaxNodeFragment}\r\n ${ScheduledCgoNodeFragment}\r\n `\r\n}","import gql from \"graphql-tag\";\r\n\r\nexport const PersonFragment = gql`\r\n fragment PersonFragment on Person {\r\n _id\r\n _rev\r\n lastName\r\n firstName\r\n classType\r\n dob\r\n nation\r\n extraBroadState\r\n credentials {\r\n _id\r\n key\r\n type\r\n expiration\r\n }\r\n contactInfo {\r\n phone {\r\n number\r\n type\r\n }\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n lastPaxWeight\r\n lastBagWeight\r\n lastBagCount\r\n }\r\n`;\r\n\r\nexport const ResolvePersonIdsQuery = gql`\r\nquery GetPaxNodesFromIds($ids: [ID!]!){\r\n resolve_entity_ids(\r\n ids: $ids,\r\n typename: \"Person\"\r\n ){\r\n ... on Person {\r\n ...PersonFragment\r\n }\r\n }\r\n}\r\n${PersonFragment}\r\n`","import {CargoFormData} from \"./types\";\r\nimport * as CargoUtils from \"components/form/CargoForm\";\r\nimport {OrgDataProviderContext} from \"context/orgData\";\r\nimport * as Util from './util';\r\nimport {Location} from \"common/types/location\";\r\nimport {getTransitType} from \"../../../../common/carriable/util\";\r\nimport {ScheduledCgoNode} from \"../../../../components/scheduling/types\";\r\n\r\nexport function cargoFormToCargoNode(\r\n formValues: CargoFormData,\r\n orgData: OrgDataProviderContext,\r\n departure: Location,\r\n destination: Location\r\n): ScheduledCgoNode {\r\n const formattedValues = CargoUtils.formatCargoFormValues(formValues);\r\n\r\n const node: ScheduledCgoNode = {\r\n _id: undefined, // ID will be assigned in backend\r\n\r\n __temp_id: Util.genTempID(),\r\n ...formattedValues,\r\n customerID: orgData.getOrgIDByType('customer'),\r\n tpID: orgData.getOrgIDByType('transporter'),\r\n classType: 'flytsuite.cgonode',\r\n departureID: departure,\r\n destinationID: destination,\r\n transitType: getTransitType(departure, destination),\r\n scheduledOrder: null,\r\n notesForPilot: null\r\n }\r\n\r\n return node;\r\n}","import {Person} from \"common/types/carriable\";\r\nimport {Location} from \"common/types/location\";\r\nimport * as Phase2State from \"./state\";\r\nimport {Actions, ActionType, DEFAULT_STATE, State} from \"./state\";\r\nimport {CargoFormData, DepDestListItem, GroupData, Phase2EntityFormData, Phase2ScheduleNode} from \"./types\";\r\nimport {Route} from \"antd/lib/breadcrumb/Breadcrumb\";\r\nimport {useBulkISNChecker} from \"../../../../components/BulkISNChecker\";\r\nimport {useApolloClient, useMutation, useQuery} from \"react-apollo\";\r\nimport React, {\r\n MutableRefObject,\r\n useContext,\r\n useEffect,\r\n useMemo,\r\n useReducer,\r\n useRef,\r\n useCallback,\r\n Dispatch\r\n} from \"react\";\r\nimport {OrgDataContext} from \"../../../../context/orgData\";\r\nimport {Mutations, Queries} from \"./graphql\";\r\nimport * as NotesForPilotRendererModule from \"../../../../components/flights/scheduling/notes-for-pilot/quickedit\";\r\nimport * as Util from \"./util\";\r\nimport {createSaveMutationVars, deRefLocations, findLegIdx, toScheduleNode} from \"./util\";\r\nimport {ResolvePersonIdsQuery} from \"../../../../Queries/Person\";\r\nimport checkScheduledPax from \"../../../../components/scheduling/checkScheduledPax\";\r\nimport {cleanGraphQLErrorMsg} from \"../../../../common/util\";\r\nimport {message, Modal} from \"antd\";\r\nimport {NetworkStatus} from \"apollo-client\";\r\nimport {personToPassenger} from \"../../../../common/person\";\r\nimport {cargoFormToCargoNode} from \"./cargo-util\";\r\nimport {Phase2SchedulerPageProps} from \"./phase-2-scheduler-page\";\r\nimport * as NotesForPilot from '../../../../components/flights/scheduling/notes-for-pilot';\r\nimport {ScheduledCgoNode, ScheduledPaxNode, ScheduleNode} from \"../../../../components/scheduling/types\";\r\nimport {getSNodeID} from \"../../../../components/scheduling/util\";\r\nimport * as PurgeEntitiesFromFlightTool from \"./purge-entities-from-flight-tool/state\";\r\nimport * as ScheduledToExpectedPaxCgo from './scheduled-to-expected-paxcgo/state';\r\nimport {useExtendedReducer} from \"hooks/custom-reducer-hook\";\r\n\r\n/**\r\n * Getters and setters for modifying and reading the state of the Phase2 page.\r\n * Abstracts access to the actual state object so that child components consuming the state don't break from\r\n * structure changes.\r\n *\r\n * TODO: Investigate ways to improve performance when using a \"global\" state like this.\r\n * Something as simple as adding a single note to notesForPilot requires an entire re-render of the page.\r\n * Look at potentially using the Redux library for this, or try to implement memoization.\r\n */\r\nexport interface Phase2Api {\r\n getState: () => Readonly,\r\n getDispatch: () => Dispatch\r\n getScheduledPaxNodes: () => ScheduledPaxNode[],\r\n getScheduledCgoNodes: () => ScheduledCgoNode[],\r\n groupData: GroupData,\r\n toScheduleNode: (phase2ScheduleNode: Phase2ScheduleNode) => ScheduleNode,\r\n data: {\r\n modifiedEntities: {\r\n get: () => State['data']['modifiedEntities'],\r\n getNotOnCarrier: () => State['data']['modifiedEntities'],\r\n set: (entities: Phase2ScheduleNode[]) => void,\r\n add: (entities: Phase2ScheduleNode[]) => void,\r\n remove: (entityIds: string[]) => void\r\n }\r\n originalEntities: {\r\n get: () => State['data']['originalEntities']\r\n }\r\n getModifiedEntityById: (entityId: string) => Phase2ScheduleNode | null,\r\n modifyEntity: (entityId: string, changedFields: Omit, '_id'>) => void,\r\n removeEntities: (entityIds: string[]) => void,\r\n removeLeg: (departureID: string, destinationID: string) => void,\r\n swapEntities: (startIdx: number, endIdx: number) => void,\r\n swapLegs: (start: DepDestListItem, end: DepDestListItem | 'up' | 'down') => void,\r\n getLegs: () => DepDestListItem[],\r\n setLegs: (legs: DepDestListItem[]) => void,\r\n setEntityLegs: (entities: string[], departure: Location, destination: Location) => void,\r\n reset: () => void,\r\n refetch: () => void,\r\n getNotesForPilot: () => Record\r\n },\r\n queryInfo: {\r\n loading: boolean,\r\n error: any,\r\n hasError: boolean\r\n },\r\n saveInfo: {\r\n saving: boolean,\r\n hasError: boolean\r\n },\r\n saveStatus: {\r\n get: () => State['saveStatus']\r\n dismiss: () => void\r\n }\r\n schedule: {\r\n save: () => void,\r\n notifySetCreated: (setID: string) => void,\r\n deleteSchedule: () => void,\r\n cancelEdits: () => void,\r\n\r\n // User is done with this schedule.\r\n // It's up to the parent component of the Phase2SchedulerPage what this does.\r\n // In the current case, it returns the user to the listing/calendar page.\r\n finish: () => void\r\n },\r\n selection: {\r\n entityIds: {\r\n get: () => string[],\r\n set: (newEntities: string[]) => void,\r\n add: (newEntities: string[]) => void,\r\n toggle: (entityID: string) => void,\r\n remove: (removedEntities: string[]) => void,\r\n clear: () => void,\r\n all: () => void\r\n },\r\n personnelIds: {\r\n get: () => State['carriableSelector']['selectedPersonnelIds'],\r\n set: (ids: string[]) => void,\r\n clear: () => void,\r\n getAsObjects: () => {\r\n loading: boolean,\r\n objects: Person[]\r\n }\r\n addToSchedule: (departureID: string, destinationID: string) => Promise\r\n }\r\n },\r\n mainHeader: {\r\n routes: Route[]\r\n },\r\n bulkIsnChecker: ReturnType,\r\n editMode: {\r\n toggle: () => void,\r\n set: (editing: boolean) => void,\r\n get: () => boolean\r\n }\r\n carriableSelector: {\r\n tabs: {\r\n set: (\r\n upperTab: typeof DEFAULT_STATE.carriableSelector.upperTab,\r\n lowerTab: typeof DEFAULT_STATE.carriableSelector.lowerTab\r\n ) => void,\r\n get: () => {\r\n upperTab: State['carriableSelector']['upperTab'],\r\n lowerTab: State['carriableSelector']['lowerTab']\r\n }\r\n },\r\n legSelector: {\r\n set: (departure: { key: string, label: string }, destination: { key: string, label: string }) => void,\r\n get: () => State['carriableSelector']['legSelector']\r\n },\r\n hideCarriablePanel: {\r\n get: () => State['carriableSelector']['hidePanel']\r\n set: (hide: boolean) => void,\r\n toggle: () => void\r\n }\r\n },\r\n forms: {\r\n entityForm: {\r\n get: (entityId: string) => Phase2EntityFormData,\r\n set: (entityId: string, formData: Phase2EntityFormData) => void,\r\n listEntityIds: () => string[],\r\n ref: MutableRefObject\r\n },\r\n cargoForm: {\r\n get: () => State['forms']['cargoForm'],\r\n setFields: (fields: State['forms']['cargoForm']) => void,\r\n resetFields: () => void,\r\n submit: (departureID: string, destinationID: string) => Promise,\r\n ref: MutableRefObject\r\n },\r\n groupForm: {\r\n get: () => State['forms']['groupForm'],\r\n setFields: (fields: State['forms']['groupForm']) => void,\r\n resetFields: () => void,\r\n ref: MutableRefObject\r\n },\r\n newLegForm: {\r\n get: () => State['forms']['newLegForm'],\r\n setFields: (fields: State['forms']['newLegForm']) => void,\r\n resetFields: () => void\r\n },\r\n searchForm: {\r\n set: (searchForm: typeof DEFAULT_STATE.carriableSelector.searchForm) => void,\r\n get: () => State['carriableSelector']['searchForm']\r\n }\r\n },\r\n modal: {\r\n paxModal: {\r\n open: (pax: ScheduledPaxNode) => void,\r\n close: () => void,\r\n get: () => State['modal']['paxModal']\r\n },\r\n newLegFormModal: {\r\n open: (\r\n departure?: Location | null,\r\n destination?: Location | null,\r\n callback?: State['modal']['newLegFormModal']['callback']\r\n ) => void,\r\n close: () => void,\r\n get: () => State['modal']['newLegFormModal'],\r\n callback?: State['modal']['newLegFormModal']['callback']\r\n }\r\n },\r\n drawer: {\r\n isnDrawer: {\r\n open: (pax: ScheduledPaxNode) => void,\r\n close: () => void,\r\n get: () => State['editor']['isnDrawer']\r\n }\r\n },\r\n chargeCodes: {\r\n getDefault: () => State['editor']['defaultChargeCode'],\r\n clear: () => void,\r\n setDefault: (chargeCode: string) => void\r\n },\r\n editor: {\r\n visibleLegs: {\r\n get: () => ({ departureID: string, destinationID: string }[]),\r\n isLegVisible: (departureID: string, destinationID: string) => boolean,\r\n showAll: () => void,\r\n hideAll: () => void,\r\n getAsStrings: () => string[],\r\n setAsStrings: (keys: string[]) => void,\r\n show: (departure: string, destination: string) => void\r\n }\r\n },\r\n notesForPilot: {\r\n getModifiedText: () => string,\r\n getQuickEditProps: (entityId: string) => Partial,\r\n editor: {\r\n isOpen: () => boolean,\r\n open: () => void,\r\n close: () => void,\r\n getNotes: () => NotesForPilot.Editor.State['notes'],\r\n hasNotes: () => boolean,\r\n submit: () => void,\r\n getEditorProps: () => Partial\r\n getToolbarProps: () => NotesForPilot.Editor.ToolbarProps\r\n }\r\n },\r\n purgeEntitiesFromFlightTool: PurgeEntitiesFromFlightTool.Api,\r\n scheduledToExpectedPaxCgo: ScheduledToExpectedPaxCgo.Api\r\n}\r\n\r\nexport interface GetModifiedEntitiesOptions {\r\n removeOnCarrier: boolean\r\n}\r\n\r\nconst POLL_INTERVAL = 10000;\r\n\r\n/**\r\n * Implements the Phase2Api as a React hook\r\n */\r\nexport function usePhase2SchedulerApi(props: Phase2SchedulerPageProps){\r\n const apolloClient = useApolloClient();\r\n\r\n // Hooks -----------------------------------------------------------------------------------------------------------\r\n const [ state, dispatch ] = useExtendedReducer(Phase2State.Reducer, Phase2State.DEFAULT_STATE);\r\n\r\n const orgData = useContext(OrgDataContext);\r\n\r\n const groupFormRef = useRef(null);\r\n const cargoFormRef = useRef(null);\r\n const entityFormRef = useRef(null);\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n function _toScheduleNode(phase2ScheduleNode: Phase2ScheduleNode){\r\n return toScheduleNode(phase2ScheduleNode, state.formDataMap);\r\n }\r\n\r\n // Read schedule ---------------------------------------------------------------------------------------------------\r\n let queryVars = null;\r\n if (props.groupData){\r\n queryVars = {\r\n tpID: props.groupData.tpID,\r\n customerID: props.groupData.customerID,\r\n scheduledFlightDate: props.groupData.date,\r\n scheduledGroup: props.groupData.name,\r\n lastKnownController: props.groupData.lastKnownController\r\n }\r\n }\r\n const queryResult = useQuery(Queries.GetScheduledPaxCgoV2, {\r\n variables: queryVars,\r\n skip: !queryVars,\r\n fetchPolicy: 'network-only',\r\n errorPolicy: 'all'\r\n })\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // ISN checker hook ------------------------------------------------------------------------------------------------\r\n function onIsnCheckerFinished(){\r\n queryResult.refetch();\r\n }\r\n\r\n const bulkISNChecker = useBulkISNChecker(\r\n apolloClient, orgData.getActiveOrg()?._id,\r\n onIsnCheckerFinished\r\n );\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Write schedule --------------------------------------------------------------------------------------------------\r\n const [ mutateSchedule, mutationResult ] = useMutation(Mutations.SaveSchedulePaxCgoV2, {\r\n onCompleted: () => {\r\n queryResult.refetch();\r\n const paxIds = state.data.modifiedEntities\r\n .filter(entity => entity.classType === 'flytsuite.paxnode')\r\n .map(pax => getSNodeID(pax as ScheduleNode));\r\n bulkISNChecker.runChecks(paxIds);\r\n }\r\n });\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Updates the state as a side effect to prop changes --------------------------------------------------------------\r\n useEffect(() => {\r\n\r\n // Update editMode if prop is defined.\r\n if (props.editMode !== undefined && state.editMode !== props.editMode){\r\n dispatch({ type: ActionType.SET_EDIT_MODE, payload: props.editMode });\r\n }\r\n\r\n // Query will only poll if not in edit mode\r\n if (!state.editMode)\r\n queryResult.startPolling(POLL_INTERVAL);\r\n else\r\n queryResult.stopPolling();\r\n\r\n // Initialize data state\r\n if (queryResult.data?.GetScheduledPaxCgoV2){\r\n const data = queryResult.data?.GetScheduledPaxCgoV2;\r\n let entities = [...data.paxnodes, ...data.cgonodes ];\r\n dispatch({\r\n type: ActionType.INIT_DATA,\r\n entities: entities,\r\n group: {\r\n ...props.groupData,\r\n lastKnownControllerObj: queryResult.data?.getLastKnownController as Location\r\n }\r\n })\r\n }\r\n\r\n if (\r\n queryResult.loading !== state.queryStatus.loading ||\r\n queryResult.error !== state.queryStatus.error\r\n ){\r\n dispatch({ type: ActionType.SET_QUERY_STATUS, payload: { loading: queryResult.loading, error: queryResult.error } })\r\n }\r\n\r\n }, [\r\n props.editMode,\r\n state.editMode,\r\n queryResult.data?.GetScheduledPaxCgoV2,\r\n queryResult.loading,\r\n queryResult.error\r\n ]);\r\n\r\n // Show and hide left panel if editMode changes.\r\n useEffect(() => {\r\n if (state.editMode){\r\n dispatch({ type: ActionType.SET_HIDE_CARRIABLE_PANEL, payload: false });\r\n }\r\n else\r\n {\r\n dispatch({ type: ActionType.SET_HIDE_CARRIABLE_PANEL, payload: true });\r\n }\r\n }, [state.editMode]);\r\n\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Tune visible legs -----------------------------------------------------------------------------------------------\r\n // Visible legs will be determined by how many legs there are. If there are more than 5 legs, all legs will be\r\n // collapsed by default.\r\n useEffect(() => {\r\n if (state.data.originalEntities.length > 0){\r\n // Data has just been filled in after query finished.\r\n const legs = Util.DepDestList.build(state.data.originalEntities);\r\n\r\n if (legs.length > 5){\r\n dispatch({ type: ActionType.SET_VISIBLE_LEGS, mode: 'objects', action: 'set', payload: [] });\r\n }\r\n else\r\n {\r\n const depDestList = legs.map(item => ({\r\n departureID: item.departure._id,\r\n destinationID: item.destination._id\r\n }));\r\n dispatch({ type: ActionType.SET_VISIBLE_LEGS, mode: 'objects', action: 'set', payload: depDestList });\r\n }\r\n }\r\n }, [\r\n state.data.originalEntities.length > 0\r\n ]);\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Dereferences person id list to real personnel documents ---------------------------------------------------------\r\n const derefSelPersonnelResult = useQuery(ResolvePersonIdsQuery, {\r\n variables: {\r\n ids: state.carriableSelector.selectedPersonnelIds\r\n },\r\n fetchPolicy: 'cache-first',\r\n errorPolicy: 'all'\r\n })\r\n const selectedPersonnelObjs = (derefSelPersonnelResult.data?.resolve_entity_ids || []) as (Person | undefined)[];\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n function createDispatchFunc(type: T){\r\n return (payload: any) => dispatch({ type: type as any, payload: payload });\r\n }\r\n\r\n function createDispatchFuncNoPayload(type: T){\r\n return () => dispatch({ type: type as any });\r\n }\r\n\r\n function setEditMode(editing: boolean){\r\n if (props.editMode !== undefined && props.onEditModeChange){\r\n props.onEditModeChange(editing);\r\n return;\r\n }\r\n dispatch({ type: ActionType.SET_EDIT_MODE, payload: editing });\r\n }\r\n\r\n let groupData: GroupData = null;\r\n if (queryResult.data?.getLastKnownController){\r\n groupData = {\r\n ...props.groupData,\r\n lastKnownControllerObj: queryResult.data.getLastKnownController\r\n }\r\n }\r\n\r\n // If I don't use useMemo, the filtered list will return a different reference\r\n // every render. This ensures the filtered version of modifiedEntities only changes references\r\n // when modifiedEntities changes.\r\n const modifiedEntitiesNotOnCarrier = useMemo(() => {\r\n return state.data.modifiedEntities.filter((entity) => {\r\n return !Boolean(entity.currentCarrierID)\r\n })\r\n }, [ state.data.modifiedEntities ])\r\n\r\n // Implements the API used by child components to communicate with other child components --------------------------\r\n const api: Phase2Api = {\r\n getState: () => state,\r\n getDispatch: () => dispatch,\r\n getScheduledPaxNodes: () => state.data.modifiedEntities.filter(e => e.classType === 'flytsuite.paxnode') as ScheduledPaxNode[],\r\n getScheduledCgoNodes: () => state.data.modifiedEntities.filter(e => e.classType === 'flytsuite.cgonode') as ScheduledCgoNode[],\r\n bulkIsnChecker: bulkISNChecker,\r\n groupData: groupData,\r\n toScheduleNode: _toScheduleNode,\r\n data: {\r\n modifiedEntities: {\r\n get: () => state.data.modifiedEntities,\r\n getNotOnCarrier: () => modifiedEntitiesNotOnCarrier,\r\n set: (entities) => dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, set: entities }),\r\n add: (entities) => dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, add: entities }),\r\n remove: (entityIds) => dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, remove: entityIds }),\r\n },\r\n originalEntities: {\r\n get: () => state.data.originalEntities\r\n },\r\n getModifiedEntityById: (entityId) => state.data.modifiedEntities\r\n .find((entity) => getSNodeID(entity as ScheduleNode) === entityId),\r\n removeLeg(departureID, destinationID) {\r\n const entitiesToRemove = state.data.modifiedEntities\r\n .filter(entity => (\r\n entity.departureID?._id === departureID && entity.destinationID?._id === destinationID\r\n ))\r\n .map(e => getSNodeID(_toScheduleNode(e)));\r\n\r\n if (entitiesToRemove.length){\r\n dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, remove: entitiesToRemove });\r\n }\r\n },\r\n modifyEntity(entityId, changedFields){\r\n const entityObj = state.data.modifiedEntities\r\n .find(e => getSNodeID(_toScheduleNode(e)) === entityId);\r\n\r\n if (!entityObj) return;\r\n\r\n const newEntity = {\r\n ...entityObj,\r\n ...changedFields\r\n } as Phase2ScheduleNode;\r\n\r\n dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, add: [newEntity] });\r\n },\r\n\r\n removeEntities(entities) {\r\n dispatch({type: ActionType.SET_MODIFIED_ENTITIES, remove: entities})\r\n },\r\n\r\n swapEntities(startIdx, endIdx) {\r\n if (!state.data.modifiedEntities.length) return;\r\n if (startIdx < 0 || startIdx >= state.data.modifiedEntities.length) return;\r\n if (endIdx < 0 || endIdx >= state.data.modifiedEntities.length) return;\r\n\r\n const entityListCopy = [...state.data.modifiedEntities];\r\n\r\n const startObj = entityListCopy[startIdx];\r\n const endObj = entityListCopy[endIdx];\r\n\r\n if (\r\n startObj.departureID?._id !== endObj.departureID?._id ||\r\n startObj.destinationID?._id !== endObj.destinationID?._id\r\n ){\r\n // Prevent reordering between legs\r\n return;\r\n }\r\n\r\n entityListCopy[startIdx] = endObj;\r\n entityListCopy[endIdx] = startObj;\r\n\r\n dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, set: entityListCopy });\r\n },\r\n\r\n swapLegs(start, arg1) {\r\n\r\n // Compute legs from data\r\n const legs = this.getLegs();\r\n\r\n const startIdx = findLegIdx(legs, start);\r\n let endIdx = -1;\r\n\r\n if (typeof arg1 === 'string'){\r\n // arg1 is either \"up\" or \"down\"\r\n if (arg1 === 'up'){\r\n endIdx = startIdx - 1;\r\n }\r\n else if (arg1 === 'down')\r\n {\r\n endIdx = startIdx + 1;\r\n }\r\n }\r\n else\r\n {\r\n // arg1 is another DepDestListItem\r\n endIdx = findLegIdx(legs, arg1);\r\n }\r\n\r\n if (\r\n startIdx < 0 || endIdx < 0 ||\r\n startIdx >= legs.length || endIdx >= legs.length\r\n ){\r\n console.error(new Error(`Index out of bounds: startIdx: ${startIdx}, endIdx: ${endIdx}`))\r\n return;\r\n }\r\n\r\n // Swap\r\n {\r\n const temp = legs[startIdx];\r\n legs[startIdx] = legs[endIdx];\r\n legs[endIdx] = temp;\r\n }\r\n\r\n this.setLegs(legs);\r\n },\r\n\r\n getLegs() {return Util.DepDestList.build(api.data.modifiedEntities.get()) },\r\n\r\n setLegs(legs) {\r\n const newEntities = Util.DepDestList.toEntities(legs);\r\n dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, set: newEntities });\r\n },\r\n\r\n setEntityLegs(entityIds, departure, destination) {\r\n const newEntities = entityIds\r\n .map(entityId => state.data.modifiedEntities.find(e => getSNodeID(_toScheduleNode(e)) === entityId))\r\n .filter(e => e)\r\n .map((entity) => {\r\n return {\r\n ...entity,\r\n departureID: departure,\r\n destinationID: destination\r\n }\r\n });\r\n\r\n dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, add: newEntities });\r\n dispatch({ type: ActionType.SET_SELECTED_ENTITY_IDS, set: [] });\r\n },\r\n\r\n reset(){ dispatch({ type: ActionType.RESET_DATA }); },\r\n refetch(){\r\n queryResult.refetch();\r\n },\r\n\r\n getNotesForPilot() {\r\n /* Gather all notesForPilot values from pax and cargo and create a dictionary of them with this structure:\r\n {\r\n : ScheduleNode[]\r\n }\r\n */\r\n\r\n return Util.getNoteMap(state.data.modifiedEntities as ScheduleNode[])\r\n }\r\n },\r\n queryInfo: {\r\n loading: state.queryStatus.loading,\r\n error: state.queryStatus.error,\r\n hasError: !!state.queryStatus.error\r\n },\r\n saveInfo: {\r\n saving: mutationResult.loading,\r\n hasError: !!mutationResult.error\r\n },\r\n saveStatus: {\r\n get: () => state.saveStatus,\r\n dismiss: createDispatchFuncNoPayload(ActionType.DISMISS_SAVE_STATUS)\r\n },\r\n editMode: {\r\n get: () => state.editMode,\r\n toggle: () => setEditMode(!state.editMode),\r\n set: setEditMode\r\n },\r\n schedule: {\r\n cancelEdits: () => props.onCancel?.(),\r\n notifySetCreated: (setID) => props.onNewSetCreated?.(setID),\r\n finish: () => props.onFinished?.(),\r\n save: () => {\r\n let passengers: any[] = state.data.modifiedEntities.filter((item) => item.classType === 'flytsuite.paxnode');\r\n checkScheduledPax(passengers, () => {\r\n groupFormRef.current.props.form.validateFieldsAndScroll((groupErr: boolean, groupValues: any) => {\r\n if (!groupErr){\r\n entityFormRef.current.validateFieldsAndScroll((entityErr: boolean) => {\r\n if (entityErr) return;\r\n\r\n let vars = createSaveMutationVars(\r\n orgData,\r\n {\r\n date: groupValues.date,\r\n lastKnownController: groupValues.lastKnownController.key,\r\n group: groupValues.name\r\n },\r\n state.data.modifiedEntities,\r\n state.data.deletedEntities,\r\n state.formDataMap,\r\n state.editor.defaultChargeCode\r\n );\r\n mutateSchedule({\r\n variables: vars\r\n })\r\n .then(() => {\r\n props.onScheduleSaved?.({\r\n variables: vars,\r\n modifiedEntities: state.data.modifiedEntities as ScheduleNode[]\r\n });\r\n dispatch(\r\n {\r\n type: ActionType.SET_SAVE_STATUS,\r\n payload: {\r\n status: 'success',\r\n message: `Successfully saved ${state.data.modifiedEntities.length} pax/cgo`\r\n }\r\n }\r\n );\r\n }\r\n )\r\n .catch((e) => {\r\n console.error('Failed to save schedule due to error: ', e);\r\n dispatch(\r\n {\r\n type: ActionType.SET_SAVE_STATUS,\r\n payload: {\r\n status: 'error',\r\n message: 'Failed to save schedule',\r\n description: cleanGraphQLErrorMsg(e)\r\n }\r\n }\r\n );\r\n })\r\n })\r\n }\r\n })\r\n });\r\n },\r\n deleteSchedule: () => {\r\n const vars = createSaveMutationVars(\r\n orgData,\r\n {\r\n date: props.groupData.date,\r\n lastKnownController: props.groupData.lastKnownController,\r\n group: props.groupData.name\r\n },\r\n [],\r\n state.data.originalEntities,\r\n state.formDataMap\r\n )\r\n mutateSchedule({\r\n variables: vars,\r\n })\r\n .then(() => {\r\n message.success('Schedule deleted successfully');\r\n props.onScheduleDeleted?.()\r\n })\r\n .catch((e) => {\r\n message.error(\"Failed to delete schedule\");\r\n console.error('Failed to delete schedule: ', e);\r\n })\r\n }\r\n },\r\n mainHeader: {\r\n routes: props.mainHeaderRoutes\r\n },\r\n selection: {\r\n entityIds: {\r\n get: () => state.editor.selectedEntityIds,\r\n set: (newEntities) => dispatch({ type: ActionType.SET_SELECTED_ENTITY_IDS, set: newEntities }),\r\n add: (newEntities) => dispatch({ type: ActionType.SET_SELECTED_ENTITY_IDS, add: newEntities }),\r\n remove: (removedEntities) => dispatch({ type: ActionType.SET_SELECTED_ENTITY_IDS, remove: removedEntities }),\r\n toggle(entityID){\r\n if (!state.editor.selectedEntityIds.includes(entityID))\r\n this.add([entityID]);\r\n else\r\n this.remove([entityID]);\r\n },\r\n clear: () => dispatch({ type: ActionType.SET_SELECTED_ENTITY_IDS, set: [] }),\r\n all: () => {\r\n let entities = state.data.modifiedEntities.map(e => getSNodeID(_toScheduleNode(e)));\r\n dispatch({ type: ActionType.SET_SELECTED_ENTITY_IDS, set: entities });\r\n }\r\n },\r\n personnelIds: {\r\n set: createDispatchFunc(ActionType.SET_SELECTED_PERSONNEL_IDS),\r\n get: () => state.carriableSelector.selectedPersonnelIds,\r\n getAsObjects: () => ({\r\n loading: [NetworkStatus.loading, NetworkStatus.setVariables].includes(derefSelPersonnelResult.networkStatus),\r\n objects: selectedPersonnelObjs\r\n }),\r\n clear: () => dispatch({ type: ActionType.SET_SELECTED_PERSONNEL_IDS, payload: [] }),\r\n addToSchedule: async (departureID: string, destinationID: string) => {\r\n // If derefSelPersonnelResult is still loading, we can't do anything.\r\n if (derefSelPersonnelResult.loading){\r\n message.error('Error: Personnel data is still loading. Please try again.')\r\n return;\r\n }\r\n\r\n // Re-reference locations to real location documents\r\n const locResult = await deRefLocations(apolloClient, [departureID, destinationID]);\r\n if (locResult.errors.length){\r\n message.error(\"Failed to get locations.\");\r\n return;\r\n }\r\n const [ departure, destination ] = locResult.data;\r\n\r\n // Convert personnel to PaxNode stubs\r\n function toPassenger(person: Person){\r\n\r\n const pax = personToPassenger(\r\n person,\r\n {\r\n departureID: departure,\r\n destinationID: destination,\r\n customerID: person.customerID,\r\n tpID: orgData.transporterID,\r\n chargeCode: null\r\n }\r\n );\r\n\r\n // Using _id is a bad idea\r\n pax.__temp_id = Util.genTempID();\r\n delete pax._id;\r\n return pax;\r\n }\r\n\r\n let autoFilledPersons = [];\r\n\r\n selectedPersonnelObjs.forEach((person) => {\r\n if (person.lastPaxWeight || person.lastBagWeight || person.lastBagCount){\r\n autoFilledPersons.push(person);\r\n }\r\n });\r\n\r\n if (autoFilledPersons.length){\r\n message.info(`Previous weight info found for ${autoFilledPersons.length} personnel. \r\n Auto-filled fields.`, 5);\r\n }\r\n\r\n const paxNodes = selectedPersonnelObjs.map(toPassenger);\r\n\r\n dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, add: paxNodes })\r\n }\r\n }\r\n },\r\n carriableSelector: {\r\n tabs: {\r\n set: (upperTab, lowerTab) =>\r\n dispatch({ type: ActionType.SET_CARRIABLE_SELECTOR_TAB, payload: { upperTab, lowerTab } }),\r\n get: () => ({\r\n upperTab: state.carriableSelector.upperTab,\r\n lowerTab: state.carriableSelector.lowerTab\r\n })\r\n },\r\n legSelector: {\r\n set: (departure, destination) => (\r\n dispatch({ type: ActionType.SET_LEG_SELECTOR, payload: { departure, destination } })\r\n ),\r\n get: () => state.carriableSelector.legSelector\r\n },\r\n hideCarriablePanel: {\r\n get: () => state.carriableSelector.hidePanel,\r\n set: createDispatchFunc(ActionType.SET_HIDE_CARRIABLE_PANEL),\r\n toggle: () => dispatch({ type: ActionType.SET_HIDE_CARRIABLE_PANEL, payload: undefined }),\r\n }\r\n },\r\n forms: {\r\n entityForm: {\r\n get: (entityId) => {\r\n return state.formDataMap[entityId];\r\n },\r\n set: (entityId, formData) => dispatch({ type: ActionType.SET_ENTITY_FORM_DATA, entityId, payload: formData }),\r\n listEntityIds: () => Object.keys(state.formDataMap),\r\n ref: entityFormRef\r\n },\r\n cargoForm: {\r\n get: () => state.forms.cargoForm,\r\n setFields: (fields) => dispatch({ type: ActionType.SET_FORM_DATA, cargo: fields }),\r\n resetFields: () => dispatch({\r\n type: ActionType.RESET_FORM_DATA,\r\n cargo: true\r\n }),\r\n submit: async (departureID, destinationID) => {\r\n\r\n // Make sure form is valid\r\n cargoFormRef.current.validateFieldsAndScroll(async (err: unknown, formValues: CargoFormData) => {\r\n if (err) return;\r\n\r\n // Re-reference locations to real location documents\r\n const locResult = await deRefLocations(apolloClient, [departureID, destinationID]);\r\n if (locResult.errors.length){\r\n message.error(\"Failed to get locations.\");\r\n return;\r\n }\r\n const [ departure, destination ] = locResult.data;\r\n\r\n const cgoNode = cargoFormToCargoNode(formValues, orgData, departure, destination);\r\n\r\n dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, add: [cgoNode] });\r\n })\r\n },\r\n ref: cargoFormRef\r\n },\r\n groupForm: {\r\n get: () => state.forms.groupForm,\r\n setFields: (fields) => dispatch({ type: ActionType.SET_FORM_DATA, group: fields }),\r\n resetFields: () => dispatch({\r\n type: ActionType.RESET_FORM_DATA,\r\n group: true\r\n }),\r\n ref: groupFormRef\r\n },\r\n newLegForm: {\r\n get: () => state.forms.newLegForm,\r\n setFields: (fields) => dispatch({ type: ActionType.SET_FORM_DATA, newLeg: fields }),\r\n resetFields: () => dispatch({\r\n type: ActionType.RESET_FORM_DATA,\r\n newLeg: true\r\n })\r\n },\r\n searchForm: {\r\n get: () => state.carriableSelector.searchForm,\r\n set: createDispatchFunc(ActionType.SET_CARRIABLE_SEL_SEARCH)\r\n }\r\n },\r\n modal: {\r\n newLegFormModal: {\r\n get: () => state.modal.newLegFormModal,\r\n open: (departure=null, destination=null, callback=null) => {\r\n\r\n if (departure && destination){\r\n const newLegValue = {\r\n departure: { key: departure._id, label: departure.name },\r\n destination: { key: destination._id, label: destination.name },\r\n }\r\n dispatch({ type: ActionType.SET_NEW_LEG_MODAL, visible: true, newLegValue: newLegValue, callback });\r\n return;\r\n }\r\n dispatch({ type: ActionType.SET_NEW_LEG_MODAL, visible: true, callback });\r\n },\r\n close: () => dispatch({ type: ActionType.SET_NEW_LEG_MODAL, visible: false }),\r\n callback: state.modal.newLegFormModal.callback\r\n },\r\n paxModal: {\r\n get: () => state.modal.paxModal,\r\n open: (pax) => dispatch({ type: ActionType.SET_PAXNODE_MODAL, pax, visible: true }),\r\n close: () => dispatch({ type: ActionType.SET_PAXNODE_MODAL, visible: false })\r\n },\r\n },\r\n drawer: {\r\n isnDrawer: {\r\n get: () => state.editor.isnDrawer,\r\n open: (pax) => dispatch({ type: ActionType.SET_ISN_DRAWER, payload: { pax, visible: true } }),\r\n close: () => dispatch({\r\n type: ActionType.SET_ISN_DRAWER,\r\n payload: { pax: state.editor.isnDrawer.pax, visible: false }\r\n })\r\n },\r\n },\r\n chargeCodes: {\r\n getDefault: () => state.editor.defaultChargeCode,\r\n setDefault: createDispatchFunc(ActionType.SET_DEFAULT_CHARGE_CODE),\r\n clear: () => dispatch({ type: ActionType.CLEAR_CHARGE_CODES })\r\n },\r\n editor: {\r\n visibleLegs: {\r\n get: () => state.editor.visibleLegs,\r\n show: (departureID, destinationID) => {\r\n const payload = {\r\n departureID: departureID,\r\n destinationID: destinationID\r\n }\r\n dispatch({ type: ActionType.SET_VISIBLE_LEGS, mode: 'objects', action: 'add', payload: [payload] });\r\n },\r\n isLegVisible: (departureID, destinationID) => (\r\n Boolean(\r\n state.editor.visibleLegs.find((item) => (\r\n item.departureID === departureID && item.destinationID === destinationID)\r\n )\r\n )\r\n ),\r\n showAll: () => {\r\n const data = Util.DepDestList.build(state.data.modifiedEntities);\r\n\r\n const depDestList = data\r\n .map(item => ({\r\n departureID: item.departure._id,\r\n destinationID: item.destination._id\r\n }));\r\n\r\n dispatch({ type: ActionType.SET_VISIBLE_LEGS, mode: 'objects', action: 'set', payload: depDestList })\r\n },\r\n hideAll: () => {\r\n dispatch({ type: ActionType.SET_VISIBLE_LEGS, mode: 'objects', action: 'set', payload: [] });\r\n },\r\n setAsStrings: (keys) => (\r\n dispatch({ type: ActionType.SET_VISIBLE_LEGS, mode: 'strings', action: 'set', splitBy: '::', payload: keys })\r\n ),\r\n getAsStrings: () => {\r\n return state.editor.visibleLegs\r\n .map(item => `${item.departureID}::${item.destinationID}`)\r\n }\r\n }\r\n },\r\n notesForPilot: {\r\n getModifiedText: () => state.notesForPilotPopup.modifiedText,\r\n getQuickEditProps: (entityId: string) => {\r\n\r\n let componentState = NotesForPilotRendererModule.DEFAULT_STATE;\r\n\r\n if (entityId === state.notesForPilotPopup.entityId)\r\n // If this is not the current entity having notes edited, then this NotesForPilotQuickedit should be closed.\r\n componentState = {\r\n open: state.notesForPilotPopup.open,\r\n editMode: state.notesForPilotPopup.editMode,\r\n modifiedText: state.notesForPilotPopup.modifiedText,\r\n originalText: state.notesForPilotPopup.originalText\r\n }\r\n\r\n const stateProps = {\r\n state: componentState,\r\n dispatch: (value) => {\r\n dispatch({ type: ActionType.NOTES_FOR_PILOT_POPUP, entityId, action: value })\r\n }\r\n }\r\n\r\n return {\r\n overrideState: stateProps\r\n }\r\n },\r\n editor: {\r\n isOpen: () => state.notesForPilotEditor.open,\r\n open: () => dispatch({ type: ActionType.NOTES_FOR_PILOT_EDITOR, open: true }),\r\n close: () => dispatch({ type: ActionType.NOTES_FOR_PILOT_EDITOR, open: false }),\r\n getNotes: () => state.notesForPilotEditor.state.notes,\r\n hasNotes: () => Boolean(Object.keys(state.notesForPilotEditor.state.notes).length),\r\n submit: () => {\r\n\r\n function handleSubmit(){\r\n dispatch({ type: ActionType.SUBMIT_NOTES_FOR_PILOT_EDITOR });\r\n }\r\n\r\n // Confirm with user that there are notes that are not assigned to any PAX/CGO and\r\n // it will remove them when they submit.\r\n const unassignedNotes = NotesForPilot.Editor.Util\r\n .findUnassignedNoteIds(state.notesForPilotEditor.state);\r\n\r\n if (unassignedNotes.length){\r\n Modal.confirm({\r\n title: 'Unassigned notes found',\r\n content: (\r\n `${unassignedNotes.length} notes have no PAX/CGO assigned and they will be removed if you continue.`\r\n ),\r\n okText: 'Continue',\r\n onOk: handleSubmit\r\n })\r\n return;\r\n }\r\n\r\n handleSubmit();\r\n },\r\n getEditorProps: () => {\r\n return {\r\n overrideState: {\r\n state: state.notesForPilotEditor.state,\r\n dispatch: (action) => dispatch({ type: ActionType.NOTES_FOR_PILOT_EDITOR, action: action })\r\n }\r\n }\r\n },\r\n getToolbarProps: () => {\r\n return {\r\n state: state.notesForPilotEditor.state,\r\n dispatch: (action) => dispatch({ type: ActionType.NOTES_FOR_PILOT_EDITOR, action: action })\r\n }\r\n }\r\n }\r\n },\r\n purgeEntitiesFromFlightTool: null,\r\n scheduledToExpectedPaxCgo: null\r\n }\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n api.purgeEntitiesFromFlightTool = PurgeEntitiesFromFlightTool.useApi(api);\r\n api.scheduledToExpectedPaxCgo = ScheduledToExpectedPaxCgo.useApi(api);\r\n\r\n return api;\r\n}","import MainHeader, {MainHeaderProps} from \"../../../../components/scheduling/MainHeader\";\r\nimport {Button, Col, Icon, message, Modal, Row, Tooltip} from \"antd\";\r\nimport React, {useContext} from \"react\";\r\nimport * as Phase2State from './state';\r\nimport useUserGroups from \"../../../../hooks/useUserGroups\";\r\nimport {TransitType} from \"../../../../common/types/carriable\";\r\nimport * as Util from \"./util\";\r\nimport MCIcon from \"../../../../components/icon\";\r\nimport {getSNodeID} from \"../../../../components/scheduling/util\";\r\n\r\nconst BASE_CLS = Util.BASE_CLS;\r\n\r\ninterface Phase2MainHeaderProps {}\r\n\r\nexport interface Phase2MainHeaderProps_Internal extends Phase2MainHeaderProps {}\r\n\r\nconst Phase2MainHeader: React.FC = (props) => {\r\n\r\n const { api } = useContext(Phase2State.Context);\r\n const [ userGroups ] = useUserGroups();\r\n\r\n const outboundPaxData = api.getScheduledPaxNodes()\r\n .filter(pax => pax.transitType === TransitType.OUTBOUND);\r\n\r\n function runIsnCheck () {\r\n if (api.editMode.get()){\r\n message.error('Cannot run ISN check in edit mode');\r\n return;\r\n }\r\n\r\n api.bulkIsnChecker.runChecks(outboundPaxData.map((pax) => getSNodeID(pax)));\r\n }\r\n\r\n let mainHeaderProps: MainHeaderProps = {\r\n routes: api.mainHeader.routes,\r\n afterRoutes: (\r\n BETA\r\n ),\r\n actions: (\r\n \r\n \r\n \r\n \r\n \r\n \r\n {api.saveInfo.saving ? (\r\n \r\n ) : null}\r\n Save Changes\r\n \r\n \r\n \r\n )\r\n }\r\n if (!api.editMode.get()){\r\n\r\n let deleteScheduleDisabled = false;\r\n\r\n let paxOnFlight = api.data.modifiedEntities.get().filter(pax => pax.currentCarrierID);\r\n\r\n if (api.bulkIsnChecker.running || paxOnFlight.length)\r\n deleteScheduleDisabled = true;\r\n\r\n let deleteScheduleBtn = (\r\n {\r\n Modal.confirm({\r\n title: 'Are you sure?',\r\n content: `Are you sure you want to delete ${api.data.originalEntities.get().length} passengers/cargo?`,\r\n onOk() {\r\n api.schedule.deleteSchedule();\r\n // props.onDeleteGroup(createSaveMutationVars(\r\n // orgData,\r\n // {\r\n // date: props.groupData.date,\r\n // lastKnownController: props.groupData.lastKnownController,\r\n // departureID: props.groupData.departureID,\r\n // destinationID: props.groupData.destinationID,\r\n // group: props.groupData.name\r\n // },\r\n // [],\r\n // data\r\n // ))\r\n }\r\n })\r\n }}\r\n >\r\n Delete Schedule\r\n \r\n );\r\n let deleteScheduleBtnWrapped = deleteScheduleBtn;\r\n\r\n if (paxOnFlight.length){\r\n deleteScheduleBtnWrapped = (\r\n \r\n

    {paxOnFlight.length} PAX/CGO are on a flight. They need to be removed from their flight before you can do this.

    \r\n Click on the{' '}{' '}icon to go to their assigned flight.\r\n \r\n }>\r\n {deleteScheduleBtn}\r\n
    \r\n )\r\n }\r\n\r\n if (!userGroups.includes('flytsuite.schedule.passenger')){\r\n deleteScheduleBtnWrapped = (\r\n \r\n {deleteScheduleBtn}\r\n \r\n )\r\n }\r\n\r\n mainHeaderProps.actions = (\r\n \r\n \r\n {deleteScheduleBtnWrapped}\r\n \r\n \r\n {/* TODO: Add V2 schedule support to the CreatePersonSet component */}\r\n \r\n \r\n Create Set\r\n \r\n \r\n {/**/}\r\n \r\n {/* TODO: Add V2 schedule support to the ManifestPrintout component */}\r\n \r\n \r\n Download Printout\r\n \r\n \r\n {/**/}\r\n {/* */}\r\n {/* {({ data, loading, error }: any) => {*/}\r\n {/* return */}\r\n {/* */}\r\n {/* */}\r\n {/* }}*/}\r\n {/* */}\r\n {/**/}\r\n \r\n {userGroups.includes('flytsuite.schedule.passenger') ? (\r\n runIsnCheck()}>Run ISN Check\r\n ) : (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n {userGroups.includes('flytsuite.schedule.passenger') ? (\r\n \r\n Edit\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\nexport default Phase2MainHeader;","import React from 'react';\r\nimport * as Phase2State from \"./state\";\r\nimport {Alert, Icon, Layout, Spin} from 'antd';\r\nimport './phase-2-scheduler.less';\r\nimport {BASE_CLS} from \"./util\";\r\nimport CarriableSelector from \"./carriable-selector\";\r\nimport Phase2Editor from \"./editor\";\r\nimport {Route} from \"antd/lib/breadcrumb/Breadcrumb\";\r\nimport {usePhase2SchedulerApi} from \"./api\";\r\nimport {GroupDataProps, ScheduleVariables} from \"./types\";\r\nimport MainLayout from \"../../../../components/scheduling/MainLayout\";\r\nimport Phase2MainHeader from \"./main-header\";\r\nimport {cleanGraphQLErrorMsg} from \"../../../../common/util\";\r\nimport {ScheduleNode} from \"../../../../components/scheduling/types\";\r\n\r\nconst { Sider } = Layout;\r\n\r\n// TODO: Integrate this component with components/scheduling/editor/schedule-editor.\r\n// Most functionality has been copied there, but has been kept here to prevent breaking the phase-2-scheduler page.\r\n\r\n// Page refreshes every 10 seconds when not in edit mode\r\n\r\n\r\nexport interface Phase2SchedulerPageProps {\r\n editMode: boolean,\r\n onEditModeChange: (editing: boolean) => void,\r\n groupData?: GroupDataProps,\r\n mainHeaderRoutes?: Route[],\r\n onCancel: () => void,\r\n onNewSetCreated: (setID: string) => void,\r\n onScheduleSaved: (data: { variables: ScheduleVariables, modifiedEntities: ScheduleNode[] }) => void,\r\n onScheduleDeleted: () => void,\r\n\r\n // User clicked the \"Finish\" button\r\n onFinished: () => void\r\n}\r\n\r\n/**\r\n * Phase 2 of the scheduling process. Handles scheduling of passengers and cargo before putting them on a flight.\r\n */\r\nexport const Phase2SchedulerPage: React.FC = (props) => {\r\n\r\n const api = usePhase2SchedulerApi(props);\r\n\r\n // Child components will have access to these\r\n const provider: Phase2State.ContextType =\r\n {\r\n api: api\r\n }\r\n\r\n let carriableSelector;\r\n\r\n {\r\n const collapsed = api.carriableSelector.hideCarriablePanel.get();\r\n const width = collapsed ? 0 : 450;\r\n let className = BASE_CLS + '-sider ';\r\n if (collapsed){\r\n className += BASE_CLS + '-sider-collapsed';\r\n }\r\n carriableSelector = (\r\n \r\n \r\n \r\n )\r\n }\r\n\r\n // Query error alert ----------------------------------------------------------------------------------------------\r\n let queryErrorAlert = null;\r\n if (api.queryInfo.error){\r\n queryErrorAlert = (\r\n \r\n )\r\n }\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n let pageContent = null;\r\n\r\n if (!api.queryInfo.error){\r\n pageContent = (\r\n }\r\n spinning={api.queryInfo.loading}\r\n wrapperClassName={BASE_CLS + '-spinner'}\r\n >\r\n \r\n {carriableSelector}\r\n \r\n \r\n
    \r\n )\r\n }\r\n\r\n return \r\n \r\n \r\n {queryErrorAlert}\r\n {pageContent}\r\n \r\n \r\n}\r\n\r\nexport default Phase2SchedulerPage;","import Phase2SchedulerPage, { Phase2SchedulerPageProps } from \"./phase-2-scheduler-page\";\r\nexport type {\r\n Phase2SchedulerPageProps\r\n}\r\n\r\nexport default Phase2SchedulerPage;","import gql from \"graphql-tag\";\r\nimport {\r\n QueryGetPhase1ListDateRange,\r\n ScheduleHistoryListItemFragment\r\n} from \"Queries/Scheduling\";\r\nimport {QueryListScheduleHistoryArgs, ScheduleHistoryListItem} from \"../../../../__generated__/graphql/types\";\r\n\r\nexport interface QueryTypes {\r\n ListScheduleHistory: {\r\n args: QueryListScheduleHistoryArgs,\r\n data: {\r\n ListScheduleHistory: ScheduleHistoryListItem[]\r\n }\r\n }\r\n}\r\n\r\nexport const Queries = {\r\n ListScheduleHistory: gql`\r\n query ListScheduleHistory(\r\n $tpID: ID!\r\n $startDate: AWSDate!\r\n $endDate: AWSDate! \r\n $createdBy: String\r\n ){\r\n ListScheduleHistory(\r\n tpID: $tpID\r\n startDate: $startDate\r\n endDate: $endDate\r\n createdBy: $createdBy\r\n ){\r\n ...ScheduleHistoryListItemFragment\r\n }\r\n }\r\n ${ScheduleHistoryListItemFragment}\r\n `,\r\n GetClientDateRange: QueryGetPhase1ListDateRange\r\n}","import React, {useReducer} from 'react';\r\nimport {produce} from \"immer\";\r\nimport {Moment} from \"moment\";\r\nimport moment from \"moment-timezone\";\r\n\r\nexport const DefaultState = {\r\n endDate: moment().startOf('month').subtract(1, 'day'),\r\n startDate: moment().subtract(1, 'month').startOf('month'),\r\n searchValue: ''\r\n}\r\n\r\nexport type State = typeof DefaultState;\r\n\r\nexport type Action = {\r\n type: 'SET_START_DATE',\r\n payload: Moment\r\n} | {\r\n type: 'SET_END_DATE',\r\n payload: Moment\r\n} | {\r\n type: 'SET_SEARCH',\r\n payload: string\r\n}\r\n\r\nconst Reducer: React.Reducer = (state, action) => {\r\n return produce(state, (draft) => {\r\n switch (action.type){\r\n case \"SET_START_DATE\":\r\n draft.startDate = action.payload;\r\n if (state.endDate.isBefore(draft.startDate)){\r\n draft.endDate = state.startDate.clone().add(1, 'day');\r\n }\r\n if (draft.startDate.isAfter(moment().endOf('day'))){\r\n draft.startDate = moment();\r\n }\r\n break;\r\n case \"SET_END_DATE\":\r\n draft.endDate = action.payload;\r\n if (state.startDate.isAfter(draft.endDate)){\r\n draft.startDate = state.endDate.clone().subtract(1, 'day');\r\n }\r\n if (draft.endDate.isAfter(moment().endOf('day'))){\r\n draft.endDate = moment();\r\n }\r\n break;\r\n case \"SET_SEARCH\":\r\n draft.searchValue = action.payload;\r\n break;\r\n }\r\n })\r\n}\r\n\r\nexport function usePhase1HistoryState(){\r\n const [ state, dispatch ] = useReducer(Reducer, DefaultState);\r\n\r\n const startDate = state.startDate.clone();\r\n const endDate = state.endDate.clone();\r\n\r\n return {\r\n dateRange: {\r\n get: () => [state.startDate.clone(), state.endDate.clone()] as [startDate: Moment, endDate: Moment],\r\n start: () => startDate.clone(),\r\n end: () => endDate.clone(),\r\n set: (range: [startDate: Moment, endDate: Moment]) => {\r\n dispatch({ type: 'SET_START_DATE', payload: range[0] });\r\n dispatch({ type: 'SET_END_DATE', payload: range[1] });\r\n },\r\n prevMonth: () => {\r\n dispatch({\r\n type: 'SET_START_DATE',\r\n payload: startDate.clone().subtract(1, 'month').startOf('month')\r\n });\r\n dispatch({\r\n type: 'SET_END_DATE',\r\n payload: endDate.clone().subtract(1, 'month').endOf('month')\r\n });\r\n },\r\n nextMonth: () => {\r\n dispatch({\r\n type: 'SET_START_DATE',\r\n payload: startDate.clone().add(1, 'month').startOf('month')\r\n });\r\n dispatch({\r\n type: 'SET_END_DATE',\r\n payload: endDate.clone().add(1, 'month').endOf('month')\r\n });\r\n }\r\n },\r\n searchValue: {\r\n get: () => state.searchValue,\r\n set: (value: string) => dispatch({ type: 'SET_SEARCH', payload: value })\r\n },\r\n }\r\n}","import {ScheduleHistoryListItem} from \"../../../../__generated__/graphql/types\";\r\nimport useBreakpoints from \"../../../../hooks/useBreakpoints\";\r\nimport {groupBy} from \"lodash\";\r\nimport {castArray} from \"../../../../common/util\";\r\nimport {ColumnProps} from \"antd/lib/table\";\r\nimport {Icon, List, Table} from \"antd\";\r\nimport moment from \"moment\";\r\nimport React from \"react\";\r\nimport ETable from \"../../../../components/enchanced-antd-table\";\r\n\r\nexport interface ScheduleHistoryListProps {\r\n onGroupClicked?: (group: ScheduleHistoryListItem, index: number) => void,\r\n data: ScheduleHistoryListItem[]\r\n}\r\n\r\nconst ScheduleHistoryList: React.FC = (props) => {\r\n const bp = useBreakpoints();\r\n\r\n let grouped = groupBy(castArray(props.data), 'date');\r\n let data: [ string, ScheduleHistoryListItem[] ][] = Object.entries(grouped);\r\n\r\n const columns: ColumnProps[] = [\r\n {\r\n key: 'name',\r\n title: 'Schedule Name',\r\n dataIndex: 'groupName',\r\n width: bp.min(\"medium\") ? 400 : undefined,\r\n }\r\n ]\r\n\r\n if (bp.min('medium')){\r\n columns.push(...[\r\n {\r\n key: 'outbound',\r\n title: 'Outbound',\r\n width: 150,\r\n render: (_, record: ScheduleHistoryListItem) => {\r\n const pax = record.paxOutboundCount;\r\n return \r\n {pax} pax\r\n ;\r\n }\r\n },\r\n {\r\n key: 'transfer',\r\n title: 'Transfer',\r\n width: 150,\r\n render: (_, record: ScheduleHistoryListItem) => {\r\n const pax = record.paxInboundCount;\r\n return \r\n {pax} pax\r\n ;\r\n }\r\n },\r\n {\r\n key: 'inbound',\r\n title: 'Inbound',\r\n render: (_, record: ScheduleHistoryListItem) => {\r\n const pax = record.paxTransferCount;\r\n return \r\n {pax} pax\r\n ;\r\n }\r\n }\r\n ])\r\n }\r\n\r\n return {\r\n let itemData = item[1];\r\n return \r\n
    \r\n

    {item[0] && moment(item[0]).format('MMMM DD, YYYY (dddd)')}

    \r\n {\r\n if (!record) return undefined;\r\n return `${record.date}::${record.groupName}::${record.lastKnownController}`\r\n }}\r\n pagination={false}\r\n dataSource={itemData}\r\n onRow={() => {\r\n return {\r\n style: {\r\n cursor: props.onGroupClicked ? 'pointer' : 'default'\r\n }\r\n }\r\n }}\r\n onRowClick={(record, index) => {\r\n if (props.onGroupClicked){\r\n props.onGroupClicked(record, index);\r\n }\r\n }}\r\n size=\"small\"\r\n columns={columns}\r\n />\r\n
    \r\n
    \r\n }}\r\n />\r\n}\r\n\r\nexport default ScheduleHistoryList;","import {Alert, Button, Col, DatePicker, Icon, Input, Layout, Row, Spin, Tooltip} from 'antd';\r\nimport {castArray} from 'common/util';\r\nimport MainHeader from 'components/scheduling/MainHeader';\r\nimport MainLayout from 'components/scheduling/MainLayout';\r\nimport {WithOrgDataProps} from 'components/WithOrgData';\r\nimport moment from 'moment';\r\nimport React, {useContext} from 'react';\r\nimport {useQuery} from 'react-apollo';\r\nimport {OrgDataContext} from \"context/orgData\";\r\nimport {Queries, QueryTypes} from \"./graphql\";\r\nimport {usePhase1HistoryState} from \"./state\";\r\nimport './style.less';\r\nimport {useHistory} from \"react-router-dom\";\r\nimport {QueryListScheduleHistoryArgs, ScheduleHistoryListItem} from \"../../../../__generated__/graphql/types\";\r\nimport {ScheduleHistoryListItemFragment} from \"../../../../Queries/Scheduling\";\r\nimport ScheduleHistoryList from \"./list\";\r\n\r\nconst basePath = (path) => `/app/scheduling${path ? `/${path}` : ''}`\r\n\r\nconst BASE_CLS = \"mc-phase-1-history\";\r\n\r\nconst { Content } = Layout;\r\nconst { RangePicker } = DatePicker;\r\n\r\nexport interface ScheduledGroupsListProps extends WithOrgDataProps {\r\n onGroupClicked?(group: { date: string, name: string, lkc: string, departureID: string, destinationID: string })\r\n}\r\n\r\nfunction formatDate(date: moment.Moment){\r\n return date.format('YYYY-MM-DD')\r\n}\r\n\r\nconst Phase1HistoryPage: React.FC = (props) => {\r\n\r\n const routeHistory = useHistory();\r\n\r\n function handleGroupClicked(group: ScheduleHistoryListItem){\r\n\r\n const date = encodeURIComponent(group.date);\r\n const lkc = encodeURIComponent(group.lastKnownController);\r\n const name = encodeURIComponent(group.groupName);\r\n\r\n routeHistory.push(basePath(`history/${date}/${name}/${lkc}`));\r\n }\r\n\r\n const state = usePhase1HistoryState();\r\n const orgData = useContext(OrgDataContext);\r\n\r\n const startDate = formatDate(state.dateRange.start());\r\n const endDate = formatDate(state.dateRange.end());\r\n\r\n const { loading, error, data: queryData } = useQuery<\r\n QueryTypes['ListScheduleHistory']['data'],\r\n QueryTypes['ListScheduleHistory']['args']\r\n >(Queries.ListScheduleHistory, {\r\n fetchPolicy: 'network-only',\r\n pollInterval: 10000,\r\n variables: {\r\n tpID: orgData.getOrgIDByType('transporter'),\r\n startDate: startDate,\r\n endDate: endDate\r\n }\r\n })\r\n\r\n let data: ScheduleHistoryListItem[] = castArray(queryData?.ListScheduleHistory);\r\n\r\n if (state.searchValue.get().length > 0){\r\n data = data.filter((item) => item.groupName.toLowerCase().includes(state.searchValue.get().toLowerCase().trim()))\r\n }\r\n\r\n const datePicker = (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n state.dateRange.set([value[0], value[1]])}\r\n disabledDate={(date) => date.isAfter(moment().startOf('day'))}\r\n ranges={{\r\n 'Last Month': [\r\n moment().subtract(1, 'month').startOf('month'),\r\n moment().startOf('month').subtract(1, 'day')\r\n ]\r\n }}\r\n className={BASE_CLS + '-daterange'}\r\n allowClear={false}\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 {datePicker}\r\n \r\n \r\n }\r\n value={state.searchValue.get()}\r\n onChange={(e) => state.searchValue.set(e.target.value)}\r\n allowClear\r\n />\r\n \r\n \r\n }\r\n />\r\n \r\n {error ? : null}\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 Phase1HistoryPage","import Phase1HistoryPage from \"./page\";\r\nexport default Phase1HistoryPage;","import MainHeader, {MainHeaderProps} from \"../../../../components/scheduling/MainHeader\";\r\nimport {Button, Col, Icon, message, Row, Tooltip} from \"antd\";\r\nimport React from \"react\";\r\nimport useUserGroups from \"../../../../hooks/useUserGroups\";\r\nimport {TransitType} from \"../../../../common/types/carriable\";\r\nimport {getSNodeID} from \"../../../../components/scheduling/util\";\r\nimport {ScheduleEditorApi} from \"../../../../components/scheduling/editor/schedule-editor-v2/api\";\r\n\r\ninterface Phase2MainHeaderProps {\r\n api: ScheduleEditorApi\r\n}\r\n\r\nconst Phase1HistoryEditorMainHeader: React.FC = (props) => {\r\n\r\n const { api } = props;\r\n\r\n let mainHeaderProps: MainHeaderProps = {\r\n routes: [\r\n {\r\n path: '/app/scheduling/history',\r\n title: 'Historical Scheduled Passengers and Cargo'\r\n },\r\n {\r\n path: '',\r\n title: api.groupData?.name\r\n }\r\n ]\r\n }\r\n\r\n return \r\n}\r\n\r\nexport default Phase1HistoryEditorMainHeader;","import ApolloClient from \"apollo-client\";\r\nimport {ResolveLocationIdsQuery} from \"Queries/Location\";\r\nimport {Location} from \"common/types/location\";\r\nimport {DepDestListItem, GroupData, GroupFormData} from \"./types\";\r\nimport {createFormField, FormField} from \"common/form\";\r\nimport {momentOrNull} from \"common/util\";\r\nimport {v4 as uuidv4} from 'uuid';\r\nimport {ScheduledCgoNode, ScheduledPaxNode, ScheduleNode} from \"components/scheduling/types\";\r\n\r\nexport const BASE_CLS = 'schedule-editor';\r\n\r\nexport async function deRefLocations(apolloClient:ApolloClient, locationIds: string[]){\r\n const { data, errors } = await apolloClient.query({\r\n query: ResolveLocationIdsQuery,\r\n errorPolicy: 'all',\r\n fetchPolicy: 'cache-first',\r\n variables: {\r\n ids: locationIds\r\n }\r\n })\r\n\r\n return {\r\n data: (data?.resolve_entity_ids || []) as Location[],\r\n errors: errors || []\r\n }\r\n}\r\n\r\nexport function preparePassengerForSchedule(pax: ScheduledPaxNode){\r\n return {\r\n _id: pax._id,\r\n _rev: pax._rev,\r\n personID: pax.personID._id,\r\n transitType: pax.transitType,\r\n paxWeight: pax.paxWeight,\r\n bagWeight: pax.bagWeight,\r\n bagCount: pax.bagCount,\r\n chargeCode: pax.chargeCode && pax.chargeCode.toUpperCase(),\r\n departureID: pax.departureID?._id,\r\n destinationID: pax.destinationID?._id,\r\n scheduledOrder: pax.scheduledOrder,\r\n notesForPilot: pax.notesForPilot\r\n }\r\n}\r\n\r\nexport function prepareCargoForSchedule(cgo: ScheduledCgoNode){\r\n return {\r\n _id: cgo._id,\r\n _rev: cgo._rev,\r\n name: cgo.name,\r\n weight: cgo.weight,\r\n hazmat: cgo.hazmat,\r\n hazmatUnCode: cgo.hazmatUnCode,\r\n attentionTo: cgo.attentionTo,\r\n notes: cgo.notes,\r\n receivedLocationID: cgo.receivedLocationID,\r\n scheduledOrder: cgo.scheduledOrder,\r\n departureID: cgo.departureID?._id,\r\n destinationID: cgo.destinationID?._id,\r\n initials: cgo.initials,\r\n transitType: cgo.transitType,\r\n notesForPilot: cgo.notesForPilot\r\n }\r\n}\r\n\r\nexport type PreparedScheduledPax = ReturnType;\r\nexport type PreparedScheduledCgo = ReturnType;\r\n\r\nexport function sortByScheduledOrder(a: ScheduleNode, b: ScheduleNode){\r\n if (b.scheduledOrder === null) return -1;\r\n if (a.scheduledOrder === null) return 1;\r\n\r\n const diff = (a.scheduledOrder || 0) - (b.scheduledOrder || 0);\r\n if (diff === 0){\r\n // scheduledOrders are equal. Put paxnodes before cgonodes.\r\n return a.classType === 'flytsuite.paxnode' && b.classType === 'flytsuite.cgonode' ? -1 : 1;\r\n }\r\n return diff;\r\n}\r\n\r\nexport function updateScheduledOrder(entity: ScheduleNode, index: number){\r\n return {\r\n ...entity,\r\n scheduledOrder: index\r\n }\r\n}\r\n\r\nexport class DepDestList {\r\n static build(scheduleNodes: ScheduleNode[]){\r\n\r\n // Ordered map\r\n const depDestList = new Map();\r\n\r\n // Used for building key for depDestList\r\n function hashLeg(departure: Location, destination: Location){\r\n return departure?._id + ':' + destination?._id\r\n }\r\n\r\n // Create a copy b/c sort sorts in-place.\r\n const scheduleNodesCopy = [...scheduleNodes];\r\n // First, sort by scheduled order:\r\n scheduleNodesCopy.sort(sortByScheduledOrder);\r\n\r\n let order = 0;\r\n for (const node of scheduleNodesCopy) {\r\n const hash = hashLeg(node.departureID, node.destinationID);\r\n if (!depDestList.has(hash)){\r\n // Create new entry with this node in it\r\n depDestList.set(hash, {\r\n departure: node.departureID,\r\n destination: node.destinationID,\r\n rangeStart: order,\r\n rangeEnd: order,\r\n pax: [node].filter(e => e.classType === 'flytsuite.paxnode') as ScheduledPaxNode[],\r\n cgo: [node].filter(e => e.classType === 'flytsuite.cgonode') as ScheduledCgoNode[],\r\n all: [node]\r\n })\r\n }\r\n else\r\n {\r\n const leg = depDestList.get(hash);\r\n\r\n // Will be updated if a pax/cgo has a greater scheduledOrder.\r\n let nextRangeEnd = leg.rangeEnd;\r\n\r\n // Insert node into existing list\r\n if (node.classType === 'flytsuite.paxnode'){\r\n leg.pax.push(node as ScheduledPaxNode);\r\n nextRangeEnd = Math.max(nextRangeEnd, order);\r\n }\r\n else if (node.classType === 'flytsuite.cgonode'){\r\n leg.cgo.push(node as ScheduledCgoNode);\r\n nextRangeEnd = Math.max(nextRangeEnd,order);\r\n }\r\n leg.all.push(node);\r\n\r\n // Update rangeEnd\r\n leg.rangeEnd = nextRangeEnd;\r\n }\r\n\r\n order++;\r\n }\r\n\r\n return Array.from(depDestList.values());\r\n }\r\n\r\n static toEntities(legs: DepDestListItem[]): ScheduleNode[] {\r\n\r\n const entityList: ScheduleNode[] = [];\r\n\r\n let order = 0;\r\n for (let leg of legs) {\r\n for (let entity of leg.all) {\r\n entityList.push({\r\n ...entity,\r\n scheduledOrder: order\r\n })\r\n order++;\r\n }\r\n }\r\n\r\n return entityList;\r\n }\r\n}\r\n\r\n\r\nexport function findLegIdx(list: DepDestListItem[], leg: DepDestListItem){\r\n return list.findIndex(item => (\r\n item.departure?._id === leg.departure?._id ||\r\n item.destination?._id === leg.destination?._id\r\n ))\r\n}\r\n\r\nexport function initFormData(groupData: GroupData): GroupFormData {\r\n return {\r\n name: createFormField(groupData.name),\r\n date: createFormField(momentOrNull(groupData.date)),\r\n lastKnownController: createFormField(groupData.lastKnownControllerObj ? ({\r\n key: groupData.lastKnownControllerObj._id,\r\n label: groupData.lastKnownControllerObj.name\r\n }) : null)\r\n }\r\n}\r\n\r\nexport function formTouched(formData: { [key: string]: FormField }){\r\n for (let key in formData) {\r\n if (formData[key]?.touched){\r\n return true\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nexport function allRequiredFieldsHaveValue(formData: { [key: string]: FormField }, requiredFieldNames: string[]){\r\n const touchedFieldNames: string[] = [];\r\n\r\n for (let key in formData) {\r\n if (formData[key]?.value){\r\n touchedFieldNames.push(key);\r\n }\r\n }\r\n\r\n for (let requiredFieldName of requiredFieldNames) {\r\n if (!touchedFieldNames.includes(requiredFieldName)){\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n}\r\n\r\nexport function genTempID(){\r\n return 'TEMP-' + uuidv4()\r\n}\r\n\r\nexport function getNoteMap(entities: ScheduleNode[]){\r\n /* Gather all notesForPilot values from pax and cargo and create a dictionary of them with this structure:\r\n {\r\n : ScheduleNode[]\r\n }\r\n */\r\n\r\n const noteMap: Record = {};\r\n\r\n for (let entity of entities) {\r\n const msg = entity.notesForPilot;\r\n if (!msg) continue;\r\n\r\n if (msg in noteMap){\r\n noteMap[msg].push(entity);\r\n }\r\n else\r\n {\r\n noteMap[msg] = [entity];\r\n }\r\n }\r\n\r\n return noteMap;\r\n}","import React, { CSSProperties } from 'react';\r\nimport { Form, DatePicker, Input } from 'antd';\r\nimport { FormComponentProps, FormProps } from 'antd/lib/form';\r\nimport { LocationSelect } from 'components/form/select/LocationSelect';\r\nimport {createFormFields} from 'common/form';\r\nimport moment from 'moment';\r\n\r\nexport interface IGroupFormProps extends FormComponentProps {\r\n formElementProps?: FormProps,\r\n disabled?: boolean,\r\n formData?: any,\r\n onFieldsChange?(fields: any): void,\r\n onValuesChange?(values: any): void\r\n}\r\n\r\nlet selectStyle: CSSProperties = {\r\n minWidth: '10rem'\r\n}\r\n\r\nconst GroupForm: React.FC = React.forwardRef((props, ref: React.LegacyRef
    ) => {\r\n const { getFieldDecorator } = props.form;\r\n let formElement = \r\n \r\n {getFieldDecorator('date', {\r\n rules: [\r\n { required: true, message: 'You must enter a flight date' }\r\n ]\r\n })( current && current < moment().startOf('day')} />)}\r\n \r\n \r\n {getFieldDecorator('name', {\r\n rules: [\r\n { required: true, message: 'You must enter a group name' }\r\n ]\r\n })( {\r\n e.target.value = e.target.value.trimStart().replace(/[^\\S ]/gm, '')}} disabled={props.disabled} />)}\r\n \r\n \r\n {getFieldDecorator('lastKnownController', {\r\n rules: [\r\n { required: true, message: 'You must enter a controlling heliport' }\r\n ]\r\n })()}\r\n \r\n
    \r\n return formElement\r\n})\r\n\r\nexport default Form.create({\r\n mapPropsToFields(props){\r\n if (!props.formData) return undefined\r\n return createFormFields(props.formData);\r\n },\r\n onFieldsChange(props, _, fields){\r\n if (props.onFieldsChange){\r\n props.onFieldsChange(fields);\r\n }\r\n },\r\n onValuesChange(props, _, values){\r\n if (props.onValuesChange){\r\n props.onValuesChange(values);\r\n }\r\n }\r\n})(GroupForm)","import {\r\n Badge,\r\n Button,\r\n Collapse,\r\n Divider,\r\n Drawer,\r\n Dropdown,\r\n Icon,\r\n Input,\r\n InputNumber,\r\n Menu,\r\n Modal,\r\n Popconfirm,\r\n Tooltip\r\n} from \"antd\";\r\nimport {BASE_CLS} from \"./util\";\r\nimport React, {useContext, useEffect} from \"react\";\r\nimport * as Phase2State from './state';\r\nimport {DepDestListItem} from \"./types\";\r\nimport ETable from \"../../../../components/enchanced-antd-table\";\r\nimport IsnCheckStatusButton from \"../../../../components/IsnCheckStatusButton\";\r\nimport {PaxISNWithData} from \"../../../../components/isn/PaxISN\";\r\nimport {PassengerEditor} from \"../../../../components/PassengerEditor\";\r\nimport NonIdealState from \"../../../../components/NonIdealState\";\r\nimport MCIcon from \"../../../../components/icon\";\r\nimport {stopPropagationProps} from \"../../../../common/util-ts\";\r\nimport {Location} from \"../../../../common/types/location\";\r\nimport {useHistory} from \"react-router-dom\";\r\nimport {\r\n approximateLegRouteColumnWidth,\r\n LegRoute\r\n} from \"../../../../components/flights/scheduling/util\";\r\nimport {calcBagCount, calcBagWeight, calcTotalWeight} from \"../../../../components/flights/scheduling/math\";\r\nimport {getTransitType} from \"../../../../common/carriable/util\";\r\nimport * as NotesForPilot from \"../../../../components/flights/scheduling/notes-for-pilot\";\r\nimport {ScheduleEditorApi} from \"./api\";\r\nimport {ScheduledCgoNode, ScheduledPaxNode, ScheduleNode} from \"../../../../components/scheduling/types\";\r\nimport {getSNodeID} from \"../../../../components/scheduling/util\";\r\n\r\nexport interface Phase2TableProps {\r\n api: ScheduleEditorApi,\r\n containerElement?: HTMLElement\r\n}\r\n\r\nfunction NotesForPilotWrapper(props: { api: ScheduleEditorApi, entity: ScheduleNode, popupContainer: HTMLElement }){\r\n\r\n const { api, entity, popupContainer } = props;\r\n const note = entity.notesForPilot;\r\n const noteMap = api.data.getNotesForPilot();\r\n\r\n const entitiesWithNote = (note ? noteMap[note] : undefined) || [];\r\n\r\n const renderAccept: NotesForPilot.QuickEdit.QuickEditProps['renderAccept'] =\r\n ({ onConfirm, buttonProps }) => {\r\n\r\n function handleConfirm(updateAllWithNote?: boolean){\r\n\r\n if (!entity){\r\n return;\r\n }\r\n\r\n let newEntities: ScheduleNode[] = [];\r\n\r\n function updateEntity(entity: ScheduleNode){\r\n return {\r\n ...entity,\r\n notesForPilot: api.notesForPilot.getModifiedText()\r\n }\r\n }\r\n\r\n if (updateAllWithNote){\r\n const oldNote = entity.notesForPilot;\r\n\r\n const noteMap = api.data.getNotesForPilot();\r\n if (!noteMap[oldNote]){\r\n return;\r\n }\r\n\r\n newEntities = noteMap[oldNote].map(updateEntity)\r\n }\r\n else\r\n {\r\n newEntities = [updateEntity(entity)];\r\n }\r\n\r\n api.data.modifiedEntities.add(newEntities);\r\n onConfirm();\r\n }\r\n\r\n if (entitiesWithNote.length > 1){\r\n const overlay = (\r\n \r\n handleConfirm()}\r\n >Update this item only\r\n {\r\n Modal.confirm({\r\n title: 'Review affected items',\r\n content: <>\r\n

    The following PAX/CGO will have their pilot notes changed:

    \r\n
      \r\n {entitiesWithNote.map(entity => {\r\n if (entity.classType === 'flytsuite.paxnode'){\r\n const pax = entity as ScheduledPaxNode;\r\n return
    • {pax.lastName}, {pax.firstName}
    • \r\n }\r\n else\r\n {\r\n const cgo = entity as ScheduledCgoNode;\r\n return
    • {cgo.name}
    • \r\n }\r\n })}\r\n
    \r\n ,\r\n okText: `Update ${entitiesWithNote.length} items`,\r\n onOk: () => handleConfirm(true)\r\n })\r\n }}\r\n >Update {entitiesWithNote.length} items\r\n
    \r\n )\r\n\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n\r\n return (\r\n handleConfirm()}\r\n />\r\n );\r\n }\r\n\r\n const readOnly = Boolean(entity.currentCarrierID) || !api.editMode.get();\r\n\r\n return (\r\n \r\n )\r\n}\r\n\r\nconst Phase2Table: React.FC = (props) => {\r\n\r\n // Hooks -----------------------------------------------------------------------------------------------------------\r\n const { api } = props;\r\n const history = useHistory();\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Event handlers---------------------------------------------------------------------------------------------------\r\n function handleCellEdit(entityId: string, fieldKey: string, value: any) {\r\n api.data.modifyEntity(entityId, { [fieldKey]: value });\r\n }\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // State helpers ---------------------------------------------------------------------------------------------------\r\n const hasSelectedPersonnel = !!api.selection.personnelIds.get().length;\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n const data = api.data.getLegs();\r\n\r\n const entityCount = data.reduce((count, leg) => {\r\n return count + leg.all.length\r\n }, 0)\r\n\r\n // Utils -----------------------------------------------------------------------------------------------------------\r\n const legRouteColumnWidth = approximateLegRouteColumnWidth(\r\n data.map((item) => ({\r\n departureName: item.departure?.name,\r\n destinationName: item.destination?.name\r\n }))\r\n );\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n function renderPanel(item: DepDestListItem){\r\n\r\n const selectedItems = item.all\r\n .filter((entity) => api.selection.entityIds.get().includes(getSNodeID(entity)));\r\n\r\n const itemsOnFlight = item.all\r\n .filter((entity) => entity.currentCarrierID);\r\n\r\n const depName = item.departure?.name;\r\n const destName = item.destination?.name;\r\n\r\n const pax = item.pax;\r\n const cgo = item.cgo;\r\n\r\n const totWt = calcTotalWeight(item.all);\r\n const totPaxWt = calcTotalWeight(item.pax);\r\n const totCgoWt = calcTotalWeight(item.cgo);\r\n\r\n const totBagWt = calcBagWeight(item.pax);\r\n const totBagCt = calcBagCount(item.pax);\r\n\r\n let tooltipTitle = 'Click to show table';\r\n if (api.editor.visibleLegs.isLegVisible(item.departure._id, item.destination._id)){\r\n tooltipTitle = 'Click to hide table';\r\n }\r\n\r\n const tooltipContent = <>\r\n

    {tooltipTitle}

    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    PAX{pax.length}
    CGO{cgo.length}
    Transit{getTransitType(item.departure, item.destination)}
    Total Weight{totWt}
    Total PAX Weight{totPaxWt}
    Total CGO Weight{totCgoWt}
    Total Bag Weight{totBagWt}
    Total Bag Count{totBagCt}
    \r\n \r\n\r\n const header = (\r\n \r\n {selectedItems.length ? (\r\n \r\n
    \r\n \r\n
    \r\n
    \r\n ) : null}\r\n {itemsOnFlight.length && !selectedItems.length ? (\r\n \r\n
    \r\n \r\n
    \r\n
    \r\n ) : null}\r\n \r\n \r\n \r\n \r\n {getTransitType(item.departure, item.destination)}\r\n \r\n \r\n {pax.length} PAX\r\n \r\n {cgo.length} CGO\r\n \r\n \r\n Totals:\r\n {totWt} Wt\r\n \r\n {totPaxWt} Pax Wt\r\n \r\n {totCgoWt} Cgo Wt\r\n \r\n {totBagWt} Bag Wt\r\n \r\n {totBagCt} Bag Ct\r\n \r\n \r\n )\r\n\r\n const deleteBtn = (\r\n {\r\n api.data.removeLeg(item.departure._id, item.destination._id);\r\n }}\r\n placement=\"left\"\r\n >\r\n {\r\n e.stopPropagation();\r\n }}\r\n />\r\n \r\n )\r\n\r\n let addBtn = null;\r\n if (hasSelectedPersonnel && api.carriableSelector.tabs.get().upperTab === 'personSearch'){\r\n addBtn = (\r\n api.selection.personnelIds.addToSchedule(\r\n item.departure._id,\r\n item.destination._id\r\n )}\r\n >Add {api.selection.personnelIds.get().length} PAX\r\n )\r\n }\r\n else if (api.carriableSelector.tabs.get().upperTab === 'cargoForm'){\r\n addBtn = (\r\n {\r\n e.stopPropagation();\r\n api.forms.cargoForm.submit(\r\n item.departure._id,\r\n item.destination._id\r\n )\r\n }}\r\n >Add Cargo\r\n )\r\n }\r\n\r\n const reorderBtns = (\r\n \r\n \r\n = entityCount-1}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n api.data.swapLegs(item, 'down');\r\n }}\r\n />\r\n \r\n \r\n {\r\n e.stopPropagation();\r\n api.data.swapLegs(item, 'up');\r\n }}\r\n />\r\n \r\n \r\n )\r\n\r\n let moreBtn: JSX.Element;\r\n\r\n {\r\n const overlay = (\r\n \r\n {\r\n clickParam.domEvent.stopPropagation();\r\n api.editor.visibleLegs.show(item.departure?._id, item.destination?._id);\r\n api.selection.entityIds.add(item.all.map(e => getSNodeID(e)));\r\n }}\r\n >\r\n Select all\r\n \r\n {\r\n clickParam.domEvent.stopPropagation();\r\n api.selection.entityIds.remove(item.all.map(e => getSNodeID(e)));\r\n }}\r\n >\r\n De-select all\r\n \r\n \r\n {\r\n clickParam.domEvent.stopPropagation();\r\n const entityIds = item.all.map(e => getSNodeID(e));\r\n api.data.setEntityLegs(\r\n entityIds,\r\n item.destination,\r\n item.departure);\r\n }}\r\n >\r\n Swap departure & destination\r\n \r\n \r\n {\r\n clickParam.domEvent.stopPropagation();\r\n const callback = (departure: Location, destination: Location) => {\r\n api.data.setEntityLegs(\r\n item.all.map(e => getSNodeID(e)),\r\n departure,\r\n destination\r\n )\r\n }\r\n\r\n api.modal.newLegFormModal.open(\r\n item.departure,\r\n item.destination,\r\n callback\r\n )\r\n }}\r\n >\r\n Change departure & destination...\r\n \r\n \r\n )\r\n\r\n moreBtn = (\r\n \r\n e.stopPropagation()}\r\n />\r\n \r\n )\r\n }\r\n\r\n let extra = [];\r\n\r\n if (api.editMode.get()){\r\n extra = [\r\n addBtn,\r\n reorderBtns,\r\n moreBtn,\r\n deleteBtn\r\n ]\r\n }\r\n\r\n return \r\n
    \r\n \r\n {renderPaxTable(item)}\r\n {renderCgoTable(item)}\r\n \r\n
    \r\n \r\n }\r\n\r\n function renderPaxTable(item: DepDestListItem){\r\n\r\n const columns = [\r\n {\r\n title: PAX ({item.pax.length}),\r\n key: 'action',\r\n width: 73,\r\n fixed: 'left' as 'left',\r\n render: (_, row) => {\r\n\r\n if (!api.editMode.get()) return (\r\n
    \r\n \r\n
    \r\n );\r\n\r\n const reorderBtns = [\r\n \r\n = item.pax.length}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n api.data.swapEntities(row.scheduledOrder, row.scheduledOrder + 1)\r\n }}\r\n />\r\n \r\n ,\r\n \r\n {\r\n e.stopPropagation();\r\n api.data.swapEntities(row.scheduledOrder, row.scheduledOrder - 1)\r\n }}\r\n />\r\n \r\n ]\r\n\r\n return (\r\n \r\n {reorderBtns}\r\n \r\n )\r\n }\r\n },\r\n {\r\n title: (\r\n \r\n OI \r\n \r\n ),\r\n key: 'oi',\r\n dataIndex: 'scheduledOrder',\r\n render: (order) => order + 1,\r\n width: 60\r\n },\r\n {\r\n title: 'Name',\r\n key: 'name',\r\n width: 200,\r\n render: (_, record) => {\r\n let xbr;\r\n\r\n let icon = null;\r\n\r\n let spanClassName = record.currentCarrierID ? BASE_CLS + '-table-on-flight' : '';\r\n\r\n if (record.currentCarrierID){\r\n icon = \r\n {\r\n e.preventDefault();\r\n history.push(\"/app/scheduling/flight/\" + record.currentCarrierID?._id)\r\n }}\r\n style={{ marginRight: '6px', position: 'relative' }}\r\n >\r\n \r\n \r\n \r\n }\r\n\r\n if(!api.editMode.get()){\r\n var data;\r\n if (record.__typename === 'Person')\r\n {\r\n data = {\r\n ...record,\r\n personID: { ...record }\r\n }\r\n }\r\n else\r\n {\r\n data = record\r\n }\r\n if(data.personID){\r\n xbr = data.personID.extraBroadState;\r\n }else {\r\n xbr = record.extraBroadState;\r\n }\r\n let name = `${record.lastName}, ${record.firstName}`\r\n if(xbr === 'FAIL'){\r\n name = `\\u2194 ${record.lastName}, ${record.firstName}`\r\n }else if(xbr === 'PASS'){\r\n name = `\\uc6c3 ${record.lastName}, ${record.firstName}`\r\n }\r\n return \r\n {icon}\r\n \r\n \r\n }\r\n xbr = record.extraBroadState || (record.personID && record.personID.extraBroadState)\r\n\r\n let text;\r\n if(xbr === 'FAIL'){\r\n text = `\\u2194 ${record.lastName}, ${record.firstName}`\r\n }else if(xbr === 'PASS'){\r\n text = `\\uc6c3 ${record.lastName}, ${record.firstName}`\r\n }else {\r\n let name = record.lastName + \", \" + record.firstName\r\n text = {name}\r\n }\r\n\r\n return (\r\n \r\n {icon}\r\n {text}\r\n \r\n );\r\n }\r\n },\r\n {\r\n title: 'Notes for Pilot',\r\n key: 'notesForPilot',\r\n width: 150,\r\n render: (_, row) => (\r\n \r\n )\r\n },\r\n {\r\n title: 'Nation',\r\n key: 'nation',\r\n width: 70,\r\n render: (_, row) => row.personID && row.personID.nation\r\n },\r\n {\r\n title: 'Employer',\r\n key: 'employer',\r\n width: 120,\r\n render: (_, record) => record.employerID && record.employerID.name\r\n },\r\n {\r\n title: 'Pax Wt',\r\n key: 'paxWeight',\r\n dataIndex: 'paxWeight',\r\n width: 50,\r\n editable: true,\r\n render: (weight: number, row) => {\r\n if (!api.editMode.get() || row.currentCarrierID) return weight || 0;\r\n return \r\n handleCellEdit(getSNodeID(row), 'paxWeight', value || 0)}\r\n size=\"small\"\r\n value={weight || 0}\r\n {...stopPropagationProps()}\r\n />\r\n \r\n }\r\n },\r\n {\r\n title: 'Bag Wt',\r\n key: 'bagWeight',\r\n dataIndex: 'bagWeight',\r\n width: 50,\r\n editable: true,\r\n render: (weight, row) => {\r\n if (!api.editMode.get() || row.currentCarrierID) return weight || 0;\r\n return \r\n handleCellEdit(getSNodeID(row), 'bagWeight', value || 0)}\r\n size=\"small\"\r\n value={weight || 0}\r\n />\r\n \r\n }\r\n },\r\n {\r\n title: 'Bag Ct',\r\n key: 'bagCount',\r\n dataIndex: 'bagCount',\r\n width: 50,\r\n editable: true,\r\n render: (count, row) => {\r\n if (!api.editMode.get() || row.currentCarrierID) return count || 0;\r\n return \r\n handleCellEdit(getSNodeID(row), 'bagCount', value || 0)}\r\n size=\"small\"\r\n value={count || 0}\r\n />\r\n \r\n }\r\n },\r\n {\r\n title: 'Charge Code',\r\n key: 'chargeCode',\r\n dataIndex: 'chargeCode',\r\n editable: true,\r\n width: 130,\r\n render: (code, row) => {\r\n if (!api.editMode.get() || row.currentCarrierID) return code && code.toUpperCase();\r\n return (\r\n handleCellEdit(getSNodeID(row), 'chargeCode', event.target.value && event.target.value.split(\" \").join(\"\").toUpperCase())}\r\n {...stopPropagationProps()}\r\n size=\"small\"\r\n />\r\n )\r\n }\r\n },\r\n {\r\n title: 'ISN Status',\r\n key: 'isnStatus',\r\n render: (_, row) => {\r\n\r\n if (row.transitType !== 'OUTBOUND') return '—';\r\n\r\n const pax = {\r\n ...row,\r\n isnCheckError: api.bulkIsnChecker.checkError(getSNodeID(row)),\r\n isnCheckRunning: api.bulkIsnChecker.checkLoading(getSNodeID(row._id))\r\n }\r\n\r\n return {\r\n e.stopPropagation();\r\n api.drawer.isnDrawer.open(row);\r\n }}\r\n />\r\n }\r\n },\r\n {\r\n title: 'Created By',\r\n key: 'createdBy',\r\n dataIndex: 'createdBy'\r\n }\r\n ]\r\n\r\n if (!item.pax.length) return null;\r\n\r\n return {\r\n return {\r\n onClick: () => {\r\n if (!api.editMode.get()) return;\r\n api.selection.entityIds.toggle(getSNodeID(record));\r\n },\r\n className: api.editMode.get() ? BASE_CLS + '-table-row' : '',\r\n disabled: !!record.currentCarrierID\r\n }\r\n }}\r\n pagination={false}\r\n rowKey={record => getSNodeID(record)}\r\n size=\"small\"\r\n />\r\n }\r\n\r\n function renderCgoTable(item: DepDestListItem){\r\n\r\n const cgo = item.cgo.filter(e => e.classType === 'flytsuite.cgonode');\r\n\r\n const columns = [\r\n {\r\n title: CGO ({cgo.length}),\r\n key: 'action',\r\n width: 73,\r\n fixed: 'left' as 'left',\r\n render: (_, row) => {\r\n\r\n if (!api.editMode.get()) return (\r\n
    \r\n \r\n
    \r\n );\r\n\r\n const reorderBtns = [\r\n \r\n = item.all.length}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n api.data.swapEntities(row.scheduledOrder, row.scheduledOrder + 1);\r\n }}\r\n />\r\n \r\n ,\r\n \r\n {\r\n e.stopPropagation();\r\n api.data.swapEntities(row.scheduledOrder, row.scheduledOrder - 1);\r\n }}\r\n />\r\n \r\n ]\r\n\r\n return (\r\n \r\n {reorderBtns}\r\n \r\n )\r\n }\r\n },\r\n {\r\n title: (\r\n \r\n OI \r\n \r\n ),\r\n key: 'oi',\r\n dataIndex: 'scheduledOrder',\r\n render: (order) => order + 1,\r\n width: 60\r\n },\r\n {\r\n title: 'Name',\r\n key: 'name',\r\n width: 200,\r\n render: (_, record) => {\r\n let spanClassName = record.currentCarrierID ? BASE_CLS + '-table-on-flight' : '';\r\n\r\n if (record.currentCarrierID){\r\n return \r\n {\r\n e.preventDefault();\r\n history.push(\"/app/scheduling/flight/\" + record.currentCarrierID?._id)\r\n }}\r\n style={{marginRight: '6px', position: 'relative'}}\r\n >\r\n \r\n \r\n \r\n \r\n {record.name}\r\n \r\n }\r\n\r\n return record.name\r\n }\r\n },\r\n {\r\n title: 'Notes for Pilot',\r\n key: 'notesForPilot',\r\n width: 150,\r\n render: (_, row) => (\r\n \r\n )\r\n },\r\n {\r\n title: 'Weight',\r\n key: 'weight',\r\n dataIndex: 'weight',\r\n width: 70,\r\n editable: true,\r\n render: (weight, row) => {\r\n if (!api.editMode.get() || row.currentCarrierID) return weight || 0;\r\n return \r\n handleCellEdit(getSNodeID(row), 'weight', value || 0)}\r\n size=\"small\"\r\n value={weight || 0}\r\n />\r\n \r\n }\r\n },\r\n {\r\n title: 'HazMat',\r\n key: 'hazmat',\r\n width: 120,\r\n render: (_, record) => record.hazmat ? record.hazmatUnCode || \"YES\" : null\r\n },\r\n {\r\n title: 'Attention',\r\n key: 'attentionTo',\r\n width: 200,\r\n render: (_, record) => record.attentionTo\r\n },\r\n {\r\n title: 'Initials',\r\n key: 'initials',\r\n width: 130,\r\n render: (_, record) => record.initials\r\n },\r\n {\r\n title: 'Notes',\r\n key: 'notes',\r\n render: (_, record) => record.notes\r\n },\r\n {\r\n title: 'Created By',\r\n key: 'createdBy',\r\n dataIndex: 'createdBy'\r\n }\r\n ]\r\n\r\n if (!cgo.length) return null;\r\n\r\n return {\r\n return {\r\n onClick: () => {\r\n if (!api.editMode.get()) return;\r\n api.selection.entityIds.toggle(getSNodeID(record));\r\n },\r\n className: api.editMode.get() ? BASE_CLS + '-table-row' : '',\r\n disabled: !!record.currentCarrierID\r\n }\r\n }}\r\n pagination={false}\r\n rowKey={record => getSNodeID(record)}\r\n size=\"small\"\r\n />\r\n }\r\n\r\n function renderIsnDrawer(){\r\n let pax = api.drawer.isnDrawer.get().pax;\r\n let title = pax ? `${pax.lastName}, ${pax.firstName}` : '';\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n\r\n function renderPaxModal(){\r\n const modalState = api.modal.paxModal.get();\r\n const modalActions = api.modal.paxModal;\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n\r\n const panels = data.map(renderPanel);\r\n\r\n let noDataMsg = null;\r\n let collapse = null;\r\n if (api.data.modifiedEntities.get().length) {\r\n collapse = (\r\n \r\n {panels}\r\n \r\n )\r\n }\r\n else if (api.editMode.get() && !api.queryInfo.loading)\r\n {\r\n noDataMsg = \r\n

    Use the left panel to add PAX/CGO

    \r\n {api.carriableSelector.hideCarriablePanel.get() ? (\r\n Show Panel\r\n ) : null}\r\n \r\n }\r\n icon=\"usergroup-add\"\r\n style={{ flex: 1 }}\r\n />\r\n }\r\n else if (!api.queryInfo.loading) {\r\n noDataMsg = \r\n }\r\n\r\n return <>\r\n {collapse}\r\n {noDataMsg}\r\n {renderIsnDrawer()}\r\n {renderPaxModal()}\r\n \r\n}\r\n\r\nexport default Phase2Table","import {FormComponentProps} from \"antd/lib/form\";\r\nimport {Col, Form, Row} from \"antd\";\r\nimport {createFormFields, FormItemClassNames} from \"../../../../common/form\";\r\nimport DepDestSelect from \"../../../../components/form/select/dep-dest-select\";\r\nimport {NewLegFormData, NewLegFormFields} from \"./types\";\r\n\r\n\r\nexport interface NewLegFormProps extends FormComponentProps{\r\n formData: NewLegFormFields,\r\n onFieldsChange: (fields: NewLegFormFields) => void,\r\n onValuesChange?: (fields: NewLegFormData) => void\r\n}\r\n\r\nconst NewLegForm: React.FC = (props) => {\r\n\r\n const { form } = props;\r\n\r\n const validator = DepDestSelect.validator;\r\n\r\n return
    \r\n \r\n {form.getFieldDecorator('depDest', {\r\n rules: [{\r\n required: true,\r\n validator: validator,\r\n message: 'Please choose a departure and destination.'\r\n }]\r\n })(\r\n \r\n )}\r\n \r\n
    \r\n}\r\n\r\nexport default Form.create({\r\n mapPropsToFields(props){\r\n if (!props.formData) return undefined\r\n return createFormFields(props.formData);\r\n },\r\n onFieldsChange(props, _, fields){\r\n if (props.onFieldsChange){\r\n props.onFieldsChange(fields);\r\n }\r\n },\r\n onValuesChange(props, _, values){\r\n if (props.onValuesChange){\r\n props.onValuesChange(values);\r\n }\r\n }\r\n})(NewLegForm)","import {ScheduleEditorApi} from \"./api\";\r\nimport {Button, Dropdown, Icon, Menu} from \"antd\";\r\nimport React from \"react\";\r\n\r\nexport interface ViewButtonProps {\r\n api: ScheduleEditorApi\r\n}\r\n\r\nconst ViewButton: React.FC = (props) => {\r\n\r\n const { api } = props;\r\n\r\n return (\r\n \r\n Expand All Tables\r\n Collapse All Tables\r\n \r\n }\r\n >\r\n \r\n \r\n )\r\n}\r\n\r\nexport default ViewButton;","import React, {useContext, useRef} from \"react\";\r\nimport * as Phase2State from './state';\r\nimport {Alert, Button, Col, Divider, Dropdown, Icon, Input, Layout, Menu, message, Modal, Row, Tooltip} from \"antd\";\r\nimport {BASE_CLS, deRefLocations} from \"./util\";\r\nimport SelectionCount from \"../../../../components/search/SelectionCount\";\r\nimport GroupForm from \"./form\";\r\nimport {TransitType} from \"../../../../common/types/carriable\";\r\nimport './schedule-editor.less';\r\nimport ScheduleEditorTable from \"./table\";\r\nimport useUserGroups from \"../../../../hooks/useUserGroups\";\r\nimport NewLegForm from \"./new-leg-form\";\r\nimport {useApolloClient} from \"react-apollo\";\r\nimport {Location} from \"common/types/location\";\r\nimport {NewLegFormData} from \"./types\";\r\nimport * as NotesForPilot from \"../../../../components/flights/scheduling/notes-for-pilot\";\r\nimport {getSNodeID} from \"../../../../components/scheduling/util\";\r\nimport {ScheduleEditorApi} from \"./api\";\r\nimport ViewButton from \"./view-button\";\r\n\r\nconst { Content } = Layout;\r\n\r\nexport interface ScheduleEditorProps {\r\n groupFormRef: React.MutableRefObject,\r\n api: ScheduleEditorApi,\r\n\r\n /**\r\n * @default true\r\n */\r\n showEditButton?: boolean,\r\n\r\n /**\r\n * @default true\r\n */\r\n showViewButton?: boolean,\r\n\r\n /**\r\n * Moves the form (Flight Date, Schedule Name, Controlling Heliport) into the toolbar.\r\n * (Only available if edit mode is off)\r\n * @default false\r\n */\r\n showFormInToolbar?: boolean,\r\n\r\n /**\r\n * Extra UI elements to place at the end of the toolbar\r\n */\r\n toolbarExtra?: React.ReactNode[],\r\n}\r\n\r\nconst ScheduleEditor: React.FC = (props) => {\r\n\r\n const { api } = props;\r\n\r\n const editMode = api.editMode.get();\r\n\r\n const data = api.data;\r\n const saveStatus = api.saveStatus;\r\n const hideCarrierPanel = api.carriableSelector.hideCarriablePanel;\r\n const chargeCodes = api.chargeCodes;\r\n const selectedEntityIds = api.selection.entityIds;\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Hooks -----------------------------------------------------------------------------------------------------------\r\n const groupFormRef = React.useRef(null);\r\n const newLegModalFormRef = React.useRef(null);\r\n const [ userGroups ] = useUserGroups();\r\n const apolloClient = useApolloClient();\r\n const popupContainerRef = useRef(null);\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // State helpers ---------------------------------------------------------------------------------------------------\r\n const hasData = !!api.data.modifiedEntities.get().length;\r\n const scheduledPax = api.data.modifiedEntities.get().filter(c => c.classType === 'flytsuite.paxnode');\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n function runIsnCheck() {\r\n if (api.editMode.get()){\r\n message.error('Cannot run ISN check in edit mode');\r\n return;\r\n }\r\n api.bulkIsnChecker.runChecks(\r\n scheduledPax\r\n .filter(p => p.transitType === TransitType.OUTBOUND)\r\n .map((pax) => getSNodeID(pax))\r\n );\r\n }\r\n\r\n // Toolbar ---------------------------------------------------------------------------------------------------------\r\n let collapserIcon = 'menu-fold';\r\n let collapserTooltipText = 'Hide personnel search';\r\n if (hideCarrierPanel) {\r\n collapserIcon = 'menu-unfold';\r\n collapserTooltipText = 'Show personnel search';\r\n }\r\n\r\n function renderMoveToMenu(){\r\n\r\n const firstID = selectedEntityIds.get()[0];\r\n const firstSelectedEntity = api.data.modifiedEntities.get().find(e => getSNodeID(e) === firstID);\r\n\r\n return \r\n {\r\n\r\n const callback = (departure: Location, destination: Location) => {\r\n api.data.setEntityLegs(\r\n api.selection.entityIds.get(),\r\n departure,\r\n destination\r\n )\r\n }\r\n\r\n // Automatically fill in the departure and destination from\r\n // the first selected entity.\r\n if (firstSelectedEntity) {\r\n api.modal.newLegFormModal.open(\r\n firstSelectedEntity.departureID,\r\n firstSelectedEntity.destinationID,\r\n callback\r\n );\r\n }\r\n else {\r\n api.modal.newLegFormModal.open();\r\n }\r\n }}\r\n >\r\n New...\r\n \r\n \r\n \r\n \r\n \r\n {api.data.getLegs().map((leg) => {\r\n return (\r\n api.data.setEntityLegs(\r\n api.selection.entityIds.get(),\r\n leg.departure,\r\n leg.destination)\r\n }\r\n >\r\n {leg.departure.name + ' → ' + leg.destination.name}\r\n \r\n )\r\n })}\r\n \r\n }\r\n\r\n function renderSelectLegMenu(){\r\n return \r\n {api.data.getLegs().map((leg) => {\r\n return (\r\n api.selection.entityIds.add(leg.all.map(e => getSNodeID(e)))}\r\n >\r\n {leg.departure.name + ' → ' + leg.destination.name}\r\n \r\n )\r\n })}\r\n \r\n }\r\n\r\n // Form ------------------------------------------------------------------------------------------------------------\r\n\r\n const form = (\r\n \r\n \r\n {\r\n groupFormRef.current = ref;\r\n if (props.groupFormRef){\r\n props.groupFormRef.current = ref;\r\n }\r\n }}\r\n disabled={!editMode}\r\n formData={api.forms.groupForm.get()}\r\n onFieldsChange={api.forms.groupForm.setFields}\r\n />\r\n \r\n {groupFormRef.current && groupFormRef.current.props.form.isFieldsTouched() ? (\r\n \r\n \r\n \r\n \r\n \r\n \r\n ) : null}\r\n {editMode ? (\r\n <>\r\n \r\n \r\n = api.data.modifiedEntities.get().length}\r\n key=\"selectall\"\r\n onClick={selectedEntityIds.all}\r\n >Select All\r\n De-select All\r\n {renderSelectLegMenu()}\r\n \r\n }\r\n >\r\n \r\n \r\n \r\n \r\n ) : null}\r\n {props.showViewButton ? (\r\n \r\n \r\n \r\n ) : null}\r\n {editMode ? (\r\n \r\n \r\n Pilot Note Editor\r\n \r\n \r\n ) : null}\r\n {editMode ? (\r\n \r\n Default Charge Code: \r\n chargeCodes.setDefault(e.target.value.split(\" \").join(\"\"))}\r\n value={chargeCodes.getDefault()}\r\n />\r\n \r\n ) : null}\r\n {props.showEditButton ? (\r\n !editMode ? (\r\n userGroups.includes('flytsuite.schedule.passenger') ? (\r\n \r\n Edit\r\n \r\n ) : (\r\n \r\n \r\n \r\n )\r\n ) : null\r\n ) : null}\r\n {showFormInToolbar ? (\r\n <>\r\n {props.showEditButton || props.showViewButton ? (\r\n \r\n \r\n \r\n ) : null}\r\n \r\n {form}\r\n \r\n \r\n\r\n ) : null}\r\n
    \r\n {selectedEntityIds.get().length ? (\r\n <>\r\n \r\n \r\n \r\n \r\n ) : null}\r\n {props.toolbarExtra ? (\r\n props.toolbarExtra.map((element) => (\r\n \r\n {element}\r\n \r\n ))\r\n ) : null}\r\n \r\n )\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Table header ----------------------------------------------------------------------------------------------------\r\n const tableHeader = !showFormInToolbar ? (\r\n
    \r\n {form}\r\n
    \r\n ) : null;\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Leg tables ------------------------------------------------------------------------------------------------------\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Save status alert -----------------------------------------------------------------------------------------------\r\n let saveStatusAlert = null;\r\n if (saveStatus.get()){\r\n let content = null;\r\n if (saveStatus.get().status === 'success'){\r\n content = <>\r\n Finish\r\n \r\n {\r\n runIsnCheck();\r\n }}\r\n type=\"link\"\r\n size=\"large\"\r\n >Run ISN Check\r\n \r\n }\r\n const desc = (\r\n <>\r\n {saveStatus.get().description ?

    {saveStatus.get().description}

    : null}\r\n {content}\r\n \r\n )\r\n\r\n saveStatusAlert = (\r\n \r\n )\r\n }\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n return \r\n \r\n {toolbar}\r\n {saveStatusAlert}\r\n {tableHeader}\r\n \r\n {\r\n newLegModalFormRef.current?.validateFieldsAndScroll(async (err, values: NewLegFormData) => {\r\n if (err) return;\r\n\r\n const departureID = values.depDest.departure?.key;\r\n const destinationID = values.depDest.destination?.key;\r\n\r\n // Convert the location IDs to real locations\r\n const result = await deRefLocations(apolloClient, [departureID, destinationID]);\r\n if (result.errors.length){\r\n message.error('Failed to get locations');\r\n return;\r\n }\r\n const [ departure, destination ] = result.data;\r\n\r\n // Call the callback and close the modal (which clears the callback too)\r\n api.modal.newLegFormModal.callback?.(departure, destination);\r\n api.modal.newLegFormModal.close();\r\n })\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n}\r\n\r\nScheduleEditor.defaultProps = {\r\n showEditButton: true,\r\n showViewButton: true,\r\n showFormInToolbar: false\r\n}\r\n\r\nexport default ScheduleEditor","import React from \"react\";\r\nimport {cloneDeep, difference, union, unionBy, uniqBy} from 'lodash';\r\nimport {CargoFormFields, GroupData, GroupFormData, NewLegFormFields} from \"./types\";\r\nimport {ScheduleEditorApi} from \"./api\";\r\nimport * as Util from './util';\r\nimport {Location} from 'common/types/location';\r\nimport {createFormField, FormErrors} from \"../../../../common/form\";\r\nimport {getTransitType} from \"../../../../common/carriable/util\";\r\nimport {produce} from \"immer\";\r\nimport * as NotesForPilot from '../../../../components/flights/scheduling/notes-for-pilot';\r\nimport {ScheduledCgoNode, ScheduledPaxNode, ScheduleNode} from \"../../../../components/scheduling/types\";\r\nimport {getSNodeID} from \"../../../../components/scheduling/util\";\r\n\r\nexport enum ActionType {\r\n // Data manipulation\r\n SET_MODIFIED_ENTITIES='SET_MODIFIED_ENTITIES',\r\n INIT_DATA='INIT_DATA',\r\n RESET_DATA='RESET_DATA',\r\n\r\n // Forms\r\n RESET_FORM_DATA='RESET_FORM_DATA',\r\n SET_FORM_DATA='SET_FORM_DATA',\r\n\r\n // Query status\r\n SET_QUERY_STATUS='SET_QUERY_STATUS',\r\n\r\n // Save status\r\n SET_SAVE_STATUS='SET_SAVE_STATUS',\r\n DISMISS_SAVE_STATUS='DISMISS_SAVE_STATUS',\r\n\r\n // Passenger selection\r\n SET_SELECTED_PERSONNEL_IDS='SET_SELECTED_PERSONNEL_IDS',\r\n\r\n // Tab selection\r\n SET_CARRIABLE_SELECTOR_TAB='SET_CARRIABLE_SELECTOR_TAB',\r\n SET_EDIT_MODE='SET_EDIT_MODE',\r\n\r\n // CarrierSelector\r\n SET_CARRIABLE_SEL_SEARCH='SET_CARRIABLE_SEL_SEARCH',\r\n SET_HIDE_CARRIABLE_PANEL='SET_HIDE_CARRIABLE_PANEL',\r\n SET_LEG_SELECTOR='SET_LEG_SELECTOR',\r\n\r\n // Editor\r\n SET_SELECTED_ENTITY_IDS='SET_SELECTED_ENTITY_IDS',\r\n CLEAR_CHARGE_CODES='CLEAR_CHARGE_CODES',\r\n SET_DEFAULT_CHARGE_CODE='SET_DEFAULT_CHARGE_CODE',\r\n SET_ISN_DRAWER='SET_ISN_DRAWER',\r\n SET_VISIBLE_LEGS='SET_VISIBLE_LEGS',\r\n\r\n // Modals\r\n SET_PAXNODE_MODAL='SET_PAXNODE_MODAL',\r\n SET_NEW_LEG_MODAL='SET_NEW_LEG_MODAL',\r\n\r\n // Notes for pilot\r\n NOTES_FOR_PILOT_POPUP='NOTES_FOR_PILOT_POPUP',\r\n NOTES_FOR_PILOT_EDITOR='NOTES_FOR_PILOT_EDITOR',\r\n SUBMIT_NOTES_FOR_PILOT_EDITOR='SUBMIT_NOTES_FOR_PILOT_EDITOR'\r\n}\r\n\r\nexport const DEFAULT_STATE = {\r\n editMode: true,\r\n data: {\r\n originalEntities: [] as ScheduleNode[],\r\n modifiedEntities: [] as ScheduleNode[],\r\n deletedEntities: [] as ScheduleNode[]\r\n },\r\n queryStatus: {\r\n loading: false,\r\n error: null as any\r\n },\r\n saveStatus: null as ({\r\n status: 'success' | 'error',\r\n message: string,\r\n description?: string\r\n }) | null,\r\n\r\n carriableSelector: {\r\n selectedPersonnelIds: [] as string[],\r\n upperTab: 'personSearch' as 'personSearch' | 'cargoForm',\r\n lowerTab: 'byName' as 'byName' | 'byId',\r\n legSelector: {\r\n departure: null as { key: string, label: string },\r\n destination: null as { key: string, label: string }\r\n },\r\n searchForm: {\r\n lastName: null as string,\r\n firstName: null as string,\r\n credId: null as string\r\n },\r\n hidePanel: true\r\n },\r\n forms: {\r\n initGroupForm: {\r\n date: null,\r\n name: null,\r\n lastKnownController: null\r\n } as GroupFormData,\r\n groupForm: {\r\n date: null,\r\n name: null,\r\n lastKnownController: null\r\n } as GroupFormData,\r\n cargoForm: {\r\n name: null,\r\n weight: null,\r\n hazmat: null,\r\n hazmatUnCode: null,\r\n attentionTo: null,\r\n notes: null\r\n } as CargoFormFields,\r\n newLegForm: {\r\n depDest: createFormField({\r\n departure: null,\r\n destination: null\r\n })\r\n } as NewLegFormFields\r\n },\r\n formErrors: {\r\n cargoFormErrors: {} as FormErrors\r\n },\r\n modal: {\r\n paxModal: {\r\n pax: null as ScheduledPaxNode,\r\n visible: false\r\n },\r\n newLegFormModal: {\r\n visible: false,\r\n callback: null as (departure: Location, destination: Location) => void\r\n },\r\n messageModal: {\r\n visible: false\r\n }\r\n },\r\n editor: {\r\n selectedEntityIds: [] as string[],\r\n defaultChargeCode: '' as string,\r\n isnDrawer: {\r\n pax: null as ScheduledPaxNode,\r\n visible: false\r\n },\r\n visibleLegs: [] as { departureID: string, destinationID: string }[]\r\n },\r\n\r\n // Controls the \"Notes For Pilot\" column inputs\r\n // Because we are centralizing the state here, it won't be possible to have more than one input popup open at once.\r\n notesForPilotPopup: {\r\n entityId: null as string,\r\n ...NotesForPilot.QuickEdit.DEFAULT_STATE\r\n },\r\n\r\n notesForPilotEditor: {\r\n open: false,\r\n state: NotesForPilot.Editor.DEFAULT_STATE\r\n }\r\n}\r\n\r\nexport type State = typeof DEFAULT_STATE;\r\n\r\nexport type Actions =\r\n // Data manipulation\r\n {\r\n type: ActionType.INIT_DATA,\r\n entities: ScheduleNode[],\r\n group: GroupData\r\n } |\r\n {\r\n type: ActionType.SET_MODIFIED_ENTITIES,\r\n add?: ScheduleNode[],\r\n remove?: string[]\r\n set?: ScheduleNode[]\r\n } |\r\n {\r\n type: ActionType.RESET_DATA\r\n } |\r\n\r\n // Forms\r\n {\r\n type: ActionType.RESET_FORM_DATA,\r\n cargo?: boolean,\r\n group?: boolean,\r\n newLeg?: boolean\r\n } |\r\n {\r\n type: ActionType.SET_FORM_DATA,\r\n group?: typeof DEFAULT_STATE.forms.groupForm\r\n cargo?: typeof DEFAULT_STATE.forms.cargoForm,\r\n newLeg?: typeof DEFAULT_STATE.forms.newLegForm\r\n } |\r\n\r\n // Query Status\r\n {\r\n type: ActionType.SET_QUERY_STATUS,\r\n payload: typeof DEFAULT_STATE.queryStatus\r\n } |\r\n\r\n // Save Status\r\n {\r\n type: ActionType.SET_SAVE_STATUS,\r\n payload: typeof DEFAULT_STATE.saveStatus\r\n } |\r\n {\r\n type: ActionType.DISMISS_SAVE_STATUS\r\n } |\r\n\r\n // Passenger selection\r\n {\r\n type: ActionType.SET_SELECTED_PERSONNEL_IDS,\r\n payload: string[]\r\n } |\r\n\r\n // Tab selection\r\n {\r\n type: ActionType.SET_CARRIABLE_SELECTOR_TAB,\r\n payload: {\r\n upperTab: typeof DEFAULT_STATE.carriableSelector.upperTab,\r\n lowerTab: typeof DEFAULT_STATE.carriableSelector.lowerTab\r\n }\r\n } |\r\n\r\n // Edit mode\r\n {\r\n type: ActionType.SET_EDIT_MODE,\r\n payload: boolean\r\n } |\r\n\r\n // Set CarriableSelector\r\n {\r\n type: ActionType.SET_CARRIABLE_SEL_SEARCH,\r\n payload: typeof DEFAULT_STATE.carriableSelector.searchForm\r\n } |\r\n {\r\n type: ActionType.SET_HIDE_CARRIABLE_PANEL,\r\n payload: boolean | undefined\r\n } |\r\n {\r\n type: ActionType.SET_LEG_SELECTOR,\r\n payload: {\r\n departure: typeof DEFAULT_STATE.carriableSelector.legSelector.departure,\r\n destination: typeof DEFAULT_STATE.carriableSelector.legSelector.destination,\r\n }\r\n } |\r\n\r\n // Editor\r\n {\r\n type: ActionType.SET_SELECTED_ENTITY_IDS,\r\n add?: typeof DEFAULT_STATE.editor.selectedEntityIds,\r\n remove?: typeof DEFAULT_STATE.editor.selectedEntityIds,\r\n set?: typeof DEFAULT_STATE.editor.selectedEntityIds\r\n } |\r\n {\r\n type: ActionType.CLEAR_CHARGE_CODES\r\n } |\r\n {\r\n type: ActionType.SET_DEFAULT_CHARGE_CODE,\r\n payload: string\r\n } |\r\n {\r\n type: ActionType.SET_ISN_DRAWER,\r\n payload: typeof DEFAULT_STATE.editor.isnDrawer\r\n } |\r\n {\r\n type: ActionType.SET_VISIBLE_LEGS,\r\n mode: 'objects',\r\n action: 'set' | 'add',\r\n payload: typeof DEFAULT_STATE.editor.visibleLegs\r\n } |\r\n {\r\n type: ActionType.SET_VISIBLE_LEGS,\r\n mode: 'strings',\r\n action: 'set' | 'add',\r\n payload: string[],\r\n splitBy: string\r\n } |\r\n\r\n // Modals\r\n {\r\n type: ActionType.SET_PAXNODE_MODAL,\r\n visible?: boolean,\r\n pax?: ScheduledPaxNode\r\n } |\r\n {\r\n type: ActionType.SET_NEW_LEG_MODAL,\r\n visible: boolean,\r\n newLegValue?: typeof DEFAULT_STATE.forms.newLegForm.depDest.value,\r\n callback?: typeof DEFAULT_STATE.modal.newLegFormModal.callback\r\n } |\r\n\r\n // Notes For Pilot\r\n {\r\n type: ActionType.NOTES_FOR_PILOT_POPUP,\r\n entityId: string,\r\n action: NotesForPilot.QuickEdit.Action\r\n } |\r\n {\r\n type: ActionType.NOTES_FOR_PILOT_EDITOR,\r\n open?: boolean,\r\n action?: NotesForPilot.Editor.Action\r\n } |\r\n {\r\n type: ActionType.SUBMIT_NOTES_FOR_PILOT_EDITOR\r\n }\r\n\r\nexport const Reducer: React.Reducer = (state, action) => {\r\n\r\n class HelperFuncs {\r\n public static setVisibleLegs(visibleLegs: typeof DEFAULT_STATE.editor.visibleLegs){\r\n return {\r\n ...state,\r\n editor: {\r\n ...state.editor,\r\n visibleLegs\r\n }\r\n }\r\n }\r\n public static addVisibleLegs(visibleLegs: typeof DEFAULT_STATE.editor.visibleLegs){\r\n return this.setVisibleLegs(\r\n unionBy(\r\n visibleLegs,\r\n state.editor.visibleLegs,\r\n this.depDestToString\r\n )\r\n )\r\n }\r\n public static depDestToString(item: { departureID: string, destinationID: string }, splitter: string='::'){\r\n return item.departureID + splitter + item.destinationID ;\r\n }\r\n public static depDestFromString(str: string, splitBy: string){\r\n const separated = String(str).split(splitBy);\r\n if (separated.length >= 2){\r\n return {\r\n departureID: separated[0],\r\n destinationID: separated[1]\r\n }\r\n }\r\n }\r\n private static _MUTABLE_validateSelectedEntities(state: State){\r\n // DO NOT USE OUTSIDE HelperFuncs.validateState!\r\n\r\n // Make sure pax/cgo assigned to a flight don't end up selected.\r\n state.editor.selectedEntityIds = state.editor.selectedEntityIds.filter(id => {\r\n return !!state.data.modifiedEntities.find(e => getSNodeID(e) === id && !e.currentCarrierID)\r\n })\r\n }\r\n public static validateState(state: State){\r\n return produce(state, (draft) => {\r\n this._MUTABLE_validateSelectedEntities(draft);\r\n })\r\n }\r\n }\r\n\r\n const nextState = getNextState();\r\n return HelperFuncs.validateState(nextState);\r\n\r\n function getNextState(){\r\n switch (action.type){\r\n // Data manipulation\r\n case ActionType.INIT_DATA:\r\n const entities = [...action.entities];\r\n entities.sort(Util.sortByScheduledOrder);\r\n\r\n let groupForm = DEFAULT_STATE.forms.groupForm;\r\n if (action.group){\r\n groupForm = Util.initFormData(action.group);\r\n }\r\n\r\n return {\r\n ...state,\r\n data: {\r\n // Deep copy initial entity list to ensure original stat is preserved\r\n originalEntities: cloneDeep(entities),\r\n\r\n modifiedEntities: entities,\r\n deletedEntities: []\r\n },\r\n forms: {\r\n ...state.forms,\r\n initGroupForm: groupForm,\r\n groupForm: groupForm\r\n }\r\n }\r\n\r\n case ActionType.RESET_DATA:\r\n // Reset data back to their original\r\n return {\r\n ...state,\r\n data: {\r\n ...state.data,\r\n modifiedEntities: state.data.originalEntities,\r\n deletedEntities: []\r\n }\r\n }\r\n\r\n // Forms\r\n case ActionType.RESET_FORM_DATA: {\r\n let newState = {...state};\r\n\r\n const resetData = (\r\n reset: boolean,\r\n formName: keyof typeof DEFAULT_STATE.forms) => {\r\n\r\n if (!reset) return;\r\n\r\n newState = {\r\n ...newState,\r\n forms: {\r\n ...newState.forms,\r\n [formName]: DEFAULT_STATE[formName]\r\n }\r\n }\r\n }\r\n\r\n resetData(action.group, 'groupForm');\r\n resetData(action.cargo, 'cargoForm');\r\n resetData(action.newLeg, 'newLegForm');\r\n\r\n return newState;\r\n }\r\n case ActionType.SET_FORM_DATA: {\r\n let newState = {...state};\r\n\r\n if (action.cargo) {\r\n let initials = action.cargo.initials?.value;\r\n if (initials) {\r\n initials = String(initials).toUpperCase();\r\n }\r\n\r\n if (action.cargo.initials?.value) {\r\n action.cargo.initials.value = initials;\r\n } else {\r\n action.cargo.initials = createFormField(initials);\r\n }\r\n\r\n newState = {\r\n ...newState,\r\n forms: {\r\n ...newState.forms,\r\n cargoForm: action.cargo\r\n }\r\n }\r\n }\r\n\r\n if (action.group) {\r\n newState = {\r\n ...newState,\r\n forms: {\r\n ...newState.forms,\r\n groupForm: action.group\r\n }\r\n }\r\n }\r\n\r\n if (action.newLeg) {\r\n newState = {\r\n ...newState,\r\n forms: {\r\n ...newState.forms,\r\n newLegForm: action.newLeg\r\n }\r\n }\r\n }\r\n\r\n return newState;\r\n }\r\n\r\n case ActionType.SET_MODIFIED_ENTITIES: {\r\n let newState = {...state};\r\n\r\n if (action.set) {\r\n newState = {\r\n ...newState,\r\n data: {\r\n ...newState.data,\r\n modifiedEntities: action.set\r\n .map(Util.updateScheduledOrder)\r\n }\r\n }\r\n }\r\n\r\n if (action.remove) {\r\n newState = {\r\n ...newState,\r\n data: {\r\n ...newState.data,\r\n modifiedEntities: newState.data.modifiedEntities.filter(e => !action.remove.includes(getSNodeID(e)))\r\n .map(Util.updateScheduledOrder),\r\n deletedEntities: unionBy(\r\n // Make sure we aren't adding 'new' entities to the deleted list.\r\n // New entities being ones added by the user that weren't in the list originally.\r\n newState.data.originalEntities.filter(e => action.remove.includes(getSNodeID(e))),\r\n\r\n newState.data.deletedEntities,\r\n e => getSNodeID(e)\r\n )\r\n },\r\n editor: {\r\n ...newState.editor,\r\n // Clear deleted items from the selection list\r\n selectedEntityIds: difference(newState.editor.selectedEntityIds, action.remove)\r\n }\r\n }\r\n }\r\n\r\n if (action.add) {\r\n\r\n let newEntities: ScheduleNode[] = unionBy(newState.data.modifiedEntities, action.add, (e) => getSNodeID(e));\r\n\r\n if (newEntities.length === newState.data.modifiedEntities.length) {\r\n\r\n // Workaround for editing existing entities weight values not working.\r\n newEntities.forEach((e: ScheduleNode, i: number) => {\r\n action.add.forEach(actionE => {\r\n if (getSNodeID(e) === getSNodeID(actionE)) {\r\n newEntities[i] = actionE;\r\n }\r\n })\r\n })\r\n\r\n // No new entities were added. Preserve their scheduledOrder.\r\n // Needed to do this because \"editing\" a passenger uses this, and it kept changing their order.\r\n newEntities.sort(Util.sortByScheduledOrder);\r\n } else {\r\n // Use to sort pax and cgo into groups\r\n const legs = Util.DepDestList.build(newEntities);\r\n\r\n let sorted = [];\r\n for (let leg of legs) {\r\n sorted = sorted.concat(leg.pax, leg.cgo);\r\n }\r\n\r\n newEntities = sorted.map(Util.updateScheduledOrder);\r\n\r\n // Check each cargo that was added. If one of the cargos has the same name as in the cargo form,\r\n // clear the cargo form.\r\n newEntities.forEach(entity => {\r\n if (entity.classType === 'flytsuite.cgonode' && (entity as ScheduledCgoNode).name === state.forms.cargoForm.name?.value) {\r\n newState = {\r\n ...newState,\r\n forms: {\r\n ...newState.forms,\r\n cargoForm: DEFAULT_STATE.forms.cargoForm\r\n }\r\n }\r\n }\r\n })\r\n }\r\n\r\n // Recalculate transitTypes\r\n newEntities = newEntities\r\n .map(entity => ({\r\n ...entity,\r\n transitType: getTransitType(entity.departureID, entity.destinationID)\r\n }))\r\n\r\n newState = {\r\n ...newState,\r\n ...HelperFuncs.addVisibleLegs(\r\n uniqBy(\r\n action.add.map(p => (\r\n {\r\n departureID: p.departureID?._id,\r\n destinationID: p.destinationID?._id\r\n }\r\n )),\r\n HelperFuncs.depDestToString\r\n )\r\n ),\r\n carriableSelector: {\r\n ...newState.carriableSelector,\r\n selectedPersonnelIds: difference(\r\n newState.carriableSelector.selectedPersonnelIds,\r\n action.add.map((p: ScheduledPaxNode) => p.personID?._id)\r\n )\r\n },\r\n data: {\r\n ...newState.data,\r\n modifiedEntities: newEntities\r\n }\r\n }\r\n }\r\n\r\n return newState;\r\n }\r\n\r\n // Query status\r\n case ActionType.SET_QUERY_STATUS:\r\n return {\r\n ...state,\r\n queryStatus: action.payload\r\n }\r\n\r\n // Save status\r\n case ActionType.SET_SAVE_STATUS:\r\n return {\r\n ...state,\r\n saveStatus: action.payload\r\n }\r\n case ActionType.DISMISS_SAVE_STATUS:\r\n return {\r\n ...state,\r\n saveStatus: undefined\r\n }\r\n\r\n case ActionType.SET_SELECTED_PERSONNEL_IDS:\r\n return {\r\n ...state,\r\n carriableSelector: {\r\n ...state.carriableSelector,\r\n selectedPersonnelIds: action.payload\r\n }\r\n }\r\n case ActionType.SET_CARRIABLE_SELECTOR_TAB:\r\n return {\r\n ...state,\r\n carriableSelector: {\r\n ...state.carriableSelector,\r\n upperTab: action.payload.upperTab,\r\n lowerTab: action.payload.lowerTab\r\n }\r\n }\r\n case ActionType.SET_EDIT_MODE:\r\n return {\r\n ...state,\r\n editMode: action.payload,\r\n saveStatus: action.payload === true ? undefined : state.saveStatus,\r\n editor: {\r\n ...state.editor,\r\n selectedEntityIds: []\r\n }\r\n }\r\n case ActionType.SET_CARRIABLE_SEL_SEARCH:\r\n return {\r\n ...state,\r\n carriableSelector: {\r\n ...state.carriableSelector,\r\n searchForm: action.payload\r\n }\r\n }\r\n\r\n // If payload is undefined, then this state will toggle\r\n case ActionType.SET_HIDE_CARRIABLE_PANEL:\r\n return {\r\n ...state,\r\n carriableSelector: {\r\n ...state.carriableSelector,\r\n hidePanel: action.payload === undefined ? !state.carriableSelector.hidePanel : action.payload\r\n }\r\n }\r\n\r\n // Editor\r\n case ActionType.SET_SELECTED_ENTITY_IDS:\r\n if (!action.add && !action.remove && !action.set) return;\r\n\r\n let newSelEntityIds = state.editor.selectedEntityIds;\r\n\r\n if (action.set){\r\n newSelEntityIds = action.set;\r\n }\r\n if (action.remove){\r\n newSelEntityIds = difference(newSelEntityIds, action.remove);\r\n }\r\n if (action.add){\r\n newSelEntityIds = union(newSelEntityIds, action.add);\r\n }\r\n\r\n return {\r\n ...state,\r\n editor: {\r\n ...state.editor,\r\n selectedEntityIds: newSelEntityIds\r\n }\r\n }\r\n\r\n case ActionType.CLEAR_CHARGE_CODES:\r\n const clearEntityChargeCode = (entity: ScheduleNode) => {\r\n if (entity.classType === 'flytsuite.paxnode'){\r\n return {\r\n ...entity,\r\n chargeCode: null\r\n }\r\n }\r\n return entity\r\n }\r\n\r\n return {\r\n ...state,\r\n scheduledEntities: state.data.modifiedEntities.map(clearEntityChargeCode)\r\n }\r\n case ActionType.SET_DEFAULT_CHARGE_CODE:\r\n return {\r\n ...state,\r\n editor: {\r\n ...state.editor,\r\n defaultChargeCode: action.payload\r\n }\r\n }\r\n case ActionType.SET_LEG_SELECTOR:\r\n return {\r\n ...state,\r\n carriableSelector: {\r\n ...state.carriableSelector,\r\n legSelector: {\r\n ...state.carriableSelector.legSelector,\r\n departure: action.payload.departure,\r\n destination: action.payload.destination\r\n }\r\n }\r\n }\r\n case ActionType.SET_ISN_DRAWER:\r\n return {\r\n ...state,\r\n editor: {\r\n ...state.editor,\r\n isnDrawer: {\r\n pax: action.payload.pax,\r\n visible: action.payload.visible\r\n }\r\n }\r\n }\r\n case ActionType.SET_VISIBLE_LEGS:\r\n\r\n let visibleLegs: typeof DEFAULT_STATE.editor.visibleLegs = [];\r\n\r\n if (action.mode === 'objects'){\r\n visibleLegs = action.payload;\r\n }\r\n else if (action.mode === 'strings')\r\n {\r\n for (let locIDCombined of action.payload) {\r\n const separated = HelperFuncs.depDestFromString(locIDCombined, action.splitBy);\r\n if (separated){\r\n visibleLegs.push({\r\n departureID: separated.departureID,\r\n destinationID: separated.destinationID\r\n })\r\n }\r\n }\r\n }\r\n\r\n if (action.action === 'set'){\r\n return HelperFuncs.setVisibleLegs(visibleLegs);\r\n }\r\n else\r\n {\r\n return HelperFuncs.addVisibleLegs(visibleLegs);\r\n }\r\n\r\n // Modals\r\n case ActionType.SET_PAXNODE_MODAL:\r\n\r\n let paxModal = {\r\n visible: action.visible !== undefined ? action.visible : state.modal.paxModal.visible,\r\n pax: action.pax !== undefined ? action.pax : state.modal.paxModal.pax\r\n }\r\n\r\n if (!paxModal.pax && paxModal.visible){\r\n // Can't be visible without pax data\r\n paxModal.visible = false;\r\n }\r\n\r\n return {\r\n ...state,\r\n modal: {\r\n ...state.modal,\r\n paxModal: paxModal\r\n }\r\n }\r\n case ActionType.SET_NEW_LEG_MODAL:\r\n\r\n let newLegForm = state.forms.newLegForm;\r\n if (action.newLegValue){\r\n newLegForm = {\r\n ...newLegForm,\r\n depDest: createFormField({\r\n departure: action.newLegValue.departure,\r\n destination: action.newLegValue.destination\r\n })\r\n }\r\n }\r\n\r\n return {\r\n ...state,\r\n modal: {\r\n ...state.modal,\r\n newLegFormModal: {\r\n ...state.modal.newLegFormModal,\r\n // Callback must be cleared if the modal is made non-visible\r\n callback: action.visible ? action.callback : null,\r\n visible: action.visible\r\n }\r\n },\r\n forms: {\r\n ...state.forms,\r\n newLegForm: newLegForm\r\n }\r\n }\r\n case ActionType.NOTES_FOR_PILOT_POPUP: {\r\n\r\n let entityId = action.entityId;\r\n\r\n if (action.action.type === 'EDIT_MODE' && !action.action.value) {\r\n // User is leaving edit mode. entityId can be cleared.\r\n entityId = null;\r\n }\r\n\r\n if (\r\n state.notesForPilotPopup.entityId !== action.entityId &&\r\n state.notesForPilotPopup.editMode\r\n ){\r\n // Cannot cancel editing of another while in edit mode.\r\n return state;\r\n }\r\n\r\n let newState = cloneDeep(state.notesForPilotPopup);\r\n\r\n newState = {\r\n ...newState,\r\n ...NotesForPilot.QuickEdit.Reducer(state.notesForPilotPopup, action.action)\r\n }\r\n\r\n // If the entityId is changed, reset the text states.\r\n if (action.entityId !== state.notesForPilotPopup.entityId){\r\n\r\n const origText = (state.data.modifiedEntities\r\n .find(entity => getSNodeID(entity) === entityId)?.notesForPilot) || '';\r\n\r\n newState = {\r\n ...newState,\r\n originalText: origText,\r\n modifiedText: origText\r\n }\r\n }\r\n\r\n return {\r\n ...state,\r\n notesForPilotPopup: {\r\n ...newState,\r\n entityId: entityId\r\n }\r\n }\r\n }\r\n case ActionType.NOTES_FOR_PILOT_EDITOR:\r\n {\r\n return produce(state, (newState) => {\r\n if (action.action){\r\n newState.notesForPilotEditor.state = NotesForPilot.Editor.Reducer(state.notesForPilotEditor.state, action.action);\r\n }\r\n\r\n // if (action.action.type === 'INIT' && state.notesForPilotEditor.open){\r\n // // Prevent spurious inits from triggering while open\r\n // newState.notesForPilotEditor.state = {...state.notesForPilotEditor.state};\r\n // }\r\n\r\n if (action.open !== undefined){\r\n newState.notesForPilotEditor.open = Boolean(action.open);\r\n }\r\n\r\n if (action.open === false){\r\n // Reset data when closed\r\n newState.notesForPilotEditor.state = NotesForPilot.Editor\r\n .Reducer(newState.notesForPilotEditor.state, { type: 'RESET' });\r\n }\r\n })\r\n }\r\n case ActionType.SUBMIT_NOTES_FOR_PILOT_EDITOR:\r\n {\r\n return produce(state, (newState) => {\r\n\r\n newState.data.modifiedEntities = newState.data.modifiedEntities\r\n .map(entity => (\r\n {\r\n ...entity,\r\n notesForPilot: (\r\n NotesForPilot.Editor.Util\r\n .getEntityNoteMsg(entity, newState.notesForPilotEditor.state)\r\n )\r\n }\r\n ))\r\n\r\n newState.notesForPilotEditor.state = NotesForPilot\r\n .Editor\r\n .Reducer(newState.notesForPilotEditor.state, {\r\n type: 'INIT',\r\n entities: newState.data.modifiedEntities\r\n });\r\n\r\n newState.notesForPilotEditor.open = false;\r\n })\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport interface ContextType {\r\n api: ScheduleEditorApi\r\n}\r\n\r\nexport const Context = React.createContext(null);\r\nexport const Provider = Context.Provider;","import ScheduleEditor from \"./schedule-editor\";\r\nexport { default as CarriableSelector } from \"./carriable-selector\";\r\nexport type {\r\n ScheduleEditorProps\r\n} from './schedule-editor';\r\nexport type { GroupData, ScheduleVariables } from './types';\r\nexport type { useScheduleEditorApi } from './api';\r\n\r\n\r\nexport default ScheduleEditor;","import {CargoFormData} from \"./types\";\r\nimport * as CargoUtils from \"components/form/CargoForm\";\r\nimport {OrgDataProviderContext} from \"context/orgData\";\r\nimport * as Util from './util';\r\nimport {Location} from \"common/types/location\";\r\nimport {getTransitType} from \"../../../../common/carriable/util\";\r\nimport {ScheduledCgoNode} from \"../../../../components/scheduling/types\";\r\n\r\nexport function cargoFormToCargoNode(\r\n formValues: CargoFormData,\r\n orgData: OrgDataProviderContext,\r\n departure: Location,\r\n destination: Location\r\n): ScheduledCgoNode {\r\n const formattedValues = CargoUtils.formatCargoFormValues(formValues);\r\n\r\n const node: ScheduledCgoNode = {\r\n _id: undefined, // ID will be assigned in backend\r\n\r\n __temp_id: Util.genTempID(),\r\n ...formattedValues,\r\n customerID: orgData.getOrgIDByType('customer'),\r\n tpID: orgData.getOrgIDByType('transporter'),\r\n classType: 'flytsuite.cgonode',\r\n departureID: departure,\r\n destinationID: destination,\r\n transitType: getTransitType(departure, destination),\r\n scheduledOrder: null,\r\n notesForPilot: null\r\n }\r\n\r\n return node;\r\n}","import {Location, Person, ScheduledPaxCgoResult, ScheduleHistoryDetail} from \"__generated__/graphql/types\";\r\nimport * as Phase2State from \"./state\";\r\nimport {ActionType, DEFAULT_STATE, State} from \"./state\";\r\nimport {CargoFormData, DepDestListItem, GroupData} from \"./types\";\r\nimport {useBulkISNChecker} from \"components/BulkISNChecker\";\r\nimport {useApolloClient, useQuery} from \"react-apollo\";\r\nimport React, {MutableRefObject, useContext, useEffect, useMemo, useReducer, useRef} from \"react\";\r\nimport {OrgDataContext} from \"context/orgData\";\r\nimport * as NotesForPilotRendererModule from \"components/flights/scheduling/notes-for-pilot/quickedit\";\r\nimport * as Util from \"./util\";\r\nimport {deRefLocations, findLegIdx} from \"./util\";\r\nimport {ResolvePersonIdsQuery} from \"Queries/Person\";\r\nimport {message, Modal} from \"antd\";\r\nimport {NetworkStatus} from \"apollo-client\";\r\nimport {personToPassenger} from \"common/person\";\r\nimport {cargoFormToCargoNode} from \"./cargo-util\";\r\nimport * as NotesForPilot from 'components/flights/scheduling/notes-for-pilot';\r\nimport {ScheduledCgoNode, ScheduledPaxNode, ScheduleNode} from \"components/scheduling/types\";\r\nimport {getSNodeID} from \"components/scheduling/util\";\r\n\r\n/**\r\n * Getters and setters for modifying and reading the state of the Phase2 page.\r\n * Abstracts access to the actual state object so that child components consuming the state don't break from\r\n * structure changes.\r\n *\r\n * TODO: Investigate ways to improve performance when using a \"global\" state like this.\r\n * Something as simple as adding a single note to notesForPilot requires an entire re-render of the page.\r\n * Look at potentially using the Redux library for this, or try to implement memoization.\r\n */\r\nexport interface ScheduleEditorApi {\r\n getScheduledPaxNodes: () => ScheduledPaxNode[],\r\n getScheduledCgoNodes: () => ScheduledCgoNode[],\r\n groupData: GroupData,\r\n data: {\r\n modifiedEntities: {\r\n get: () => State['data']['modifiedEntities'],\r\n getNotOnCarrier: () => State['data']['modifiedEntities'],\r\n set: (entities: ScheduleNode[]) => void,\r\n add: (entities: ScheduleNode[]) => void,\r\n remove: (entityIds: string[]) => void\r\n },\r\n originalEntities: {\r\n get: () => State['data']['originalEntities']\r\n }\r\n getModifiedEntityById: (entityId: string) => ScheduleNode | null,\r\n modifyEntity: (entityId: string, changedFields: Omit, '_id'>) => void,\r\n removeEntities: (entityIds: string[]) => void,\r\n removeLeg: (departureID: string, destinationID: string) => void,\r\n swapEntities: (startIdx: number, endIdx: number) => void,\r\n swapLegs: (start: DepDestListItem, end: DepDestListItem | 'up' | 'down') => void,\r\n getLegs: () => DepDestListItem[],\r\n setLegs: (legs: DepDestListItem[]) => void,\r\n setEntityLegs: (entities: string[], departure: Location, destination: Location) => void,\r\n reset: () => void,\r\n getNotesForPilot: () => Record\r\n },\r\n schedule: {\r\n finish: () => void\r\n },\r\n queryInfo: {\r\n loading: boolean,\r\n error: any,\r\n hasError: boolean\r\n },\r\n saveInfo: {\r\n saving: boolean,\r\n hasError: boolean\r\n },\r\n saveStatus: {\r\n get: () => State['saveStatus']\r\n dismiss: () => void\r\n }\r\n selection: {\r\n entityIds: {\r\n get: () => string[],\r\n set: (newEntities: string[]) => void,\r\n add: (newEntities: string[]) => void,\r\n toggle: (entityID: string) => void,\r\n remove: (removedEntities: string[]) => void,\r\n clear: () => void,\r\n all: () => void\r\n },\r\n personnelIds: {\r\n get: () => State['carriableSelector']['selectedPersonnelIds'],\r\n set: (ids: string[]) => void,\r\n clear: () => void,\r\n getAsObjects: () => {\r\n loading: boolean,\r\n objects: Person[]\r\n }\r\n addToSchedule: (departureID: string, destinationID: string) => Promise\r\n }\r\n },\r\n bulkIsnChecker: ReturnType,\r\n editMode: {\r\n toggle: () => void,\r\n set: (editing: boolean) => void,\r\n get: () => boolean\r\n }\r\n carriableSelector: {\r\n tabs: {\r\n set: (\r\n upperTab: typeof DEFAULT_STATE.carriableSelector.upperTab,\r\n lowerTab: typeof DEFAULT_STATE.carriableSelector.lowerTab\r\n ) => void,\r\n get: () => {\r\n upperTab: State['carriableSelector']['upperTab'],\r\n lowerTab: State['carriableSelector']['lowerTab']\r\n }\r\n },\r\n legSelector: {\r\n set: (departure: { key: string, label: string }, destination: { key: string, label: string }) => void,\r\n get: () => State['carriableSelector']['legSelector']\r\n },\r\n hideCarriablePanel: {\r\n get: () => State['carriableSelector']['hidePanel']\r\n set: (hide: boolean) => void,\r\n toggle: () => void\r\n }\r\n },\r\n forms: {\r\n cargoForm: {\r\n get: () => State['forms']['cargoForm'],\r\n setFields: (fields: State['forms']['cargoForm']) => void,\r\n resetFields: () => void,\r\n submit: (departureID: string, destinationID: string) => Promise,\r\n ref: MutableRefObject\r\n },\r\n groupForm: {\r\n get: () => State['forms']['groupForm'],\r\n setFields: (fields: State['forms']['groupForm']) => void,\r\n resetFields: () => void,\r\n ref: MutableRefObject\r\n },\r\n newLegForm: {\r\n get: () => State['forms']['newLegForm'],\r\n setFields: (fields: State['forms']['newLegForm']) => void,\r\n resetFields: () => void\r\n },\r\n searchForm: {\r\n set: (searchForm: typeof DEFAULT_STATE.carriableSelector.searchForm) => void,\r\n get: () => State['carriableSelector']['searchForm']\r\n }\r\n },\r\n modal: {\r\n paxModal: {\r\n open: (pax: ScheduledPaxNode) => void,\r\n close: () => void,\r\n get: () => State['modal']['paxModal']\r\n },\r\n newLegFormModal: {\r\n open: (\r\n departure?: Location | null,\r\n destination?: Location | null,\r\n callback?: State['modal']['newLegFormModal']['callback']\r\n ) => void,\r\n close: () => void,\r\n get: () => State['modal']['newLegFormModal'],\r\n callback?: State['modal']['newLegFormModal']['callback']\r\n }\r\n },\r\n drawer: {\r\n isnDrawer: {\r\n open: (pax: ScheduledPaxNode) => void,\r\n close: () => void,\r\n get: () => State['editor']['isnDrawer']\r\n }\r\n },\r\n chargeCodes: {\r\n getDefault: () => State['editor']['defaultChargeCode'],\r\n clear: () => void,\r\n setDefault: (chargeCode: string) => void\r\n },\r\n editor: {\r\n visibleLegs: {\r\n get: () => ({ departureID: string, destinationID: string }[]),\r\n isLegVisible: (departureID: string, destinationID: string) => boolean,\r\n showAll: () => void,\r\n hideAll: () => void,\r\n getAsStrings: () => string[],\r\n setAsStrings: (keys: string[]) => void,\r\n show: (departure: string, destination: string) => void\r\n }\r\n },\r\n notesForPilot: {\r\n getModifiedText: () => string,\r\n getQuickEditProps: (entityId: string) => Partial,\r\n editor: {\r\n isOpen: () => boolean,\r\n open: () => void,\r\n close: () => void,\r\n getNotes: () => NotesForPilot.Editor.State['notes'],\r\n hasNotes: () => boolean,\r\n submit: () => void,\r\n getEditorProps: () => Partial\r\n getToolbarProps: () => NotesForPilot.Editor.ToolbarProps\r\n }\r\n }\r\n}\r\n\r\nexport interface UseSchedulerApiProps {\r\n data: ScheduleHistoryDetail,\r\n groupData: GroupData,\r\n refetch?: () => void,\r\n editMode?: boolean,\r\n isLoading?: boolean,\r\n error?: any,\r\n onEditModeChange?: (editing: boolean) => void,\r\n onFinish?: () => void,\r\n saveInfo?: ScheduleEditorApi['saveInfo']\r\n}\r\n\r\n/**\r\n * Implements the Phase2Api as a React hook\r\n */\r\nexport function useScheduleEditorApi(props: UseSchedulerApiProps){\r\n const apolloClient = useApolloClient();\r\n\r\n // Hooks -----------------------------------------------------------------------------------------------------------\r\n const [ state, dispatch ] =\r\n useReducer>(Phase2State.Reducer, Phase2State.DEFAULT_STATE);\r\n\r\n const orgData = useContext(OrgDataContext);\r\n\r\n const groupFormRef = useRef(null);\r\n const cargoFormRef = useRef(null);\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // ISN checker hook ------------------------------------------------------------------------------------------------\r\n function onIsnCheckerFinished(){\r\n props.refetch?.();\r\n }\r\n\r\n const bulkISNChecker = useBulkISNChecker(\r\n apolloClient, orgData.getActiveOrg()?._id,\r\n onIsnCheckerFinished\r\n );\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Updates the state as a side effect to prop changes --------------------------------------------------------------\r\n useEffect(() => {\r\n\r\n // Update editMode if prop is defined.\r\n if (props.editMode !== undefined && state.editMode !== props.editMode){\r\n dispatch({ type: ActionType.SET_EDIT_MODE, payload: props.editMode });\r\n }\r\n\r\n // Initialize data state\r\n if (props.data){\r\n let entities = [...props.data.paxList];\r\n dispatch({\r\n type: ActionType.INIT_DATA,\r\n entities: entities as ScheduleNode[],\r\n group: {\r\n ...props.groupData,\r\n lastKnownControllerObj: props.groupData.lastKnownControllerObj as Location\r\n }\r\n })\r\n }\r\n\r\n if (\r\n props.isLoading !== state.queryStatus.loading ||\r\n props.error !== state.queryStatus.error\r\n ){\r\n dispatch({ type: ActionType.SET_QUERY_STATUS, payload: { loading: props.isLoading, error: props.error } })\r\n }\r\n\r\n }, [\r\n props.editMode,\r\n state.editMode,\r\n props.data,\r\n props.isLoading,\r\n props.error\r\n ]);\r\n\r\n // Show and hide left panel if editMode changes.\r\n useEffect(() => {\r\n if (state.editMode){\r\n dispatch({ type: ActionType.SET_HIDE_CARRIABLE_PANEL, payload: false });\r\n }\r\n else\r\n {\r\n dispatch({ type: ActionType.SET_HIDE_CARRIABLE_PANEL, payload: true });\r\n }\r\n }, [state.editMode]);\r\n\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Tune visible legs -----------------------------------------------------------------------------------------------\r\n // Visible legs will be determined by how many legs there are. If there are more than 5 legs, all legs will be\r\n // collapsed by default.\r\n useEffect(() => {\r\n if (state.data.originalEntities.length > 0){\r\n // Data has just been filled in after query finished.\r\n const legs = Util.DepDestList.build(state.data.originalEntities);\r\n\r\n if (legs.length > 5){\r\n dispatch({ type: ActionType.SET_VISIBLE_LEGS, mode: 'objects', action: 'set', payload: [] });\r\n }\r\n else\r\n {\r\n const depDestList = legs.map(item => ({\r\n departureID: item.departure._id,\r\n destinationID: item.destination._id\r\n }));\r\n dispatch({ type: ActionType.SET_VISIBLE_LEGS, mode: 'objects', action: 'set', payload: depDestList });\r\n }\r\n }\r\n }, [\r\n state.data.originalEntities.length > 0\r\n ]);\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Dereferences person id list to real personnel documents ---------------------------------------------------------\r\n const derefSelPersonnelResult = useQuery(ResolvePersonIdsQuery, {\r\n variables: {\r\n ids: state.carriableSelector.selectedPersonnelIds\r\n },\r\n fetchPolicy: 'cache-first',\r\n errorPolicy: 'all'\r\n })\r\n const selectedPersonnelObjs = (derefSelPersonnelResult.data?.resolve_entity_ids || []) as (Person | undefined)[];\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n function createDispatchFunc(type: T){\r\n return (payload: any) => dispatch({ type: type as any, payload: payload });\r\n }\r\n\r\n function createDispatchFuncNoPayload(type: T){\r\n return () => dispatch({ type: type as any });\r\n }\r\n\r\n function setEditMode(editing: boolean){\r\n if (props.editMode !== undefined && props.onEditModeChange){\r\n props.onEditModeChange(editing);\r\n return;\r\n }\r\n dispatch({ type: ActionType.SET_EDIT_MODE, payload: editing });\r\n }\r\n\r\n let groupData: GroupData = null;\r\n if (props.groupData.lastKnownControllerObj){\r\n groupData = {\r\n ...props.groupData,\r\n lastKnownControllerObj: props.groupData.lastKnownControllerObj\r\n }\r\n }\r\n\r\n // If I don't use useMemo, the filtered list will return a different reference\r\n // every render. This ensures the filtered version of modifiedEntities only changes references\r\n // when modifiedEntities changes.\r\n const modifiedEntitiesNotOnCarrier = useMemo(() => {\r\n return state.data.modifiedEntities.filter((entity) => {\r\n return !Boolean(entity.currentCarrierID)\r\n })\r\n }, [ state.data.modifiedEntities ])\r\n\r\n // Implements the API used by child components to communicate with other child components --------------------------\r\n const api: ScheduleEditorApi = {\r\n getScheduledPaxNodes: () => state.data.modifiedEntities.filter(e => e.classType === 'flytsuite.paxnode') as ScheduledPaxNode[],\r\n getScheduledCgoNodes: () => state.data.modifiedEntities.filter(e => e.classType === 'flytsuite.cgonode') as ScheduledCgoNode[],\r\n bulkIsnChecker: bulkISNChecker,\r\n groupData: groupData,\r\n schedule: {\r\n finish: () => props.onFinish?.()\r\n },\r\n data: {\r\n modifiedEntities: {\r\n get: () => state.data.modifiedEntities,\r\n getNotOnCarrier: () => modifiedEntitiesNotOnCarrier,\r\n set: (entities) => dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, set: entities }),\r\n add: (entities) => dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, add: entities }),\r\n remove: (entityIds) => dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, remove: entityIds }),\r\n },\r\n originalEntities: {\r\n get: () => state.data.originalEntities\r\n },\r\n getModifiedEntityById: (entityId) => state.data.modifiedEntities\r\n .find((entity) => getSNodeID(entity) === entityId),\r\n removeLeg(departureID, destinationID) {\r\n const entitiesToRemove = state.data.modifiedEntities\r\n .filter(entity => (\r\n entity.departureID?._id === departureID && entity.destinationID?._id === destinationID\r\n ))\r\n .map(e => getSNodeID(e));\r\n\r\n if (entitiesToRemove.length){\r\n dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, remove: entitiesToRemove });\r\n }\r\n },\r\n modifyEntity(entityId, changedFields){\r\n const entityObj = state.data.modifiedEntities\r\n .find(e => getSNodeID(e) === entityId);\r\n\r\n if (!entityObj) return;\r\n\r\n const newEntity = {\r\n ...entityObj,\r\n ...changedFields\r\n } as ScheduleNode;\r\n\r\n dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, add: [newEntity] });\r\n },\r\n\r\n removeEntities(entities) {\r\n dispatch({type: ActionType.SET_MODIFIED_ENTITIES, remove: entities})\r\n },\r\n\r\n swapEntities(startIdx, endIdx) {\r\n if (!state.data.modifiedEntities.length) return;\r\n if (startIdx < 0 || startIdx >= state.data.modifiedEntities.length) return;\r\n if (endIdx < 0 || endIdx >= state.data.modifiedEntities.length) return;\r\n\r\n const entityListCopy = [...state.data.modifiedEntities];\r\n\r\n const startObj = entityListCopy[startIdx];\r\n const endObj = entityListCopy[endIdx];\r\n\r\n if (\r\n startObj.departureID?._id !== endObj.departureID?._id ||\r\n startObj.destinationID?._id !== endObj.destinationID?._id\r\n ){\r\n // Prevent reordering between legs\r\n return;\r\n }\r\n\r\n entityListCopy[startIdx] = endObj;\r\n entityListCopy[endIdx] = startObj;\r\n\r\n dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, set: entityListCopy });\r\n },\r\n\r\n swapLegs(start, arg1) {\r\n\r\n // Compute legs from data\r\n const legs = this.getLegs();\r\n\r\n const startIdx = findLegIdx(legs, start);\r\n let endIdx = -1;\r\n\r\n if (typeof arg1 === 'string'){\r\n // arg1 is either \"up\" or \"down\"\r\n if (arg1 === 'up'){\r\n endIdx = startIdx - 1;\r\n }\r\n else if (arg1 === 'down')\r\n {\r\n endIdx = startIdx + 1;\r\n }\r\n }\r\n else\r\n {\r\n // arg1 is another DepDestListItem\r\n endIdx = findLegIdx(legs, arg1);\r\n }\r\n\r\n if (\r\n startIdx < 0 || endIdx < 0 ||\r\n startIdx >= legs.length || endIdx >= legs.length\r\n ){\r\n console.error(new Error(`Index out of bounds: startIdx: ${startIdx}, endIdx: ${endIdx}`))\r\n return;\r\n }\r\n\r\n // Swap\r\n {\r\n const temp = legs[startIdx];\r\n legs[startIdx] = legs[endIdx];\r\n legs[endIdx] = temp;\r\n }\r\n\r\n this.setLegs(legs);\r\n },\r\n\r\n getLegs() {return Util.DepDestList.build(state.data.modifiedEntities) },\r\n\r\n setLegs(legs) {\r\n const newEntities = Util.DepDestList.toEntities(legs);\r\n dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, set: newEntities });\r\n },\r\n\r\n setEntityLegs(entityIds, departure, destination) {\r\n const newEntities = entityIds\r\n .map(entityId => state.data.modifiedEntities.find(e => getSNodeID(e) === entityId))\r\n .filter(e => e)\r\n .map((entity) => {\r\n return {\r\n ...entity,\r\n departureID: departure,\r\n destinationID: destination\r\n }\r\n });\r\n\r\n dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, add: newEntities });\r\n dispatch({ type: ActionType.SET_SELECTED_ENTITY_IDS, set: [] });\r\n },\r\n\r\n reset(){ dispatch({ type: ActionType.RESET_DATA }); },\r\n\r\n getNotesForPilot() {\r\n /* Gather all notesForPilot values from pax and cargo and create a dictionary of them with this structure:\r\n {\r\n : ScheduleNode[]\r\n }\r\n */\r\n\r\n return Util.getNoteMap(state.data.modifiedEntities)\r\n }\r\n },\r\n queryInfo: {\r\n loading: state.queryStatus.loading,\r\n error: state.queryStatus.error,\r\n hasError: !!state.queryStatus.error\r\n },\r\n saveInfo: {\r\n saving: !!props.saveInfo?.saving,\r\n hasError: !!props.saveInfo?.hasError\r\n },\r\n saveStatus: {\r\n get: () => state.saveStatus,\r\n dismiss: createDispatchFuncNoPayload(ActionType.DISMISS_SAVE_STATUS)\r\n },\r\n editMode: {\r\n get: () => state.editMode,\r\n toggle: () => setEditMode(!state.editMode),\r\n set: setEditMode\r\n },\r\n selection: {\r\n entityIds: {\r\n get: () => state.editor.selectedEntityIds,\r\n set: (newEntities) => dispatch({ type: ActionType.SET_SELECTED_ENTITY_IDS, set: newEntities }),\r\n add: (newEntities) => dispatch({ type: ActionType.SET_SELECTED_ENTITY_IDS, add: newEntities }),\r\n remove: (removedEntities) => dispatch({ type: ActionType.SET_SELECTED_ENTITY_IDS, remove: removedEntities }),\r\n toggle(entityID){\r\n if (!state.editor.selectedEntityIds.includes(entityID))\r\n this.add([entityID]);\r\n else\r\n this.remove([entityID]);\r\n },\r\n clear: () => dispatch({ type: ActionType.SET_SELECTED_ENTITY_IDS, set: [] }),\r\n all: () => {\r\n let entities = state.data.modifiedEntities.map(e => getSNodeID(e));\r\n dispatch({ type: ActionType.SET_SELECTED_ENTITY_IDS, set: entities });\r\n }\r\n },\r\n personnelIds: {\r\n set: createDispatchFunc(ActionType.SET_SELECTED_PERSONNEL_IDS),\r\n get: () => state.carriableSelector.selectedPersonnelIds,\r\n getAsObjects: () => ({\r\n loading: [NetworkStatus.loading, NetworkStatus.setVariables].includes(derefSelPersonnelResult.networkStatus),\r\n objects: selectedPersonnelObjs\r\n }),\r\n clear: () => dispatch({ type: ActionType.SET_SELECTED_PERSONNEL_IDS, payload: [] }),\r\n addToSchedule: async (departureID: string, destinationID: string) => {\r\n // If derefSelPersonnelResult is still loading, we can't do anything.\r\n if (derefSelPersonnelResult.loading){\r\n message.error('Error: Personnel data is still loading. Please try again.')\r\n return;\r\n }\r\n\r\n // Re-reference locations to real location documents\r\n const locResult = await deRefLocations(apolloClient, [departureID, destinationID]);\r\n if (locResult.errors.length){\r\n message.error(\"Failed to get locations.\");\r\n return;\r\n }\r\n const [ departure, destination ] = locResult.data;\r\n\r\n // Convert personnel to PaxNode stubs\r\n function toPassenger(person: Person){\r\n\r\n const pax = personToPassenger(\r\n person,\r\n {\r\n departureID: departure,\r\n destinationID: destination,\r\n customerID: person.customerID,\r\n tpID: orgData.transporterID,\r\n chargeCode: null\r\n }\r\n );\r\n\r\n // Using _id is a bad idea\r\n pax.__temp_id = Util.genTempID();\r\n delete pax._id;\r\n return pax;\r\n }\r\n\r\n let autoFilledPersons = [];\r\n\r\n selectedPersonnelObjs.forEach((person) => {\r\n if (person.lastPaxWeight || person.lastBagWeight || person.lastBagCount){\r\n autoFilledPersons.push(person);\r\n }\r\n });\r\n\r\n if (autoFilledPersons.length){\r\n message.info(`Previous weight info found for ${autoFilledPersons.length} personnel. \r\n Auto-filled fields.`, 5);\r\n }\r\n\r\n const paxNodes = selectedPersonnelObjs.map(toPassenger);\r\n\r\n dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, add: paxNodes })\r\n }\r\n }\r\n },\r\n carriableSelector: {\r\n tabs: {\r\n set: (upperTab, lowerTab) =>\r\n dispatch({ type: ActionType.SET_CARRIABLE_SELECTOR_TAB, payload: { upperTab, lowerTab } }),\r\n get: () => ({\r\n upperTab: state.carriableSelector.upperTab,\r\n lowerTab: state.carriableSelector.lowerTab\r\n })\r\n },\r\n legSelector: {\r\n set: (departure, destination) => (\r\n dispatch({ type: ActionType.SET_LEG_SELECTOR, payload: { departure, destination } })\r\n ),\r\n get: () => state.carriableSelector.legSelector\r\n },\r\n hideCarriablePanel: {\r\n get: () => state.carriableSelector.hidePanel,\r\n set: createDispatchFunc(ActionType.SET_HIDE_CARRIABLE_PANEL),\r\n toggle: () => dispatch({ type: ActionType.SET_HIDE_CARRIABLE_PANEL, payload: undefined }),\r\n }\r\n },\r\n forms: {\r\n cargoForm: {\r\n get: () => state.forms.cargoForm,\r\n setFields: (fields) => dispatch({ type: ActionType.SET_FORM_DATA, cargo: fields }),\r\n resetFields: () => dispatch({\r\n type: ActionType.RESET_FORM_DATA,\r\n cargo: true\r\n }),\r\n submit: async (departureID, destinationID) => {\r\n\r\n // Make sure form is valid\r\n cargoFormRef.current.validateFieldsAndScroll(async (err: unknown, formValues: CargoFormData) => {\r\n if (err) return;\r\n\r\n // Re-reference locations to real location documents\r\n const locResult = await deRefLocations(apolloClient, [departureID, destinationID]);\r\n if (locResult.errors.length){\r\n message.error(\"Failed to get locations.\");\r\n return;\r\n }\r\n const [ departure, destination ] = locResult.data;\r\n\r\n const cgoNode = cargoFormToCargoNode(formValues, orgData, departure, destination);\r\n\r\n dispatch({ type: ActionType.SET_MODIFIED_ENTITIES, add: [cgoNode] });\r\n })\r\n },\r\n ref: cargoFormRef\r\n },\r\n groupForm: {\r\n get: () => state.forms.groupForm,\r\n setFields: (fields) => dispatch({ type: ActionType.SET_FORM_DATA, group: fields }),\r\n resetFields: () => dispatch({\r\n type: ActionType.RESET_FORM_DATA,\r\n group: true\r\n }),\r\n ref: groupFormRef\r\n },\r\n newLegForm: {\r\n get: () => state.forms.newLegForm,\r\n setFields: (fields) => dispatch({ type: ActionType.SET_FORM_DATA, newLeg: fields }),\r\n resetFields: () => dispatch({\r\n type: ActionType.RESET_FORM_DATA,\r\n newLeg: true\r\n })\r\n },\r\n searchForm: {\r\n get: () => state.carriableSelector.searchForm,\r\n set: createDispatchFunc(ActionType.SET_CARRIABLE_SEL_SEARCH)\r\n }\r\n },\r\n modal: {\r\n newLegFormModal: {\r\n get: () => state.modal.newLegFormModal,\r\n open: (departure=null, destination=null, callback=null) => {\r\n\r\n if (departure && destination){\r\n const newLegValue = {\r\n departure: { key: departure._id, label: departure.name },\r\n destination: { key: destination._id, label: destination.name },\r\n }\r\n dispatch({ type: ActionType.SET_NEW_LEG_MODAL, visible: true, newLegValue: newLegValue, callback });\r\n return;\r\n }\r\n dispatch({ type: ActionType.SET_NEW_LEG_MODAL, visible: true, callback });\r\n },\r\n close: () => dispatch({ type: ActionType.SET_NEW_LEG_MODAL, visible: false }),\r\n callback: state.modal.newLegFormModal.callback\r\n },\r\n paxModal: {\r\n get: () => state.modal.paxModal,\r\n open: (pax) => dispatch({ type: ActionType.SET_PAXNODE_MODAL, pax, visible: true }),\r\n close: () => dispatch({ type: ActionType.SET_PAXNODE_MODAL, visible: false })\r\n },\r\n },\r\n drawer: {\r\n isnDrawer: {\r\n get: () => state.editor.isnDrawer,\r\n open: (pax) => dispatch({ type: ActionType.SET_ISN_DRAWER, payload: { pax, visible: true } }),\r\n close: () => dispatch({\r\n type: ActionType.SET_ISN_DRAWER,\r\n payload: { pax: state.editor.isnDrawer.pax, visible: false }\r\n })\r\n },\r\n },\r\n chargeCodes: {\r\n getDefault: () => state.editor.defaultChargeCode,\r\n setDefault: createDispatchFunc(ActionType.SET_DEFAULT_CHARGE_CODE),\r\n clear: () => dispatch({ type: ActionType.SET_DEFAULT_CHARGE_CODE, payload: '' })\r\n },\r\n editor: {\r\n visibleLegs: {\r\n get: () => state.editor.visibleLegs,\r\n show: (departureID, destinationID) => {\r\n const payload = {\r\n departureID: departureID,\r\n destinationID: destinationID\r\n }\r\n dispatch({ type: ActionType.SET_VISIBLE_LEGS, mode: 'objects', action: 'add', payload: [payload] });\r\n },\r\n isLegVisible: (departureID, destinationID) => (\r\n Boolean(\r\n state.editor.visibleLegs.find((item) => (\r\n item.departureID === departureID && item.destinationID === destinationID)\r\n )\r\n )\r\n ),\r\n showAll: () => {\r\n const data = Util.DepDestList.build(state.data.modifiedEntities);\r\n\r\n const depDestList = data\r\n .map(item => ({\r\n departureID: item.departure._id,\r\n destinationID: item.destination._id\r\n }));\r\n\r\n dispatch({ type: ActionType.SET_VISIBLE_LEGS, mode: 'objects', action: 'set', payload: depDestList })\r\n },\r\n hideAll: () => {\r\n dispatch({ type: ActionType.SET_VISIBLE_LEGS, mode: 'objects', action: 'set', payload: [] });\r\n },\r\n setAsStrings: (keys) => (\r\n dispatch({ type: ActionType.SET_VISIBLE_LEGS, mode: 'strings', action: 'set', splitBy: '::', payload: keys })\r\n ),\r\n getAsStrings: () => {\r\n return state.editor.visibleLegs\r\n .map(item => `${item.departureID}::${item.destinationID}`)\r\n }\r\n }\r\n },\r\n notesForPilot: {\r\n getModifiedText: () => state.notesForPilotPopup.modifiedText,\r\n getQuickEditProps: (entityId: string) => {\r\n\r\n let componentState = NotesForPilotRendererModule.DEFAULT_STATE;\r\n\r\n if (entityId === state.notesForPilotPopup.entityId)\r\n // If this is not the current entity having notes edited, then this NotesForPilotQuickedit should be closed.\r\n componentState = {\r\n open: state.notesForPilotPopup.open,\r\n editMode: state.notesForPilotPopup.editMode,\r\n modifiedText: state.notesForPilotPopup.modifiedText,\r\n originalText: state.notesForPilotPopup.originalText\r\n }\r\n\r\n const stateProps = {\r\n state: componentState,\r\n dispatch: (value) => {\r\n dispatch({ type: ActionType.NOTES_FOR_PILOT_POPUP, entityId, action: value })\r\n }\r\n }\r\n\r\n return {\r\n overrideState: stateProps\r\n }\r\n },\r\n editor: {\r\n isOpen: () => state.notesForPilotEditor.open,\r\n open: () => dispatch({ type: ActionType.NOTES_FOR_PILOT_EDITOR, open: true }),\r\n close: () => dispatch({ type: ActionType.NOTES_FOR_PILOT_EDITOR, open: false }),\r\n getNotes: () => state.notesForPilotEditor.state.notes,\r\n hasNotes: () => Boolean(Object.keys(state.notesForPilotEditor.state.notes).length),\r\n submit: () => {\r\n\r\n function handleSubmit(){\r\n dispatch({ type: ActionType.SUBMIT_NOTES_FOR_PILOT_EDITOR });\r\n }\r\n\r\n // Confirm with user that there are notes that are not assigned to any PAX/CGO and\r\n // it will remove them when they submit.\r\n const unassignedNotes = NotesForPilot.Editor.Util\r\n .findUnassignedNoteIds(state.notesForPilotEditor.state);\r\n\r\n if (unassignedNotes.length){\r\n Modal.confirm({\r\n title: 'Unassigned notes found',\r\n content: (\r\n `${unassignedNotes.length} notes have no PAX/CGO assigned and they will be removed if you continue.`\r\n ),\r\n okText: 'Continue',\r\n onOk: handleSubmit\r\n })\r\n return;\r\n }\r\n\r\n handleSubmit();\r\n },\r\n getEditorProps: () => {\r\n return {\r\n overrideState: {\r\n state: state.notesForPilotEditor.state,\r\n dispatch: (action) => dispatch({ type: ActionType.NOTES_FOR_PILOT_EDITOR, action: action })\r\n }\r\n }\r\n },\r\n getToolbarProps: () => {\r\n return {\r\n state: state.notesForPilotEditor.state,\r\n dispatch: (action) => dispatch({ type: ActionType.NOTES_FOR_PILOT_EDITOR, action: action })\r\n }\r\n }\r\n }\r\n }\r\n }\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n return api;\r\n}","import gql from \"graphql-tag\";\r\nimport {\r\n ScheduledCgoNodeFragment,\r\n ScheduledPaxNodeFragment,\r\n ScheduleHistoryDetailFragment\r\n} from \"../../../../Queries/Scheduling\";\r\n\r\nexport const Queries = {\r\n GetScheduleHistory: gql`\r\n query GetScheduleHistory(\r\n $tpID: ID!\r\n $date: AWSDate!\r\n $groupName: String!\r\n $lastKnownController: ID!\r\n $customerID: ID!\r\n ){\r\n getTransporter(\r\n _id: $tpID\r\n ){\r\n _id\r\n name\r\n }\r\n getCustomer(\r\n _id: $customerID\r\n ){\r\n _id\r\n name\r\n }\r\n getLastKnownController: getLocation(\r\n _id: $lastKnownController\r\n ){\r\n ...LocationFragment\r\n }\r\n GetScheduleHistory(\r\n tpID: $tpID\r\n date: $date\r\n groupName: $groupName\r\n lastKnownController: $lastKnownController\r\n ){\r\n ...ScheduleHistoryDetailFragment\r\n }\r\n }\r\n ${ScheduleHistoryDetailFragment}\r\n `\r\n}\r\n\r\nexport const Mutations = {\r\n SaveSchedulePaxCgoV2: gql`\r\n mutation SchedulePaxCgo_V2(\r\n $customerID: ID!\r\n $tpID: ID!\r\n $lastKnownController: ID!\r\n $scheduledFlightDate: AWSDate!\r\n $scheduledGroup: String!\r\n $modifiedPax: [ScheduledPassengerInput_V2!]!\r\n $modifiedCgo: [ScheduledCargoInput_V2!]!\r\n $deletedEntities: [DeletedScheduledEntityInput!]\r\n ){\r\n SchedulePaxCgo_V2(\r\n customerID: $customerID\r\n tpID: $tpID\r\n lastKnownController: $lastKnownController\r\n scheduledFlightDate: $scheduledFlightDate\r\n scheduledGroup: $scheduledGroup\r\n modifiedPax: $modifiedPax\r\n modifiedCgo: $modifiedCgo\r\n deletedEntities: $deletedEntities\r\n ){\r\n cgonodes {\r\n ...ScheduledCgoNodeFragment\r\n }\r\n paxnodes {\r\n ...ScheduledPaxNodeFragment\r\n }\r\n }\r\n }\r\n ${ScheduledPaxNodeFragment}\r\n ${ScheduledCgoNodeFragment}\r\n `\r\n}","import React from 'react';\r\nimport {createFormField, FormField} from \"../../../../common/form\";\r\nimport {produce} from \"immer\";\r\nimport {Moment} from \"moment\";\r\n\r\nexport interface CloneFormFields {\r\n name: FormField,\r\n date: FormField\r\n}\r\n\r\ntype CloneFormValues = {\r\n [K in keyof CloneFormFields]: CloneFormFields[K]['value'];\r\n};\r\n\r\nconst DefaultForm = {\r\n name: createFormField(''),\r\n date: createFormField(null)\r\n} as CloneFormFields\r\n\r\nexport const DefaultState = {\r\n cloneScheduleOpen: false,\r\n initCloneScheduleForm: DefaultForm,\r\n cloneScheduleForm: {...DefaultForm}\r\n}\r\n\r\ntype State = typeof DefaultState;\r\n\r\ntype Action = {\r\n type: 'SET_CLONE_OPEN',\r\n payload: boolean\r\n} | {\r\n type: 'UPDATE_FORM',\r\n payload: CloneFormFields\r\n} | {\r\n type: 'INIT_FORM',\r\n payload: CloneFormValues\r\n} | {\r\n type: 'RESET_FORM'\r\n}\r\n\r\nexport const Reducer: React.Reducer = (_state, action) => {\r\n\r\n function formValuesToFields(values: CloneFormValues | CloneFormFields){\r\n const formFields = {};\r\n for (let key in values) {\r\n if (formFields[key] && typeof formFields[key] === 'object' && 'value' in formFields[key]){\r\n formFields[key] = createFormField(values[key].value);\r\n }\r\n else\r\n {\r\n formFields[key] = createFormField(values[key]);\r\n }\r\n }\r\n return formFields as CloneFormFields;\r\n }\r\n return produce(_state, (draft) => {\r\n\r\n function resetForm(){\r\n draft.cloneScheduleForm = formValuesToFields(draft.initCloneScheduleForm);\r\n }\r\n\r\n switch (action.type){\r\n case \"SET_CLONE_OPEN\":\r\n draft.cloneScheduleOpen = action.payload;\r\n if (!action.payload){\r\n resetForm();\r\n }\r\n break;\r\n case \"UPDATE_FORM\":\r\n draft.cloneScheduleForm = action.payload;\r\n break;\r\n case \"INIT_FORM\":\r\n draft.initCloneScheduleForm = formValuesToFields(action.payload);\r\n draft.cloneScheduleForm = formValuesToFields(action.payload);\r\n break;\r\n case \"RESET_FORM\":\r\n resetForm();\r\n break\r\n }\r\n })\r\n}","import {useScheduleEditorApi} from \"components/scheduling/editor/schedule-editor-v2/api\";\r\nimport {useContext, useEffect, useReducer, useRef} from \"react\";\r\nimport {OrgDataContext} from \"../../../../context/orgData\";\r\nimport {useMutation, useQuery} from \"react-apollo\";\r\nimport {Mutations, Queries} from \"./graphql\";\r\nimport {useHistory, useParams} from \"react-router-dom\";\r\nimport {\r\n CargoNode,\r\n Customer,\r\n Location,\r\n MutationSchedulePaxCgo_V2Args,\r\n PaxNode,\r\n QueryGetScheduleHistoryArgs,\r\n ScheduledCargoInput_V2,\r\n ScheduledPassengerInput_V2,\r\n ScheduleHistoryDetail,\r\n TransitType,\r\n Transporter\r\n} from \"__generated__/graphql/types\";\r\nimport {CloneFormFields, DefaultState, Reducer} from './state';\r\nimport {basePath} from \"../../../../routes/scheduling\";\r\nimport {isTruey} from \"../../../../common/util-ts\";\r\nimport {message} from \"antd\";\r\nimport {Moment} from \"moment\";\r\n\r\ntype RouteParams = {\r\n date: string,\r\n scheduledGroup: string,\r\n lastKnownController: string,\r\n departureID?: string,\r\n destinationID?: string\r\n}\r\n\r\nexport function usePhase1HistoryEditorApi() {\r\n\r\n const orgData = useContext(OrgDataContext);\r\n const [ state, dispatch ] = useReducer(Reducer, DefaultState);\r\n const history = useHistory();\r\n\r\n const routeParamsEncoded = useParams();\r\n let routeParams: RouteParams = {} as RouteParams;\r\n Object.entries(routeParamsEncoded).forEach(([k, v]) => {\r\n routeParams[k] = decodeURIComponent(v);\r\n })\r\n\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Read schedule ---------------------------------------------------------------------------------------------------\r\n let queryVars = {\r\n tpID: orgData.transporterID,\r\n date: routeParams.date,\r\n groupName: routeParams.scheduledGroup,\r\n lastKnownController: routeParams.lastKnownController,\r\n customerID: orgData.customerID\r\n }\r\n\r\n const queryResult = useQuery<\r\n {\r\n GetScheduleHistory: ScheduleHistoryDetail,\r\n getTransporter: Transporter,\r\n getCustomer: Customer,\r\n getLastKnownController: Location\r\n },\r\n { customerID: string } & QueryGetScheduleHistoryArgs\r\n >(Queries.GetScheduleHistory, {\r\n variables: queryVars,\r\n fetchPolicy: 'network-only',\r\n errorPolicy: 'all',\r\n pollInterval: 10000\r\n })\r\n const data = queryResult.data?.GetScheduleHistory;\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n // Clone Schedule form ---------------------------------------------------------------------------------------------\r\n const cloneScheduleFormRef = useRef(null);\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n const [ cloneScheduleMutation, cloneScheduleMutationResult ] = useMutation(Mutations.SaveSchedulePaxCgoV2, {\r\n onCompleted: () => {\r\n history.push(basePath('schedule'));\r\n }\r\n })\r\n\r\n function initiateClone(){\r\n\r\n function clone(formValues: { date: Moment, name: string }){\r\n function processEntity(entity: PaxNode): ScheduledPassengerInput_V2;\r\n function processEntity(entity: CargoNode): ScheduledCargoInput_V2;\r\n function processEntity(entity: T){\r\n\r\n let common = {\r\n _id: undefined,\r\n _rev: undefined,\r\n scheduledOrder: entity.scheduledOrder,\r\n transitType: entity.transitType as TransitType,\r\n notesForPilot: entity.notesForPilot,\r\n departureID: entity.departureID?._id,\r\n destinationID: entity.destinationID?._id\r\n };\r\n\r\n if (entity.classType === 'flytsuite.paxnode'){\r\n const pax = entity as PaxNode;\r\n const cloned: ScheduledPassengerInput_V2 = {\r\n ...common,\r\n personID: pax.personID?._id,\r\n paxWeight: pax.paxWeight,\r\n bagWeight: pax.bagWeight,\r\n chargeCode: pax.chargeCode,\r\n bagCount: pax.bagCount\r\n }\r\n return cloned;\r\n }\r\n else if (entity.classType === 'flytsuite.cgonode'){\r\n const cgo = entity as CargoNode;\r\n const cloned: ScheduledCargoInput_V2 = {\r\n ...common,\r\n name: cgo.name,\r\n initials: cgo.initials,\r\n weight: cgo.weight,\r\n approvedBy: cgo.approvedBy,\r\n hazmat: cgo.hazmat,\r\n hazmatUnCode: cgo.hazmatUnCode,\r\n notes: cgo.notes,\r\n attentionTo: cgo.attentionTo\r\n }\r\n return cloned;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n const vars: MutationSchedulePaxCgo_V2Args = {\r\n customerID: orgData.customerID,\r\n tpID: orgData.transporterID,\r\n scheduledFlightDate: formValues.date.format('YYYY-MM-DD'),\r\n scheduledGroup: formValues.name,\r\n lastKnownController: routeParams.lastKnownController,\r\n modifiedPax: data.paxList.map((e) => processEntity(e)).filter(isTruey),\r\n modifiedCgo: [],\r\n deletedEntities: []\r\n }\r\n\r\n cloneScheduleMutation({\r\n variables: vars,\r\n })\r\n .then(() => {\r\n history.push(basePath(`schedule/${vars.scheduledFlightDate}/${vars.scheduledGroup}/${vars.lastKnownController}/edit`));\r\n })\r\n .catch((err) => {\r\n console.error('Failed to clone schedule:', err);\r\n message.error('Failed to clone schedule. Read console for details.');\r\n })\r\n }\r\n\r\n cloneScheduleFormRef.current?.validateFieldsAndScroll((err, values) => {\r\n if (!err){\r\n clone(values);\r\n }\r\n })\r\n }\r\n\r\n const groupData = {\r\n name: routeParams.scheduledGroup,\r\n lastKnownController: routeParams.lastKnownController,\r\n date: routeParams.date,\r\n lastKnownControllerObj: queryResult.data?.getLastKnownController as Location,\r\n tpID: orgData.transporterID,\r\n customerID: orgData.customerID\r\n };\r\n\r\n const editorApi = useScheduleEditorApi({\r\n data: data,\r\n groupData: groupData,\r\n isLoading: queryResult.loading,\r\n error: queryResult.error,\r\n refetch: () => queryResult.refetch(),\r\n editMode: false\r\n });\r\n\r\n useEffect(() => {\r\n dispatch({\r\n type: 'INIT_FORM',\r\n payload: {\r\n date: null,\r\n name: groupData.name\r\n }\r\n })\r\n }, [groupData.name, groupData.date]);\r\n\r\n type CloneScheduleFormKeys = keyof typeof state.cloneScheduleForm;\r\n\r\n return {\r\n ...editorApi,\r\n cloneSchedule: {\r\n ref: cloneScheduleFormRef,\r\n drawer: {\r\n isOpen: () => state.cloneScheduleOpen,\r\n open: () => dispatch({ type: 'SET_CLONE_OPEN', payload: true }),\r\n close: () => dispatch({ type: 'SET_CLONE_OPEN', payload: false }),\r\n },\r\n form: {\r\n get: () => state.cloneScheduleForm,\r\n getValue: (name: T) => (\r\n state.cloneScheduleForm[name]?.value as typeof state.cloneScheduleForm[T]['value']\r\n ),\r\n set: (formFields: CloneFormFields) => dispatch({ type: 'UPDATE_FORM', payload: formFields }),\r\n reset: () => dispatch({ type: 'RESET_FORM' })\r\n },\r\n clone: {\r\n initiate: initiateClone,\r\n isCloning: cloneScheduleMutationResult.loading\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport type Phase1HistoryEditorApi = ReturnType","\r\nexport const BASE_CLS = 'phase-1-history-editor-page';","import React from 'react';\r\nimport {DatePicker, Form, Input} from 'antd';\r\nimport {FormComponentProps, FormProps} from 'antd/lib/form';\r\nimport {createFormFields, formItemLayout} from 'common/form';\r\nimport moment from 'moment';\r\nimport {CloneFormFields} from \"./state\";\r\n\r\nexport interface CloneFormProps extends FormComponentProps {\r\n formElementProps?: FormProps,\r\n disabled?: boolean,\r\n formData?: any,\r\n onFieldsChange?: (fields: CloneFormFields) => void\r\n}\r\n\r\nconst CloneForm_Internal: React.FC = React.forwardRef((props, ref: React.LegacyRef
    ) => {\r\n const { getFieldDecorator } = props.form;\r\n return \r\n \r\n {getFieldDecorator('date', {\r\n rules: [\r\n {required: true, message: 'You must enter a flight date'}\r\n ]\r\n })( current && current < moment().startOf('day')}/>)}\r\n \r\n \r\n {getFieldDecorator('name', {\r\n rules: [\r\n {required: true, message: 'You must enter a group name'}\r\n ]\r\n })( {\r\n e.target.value = e.target.value.trimStart().replace(/[^\\S ]/gm, '')\r\n }} disabled={props.disabled}/>)}\r\n \r\n
    \r\n})\r\n\r\nconst CloneForm = Form.create({\r\n mapPropsToFields(props){\r\n if (!props.formData) return undefined\r\n return createFormFields(props.formData);\r\n },\r\n onFieldsChange(props, _, fields){\r\n if (props.onFieldsChange){\r\n props.onFieldsChange(fields);\r\n }\r\n }\r\n})(CloneForm_Internal);\r\n\r\nCloneForm.displayName = 'CloneForm';\r\n\r\nexport default CloneForm;","import {Phase1HistoryEditorApi} from \"./api\";\r\nimport CloneForm from \"./clone-form\";\r\nimport {Button, Drawer, Form} from \"antd\";\r\nimport {tailFormItemLayout} from \"../../../../common/form\";\r\nimport React, {useContext} from \"react\";\r\nimport useBreakpoints from \"../../../../hooks/useBreakpoints\";\r\nimport {\r\n Customer, Location,\r\n QueryGetScheduledPaxCgoV2Args, QueryGetScheduleHistoryArgs,\r\n ScheduledPaxCgoResult,\r\n ScheduleHistoryDetail, Transporter\r\n} from \"../../../../__generated__/graphql/types\";\r\nimport {useQuery} from \"react-apollo\";\r\nimport {Queries} from \"./graphql\";\r\nimport {OrgDataContext} from \"../../../../context/orgData\";\r\n\r\n\r\nexport interface CloneFormDrawerProps {\r\n api: Phase1HistoryEditorApi\r\n}\r\n\r\nfunction useCheckExistingSchedule(api: Phase1HistoryEditorApi){\r\n\r\n const orgData = useContext(OrgDataContext);\r\n\r\n const vars: QueryGetScheduleHistoryArgs = {\r\n groupName: api.cloneSchedule.form.getValue('name'),\r\n date: api.cloneSchedule.form.getValue('date')?.format('YYYY-MM-DD'),\r\n lastKnownController: api.groupData?.lastKnownController,\r\n tpID: orgData.transporterID\r\n }\r\n\r\n const queryResult = useQuery<\r\n {\r\n GetScheduleHistory: ScheduleHistoryDetail\r\n },\r\n QueryGetScheduleHistoryArgs\r\n >(\r\n Queries.GetScheduleHistory,\r\n {\r\n variables: vars,\r\n fetchPolicy: 'network-only',\r\n skip: !vars.groupName || !vars.date\r\n }\r\n )\r\n\r\n const data = queryResult.data?.GetScheduleHistory;\r\n\r\n return {\r\n loading: queryResult.loading,\r\n exists: Boolean(data)\r\n };\r\n}\r\n\r\nconst CloneFormDrawer: React.FC = ({ api }) => {\r\n const bp = useBreakpoints();\r\n\r\n const { loading, exists } = useCheckExistingSchedule(api);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n Clone and Edit\r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport default CloneFormDrawer;","import Phase1HistoryEditorPage from \"./page\";\r\nexport default Phase1HistoryEditorPage;","import React from 'react';\r\nimport {Alert, Button, Drawer, Form, Icon, Layout, Spin} from 'antd';\r\nimport './style.less';\r\nimport MainLayout from \"components/scheduling/MainLayout\";\r\nimport MainHeader from \"./main-header\";\r\nimport {cleanGraphQLErrorMsg} from \"common/util\";\r\nimport ScheduleEditor from 'components/scheduling/editor/schedule-editor-v2';\r\nimport {usePhase1HistoryEditorApi} from \"./api\";\r\nimport {BASE_CLS} from \"./util\";\r\nimport useBreakpoints from \"../../../../hooks/useBreakpoints\";\r\nimport CloneForm from \"./clone-form\";\r\nimport {tailFormItemLayout} from \"../../../../common/form\";\r\nimport ViewButton from \"../../../../components/scheduling/editor/schedule-editor-v2/view-button\";\r\nimport CloneFormDrawer from \"./clone-form-drawer\";\r\n\r\nexport interface Phase1HistoryEditorPageProps {}\r\n\r\n/**\r\n * Phase 2 of the scheduling process. Handles scheduling of passengers and cargo before putting them on a flight.\r\n */\r\nexport const Phase1HistoryEditorPage: React.FC = (props) => {\r\n\r\n const api = usePhase1HistoryEditorApi();\r\n\r\n // Query error alert ----------------------------------------------------------------------------------------------\r\n let queryErrorAlert = null;\r\n if (api.queryInfo.error){\r\n queryErrorAlert = (\r\n \r\n )\r\n }\r\n // -----------------------------------------------------------------------------------------------------------------\r\n\r\n let pageContent = null;\r\n\r\n if (!api.queryInfo.error){\r\n pageContent = (\r\n }\r\n spinning={api.queryInfo.loading}\r\n wrapperClassName={BASE_CLS + '-spinner'}\r\n >\r\n \r\n ,\r\n \r\n Clone Schedule\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 {queryErrorAlert}\r\n {pageContent}\r\n \r\n \r\n}\r\n\r\nexport default Phase1HistoryEditorPage;","import React from 'react';\r\nimport CurrentOrg from 'components/CurrentOrg';\r\nimport PrivateRoute from 'components/PrivateRoute';\r\nimport moment from 'moment';\r\nimport Phase2Scheduler from \"pages/app/scheduling/phase-2-scheduler\";\r\nimport Phase1HistoryPage from \"pages/app/scheduling/phase-1-history\";\r\nimport Phase1HistoryEditorPage from \"pages/app/scheduling/phase-1-history-editor\";\r\n\r\nexport const basePath = (path) => `/app/scheduling${path ? `/${path}` : ''}`\r\n\r\n/** Connects PaxCgoScheduler state with route url data */\r\nconst Phase2SchedulerWrapper = (\r\n {\r\n match,\r\n routes,\r\n editing,\r\n onEditingChange,\r\n onCancel,\r\n onSaveSuccessful,\r\n onNewSetClicked,\r\n onDeleteGroupSuccessful,\r\n onBackToList\r\n }) => {\r\n\r\n const { params } = match;\r\n var group;\r\n if (params && params.date && params.scheduledGroup && params.lastKnownController) {\r\n group = {\r\n date: params.date,\r\n name: decodeURIComponent(params.scheduledGroup),\r\n lastKnownController: decodeURIComponent(params.lastKnownController)\r\n }\r\n }\r\n const getGroupDataWithOrg = (orgData) => {\r\n if (!group){\r\n return group;\r\n }\r\n if (!orgData){\r\n return group;\r\n }\r\n const { customer, transporter } = orgData;\r\n return {\r\n ...group,\r\n tpID: transporter && transporter._id,\r\n customerID: customer && customer._id\r\n }\r\n }\r\n return (\r\n \r\n {(orgData) => (\r\n \r\n )}\r\n \r\n )\r\n}\r\n\r\nconst Phase1Routes = [\r\n ,\r\n ,\r\n \r\n]\r\n\r\nconst Phase2Routes = [\r\n (\r\n props.history.push(basePath('groups'))}\r\n onSaveSuccessful={({ variables: v }) => {\r\n if (!v) return;\r\n let flightDate = encodeURIComponent( moment(v.scheduledFlightDate).format('YYYY-MM-DD') );\r\n let groupName = encodeURIComponent( v.scheduledGroup );\r\n let lkc = encodeURIComponent( v.lastKnownController );\r\n\r\n var path = basePath(`schedule/${flightDate}/${groupName}/${lkc}`);\r\n props.history.push(path);\r\n }}\r\n\r\n // Set up breadcrumb on header\r\n routes={[\r\n {\r\n path: '/app/scheduling/schedule',\r\n title: 'Scheduled Passengers and Cargo'\r\n },\r\n {\r\n title: 'New Schedule'\r\n }\r\n ]}\r\n />\r\n )}\r\n />,\r\n (\r\n props.history.push(basePath('schedule'))}\r\n onSaveSuccessful={() => {\r\n props.history.push(basePath('groups'))\r\n }}\r\n onDeleteGroupSuccessful={() => {\r\n props.history.push(basePath('schedule'))\r\n }}\r\n onEditingChange={(editing) => {\r\n if (editing === false){\r\n return;\r\n }\r\n var { date, scheduledGroup, departureID, destinationID, lastKnownController } = props.match.params;\r\n scheduledGroup = encodeURIComponent(scheduledGroup);\r\n departureID = encodeURIComponent(departureID);\r\n destinationID = encodeURIComponent(destinationID);\r\n lastKnownController = encodeURIComponent(lastKnownController);\r\n var path = basePath(`schedule/${date}/${scheduledGroup}/${lastKnownController}/edit`)\r\n props.history.push(path)\r\n }}\r\n onNewSetClicked={(id) => props.history.push(basePath(`sets/${id}`))}\r\n onBackToList={() => {\r\n props.history.push(basePath('groups'))\r\n }}\r\n onToScheduledFlights={() => {\r\n props.history.push(basePath('flight'))\r\n }}\r\n\r\n // Set up breadcrumb on header\r\n routes={[\r\n {\r\n path: '/app/scheduling/groups',\r\n title: 'Scheduled Passengers and Cargo'\r\n },\r\n {\r\n title: decodeURIComponent(props.match.params.scheduledGroup)\r\n }\r\n ]}\r\n />\r\n )}\r\n />,\r\n {\r\n const { date, scheduledGroup, departureID, destinationID, lastKnownController } = props.match.params;\r\n var path = basePath(`schedule/${date}/${scheduledGroup}/${lastKnownController}`);\r\n return (\r\n {\r\n props.history.push(path)\r\n }}\r\n onSaveSuccessful={({ modifiedEntities, variables: v }) => {\r\n if (modifiedEntities?.length){\r\n if (!v) return;\r\n let flightDate = encodeURIComponent( moment(v.scheduledFlightDate).format('YYYY-MM-DD') );\r\n let groupName = encodeURIComponent( v.scheduledGroup );\r\n let lastKnownController = encodeURIComponent( v.lastKnownController );\r\n var path = basePath(`schedule/${flightDate}/${groupName}/${lastKnownController}`);\r\n props.history.push(path);\r\n }\r\n else\r\n {\r\n props.history.push(basePath('groups'))\r\n }\r\n }}\r\n onDeleteGroupSuccessful={() => {\r\n props.history.push(basePath('groups'))\r\n }}\r\n onEditingChange={(editing) => {\r\n if (editing === true){\r\n return;\r\n }\r\n props.history.push(path)\r\n }}\r\n routes={[\r\n {\r\n path: '/app/scheduling/groups',\r\n title: 'Scheduled Passengers and Cargo'\r\n },\r\n {\r\n title: decodeURIComponent(props.match.params.scheduledGroup),\r\n path: path\r\n },\r\n {\r\n title: 'Edit'\r\n }\r\n ]}\r\n />\r\n )\r\n }}\r\n />\r\n]\r\n\r\nconst SchedulingRoutes = [\r\n ...Phase1Routes,\r\n ...Phase2Routes\r\n]\r\n\r\nexport default SchedulingRoutes;","import React from 'react';\r\nimport { Switch, Redirect } from 'react-router-dom';\r\nimport CurrentOrg from '../../CurrentOrg';\r\nimport PrivateRoute from '../../PrivateRoute';\r\nimport FlightScheduleEdit from 'components/flights/scheduling/FlightScheduleEdit';\r\nimport MainScheduling from './MainScheduling';\r\nimport SetsList from '../../scheduling/SetsList';\r\nimport moment from 'moment';\r\nimport { Spin, Icon, message, Alert } from 'antd';\r\nimport SetsEditorContainer from '../../../containers/SetsEditorContainer';\r\nimport PaxCgoScheduler from 'components/scheduling/PaxCgoScheduler';\r\nimport ScheduledGroupsList from 'components/scheduling/ScheduledGroupsList';\r\nimport ScheduledFlightsList from 'components/scheduling/ScheduledFlightsList';\r\nimport SchedulingV2Routes from \"routes/scheduling\";\r\n\r\nexport const basePath = (path) => `/app/scheduling${path ? `/${path}` : ''}`\r\n\r\n/** Connects PaxCgoScheduler state with route url data */\r\nconst PaxSchedulerWrapper = ({\r\n match,\r\n routes,\r\n editing,\r\n paxEdit,\r\n onEditingChange,\r\n onCancel,\r\n onSaveSuccessful,\r\n onNewSetClicked,\r\n onDeleteGroupSuccessful,\r\n onBackToList,\r\n onToScheduledFlights\r\n}) => {\r\n\r\n const { params } = match;\r\n var group;\r\n if (params && params.date && params.scheduledGroup && params.departureID && params.destinationID && params.lastKnownController) {\r\n group = {\r\n date: params.date,\r\n name: decodeURIComponent(params.scheduledGroup),\r\n departureID: decodeURIComponent(params.departureID),\r\n destinationID: decodeURIComponent(params.destinationID),\r\n lastKnownController: decodeURIComponent(params.lastKnownController)\r\n }\r\n }\r\n const getGroupDataWithOrg = (orgData) => {\r\n if (!group){\r\n return group;\r\n }\r\n if (!orgData){\r\n return group;\r\n }\r\n const { customer, transporter } = orgData;\r\n return {\r\n ...group,\r\n tpID: transporter && transporter._id,\r\n customerID: customer && customer._id\r\n }\r\n }\r\n return (\r\n \r\n {(orgData) => (\r\n \r\n )}\r\n \r\n )\r\n}\r\n\r\n\r\n\r\n/** Connects SetsEditor state with route url data */\r\nconst renderSetsEditor = ({\r\n match: { params, path },\r\n history\r\n}) => {\r\n let isNew = path === basePath('sets/new');\r\n let isScheduling = path === basePath('sets/:id/schedule');\r\n let isEditing = path === basePath('sets/:id/edit') || isNew || isScheduling;\r\n \r\n return (\r\n history.push(basePath('sets'))}\r\n onDeleted={() => history.push(basePath('sets'))}\r\n onScheduled={(data) => {\r\n const date = encodeURIComponent(data.date);\r\n const group = encodeURIComponent(data.group);\r\n const lkc = encodeURIComponent(data.lastKnownController);\r\n const dep = encodeURIComponent(data.departureID);\r\n const dest = encodeURIComponent(data.destinationID);\r\n history.push(\r\n basePath(`groups/${date}/${group}/${lkc}/${dep}/${dest}`)\r\n )\r\n }}\r\n\r\n // Build breadcrumb for header\r\n createRoutes={({ loading, setName }) => {\r\n const renderName = () => {\r\n return loading ? } /> : setName\r\n }\r\n let routes = [\r\n {\r\n path: '/app/scheduling/sets',\r\n title: 'Passenger Sets'\r\n }\r\n ]\r\n if (params.id){\r\n routes.push({\r\n path: `/app/scheduling/sets/${params.id}`,\r\n title: renderName()\r\n })\r\n }\r\n if (isNew){\r\n routes.push({\r\n title: 'New'\r\n })\r\n }\r\n else if (isScheduling) {\r\n routes.push({\r\n title: 'Schedule'\r\n })\r\n }\r\n else if (isEditing) {\r\n routes.push({\r\n title: 'Edit'\r\n })\r\n }\r\n return routes;\r\n }}\r\n onEditChange={(val) => {\r\n if (val){\r\n history.push(basePath(`sets/${params.id}/edit`))\r\n }\r\n else if (!isNew)\r\n {\r\n history.push(basePath(`sets/${params.id}`))\r\n }\r\n else {\r\n history.push(basePath(`sets`))\r\n }\r\n }}\r\n onScheduleChange={(val) => {\r\n if (val){\r\n history.push(basePath(`sets/${params.id}/schedule`))\r\n }\r\n else\r\n {\r\n history.push(basePath(`sets/${params.id}`))\r\n }\r\n }}\r\n />\r\n )\r\n}\r\n\r\nconst phase2SchedulingRoutesLegacy = [\r\n ,\r\n (\r\n props.history.push(basePath('groups'))}\r\n onSaveSuccessful={({ variables: v }) => {\r\n if (!v) return;\r\n let flightDate = encodeURIComponent( moment(v.scheduledFlightDate).format('YYYY-MM-DD') );\r\n let groupName = encodeURIComponent( v.scheduledGroup );\r\n let lkc = encodeURIComponent( v.lastKnownController );\r\n let departureID = encodeURIComponent( v.departureID );\r\n let destinationID = encodeURIComponent( v.destinationID );\r\n\r\n var path = basePath(`groups/${flightDate}/${groupName}/${lkc}/${departureID}/${destinationID}`);\r\n props.history.push(path);\r\n }}\r\n\r\n // Set up breadcrumb on header\r\n routes={[\r\n {\r\n path: '/app/scheduling/groups',\r\n title: 'Scheduled Passengers and Cargo'\r\n },\r\n {\r\n title: 'New Schedule'\r\n }\r\n ]}\r\n />\r\n )}\r\n />,\r\n ,\r\n (\r\n props.history.push(basePath('groups'))}\r\n onSaveSuccessful={() => {\r\n props.history.push(basePath('groups'))\r\n }}\r\n onDeleteGroupSuccessful={() => {\r\n props.history.push(basePath('groups'))\r\n }}\r\n onEditingChange={(editing) => {\r\n if (editing === false){\r\n return;\r\n }\r\n var { date, scheduledGroup, departureID, destinationID, lastKnownController } = props.match.params;\r\n scheduledGroup = encodeURIComponent(scheduledGroup);\r\n departureID = encodeURIComponent(departureID);\r\n destinationID = encodeURIComponent(destinationID);\r\n lastKnownController = encodeURIComponent(lastKnownController);\r\n var path = basePath(`groups/${date}/${scheduledGroup}/${lastKnownController}/${departureID}/${destinationID}/edit`)\r\n props.history.push(path)\r\n }}\r\n onNewSetClicked={(id) => props.history.push(basePath(`sets/${id}`))}\r\n onBackToList={() => {\r\n props.history.push(basePath('groups'))\r\n }}\r\n onToScheduledFlights={() => {\r\n props.history.push(basePath('flight'))\r\n }}\r\n\r\n // Set up breadcrumb on header\r\n routes={[\r\n {\r\n path: '/app/scheduling/groups',\r\n title: 'Scheduled Passengers and Cargo'\r\n },\r\n {\r\n title: decodeURIComponent(props.match.params.scheduledGroup)\r\n }\r\n ]}\r\n />\r\n )}\r\n />,\r\n ,\r\n {\r\n const { date, scheduledGroup, departureID, destinationID, lastKnownController } = props.match.params;\r\n var path = basePath(`groups/${date}/${scheduledGroup}/${lastKnownController}/${departureID}/${destinationID}`);\r\n return (\r\n {\r\n props.history.push(path)\r\n }}\r\n onSaveSuccessful={({ data, variables: v }) => {\r\n if (data && (data.paxnodes || data.cgonodes)){\r\n if (!v) return;\r\n var path = basePath(`groups/${encodeURIComponent(moment(v.scheduledFlightDate).format('YYYY-MM-DD'))}/${encodeURIComponent(v.scheduledGroup)}/${encodeURIComponent(v.lastKnownController)}/${encodeURIComponent(v.departureID)}/${encodeURIComponent(v.destinationID)}`)\r\n props.history.push(path);\r\n }\r\n else\r\n {\r\n props.history.push(basePath('groups'))\r\n }\r\n }}\r\n onDeleteGroupSuccessful={() => {\r\n props.history.push(basePath('groups'))\r\n }}\r\n onEditingChange={(editing) => {\r\n if (editing === true){\r\n return;\r\n }\r\n props.history.push(path)\r\n }}\r\n routes={[\r\n {\r\n path: '/app/scheduling/groups',\r\n title: 'Scheduled Passengers and Cargo'\r\n },\r\n {\r\n title: decodeURIComponent(props.match.params.scheduledGroup),\r\n path: path\r\n },\r\n {\r\n title: 'Edit'\r\n }\r\n ]}\r\n />\r\n )\r\n }}\r\n />\r\n]\r\n\r\n/** Handles all routes related to scheduling */\r\n// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default () => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n return {\r\n let flightDate = encodeURIComponent( moment(date).format('YYYY-MM-DD') );\r\n let groupName = encodeURIComponent( name );\r\n let lastKnownController = encodeURIComponent( lkc );\r\n let depID = dep ? encodeURIComponent( dep ) : null;\r\n let destID = dest ? encodeURIComponent( dest ) : null;\r\n\r\n if (!depID && !destID)\r\n // This must be a scheduler V2 group\r\n history.push(basePath(`schedule/${flightDate}/${groupName}/${lastKnownController}`))\r\n else\r\n history.push(basePath(`groups/${flightDate}/${groupName}/${lastKnownController}/${depID}/${destID}`));\r\n }\r\n }\r\n />\r\n }}\r\n />\r\n {phase2SchedulingRoutesLegacy}\r\n {SchedulingV2Routes}\r\n {\r\n return history.push(basePath(`flight/${flight._id}`))}\r\n onNewFlightSubmitted={(flightId) => history.push(basePath(`flight/${flightId}`))}\r\n />\r\n }}\r\n />\r\n \r\n \r\n \r\n)","\r\nconst fieldNames = {\r\n dateRange: ['dateRange', 'Date Range'],\r\n customers: ['customers', 'Customers'],\r\n customer: ['customer', 'Customer'],\r\n name: ['name', 'Name'],\r\n firstName: ['firstName', 'First Name'],\r\n lastName: ['lastName', 'Last Name'],\r\n desig: ['desig', 'Flight Designation'],\r\n employers: ['employers', 'Employers'],\r\n departures: ['departures', 'Departures'],\r\n destinations: ['destinations', 'Destinations'],\r\n status: ['status', 'Status'],\r\n transporters: ['transporters', 'Transporters'],\r\n transitType: ['transitType', 'Transit Type']\r\n}\r\n\r\nexport default fieldNames;\r\n\r\nexport const getFieldKey = (key) => {\r\n return fieldNames[key] && fieldNames[key][0];\r\n}\r\n\r\nexport const getFieldLabel = (key) => {\r\n return fieldNames[key] && fieldNames[key][1];\r\n}","import moment from 'moment'\r\n\r\n// eslint-disable-next-line import/no-anonymous-default-export\r\nconst DefaultGlobalState = {\r\n highlightFiltered: true,\r\n transporter: null,\r\n employer: null,\r\n organization: null,\r\n contracts: [],\r\n appLoaded: false,\r\n paginationLimit: 200,\r\n schedulingCalendarView: '0',\r\n schedulingDateRange: [moment().format('YYYY-MM-DD'), moment().add(1, 'month').format('YYYY-MM-DD')],\r\n reportDateRange: [moment().subtract(1, 'week').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')],\r\n navSiderCollapsed: false,\r\n scheduling: {\r\n __typename: 'SchedulingState',\r\n\r\n // Shows which option to show for Phase 1 of scheduling:\r\n // sets: Shows the \"Passenger Sets\" option as phase 1\r\n // history: Shows the \"Historical Scheduled Passengers and Cargo\" option as phase 1\r\n phase1Step: 'sets' as 'sets' | 'history'\r\n },\r\n globalFilter: {\r\n __typename: 'GlobalFilter',\r\n visible: false,\r\n customer: null,\r\n transporter: null,\r\n departure: null,\r\n destination: null,\r\n employer: null,\r\n pax: {\r\n __typename: 'PaxGlobalFilter',\r\n lastName: null,\r\n firstName: null\r\n },\r\n cgo: {\r\n __typename: 'CgoGlobalFilter',\r\n name: null\r\n }\r\n },\r\n userFilter: {\r\n paxSets: {\r\n owner: 'own',\r\n __typename: 'ScheduleFilter'\r\n },\r\n scheduledPax: {\r\n owner: 'own',\r\n startDate: moment().format('YYYY-MM-DD'),\r\n endDate: moment().add(1, 'week').format('YYYY-MM-DD'),\r\n __typename: 'ScheduleFilter'\r\n },\r\n scheduledFlights: {\r\n owner: 'own',\r\n startDate: moment().format('YYYY-MM-DD'),\r\n endDate: moment().add(1, 'week').format('YYYY-MM-DD'),\r\n __typename: 'ScheduleFilter'\r\n },\r\n __typename: 'UserFilter'\r\n },\r\n tableSettings: [\r\n {\r\n name: 'livePassengers',\r\n __typename: 'TableSettingsItem',\r\n settings: {\r\n __typename: 'TableSettings',\r\n visibleColumns: [\r\n 'assignedFlight',\r\n 'name',\r\n 'employer',\r\n 'customer',\r\n 'transporter',\r\n 'weight',\r\n 'checkedInTime',\r\n 'bagWeight',\r\n 'bagCount',\r\n 'departure',\r\n 'destination',\r\n 'tsa',\r\n 'restrictions',\r\n 'isnStatus'\r\n ]\r\n }\r\n },\r\n {\r\n name: 'liveFlights',\r\n __typename: 'TableSettingsItem',\r\n settings: {\r\n __typename: 'TableSettings',\r\n visibleColumns: [\r\n 'desig',\r\n 'departureWeight',\r\n 'passengers',\r\n 'departure',\r\n 'destinations',\r\n 'seatPercent',\r\n 'weightPercent',\r\n 'status'\r\n ]\r\n }\r\n },\r\n {\r\n name: 'liveCargo',\r\n __typename: 'TableSettingsItem',\r\n settings: {\r\n __typename: 'TableSettings',\r\n visibleColumns: [\r\n 'assignedFlight',\r\n 'name',\r\n 'customer',\r\n 'checkedIn',\r\n 'departure',\r\n 'destination',\r\n 'deliveredBy',\r\n 'attentionTo',\r\n 'weight',\r\n 'hazmat'\r\n ]\r\n }\r\n }\r\n ]\r\n}\r\n\r\nexport type GlobalState = typeof DefaultGlobalState;\r\n\r\nexport default DefaultGlobalState;","import { useApolloClient, useQuery } from \"@apollo/react-hooks\";\r\nimport defaultState from \"defaultState\";\r\nimport gql from \"graphql-tag\";\r\nimport moment, { MomentInput } from \"moment\";\r\n\r\nconst QUERY_CACHE = gql`\r\n{\r\n reportDateRange @client\r\n}\r\n`\r\n\r\nexport default function useCachedDateRange(defaultStartDate?: MomentInput, defaultEndDate?: MomentInput){\r\n let { data, loading } = useQuery(QUERY_CACHE);\r\n const client = useApolloClient();\r\n\r\n let reportDateRange = data?.reportDateRange;\r\n\r\n function cleanDateRange(dateRange: [MomentInput, MomentInput]){\r\n if (!dateRange || !dateRange[0] || !dateRange[1]){\r\n if (defaultStartDate && defaultEndDate){\r\n dateRange = [ moment(defaultStartDate), moment(defaultEndDate) ]\r\n }\r\n else\r\n {\r\n dateRange = [ moment(defaultState.reportDateRange[0]), moment(defaultState.reportDateRange[1]) ];\r\n }\r\n }\r\n else {\r\n dateRange = [ moment(dateRange[0]), moment(dateRange[1]) ]\r\n }\r\n return dateRange;\r\n }\r\n\r\n reportDateRange = cleanDateRange(reportDateRange);\r\n\r\n return {\r\n dateRange: reportDateRange,\r\n setDateRange: (newDateRange) => {\r\n newDateRange = cleanDateRange(newDateRange);\r\n newDateRange = [moment(newDateRange[0]).format('YYYY-MM-DD'), moment(newDateRange[1]).format('YYYY-MM-DD')]\r\n client.writeData({\r\n data: {\r\n reportDateRange: newDateRange\r\n }\r\n })\r\n },\r\n loaded: !loading\r\n }\r\n}","import { Button, Col, Form, Input, Row } from 'antd';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\nimport moment from 'moment';\r\nimport React, { useEffect, useRef } from 'react';\r\nimport WithOrgData, { WithOrgDataProps } from '../../WithOrgData';\r\nimport { getFieldLabel } from '../fieldTypes';\r\nimport useCachedDateRange from '../ReportForms/hooks/useCachedDateRange';\r\n\r\nconst formItemLayout = {\r\n labelCol: {\r\n xs: { span: 24 },\r\n sm: { span: 8 },\r\n },\r\n wrapperCol: {\r\n xs: { span: 24 },\r\n sm: { span: 16 },\r\n },\r\n};\r\nconst tailFormItemLayout = {\r\n wrapperCol: {\r\n xs: {\r\n span: 24,\r\n offset: 0,\r\n },\r\n sm: {\r\n span: 16,\r\n offset: 8,\r\n },\r\n },\r\n};\r\n\r\nexport interface ReportFormProps extends FormComponentProps, WithOrgDataProps {\r\n renderFormItems?: (form: any, formItemLayout: any, customer: any, transporter: any, employer: any) => React.ReactNode[],\r\n onSubmit: (data: { name: string, criteria: any }) => void,\r\n submitting?: boolean,\r\n fieldFormatter?: (values: any) => any,\r\n generatedReportDateTimeFormat?: string\r\n}\r\n\r\nconst ReportForm: React.FC = (props) => {\r\n const { dateRange, setDateRange, loaded } = useCachedDateRange();\r\n let dateRangeFormValue = props.form.getFieldValue('dateRange');\r\n\r\n let isMounted = useRef(false);\r\n\r\n useEffect(() => {\r\n if (isMounted.current === false) {\r\n isMounted.current = true;\r\n }\r\n else if (loaded) {\r\n setDateRange(dateRangeFormValue);\r\n }\r\n // eslint-disable-next-line\r\n }, [dateRangeFormValue, loaded])\r\n\r\n useEffect(() => {\r\n if (loaded) {\r\n props.form.setFieldsValue({ dateRange: dateRange })\r\n }\r\n // eslint-disable-next-line\r\n }, [loaded])\r\n\r\n function getFormattedFields() {\r\n const values = props.form.getFieldsValue();\r\n return (props.fieldFormatter && props.fieldFormatter(values)) || values\r\n }\r\n function generateReportName() {\r\n let format = props.generatedReportDateTimeFormat || 'MMM D, YYYY HH:mm:ss A'\r\n let orgName = props.orgData.getActiveOrgName();\r\n const reportName = `${orgName} ${moment().format(format)}`\r\n return reportName\r\n }\r\n const handleSubmit = () => {\r\n props.form.validateFieldsAndScroll((err, values) => {\r\n const formattedFields = getFormattedFields();\r\n const { reportName, ...restValues } = formattedFields;\r\n const criteria = Object.entries(restValues).map(([key, value]) => ({\r\n key,\r\n value,\r\n label: getFieldLabel(key)\r\n }));\r\n if (!err) {\r\n props.onSubmit({\r\n name: reportName || generateReportName(),\r\n criteria: criteria\r\n });\r\n }\r\n })\r\n }\r\n\r\n const { getFieldDecorator } = props.form;\r\n const { renderFormItems, orgData: { customer, transporter, employer }, submitting } = props;\r\n const formItems = renderFormItems && renderFormItems(props.form, formItemLayout, customer, transporter, employer);\r\n return (\r\n
    \r\n \r\n \r\n \r\n {getFieldDecorator('reportName')()}\r\n \r\n {formItems}\r\n \r\n \r\n \r\n \r\n \r\n
    \r\n );\r\n}\r\n\r\nexport default WithOrgData(Form.create()(ReportForm));","import PropTypes from 'prop-types';\r\nimport React, { Component } from 'react';\r\nimport { Mutation } from 'react-apollo';\r\nimport SubmitReport from './SubmitReport';\r\nimport WithOrgData from '../../WithOrgData';\r\n\r\nclass ReportFormSubmitter extends Component {\r\n static propTypes = {\r\n onCompleted: PropTypes.func,\r\n onError: PropTypes.func,\r\n type: PropTypes.oneOf(['COVID', 'MANIFEST', 'PAX', 'CGO', 'PAX_COVID19_VAX', 'PERSON_COVID19_VAX_DETAILS']),\r\n children: PropTypes.func.isRequired,\r\n onChange: PropTypes.func\r\n }\r\n render() {\r\n const renderReport = this.props.children;\r\n const {\r\n type,\r\n orgData: { transporter },\r\n onCompleted=() => null,\r\n onError=() => null,\r\n } = this.props;\r\n return (\r\n \r\n {(submitReport, result) => {\r\n const submitFunc = ({ name, criteria }) => {\r\n submitReport({\r\n variables: {\r\n name,\r\n criteria: criteria.map(item => ({...item, value: JSON.stringify(item.value)})),\r\n type,\r\n tpID: transporter._id\r\n }\r\n })\r\n .then(({ data }) => onCompleted({\r\n id: data.run_report,\r\n name\r\n }))\r\n .catch((error) => {\r\n onError(error);\r\n })\r\n };\r\n return renderReport(\r\n submitFunc,\r\n result\r\n )\r\n }}\r\n \r\n );\r\n }\r\n}\r\n \r\nexport default WithOrgData(ReportFormSubmitter);","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Row, Col, List, Badge, Empty, Icon } from 'antd';\r\nimport moment from 'moment';\r\nimport groupBy from 'lodash/groupBy';\r\nimport '../../../css/List.css';\r\n\r\nclass ReportList extends Component {\r\n state = {\r\n currentTime: moment()\r\n }\r\n static propTypes = {\r\n reports: PropTypes.arrayOf(PropTypes.shape({\r\n name: PropTypes.any\r\n }).isRequired).isRequired,\r\n onItemClick: PropTypes.func.isRequired\r\n }\r\n updateCurrentTime = () => {\r\n this.setState({ currentTime: moment() });\r\n }\r\n componentDidMount(){\r\n this.interval = setInterval(this.updateCurrentTime, 1000);\r\n }\r\n render() {\r\n const { reports, renderEmpty, showWarningAtRunTime=120 } = this.props;\r\n const groupedReports = Object.entries(groupBy(reports, (r) => moment(r.createdTs).calendar(null, {\r\n sameDay: '[Today]',\r\n lastDay: '[Yesterday]',\r\n lastWeek: '[Last] dddd',\r\n sameElse: 'MMMM D, YYYY'\r\n })));\r\n if (!reports || !reports.length){\r\n return (\r\n renderEmpty || \r\n \r\n )\r\n }\r\n return (\r\n
    \r\n {groupedReports.map(([day, repList], i) => (\r\n
    \r\n

    0 ? 20 : 0, marginBottom: 12 }}>{day}

    \r\n {\r\n const isRunning = report.status === 'IN_PROGRESS' || report.status === 'INITIALIZING';\r\n const getStatus = () => {\r\n const statusMap = {\r\n 'INITIALIZING': ['In Progress', 'processing'],\r\n 'IN_PROGRESS': ['In Progress', 'processing'],\r\n 'COMPLETE': ['Complete', 'success'],\r\n 'ERROR': ['Failed', 'error']\r\n }\r\n return statusMap[report.status]\r\n }\r\n const startMoment = moment(report.startTs);\r\n const endMoment = moment(report.endTs || this.state.currentTime);\r\n const runTime = endMoment.diff(startMoment, 'milliseconds') / 1000;\r\n return (\r\n this.props.onItemClick(report._id, report.name)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n

    {report.name}

    \r\n
    \r\n \r\n \r\n {isRunning && runTime >= showWarningAtRunTime ? (\r\n \r\n \r\n This report is taking longer than usual to run\r\n \r\n ) : null}\r\n \r\n \r\n {report.result ? (\r\n \r\n
    \r\n {report.result.total_docs || 0} records\r\n
    \r\n \r\n ) : null}\r\n
    \r\n \r\n \r\n \r\n \r\n
    {`Created at ${moment(report.createdTs).format('YYYY-M-D H:m')}`}
    \r\n
    \r\n Run Time: {`${runTime} seconds`}\r\n
    \r\n \r\n
    \r\n \r\n
    \r\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 ReportList;","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery ReportListQuery(\r\n $filter: ReportsFilterInput\r\n $limit: Int = 10\r\n $skip: Int\r\n $bookmark: String\r\n){\r\n reports(\r\n filter: $filter\r\n limit: $limit\r\n skip: $skip\r\n bookmark: $bookmark\r\n ){\r\n docs {\r\n _id\r\n ... on Report {\r\n name\r\n startTs\r\n endTs\r\n createdTs\r\n status\r\n type\r\n result {\r\n total_docs\r\n }\r\n }\r\n }\r\n bookmark\r\n }\r\n}\r\n`","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Query } from 'react-apollo';\r\nimport { ReportList } from '.';\r\nimport { Alert, Spin, Icon } from 'antd';\r\nimport ReportListQuery from './ReportListQuery';\r\nimport withUserInfo from '../../withUserInfo';\r\n\r\nclass ReportListWithData extends Component {\r\n static propTypes = {\r\n type: PropTypes.oneOf(['COVID', 'MANIFEST', 'PAX', 'CGO', 'PAX_COVID19_VAX', 'PERSON_COVID19_VAX_DETAILS']),\r\n userinfo: PropTypes.object.isRequired\r\n }\r\n render() {\r\n const { type, userinfo, ...restProps } = this.props;\r\n const username = userinfo.user && userinfo.user.username;\r\n return (\r\n \r\n {({ data, loading, error }) => {\r\n const reports = (data && data.reports && data.reports.docs) || [];\r\n return (\r\n
    \r\n {error ? (\r\n \r\n ) : null}\r\n
    \r\n \r\n {!reports.length ? (\r\n
    \r\n }\r\n />\r\n
    \r\n ):null}\r\n
    \r\n
    \r\n )\r\n }}\r\n \r\n );\r\n }\r\n}\r\n \r\nexport default withUserInfo(ReportListWithData);","import { DatePicker, Form, Input, Select } from \"antd\";\r\nimport moment from 'moment';\r\nimport React from 'react';\r\nimport { LocationSelect } from '../../form/select/LocationSelect';\r\nimport { OrganizationSelect } from '../../form/select/OrganizationSelect';\r\nimport { getFieldKey } from '../fieldTypes';\r\n\r\nconst { RangePicker } = DatePicker;\r\n\r\nconst DATERANGE = getFieldKey('dateRange')\r\nconst CUSTOMERS = getFieldKey('customers');\r\nconst TRANSPORTERS = getFieldKey('transporters');\r\nconst NAME = getFieldKey('name');\r\nconst EMPLOYERS = getFieldKey('employers');\r\nconst DEPARTURES = getFieldKey('departures');\r\nconst DESTINATIONs = getFieldKey('destinations');\r\nconst STATUS = getFieldKey('status');\r\n\r\nexport const formatFields = (fields) => {\r\n var [ startDay, endDay ] = fields.dateRange;\r\n startDay = moment(startDay).startOf('day');\r\n endDay = moment(endDay).endOf('day');\r\n return {\r\n ...fields,\r\n dateRange: [startDay, endDay]\r\n }\r\n}\r\n\r\nconst PaxForm = (form, fieldProps={}, currentCustomer, currentTransporter) => {\r\n\r\n const { getFieldDecorator } = form;\r\n\r\n return [\r\n \r\n {getFieldDecorator(DATERANGE, {\r\n rules: [\r\n {required: true, message: 'You must specify a date range'}\r\n ]\r\n })()}\r\n ,\r\n \r\n {getFieldDecorator(TRANSPORTERS, {\r\n initialValue: currentTransporter ? currentTransporter._id : null,\r\n rules: [\r\n {required: true, message: 'Transporter is required'}\r\n ]\r\n })(currentCustomer ? (\r\n ) : (\r\n \r\n ))}\r\n ,\r\n \r\n {getFieldDecorator(CUSTOMERS, {\r\n initialValue: currentCustomer ? currentCustomer._id : [],\r\n rules: [\r\n {required: currentCustomer ? true : false, message: 'Customer is required'}\r\n ]\r\n })(currentCustomer ? (\r\n \r\n ) : (\r\n )\r\n )}\r\n ,\r\n \r\n {getFieldDecorator(NAME)()}\r\n ,\r\n \r\n {getFieldDecorator(EMPLOYERS, {\r\n initialValue: []\r\n })()}\r\n ,\r\n \r\n {getFieldDecorator(DEPARTURES, {\r\n initialValue: []\r\n })(\r\n \r\n )}\r\n ,\r\n \r\n {getFieldDecorator(DESTINATIONs, {\r\n initialValue: []\r\n })(\r\n \r\n )}\r\n ,\r\n \r\n {getFieldDecorator(STATUS, {\r\n initialValue: 'default'\r\n })(\r\n \r\n )}\r\n \r\n ]\r\n}\r\n\r\nexport default PaxForm","import React from 'react';\r\nimport { Form, Select, DatePicker, Input } from \"antd\";\r\nimport moment from 'moment';\r\nimport { OrganizationSelect } from '../../form/select/OrganizationSelect';\r\nimport { LocationSelect } from '../../form/select/LocationSelect';\r\nimport { getFieldKey } from '../fieldTypes';\r\n\r\nconst { RangePicker } = DatePicker;\r\n\r\nconst DATERANGE = getFieldKey('dateRange')\r\nconst CUSTOMERS = getFieldKey('customers');\r\nconst TRANSPORTERS = getFieldKey('transporters');\r\nconst NAME = getFieldKey('name');\r\nconst EMPLOYERS = getFieldKey('employers');\r\nconst DEPARTURES = getFieldKey('departures');\r\nconst DESTINATIONs = getFieldKey('destinations');\r\nconst STATUS = getFieldKey('status');\r\n\r\nexport const formatFields = (fields) => {\r\n var [ startDay, endDay ] = fields.dateRange;\r\n startDay = moment(startDay).startOf('day');\r\n endDay = moment(endDay).endOf('day');\r\n return {\r\n ...fields,\r\n dateRange: [startDay, endDay]\r\n }\r\n}\r\n\r\nconst CgoForm = (form, fieldProps={}, currentCustomer, currentTransporter) => {\r\n const { getFieldDecorator } = form;\r\n return [\r\n \r\n {getFieldDecorator(DATERANGE, {\r\n rules: [\r\n {required: true, message: 'You must specify a date range'}\r\n ]\r\n })()}\r\n ,\r\n \r\n {getFieldDecorator(TRANSPORTERS, {\r\n initialValue: currentTransporter ? currentTransporter._id : null,\r\n rules: [\r\n {required: true, message: 'Transporter is required'}\r\n ]\r\n })(currentCustomer ? (\r\n ) : (\r\n \r\n ))}\r\n ,\r\n \r\n {getFieldDecorator(CUSTOMERS, {\r\n initialValue: currentCustomer ? currentCustomer._id : [],\r\n rules: [\r\n {required: currentCustomer ? true : false, message: 'Customer is required'}\r\n ]\r\n })(currentCustomer ? (\r\n \r\n ) : (\r\n )\r\n )}\r\n ,\r\n \r\n {getFieldDecorator(NAME)()}\r\n ,\r\n \r\n {getFieldDecorator(EMPLOYERS, {\r\n initialValue: []\r\n })()}\r\n ,\r\n \r\n {getFieldDecorator(DEPARTURES, {\r\n initialValue: []\r\n })(\r\n \r\n )}\r\n ,\r\n \r\n {getFieldDecorator(DESTINATIONs, {\r\n initialValue: []\r\n })(\r\n \r\n )}\r\n ,\r\n \r\n {getFieldDecorator(STATUS, {\r\n initialValue: 'default'\r\n })(\r\n \r\n )}\r\n \r\n ]\r\n}\r\n\r\nexport default CgoForm","import { DatePicker, Form, Input, Select } from \"antd\";\r\nimport moment from 'moment';\r\nimport React from 'react';\r\nimport { LocationSelect } from '../../form/select/LocationSelect';\r\nimport { OrganizationSelect } from '../../form/select/OrganizationSelect';\r\nimport { getFieldKey } from '../fieldTypes';\r\n\r\nconst { RangePicker } = DatePicker;\r\n\r\nconst DATERANGE = getFieldKey('dateRange')\r\nconst CUSTOMERS = getFieldKey('customers');\r\nconst TRANSPORTERS = getFieldKey('transporters');\r\nconst DESIG = getFieldKey('desig');\r\nconst EMPLOYERS = getFieldKey('employers');\r\nconst DEPARTURES = getFieldKey('departures');\r\nconst DESTINATIONs = getFieldKey('destinations');\r\nconst STATUS = getFieldKey('status');\r\n\r\nexport const formatFields = (fields) => {\r\n var [ startDay, endDay ] = fields.dateRange;\r\n startDay = moment(startDay).utc().format('YYYY-MM-DD');\r\n endDay = moment(endDay).utc().format('YYYY-MM-DD');\r\n return {\r\n ...fields,\r\n dateRange: [startDay, endDay]\r\n }\r\n}\r\n\r\nconst ManifestForm = (form, fieldProps={}, currentCustomer, currentTransporter) => {\r\n const { getFieldDecorator } = form;\r\n return [\r\n \r\n {getFieldDecorator(DATERANGE, {\r\n rules: [\r\n {required: true, message: 'You must specify a date range'}\r\n ]\r\n })()}\r\n ,\r\n \r\n {getFieldDecorator(TRANSPORTERS, {\r\n initialValue: currentTransporter ? currentTransporter._id : null,\r\n rules: [\r\n {required: true, message: 'Transporter is required'}\r\n ]\r\n })(currentCustomer ? (\r\n ) : (\r\n \r\n ))}\r\n ,\r\n \r\n {getFieldDecorator(CUSTOMERS, {\r\n initialValue: currentCustomer ? currentCustomer._id : [],\r\n rules: [\r\n {required: currentCustomer ? true : false, message: 'Customer is required'}\r\n ]\r\n })(currentCustomer ? (\r\n \r\n ) : (\r\n )\r\n )}\r\n ,\r\n \r\n {getFieldDecorator(DESIG)()}\r\n ,\r\n \r\n {getFieldDecorator(EMPLOYERS, {\r\n initialValue: []\r\n })()}\r\n ,\r\n \r\n {getFieldDecorator(DEPARTURES, {\r\n initialValue: []\r\n })(\r\n \r\n )}\r\n ,\r\n \r\n {getFieldDecorator(DESTINATIONs, {\r\n initialValue: []\r\n })(\r\n \r\n )}\r\n ,\r\n \r\n {getFieldDecorator(STATUS, {\r\n initialValue: 'default'\r\n })(\r\n \r\n )}\r\n \r\n ]\r\n}\r\n\r\nexport default ManifestForm","import React from 'react';\r\nimport { Form, Select, DatePicker, Input } from \"antd\";\r\nimport moment from 'moment';\r\nimport { OrganizationSelect } from '../../form/select/OrganizationSelect';\r\nimport { LocationSelect } from '../../form/select/LocationSelect';\r\nimport { getFieldKey } from '../fieldTypes';\r\n\r\nconst { RangePicker } = DatePicker;\r\n\r\nconst DATERANGE = getFieldKey('dateRange')\r\nconst CUSTOMERS = getFieldKey('customers');\r\nconst TRANSPORTERS = getFieldKey('transporters');\r\nconst NAME = getFieldKey('name');\r\nconst EMPLOYERS = getFieldKey('employers');\r\nconst DEPARTURES = getFieldKey('departures');\r\nconst DESTINATIONs = getFieldKey('destinations');\r\nconst STATUS = getFieldKey('status');\r\nconst TRANSITTYPE = getFieldKey('transitType');\r\n\r\nexport const formatFields = (fields) => {\r\n var [ startDay, endDay ] = fields.dateRange;\r\n startDay = moment(startDay).startOf('day');\r\n endDay = moment(endDay).endOf('day');\r\n return {\r\n ...fields,\r\n dateRange: [startDay, endDay]\r\n }\r\n}\r\n\r\nconst ISNForm = (form, fieldProps={}, currentCustomer, currentTransporter) => {\r\n const { getFieldDecorator } = form;\r\n return [\r\n \r\n {getFieldDecorator(DATERANGE, {\r\n rules: [\r\n {required: true, message: 'You must specify a date range'}\r\n ]\r\n })()}\r\n ,\r\n \r\n {getFieldDecorator(TRANSPORTERS, {\r\n initialValue: currentTransporter ? currentTransporter._id : null,\r\n rules: [\r\n {required: true, message: 'Transporter is required'}\r\n ]\r\n })(currentCustomer ? (\r\n ) : (\r\n \r\n ))}\r\n ,\r\n \r\n {getFieldDecorator(CUSTOMERS, {\r\n initialValue: currentCustomer ? currentCustomer._id : [],\r\n rules: [\r\n {required: currentCustomer ? true : false, message: 'Customer is required'}\r\n ]\r\n })(currentCustomer ? (\r\n \r\n ) : (\r\n )\r\n )}\r\n ,\r\n \r\n {getFieldDecorator(NAME)()}\r\n ,\r\n \r\n {getFieldDecorator(EMPLOYERS, {\r\n initialValue: []\r\n })()}\r\n ,\r\n \r\n {getFieldDecorator(DEPARTURES, {\r\n initialValue: []\r\n })(\r\n \r\n )}\r\n ,\r\n \r\n {getFieldDecorator(DESTINATIONs, {\r\n initialValue: []\r\n })(\r\n \r\n )}\r\n ,\r\n \r\n {getFieldDecorator(TRANSITTYPE, {\r\n initialValue: 'default'\r\n })(\r\n \r\n )}\r\n ,\r\n \r\n {getFieldDecorator(STATUS, {\r\n initialValue: 'default'\r\n })(\r\n \r\n )}\r\n \r\n ]\r\n}\r\n\r\nexport default ISNForm","import { DatePicker, Form, Input, Select } from \"antd\";\r\nimport moment from 'moment';\r\nimport React from 'react';\r\nimport { LocationSelect } from '../../form/select/LocationSelect';\r\nimport { OrganizationSelect } from '../../form/select/OrganizationSelect';\r\nimport { getFieldKey } from '../fieldTypes';\r\n\r\nconst { RangePicker } = DatePicker;\r\n\r\nconst DATERANGE = getFieldKey('dateRange')\r\nconst CUSTOMERS = getFieldKey('customers');\r\nconst TRANSPORTERS = getFieldKey('transporters');\r\nconst NAME = getFieldKey('name');\r\nconst EMPLOYERS = getFieldKey('employers');\r\nconst DEPARTURES = getFieldKey('departures');\r\nconst DESTINATIONs = getFieldKey('destinations');\r\nconst STATUS = getFieldKey('status');\r\n\r\nexport const formatFields = (fields) => {\r\n var [ startDay, endDay ] = fields.dateRange;\r\n startDay = moment(startDay).startOf('day');\r\n endDay = moment(endDay).endOf('day');\r\n return {\r\n ...fields,\r\n dateRange: [startDay, endDay]\r\n }\r\n}\r\n\r\nconst CovidForm = (form, fieldProps={}, currentCustomer, currentTransporter) => {\r\n\r\n const { getFieldDecorator } = form;\r\n\r\n return [\r\n \r\n {getFieldDecorator(DATERANGE, {\r\n rules: [\r\n {required: true, message: 'You must specify a date range'}\r\n ]\r\n })()}\r\n ,\r\n \r\n {getFieldDecorator(TRANSPORTERS, {\r\n initialValue: currentTransporter ? currentTransporter._id : null,\r\n rules: [\r\n {required: true, message: 'Transporter is required'}\r\n ]\r\n })(currentCustomer ? (\r\n ) : (\r\n \r\n ))}\r\n ,\r\n \r\n {getFieldDecorator(CUSTOMERS, {\r\n initialValue: currentCustomer ? currentCustomer._id : [],\r\n rules: [\r\n {required: currentCustomer ? true : false, message: 'Customer is required'}\r\n ]\r\n })(currentCustomer ? (\r\n \r\n ) : (\r\n )\r\n )}\r\n ,\r\n \r\n {getFieldDecorator(NAME)()}\r\n ,\r\n \r\n {getFieldDecorator(EMPLOYERS, {\r\n initialValue: []\r\n })()}\r\n ,\r\n \r\n {getFieldDecorator(DEPARTURES, {\r\n initialValue: []\r\n })(\r\n \r\n )}\r\n ,\r\n \r\n {getFieldDecorator(DESTINATIONs, {\r\n initialValue: []\r\n })(\r\n \r\n )}\r\n ,\r\n \r\n {getFieldDecorator(STATUS, {\r\n initialValue: 'default'\r\n })(\r\n \r\n )}\r\n \r\n ]\r\n}\r\n\r\nexport default CovidForm","import { DatePicker, Form, Input, Select } from \"antd\";\r\nimport moment from 'moment';\r\nimport React from 'react';\r\nimport { LocationSelect } from '../../form/select/LocationSelect';\r\nimport { OrganizationSelect } from '../../form/select/OrganizationSelect';\r\nimport { getFieldKey } from '../fieldTypes';\r\n\r\nconst { RangePicker } = DatePicker;\r\n\r\nconst DATERANGE = getFieldKey('dateRange')\r\nconst CUSTOMERS = getFieldKey('customers');\r\nconst TRANSPORTERS = getFieldKey('transporters');\r\nconst NAME = getFieldKey('name');\r\nconst EMPLOYERS = getFieldKey('employers');\r\nconst DEPARTURES = getFieldKey('departures');\r\nconst DESTINATIONs = getFieldKey('destinations');\r\nconst STATUS = getFieldKey('status');\r\n\r\nexport const formatFields = (fields) => {\r\n var [ startDay, endDay ] = fields.dateRange;\r\n startDay = moment(startDay).startOf('day');\r\n endDay = moment(endDay).endOf('day');\r\n return {\r\n ...fields,\r\n dateRange: [startDay, endDay]\r\n }\r\n}\r\n\r\nconst CovidVaccineForm = (form, fieldProps={}, currentCustomer, currentTransporter) => {\r\n\r\n const { getFieldDecorator } = form;\r\n\r\n return [\r\n \r\n {getFieldDecorator(DATERANGE, {\r\n rules: [\r\n {required: true, message: 'You must specify a date range'}\r\n ]\r\n })()}\r\n ,\r\n \r\n {getFieldDecorator(TRANSPORTERS, {\r\n initialValue: currentTransporter ? currentTransporter._id : null,\r\n rules: [\r\n {required: true, message: 'Transporter is required'}\r\n ]\r\n })(currentCustomer ? (\r\n ) : (\r\n \r\n ))}\r\n ,\r\n \r\n {getFieldDecorator(CUSTOMERS, {\r\n initialValue: currentCustomer ? currentCustomer._id : [],\r\n rules: [\r\n {required: currentCustomer ? true : false, message: 'Customer is required'}\r\n ]\r\n })(currentCustomer ? (\r\n \r\n ) : (\r\n )\r\n )}\r\n ,\r\n \r\n {getFieldDecorator(NAME)()}\r\n ,\r\n \r\n {getFieldDecorator(EMPLOYERS, {\r\n initialValue: []\r\n })()}\r\n ,\r\n \r\n {getFieldDecorator(DEPARTURES, {\r\n initialValue: []\r\n })(\r\n \r\n )}\r\n ,\r\n \r\n {getFieldDecorator(DESTINATIONs, {\r\n initialValue: []\r\n })(\r\n \r\n )}\r\n ,\r\n \r\n {getFieldDecorator(STATUS, {\r\n initialValue: 'default'\r\n })(\r\n \r\n )}\r\n \r\n ]\r\n}\r\n\r\nexport default CovidVaccineForm","import { Form, Input } from \"antd\";\r\nimport React from 'react';\r\nimport { OrganizationSelect } from '../../form/select/OrganizationSelect';\r\nimport { getFieldKey } from '../fieldTypes';\r\n\r\n// const CUSTOMER = getFieldKey('customer');\r\nconst FIRSTNAME = getFieldKey('firstName');\r\nconst LASTNAME = getFieldKey('lastName');\r\nconst EMPLOYERS = getFieldKey('employers');\r\n\r\nexport const formatFields = (fields) => {\r\n return fields\r\n}\r\n\r\nconst CovidVaccineForm = (form, fieldProps={}, currentCustomer, currentTransporter) => {\r\n\r\n const { getFieldDecorator } = form;\r\n\r\n return [\r\n // \r\n // {getFieldDecorator(CUSTOMER, {\r\n // })(\r\n // \r\n // )}\r\n // ,\r\n \r\n {getFieldDecorator(EMPLOYERS, {\r\n initialValue: []\r\n })()}\r\n ,\r\n \r\n {getFieldDecorator(FIRSTNAME)()}\r\n ,\r\n \r\n {getFieldDecorator(LASTNAME)()}\r\n \r\n ]\r\n}\r\n\r\nexport default CovidVaccineForm","import { Form, Input, Select } from \"antd\";\r\nimport { OrganizationSelect } from '../../form/select/OrganizationSelect';\r\nimport { getFieldKey } from '../fieldTypes';\r\n\r\nconst CUSTOMERS = getFieldKey('customers');\r\nconst EMPLOYERS = getFieldKey('employers');\r\nconst FIRST_NAME = getFieldKey('firstName')\r\nconst LAST_NAME = getFieldKey('lastName')\r\n\r\nexport const formatFields = (fields) => {\r\n // Nothing to format\r\n return fields\r\n}\r\n\r\nconst PersonHotFuelForm = (form, fieldProps={}, currentCustomer) => {\r\n\r\n const { getFieldDecorator } = form;\r\n\r\n return [\r\n \r\n {getFieldDecorator(CUSTOMERS, {\r\n initialValue: currentCustomer ? currentCustomer._id : [],\r\n rules: [\r\n {required: currentCustomer ? true : false, message: 'Customer is required'}\r\n ]\r\n })(currentCustomer ? (\r\n \r\n ) : (\r\n )\r\n )}\r\n ,\r\n \r\n {getFieldDecorator(EMPLOYERS)(\r\n \r\n )}\r\n ,\r\n \r\n {getFieldDecorator(LAST_NAME)()}\r\n ,\r\n \r\n {getFieldDecorator(FIRST_NAME)()}\r\n \r\n ]\r\n}\r\n\r\nexport default PersonHotFuelForm","import { DatePicker, Form, Input, Select } from \"antd\";\r\nimport moment from 'moment';\r\nimport React from 'react';\r\nimport { LocationSelect } from '../../form/select/LocationSelect';\r\nimport { OrganizationSelect } from '../../form/select/OrganizationSelect';\r\nimport { getFieldKey } from '../fieldTypes';\r\n\r\nconst { RangePicker } = DatePicker;\r\n\r\nconst DATERANGE = getFieldKey('dateRange')\r\nconst CUSTOMERS = getFieldKey('customers');\r\nconst NAME = getFieldKey('name');\r\nconst EMPLOYERS = getFieldKey('employers');\r\n\r\nexport const formatFields = (fields) => {\r\n var [ startDay, endDay ] = fields.dateRange;\r\n startDay = moment(startDay).startOf('day');\r\n endDay = moment(endDay).endOf('day');\r\n return {\r\n ...fields,\r\n dateRange: [startDay, endDay]\r\n }\r\n}\r\n\r\nconst PaxIsnEventsForm = (form, fieldProps={}, currentCustomer, _, currentEmployer) => {\r\n\r\n const { getFieldDecorator } = form;\r\n\r\n return [\r\n \r\n {getFieldDecorator(DATERANGE, {\r\n rules: [\r\n {required: true, message: 'You must specify a date range'}\r\n ]\r\n })()}\r\n ,\r\n \r\n {getFieldDecorator(CUSTOMERS, {\r\n initialValue: currentCustomer ? currentCustomer._id : [],\r\n rules: [\r\n {required: currentCustomer ? true : false, message: 'Customer is required'}\r\n ]\r\n })(currentCustomer ? (\r\n \r\n ) : (\r\n )\r\n )}\r\n ,\r\n \r\n {getFieldDecorator(NAME)()}\r\n ,\r\n \r\n {getFieldDecorator(EMPLOYERS, {\r\n initialValue: []\r\n })(currentEmployer ? (\r\n \r\n ) : (\r\n ))\r\n }\r\n \r\n ]\r\n}\r\n\r\nexport default PaxIsnEventsForm","import PaxForm, { formatFields as ff1 } from './PaxForm'\r\nimport CgoForm, { formatFields as ff2 } from './CgoForm';\r\nimport ManifestForm, { formatFields as ff3 } from './ManifestForm';\r\nimport ISNForm, { formatFields as ff4 } from './ISNForm';\r\nimport CovidForm, { formatFields as ff5 } from './CovidForm';\r\nimport CovidVaccineForm, { formatFields as ff6 } from 'components/reporting/ReportForms/CovidVaccineForm';\r\nimport PersonCovidVaccineForm, { formatFields as ff7 } from 'components/reporting/ReportForms/PersonCovidVaccine';\r\nimport PersonHotFuelForm, { formatFields as ff8 } from 'components/reporting/ReportForms/PersonHotFuel';\r\nimport PaxIsnEventsForm, { formatFields as ff9 } from 'components/reporting/ReportForms/PaxIsnEvents';\r\n\r\nexport const getReportForm = (type) => {\r\n switch (type) {\r\n case 'COVID':\r\n return CovidForm;\r\n case 'PAX':\r\n return PaxForm;\r\n case 'CGO':\r\n return CgoForm\r\n case 'MANIFEST':\r\n return ManifestForm\r\n case 'ISN':\r\n return ISNForm\r\n case 'PAX_COVID19_VAX':\r\n return CovidVaccineForm\r\n case 'PERSON_COVID19_VAX_DETAILS':\r\n return PersonCovidVaccineForm\r\n case 'PERSON_HOTFUEL':\r\n return PersonHotFuelForm\r\n case 'PAX_ISN_EVENTS':\r\n return PaxIsnEventsForm\r\n default:\r\n return undefined;\r\n }\r\n}\r\n\r\nexport const getFieldFormmatter = (type) => {\r\n switch (type) {\r\n case 'PAX':\r\n return ff1;\r\n case 'CGO':\r\n return ff2\r\n case 'MANIFEST':\r\n return ff3\r\n case 'ISN':\r\n return ff4\r\n case 'COVID':\r\n return ff5\r\n case 'PAX_COVID19_VAX':\r\n return ff6;\r\n case 'PERSON_COVID19_VAX_DETAILS':\r\n return ff7\r\n case 'PERSON_HOTFUEL':\r\n return ff8\r\n case 'PAX_ISN_EVENTS':\r\n return ff9\r\n default:\r\n return undefined;\r\n }\r\n}","import React from 'react';\r\nimport { Layout, Row, Col, Spin, Icon, Button, Menu } from \"antd\";\r\nimport './DetailHeader.less';\r\n\r\nconst { Header } = Layout;\r\n\r\nconst DetailHeader = ({ title, onBackClicked, loading, activeTabKey, onTabChange, extra, enableExport }) => {\r\n return (\r\n
    \r\n \r\n \r\n {onBackClicked ? (\r\n \r\n ) : null}\r\n

    \r\n {loading ? (\r\n } />\r\n ) : title}\r\n

    \r\n \r\n \r\n onTabChange(e.key)}\r\n >\r\n Details\r\n Summary\r\n {enableExport ? Export : null}\r\n \r\n \r\n \r\n {extra}\r\n \r\n
    \r\n {/* \r\n \r\n {onBackClicked ? (\r\n \r\n ) : null}\r\n

    \r\n {loading ? (\r\n } />\r\n ) : title}\r\n

    \r\n \r\n \r\n onTabChange(e.target.value)}\r\n buttonStyle=\"solid\"\r\n >\r\n \r\n Details\r\n \r\n \r\n Summary\r\n \r\n \r\n Export\r\n \r\n \r\n \r\n {extra ? (\r\n \r\n {extra}\r\n \r\n ) : null}\r\n
    */}\r\n
    \r\n )\r\n}\r\n\r\nexport default DetailHeader","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Layout, Spin, Icon, Alert } from 'antd';\r\nimport moment from 'moment';\r\nimport DetailHeader from './DetailHeader';\r\nimport { Criteria } from './Criteria';\r\nimport './ReportDetails.less';\r\n\r\nconst { Sider, Content } = Layout;\r\n\r\n\r\n\r\nconst ErrorMessage = ({ error }) => {\r\n let message = error ? error.message : 'An unknown error has occurred';\r\n if (!message){\r\n message = error.detailMessage;\r\n }\r\n return (\r\n
    \r\n \r\n

    An error occurred while running the report

    \r\n \r\n
    \r\n )\r\n}\r\n\r\n// const ReportHeaderStat = ({ title, children }) => (\r\n//
    \r\n//
    {('' + title).toUpperCase()}
    \r\n// {children}\r\n//
    \r\n// )\r\n\r\n// const HeaderSeparator = (style) => (\r\n// \r\n// )\r\n\r\n\r\n\r\nclass ReportDetails extends Component {\r\n state = {\r\n activeTab: 'details',\r\n currentTime: moment()\r\n }\r\n static propTypes = {\r\n data: PropTypes.object.isRequired,\r\n onBackClicked: PropTypes.func,\r\n renderSummary: PropTypes.func,\r\n renderDetail: PropTypes.func\r\n }\r\n\r\n componentDidMount(){\r\n setInterval(() => this.setState({ currentTime: moment() }), 1000);\r\n }\r\n\r\n getActiveTab = () => {\r\n if (this.props.activeTab) {\r\n return this.props.activeTab;\r\n }\r\n return this.state.activeTab\r\n }\r\n\r\n setActiveTab = (activeTab) => {\r\n this.setState({ activeTab });\r\n if (this.props.onTabChange){\r\n this.props.onTabChange(activeTab);\r\n }\r\n }\r\n\r\n render() {\r\n const { data, style, loading, error, onBackClicked, renderSummary, enableExport=true, renderDetail, renderExport, runTimeErrorMessage, runTimeErrorDescription, showErrorAtRunTime=120 } = this.props;\r\n const isInProgress = data.status === 'IN_PROGRESS' || data.status === 'INITIALIZING';\r\n const summary = data.result && JSON.parse(data.result.summary);\r\n const startMoment = moment(data.startTs);\r\n const runTime = this.state.currentTime.diff(startMoment, 'milliseconds') / 1000;\r\n return (\r\n \r\n \r\n {data?.result?.total_docs || 0} records}\r\n // extra={\r\n // \r\n // \r\n // \r\n // \r\n // \r\n // \r\n // \r\n // \r\n // \r\n // {!isInProgress ? `${runTime} seconds` : } />}\r\n // \r\n // \r\n // \r\n // \r\n // {created}\r\n // \r\n // \r\n // \r\n // \r\n // }\r\n />\r\n \r\n {error ? : null}\r\n {loading ? (\r\n
    \r\n
    \r\n } size=\"large\" style={{ marginBottom: '1rem' }} />\r\n

    Downloading Report

    \r\n
    \r\n
    \r\n ) : null}\r\n {!loading ? \r\n isInProgress ? (\r\n
    \r\n
    \r\n }\r\n />\r\n
    \r\n
    \r\n Report is being generated. Please wait.\r\n
    \r\n {runTime >= showErrorAtRunTime ? (\r\n \r\n ) : null}\r\n
    \r\n ) : (\r\n data.status === 'ERROR' ? (\r\n \r\n ) : (\r\n
    \r\n {this.getActiveTab() === 'details' && renderDetail ? renderDetail(data) : null}\r\n {this.getActiveTab() === 'summary' && renderSummary ? renderSummary(summary) : null}\r\n {this.getActiveTab() === 'export' && renderExport && enableExport ? renderExport(data._id) : null}\r\n
    \r\n )\r\n ) : null}\r\n \r\n
    \r\n {data.criteria ? (\r\n \r\n
    \r\n \r\n
    \r\n \r\n ) : null}\r\n
    \r\n );\r\n }\r\n}\r\n \r\nexport default ReportDetails;","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Query } from 'react-apollo';\r\nimport ReportQuery, { S3ReportQuery } from './ReportQuery';\r\nimport ReportDetails from './ReportDetails';\r\nimport { Alert, Icon, Spin } from 'antd';\r\nimport DetailHeader from './DetailHeader';\r\n\r\nclass ReportDetailsWithData extends Component {\r\n state = {\r\n isInProgress: false\r\n }\r\n static propTypes = {\r\n id: PropTypes.string.isRequired,\r\n }\r\n render() {\r\n const { id, ...restProps } = this.props;\r\n return (\r\n \r\n {({ data, loading, error, startPolling, stopPolling }) => {\r\n if (loading) return (\r\n
    \r\n } size=\"large\" />\r\n
    \r\n )\r\n if (error) return (\r\n \r\n )\r\n if (data && \r\n data.report\r\n ){\r\n if (data.report.status === 'INITIALIZING' || data.report.status === 'IN_PROGRESS') {\r\n if (!this.state.isInProgress){\r\n this.setState({ isInProgress: true });\r\n startPolling(5000);\r\n }\r\n }\r\n else\r\n {\r\n if (this.state.isInProgress){\r\n this.setState({ isInProgress: false });\r\n stopPolling();\r\n }\r\n }\r\n }\r\n return (\r\n \r\n {data && data.report ? (\r\n \r\n {({ data: s3Data, loading: s3Loading, error: s3Error }) => {\r\n var mergedReport;\r\n if ((data && data.report) || (s3Data && s3Data.s3Report))\r\n {\r\n mergedReport = data && data.report;\r\n if (s3Data && s3Data.s3Report && s3Data.s3Report.result && s3Data.s3Report.result.docs){\r\n mergedReport.result.docs = JSON.stringify(s3Data.s3Report.result.docs)\r\n }\r\n }\r\n if (mergedReport && mergedReport.result && mergedReport.result.docs){\r\n if (typeof mergedReport.result.docs === 'string'){\r\n mergedReport.result.docs = JSON.parse(mergedReport.result.docs);\r\n }\r\n }\r\n return (\r\n \r\n {error || (s3Error && !this.state.isInProgress) ? : null}\r\n {mergedReport ? (\r\n \r\n ) : null}\r\n {!data || !data.report ? (\r\n \r\n ) : null}\r\n \r\n )\r\n }}\r\n \r\n ) : null}\r\n \r\n )\r\n }}\r\n \r\n );\r\n }\r\n}\r\n \r\nexport default ReportDetailsWithData;","import React from 'react';\r\nimport { Card, Row, Col } from 'antd';\r\nimport { Statistic } from 'antd';\r\n\r\nconst PaxSummary = ({ data }) => {\r\n const finalize_count = data.pax_finalized.value || 0;\r\n const not_finalized_count = data.pax_not_finalized.value || 0;\r\n const paxc = (data.pax_count && data.pax_count.value) || 0;\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\nexport default PaxSummary;","import React from 'react';\r\nimport { Card, Row, Col } from 'antd';\r\nimport { Statistic } from 'antd';\r\n\r\nconst CgoSummary = ({ data }) => {\r\n const finalize_count = data.cgo_finalized.value || 0;\r\n const not_finalized_count = data.cgo_not_finalized.value || 0;\r\n const cgoc = (data.pax_count && data.cgo_count.value) || 0;\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\nexport default CgoSummary;","import { Card, Col, Row, Statistic } from 'antd';\r\nimport React from 'react';\r\n\r\nconst ManifestSummary = ({ data }) => {\r\n const fc = (data.flight_count && data.flight_count.value) || 0;\r\n const tpax = (data.total_pax && data.total_pax.value) || 0;\r\n const tcgo = (data.total_cgo && data.total_cgo.value) || 0;\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n \r\nexport default ManifestSummary;","import React from 'react';\r\nimport { Card, Row, Col } from 'antd';\r\nimport { Statistic } from 'antd';\r\nimport { RadialChart, DiscreteColorLegend } from 'react-vis';\r\n\r\nconst ISNSummary = ({ data }) => {\r\n const getValue = (key) => (data[key] && data[key].value) || 0;\r\n const getPercentage = (val) => (val / getValue('pax_count') * 100).toFixed(1);\r\n const pax_no_isn = getValue('pax_count') - getValue('pax_with_isn_result');\r\n const colors = {\r\n green: '#8ef771',\r\n red: '#f77171',\r\n yellow: '#f7ee71',\r\n purple: '#9b71f7'\r\n }\r\n const statusChartData = [\r\n {\r\n angle: getValue('pax_green_quick_check_status'),\r\n color: colors.green\r\n },\r\n {\r\n angle: getValue('pax_red_quick_check_status'),\r\n color: colors.red\r\n },\r\n {\r\n angle: getValue('pax_no_quick_check_status'),\r\n color: colors.yellow\r\n }\r\n ]\r\n const legenditems = [\r\n {\r\n title: 'Green',\r\n color: colors.green\r\n },\r\n {\r\n title: 'Red',\r\n color: colors.red\r\n },\r\n {\r\n title: 'No Status',\r\n color: colors.yellow\r\n }\r\n ]\r\n if (getValue('pax_multi_quick_check_status') > 0){\r\n statusChartData.push({\r\n angle: getValue('pax_multi_quick_check_status'),\r\n color: colors.purple\r\n });\r\n legenditems.push({\r\n title: 'Multiple Results',\r\n color: colors.purple\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

    ISN Status

    \r\n \r\n \r\n \r\n
    ISN Status
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n
    {getPercentage(getValue('pax_green_quick_check_status'))}%
    \r\n
    \r\n \r\n \r\n
    {getPercentage(getValue('pax_red_quick_check_status'))}%
    \r\n
    \r\n \r\n \r\n
    {getPercentage(getValue('pax_no_quick_check_status'))}%
    \r\n
    \r\n {getValue('pax_multi_quick_check_status') ? (\r\n \r\n \r\n
    {getPercentage(getValue('pax_multi_quick_check_status'))}%
    \r\n
    \r\n ) : null}\r\n
    \r\n \r\n
    \r\n
    \r\n )\r\n}\r\n \r\nexport default ISNSummary;","import React from 'react';\r\nimport { Card, Row, Col } from 'antd';\r\nimport { Statistic } from 'antd';\r\n\r\nconst CovidSummary = ({ data }) => {\r\n const finalize_count = data.pax_finalized.value || 0;\r\n const not_finalized_count = data.pax_not_finalized.value || 0;\r\n const paxc = (data.pax_count && data.pax_count.value) || 0;\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\nexport default CovidSummary;","import React from 'react';\r\nimport { Card, Row, Col } from 'antd';\r\nimport { Statistic } from 'antd';\r\n\r\nconst PaxCovidVaxSummary = ({ data }) => {\r\n const finalize_count = data.pax_finalized.value || 0;\r\n const not_finalized_count = data.pax_not_finalized.value || 0;\r\n const paxc = (data.pax_count && data.pax_count.value) || 0;\r\n const vax_count = data.is_vaccinated?.value || 0;\r\n const no_vax_count = data.is_not_vaccinated?.value || 0;\r\n const ess = data.essential_pax?.value || 0;\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n \r\nexport default PaxCovidVaxSummary;","import React from 'react';\r\nimport { Card, Row, Col } from 'antd';\r\nimport { Statistic } from 'antd';\r\n\r\nconst PaxCovidVaxDetailedSummary = ({ data }) => {\r\n const perc = (data.personnel_count && data.personnel_count.value) || 0;\r\n const is_vax_count = data.is_vaccinated?.value || 0;\r\n const no_vax_count = data.is_not_vaccinated?.value || 0;\r\n const ess = data.essential_personnel?.value || 0;\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n \r\nexport default PaxCovidVaxDetailedSummary;","import React from 'react';\r\nimport { Card, Row, Col } from 'antd';\r\nimport { Statistic } from 'antd';\r\n\r\nconst PersonHotFuel = ({ data }) => {\r\n const person_count = data.person_count.value || 0;\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n \r\nexport default PersonHotFuel;","import React from 'react';\r\nimport { Card, Row, Col } from 'antd';\r\nimport { Statistic } from 'antd';\r\n\r\nconst PaxIsnEventsSummary = ({ data }) => {\r\n const override_count = data.override_count.value || 0;\r\n const non_green_count = data.non_green_count.value || 0;\r\n const overall_count = (data.overall_count && data.overall_count.value) || 0;\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n \r\nexport default PaxIsnEventsSummary;","import React from 'react';\r\nimport PaxSummary from './Pax';\r\nimport CgoSummary from './Cgo';\r\nimport ManifestSummary from './Manifest';\r\nimport ISNSummary from './ISN';\r\nimport CovidSummary from 'components/reporting/summaries/Covid';\r\nimport PaxCovidVaxSummary from 'components/reporting/summaries/PaxCovidVax';\r\nimport PaxCovidVaxDetailedSummary from 'components/reporting/summaries/PaxCovidVaxDetailed';\r\nimport PersonHotFuelSummary from 'components/reporting/summaries/PersonHotFuel';\r\nimport PaxIsnEventsSummary from 'components/reporting/summaries/PaxIsnEvents';\r\n\r\n\r\nexport const renderSummary = (report_type, summary_data) => {\r\n switch (report_type) {\r\n case 'PAX':\r\n return \r\n case 'CGO':\r\n return \r\n case 'MANIFEST':\r\n return \r\n case 'ISN':\r\n return \r\n case 'COVID':\r\n return \r\n case 'PAX_COVID19_VAX':\r\n return \r\n case 'PERSON_COVID19_VAX_DETAILS':\r\n return \r\n case 'PERSON_HOTFUEL':\r\n return \r\n case 'PAX_ISN_EVENTS':\r\n return \r\n default:\r\n return undefined\r\n }\r\n}","import {useCallback, useEffect, useState} from \"react\";\r\n\r\nexport type SortDirection = 'asc' | 'desc' | undefined;\r\n\r\nexport interface SortableDataOptions {\r\n defaultSortDir?: SortDirection,\r\n sortDir?: SortDirection,\r\n sortBy?: string,\r\n}\r\n\r\nexport default function useSortableData(data: T[], options: SortableDataOptions={}){\r\n const { sortBy, defaultSortDir } = options;\r\n\r\n const [ sortDir, setSortDir ] = useState(defaultSortDir);\r\n const [ sortKey, setSortKey ] = useState(typeof sortBy === 'string' ? sortBy : null);\r\n\r\n useEffect(() => {\r\n setSortKey(key => sortBy || key);\r\n setSortDir(dir => options.sortDir || dir);\r\n }, [ sortBy, options.sortDir ]);\r\n\r\n const sort = useCallback((a: T, b: T) => {\r\n if (!sortDir || !sortKey) return 0;\r\n\r\n const sortDirFactor = sortDir === 'desc' ? 1 : -1;\r\n\r\n const valueA = String(a[sortKey]);\r\n const valueB = String(b[sortKey]);\r\n\r\n return valueA.localeCompare(valueB) > 0 ? -1*sortDirFactor : 1*sortDirFactor;\r\n }, [ data, sortDir, sortBy, sortKey ])\r\n\r\n if (!Array.isArray(data)) return data;\r\n\r\n const returnOptions = {\r\n setSortKey(key: string, dir: SortDirection = sortDir){\r\n setSortKey(key);\r\n setSortDir(dir);\r\n },\r\n setSortDir(dir: SortDirection){\r\n setSortDir(dir);\r\n },\r\n toggleSortDir(){\r\n setSortDir(dir => dir === 'desc' ? 'asc' : 'desc')\r\n },\r\n currentSortKey: sortKey,\r\n currentSortDir: sortDir\r\n }\r\n\r\n return [\r\n data.sort(sort),\r\n returnOptions\r\n ] as [ T[], typeof returnOptions ]\r\n}\r\n","import {ColumnHeaderCell, IColumnHeaderCellProps} from \"@blueprintjs/table\";\r\nimport React from \"react\";\r\nimport {Button, Dropdown, Icon, Menu} from \"antd\";\r\n\r\n\r\nexport interface SortableColumnHeaderCellProps extends IColumnHeaderCellProps {\r\n name: string,\r\n sortKey: string,\r\n onSort: (keyName: string, dir: 'asc' | 'desc') => void,\r\n currentSortedKey: string,\r\n currentSortDir: string\r\n}\r\n\r\nconst SortableColumnHeaderCell: React.FC =\r\n React.forwardRef((props, ref: React.LegacyRef) => {\r\n\r\n const { name, onSort, currentSortedKey, currentSortDir, sortKey, ...restProps } = props;\r\n\r\n const keyIsSelected = currentSortedKey === sortKey;\r\n\r\n function handleClick(dir: 'asc' | 'desc'){\r\n return () => props.onSort(sortKey, dir);\r\n }\r\n\r\n function isActive(dir: 'asc' | 'desc'){\r\n return keyIsSelected && currentSortDir === dir;\r\n }\r\n\r\n const menu = (\r\n \r\n Sort asc\r\n Sort desc\r\n \r\n );\r\n\r\n const headerTextStyle: React.CSSProperties = {\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n minWidth: 0\r\n }\r\n\r\n const headerContent = (\r\n
    \r\n {keyIsSelected ? {name} : {name}}\r\n \r\n \r\n \r\n
    \r\n )\r\n\r\n return headerContent}\r\n\r\n {...restProps}\r\n ref={ref}\r\n />\r\n})\r\n\r\nSortableColumnHeaderCell.displayName = 'SortableColumnHeaderCell'\r\n\r\nexport default SortableColumnHeaderCell;","import {CognitoUserInfo} from \"./cognito-user-info\";\r\n\r\nexport enum NonComplyBypassCategory {\r\n NONE=\"NONE\",\r\n TRAINING=\"TRAINING\",\r\n DRUGANDALCOHOL=\"DRUGANDALCOHOL\",\r\n COMPANYGRADE=\"COMPANYGRADE\"\r\n}\r\n\r\n// Human-readable version of the NonComplyBypassCategory enum\r\nexport enum NonComplyBypassCategoryHuman {\r\n NONE = \"None\",\r\n TRAINING = \"Training\",\r\n DRUGANDALCOHOL = \"Drug and Alcohol\",\r\n COMPANYGRADE = \"Company Grade\"\r\n}\r\n\r\nexport interface NonComplyBypassInput {\r\n expiresOn?: string\r\n reason: string\r\n}\r\n\r\nexport interface NonComplyBypass extends NonComplyBypassInput{\r\n customerID: string\r\n personID: string\r\n timestamp: string\r\n cognitoUser: CognitoUserInfo\r\n nonComplyCategory: NonComplyBypassCategory\r\n}","/*\r\nWritten by Austin Thibodeaux in February 2019\r\nDocumented by Austin Thibodeaux in May 2023\r\n\r\nComponent name: PaxDetail\r\nPurpose: Displays data grid for Passenger report.\r\n*/\r\n\r\nimport React from 'react';\r\nimport {Cell, Column, SelectionModes, Table} from '@blueprintjs/table';\r\nimport {momentOrNull} from \"common/util\";\r\nimport useSortableData from \"hooks/useSortableData\";\r\nimport SortableColumnHeaderCell from \"components/blueprinttable/SortableColumnHeaderCell\";\r\n\r\nconst PaxDetail = (props) => {\r\n\tconst initialData = props.data.map((row) => {\r\n\t\tconst getVal = (obj, field) => obj && obj[field];\r\n\t\t//console.log(row);\r\n\r\n\t\t//console.log( row._id + \" -- \" + row.departure['name'] + \"---->\" + row.destination['name']);\r\n\t\treturn {\r\n\t\t\t...row,\r\n\t\t\tcurrentCarrierName: getVal(row.currentCarrier, 'desig'),\r\n\t\t\t//currentCarrierName: getVal(row.currentCarrier, 'desig'),\r\n\t\t\tdepartureName: getVal(row.departure, 'name'),\r\n\t\t\tdestinationName: getVal(row.destination, 'name'),\r\n\t\t\tcustomerName: getVal(row.customer, 'name'),\r\n\t\t\ttransporterName: getVal(row.transporter, 'name'),\r\n\t\t\temployerName: getVal(row.employer, 'name'),\r\n\t\t\tfinalizationReasonType: row.finalizationReasonType,\r\n\t\t\taircraftTailNum: row.currentCarrier?.aircraftDoc?.tailNum,\r\n\t\t\taircraftModel: row.currentCarrier?.aircraftDoc?.model\r\n\t\t\t//finalized: row.nodeState === 'FINALIZED'\r\n\t\t};\r\n\t});\r\n\r\n\tconst [ data, { setSortKey, currentSortKey, currentSortDir } ] = useSortableData(initialData);\r\n\r\n\tconst columns = [\r\n\t\t['Last Name', \t\t\t'lastName'],\r\n\t\t['First Name', \t\t\t'firstName'],\r\n\t\t['Flight', \t\t\t\t'currentCarrierName'],\r\n\t\t['Departure', \t\t\t'departureName'],\r\n\t\t['Destination', \t\t'destinationName'],\r\n\t\t['Pax Wt', \t\t\t\t'paxWeight'],\r\n\t\t['Bag Wt', \t\t\t\t'bagWeight'],\r\n\t\t['Bad Ct', \t\t\t\t'bagCount'],\r\n\t\t['Transporter', \t\t'transporterName'],\r\n\t\t['Customer', \t\t\t'customerName'],\r\n\t\t['Check-In-Time', \t\t'checkedInTime', (i) => momentOrNull(data[i]?.checkedInTime)?.format('YYYY-MM-DD HH:mm:ss')],\r\n\t\t['Finalization Reason', 'finalizationReasonType'],\r\n\t\t['Tail Num', \t\t\t'aircraftTailNum'],\r\n\t\t['Aircraft Model',\t\t'aircraftModel']\r\n\t]\r\n\t\t.map((col) => {\r\n\t\t\tconst cellRenderer = (i) => {\r\n\t\t\t\tconst value = col.length > 2 ?\r\n\t\t\t\t\tcol[2](i) :\r\n\t\t\t\t\tdata[i]?.[col[1]]\r\n\t\t\t\treturn {value}\r\n\t\t\t}\r\n\t\t\treturn (\r\n\t\t\t\t (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t}\r\n\t\t\t\t/>\r\n\t\t\t)\r\n\t\t})\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{columns}\r\n\t\t\r\n\t);\r\n};\r\n\r\n// const PaxDetail = ({ data }) => {\r\n// return (\r\n// flight && flight.desig,\r\n// width: 100\r\n// },\r\n// {\r\n// title: 'Base',\r\n// key: 'base',\r\n// dataIndex: 'departure',\r\n// render: dep => dep && dep.name,\r\n// width: 200\r\n// },\r\n// {\r\n// title: 'Passenger Name',\r\n// key: 'passengerName',\r\n// render: (_, record) => {\r\n// const { firstName, lastName } = record;\r\n// return `${lastName}, ${firstName}`\r\n// },\r\n// width: 200\r\n// },\r\n// {\r\n// title: 'Pax Weight',\r\n// key: 'paxWeight',\r\n// dataIndex: 'paxWeight',\r\n// width: 100\r\n// },\r\n// {\r\n// title: 'Bag Weight',\r\n// key: 'bagWeight',\r\n// dataIndex: 'bagWeight',\r\n// width: 100\r\n// },\r\n// {\r\n// title: 'Bag Count',\r\n// key: 'bagCount',\r\n// dataIndex: 'bagCount',\r\n// width: 100\r\n// },\r\n// {\r\n// title: 'Check-In-Time',\r\n// key: 'checkInTime',\r\n// dataIndex: 'checkedInTime',\r\n// render: time => time && moment(time).format('YYYY-MM-DD hh:mm:ss'),\r\n// width: 200\r\n// },\r\n// {\r\n// title: 'Employer',\r\n// key: 'employer',\r\n// dataIndex: 'employer',\r\n// render: emp => emp && emp.name,\r\n// width: 200\r\n// },\r\n// {\r\n// title: 'Destination',\r\n// key: 'destination',\r\n// dataIndex: 'destination',\r\n// render: dest => dest && dest.name,\r\n// width: 200\r\n// },\r\n// {\r\n// title: 'Customer',\r\n// key: 'customer',\r\n// dataIndex: 'customer',\r\n// render: cust => cust && cust.name,\r\n// width: 200\r\n// },\r\n// {\r\n// title: 'Finalized',\r\n// key: 'finalized',\r\n// dataIndex: 'nodeState',\r\n// render: final => YesNo(final === 'FINALIZED'),\r\n// width: 100\r\n// }\r\n// ]}\r\n// size=\"small\"\r\n// pagination={false}\r\n// rowKey={record => record._id}\r\n// />\r\n// )\r\n// }\r\n\r\n// const PaxDetail = ({ data }) => {\r\n// const tableRef = useRef(null);\r\n// return (\r\n// \r\n// \r\n// \r\n// \r\n// \r\n// {\r\n// return moment(cell.getValue()).format('YYYY-MM-DD hh:mm:ss')\r\n// }\r\n// },\r\n// {\r\n// title: 'State',\r\n// field: 'nodeState',\r\n// headerFilter: 'select',\r\n// headerFilterParams: {\r\n// values: true\r\n// }\r\n// }\r\n// ]}\r\n// />\r\n// \r\n// \r\n// )\r\n// }\r\n\r\nexport default PaxDetail","import React from \"react\";\r\nimport { momentOrNull } from \"../../../common/util\";\r\nimport { Cell, Column, SelectionModes, Table } from \"@blueprintjs/table\";\r\nimport useSortableData from \"hooks/useSortableData\";\r\nimport SortableColumnHeaderCell from \"components/blueprinttable/SortableColumnHeaderCell\";\r\n\r\nconst CgoDetail = (props) => {\r\n const initialData = props.data.map((row) => {\r\n const getVal = (obj, field) => obj && obj[field];\r\n //console.log(row.groundPickup);\r\n //console.log(row);\r\n return {\r\n ...row,\r\n currentCarrierName: getVal(row.currentCarrier, \"desig\")\r\n ? getVal(row.currentCarrier, \"desig\")\r\n : row.groundPickup\r\n ? \"Ground Pickup\"\r\n : \" \",\r\n departureName: getVal(row.departure, \"name\"),\r\n destinationName: getVal(row.destination, \"name\"),\r\n customerName: getVal(row.customer, \"name\"),\r\n transporterName: getVal(row.transporter, \"name\"),\r\n finalized: row.nodeState === \"FINALIZED\",\r\n };\r\n });\r\n\r\n const [data, { setSortKey, currentSortKey, currentSortDir }] =\r\n useSortableData(initialData);\r\n\r\n const columns = [\r\n [\"Name\", \"name\"],\r\n [\"Flight\", \"currentCarrierName\"],\r\n [\"Departure\", \"departureName\"],\r\n [\"Destination\", \"destinationName\"],\r\n [\"Weight\", \"weight\"],\r\n [\"Transporter\", \"transporterName\"],\r\n [\"Customer\", \"customerName\"],\r\n [\r\n \"Check-In-Time\",\r\n \"checkedInTime\",\r\n (i) => (\r\n momentOrNull(data[i]?.checkedInTime)?.format(\"YYYY-MM-DD HH:mm:ss\")\r\n ),\r\n ],\r\n [\"Initials\", \"initials\"],\r\n [\"Finalized\", \"nodeState\"],\r\n [\"Last Modified\", \"modifiedTs\"],\r\n [\"Delivered By\", \"deliveredBy\"]\r\n ].map((col) => {\r\n const cellRenderer = (i) => {\r\n const value =\r\n col.length > 2 ? col[2](i) : data[i]?.[col[1]];\r\n return (\r\n \r\n {value}\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 return (\r\n \r\n {columns}\r\n \r\n );\r\n};\r\n\r\n// const CgoDetail = ({ data }) => {\r\n// const tableRef = useRef(null);\r\n// return (\r\n// \r\n// \r\n// \r\n// \r\n// \r\n// {\r\n// return moment(cell.getValue()).format('YYYY-MM-DD hh:mm:ss')\r\n// }\r\n// },\r\n// {\r\n// title: 'State',\r\n// field: 'nodeState',\r\n// headerFilter: 'select',\r\n// headerFilterParams: {\r\n// values: true\r\n// }\r\n// }\r\n// ]}\r\n// />\r\n// \r\n// \r\n// )\r\n// }\r\n\r\nexport default CgoDetail","import React, { useState } from \"react\";\r\nimport { momentOrNull, YesNo } from \"../../../common/util\";\r\nimport { Button, Icon } from \"antd\";\r\nimport PaxDetail from \"./Pax\";\r\nimport CgoDetail from \"./Cgo\";\r\nimport { Cell, Column, SelectionModes, Table } from \"@blueprintjs/table\";\r\nimport SortableColumnHeaderCell from \"components/blueprinttable/SortableColumnHeaderCell\";\r\nimport useSortableData from \"hooks/useSortableData\";\r\n\r\nconst CarriableCount = ({ count, onClicked }) => {\r\n const text = `${count} item(s)`;\r\n if (!count) {\r\n return text;\r\n }\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst ManifestDetail = (props) => {\r\n const [selFlight, setSelFlight] = useState(null);\r\n const [carriableType, setCarriableType] = useState('pax');\r\n\r\n const mappedData = props.data.map((row) => {\r\n const getVal = (obj, field) => obj && obj[field];\r\n const legs = (row.legs && Object.values(row.legs)) || [];\r\n const haslegs = legs.length ? true : false;\r\n const firstleg = haslegs ? legs[0] : null;\r\n const departure = (firstleg && firstleg.departure) || (row.departure && row.departure.name) || null;\r\n const destinations = (haslegs && legs.map((leg) => leg.destination).join(', ')) || null;\r\n return {\r\n ...row,\r\n departure,\r\n destinations,\r\n tailNum: getVal(row.aircraft, 'tailNum'),\r\n customerName: getVal(row.customer, 'name'),\r\n transporterName: getVal(row.transporter, 'name'),\r\n finalized: row.nodeState === 'FINALIZED',\r\n };\r\n });\r\n\r\n const [ data, { setSortKey, currentSortKey, currentSortDir } ] = useSortableData(mappedData);\r\n\r\n const setSelectedFlight = (selFlight, carriableType = carriableType) => {\r\n setSelFlight(selFlight);\r\n setCarriableType(carriableType);\r\n };\r\n\r\n const getSelectedFlight = () => {\r\n if (!selFlight || !data) return undefined;\r\n return data.find((flight) => flight._id === selFlight);\r\n };\r\n\r\n const columns = [\r\n {\r\n name: 'Flight Designation',\r\n key: 'desig',\r\n },\r\n {\r\n name: 'Departure',\r\n key: 'departure',\r\n },\r\n {\r\n name: 'Destinations',\r\n key: 'destinations',\r\n },\r\n {\r\n name: 'Transporter',\r\n key: 'transporterName',\r\n },\r\n {\r\n name: 'Customer',\r\n key: 'customerName',\r\n },\r\n {\r\n name: 'Aircraft Tail Num',\r\n key: 'tailNum',\r\n },\r\n {\r\n name: 'Scheduled Flight Date',\r\n key: 'scheduledFlightDate',\r\n formatter: (value) => momentOrNull(value)?.format('YYYY-MM-DD'),\r\n },\r\n {\r\n name: 'Finalized',\r\n key: 'state',\r\n formatter: (value) => YesNo(value === 'FINALIZED' || value === 'RETIRED'),\r\n },\r\n {\r\n name: 'PAX Count',\r\n key: 'paxList',\r\n formatter: (value, row) => (\r\n setSelectedFlight(row._id, 'pax' )}\r\n />\r\n ),\r\n },\r\n {\r\n name: 'CGO Count',\r\n key: 'cgoList',\r\n formatter: (value, row) => (\r\n setSelectedFlight(row._id, 'cgo' )}\r\n />\r\n ),\r\n },\r\n {\r\n name: 'Export',\r\n Key: 'export',\r\n formatter: (_, row) => (\r\n renderExportButtons(row)\r\n )\r\n }\r\n ]\r\n .map((col) => {\r\n const cellRenderer = (i) => {\r\n const value = col.formatter ?\r\n col.formatter(data[i]?.[col.key], data[i]) :\r\n data[i]?.[col.key]\r\n return {value}\r\n }\r\n return (\r\n (\r\n \r\n )\r\n }\r\n />\r\n )\r\n })\r\n\r\n const [ rowHeights, setRowHeights ] = useState(new Array(data?.length).fill(30));\r\n\r\n const renderFlightsGrid = () => {\r\n if (!data) return null;\r\n return (\r\n (\r\n setRowHeights(curr => [...curr.slice(0, i), size, ...curr.slice(i+1, rowHeights.length)])\r\n )}\r\n >\r\n {columns}\r\n \r\n );\r\n };\r\n\r\n const renderExportButtons = (row) => {\r\n return (\r\n \r\n );\r\n };\r\n\r\n const renderChildGrids = () => {\r\n switch (carriableType) {\r\n case 'pax':\r\n return ;\r\n case 'cgo':\r\n return ;\r\n default:\r\n break;\r\n }\r\n };\r\n\r\n const selectedFlight = getSelectedFlight();\r\n\r\n return (\r\n
    \r\n {selectedFlight ? (\r\n
    \r\n
    \r\n ) : null}\r\n
    \r\n {selectedFlight ? renderChildGrids() : renderFlightsGrid()}\r\n
    \r\n
    \r\n );\r\n};\r\n\r\nexport default ManifestDetail;","import { Tag } from \"antd\";\r\nimport moment from \"moment\";\r\nimport React, { useState } from \"react\";\r\nimport useSortableData from \"hooks/useSortableData\";\r\nimport { Cell, Column, SelectionModes, Table } from \"@blueprintjs/table\";\r\nimport SortableColumnHeaderCell from \"components/blueprinttable/SortableColumnHeaderCell\";\r\n\r\nconst getIsnSelectedResult = (pax) => {\r\n const isnResult = pax.lastIsnResultWithHeader;\r\n if (isnResult) {\r\n var selectedResult = isnResult.selectedResult;\r\n const qc_result = isnResult.qc_result || [];\r\n\r\n if (qc_result.length === 1 && !selectedResult) {\r\n selectedResult = qc_result[0];\r\n }\r\n return selectedResult;\r\n }\r\n};\r\n\r\nconst getIsnStatus = (pax) => {\r\n const isnResult = pax.lastIsnResultWithHeader;\r\n const authorization = pax.authorization;\r\n if (authorization){\r\n const brdIsn = authorization && authorization.brdRestriction_Isn;\r\n const isnStatus = brdIsn && brdIsn.status;\r\n const isOverridden = isnStatus === 'OVERRIDDEN';\r\n if (isOverridden){\r\n return 'OVERRIDDEN'\r\n }\r\n }\r\n if (isnResult){\r\n const selectedResult = getIsnSelectedResult(pax);\r\n const qc_result = isnResult.qc_result || [];\r\n\r\n const qcs = selectedResult && ('' + selectedResult.quickCheckStatus).toUpperCase();\r\n\r\n\r\n if (selectedResult?.reason === 'WHITELISTED'){\r\n return 'WHITELISTED';\r\n }\r\n\r\n if (!selectedResult && qc_result > 0){\r\n return 'MULTIPLE RESULTS'\r\n }\r\n if (!selectedResult && qc_result.length <= 0){\r\n return 'NO ISN RESULT'\r\n }\r\n return qcs\r\n }\r\n else\r\n {\r\n return 'NO ISN RESULT'\r\n }\r\n}\r\n\r\nconst getISNRestriction = (pax) => {\r\n const authorization = pax.authorization;\r\n return authorization && authorization.brdRestriction_Isn;\r\n}\r\n\r\nconst getOverrideUser = (pax) => {\r\n const brdIsn = getISNRestriction(pax);\r\n const isnStatus = brdIsn && brdIsn.status;\r\n const overriddenBy = brdIsn && (brdIsn.modifiedBy || brdIsn.createdBy);\r\n const isOverridden = isnStatus === 'OVERRIDDEN';\r\n if (isOverridden){\r\n return overriddenBy ? overriddenBy : 'Local user';\r\n }\r\n}\r\n\r\nconst ISNDetail = (props) => {\r\n var hasTrainingDeficiencies = false;\r\n var hasReasonsForNonCompliance = false;\r\n var hasISNOverrideNotes = false;\r\n var hasIsnOverriderReason = false;\r\n const initialData = props.data.map(row => {\r\n const getVal = (obj, field) => obj && obj[field];\r\n const trainingDeficiencies = getIsnSelectedResult(row) && getIsnSelectedResult(row).trainingDeficiencies;\r\n const reasonsForNonCompliance = getIsnSelectedResult(row) && getIsnSelectedResult(row).reasonsForNonCompliance\r\n const isnRestriction = getISNRestriction(row);\r\n if (trainingDeficiencies){\r\n hasTrainingDeficiencies = true;\r\n }\r\n if (reasonsForNonCompliance){\r\n hasReasonsForNonCompliance = true;\r\n }\r\n if (isnRestriction && isnRestriction.notes){\r\n hasISNOverrideNotes = true;\r\n }\r\n\r\n if (isnRestriction && isnRestriction.overriderReason){\r\n hasIsnOverriderReason = true;\r\n }\r\n\r\n return {\r\n ...row,\r\n currentCarrierName: getVal(row.currentCarrier, 'desig'),\r\n departureName: getVal(row.departure, 'name'),\r\n destinationName: getVal(row.destination, 'name'),\r\n customerName: getVal(row.customer, 'name'),\r\n transporterName: getVal(row.transporter, 'name'),\r\n employerName: getVal(row.employer, 'name'),\r\n finalized: row.nodeState === 'FINALIZED',\r\n isnStatus: getIsnStatus(row),\r\n overriddenBy: getOverrideUser(row),\r\n overrideNotes: isnRestriction && isnRestriction.notes,\r\n overriderReason: isnRestriction?.overriderReason,\r\n reasonsForNonCompliance,\r\n trainingDeficiencies,\r\n isnId: getIsnSelectedResult(row)?.isnId,\r\n assignedActivities: getIsnSelectedResult(row)?.assignedActivities\r\n }\r\n })\r\n\r\n const [ data, { setSortKey, currentSortKey, currentSortDir } ] = useSortableData(initialData);\r\n\r\n const columns = [\r\n {\r\n name: 'Last Name',\r\n key: 'lastName'\r\n },\r\n {\r\n name: 'First Name',\r\n key: 'firstName'\r\n },\r\n {\r\n name: 'Check-In-Time',\r\n key: 'checkedInTime',\r\n formatter: (value) => moment(value).format('YYYY-MM-DD HH:mm:ss')\r\n },\r\n {\r\n name: 'Departure',\r\n key: 'departureName'\r\n },\r\n {\r\n name: 'Destination',\r\n key: 'destinationName'\r\n },\r\n {\r\n name: 'Transporter',\r\n key: 'transporterName'\r\n },\r\n {\r\n name: 'Customer',\r\n key: 'customerName'\r\n },\r\n {\r\n name: 'Employer',\r\n key: 'employerName'\r\n },\r\n {\r\n name: 'ISN Status',\r\n key: 'isnStatus',\r\n formatter: (value) => {\r\n const colorMap = {\r\n 'GREEN': 'green',\r\n 'RED': 'red',\r\n 'MULTI': 'purple',\r\n 'OVERRIDDEN': 'blue'\r\n }\r\n return (\r\n {value}\r\n )\r\n }\r\n },\r\n {\r\n name: 'ISN ID',\r\n key: 'isnId'\r\n },\r\n hasTrainingDeficiencies ? ({\r\n name: 'Training Deficiencies',\r\n key: 'trainingDeficiencies'\r\n }) : null,\r\n hasReasonsForNonCompliance ? ({\r\n name: 'Reasons For Non Compliance',\r\n key: 'reasonsForNonCompliance'\r\n }) : null,\r\n {\r\n name: 'Overriden By',\r\n key: 'overriddenBy'\r\n },\r\n hasISNOverrideNotes ? ({\r\n name: 'Override Notes',\r\n key: 'overrideNotes'\r\n }) : null,\r\n hasIsnOverriderReason ? ({\r\n name: 'Overrider Reason',\r\n key: 'overriderReason'\r\n }) : null,\r\n {\r\n name: 'Assigned Activities',\r\n key: 'assignedActivities'\r\n }\r\n ]\r\n .filter(col => col)\r\n .map((col) => {\r\n const cellRenderer = (i) => {\r\n const value = col.formatter ?\r\n col.formatter(data[i]?.[col.key]) :\r\n data[i]?.[col.key]\r\n return {value}\r\n }\r\n return (\r\n (\r\n \r\n )\r\n }\r\n />\r\n )\r\n })\r\n\r\n const [ rowHeights, setRowHeights ] = useState(new Array(data?.length).fill(30));\r\n\r\n return (\r\n (\r\n setRowHeights(curr => [...curr.slice(0, i), size, ...curr.slice(i+1, rowHeights.length)])\r\n )}\r\n >\r\n {columns}\r\n \r\n );\r\n}\r\n\r\nexport default ISNDetail","import React from \"react\";\r\nimport { Cell, Column, SelectionModes, Table } from \"@blueprintjs/table\";\r\nimport SortableColumnHeaderCell from \"components/blueprinttable/SortableColumnHeaderCell\";\r\nimport useSortableData from \"hooks/useSortableData\";\r\nimport { momentOrNull } from \"common/util\";\r\n\r\nconst CovidDetail = (props) => {\r\n console.log(props.data);\r\n const initialData = props.data.map((row) => {\r\n const getVal = (obj, field) => obj && obj[field];\r\n return {\r\n ...row,\r\n currentCarrierName: getVal(row.currentCarrier, \"desig\"),\r\n departureName: getVal(row.departure, \"name\"),\r\n destinationName: getVal(row.destination, \"name\"),\r\n customerName: getVal(row.customer, \"name\"),\r\n transporterName: getVal(row.transporter, \"name\"),\r\n employerName: getVal(row.employer, \"name\"),\r\n finalizationReasonType: row.finalizationReasonType,\r\n };\r\n });\r\n\r\n const [data, { setSortKey, currentSortKey, currentSortDir }] =\r\n useSortableData(initialData);\r\n\r\n const columns = [\r\n {\r\n name: \"Check-In-Time\",\r\n key: \"checkedInTime\",\r\n formatter: (value) => momentOrNull(value)?.format(\"YYYY-MM-DD HH:mm:ss\"),\r\n },\r\n {\r\n name: \"Last Name\",\r\n key: \"lastName\",\r\n },\r\n {\r\n name: \"First Name\",\r\n key: \"firstName\",\r\n },\r\n {\r\n name: \"Customer\",\r\n key: \"customerName\",\r\n },\r\n {\r\n name: \"Employer\",\r\n key: \"employerName\",\r\n },\r\n {\r\n name: \"Departure\",\r\n key: \"departureName\",\r\n },\r\n {\r\n name: \"Destination\",\r\n key: \"destinationName\",\r\n },\r\n {\r\n name: \"Symptoms\",\r\n key: \"covid_hasFluSymptoms\",\r\n formatter: (value) => (value ? \"Yes\" : \"No\"),\r\n },\r\n {\r\n name: \"Has High Temp\",\r\n key: \"covid_selfReportedHighBodyTemperature\",\r\n formatter: (value) => (value ? \"Yes\" : \"No\"),\r\n },\r\n {\r\n name: \"Exposed to Covid\",\r\n key: \"covid_ExposedToVirus\",\r\n formatter: (value) => (value ? \"Yes\" : \"No\"),\r\n },\r\n {\r\n name: \"Vaccinated\",\r\n key: \"covid_hasBeenVaccinated\",\r\n formatter: (value) => (value ? \"Yes\" : \"No\"),\r\n },\r\n ].map((col) => {\r\n const cellRenderer = (i) => {\r\n const value = col.formatter\r\n ? col.formatter(data[i]?.[col.key])\r\n : data[i]?.[col.key];\r\n return (\r\n \r\n {value}\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 return (\r\n \r\n {columns}\r\n \r\n );\r\n};\r\n\r\nexport default CovidDetail","import React from \"react\";\r\nimport { Cell, Column, SelectionModes, Table } from \"@blueprintjs/table\";\r\nimport SortableColumnHeaderCell from \"components/blueprinttable/SortableColumnHeaderCell\";\r\nimport useSortableData from \"hooks/useSortableData\";\r\n\r\nconst CovidVaccineDetail = (props) => {\r\n const initialData = props.data.map((row) => {\r\n const getVal = (obj, field) => obj && obj[field];\r\n return {\r\n ...row,\r\n customerName: getVal(row.customer, \"name\"),\r\n employerName: getVal(row.employer, \"name\"),\r\n };\r\n });\r\n\r\n const [data, { setSortKey, currentSortKey, currentSortDir }] =\r\n useSortableData(initialData);\r\n\r\n const columns = [\r\n {\r\n name: \"Last Name\",\r\n key: \"lastName\",\r\n },\r\n {\r\n name: \"First Name\",\r\n key: \"firstName\",\r\n },\r\n {\r\n name: \"Is Vaccinated\",\r\n key: \"isVaccinated\",\r\n formatter: (value) => {\r\n const colorMap = {\r\n true: \"green\",\r\n false: \"red\",\r\n };\r\n let v = value ? \"Yes\" : \"No\";\r\n return (\r\n {v}\r\n );\r\n },\r\n },\r\n {\r\n name: \"Customer\",\r\n key: \"customerName\",\r\n },\r\n {\r\n name: \"Employer\",\r\n key: \"employerName\",\r\n },\r\n {\r\n name: \"Essential On\",\r\n key: \"essentialOn\",\r\n },\r\n ].map((col) => {\r\n const cellRenderer = (i) => {\r\n const value = col.formatter\r\n ? col.formatter(data[i]?.[col.key])\r\n : data[i]?.[col.key];\r\n return (\r\n \r\n {value}\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 return (\r\n \r\n {columns}\r\n \r\n );\r\n};\r\n\r\nexport default CovidVaccineDetail","import React from \"react\";\r\nimport useSortableData from \"hooks/useSortableData\";\r\nimport { Cell, Column, SelectionModes, Table } from \"@blueprintjs/table\";\r\nimport SortableColumnHeaderCell from \"components/blueprinttable/SortableColumnHeaderCell\";\r\n\r\nconst CovidVaccineDetailedDetail = (props) => {\r\n const initialData = props.data;\r\n\r\n const [data, { setSortKey, currentSortKey, currentSortDir }] =\r\n useSortableData(initialData);\r\n\r\n const columns = [\r\n {\r\n name: \"Last Name\",\r\n key: \"lastName\",\r\n },\r\n {\r\n name: \"First Name\",\r\n key: \"firstName\",\r\n },\r\n {\r\n name: \"DOB\",\r\n key: \"dob\",\r\n },\r\n {\r\n name: \"Employer\",\r\n key: \"employerName\",\r\n },\r\n {\r\n name: \"Shot Manufacturer\",\r\n key: \"shotManufacturer\",\r\n },\r\n {\r\n name: \"Shot 1\",\r\n key: \"shot_1\",\r\n },\r\n {\r\n name: \"Shot 2\",\r\n key: \"shot_2\",\r\n },\r\n {\r\n name: \"Vaccinated on\",\r\n key: \"vaccinated_on\",\r\n },\r\n {\r\n name: \"POS Test\",\r\n key: \"pos_test\",\r\n },\r\n {\r\n name: \"RTW\",\r\n key: \"rtw\",\r\n },\r\n {\r\n name: \"RTW 2\",\r\n key: \"rtw_2\",\r\n },\r\n {\r\n name: \"Essential On\",\r\n key: \"essentialOn\",\r\n },\r\n ].map((col) => {\r\n const cellRenderer = (i) => {\r\n const value = col.formatter\r\n ? col.formatter(data[i]?.[col.key])\r\n : data[i]?.[col.key];\r\n return (\r\n \r\n {value}\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 return (\r\n \r\n {columns}\r\n \r\n );\r\n};\r\n\r\nexport default CovidVaccineDetailedDetail","import React from \"react\";\r\nimport { Cell, Column, SelectionModes, Table } from \"@blueprintjs/table\";\r\nimport useSortableData from \"hooks/useSortableData\";\r\nimport SortableColumnHeaderCell from \"components/blueprinttable/SortableColumnHeaderCell\";\r\n\r\nconst PersonHotFuelDetail = (props) => {\r\n const [data, { setSortKey, currentSortKey, currentSortDir }] =\r\n useSortableData(props.data);\r\n\r\n const columns = [\r\n {\r\n name: \"Last Name\",\r\n key: \"lastName\",\r\n },\r\n {\r\n name: \"First Name\",\r\n key: \"firstName\",\r\n },\r\n {\r\n name: \"Customer\",\r\n key: \"customerName\",\r\n },\r\n {\r\n name: \"Employer\",\r\n key: \"employerName\",\r\n },\r\n {\r\n name: \"HotFuel Expiration Date\",\r\n key: \"hotfuelExpirationDate\",\r\n },\r\n ].map((col) => {\r\n const cellRenderer = (i) => {\r\n const value = data[i]?.[col.key];\r\n return (\r\n \r\n {value}\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 return (\r\n \r\n {columns}\r\n \r\n );\r\n};\r\n\r\nexport default PersonHotFuelDetail","import React from \"react\";\r\nimport useSortableData from \"hooks/useSortableData\";\r\nimport { useColWidths } from \"common/table\";\r\nimport { Cell, Column, SelectionModes, Table } from \"@blueprintjs/table\";\r\nimport SortableColumnHeaderCell from \"components/blueprinttable/SortableColumnHeaderCell\";\r\n\r\nconst PaxIsnEventsDetail = (props) => {\r\n const initialData = props.data.map((row) => {\r\n const getVal = (obj, field) => obj && obj[field];\r\n //console.log(row);\r\n\r\n //console.log( row._id + \" -- \" + row.departure['name'] + \"---->\" + row.destination['name']);\r\n return {\r\n ...row,\r\n currentCarrierName: getVal(row.currentCarrier, \"desig\"),\r\n //currentCarrierName: getVal(row.currentCarrier, 'desig'),\r\n departureName: getVal(row.departure, \"name\"),\r\n destinationName: getVal(row.destination, \"name\"),\r\n customerName: getVal(row.customer, \"name\"),\r\n transporterName: getVal(row.transporter, \"name\"),\r\n employerName: getVal(row.employer, \"name\"),\r\n finalizationReasonType: row.finalizationReasonType,\r\n //finalized: row.nodeState === 'FINALIZED'\r\n };\r\n });\r\n\r\n const [data, { setSortKey, currentSortKey, currentSortDir }] =\r\n useSortableData(initialData);\r\n\r\n const columns = [\r\n \"Event Timestamp\",\r\n \"Event Type\",\r\n \"Pax Name\",\r\n \"Pax ID\",\r\n \"Destination\",\r\n \"Customer\",\r\n \"Employer\",\r\n \"Scheduled Flight Date\",\r\n \"ISN Status\",\r\n \"ISN Reason\",\r\n \"ISN Company\",\r\n \"ISN ID\",\r\n \"Override Type\",\r\n \"Override Time\",\r\n \"Override Title\",\r\n \"Override Reason\",\r\n \"Training or Whitelist\",\r\n \"Overrider Name\",\r\n \"Approver Name\",\r\n \"Override Notes\",\r\n \"Deleted Ts\",\r\n \"Created Ts\",\r\n \"Created By\",\r\n \"Modified Ts\",\r\n \"Modified By\",\r\n ].map((col) => {\r\n const cellRenderer = (i) => {\r\n const value = data[i]?.[col];\r\n return (\r\n \r\n {value}\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 const [colWidths, , updateColWidth] = useColWidths(columns.length, {\r\n 0: 180,\r\n 1: 215,\r\n 2: 167,\r\n 7: 167,\r\n 11: 160,\r\n 13: 175,\r\n 16: 162,\r\n });\r\n\r\n return (\r\n \r\n {columns}\r\n \r\n );\r\n};\r\n\r\nexport default PaxIsnEventsDetail","import React from 'react';\r\nimport PaxDetail from './Pax';\r\nimport CgoDetail from './Cgo';\r\nimport ManifestDetail from './Manifest';\r\nimport ISNDetail from './ISN';\r\nimport CovidDetail from './Covid';\r\nimport { Empty } from 'antd';\r\nimport CovidVaccineDetail from 'components/reporting/detail/CovidVaccine';\r\nimport CovidVaccineDetailedDetail from 'components/reporting/detail/CovidVaccineDetailed';\r\nimport PersonHotFuelDetail from 'components/reporting/detail/PersonHotFuel';\r\nimport PaxIsnEventsDetail from 'components/reporting/detail/PaxIsnEvents';\r\n\r\n/**\r\n * Renders report details components depending on the report type specified. Also renders number of records.\r\n * @param {string} report_type\r\n * @param {import('common/types/report-types').Report} report\r\n * @param {(flightId: string, flightDesig: string)} onManifestExportClick\r\n * @returns {ReactNode}\r\n */\r\nexport const renderDetail = (report_type, report, onManifestExportClick) => {\r\n\tif (!report || !report.result || !report.result.docs || !report.result.docs.length) {\r\n\t\treturn (\r\n\t\t\t
    \r\n\t\t\t\t\r\n\t\t\t
    \r\n\t\t);\r\n\t}\r\n\tconst data = report.result.docs;\r\n\r\n\tconst renderDetailByType = () => {\r\n\t\tswitch (report_type) {\r\n\t\t\tcase 'PAX':\r\n\t\t\t\treturn ;\r\n\t\t\tcase 'CGO':\r\n\t\t\t\treturn ;\r\n\t\t\tcase 'MANIFEST':\r\n\t\t\t\treturn ;\r\n\t\t\tcase 'ISN':\r\n\t\t\t\treturn ;\r\n\t\t\tcase 'COVID':\r\n\t\t\t\treturn ;\r\n\t\t\tcase 'PAX_COVID19_VAX':\r\n\t\t\t\treturn ;\r\n\t\t\tcase 'PERSON_COVID19_VAX_DETAILS':\r\n\t\t\t\treturn ;\r\n\t\t\tcase 'PERSON_HOTFUEL':\r\n\t\t\t\treturn ;\r\n\t\t\tcase 'PAX_ISN_EVENTS':\r\n\t\t\t\treturn ;\r\n\t\t\tdefault:\r\n\t\t\t\treturn undefined;\r\n\t\t}\r\n\t};\r\n\r\n\treturn (\r\n\t\t
    \r\n\t\t\t
    \r\n\t\t\t\t{renderDetailByType()}\r\n\t\t\t
    \r\n\t\t
    \r\n\t);\r\n};\r\n","import { Empty, Layout, Tabs, Alert, Typography } from 'antd';\r\nimport PropTypes from 'prop-types';\r\nimport React, { Component } from 'react';\r\nimport { ReportForm, ReportFormSubmitter } from '../ReportForm';\r\nimport { ReportListWithData } from '../ReportList';\r\nimport { getReportForm, getFieldFormmatter } from '../ReportForms';\r\nimport { ReportDetailsWithData } from '../ReportDetails';\r\nimport { renderSummary } from '../summaries';\r\nimport { renderDetail } from '../detail';\r\nimport { renderExport } from '../export';\r\nimport './ReportingInterface.less';\r\n\r\nclass ReportingInterface extends Component {\r\n state = {\r\n selectedReport: {\r\n id: null,\r\n name: null\r\n },\r\n activeTab: 'new'\r\n }\r\n static propTypes = {\r\n title: PropTypes.any,\r\n type: PropTypes.oneOf(['MANIFEST', 'PAX', 'CGO', 'COVID', 'PAX_COVID19_VAX', 'PERSON_COVID19_VAX_DETAILS'])\r\n } \r\n getActiveTab = () => {\r\n if (this.props.activeTab){\r\n return this.props.activeTab\r\n }\r\n return this.state.activeTab\r\n }\r\n\r\n setActiveTab = (activeTab) => {\r\n this.setState({ activeTab });\r\n if (this.props.onTabChange)\r\n this.props.onTabChange(activeTab);\r\n }\r\n\r\n getSelectedReport = () => {\r\n if (this.props.selectedReport){\r\n return this.props.selectedReport\r\n }\r\n return this.state.selectedReport\r\n }\r\n\r\n setSelectedReport = (id, name) => {\r\n this.setState({ selectedReport: { id, name } });\r\n if (this.props.onSelectedReportChange){\r\n this.props.onSelectedReportChange(id, name);\r\n }\r\n }\r\n\r\n render() {\r\n const { title, type, description, onManifestExportClick} = this.props;\r\n return (\r\n \r\n {!this.state.selectedReport.id ? (\r\n \r\n \r\n

    {title || 'Report'}

    \r\n {description ? (\r\n \r\n {description}\r\n \r\n ) : null}\r\n
    \r\n \r\n \r\n \r\n {\r\n this.setSelectedReport(id, name);\r\n }}\r\n >\r\n {(submitReport, { loading, error }) => (\r\n
    \r\n {error ? : null}\r\n \r\n
    \r\n )}\r\n \r\n
    \r\n \r\n \r\n }\r\n />\r\n \r\n \r\n
    \r\n
    \r\n ) : (\r\n this.setState({ selectedReport: null, selectedReportName: null })}\r\n id={this.state.selectedReport.id}\r\n style={{ height: '100%'}}\r\n renderSummary={(data) => data && renderSummary(type, data)}\r\n renderDetail={(data) => data && renderDetail(type, data, onManifestExportClick)}\r\n renderExport={(reportId) => reportId && renderExport(type, reportId)}\r\n />\r\n )}\r\n
    \r\n )\r\n }\r\n}\r\n\r\nexport default ReportingInterface","import React, { Component } from 'react';\r\nimport { Card, Row, Col, Tooltip } from 'antd';\r\nimport { RadialChart, DiscreteColorLegend, Hint } from 'react-vis';\r\nimport PropTypes from 'prop-types';\r\nimport './style.less';\r\n\r\nclass ChartItem extends Component {\r\n state = {\r\n value: false\r\n }\r\n render(){\r\n const { colors, showHint=false, ...rest } = this.props;\r\n const { value } = this.state;\r\n const getPercentage = (color) => {\r\n if (colors[color] === 0){\r\n return ''\r\n }\r\n const total = Number(colors.green) + Number(colors.red) + Number(colors.yellow);\r\n return `${((colors[color] / total) * 100).toFixed(2)}%`;\r\n }\r\n return (\r\n {\r\n this.setState({value: v})\r\n }}\r\n onSeriesMouseOut={v => this.setState({value: false})}\r\n data={[\r\n {\r\n angle: colors.green || 0,\r\n paxCount: colors.green || 0,\r\n label: getPercentage('green'),\r\n subLabel: colors.green ? 'Success' : null,\r\n color: '#009933',\r\n key: 'green'\r\n },\r\n {\r\n angle: colors.red || 0,\r\n paxCount: colors.red || 0,\r\n label: getPercentage('red'),\r\n subLabel: colors.red ? 'Failed' : null,\r\n color: '#cc0000',\r\n key: 'red'\r\n },\r\n {\r\n angle: colors.yellow || 0,\r\n paxCount: colors.yellow || 0,\r\n label: getPercentage('yellow'),\r\n subLabel: colors.yellow ? 'No Status' : null,\r\n color: '#ffcc00',\r\n key: 'yellow'\r\n }\r\n ]}\r\n {...rest}\r\n >\r\n {value !== false && showHint === true && (\r\n \r\n
    \r\n

    {value.label}

    \r\n
    {value.subLabel}
    \r\n
    {value.paxCount} PAX
    \r\n
    \r\n
    \r\n )}\r\n \r\n )\r\n }\r\n}\r\n\r\nclass ISNChartSelector extends Component {\r\n state = {\r\n selected: 'total'\r\n }\r\n componentDidUpdate(prevProps, prevState){\r\n const selected = this.getSelected();\r\n if (!selected){\r\n const firstContent = this.props.data.content[0];\r\n if (this.props.includeTotal && prevState.selected !== 'total'){\r\n this.setSelected('total')\r\n }\r\n else if (prevState.selected !== (firstContent ? firstContent.id : null))\r\n {\r\n this.setSelected(firstContent && firstContent.id);\r\n }\r\n }\r\n }\r\n getSelected = () => {\r\n if (this.state.selected === 'total'){\r\n return this.props.data.total;\r\n }else{\r\n return this.props.data.content.find(item => item.id === this.state.selected);\r\n }\r\n }\r\n setSelected = (id) => this.setState({ selected: id })\r\n getLegend = (id, key) => {\r\n var item;\r\n if (id === 'total'){\r\n item = this.props.data.total;\r\n }else{\r\n item = this.props.data.content.find(item => item.id === id);\r\n }\r\n if (item){\r\n return item.legend.find(l => l.key === key);\r\n }\r\n }\r\n render() {\r\n var { data } = this.props;\r\n if (this.props.includeTotal){\r\n data = [\r\n data.total,\r\n ...data.content\r\n ]\r\n }else{\r\n data = data.content;\r\n }\r\n const selected = this.getSelected();\r\n const total = {\r\n red: this.getLegend(this.state.selected, 'Red'),\r\n green: this.getLegend(this.state.selected, 'Green'),\r\n yellow: this.getLegend(this.state.selected, 'No Status')\r\n }\r\n return (\r\n
    \r\n
    \r\n \r\n
    \r\n \r\n \r\n \r\n {data.map(item => {\r\n const red = this.getLegend(item.id, 'Red');\r\n const green = this.getLegend(item.id, 'Green');\r\n const yellow = this.getLegend(item.id, 'No Status');\r\n const isSelected = item.id === this.state.selected;\r\n return (\r\n this.setSelected(item.id)}\r\n >\r\n \r\n \r\n
    {item.name}
    \r\n
    \r\n
    \r\n )\r\n })}\r\n
    \r\n \r\n \r\n {selected ? (\r\n \r\n \r\n \r\n ) : null}\r\n \r\n
    \r\n
    \r\n );\r\n }\r\n}\r\n\r\nISNChartSelector.propTypes = {\r\n data: PropTypes.object\r\n}\r\n \r\nexport default ISNChartSelector;","import React, { Component } from 'react';\r\nimport { Query } from 'react-apollo';\r\nimport compose from 'lodash.flowright';\r\nimport gql from 'graphql-tag';\r\nimport moment from 'moment';\r\nimport WithOrgData from '../../WithOrgData';\r\nimport LoadingContent from '../../LoadingContent';\r\nimport { Alert, DatePicker, Card, Select, Divider, Row, Col, Icon, Checkbox, Spin, Button } from 'antd';\r\nimport withErrorCatch from '../../withErrorCatch';\r\nimport RadioGroup from 'antd/lib/radio/group';\r\nimport RadioButton from 'antd/lib/radio/radioButton';\r\nimport ISNChartSelector from './ISNChartSelector';\r\n\r\nconst { RangePicker } = DatePicker;\r\n\r\nconst QUERY = gql`\r\nquery DashboardQuery(\r\n $type: String!\r\n $variables: DashboardInputVariables!\r\n $filter_result: [FilterResultInput]\r\n $filter: FilterInput\r\n $summary: SummaryInput\r\n) {\r\n dashboard(\r\n type: $type\r\n variables: $variables\r\n filter_result: $filter_result\r\n filter: $filter\r\n summary: $summary\r\n ) @client {\r\n filter {\r\n __typename\r\n label\r\n choices {\r\n __typename\r\n key\r\n value\r\n }\r\n }\r\n summary {\r\n __typename\r\n label\r\n total {\r\n __typename\r\n id\r\n name\r\n type\r\n legend {\r\n __typename\r\n key\r\n value\r\n }\r\n }\r\n content {\r\n __typename\r\n id\r\n name\r\n type\r\n legend {\r\n __typename\r\n key\r\n value\r\n }\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\n// const FilterHeader = ({ title=\"Filtering\", startTime=moment().subtract(1, 'month'), endTime=moment() }) => (\r\n//
    \r\n// {title}\r\n// \r\n// Time span: {startTime.format(TIME_FORMAT)} to {endTime.format(TIME_FORMAT)}\r\n//
    \r\n// )\r\n\r\nconst FilterSelect = ({ filterData, dataLabel, ...restProps }) => {\r\n const filterItem = filterData.find(item => item.label === dataLabel);\r\n var options = null;\r\n if (filterItem){\r\n options = filterItem.choices.map(({ key, value }) => (\r\n {value}\r\n ))\r\n }\r\n return (\r\n \r\n )\r\n}\r\n\r\nconst FilterSelectSearch = (props) => (\r\n option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}\r\n {...props}\r\n />\r\n)\r\n\r\nclass Dashboard extends Component {\r\n state = {\r\n start: moment().subtract(15, 'days'),\r\n end: moment(),\r\n filter_result: {},\r\n filter_visible: true,\r\n activeTabKey: 'Destination',\r\n include_total: true,\r\n dateRangeState: null\r\n }\r\n onRangeChange = ([start, end]) => {\r\n this.setState({ start, end }, this.clearFilter())\r\n }\r\n setFilter = (key, value) => {\r\n const filter_result = this.state.filter_result\r\n const new_filter = {\r\n ...filter_result,\r\n [key]: {\r\n key,\r\n value\r\n }\r\n }\r\n if (!value) delete new_filter[key]\r\n this.setState({ filter_result: new_filter })\r\n }\r\n getFilter = (key) => {\r\n try{\r\n return this.state.filter_result[key].value\r\n }catch(err){\r\n return null\r\n }\r\n }\r\n clearFilter = () => this.setState({ filter_result: {} })\r\n toggleFilterVisibility = () => this.setState({ filter_visible: !this.state.filter_visible })\r\n render() {\r\n const { customer, transporter } = this.props.orgData;\r\n var filter_result = Object.values(this.state.filter_result)\r\n if (!filter_result.length){\r\n filter_result = undefined;\r\n }\r\n const variables = {\r\n type: 'PaxNode',\r\n variables: {\r\n tpID: transporter._id,\r\n customerID: customer && customer._id,\r\n startDate: this.state.start.toISOString(),\r\n endDate: this.state.end.toISOString()\r\n },\r\n filter_result,\r\n filter: [\r\n {\r\n label: \"destination\",\r\n key: \"destinationID._id\",\r\n value: \"destinationID.name\"\r\n },\r\n {\r\n label: \"employer\",\r\n key: \"employerID._id\",\r\n value: \"employerID.name\"\r\n },\r\n {\r\n label: \"company\",\r\n key: \"lastIsnResultWithHeader.selectedResult.companyName\"\r\n },\r\n {\r\n label: \"passenger\",\r\n key: \"_id\",\r\n value: [\"lastName\", \"firstName\"],\r\n value_delimiter: \", \"\r\n }\r\n ],\r\n summary: [\r\n {\r\n label: \"Destination\",\r\n type: \"percentage\",\r\n key: \"destinationID._id\",\r\n value: \"destinationID.name\",\r\n sort: [\r\n {\r\n \"destinationID.name\": \"ascend\"\r\n }\r\n ],\r\n group_by: \"lastIsnResultWithHeader.selectedResult.quickCheckStatus\",\r\n reduce: \"count\",\r\n force_capitalization_type: \"capitalize\",\r\n default_group_if_null: \"No Status\",\r\n include_total: true\r\n },\r\n {\r\n label: \"Employer\",\r\n type: \"percentage\",\r\n key: \"employerID._id\",\r\n value: \"employerID.name\",\r\n sort: [\r\n {\r\n \"employerID.name\": \"ascend\"\r\n }\r\n ],\r\n group_by: \"lastIsnResultWithHeader.selectedResult.quickCheckStatus\",\r\n reduce: \"count\",\r\n force_capitalization_type: \"capitalize\",\r\n default_group_if_null: \"No Status\",\r\n include_total: true\r\n },\r\n {\r\n label: \"Company\",\r\n type: \"percentage\",\r\n key: \"lastIsnResultWithHeader.selectedResult.companyName\",\r\n value: \"lastIsnResultWithHeader.selectedResult.companyName\",\r\n sort: [\r\n {\r\n \"lastIsnResultWithHeader.selectedResult.companyName\": \"ascend\"\r\n }\r\n ],\r\n group_by: \"lastIsnResultWithHeader.selectedResult.quickCheckStatus\",\r\n reduce: \"count\",\r\n force_capitalization_type: \"capitalize\",\r\n default_group_if_null: \"No Status\",\r\n include_total: true\r\n }\r\n ]\r\n }\r\n return (\r\n
    \r\n

    Dashboard

    \r\n {/* \r\n \r\n \r\n \r\n \r\n */}\r\n

    Passenger ISN Status

    \r\n \r\n {\r\n ({ data, loading, error }) => {\r\n // if (error) return \r\n return (\r\n \r\n {\r\n this.state.filter_visible ? (\r\n \r\n Clear filter\r\n ) : null\r\n }>\r\n
    \r\n

    Time Range:

    \r\n this.setState({ dateRangeState: dates })}\r\n format=\"YYYY-MM-DD\"\r\n disabledDate={(curr) => {\r\n if (curr && this.state.dateRangeState && this.state.dateRangeState[0]){\r\n let afterMonth = curr.isSameOrAfter(this.state.dateRangeState[0].clone().subtract(1, 'month'));\r\n let beforeMonth = curr.isSameOrBefore(this.state.dateRangeState[0].clone().add(1, 'month'));\r\n return !(afterMonth && beforeMonth)\r\n }\r\n return false\r\n }}\r\n onOpenChange={(open) => {\r\n if (!open) {\r\n this.setState({ dateRangeState: null });\r\n }\r\n }}\r\n onChange={this.onRangeChange}\r\n ranges={{\r\n 'Past day': [\r\n moment().subtract(1, 'day'),\r\n moment()\r\n ],\r\n 'Past 3 days': [\r\n moment().subtract(3, 'days'),\r\n moment()\r\n ],\r\n 'Past 15 days': [\r\n moment().subtract(15, 'days'),\r\n moment()\r\n ],\r\n 'Past month': [\r\n moment().subtract(1, 'month'),\r\n moment()\r\n ]\r\n }}\r\n />\r\n
    \r\n {loading || !(data && data.dashboard) ? (\r\n
    \r\n } />\r\n
    \r\n ) : (\r\n <>\r\n \r\n
    \r\n

    Destination

    \r\n this.setFilter('destinationID._id', value)}\r\n />\r\n
    \r\n
    \r\n

    Employer

    \r\n this.setFilter('employerID._id', value)}\r\n />\r\n
    \r\n
    \r\n

    Company

    \r\n this.setFilter('lastIsnResultWithHeader.selectedResult.companyName', value)}\r\n />\r\n
    \r\n
    \r\n

    Passenger

    \r\n this.setFilter('_id', value)}\r\n />\r\n
    \r\n \r\n )}\r\n
    \r\n \r\n ) : null\r\n }\r\n \r\n
    \r\n {error ? : null}\r\n \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n this.setState({ include_total: e.target.checked })} />\r\n Include Total\r\n \r\n \r\n this.setState({ activeTabKey: e.target.value })}>\r\n Destination\r\n Employer\r\n Company\r\n \r\n \r\n \r\n
    \r\n
    \r\n
    \r\n {\r\n loading ? (\r\n \r\n \r\n \r\n ) : (\r\n
    \r\n {data && data.dashboard ? (\r\n
    \r\n i.label === this.state.activeTabKey)} includeTotal={this.state.include_total} />\r\n
    \r\n ) : null}\r\n
    \r\n )\r\n }\r\n \r\n
    \r\n )\r\n }\r\n }\r\n
    \r\n
    \r\n );\r\n }\r\n}\r\n \r\nexport default compose(\r\n withErrorCatch(),\r\n WithOrgData\r\n)(Dashboard);","import { Icon, Menu } from 'antd';\r\nimport { SubMenuProps } from 'antd/lib/menu/SubMenu';\r\nimport { useHistory } from \"react-router-dom\";\r\nimport React from 'react';\r\nimport './style.less';\r\nimport useUserGroups from 'hooks/useUserGroups';\r\n\r\nconst AdminSubMenu: React.FC = (props) => {\r\n const history = useHistory();\r\n const [ groups ] = useUserGroups();\r\n if (groups.findIndex(g => g.startsWith('dataflyt.superuser')) < 0)\r\n return null;\r\n return Admin} {...props}>\r\n history.push('/app/admin/user')}>\r\n User Management\r\n \r\n history.push('/app/admin/fw-billing-report')}>\r\n FlytWatch Billing Report\r\n \r\n history.push('/app/admin/fw-changes-by-console')}>\r\n FlytWatch Changes By Console Report\r\n \r\n \r\n}\r\n\r\nexport default AdminSubMenu;","import { Icon, Layout, Menu } from 'antd';\r\nimport windowSizes from 'common/windowSizes';\r\nimport 'components/admin/sidebar-nav/AdminSubMenu';\r\nimport AdminSubMenu from 'components/admin/sidebar-nav/AdminSubMenu';\r\nimport MCIcon from 'components/icon';\r\nimport { GlobalAppStateContext } from 'context/global-app-state';\r\nimport usePersistence from 'hooks/persistence';\r\nimport React, { useContext, useEffect, useState } from 'react';\r\nimport { withRouter } from 'react-router-dom';\r\nimport { withUserGroups } from '../userGroup';\r\nimport WithOrgData from '../WithOrgData';\r\nimport './flightsnav.less';\r\nimport useUserGroups from 'hooks/useUserGroups';\r\n\r\nconst { Sider } = Layout;\r\n\r\nconst basePath = '/app/'\r\n\r\nconst mcItems = [\r\n {\r\n path: basePath + 'dashboard',\r\n key: 'dashboard',\r\n icon: 'play-circle',\r\n text: 'ISN Dashboard'\r\n },\r\n {\r\n path: basePath + 'scheduling',\r\n icon: 'calendar',\r\n text: 'Schedule',\r\n groups: [\"flytsuite.schedule.sets\", \"flytsuite.schedule.flight\", \"flytsuite.schedule.passenger\", \"flytsuite.schedule.passenger.view\"],\r\n onlyCustomer: true\r\n },\r\n {\r\n path: basePath + 'flights',\r\n icon: 'helicopter',\r\n text: 'Flights'\r\n },\r\n {\r\n path: basePath + 'passengers',\r\n icon: 'team',\r\n text: 'Passengers'\r\n },\r\n {\r\n path: basePath + 'cargo',\r\n icon: 'right-square',\r\n text: 'Cargo'\r\n },\r\n {\r\n path: basePath + 'tsacheck',\r\n icon: 'check',\r\n text: 'TSA Check',\r\n onlyTransporter: true\r\n },\r\n {\r\n path: basePath + 'flightTimes',\r\n icon: 'clock-circle',\r\n text: 'Flight Times',\r\n groups:[\"flytsuite.flight.times\"]\r\n }\r\n]\r\n\r\n const navItems = [ \r\n {\r\n path: basePath + 'quartermaster',\r\n icon: 'clock-circle',\r\n text: 'Quartermaster',\r\n groups:[\"flytsuite.quartermaster\"],\r\n onlyCustomer: true\r\n }\r\n ];\r\n const flytwatchItems = [\r\n {\r\n path: basePath + 'flytwatch',\r\n text: 'Home',\r\n groups: ['flytsuite.flytwatch.view'],\r\n evalPathsFirst: [\r\n basePath + 'flytwatch/history',\r\n basePath + 'flytwatch/historical-reporting',\r\n basePath + 'flytwatch/fuel-taken'\r\n ]\r\n },\r\n {\r\n path: basePath + 'flytwatch/history',\r\n rootPath: basePath + 'flytwatch',\r\n text: 'Approve Flights',\r\n groups: ['flytsuite.flytwatch.history.read']\r\n },\r\n {\r\n path: basePath + 'flytwatch/historical-reporting',\r\n rootPath: basePath + 'flytwatch',\r\n text: 'Historical Reporting',\r\n groups: ['flytsuite.flytwatch.history.read']\r\n },\r\n {\r\n path: basePath + 'flytwatch/fuel-taken',\r\n rootPath: basePath + 'flytwatch',\r\n text: 'Fuel Taken',\r\n onlyTransporter: true,\r\n groups: ['flytsuite.flytwatch.view']\r\n }\r\n ]\r\n const reportItems = [\r\n {\r\n path: basePath + 'report/covid',\r\n text: 'Covid'\r\n },\r\n {\r\n path: basePath + 'report/manifest',\r\n text: 'Manifest'\r\n },\r\n {\r\n path: basePath + 'report/passenger',\r\n text: 'Passenger'\r\n },\r\n {\r\n path: basePath + 'report/vaccinated-passengers',\r\n text: 'Vaccinated Pax',\r\n groups: ['flytsuite.covid19vaxrecords.read']\r\n },\r\n {\r\n path: basePath + 'report/personnel-vax-details',\r\n text: 'Personnel Vax Details',\r\n groups: ['flytsuite.covid19vaxrecords.read'],\r\n onlyCustomer: true\r\n },\r\n {\r\n path: basePath + 'report/cargo',\r\n text: 'Cargo'\r\n },\r\n {\r\n path: basePath + 'report/isn',\r\n text: 'ISN'\r\n },\r\n {\r\n path: basePath + 'report/hotfuel',\r\n text: 'Hot Fuel',\r\n groups: ['flytsuite.report.hotfuel.all']\r\n },\r\n {\r\n path: basePath + 'report/pax-isn-events',\r\n text: 'Pax ISN Events',\r\n\r\n // TODO: Does this need its own user groups?\r\n groups: ['flytsuite.master.all', 'flytsuite.management.all', 'flytsuite.management.emailtriggers.all']\r\n }\r\n ]\r\n \r\n const mdItems = [\r\n {\r\n path: basePath + 'masterdata/whitelist',\r\n text: 'ISN White List',\r\n onlyCustomer: true\r\n },\r\n {\r\n path: basePath + 'masterdata/nonpreferred',\r\n text: 'Non-Preferred List',\r\n onlyCustomer: true\r\n },\r\n {\r\n path: basePath + 'masterdata/aircraft',\r\n text: 'Aircraft',\r\n onlyTransporter: true,\r\n groups: ['flytsuite.master.all', 'flytsuite.master.edit', 'flytsuite.master.delete']\r\n },\r\n {\r\n path: basePath + 'masterdata/contract',\r\n text: 'Contracts',\r\n onlyTransporter: true,\r\n groups: ['flytsuite.master.all', 'flytsuite.master.edit', 'flytsuite.master.delete']\r\n },\r\n {\r\n path: basePath + 'masterdata/customer',\r\n text: 'Customers',\r\n onlyTransporter: true,\r\n groups: ['flytsuite.master.all', 'flytsuite.master.edit', 'flytsuite.master.delete']\r\n },\r\n {\r\n path: basePath + 'masterdata/employer',\r\n text: 'Employers',\r\n groups: ['flytsuite.master.all', 'flytsuite.master.edit', 'flytsuite.master.delete']\r\n },\r\n {\r\n path: basePath + 'masterdata/location',\r\n text: 'Locations',\r\n onlyTransporter: true,\r\n groups: ['flytsuite.master.all', 'flytsuite.master.edit', 'flytsuite.master.delete']\r\n },\r\n {\r\n path: basePath + 'masterdata/pilot',\r\n text: 'Pilots',\r\n onlyTransporter: true,\r\n groups: ['flytsuite.master.all', 'flytsuite.master.edit', 'flytsuite.master.delete']\r\n },\r\n {\r\n path: basePath + 'masterdata/personnel',\r\n text: 'Personnel',\r\n groups: [\r\n 'flytsuite.master.all',\r\n 'flytsuite.master.edit',\r\n 'flytsuite.master.delete',\r\n 'flytsuite.master.person.all'\r\n ]\r\n },\r\n ]\r\n\r\n const managementItems = [\r\n {\r\n path: basePath + 'management/email-triggers',\r\n text: 'Email Triggers',\r\n onlyCustomer: true,\r\n groups: ['flytsuite.master.all', 'flytsuite.management.all', 'flytsuite.management.emailtriggers.all']\r\n }\r\n ]\r\n\r\n const adminItems = [\r\n {\r\n path: basePath + 'admin/user'\r\n },\r\n {\r\n path: basePath + 'admin/fw-billing-report'\r\n },\r\n {\r\n path: basePath + 'admin/fw-changes-by-console'\r\n }\r\n ]\r\n\r\nconst FlightsNav = (props) => {\r\n const { state: { sidebarCollapsed }, setState } = useContext(GlobalAppStateContext);\r\n const { persistentData, setPersistentValues } = usePersistence('mc.flights.sidenav');\r\n const [ hasExpanded, setHasExpanded ] = useState(false);\r\n const [ userGroups ] = useUserGroups();\r\n\r\n useEffect(() => {\r\n if (!sidebarCollapsed && !hasExpanded){\r\n setHasExpanded(true);\r\n }\r\n }, [ sidebarCollapsed ])\r\n\r\n const { customer } = props.orgData;\r\n const { pathname } = props.location;\r\n const renderMenuItems = (data) => (\r\n data.map(item => {\r\n var authorized = false;\r\n if (item.groups){\r\n item.groups && item.groups.forEach(group => {\r\n if (props.userGroups.includes(group)){\r\n authorized = true;\r\n }\r\n })\r\n }else{\r\n authorized = true;\r\n }\r\n if ( item.onlyCustomer && !customer){\r\n authorized = false\r\n }\r\n if ( item.onlyTransporter && customer){\r\n authorized = false\r\n }\r\n if (authorized === true){\r\n return (\r\n {\r\n props.history.push(item.path);\r\n if (window.innerWidth <= windowSizes.small){\r\n setState({ sidebarCollapsed: true })\r\n }\r\n }}>\r\n {item.icon && }\r\n {item.text}\r\n \r\n )\r\n }\r\n return null\r\n }\r\n )\r\n )\r\n const allMenuItemsPaths = [...mcItems, ...navItems, ...flytwatchItems, ...reportItems, ...mdItems, ...adminItems];\r\n const findIfPathMatches = (item, pathname) => {\r\n const { path } = item;\r\n let splitPath = path.split('/');\r\n // ['app', 'reports', '']\r\n let splitPathname = pathname.split('/');\r\n // ['app', 'reports', '', '', '', '']\r\n if (item.rootPath){\r\n splitPath = path.replace(item.rootPath, '').split('/')\r\n splitPathname = pathname.replace(item.rootPath, '').split('/')\r\n }\r\n\r\n let match = true;\r\n\r\n for (let i=0; i < splitPath.length; i++){\r\n let itemPathElement = splitPath[i];\r\n\r\n if (splitPathname[i] !== itemPathElement){\r\n match = false;\r\n break;\r\n }\r\n }\r\n return match;\r\n }\r\n\r\n let matchingPath = '';\r\n\r\n allMenuItemsPaths.every(item => {\r\n let { path, evalPathsFirst } = item;\r\n \r\n let match = false;\r\n\r\n if (evalPathsFirst){\r\n evalPathsFirst.every(p => {\r\n let subItem = allMenuItemsPaths.find(item => item.path === p);\r\n if (subItem && findIfPathMatches(subItem, pathname)){\r\n matchingPath = p;\r\n match = true;\r\n return false; // break\r\n }\r\n return true\r\n })\r\n }\r\n\r\n if (match){\r\n return false; // break\r\n }\r\n\r\n match = findIfPathMatches(item, pathname)\r\n\r\n if (match){\r\n matchingPath = path\r\n return false; // break\r\n }\r\n\r\n return true; // continue loop\r\n });\r\n\r\n let menu = setPersistentValues({ openKeys })}\r\n style={{ height: '100%', borderRight: 0 }}\r\n theme=\"dark\"\r\n >\r\n Manifesting}>\r\n {renderMenuItems(mcItems)}\r\n \r\n {renderMenuItems(navItems)}\r\n { props.userGroups.includes('flytsuite.flytwatch.view') ? \r\n (FlytWatch}>\r\n {renderMenuItems(flytwatchItems)}\r\n ) : null\r\n }\r\n Report}>\r\n {renderMenuItems(reportItems)}\r\n \r\n Master Data}>\r\n {renderMenuItems(mdItems)}\r\n \r\n {userGroups.findIndex(g => g.includes('management') || g === 'flytsuite.master.all') > -1 &&\r\n Management}>\r\n {renderMenuItems(managementItems)}\r\n \r\n }\r\n \r\n \r\n\r\n if (!hasExpanded) menu = null;\r\n\r\n return (\r\n \r\n {menu}\r\n \r\n )\r\n}\r\n\r\nexport default WithOrgData( withUserGroups( withRouter( FlightsNav ) ) )\r\n","import React, { Component } from 'react';\r\nimport { graphql } from 'react-apollo';\r\nimport gql from 'graphql-tag';\r\nimport LoadingContent from './LoadingContent';\r\nimport {Form, Alert, List, Checkbox, Icon, Input, Row, Col, Button, DatePicker, Divider, Card} from 'antd';\r\nimport _ from 'lodash';\r\nimport moment from 'moment';\r\nimport {formItemLayout, FormItemClassNames} from \"../common/form\";\r\n\r\nconst SEARCH_EMPLOYERS = gql`\r\nquery SearchEmployers(\r\n $query: String!\r\n $limit: Int\r\n $bookmark: String\r\n){\r\n searchEmployers(\r\n query: $query\r\n limit: $limit\r\n bookmark: $bookmark\r\n ){\r\n bookmark\r\n docs {\r\n _id\r\n ... on Employer {\r\n name\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst SearchPrompt = () => (\r\n
    \r\n \r\n
    Search for employers by typing into the search bar
    \r\n
    \r\n)\r\n\r\nconst default_limit = 15;\r\n\r\nclass EmployerResults extends Component {\r\n state = {\r\n error: null,\r\n selected: []\r\n }\r\n componentDidUpdate(prevProps){\r\n const { selected } = this.props;\r\n if (Array.isArray(selected) && Array.isArray(prevProps.selected)){\r\n if (selected.length !== prevProps.selected.length){\r\n this.setState({ selected })\r\n }\r\n }\r\n }\r\n onSelectedChange = (employerID, checked) => {\r\n var selected;\r\n if (checked) {\r\n selected = _.union(this.state.selected, [employerID])\r\n }else{\r\n selected = this.state.selected.filter(item => item !== employerID)\r\n }\r\n this.setState({ selected })\r\n if (this.props.onChange){\r\n this.props.onChange(selected)\r\n }\r\n }\r\n clearSelected = () => this.setState({ selected: [] })\r\n render (){\r\n const { searchEmployers, loading, error, networkStatus } = this.props.data;\r\n const isFetchingMore = networkStatus === 3;\r\n if (loading && !isFetchingMore) return ;\r\n if (error) return (\r\n \r\n )\r\n return (\r\n \r\n \r\n \r\n {this.state.selected.length ? (\r\n
    \r\n {this.state.selected.length} Selected\r\n \r\n
    \r\n ) : null}\r\n \r\n {\r\n this.props.action && (\r\n \r\n {this.props.action}\r\n \r\n )\r\n }\r\n
    \r\n
    \r\n {\r\n const isChecked = this.state.selected.find(item => item === employer._id) ? true : false\r\n return (\r\n \r\n this.onSelectedChange(employer._id, e.target.checked)}\r\n style={{ width: '100%' }}\r\n >\r\n {employer.name}\r\n \r\n \r\n )\r\n }} />\r\n {searchEmployers.docs.length >= (this.props.limit || default_limit) ?
    \r\n \r\n
    : null}\r\n
    \r\n
    \r\n )\r\n }\r\n}\r\n\r\nconst EmployerResultsWithData = graphql(\r\n SEARCH_EMPLOYERS,\r\n {\r\n options: props => ({\r\n variables: {\r\n query: props.query,\r\n limit: props.limit || default_limit,\r\n bookmark: props.bookmark\r\n },\r\n fetchPolicy: 'network-only',\r\n notifyOnNetworkStatusChange: true\r\n }),\r\n props: (props) => ({\r\n ...props,\r\n onLoadMore: () => {\r\n const { fetchMore, searchEmployers: { bookmark } } = props.data;\r\n fetchMore({\r\n variables: {\r\n bookmark\r\n },\r\n updateQuery: (prevResult, { fetchMoreResult }) => { \r\n return {\r\n ...prevResult,\r\n searchEmployers: {\r\n __typename: 'MangoQueryResult',\r\n bookmark: fetchMoreResult.searchEmployers.bookmark,\r\n docs: [...prevResult.searchEmployers.docs, ...fetchMoreResult.searchEmployers.docs]\r\n }\r\n }\r\n }\r\n })\r\n }\r\n })\r\n }\r\n)(EmployerResults)\r\n\r\nclass NonPreferredEmployerSearch extends Component {\r\n state = {\r\n query: '',\r\n error: null\r\n }\r\n componentDidCatch(error) {\r\n this.setState({ error })\r\n }\r\n onSearch = (query) => {\r\n this.setState({ query, error: null })\r\n }\r\n renderContent = () => {\r\n if (this.state.error){\r\n return (\r\n \r\n )\r\n }\r\n if (this.state.query){\r\n return (\r\n \r\n )\r\n }else{\r\n return \r\n }\r\n }\r\n\r\n renderForm = () => {\r\n\r\n const { form } = this.props;\r\n\r\n return
    \r\n \r\n {form.getFieldDecorator('startDate')(\r\n \r\n )}\r\n \r\n \r\n {form.getFieldDecorator('reason', {\r\n rules: [{\r\n required: true, message: 'Reason is required'\r\n }]\r\n })(\r\n \r\n )}\r\n \r\n \r\n }\r\n\r\n render() {\r\n return (\r\n
    \r\n \r\n {this.renderForm()}\r\n \r\n \r\n {this.renderContent()}\r\n \r\n )\r\n }\r\n}\r\n \r\nexport default Form.create()(NonPreferredEmployerSearch)","import gql from \"graphql-tag\";\r\n\r\nconst GetNonPreferredQuery = gql`\r\n query NonPreferred($_id: ID!) {\r\n getNonPreferredList(_id: $_id) {\r\n _id\r\n personIds {\r\n id {\r\n _id\r\n lastName\r\n firstName\r\n employerID {\r\n _id\r\n name\r\n }\r\n contactInfo {\r\n address {\r\n city\r\n state\r\n }\r\n }\r\n }\r\n startDate\r\n endDate\r\n reason\r\n modifiedBy\r\n }\r\n organizationIds {\r\n id {\r\n ... on Customer {\r\n _id\r\n name\r\n classType\r\n }\r\n ... on Employer {\r\n _id\r\n name\r\n classType\r\n }\r\n }\r\n startDate\r\n endDate\r\n reason\r\n modifiedBy\r\n }\r\n }\r\n }\r\n`;\r\n\r\nexport default GetNonPreferredQuery;\r\n","import gql from \"graphql-tag\";\r\n\r\nconst SetNonPreferredMutation = gql`\r\n mutation SetNonPreferredList(\r\n $_id: ID\r\n $customerID: ID!\r\n $tpID: ID!\r\n $personIds: [NonPreferredPersonInput!]\r\n $organizationIds: [NonPreferredOrganizationInput!]\r\n ) {\r\n setNonPreferred(\r\n _id: $_id\r\n customerID: $customerID\r\n tpID: $tpID\r\n personIds: $personIds\r\n organizationIds: $organizationIds\r\n ) {\r\n _id\r\n personIds {\r\n id {\r\n _id\r\n lastName\r\n firstName\r\n employerID {\r\n _id\r\n name\r\n }\r\n contactInfo {\r\n address {\r\n city\r\n state\r\n }\r\n }\r\n }\r\n startDate\r\n endDate\r\n reason\r\n modifiedBy\r\n }\r\n organizationIds {\r\n id {\r\n ... on Customer {\r\n _id\r\n name\r\n classType\r\n }\r\n ... on Employer {\r\n _id\r\n name\r\n classType\r\n }\r\n }\r\n startDate\r\n endDate\r\n reason\r\n modifiedBy\r\n }\r\n }\r\n }\r\n`;\r\n\r\nexport default SetNonPreferredMutation","import { Alert, Button, Col, message, Popconfirm, Row, Table } from 'antd';\r\nimport commonColumns from 'common/table/columns';\r\nimport NonPreferredEmployerSearch from 'components/NonPreferredEmployerSearch';\r\nimport _ from 'lodash';\r\nimport compose from 'lodash.flowright';\r\nimport pluralize from 'pluralize';\r\nimport React, { Component } from 'react';\r\nimport { graphql } from 'react-apollo';\r\nimport LoadingContent from '../../../LoadingContent';\r\nimport WithOrgData from '../../../WithOrgData';\r\nimport GetNonPreferredQuery from \"Queries/GetNonPreferred\";\r\nimport SetNonPreferredMutation from \"Mutations/SetNonPreferred\";\r\nimport {momentOrNull} from \"../../../../common/util\";\r\n\r\nexport class Employer extends Component {\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.npfEmployerSearchRef = React.createRef();\r\n }\r\n\r\n state = {\r\n selected: [],\r\n employersToAdd: [],\r\n addingEmployers: false,\r\n removingEmployers: false\r\n }\r\n addOrgs = () => {\r\n\r\n this.npfEmployerSearchRef.current.validateFieldsAndScroll((err, values) => {\r\n\r\n if (err) return;\r\n\r\n const startDate = momentOrNull(values.startDate).format(\"YYYY-MM-DD\");\r\n const reason = values.reason;\r\n\r\n const { getNonPreferredList } = this.props.data;\r\n const { customer, transporter } = this.props.orgData;\r\n const organizationIds = _.union(getNonPreferredList && getNonPreferredList.organizationIds.map(org => {\r\n delete org.__typename\r\n if(!org.startDate){\r\n delete org.startDate\r\n }\r\n return {\r\n ...org,\r\n id: org.id._id\r\n }\r\n }), this.state.employersToAdd.map(id => {\r\n if(values.startDate){\r\n return {\r\n id: id,\r\n reason: reason,\r\n startDate: startDate\r\n }\r\n }\r\n\r\n return {\r\n id: id,\r\n reason: reason\r\n }\r\n }));\r\n\r\n this.setState({ addingEmployers: true });\r\n this.props.setNonPreferred({\r\n variables: {\r\n _id: customer._id.replace('CUS-', 'NPF-'),\r\n tpID: transporter._id,\r\n customerID: customer._id,\r\n organizationIds\r\n }\r\n })\r\n .then(() => {\r\n message.success(`Successfully added ${this.state.employersToAdd.length} organizations to the non preferred list`);\r\n this.setState({ employersToAdd: [] })\r\n this.npfEmployerSearchRef.current.resetFields();\r\n })\r\n .catch((error) => {\r\n console.error(error);\r\n message.error(\"Failed to add organizations to the non preferred list\")\r\n })\r\n .then(() => this.setState({ addingEmployers: false }))\r\n })\r\n }\r\n removeOrgs = () => {\r\n const { getNonPreferredList } = this.props.data;\r\n const { customer, transporter } = this.props.orgData;\r\n const organizations = getNonPreferredList.organizationIds.filter(org => !this.state.selected.includes(org.id._id));\r\n this.setState({ removingEmployers: true });\r\n this.props.setNonPreferred({\r\n variables: {\r\n _id: customer._id.replace('CUS-', 'NPF-'),\r\n tpID: transporter._id,\r\n customerID: customer._id,\r\n organizationIds: organizations.map(org => {\r\n delete org.__typename\r\n if(!org.startDate){\r\n delete org.startDate\r\n }\r\n return {\r\n ...org,\r\n id: org.id._id\r\n }\r\n })\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setNonPreferredList: {\r\n __typename: 'NonPreferredList',\r\n _id: getNonPreferredList._id,\r\n organizationIds: organizations.map(org => {\r\n return {\r\n ...org,\r\n id: org.id._id\r\n }\r\n })\r\n }\r\n }\r\n })\r\n .then(() => {\r\n message.success(`Successfully removed ${this.state.selected.length} organizations from the non preferred list`);\r\n this.setState({ selected: [] })\r\n })\r\n .catch((error) => {\r\n console.error(error);\r\n message.error(\"Failed to remove organizations from the non preferred list\")\r\n })\r\n .then(() => this.setState({ removingEmployers: false }))\r\n }\r\n \r\n clearSelected = () => this.setState({ selected: [] })\r\n render() {\r\n const { data: { getNonPreferredList, loading, error }} = this.props;\r\n if (loading) return \r\n if (error){\r\n const notFoundError = error.graphQLErrors.find(err => err.errorType === 'not_found' && err.path.length === 1)\r\n if (!notFoundError){\r\n return \r\n }\r\n }\r\n const employers = getNonPreferredList && getNonPreferredList.organizationIds.filter(\r\n org => org.id.classType === 'flytsuite.employer'\r\n )\r\n .sort((a, b) => {\r\n if (a.id.name < b.id.name) return -1\r\n if (a.id.name > b.id.name) return 1\r\n return 0\r\n });\r\n return (\r\n \r\n \r\n
    \r\n
    \r\n \r\n \r\n

    Add Employers to non preferred list

    \r\n \r\n \r\n this.addOrgs()}\r\n > Add {this.state.employersToAdd.length} Employers\r\n \r\n
    \r\n
    \r\n this.setState({ employersToAdd })}\r\n />\r\n
    \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n

    Employers on Non Preferred List

    \r\n
    \r\n {this.state.selected.length ? (\r\n
    \r\n {this.state.selected.length} Selected\r\n \r\n
    \r\n ) : null}\r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n Remove {this.state.selected.length} Employers\r\n \r\n \r\n \r\n
    \r\n record.id._id}\r\n size=\"small\"\r\n className=\"mc-table\"\r\n pagination={false}\r\n columns={commonColumns.nonPreferred.some([\"employerName\", \"reason\", \"startDate\"])}\r\n rowSelection={{\r\n selectedRowKeys: this.state.selected,\r\n onChange: (selected) => {\r\n this.setState({selected})\r\n if (this.props.onChange){\r\n this.props.onChange(selected)\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 compose(\r\n WithOrgData,\r\n graphql(\r\n GetNonPreferredQuery,\r\n {\r\n options: props => ({\r\n variables: {\r\n _id: props.orgData.customer._id.replace('CUS-', 'NPF-')\r\n },\r\n pollInterval: 15000,\r\n fetchPolicy: 'network-only'\r\n })\r\n }\r\n ),\r\n graphql(\r\n SetNonPreferredMutation,\r\n {\r\n name: 'setNonPreferred'\r\n }\r\n )\r\n)(Employer);","import { Cell, Column, RenderMode, SelectionModes, Table } from '@blueprintjs/table';\r\nimport {Form, Alert, Button, Col, DatePicker, Divider, Icon, Input, Row, Card} from 'antd';\r\nimport Checkbox from 'antd/lib/checkbox';\r\nimport {FormItemClassNames, formItemLayout, getLabelInValueKey} from 'common/form';\r\nimport { useColWidths } from 'common/table';\r\nimport { PersonColumnSet } from 'common/table/blueprintcolumns';\r\nimport { safeGet } from 'common/util';\r\nimport BlueprintTableInfiniteScroller from 'components/BlueprintTableInfiniteScroller';\r\nimport EmployerSelectWithData from 'components/form/select/EmployerSelect';\r\nimport { OrganizationSelect } from 'components/form/select/OrganizationSelect';\r\nimport NonIdealState from 'components/NonIdealState';\r\nimport WithOrgData, { WithOrgDataProps } from 'components/WithOrgData';\r\nimport gql from 'graphql-tag';\r\nimport useControlledState from 'hooks/useControlledState';\r\nimport { useMultiSelectByID } from 'hooks/useMultiSelectByID';\r\nimport { compact } from 'lodash';\r\nimport moment from 'moment';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { useQuery } from 'react-apollo';\r\nimport { LoadingIndicator, shouldRenderLoadingIndicator } from '..';\r\nimport { SearchProps } from '../interface';\r\nimport '../search.less';\r\nimport SelectionCount from '../SelectionCount';\r\nimport {WrappedFormUtils} from \"antd/lib/form/Form\";\r\n\r\nconst PERSON_SEARCH_QUERY = gql`\r\nquery PersonSearch(\r\n $filter: PersonFilterInput\r\n $advancedFilter: [FilterByKeyValueInput!]\r\n $advancedFilterOr: [FilterByKeyValueInput!]\r\n $search: [FilterByKeyValueInput!]\r\n $bookmark: String\r\n $limit: Int!\r\n $skip: Int\r\n) {\r\n persons(\r\n filter: $filter\r\n bookmark: $bookmark\r\n advancedFilter: $advancedFilter\r\n advancedFilterOr: $advancedFilterOr\r\n search: $search\r\n limit: $limit\r\n skip: $skip\r\n ){\r\n bookmark\r\n docs {\r\n _id\r\n ... on Person {\r\n lastName\r\n firstName\r\n extraBroadState\r\n customerID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n dob\r\n nation\r\n contactInfo {\r\n phone {\r\n number\r\n type\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nexport interface SearchState {\r\n lastName?: string,\r\n firstName?: string,\r\n offset: number\r\n}\r\n\r\nexport const initialSearchState: SearchState = {\r\n lastName: null,\r\n firstName: null,\r\n offset: 0\r\n}\r\n\r\ninterface LabelInValue {\r\n key: string,\r\n label: string\r\n}\r\n\r\nexport interface AdvancedFilterState {\r\n customer?: LabelInValue[],\r\n employer?: LabelInValue[]\r\n}\r\n\r\nexport const initialAdvancedFilterState: AdvancedFilterState = {\r\n customer: [],\r\n employer: []\r\n}\r\n\r\nexport interface PersonSearchProps extends SearchProps, WithOrgDataProps, React.HTMLAttributes {\r\n filterResults?(rows: any[]): any[],\r\n showCustomerColumn?: boolean,\r\n showEmployerColumn?: boolean,\r\n onReason?(reason: string): string,\r\n onStartDate?(startDate: string): string,\r\n startDate?: string,\r\n reason?: string,\r\n form?: WrappedFormUtils\r\n}\r\n\r\nconst NonPreferredPersonSearch: React.FC = ({\r\n form,\r\n pageLimit=50,\r\n onSelection,\r\n filterOptions,\r\n selectedItems: selectedItemsProps,\r\n orgData,\r\n showSelectedItemsCount=true,\r\n searchState: searchStateProp,\r\n onSearchStateChange,\r\n excludeCarrier,\r\n showCustomerColumn=true,\r\n showEmployerColumn=true,\r\n filterResults,\r\n ...restProps\r\n}) => {\r\n const [ searchState, setSearchState ] = useControlledState(initialSearchState, searchStateProp, onSearchStateChange);\r\n const { isSelected, toggleSelection, selectedItems, clearAll } = useMultiSelectByID({ selectedItems: selectedItemsProps, onSelection });\r\n const [ showMoreFilters, setShowMoreFilters ] = useState(false);\r\n const [ advFilterState, setAdvFilterState ] = useState(initialAdvancedFilterState);\r\n\r\n let colCount = 2;\r\n\r\n if (showCustomerColumn) colCount++;\r\n if (showEmployerColumn) colCount++;\r\n\r\n useEffect(() => {\r\n if (!showEmployerColumn && advFilterState.employer.length){\r\n setAdvFilterState({ employer: [] });\r\n }\r\n if (!showCustomerColumn && advFilterState.customer.length){\r\n setAdvFilterState({ customer: [] });\r\n }\r\n if (!showEmployerColumn && !showCustomerColumn && showMoreFilters){\r\n setShowMoreFilters(false);\r\n }\r\n // eslint-disable-next-line\r\n }, [ showEmployerColumn, showCustomerColumn ])\r\n\r\n const inputDirty = (\r\n searchState.lastName ||\r\n searchState.firstName ||\r\n advFilterState.employer.length ||\r\n advFilterState.customer.length\r\n ) ? true : false;\r\n\r\n function getAdvFilterValues(): { [key: string]: string[] } {\r\n let keys = Object.keys(advFilterState);\r\n let keyValues = {};\r\n keys.forEach(key => {\r\n let value = advFilterState[key];\r\n if (Array.isArray(value)){\r\n keyValues[key] = value.map(valItem => getLabelInValueKey(valItem))\r\n }\r\n else\r\n {\r\n return;\r\n }\r\n })\r\n return keyValues\r\n }\r\n\r\n function hideMoreFilters(){\r\n setShowMoreFilters(false);\r\n }\r\n\r\n let variables = {\r\n filter: {\r\n lastName: searchState.lastName,\r\n firstName: searchState.firstName,\r\n employer: null\r\n },\r\n limit: pageLimit,\r\n advancedFilter: null\r\n }\r\n\r\n const advFilterValues = getAdvFilterValues();\r\n variables.advancedFilter = [];\r\n if (advFilterValues.employer.length){\r\n variables.advancedFilter.push({\r\n key: '$or',\r\n value: JSON.stringify(advFilterValues.employer.map(id => ({ employerID: id })))\r\n })\r\n }\r\n if (advFilterValues.customer.length){\r\n variables.advancedFilter.push({\r\n key: '$or',\r\n value: JSON.stringify(advFilterValues.customer.map(id => ({ customerID: id })))\r\n })\r\n }\r\n\r\n const queryResult = useQuery(PERSON_SEARCH_QUERY, {\r\n variables,\r\n fetchPolicy: 'cache-and-network',\r\n skip: !inputDirty,\r\n context: {\r\n debounceKey: 'personsearch',\r\n debounceTimeout: 1000\r\n }\r\n })\r\n\r\n function handleRefresh(){\r\n setSearchState({ ...searchState, offset: 0 });\r\n queryResult.refetch()\r\n }\r\n\r\n function handleInputValueChange(key: string, value: string) {\r\n setSearchState({ ...searchState, [key]: value })\r\n }\r\n\r\n function handleInputPressEnter(key: string, value: string) {\r\n setSearchState({ ...searchState, [key]: value })\r\n }\r\n\r\n const [ colWidths, , updateColWidth ] = useColWidths(colCount, { 0: 40 }, 200);\r\n\r\n function renderTable(){\r\n const { data, error, networkStatus, fetchMore } = queryResult;\r\n if (shouldRenderLoadingIndicator(networkStatus)){\r\n return \r\n }\r\n\r\n if (!inputDirty || (!data && networkStatus > 3 && !error)){\r\n return \r\n }\r\n\r\n if (error) return \r\n\r\n let rows: any[] = safeGet(['persons', 'docs'], data);\r\n if (!Array.isArray(rows)){\r\n rows = [];\r\n }\r\n if (!rows.length){\r\n return \r\n }\r\n\r\n if (filterResults){\r\n rows = filterResults(rows)\r\n }\r\n const ColumnSet = new PersonColumnSet(rows);\r\n let colNames = ['personName'];\r\n if (showEmployerColumn){\r\n colNames.push('employerName');\r\n }\r\n if (showCustomerColumn){\r\n colNames.push('customerName');\r\n }\r\n let columns = [\r\n {\r\n const record = rows[idx];\r\n if(record){\r\n let checked = isSelected ? isSelected(record._id) : false\r\n console.log('checked: ', checked);\r\n return \r\n {\r\n if (toggleSelection){\r\n toggleSelection(record._id);\r\n }\r\n }}\r\n />\r\n \r\n }\r\n return \r\n }} />,\r\n ...ColumnSet.some(colNames)\r\n ]\r\n return = pageLimit + searchState.offset}\r\n loadMore={() => {\r\n let nextOffset = searchState.offset + pageLimit;\r\n return fetchMore({\r\n variables: {\r\n skip: nextOffset\r\n },\r\n updateQuery: (prev: any, { fetchMoreResult }) => {\r\n if (!fetchMoreResult) return prev;\r\n setSearchState({ ...searchState, offset: nextOffset });\r\n return {\r\n ...prev,\r\n persons: {\r\n ...prev.persons,\r\n docs: [\r\n ...prev.persons.docs,\r\n ...fetchMoreResult.persons.docs\r\n ]\r\n }\r\n }\r\n }\r\n })\r\n }}\r\n >\r\n {\r\n if (isSelected(row._id)){\r\n return {\r\n rows: [ idx, idx ]\r\n }\r\n }\r\n return null\r\n }))}\r\n >\r\n {columns}\r\n \r\n \r\n }\r\n\r\n function numAdvFiltersApplied(){\r\n let values = Object.values(advFilterState);\r\n values = values.filter(value => {\r\n if (Array.isArray(value)){\r\n return value.length > 0\r\n }\r\n return value\r\n });\r\n return values.length\r\n }\r\n\r\n const renderForm = () => {\r\n\t\t\treturn (\r\n\t\t\t\t
    \r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{form.getFieldDecorator('startDate')()}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{form.getFieldDecorator('reason', {\r\n\t\t\t\t\t\t\trules: [\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\trequired: true,\r\n\t\t\t\t\t\t\t\t\tmessage: 'Reason is required',\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t],\r\n\t\t\t\t\t\t})()}\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t);\r\n\t\t};\r\n\r\n\t\treturn (\r\n\t\t\t
    \r\n\t\t\t\t
    \r\n \r\n {renderForm()}\r\n \r\n \r\n \r\n
    \r\n \r\n handleInputValueChange('lastName', e.target.value)}\r\n onPressEnter={(e) => handleInputPressEnter('lastName', e.currentTarget.value)}\r\n value={searchState.lastName}\r\n />\r\n handleInputValueChange('firstName', e.target.value)}\r\n onPressEnter={(e) => handleInputPressEnter('firstName', e.currentTarget.value)}\r\n value={searchState.firstName}\r\n />\r\n
    \r\n \r\n \r\n \r\n \r\n
    \r\n {showMoreFilters && (showCustomerColumn || showEmployerColumn) ? (\r\n <>\r\n {showCustomerColumn ? (\r\n
    \r\n
    Filter customers
    \r\n \r\n setAdvFilterState({\r\n ...advFilterState,\r\n customer: value,\r\n })\r\n }\r\n />\r\n
    \r\n ) : null}\r\n {showEmployerColumn ? (\r\n
    \r\n
    Filter employers
    \r\n setAdvFilterState({ ...advFilterState, employer: e })}\r\n style={{ maxWidth: '22rem' }}\r\n className='search-header-input'\r\n placeholder='Search by name'\r\n labelInValue\r\n />\r\n
    \r\n ) : null}\r\n \r\n ) : null}\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\t\t\tsetSearchState({\r\n\t\t\t\t\t\t\t\t\t\t...searchState,\r\n\t\t\t\t\t\t\t\t\t\tlastName: null,\r\n\t\t\t\t\t\t\t\t\t\tfirstName: null,\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\tsetAdvFilterState({\r\n\t\t\t\t\t\t\t\t\t\t...advFilterState,\r\n\t\t\t\t\t\t\t\t\t\temployer: [],\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\tClear\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{showCustomerColumn || showEmployerColumn ? (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{!showMoreFilters ? (\r\n\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\t\t\t\t\t\tsetShowMoreFilters(true);\r\n\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tShow advanced filters{' '}\r\n\t\t\t\t\t\t\t\t\t\t\t{numAdvFiltersApplied() > 0 ? `(${numAdvFiltersApplied()} applied)` : null}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\t\t\t\t\t\thideMoreFilters();\r\n\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tHide advanced filters\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t{selectedItems.length > 0 ? (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t clearAll()} />\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\r\n\t\t\t\t
    \r\n\t\t\t\t
    {renderTable()}
    \r\n\t\t\t
    \r\n\t\t);\r\n}\r\n\r\nexport default Form.create()(WithOrgData(NonPreferredPersonSearch))","import { Form, Alert, Button, Col, message, Popconfirm, Row, Table } from 'antd';\r\nimport NonPreferredPersonSearch from 'components/search/NonPreferredPersonSearch';\r\nimport gql from 'graphql-tag';\r\nimport _ from 'lodash';\r\nimport compose from 'lodash.flowright';\r\nimport React, { Component } from 'react';\r\nimport { graphql } from 'react-apollo';\r\nimport commonColumns from '../../../../common/table/columns';\r\nimport LoadingContent from '../../../LoadingContent';\r\nimport WithOrgData from '../../../WithOrgData';\r\nimport GetNonPreferredQuery from \"Queries/GetNonPreferred\";\r\nimport SetNonPreferredMutation from \"Mutations/SetNonPreferred\";\r\nimport {momentOrNull} from \"../../../../common/util\";\r\n\r\nconst NON_PREFERRED = gql`\r\nquery NonPreferredList($_id: ID!){\r\n getNonPreferredList(_id: $_id){\r\n _id\r\n personIds {\r\n id {\r\n _id\r\n lastName\r\n firstName\r\n employerID {\r\n _id\r\n name\r\n }\r\n contactInfo {\r\n address {\r\n city\r\n state\r\n }\r\n }\r\n }\r\n startDate\r\n reason\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst SET_NON_PREFERRED = gql`\r\nmutation SetNonPreferredList(\r\n $_id: ID\r\n $customerID: ID!\r\n $tpID: ID!\r\n $personIds: [NonPreferredPersonInput]!\r\n){\r\n setNonPreferred(\r\n _id: $_id\r\n customerID: $customerID\r\n tpID: $tpID\r\n personIds: $personIds\r\n ){\r\n _id\r\n personIds {\r\n id {\r\n _id\r\n lastName\r\n firstName\r\n employerID {\r\n _id\r\n name\r\n }\r\n contactInfo {\r\n address {\r\n city\r\n state\r\n }\r\n }\r\n }\r\n reason\r\n startDate\r\n }\r\n }\r\n}\r\n`\r\n\r\nclass Person extends Component {\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.npfSearchRef = React.createRef();\r\n }\r\n\r\n state = {\r\n personsToAdd: [],\r\n addingPersons: false,\r\n selectedPersons: []\r\n }\r\n addPersons = () => {\r\n\r\n this.npfSearchRef.current.validateFieldsAndScroll((err, values) => {\r\n if (err) return;\r\n\r\n const startDate = momentOrNull(values.startDate).format(\"YYYY-MM-DD\");\r\n const reason = values.reason;\r\n\r\n const { orgData: { customer, transporter }, data: { getNonPreferredList } } = this.props;\r\n const { personsToAdd } = this.state;\r\n const prevPersonIds = getNonPreferredList ? getNonPreferredList.personIds : [];\r\n const personIds = _.union(prevPersonIds.map(per => {\r\n delete per.__typename\r\n if(!per.startDate){\r\n delete per.startDate\r\n }\r\n return {\r\n ...per,\r\n id: per.id._id\r\n }\r\n }), personsToAdd.map(per => {\r\n if(values.startDate){\r\n return {\r\n id: per,\r\n reason: reason,\r\n startDate: startDate\r\n }\r\n }\r\n return {\r\n id: per,\r\n reason: reason\r\n }\r\n }));\r\n\r\n this.setState({ addingPersons: true });\r\n\r\n this.props.setNonPreferred({\r\n variables: {\r\n _id: customer._id.replace('CUS-', 'NPF-'),\r\n customerID: customer._id,\r\n tpID: transporter._id,\r\n personIds\r\n }\r\n })\r\n .then(() => {\r\n message.success(`Successfully added ${personsToAdd.length} personnel to non-preferred list`);\r\n this.setState({ personsToAdd: []})\r\n this.npfSearchRef.current.resetFields();\r\n })\r\n .catch((error) => {\r\n console.error(error)\r\n message.error(\"Failed to add personnel to non-preferred list\");\r\n })\r\n .then(() => this.setState({ addingPersons: false }))\r\n })\r\n }\r\n removePersons = () => {\r\n const { orgData: { customer, transporter }, data: { getNonPreferredList } } = this.props;\r\n const { selectedPersons } = this.state;\r\n const persons = getNonPreferredList.personIds.filter(per => !selectedPersons.includes(per.id._id));\r\n const personIds = persons.map(per => {\r\n delete per.__typename\r\n if(!per.startDate){\r\n delete per.startDate\r\n }\r\n return {\r\n ...per,\r\n id: per.id._id\r\n }\r\n });\r\n\r\n this.props.setNonPreferred({\r\n variables: {\r\n _id: customer._id.replace('CUS-', 'NPF-'),\r\n customerID: customer._id,\r\n tpID: transporter._id,\r\n personIds\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setNonPreferredList: {\r\n __typename: 'NonPreferredList',\r\n _id: getNonPreferredList._id,\r\n personIds: persons\r\n }\r\n }\r\n })\r\n .then(() => {\r\n message.success(`Successfully removed ${selectedPersons.length} personnel from non-preferred list`);\r\n this.setState({ selectedPersons: [] });\r\n })\r\n .catch(error => {\r\n console.error(error);\r\n message.error('Failed to remove personnel from white list');\r\n })\r\n }\r\n render(){\r\n const { getNonPreferredList, loading, error } = this.props.data;\r\n if (loading) return \r\n if (error){\r\n const notFoundError = error.graphQLErrors.find(err => err.errorType === 'not_found' && err.path.length === 1)\r\n if (!notFoundError){\r\n return \r\n }\r\n }\r\n return (\r\n \r\n \r\n
    \r\n \r\n

    Add Personnel

    \r\n
    \r\n \r\n Add to Non-Preferred List\r\n \r\n \r\n this.setState({ personsToAdd: rows })}\r\n selectedItems={this.state.personsToAdd}\r\n filterResults={(rows) => rows.filter((row) => !((getNonPreferredList && getNonPreferredList.personIds) || []).map(p => p._id).includes(row._id))}\r\n style={{ flex: 1, minHeight: 0 }}\r\n showCustomerColumn={false}\r\n />\r\n
    \r\n \r\n \r\n
    \r\n \r\n \r\n

    Personnel on Non-Preferred List

    \r\n \r\n \r\n \r\n \r\n Remove {this.state.selectedPersons.length} Personnel\r\n \r\n \r\n \r\n
    \r\n record.id._id}\r\n size=\"small\"\r\n className=\"mc-table\"\r\n pagination={false}\r\n columns={commonColumns.nonPreferred.some([\"personName\", \"employer\", \"reason\", \"startDate\"])}\r\n rowSelection={{\r\n selectedRowKeys: this.state.selectedPersons,\r\n onChange: (selectedPersons) => this.setState({ selectedPersons })\r\n }}\r\n />\r\n
    \r\n \r\n
    \r\n )\r\n }\r\n}\r\n\r\nexport default compose(\r\n WithOrgData,\r\n graphql(\r\n GetNonPreferredQuery,\r\n {\r\n options: props => ({\r\n variables: {\r\n _id: props.orgData.customer._id.replace('CUS-', 'NPF-')\r\n },\r\n pollInterval: 15000,\r\n fetchPolicy: 'network-only'\r\n })\r\n }\r\n ),\r\n graphql(\r\n SetNonPreferredMutation,\r\n {\r\n name: 'setNonPreferred'\r\n }\r\n )\r\n)(Person);","import { Alert, Card, Col, Row } from 'antd';\r\nimport gql from 'graphql-tag';\r\nimport compose from 'lodash.flowright';\r\nimport React, { Component } from 'react';\r\nimport { graphql, withApollo } from 'react-apollo';\r\nimport { withRouter } from 'react-router-dom';\r\nimport LoadingContent from '../../../LoadingContent';\r\nimport WithOrgData from '../../../WithOrgData';\r\nimport Employer from './Employer';\r\nimport Person from './Person';\r\nimport GetNonPreferredQuery from \"Queries/GetNonPreferred\";\r\nimport SetNonPreferredMutation from \"Mutations/SetNonPreferred\";\r\n\r\nclass NonPreferred extends Component {\r\n renderContent = () => {\r\n const { loading, error } = this.props.data;\r\n const { useDefault } = this.props;\r\n if (loading) return \r\n if (error) return \r\n const currentTab = this.props.match.params.tab;\r\n const renderTab = () => {\r\n switch (currentTab) {\r\n case 'person':\r\n return (\r\n
    \r\n \r\n
    \r\n )\r\n case 'employer':\r\n default:\r\n return (\r\n
    \r\n \r\n
    \r\n )\r\n }\r\n }\r\n return (\r\n
    \r\n { (\r\n this.props.history.push(`/app/masterdata/nonpreferred/${key}`)}\r\n >\r\n {renderTab()}\r\n \r\n ) }\r\n
    \r\n )\r\n }\r\n render() { \r\n return (\r\n \r\n \r\n \r\n

    Non Preferred List

    \r\n \r\n
    \r\n {this.renderContent()}\r\n
    \r\n )\r\n }\r\n}\r\n \r\nexport default compose(\r\n WithOrgData,\r\n withApollo,\r\n graphql(\r\n GetNonPreferredQuery,\r\n {\r\n options: props => ({\r\n variables: {\r\n _id: props.orgData.customer._id.replace('CUS-', 'NPF-')\r\n },\r\n pollInterval: 15000,\r\n fetchPolicy: 'network-only'\r\n }),\r\n props: props => {\r\n const defaultWl = {\r\n _id: props.ownProps.orgData.customer._id.replace('CUS-', 'NPF-'),\r\n organizationIds: [],\r\n personIds: [],\r\n __typename: 'NonPreferredList'\r\n }\r\n var error = props.data.error;\r\n if (error){\r\n const notFoundError = error.graphQLErrors.find(err => err.errorType === 'not_found' && err.path.length === 1)\r\n if (notFoundError){\r\n return {\r\n ...props,\r\n useDefault: true,\r\n data: {\r\n ...props.data,\r\n error: undefined,\r\n loading: false,\r\n getNonPreferredList: defaultWl\r\n }\r\n }\r\n }\r\n }\r\n return {\r\n ...props,\r\n data: {\r\n ...props.data,\r\n getNonPreferredList: {\r\n ...defaultWl,\r\n ...(props.data.getNonPreferredList || {})\r\n }\r\n }\r\n }\r\n }\r\n }\r\n ),\r\n graphql(\r\n SetNonPreferredMutation,\r\n {\r\n name: 'setNonPreferredList'\r\n }\r\n ),\r\n withRouter\r\n)(NonPreferred);","import {FormComponentProps} from \"antd/lib/form\";\r\nimport React from \"react\";\r\nimport {Checkbox, Col, DatePicker, Form, Input, List, Row} from \"antd\";\r\nimport moment from \"moment\";\r\nimport {\r\n NonComplyBypass,\r\n NonComplyBypassCategory,\r\n NonComplyBypassCategoryHuman,\r\n NonComplyBypassInput,\r\n} from \"../../../common/types/non-comply-bypass\";\r\nimport {momentOrNull} from \"../../../common/util\";\r\nimport {createFormField, FormItemClassNames} from \"../../../common/form\";\r\n\r\nexport interface WhitelistBypassFormIndividualProps extends FormComponentProps {\r\n initialData?: NonComplyBypass[],\r\n onFormFieldsChange?: (fields: any) => void,\r\n formFields?: any\r\n}\r\n\r\n/**\r\n * This form allows the user to type information for each non-comply type.\r\n *\r\n * To add a new non-comply category, please add a new entry into the NonComplyBypassCategory and\r\n * NonComplyBypassCategoryHuman enums.\r\n */\r\nconst WhitelistBypassFormIndividual: React.FC = (props) => {\r\n\r\n const {\r\n form,\r\n initialData=[]\r\n } = props;\r\n\r\n const renderDatePicker = (disabled: boolean) => (\r\n current.isBefore(moment().startOf('day'))}\r\n style={{ width: '100%' }}\r\n disabled={disabled}\r\n placeholder=\"No expiration (add one here)\"\r\n />\r\n )\r\n\r\n function findBypass(category: NonComplyBypassCategory){\r\n return initialData?.find((nonComplyBypass) => nonComplyBypass.nonComplyCategory === category);\r\n }\r\n\r\n const dataSource = Object.keys(NonComplyBypassCategory).filter(c => c !== NonComplyBypassCategory.NONE);\r\n\r\n return
    \r\n {\r\n\r\n const lastItem = index === dataSource.length - 1;\r\n const firstItem = index === 0;\r\n\r\n let checkboxText = NonComplyBypassCategoryHuman[category];\r\n\r\n const isEnabled = form.getFieldValue(`${category}:enabled`);\r\n\r\n return (\r\n \r\n \r\n {form.getFieldDecorator(`${category}:enabled`, {\r\n initialValue: !!findBypass(category as NonComplyBypassCategory),\r\n valuePropName: 'checked'\r\n })({checkboxText})}\r\n \r\n \r\n \r\n \r\n {form.getFieldDecorator(`${category}:reason`, {\r\n initialValue: findBypass(category as NonComplyBypassCategory)?.reason,\r\n rules: [{ required: isEnabled, message: 'Reason is required.' }]\r\n })()}\r\n \r\n \r\n \r\n \r\n {form.getFieldDecorator(`${category}:expiresOn`, {\r\n initialValue: momentOrNull(findBypass(category as NonComplyBypassCategory)?.expiresOn)\r\n })(renderDatePicker(!isEnabled))}\r\n \r\n \r\n \r\n \r\n )\r\n }}\r\n />\r\n \r\n}\r\n\r\nexport default Form.create({\r\n onFieldsChange(props, fields, allFields){\r\n props.onFormFieldsChange?.(allFields)\r\n },\r\n mapPropsToFields(props){\r\n if (!Object.keys(props.formFields || {}).length && props.initialData?.length){\r\n // If formFields is empty, initialize form from initialData.\r\n const formFields: any = {};\r\n props.initialData.forEach((bypass) => {\r\n const cat = bypass.nonComplyCategory;\r\n formFields[`${cat}:enabled`] = createFormField(true);\r\n formFields[`${cat}:reason`] = createFormField(bypass.reason);\r\n formFields[`${cat}:expiresOn`] = createFormField(momentOrNull(bypass.expiresOn));\r\n })\r\n return formFields;\r\n }\r\n return props.formFields\r\n }\r\n})(WhitelistBypassFormIndividual);\r\n\r\n/**\r\n * Reads the dynamic form values and converts them into a list of NonComplyBypassInput objects\r\n * (with the nonComplyCategory included too so we can derive the non-comply type later)\r\n */\r\nfunction parseFormValues(values: any): (NonComplyBypassInput & { nonComplyCategory: NonComplyBypassCategory })[] {\r\n const newBypassMapping = new Map>();\r\n\r\n function putBypassField(category: NonComplyBypassCategory, fieldName: string, value: any){\r\n if (newBypassMapping.has(category)){\r\n newBypassMapping.get(category)[fieldName] = value;\r\n }\r\n else\r\n {\r\n newBypassMapping.set(category, { [fieldName]: value });\r\n }\r\n }\r\n\r\n Object.entries(values)\r\n .forEach(([ key, value ]) => {\r\n const [ categoryStr, fieldName ] = key.split(\":\");\r\n const category = NonComplyBypassCategory[categoryStr];\r\n if (!category) return;\r\n\r\n putBypassField(category, fieldName, value);\r\n })\r\n\r\n const nonComplyList: (NonComplyBypassInput & { nonComplyCategory: NonComplyBypassCategory })[] = []\r\n\r\n newBypassMapping.forEach((value, key) => {\r\n if (!(value as any).enabled) return;\r\n\r\n const item = {\r\n ...(value as NonComplyBypassInput),\r\n expiresOn: momentOrNull(value.expiresOn)?.format('YYYY-MM-DD'),\r\n nonComplyCategory: key\r\n }\r\n delete (item as any).enabled;\r\n\r\n nonComplyList.push(item);\r\n })\r\n\r\n return nonComplyList;\r\n}\r\n\r\nexport const WhitelistBypassFormUtils = {\r\n parseFormValues\r\n}","import React from 'react';\r\nimport { Query } from 'react-apollo';\r\nimport gql from 'graphql-tag';\r\nimport { Spin } from 'antd';\r\n\r\nconst TP_QUERY = gql`\r\n{\r\n transporter @client {\r\n _id\r\n name\r\n }\r\n}\r\n`\r\n\r\n// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default (Component) => {\r\n return props => (\r\n \r\n {\r\n ({ data: {transporter}, loading, error }) => {\r\n if (loading) return \r\n if (error) return
    ERROR: {error}
    \r\n return \r\n }\r\n }\r\n
    \r\n )\r\n}","import WhitelistBypassForm from \"./whitelist-bypass-form\";\r\nexport { WhitelistBypassFormUtils } from './whitelist-bypass-form';\r\nexport default WhitelistBypassForm;","import gql from \"graphql-tag\";\r\nimport {QueryHookOptions, QueryResult, useQuery} from \"react-apollo\";\r\nimport {OperationVariables} from \"@apollo/react-common\";\r\n\r\nconst WhiteListNonComplyBypassFragment = gql`\r\n fragment WhiteListNonComplyBypassFragment on NonComplyBypass {\r\n customerID\r\n personID\r\n timestamp\r\n expiresOn\r\n reason\r\n cognitoUser {\r\n congitoUsername\r\n givenName\r\n familyName\r\n email\r\n }\r\n nonComplyCategory\r\n }\r\n`\r\n\r\nexport const WhiteListFragment = gql`\r\nfragment WhiteListFragment on WhiteList {\r\n _id\r\n personIds {\r\n _id\r\n lastName\r\n firstName\r\n employerID {\r\n _id\r\n name\r\n }\r\n contactInfo {\r\n address {\r\n city\r\n state\r\n }\r\n }\r\n }\r\n locationToEmployer {\r\n locationID {\r\n _id\r\n name\r\n }\r\n employerIDs {\r\n _id\r\n name\r\n }\r\n }\r\n organizationIds {\r\n ... on Customer {\r\n _id\r\n name\r\n classType\r\n }\r\n ... on Employer {\r\n _id\r\n name\r\n classType\r\n }\r\n }\r\n noncomplyPassList_Training {\r\n personID\r\n nonComplyBypass {\r\n ...WhiteListNonComplyBypassFragment\r\n }\r\n }\r\n noncomplyPassList_DrugAndAlcohol {\r\n personID\r\n nonComplyBypass {\r\n ...WhiteListNonComplyBypassFragment\r\n }\r\n }\r\n noncomplyPassList_CompanyGrade {\r\n personID\r\n nonComplyBypass {\r\n ...WhiteListNonComplyBypassFragment\r\n }\r\n }\r\n}\r\n${WhiteListNonComplyBypassFragment}\r\n`\r\n\r\nexport const QueryGetWhiteList = gql`\r\n query GetWhiteList($_id: ID!){\r\n getWhiteList(_id: $_id){\r\n ...WhiteListFragment\r\n }\r\n }\r\n ${WhiteListFragment}\r\n`","import {NonComplyBypass} from \"common/types/non-comply-bypass\";\r\nimport pluralize from 'pluralize';\r\nimport {Button, Divider, Icon, List, Row, Tag, Tooltip, Typography} from \"antd\";\r\nimport {momentOrNull} from \"../../../../common/util\";\r\nimport {TooltipProps} from \"antd/lib/tooltip\";\r\nimport moment from 'moment';\r\n\r\nexport interface ConditionCountProps {\r\n personID: string,\r\n nonComplyBypasses: NonComplyBypass[],\r\n tooltipProps?: TooltipProps,\r\n onEdit?: () => void\r\n}\r\n\r\n/**\r\n * Displays a button with the text \"1 Condition\" or \"2 Conditions\" and displays a tooltip with more detailed Non-Comply bypass information\r\n */\r\nconst ConditionCount: React.FC = (props) => {\r\n const count = props.nonComplyBypasses.length;\r\n\r\n const currentDate = moment();\r\n\r\n // If there is no bypasses, then display \"Add Condition\"\r\n if (count <= 0){\r\n return props.onEdit?.()}\r\n >Add Condition\r\n }\r\n\r\n function isBypassExpired(bypass: NonComplyBypass){\r\n const exp = momentOrNull(bypass.expiresOn)?.endOf('day');\r\n return exp?.isBefore(currentDate) || false;\r\n }\r\n\r\n function renderBypassOverlay(bypass: NonComplyBypass, key: string | number) {\r\n\r\n const isExpired = isBypassExpired(bypass);\r\n\r\n const expiredBadge = isExpired ? EXPIRED : null\r\n\r\n return \r\n Person will be whitelisted for {bypass.nonComplyCategory}{' '}\r\n status until {momentOrNull(bypass.expiresOn)?.format('YYYY-MM-DD')}\r\n
    \r\n \r\n Added by {bypass.cognitoUser?.givenName} {bypass.cognitoUser?.familyName} at {momentOrNull(bypass.timestamp)?.format('YYYY-MM-DD HH:mm')}\r\n \r\n {expiredBadge}\r\n
    \r\n }\r\n\r\n const hasExpired = !!props.nonComplyBypasses.find(isBypassExpired);\r\n\r\n /**\r\n * This overlay shows when you hover over the button.\r\n * Displays detailed information about NonComplyBypasses.\r\n */\r\n const overlay = (\r\n
    \r\n
    \r\n \r\n {props.nonComplyBypasses.map(renderBypassOverlay)}\r\n \r\n
    \r\n
    \r\n \r\n \r\n props.onEdit?.()}\r\n >Edit\r\n \r\n
    \r\n
    \r\n )\r\n\r\n const textType = hasExpired ? 'danger' : 'warning';\r\n const icon = hasExpired ? : \r\n\r\n return \r\n \r\n \r\n}\r\n\r\nexport default ConditionCount","import React, {Component} from 'react';\r\nimport {graphql} from 'react-apollo';\r\nimport compose from 'lodash.flowright';\r\nimport moment from 'moment';\r\nimport gql from 'graphql-tag';\r\nimport WithOrgData from '../../../WithOrgData';\r\nimport LoadingContent from '../../../LoadingContent';\r\nimport {\r\n Alert,\r\n Button,\r\n Card,\r\n Checkbox,\r\n Col,\r\n Divider,\r\n Icon, Input,\r\n message, Modal,\r\n Popconfirm,\r\n Row,\r\n Spin,\r\n Table,\r\n Typography\r\n} from 'antd';\r\nimport commonColumns from '../../../../common/table/columns';\r\nimport PersonSearch from 'components/search/PersonSearch';\r\nimport './index.less';\r\nimport WhitelistBypassForm, { WhitelistBypassFormUtils } from \"components/form/whitelist-bypass-form\";\r\nimport SelectionCount from \"../../../search/SelectionCount\";\r\nimport pluralize from 'pluralize';\r\nimport ResolveEntityID from \"../../../ResolveEntityID\";\r\nimport {QueryGetWhiteList, WhiteListFragment} from \"../../../../Queries/WhiteList\";\r\nimport ConditionCount from \"./ConditionCount\";\r\nimport {NonComplyBypassCategoryHuman} from \"../../../../common/types/non-comply-bypass\";\r\nimport {momentOrNull} from \"../../../../common/util\";\r\n\r\nconst SET_PERSON_ON_WHITE_LIST = gql`\r\nmutation SetPersonOnWhiteList(\r\n $modifyList: [SetPersonOnWhiteListModifyAction!],\r\n $deleteList: [SetPersonOnWhiteListDeleteAction!]\r\n){\r\n SetPersonOnWhiteList(\r\n modifyList: $modifyList,\r\n deleteList: $deleteList\r\n ){\r\n ...WhiteListFragment\r\n }\r\n}\r\n${WhiteListFragment}\r\n`\r\n\r\nclass Person extends Component {\r\n state = {\r\n // List is built from the \"Add Personnel\" panel\r\n personsToAdd: [],\r\n\r\n /**\r\n * The current step of the \"Add Personnel\" panel.\r\n * 0 = Renders personnel search.\r\n * 1 = Renders whitelist conditions form.\r\n * @type {0|1}\r\n */\r\n addPersonStep: 0,\r\n\r\n // True if the request for adding personnel is in flight\r\n addingPersons: false,\r\n\r\n // True if user checked the \"Whitelist on condition option\" in the \"Add Personnel\" panel.\r\n enableWhiteListBypass: false,\r\n\r\n // Form state of the WhiteListBypassFormCombined component.\r\n whiteListBypassFormFields: {},\r\n\r\n // List of personIDs selected on the right \"Personnel on White List\" panel\r\n selectedPersons: [],\r\n\r\n // Current state of the \"Edit WhiteList Conditions\" pop-up modal.\r\n editBypassesModal: {\r\n open: false,\r\n personID: null,\r\n executing: false,\r\n formFields: {}\r\n },\r\n\r\n // Value of the search bar in the \"Personnel on White List\" panel.\r\n searchBarValue: null,\r\n\r\n // Filter only conditions checkbox state\r\n filterOnlyConditions: false,\r\n\r\n // Show only conditions that are expired\r\n filterOnlyExpired: false,\r\n\r\n // Loading state when removing persons.\r\n removingPersons: false\r\n }\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n // Ref to White List bypass form seen in the \"Add Personnel\" panel.\r\n this.whitelistBypassFormLeftPanel = React.createRef();\r\n\r\n // Ref to White List bypass form seen in the \"Edit WhiteList Conditions\" pop-up modal.\r\n this.whitelistBypassFormRightPanel = React.createRef();\r\n }\r\n\r\n /**\r\n * Gets the conditions/bypasses for a personID\r\n * @param personID\r\n * @returns {NonComplyBypass[]}\r\n */\r\n getPersonNonComplyBypasses = (personID) => {\r\n const whiteList = this.props.data.getWhiteList;\r\n if (!whiteList) return [];\r\n\r\n const nonComplyBypasses = [];\r\n\r\n // Scan all fields that begin with noncomplyPassList_ and find the personID.\r\n Object.entries(whiteList)\r\n .forEach(([ key, personToBypassList ]) => {\r\n if (!key.startsWith(\"noncomplyPassList_\") || !personToBypassList) return;\r\n\r\n const bypass = personToBypassList.find((item) => item.personID === personID)?.nonComplyBypass;\r\n if (bypass){\r\n nonComplyBypasses.push(bypass);\r\n }\r\n })\r\n\r\n return nonComplyBypasses;\r\n }\r\n\r\n /**\r\n * Handles adding new personnel to the user's organization's whitelist.\r\n * Reads the data from the \"WhiteListBypassFormCombined\" form and uploads it.\r\n */\r\n handleAddPersons = () => {\r\n const { personsToAdd } = this.state;\r\n\r\n const submit = (bypassFields = {}) => {\r\n const modifyList = personsToAdd.map((personId) => (\r\n {\r\n personID: personId,\r\n ...bypassFields\r\n }\r\n ))\r\n\r\n // Upload to the SetPersonOnWhiteList lambda function\r\n this.setState({ addingPersons: true });\r\n this.props.setPersonOnWhiteList({\r\n variables: {\r\n modifyList: modifyList\r\n }\r\n })\r\n .then(() => {\r\n message.success(`Successfully added/modified ${personsToAdd.length} personnel to whitelist`);\r\n this.setState({ personsToAdd: [], addPersonStep: 0, whiteListBypassFormFields: {} });\r\n this.props.data.refetch();\r\n })\r\n .catch((error) => {\r\n console.error(error)\r\n message.error(\"Failed to add personnel to whitelist\");\r\n })\r\n .then(() => this.setState({ addingPersons: false }))\r\n }\r\n\r\n if (this.state.enableWhiteListBypass)\r\n {\r\n this.whitelistBypassFormLeftPanel.current.validateFieldsAndScroll((err, values) => {\r\n if (err) return;\r\n\r\n const bypasses = WhitelistBypassFormUtils.parseFormValues(values);\r\n\r\n /**\r\n * Fields to insert into the modifyList input.\r\n * @type {{ [fieldName: string]: NonComplyBypassInput }}\r\n */\r\n const bypassFields = {};\r\n\r\n bypasses.forEach((bypass) => {\r\n // Create the key of the element in bypassFields\r\n const fieldName = \"nonComplyBypass_\" + String(bypass.nonComplyCategory);\r\n delete bypass.nonComplyCategory;\r\n bypassFields[fieldName] = bypass\r\n })\r\n\r\n submit(bypassFields);\r\n })\r\n }\r\n else\r\n {\r\n submit();\r\n }\r\n\r\n }\r\n\r\n /**\r\n * Handles editing the condition/bypasses of a person in this whitelist.\r\n * @param {string} personID\r\n */\r\n handleEditConditions = (personID) => {\r\n this.whitelistBypassFormRightPanel.current.validateFieldsAndScroll((err, values) => {\r\n if (err) return;\r\n\r\n const bypasses = WhitelistBypassFormUtils.parseFormValues(values);\r\n\r\n /**\r\n * Fields to insert into the modifyList input.\r\n * @type {{ [fieldName: string]: NonComplyBypassInput }}\r\n */\r\n const bypassFields = {};\r\n\r\n // Builds bypassFields\r\n bypasses.forEach((bypass) => {\r\n const keyName = \"nonComplyBypass_\" + bypass.nonComplyCategory;\r\n\r\n // Insert the expected NonComplyBypassInput into bypassFields\r\n bypassFields[keyName] = {\r\n reason: bypass.reason,\r\n expiresOn: bypass.expiresOn\r\n }\r\n })\r\n\r\n const modifyList = [\r\n {\r\n personID: personID,\r\n ...bypassFields\r\n }\r\n ]\r\n\r\n // Loading state of modal\r\n this.setState({ editBypassesModal: {\r\n ...this.state.editBypassesModal,\r\n executing: true\r\n } });\r\n\r\n // Upload to the SetPersonOnWhiteList lambda function\r\n this.props.setPersonOnWhiteList({\r\n variables: {\r\n modifyList: modifyList\r\n }\r\n })\r\n .then(() => {\r\n message.success(`Successfully modified personnel whitelist`);\r\n this.setState({ personsToAdd: [], addPersonStep: 0, editBypassesModal: { open: false, personID: null, executing: false, formFields: {} } });\r\n })\r\n .catch((error) => {\r\n console.error(error)\r\n message.error(\"Failed to add personnel to whitelist\");\r\n })\r\n .then(() => this.setState({ modifyingPersonID: null, editBypassesModal: { ...this.state.editBypassesModal, executing: false } }))\r\n })\r\n }\r\n\r\n /**\r\n * Handles deleting personnel from the user's organization's whitelist.\r\n */\r\n removePersons = () => {\r\n const { data: { getWhiteList } } = this.props;\r\n const { selectedPersons } = this.state;\r\n const newPersonList = getWhiteList.personIds.filter(per => !selectedPersons.includes(per._id));\r\n\r\n this.setState({ removingPersons: true });\r\n this.props.setPersonOnWhiteList({\r\n variables: {\r\n deleteList: selectedPersons.map((personID) => ({ personID: personID }))\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setWhiteList: {\r\n __typename: 'WhiteList',\r\n ...getWhiteList,\r\n _id: getWhiteList._id,\r\n personIds: newPersonList\r\n }\r\n }\r\n })\r\n .then(() => {\r\n message.success(`Successfully removed ${selectedPersons.length} personnel from white list`);\r\n this.setState({ selectedPersons: [] });\r\n })\r\n .catch(error => {\r\n console.error(error);\r\n message.error('Failed to remove personnel from white list');\r\n })\r\n .then(() => {\r\n this.setState({ removingPersons: false });\r\n })\r\n }\r\n\r\n /**\r\n * Renders the left panel responsible for searching for and adding personnel.\r\n */\r\n renderSearchCol = () => {\r\n\r\n const { getWhiteList } = this.props.data;\r\n\r\n let header = (\r\n \r\n

    Add Personnel

    \r\n
    \r\n \r\n {this.state.addPersonStep === 0 ? (\r\n this.setState({ addPersonStep: 1 })}\r\n >Next \r\n ) : (\r\n <>\r\n this.setState({ addPersonStep: 0 })}\r\n style={{ marginRight: '0.5rem' }}\r\n >Back\r\n Add to White List \r\n \r\n )}\r\n \r\n \r\n )\r\n\r\n let content = null;\r\n\r\n if (this.state.addPersonStep === 0){\r\n // Display Person Search list\r\n content = this.setState({ personsToAdd: rows })}\r\n selectedItems={this.state.personsToAdd}\r\n filterResults={(rows) => rows.filter((row) => !getWhiteList.personIds.map(p => p._id).includes(row._id))}\r\n style={{ flex: 1, minHeight: 0 }}\r\n showCustomerColumn={false}\r\n />\r\n }\r\n else if (this.state.addPersonStep === 1){\r\n // Display White List condition form\r\n content = (\r\n \r\n \r\n {/* Optional White List Conditions form, User clicks the checkbox to show the form. */}\r\n this.setState({ enableWhiteListBypass: !this.state.enableWhiteListBypass })}\r\n >\r\n
    \r\n this.setState({ enableWhiteListBypass: e.target.checked })}\r\n checked={this.state.enableWhiteListBypass}\r\n />\r\n
    \r\n
    \r\n \r\n Whitelist with condition (optional)\r\n \r\n \r\n Personnel will only be whitelisted under these conditions\r\n \r\n
    \r\n
    \r\n }\r\n headStyle={this.state.enableWhiteListBypass ? undefined : {\r\n borderBottom: 'none'\r\n }}\r\n bodyStyle={this.state.enableWhiteListBypass ? undefined : {\r\n display: 'none'\r\n }}\r\n >\r\n {this.state.enableWhiteListBypass ? (\r\n {\r\n this.setState({ whiteListBypassFormFields: fields });\r\n }}\r\n formFields={this.state.whiteListBypassFormFields}\r\n />\r\n ) : null}\r\n \r\n \r\n \r\n {/* Describes how these conditions will apply to these personnel */}\r\n \r\n \r\n this.setState({ personsToAdd: [], addPersonStep: 0 })\r\n }\r\n itemName=\"person\"\r\n style={{ marginBottom: \"0.5rem\" }}\r\n renderMessage={(count) => {\r\n let msg = `${count} ${pluralize(\"person\", this.state.personsToAdd.length)} will be whitelisted to pass all ISN checks:`;\r\n\r\n if (this.state.enableWhiteListBypass){\r\n let values = this.whitelistBypassFormLeftPanel.current?.getFieldsValue() || {};\r\n\r\n const bypasses = WhitelistBypassFormUtils.parseFormValues(values);\r\n\r\n const bypassNames = bypasses\r\n .map((bypass) => NonComplyBypassCategoryHuman[bypass.nonComplyCategory])\r\n .join(', ');\r\n\r\n const expirations = bypasses\r\n .map((bypass) => bypass.expiresOn)\r\n .join(', ');\r\n\r\n\r\n if (bypasses.length && bypassNames && expirations) {\r\n msg = `This whitelist will apply to ${count} ${pluralize(\"person\", this.state.personsToAdd.length)} for ${bypassNames} until ${expirations} respectively.`\r\n }\r\n }\r\n\r\n return (\r\n {msg}\r\n )\r\n }}\r\n />\r\n
      \r\n \r\n {({ data, loading }) => {\r\n if (loading)\r\n return } />;\r\n return data?.map((per) => (\r\n
    1. \r\n {per.lastName}, {per.firstName}\r\n \r\n {\r\n const filteredPersonsToAdd = this.state.personsToAdd\r\n .filter((personId) => personId !== per._id);\r\n this.setState({ personsToAdd: filteredPersonsToAdd })\r\n if (!filteredPersonsToAdd.length) {\r\n this.setState({addPersonStep: 0, whiteListBypassFormFields: {}});\r\n }\r\n }}\r\n >Remove\r\n
    2. \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 {header}\r\n {content}\r\n \r\n }\r\n\r\n getColumns = () => {\r\n const columns = commonColumns.person.all();\r\n\r\n columns.push(...[\r\n {\r\n key: 'conditions',\r\n title: 'Conditions',\r\n render: (_, record) => {\r\n const bypasses = this.getPersonNonComplyBypasses(record._id);\r\n return this.setState({ editBypassesModal: { open: true, personID: record._id } })}\r\n />\r\n }\r\n }\r\n ])\r\n\r\n return columns\r\n }\r\n\r\n getFilteredData = () => {\r\n const { getWhiteList } = this.props.data;\r\n\r\n let data = getWhiteList?.personIds || [];\r\n if (this.state.searchBarValue){\r\n const hasMatch = (text) => {\r\n if (!text) return false;\r\n return !!String(text).toLowerCase().includes(String(this.state.searchBarValue).toLowerCase())\r\n }\r\n data = data.filter((person) => {\r\n return hasMatch(person.lastName) || hasMatch(person.firstName) || hasMatch(person?.employerID?.name)\r\n })\r\n }\r\n\r\n if (this.state.filterOnlyConditions){\r\n data = data.filter(this.doesPersonHaveCondition);\r\n }\r\n\r\n if (this.state.filterOnlyExpired){\r\n data = data.filter(this.isPersonExpired);\r\n }\r\n\r\n return data;\r\n }\r\n\r\n doesPersonHaveCondition = (person) => {\r\n const nonComplyBypasses = this.getPersonNonComplyBypasses(person._id);\r\n return !!nonComplyBypasses?.length;\r\n }\r\n\r\n isPersonExpired = (person) => {\r\n const now = moment();\r\n const nonComplyBypasses = this.getPersonNonComplyBypasses(person._id);\r\n for (let nonComplyBypass of nonComplyBypasses) {\r\n const exp = momentOrNull(nonComplyBypass.expiresOn)?.endOf('day');\r\n const isExpired = exp?.isBefore(now);\r\n if (isExpired) return true;\r\n }\r\n return false;\r\n }\r\n\r\n render(){\r\n const { loading, error } = this.props.data;\r\n if (loading) return \r\n if (error){\r\n const notFoundError = error.graphQLErrors.find(err => err.errorType === 'not_found' && err.path.length === 1)\r\n if (!notFoundError){\r\n return \r\n }\r\n }\r\n\r\n return (\r\n \r\n \r\n
    \r\n {this.renderSearchCol()}\r\n
    \r\n \r\n \r\n
    \r\n \r\n \r\n

    Personnel on White List

    \r\n \r\n \r\n this.setState({ filterOnlyExpired: e.target.checked })}\r\n style={{ display: 'flex', alignItems: 'center' }}\r\n >\r\n
    \r\n Show only expired
    \r\n ({(this.props.data?.getWhiteList?.personIds.filter(this.isPersonExpired) || []).length} found)\r\n
    \r\n \r\n \r\n \r\n this.setState({ filterOnlyConditions: e.target.checked })}\r\n style={{ display: 'flex', alignItems: 'center' }}\r\n >\r\n
    \r\n Show only with conditions
    \r\n ({(this.props.data?.getWhiteList?.personIds.filter(this.doesPersonHaveCondition) || []).length} found)\r\n
    \r\n \r\n \r\n \r\n this.setState({ searchBarValue: e.target.value })}\r\n value={this.state.searchBarValue}\r\n />\r\n \r\n \r\n \r\n \r\n Remove {this.state.selectedPersons.length} Personnel\r\n \r\n \r\n \r\n
    \r\n record._id}\r\n size=\"small\"\r\n className=\"mc-table\"\r\n pagination={false}\r\n columns={this.getColumns()}\r\n rowSelection={{\r\n selectedRowKeys: this.state.selectedPersons,\r\n onChange: (selectedPersons) => this.setState({ selectedPersons })\r\n }}\r\n />\r\n \r\n {({ data, loading }) => {\r\n if (loading || !data[0]) return } />\r\n return `Edit White-List Conditions for ${data[0].firstName} ${data[0].lastName}`\r\n }}\r\n \r\n }\r\n onCancel={() => this.setState({ editBypassesModal: { open: false, personID: this.state.editBypassesModal.personID } })}\r\n width={800}\r\n destroyOnClose\r\n okText=\"Save\"\r\n onOk={() => this.handleEditConditions(this.state.editBypassesModal.personID)}\r\n closable={!this.state.editBypassesModal.executing}\r\n cancelButtonProps={{\r\n disabled: this.state.editBypassesModal.executing\r\n }}\r\n okButtonProps={{\r\n loading: this.state.editBypassesModal.executing\r\n }}\r\n >\r\n \r\n this.setState({ editBypassesModal: { ...this.state.editBypassesModal, formFields } })}\r\n />\r\n \r\n
    \r\n \r\n
    \r\n )\r\n }\r\n}\r\n\r\nexport default compose(\r\n WithOrgData,\r\n graphql(\r\n QueryGetWhiteList,\r\n {\r\n options: props => ({\r\n variables: {\r\n _id: props.orgData.customer._id.replace('CUS-', 'WHL-')\r\n },\r\n pollInterval: ['cache-only', 'cache-first'].includes(props.fetchPolicy) ? undefined : 15000,\r\n fetchPolicy: props.fetchPolicy || 'network-only'\r\n }),\r\n props: props => {\r\n const defaultWl = {\r\n _id: props.ownProps.orgData.customer._id.replace('CUS-', 'WHL-'),\r\n personIds: [],\r\n __typename: 'WhiteList'\r\n }\r\n if (props.ownProps.useDefault){\r\n return {\r\n ...props,\r\n data: {\r\n ...props.data,\r\n useDefault: undefined,\r\n error: undefined,\r\n getWhiteList: defaultWl\r\n }\r\n }\r\n }\r\n return props\r\n }\r\n }\r\n ),\r\n graphql(\r\n SET_PERSON_ON_WHITE_LIST,\r\n {\r\n name: 'setPersonOnWhiteList'\r\n }\r\n )\r\n)(Person);","import React, { Component } from 'react';\r\nimport { graphql } from 'react-apollo';\r\nimport gql from 'graphql-tag';\r\nimport LoadingContent from './LoadingContent';\r\nimport { Alert, List, Checkbox, Icon, Input, Row, Col, Button } from 'antd';\r\nimport _ from 'lodash';\r\n\r\nconst SEARCH_EMPLOYERS = gql`\r\nquery SearchEmployers(\r\n $query: String!\r\n $limit: Int\r\n $bookmark: String\r\n){\r\n searchEmployers(\r\n query: $query\r\n limit: $limit\r\n bookmark: $bookmark\r\n ){\r\n bookmark\r\n docs {\r\n _id\r\n ... on Employer {\r\n name\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst SearchPrompt = () => (\r\n
    \r\n \r\n
    Search for employers by typing into the search bar
    \r\n
    \r\n)\r\n\r\nconst default_limit = 15;\r\n\r\nclass EmployerResults extends Component {\r\n state = {\r\n error: null,\r\n selected: []\r\n }\r\n componentDidUpdate(prevProps){\r\n const { selected } = this.props;\r\n if (Array.isArray(selected) && Array.isArray(prevProps.selected)){\r\n if (selected.length !== prevProps.selected.length){\r\n this.setState({ selected })\r\n }\r\n }\r\n }\r\n onSelectedChange = (employerID, checked) => {\r\n var selected;\r\n if (checked) {\r\n selected = _.union(this.state.selected, [employerID])\r\n }else{\r\n selected = this.state.selected.filter(item => item !== employerID)\r\n }\r\n this.setState({ selected })\r\n if (this.props.onChange){\r\n this.props.onChange(selected)\r\n }\r\n }\r\n clearSelected = () => this.setState({ selected: [] })\r\n render (){\r\n const { searchEmployers, loading, error, networkStatus } = this.props.data;\r\n const isFetchingMore = networkStatus === 3;\r\n if (loading && !isFetchingMore) return ;\r\n if (error) return (\r\n \r\n )\r\n return (\r\n \r\n \r\n \r\n {this.state.selected.length ? (\r\n
    \r\n {this.state.selected.length} Selected\r\n \r\n
    \r\n ) : null}\r\n \r\n {\r\n this.props.action && (\r\n \r\n {this.props.action}\r\n \r\n )\r\n }\r\n
    \r\n
    \r\n {\r\n const isChecked = this.state.selected.find(item => item === employer._id) ? true : false\r\n return (\r\n \r\n this.onSelectedChange(employer._id, e.target.checked)}\r\n style={{ width: '100%' }}\r\n >\r\n {employer.name}\r\n \r\n \r\n )\r\n }} />\r\n {searchEmployers.docs.length >= (this.props.limit || default_limit) ?
    \r\n \r\n
    : null}\r\n
    \r\n
    \r\n )\r\n }\r\n}\r\n\r\nconst EmployerResultsWithData = graphql(\r\n SEARCH_EMPLOYERS,\r\n {\r\n options: props => ({\r\n variables: {\r\n query: props.query,\r\n limit: props.limit || default_limit,\r\n bookmark: props.bookmark\r\n },\r\n fetchPolicy: 'network-only',\r\n notifyOnNetworkStatusChange: true\r\n }),\r\n props: (props) => ({\r\n ...props,\r\n onLoadMore: () => {\r\n const { fetchMore, searchEmployers: { bookmark } } = props.data;\r\n fetchMore({\r\n variables: {\r\n bookmark\r\n },\r\n updateQuery: (prevResult, { fetchMoreResult }) => { \r\n return {\r\n ...prevResult,\r\n searchEmployers: {\r\n __typename: 'MangoQueryResult',\r\n bookmark: fetchMoreResult.searchEmployers.bookmark,\r\n docs: [...prevResult.searchEmployers.docs, ...fetchMoreResult.searchEmployers.docs]\r\n }\r\n }\r\n }\r\n })\r\n }\r\n })\r\n }\r\n)(EmployerResults)\r\n\r\nclass EmployerSearch extends Component {\r\n state = {\r\n query: '',\r\n error: null\r\n }\r\n componentDidCatch(error) {\r\n this.setState({ error })\r\n }\r\n onSearch = (query) => {\r\n this.setState({ query, error: null })\r\n }\r\n renderContent = () => {\r\n if (this.state.error){\r\n return (\r\n \r\n )\r\n }\r\n if (this.state.query){\r\n return (\r\n \r\n )\r\n }else{\r\n return \r\n }\r\n }\r\n render() {\r\n return (\r\n
    \r\n \r\n {this.renderContent()}\r\n \r\n )\r\n }\r\n}\r\n \r\nexport default EmployerSearch","import React, { Component } from 'react';\r\nimport { graphql } from 'react-apollo';\r\nimport compose from 'lodash.flowright';\r\nimport gql from 'graphql-tag';\r\nimport WithOrgData from '../../../WithOrgData';\r\nimport LoadingContent from '../../../LoadingContent';\r\nimport { Alert, Row, Col, Button, message, Popconfirm, List, Checkbox } from 'antd';\r\nimport EmployerSearch from '../../../EmployerSearch';\r\nimport _ from 'lodash';\r\nimport pluralize from 'pluralize';\r\nimport './index.less';\r\nimport {WhiteListFragment} from \"../../../../Queries/WhiteList\";\r\n\r\nconst WHITE_LIST = gql`\r\nquery WhiteList($_id: ID!){\r\n getWhiteList(_id: $_id){\r\n ...WhiteListFragment\r\n }\r\n}\r\n${WhiteListFragment}\r\n`\r\n\r\nconst SET_WHITE_LIST = gql`\r\nmutation SetWhiteList(\r\n $_id: ID\r\n $customerID: ID!\r\n $tpID: ID!\r\n $organizationIds: [ID]\r\n){\r\n setWhiteList(\r\n _id: $_id\r\n customerID: $customerID\r\n tpID: $tpID\r\n organizationIds: $organizationIds\r\n ){\r\n ...WhiteListFragment\r\n }\r\n}\r\n${WhiteListFragment}\r\n`\r\n\r\nexport class Employer extends Component {\r\n state = {\r\n selected: [],\r\n employersToAdd: [],\r\n addingEmployers: false,\r\n removingEmployers: false\r\n }\r\n addOrgs = () => {\r\n const { getWhiteList } = this.props.data;\r\n const { customer, transporter } = this.props.orgData;\r\n const organizationIds = _.union(getWhiteList.organizationIds.map(org => org._id), this.state.employersToAdd);\r\n this.setState({ addingEmployers: true });\r\n this.props.setWhiteList({\r\n variables: {\r\n _id: customer._id.replace('CUS-', 'WHL-'),\r\n tpID: transporter._id,\r\n customerID: customer._id,\r\n organizationIds\r\n }\r\n })\r\n .then(() => {\r\n message.success(`Successfully added ${this.state.employersToAdd.length} organizations to the white list`);\r\n this.setState({ employersToAdd: [] })\r\n })\r\n .catch((error) => {\r\n console.error(error);\r\n message.error(\"Failed to add organizations to white list\")\r\n })\r\n .then(() => this.setState({ addingEmployers: false }))\r\n }\r\n removeOrgs = () => {\r\n const { getWhiteList } = this.props.data;\r\n const { customer, transporter } = this.props.orgData;\r\n const organizations = getWhiteList.organizationIds.filter(org => !this.state.selected.includes(org._id));\r\n this.setState({ removingEmployers: true });\r\n this.props.setWhiteList({\r\n variables: {\r\n _id: customer._id.replace('CUS-', 'WHL-'),\r\n tpID: transporter._id,\r\n customerID: customer._id,\r\n organizationIds: organizations.map(org => org._id)\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setWhiteList: {\r\n __typename: 'WhiteList',\r\n _id: getWhiteList._id,\r\n organizationIds: organizations\r\n }\r\n }\r\n })\r\n .then(() => {\r\n message.success(`Successfully removed ${this.state.selected.length} organizations from white list`);\r\n this.setState({ selected: [] })\r\n })\r\n .catch((error) => {\r\n console.error(error);\r\n message.error(\"Failed to remove organizations from white list\")\r\n })\r\n .then(() => this.setState({ removingEmployers: false }))\r\n }\r\n onSelectedChange = (employerID, checked) => {\r\n var selected;\r\n if (checked) {\r\n selected = _.union(this.state.selected, [employerID])\r\n }else{\r\n selected = this.state.selected.filter(item => item !== employerID)\r\n }\r\n this.setState({ selected })\r\n if (this.props.onChange){\r\n this.props.onChange(selected)\r\n }\r\n }\r\n \r\n clearSelected = () => this.setState({ selected: [] })\r\n render() { \r\n const { getWhiteList, loading, error } = this.props.data;\r\n if (loading) return \r\n if (error){\r\n const notFoundError = error.graphQLErrors.find(err => err.errorType === 'not_found' && err.path.length === 1)\r\n if (!notFoundError){\r\n return \r\n }\r\n }\r\n const employers = getWhiteList.organizationIds.filter(\r\n org => org.classType === 'flytsuite.employer'\r\n )\r\n .sort((a, b) => {\r\n if (a.name < b.name) return -1\r\n if (a.name > b.name) return 1\r\n return 0\r\n });\r\n return (\r\n \r\n \r\n
    \r\n
    \r\n \r\n \r\n

    Add Employers to white list

    \r\n \r\n \r\n \r\n \r\n
    \r\n
    \r\n this.setState({ employersToAdd })}\r\n />\r\n
    \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n

    Employers on White List

    \r\n
    \r\n {this.state.selected.length ? (\r\n
    \r\n {this.state.selected.length} Selected\r\n \r\n
    \r\n ) : null}\r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n Remove {this.state.selected.length} Employers\r\n \r\n \r\n \r\n
    \r\n {\r\n const isChecked = this.state.selected.find(item => item === employer._id) ? true : false\r\n return (\r\n \r\n
    \r\n this.onSelectedChange(employer._id, e.target.checked)} />\r\n
    \r\n {employer.name}\r\n
    \r\n
    \r\n
    \r\n )\r\n }}\r\n />\r\n
    \r\n \r\n
    \r\n )\r\n }\r\n}\r\n \r\nexport default compose(\r\n WithOrgData,\r\n graphql(\r\n WHITE_LIST,\r\n {\r\n options: props => ({\r\n variables: {\r\n _id: props.orgData.customer._id.replace('CUS-', 'WHL-')\r\n },\r\n pollInterval: ['cache-only', 'cache-first'].includes(props.fetchPolicy) ? undefined : 15000,\r\n fetchPolicy: props.fetchPolicy || 'network-only'\r\n }),\r\n props: props => {\r\n const defaultWl = {\r\n _id: props.ownProps.orgData.customer._id.replace('CUS-', 'WHL-'),\r\n organizationIds: [],\r\n __typename: 'WhiteList'\r\n }\r\n if (props.ownProps.useDefault){\r\n return {\r\n ...props,\r\n data: {\r\n ...props.data,\r\n useDefault: undefined,\r\n error: undefined,\r\n getWhiteList: defaultWl\r\n }\r\n }\r\n }\r\n return props\r\n }\r\n }\r\n ),\r\n graphql(\r\n SET_WHITE_LIST,\r\n {\r\n name: 'setWhiteList'\r\n }\r\n )\r\n)(Employer);","import React, { Component } from 'react';\r\nimport { graphql } from 'react-apollo';\r\nimport gql from 'graphql-tag';\r\nimport LoadingContent from './LoadingContent';\r\nimport { Alert, List, Checkbox, Icon, Input, Row, Col, Button } from 'antd';\r\nimport _ from 'lodash';\r\n\r\nconst SEARCH_LOCATIONS = gql`\r\nquery SearchLocations(\r\n $query: String!\r\n $limit: Int\r\n $bookmark: String\r\n){\r\n searchLocations(\r\n query: $query\r\n limit: $limit\r\n bookmark: $bookmark\r\n ){\r\n bookmark\r\n docs {\r\n _id\r\n ... on Location {\r\n name\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst SearchPrompt = () => (\r\n
    \r\n \r\n
    Search for locations by typing into the search bar
    \r\n
    \r\n)\r\n\r\nconst default_limit = 15;\r\n\r\nclass LocationResults extends Component {\r\n state = {\r\n error: null,\r\n selected: []\r\n }\r\n componentDidUpdate(prevProps){\r\n const { selected } = this.props;\r\n if (Array.isArray(selected) && Array.isArray(prevProps.selected)){\r\n if (selected.length !== prevProps.selected.length){\r\n this.setState({ selected })\r\n }\r\n }\r\n }\r\n onSelectedChange = (locationID, checked) => {\r\n var selected;\r\n if (checked) {\r\n selected = _.union(this.state.selected, [locationID])\r\n }else{\r\n selected = this.state.selected.filter(item => item !== locationID)\r\n }\r\n this.setState({ selected })\r\n if (this.props.onChange){\r\n this.props.onChange(selected)\r\n }\r\n }\r\n clearSelected = () => this.setState({ selected: [] })\r\n render (){\r\n const { searchLocations, loading, error, networkStatus } = this.props.data;\r\n const isFetchingMore = networkStatus === 3;\r\n if (loading && !isFetchingMore) return ;\r\n if (error) return (\r\n \r\n )\r\n return (\r\n \r\n \r\n \r\n {this.state.selected.length ? (\r\n
    \r\n {this.state.selected.length} Selected\r\n \r\n
    \r\n ) : null}\r\n \r\n {\r\n this.props.action && (\r\n \r\n {this.props.action}\r\n \r\n )\r\n }\r\n
    \r\n
    \r\n {\r\n const isChecked = this.state.selected.find(item => item === location._id) ? true : false\r\n return (\r\n \r\n
    \r\n this.onSelectedChange(location._id, e.target.checked)} />\r\n
    \r\n {location.name}\r\n
    \r\n
    \r\n
    \r\n )\r\n }} />\r\n {searchLocations.docs.length >= (this.props.limit || default_limit) ?
    \r\n \r\n
    : null}\r\n
    \r\n
    \r\n )\r\n }\r\n}\r\n\r\nconst LocationResultsWithData = graphql(\r\n SEARCH_LOCATIONS,\r\n {\r\n options: props => ({\r\n variables: {\r\n query: props.query,\r\n limit: props.limit || default_limit,\r\n bookmark: props.bookmark\r\n },\r\n fetchPolicy: 'network-only',\r\n notifyOnNetworkStatusChange: true\r\n }),\r\n props: (props) => ({\r\n ...props,\r\n onLoadMore: () => {\r\n const { fetchMore, searchLocations: { bookmark } } = props.data;\r\n fetchMore({\r\n variables: {\r\n bookmark\r\n },\r\n updateQuery: (prevResult, { fetchMoreResult }) => { \r\n return {\r\n ...prevResult,\r\n searchLocations: {\r\n __typename: 'MangoQueryResult',\r\n bookmark: fetchMoreResult.searchLocations.bookmark,\r\n docs: [...prevResult.searchLocations.docs, ...fetchMoreResult.searchLocations.docs]\r\n }\r\n }\r\n }\r\n })\r\n }\r\n })\r\n }\r\n)(LocationResults)\r\n\r\nclass LocationSearch extends Component {\r\n state = {\r\n query: '',\r\n error: null\r\n }\r\n componentDidCatch(error) {\r\n this.setState({ error })\r\n }\r\n onSearch = (query) => {\r\n this.setState({ query, error: null })\r\n }\r\n renderContent = () => {\r\n if (this.state.error){\r\n return (\r\n \r\n )\r\n }\r\n if (this.state.query){\r\n return (\r\n \r\n )\r\n }else{\r\n return this.props.searchPrompt || \r\n }\r\n }\r\n render() {\r\n return (\r\n
    \r\n \r\n {this.renderContent()}\r\n \r\n )\r\n }\r\n}\r\n \r\nexport default LocationSearch","import React from 'react';\r\nimport LoadingContent from './LoadingContent';\r\n\r\nconst withLoading = (options) => (Component) => props => {\r\n const dataIndex = (options && options.dataIndex) || 'data';\r\n if (props[dataIndex] && props[dataIndex].loading){\r\n let props = options && options.loadingProps;\r\n return \r\n }\r\n return \r\n}\r\n\r\nexport default withLoading","import React from 'react';\r\nimport { Alert } from 'antd';\r\n\r\nconst withError = (options) => (Component) => (props) => {\r\n const dataIndex = (options && options.dataIndex) || 'data';\r\n const error = props[dataIndex] && props[dataIndex].error;\r\n const render = options && options.render;\r\n if (error){\r\n if (typeof render === 'function'){\r\n const renderedError = render(props[dataIndex], options)\r\n if (renderedError) return renderedError\r\n }\r\n const errorProps = options && options.errorProps;\r\n const message = (options && options.message) || 'An error occurred'\r\n const description = (options && options.description) || error.message;\r\n return \r\n }\r\n return \r\n}\r\n\r\nexport default withError","import React, { Component } from 'react';\r\nimport { graphql } from 'react-apollo';\r\nimport compose from 'lodash.flowright';\r\nimport gql from 'graphql-tag';\r\nimport WithOrgData from '../../../WithOrgData';\r\nimport { Alert, Row, Col, Button, message, Popconfirm, List, Checkbox, Modal, Icon, Input } from 'antd';\r\nimport LocationSearch from '../../../LocationSearch';\r\nimport EmployerSearch from '../../../EmployerSearch';\r\nimport _ from 'lodash';\r\nimport withLoading from '../../../WithLoading';\r\nimport withError from '../../../WithError';\r\nimport { Link } from 'react-router-dom';\r\nimport pluralize from 'pluralize';\r\nimport { withRouter } from 'react-router-dom';\r\nimport './index.less';\r\nimport {WhiteListFragment} from \"../../../../Queries/WhiteList\";\r\n\r\nconst WHITE_LIST = gql`\r\nquery WhiteList($_id: ID!){\r\n getWhiteList(_id: $_id){\r\n _id\r\n locationToEmployer {\r\n locationID {\r\n _id\r\n name\r\n }\r\n employerIDs {\r\n _id\r\n name\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst SET_WHITE_LIST = gql`\r\nmutation SetWhiteList(\r\n $_id: ID\r\n $customerID: ID!\r\n $tpID: ID!\r\n $locationToEmployer: [LocationToEmployerMapInput]\r\n){\r\n setWhiteList(\r\n _id: $_id\r\n customerID: $customerID\r\n tpID: $tpID\r\n locationToEmployer: $locationToEmployer\r\n ){\r\n ...WhiteListFragment\r\n }\r\n}\r\n${WhiteListFragment}\r\n`\r\n\r\nconst LocationSearchPrompt = () => (\r\n
    \r\n \r\n
    Search for locations by typing into the search bar
    \r\n
    \r\n)\r\n\r\nclass Location extends Component {\r\n state = {\r\n locationSearchOpen: false,\r\n locationFilter: '',\r\n locationsToAdd: [],\r\n employersToAdd: [],\r\n selectedEmployers: [],\r\n addingEmployers: false,\r\n addingLocations: false\r\n }\r\n componentDidUpdate(prevProps) {\r\n const prevLocation = prevProps.match.params.location;\r\n const currentLocation = this.getSelectedLocation();\r\n if (!prevLocation && currentLocation){\r\n this.props.history.replace(`/app/masterdata/whitelist/location/${currentLocation}`);\r\n }\r\n if (prevLocation !== currentLocation){\r\n this.setState({ selectedEmployers: [] });\r\n }\r\n }\r\n openLocationSearch = () => {\r\n this.setState({ locationSearchOpen: true, locationsToAdd: [] });\r\n }\r\n closeLocationSearch = () => {\r\n this.setState({ locationSearchOpen: false, locationsToAdd: [] })\r\n }\r\n addEmployers = () => {\r\n const { customer, transporter } = this.props.orgData;\r\n const { setWhiteList, data } = this.props;\r\n const locationToEmployer = data.getWhiteList ? data.getWhiteList.locationToEmployer || [] : [];\r\n const locationID = this.getSelectedLocation();\r\n const location = locationToEmployer.find(loc => loc.locationID._id === locationID);\r\n const employers = location ? location.employerIDs || [] : [];\r\n const employerIDs = employers.map(emp => emp._id);\r\n\r\n const lte = locationToEmployer.map(loc => {\r\n var result = {\r\n locationID: loc.locationID._id\r\n }\r\n if (loc.locationID._id === locationID){\r\n result.employerIDs = _.union(employerIDs, this.state.employersToAdd);\r\n }else{\r\n result.employerIDs = loc.employerIDs.map(emp => emp._id)\r\n }\r\n return result\r\n })\r\n this.setState({ addingEmployers: true });\r\n setWhiteList({\r\n variables: {\r\n _id: customer._id.replace('CUS-', 'WHL-'),\r\n tpID: transporter._id,\r\n customerID: customer._id,\r\n locationToEmployer: lte\r\n }\r\n })\r\n .then(() => {\r\n message.success(`Successfully added ${this.state.employersToAdd.length} employers to ${location.locationID.name}`);\r\n this.setState({ employersToAdd: [] });\r\n })\r\n .catch(error => {\r\n console.error(error);\r\n message.error(\"Failed to add employers to location\")\r\n })\r\n .then(() => this.setState({ addingEmployers: false }))\r\n }\r\n removeEmployers = () => {\r\n const { customer, transporter } = this.props.orgData;\r\n const { setWhiteList, data } = this.props;\r\n const locationToEmployer = data.getWhiteList ? data.getWhiteList.locationToEmployer || [] : [];\r\n const locationID = this.getSelectedLocation();\r\n const location = locationToEmployer.find(loc => loc.locationID._id === locationID);\r\n const employers = location ? location.employerIDs || [] : [];\r\n const employerIDs = employers.map(emp => emp._id);\r\n\r\n const lte = locationToEmployer.map(loc => {\r\n var result = {\r\n locationID: loc.locationID._id\r\n }\r\n if (loc.locationID._id === locationID){\r\n result.employerIDs = employerIDs.filter(emp => !this.state.selectedEmployers.includes(emp));\r\n }else{\r\n result.employerIDs = loc.employerIDs.map(emp => emp._id)\r\n }\r\n return result\r\n })\r\n\r\n setWhiteList({\r\n variables: {\r\n _id: customer._id.replace('CUS-', 'WHL-'),\r\n tpID: transporter._id,\r\n customerID: customer._id,\r\n locationToEmployer: lte\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setWhiteList: {\r\n __typename: 'WhiteList',\r\n _id: customer._id.replace('CUS-', 'WHL-'),\r\n locationToEmployer: locationToEmployer.map(loc => {\r\n var result = {\r\n __typename: 'LocationToEmployerMap',\r\n locationID: loc.locationID\r\n }\r\n if (loc.locationID._id === locationID){\r\n result.employerIDs = employers.filter(emp => !this.state.selectedEmployers.includes(emp._id));\r\n }else{\r\n result.employerIDs = loc.employerIDs\r\n }\r\n return result\r\n })\r\n }\r\n }\r\n })\r\n .then(() => {\r\n message.success(`Successfully removed ${this.state.selectedEmployers.length} employers to ${location.locationID.name}`);\r\n this.setState({ selectedEmployers: [] });\r\n })\r\n .catch(error => {\r\n console.error(error);\r\n message.error(\"Failed to add employers to location\")\r\n })\r\n\r\n }\r\n addLocations = () => {\r\n const { customer, transporter } = this.props.orgData;\r\n const { setWhiteList, data } = this.props;\r\n const locationToEmployer = data.getWhiteList.locationToEmployer || [];\r\n const oldLocItems = locationToEmployer.map(loc => {\r\n return {\r\n locationID: loc.locationID._id,\r\n employerIDs: loc.employerIDs.map(emp => emp._id)\r\n }\r\n })\r\n const locItems = this.state.locationsToAdd.map(loc => ({\r\n locationID: loc,\r\n employerIDs: []\r\n }))\r\n const lte = _.unionBy(oldLocItems, locItems, 'locationID')\r\n this.setState({ addingLocations: true })\r\n setWhiteList({\r\n variables: {\r\n _id: customer._id.replace('CUS-', 'WHL-'),\r\n tpID: transporter._id,\r\n customerID: customer._id,\r\n locationToEmployer: lte\r\n }\r\n })\r\n .then(() => {\r\n message.success(`Succesfully added ${this.state.locationsToAdd.length} locations to white list`)\r\n this.closeLocationSearch()\r\n })\r\n .catch(error => {\r\n console.error(error)\r\n message.error(\"Failed to add locations to white list\")\r\n })\r\n .then(() => this.setState({ addingLocations: false }))\r\n }\r\n removeLocation = (id) => {\r\n const { customer, transporter } = this.props.orgData;\r\n const { setWhiteList, data } = this.props;\r\n const currentLocationID = this.props.match.params.location;\r\n const locationToEmployer = data.getWhiteList.locationToEmployer || [];\r\n const newLocItems = locationToEmployer.filter(loc => loc.locationID._id !== id);\r\n const lte = newLocItems.map(loc => {\r\n return {\r\n locationID: loc.locationID._id,\r\n employerIDs: loc.employerIDs.map(emp => emp._id)\r\n }\r\n })\r\n if (currentLocationID === id){\r\n var path = `/app/masterdata/whitelist/location`;\r\n if (lte.length){\r\n path = path + `/${lte[0].locationID}`\r\n }\r\n this.props.history.push(path)\r\n }\r\n setWhiteList({\r\n variables: {\r\n _id: customer._id.replace('CUS-', 'WHL-'),\r\n tpID: transporter._id,\r\n customerID: customer._id,\r\n locationToEmployer: lte\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setWhiteList: {\r\n __typename: 'WhiteList',\r\n _id: data.getWhiteList._id,\r\n locationToEmployer: newLocItems\r\n }\r\n }\r\n })\r\n .then(() => {\r\n message.success(`Succesfully removed location from white list`)\r\n })\r\n .catch(error => {\r\n console.error(error)\r\n message.error(\"Failed to add locations to white list\")\r\n })\r\n }\r\n getSelectedLocation = () => {\r\n const { locationToEmployer } = this.props.data.getWhiteList;\r\n const { match } = this.props;\r\n var selectedLoc = match.params.location;\r\n if (!selectedLoc && locationToEmployer && locationToEmployer.length){\r\n selectedLoc = locationToEmployer[0].locationID._id;\r\n }\r\n return selectedLoc\r\n }\r\n onEmployerChecked = (employerID, checked) => {\r\n var selectedEmployers;\r\n if (checked) {\r\n selectedEmployers = _.union(this.state.selectedEmployers, [employerID])\r\n }else{\r\n selectedEmployers = this.state.selectedEmployers.filter(item => item !== employerID)\r\n }\r\n this.setState({ selectedEmployers })\r\n }\r\n renderLocationContent = () => {\r\n const { locationToEmployer } = this.props.data.getWhiteList;\r\n const location = locationToEmployer.find(item => item.locationID._id === this.getSelectedLocation())\r\n if (location) {\r\n const employers = location.employerIDs || [];\r\n const employerList = (\r\n
    \r\n \r\n \r\n

    White Listed Employers for {location.locationID.name}

    \r\n \r\n \r\n \r\n Remove Selected Employers\r\n \r\n \r\n
    \r\n {\r\n const isChecked = this.state.selectedEmployers.includes(emp._id);\r\n return (\r\n \r\n
    \r\n this.onEmployerChecked(emp._id, e.target.checked)} />\r\n
    \r\n {emp.name}\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 {employers.length ? employerList : (\r\n
    \r\n

    {location.locationID.name} has no white listed employers

    \r\n

    If a location has no white listed employers, the location is considered white listed.

    \r\n

    To add employers, use the search on the right.

    \r\n

    If you don't want {location.locationID.name} to be white listed, then \r\n this.removeLocation(location.locationID._id)}>\r\n \r\n \r\n this location.

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

    Add Employers to {location.locationID.name}

    \r\n \r\n \r\n Add Selected Employers\r\n \r\n
    \r\n
    \r\n this.setState({ employersToAdd })}\r\n />\r\n
    \r\n \r\n
    \r\n )\r\n }\r\n return (\r\n
    \r\n

    \r\n Location does not exist in white list\r\n

    \r\n

    Please choose a different location or add a

    \r\n
    \r\n )\r\n }\r\n renderLocations = () => {\r\n const { locationToEmployer } = this.props.data.getWhiteList;\r\n const selectedLoc = this.getSelectedLocation();\r\n const locations = locationToEmployer.sort((a, b) => {\r\n if (a.locationID.name < b.locationID.name) return -1\r\n if (a.locationID.name > b.locationID.name) return 1\r\n return 0\r\n })\r\n const filteredLocations = locations.filter(loc => {\r\n if (this.state.locationFilter){\r\n if (loc.locationID.name && loc.locationID.name.toLowerCase().indexOf(this.state.locationFilter)){\r\n return false\r\n }else{\r\n return true\r\n }\r\n }else{\r\n return true\r\n }\r\n })\r\n return (\r\n
    \r\n

    Locations

    \r\n }\r\n placeholder=\"Filter locations\"\r\n onChange={(e) => this.setState({ locationFilter: e.target.value })}\r\n style={{ marginBottom: '1rem' }}\r\n />\r\n
    \r\n {\r\n const isSelected = selectedLoc === item.locationID._id;\r\n const style = {\r\n background: isSelected ? '#1890ff' : undefined,\r\n color: isSelected ? 'white' : undefined\r\n }\r\n const textStyle = {\r\n color: isSelected ? 'white' : undefined\r\n }\r\n const buttonStyle = {\r\n borderColor: isSelected ? 'white' : undefined,\r\n background: isSelected ? 'transparent' : undefined,\r\n color: isSelected ? 'white' : undefined\r\n }\r\n var renderText = {item.locationID.name}\r\n if (!isSelected) {\r\n renderText = {item.locationID.name}\r\n }\r\n const employers = item.employerIDs || [];\r\n var desc = {employers.length} {pluralize('Employer', employers.length)};\r\n if (!employers.length){\r\n desc = WHITELISTED (No employers)\r\n }\r\n return (\r\n this.removeLocation(item.locationID._id)}>\r\n
    \r\n Add Location\r\n
    \r\n )\r\n // const renderItem = (item) => (\r\n // \r\n // {item.locationID.name}\r\n // \r\n // )\r\n // return (\r\n // \r\n // )\r\n }\r\n render() {\r\n const { getWhiteList } = this.props.data;\r\n const { customer } = this.props.orgData;\r\n var hasLocations = false;\r\n if (getWhiteList && getWhiteList.locationToEmployer && getWhiteList.locationToEmployer.length){\r\n hasLocations = true;\r\n }\r\n return (\r\n \r\n {hasLocations ? (\r\n \r\n \r\n
    \r\n {this.renderLocations()}\r\n
    \r\n \r\n \r\n {this.renderLocationContent()}\r\n \r\n
    \r\n ) : (\r\n
    \r\n

    No locations are white listed for {customer.name}

    \r\n Add Locations\r\n
    \r\n )}\r\n \r\n
    \r\n this.setState({ locationsToAdd }))}\r\n selected={this.state.locationsToAdd}\r\n searchPrompt={}\r\n />\r\n
    \r\n \r\n
    \r\n )\r\n }\r\n}\r\n\r\nconst withErrorRender = ({ error }, { message }) => {\r\n const notFoundError = error.graphQLErrors.find(err => err.errorType === 'not_found' && err.path.length === 1)\r\n if (!notFoundError){\r\n return \r\n }\r\n return null\r\n}\r\n \r\nexport default compose(\r\n withRouter,\r\n WithOrgData,\r\n graphql(\r\n WHITE_LIST,\r\n {\r\n options: props => ({\r\n variables: {\r\n _id: props.orgData.customer._id.replace('CUS-', 'WHL-')\r\n },\r\n pollInterval: ['cache-only', 'cache-first'].includes(props.fetchPolicy) ? undefined : 15000,\r\n fetchPolicy: props.fetchPolicy || 'network-only'\r\n }),\r\n props: props => {\r\n const defaultWl = {\r\n _id: props.ownProps.orgData.customer._id.replace('CUS-', 'WHL-'),\r\n locationToEmployer: [],\r\n __typename: 'WhiteList'\r\n }\r\n if (props.ownProps.useDefault){\r\n return {\r\n ...props,\r\n useDefault: undefined,\r\n data: {\r\n ...props.data,\r\n error: undefined,\r\n getWhiteList: defaultWl\r\n }\r\n }\r\n }\r\n return props\r\n }\r\n }\r\n ),\r\n graphql(\r\n SET_WHITE_LIST,\r\n {\r\n name: 'setWhiteList'\r\n }\r\n ),\r\n withLoading({ loadingProps: { style: { margin: '5rem 0' } } }),\r\n withError({ message: 'Failed to load location white list data', render: withErrorRender })\r\n)(Location);","import React, { Component } from 'react';\r\nimport { graphql, withApollo } from 'react-apollo';\r\nimport compose from 'lodash.flowright';\r\nimport gql from 'graphql-tag';\r\nimport WithOrgData from '../../../WithOrgData';\r\nimport LoadingContent from '../../../LoadingContent';\r\nimport {Alert, Row, Col, Card, message, Switch, Tooltip} from 'antd';\r\nimport Person from './Person';\r\nimport Employer from './Employer';\r\nimport { withRouter } from 'react-router-dom';\r\nimport Location from './Location';\r\nimport {withUserGroups} from \"../../../userGroup\";\r\nimport {QueryGetWhiteList} from \"../../../../Queries/WhiteList\";\r\n\r\nconst SET_WHITE_LIST = gql`\r\nmutation SetWhiteList(\r\n $_id: ID\r\n $customerID: ID!\r\n $tpID: ID!\r\n $organizationIds: [ID]\r\n){\r\n setWhiteList(\r\n _id: $_id\r\n customerID: $customerID\r\n tpID: $tpID\r\n organizationIds: $organizationIds\r\n ){\r\n _id\r\n organizationIds {\r\n ... on Customer {\r\n _id\r\n name\r\n classType\r\n }\r\n ... on Employer {\r\n _id\r\n name\r\n classType\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nclass WhiteList extends Component {\r\n onCustomerSwitchChange = (checked) => {\r\n const { customer, transporter } = this.props.orgData;\r\n\r\n const employers = this.props.data.getWhiteList.organizationIds.filter(\r\n org => org.classType === 'flytsuite.employer'\r\n );\r\n var organizations = [...employers];\r\n if (checked) {\r\n organizations.push({\r\n ...customer,\r\n classType: 'flytsuite.customer'\r\n })\r\n }\r\n const organizationIds = organizations.map(org => org._id)\r\n this.props.setWhiteList({\r\n variables: {\r\n _id: customer._id.replace('CUS-', 'WHL-'),\r\n tpID: transporter._id,\r\n customerID: customer._id,\r\n organizationIds\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setWhiteList: {\r\n __typename: 'WhiteList',\r\n _id: this.props.data.getWhiteList._id,\r\n organizationIds: organizations\r\n }\r\n }\r\n })\r\n .then(() => message.success(\"White list updated successfully\"))\r\n .catch((error) => {\r\n console.error(error)\r\n message.error(\"Failed to update white list\")\r\n })\r\n }\r\n renderContent = () => {\r\n const { getWhiteList, loading, error } = this.props.data;\r\n const { useDefault, userGroups } = this.props;\r\n\r\n const hasWhitelistAllGroup = userGroups.findIndex((group) => group === \"flytsuite.whitelist.whitelistall\") > -1;\r\n\r\n if (loading) return \r\n if (error) return \r\n const currentTab = this.props.match.params.tab;\r\n const renderTab = () => {\r\n switch (currentTab) {\r\n case 'person':\r\n return (\r\n
    \r\n \r\n
    \r\n )\r\n case 'employer':\r\n return (\r\n
    \r\n \r\n
    \r\n )\r\n case 'location':\r\n default:\r\n return (\r\n
    \r\n \r\n
    \r\n )\r\n }\r\n }\r\n const customerWhitelisted = getWhiteList.organizationIds.find(\r\n org => org._id === this.props.orgData.customer._id\r\n )\r\n\r\n const wlAllSwitch = (\r\n \r\n )\r\n\r\n return (\r\n
    \r\n
    \r\n \r\n \r\n White list all {this.props.orgData.customer.name} passengers\r\n \r\n \r\n {!hasWhitelistAllGroup ? (\r\n \r\n {wlAllSwitch}\r\n \r\n ) : wlAllSwitch }\r\n\r\n \r\n \r\n
    \r\n { !customerWhitelisted ? (\r\n this.props.history.push(`/app/masterdata/whitelist/${key}`)}\r\n >\r\n {renderTab()}\r\n \r\n ) : null }\r\n
    \r\n )\r\n }\r\n render() { \r\n return (\r\n \r\n \r\n \r\n

    ISN White List

    \r\n \r\n
    \r\n {this.renderContent()}\r\n
    \r\n )\r\n }\r\n}\r\n \r\nexport default compose(\r\n WithOrgData,\r\n withApollo,\r\n withUserGroups,\r\n graphql(\r\n QueryGetWhiteList,\r\n {\r\n options: props => ({\r\n variables: {\r\n _id: props.orgData.customer._id.replace('CUS-', 'WHL-')\r\n },\r\n pollInterval: 15000,\r\n fetchPolicy: 'network-only'\r\n }),\r\n props: props => {\r\n const defaultWl = {\r\n _id: props.ownProps.orgData.customer._id.replace('CUS-', 'WHL-'),\r\n organizationIds: [],\r\n personIds: [],\r\n locationToEmployer: [],\r\n __typename: 'WhiteList'\r\n }\r\n var error = props.data.error;\r\n if (error){\r\n const notFoundError = error.graphQLErrors.find(err => err.errorType === 'not_found' && err.path.length === 1)\r\n if (notFoundError){\r\n return {\r\n ...props,\r\n useDefault: true,\r\n data: {\r\n ...props.data,\r\n error: undefined,\r\n loading: false,\r\n getWhiteList: defaultWl\r\n }\r\n }\r\n }\r\n }\r\n return {\r\n ...props,\r\n data: {\r\n ...props.data,\r\n getWhiteList: {\r\n ...defaultWl,\r\n ...(props.data.getWhiteList || {})\r\n }\r\n }\r\n }\r\n }\r\n }\r\n ),\r\n graphql(\r\n SET_WHITE_LIST,\r\n {\r\n name: 'setWhiteList'\r\n }\r\n ),\r\n withRouter\r\n)(WhiteList);","import React from 'react';\r\nimport { Query } from 'react-apollo';\r\nimport gql from 'graphql-tag';\r\nimport { Alert } from 'antd';\r\n\r\nconst query = gql`\r\n query {\r\n customer @client {\r\n _id\r\n name\r\n }\r\n }\r\n`\r\n\r\n// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default (Component) => {\r\n return props => (\r\n \r\n {({data, loading, error}) => {\r\n if (loading) return null\r\n if (error) return \r\n console.log('customer data', data);\r\n return \r\n }}\r\n \r\n )\r\n}","import React from 'react';\r\nimport { Row, Col, Layout, Button, Icon, Alert, Spin, Form, Select, DatePicker, Tooltip, Input } from 'antd';\r\nimport moment from 'moment';\r\nimport { Query, withApollo } from 'react-apollo';\r\nimport withCustomer from '../../WithCustomer';\r\nimport withTransporter from '../../WithTransporter';\r\n\r\nconst { Header, Sider, Content } = Layout;\r\nconst FormItem = Form.Item;\r\nconst { Option } = Select;\r\nconst { RangePicker } = DatePicker;\r\n\r\nconst siderStyle = {\r\n borderStyle: 'solid',\r\n borderWidth: '0 1px',\r\n borderColor: '#ededed',\r\n background: '#ffffff',\r\n overflow: 'auto'\r\n}\r\n\r\nconst HeaderRowLayout = {\r\n type: 'flex',\r\n style: {\r\n alignItems: 'center'\r\n }\r\n}\r\n\r\nexport const formItemLayout = {\r\n style: {\r\n marginBottom: 0\r\n },\r\n};\r\n\r\nconst dateFormat = 'MM/DD/YYYY';\r\n\r\nexport class ReportLayout extends React.Component {\r\n constructor(props){\r\n super(props);\r\n this.state = {\r\n siderHidden: false\r\n }\r\n }\r\n componentDidMount() {\r\n const { siderHidden } = this.props;\r\n if (siderHidden) {\r\n this.setState({ siderHidden });\r\n }\r\n }\r\n toggleSider = () => {\r\n this.setState({ siderHidden: !this.state.siderHidden })\r\n }\r\n render(){\r\n const { title, renderSiderContent, renderReport } = this.props;\r\n const { siderHidden } = this.state;\r\n return \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n

    {title}

    \r\n
    \r\n \r\n \r\n \r\n {/* {print && \r\n \r\n }\r\n {csv && \r\n \r\n } */}\r\n \r\n \r\n
    \r\n\r\n
    \r\n \r\n \r\n \r\n {renderSiderContent && renderSiderContent()}\r\n \r\n \r\n \r\n {renderReport && renderReport()}\r\n \r\n \r\n
    \r\n }\r\n}\r\n\r\nexport const ReportLoading = () => (\r\n Generating Report...\r\n)\r\n\r\nexport const ReportNoData = () => 'No data returned from your criteria'\r\n\r\nexport const ReportError = ({error}) => (\r\n \r\n)\r\n\r\nexport const CustomerFormItem = ({ form: { getFieldDecorator }, customerID, customerList }) => (\r\n\r\n {getFieldDecorator('customerID', {\r\n initialValue: customerID || customerList[0]._id,\r\n rules: [\r\n {\r\n required: true, message: 'Customer is required'\r\n }\r\n ]\r\n })(\r\n \r\n )}\r\n\r\n)\r\nexport class DateRangeFormItem extends React.Component {\r\n componentDidMount(){\r\n this.initialize()\r\n }\r\n componentDidUpdate(){\r\n if (!this.props.form.getFieldValue('daterange')){\r\n this.initialize()\r\n }\r\n \r\n }\r\n initialize = () => {\r\n this.props.form.setFieldsValue({\r\n daterange: [moment().startOf('month'), moment()]\r\n })\r\n }\r\n render(){\r\n const { form: {getFieldDecorator}, includeReset = true } = this.props;\r\n return (\r\n \r\n
    \r\n {getFieldDecorator('daterange', {\r\n rules: [\r\n {type: 'array', required: true, message: \"Date range is required\"}\r\n ]\r\n })(\r\n current && current > moment().endOf('day').add(1, 'day')} format={dateFormat}/>\r\n )} \r\n {includeReset && \r\n \r\n }\r\n
    \r\n
    \r\n )\r\n }\r\n}\r\nexport class TimeRangeFormItem extends React.Component {\r\n componentDidMount(){\r\n this.initialize()\r\n }\r\n componentDidUpdate(){\r\n if (!this.props.form.getFieldValue('timerange')){\r\n this.initialize()\r\n }\r\n \r\n }\r\n initialize = () => {\r\n this.props.form.setFieldsValue({\r\n timerange: [moment().startOf('month'), moment()]\r\n })\r\n }\r\n render(){\r\n const { form: {getFieldDecorator}, includeReset = true } = this.props;\r\n return (\r\n \r\n
    \r\n {getFieldDecorator('timerange', {\r\n rules: [\r\n {type: 'array', required: true, message: \"Time range is required\"}\r\n ]\r\n })(\r\n current && current > moment().endOf('day').add(1, 'day')} format=\"YYYY-MM-DD HH:mm:ss\"/>\r\n )} \r\n {includeReset && \r\n \r\n }\r\n
    \r\n
    \r\n )\r\n }\r\n}\r\nexport const GenerateReportFormItem = ({ resetReport }) => (\r\n\r\n \r\n \r\n\r\n)\r\n\r\nconst selectProps = {\r\n showSearch: true,\r\n optionFilterProp: \"children\",\r\n filterOption: (input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0\r\n}\r\n\r\nexport const DepartureFormItem = ({ form: { getFieldDecorator }, departureList }) => (\r\n\r\n {getFieldDecorator('departureID', {\r\n initialValue: \"\"\r\n })(\r\n \r\n )}\r\n\r\n)\r\n\r\nexport const DestinationFormItem = ({ form: { getFieldDecorator }, destinationList }) => (\r\n \r\n {getFieldDecorator('destinationID', {\r\n initialValue: \"\"\r\n })(\r\n \r\n )}\r\n \r\n)\r\n\r\nexport const EmployerFormItem = ({ form: { getFieldDecorator }, employerList }) => (\r\n \r\n {getFieldDecorator('employerID', {\r\n initialValue: \"\"\r\n })(\r\n \r\n )}\r\n \r\n)\r\n\r\nexport const FinalizeFormItem = ({ form: { getFieldDecorator }, label=\"Finalized\", fieldName=\"finalized\" }) => (\r\n \r\n {getFieldDecorator(fieldName, {\r\n initialValue: 'FINALIZED'\r\n })(\r\n \r\n )}\r\n \r\n)\r\n\r\nexport const PaxNameFormItem = ({ form: { getFieldDecorator } }) => (\r\n \r\n {getFieldDecorator('paxname', {\r\n initialValue: \"\"\r\n })(\r\n \r\n )}\r\n \r\n)\r\n\r\nexport const CgoNameFormItem = ({ form: { getFieldDecorator } }) => (\r\n \r\n {getFieldDecorator('cgoname', {\r\n initialValue: \"\"\r\n })(\r\n \r\n )}\r\n \r\n)\r\n\r\nexport const ReportResult = ({header: { title, dateRange, sortedBy }, render}) => (\r\n
    \r\n \r\n

    {title}

    \r\n \r\n {dateRange &&\r\n \r\n {sortedBy && Sorted By: {sortedBy}}\r\n From {moment(dateRange.start).format('YYYY-MM-DD')} to {moment(dateRange.end).format('YYYY-MM-DD')}\r\n \r\n }\r\n \r\n
    \r\n {render}\r\n
    \r\n)\r\n\r\nclass BaseReport extends React.Component {\r\n constructor(props){\r\n super(props);\r\n this.state = this.getInitialState()\r\n }\r\n getInitialState = () => ({\r\n report: null\r\n })\r\n componentDidMount(){\r\n this.initializeDateRange()\r\n } \r\n initializeDateRange = () => {\r\n this.props.form.setFieldsValue({\r\n daterange: [moment().startOf('month'), moment()]\r\n })\r\n }\r\n query = async (variables) => {\r\n const { reportQuery } = this.props;\r\n if (reportQuery){\r\n const { data, loading, error } = await this.props.client.query({\r\n query: reportQuery,\r\n variables,\r\n fetchPolicy: 'network-only'\r\n })\r\n this.setState({ report: {data, loading, error, variables} });\r\n }\r\n }\r\n renderReport = () => {\r\n const { renderReport } = this.props;\r\n const { report } = this.state;\r\n if (report){\r\n const { data, loading, error } = this.state.report;\r\n try{\r\n if (loading) return 'Generating Report...'\r\n if (error) throw Error(error)\r\n if (!data) return null \r\n const report = renderReport({data})\r\n if (report) return report\r\n return 'No Data'\r\n }\r\n catch(error){\r\n console.error(error)\r\n return \r\n }\r\n }\r\n return null\r\n }\r\n resetReport = () => {\r\n this.setState(this.getInitialState());\r\n this.props.form.resetFields()\r\n this.initializeDateRange()\r\n }\r\n renderSiderContent = () => {\r\n const { customer, transporter, form: { getFieldDecorator }, formQuery: { query, variables }, renderSiderContent } = this.props;\r\n if (!query) return null\r\n return (\r\n \r\n {({ data, loading, error }) => {\r\n try{\r\n if (loading) return \r\n if (error) throw Error(error)\r\n return (\r\n \r\n
    this.props.generateReport(e, this.props.form, this.query)}>\r\n \r\n {getFieldDecorator('customerID', {\r\n initialValue: customer._id,\r\n rules: [\r\n {\r\n required: true, message: 'Customer is required'\r\n }\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('daterange', {\r\n rules: [\r\n {type: 'array', required: true, message: \"Date range is required\"}\r\n ]\r\n })(\r\n current && current > moment().endOf('day').add(1, 'day')} format={dateFormat}/>\r\n )} \r\n \r\n {renderSiderContent && renderSiderContent(data, getFieldDecorator, formItemLayout)}\r\n \r\n \r\n \r\n \r\n
    \r\n
    \r\n )\r\n }\r\n catch(error){\r\n console.error(error)\r\n return \r\n }\r\n }}\r\n
    \r\n )}\r\n render(){\r\n const { title } = this.props;\r\n return (\r\n \r\n )\r\n }\r\n}\r\n\r\nexport default withApollo(withCustomer(withTransporter(Form.create()(BaseReport))))","import React from 'react';\r\nimport { RadialChart, DiscreteColorLegend } from 'react-vis';\r\n\r\nclass IsnNullAndOverride extends React.Component {\r\n render(){\r\n const { data } = this.props;\r\n console.log(data);\r\n const nulls = data.filter(pax => !pax.lastIsnResultWithHeader && (\r\n pax.authorization && pax.authorization.brdRestriction_Isn && pax.authorization.brdRestriction_Isn.status !== \"OVERRIDDEN\"\r\n ));\r\n const overs = data.filter(pax => pax.authorization && pax.authorization.brdRestriction_Isn && pax.authorization.brdRestriction_Isn.status === \"OVERRIDDEN\")\r\n if (!nulls.length && !overs.length){\r\n return (\r\n
    \r\n

    No Data to Generate Report

    \r\n
    \r\n )\r\n }\r\n console.log('nulls', nulls)\r\n console.log('overs', overs)\r\n const nullColor = 'rgb(255, 128, 128)';\r\n const overColor = 'rgb(128, 255, 128)';\r\n const chartData = [\r\n {\r\n angle: nulls.length,\r\n label: `${nulls.length} No ISN Result`,\r\n style: {\r\n fill: nullColor,\r\n stroke: nullColor\r\n }\r\n },\r\n {\r\n angle: overs.length,\r\n label: `${overs.length} Override`,\r\n style: {\r\n fill: overColor,\r\n stroke: overColor\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\nexport default IsnNullAndOverride","import React from 'react';\r\nimport { graphql } from 'react-apollo';\r\nimport gql from 'graphql-tag';\r\nimport { RadialChart, DiscreteColorLegend } from 'react-vis/dist';\r\nimport { Alert } from 'antd';\r\n\r\nclass IsnCardStatus extends React.Component {\r\n render(){\r\n const { persons } = this.props;\r\n const { getIsnCredential, loading, error } = this.props.data;\r\n if (loading) return \"Loading\";\r\n if (error) return \r\n const noIsnCard = persons.length - getIsnCredential.length;\r\n const hasIsnCard = persons.length - noIsnCard;\r\n const red = 'rgb(255, 128, 128)';\r\n const green = 'rgb(128, 255, 128)';\r\n const data = [\r\n hasIsnCard && {\r\n angle: hasIsnCard,\r\n label: `${hasIsnCard} Has ISN Card`,\r\n style: {\r\n fill: green,\r\n stroke: green\r\n }\r\n },\r\n noIsnCard && (\r\n {\r\n angle: noIsnCard,\r\n label: `${noIsnCard} No ISN Card`,\r\n style: {\r\n fill: red,\r\n stroke: red\r\n }\r\n }\r\n )\r\n ]\r\n\r\n if (!data.length) {\r\n return (\r\n
    \r\n

    No Data to Generate Report

    \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\nconst CREDS = gql`\r\nquery Creds($persons: [ID]!){\r\n getIsnCredential(personIDs: $persons){\r\n _id\r\n }\r\n}\r\n`\r\n\r\nexport default graphql(\r\n CREDS,\r\n {\r\n options: props => {\r\n const persons = props.persons\r\n return {\r\n variables: {\r\n persons\r\n }\r\n }\r\n }\r\n }\r\n)(IsnCardStatus)","import React from 'react';\r\nimport { Row, Col, Form, Alert, Card, Table, Spin, Tabs, List } from 'antd';\r\nimport gql from 'graphql-tag';\r\nimport moment from 'moment';\r\nimport { Query } from 'react-apollo';\r\nimport { filterNull, deDupeSort, YesNo, get } from '../../../common/util';\r\nimport { withApollo } from 'react-apollo';\r\nimport {\r\n CustomerFormItem, \r\n DateRangeFormItem, \r\n GenerateReportFormItem, \r\n ReportLayout, \r\n ReportLoading,\r\n ReportResult,\r\n ReportNoData,\r\n ReportError,\r\n EmployerFormItem\r\n} from './Report';\r\n\r\nimport '../../../css/Report.css';\r\nimport WithOrgData from '../../WithOrgData';\r\nimport IsnNullAndOverride from '../../charts/isn/IsnNullAndOverride';\r\nimport IsnCardStatus from '../../charts/isn/IsnCardStatus';\r\nimport _ from 'lodash';\r\n\r\nconst FORM_QUERY = gql`\r\nquery FormQuery($tpID: ID!, $customerID: ID!){\r\n NodeDepartureList(\r\n tpID: $tpID\r\n customerID: $customerID\r\n classType: \"flytsuite.paxnode\"\r\n ){\r\n _id\r\n name\r\n }\r\n NodeDestinationList(\r\n tpID: $tpID\r\n customerID: $customerID\r\n classType: \"flytsuite.paxnode\"\r\n ){\r\n _id\r\n name\r\n }\r\n PaxEmployerList(\r\n tpID: $tpID\r\n customerID: $customerID\r\n ){\r\n _id\r\n name\r\n }\r\n customerList @client {\r\n _id\r\n name\r\n }\r\n customerList @client {\r\n _id\r\n name\r\n }\r\n}\r\n`\r\n\r\nconst REPORT_QUERY = gql`\r\nquery ReportQuery(\r\n $tpID: ID!\r\n $customerID: ID!\r\n $startDate: AWSDate!\r\n $endDate: AWSDate!\r\n $employerID: ID\r\n){\r\n reportIsn(\r\n tpID: $tpID\r\n customerID: $customerID\r\n startDate: $startDate\r\n endDate: $endDate\r\n employerID: $employerID\r\n ){\r\n _id\r\n personID {\r\n _id\r\n }\r\n currentCarrierID {\r\n _id\r\n desig\r\n scheduledFlightDate\r\n }\r\n departureID {\r\n _id\r\n name\r\n }\r\n checkInCred {\r\n type\r\n expiration\r\n }\r\n firstName\r\n lastName\r\n paxWeight\r\n bagCount\r\n bagWeight\r\n checkedInTime\r\n employerID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n authorization {\r\n onWhiteList\r\n brdRestriction_Isn {\r\n status\r\n type\r\n notes\r\n reason\r\n }\r\n }\r\n lastIsnResultWithHeader {\r\n error_message\r\n isn_customer\r\n quick_check_status\r\n reason\r\n isn_ownerid\r\n success\r\n selectedResult {\r\n isnStatus {\r\n shortLabel\r\n }\r\n allowed\r\n companyID\r\n quickCheckStatus\r\n errorMessage\r\n isnId\r\n firstName\r\n lastName\r\n companyName\r\n mostRecentTrainingQualificationExpirationName\r\n mostRecentTrainingExpirationDate\r\n assignedActivities\r\n dataAsOf\r\n reason\r\n reasonsForNonCompliance\r\n trainingDeficiencies\r\n trainingStatus\r\n }\r\n }\r\n }\r\n getOrganization(_id: $customerID){\r\n _id\r\n name\r\n }\r\n}\r\n`\r\n\r\nconst ISNTable = ({ data, ...rest }) => {\r\n const filteredData = filterNull(data);\r\n if (!filteredData.length) return null\r\n const dataSource = filteredData.map(cgo => ({\r\n ...cgo,\r\n key: cgo._id\r\n }\r\n ))\r\n const columns = [\r\n {\r\n title: 'Passenger Name',\r\n key: 'passengerName',\r\n render: (_, record) => {\r\n const { firstName, lastName } = record;\r\n return `${lastName}, ${firstName}`\r\n }\r\n },\r\n {\r\n title: 'Customer',\r\n key: 'customer',\r\n dataIndex: 'customerID',\r\n render: cust => cust.name\r\n },\r\n {\r\n title: 'Employer',\r\n key: 'employer',\r\n dataIndex: 'employerID',\r\n render: emp => emp.name\r\n },\r\n {\r\n title: 'Base',\r\n key: 'base',\r\n dataIndex: 'departureID',\r\n render: dep => dep.name\r\n },\r\n {\r\n title: 'Destination',\r\n key: 'destination',\r\n dataIndex: 'destinationID',\r\n render: dest => dest.name\r\n },\r\n {\r\n title: 'First Name',\r\n key: 'firstName',\r\n dataIndex: 'firstName'\r\n },\r\n {\r\n title: 'First Name',\r\n key: 'lastName',\r\n dataIndex: 'lastName'\r\n },\r\n {\r\n title: 'Allowed',\r\n key: 'allowed',\r\n dataIndex: 'lastIsnResultWithHeader',\r\n render: (lastIsn) => {\r\n try{\r\n return YesNo(lastIsn.selectedResult.allowed)\r\n }\r\n catch(err){\r\n console.warn(err.message)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'Credential Type',\r\n key: 'credentialType',\r\n dataIndex: 'checkInCred',\r\n render: cred => {\r\n if (!cred) return null\r\n try{\r\n return cred.type.replace(/_/g, \" \")\r\n }catch(error){\r\n console.warn(error)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'Credential Expires',\r\n key: 'credentialExpires',\r\n dataIndex: 'checkInCred',\r\n render: cred => {\r\n if (!cred) return null\r\n try{\r\n return cred.expiration\r\n }catch(error){\r\n console.warn(error)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'ISN ID',\r\n key: 'isnID',\r\n dataIndex: 'lastIsnResultWithHeader',\r\n render: (lastIsn) => {\r\n try{\r\n return lastIsn.selectedResult.isnId || No ISN Number\r\n }\r\n catch(err){\r\n console.warn(err.message)\r\n return No ISN Number\r\n }\r\n }\r\n },\r\n {\r\n title: Most Recent Training
    Expiration Qualification Name
    ,\r\n key: 'mostRecentTrainingExpirationQualificationName',\r\n dataIndex: 'lastIsnResultWithHeader',\r\n render: (lastIsn) => {\r\n try{\r\n return lastIsn.selectedResult.mostRecentTrainingQualificationExpirationName \r\n }\r\n catch(err){\r\n console.warn(err.message)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'Error Message',\r\n key: 'errorMessage',\r\n dataIndex: 'lastIsnResultWithHeader',\r\n render: (lastIsn) => {\r\n try{\r\n return lastIsn.selectedResult.errorMessage\r\n }\r\n catch(err){\r\n console.warn(err.message)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'Success',\r\n key: 'success',\r\n dataIndex: 'lastIsnResultWithHeader',\r\n render: (lastIsn) => {\r\n try{\r\n return lastIsn.success\r\n }\r\n catch(err){\r\n console.warn(err.message)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'Company ID',\r\n key: 'companyID',\r\n dataIndex: 'lastIsnResultWithHeader',\r\n render: (lastIsn) => {\r\n try{\r\n return lastIsn.selectedResult.companyID\r\n }\r\n catch(err){\r\n console.warn(err.message)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'Company Name',\r\n key: 'companyName',\r\n dataIndex: 'lastIsnResultWithHeader',\r\n render: (lastIsn) => {\r\n try{\r\n return lastIsn.selectedResult.companyName\r\n }\r\n catch(err){\r\n console.warn(err.message)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'Received',\r\n key: 'received',\r\n dataIndex: 'lastIsnResultWithHeader',\r\n render: () => Not in data model\r\n },\r\n {\r\n title: Most Recent Training
    Expiration Date
    ,\r\n key: 'mostRecentTrainingExpirationDate',\r\n dataIndex: 'lastIsnResultWithHeader',\r\n render: (lastIsn) => {\r\n try{\r\n return lastIsn.selectedResult.mostRecentTrainingExpirationDate\r\n }\r\n catch(err){\r\n console.warn(err.message)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'Reason',\r\n key: 'reason',\r\n dataIndex: 'lastIsnResultWithHeader',\r\n render: (lastIsn) => {\r\n try{\r\n return lastIsn.selectedResult.reason\r\n }\r\n catch(err){\r\n console.warn(err.message)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'Data As Of',\r\n key: 'dataAsOf',\r\n dataIndex: 'lastIsnResultWithHeader',\r\n render: (lastIsn) => {\r\n try{\r\n return lastIsn.selectedResult.dataAsOf\r\n }\r\n catch(err){\r\n console.warn(err.message)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'Training Deficiencies',\r\n key: 'trainingDeficiencies',\r\n dataIndex: 'lastIsnResultWithHeader',\r\n render: (lastIsn) => {\r\n try{\r\n return lastIsn.selectedResult.trainingDeficiencies\r\n }\r\n catch(err){\r\n console.warn(err.message)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'Override Reason',\r\n key: 'overrideReason',\r\n dataIndex: 'authorization',\r\n render: (auth) => {\r\n try{\r\n return auth.brdRestriction_Isn.type.replace(/_/g, \" \")\r\n }\r\n catch(err){\r\n console.warn(err.message)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'Override Authorizing User',\r\n key: 'overrideAuthorizingUser',\r\n dataIndex: 'authorization',\r\n render: () => Not in data model\r\n },\r\n {\r\n title: 'Override Created',\r\n key: 'overrideCreated',\r\n dataIndex: 'authorization',\r\n render: (auth) => {\r\n try{\r\n return moment(auth.brdRestriction_Isn.createdTs).format('YYYY-MM-DD HH:mm:ss')\r\n }\r\n catch(err){\r\n console.warn(err.message)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'Override Notes',\r\n key: 'overrideNotes',\r\n dataIndex: 'authorization',\r\n render: (auth) => {\r\n try{\r\n return auth.brdRestriction_Isn.notes\r\n }\r\n catch(err){\r\n console.warn(err.message)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'Override Expires',\r\n key: 'overrideExpires',\r\n dataIndex: 'authorization',\r\n render: (auth) => {\r\n try{\r\n return auth.brdRestriction_Isn.scheduledFlightDate\r\n }\r\n catch(err){\r\n console.warn(err.message)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'Quick Check Status',\r\n key: 'quickCheckStatus',\r\n dataIndex: 'authorization',\r\n render: (lastIsn) => {\r\n try{\r\n const { quickCheckStatus } = lastIsn.selectedResult;\r\n var color = 'initial';\r\n if (quickCheckStatus.toLowerCase() === 'green'){\r\n color = 'green'\r\n }\r\n else if (quickCheckStatus.toLowerCase() === 'red'){\r\n color = 'red'\r\n }\r\n return {quickCheckStatus}\r\n }\r\n catch(err){\r\n console.warn(err.message)\r\n return null\r\n }\r\n }\r\n },\r\n {\r\n title: 'Documentation',\r\n key: 'documentation',\r\n render: () => Not in data model\r\n },\r\n ]\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n\r\nconst getEmployersWithNoIsnCard = (data) => {\r\n // const employers = data.map(item => item.employer && item.employer._id).filter(item => item);\r\n const employers = data.filter(item => {\r\n if (!item.employerID) return false\r\n const lastIsn = item.lastIsnResultWithHeader;\r\n const selectedResult = lastIsn && lastIsn.selectedResult;\r\n const isnId = selectedResult && selectedResult.isnId;\r\n if (isnId){\r\n return false\r\n }\r\n return true\r\n }).map(pax => pax.employerID);\r\n const uniqueEmployers = _(employers)\r\n .groupBy('name')\r\n .map((items, name) => ({ name, count: items.length }))\r\n .value()\r\n .sort((a, b) => {\r\n if (a.name < b.name) return -1\r\n if (a.name > b.name) return 1\r\n return 0\r\n })\r\n return uniqueEmployers\r\n}\r\n\r\nclass ISNReport extends React.Component {\r\n constructor(props){\r\n super(props);\r\n this.state = {\r\n report: null\r\n }\r\n }\r\n handleSubmit = (e) => {\r\n e.preventDefault();\r\n this.props.form.validateFieldsAndScroll((err, values) => {\r\n if (!err) {\r\n const { transporter } = this.props.orgData;\r\n const { customerID, daterange, departureID, destinationID, cgoname, finalized, employerID } = values;\r\n const variables = {\r\n name: cgoname,\r\n tpID: transporter._id,\r\n customerID,\r\n departureID,\r\n destinationID,\r\n employerID,\r\n finalized: finalized === 'FINALIZED',\r\n startDate: daterange[0].toISOString().split(\"T\")[0],\r\n endDate: daterange[1].toISOString().split(\"T\")[0]\r\n }\r\n this.query(variables)\r\n }\r\n });\r\n }\r\n query = async (variables) => {\r\n this.setState({ report: {loading: true }});\r\n try{\r\n const { data, error } = await this.props.client.query({\r\n query: REPORT_QUERY,\r\n variables,\r\n fetchPolicy: 'network-only'\r\n })\r\n this.setState({ report: {data, error, variables} });\r\n }catch(error){\r\n console.error(error);\r\n this.setState({ report: {data: null, error, variables} });\r\n }\r\n this.setState({ loading: false })\r\n }\r\n renderReport = () => {\r\n const { report } = this.state;\r\n if (report){\r\n const { transporter } = this.props.orgData;\r\n var transporterName;\r\n const customerName = get(report, r => r.data.getOrganization.name) || 'Customer not found';\r\n try{\r\n transporterName = transporter.name;\r\n }\r\n catch(error){\r\n transporterName = Transporter not found\r\n }\r\n const { data, loading, error } = report;\r\n try{\r\n if (loading) return \r\n if (error) throw Error(error)\r\n if (!data) return null \r\n const { reportIsn } = data;\r\n const { startDate, endDate } = report.variables;\r\n if (reportIsn.length){\r\n var employers = getEmployersWithNoIsnCard(reportIsn);\r\n return {transporterName} ISN Report for {customerName},\r\n dateRange: {\r\n start: startDate,\r\n end: endDate\r\n }\r\n }} render={\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n pax.personID && pax.personID._id).filter(pax => pax)} />\r\n \r\n \r\n \r\n \r\n \r\n
    \r\n (\r\n \r\n {item.name} ({item.count})\r\n \r\n )} />\r\n
    \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 catch(error){\r\n return \r\n }\r\n }\r\n return null\r\n }\r\n resetReport = () => {\r\n this.setState({ report: null });\r\n this.props.form.resetFields()\r\n }\r\n renderSiderContent = () => {\r\n const { orgData: {customer, transporter}, form } = this.props;\r\n const customerID = get(customer, c => c._id);\r\n return (\r\n \r\n {({ data, loading, error }) => {\r\n try{\r\n if (loading) return \r\n if (error) throw Error(error)\r\n const { PaxEmployerList, customerList } = data;\r\n const employerList = deDupeSort(\r\n filterNull(PaxEmployerList),\r\n emp => emp._id,\r\n emp => emp.name\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 catch(error){\r\n console.error(error)\r\n return \r\n }\r\n }}\r\n
    \r\n )}\r\n render(){\r\n const { report } = this.state;\r\n var csv = false;\r\n try{\r\n csv = report.data.reportIsn.length ? true : false\r\n }\r\n catch(TypeError){\r\n csv = false;\r\n }\r\n return (\r\n \r\n )\r\n }\r\n}\r\n\r\nexport default withApollo( WithOrgData( Form.create()(ISNReport) ) )","import React from 'react';\r\nimport { Auth } from '@aws-amplify/auth';\r\nimport NotAuthorized from './NotAuthorized';\r\n// import hoistNonReactStatics from 'hoist-non-react-statics';\r\n\r\nconst withUserPermissions = (options={}, RenderComponent=NotAuthorized) => {\r\n const { requiredGroups, renderComponentProps={} } = options;\r\n return Component => {\r\n return class UserPermissions extends React.PureComponent {\r\n state = {\r\n userGroups: null\r\n }\r\n componentDidMount(){\r\n Auth.currentSession()\r\n .then(session => {\r\n const userGroups = session.idToken.payload['cognito:groups']\r\n this.setState({ userGroups })\r\n })\r\n .catch(error => console.error('Failed to get user', error))\r\n }\r\n render(){\r\n const { userGroups } = this.state;\r\n if (!userGroups) return null;\r\n const authorizedGroups = userGroups.filter(group => {\r\n if (Array.isArray(requiredGroups)){\r\n return requiredGroups.includes(group)\r\n }\r\n return group === requiredGroups\r\n });\r\n if (authorizedGroups.length){\r\n return \r\n }else{\r\n return \r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport default withUserPermissions","import React from 'react';\r\nimport { graphql, Query } from 'react-apollo';\r\nimport compose from 'lodash.flowright';\r\nimport gql from 'graphql-tag';\r\nimport withUserPermissions from '../withUserPermissions';\r\nimport moment from 'moment';\r\nimport WithOrgData from '../WithOrgData';\r\nimport LoadingContent from '../LoadingContent';\r\nimport { Table, Radio, Row, Col, DatePicker, Alert, message } from 'antd';\r\nimport commonColumns from '../../common/table/columns';\r\n\r\nconst PASSENGERS = gql`\r\nquery Passengers(\r\n $tpID: ID!\r\n $scheduledFlightDate: AWSDate!\r\n){\r\n getTSAPassengers(\r\n tpID: $tpID\r\n scheduledFlightDate: $scheduledFlightDate\r\n ){\r\n _id\r\n lastName\r\n firstName\r\n employerID {\r\n _id\r\n name\r\n }\r\n departureID {\r\n _id\r\n name\r\n }\r\n destinationID {\r\n _id\r\n name\r\n }\r\n authorization {\r\n onWhiteList\r\n noFlyListed\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst SET_NO_FLY = gql`\r\nmutation SetNoFly(\r\n $_id: ID!\r\n $tpID: ID!\r\n $value: Boolean!\r\n){\r\n setPassengerNoFlyCheck(\r\n _id: $_id\r\n tpID: $tpID\r\n value: $value\r\n ){\r\n _id\r\n authorization {\r\n noFlyListed\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst DATE_FORMAT = \"YYYY-MM-DD\"\r\n\r\nclass TsaCheck extends React.Component {\r\n state = {\r\n date: moment().add(1, 'day')\r\n }\r\n renderContent = () => {\r\n const { transporter } = this.props.orgData;\r\n return (\r\n \r\n {\r\n ({ data, loading, error }) => {\r\n if (loading) return \r\n if (error) return \r\n return (\r\n record._id}\r\n size=\"middle\"\r\n pagination={false}\r\n columns={[\r\n ...commonColumns.pax.some([ \"name\", \"employer\", \"departure\", \"destination\" ]),\r\n {\r\n title: 'No Fly List',\r\n key: 'noFlyList',\r\n render: (_, record) => {\r\n const noFlyListed = (record.authorization && record.authorization.noFlyListed) ? true : false\r\n const value = noFlyListed.toString()\r\n return (\r\n this.setNoFly(record._id, e.target.value)}>\r\n Not On List\r\n On List\r\n \r\n )\r\n }\r\n }\r\n ]}\r\n />\r\n )\r\n }\r\n }\r\n \r\n )\r\n }\r\n setNoFly = async (_id, value) => {\r\n const { transporter } = this.props.orgData;\r\n this.props.setNoFly({\r\n variables: {\r\n _id,\r\n tpID: transporter._id,\r\n value\r\n },\r\n optimisticResponse: {\r\n __typename: 'Mutation',\r\n setPassengerNoFlyCheck: {\r\n _id,\r\n __typename: 'PaxNode',\r\n authorization: {\r\n __typename: 'Authorization',\r\n noFlyListed: value === 'true'\r\n }\r\n }\r\n }\r\n })\r\n .then(() => {\r\n message.success('Passenger successfully updated')\r\n })\r\n .catch((error) => {\r\n console.error(error)\r\n message.error('Failed to update passenger')\r\n })\r\n }\r\n handleDateChange = (date) => {\r\n this.setState({ date: date ? date : moment() })\r\n }\r\n render(){\r\n return (\r\n \r\n \r\n
    \r\n

    TSA Check

    \r\n \r\n \r\n current < moment().startOf('day')} />\r\n \r\n \r\n {this.renderContent()}\r\n \r\n )\r\n }\r\n}\r\n\r\nexport default compose(\r\n withUserPermissions({\r\n requiredGroups: 'flytsuite.tsa'\r\n }),\r\n WithOrgData,\r\n graphql(\r\n SET_NO_FLY,\r\n {\r\n name: 'setNoFly'\r\n }\r\n )\r\n)(TsaCheck)","import { Layout } from 'antd';\r\nimport cn from 'classnames';\r\nimport CenteredLoadingScreen from 'components/CenteredLoadingScreen';\r\nimport FlightTimesHeader from 'components/flights/times/FlightTimesHeader';\r\nimport LiveCargo from 'components/live-2/cargo';\r\nimport LiveFlights from 'components/live-2/flights';\r\nimport LivePassengers from 'components/live-2/passengers';\r\nimport { MDAircraft, MDContract, MDCustomer, MDEmployer, MDLocation, MDPersonnel, MDPilot } from 'components/masterdata-2-0/pages';\r\nimport MobileScreenAlert from 'components/MobileScreenWarningAlert';\r\nimport QuartermasterMainPage from 'components/quartermaster/pages/quartermaster';\r\nimport { GlobalAppStateContext } from 'context/global-app-state';\r\nimport moment from 'moment';\r\nimport FuelTakenPage from 'pages/app/flytwatch/fuel-taken';\r\nimport FuelTakenReportPage from 'pages/app/flytwatch/fuel-taken-report';\r\nimport { FWHistoryEditorContextProvider } from 'pages/app/flytwatch/history-editor-page/editor';\r\nimport qs from 'qs';\r\nimport React, { lazy, useContext } from 'react';\r\nimport { Mutation } from 'react-apollo';\r\nimport { Prompt } from 'react-router';\r\nimport { Redirect, Route, Switch } from 'react-router-dom';\r\nimport { getAdminRoutes } from 'routes/admin';\r\nimport LiveFlightEditor from '../../containers/flighteditor/LiveFlightEditor';\r\nimport { CheckInPassengerFlight } from '../../Mutations/CheckInPassenger';\r\nimport CurrentOrg from '../CurrentOrg';\r\nimport MainScheduling from '../flights/scheduling/main';\r\nimport { PaxCheckIn } from '../PaxCheckIn';\r\nimport PrivateRoute from '../PrivateRoute';\r\nimport { ReportingInterface } from '../reporting';\r\nimport { renderDetail as renderReportDetail } from '../reporting/detail';\r\nimport { renderExport as renderReportExport } from '../reporting/export';\r\nimport { ReportDetailsWithData } from '../reporting/ReportDetails';\r\nimport { renderSummary as renderReportSummary } from '../reporting/summaries';\r\nimport { requireUserGroup, RequireUserGroup, withUserGroups } from '../userGroup';\r\nimport WithOrgData from '../WithOrgData';\r\nimport Dashboard from './dashboard/Dashboard';\r\nimport FlightsNav from './FlightsNav';\r\nimport NonPreferred from './masterdata/nonpreferred/NonPreferred.js';\r\nimport WhiteList from './masterdata/whitelisting/Whitelist';\r\nimport ISNReport from './report/ISN';\r\nimport TsaCheck from './TsaCheck';\r\nimport EmailTriggersPage from 'pages/app/management/email-triggers/email-triggers';\r\nimport useUserGroups from 'hooks/useUserGroups';\r\n\r\n// Use react lazy loading\r\n// https://reactgo.com/tutorial-reactlazy-react-suspense/\r\nconst FlytWatch = lazy(() => import('pages/app/flytwatch'));\r\nconst FlytWatchHistory = lazy(() => import('pages/app/flytwatch/history'));\r\nconst FlytWatchHistoryEditor = lazy(() => import('pages/app/flytwatch/history-editor-page'));\r\nconst FlytWatchHistoricalReportingPage = lazy(() => import('pages/app/flytwatch/historical-reporting'))\r\n\r\nconst basePath = \"/app/\";\r\n\r\n/** Removes padding from child component by using negative margins */\r\nconst removePadding = (Cp) => (props) => {\r\n return
    \r\n \r\n
    \r\n}\r\n\r\nconst { Content } = Layout;\r\n\r\nconst getReport = (type) => {\r\n switch (type) {\r\n case 'covid':\r\n return {\r\n title: 'Covid Pax Report',\r\n type: \"COVID\"\r\n }\r\n case 'vaccinated-passengers':\r\n return {\r\n title: 'Vaccinated Pax',\r\n description: 'Reports on whether or not passengers are vaccinated against Covid-19',\r\n type: 'PAX_COVID19_VAX'\r\n }\r\n case 'personnel-vax-details':\r\n return {\r\n title: 'Personnel Vaccine Details',\r\n description: 'Reports all personnel Covid-19 vaccination records',\r\n type: 'PERSON_COVID19_VAX_DETAILS'\r\n }\r\n case 'passenger':\r\n return {\r\n title: 'Passenger Report',\r\n type: 'PAX'\r\n }\r\n case 'cargo':\r\n return {\r\n title: 'Cargo Report',\r\n type: 'CGO'\r\n }\r\n case 'manifest':\r\n return {\r\n title: 'Manifest Report',\r\n type: 'MANIFEST'\r\n }\r\n case 'isn':\r\n return {\r\n title: 'ISN Report',\r\n type: 'ISN'\r\n }\r\n case 'hotfuel':\r\n return {\r\n title: 'Hot Fuel Report',\r\n type: 'PERSON_HOTFUEL'\r\n }\r\n case 'pax-isn-events':\r\n return {\r\n title: 'Pax ISN Events',\r\n type: 'PAX_ISN_EVENTS',\r\n description: 'Reports ISN events from passengers (overrides and non-green isn statuses)'\r\n }\r\n default:\r\n return\r\n }\r\n}\r\n\r\n/** Connect ReportingInterface state changes with routes */\r\nconst renderReportInterface = ({ history, match: { params: { type, tab, id } } }) => {\r\n const r = getReport(type);\r\n if (!r){\r\n return
    Unsupported report type
    \r\n }\r\n const onTabChange = (tab) => {\r\n history.push(basePath + `report/${type}/${tab}`);\r\n }\r\n\tconst onManifestExportClick = (flightID) => {\r\n history.push(basePath + `report/${type}/details/${id}/export/${flightID}`);\r\n }\r\n const onSelectedReportChange = (id, name) => {\r\n history.push({\r\n pathname: basePath + `report/${type}/details/${id}`,\r\n state: {\r\n reportName: name\r\n }\r\n });\r\n }\r\n return (\r\n \r\n )\r\n}\r\n\r\n/** Connect ReportDetails state changes with routes */\r\nconst renderReportDetails = ({ history, match: { params: { type, id, tab, flightID } } }) => {\r\n const onTabChange = (activeTab) => {\r\n history.push(basePath + `report/${type}/details/${id}/${activeTab}`);\r\n }\r\n\tconst onManifestExportClick = (flightID) => {\r\n history.push(basePath + `report/${type}/details/${id}/export/${flightID}`);\r\n }\r\n const onBackClicked = () => {\r\n history.push(basePath + `report/${type}`)\r\n }\r\n const r = getReport(type);\r\n if (!r) {\r\n return
    Unsupported report type
    \r\n }\r\n\r\n return (\r\n \r\n renderReportSummary(r.type, data)}\r\n renderDetail={(data) => renderReportDetail(r.type, data, onManifestExportClick)}\r\n renderExport={(reportId) => renderReportExport(r.type, reportId, flightID)}\r\n enableExport={true}\r\n />\r\n \r\n )\r\n}\r\n\r\n/** Render FlightEditor with flightid from route url */\r\nconst renderFlightEditor = ({ match: { params: { flightid } }, history }) => {\r\n return (\r\n history.push(basePath + 'flights')}\r\n onIDChange={(newID) => history.push(basePath + 'flights/' + newID)}\r\n />\r\n )\r\n}\r\n\r\nconst renderLayout = (component) => (props) => {\r\n const cmp = React.cloneElement(component, props);\r\n return (\r\n
    \r\n {cmp}\r\n
    \r\n )\r\n}\r\n\r\n/** Render PassengerCheckIn with personId from route url */\r\nconst renderPassengerCheckIn = (props) => {\r\n var personId = props.match.params.personId;\r\n let qsParams = qs.parse(props.location.search, { ignoreQueryPrefix: true });\r\n return renderLayout(\r\n \r\n {(checkIn, { data, loading, error }) => {\r\n return (\r\n \r\n {({ transporter }) => {\r\n return (\r\n props.history.push(qsParams.goBackTo) : undefined}\r\n onPersonSelect={(id) => props.history.push(basePath + 'passengers/checkin/' + id)}\r\n onSubmit={(values) => {\r\n checkIn({\r\n variables: {\r\n payload: values\r\n }\r\n })\r\n }}\r\n onClearSelection={() => props.history.push(basePath + 'passengers/checkin')}\r\n submitting={loading}\r\n submitError={error}\r\n submitSuccess={data && !loading && !error}\r\n submittedPassengerData={data && data.CheckInPassengerFlight}\r\n />\r\n )\r\n }}\r\n \r\n )\r\n }}\r\n \r\n )(props)\r\n}\r\n\r\nconst FlightsRoutes = React.memo(({ orgData: { customer }, userGroups }) => (\r\n <>\r\n {/* Displays warning when using on a small screen for unoptimized pages */}\r\n (\r\n \r\n )}\r\n />\r\n \r\n {getAdminRoutes()}\r\n \r\n } />\r\n } />\r\n \r\n \r\n }>\r\n \r\n } />\r\n }>\r\n history.push(basePath + 'flytwatch')\r\n }} />\r\n }\r\n />\r\n {\r\n let qsParams = qs.parse(location.search, { ignoreQueryPrefix: true });\r\n return }>\r\n history.push(basePath + \"flytwatch/history/editor/\" + airID + \"/\" + date + \"?tz=\" + tz, { historySearchUrl: location.pathname + location.search })}\r\n getFlightEditorHref={(airID, date, tz) => basePath + \"flytwatch/history/editor/\" + airID + \"/\" + date + \"?tz=\" + tz}\r\n onFormSubmit={({ flightDate, contractId, tz }) => {\r\n let params = []\r\n if (flightDate){\r\n params.push(`date=${flightDate}`)\r\n }\r\n if (contractId){\r\n params.push(`contractID=${contractId}`)\r\n }\r\n if (tz){\r\n params.push(`tz=${tz}`)\r\n }\r\n if (params.length){\r\n history.push(basePath + 'flytwatch/history?' + params.join('&'))\r\n }\r\n else\r\n {\r\n history.push(basePath + 'flytwatch/history')\r\n }\r\n }}\r\n />\r\n \r\n }} />\r\n {\r\n let qsParams = qs.parse(location.search, { ignoreQueryPrefix: true });\r\n return history.push(basePath + \"flytwatch/history?date=\" + params.date + '&tz=' + qsParams.tz)}\r\n onDiscard={() => history.push(basePath + \"flytwatch/history?date=\" + params.date + '&tz=' + qsParams.tz)}\r\n >\r\n }>\r\n {\r\n history.push(basePath + \"flytwatch/history?date=\" + params.date + '&tz=' + qsParams.tz);\r\n }}\r\n onDiscard={() => {\r\n history.push(basePath + \"flytwatch/history?date=\" + params.date + '&tz=' + qsParams.tz);\r\n }}\r\n aircraftID={params.aircraftID}\r\n flightDate={params.date}\r\n onPreview={() => history.push(basePath + \"flytwatch/history/preview/\" + params.aircraftID + \"/\" + params.date + '?tz=' + qsParams.tz)}\r\n renderPrompt={(valuesChanged, isApproved) => (\r\n {\r\n if (isApproved) return null\r\n if (location.pathname !== basePath + \"flytwatch/history/preview/\" + params.aircraftID + \"/\" + params.date){\r\n return \"You currently have unsaved data. Are you sure you want to leave?\"\r\n }\r\n return null;\r\n }}\r\n />\r\n )}\r\n />\r\n \r\n \r\n }} />\r\n {\r\n let qsParams = qs.parse(location.search, { ignoreQueryPrefix: true });\r\n return history.push(basePath + \"flytwatch/history?date=\" + params.date + '&tz=' + qsParams.tz)}\r\n onDiscard={() => history.push(basePath + \"flytwatch/history?date=\" + params.date + '&tz=' + qsParams.tz)}\r\n >\r\n }>\r\n {\r\n history.push(basePath + \"flytwatch/history/editor/\" + params.aircraftID + \"/\" + params.date + '?tz=' + qsParams.tz)\r\n }}\r\n onDiscard={() => {\r\n history.push(basePath + \"flytwatch/history?date=\" + params.date + '&tz=' + qsParams.tz);\r\n }}\r\n dispatchID={params.id}\r\n onReturnToEditor={() => {\r\n history.push(basePath + \"flytwatch/history/editor/\" + params.aircraftID + \"/\" + params.date + '?tz=' + qsParams.tz)\r\n }}\r\n useExternalEditorContext\r\n renderPrompt={(valuesChanged, isApproved) => (\r\n {\r\n if (isApproved) return null\r\n if (location.pathname !== basePath + \"flytwatch/history/editor/\" + params.aircraftID + \"/\" + params.date){\r\n return \"You currently have unsaved data. Are you sure you want to leave?\"\r\n }\r\n return null;\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 return }>\r\n \r\n \r\n }} />\r\n {\r\n let qsParams = qs.parse(location.search, { ignoreQueryPrefix: true });\r\n\r\n let newParams = {\r\n date: qsParams.date,\r\n reportType: qsParams.reportType\r\n }\r\n\r\n let pushHistory = () => history.push(basePath + \"flytwatch/fuel-taken?\" + qs.stringify(newParams));\r\n\r\n return }>\r\n {\r\n newParams.reportType = reportType;\r\n pushHistory();\r\n }}\r\n onDateChange={(date) => {\r\n newParams.date = date.format('YYYY-MM-DD');\r\n pushHistory();\r\n }}\r\n />\r\n \r\n }} />\r\n { \r\n return }>\r\n \r\n \r\n }} />\r\n {\r\n let qsParams = qs.parse(location.search, { ignoreQueryPrefix: true });\r\n let activeTab = qsParams.tab || 'outbound';\r\n return (\r\n history.replace(basePath + 'passengers?tab=' + tab)}\r\n />\r\n )\r\n }} />\r\n (\r\n \r\n \r\n \r\n )}\r\n />\r\n \r\n \r\n {!!(userGroups.includes('flytsuite.management.all') ||\r\n userGroups.includes('flytsuite.management.emailtriggers.all') ||\r\n userGroups.includes('flytsuite.master.all')) &&\r\n \r\n }\r\n ()} />\r\n \r\n \r\n \r\n \r\n \r\n \r\n {customer && (\r\n \r\n \r\n {/* Scheduling routes are defined by MainScheduling component */}\r\n \r\n \r\n \r\n \r\n \r\n } />\r\n \r\n \r\n \r\n )}\r\n\r\n {!customer && (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n } />\r\n \r\n \r\n )}\r\n\r\n \r\n \r\n))\r\n\r\n/**\r\n * Handles navigation and routes of flights branch of the application.\r\n */\r\nconst FlightsMain = (props) => {\r\n const { state: { sidebarCollapsed }, setState } = useContext(GlobalAppStateContext);\r\n const [ userGroups ] = useUserGroups();\r\n\r\n return(\r\n \r\n
    setState({ sidebarCollapsed: true })} />\r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\nexport default WithOrgData( withUserGroups( FlightsMain ) )","import PrivateRoute from 'components/PrivateRoute';\r\nimport AdminUserPage from 'pages/admin/user';\r\nimport FWChangesByConsoleReportPage from 'pages/app/admin/changes-by-console-report';\r\nimport FWBillingReportPage from 'pages/app/admin/flytwatch-billing-report';\r\nimport React from 'react';\r\n\r\nexport function getAdminRoutes() {\r\n return [\r\n } />,\r\n } />,\r\n } />\r\n ]\r\n}\r\n\r\n// const AdminRoutes = (props: any) => {\r\n// return <>\r\n// }/>\r\n// \r\n// }\r\n\r\n// export default AdminRoutes;","import { Table } from 'antd';\r\nimport React, { HTMLAttributes } from 'react';\r\nimport packageJson from '../../package.json';\r\n\r\nconst AboutApp: React.FC> = (props) => {\r\n let data = [\r\n {\r\n name: 'VERSION',\r\n value: packageJson.version\r\n }\r\n ]\r\n return
    \r\n {text}\r\n },\r\n {\r\n key: 'value',\r\n title: 'Value',\r\n dataIndex: 'value'\r\n }\r\n ]}\r\n pagination={false}\r\n showHeader={false}\r\n />\r\n
    \r\n}\r\n\r\nexport default AboutApp","// In production, we register a service worker to serve assets from local cache.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\r\n// cached resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\r\n// This link also includes instructions on opting out of this behavior.\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.1/8 is considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\nexport default function register(onChange) {\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 publicUrl = new URL(process.env.PUBLIC_URL, window.location);\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Lets check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl);\r\n\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.log(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://goo.gl/SC7cgQ'\r\n );\r\n });\r\n } else {\r\n // Is not local host. Just register service worker\r\n registerValidSW(swUrl, onChange);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl, onChange) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n installingWorker.onstatechange = () => {\r\n if (typeof onChange === 'function'){\r\n onChange(installingWorker);\r\n }\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the old content will have been purged and\r\n // the fresh content will have been added to the cache.\r\n // It's the perfect time to display a \"New content is\r\n // available; please refresh.\" message in your web app.\r\n console.log('New content is available; please refresh.');\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl)\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n if (\r\n response.status === 404 ||\r\n response.headers.get('content-type').indexOf('javascript') === -1\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister();\r\n });\r\n }\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport registerServiceWorker from '../registerServiceWorker';\r\n\r\ninterface ServiceWorkerProviderState extends ServiceWorker {\r\n updateAvailable: boolean,\r\n update: () => void\r\n}\r\n\r\nexport const ServiceWorkerContext = React.createContext(null);\r\n\r\nexport const ServiceWorkerConsumer = ({ children }) => {\r\n return \r\n {(serviceWorker: ServiceWorkerProviderState) => {\r\n if (!serviceWorker) return null;\r\n return children(serviceWorker)\r\n }}\r\n \r\n}\r\n\r\nexport default function ServiceWorkerProvider({ children }) {\r\n const [ sw, setSW ] = useState(null);\r\n useEffect(() => {\r\n registerServiceWorker((newSW: ServiceWorker) => {\r\n console.log('Service Worker Changed!', newSW.state);\r\n setSW({\r\n ...newSW,\r\n updateAvailable: newSW.state === 'installed',\r\n update: () => {\r\n newSW.postMessage({ type: 'SKIP_WAITING' });\r\n window.location.reload();\r\n }\r\n })\r\n })\r\n }, [])\r\n return \r\n {children}\r\n \r\n}","import Button, { ButtonProps } from 'antd/lib/button';\r\nimport React, { useState } from 'react';\r\nimport cn from 'classnames';\r\nimport MCIcon from 'components/icon';\r\nimport './style.less';\r\nimport { FeedbackFormModal } from 'components/feedback-form';\r\n\r\nexport interface FeedbackButtonProps extends Omit {\r\n\r\n}\r\n\r\nconst FeedbackButton: React.FC = (props) => {\r\n const [ modalOpen, setModalOpen ] = useState(false);\r\n return <>\r\n \r\n setModalOpen(false)}\r\n />\r\n \r\n}\r\n\r\nexport default FeedbackButton","import { Form, Input, Popover, Table } from 'antd';\r\nimport { FormComponentProps, ValidationRule } from 'antd/lib/form';\r\nimport { WrappedFormUtils } from 'antd/lib/form/Form';\r\nimport { InputProps } from 'antd/lib/input';\r\nimport { ColumnProps, TableProps } from 'antd/lib/table';\r\nimport useControlledState from 'hooks/useControlledState';\r\nimport React, { cloneElement, ReactElement, ReactNode, useEffect, useRef, useState } from 'react';\r\nimport './editable-pref-table-style.less';\r\n\r\ntype HandleSaveType = (key: string, getValue?: (value: any) => any) => void\r\n\r\nexport interface PrefRow {\r\n key: string,\r\n label: string,\r\n value: any,\r\n formRules?: ValidationRule[],\r\n inputProps?: InputProps,\r\n isText?: boolean,\r\n render?: (row: PrefRow, saveFn: HandleSaveType, cancelFn: () => void, form: WrappedFormUtils) => ReactElement,\r\n renderText?: (text: any) => ReactNode,\r\n renderedElementRefPropName?: string\r\n}\r\n\r\nexport interface EditablePrefTableProps extends Pick, 'size'> {\r\n data?: Array,\r\n editingKey?: string,\r\n onEditingKeyChange?: (key: string) => void,\r\n onSave?: (key: string, value: string) => void\r\n}\r\n\r\n// const PrevValueCell: React.FC = (props) => {\r\n\r\n// }\r\n\r\nconst EditablePrefTable: React.FC & FormComponentProps> = (props) => {\r\n \r\n const { getFieldDecorator } = props.form;\r\n const [ editingKey, setEditingKey ] = useControlledState('', props.editingKey, props.onEditingKeyChange);\r\n const [ isCancelled, setIsCancelled ] = useState(false);\r\n const inputRef = useRef(null);\r\n\r\n useEffect(() => {\r\n if (inputRef.current && editingKey && inputRef.current.focus){\r\n inputRef.current.focus();\r\n }\r\n else\r\n {\r\n console.warn('Cannot find input ref');\r\n console.log('ref:', inputRef);\r\n }\r\n\r\n if (isCancelled){\r\n setIsCancelled(false);\r\n }\r\n // eslint-disable-next-line\r\n }, [ editingKey ])\r\n\r\n function handleSave(key: string, getValue?: (value: any) => any){\r\n if (isCancelled) return;\r\n\r\n let validationStarted = false; // Needed because validateFieldsAndScroll doesn't work when field hasn't been changed.\r\n\r\n props.form.validateFieldsAndScroll((err, values) => {\r\n validationStarted = true;\r\n console.log('validating fields:', {err, values})\r\n if (!err){\r\n props.onSave?.(key, getValue ? getValue(values[key]) : values[key]);\r\n setEditingKey('');\r\n }\r\n })\r\n if (!validationStarted){\r\n setEditingKey('');\r\n }\r\n }\r\n\r\n function handleCancel(){\r\n setIsCancelled(true);\r\n setEditingKey('');\r\n }\r\n\r\n function renderValueCell(text: any, row: PrefRow): ReactNode {\r\n if (row.key === editingKey){\r\n let element: ReactElement;\r\n if (row.render){\r\n element = row.render(row, handleSave, handleCancel, props.form);\r\n element = cloneElement(element, { [row.renderedElementRefPropName || 'ref']: inputRef })\r\n }\r\n else if (row.isText){\r\n element = row.value;\r\n }\r\n else\r\n {\r\n element = handleSave(row.key)} \r\n onBlur={() => handleSave(row.key)} \r\n onKeyDown={(e) => {\r\n e.stopPropagation();\r\n if (e.keyCode === 27){\r\n handleCancel();\r\n }\r\n }}\r\n />\r\n }\r\n return \r\n \r\n {getFieldDecorator(row.key, { rules: row.formRules, initialValue: row.value })(element)}\r\n \r\n \r\n }\r\n if (row.isText){\r\n return row.value;\r\n }\r\n return setEditingKey(row.key)}\r\n style={{ paddingRight: 24 }}\r\n >\r\n {row.renderText ? row.renderText(text) : text}\r\n
    \r\n }\r\n\r\n const columns: ColumnProps[] = [\r\n {\r\n dataIndex: 'label',\r\n key: 'key',\r\n render: (txt) => {txt}\r\n },\r\n {\r\n dataIndex: 'value',\r\n key: 'value',\r\n render: renderValueCell\r\n }\r\n ]\r\n return \"editable-row\"}\r\n columns={columns}\r\n showHeader={false}\r\n pagination={false}\r\n rowKey=\"key\"\r\n size={props.size}\r\n />\r\n}\r\n\r\nexport default Form.create & FormComponentProps>()(EditablePrefTable)","import { Modal } from 'antd';\r\nimport { Hub } from '@aws-amplify/core';\r\nimport InputCognitoPhoneNumber from 'components/form/InputCognitoPhoneNumber';\r\nimport CognitoPhoneNumber from 'components/form/InputCognitoPhoneNumber/CognitoPhoneNumber';\r\nimport { validateCognitoPhoneNumber } from 'components/form/InputCognitoPhoneNumber/validator';\r\nimport { AuthContext } from 'context/auth';\r\nimport gql from 'graphql-tag';\r\nimport React, { useContext } from 'react';\r\nimport { useQuery } from 'react-apollo';\r\nimport withUserInfo from '../withUserInfo';\r\nimport EditablePrefTable from './EditablePrefTable';\r\nimport './preferences-style.css';\r\nimport './style.less';\r\n\r\nconst Account = (props) => {\r\n const { user } = useContext(AuthContext);\r\n\r\n const { data } = useQuery(gql`\r\n query {\r\n organization @client {\r\n _id\r\n name\r\n }\r\n }\r\n `);\r\n\r\n function getAttr(attrKey){\r\n if (user && user.attributes){\r\n return user.attributes[attrKey];\r\n }\r\n return;\r\n }\r\n\r\n function updateUserAttr(key, value){\r\n\r\n // Check if attribute has been changed before performing an update\r\n if (getAttr(key) === value){\r\n return; // No changes detected. Exit function.\r\n }\r\n Hub.dispatch('user', {\r\n event: 'updateUserAttributes',\r\n data: {\r\n attributes: {\r\n ...user.attributes,\r\n [key]: value\r\n }\r\n },\r\n message: 'Updating user attribute ' + key\r\n })\r\n }\r\n\r\n const defaultRules = [\r\n {\r\n required: true,\r\n message: 'This field is required'\r\n }\r\n ]\r\n\r\n return (\r\n
    \r\n

    Account Attributes

    \r\n {\r\n if (getAttr(key) === value){\r\n return;\r\n }\r\n if (key === 'email'){\r\n Modal.confirm({\r\n title: 'Are you sure?',\r\n content:
    \r\n

    Are you sure you want to change your email address? Changes to your email address requires re-verification.

    \r\n
    ,\r\n onOk: () => {\r\n updateUserAttr(key, value);\r\n }\r\n })\r\n return;\r\n }\r\n updateUserAttr(key, value);\r\n }}\r\n data={[\r\n {\r\n key: 'email',\r\n label: 'Email',\r\n value: getAttr('email'),\r\n inputProps: {\r\n type: 'email'\r\n },\r\n formRules: defaultRules\r\n },\r\n {\r\n key: 'given_name',\r\n label: 'First Name',\r\n value: getAttr('given_name'),\r\n formRules: defaultRules\r\n },\r\n {\r\n key: 'family_name',\r\n label: 'Last Name',\r\n value: getAttr('family_name'),\r\n formRules: defaultRules\r\n },\r\n {\r\n key: 'phone_number',\r\n label: 'Phone Number',\r\n value: getAttr('phone_number'),\r\n formRules: [\r\n {\r\n required: true, validator: validateCognitoPhoneNumber\r\n }\r\n ],\r\n render: (row, handleSave, handleCancel) => {\r\n const convertPN = (value: CognitoPhoneNumber) => value.toString()\r\n\r\n function handleEscPress(e: React.KeyboardEvent){\r\n e.stopPropagation();\r\n if (e.keyCode === 27){\r\n handleCancel();\r\n }\r\n }\r\n function handleEnterPress(){\r\n handleSave(row.key, convertPN);\r\n }\r\n return {\r\n handleSave(row.key, convertPN);\r\n }}\r\n onFocus={() => null}\r\n inputProps={{\r\n onKeyDown: handleEscPress,\r\n onPressEnter: handleEnterPress\r\n }}\r\n allowClear={false}\r\n />\r\n }\r\n },\r\n {\r\n key: 'custom:company_phone_number',\r\n label: 'Company Phone Number',\r\n value: getAttr('custom:company_phone_number'),\r\n formRules: [\r\n {\r\n required: false, validator: validateCognitoPhoneNumber\r\n }\r\n ],\r\n render: (row, handleSave, handleCancel) => {\r\n const convertPN = (value: CognitoPhoneNumber) => value ? value.toString() : ''\r\n\r\n function handleEscPress(e: React.KeyboardEvent){\r\n e.stopPropagation();\r\n if (e.keyCode === 27){\r\n handleCancel();\r\n }\r\n }\r\n function handleEnterPress(){\r\n handleSave(row.key, convertPN);\r\n }\r\n return {\r\n handleSave(row.key, convertPN);\r\n }}\r\n inputProps={{\r\n onKeyDown: handleEscPress,\r\n onPressEnter: handleEnterPress\r\n }}\r\n />\r\n }\r\n },\r\n {\r\n key: 'organization',\r\n label: 'Organization',\r\n value: data?.organization?.name,\r\n isText: true\r\n }\r\n ]}\r\n />\r\n
    \r\n )\r\n}\r\n\r\nexport default withUserInfo( Account )","import React from 'react';\r\nimport { Auth } from '@aws-amplify/auth';\r\nimport { Form, Input, Alert, Button } from 'antd';\r\n\r\nconst formItemLayout = {\r\n labelCol: {\r\n xs: { span: 24 },\r\n sm: { span: 8 },\r\n },\r\n wrapperCol: {\r\n xs: { span: 24 },\r\n sm: { span: 16 },\r\n },\r\n};\r\nconst tailFormItemLayout = {\r\n wrapperCol: {\r\n xs: {\r\n span: 24,\r\n offset: 0,\r\n },\r\n sm: {\r\n span: 16,\r\n offset: 8,\r\n },\r\n },\r\n};\r\n\r\nclass ChangePassword extends React.Component {\r\n state = {\r\n submitted: false,\r\n error: null,\r\n submitting: false\r\n }\r\n hasFailed = () => (\r\n this.state.submitted && this.state.error\r\n )\r\n hasSucceeded = () => (\r\n this.state.submitted && !this.state.error\r\n )\r\n submit = (e) => {\r\n e.preventDefault();\r\n this.setState({ submitting: true })\r\n this.props.form.validateFieldsAndScroll((err, values) => {\r\n if (!err) {\r\n Auth.currentAuthenticatedUser()\r\n .then(user => {\r\n return Auth.changePassword(user, values.oldPassword, values.password)\r\n .then(() => this.setState({ submitted: true, error: null }));\r\n })\r\n .catch(error => this.setState({ error, submitted: true }))\r\n .then(() => this.setState({ submitting: false }));\r\n }\r\n });\r\n }\r\n compareToFirstPassword = (rule, value, callback) => {\r\n const form = this.props.form;\r\n if (value && value !== form.getFieldValue('password')) {\r\n callback('Password and confirm password must be the same');\r\n } else {\r\n callback();\r\n }\r\n }\r\n \r\n validateToNextPassword = (rule, value, callback) => {\r\n const form = this.props.form;\r\n if (value && this.state.confirmDirty) {\r\n form.validateFields(['confirm'], { force: true });\r\n }\r\n callback();\r\n }\r\n render(){\r\n const { getFieldDecorator } = this.props.form;\r\n return (\r\n
    \r\n { this.hasFailed() ? : null}\r\n { this.hasSucceeded() ? : null}\r\n \r\n {getFieldDecorator('oldPassword', {\r\n rules: [\r\n {required: true, message: 'You must enter your old password to change your password.'}\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('password', {\r\n rules: [\r\n {required: true, message: 'You must enter your old password to change your password.'}\r\n ],\r\n validator: this.validateToNextPassword\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('confirm', {\r\n rules: [\r\n {required: true, message: 'You must enter your old password to change your password.'}\r\n ],\r\n validator: this.compareToFirstPassword\r\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 Form.create()(ChangePassword)","import { Button, Input, message } from 'antd';\r\nimport Alert, { AlertProps } from 'antd/lib/alert';\r\nimport Form, { FormComponentProps } from 'antd/lib/form';\r\nimport { Auth } from '@aws-amplify/auth';\r\nimport { Hub } from '@aws-amplify/core';\r\nimport { AuthContext } from 'context/auth';\r\nimport React, { useContext } from 'react';\r\n\r\nexport interface VerifyEmailAlertProps extends AlertProps {\r\n\r\n}\r\n\r\nconst EmailVerifyForm: React.FC = (props) => {\r\n const { getFieldDecorator } = props.form;\r\n\r\n function handleSubmit(event: React.FormEvent){\r\n event.preventDefault();\r\n props.form.validateFieldsAndScroll((err, values) => {\r\n if (!err){\r\n Hub.dispatch('user', {\r\n event: 'verifyEmail',\r\n data: {\r\n code: values.code\r\n },\r\n message: 'Verifying user'\r\n })\r\n }\r\n })\r\n }\r\n\r\n function resendCode(){\r\n Auth.verifyCurrentUserAttribute('email')\r\n .then(() => message.success('Successfully resent verification code'))\r\n .catch((err) => {\r\n message.error('Failed to resend verification code')\r\n console.error(err);\r\n })\r\n }\r\n\r\n return
    \r\n \r\n {getFieldDecorator('code', {\r\n rules: [{\r\n required: true, message: 'Please enter a valid verification code',\r\n }],\r\n })(\r\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 EmailVerifyFormWrapped = Form.create()(EmailVerifyForm);\r\n\r\nconst VerifyEmailAlert: React.FC = (props) => {\r\n const { user } = useContext(AuthContext);\r\n\r\n if (!user.attributes.email_verified){\r\n return \r\n

    You have received an email with a code at the address {user.attributes.email}. Please type in your verification code here:

    \r\n \r\n }\r\n style={{ marginBottom: '1rem' }}\r\n className=\"userprefs-email-verify-alert\"\r\n {...props}\r\n />\r\n }\r\n return null;\r\n}\r\n\r\nexport default VerifyEmailAlert","import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\n\r\ninterface WindowSize {\r\n width: number,\r\n height: number\r\n}\r\n\r\nfunction useWindowSize(): WindowSize {\r\n const [ size, setSize ] = useState({\r\n width: window.innerWidth,\r\n height: window.innerHeight\r\n });\r\n\r\n function onWindowSizeChange(){\r\n setSize({\r\n width: window.innerWidth,\r\n height: window.innerHeight\r\n });\r\n }\r\n\r\n useEffect(() => {\r\n window.addEventListener('resize', onWindowSizeChange);\r\n return () => {\r\n window.removeEventListener('resize', onWindowSizeChange);\r\n }\r\n }, [])\r\n\r\n return size;\r\n}\r\n\r\nexport default useWindowSize;","import React, { createContext, useReducer } from 'react';\r\nimport { Modal, Tabs } from 'antd';\r\nimport AccountAttributes from './AccountAttributes';\r\nimport ChangePassword from 'components/preferences/ChangePassword';\r\nimport VerifyEmailAlert from 'components/preferences/VerifyEmailAlert';\r\nimport useWindowSize from 'hooks/useWindowSize';\r\nimport windowSizes from 'common/windowSizes';\r\n\r\nexport const NavContext = createContext({ state: null, dispatch: null })\r\n\r\nexport function navReducer(state, action) {\r\n switch (action.type) {\r\n case 'push':\r\n return [...state, action.payload];\r\n case 'replace':\r\n const route = [...state];\r\n route.pop();\r\n route.push(action.payload);\r\n return route;\r\n case 'goBack':\r\n return [...state].pop();\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst UserPreferencesModal = (props) => {\r\n const [state, dispatch] = useReducer(navReducer, ['/account']);\r\n const windowSize = useWindowSize();\r\n\r\n const renderContent = () => (\r\n = windowSizes.large ? \"left\" : \"top\"}\r\n activeKey={state[state.length-1].split('/')[1]}\r\n onChange={(key) => dispatch({ type: 'replace', payload: '/' + key })}\r\n >\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 {renderContent()}\r\n \r\n \r\n )\r\n}\r\n\r\n// const WithMemoryRouter = (props) => {\r\n// return \r\n// \r\n// \r\n// }\r\n\r\nexport default UserPreferencesModal","import React from 'react';\r\nimport UserPreferencesModal from './preferences/Preferences';\r\n\r\nclass UserPreferencesWrapper extends React.Component {\r\n state = {\r\n visible: false\r\n }\r\n open = () => this.setState({ visible: true })\r\n close = () => this.setState({ visible: false })\r\n render(){\r\n const { component: Component, ...rest } = this.props;\r\n return (\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n}\r\n\r\nconst withUserPreferences = (component) => {\r\n return props => (\r\n \r\n )\r\n};\r\n\r\nexport default withUserPreferences","import {useEffect, useState} from \"react\";\r\nimport config from \"../config\";\r\nimport useInterval from \"../components/useInterval\";\r\n\r\nexport function useS3Config(){\r\n const [ S3Config, setS3Config ] = useState(null);\r\n\r\n\r\n /**\r\n * Fetches public application config file from S3.\r\n */\r\n function getConfig() {\r\n fetch(`https://${config.configS3Bucket}.s3.amazonaws.com/${config.configKey}`, {\r\n headers: {\r\n 'Access-Control-Allow-Origin': '*'\r\n },\r\n mode: 'cors',\r\n cache: 'no-cache'\r\n })\r\n .then((resp) => resp.json())\r\n .then((data) => {\r\n if (!S3Config || (data.maintenance.enabled !== S3Config.maintenance.enabled) || S3Config.maintenance.announcement !== data.maintenance.announcement){\r\n setS3Config(data)\r\n }\r\n })\r\n .catch((err) => console.error('Could not get config file from S3!', err));\r\n }\r\n\r\n // Repeatedly call getConfig. Allows the maintenange page to be turned on without a page refresh.\r\n useInterval(() => {\r\n getConfig();\r\n }, 60000)\r\n\r\n useEffect(() => {\r\n if(!S3Config){\r\n getConfig();\r\n }\r\n // eslint-disable-next-line\r\n }, [])\r\n\r\n return S3Config\r\n}","import { Alert, Button, Col, Divider, Dropdown, Icon, Layout, Menu, Modal, Row, Switch, Tooltip, Typography } from 'antd';\r\nimport { ClickParam } from 'antd/lib/menu';\r\nimport AboutApp from 'components/AboutApp';\r\nimport { AuthContext } from 'context/auth';\r\nimport { GlobalAppStateContext } from 'context/global-app-state';\r\nimport { ThemeContext } from 'context/theme';\r\nimport React, { HTMLAttributes, useContext, useState } from 'react';\r\nimport { withApollo } from 'react-apollo';\r\nimport { withRouter } from 'react-router-dom';\r\nimport MenuItem from '../../node_modules/antd/lib/menu/MenuItem';\r\nimport TransporterSelector from '../containers/TransporterSelector';\r\nimport { ServiceWorkerConsumer } from '../context/serviceworker';\r\nimport '../css/App.css';\r\nimport CurrentOrg from './CurrentOrg';\r\nimport FeedbackButton from './feedback-button';\r\nimport { FeedbackFormModal } from './feedback-form';\r\nimport MCIcon from './icon';\r\nimport { UserGroup } from './userGroup';\r\nimport withUserPreferences from './withUserPreferences';\r\nimport {useS3Config} from \"../hooks/s3config\";\r\n\r\nconst iconStyle = {\r\n margin: 'auto 0'\r\n}\r\n\r\nconst DevStage: React.FC & { type?: 'dev' | 'beta' }> = (props) => {\r\n\r\n let style = {\r\n fontSize: '1.5rem',\r\n color: 'white',\r\n borderRadius: '4px',\r\n padding: '0 0.3rem',\r\n ...props.style\r\n }\r\n if (props.type === 'dev'){\r\n style.backgroundColor = 'red';\r\n }\r\n else if (props.type === 'beta'){\r\n style.backgroundColor = '#00c100';\r\n }\r\n\r\n return \r\n}\r\n\r\nconst GlobalNavbar: React.FC = (props) => {\r\n const { user, signOut } = useContext(AuthContext);\r\n const { toggleSidebarCollapse, state: { sidebarCollapsed } } = useContext(GlobalAppStateContext);\r\n const { changeTheme, themeName, loading: themeLoading } = useContext(ThemeContext);\r\n const [ userMenuVisible, setUserMenuVisible ] = useState(false);\r\n const [ showAboutModal, setShowAboutModal ] = useState(false);\r\n const [ showFeedbackModal, setShowFeedbackModal ] = useState(false);\r\n\r\n const S3Config = useS3Config();\r\n\r\n const { staticContext, userprefs, ...rest } = props;\r\n\r\n function handleMenuClick(e: ClickParam){\r\n switch (e.key) {\r\n case 'theme':\r\n changeTheme(themeName !== 'dark' ? 'dark' : 'light');\r\n break;\r\n case 'user':\r\n userprefs.open();\r\n setUserMenuVisible(false);\r\n break;\r\n case 'feedback':\r\n setShowFeedbackModal(true);\r\n break;\r\n case 'about':\r\n setShowAboutModal(true);\r\n break;\r\n case 'logout':\r\n signOut();\r\n break;\r\n default:\r\n setUserMenuVisible(false);\r\n }\r\n }\r\n\r\n function renderDevStage(){\r\n switch (process.env.REACT_APP_STAGE) {\r\n case 'qas':\r\n return BETA\r\n case 'dev':\r\n return DEV\r\n case 'prd':\r\n default:\r\n return null;\r\n }\r\n }\r\n\r\n let devStage = renderDevStage();\r\n\r\n const dropdownOverlay = (\r\n \r\n \r\n \r\n Account\r\n \r\n \r\n \r\n \r\n \r\n About Manifest Central\r\n \r\n \r\n \r\n \r\n \r\n Feedback\r\n \r\n \r\n \r\n \r\n \r\n
    \r\n Dark Theme\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Logout\r\n \r\n \r\n \r\n \r\n )\r\n\r\n let maintenanceAnnouncement = S3Config?.maintenance?.announcement;\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n {!props.hideMenuCollapse ? (\r\n \r\n toggleSidebarCollapse()}\r\n />\r\n \r\n ) : null}\r\n
    \r\n \r\n {devStage ?
    {devStage} : null}\r\n
    \r\n
    \r\n \r\n {(serviceWorker) => {\r\n if (serviceWorker.updateAvailable){\r\n return \r\n A new update is available! \r\n \r\n }\r\n return null;\r\n }}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {({ organization }) => {\r\n return \r\n {organization && organization.classType === 'flytsuite.customer' ? (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ) : null}\r\n {/* {organization && organization.name} */}\r\n {user && (\r\n \r\n setUserMenuVisible(visible)}\r\n >\r\n \r\n
    \r\n
    \r\n {`${user.attributes.given_name} ${user.attributes.family_name}`}\r\n
    \r\n
    \r\n {organization ? \r\n {organization.name} : \r\n 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 {maintenanceAnnouncement ? (\r\n \r\n ) : null}\r\n {user ? !user.attributes.email_verified ? (\r\n Please verify your email address. \r\n }\r\n />\r\n ) : null : null}\r\n setShowAboutModal(false)}\r\n footer={null}\r\n >\r\n \r\n \r\n setShowFeedbackModal(false)}\r\n />\r\n \r\n )\r\n}\r\n\r\n// @ts-ignore\r\nexport default withRouter(withApollo(withUserPreferences(GlobalNavbar)))","import React from 'react';\r\nimport { Table, Alert } from 'antd';\r\nimport { graphql } from 'react-apollo';\r\nimport gql from 'graphql-tag';\r\nimport WithOrgData from '../../WithOrgData';\r\nimport LoadingContent from '../../LoadingContent';\r\nimport { withRouter } from 'react-router-dom';\r\nimport commonColumns from '../../../common/table/columns';\r\n\r\nclass Pob extends React.Component {\r\n renderContent = () => {\r\n const { data: { getRigs, loading, error } } = this.props;\r\n if (error) return \r\n if (loading) return \r\n if (getRigs){\r\n return (\r\n record._id}\r\n pagination={false}\r\n size=\"middle\"\r\n onRow={record => ({\r\n onClick: () => this.props.history.push(`/app/pob/${record._id}`),\r\n style: {\r\n cursor: 'pointer'\r\n }\r\n })}\r\n columns={commonColumns.rig.all()}\r\n />\r\n )\r\n }\r\n }\r\n render(){\r\n return (\r\n \r\n

    Live POB

    \r\n
    \r\n {this.renderContent()}\r\n
    \r\n
    \r\n )\r\n }\r\n}\r\nconst RIGS = gql`\r\nquery Pob($customerID: ID!){\r\n getRigs(customerID: $customerID){\r\n _id\r\n customerID {\r\n _id\r\n name\r\n }\r\n locationID {\r\n _id\r\n name\r\n }\r\n onboardCount,\r\n inboundCount,\r\n outboundCount,\r\n onboardCargoCount,\r\n inboundCargoCount,\r\n outboundCargoCount\r\n }\r\n}\r\n`\r\n\r\nconst RigsWithData = graphql(\r\n RIGS,\r\n {\r\n options: props => {\r\n const {customer } = props.orgData;\r\n return {\r\n fetchPolicy: 'network-only',\r\n pollInterval: 5000,\r\n variables: {\r\n customerID: customer && customer._id\r\n }\r\n }\r\n }\r\n }\r\n)(Pob)\r\n\r\nexport default withRouter( WithOrgData(RigsWithData) )","import React, { useContext, useEffect, useState } from 'react';\r\nimport { Layout, Menu } from 'antd';\r\nimport { useHistory, useLocation } from 'react-router-dom';\r\nimport { GlobalAppStateContext } from 'context/global-app-state';\r\nimport windowSizes from 'common/windowSizes';\r\n\r\nconst { Sider } = Layout;\r\n\r\nconst PobNav = () => {\r\n const { state: { sidebarCollapsed }, setState } = useContext(GlobalAppStateContext);\r\n const [ hasExpanded, setHasExpanded ] = useState(false);\r\n\r\n useEffect(() => {\r\n if (!sidebarCollapsed && !hasExpanded){\r\n setHasExpanded(true);\r\n }\r\n }, [ sidebarCollapsed ])\r\n\r\n\r\n const history = useHistory();\r\n const { pathname } = useLocation();\r\n\r\n function handleMenuClick({ key }) {\r\n history.push(`/app/${key}`);\r\n if (window.innerWidth <= windowSizes.small){\r\n setState({ sidebarCollapsed: true })\r\n }\r\n }\r\n\r\n const pathArray = pathname.split('/').filter(path => path);\r\n var key = pathArray[1];\r\n\r\n let menu = \r\n \r\n Stations\r\n \r\n \r\n\r\n if (!hasExpanded) menu = null;\r\n\r\n return (\r\n \r\n {menu}\r\n \r\n )\r\n}\r\n\r\nexport default PobNav","import React, { Component } from 'react';\r\nimport { Tabs, Card, Col, Checkbox, Table, Avatar, Button } from 'antd';\r\nimport PropTypes from 'prop-types';\r\nimport commonColumns from '../../common/table/columns';\r\nimport { CredentialManagerWithData } from '../CredentialManager';\r\nimport moment from 'moment';\r\n\r\n\r\nclass PobViewer extends Component {\r\n state = {\r\n visible: false,\r\n error: false\r\n }\r\n setPicError = () => {\r\n this.setState({ error: true })\r\n }\r\n setPictureVisible = () => {\r\n this.setState({ visible: true })\r\n }\r\n renderPicture = () => {\r\n const { data } = this.props;\r\n const personId = data.personID._id;\r\n const path = \"https://s3.amazonaws.com/df-web-img/pax/\" + personId + \"/\" + personId + \"_prof.jpeg\";\r\n if(this.state.error){\r\n return(\r\n No Image Found \r\n )\r\n }\r\n else{\r\n return (\r\n this.state.visible? \r\n \r\n : \r\n )\r\n }\r\n }\r\n renderPersonalInfo = () => {\r\n const { data } = this.props;\r\n return (\r\n \r\n
    \r\n \r\n \r\n {this.renderPicture()}\r\n
    \r\n Date of Birth: {data.personID.dob}
    \r\n Phone Number: {data.personID.contactInfo.phone.number}\r\n
    \r\n Email Address: {data.personID.contactInfo.email.address}\r\n
    \r\n \r\n \r\n \r\n Street: {data.personID.contactInfo.address.street}\r\n
    \r\n City: {data.personID.contactInfo.address.city}\r\n
    \r\n State: {data.personID.contactInfo.address.state}\r\n
    \r\n ZipCode: {data.personID.contactInfo.address.zipCode}\r\n
    \r\n \r\n Customer: {data.customerID.name}
    \r\n Employee Number: {data.personID.employeeNumber}
    \r\n Employer: {data.employerID.name}\r\n
    \r\n \r\n \r\n )\r\n }\r\n renderPobInfo = () => {\r\n const { data } = this.props;\r\n return (\r\n \r\n \r\n \r\n Room Assignment:\r\n \r\n \r\n Lifeboat Number: {data.lifeBoatNumber}
    \r\n Essential Personnel: \r\n
    \r\n \r\n \r\n \r\n \r\n Base Checkin:
    \r\n Offshore Check In: {moment(data.offshoreCheckIn).format('YYYY-MM-DD HH:mm:ss')}\r\n\r\n
    \r\n \r\n \r\n )\r\n }\r\n renderCred = () => {\r\n const { data } = this.props;\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n )\r\n }\r\n renderEmergencyContact = () => {\r\n const { data } = this.props;\r\n return (\r\n \r\n \r\n \r\n First Name: {data.personID.emergencyContactInfo.name.firstName}\r\n
    \r\n last Name: {data.personID.emergencyContactInfo.name.lastName}\r\n
    \r\n \r\n Phone Number: {data.personID.emergencyContactInfo.phone.number}\r\n
    \r\n Email Address: {data.personID.emergencyContactInfo.email.address}\r\n
    \r\n \r\n \r\n \r\n Street:\r\n
    \r\n City:\r\n
    \r\n State: \r\n
    \r\n ZipCode:\r\n
    \r\n \r\n \r\n \r\n )\r\n }\r\n renderWorkHistory = (workHistory) => {\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n render() { \r\n const { data } = this.props;\r\n return (\r\n
    \r\n {data && data && (\r\n

    {`${data.lastName}, ${data.firstName}`}

    \r\n )}\r\n \r\n {this.renderPersonalInfo()}\r\n {this.renderPobInfo()}\r\n {this.renderWorkHistory(data.shiftTimes)}\r\n {this.renderCred()}\r\n {this.renderEmergencyContact()}\r\n \r\n \r\n
    \r\n );\r\n }\r\n}\r\nconst formStyle = {\r\n fontSize: '16px',\r\n marginTop: '25px',\r\n };\r\nconst infoStyle = {\r\n fontSize: '16px',\r\n color: 'black'\r\n \r\n } \r\nPobViewer.propTypes = {\r\n data: PropTypes.object.isRequired\r\n}\r\nexport default PobViewer;","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery PobQuery(\r\n $_id: ID!\r\n){\r\n getPobNode(\r\n _id: $_id\r\n ){\r\n _id\r\n firstName\r\n lastName\r\n lifeBoatNumber\r\n offshoreCheckIn\r\n shiftTimes{\r\n clockIn\r\n clockOut\r\n }\r\n customerID{\r\n _id\r\n name\r\n }\r\n employerID{\r\n _id\r\n name\r\n }\r\n personID{\r\n _id\r\n dob\r\n emergencyContactInfo{\r\n phone{\r\n number\r\n }\r\n name{\r\n firstName\r\n lastName\r\n }\r\n email{\r\n address\r\n }\r\n address{\r\n street\r\n city\r\n state\r\n zipCode\r\n }\r\n }\r\n contactInfo{\r\n phone{\r\n number\r\n }\r\n email{\r\n address\r\n }\r\n address{\r\n street\r\n city\r\n state\r\n zipCode\r\n }\r\n }\r\n }\r\n }\r\n}\r\n`","import React, { Component } from 'react';\r\nimport { Query } from 'react-apollo';\r\nimport PobViewer from './pobViewer';\r\nimport PropTypes from 'prop-types';\r\nimport LoadingContent from '../LoadingContent';\r\nimport { Alert } from 'antd';\r\nimport PobQuery from 'components/PobEditor/pobQuery';\r\n\r\nclass PobViewerWithData extends Component {\r\n render() {\r\n const { pobID } = this.props;\r\n return (\r\n \r\n {({ data, loading, error }) => {\r\n if (loading) return \r\n return (\r\n
    \r\n {error ? (\r\n \r\n ) : null}\r\n {data && data.getPobNode ? : null}\r\n
    \r\n )\r\n }}\r\n \r\n );\r\n }\r\n}\r\n\r\nPobViewerWithData.propTypes = {\r\n pobID: PropTypes.string.isRequired\r\n}\r\n \r\nexport default PobViewerWithData;","import { Alert, Badge, Breadcrumb, Button, Card, Col, Modal, Row, Spin, Table } from 'antd';\r\nimport RadioGroup from 'antd/lib/radio/group';\r\nimport RadioButton from 'antd/lib/radio/radioButton';\r\nimport gql from 'graphql-tag';\r\nimport compose from 'lodash.flowright';\r\nimport React from 'react';\r\nimport { graphql } from 'react-apollo';\r\nimport { Link, withRouter } from 'react-router-dom';\r\nimport commonColumns from '../../../common/table/columns';\r\nimport LoadingContent from '../../LoadingContent';\r\nimport { PobViewerWithData } from '../../PobEditor';\r\nimport WithOrgData from '../../WithOrgData';\r\n\r\nclass RigDetail extends React.Component {\r\n state = {\r\n activeTab: 'passengers',\r\n tabKey: 'onboard',\r\n editPaxModal: {\r\n id: null,\r\n visible: null\r\n },\r\n viewPobModal:{\r\n id: null,\r\n visible: null\r\n }\r\n }\r\n \r\n setPaxModal = (visible, id) => {\r\n this.setState({\r\n editPaxModal: {\r\n id: id || this.state.editPaxModal.id,\r\n visible\r\n }\r\n })\r\n }\r\n setPobModal = (visible, id) => {\r\n this.setState({\r\n viewPobModal: {\r\n id: id || this.state.viewPobModal.id,\r\n visible\r\n }\r\n })\r\n }\r\n componentDidMount(){\r\n this.props.data.startPolling(5000)\r\n }\r\n onTabChange = (activeTab) => this.setState({ activeTab })\r\n \r\n renderDesig = () => {\r\n const { data: { getRig, loading } } = this.props;\r\n return (loading && !getRig) ? Loading : getRig && getRig.locationID.name\r\n }\r\n renderPassengers = () => {\r\n const { data: {getPobNodesOnRig, getPaxNodesToRig, getPaxNodesLeavingRig, loading, error }} = this.props;\r\n if (loading) return \r\n if (error) return \r\n const onboardLen = getPobNodesOnRig ? getPobNodesOnRig.length : 0;\r\n const inboundLen = getPaxNodesToRig ? getPaxNodesToRig.length : 0;\r\n const outboundLen = getPobNodesOnRig ? getPaxNodesLeavingRig.length : 0;\r\n \r\n const renderOnboard = (onboardPob) => (\r\n record._id}\r\n size=\"middle\"\r\n pagination={false}\r\n columns={[\r\n {\r\n ...commonColumns.onboardpob.columns.name,\r\n render: (_, record) => \r\n },\r\n ...commonColumns.onboardpob.some(['customer', 'employer', 'checkedIn', 'offshoreCheckedIn']),\r\n ]}\r\n \r\n />\r\n )\r\n const renderInbound = (inboundPax) => (\r\n record._id}\r\n size=\"middle\"\r\n pagination={false}\r\n columns={commonColumns.onboardpob.all()}\r\n />\r\n )\r\n const renderOutbound = (outboundPob) => (\r\n record._id}\r\n size=\"middle\"\r\n pagination={false}\r\n columns={commonColumns.onboardpob.all()}\r\n />\r\n )\r\n const tabContent = {\r\n onboard: renderOnboard(getPobNodesOnRig),\r\n inbound: renderInbound(getPaxNodesToRig),\r\n outbound: renderOutbound(getPaxNodesLeavingRig)\r\n }\r\n const Count = (props) => \r\n \r\n return (\r\n \r\n Onboard\r\n \r\n \r\n )\r\n },\r\n {\r\n key: 'inbound',\r\n tab: (\r\n
    \r\n Inbound\r\n \r\n
    \r\n )\r\n },\r\n {\r\n key: 'outbound',\r\n tab: (\r\n
    \r\n Outbound\r\n \r\n
    \r\n )\r\n }\r\n ]}\r\n onTabChange={(tabKey) => this.setState({ tabKey })}\r\n activeTabKey={this.state.tabKey}\r\n >\r\n {tabContent[this.state.tabKey]}\r\n \r\n )\r\n }\r\n\r\n renderCargo = () => {\r\n const { data: {getDocksCargoOnRig, getCargoToRig, getCargoLeavingRig, loading, error }} = this.props;\r\n if (loading) return \r\n if (error) return \r\n const onboardLen = getDocksCargoOnRig ? getDocksCargoOnRig.length : 0;\r\n const inboundLen = getCargoToRig ? getCargoToRig.length : 0;\r\n const outboundLen = getCargoLeavingRig ? getCargoLeavingRig.length : 0;\r\n \r\n const renderOutboundCgo = (outboundCgo) => (\r\n record._id}\r\n size=\"middle\"\r\n pagination={false}\r\n columns={commonColumns.dockscgo.all()}\r\n />\r\n )\r\n const renderInboundCgo = (inboundCgo) => (\r\n record._id}\r\n size=\"middle\"\r\n pagination={false}\r\n columns={commonColumns.dockscgo.all()}\r\n />\r\n )\r\n const renderOnboardCgo = (onboardCgo) => (\r\n record._id}\r\n size=\"middle\"\r\n pagination={false}\r\n columns={commonColumns.dockscgo.all()}\r\n />\r\n )\r\n const tabContent = {\r\n onboard: renderOnboardCgo(getDocksCargoOnRig),\r\n inbound: renderInboundCgo(getCargoToRig),\r\n outbound: renderOutboundCgo(getCargoLeavingRig)\r\n }\r\n \r\n const Count = (props) => \r\n \r\n return (\r\n \r\n Onboard\r\n \r\n \r\n )\r\n },\r\n {\r\n key: 'inbound',\r\n tab: (\r\n
    \r\n Inbound\r\n \r\n
    \r\n )\r\n },\r\n {\r\n key: 'outbound',\r\n tab: (\r\n
    \r\n Outbound\r\n \r\n
    \r\n )\r\n }\r\n ]}\r\n onTabChange={(tabKey) => this.setState({ tabKey })}\r\n activeTabKey={this.state.tabKey}\r\n >\r\n {tabContent[this.state.tabKey]}\r\n \r\n )\r\n }\r\n renderContent = () => {\r\n if(this.state.activeTab === 'passengers'){\r\n return this.renderPassengers()\r\n }\r\n else if (this.state.activeTab === 'cargo'){\r\n return this.renderCargo()\r\n } \r\n }\r\n render(){\r\n return (\r\n \r\n \r\n \r\n POB\r\n \r\n \r\n {this.renderDesig()}\r\n \r\n \r\n \r\n
    \r\n

    {this.renderDesig()}

    \r\n \r\n \r\n
    \r\n this.onTabChange(e.target.value)} value={this.state.activeTab} buttonStyle=\"solid\">\r\n \r\n Passengers\r\n \r\n \r\n Cargo\r\n \r\n \r\n
    \r\n
    \r\n {this.renderContent()}\r\n
    \r\n this.setPobModal(false)}\r\n width=\"50rem\"\r\n title=\"Pob Information\"\r\n footer={false}\r\n >\r\n {this.state.viewPobModal.id ? : null}\r\n \r\n \r\n )\r\n }\r\n}\r\n\r\nconst RIG = gql`\r\nquery Rig($_id: ID! $locID: ID!){\r\n getRig(_id: $_id){\r\n _id\r\n locationID {\r\n _id\r\n name\r\n }\r\n }\r\n getPobNodesOnRig(_id: $locID){\r\n _id\r\n lastName\r\n firstName\r\n checkedInTime\r\n offshoreCheckIn\r\n customerID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n }\r\n getPaxNodesToRig(destinationID: $locID){\r\n _id\r\n lastName\r\n firstName\r\n checkedInTime\r\n departureID {\r\n _id\r\n name\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n }\r\n getPaxNodesLeavingRig(departureID: $locID){\r\n _id\r\n lastName\r\n firstName\r\n checkedInTime\r\n departureID {\r\n _id\r\n name\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n employerID {\r\n _id\r\n name\r\n }\r\n }\r\n getDocksCargoOnRig(_id: $locID){\r\n _id\r\n assetID {\r\n _id\r\n name\r\n }\r\n description\r\n name\r\n lifts\r\n liftWeight\r\n totalWeight\r\n weight\r\n }\r\n getCargoToRig(destinationID: $locID){\r\n _id\r\n assetID {\r\n _id\r\n name\r\n }\r\n description\r\n name\r\n lifts\r\n liftWeight\r\n totalWeight\r\n weight\r\n classType\r\n }\r\n getCargoLeavingRig(departureID: $locID){\r\n _id\r\n assetID {\r\n _id\r\n name\r\n }\r\n description\r\n name\r\n lifts\r\n liftWeight\r\n totalWeight\r\n weight\r\n classType\r\n }\r\n}\r\n`\r\n\r\nconst RigDetailWithData = compose(\r\n withRouter,\r\n WithOrgData,\r\n graphql(\r\n RIG,\r\n {\r\n options: props => {\r\n return {\r\n variables: {\r\n _id: props.match.params.rigid,\r\n locID: props.match.params.rigid.replace(\"RIG-\", \"LOC-\")\r\n },\r\n fetchPolicy: 'network-only'\r\n }\r\n }\r\n }\r\n )\r\n)(RigDetail)\r\nexport default RigDetailWithData;","import React, { useContext } from 'react';\r\nimport { Switch, Redirect } from 'react-router-dom';\r\nimport PrivateRoute from '../PrivateRoute';\r\nimport Pob from './pages/pob';\r\nimport { Layout } from 'antd';\r\nimport PobNav from './nav';\r\nimport RigDetail from './pages/rigDetail';\r\nimport cn from 'classnames';\r\nimport { GlobalAppStateContext } from 'context/global-app-state';\r\n\r\nconst basePath = '/app/'\r\n\r\nconst { Content } = Layout;\r\n\r\n/**\r\n * Handles navigation and routes of POB branch of the application.\r\n */\r\nconst PobMain = () => {\r\n const { state: { sidebarCollapsed }, setState } = useContext(GlobalAppStateContext);\r\n return \r\n
    setState({ sidebarCollapsed: true })} />\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 PobMain","import { Layout, Button } from 'antd';\r\nimport PrivateRoute from 'components/PrivateRoute';\r\nimport FlightboardPage from 'pages/app/flightboard/flight-board-page';\r\nimport FlightboardLocationSelectPage from 'pages/app/flightboard/location-page';\r\nimport qs from 'qs';\r\nimport React from 'react';\r\nimport { Switch, withRouter } from 'react-router-dom';\r\nimport { getWindowRoutes } from 'routes/window';\r\nimport '../css/App.css';\r\nimport EmployerMain from '../pages/app/employer';\r\nimport DocksMain from './docks/main';\r\nimport FlightsMain from './flights/main';\r\nimport GlobalNavbar from './GlobalNavbar';\r\nimport NotAuthorized from './NotAuthorized';\r\nimport PobMain from './pob/main';\r\nimport { UserGroup, withUserGroups } from './userGroup';\r\nimport WithOrgData from './WithOrgData';\r\nimport { AuthContext } from 'context/auth';\r\n\r\nconst basePath = \"/app/\";\r\n\r\nconst NotApproved = () => (\r\n \r\n)\r\n\r\n/**\r\n * Renders main application\r\n */\r\nclass App extends React.Component {\r\n constructor(props){\r\n super(props);\r\n this.state = {\r\n error: null\r\n }\r\n }\r\n\r\n componentDidMount(){\r\n if (this.props.themeContext){\r\n this.props.themeContext.setThemingEnabled(true);\r\n }\r\n }\r\n\r\n componentDidCatch(error){\r\n this.setState({ error })\r\n }\r\n\r\n /** Choose different sets of routes depending on the organization. Also displays sidebar navigation. */\r\n renderMain = () => {\r\n const { organization: org, transporter } = this.props.orgData;\r\n switch (org && org.classType) {\r\n case 'flytsuite.transporter':\r\n return \r\n case 'flytsuite.customer':\r\n switch(transporter.type){\r\n case 'boat':\r\n return \r\n case 'flight':\r\n return \r\n case 'pob':\r\n return \r\n default:\r\n return null;\r\n }\r\n case 'flytsuite.employer':\r\n return \r\n default:\r\n return null;\r\n }\r\n }\r\n\r\n render(){\r\n if (this.state.error){\r\n return (\r\n \r\n {({ signOut }) => (\r\n \r\n Log Out}\r\n />\r\n \r\n )}\r\n \r\n )\r\n }\r\n return (\r\n \r\n\r\n {/* User must have default user group to be allowed access to the application */}\r\n }>\r\n \r\n {\r\n let qsParams = qs.parse(location.search, { ignoreQueryPrefix: true });\r\n if (qsParams.locationID){\r\n return \r\n }\r\n else\r\n {\r\n return <>\r\n \r\n history.push('/app/flightboard?locationID=' + locationID)}\r\n />\r\n \r\n }\r\n }}\r\n />\r\n getWindowRoutes()}\r\n />\r\n <>\r\n \r\n {this.renderMain()}\r\n } />\r\n \r\n \r\n \r\n )\r\n }\r\n}\r\n\r\nexport default withRouter( withUserGroups( WithOrgData(App) ) );\r\n","import PrivateRoute from 'components/PrivateRoute';\r\nimport FWAircraftDetailsPage from 'pages/window/flytwatch/aircraft-details-page';\r\nimport React from 'react';\r\n\r\nexport function getWindowRoutes() {\r\n return [\r\n } />,\r\n ]\r\n}","import React from 'react';\r\nimport { Spin, Icon } from 'antd';\r\n\r\nconst AppLoading = ({ message, subMessage, style }) => (\r\n
    \r\n } />\r\n
    \r\n

    Loading Manifest Central

    \r\n
    \r\n {message}\r\n
    \r\n {subMessage ? (\r\n
    {subMessage}
    \r\n ) : null}\r\n
    \r\n
    \r\n)\r\n\r\nexport default AppLoading","import React, { Component } from 'react';\r\nimport { graphql } from 'react-apollo';\r\nimport compose from 'lodash.flowright';\r\nimport gql from 'graphql-tag';\r\nimport WithOrgData from '../WithOrgData';\r\n\r\n/**\r\n * Initializes global filters with data from local state\r\n */\r\nclass GlobalFilterInitializer extends Component {\r\n state = {\r\n isFinished: false,\r\n error: null,\r\n loading: false\r\n }\r\n componentDidMount(){\r\n const { orgData: { customer, transporter, employer } } = this.props;\r\n this.setState({ loading: true });\r\n\r\n // Call mutation to update global filters\r\n this.props.initialize({\r\n variables: {\r\n customer: customer && {\r\n key: customer._id,\r\n label: customer.name,\r\n __typename: 'SelectItem'\r\n },\r\n transporter: transporter && {\r\n key: transporter._id,\r\n label: transporter.name,\r\n __typename: 'SelectItem'\r\n },\r\n employer: employer && [{\r\n key: employer._id,\r\n label: employer.name,\r\n __typename: 'SelectItem'\r\n }]\r\n }\r\n })\r\n .then(() => this.setState({ isFinished: true }))\r\n .catch((error) => this.setState({ error }))\r\n .then(() => this.setState({ loading: false }))\r\n }\r\n\r\n /**\r\n * Check if the organization has changed.\r\n * @param prevData Previous organization data to be compared with new organization data\r\n * @param orgType Organization type to check that changed\r\n */\r\n orgChanged = (prevData, orgType) => {\r\n const currOrg = this.props.orgData[orgType];\r\n const currOrgID = currOrg && currOrg._id;\r\n const prevOrg = prevData[orgType];\r\n const prevOrgID = prevOrg && prevOrg._id;\r\n\r\n if (!currOrgID) return false;\r\n if (currOrgID !== prevOrgID) return true;\r\n return false\r\n }\r\n componentDidUpdate({ orgData: prevOrgData }){\r\n if (this.state.error) return\r\n const { orgData: { customer, transporter, employer } } = this.props;\r\n const changed = {\r\n customer: this.orgChanged(prevOrgData, 'customer'),\r\n transporter: this.orgChanged(prevOrgData, 'transporter'),\r\n employer: this.orgChanged(prevOrgData, 'employer')\r\n }\r\n\r\n // If anything changed, re-initialize global filters.\r\n if (changed.customer || changed.transporter || changed.employer){\r\n this.props.initialize({\r\n variables: {\r\n customer: customer && {\r\n key: customer._id,\r\n label: customer.name,\r\n __typename: 'SelectItem'\r\n },\r\n transporter: transporter && {\r\n key: transporter._id,\r\n label: transporter.name,\r\n __typename: 'SelectItem'\r\n },\r\n employer: employer && [{\r\n key: employer._id,\r\n label: employer.name,\r\n __typename: 'SelectItem'\r\n }]\r\n }\r\n })\r\n }\r\n }\r\n render() { \r\n const { children } = this.props;\r\n if (this.state.error) return (\r\n
    \r\n

    An error occurred preventing Manifest Central from starting

    \r\n

    {this.state.error.message}

    \r\n
    \r\n )\r\n if (this.state.isFinished) return children\r\n return null\r\n }\r\n}\r\n \r\nexport default compose(\r\n WithOrgData,\r\n graphql(\r\n gql`\r\n mutation IntializeGlobalFilter(\r\n $customer: SelectItem\r\n $transporter: SelectItem\r\n $employer: [SelectItem]\r\n ){\r\n setGlobalFilter(\r\n customer: $customer\r\n transporter: $transporter\r\n employer: $employer\r\n ) @client{\r\n customer\r\n transporter\r\n employer\r\n }\r\n }\r\n `,\r\n {\r\n name: 'initialize'\r\n }\r\n )\r\n)(GlobalFilterInitializer);","import { Auth } from \"@aws-amplify/auth\";\r\nimport gql from \"graphql-tag\";\r\nimport defaultState from \"../defaultState\";\r\nimport { S3Client, GetObjectCommand } from '@aws-sdk/client-s3';\r\nimport config from \"../config\";\r\nimport { readableStreamToBuffer } from \"common/util-ts\";\r\n\r\n// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default {\r\n Mutation: {\r\n appLoaded: (_, {payload}, { cache }) => {\r\n const appLoaded = payload ? true : false;\r\n cache.writeData({\r\n data: {\r\n appLoaded\r\n }\r\n });\r\n return appLoaded\r\n },\r\n setPaxSetsOwnerFilter: (_, {payload}, {cache}) => {\r\n cache.writeData({\r\n data: {\r\n userFilter: {\r\n paxSets: {\r\n owner: payload,\r\n __typename: 'ScheduleFilter'\r\n },\r\n __typename: 'UserFilter'\r\n }\r\n }\r\n })\r\n return payload\r\n },\r\n setScheduledPaxOwnerFilter: (_, {payload}, {cache}) => {\r\n cache.writeData({\r\n data: {\r\n userFilter: {\r\n scheduledPax: {\r\n owner: payload,\r\n __typename: 'ScheduleFilter'\r\n },\r\n __typename: 'UserFilter'\r\n }\r\n }\r\n })\r\n return payload\r\n },\r\n setScheduledPaxDateRangeFilter: (_, {startDate, endDate}, {cache}) => {\r\n cache.writeData({\r\n data: {\r\n userFilter: {\r\n scheduledPax: {\r\n startDate,\r\n endDate,\r\n __typename: 'ScheduleFilter'\r\n },\r\n __typename: 'UserFilter'\r\n }\r\n }\r\n })\r\n },\r\n setScheduledFlightsDateRangeFilter: (_, {startDate, endDate}, {cache}) => {\r\n cache.writeData({\r\n data: {\r\n userFilter: {\r\n scheduledFlights: {\r\n startDate,\r\n endDate,\r\n __typename: 'ScheduleFilter'\r\n },\r\n __typename: 'UserFilter'\r\n }\r\n }\r\n })\r\n },\r\n setGlobalFilter: (_, args, { cache }) => {\r\n const query = gql`\r\n {\r\n globalFilter @client{\r\n visible\r\n customer {\r\n key\r\n label\r\n }\r\n transporter {\r\n key\r\n label\r\n }\r\n departure {\r\n key\r\n label\r\n }\r\n destination {\r\n key\r\n label\r\n }\r\n employer {\r\n key\r\n label\r\n }\r\n pax {\r\n lastName\r\n firstName\r\n }\r\n cgo {\r\n name\r\n }\r\n }\r\n }`\r\n // const { globalFilter } = cache.readQuery({query});\r\n var globalFilter;\r\n try{\r\n const data = cache.readQuery({query});\r\n globalFilter = data.globalFilter;\r\n }\r\n catch(error){\r\n if (error.message.includes(\"Can't find field\")){\r\n console.error(error);\r\n console.warn(\"Failed to query global filter due to the error above. Continuing using default global filter parameters.\");\r\n globalFilter = defaultState.globalFilter;\r\n }else{\r\n throw error\r\n }\r\n }\r\n const newGlobalFilter = {\r\n ...globalFilter,\r\n ...args\r\n };\r\n cache.writeData({\r\n data: {\r\n globalFilter: newGlobalFilter\r\n }\r\n });\r\n cache.writeQuery({\r\n query: gql`\r\n {\r\n getGlobalFilter @client{\r\n visible\r\n customer {\r\n key\r\n label\r\n }\r\n transporter {\r\n key\r\n label\r\n }\r\n departure {\r\n key\r\n label\r\n }\r\n destination {\r\n key\r\n label\r\n }\r\n employer {\r\n key\r\n label\r\n }\r\n pax {\r\n lastName\r\n firstName\r\n }\r\n cgo {\r\n name\r\n }\r\n }\r\n }\r\n `,\r\n data: {\r\n getGlobalFilter: newGlobalFilter\r\n }\r\n });\r\n return newGlobalFilter\r\n },\r\n resetGlobalFilter: (_, __, { cache }) => {\r\n const { globalFilter, customer, transporter, employer } = cache.readQuery({\r\n query: gql`\r\n {\r\n globalFilter {\r\n visible\r\n customer {\r\n key\r\n label\r\n }\r\n transporter {\r\n key\r\n label\r\n }\r\n }\r\n customer {\r\n _id\r\n name\r\n }\r\n transporter {\r\n _id\r\n name\r\n }\r\n employer {\r\n _id\r\n name\r\n }\r\n }\r\n `\r\n });\r\n const newGlobalFilter = {\r\n ...defaultState.globalFilter,\r\n visible: globalFilter.visible,\r\n customer: globalFilter.customer && customer && globalFilter.customer.key === customer._id ? globalFilter.customer : customer ? {\r\n key: customer._id,\r\n label: customer.name,\r\n __typename: 'SelectItem'\r\n } : null,\r\n transporter: globalFilter.transporter && transporter && globalFilter.transporter.key === transporter._id ? globalFilter.transporter : transporter ? {\r\n key: transporter._id,\r\n label: transporter.name,\r\n __typename: 'SelectItem'\r\n } : null,\r\n employer: globalFilter.employer && globalFilter.employer.length > 0 && employer && globalFilter.employer[0].key === employer._id ? globalFilter.employer : employer ? [{\r\n key: employer._id,\r\n label: employer.name,\r\n __typename: 'SelectItem'\r\n }] : null\r\n }\r\n cache.writeData({\r\n data: {\r\n globalFilter: newGlobalFilter\r\n }\r\n });\r\n return newGlobalFilter\r\n },\r\n setPaginationLimit: (_, { limit }, { cache }) => {\r\n cache.writeData({\r\n data: {\r\n paginationLimit: limit\r\n }\r\n })\r\n return limit\r\n },\r\n tableSettings: async (_, { name, action, payload }, { cache }) => {\r\n let query = gql`\r\n {\r\n tableSettings @client {\r\n name\r\n settings {\r\n visibleColumns\r\n }\r\n }\r\n }\r\n `\r\n\r\n function getOrCreateTableSettings(tableSettings, name, defaultSettings){\r\n let settingsItem = tableSettings.find((item) => item.name === name);\r\n if (!settingsItem){\r\n settingsItem = {\r\n name,\r\n settings: defaultSettings\r\n }\r\n tableSettings.push(settingsItem);\r\n }\r\n Object.entries(settingsItem.settings).forEach(([ settingName, settingValue ]) => {\r\n if (defaultSettings && defaultSettings[settingName] && !settingValue){\r\n settingsItem.settings[settingName] = defaultSettings[settingName];\r\n }\r\n })\r\n return settingsItem;\r\n }\r\n\r\n function setOrCreateTableSettings(tableSettings, name, settings){\r\n let settingsItem = tableSettings.find((item) => item.name === name);\r\n if (!settingsItem){\r\n settingsItem = {\r\n name,\r\n settings,\r\n __typename: 'TableSettings'\r\n }\r\n tableSettings.push(settingsItem);\r\n }\r\n else\r\n {\r\n settingsItem.settings = { ...settingsItem.settings, ...settings };\r\n }\r\n\r\n return tableSettings\r\n }\r\n let tableSettings, settingsItem, newTableSettings;\r\n tableSettings = cache.readQuery({ query }).tableSettings;\r\n\r\n if (!tableSettings){\r\n await cache.writeData({\r\n data: {\r\n tableSettings: defaultState.tableSettings\r\n }\r\n })\r\n tableSettings = defaultState.tableSettings;\r\n }\r\n\r\n switch (action) {\r\n case 'SHOW_COLUMN':\r\n settingsItem = getOrCreateTableSettings(tableSettings, name, { visibleColumns: [] });\r\n newTableSettings = setOrCreateTableSettings(tableSettings, name, {\r\n __typename: 'TableSettings',\r\n visibleColumns: [ ...settingsItem.settings.visibleColumns, payload ]\r\n });\r\n\r\n cache.writeData({\r\n data: {\r\n tableSettings: newTableSettings\r\n }\r\n })\r\n return newTableSettings\r\n case 'REMOVE_COLUMN':\r\n settingsItem = getOrCreateTableSettings(tableSettings, name, { visibleColumns: [] });\r\n newTableSettings = setOrCreateTableSettings(tableSettings, name, {\r\n visibleColumns: settingsItem.settings.visibleColumns.filter(colName => colName !== payload)\r\n });\r\n\r\n cache.writeData({\r\n data: {\r\n tableSettings: newTableSettings\r\n }\r\n })\r\n return newTableSettings\r\n default:\r\n return tableSettings;\r\n }\r\n }\r\n },\r\n Query: {\r\n cognitoUser: async () => {\r\n const user = await Auth.currentAuthenticatedUser()\r\n return JSON.stringify(user)\r\n },\r\n getGlobalFilter: (_, __, { cache }) => {\r\n const query = gql`\r\n {\r\n globalFilter @client{\r\n visible\r\n customer {\r\n key\r\n label\r\n }\r\n transporter {\r\n key\r\n label\r\n }\r\n departure {\r\n key\r\n label\r\n }\r\n destination {\r\n key\r\n label\r\n }\r\n employer {\r\n key\r\n label\r\n }\r\n pax {\r\n lastName\r\n firstName\r\n }\r\n cgo {\r\n name\r\n }\r\n }\r\n }`\r\n\r\n var globalFilter;\r\n try{\r\n const data = cache.readQuery({query});\r\n globalFilter = data.globalFilter;\r\n }\r\n catch(error){\r\n if (error.message.includes(\"Can't find field\")){\r\n console.error(error);\r\n console.warn(\"Failed to query global filter due to the error above. Continuing using default global filter parameters.\");\r\n globalFilter = defaultState.globalFilter;\r\n }else{\r\n throw error\r\n }\r\n }\r\n return globalFilter\r\n },\r\n s3Report: async (_, { id, encoding, fileext }) => {\r\n try {\r\n if (!encoding) { encoding = 'base64' }\r\n \r\n const user = await Auth.currentAuthenticatedUser();\r\n const s3 = new S3Client({\r\n region: config.amplify.Auth.region,\r\n credentials: await Auth.currentCredentials()\r\n });\r\n const comm = new GetObjectCommand({\r\n Bucket: config.reportS3Bucket,\r\n Key: `cognito/${user.attributes.sub}/${id}.${fileext || 'report'}`\r\n })\r\n const resp = await s3.send(comm);\r\n const contentBuf = await readableStreamToBuffer(resp.Body);\r\n let body;\r\n if (encoding == 'base64'){\r\n body = atob(contentBuf.toString('utf-8'));\r\n body = JSON.parse(body);\r\n }\r\n else\r\n {\r\n body = JSON.parse(contentBuf.toString('utf-8'));\r\n }\r\n return body;\r\n }\r\n catch(error){\r\n console.error(error);\r\n throw error\r\n }\r\n },\r\n tableSettings: (_, __, { cache }) => {\r\n let { tableSettings } = cache.readQuery(gql`\r\n {\r\n tableSettings @client {\r\n name\r\n settings {\r\n visibleColumns\r\n }\r\n }\r\n }`);\r\n\r\n if (!tableSettings){\r\n tableSettings = defaultState.tableSettings;\r\n cache.writeData({\r\n data: {\r\n tableSettings: defaultState.tableSettings\r\n }\r\n })\r\n };\r\n return tableSettings;\r\n }\r\n // registeredUsers: async () => {\r\n // const session = await Auth.currentSession();\r\n // let result = await fetch('https://d7ktrukiyg.execute-api.us-east-1.amazonaws.com/dev/users', {\r\n // method: 'get',\r\n // headers: {\r\n // 'Authorization': session.getIdToken().getJwtToken(),\r\n // 'Access-Control-Allow-Origin': '*'\r\n // }\r\n // })\r\n // let json = await result.json();\r\n // for (let user of json.users){\r\n // console.log(typeof user);\r\n // user.mappedAttributes = {};\r\n // for (let attr of user.Attributes){\r\n // user.mappedAttributes[attr.Name] = attr.Value; \r\n // }\r\n // }\r\n // return json.users;\r\n // }\r\n }\r\n}","import { deDupeSort } from '../common/util';\r\nimport gql from 'graphql-tag';\r\n// import { withRouter } from 'react-router-dom';\r\n// import qs from 'qs';\r\n\r\n// const getTpFromRoute = withRouter(\r\n// ({ location: { search } }, { customerID }, { cache }) => {\r\n// const params = qs.parse(search, { ignoreQueryPrefix: true });\r\n// const query = gql`\r\n// query tpList($customerID: ID!){\r\n// tpList(customerID: $customerID) @client{\r\n// _id\r\n// name\r\n// }\r\n// }\r\n// `\r\n// console.log('params', params)\r\n// if (params.tp){\r\n// const {tpList: tpList } = cache.readQuery({ query, variables: {customerID} });\r\n// console.log('tpList', tpList)\r\n// return tpList.find(tp => tp._id === params.tp)\r\n// }\r\n// return null;\r\n// }\r\n// )\r\n\r\n// const getTpIDFromRoute = withRouter(\r\n// ({ location: { search } }) => {\r\n// const params = qs.parse(search, { ignoreQueryPrefix: true });\r\n// return params.tp;\r\n// }\r\n// )\r\n\r\n// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default {\r\n Query: {\r\n tpList: (obj, args, { cache }, info) => {\r\n const query = gql`\r\n query {\r\n contracts{\r\n tpID {\r\n _id, name\r\n }\r\n }\r\n }\r\n `\r\n const {contracts} = cache.readQuery({ query });\r\n var tpList = contracts.map(c => c.tpID);\r\n tpList = deDupeSort(tpList, tp => tp._id, tp => tp.name);\r\n return tpList;\r\n },\r\n // getTpFromRoute: (_, __, { cache, getCacheKey }) => {\r\n // if (tpID){\r\n // const {tp: tpID} = qs.parse(search, { ignoreQueryPrefix: true });\r\n // const id = getCacheKey({ __typename: 'Transporter', _id: tpID });\r\n // const fragment = gql`\r\n // fragment tp on Transporter {\r\n // _id\r\n // name\r\n // }\r\n // `;\r\n // const tp = cache.readFragment({ fragment, id });\r\n // cache.writeData({data: {transporter: tp}});\r\n // return tp;\r\n // }\r\n // return null;\r\n // }\r\n },\r\n Mutation: {\r\n transporter: (obj, args, { cache, getCacheKey }, info) => {\r\n const id = 'Transporter:' + args.id;\r\n const fragment = gql`\r\n fragment tp on Transporter {\r\n _id\r\n name\r\n type\r\n }\r\n `;\r\n const tp = cache.readFragment({ fragment, id });\r\n cache.writeData({data: {transporter: tp}});\r\n return tp;\r\n }\r\n // transporter: (obj, payload, { cache }, info) => {\r\n // // const id = getCacheKey({ __typename: 'Transporter', _id: args.id });\r\n // // const fragment = gql`\r\n // // fragment tp on Transporter {\r\n // // _id\r\n // // name\r\n // // }\r\n // // `;\r\n // // const tp = cache.readFragment({ fragment, id });\r\n // cache.writeData({data: {transporter: payload}});\r\n // return payload;\r\n // }\r\n }\r\n}","import gql from 'graphql-tag';\r\nimport { deDupeSort } from '../common/util';\r\n\r\n// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default {\r\n Query: {\r\n customerList: (obj, args, { cache }, info) => {\r\n const query = gql`\r\n query {\r\n contracts{\r\n customerID {\r\n _id, name\r\n }\r\n }\r\n }\r\n `\r\n const {contracts} = cache.readQuery({ query });\r\n var customerList = contracts.map(c => c.customerID);\r\n customerList = deDupeSort(customerList, c => c._id, c => c.name);\r\n return customerList;\r\n },\r\n customer: (_,__,{cache}) => {\r\n const query = gql`\r\n query{\r\n organization {\r\n _id\r\n name\r\n classType\r\n }\r\n }\r\n `\r\n const { organization } = cache.readQuery({query});\r\n if (organization.classType === 'flytsuite.customer'){\r\n return {\r\n _id: organization._id,\r\n name: organization.name,\r\n __typename: 'Customer'\r\n }\r\n }\r\n return null\r\n }\r\n }\r\n}","import { Auth } from '@aws-amplify/auth';\r\n\r\n// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default {\r\n Query: {\r\n userGroups: async () => {\r\n const session = await Auth.currentSession();\r\n console.log('resolver session', session)\r\n const groups = session.idToken.payload['cognito:groups'];\r\n if (Array.isArray(groups)){\r\n return groups\r\n }\r\n return []\r\n }\r\n }\r\n}","import config from '../config'\r\nimport { Auth } from '@aws-amplify/auth'\r\n\r\n// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default {\r\n Query: {\r\n dashboard: async (_, args) => {\r\n const session = await Auth.currentSession();\r\n console.log('args', args);\r\n const response = await fetch(config.dashboardAPI + '/dashboard', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Authorization': session.idToken.jwtToken\r\n },\r\n body: JSON.stringify(args)\r\n });\r\n const respData = await response;\r\n if (respData.ok){\r\n return respData.json();\r\n }\r\n else{\r\n var json;\r\n try{\r\n json = await respData.json();\r\n }\r\n catch(e){}\r\n const message = json ? json.Message : await respData.text();\r\n const error = Error(message);\r\n error.name = json ? json.Code : 'Error';\r\n console.error(error);\r\n throw error\r\n }\r\n }\r\n }\r\n}","\r\nconst contractsResolv = {\r\n Mutation: {\r\n contracts: (_, {payload: contracts}, {cache}) => {\r\n cache.writeData({data: {contracts}})\r\n return contracts\r\n }\r\n }\r\n}\r\n\r\nexport default contractsResolv;","const organizationResolv = {\r\n Mutation: {\r\n organization: (_, {payload}, {cache}) => {\r\n const organization = {\r\n _id: payload._id,\r\n name: payload.name,\r\n classType: payload.classType,\r\n __typename: 'Organization'\r\n };\r\n const data = {\r\n organization\r\n }\r\n cache.writeData({data})\r\n return organization\r\n }\r\n }\r\n}\r\n\r\nexport default organizationResolv;","import gql from \"graphql-tag\";\r\nimport {GlobalState} from \"../defaultState\";\r\nimport {Phase1StepQuery} from \"../Queries/Scheduling\";\r\n\r\ntype Phase1Step = GlobalState['scheduling']['phase1Step']\r\n\r\nconst SchedulingResolvers = {\r\n Query: {\r\n getPhase1Step: (obj, args, { cache }, info) => {\r\n const query = gql`\r\n {\r\n scheduling @client {\r\n phase1Step\r\n }\r\n }\r\n `;\r\n\r\n const data = cache.readQuery({ query });\r\n console.log('getPhase1Step', data);\r\n return data?.scheduling?.phase1Step as Phase1Step;\r\n }\r\n },\r\n Mutation: {\r\n setPhase1Step: (_, args, { cache }) => {\r\n const step: Phase1Step = args.step;\r\n\r\n cache.writeData({\r\n data: {\r\n scheduling: {\r\n __typename: 'SchedulingState',\r\n phase1Step: step\r\n }\r\n }\r\n })\r\n\r\n // cache.writeQuery({\r\n // query: Phase1StepQuery,\r\n // data: step\r\n // })\r\n\r\n return step;\r\n }\r\n }\r\n}\r\n\r\nexport default SchedulingResolvers;","import { merge } from \"lodash\";\r\nimport appResolv from \"./app\";\r\nimport transporterResolv from \"./transporter\";\r\nimport customerResolv from \"./customer\";\r\nimport authResolv from \"./auth\";\r\nimport dashboardResolv from \"./dashboard\";\r\nimport contractsResolv from \"./contracts\";\r\nimport organizationResolv from \"./organization\";\r\nimport SchedulingResolvers from \"./scheduling\";\r\n\r\nconst Resolvers = merge(\r\n appResolv,\r\n transporterResolv,\r\n contractsResolv,\r\n organizationResolv,\r\n customerResolv,\r\n authResolv,\r\n dashboardResolv,\r\n SchedulingResolvers\r\n);\r\nexport default Resolvers;","import { concat } from \"lodash\";\r\nimport appSchem from \"./app\";\r\nimport transporterSchem from \"./transporter\";\r\nimport customerSchem from \"./customer\";\r\nimport authSchem from \"./auth\";\r\nimport dashboardSchem from \"./dashboard\";\r\nimport SchedulingSchema from \"./scheduling\";\r\n\r\nexport const TypeDefs = concat(appSchem, transporterSchem, customerSchem, authSchem, dashboardSchem, SchedulingSchema);\r\n\r\nexport default TypeDefs;","// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default `\r\nenum OwnerFilter {\r\n own\r\n all\r\n}\r\ntype ScheduleFilter {\r\n owner: OwnerFilter,\r\n startDate: String\r\n endDate: String\r\n}\r\ntype UserFilter {\r\n paxSets: ScheduleFilter\r\n scheduledPax: ScheduleFilter\r\n scheduledFlights: ScheduleFilter\r\n}\r\ntype PaxGlobalFilter {\r\n lastName: String\r\n firstName: String\r\n}\r\ntype CgoGlobalFilter {\r\n name: String\r\n}\r\ntype GlobalFilter {\r\n visible: Boolean\r\n customer: [SelectItem]\r\n transporter: [SelectItem]\r\n departure: [SelectItem]\r\n destination: [SelectItem]\r\n employer: [SelectItem]\r\n pax: [PaxGlobalFilter]\r\n cgo: [CgoGlobalFilter]\r\n\r\n}\r\n\r\ntype TableSettings {\r\n visibleColumns: [String!]\r\n}\r\n\r\ntype TableSettingsItem {\r\n name: String!\r\n settings: TableSettings!\r\n}\r\n\r\ntype SelectItem {\r\n key: ID\r\n label: String\r\n}\r\ninput SelectItemInput {\r\n key: ID\r\n label: String\r\n}\r\ntype Query {\r\n appLoaded: Boolean\r\n congitoUser: String\r\n userFilter: UserFilter\r\n getGlobalFilter: GlobalFilter\r\n s3Report(id: String!, encoding: String): Report\r\n tableSettings: [TableSettingsItem!]!\r\n}\r\ntype Mutation {\r\n setPaxSetsOwnerFilter(payload: String!): OwnerFilter\r\n setScheduledPaxOwnerFilter(payload: String!): OwnerFilter\r\n setScheduledFlightsOwnerFilter(payload: String!): OwnerFilter\r\n setGlobalFilter(\r\n visible: Boolean\r\n customer: [SelectItemInput]\r\n transporter: SelectItemInput\r\n departure: [SelectItemInput]\r\n destination: [SelectItemInput]\r\n employer: [SelectItemInput]\r\n pax: [PaxGlobalFilter]\r\n cgo: [CgoGlobalFilter]\r\n ): GlobalFilter\r\n resetGlobalFilter: GlobalFilter\r\n setPaginationLimit(limit: Int!): Int,\r\n tableSettings(name: String!, action: String!, payload: String): [TableSettings!]!\r\n}\r\n`","// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default `\r\ntype Transporter {\r\n _id: ID!\r\n name: String\r\n}\r\ntype Mutation {\r\n setTpList(payload: [Transporter]!): [Transporter]\r\n transporter(id: ID!): Transporter\r\n}\r\ntype Query {\r\n tpList(customerID: ID!): [Transporter]\r\n}\r\n`;","// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default `\r\ntype Customer {\r\n _id,\r\n name\r\n}\r\ntype Query {\r\n customerList: [Customer]\r\n}\r\n`","// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default `\r\ntype Query {\r\n userGroups: [String]\r\n}\r\n`","// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default `\r\nenum ReduceTypes {\r\n count\r\n}\r\ninput DashboardInputVariables {\r\n tpID: ID!\r\n customerID: ID\r\n startDate: String\r\n endDate: String\r\n}\r\ninput FilterInput {\r\n label: String!\r\n key: String!\r\n value: String\r\n value_delimiter: String\r\n}\r\ninput SummaryInput {\r\n label: String!\r\n type: String!\r\n key: String!\r\n value: String\r\n group_by: String\r\n reduce: ReduceTypes\r\n force_group_uppercase: Boolean\r\n default_group_if_null: String\r\n include_total: Boolean\r\n}\r\ninput FilterResultInput {\r\n key: String\r\n value: String\r\n}\r\ntype Legend {\r\n key: String\r\n value: String\r\n}\r\ntype PercentageChart {\r\n id: ID\r\n name: String\r\n type: String\r\n legend: [Legend]\r\n}\r\ntype DashboardSummary {\r\n label: String\r\n total: PercentageChart\r\n content: [PercentageChart]\r\n}\r\ntype DashboardChoice {\r\n key: ID\r\n value: String\r\n}\r\ntype DashboardFilter {\r\n label: String\r\n choices: [DashboardChoice]\r\n}\r\ntype DashboardResponse {\r\n filter: [DashboardFilter]\r\n summary: [DashboardSummary]\r\n}\r\ntype Query {\r\n dashboard(\r\n type: String!\r\n variables: DashboardInputVariables!\r\n filter_result: [FilterResultInput]\r\n filter: FilterInput\r\n summary: SummaryInput\r\n ): DashboardResponse\r\n}\r\n`","\r\nconst SchedulingSchema = `\r\nenum Phase1Step {\r\n sets,\r\n history\r\n}\r\n\r\ntype SchedulingState {\r\n phase1Step: Phase1Step\r\n}\r\n\r\ntype Query {\r\n getPhase1Step: Phase1Step\r\n}\r\n\r\ntype Mutation {\r\n setPhase1Step(step: Phase1Step): Phase1Step\r\n}\r\n`\r\n\r\nexport default SchedulingSchema;","import React from 'react';\r\n\r\nimport { ApolloProvider } from 'react-apollo';\r\nimport { ApolloLink, Observable} from 'apollo-link'\r\nimport { InMemoryCache } from 'apollo-cache-inmemory';\r\nimport { persistCache } from 'apollo-cache-persist';\r\nimport { Auth } from '@aws-amplify/auth';\r\nimport { onError } from 'apollo-link-error';\r\nimport config from '../config';\r\nimport ApolloClient from 'apollo-client';\r\nimport { setContext } from 'apollo-link-context';\r\nimport { HttpLink } from 'apollo-boost';\r\nimport { RetryLink } from 'apollo-link-retry';\r\nimport defaults from '../defaultState';\r\nimport DebounceLink from 'apollo-link-debounce';\r\nimport Resolvers from \"resolvers\";\r\nimport TypeDefs from \"typeDefs\";\r\n\r\nconst DEFAULT_DEBOUNCE_TIMEOUT = 1000;\r\n\r\nconst cache = new InMemoryCache({\r\n dataIdFromObject: o => (o._id ? `${o.__typename}:${o._id}`: null),\r\n cacheRedirects: {\r\n Query: {\r\n // If every item in the cache exists, then this is a cache hit...if the docs are right...\r\n resolve_entity_ids: (_, args, { getCacheKey }) => {\r\n return args.ids.map((id) => getCacheKey({ __typename: args.typename, _id: id }));\r\n }\r\n }\r\n }\r\n});\r\n\r\nconst errorLink = onError(({ graphQLErrors, networkError, operation, forward }) => {\r\n if (graphQLErrors) {\r\n for (let err of graphQLErrors) {\r\n console.log('[Graphql Error]', err);\r\n switch (err.errorType) {\r\n case 'UnauthorizedException':\r\n // error code is set to UNAUTHENTICATED\r\n // when AuthenticationError thrown in resolver\r\n\r\n // modify the operation context with a new token\r\n return new Observable(async observer => {\r\n try{\r\n // const creds = await Auth.currentUserCredentials();\r\n // creds.refresh(err => {throw Error(err)});\r\n const idToken = await Auth.currentSession().idToken;\r\n console.log('currentSession', await Auth.currentSession());\r\n const oldHeaders = operation.getContext().headers;\r\n operation.setContext({\r\n headers: {\r\n ...oldHeaders,\r\n authorization: idToken.jwtToken,\r\n },\r\n });\r\n const subscriber = {\r\n next: observer.next.bind(observer),\r\n error: observer.error.bind(observer),\r\n complete: observer.complete.bind(observer)\r\n }\r\n forward(operation).subscribe(subscriber);\r\n }catch(error){\r\n console.error('ID Token refresh failed', err)\r\n observer.error(error)\r\n }\r\n })\r\n default:\r\n break;\r\n }\r\n }\r\n }\r\n if (networkError) {\r\n console.log(`[Network error]: ${networkError}`);\r\n // if you would also like to retry automatically on\r\n // network errors, we recommend that you use\r\n // apollo-link-retry\r\n }\r\n }\r\n);\r\n\r\nconst authLink = setContext((request) => new Promise( (resolve, reject) => {\r\n let promises = [];\r\n\r\n promises.push(\r\n Auth.currentSession()\r\n .then(session => {\r\n const token = session.idToken.jwtToken;\r\n return {\r\n headers: { Authorization: token }\r\n }\r\n })\r\n )\r\n\r\n Promise.all(promises)\r\n .then((values) => resolve(values[0]))\r\n .catch((err) => reject(err))\r\n\r\n }));\r\n\r\npersistCache({\r\n cache,\r\n storage: window.localStorage\r\n})\r\n\r\nconst client = new ApolloClient({\r\n cache,\r\n resolvers: Resolvers,\r\n typeDefs: TypeDefs,\r\n link: ApolloLink.from([\r\n errorLink,\r\n new RetryLink(),\r\n authLink,\r\n new DebounceLink(DEFAULT_DEBOUNCE_TIMEOUT),\r\n new HttpLink({\r\n uri: config.appSync.url\r\n })\r\n ])\r\n})\r\n\r\ncache.writeData({ data: defaults });\r\n\r\nclient.onResetStore(() => cache.writeData({ data: defaults }));\r\n\r\nconst withApolloProvider = (Component) => {\r\n return props => (\r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport default withApolloProvider","import gql from 'graphql-tag';\r\n\r\nexport default gql`\r\nquery GetRemoteUserSettings {\r\n GetRemoteUserAppSettings(appName: \"manifestcentral\"){\r\n appName\r\n settings\r\n }\r\n}\r\n`","import { Button, Icon, Layout } from 'antd';\r\nimport { Auth } from '@aws-amplify/auth';\r\nimport { FeedbackFormModal } from 'components/feedback-form';\r\nimport { AuthContext, AuthProvider } from 'context/auth';\r\nimport { GlobalAppStateProvider } from 'context/global-app-state';\r\nimport GlobalFilterProvider from 'context/global-filter';\r\nimport { ThemeContext, ThemeProvider } from 'context/theme';\r\nimport gql from 'graphql-tag';\r\nimport React, { Component } from 'react';\r\nimport { withApollo } from 'react-apollo';\r\nimport { DragDropContext } from 'react-dnd';\r\nimport HTML5Backend from 'react-dnd-html5-backend';\r\nimport { withRouter } from 'react-router-dom';\r\nimport App from '../components/App';\r\nimport AppLoading from '../components/AppLoading';\r\nimport { GlobalFilterInitializer } from '../components/GlobalFilterInitializer';\r\nimport NotAuthorized from '../components/NotAuthorized';\r\nimport withApolloProvider from '../components/WithApolloProvider';\r\nimport { OrgDataProvider } from '../context/orgData';\r\nimport queryString from 'qs';\r\nimport { PersistenceProvider } from 'hooks/persistence';\r\nimport UserSettingsQuery from 'Queries/UserSettingsQuery';\r\nimport {OrganizationFragment} from \"../Queries/Organization\";\r\nimport { enableMapSet } from \"immer\";\r\n\r\n// Allow immer library to work with Maps and Sets.\r\nenableMapSet();\r\n\r\nconst ORG_QUERY = gql`\r\nquery OrgQuery($id: ID!){\r\n getOrganization(_id: $id){\r\n ...OrganizationFragment\r\n }\r\n}\r\n${OrganizationFragment}\r\n`\r\n\r\nconst FINISH_APP_LOADING = gql`\r\nmutation {\r\n appLoaded(payload: true) @client\r\n}\r\n`\r\n\r\nconst NoContracts = (org) => (\r\n
    \r\n

    No contracts have been assigned to your organization {org.name}

    \r\n
    \r\n)\r\n\r\n/**\r\n * Wraps the entire application and retrieves data that is required for the application to function.\r\n */\r\nclass AppInitializer extends Component {\r\n\r\n initialState = {\r\n initializing: true,\r\n error: null,\r\n notAuthorized: false,\r\n message: null,\r\n currentOrganization: null,\r\n contracts: [],\r\n attempts: 0,\r\n loadingMessage: null,\r\n feedbackOpen: false\r\n }\r\n\r\n constructor(props){\r\n super(props);\r\n this.state = this.initialState\r\n }\r\n\r\n isWindow(){ String(this.props.location.pathname).startsWith('/app/window') }\r\n\r\n componentDidMount(){\r\n this.setState({ initializing: true });\r\n\r\n // Start initialization process on component mount.\r\n this.initialize()\r\n .then(() => this.setState({ initializing: false }))\r\n .catch((error) => {\r\n if (!this.attemptAutomaticRetry()){\r\n this.setState({ error })\r\n }\r\n })\r\n }\r\n\r\n /** \r\n * Restarts the initialization process.\r\n * @param resetAttempts boolean -- if true, the attempt counter is reset to 1.\r\n **/\r\n retry = (resetAttempts) => {\r\n this.initialize(resetAttempts)\r\n .then(() => this.setState({ initializing: false }))\r\n .catch((error) => {\r\n if (!this.attemptAutomaticRetry()){\r\n this.setState({\r\n error: {\r\n title: 'Could not establish connection to server',\r\n message: If this issue persists please this.setState({ feedbackOpen: true })}\r\n >report an outage\r\n \r\n },\r\n initializing: false\r\n })\r\n }\r\n })\r\n }\r\n\r\n /** Attempt to retry initialization process. If max retries has been reached, then a retry will not be performed. */\r\n attemptAutomaticRetry = () => {\r\n if (this.canRetry()){\r\n this.retry();\r\n return true\r\n }\r\n return false\r\n }\r\n\r\n /** Finishes the app loading process */\r\n finishAppLoading = async () => {\r\n return await this.props.client.mutate({\r\n mutation: FINISH_APP_LOADING\r\n });\r\n }\r\n\r\n /** Gets max retry count. If prop maxEntries is not included on components it defaults to 3 retries. */\r\n getMaxRetryCount = () => {\r\n return this.props.maxRetries || 3;\r\n }\r\n\r\n /** Whether or not there are enough retry attempts */\r\n canRetry = () => {\r\n return this.state.attempts <= this.getMaxRetryCount()\r\n }\r\n\r\n /** Starts initialization process */\r\n initialize = async (resetAttempts) => {\r\n await this.setState({ ...this.initialState, attempts: resetAttempts ? this.initialState.attempts + 1 : this.state.attempts + 1});\r\n const { client, location } = this.props;\r\n\r\n let urlQs = queryString.parse(location.search, { ignoreQueryPrefix: true });\r\n let fetchPolicy = this.isWindow() ? 'cache-first' : 'network-only';\r\n\r\n var user, org;\r\n\r\n // Retrieve organization details from user account.\r\n try{\r\n user = await Auth.currentAuthenticatedUser()\r\n }\r\n catch(err){\r\n console.error(err);\r\n err.title = 'Failed to load user';\r\n throw err\r\n }\r\n const orgId = user.attributes['custom:organization'];\r\n\r\n // Users without an organization are kicked to this screen.\r\n if (!orgId){\r\n const msg = \r\n Your Dataflyt account does not have an assigned organization. Please contact dataflyt at support@dataflyt.com\r\n \r\n this.setState({ message: msg })\r\n return;\r\n }\r\n\r\n // Retrieve the user's organization from database\r\n try{\r\n this.setState({ loadingMessage: 'Loading organization' })\r\n const { data: { getOrganization } } = await client.query({\r\n query: ORG_QUERY,\r\n variables: {\r\n id: orgId\r\n },\r\n fetchPolicy\r\n });\r\n org = getOrganization\r\n this.setState({ currentOrganization: org });\r\n }\r\n catch(error){\r\n console.error(error);\r\n const unauthorizedError = error.graphQLErrors.find(err => {\r\n if (err.errorType === 'Unauthorized' && err.path[0] === 'getOrganization'){\r\n return true\r\n }\r\n return false\r\n });\r\n if (unauthorizedError){\r\n this.setState({\r\n loading: false,\r\n notAuthorized: true\r\n })\r\n return;\r\n }\r\n error.title = 'Failed to load organization';\r\n throw error\r\n // this.setState({ error });\r\n // return; \r\n }\r\n\r\n // Set global current organization state\r\n try{\r\n await client.mutate({\r\n mutation: gql`\r\n mutation SetOrg($org: Organization!){\r\n organization(payload: $org) @client {\r\n ...OrganizationFragment\r\n }\r\n }\r\n ${OrganizationFragment}\r\n `,\r\n variables: {\r\n org: org\r\n }\r\n });\r\n }\r\n catch(err){\r\n console.error(err);\r\n throw err\r\n }\r\n\r\n try{\r\n if (!org){\r\n this.setState({ message: 'Not organization returned' })\r\n return\r\n }\r\n\r\n // Organization is a customer. Get transporters contracted with this customer and set a default selected transporter.\r\n if (org.classType === 'flytsuite.customer'){\r\n let allContracts;\r\n this.setState({ loadingMessage: 'Loading contracts' })\r\n const { data: { contracts } } = await client.query({\r\n query: gql`\r\n query ContractQuery(\r\n $filter: ContractsFilterInput\r\n $limit: Int\r\n ){\r\n contracts(\r\n filter: $filter\r\n limit: $limit\r\n ){\r\n docs {\r\n _id\r\n ... on Contract {\r\n name\r\n startDate\r\n endDate\r\n customerID {\r\n ...OrganizationFragment\r\n }\r\n tpID {\r\n ...OrganizationFragment\r\n }\r\n }\r\n }\r\n }\r\n }\r\n ${OrganizationFragment}\r\n `,\r\n variables: {\r\n filter: {\r\n customerID: org._id,\r\n active: true\r\n },\r\n limit: 9999\r\n },\r\n fetchPolicy\r\n });\r\n allContracts = contracts.docs;\r\n this.setState({ contracts: allContracts });\r\n\r\n // No contracts are available for this customer. Application cannot continue forward.\r\n if (!allContracts || !allContracts.length){\r\n this.setState({ message: });\r\n return;\r\n }\r\n\r\n await client.mutate({\r\n mutation: gql`\r\n mutation SetContracts($contracts: [Contract!]!){\r\n contracts(payload: $contracts) @client{\r\n _id\r\n name\r\n startDate\r\n endDate\r\n tpID {\r\n ...OrganizationFragment\r\n }\r\n customerID {\r\n ...OrganizationFragment\r\n }\r\n }\r\n }\r\n ${OrganizationFragment}\r\n `,\r\n variables: {\r\n contracts: allContracts\r\n }\r\n });\r\n const { data: { tpList } } = await client.query({\r\n query: gql`\r\n query GetTpList{\r\n tpList @client{\r\n ...OrganizationFragment\r\n }\r\n }\r\n ${OrganizationFragment}\r\n `\r\n });\r\n const { data: { transporter: currentTp } } = await client.query({\r\n query: gql`\r\n {\r\n transporter @client {\r\n ...OrganizationFragment\r\n }\r\n }\r\n ${OrganizationFragment}\r\n `\r\n });\r\n const userSettingsQueryRes = await client.query({ query: UserSettingsQuery });\r\n let settingsJson, savedTpId;\r\n try {\r\n settingsJson = JSON.parse(userSettingsQueryRes?.data?.GetRemoteUserAppSettings?.settings);\r\n savedTpId = settingsJson?.generalSettings?.savedTpId;\r\n }\r\n catch(error){\r\n console.error(\"Failed to parse user settings!\");\r\n }\r\n \r\n let selectedTp = tpList[0];\r\n let savedTpIndex = tpList.findIndex((tp) => tp._id === savedTpId);\r\n if (savedTpId && savedTpIndex > -1){\r\n selectedTp = tpList[savedTpIndex];\r\n }\r\n\r\n if (!currentTp || (currentTp._id !== savedTpId && savedTpId)){\r\n client.writeData({ data: {\r\n customer: org,\r\n transporter: selectedTp\r\n } });\r\n }\r\n }\r\n\r\n // Organization is a transporter. Set global transporter state to organization.\r\n else if (org.classType === 'flytsuite.transporter'){\r\n await client.writeFragment({\r\n id: `Transporter:${org._id}`,\r\n fragment: OrganizationFragment,\r\n data: {\r\n _id: org._id,\r\n name: org.name,\r\n type: org.type,\r\n classType: org.classType,\r\n requireOverrideFields1: org.requireOverrideFields1,\r\n useV1Scheduler: org.useV1Scheduler,\r\n __typename: 'Transporter'\r\n }\r\n })\r\n await client.mutate({\r\n mutation: gql`\r\n mutation SetTransporter(\r\n $id: ID!\r\n ){\r\n transporter(\r\n id: $id\r\n ) @client {\r\n ...OrganizationFragment\r\n }\r\n }\r\n ${OrganizationFragment}\r\n `,\r\n variables: {\r\n id: org._id\r\n }\r\n });\r\n }\r\n\r\n // Organization is an employer. Set global employer state to organization.\r\n else if (org.classType === 'flytsuite.employer') {\r\n await client.writeFragment({\r\n id: 'Employer:' + org._id,\r\n fragment: OrganizationFragment,\r\n data: {\r\n ...org,\r\n __typename: 'Employer'\r\n }\r\n })\r\n const employer = await client.readFragment({\r\n id: 'Employer:' + org._id,\r\n fragment: OrganizationFragment\r\n })\r\n await client.writeData({ data: {\r\n employer: employer\r\n } });\r\n }\r\n else\r\n {\r\n const err = new Error(`Manifest Central is not compatible with your organization '${org.name}' at this time.`);\r\n err.title = 'Incompatible organization';\r\n throw err\r\n // this.setState({ error: err })\r\n }\r\n }\r\n catch(err){\r\n console.error(err);\r\n this.setState({ initializing: false })\r\n throw err\r\n // this.setState({ error: err });\r\n // return;\r\n }\r\n this.setState({ loadingMessage: null })\r\n this.finishAppLoading();\r\n }\r\n\r\n /**\r\n * Signs user out and redirects to login page\r\n */\r\n logout = async () => {\r\n await Auth.signOut();\r\n this.props.history.push('/login');\r\n }\r\n\r\n render(){\r\n const { location } = this.props;\r\n const themeProviderProps = {\r\n enableThemingOnMount: true\r\n }\r\n \r\n let urlQuery = queryString.parse(location.search, { ignoreQueryPrefix: true });\r\n\r\n if (urlQuery.popoutActive){\r\n return \r\n }\r\n\r\n const { initializing, error, message, notAuthorized } = this.state;\r\n \r\n if (initializing){\r\n return \r\n
    \r\n \r\n {this.state.loadingMessage ? this.state.loadingMessage : null }\r\n {this.state.loadingMessage && this.state.attempts > 1 ? ' | ' : null}\r\n {this.state.attempts > 1 ? `Attempt ${this.state.attempts}` : null}\r\n \r\n }\r\n />\r\n
    \r\n
    \r\n }\r\n if (error){\r\n return (\r\n \r\n \r\n \r\n {(auth) => (\r\n <>\r\n \r\n \r\n

    {error.title || 'An error occurred'}

    \r\n

    {error.message}

    \r\n
    \r\n or \r\n
    \r\n
    \r\n this.setState({ feedbackOpen: false })}\r\n />\r\n \r\n )}\r\n
    \r\n
    \r\n
    \r\n )\r\n }\r\n if (message){\r\n return (\r\n \r\n \r\n \r\n {(auth) => (\r\n \r\n

    Your account has not been set up to use Manifest Central

    \r\n

    {message}

    \r\n
    \r\n or \r\n
    \r\n
    \r\n )}\r\n
    \r\n
    \r\n
    \r\n )\r\n }\r\n if (notAuthorized){\r\n return (\r\n \r\n \r\n \r\n {(theme) => (\r\n \r\n

    \r\n In order to use Manifest Central your account must first be approved by a DataFlyt representative.\r\n We have been notified of your request and will be reviewing your account soon.\r\n

    \r\n

    You will receive an email when your account is approved.

    \r\n

    If you have any questions or concerns please contact us by phone: 337-912-0948 or email: support@dataflyt.com

    \r\n }\r\n extra={}\r\n />\r\n )}\r\n
    \r\n
    \r\n
    \r\n )\r\n }\r\n if (!this.state.currentOrganization){\r\n return null\r\n }\r\n console.debug('AppInitializer props', this.props);\r\n\r\n return \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {(theme) => (\r\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 withApolloProvider( withRouter( withApollo(DragDropContext(HTML5Backend)( AppInitializer )) ) )","import React from 'react';\r\nimport './Maintenance.css';\r\n\r\ninterface MaintenanceProps {\r\n message?: string\r\n}\r\n\r\nconst Maintenance: React.FC = (props) => {\r\n return
    \r\n

    Manifest Central is currently down for maintenance

    \r\n {props.message ? (\r\n

    {props.message}

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

    If you have any questions or concerns, please call 337-912-0948 or email support@dataflyt.com

    \r\n
    \r\n}\r\n\r\nexport default Maintenance","import React, { useState, useEffect, useRef } from 'react';\r\nimport '../css/Main.css';\r\nimport { Route, Switch, BrowserRouter } from \"react-router-dom\";\r\nimport Home from './Home';\r\nimport SignIn from './SignIn';\r\nimport SignUp from './SignUp';\r\nimport PrivateRoute from './PrivateRoute';\r\nimport AppInitializer from '../containers/AppInitializer';\r\nimport config from '../config';\r\nimport Maintenance from 'components/Maintenance';\r\nimport {useS3Config} from \"../hooks/s3config\";\r\n\r\nfunction useInterval(callback, delay) {\r\n const savedCallback = useRef();\r\n\r\n // Remember the latest callback.\r\n useEffect(() => {\r\n savedCallback.current = callback;\r\n }, [callback]);\r\n\r\n // Set up the interval.\r\n useEffect(() => {\r\n function tick() {\r\n savedCallback.current();\r\n }\r\n if (delay !== null) {\r\n let id = setInterval(tick, delay);\r\n return () => clearInterval(id);\r\n }\r\n }, [delay]);\r\n}\r\n\r\n/**\r\n * Entry point of the application.\r\n */\r\nfunction Main(){\r\n const S3Config = useS3Config();\r\n\r\n // Display maintenance page if maintenance is enabled in config file.\r\n if (S3Config && S3Config.maintenance){\r\n if (S3Config.maintenance.enabled === true){\r\n return \r\n }\r\n }\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n\r\nexport default Main;\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport './css/index.less';\r\nimport './css/MCTable.less';\r\nimport Main from './components/Main';\r\n\r\n// Imports needed for these styles to apply on popped out windows\r\nimport './components/flytwatch/aircraft-details/style.less';\r\nimport './pages/app/flytwatch/style.less';\r\n// --------------------------------------------------------------\r\n\r\n// import 'antd/dist/antd.css';\r\nimport 'antd/lib/transfer/style';\r\nimport '../node_modules/react-vis/dist/style.css';\r\nimport './css/BlueprintTableFix.css';\r\nimport '@blueprintjs/table/lib/css/table.css';\r\nimport 'react-reflex/styles.css';\r\nimport 'maplibre-gl/dist/maplibre-gl.css';\r\nimport Amplify from '@aws-amplify/core';\r\nimport config from './config';\r\nimport ServiceWorkerProvider from './context/serviceworker';\r\nimport BackspaceDisabler from 'backspace-disabler';\r\n// import AWS from 'aws-sdk';\r\n\r\n\r\n// AWS.config.region = 'us-east-1';\r\n\r\nAmplify.configure(config.amplify);\r\nBackspaceDisabler.disable();\r\n\r\n\r\nconst root = \r\n
    \r\n\r\n\r\nReactDOM.render(root, document.getElementById('root'));","import { useQuery } from '@apollo/react-hooks';\r\nimport { Descriptions, Icon, Menu, message, Select, Tooltip, Typography } from 'antd';\r\nimport { OptionProps, SelectProps } from 'antd/lib/select';\r\nimport cn from 'classnames';\r\nimport { OrgDataContext } from 'context/orgData';\r\nimport gql from 'graphql-tag';\r\nimport moment from 'moment';\r\nimport React, { CSSProperties, HTMLAttributes, ReactElement, useContext, useState } from 'react';\r\nimport { OrgTypes } from '../WithOrgData';\r\nimport { useDebouncedCallback } from 'hooks/useDebouncedCallback';\r\n\r\nconst { Option } = Select;\r\n\r\nconst GET_CONTRACTS = gql`\r\nquery ContractQuery(\r\n $filter: ContractsFilterInput\r\n $limit: Int\r\n){\r\n contracts(\r\n filter: $filter\r\n limit: $limit\r\n ){\r\n docs {\r\n _id\r\n ... on Contract {\r\n name\r\n active\r\n locationID {\r\n _id\r\n name\r\n }\r\n customerID {\r\n _id\r\n name\r\n }\r\n tpID {\r\n _id\r\n name\r\n }\r\n startDate\r\n endDate\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nexport interface ContractDescriptionProps extends HTMLAttributes {\r\n name: string,\r\n locationName: string,\r\n transporterName: string,\r\n customerName: string,\r\n active: boolean,\r\n startDate: string,\r\n endDate: string\r\n}\r\n\r\nfunction renderExpiry(endDate: string){\r\n if (!endDate) return null;\r\n if (moment().startOf('day').isAfter(moment(endDate).startOf('day'))){\r\n return (Expired)\r\n }\r\n else if (moment().startOf('day').isSame(moment(endDate).startOf('day'))){\r\n return (Expires TODAY)\r\n }\r\n else if (moment().add(1, 'month').isAfter(moment(endDate))){\r\n return (Expires in {moment(endDate).diff(moment().startOf('day'), 'days')} days)\r\n }\r\n return null;\r\n}\r\n\r\nexport const ContractDescription: React.FC = (props) => {\r\n\r\n let spanStyle: CSSProperties = {\r\n maxWidth: '80px',\r\n textOverflow: 'ellipsis',\r\n whiteSpace: 'nowrap',\r\n display: 'inline-block',\r\n overflow: 'hidden'\r\n }\r\n\r\n let spanStyle2: CSSProperties = {\r\n display: 'inline-block',\r\n overflow: 'hidden'\r\n }\r\n\r\n let dividerStyle: CSSProperties = {\r\n ...spanStyle2,\r\n margin: '0 4px'\r\n }\r\n\r\n let endDate = [{props.endDate}, renderExpiry(props.endDate)]\r\n\r\n return (\r\n
    \r\n {props.name}\r\n \r\n \r\n LOC: {props.locationName}\r\n \r\n | \r\n \r\n TP: {props.transporterName}\r\n \r\n | \r\n \r\n CUS: {props.customerName}\r\n \r\n | \r\n Active: {\r\n \r\n }\r\n | \r\n St Dt: {\r\n props.startDate ? (\r\n moment().isBefore(moment(props.startDate)) ? (\r\n {props.startDate} (not effective yet)\r\n ) : props.startDate\r\n ) : null\r\n }\r\n | \r\n Ed Dt: {endDate}\r\n \r\n
    \r\n )\r\n}\r\n\r\nexport interface ContractSelectProps extends SelectProps {\r\n orgType?: OrgTypes,\r\n locationID?: string,\r\n extraOptionsBefore?: ReactElement[],\r\n showChooseContractOption?: boolean,\r\n activeOnly?: boolean,\r\n showLocation?: boolean,\r\n showInactive?: boolean,\r\n showExpired?: boolean,\r\n filterOption?: (contract: any) => boolean,\r\n\r\n modifyQueryFilter?: (currFilter: any) => any,\r\n disableFilterByOrg?: boolean,\r\n detailedDescriptions?: boolean\r\n}\r\n\r\nconst ContractSelect = React.forwardRef((props: ContractSelectProps, ref?: React.LegacyRef\r\n )\r\n})\r\n\r\nContractSelect.defaultProps = {\r\n showChooseContractOption: true,\r\n showLocation: false,\r\n detailedDescriptions: false\r\n}\r\n\r\nContractSelect.displayName = \"ContractSelect\"\r\n\r\nexport default ContractSelect\r\n","import queryString from 'qs';\r\nimport React from 'react';\r\nimport _ from 'lodash';\r\nimport moment, { Moment } from 'moment';\r\n\r\nexport const getUniqueTransporters = contracts => {\r\n var uniqueTp = {};\r\n\r\n contracts.forEach(c => {\r\n uniqueTp[c.tpID._id] = c.tpID;\r\n })\r\n\r\n var sortedPaxList = Object.values(uniqueTp).sort((a, b) => {\r\n if (a.name < b.name){\r\n return -1\r\n }\r\n if (a.name > b.name){\r\n return 1\r\n }\r\n return 0\r\n })\r\n return sortedPaxList\r\n}\r\n\r\nexport const getTransporter = (contracts, tpID) => {\r\n const tp = contracts.find(c => c.tpID._id === tpID)\r\n if (tp) {\r\n return tp.tpID\r\n }\r\n return undefined\r\n}\r\n\r\nexport const setTpQueryRoute = (history, location, tpID) => {\r\n const qp = queryString.parse(location.search, { ignoreQueryPrefix: true });\r\n const search = {\r\n ...qp,\r\n tp: tpID\r\n }\r\n history.push({\r\n pathname: location.pathname,\r\n search: queryString.stringify(search)\r\n })\r\n}\r\n\r\nexport const pushHistory = (props, pathname) => {\r\n const qp = queryString.parse(props.location.search, { ignoreQueryPrefix: true });\r\n const search = {\r\n tp: qp.tp\r\n }\r\n props.history.push({\r\n pathname: pathname,\r\n search: queryString.stringify(search)\r\n })\r\n}\r\n\r\nexport const toDateTime = (iso, checkIsToday=true) => {\r\n var dateObj = new Date(iso);\r\n const hh = ('0' + dateObj.getHours()).slice(-2);\r\n const mm = ('0' + dateObj.getMinutes()).slice(-2);\r\n const ss = ('0' + dateObj.getSeconds()).slice(-2);\r\n\r\n const yy = dateObj.getFullYear();\r\n const nn = ('0' + dateObj.getMonth()).slice(-2);\r\n const dd = ('0' + dateObj.getDay()).slice(-2);\r\n\r\n const time = `${hh}:${mm}:${ss}`;\r\n const date = `${yy}-${nn}-${dd}`;\r\n\r\n if (checkIsToday && new Date(Date.now()).getDate() === dateObj.getDate()){\r\n return `${time} TODAY`;\r\n }\r\n return `${time} ${date}`;\r\n}\r\n\r\nexport const sortObjects = (key, a, b) => {\r\n try{\r\n var nameA = a[key].toUpperCase(); // ignore upper and lowercase\r\n var nameB = b[key].toUpperCase(); // ignore upper and lowercase\r\n if (nameA < nameB) {\r\n return -1;\r\n }\r\n if (nameA > nameB) {\r\n return 1;\r\n }\r\n\r\n // names must be equal\r\n return 0;\r\n }\r\n catch(TypeError) {\r\n return -1;\r\n }\r\n}\r\n\r\nexport const filterNull = (list) => list.filter(item => item);\r\n\r\nexport const deDupe = (array, func) => {\r\n const keys = []\r\n const newArray = array.filter(element => {\r\n const funcVal = func(element)\r\n if (!keys.includes(funcVal)){\r\n keys.push(funcVal)\r\n return true\r\n }\r\n return false\r\n })\r\n return newArray\r\n}\r\n\r\nexport const simpleSort = (array, func) => {\r\n return array.sort((a, b) => {\r\n const aFuncVal = func(a);\r\n const bFuncVal = func(b);\r\n if (aFuncVal < bFuncVal){\r\n return -1\r\n }\r\n if (aFuncVal > bFuncVal){\r\n return 1\r\n }\r\n return 0\r\n })\r\n}\r\n\r\nexport const deDupeSort = (array, deDupeFunc, sortFunc) => simpleSort(deDupe(array, deDupeFunc), sortFunc)\r\n\r\nexport const YesNo = (bool) => {\r\n if (bool === true){\r\n return Yes\r\n }\r\n else if (bool === false){\r\n return No\r\n }else{\r\n return null\r\n }\r\n}\r\n\r\nexport const get = (obj, func, def) => {\r\n try{\r\n return func(obj)\r\n }\r\n catch(error){\r\n if (error instanceof TypeError){\r\n return def\r\n }\r\n else{\r\n throw error\r\n }\r\n }\r\n}\r\n\r\nexport const safeGet = (p, o) =>\r\n p.reduce((xs, x) => (xs && xs[x]) ? xs[x] : null, o)\r\n\r\n\r\nexport const getDestinationsFromLegs = (legs) => {\r\n var locations = [];\r\n legs.forEach((leg) => {\r\n locations.push({_id: leg.destinationID, name: leg.destination})\r\n })\r\n return locations;\r\n}\r\n\r\nexport const getLocationsFromLegs = (legs) => {\r\n var locations = [];\r\n legs.forEach((leg) => {\r\n const departureIndex = locations.findIndex(p => p._id === leg.departureID);\r\n const destinationIndex = locations.findIndex(p => p._id === leg.destinationID);\r\n if (departureIndex === -1){\r\n locations.push({_id: leg.departureID, name: leg.departure})\r\n }\r\n if (destinationIndex === -1){\r\n locations.push({_id: leg.destinationID, name: leg.destination})\r\n }\r\n })\r\n return locations;\r\n}\r\n\r\nexport const getDestinationsFromPaxList = (origin, passengers, cargo) => {\r\n var locations = []\r\n if(passengers){\r\n passengers.forEach(pax => {\r\n const destinationIndex = locations.findIndex(p => p._id === pax.destinationID._id);\r\n if (destinationIndex === -1 && pax.destinationID._id !== origin._id){\r\n locations.push(pax.destinationID)\r\n }\r\n\r\n })\r\n }\r\n if(cargo){\r\n cargo.forEach(pax => {\r\n const destinationIndex = locations.findIndex(p => p._id === pax.destinationID._id);\r\n if (destinationIndex === -1 && pax.destinationID._id !== origin._id){\r\n locations.push(pax.destinationID)\r\n }\r\n\r\n })\r\n }\r\n locations.push(origin);\r\n return locations;\r\n}\r\n\r\nexport const getLocationsFromPaxAndCgoList = (origin, passengers, cargo) => {\r\n var locations = [\r\n origin\r\n ]\r\n if(passengers){\r\n passengers.forEach(pax => {\r\n const departureIndex = locations.findIndex(p => p._id === pax.departureID._id);\r\n const destinationIndex = locations.findIndex(p => p._id === pax.destinationID._id);\r\n if (departureIndex === -1){\r\n locations.push(pax.departureID)\r\n }\r\n if (destinationIndex === -1){\r\n locations.push(pax.destinationID)\r\n }\r\n })\r\n }\r\n\r\n if(cargo){\r\n cargo.forEach(cgo => {\r\n const departureIndex = locations.findIndex(p => p._id === cgo.departureID._id);\r\n const destinationIndex = locations.findIndex(p => p._id === cgo.destinationID._id);\r\n if (departureIndex === -1){\r\n locations.push(cgo.departureID)\r\n }\r\n if (destinationIndex === -1){\r\n locations.push(cgo.destinationID)\r\n }\r\n })\r\n }\r\n return locations;\r\n}\r\n\r\nexport const getLocationsFromPaxList = (origin, passengers) => {\r\n var locations = [\r\n origin\r\n ]\r\n passengers.forEach(pax => {\r\n const departureIndex = locations.findIndex(p => p._id === pax.departureID._id);\r\n const destinationIndex = locations.findIndex(p => p._id === pax.destinationID._id);\r\n if (departureIndex === -1){\r\n locations.push(pax.departureID)\r\n }\r\n if (destinationIndex === -1){\r\n locations.push(pax.destinationID)\r\n }\r\n\r\n })\r\n return locations;\r\n}\r\n\r\nexport const createNewLeg = (order, departure, destination) => {\r\n return {\r\n order: order,\r\n departureID: departure.key,\r\n departure: departure.label,\r\n destinationID: destination.key,\r\n destination: destination.label,\r\n paxIDs: [],\r\n cgoIDs: [],\r\n paxWeight: 0,\r\n bagWeight: 0,\r\n paxCount: 0,\r\n bagCount: 0,\r\n cgoWeight: 0,\r\n cgoCount: 0\r\n }\r\n}\r\n\r\nexport const paxOnFlightLeg = (leg, paxSourceData, cgoSourceData) => {\r\n if ((!paxSourceData && !cgoSourceData) || (!paxSourceData.length && !cgoSourceData.length)){\r\n return {\r\n order: leg.order,\r\n departureID: leg.departureID,\r\n departure: leg.departure,\r\n destinationID: leg.destinationID,\r\n destination: leg.destination,\r\n paxIDs: [],\r\n cgoIDs: [],\r\n paxWeight: 0,\r\n bagWeight: 0,\r\n paxCount: 0,\r\n bagCount: 0,\r\n cgoWeight: 0,\r\n cgoCount: 0\r\n }\r\n }\r\n \r\n //Recalculate totals\r\n let paxIDs = [...new Set(paxSourceData.map(pax => pax._id))]\r\n let cgoIDs = [...new Set(cgoSourceData.map(cgo => cgo._id))]\r\n return {\r\n order: leg.order,\r\n departureID: leg.departureID,\r\n departure: leg.departure,\r\n destinationID: leg.destinationID,\r\n destination: leg.destination,\r\n paxIDs: paxIDs,\r\n cgoIDs: cgoIDs,\r\n paxWeight: paxSourceData.reduce((acc, { paxWeight=0 }) => acc + paxWeight, 0),\r\n bagWeight: paxSourceData.reduce((acc, { bagWeight=0 }) => acc + bagWeight, 0),\r\n paxCount: paxIDs.length,\r\n bagCount: paxSourceData.reduce((acc, { bagCount=0 }) => acc + bagCount, 0),\r\n cgoWeight: cgoSourceData.reduce((acc, { weight=0 }) => acc + weight, 0),\r\n cgoCount: cgoIDs.length\r\n }\r\n}\r\n\r\nexport const locationListToFlightLegs = (locations, paxData, cgoData) => {\r\n const getID = (field) => typeof field === 'string' ? field : field?._id\r\n var legs = [];\r\n locations.forEach((loc, pathIndex) => {\r\n if(pathIndex === locations.length -1){\r\n return;\r\n }\r\n\r\n function getDepartureObj(entity){\r\n if ( typeof entity.departureID === 'object') return entity.departureID;\r\n return entity.departureDoc;\r\n }\r\n\r\n function getDestinationObj(entity){\r\n if ( typeof entity.destinationID === 'object') return entity.destinationID;\r\n return entity.destinationDoc;\r\n }\r\n\r\n const passengers = paxData.filter(pax => {\r\n const departureIdx = locations.findIndex(p => (p?.key) === getID(getDepartureObj(pax)));\r\n const destinationIdx = locations.slice().reverse().findIndex(l => (l?.key) === getID(getDestinationObj(pax)));\r\n var count = locations.length - 1\r\n var finalDestIndex = destinationIdx >= 0 ? count - destinationIdx : destinationIdx; \r\n const isOnLeg = pathIndex >= departureIdx && pathIndex < finalDestIndex;\r\n return isOnLeg;\r\n })\r\n const cargo = cgoData.filter(cgo => {\r\n const departureIdx = locations.findIndex(p => (p?.key) === getID(getDepartureObj(cgo)));\r\n const destinationIdx = locations.slice().reverse().findIndex(l => (l?.key) === getID(getDestinationObj(cgo)))\r\n var count = locations.length - 1\r\n var finalDestIndex = destinationIdx >= 0 ? count - destinationIdx : destinationIdx;\r\n const isOnLeg = pathIndex >= departureIdx && pathIndex < finalDestIndex;\r\n return isOnLeg;\r\n })\r\n const nextLoc = locations[pathIndex + 1] || locations[locations.length-1];\r\n const leg = {\r\n order: pathIndex,\r\n departureID: loc.key || getID(loc?.key),\r\n departure: loc.label || loc.name,\r\n destinationID: nextLoc.key || getID(nextLoc?.key),\r\n destination: nextLoc.label || nextLoc.name,\r\n paxIDs: passengers,\r\n cgoIDs: cargo,\r\n paxWeight: passengers.reduce((acc, { paxWeight=0 }) => acc + paxWeight, 0),\r\n bagWeight: passengers.reduce((acc, { bagWeight=0 }) => acc + bagWeight, 0),\r\n paxCount: passengers.length,\r\n bagCount: passengers.reduce((acc, { bagCount=0 }) => acc + bagCount, 0),\r\n cgoWeight: cargo.reduce((acc, { weight=0 }) => acc + weight, 0),\r\n cgoCount: cargo.length\r\n }\r\n legs.push(leg)\r\n })\r\n return legs\r\n}\r\n\r\n/**\r\n * Converts flight legs to a paxList and cgoList\r\n * @param {Array} legs \r\n * @param {(paxID: string) => string} getPaxDestIDCb\r\n * @param {(cgoID: string) => string} getCgoDestCb\r\n * @returns {{ paxIDs: Array, cgoIDs: Array }}\r\n */\r\nexport const flightLegsToPaxCgoLists = (legs, getPaxDestIDCb, getCgoDestIDCb) => {\r\n\r\n if (!legs){\r\n return { paxIDs: [], cgoIDs: [] }\r\n }\r\n\r\n let paxList = [];\r\n let cgoList = [];\r\n\r\n /**\r\n * @param {Array} list \r\n * @param {string} id \r\n */\r\n function insert(list, id){\r\n if (list.findIndex(i => i===id) > -1){\r\n return;\r\n }\r\n else\r\n {\r\n list.push(id)\r\n }\r\n }\r\n\r\n /**\r\n * @param {Array} list \r\n * @param {Array} ids \r\n */\r\n function insertAll(list, ids){\r\n ids.forEach((id) => insert(list, id))\r\n }\r\n\r\n function sortPaxCurrDestFirst(leg){\r\n if (!getPaxDestIDCb) return;\r\n\r\n leg.paxIDs.sort((a, b) => {\r\n let aDest = getPaxDestIDCb(a);\r\n let bDest = getPaxDestIDCb(b);\r\n if (aDest === bDest){\r\n return 0;\r\n }\r\n else if (bDest === leg.destinationID)\r\n {\r\n return 1;\r\n }\r\n else if (aDest === leg.destinationID){\r\n return -1;\r\n }\r\n })\r\n }\r\n\r\n function sortCgoCurrDestFirst(leg){\r\n if (!getCgoDestIDCb) return;\r\n\r\n leg.cgoIDs.sort((a, b) => {\r\n let aDest = getCgoDestIDCb(a);\r\n let bDest = getCgoDestIDCb(b);\r\n if (aDest === bDest){\r\n return 0;\r\n }\r\n else if (bDest === leg.destinationID)\r\n {\r\n return 1;\r\n }\r\n else if (aDest === leg.destinationID){\r\n return -1;\r\n }\r\n })\r\n }\r\n\r\n legs.forEach(leg => {\r\n insertAll(paxList, leg.paxIDs)\r\n insertAll(cgoList, leg.cgoIDs)\r\n sortPaxCurrDestFirst(leg);\r\n sortCgoCurrDestFirst(leg);\r\n })\r\n\r\n return {\r\n paxIDs: paxList,\r\n cgoIDs: cgoList\r\n }\r\n}\r\n\r\nexport const removePaxCgoFromFlightLegs = (legs, paxIDs, cgoIDs) => {\r\n let newLegs = {...legs};\r\n\r\n newLegs.forEach((leg) => {\r\n paxIDs.forEach((paxID) => {\r\n let paxIdx = leg.paxIDs.findIndex(id => id === paxID)\r\n if (paxIdx > -1){\r\n leg.paxIDs.splice(paxIdx, 1);\r\n }\r\n })\r\n cgoIDs.forEach((cgoID) => {\r\n let cgoIdx = leg.cgoIDs.findIndex(id => id === cgoID)\r\n if (cgoIdx > -1){\r\n leg.cgoIDs.splice(cgoIdx, 1);\r\n }\r\n })\r\n })\r\n\r\n newLegs.filter((leg) => {\r\n let empty = !leg.cgoIDs && !leg.paxIDs;\r\n if (empty){\r\n return 0;\r\n }\r\n return 1;\r\n })\r\n\r\n return newLegs\r\n}\r\n\r\nexport const paxListToFlightLegs = (origin, paxSourceData, cgoSourceData, locations) => {\r\n if ((!paxSourceData && !cgoSourceData) || (!paxSourceData.length && !cgoSourceData.length)){\r\n return [{\r\n order: 0,\r\n departureID: origin._id,\r\n departure: origin.name,\r\n destinationID: origin._id,\r\n destination: origin.name,\r\n paxIDs: [],\r\n cgoIDs: [],\r\n paxWeight: 0,\r\n bagWeight: 0,\r\n paxCount: 0,\r\n bagCount: 0,\r\n cgoWeight: 0,\r\n cgoCount: 0\r\n }]\r\n }\r\n var flightpath = [\r\n origin\r\n ]\r\n if(locations && locations.length > 0){\r\n flightpath = flightpath.concat(locations.slice(0, -1))\r\n }\r\n if(paxSourceData){\r\n paxSourceData.forEach(pax => {\r\n var departureIndex = flightpath.findIndex(p => p._id === pax.departureID._id);\r\n if (departureIndex === -1){\r\n flightpath.push(pax.departureID)\r\n departureIndex = flightpath.findIndex(p => p._id === pax.departureID._id);\r\n }\r\n const destinationIdx = flightpath.slice().reverse().findIndex(p => p._id === pax.destinationID._id)\r\n var count = flightpath.length - 1\r\n var finalDestIndex = destinationIdx > 0 ? count - destinationIdx : destinationIdx;\r\n if (finalDestIndex === -1 || ((finalDestIndex < departureIndex) && finalDestIndex !== 0)){\r\n flightpath.push(pax.destinationID)\r\n }\r\n })\r\n }\r\n if(cgoSourceData){\r\n cgoSourceData.forEach(pax => {\r\n var departureIndex = flightpath.findIndex(p => p._id === pax.departureID._id);\r\n if (departureIndex === -1){\r\n flightpath.push(pax.departureID)\r\n departureIndex = flightpath.findIndex(p => p._id === pax.departureID._id);\r\n }\r\n const destinationIdx = flightpath.slice().reverse().findIndex(p => p._id === pax.destinationID._id)\r\n var count = flightpath.length - 1\r\n var finalDestIndex = destinationIdx > 0 ? count - destinationIdx : destinationIdx;\r\n if (finalDestIndex === -1 || ((finalDestIndex < departureIndex) && finalDestIndex !== 0)){\r\n flightpath.push(pax.destinationID)\r\n }\r\n })\r\n }\r\n flightpath.push(origin)\r\n \r\n var legs = [];\r\n flightpath.forEach((loc, pathIndex) => {\r\n if(pathIndex === flightpath.length -1){\r\n return;\r\n }\r\n const passengers = paxSourceData.filter(pax => {\r\n const departureIdx = flightpath.findIndex(p => p._id === pax.departureID._id)\r\n const destinationIdx = flightpath.slice().reverse().findIndex(p => p._id === pax.destinationID._id)\r\n var count = flightpath.length - 1\r\n var finalDestIndex = destinationIdx >= 0 ? count - destinationIdx : destinationIdx; \r\n const isOnLeg = pathIndex >= departureIdx && pathIndex < finalDestIndex;\r\n return isOnLeg;\r\n })\r\n const cargo = cgoSourceData.filter(cgo => {\r\n const departureIdx = flightpath.findIndex(p => p._id === cgo.departureID._id)\r\n const destinationIdx = flightpath.slice().reverse().findIndex(p => p._id === cgo.destinationID._id)\r\n var count = flightpath.length - 1\r\n var finalDestIndex = destinationIdx >= 0 ? count - destinationIdx : destinationIdx;\r\n const isOnLeg = pathIndex >= departureIdx && pathIndex < finalDestIndex;\r\n return isOnLeg;\r\n })\r\n const nextLoc = flightpath[pathIndex + 1] || origin;\r\n const leg = {\r\n order: pathIndex,\r\n departureID: loc._id,\r\n departure: loc.name,\r\n destinationID: nextLoc._id,\r\n destination: nextLoc.name,\r\n paxIDs: passengers.map(pax => pax._id),\r\n cgoIDs: cargo.map(cgo => cgo._id),\r\n paxWeight: passengers.reduce((acc, { paxWeight=0 }) => acc + paxWeight, 0),\r\n bagWeight: passengers.reduce((acc, { bagWeight=0 }) => acc + bagWeight, 0),\r\n paxCount: passengers.length,\r\n bagCount: passengers.reduce((acc, { bagCount=0 }) => acc + bagCount, 0),\r\n cgoWeight: cargo.reduce((acc, { weight=0 }) => acc + weight, 0),\r\n cgoCount: cargo.length\r\n }\r\n legs.push(leg)\r\n })\r\n return legs\r\n}\r\n\r\nexport const getFlightDeparture = (flight, passengers=[], cargo=[]) => {\r\n if (!flight) return undefined;\r\n const paxList = [...flight.paxIDList, ...passengers];\r\n const cgoList = [...flight.cgoIDList, ...cargo];\r\n const legs = Object.values(JSON.parse(flight.legs || '{}'));\r\n var departure;\r\n if (!departure && legs.length){\r\n const leg = legs[0]\r\n departure = {\r\n _id: leg.departureID,\r\n name: leg.departure\r\n }\r\n }\r\n if (!departure && flight.departureID){\r\n departure = flight.departureID;\r\n }\r\n if (!departure && paxList.length){\r\n const pax = paxList.find(pax => pax && pax.departureID);\r\n if (pax){\r\n departure = pax.departureID;\r\n }\r\n } \r\n if (!departure && cgoList.length){\r\n const cgo = cgoList.find(cgo => cgo && cgo.departureID);\r\n if (cgo){\r\n departure = cgo.departureID;\r\n }\r\n }\r\n if(!departure && flight.lastKnownController){\r\n departure = flight.lastKnownController\r\n }\r\n return departure\r\n}\r\n\r\nexport const getMaxScheduledOrder = (paxList) => {\r\n const scheduledOrders = paxList.map(pax => {\r\n var so = (pax && pax.scheduledOrder) || 0\r\n if (typeof so !== 'number'){\r\n so = Number(so);\r\n }\r\n return so\r\n })\r\n .filter(so => so !== undefined && so !== null);\r\n\r\n if (!scheduledOrders.length) return null;\r\n\r\n return Math.max(...scheduledOrders);\r\n}\r\n\r\nexport const calculateScheduledOrder = (paxList) => {\r\n const sortedPaxList = paxList.map(pax => {\r\n var so = pax.scheduledOrder || 0;\r\n if (typeof pax.scheduledOrder !== \"number\"){\r\n so = Number(so); \r\n }\r\n return {\r\n ...pax,\r\n scheduledOrder: so\r\n };\r\n }).sort((a, b) => {\r\n return a.scheduledOrder - b.scheduledOrder\r\n });\r\n return sortedPaxList.map((pax, i) => {\r\n return {\r\n ...pax,\r\n scheduledOrder: i\r\n }\r\n })\r\n}\r\n\r\nexport const getLabelInValue = (key, label, renderLabel) => (obj) => {\r\n if (!obj) return;\r\n let l;\r\n if (typeof renderLabel === 'function'){\r\n l = obj && renderLabel(obj);\r\n }\r\n else{\r\n l = label;\r\n }\r\n return {\r\n key: obj[key],\r\n label: l\r\n }\r\n}\r\n\r\nexport const getContractName = (contract) => {\r\n if(!contract || !contract.name){\r\n return undefined\r\n }\r\n return `${contract.name}`\r\n}\r\n\r\nexport const getPilotName = (pilot, firstNameFirst=true) => {\r\n if (!pilot || !pilot.name){\r\n return null\r\n }\r\n if (firstNameFirst){\r\n return `${pilot.name.lastName}, ${pilot.name.firstName}`\r\n }\r\n return `${pilot.name.lastName}, ${pilot.name.firstName}`\r\n}\r\n\r\nexport const toFormField = (data, field, getValue) => {\r\n let value = data && data[field];\r\n if (typeof getValue === 'function'){\r\n value = getValue(value)\r\n }\r\n return {\r\n value\r\n }\r\n}\r\n\r\nexport const mergeDataWithFormFields = (data, formFields) => {\r\n if (typeof data !== 'object') return;\r\n const dataEntries = Object.entries(data);\r\n let newFormFields = {};\r\n let i;\r\n for (i = 0; i < dataEntries.length; i++){\r\n const [ key, value ] = dataEntries[i];\r\n const field = (formFields && formFields[key]) || {};\r\n newFormFields[key] = { ...field, value };\r\n }\r\n return newFormFields;\r\n}\r\n\r\nexport function parsePersonName(value){\r\n const inputString = ('' + value).trim();\r\n if (!inputString){\r\n return\r\n }\r\n var lastName, firstName;\r\n if (inputString.includes(\", \")){\r\n const splitString = inputString.split(\", \");\r\n if (splitString.length === 2){\r\n lastName = splitString[0];\r\n firstName = splitString[1];\r\n }\r\n }\r\n else if (inputString.includes(\" \")){\r\n const splitString = inputString.split(\" \");\r\n if (splitString.length === 2){\r\n firstName = splitString[0];\r\n lastName = splitString[1];\r\n }\r\n }\r\n if (!lastName && !firstName){\r\n return { lastName: null, firstName: null, name: inputString }\r\n }\r\n if (lastName && firstName){\r\n return { lastName, firstName, name: undefined }\r\n }\r\n}\r\n\r\nexport function getOrgISNName(org){\r\n if (!org) return;\r\n const name = org.name;\r\n var isnName = org.isnName;\r\n if (!isnName){\r\n if (typeof name === 'string'){\r\n isnName = name.toLowerCase().replace(' ', '_');\r\n }else{\r\n isnName = name;\r\n }\r\n }\r\n return isnName\r\n}\r\n\r\nexport function removeTypename(obj, recursive=true){\r\n if (!_.isObject(obj)){\r\n return obj;\r\n }\r\n\r\n if (Array.isArray(obj)){\r\n return obj.map(element => removeTypename(element));\r\n }\r\n // let keys = Object.keys(obj);\r\n // for (let index = 0; index < keys.length; index++) {\r\n // let key = keys[index];\r\n // let value = obj[key];\r\n // if (value && typeof value === 'object'){\r\n // delete value.__typename;\r\n // if (recursive){\r\n // removeTypename(value);\r\n // }\r\n // }\r\n // }\r\n let newObj = _.omit(obj, '__typename');\r\n if (recursive){\r\n newObj = _.mapValues(newObj, (value) => removeTypename(value, recursive))\r\n }\r\n return newObj\r\n}\r\n\r\nexport function getDisplayName(WrappedComponent) {\r\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\r\n}\r\n\r\nexport function englishList(strings){\r\n return strings.join(', ').replace(/, ([^,]*)$/, ' and $1')\r\n}\r\n\r\nexport function castArray(obj){\r\n let array = [];\r\n if (Array.isArray(obj)){\r\n array = obj;\r\n }\r\n else if (obj === undefined){\r\n return [];\r\n }\r\n else if (obj)\r\n {\r\n array.push(obj);\r\n }\r\n return array\r\n}\r\n\r\nexport function cleanGraphQLErrorMsg(message){\r\n if (typeof message !== 'string'){\r\n message = String(message);\r\n }\r\n message = message.replace('GraphQL error: ', '');\r\n return message;\r\n}\r\n\r\nexport function classNames(){\r\n\r\n let clsArray = [];\r\n\r\n for (const idx in arguments) {\r\n let arg = arguments[idx];\r\n\r\n if (Array.isArray(arg)) {\r\n clsArray = [ ...clsArray, ...arg ];\r\n }\r\n else if (typeof arg === 'string'){\r\n clsArray = [ ...clsArray, ...arg.split(' ') ];\r\n }\r\n }\r\n\r\n clsArray = clsArray.map(str => str.trim()).filter(str => str.length > 0);\r\n return clsArray.join(' ')\r\n}\r\n\r\nexport function paxHasRestriction(pax){\r\n if (!pax.authorization){\r\n return false;\r\n }\r\n let entries = Object.entries(pax.authorization);\r\n entries = entries.filter(([key]) => {\r\n if (String(key).startsWith(\"brdRestriction_\")){\r\n return true;\r\n }\r\n return false;\r\n })\r\n for (const i in entries) {\r\n if (entries[i] && entries[i][1].status === 'NEEDS_OVERRIDE'){\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nexport function omit(obj, ...keys){\r\n if (typeof obj === 'object' && Array.isArray(keys)){\r\n let objCopy = {...obj};\r\n keys.forEach(key => {\r\n if (key in objCopy){\r\n delete objCopy[key];\r\n }\r\n })\r\n return objCopy;\r\n }\r\n return obj;\r\n}\r\n\r\nexport function getPersonFullName(person){\r\n if (person && person.lastName && person.firstName){\r\n return `${person.lastName}, ${person.firstName}`\r\n }\r\n return undefined;\r\n}\r\nexport function padStringInt(num, size) {\r\n num = num.toString();\r\n while (num.length < size) num = \"0\" + num;\r\n return num;\r\n}\r\n\r\nexport function momentOrNull(value){\r\n if (value){\r\n return moment(value)\r\n }\r\n return null\r\n}\r\n\r\nexport function isPaxNodeLockedOrDeparted(pax){\r\n console.log(pax, pax?.currentCarrierID?.state)\r\n if (['LOCKED', 'DEPARTED'].includes(pax?.currentCarrierID?.state)){\r\n return true\r\n }\r\n return false\r\n}\r\n\r\nexport function getFirstElArrayOrNull(arr){\r\n if (!arr || arr.length === 0){\r\n return undefined\r\n }\r\n return arr[0];\r\n}\r\n\r\n/**\r\n * @param {Moment} start \r\n * @param {Moment} end \r\n */\r\nexport function getMinuteDuration(start, end){\r\n let sMin = Math.floor(moment(start).unix() / 60);\r\n let eMin = Math.floor(moment(end).unix() / 60);\r\n\r\n return eMin - sMin;\r\n}\r\n\r\n/**\r\n * @param {Moment} start \r\n * @param {Moment} end \r\n */\r\n export function getMinuteDurationAsHrMin(start, end){\r\n let minDur = getMinuteDuration(start, end);\r\n\r\n let hours = padStringInt(Math.floor(Math.abs(minDur / 60)), 2);\r\n let minutes = padStringInt(Math.floor(Math.abs(minDur % 60)), 2);\r\n\r\n if (minDur < 0) {\r\n return \"-\" + hours + ':' + minutes\r\n }\r\n\r\n return hours + ':' + minutes\r\n}\r\n\r\nexport function getDurationHoursMinutes(diff, formatFn){\r\n\r\n let minDur = Math.ceil(moment.duration(diff).asMinutes());\r\n \r\n let hours, minutes;\r\n \r\n hours = padStringInt(Math.floor(Math.abs(minDur / 60)), 2);\r\n minutes = padStringInt(Math.floor(Math.abs(minDur % 60)), 2);\r\n\r\n if (typeof formatFn === 'function'){\r\n return formatFn(hours, minutes)\r\n }\r\n\r\n if (minDur < 0) {\r\n return \"-\" + hours + ':' + minutes\r\n }\r\n\r\n return hours + ':' + minutes\r\n}\r\n\r\n// Pads a time (two or one digit) with a 0 if it is one digit\r\nexport function padTime(t){\r\n return String(t).padStart(2, '0')\r\n}\r\n\r\n// customOffset is in minutes. e.g. CST: -360\r\nexport function dateToZulu(date, customOffset){\r\n if (!date) return null\r\n let mom = moment(date);\r\n mom.set({\r\n hour: 0,\r\n minute: 0,\r\n second: 0,\r\n millisecond: 0\r\n })\r\n if (customOffset){\r\n mom.utcOffset(customOffset);\r\n }\r\n let utc = moment.utc(mom, true).format();\r\n return utc\r\n}\r\n\r\nexport function dateToZuluTzName(date, tzName){\r\n if (!date) return null\r\n let mom = moment(date);\r\n let day = mom.startOf('day');\r\n mom = moment.tz(mom.format(), tzName);\r\n mom.set({ day: day.day() })\r\n let utc = mom.format();\r\n return utc\r\n}\r\n\r\nexport function getDateMidnightZulu(date, offset){\r\n if (!date) return null\r\n let day = moment(date).format('YYYY-MM-DD') + 'T00:00:00Z';\r\n let startTime = moment(day).add(offset, 'hours').utc().format()\r\n return startTime\r\n}\r\n\r\nexport function dateMtimeMtoZuluStr(date, time){\r\n let d = moment.utc(moment(date)).format()\r\n let t = moment.utc(moment(time)).format();\r\n\r\n let newDate = d.split(\"T\")[0]\r\n let newTime = t.split(\"T\")[1]\r\n return newDate + \"T\" + newTime\r\n}\r\n\r\n/**\r\n * Converts the object { date: Moment, time: Moment } to a plain moment object.\r\n * Takes the date from the date, and the time from the time, and combines them together\r\n * @param {{ date: Moment, time: Moment }} dt \r\n * @param {bool} nullIfPartial Returns null if obj only contains a date or only contains a time\r\n * @returns Moment\r\n */\r\nexport function dateMtimeMtoMoment(dt, nullIfPartial=true){\r\n if (!dt) return null\r\n let { date, time } = dt;\r\n if (!date && !time) return null;\r\n if (nullIfPartial && (!date || !time)){\r\n return null\r\n }\r\n let d = moment(date);\r\n let t = moment(time);\r\n\r\n d.set({\r\n hours: t.get('hours'),\r\n minutes: t.get('minutes'),\r\n seconds: t.get('seconds'),\r\n milliseconds: t.get('milliseconds')\r\n })\r\n \r\n return d\r\n}\r\n\r\nexport function detectInvalidDate(date, valueIfInvalid){\r\n if (typeof date === 'string' && date.includes('Invalid date')){\r\n return valueIfInvalid;\r\n }\r\n return date;\r\n}\r\n\r\n/**\r\n * Checks if an arbritrary time is within the start time and end time of an unsorted list\r\n * @param {Moment} t Time to compare\r\n * @param {Array<[Moment, Moment]>} timeRanges List of arrays of size 2. Each entry has a start time and end time\r\n */\r\nexport function timeInTimeRanges(t, timeRanges){\r\n if (!Array.isArray(timeRanges)){\r\n return false;\r\n }\r\n let start, end, range;\r\n for (range in timeRanges){\r\n if (Array.isArray(range) && range.length > 1){\r\n start = range[0];\r\n end = range[1];\r\n }\r\n else continue;\r\n \r\n if (moment(t).isBetween(moment(start), moment(end))){\r\n return true\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Detects overlapping intervals in any number of intervals of Moment objects\r\n * @param {Array<[Moment, Moment]>} intervals \r\n * @returns {bool} true if overlap, false if not\r\n */\r\nexport function momentIntervalsHaveOverlap(intervals){\r\n // Sort by start time\r\n // For each time range, check if the end time of the last entry is greater than the end time of the current entry\r\n // If true, then there is an overlap\r\n if (!Array.isArray(intervals)){\r\n return false;\r\n }\r\n if (intervals.length < 2){\r\n return false;\r\n }\r\n let sorted = intervals.sort((a, b) => a[0].diff(b[0]))\r\n for (let i = 1; i < sorted.length; i++){\r\n if (sorted[i-1][1].isAfter(sorted[i][0])){\r\n console.debug('[momentIntervalsHaveOverlap] Overlap detected.', sorted);\r\n console.debug(`${sorted[i-1][1]} of interval index ${i-1} is after ${sorted[i][0]} of interval index ${i}`);\r\n return true\r\n }\r\n }\r\n console.debug('[momentIntervalsHaveOverlap] No overlap detected.', sorted);\r\n return false\r\n}\r\n\r\n/**\r\n * Detects overlapping intervals in any number of intervals of Moment objects.\r\n * If an overlap is detected it will return a mapping with the left side representing\r\n * the index of the interval, and the right representing the interval element (start or end) -> (0 or 1)\r\n * \r\n * Example: This return value says that the second and third interval are overlapping at the end time of the second interval\r\n * and the start time of the third interval:\r\n * \r\n * {\r\n * 2: 1, // Second interval overlapping at end time\r\n * 3: 0 // Third interval overlapping at start time\r\n * }\r\n * \r\n * @param {Array<[Moment, Moment]>} intervals \r\n * @returns {Map} Map where left is the offending interval index and right is the start (0) or end (1) that is overlapping\r\n */\r\nexport function getMomentIntervalsWithOverlaps(intervals){\r\n // Sort by start time\r\n // For each time range, check if the end time of the last entry is greater than the end time of the current entry\r\n // If true, then there is an overlap\r\n if (!Array.isArray(intervals)){\r\n return new Map();\r\n }\r\n if (intervals.length < 2){\r\n return new Map();\r\n }\r\n let sorted = intervals.sort((a, b) => a[0].diff(b[0]))\r\n\r\n let overlaps = new Map();\r\n\r\n for (let i = 1; i < sorted.length; i++){\r\n if (sorted[i-1][1].isAfter(sorted[i][0])){\r\n console.debug('[getMomentIntervalsWithOverlaps] Overlaps detected.', sorted);\r\n console.debug(`${sorted[i-1][1]} of interval index ${i-1} is after ${sorted[i][0]} of interval index ${i}`);\r\n overlaps.set(i-1, 1);\r\n overlaps.set(i, 0);\r\n }\r\n }\r\n if (overlaps.length === 0){\r\n console.debug('[getMomentIntervalsWithOverlaps] No overlaps detected.', sorted);\r\n }\r\n return overlaps\r\n}\r\n\r\nexport function zeroTimeMoment(moment){\r\n moment.set({\r\n hours: 0,\r\n minutes: 0,\r\n seconds: 0,\r\n milliseconds: 0\r\n })\r\n return moment\r\n}\r\n\r\nexport function maxTimeMoment(moment){\r\n moment.set({\r\n hours: 23,\r\n minutes: 59,\r\n seconds: 59,\r\n milliseconds: 999\r\n })\r\n return moment\r\n}\r\n\r\n/**\r\n * \r\n * @param {string} str \r\n * @param {boolean} lowercaseRest \r\n * @param {RegExp} regexException Do not apply capitalization to a string that matches the pattern\r\n * @returns str\r\n */\r\nexport function capitalize(str, lowercaseRest=false, regexException=null){\r\n if (!str){ return '' }\r\n\r\n if (regexException && regexException.test(str)){\r\n return str\r\n }\r\n\r\n let firstLetter = String(str).charAt(0).toUpperCase();\r\n let rest = String(str).slice(1);\r\n if (lowercaseRest){\r\n rest = rest.toLowerCase();\r\n }\r\n return firstLetter + rest\r\n}\r\n\r\n/**\r\n * \r\n * @param {string} str \r\n * @param {boolean} lowercaseRest \r\n * @param {RegExp} regexException Do not apply capitalization to a word that matches the pattern\r\n * @returns str\r\n */\r\nexport function capitalizeWords(str, lowercaseRest=false, regexException=null){\r\n if (!str){ return '' }\r\n \r\n let start = 0;\r\n let end = 0;\r\n let newStr = str;\r\n\r\n function write(){\r\n let word = str.substring(start, end);\r\n word = capitalize(word, lowercaseRest, regexException);\r\n \r\n let tmp = newStr.split('');\r\n tmp.splice(start, end-start, ...word.split(''));\r\n newStr = tmp.join('');\r\n start = end+1;\r\n }\r\n\r\n for (let i = 0; i < str.length; i++) {\r\n const char = str[i];\r\n if (char === \" \"){\r\n end = i;\r\n write();\r\n }\r\n if (i === str.length-1){\r\n end = i+1;\r\n write();\r\n }\r\n }\r\n\r\n return newStr;\r\n}\r\n\r\nexport function getReportCriteriaValue(reportDocument, key){\r\n let criteria = castArray(reportDocument?.criteria);\r\n let c_item = criteria.find(c => c.key === key);\r\n\r\n if (c_item?.value){\r\n try{\r\n return JSON.parse(c_item.value);\r\n }\r\n catch(e){\r\n console.error(\"Failed to parse criteria value:\", e);\r\n return undefined;\r\n }\r\n }\r\n\r\n return;\r\n}\r\n\r\nexport function getDegAngleFromPoints(x1, y1, x2, y2){\r\n return Math.atan2(y2 - y1, x2 - x1) * 180 / Math.PI;\r\n}","import ReactDom from 'react-dom';\r\nimport React, {useRef} from 'react';\r\n\r\nexport type RegisterNodeFunction = (node: React.ReactNode, key: string) => React.ReactNode\r\n\r\n/**\r\n * Holds refs to every React Node registered through {@link reactNodeTextGetter.registerNode}. When those nodes are rendered,\r\n * {@link reactNodeTextGetter.getNodeText} can be called to retrieve the text content of the component.\r\n */\r\nexport function reactNodeTextGetter(){\r\n const nodeRefs = {};\r\n\r\n /**\r\n * \"Registers\" a React Node into a map with a unique key. Used later to get text content onces the component is mounted.\r\n * @param node ReactNode\r\n * @param key Unique key\r\n */\r\n const registerNode: RegisterNodeFunction = (node: React.ReactNode, key: string) => {\r\n let clonedNode = node;\r\n if (React.isValidElement(node)){\r\n clonedNode = React.cloneElement(node, {\r\n ref: r => nodeRefs[key] = r\r\n })\r\n }\r\n else {\r\n nodeRefs[key] = node;\r\n }\r\n return clonedNode;\r\n }\r\n\r\n /**\r\n * Given a nodeId, return the text content of the component. If the component has a \"displayText\" property defined in its ref,\r\n * then that value is used instead. See {@link exportTextInRef}.\r\n * @param nodeId Unique ID to retrieve node text from\r\n */\r\n const getNodeText = (nodeId: string) => {\r\n let text = '';\r\n\r\n let nodeRef = nodeRefs[nodeId];\r\n\r\n if (!nodeRef){\r\n return null;\r\n }\r\n else if (nodeRef.displayText){\r\n text = String(nodeRef.displayText);\r\n }\r\n else if (typeof nodeRef === 'string' || typeof nodeRef === 'number' || typeof nodeRef === 'boolean'){\r\n text = String(nodeRef);\r\n }\r\n else\r\n {\r\n const domNode = ReactDom.findDOMNode(nodeRef);\r\n if (domNode){\r\n text = domNode.textContent;\r\n }\r\n }\r\n\r\n return text;\r\n }\r\n\r\n return ({ getNodeText, registerNode })\r\n}","import React, { createContext, PropsWithChildren, useState, useEffect } from 'react';\r\nimport config from 'config.js';\r\n\r\nimport darkVars from '../dark.json';\r\nimport lightVars from '../light.json';\r\n\r\nconst DARK_THEME_STORAGE_KEY = 'app-dark-theme';\r\nconst ENABLE_THEME_STORAGE_KEY = 'app-theming-enabled';\r\n\r\nconst initialValue = {\r\n vars: undefined,\r\n themeName: undefined,\r\n applied: false,\r\n changeTheme: undefined,\r\n loading: false,\r\n themingEnabled: true\r\n}\r\n\r\ntype ThemeName = 'light' | 'dark'\r\n\r\nexport interface ThemeContextValue {\r\n vars?: any,\r\n themeName: ThemeName,\r\n applied: boolean,\r\n loading: boolean,\r\n changeTheme?: (name: (ThemeName | ((currThemeName: ThemeName) => ThemeName))) => void,\r\n themingEnabled: boolean,\r\n setThemingEnabled?(enabled: boolean): void\r\n}\r\n\r\nexport const ThemeContext = createContext(initialValue);\r\n\r\nexport interface CurrentTheme {\r\n theme: any,\r\n name: ThemeName\r\n}\r\n\r\nfunction getThemeVars(dark: boolean) {\r\n return dark ? darkVars : lightVars;\r\n}\r\n\r\nfunction isDarkFromName(name: ThemeName) {\r\n return name === 'dark';\r\n}\r\n\r\nexport interface ThemeProviderProps {\r\n /**\r\n * Enables application theming when provider is mounted.\r\n * Default: false\r\n */\r\n enableThemingOnMount?: boolean\r\n}\r\n\r\n/**\r\n * Provides dark theming context to the rest of the application.\r\n * Used to enable and disable dark theme.\r\n */\r\nexport const ThemeProvider: React.FC> = (props) => {\r\n let defaultTheme: any = 'dark';\r\n if (config.defaultTheme === 'light') {\r\n defaultTheme = 'light';\r\n }\r\n\r\n const { enableThemingOnMount = false } = props;\r\n\r\n const [themeVars, setThemeVars] = useState(getThemeVars(isDarkFromName(defaultTheme)));\r\n const [themingEnabled, setThemingEnabled] = useState(true);\r\n const [darkApplied, setDarkApplied] = useState(isDarkFromName(defaultTheme));\r\n const [themeApplied, setThemeApplied] = useState(false);\r\n const [themeLoading, setThemeLoading] = useState(false);\r\n\r\n const themeName = darkApplied ? 'dark' : 'light';\r\n\r\n function parseDarkThemeStorage(val: string) {\r\n try {\r\n return JSON.parse(val);\r\n }\r\n catch (e) {\r\n console.error(\"Failed to parse local storage: \", val);\r\n return isDarkFromName(defaultTheme);\r\n }\r\n }\r\n\r\n function parseThemingEnabledStorage(val: string) {\r\n try {\r\n return JSON.parse(val);\r\n }\r\n catch (e) {\r\n console.error(\"Failed to parse local storage: \", val);\r\n return true;\r\n }\r\n }\r\n\r\n // Will listen to theme changes from other windows.\r\n function listenToStorageChanges(e: StorageEvent) {\r\n if (e.key !== DARK_THEME_STORAGE_KEY) return;\r\n console.log(\"Theme changed in other window. Switching theme...\");\r\n applyTheme(Boolean(parseDarkThemeStorage(e.newValue)));\r\n }\r\n\r\n // Re-apply theme when themingEnabled is changed.\r\n useEffect(() => {\r\n applyTheme(darkApplied);\r\n // eslint-disable-next-line\r\n }, [themingEnabled])\r\n\r\n useEffect(() => {\r\n\r\n // Get theme value from local storage\r\n let themeValue = parseDarkThemeStorage(localStorage.getItem(DARK_THEME_STORAGE_KEY));\r\n let themeEnabled = parseThemingEnabledStorage(localStorage.getItem(ENABLE_THEME_STORAGE_KEY));\r\n\r\n // Set default value in local storage if not found.\r\n if (themeValue !== true && themeValue !== false) {\r\n themeValue = isDarkFromName(defaultTheme);\r\n localStorage.setItem(DARK_THEME_STORAGE_KEY, JSON.stringify(themeValue));\r\n }\r\n\r\n // Set default value of theming enabled if not found.\r\n if ((themeEnabled !== true && themeEnabled !== false) || (enableThemingOnMount && !themeEnabled)) {\r\n themeEnabled = true;\r\n localStorage.setItem(ENABLE_THEME_STORAGE_KEY, JSON.stringify(themeEnabled));\r\n }\r\n\r\n // Apply light/dark theme.\r\n applyTheme(themeValue);\r\n\r\n // Add listener for storage changes.\r\n window.addEventListener('storage', listenToStorageChanges);\r\n return () => window.removeEventListener('storage', listenToStorageChanges);\r\n // eslint-disable-next-line\r\n }, [])\r\n\r\n useEffect(() => {\r\n if (themeVars) {\r\n setThemeApplied(false)\r\n setThemeLoading(true)\r\n\r\n // Modifies LESS variables at runtime.\r\n window['less']\r\n .modifyVars(themeVars)\r\n .then(() => {\r\n console.log('Theme changed:', themeVars);\r\n setThemeApplied(true);\r\n })\r\n .catch((e) => {\r\n console.error('FAILED TO APPLY THEME:', e)\r\n })\r\n .then(() => setThemeLoading(false))\r\n }\r\n // eslint-disable-next-line\r\n }, [themeVars, window])\r\n\r\n // Apply theme variables\r\n function applyTheme(dark: boolean) {\r\n const useDark = themingEnabled ? dark : false;\r\n if (useDark)\r\n console.log('Applying dark theme...');\r\n else\r\n console.log('Removing dark theme...');\r\n setDarkApplied(useDark);\r\n const vars = getThemeVars(useDark);\r\n setThemeVars(vars);\r\n }\r\n\r\n // Start theme change process\r\n function changeTheme() {\r\n let name: ThemeName;\r\n if (typeof arguments[0] === 'function') {\r\n name = arguments[0](themeName);\r\n }\r\n else {\r\n name = arguments[0];\r\n }\r\n\r\n console.log(name, isDarkFromName(name));\r\n localStorage.setItem(DARK_THEME_STORAGE_KEY, JSON.stringify(isDarkFromName(name)));\r\n applyTheme(isDarkFromName(name));\r\n }\r\n\r\n function enableTheming(enabled: boolean) {\r\n localStorage.setItem(ENABLE_THEME_STORAGE_KEY, JSON.stringify(enabled));\r\n setThemingEnabled(enabled);\r\n }\r\n\r\n return \r\n {props.children}\r\n ;\r\n}","import React, { createContext, FC, PropsWithChildren, useReducer, useEffect, useContext } from 'react';\r\nimport { Auth } from '@aws-amplify/auth';\r\nimport { Hub } from '@aws-amplify/core';\r\nimport { message } from 'antd';\r\nimport { cloneDeep } from 'lodash';\r\nimport { useApolloClient } from 'react-apollo';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { ThemeContext } from './theme';\r\n// import AWS from 'aws-sdk';\r\n\r\nexport interface AuthContextProps {\r\n user: any,\r\n loading: boolean,\r\n error: any,\r\n signOut: () => Promise,\r\n refreshUser?: () => Promise\r\n}\r\n\r\nexport const AuthContext = createContext({ user: null, loading: true, error: null, signOut: null, refreshUser: () => null })\r\n\r\nconst initialState = { user: null, loading: true }\r\n\r\nfunction authReducer(state, action){\r\n switch (action.type) {\r\n case 'FETCHING':\r\n return { user: null, loading: true }\r\n case 'RECIEVED':\r\n return { user: action.payload, loading: false }\r\n case 'ERROR':\r\n return { user: null, error: action.payload, loading: false }\r\n case 'UPDATE_USER_ATTRIBUTES':\r\n if (!state.user) return state;\r\n\r\n const user = cloneDeep(state.user);\r\n Object.assign(user, { attributes: {\r\n ...state.user.attributes,\r\n ...action.payload\r\n } })\r\n if (action.payload.email !== state.user.attributes.email){\r\n // Email address was changed. Needs to turn off email_verified attribute.\r\n user.attributes.email_verified = false;\r\n }\r\n return { ...state, user };\r\n case 'VERIFY_EMAIL':\r\n let user_to_verify = { ...state.user }\r\n user_to_verify.attributes.email_verified = true;\r\n return { ...state, user: user_to_verify }\r\n case 'UNVERIFY_EMAIL':\r\n let user_to_unverify = { ...state.user }\r\n user_to_unverify.attributes.email_verified = false;\r\n return { ...state, user: user_to_unverify }\r\n default:\r\n break;\r\n }\r\n}\r\n\r\nexport const AuthProvider: FC> = (props) => {\r\n const [state, dispatch] = useReducer(authReducer, initialState);\r\n const apolloClient = useApolloClient();\r\n const history = useHistory();\r\n const theme = useContext(ThemeContext);\r\n\r\n function loadUser(): Promise {\r\n let promise = new Promise((resolve, reject) => {\r\n let promises: Array> = [];\r\n\r\n promises.push(\r\n Auth.currentAuthenticatedUser({\r\n bypassCache: true // Always request user info from cognito\r\n })\r\n .then(user => {\r\n dispatch({ type: 'RECIEVED', payload: user });\r\n return user;\r\n })\r\n .catch(e => {\r\n console.error(e);\r\n message.error(\"Could not retrieve login details\");\r\n dispatch({ type: 'ERROR', payload: e })\r\n })\r\n )\r\n \r\n // promises.push(\r\n // Auth.currentUserCredentials().then((cred) => {\r\n // AWS.config.credentials = cred;\r\n // })\r\n // )\r\n\r\n Promise.all(promises)\r\n .then((values) => resolve(values[0]))\r\n .catch((error) => reject(error))\r\n })\r\n return promise;\r\n }\r\n\r\n useEffect(() => {\r\n loadUser();\r\n\r\n Hub.listen('auth', data => console.log(\"AUTH EVENT: \" + data))\r\n return () => {\r\n Hub.remove('auth', null);\r\n }\r\n }, [])\r\n\r\n useEffect(() => {\r\n function listener (data){\r\n if (!state.user) return;\r\n console.log('user channel event fired:', data, state);\r\n switch (data.payload.event) {\r\n case 'updateUserAttributes':\r\n if (!state.user || !state.user.getSession) return;\r\n const prevAttr = { ...state.user.attributes };\r\n dispatch({ type: 'UPDATE_USER_ATTRIBUTES', payload: data.payload.data.attributes })\r\n Auth.updateUserAttributes(state.user, data.payload.data.attributes)\r\n .then(() => {\r\n message.success(data.payload.data.customSuccessMessage || \"Successfully updated user attributes\");\r\n })\r\n .catch((e) => {\r\n console.log('Failed to update user attributes:', e);\r\n message.error(\"An error occurred while updating user attributes. Please try again later.\");\r\n dispatch({ type: 'UPDATE_USER_ATTRIBUTES', payload: prevAttr })\r\n })\r\n break;\r\n case 'verifyEmail':\r\n Auth.verifyCurrentUserAttributeSubmit('email', data.payload.data.code)\r\n .then(() => {\r\n message.success(\"Successfully verified email address.\")\r\n dispatch({ type: 'VERIFY_EMAIL' });\r\n })\r\n .catch((err) => {\r\n message.error('Failed to verify email address: ' + err.message);\r\n console.error(err);\r\n })\r\n break;\r\n }\r\n }\r\n Hub.remove('user', listener);\r\n Hub.listen('user', listener);\r\n return () => {\r\n Hub.remove('user', listener);\r\n }\r\n // eslint-disable-next-line\r\n }, [state.user])\r\n\r\n console.log(state.user);\r\n\r\n return loadUser(),\r\n signOut: () => {\r\n return new Promise((resolve, reject) => {\r\n theme.setThemingEnabled(false);\r\n Auth.signOut()\r\n .then(() => {\r\n apolloClient.resetStore();\r\n message.success('You have been logged out');\r\n history.push('/login');\r\n resolve(null);\r\n })\r\n .catch(err => {\r\n theme.setThemingEnabled(true);\r\n message.error('Logout failed: ' + err.message);\r\n reject(err.message);\r\n })\r\n })\r\n }\r\n }}>\r\n {props.children}\r\n \r\n}","import gql from \"graphql-tag\";\r\n\r\nexport const LocationFragment = gql`\r\n fragment LocationFragment on Location {\r\n _id\r\n _rev\r\n name\r\n block\r\n field\r\n areaBlockName\r\n deletedTs\r\n type\r\n }\r\n`;\r\n\r\nexport const ResolveLocationIdsQuery = gql`\r\n query GetLocationsFromIds($ids: [ID!]!){\r\n resolve_entity_ids(\r\n ids: $ids,\r\n typename: \"Location\"\r\n ){\r\n ... on Location {\r\n ...LocationFragment\r\n }\r\n }\r\n }\r\n ${LocationFragment}\r\n`","import { Input, message, Select } from 'antd';\r\nimport { SelectProps } from 'antd/lib/select';\r\nimport gql from 'graphql-tag';\r\nimport React from 'react';\r\nimport { Query } from 'react-apollo';\r\n\r\nconst { Option } = Select;\r\n\r\nconst GET_TRANSPORTER = gql`\r\nquery {\r\n transporter @client {\r\n _id\r\n name\r\n }\r\n}\r\n`\r\n\r\nconst GET_PILOTS = gql`\r\nquery GetPilots($tpID: ID!){\r\n getPilots(tpID: $tpID) {\r\n _id\r\n name {\r\n lastName\r\n firstName\r\n }\r\n }\r\n}\r\n`\r\n\r\nconst PilotSelect = React.forwardRef((props: SelectProps, ref?: React.LegacyRef\r\n )\r\n }\r\n return (\r\n String(option.props.children).toLowerCase().indexOf(input.toLowerCase()) >= 0}\r\n value={(!loading && data && data.getPilots && data.getPilots.length && props.value) || ''}>\r\n \r\n {!loading && data && data.getPilots && data.getPilots.map(pilot => (\r\n pilot && \r\n ))}\r\n \r\n )\r\n }\r\n }\r\n \r\n )\r\n return (\r\n message.error(\"Error: Failed to get current transportation provider\")}>\r\n {\r\n ({ data, error }: any) => {\r\n if (data && !error){\r\n return renderSelect(data.transporter._id)\r\n }\r\n return null\r\n }\r\n }\r\n \r\n )\r\n})\r\n\r\nPilotSelect.displayName = 'PilotSelect'\r\n\r\nexport default PilotSelect","import { Button, Icon, Tooltip, Typography } from \"antd\";\r\nimport React, { PropsWithChildren } from \"react\";\r\nimport './editable-cell.less';\r\n\r\nconst BASE_CLS = 'mc-editable-cell';\r\n\r\nexport interface EditableCellProps {\r\n children?: React.ReactNode,\r\n initValue?: any,\r\n changedValue?: any,\r\n onReset?: () => void,\r\n maxTextWidth?: number,\r\n showChanges?: boolean\r\n}\r\n\r\nconst EditableCell: React.FC> = (props) => {\r\n\r\n let initValue = props.initValue || null;\r\n\r\n let typogStyle: React.CSSProperties = {\r\n maxWidth: props.maxTextWidth,\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n display: 'inline-block',\r\n position: 'relative',\r\n top: 4\r\n }\r\n let text = {initValue}\r\n\r\n if (props.changedValue && initValue && props.changedValue !== initValue && props.showChanges){\r\n text = \r\n \r\n \r\n {props.initValue}\r\n \r\n \r\n {props.changedValue}\r\n \r\n \r\n \r\n {props.onReset ? (\r\n \r\n props.onReset()}\r\n style={{ marginLeft: '6px', height: '20px' }}\r\n />\r\n \r\n ) : null}\r\n \r\n }\r\n else if (props.changedValue && !initValue && props.showChanges){\r\n text = \r\n \r\n \r\n \r\n {props.changedValue} (new)\r\n \r\n \r\n {props.onReset ? (\r\n \r\n props.onReset?.()}\r\n style={{ marginLeft: '6px', height: '20px' }}\r\n />\r\n \r\n ) : null}\r\n \r\n }\r\n\r\n return
    \r\n {React.Children.count(props.children) === 0 || (\r\n (props.changedValue && initValue && props.changedValue !== initValue) || \r\n (props.changedValue && !initValue)\r\n ) ? (\r\n
    \r\n {text}\r\n
    \r\n ) : null}\r\n {props.children}\r\n
    \r\n}\r\n\r\nEditableCell.defaultProps = {\r\n maxTextWidth: 70,\r\n showChanges: true\r\n}\r\n\r\nexport default EditableCell","import EditableCell from './editable-cell';\r\nexport default EditableCell;","import React from 'react';\r\nimport gql from 'graphql-tag';\r\nimport { Query } from 'react-apollo';\r\nimport { Select, message, Input } from 'antd';\r\nimport { SelectProps } from 'antd/lib/select';\r\n\r\nconst { Option } = Select;\r\n\r\nconst GET_TRANSPORTER = gql`\r\nquery {\r\n transporter @client {\r\n _id\r\n name\r\n }\r\n}\r\n`\r\n\r\nconst GET_AIRCRAFTS = gql`\r\nquery GetPilots($tpID: ID!){\r\n getAircrafts(tpID: $tpID) {\r\n _id\r\n tailNum\r\n }\r\n}\r\n`\r\n\r\nconst AircraftSelect = React.forwardRef((props: SelectProps, ref?: React.LegacyRef\r\n )\r\n }\r\n return (\r\n \r\n )\r\n }\r\n }\r\n \r\n )\r\n return (\r\n message.error(\"Error: Failed to get current transportation provider\")}>\r\n {\r\n ({ data, error }: any) => {\r\n if (data && !error){\r\n return renderSelect(data.transporter._id)\r\n }\r\n return null\r\n }\r\n }\r\n \r\n )\r\n})\r\n\r\nexport default AircraftSelect","import React from 'react';\r\nimport gql from 'graphql-tag';\r\nimport { Query } from 'react-apollo';\r\n\r\nconst query = gql`\r\n{\r\n cognitoUser @client\r\n}\r\n`\r\n\r\nexport interface WithCognitoUserProps {\r\n cognitoUser?: any\r\n}\r\n\r\nconst withCognitoUser =

    (Component: React.ComponentType

    ) => {\r\n return (props: P & WithCognitoUserProps) => (\r\n \r\n {\r\n ({ data, loading }) => {\r\n if (!loading && data.cognitoUser){\r\n const user = JSON.parse(data.cognitoUser)\r\n return \r\n }\r\n return null\r\n }\r\n }\r\n \r\n )\r\n}\r\n\r\nexport default withCognitoUser","import gql from \"graphql-tag\";\r\nimport {LocationFragment} from \"../../../../Queries/Location\";\r\n\r\nexport default gql`\r\nquery LocationQuery(\r\n $filter: LocationsFilterInput\r\n $limit: Int = 15\r\n){\r\n locations(\r\n filter: $filter\r\n limit: $limit\r\n ){\r\n docs {\r\n ...LocationFragment\r\n }\r\n }\r\n}\r\n${LocationFragment}\r\n`","import { Alert, Input, Select, Tooltip } from 'antd';\r\nimport { SelectProps } from 'antd/lib/select';\r\nimport React, { LegacyRef, useState } from 'react';\r\nimport { SearchSelectWithData } from '../SearchSelect';\r\nimport LocationQuery from './LocationQuery';\r\n\r\nconst { Option } = Select;\r\n\r\ninterface LocationSelect2Props extends SelectProps {\r\n onChange?: (value: any) => void,\r\n limit?: number,\r\n deleted?: boolean,\r\n type?: 'ONSHORE' | 'OFFSHORE',\r\n includeOneOff?: boolean,\r\n\r\n /** Filter locations that have DataFlyt hardware installed.\r\n * If true, it will only include locations that have hardware.\r\n * If false, it will not show locations with hardware.\r\n * If left null/undefined, the filter will not apply.*/\r\n hasDataflytHardware?: boolean\r\n}\r\n\r\nconst LocationSelect2: React.FC = React.forwardRef((props, ref: LegacyRef) => {\r\n const [ state, _setState ] = useState({\r\n value: undefined,\r\n searchValue: null\r\n })\r\n\r\n function setState(newState) { _setState({ ...state, ...newState }) }\r\n\r\n function getValue(){\r\n if (props.value){\r\n if (state.value !== props.value){\r\n setState({ value: props.value });\r\n }\r\n return props.value\r\n }\r\n return undefined\r\n }\r\n\r\n function handleChange(value){\r\n setState({ value });\r\n props?.onChange(value)\r\n }\r\n\r\n function getLocName(loc: any){\r\n return loc.deletedTs ? \"*\" + loc.name + (loc.field && loc.block ? \" (\" + loc.block + \"-\" + loc.field + \")\" : \"\"): loc.name + (loc.field && loc.block ? \" (\" + loc.block + \"-\" + loc.field + \")\" : \"\") ;\r\n }\r\n\r\n let searchFields = {}\r\n\r\n if (String(state.searchValue).includes(':')){\r\n // Area/block mode\r\n let areablock = String(state.searchValue).split(':')\r\n searchFields = {\r\n area: areablock[0],\r\n block: areablock[1]\r\n }\r\n }\r\n else\r\n {\r\n // Name mode\r\n searchFields = {\r\n name: state.searchValue\r\n }\r\n }\r\n\r\n const variables = {\r\n limit: props.limit,\r\n filter: {\r\n type: props.type,\r\n deleted: props.deleted,\r\n includeOneOff: props.includeOneOff,\r\n hasDataflytHardware: props.hasDataflytHardware,\r\n ...searchFields\r\n }\r\n }\r\n var placeholderMsg = props.placeholder;\r\n if (!props.placeholder){\r\n switch (props.type) {\r\n case 'ONSHORE':\r\n placeholderMsg = 'Search for an onshore location.';\r\n break;\r\n case 'OFFSHORE':\r\n placeholderMsg = 'Search for an offshore location.';\r\n break;\r\n default:\r\n placeholderMsg = 'Search for a location.';\r\n break;\r\n }\r\n }\r\n return (\r\n \r\n data && data.locations && data.locations.docs}\r\n onDataItem={item => }\r\n onChange={handleChange}\r\n onSearch={(searchValue) => setState({ searchValue })}\r\n placeholder={placeholderMsg}\r\n showAction={[\"focus\", \"click\"]}\r\n dropdownMatchSelectWidth={false}\r\n dropdownStyle={{ width: '15rem' }}\r\n dropdownRender={(menu) => {\r\n return

    \r\n \r\n {menu}\r\n
    \r\n }}\r\n />\r\n \r\n );\r\n});\r\n\r\nLocationSelect2.defaultProps = {\r\n limit: 100,\r\n includeOneOff: false\r\n}\r\n \r\nexport default LocationSelect2;","import gql from \"graphql-tag\";\r\n\r\nexport const OrganizationFragment = gql`\r\nfragment OrganizationFragment on OrganizationInterface {\r\n _id\r\n name\r\n type\r\n classType\r\n requireOverrideFields1\r\n useV1Scheduler\r\n}\r\n`","import React, { createContext, PropsWithChildren, useContext, useEffect, useState } from 'react';\r\nimport packageJson from '../../package.json';\r\n\r\nconst LOCALSTORAGE_KEY = \"manifestcentral-persistence\";\r\n\r\nexport interface PersistentData { [key: string]: any }\r\n\r\nfunction getLocalStorage(json?: string){\r\n let unparsed;\r\n if (json){\r\n unparsed = json;\r\n }\r\n else\r\n {\r\n unparsed = localStorage.getItem(LOCALSTORAGE_KEY)\r\n }\r\n let parsed = {};\r\n try {\r\n parsed = JSON.parse(unparsed);\r\n }\r\n catch(e){\r\n console.error('Failed to parse ' + LOCALSTORAGE_KEY + ' local storage. Defaulting to {}');\r\n }\r\n return parsed;\r\n}\r\n\r\nconst PersistenceContext = createContext({ lastUpdate: new Date().toISOString(), storage: undefined, update: undefined })\r\n\r\nexport const PersistenceProvider: React.FC> = ({ children }) => {\r\n const [ lastUpdate, setLastUpdate ] = useState(new Date().toISOString());\r\n const [ storage, setStorage ] = useState(getLocalStorage());\r\n\r\n useEffect(() => {\r\n setStorage(getLocalStorage());\r\n // eslint-disable-next-line\r\n }, [ lastUpdate ])\r\n\r\n return setLastUpdate(new Date().toISOString()) }}>\r\n {children}\r\n \r\n}\r\n\r\nclass PersistentGroup {\r\n updateTs: string // Will be used to determine if this entry was written to\r\n rev: number = 0; // Number of times this group has been changed\r\n data: T;\r\n appVersion: string\r\n\r\n constructor(data?: any, updateTs?: any, rev?: number, appVersion?: string){\r\n if (rev){\r\n this.rev = rev;\r\n }\r\n if (appVersion){\r\n this.appVersion = appVersion;\r\n }\r\n else\r\n {\r\n this.appVersion = packageJson.version;\r\n }\r\n if (!updateTs){\r\n this.updateUpdateTs();\r\n }\r\n else\r\n {\r\n this.updateTs = updateTs;\r\n }\r\n if (typeof data === 'object'){\r\n this.data = data;\r\n }\r\n else if (typeof data === 'string'){\r\n this.data = JSON.parse(data);\r\n }\r\n }\r\n\r\n updateUpdateTs(){\r\n this.updateTs = new Date().toISOString();\r\n this.rev++;\r\n }\r\n\r\n getValue(key: string){\r\n return this.data[key];\r\n }\r\n\r\n setValue(key: string, value: any){\r\n const newData = { ...this.data, [key]: value };\r\n this.data = newData;\r\n this.updateUpdateTs();\r\n }\r\n\r\n // Merges data in dataToMerge argument with existing data\r\n updateData(dataToMerge: T){\r\n this.data = {\r\n ...this.data,\r\n ...dataToMerge\r\n }\r\n this.updateUpdateTs();\r\n }\r\n\r\n // Replaces existing data with new data\r\n setData(newData: T){\r\n this.data = {\r\n ...newData\r\n }\r\n this.updateUpdateTs();\r\n }\r\n\r\n static fromObject(obj: any){\r\n let updateTs = obj?.updateTs;\r\n let rev = obj?.rev;\r\n let appVersion = obj?.appVersion;\r\n let data = obj?.data;\r\n let entry = new PersistentGroup(data, updateTs, rev, appVersion);\r\n return entry\r\n }\r\n\r\n static fromJson(json: string){\r\n let parsed = JSON.parse(json);\r\n return this.fromObject(parsed);\r\n }\r\n}\r\n\r\nfunction usePersistence(groupid: string, defaultValues: PersistentData={}){\r\n\r\n\r\n const { lastUpdate, update, storage } = useContext(PersistenceContext);\r\n const [ initialized, setInitialized ] = useState(false);\r\n\r\n // Inits persistence object in local storage if none exists\r\n function initLocalStorage(){\r\n let data = localStorage.getItem(LOCALSTORAGE_KEY);\r\n if (!data){\r\n localStorage.setItem(LOCALSTORAGE_KEY, JSON.stringify({}))\r\n update();\r\n }\r\n }\r\n\r\n function setLocalStorage(storage: any){\r\n localStorage.setItem(LOCALSTORAGE_KEY, JSON.stringify(storage));\r\n update();\r\n }\r\n\r\n function getLocalStorage(){\r\n let json = localStorage.getItem(LOCALSTORAGE_KEY);\r\n try {\r\n return JSON.parse(json);\r\n }\r\n catch(e){\r\n console.error('Failed to parse localStorage value: ' + e);\r\n return {}\r\n }\r\n }\r\n\r\n function initPersistentGroup(){\r\n setPersistentGroup(new PersistentGroup(defaultValues))\r\n update();\r\n }\r\n\r\n function isGroupOutdated(group: PersistentGroup){\r\n if (group.appVersion !== packageJson.version){\r\n return true;\r\n }\r\n return false\r\n }\r\n\r\n function getPersistentGroup(ls?: any): PersistentGroup {\r\n if (!ls){\r\n ls = storage;\r\n }\r\n if (ls && groupid in ls){\r\n let group = PersistentGroup.fromObject(ls[groupid]);\r\n if (isGroupOutdated(group)){\r\n initPersistentGroup();\r\n const newLs = getLocalStorage();\r\n return getPersistentGroup(newLs);\r\n }\r\n return group\r\n }\r\n else\r\n {\r\n initPersistentGroup()\r\n const newLs = getLocalStorage();\r\n return getPersistentGroup(newLs);\r\n }\r\n }\r\n\r\n function setPersistentGroup(group: PersistentGroup){\r\n let ls = storage;\r\n if (!ls){\r\n ls = {}\r\n }\r\n ls[groupid] = {\r\n updateTs: group.updateTs,\r\n data: group.data,\r\n rev: group.rev,\r\n appVersion: group.appVersion\r\n };\r\n setLocalStorage(ls);\r\n }\r\n\r\n function getPersistentGroupValue(key: string){\r\n let group = getPersistentGroup();\r\n return group.getValue(key);\r\n }\r\n\r\n function setPersistentGroupValue(key: string, value: any){\r\n let group = getPersistentGroup();\r\n group.setValue(key, value);\r\n setPersistentGroup(group);\r\n }\r\n\r\n // Merges values from values arg with existing values in PersistentGroup\r\n function updatePersistentGroupValues(values: T){\r\n let group = getPersistentGroup();\r\n group.updateData(values);\r\n setPersistentGroup(group);\r\n }\r\n\r\n // Replaces values of PersistentGroup with values from newValues arg\r\n function setPersistentGroupValues(newValues: T){\r\n let group = getPersistentGroup();\r\n group.setData(newValues);\r\n setPersistentGroup(group);\r\n }\r\n\r\n // Create entry in localstorage if none exists\r\n useEffect(() => {\r\n initLocalStorage();\r\n update();\r\n if (!initialized){\r\n setInitialized(true);\r\n }\r\n // eslint-disable-next-line\r\n }, [ groupid ])\r\n \r\n // Retrieves the local storage data before this hook's state is initialized.\r\n // That way the persistentData is not null the first time\r\n if (!initialized){\r\n initLocalStorage();\r\n }\r\n let persistentGroup = getPersistentGroup();\r\n\r\n return {\r\n lastUpdate,\r\n persistentData: persistentGroup?.data,\r\n updateTs: persistentGroup?.updateTs,\r\n getPersistentValue: getPersistentGroupValue,\r\n setPersistentValue: setPersistentGroupValue,\r\n setPersistentValues: setPersistentGroupValues,\r\n updatePersistentValues: updatePersistentGroupValues\r\n }\r\n}\r\n\r\nexport default usePersistence","import { OperationVariables, QueryResult } from '@apollo/react-common';\r\nimport { ApolloError, ApolloQueryResult, NetworkStatus } from \"apollo-boost\";\r\nimport { DocumentNode } from 'graphql';\r\nimport lodash from 'lodash';\r\nimport { useCallback, useEffect, useReducer, useRef } from \"react\";\r\nimport { QueryHookOptions, useQuery } from \"react-apollo\";\r\nimport { v4 as uuid4 } from 'uuid';\r\n\r\nexport type GetNextTokenFunction = (token: string) => Promise\r\nexport type GetTokenFromData = (data: any) => string\r\n\r\nexport interface PaginatedQueryResult extends QueryResult {\r\n paginating: boolean,\r\n pageCount: number,\r\n paginationError: any,\r\n startAutoPagination: (continuePagination?: boolean) => void,\r\n stopAutoPagination: () => void,\r\n wasStopped: boolean,\r\n initialPaginationRunning: boolean,\r\n refetchAndPaginate(): Promise>\r\n}\r\n\r\ninterface AutoPaginatorState {\r\n pageCount: number,\r\n retryCount: number,\r\n currToken: string,\r\n lastToken: string,\r\n paginating: boolean,\r\n error: any,\r\n wasStopped: boolean,\r\n uuid: string\r\n}\r\n\r\ninterface AutoPaginatorConstructorOptions {\r\n\r\n /** Used to update react component UI as data is rolling in */\r\n updateListener: PageUpdateListener,\r\n getNextToken: (token: string) => Promise,\r\n maxPages?: number,\r\n maxRetries?: number\r\n}\r\n\r\ntype PageUpdateListener = (state: AutoPaginatorState) => void\r\n\r\nconst DEFAULT_MAX_PAGES = 100;\r\nconst DEFAULT_MAX_RETRIES = 3;\r\n\r\nexport class AutoPaginator {\r\n public state: AutoPaginatorState = {\r\n pageCount: 0,\r\n retryCount: 0,\r\n currToken: null,\r\n lastToken: null,\r\n paginating: false,\r\n error: null,\r\n wasStopped: false,\r\n uuid: null\r\n }\r\n public getNextToken: (token: string) => Promise\r\n\r\n private maxPages: number = DEFAULT_MAX_PAGES;\r\n private maxRetries: number = DEFAULT_MAX_RETRIES;\r\n private updateListener: PageUpdateListener;\r\n private isStopped = false;\r\n\r\n constructor(options: AutoPaginatorConstructorOptions) {\r\n this.updateListener = options.updateListener;\r\n this.getNextToken = options.getNextToken;\r\n this.setMaxPages(options.maxPages);\r\n this.maxRetries = options.maxRetries === undefined ? DEFAULT_MAX_RETRIES : options.maxRetries;\r\n }\r\n\r\n onLastPage() {\r\n if (this.maxPages !== null && this.state.pageCount > this.maxPages) {\r\n return true;\r\n }\r\n let lastPage = AutoPaginator.isOnLastPage(this.state.currToken, this.state.lastToken);\r\n // if (lastPage){\r\n // console.log('Last page reached!');\r\n // }\r\n return lastPage;\r\n }\r\n\r\n public getMaxPages() {\r\n return this.maxPages;\r\n }\r\n\r\n public setMaxPages(value: number) {\r\n if (value === null) {\r\n this.maxPages = null;\r\n }\r\n else {\r\n this.maxPages = value === undefined ? DEFAULT_MAX_PAGES : value;\r\n }\r\n }\r\n\r\n static isOnLastPage(currToken: string, lastToken: string) {\r\n if (currToken === 'nil') {\r\n currToken = null;\r\n }\r\n if (lastToken === 'nil') {\r\n lastToken = null;\r\n }\r\n // console.log('Checking if on last page...', { currToken, lastToken });\r\n if (!currToken && !lastToken) {\r\n // Must be on a page that returned 0 results or something.\r\n return true;\r\n }\r\n if (!lastToken && !currToken) {\r\n return false;\r\n }\r\n if (lastToken === currToken) {\r\n return true\r\n }\r\n if (!currToken && lastToken) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n\r\n updateState(state: Partial) {\r\n this.state = {\r\n ...this.state,\r\n ...state\r\n }\r\n if (this.updateListener) {\r\n this.updateListener(this.state);\r\n }\r\n return this.state;\r\n }\r\n\r\n stopPaging() {\r\n this.isStopped = true;\r\n this.updateState({ paginating: false, wasStopped: true });\r\n // console.log('Auto-Pagination stopping...');\r\n }\r\n\r\n async startPaging(token: string, startingPageCount = 1): Promise {\r\n let uuid = uuid4();\r\n // console.log('Starting auto-pagination...');\r\n this.updateState({\r\n paginating: true,\r\n pageCount: startingPageCount,\r\n retryCount: 0,\r\n currToken: token,\r\n lastToken: null,\r\n error: null,\r\n wasStopped: false,\r\n uuid\r\n });\r\n let error: any;\r\n while (!this.onLastPage() && this.state.retryCount < this.maxRetries) {\r\n if (uuid !== this.state.uuid) {\r\n // Stop this while loop and exit the function when startPaging() is called again.\r\n // This one should exit before getNextToken is called\r\n return false;\r\n }\r\n if (this.isStopped) {\r\n break;\r\n }\r\n // console.log('Getting page ' + (this.state.pageCount + 1));\r\n let newToken: string;\r\n try {\r\n error = undefined;\r\n newToken = await this.getNextToken(this.state.currToken || token);\r\n }\r\n catch (err) {\r\n error = err;\r\n this.updateState({ retryCount: this.state.retryCount + 1 });\r\n console.error(`Failed to get next token. Retrying... (${this.state.retryCount}/${this.maxRetries})`);\r\n break;\r\n }\r\n if (uuid !== this.state.uuid) {\r\n // Stop this while loop and exit the function when startPaging() is called again.\r\n // This one should exit after getNextToken is called, ignoring the results from it.\r\n return false;\r\n }\r\n this.updateState({\r\n pageCount: this.state.pageCount + 1,\r\n currToken: newToken,\r\n lastToken: this.state.currToken\r\n });\r\n }\r\n if (this.isStopped) {\r\n this.isStopped = false;\r\n }\r\n if (error) {\r\n console.error(`Auto-pagination failed after ${this.state.retryCount}/${this.maxRetries} retries:`, error);\r\n this.updateState({ error: error, paginating: false });\r\n return false;\r\n }\r\n this.updateState({ paginating: false });\r\n return true;\r\n }\r\n\r\n}\r\n\r\ninterface AutoPaginatedQueryHookOptions extends QueryHookOptions {\r\n\r\n /** Given the current token, fetch the next page and return a new token. */\r\n getNextToken: GetNextTokenFunction,\r\n\r\n /** Get token from query result data. */\r\n getTokenFromData: GetTokenFromData,\r\n\r\n /** Start auto-pagination immediately after a successful query result. Defaults to true. */\r\n autoPaginate?: boolean,\r\n\r\n /** Max number of pages to fetch. (Default: 100) Use 'null' to allow an infinite number of pages (NOT RECOMMENDED). */\r\n maxPages?: number,\r\n\r\n /** Triggers when an error happens while fetching subsequent pages of data. */\r\n onPaginationError?: (error: any) => void,\r\n\r\n /** Keep the result data from changing while pagination is happening if a poll happened or if the query's variables changed. \r\n * Useful for preventing the UI from changing while data is rolling in during pagination.\r\n * Instructions:\r\n * - Set to an array of NetworkStatus numbers that the data should freeze on. e.g. [NetworkStatus.poll, NetworkStatus.setVariables] or [6, 2]\r\n * - Set to true to freeze the data while pagination is in effect for all NetworkStatuses.\r\n * - Set to false to disable all freezing of data.\r\n * Defaults to false.\r\n */\r\n // freezeDataOnNetworkStatus?: number[] | boolean\r\n\r\n /**\r\n * Supress result data from changing while data is being rolled in. Instead of result data being built as the data is coming in due to pagination,\r\n * the previous result data will persist until pagination is finished. This helps prevent the UI from changing too much as data is rolling in.\r\n */\r\n supressDataUpdates?: boolean\r\n}\r\n\r\n/**\r\n * \r\n * @param query Query document\r\n * @param options Query options\r\n */\r\nfunction useAutoPaginatedQuery(query: DocumentNode, options?: AutoPaginatedQueryHookOptions): PaginatedQueryResult {\r\n const [state, setState] = useReducer((state, newState) => ({ ...state, ...newState }), {\r\n paginating: false,\r\n pageCount: 1,\r\n paginationError: null,\r\n prevNetworkStatus: null,\r\n dataBeforePagination: null,\r\n initNetworkStatus: NetworkStatus.loading,\r\n data: false,\r\n wasStopped: false,\r\n initialPaginationCompleted: false,\r\n shouldStartPagination: false\r\n });\r\n\r\n\r\n // For use by useEffect hooks watching changes in query variables.\r\n // Should prevent useEffect from firing every re-render with queryVars as a dependency\r\n let queryVars = useRef(options.variables);\r\n if (!lodash.isEqual(queryVars.current, options.variables)) {\r\n queryVars.current = options.variables;\r\n }\r\n\r\n const autoPaginatorRef = useRef();\r\n if (!autoPaginatorRef.current) {\r\n // If AutoPaginator object isn't in current, create a new AutoPaginator object.\r\n // This AutoPaginator object must exist regardless of the component state.\r\n autoPaginatorRef.current = new AutoPaginator({\r\n updateListener: onAutoPaginatorUpdate,\r\n getNextToken: options.getNextToken,\r\n maxPages: options.maxPages\r\n });\r\n }\r\n\r\n useEffect(() => {\r\n if (autoPaginatorRef.current) {\r\n autoPaginatorRef.current.setMaxPages(options.maxPages);\r\n }\r\n }, [options.maxPages])\r\n\r\n function onAutoPaginatorUpdate(pState: AutoPaginatorState) {\r\n setState({\r\n paginating: pState.paginating,\r\n pageCount: pState.pageCount,\r\n paginationError: pState.error,\r\n wasStopped: pState.wasStopped\r\n })\r\n }\r\n\r\n const result = useQuery(query, options);\r\n\r\n useEffect(() => {\r\n if (!options.supressDataUpdates) {\r\n setState({ data: result.data });\r\n }\r\n // eslint-disable-next-line\r\n }, [result.networkStatus])\r\n\r\n function startPaging(continuePagination?: boolean) {\r\n autoPaginatorRef.current.startPaging(\r\n options.getTokenFromData(result.data),\r\n continuePagination ? autoPaginatorRef.current.state.pageCount : undefined\r\n )\r\n .then(() => {\r\n // Pagination finishes\r\n setState({ initialPaginationRunning: false, initialPaginationCompleted: true });\r\n });\r\n }\r\n\r\n function stopPaging() {\r\n autoPaginatorRef.current.stopPaging();\r\n }\r\n\r\n useEffect(() => {\r\n if (result.networkStatus === NetworkStatus.setVariables) {\r\n // Query reiteria changed. Remove all existing results since they are no longer valid\r\n setState({ data: [] });\r\n }\r\n if (!state.paginating && options.supressDataUpdates) {\r\n setState({ data: result.data });\r\n }\r\n // eslint-disable-next-line\r\n }, [\r\n state.paginating,\r\n // eslint-disable-next-line\r\n state.prevNetworkStatus === NetworkStatus.setVariables,\r\n // eslint-disable-next-line\r\n state.prevNetworkStatus === NetworkStatus.poll,\r\n // eslint-disable-next-line\r\n state.prevNetworkStatus === NetworkStatus.refetch,\r\n // eslint-disable-next-line\r\n state.prevNetworkStatus === NetworkStatus.loading\r\n ])\r\n\r\n let data = state.data;\r\n // if (\r\n // (freezeDataOnNetworkStatus.includes(state.initNetworkStatus) && state.useCachedData) ||\r\n // (freezeData && state.useCachedData)\r\n // ){\r\n // data = state.dataBeforePagination;\r\n // }\r\n\r\n useEffect(() => {\r\n if (state.paginationError && options.onPaginationError) {\r\n options.onPaginationError(state.paginationError);\r\n }\r\n // eslint-disable-next-line\r\n }, [state.paginationError])\r\n\r\n useEffect(() => {\r\n // if (freezeDataOnNetworkStatus.includes(state.initNetworkStatus) && !state.useCachedData){\r\n // setState({ useCachedData: true, dataBeforePagination: result.data });\r\n // }\r\n\r\n if (result.networkStatus === NetworkStatus.setVariables) {\r\n stopPaging();\r\n }\r\n\r\n if (\r\n result.networkStatus === NetworkStatus.ready &&\r\n state.prevNetworkStatus &&\r\n state.prevNetworkStatus !== NetworkStatus.ready &&\r\n state.prevNetworkStatus !== NetworkStatus.fetchMore &&\r\n ((options.autoPaginate !== undefined ? options.autoPaginate : true) || state.shouldStartPagination)\r\n ) {\r\n // console.log('Successful query result detected. Starting auto-pagination...');\r\n if (!state.initialPaginationRunning && !state.initialPaginationCompleted) {\r\n setState({ initialPaginationRunning: true });\r\n }\r\n // if (freezeData && !state.useCachedData){\r\n // setState({ useCachedData: true, dataBeforePagination: result.data });\r\n // }\r\n // setState({ initNetworkStatus: state.prevNetworkStatus });\r\n startPaging();\r\n setState({ shouldStartPagination: false });\r\n }\r\n setState({ prevNetworkStatus: result.networkStatus });\r\n // eslint-disable-next-line\r\n }, [result.networkStatus, options.autoPaginate])\r\n\r\n useEffect(() => {\r\n /* getNextToken function is most likely dependent on the current query variables, so when\r\n those query variables change, the getNextToken callback in the Autopaginator needs to be updated.\r\n */\r\n if (autoPaginatorRef.current) {\r\n autoPaginatorRef.current.getNextToken = options.getNextToken;\r\n }\r\n // eslint-disable-next-line\r\n }, [queryVars.current])\r\n\r\n let error = result.error;\r\n if (result.networkStatus === NetworkStatus.error) {\r\n error = new ApolloError({\r\n errorMessage: 'An error occurred while loading data. Try refreshing the page.'\r\n })\r\n }\r\n\r\n return {\r\n ...result,\r\n refetch: (...args) => {\r\n console.debug('Normal refetch');\r\n return result.refetch(...args);\r\n },\r\n refetchAndPaginate: () => {\r\n console.debug('Paginated refetch');\r\n const refetchPromise = result.refetch();\r\n return new Promise>((resolve, reject) => {\r\n refetchPromise\r\n .then((data) => {\r\n resolve(data);\r\n setState({ shouldStartPagination: true });\r\n })\r\n .catch(reject)\r\n })\r\n },\r\n data,\r\n error,\r\n paginating: state.paginating,\r\n pageCount: state.pageCount,\r\n paginationError: state.paginationError,\r\n startAutoPagination: startPaging,\r\n stopAutoPagination: stopPaging,\r\n wasStopped: state.wasStopped,\r\n initialPaginationRunning: state.initialPaginationRunning || result.networkStatus === NetworkStatus.loading\r\n }\r\n}\r\n\r\nexport default useAutoPaginatedQuery","import { getFormFieldValue } from \"common/form\";\r\nimport { dateMtimeMtoMoment, getDurationHoursMinutes, getMinuteDuration, momentOrNull } from \"common/util\";\r\nimport { DateTimePickerValue } from \"components/date-time-picker\";\r\nimport moment, { Moment } from \"moment\";\r\n\r\nexport function formatDateTime(dt: DateTimePickerValue){\r\n if (!dt) return ''\r\n let date = dt.date ? dt.date.format('MM/DD/YYYY') : ''\r\n let time = dt.time ? dt.time.format('HH:mm') : ''\r\n return date + ' ' + time\r\n}\r\n\r\nexport function dispatchFormDataToArray(formData: any): any[] {\r\n let rowIdToFormData = new Map();\r\n let data = []\r\n\r\n Object.entries(formData).forEach((entry) => {\r\n let k = entry[0];\r\n let v: any = entry[1];\r\n\r\n let splitK = k.split('::');\r\n let id = splitK[0]\r\n let fieldname = splitK[1]\r\n if (rowIdToFormData.has(id)){\r\n rowIdToFormData.get(id)[fieldname] = getFormFieldValue(v)\r\n }\r\n else\r\n {\r\n rowIdToFormData.set(id, { [fieldname]: getFormFieldValue(v) })\r\n }\r\n })\r\n\r\n // Filter out newRecords that are not added\r\n rowIdToFormData.forEach((values, k) => {\r\n\r\n // Remove missing record entries that are not added (checkbox not checked)\r\n if (k.startsWith('new') && !values.add) return;\r\n\r\n values._id = k;\r\n values.new = true;\r\n\r\n data.push(values)\r\n })\r\n return data\r\n}\r\n\r\ninterface DT {\r\n date: Moment,\r\n time: Moment\r\n}\r\n\r\nexport function getTotalDurationHoursMinutes(rows: Array<{ ato: DT, ata: DT }>, momentConverter: (t: any) => Moment=dateMtimeMtoMoment){\r\n let totalMinutes = 0;\r\n rows.forEach(row => {\r\n if (momentConverter instanceof dateMtimeMtoMoment){\r\n if (!row.ata || !row.ato || !row.ata.date || !row.ata.time || !row.ato.date || !row.ato.time){\r\n return;\r\n }\r\n }\r\n\r\n totalMinutes += getMinuteDuration(momentConverter(row.ato), momentConverter(row.ata));\r\n })\r\n return getDurationHoursMinutes(moment.duration(totalMinutes, 'minutes'))\r\n}","import { useState } from 'react';\r\nimport config from '../../../config';\r\nimport { compressSync, strToU8 } from \"fflate\";\r\nimport { bytesToBase64 } from \"byte-base64\";\r\n\r\nconst endpoint = config.manifestPrintoutEndpoint;\r\n\r\n// const useFetchState = (defaultState={ fetching: false, error: null }) => {\r\n// const [fetchState, setFetchState] = useState({ fetching: defaultState.fetching, error: defaultState.error })\r\n// return [\r\n// fetchState,\r\n// (isFetching) => setFetchState({ ...fetchState, fetching: isFetching }),\r\n// (err) => setFetchState({ ...fetchState, error: err })\r\n// ]\r\n// }\r\n\r\nfunction useManifestPrintout(type, layout){\r\n const url = `${endpoint}/${type}/${layout}`;\r\n\r\n // const [ { fetching, error }, setFetching, setError ] = useFetchState();\r\n const [ fetching, setFetching ] = useState(false);\r\n const [ error, setError ] = useState(null);\r\n\r\n const fetchPrintout = async function(body, autoDownload=false, fileName){\r\n setFetching(true);\r\n setError(null);\r\n var resp;\r\n\r\n // Compress the request body with gzip\r\n const buffer = strToU8(JSON.stringify(body));\r\n const compressed = compressSync(buffer);\r\n\r\n try{\r\n // Send request to printout microservice\r\n resp = await fetch(url, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Accept': 'application/octet-stream',\r\n 'X-Content-Encoding': 'gzip;base64'\r\n },\r\n body: bytesToBase64(compressed)\r\n })\r\n }\r\n catch(err){\r\n console.error(err);\r\n setFetching(false);\r\n setError(err);\r\n throw err\r\n }\r\n setFetching(false);\r\n if (resp.ok){\r\n const blob = await resp.blob();\r\n const objURL = URL.createObjectURL(blob);\r\n if (autoDownload){\r\n const link = document.createElement('a');\r\n link.href = objURL;\r\n link.setAttribute('download', fileName || 'download.txt');\r\n document.body.appendChild(link);\r\n link.click();\r\n link.parentNode.removeChild(link);\r\n }\r\n return objURL\r\n }\r\n else {\r\n var msg;\r\n try{\r\n const json = await resp.json();\r\n msg = json.Message;\r\n }\r\n catch(err){\r\n msg = err.message\r\n }\r\n await setError(new Error(msg))\r\n throw error\r\n }\r\n\r\n }\r\n\r\n function clearError(){\r\n setError(null);\r\n }\r\n\r\n return [ fetchPrintout, fetching, error, clearError ]\r\n}\r\n\r\nexport default useManifestPrintout","import React, { forwardRef } from 'react';\r\nimport { Checkbox } from 'antd';\r\n\r\nconst ColumnSelector = forwardRef(({ columns, onChange, style, disabled }, ref) => {\r\n const renderColumns = () => columns.map(({ label, key, checked }) => (\r\n
    \r\n {\r\n const newColumns = [...columns];\r\n var i;\r\n for (i = 0; i < newColumns.length; i++){\r\n const col = newColumns[i];\r\n if (col.key === key){\r\n newColumns[i].checked = e.target.checked;\r\n }\r\n }\r\n onChange(newColumns)\r\n }}\r\n /> {label}\r\n
    \r\n ))\r\n return (\r\n
    \r\n {renderColumns()}\r\n
    \r\n )\r\n})\r\n\r\nexport { ColumnSelector }","import { Alert, Button, Card, Col, Form, Input, message, Row, Select } from 'antd';\r\nimport gql from 'graphql-tag';\r\nimport PropTypes from 'prop-types';\r\nimport React, { useState } from 'react';\r\nimport { Mutation, Query } from \"react-apollo\";\r\nimport { safeGet } from '../../../common/util';\r\nimport { ColumnSelector } from '../../ColumnSelector';\r\nimport useManifestPrintout from '../../scheduling/Printout/useManifestPrintout';\r\nimport withCognitoUser from '../../WithCognitoUser';\r\nimport WithOrgData from '../../WithOrgData';\r\n\r\nconst getColumnSets = (report_type) => {\r\n const paxColumns = [\r\n {\r\n setName: 'Columns',\r\n key: 'columns',\r\n columns: [\r\n {\r\n label: 'First Name',\r\n key: 'firstName'\r\n },\r\n {\r\n label: 'Last Name',\r\n key: 'lastName'\r\n },\r\n {\r\n label: 'Flight',\r\n key: 'currentCarrier.desig'\r\n },\r\n {\r\n label: 'Departure',\r\n key: 'departure.name'\r\n },\r\n {\r\n label: 'Destination',\r\n key: 'destination.name'\r\n },\r\n {\r\n label: 'Pax Weight',\r\n key: 'paxWeight'\r\n },\r\n {\r\n label: 'Bag Weight',\r\n key: 'bagWeight'\r\n },\r\n {\r\n label: 'Bag Count',\r\n key: 'bagCount'\r\n },\r\n {\r\n label: 'Transporter',\r\n key: 'transporter.name'\r\n },\r\n {\r\n label: 'Customer',\r\n key: 'customer.name'\r\n },\r\n {\r\n label: 'Employer',\r\n key: 'employer.name'\r\n },\r\n {\r\n label: 'Checked-In-Time',\r\n key: 'checkedInTime'\r\n },\r\n {\r\n label: 'Finalization reason',\r\n key: 'finalizationReasonType'\r\n },\r\n {\r\n label: 'Charge Code',\r\n key: 'chargeCode'\r\n },\r\n {\r\n label: 'Tail Num',\r\n key: 'currentCarrier.aircraftDoc.tailNum'\r\n },\r\n {\r\n label: 'Aircraft Model',\r\n key: 'currentCarrier.aircraftDoc.model'\r\n }\r\n //{\r\n // label: 'State',\r\n // key: 'nodeState'\r\n //}\r\n ]\r\n }\r\n ]\r\n const paxCovidVaxColumns = [\r\n {\r\n setName: 'Columns',\r\n key: 'columns',\r\n columns: [\r\n {\r\n label: 'First Name',\r\n key: 'firstName'\r\n },\r\n {\r\n label: 'Last Name',\r\n key: 'lastName'\r\n },\r\n {\r\n label: 'Is Vaccinated',\r\n key: 'isVaccinated'\r\n },\r\n {\r\n label: 'Flight',\r\n key: 'currentCarrier.desig'\r\n },\r\n {\r\n label: 'Departure',\r\n key: 'departure.name'\r\n },\r\n {\r\n label: 'Destination',\r\n key: 'destination.name'\r\n },\r\n {\r\n label: 'Pax Weight',\r\n key: 'paxWeight'\r\n },\r\n {\r\n label: 'Bag Weight',\r\n key: 'bagWeight'\r\n },\r\n {\r\n label: 'Bag Count',\r\n key: 'bagCount'\r\n },\r\n {\r\n label: 'Transporter',\r\n key: 'transporter.name'\r\n },\r\n {\r\n label: 'Customer',\r\n key: 'customer.name'\r\n },\r\n {\r\n label: 'Employer',\r\n key: 'employer.name'\r\n },\r\n {\r\n label: 'Checked-In-Time',\r\n key: 'checkedInTime'\r\n },\r\n {\r\n label: 'Finalization reason',\r\n key: 'finalizationReasonType'\r\n },\r\n {\r\n label: 'Charge Code',\r\n key: 'chargeCode'\r\n },\r\n {\r\n label: 'Essential On',\r\n key: 'essentialOn'\r\n }\r\n //{\r\n // label: 'State',\r\n // key: 'nodeState'\r\n //}\r\n ]\r\n }\r\n ]\r\n const personCovidVaxDetails = [\r\n {\r\n setName: 'Columns',\r\n key: 'columns',\r\n columns: [\r\n {\r\n label: 'First Name',\r\n key: 'firstName'\r\n },\r\n {\r\n label: 'Last Name',\r\n key: 'lastName'\r\n },\r\n {\r\n label: 'DOB',\r\n key: 'dob'\r\n },\r\n {\r\n label: 'Employer',\r\n key: 'employerName'\r\n },\r\n {\r\n label: 'Shot Manufacturer',\r\n key: 'shotManufacturer'\r\n },\r\n {\r\n label: 'Shot 1',\r\n key: 'shot_1'\r\n },\r\n {\r\n label: 'Shot 2',\r\n key: 'shot_2'\r\n },\r\n {\r\n label: 'Vaccinated on',\r\n key: 'vaccinated_on'\r\n },\r\n {\r\n label: 'POS Test',\r\n key: 'pos_test'\r\n },\r\n {\r\n label: 'RTW',\r\n key: 'rtw'\r\n },\r\n {\r\n label: 'RTW 2',\r\n key: 'rtw_2'\r\n },\r\n {\r\n label: 'Essential On',\r\n key: 'essentialOn'\r\n }\r\n // {\r\n // label: 'Booster 1',\r\n // key: 'booster_1'\r\n // },\r\n // {\r\n // label: 'Booster 2',\r\n // key: 'booster_2'\r\n // }\r\n ]\r\n }\r\n ]\r\n const covidColumns = [\r\n {\r\n setName: 'Columns',\r\n key: 'columns',\r\n columns: [\r\n {\r\n label: 'Checked-In-Time',\r\n key: 'checkedInTime'\r\n },\r\n {\r\n label: 'Last Name',\r\n key: 'lastName'\r\n },\r\n {\r\n label: 'First Name',\r\n key: 'firstName'\r\n },\r\n {\r\n label: 'Customer',\r\n key: 'customer.name'\r\n },\r\n {\r\n label: 'Employer',\r\n key: 'employer.name'\r\n },\r\n {\r\n label: 'Departure',\r\n key: 'departure.name'\r\n },\r\n {\r\n label: 'Symptoms',\r\n key: 'covid_hasFluSymptoms'\r\n },\r\n {\r\n label: 'Has High Temp',\r\n key: 'covid_selfReportedHighBodyTemperature'\r\n },\r\n {\r\n label: 'Exposed to Covid',\r\n key: 'covid_ExposedToVirus'\r\n },\r\n {\r\n label: 'Vaccinated',\r\n key: 'covid_hasBeenVaccinated'\r\n }\r\n ]\r\n }\r\n ]\r\n const cgoColumns = [\r\n {\r\n setName: 'Columns',\r\n key: 'columns',\r\n columns: [\r\n {\r\n label: 'Name',\r\n key: 'name'\r\n },\r\n {\r\n label: 'Flight',\r\n key: 'currentCarrier.desig',\r\n },\r\n {\r\n label: 'Departure',\r\n key: 'departure.name'\r\n },\r\n {\r\n label: 'Destination',\r\n key: 'destination.name'\r\n },\r\n {\r\n label: 'Ground Pickup',\r\n key: 'groundPickup'\r\n },\r\n {\r\n label: 'Weight',\r\n key: 'weight'\r\n },\r\n {\r\n label: 'Transporter',\r\n key: 'transporter.name'\r\n },\r\n {\r\n label: 'Customer',\r\n key: 'customer.name'\r\n },\r\n {\r\n label: 'Check-In-Time',\r\n key: 'checkedInTime'\r\n },\r\n {\r\n label: 'Initials',\r\n key: 'initials'\r\n },\r\n {\r\n label: 'State',\r\n key: 'nodeState'\r\n },\r\n {\r\n label: 'Charge Code',\r\n key: 'chargeCode'\r\n },\r\n {\r\n label: 'Last Modified',\r\n key: 'modifiedTs'\r\n },\r\n {\r\n label: 'Delivered By',\r\n key: 'deliveredBy'\r\n }\r\n ]\r\n }\r\n ]\r\n const isnColumns = [\r\n {\r\n setName: 'Columns',\r\n key: 'columns',\r\n columns: [\r\n {\r\n label: 'Last Name',\r\n key: 'lastName'\r\n },\r\n {\r\n label: 'First Name',\r\n key: 'firstName'\r\n },\r\n {\r\n label: 'Checked-In-Time',\r\n key: 'checkedInTime'\r\n },\r\n {\r\n label: 'Departure',\r\n key: 'departure.name'\r\n },\r\n {\r\n label: 'Destination',\r\n key: 'destination.name'\r\n },\r\n {\r\n label: 'Transporter',\r\n key: 'transporter.name'\r\n },\r\n {\r\n label: 'Customer',\r\n key: 'customer.name'\r\n },\r\n {\r\n label: 'Employers',\r\n key: 'employer.name'\r\n },\r\n {\r\n label: 'ISN Status',\r\n key: 'isn_status',\r\n format: 'isn_status'\r\n },\r\n {\r\n label: 'ISN ID',\r\n key: 'lastIsnResultWithHeader.selectedResult.isnId'\r\n },\r\n {\r\n label: 'Training Deficiencies',\r\n key: 'trainingDeficiencies',\r\n format: 'get_selected_result'\r\n },\r\n {\r\n label: 'Reasons For Non Compliance',\r\n key: 'reasonsForNonCompliance',\r\n format: 'get_selected_result'\r\n },\r\n {\r\n label: 'Overridden By',\r\n key: 'overridden_by',\r\n format: 'overridden_by'\r\n },\r\n {\r\n label: 'Override Notes',\r\n key: 'authorization.brdRestriction_Isn.notes'\r\n },\r\n {\r\n label: 'Overrider Reason',\r\n key: 'authorization.brdRestriction_Isn.overriderReason'\r\n },\r\n {\r\n label: 'Assigned Activities',\r\n key: 'assignedActivities',\r\n format: 'get_selected_result'\r\n }\r\n ]\r\n }\r\n ]\r\n\r\n const personHotfuel = [\r\n {\r\n setName: 'Columns',\r\n key: 'columns',\r\n columns: [\r\n {\r\n label: 'Last Name',\r\n key: 'lastName'\r\n },\r\n {\r\n label: 'First Name',\r\n key: 'firstName'\r\n },\r\n {\r\n label: 'Customer',\r\n key: 'customerName'\r\n },\r\n {\r\n label: 'Employer',\r\n key: 'employerName'\r\n },\r\n {\r\n label: 'HotFuel Expiration Date',\r\n key: 'hotfuelExpirationDate'\r\n }\r\n ]\r\n }\r\n ]\r\n\r\n const paxIsnEventsColumns = [\r\n {\r\n setName: 'Columns',\r\n key: 'columns',\r\n columns: [\r\n \"Event Timestamp\",\r\n \"Event Type\",\r\n \"Pax Name\",\r\n \"Pax ID\",\r\n \"Destination\",\r\n \"Customer\",\r\n \"Employer\",\r\n \"Scheduled Flight Date\",\r\n \"ISN Status\",\r\n \"ISN Reason\",\r\n \"ISN Company\",\r\n \"ISN ID\",\r\n \"Override Type\",\r\n \"Override Time\",\r\n \"Override Title\",\r\n \"Override Reason\",\r\n \"Training or Whitelist\",\r\n \"Overrider Name\",\r\n \"Approver Name\",\r\n \"Override Notes\",\r\n \"Deleted Ts\",\r\n \"Created Ts\",\r\n \"Created By\",\r\n \"Modified Ts\",\r\n \"Modified By\",\r\n\r\n ]\r\n .map(col => ({ label: col, key: col }))\r\n }\r\n ]\r\n\r\n const noColumns = []\r\n\r\n switch (report_type) {\r\n case 'PAX':\r\n return paxColumns\r\n case 'CGO':\r\n return cgoColumns\r\n case 'MANIFEST':\r\n return noColumns\r\n case 'ISN':\r\n return isnColumns\r\n case 'COVID':\r\n return covidColumns\r\n case 'PAX_COVID19_VAX':\r\n return paxCovidVaxColumns\r\n case 'PERSON_COVID19_VAX_DETAILS':\r\n return personCovidVaxDetails\r\n case 'PERSON_HOTFUEL':\r\n return personHotfuel\r\n case 'PAX_ISN_EVENTS':\r\n return paxIsnEventsColumns\r\n default:\r\n return null\r\n }\r\n}\r\n\r\nexport const renderExport = (report_type, report_id, flightID) => {\r\n const column_sets = getColumnSets(report_type);\r\n if (!column_sets){\r\n return
    Unknown report type
    \r\n }\r\n return \r\n}\r\n\r\nconst file_types = [\r\n {\r\n key: 'csv',\r\n label: 'CSV',\r\n content_type: 'text/csv'\r\n },\r\n {\r\n key: 'json',\r\n label: 'JSON',\r\n content_type: 'application/json'\r\n }\r\n]\r\n\r\nvar ReportExporter = ({ flightID, report_type, report_id, data, export_name, column_sets, titleRowText, criteria, default_file_type=\"csv\", export_as_zip=false, form: { getFieldDecorator, validateFieldsAndScroll, getFieldValue } }) => {\r\n const [ downloadUrl, setDownloadUrl ] = useState(null);\r\n const [ desig, setDesig] = useState(null)\r\n const exportedFileType = downloadUrl && downloadUrl.split('.').slice(-1)[0];\r\n const single_column_set = column_sets.length === 1;\r\n const FLIGHT = gql`\r\n query Flight($_id: ID!){\r\n getFlightHistory(_id: $_id){\r\n _id\r\n desig\r\n scheduledFlightDate\r\n callSign\r\n customerID {\r\n _id\r\n name\r\n }\r\n paxIDList {\r\n _id\r\n lastName\r\n firstName\r\n scheduledOrder\r\n scheduledGroup\r\n employerID \r\n employerDoc {\r\n _id\r\n name\r\n }\r\n transitType\r\n departureID\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationID\r\n destinationDoc{\r\n _id\r\n name\r\n }\r\n paxWeight\r\n bagWeight\r\n bagCount\r\n }\r\n legs\r\n legsArray {\r\n departure\r\n destination\r\n departureID\r\n destinationID\r\n flightTime\r\n paxIDs {\r\n _id\r\n lastName\r\n firstName\r\n employerID\r\n employerDoc {\r\n _id\r\n name\r\n }\r\n chargeCode\r\n paxWeight\r\n bagWeight\r\n departureID\r\n departureDoc {\r\n _id\r\n name\r\n }\r\n destinationID\r\n destinationDoc{\r\n _id\r\n name\r\n }\r\n personID\r\n personDoc {\r\n _id\r\n dob\r\n nation\r\n }\r\n }\r\n cgoIDs{\r\n _id\r\n name\r\n approvedBy\r\n weight\r\n assigned\r\n checkInType\r\n nodeState\r\n hazmat\r\n transitType\r\n attentionTo\r\n deliveredBy\r\n notes\r\n chargeCode\r\n departureID\r\n departureDoc{\r\n _id\r\n name\r\n }\r\n destinationID\r\n destinationDoc{\r\n _id\r\n name\r\n }\r\n }\r\n }\r\n tpID {\r\n _id\r\n }\r\n pilot {\r\n _id\r\n name {\r\n lastName\r\n firstName\r\n }\r\n }\r\n copilot {\r\n _id\r\n name {\r\n lastName\r\n firstName\r\n }\r\n }\r\n contract {\r\n _id\r\n name\r\n }\r\n aircraftID {\r\n _id\r\n tailNum\r\n }\r\n departureID {\r\n _id\r\n name\r\n }\r\n }\r\n }\r\n `\r\n\r\n let mutation_name = report_id ? 'export_report' : 'export_data';\r\n\r\n let mut = `\r\n mutation ExportReport(\r\n ${report_id ? \"$report_id: ID!,\" : \"$data: AWSJSON!,\"}\r\n ${!report_id ? \"$export_name: String!\" : \"\"}\r\n ${!report_id ? \"$report_type: String!\" : \"\"}\r\n ${!report_id ? \"$criteria: [ReportCriteriaInput]!\" : \"\"}\r\n $file_type: String!,\r\n $content_type: String!,\r\n $column_sets: [ExportReportColumnSetInput!]!\r\n $export_as_zip: Boolean\r\n $titleRowText: String\r\n ) {\r\n ${report_id ? \"export_report\" : \"export_data\"}(\r\n ${report_id ? \"report_id: $report_id,\" : \"data: $data,\"}\r\n ${!report_id ? \"export_name: $export_name\" : \"\"}\r\n ${!report_id ? \"report_type: $report_type\" : \"\"}\r\n ${!report_id ? \"criteria: $criteria\" : \"\"}\r\n file_type: $file_type,\r\n content_type: $content_type,\r\n column_sets: $column_sets\r\n export_as_zip: $export_as_zip\r\n titleRowText: $titleRowText\r\n )\r\n }\r\n `\r\n\r\n return (\r\n setDownloadUrl(data[mutation_name])}\r\n >\r\n {(export_report, { loading, error }) => {\r\n const submit = () => {\r\n validateFieldsAndScroll((err, values) => {\r\n if (!err){\r\n const selectedFileType = file_types.find(({ key }) => key === values.file_type);\r\n let _criteria;\r\n if (Array.isArray(criteria)){\r\n _criteria = [ ...criteria ];\r\n _criteria.forEach((c) => {\r\n if ('__typename' in c){\r\n delete c.__typename;\r\n }\r\n })\r\n\r\n }\r\n\r\n export_report({\r\n variables: {\r\n export_as_zip: export_as_zip,\r\n report_id: report_id,\r\n criteria: _criteria,\r\n data: typeof data === 'string' ? data : JSON.stringify(data),\r\n report_type: report_type,\r\n export_name: export_name,\r\n file_type: values.file_type,\r\n content_type: selectedFileType && selectedFileType.content_type,\r\n titleRowText: values.titleRowText ? values.titleRowText.replace(',', '') : undefined,\r\n column_sets: column_sets.map(colSet => {\r\n const newColumns = values[colSet.key] && values[colSet.key]\r\n .filter(col => col.checked)\r\n .map(({ label, key, dataIndex, format }) => ({ label, key: dataIndex ? dataIndex : key, format }));\r\n const newColSet = {\r\n ...colSet,\r\n columns: newColumns\r\n }\r\n return newColSet\r\n })\r\n }\r\n })\r\n }\r\n })\r\n }\r\n const renderColumnSelector = (colSet, formItemProps={}) => {\r\n if (!colSet){\r\n return null\r\n }\r\n return \r\n {getFieldDecorator(colSet.key, {\r\n initialValue: colSet.columns.map(col => ({\r\n ...col,\r\n checked: typeof col.checkedByDefault === 'boolean' ? col.checkedByDefault : true\r\n })),\r\n valuePropName: 'columns'\r\n })()}\r\n \r\n }\r\n return (\r\n
    \r\n {error ? (\r\n \r\n ) : null}\r\n {report_type === 'MANIFEST' ?\r\n \r\n \r\n : null }\r\n \r\n {getFieldDecorator('file_type', {\r\n initialValue: default_file_type,\r\n rules: [\r\n {required: true, message: 'You must choose a file type'}\r\n ]\r\n })(\r\n \r\n )}\r\n \r\n \r\n {getFieldDecorator('titleRowText', {\r\n initialValue: titleRowText\r\n })(\r\n \r\n )}\r\n \r\n \r\n {column_sets.map((colSet, i) => (\r\n
    \r\n {single_column_set ? renderColumnSelector(colSet, { label: 'Columns' }) : (\r\n \r\n {renderColumnSelector(colSet)}\r\n \r\n )}\r\n \r\n ))}\r\n \r\n \r\n {report_type === \"MANIFEST\" ?\r\n \r\n {(flight) => {\r\n var flightData = {};\r\n if (flight && flight.data && flight.data.getFlightHistory){\r\n setDesig(flight.data.getFlightHistory.desig)\r\n flightData = flight.data.getFlightHistory || {};\r\n flightData.departureDoc = {};\r\n flightData.departureDoc[\"_id\"] = flightData.legsArray[0].departureID;\r\n flightData.departureDoc[\"name\"] = flightData.legsArray[0].departure;\r\n }\r\n //console.log(column_sets[0].columns);\r\n return \r\n }\r\n }\r\n :\r\n Export Report\r\n }\r\n {downloadUrl && !loading && !error ? (\r\n \r\n

    Export finished! Click the button below to download your report.

    \r\n {exportedFileType === 'json' ? (\r\n \r\n ) : null}\r\n \r\n \r\n Download Report\r\n \r\n \r\n
    \r\n ) : null}\r\n
    \r\n \r\n )\r\n }}\r\n \r\n )\r\n}\r\nvar PrintoutButton = ({flight, flightDesigText, orgData, cognitoUser, ...restProps}) => {\r\n const [ fetchPrintout, fetching ] = useManifestPrintout('FlightWithLegs', 'Manifest');\r\n const userAttr = cognitoUser.attributes;\r\n return (\r\n \r\n {({ data }) => {\r\n const manifestPrintouts = safeGet(['getCustomer', 'manifestPrintout'], data) || [];\r\n const flightManifest = manifestPrintouts.find((m) => m.type === 'Flight');\r\n const hessLayout = flightManifest && flightManifest.layouts.find((l) => l.name === 'Hess');\r\n const logoURL = hessLayout && hessLayout.logo;\r\n const handleClick = () => {\r\n if (!flight || !flightDesigText){\r\n message.error('No flight was selected for exporting');\r\n return;\r\n }\r\n const legs = flight.legsArray || [];\r\n const body = {\r\n issuedBy: `${userAttr.given_name} ${userAttr.family_name}`,\r\n orgName: flight.customerDoc?.name,\r\n logoURL: logoURL,\r\n desig: flight.desig,\r\n departure: flight.departureDoc?.name,\r\n aircraftNo: flight.aircraftID && flight.aircraftID.tailNum,\r\n scheduledFlightDate: flight.scheduledFlightDate,\r\n legs: legs.map((leg) => {\r\n return {\r\n departure: leg.departure,\r\n destination: leg.destination,\r\n flightTime: leg.flightTime || 0,\r\n cargo: leg.cgoIDs.map((cgo)=>{\r\n return{\r\n _id: cgo._id,\r\n name: cgo.name,\r\n attentionTo: cgo.attentionTo,\r\n deliveredBy: cgo.deliveredBy,\r\n weight: cgo.weight,\r\n departure: cgo.departureDoc?.name,\r\n destination: cgo.destinationDoc?.name,\r\n chargeCode: cgo.chargeCode && cgo.chargeCode.toUpperCase(),\r\n }\r\n }),\r\n passengers: leg.paxIDs.map((pax) => {\r\n return {\r\n _id: pax._id,\r\n lastName: pax.lastName,\r\n firstName: pax.firstName,\r\n employer: pax.employerDoc?.name,\r\n chargeCode: pax.chargeCode && pax.chargeCode.toUpperCase(),\r\n paxWeight: pax.paxWeight,\r\n bagWeight: pax.bagWeight,\r\n departure: pax.departureDoc?.name,\r\n destination: pax.destinationDoc?.name,\r\n dob: pax.personDoc?.dob\r\n }\r\n })\r\n }\r\n })\r\n }\r\n fetchPrintout(body, true, `${flight.scheduledFlightDate} ${flight.desig} Flight Manifest.xlsx`)\r\n .catch((err) => {\r\n message.error('Failed to download printout', 3)\r\n .then(() => message.error(err.message))\r\n })\r\n }\r\n return (\r\n \r\n )\r\n }}\r\n \r\n )\r\n}\r\n\r\nPrintoutButton = WithOrgData( withCognitoUser( PrintoutButton ) )\r\n\r\nReportExporter.propTypes = {\r\n report_id: PropTypes.string.isRequired,\r\n column_sets: PropTypes.arrayOf(\r\n PropTypes.shape({\r\n setName: PropTypes.string.isRequired,\r\n key: PropTypes.string.isRequired,\r\n columns: PropTypes.arrayOf(\r\n PropTypes.shape({\r\n label: PropTypes.string.isRequired,\r\n key: PropTypes.string.isRequired\r\n })\r\n ).isRequired,\r\n dataSource: PropTypes.shape({\r\n set: PropTypes.string.isRequired,\r\n key: PropTypes.string.isRequired\r\n }),\r\n })\r\n )\r\n}\r\n\r\nReportExporter = Form.create()(ReportExporter)\r\n\r\nReportExporter.displayName = 'Form(ReportExporter)'\r\n\r\nconst DataExporter = ({ ...props }) => \r\n\r\nexport { ReportExporter, DataExporter };\r\n","\r\nfunction getGenericStateReducer(extendTypeHandling?: (state: State, type: string, payload: Payload) => State){\r\n function reducer(\r\n state: State,\r\n action: { type?: string, payload?: Payload, newState?: Partial }\r\n ): State {\r\n switch (action.type) {\r\n default:\r\n let newState = state;\r\n if (action.newState){\r\n newState = { ...state, ...action.newState }\r\n }\r\n if (extendTypeHandling){\r\n newState = extendTypeHandling(newState, action.type, action.payload);\r\n }\r\n return newState;\r\n }\r\n }\r\n return reducer\r\n}\r\n\r\nexport default getGenericStateReducer","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Select, Spin, Alert } from 'antd';\r\nimport debounce from 'lodash/debounce';\r\n\r\nconst { Option } = Select;\r\n\r\nclass SearchSelect extends Component {\r\n constructor(props){\r\n super(props);\r\n this.handleSearch = debounce(this.handleSearch, props.searchDebounceTime || 500)\r\n }\r\n state = {\r\n value: ''\r\n }\r\n getValue = () => {\r\n if (this.props.loading || this.props.error) return null\r\n if (this.props.value){\r\n if (this.state.value !== this.props.value){\r\n this.setState({ value: this.props.value });\r\n }\r\n }else if(this.props.defaultValue){\r\n if (this.state.value !== this.props.defaultValue){\r\n this.setState({ value: this.props.defaultValue });\r\n }\r\n }\r\n return this.state.value\r\n }\r\n handleSearch = (value) => {\r\n this.props.onSearch(value)\r\n }\r\n handleChange = (value) => {\r\n this.setState({ value: value })\r\n this.props.onChange && this.props.onChange(value)\r\n }\r\n render() {\r\n var {\r\n onDataItem,\r\n loading,\r\n error,\r\n errorMessage=\"Failed to load data\",\r\n ...restProps\r\n } = this.props;\r\n if (!onDataItem){\r\n onDataItem = (item) => \r\n }\r\n const options = this.props.data.map(onDataItem);\r\n var nfContent = null;\r\n if (!options.length){\r\n if (loading) nfContent = \r\n if (error) nfContent = \r\n }\r\n return (\r\n \r\n {options}\r\n \r\n );\r\n }\r\n}\r\n\r\nSearchSelect.propTypes = {\r\n data: PropTypes.arrayOf(PropTypes.object).isRequired,\r\n onSearch: PropTypes.func.isRequired,\r\n onChange: PropTypes.func,\r\n onDataItem: PropTypes.func,\r\n placeholder: PropTypes.string,\r\n value: PropTypes.any,\r\n loading: PropTypes.bool,\r\n error: PropTypes.object,\r\n errorMessage: PropTypes.string\r\n}\r\n \r\nexport default SearchSelect;","import React, { Component } from 'react';\r\nimport { Query } from 'react-apollo';\r\nimport PropTypes from 'prop-types';\r\nimport SearchSelect from './SearchSelect';\r\n\r\nclass SearchSelectWithData extends Component {\r\n render() { \r\n const { query, variables, fetchPolicy, ...restProps } = this.props;\r\n return (\r\n \r\n {({ data, loading, error }) => {\r\n return (\r\n \r\n )\r\n }}\r\n \r\n );\r\n }\r\n}\r\n\r\nSearchSelectWithData.propTypes = {\r\n query: PropTypes.object.isRequired,\r\n getData: PropTypes.func.isRequired,\r\n variables: PropTypes.object,\r\n fetchPolicy: PropTypes.string\r\n}\r\n\r\nexport default SearchSelectWithData;","import { useEffect, useState } from \"react\";\r\nimport { QueryResult, useQuery } from \"react-apollo\";\r\nimport ReportQuery, { S3ReportQuery } from \"../ReportDetails/ReportQuery\";\r\nimport moment from 'moment';\r\nimport { ApolloError } from \"apollo-client\";\r\n\r\nexport type ReportState = 'NOT_STARTED' | 'IN_PROGRESS' | 'QUERY_FAILED' | 'DOWNLOADING' | 'DOWNLOAD_FAILED' | 'COMPLETE';\r\n\r\nexport interface ReportDetailsResult {\r\n reportData: any,\r\n couchResult: QueryResult,\r\n s3Result: QueryResult,\r\n reportState: ReportState,\r\n error: ApolloError\r\n}\r\n\r\nfunction useReportDetails(reportId: string, overrideState?: ReportState): ReportDetailsResult{\r\n const [ reportState, setReportState ] = useState('NOT_STARTED');\r\n\r\n let skipCouch = !reportId;\r\n let skipS3 = reportState !== 'DOWNLOADING' || !reportId;\r\n\r\n // Get report stub from Couch\r\n const couchResult = useQuery(ReportQuery, {\r\n variables: {\r\n id: reportId,\r\n },\r\n skip: skipCouch,\r\n pollInterval: reportState === 'IN_PROGRESS' ? 1000 : 0,\r\n onCompleted: () => !skipCouch && setReportState('IN_PROGRESS'),\r\n onError: () => setReportState('QUERY_FAILED')\r\n })\r\n\r\n useEffect(() => {\r\n if (reportId){\r\n setReportState('IN_PROGRESS');\r\n }\r\n else\r\n {\r\n setReportState('NOT_STARTED');\r\n }\r\n }, [ reportId ])\r\n\r\n useEffect(() => {\r\n if (['INITIALIZING', 'IN_PROGRESS'].includes(couchResult.data?.report?.status)){\r\n console.debug('Report has INITIALIZING or IN_PROGRESS status')\r\n if (reportState !== 'IN_PROGRESS'){\r\n setReportState('IN_PROGRESS');\r\n }\r\n }\r\n else\r\n {\r\n if (reportState === 'IN_PROGRESS'){\r\n setReportState('DOWNLOADING');\r\n }\r\n }\r\n }, [ couchResult.data?.report?.status ])\r\n\r\n // Get full report from S3 after report finishes in successful state\r\n const s3Result = useQuery(S3ReportQuery, {\r\n variables: {\r\n id: reportId,\r\n encoding: 'base64'\r\n },\r\n fetchPolicy: 'no-cache', // Reports can get huge, so best not to store it in the cache\r\n skip: skipS3,\r\n onCompleted: () => !skipS3 && setReportState('COMPLETE'),\r\n onError: () => setReportState('DOWNLOAD_FAILED')\r\n })\r\n\r\n if (!reportId){\r\n return {\r\n reportData: null,\r\n couchResult: null,\r\n s3Result: null,\r\n reportState: overrideState || reportState,\r\n error: null\r\n }\r\n }\r\n\r\n var mergedReport;\r\n if ((couchResult.data && couchResult.data.report) || (s3Result.data && s3Result.data.s3Report))\r\n {\r\n mergedReport = couchResult.data && couchResult.data.report;\r\n if (s3Result.data && s3Result.data.s3Report && s3Result.data.s3Report.result && s3Result.data.s3Report.result.docs){\r\n mergedReport.result.docs = JSON.stringify(s3Result.data.s3Report.result.docs)\r\n }\r\n }\r\n if (mergedReport && mergedReport.result && mergedReport.result.docs){\r\n if (typeof mergedReport.result.docs === 'string'){\r\n mergedReport.result.docs = JSON.parse(mergedReport.result.docs);\r\n }\r\n }\r\n console.debug('reportState', reportState);\r\n console.debug('couchResult', couchResult);\r\n console.debug('s3Result', s3Result);\r\n console.debug('mergedReport', mergedReport);\r\n \r\n return {\r\n reportData: mergedReport,\r\n couchResult,\r\n s3Result,\r\n reportState: reportState,\r\n error: couchResult?.error || s3Result?.error\r\n };\r\n}\r\n\r\nexport function getReportRuntimeFromNow(reportData: any){\r\n if (!reportData) return undefined;\r\n const startMoment = moment(reportData.startTs);\r\n return moment().diff(startMoment, 'milliseconds') / 1000;\r\n}\r\n\r\nexport default useReportDetails;","import { Form } from \"antd\";\r\nimport { isObject, mapValues, isEmpty } from 'lodash';\r\nimport emailValidator from 'email-validator';\r\n\r\nexport const formItemLayout = {\r\n labelCol: {\r\n xs: { span: 24 },\r\n sm: { span: 8 },\r\n },\r\n wrapperCol: {\r\n xs: { span: 24 },\r\n sm: { span: 16 },\r\n },\r\n};\r\n\r\nexport const tailFormItemLayout = {\r\n wrapperCol: {\r\n xs: {\r\n span: 24,\r\n offset: 0,\r\n },\r\n sm: {\r\n span: 16,\r\n offset: 8,\r\n }\r\n }\r\n}\r\n\r\nexport function createFormField(data: D | { value: D, [key: string]: any }, useDataAsValue?: boolean){\r\n if ((typeof data === 'object' && !isEmpty(data) && data !== null && !('value' in data) && !('dirty' in data)) || typeof data !== 'object' || data === null || useDataAsValue){\r\n return Form.createFormField({\r\n value: data\r\n }) as FormField\r\n }\r\n return Form.createFormField({\r\n ...(data || {}),\r\n value: data && (data as any).value\r\n }) as FormField\r\n}\r\n\r\n/**\r\n * Converts any object key/values into form data\r\n */\r\nexport type AsFormData = { [K in keyof T]: FormField }\r\n\r\n/**\r\n * Extracts the value of each FormField. Essentially converts form data back into a standard key/value pair object.\r\n */\r\nexport type FormDataValues> = {\r\n [K in keyof T]: T[K] extends FormField ? U : T[K]\r\n};\r\n\r\nexport function createFormFields(fields: T){\r\n if (!fields) return undefined;\r\n let data: AsFormData = {} as AsFormData\r\n for (let key in fields) {\r\n const value = fields[key];\r\n data[key] = createFormField(value);\r\n }\r\n return data\r\n}\r\n\r\nexport interface LabelInValue {\r\n label: string,\r\n key: string\r\n}\r\n\r\nexport interface FormField {\r\n value: T,\r\n touched?: boolean,\r\n [key: string]: any\r\n}\r\n\r\nexport interface FormFields {\r\n [key: string]: FormField | string | number\r\n}\r\n\r\nexport interface FormErrors {\r\n [field: string]: {\r\n errors: { field: string, message: string }\r\n }\r\n}\r\n\r\nexport function getFormFieldValue(field: FormField | string | number){\r\n let value: any;\r\n if (field !== null && typeof field === 'object' && field.value !== undefined){\r\n value = field.value;\r\n }\r\n else if (field !== null && typeof field === 'object' && field.value === undefined){\r\n value = undefined;\r\n }\r\n else\r\n {\r\n value = field\r\n }\r\n if (isObject(value) && isEmpty(value)){\r\n value = undefined\r\n }\r\n return value\r\n}\r\n\r\nexport function getFormFieldsValues(fields: FormFields | AsFormData): T{\r\n if (!isObject(fields)){\r\n return fields\r\n }\r\n return mapValues(fields, getFormFieldValue) as T;\r\n}\r\n\r\nexport function formFieldsValuesHaveChanged(oldFormFields: any, newFormFields: any){\r\n\r\n let oldValues = getFormFieldsValues(oldFormFields);\r\n let newValues = getFormFieldsValues(newFormFields);\r\n\r\n console.debug('detecting changes: ', oldValues, newValues);\r\n\r\n // Converts objects with \"key\" property for fields that use labelInValue prop\r\n const convertKeyLabel = (value: any) => {\r\n if (typeof value !== 'object' || value === null || value === undefined){\r\n return value;\r\n }\r\n if ('key' in value){\r\n return value.key;\r\n }\r\n \r\n return value;\r\n }\r\n\r\n const findChanged = (key: string, value: any, fv: any) => {\r\n if (fv === undefined) return true;\r\n if (!(key in fv)){\r\n return true; // Key not found in other form fields. Must've been added.\r\n }\r\n let otherValue = fv[key];\r\n if (typeof value === 'object' && value !== null){\r\n value = convertKeyLabel(value);\r\n value = String(value);\r\n }\r\n if (typeof otherValue === 'object' && otherValue !== null){\r\n otherValue = convertKeyLabel(otherValue);\r\n otherValue = String(otherValue);\r\n }\r\n return otherValue !== value;\r\n }\r\n\r\n let changed = false;\r\n\r\n // Compare new form fields vs old\r\n let newKeys = newValues ? Object.keys(newValues) : [];\r\n for (let i = 0; i < newKeys.length; i++) {\r\n const key = newKeys[i];\r\n if (changed)\r\n break\r\n changed = findChanged(key, newValues[key], oldValues);\r\n }\r\n\r\n // Compare old form fields vs new\r\n let oldKeys = oldValues ? Object.keys(oldValues) : [];\r\n for (let i = 0; i < oldKeys.length; i++) {\r\n const key = newKeys[i];\r\n if (changed)\r\n break\r\n changed = findChanged(key, oldValues[key], newValues);\r\n }\r\n\r\n if (changed) console.debug('changes detected!');\r\n if (changed) return true;\r\n console.debug('change not detected', oldValues, newValues);\r\n return false;\r\n}\r\n\r\nexport function formFieldsIsTouched(fields: FormFields, recursiveLevels: boolean | number=false){\r\n if (!fields) return false;\r\n return Object.values(fields).findIndex((field) => {\r\n if (!isObject(field)) return false\r\n\r\n if (field.touched){\r\n return field.touched\r\n }\r\n if (recursiveLevels){\r\n let nextRecursiveLevel: boolean | number = recursiveLevels;\r\n if (typeof recursiveLevels === 'number'){\r\n nextRecursiveLevel = recursiveLevels - 1;\r\n }\r\n return formFieldsIsTouched(field.value, nextRecursiveLevel)\r\n }\r\n return false\r\n }) !== -1\r\n}\r\n\r\nexport function transformFormFieldsValues(fields: FormFields, fn: (value: any) => any){\r\n function transformField(field: FormField){\r\n if (!field) return field;\r\n let value = getFormFieldValue(field);\r\n if (!value) return field;\r\n value = fn(value);\r\n return {\r\n ...field,\r\n value\r\n }\r\n }\r\n return mapValues(fields, transformField)\r\n}\r\n\r\nexport function getLabelInValue(obj: T, labelKey: keyof T | any, objKey: string='_id'): LabelInValue{\r\n if (!obj){\r\n return undefined;\r\n }\r\n return {\r\n key: obj[objKey],\r\n label: obj[labelKey]\r\n }\r\n}\r\n\r\nexport function castToLabelInValue(obj: any){\r\n if (!obj) return undefined;\r\n if (typeof obj === 'object' && obj.key && obj.label){\r\n return obj;\r\n }\r\n\r\n return { key: obj, label: '' }\r\n}\r\n\r\nexport function getLabelInValueKey(obj?: { label: any, key: any }){\r\n if (isObject(obj)){\r\n return obj.key\r\n }\r\n return obj\r\n}\r\n\r\nexport function uppercaseField(field: FormField | string | number){\r\n if (field !== null && typeof field === 'object'){\r\n let val = field.value;\r\n if (typeof val === 'string'){\r\n val = val.toUpperCase();\r\n }\r\n return {\r\n ...field,\r\n value: val\r\n }\r\n }\r\n let val = field;\r\n if (typeof val === 'string'){\r\n val = val.toUpperCase();\r\n }\r\n return val\r\n}\r\n\r\nexport function uppercaseAllFields(fields: FormFields){\r\n return transformFormFieldsValues(fields, (value) => {\r\n if (typeof value !== 'string') return value\r\n return value.toUpperCase();\r\n })\r\n}\r\n\r\nexport function uppercaseFields(fields: FormFields, fieldNames?: Array){\r\n if (!fieldNames || fieldNames.length <= 0){\r\n return fields\r\n }\r\n let uppercased = {};\r\n fieldNames.forEach((fieldName) => {\r\n uppercased[fieldName] = uppercaseField(fields[fieldName]);\r\n })\r\n return {\r\n ...fields,\r\n ...uppercased\r\n }\r\n}\r\n\r\nexport function mergeValuesIntoFormFields(newValues: any, fields: FormFields){\r\n let newValueEntries = Object.entries(newValues);\r\n\r\n let newFields = { ...fields }\r\n\r\n newValueEntries.forEach(([ k, v ]) => {\r\n if (k in fields){\r\n let field = Object.assign({}, fields[k]); // Create a copy\r\n if (typeof field === 'object'){\r\n field.value = v\r\n }\r\n newFields[k] = field\r\n }\r\n else\r\n {\r\n newFields[k] = createFormField(v);\r\n }\r\n })\r\n\r\n return newFields\r\n}\r\n\r\n/**\r\n * Gets the value of a field. Also gets the value of the 'key' property if an object for labelInValue fields.\r\n */\r\nexport function getFieldKey(fieldValue: { key: any } | any){\r\n if (typeof fieldValue === 'object' && fieldValue.hasOwnProperty('key')){\r\n return fieldValue.key;\r\n }\r\n return fieldValue;\r\n}\r\n\r\nexport function validateLabelInValue(rule, value, callback){\r\n if (rule.required && !getFieldKey(value)){\r\n callback(rule.message);\r\n }\r\n else\r\n {\r\n callback();\r\n }\r\n}\r\n\r\nexport function requiredRule(msg=\"This field is required\"){\r\n return [{ required: true, message: msg }]\r\n}\r\n\r\nexport function validateEmail(rules, value, callback){\r\n if(emailValidator.validate(value))\r\n callback()\r\n else\r\n callback(\"Invalid email format\")\r\n}\r\n\r\nexport const FormItemClassNames = {\r\n NoMargin: \"ant-form-item-no-margin\"\r\n}","import { Col, Divider, Icon, Row, Spin, Tag } from 'antd';\r\nimport moment from 'moment';\r\nimport React, { useState } from 'react';\r\nimport useInterval from '../../useInterval';\r\nimport './Criteria.less';\r\n\r\nconst SiderSection = ({ title, children }) => {\r\n return (\r\n
    \r\n

    {title}

    \r\n
    {children}
    \r\n
    \r\n )\r\n}\r\n\r\nconst ReportStatus = ({ status, style }) => {\r\n const textStyle = {\r\n fontSize: '1.2rem',\r\n ...style\r\n }\r\n switch (status) {\r\n case 'INITIALIZING':\r\n case 'IN_PROGRESS':\r\n return (\r\n \r\n } />\r\n IN PROGRESS\r\n \r\n )\r\n case 'COMPLETE':\r\n return (\r\n \r\n \r\n COMPLETE\r\n \r\n )\r\n case 'ERROR':\r\n return (\r\n \r\n \r\n ERROR\r\n \r\n )\r\n default:\r\n return null;\r\n }\r\n}\r\n\r\nconst ReportProperty = ({label, value, style}) => (\r\n \r\n
    \r\n {label}:\r\n \r\n \r\n {typeof value === 'string' && value}\r\n {Array.isArray(value) && value.map(val => {val})}\r\n \r\n \r\n)\r\n\r\nexport const Criteria = ({ data, isInProgress, justCriteria=false, criteriaItemStyle={} }) => \r\n{\r\n const [ currentTime, setCurrentTime ] = useState(moment());\r\n \r\n useInterval(() => {\r\n setCurrentTime(moment())\r\n }, 1000);\r\n\r\n let criteria = data ? (\r\n data.criteria\r\n .filter((item) => {\r\n const value = JSON.parse(item.display_value || item.value);\r\n if (Array.isArray(value) && value.length) return true\r\n if (!Array.isArray(value) && value) return true\r\n return false\r\n })\r\n .map((item) => {\r\n var value = JSON.parse(item.display_value || item.value);\r\n if (Array.isArray(value)){\r\n if (!value.length) value = 'N/A';\r\n }\r\n if (Array.isArray(value)){\r\n var isTime = false;\r\n for (var i = 0; i < value.length; i++)\r\n {\r\n var time = moment(value[i]);\r\n if (time.isValid()){\r\n isTime = true;\r\n value[i] = time.format('YYYY-MM-DD');\r\n }\r\n }\r\n if (isTime){\r\n value = value.join(' - ');\r\n }\r\n }\r\n else if (typeof value === 'object' && value){\r\n value = Object.values(value)\r\n }\r\n else if (!value){\r\n value = 'N/A'\r\n }\r\n return (\r\n \r\n )\r\n })\r\n ) : null;\r\n\r\n if (justCriteria){\r\n return criteria;\r\n }\r\n\r\n const startMoment = moment(data.startTs);\r\n const endMoment = moment(data.endTs || currentTime);\r\n const runTime = endMoment.diff(startMoment, 'milliseconds') / 1000;\r\n const created = moment(data.createdTs).format('YYYY-M-D H:m');\r\n\r\n return (\r\n
    \r\n \r\n \r\n \r\n \r\n \r\n {created}\r\n \r\n \r\n \r\n {isInProgress ? : null}\r\n {`${runTime} seconds`}\r\n \r\n \r\n \r\n {criteria}\r\n \r\n
    \r\n )\r\n}","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery ReportQuery($id: ID!) {\r\n report(id: $id){\r\n _id\r\n name\r\n startTs\r\n endTs\r\n createdTs\r\n status\r\n type\r\n result {\r\n total_docs\r\n summary\r\n }\r\n criteria {\r\n key\r\n label\r\n display_value\r\n value\r\n }\r\n error {\r\n type\r\n message\r\n detailMessage\r\n args\r\n }\r\n }\r\n}\r\n`\r\n\r\nexport const S3ReportQuery = gql`\r\nquery S3ReportQuery($id: ID!, $encoding: String) {\r\n s3Report(id: $id, encoding: $encoding) @client{\r\n _id\r\n name\r\n startTs\r\n endTs\r\n createdTs\r\n status\r\n type\r\n result {\r\n docs\r\n total_docs\r\n summary\r\n }\r\n criteria {\r\n key\r\n label\r\n display_value\r\n value\r\n }\r\n error {\r\n type\r\n message\r\n args\r\n }\r\n }\r\n}\r\n`","import { faMapMarkerAlt } from '@fortawesome/free-solid-svg-icons';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport React, { HTMLAttributes } from 'react'\r\nimport './style.less';\r\nimport cn from 'classnames';\r\n\r\nexport interface LocationMarkerProps extends HTMLAttributes {\r\n label?: React.ReactNode,\r\n isStart?: boolean,\r\n subLabel?: React.ReactNode,\r\n source?: string\r\n}\r\n\r\nexport const LocationMarker: React.FC = (props) => {\r\n let title = undefined;\r\n if (props.source){\r\n title = 'Coordinate Data Source: ' + String(props.source);\r\n }\r\n let iconClassName = cn({\r\n \"mc-location-marker-icon\": true,\r\n \"mc-location-marker-icon-start\": props.isStart ? true : false,\r\n \"mc-location-marker-icon-end\": props.isStart ? false : true,\r\n })\r\n return (\r\n
    \r\n \r\n
    \r\n {props.label ? (\r\n
    {props.label}
    \r\n ) : null}\r\n {props.subLabel ? (\r\n
    {props.subLabel}
    \r\n ) : null}\r\n
    \r\n
    \r\n )\r\n}\r\n\r\nexport default LocationMarker;","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nquery QueryQuickReport(\r\n $name: String!\r\n $type: ReportType!\r\n $criteria: [ReportCriteriaInput!]!\r\n $tpID: ID!\r\n){\r\n run_quick_report(\r\n name: $name\r\n type: $type\r\n criteria: $criteria\r\n tpID: $tpID\r\n ){\r\n classType\r\n createdBy\r\n createdTs\r\n criteria {\r\n display_value\r\n key\r\n label\r\n value\r\n }\r\n endTs\r\n error {\r\n args\r\n message\r\n detailMessage\r\n type\r\n }\r\n modifiedBy\r\n modifiedTs\r\n name\r\n result {\r\n docs\r\n refs\r\n summary\r\n total_docs\r\n total_pages\r\n }\r\n startTs\r\n status\r\n tpID\r\n type\r\n }\r\n}\r\n`","import { ApolloError } from \"apollo-client\";\r\nimport { BaseQueryOptions, MutationResult, QueryHookOptions, QueryResult, useLazyQuery, useMutation, useQuery } from \"react-apollo\";\r\nimport SubmitReport from \"../ReportForm/SubmitReport\";\r\nimport QueryQuickReport from \"../ReportForm/QueryQuickReport\";\r\n\r\ninterface SubmitEvents {\r\n onCompleted?: (data: any) => void;\r\n onError?: (error: ApolloError) => void;\r\n}\r\n\r\ninterface ReportSubmitterOptions {\r\n tpID?: string,\r\n customerID?: string,\r\n contractIDs?: string[]\r\n}\r\n\r\n/**\r\n * Create a new report which is then stored in S3 and CouchDB (stores only the metadata) using a GraphQL Mutation. Returns the report ID for later reference.\r\n * Can later be retrieved to check the status and view the data using useReportDetails hook (in report-details.tsx)\r\n * @param reportType Type of report [PAX|CGO|MANIFEST|ISN|COVID|PAX_COVID19_VAX|PERSON_COVID19_VAX_DETAILS|DISPATCH_HISTORY|DISPATCH_BILLING|DISPATCH_FUEL_TAKEN_S3|DISPATCH_CHANGES_BY_CONSOLE]\r\n * @param tpID Transporter ID of user\r\n * @param submitEvents Callbacks for when report submission is complete or failed\r\n * @param options Additional parameters for report\r\n * @returns sbmitFunc mutation function and result from mutation\r\n */\r\nfunction useReportSubmitter(reportType: string, tpID: string, submitEvents?: SubmitEvents, options?: ReportSubmitterOptions): [ (reportData: any) => Promise, MutationResult ] {\r\n const [ submit, result ] = useMutation(SubmitReport);\r\n\r\n const { onCompleted, onError } = submitEvents;\r\n \r\n const submitFunc = ({ name, criteria }) => new Promise((resolve, reject) => {\r\n submit({\r\n variables: {\r\n name,\r\n criteria: criteria.map(item => {\r\n return {\r\n ...item,\r\n value: JSON.stringify(item.value)\r\n };\r\n }),\r\n type: reportType,\r\n tpID: tpID || options?.tpID,\r\n customerID: options?.customerID,\r\n contractIDs: options?.contractIDs\r\n }\r\n })\r\n .then(({ data }) => {\r\n onCompleted({\r\n id: data.run_report,\r\n name\r\n });\r\n resolve?.(data);\r\n })\r\n .catch((error) => {\r\n onError?.(error);\r\n reject(error);\r\n })\r\n });\r\n return [ submitFunc, result ]\r\n}\r\n\r\n/**\r\n * Works similarly to useReportSubmitter, but it runs the report and immediately returns results back using a GraphQL Query.\r\n * This method of running a report should only be done with a narrow criteria on a report that is highly performant.\r\n * Reports that take a minute or more WILL FAIL.\r\n * @param reportType Type of report [PAX|CGO|MANIFEST|ISN|COVID|PAX_COVID19_VAX|PERSON_COVID19_VAX_DETAILS|DISPATCH_HISTORY|DISPATCH_BILLING|DISPATCH_FUEL_TAKEN_S3|DISPATCH_CHANGES_BY_CONSOLE]\r\n * @param tpID Transporter ID of user\r\n * @param reportName Human readable name for the report\r\n * @param submitEvents Callbacks for when report submission is complete or failed\r\n * @param options Additional parameters for report\r\n * @returns Query result\r\n */\r\nexport function useQuickReportQuery(reportType: string, tpID: string, reportName: string, reportCriteria: any, options?: QueryHookOptions): QueryResult {\r\n const result = useQuery(QueryQuickReport, {\r\n variables: {\r\n name: reportName,\r\n criteria: reportCriteria?.map(item => {\r\n return {\r\n ...item,\r\n value: JSON.stringify(item.value)\r\n };\r\n }),\r\n type: reportType,\r\n tpID: tpID\r\n },\r\n fetchPolicy: 'no-cache',\r\n ...options\r\n });\r\n return result\r\n}\r\n\r\nexport default useReportSubmitter;","import {Ref} from \"react\";\r\n\r\n/**\r\n * Adds a \"displayText\" property to the ref of component's element for purposes of converting it into a human-readable string.\r\n * One of the modules that uses this property is {@link reactNodeTextGetter}\" in its getNodeText function.\r\n * @param text Text to display\r\n * @param ref Ref to enhance\r\n */\r\nexport function exportTextInRef(text: string, ref: Ref){\r\n function enhanceElement(e: T){\r\n if (!e) return;\r\n (e as any).displayText = text;\r\n }\r\n\r\n if (typeof ref === 'function'){\r\n return (e: T) => {\r\n enhanceElement(e);\r\n return ref(e);\r\n }\r\n }\r\n else\r\n {\r\n enhanceElement(ref?.current);\r\n return ref;\r\n }\r\n}","/**\r\n * Second version of report user interface. Integrates with python backend report system.\r\n */\r\n\r\nimport { faFileAlt } from '@fortawesome/free-solid-svg-icons';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { Alert, Button, Checkbox, Divider, Drawer, Icon, Layout, PageHeader, Tooltip, Typography } from 'antd';\r\nimport cn from 'classnames';\r\nimport { createFormField } from 'common/form';\r\nimport wrapCtxProvider, { ContextProviderWrapperProps, WithContextOverrideProps } from 'component-wrappers/wrap-ctx-provider';\r\nimport CenteredLoadingScreen from 'components/CenteredLoadingScreen';\r\nimport NonIdealState from 'components/NonIdealState';\r\nimport { DataExporter, DataExporterProps, ReportExporter, ReportExporterBaseProps, ReportExporterProps } from 'components/reporting/export';\r\nimport { getReportRuntimeFromNow } from 'components/reporting/hooks/report-details';\r\nimport { Criteria } from 'components/reporting/ReportDetails/Criteria';\r\nimport React, { CSSProperties, useContext, useEffect, useMemo, useRef, useState } from 'react';\r\nimport { ReportUIContext, ReportUIContextInterface, ReportUIContextProvider, ReportUIContextProviderProps } from './context';\r\nimport './report-ui.less';\r\n\r\nexport interface ReportState {\r\n showCriteriaSider: boolean,\r\n showReportCriteria: boolean,\r\n showExportDrawer: boolean,\r\n forceUpdateCount: number\r\n}\r\n\r\nconst BASE_CLS = 'mc-report-ui';\r\n\r\nexport interface ReportUIFormProps {\r\n formFields: any,\r\n onFieldsChange: (values: { [key: string]: any }) => void\r\n}\r\n\r\ninterface AutoRefreshOptions {\r\n enabled?: boolean,\r\n pollInterval?: number\r\n}\r\n\r\nexport interface ReportUIProps extends WithContextOverrideProps {\r\n renderTable: (consumerValue: any) => React.ReactNode,\r\n renderCriteriaForm: (ref: any, formFields: any, onCriteriaFieldsChange: (values: { [key: string]: any }) => void) => React.ReactNode,\r\n setReportExporterProps?: (reportData: any) => Omit,\r\n // renderReportExporter?: (reportData: any) => React.ReactElement\r\n reportTitle: string | React.ReactNode,\r\n overrideRenderHeader?: (state: any) => React.ReactNode,\r\n style?: CSSProperties,\r\n contentFlexMode?: boolean,\r\n\r\n /** Required if useExternalContextProvider is not specified or false */\r\n contextProviderProps?: ReportUIContextProviderProps,\r\n\r\n autoRefreshOptions?: AutoRefreshOptions,\r\n headerExtra?: {\r\n left?: React.ReactNode,\r\n right?: React.ReactNode\r\n }\r\n}\r\n\r\nconst { Sider, Header, Content } = Layout;\r\n\r\nconst ReportUI_Internal: React.FC = (props) => {\r\n const {\r\n formRef,\r\n criteriaFormFields,\r\n onCriteriaFieldsChange,\r\n resetCriteriaForm,\r\n submitReport,\r\n reportSubmitting,\r\n reportDetails,\r\n setAutoRefreshInterval,\r\n setAutoRefreshMode,\r\n autoRefreshMode\r\n } = useContext(props.overrideContext || ReportUIContext);\r\n\r\n let reportData = reportDetails?.reportData;\r\n let reportState = reportDetails?.reportState;\r\n \r\n const [ state, _setState ] = useState({\r\n showCriteriaSider: true,\r\n showReportCriteria: false,\r\n showExportDrawer: false,\r\n forceUpdateCount: 0\r\n });\r\n\r\n useEffect(() => {\r\n setAutoRefreshInterval(props.autoRefreshOptions?.pollInterval);\r\n }, [ props.autoRefreshOptions?.pollInterval ])\r\n\r\n // Had to do it this way for some reason because old values were showing up in the 'state' variable\r\n const [ pendingState, setPendingState ] = useState({});\r\n useEffect(() => {\r\n _setState({ ...state, ...pendingState });\r\n }, [ pendingState ])\r\n\r\n function setState(newState: Partial){\r\n setPendingState(newState);\r\n }\r\n // ------------------------------------------------------------------------------------------------\r\n\r\n const forceUpdateInterval = useRef({ prevVal: 0, interval: null });\r\n\r\n useEffect(() => {\r\n console.debug('REPORT STATE CHANGED TO \"' + reportState + '\"')\r\n console.debug('has interval: ', forceUpdateInterval.current);\r\n\r\n function intervalFunc(){\r\n setState({ forceUpdateCount: forceUpdateInterval.current.prevVal + 1 });\r\n forceUpdateInterval.current.prevVal++;\r\n }\r\n\r\n if (reportState === 'IN_PROGRESS' && !forceUpdateInterval.current.interval){\r\n forceUpdateInterval.current = {\r\n prevVal: state.forceUpdateCount,\r\n interval: setInterval(intervalFunc, 1000)\r\n }\r\n }\r\n if (reportState !== 'IN_PROGRESS'){\r\n console.debug('CLEARING INTERVAL');\r\n if (forceUpdateInterval.current){\r\n clearInterval(forceUpdateInterval.current.interval);\r\n forceUpdateInterval.current.interval = null;\r\n }\r\n }\r\n \r\n }, [ reportState ])\r\n\r\n useEffect(() => {\r\n if (autoRefreshMode){\r\n return;\r\n }\r\n if (reportState === 'NOT_STARTED' && state.showReportCriteria){\r\n setState({ showReportCriteria: false });\r\n }\r\n if ((reportState === 'IN_PROGRESS') && !state.showReportCriteria){\r\n setState({ showReportCriteria: true });\r\n }\r\n if ((reportState === 'DOWNLOADING') && !state.showReportCriteria){\r\n setState({ showReportCriteria: true });\r\n }\r\n // eslint-disable-next-line\r\n }, [ reportState, autoRefreshMode ])\r\n\r\n function renderContent(){\r\n return <>\r\n {reportState === 'QUERY_FAILED' || reportState === 'DOWNLOAD_FAILED' ? : null}\r\n {reportState === 'COMPLETE' && reportData?.status === 'ERROR' ? (\r\n \r\n ) : null}\r\n {reportState === 'IN_PROGRESS' ? (\r\n \r\n
    \r\n Report is being generated. Please wait.\r\n
    \r\n {!autoRefreshMode && getReportRuntimeFromNow(reportData) >= 120/* seconds */ ? (\r\n \r\n ) : null}\r\n \r\n }\r\n />\r\n ) : null}\r\n {reportState === 'DOWNLOADING' ? (\r\n Downloading Report}\r\n />\r\n ) : null}\r\n {reportState === 'NOT_STARTED' ? (\r\n \r\n
    Use the left panel to choose your criteria. Then click \"Generate Report\" to run the report.
    \r\n \r\n }\r\n style={{ height: '100%' }}\r\n icon={}\r\n type=\"primary\"\r\n />\r\n ) : null}\r\n {reportState === 'COMPLETE' ? (\r\n \r\n {(value) => props.renderTable(value)}\r\n \r\n ) : null}\r\n \r\n }\r\n\r\n let contentStyle: CSSProperties = { padding: 12, overflow: 'auto' };\r\n\r\n if (props.contentFlexMode){\r\n contentStyle = {\r\n ...contentStyle,\r\n display: 'flex',\r\n flexDirection: 'column'\r\n }\r\n }\r\n\r\n function renderAutoRefreshMode(){\r\n if (!props.autoRefreshOptions?.enabled){\r\n return null\r\n }\r\n if (!formRef.current){\r\n return null;\r\n }\r\n return <>\r\n setAutoRefreshMode(e.target.checked)}\r\n >Auto-Refresh Mode\r\n \r\n

    Report runs every 30 seconds when enabled

    \r\n

    \r\n WARNING: Due to the limitations of real-time reports, some reports may take too long to run and display an error.\r\n If this happens, please reduce the scope of the report and try again.\r\n

    \r\n \r\n }>\r\n \r\n
    \r\n \r\n }\r\n\r\n const renderedCriteriaForm = useMemo(() => {\r\n return props.renderCriteriaForm(formRef, criteriaFormFields, onCriteriaFieldsChange);\r\n }, [ criteriaFormFields ])\r\n\r\n const renderExporter = () => {\r\n let exporterProps = props.setReportExporterProps?.(reportData);\r\n if (!exporterProps){\r\n return null;\r\n }\r\n if (autoRefreshMode){\r\n return \r\n }\r\n else\r\n {\r\n return \r\n }\r\n }\r\n\r\n return \r\n
    \r\n {typeof props.reportTitle === 'string' ? (\r\n

    {props.reportTitle}

    \r\n ) : (\r\n props.reportTitle\r\n )}\r\n {props.headerExtra?.left ? props.headerExtra?.left : null}\r\n
    \r\n {props.headerExtra?.right ? props.headerExtra?.right : null}\r\n {reportSubmitting && autoRefreshMode && reportState !== 'IN_PROGRESS' ? (\r\n Refreshing data\r\n ) : null}\r\n {renderAutoRefreshMode()}\r\n \r\n {reportState === 'COMPLETE' ? (\r\n \r\n ) : null}\r\n
    \r\n \r\n {!state.showCriteriaSider ? (\r\n setState({ showCriteriaSider: !state.showCriteriaSider })}\r\n >Show Criteria Panel\r\n ) : null}\r\n \r\n
    \r\n
    \r\n setState({ showReportCriteria: false })} title=\"CRITERIA\" className={BASE_CLS + '-form-title'} />\r\n \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n setState({ showReportCriteria: true })}>Show Criteria : null}\r\n />\r\n
    \r\n {renderedCriteriaForm}\r\n
    \r\n {!autoRefreshMode ? (\r\n
    \r\n {\r\n formRef.current.validateFieldsAndScroll((err, values) => {\r\n if (!err){\r\n submitReport(values);\r\n }\r\n })\r\n }}\r\n loading={reportSubmitting}\r\n >Generate Report\r\n
    \r\n ) : null}\r\n {formRef?.current?.isFieldsTouched() ? (\r\n
    \r\n \r\n
    \r\n ) : null}\r\n
    \r\n
    \r\n {reportData ? (\r\n setState({ showCriteriaSider: !state.showCriteriaSider })}\r\n icon={state.showCriteriaSider ? 'menu-fold' : 'menu-unfold'}\r\n block\r\n >Hide Criteria Panel\r\n ) : null}\r\n
    \r\n \r\n {renderContent()}\r\n \r\n
    \r\n Export Report}\r\n width={600}\r\n onClose={() => setState({ showExportDrawer: false })}\r\n bodyStyle={{ height: 'calc(100% - 56px)' }}\r\n >\r\n {renderExporter()}\r\n \r\n
    \r\n}\r\n\r\nReportUI_Internal.displayName = 'ReportUI'\r\n\r\nconst ReportUI = wrapCtxProvider({\r\n providerComponent: ReportUIContextProvider,\r\n wrapperPropsToProviderProps: (wrapperProps: ReportUIProps) => {\r\n console.debug('wrapperProps', wrapperProps);\r\n if (wrapperProps.contextProviderProps){\r\n return wrapperProps.contextProviderProps;\r\n }\r\n else\r\n {\r\n throw Error(\"contextProviderProps must be specified if useExternalContextProvider isn't specified or false.\")\r\n }\r\n }\r\n})(ReportUI_Internal) as React.FC\r\n\r\nReportUI.defaultProps = {\r\n autoRefreshOptions: {\r\n enabled: true,\r\n pollInterval: 30000\r\n }\r\n}\r\n\r\nexport default ReportUI","// Code from https://stackoverflow.com/a/57335271/2901480\r\nimport { useEffect, useRef } from \"react\";\r\n\r\nexport function useDebouncedCallback(\r\n callback: (...args: A) => void,\r\n wait: number\r\n) {\r\n // track args & timeout handle between calls\r\n const argsRef = useRef();\r\n const timeout = useRef>();\r\n\r\n function cleanup() {\r\n if(timeout.current) {\r\n clearTimeout(timeout.current);\r\n }\r\n }\r\n\r\n // make sure our timeout gets cleared if\r\n // our consuming component gets unmounted\r\n useEffect(() => cleanup, []);\r\n\r\n return function debouncedCallback(\r\n ...args: A\r\n ) {\r\n // capture latest args\r\n argsRef.current = args;\r\n\r\n // clear debounce timer\r\n cleanup();\r\n\r\n // start waiting again\r\n timeout.current = setTimeout(() => {\r\n if(argsRef.current) {\r\n callback(...argsRef.current);\r\n }\r\n }, wait);\r\n };\r\n}","import Auth from '@aws-amplify/auth';\r\nimport { PutObjectCommand, S3Client } from '@aws-sdk/client-s3';\r\nimport { Button, Icon, message, Modal, Spin, Typography, Upload } from 'antd';\r\nimport { UploadProps } from 'antd/lib/upload';\r\nimport { UploadFile } from 'antd/lib/upload/interface';\r\nimport getGenericStateReducer from 'common/reducer/generic-state-reducer';\r\nimport config from 'config';\r\nimport { AuthContext } from 'context/auth';\r\nimport React, { useContext, useEffect, useReducer } from 'react';\r\nimport cn from 'classnames';\r\nimport './isn-override-file-uploader.less';\r\n\r\nexport interface IsnOverrideFileUploaderProps extends UploadProps {\r\n paxID: string,\r\n readOnly?: boolean,\r\n addOnly?: boolean\r\n}\r\n\r\ninterface S3FileListItem {\r\n Key: string,\r\n LastModified: string,\r\n Size: number\r\n}\r\n\r\ninterface State {\r\n fileList: any[],\r\n loading: boolean,\r\n error?: string\r\n}\r\n\r\nconst DEFAULT_STATE: State = {\r\n fileList: [],\r\n loading: true,\r\n error: null\r\n}\r\n\r\nconst IsnOverrideFileUploader: React.FC = (props) => {\r\n const { user, refreshUser } = useContext(AuthContext);\r\n const [ state, dispatch ] = useReducer(getGenericStateReducer(), DEFAULT_STATE);\r\n\r\n async function getHeaders(_refreshUser=true){\r\n let currUser = user;\r\n if (_refreshUser){\r\n currUser = await refreshUser();\r\n }\r\n if (!currUser || !currUser.signInUserSession) return {}\r\n const idToken = currUser.signInUserSession.idToken.jwtToken;\r\n\r\n return {\r\n 'Authorization': idToken\r\n }\r\n }\r\n\r\n async function downloadImagePreview(url: string): Promise {\r\n let res = await fetch(url, { headers: await getHeaders(false) });\r\n let arrBuf = await res.arrayBuffer();\r\n let b64Str = Buffer.from(arrBuf).toString('base64');\r\n let contentType = res.headers.get('Content-Type');\r\n return `data:${contentType};base64, ${b64Str}`\r\n }\r\n\r\n function convertS3FileList(list: S3FileListItem[]): Promise>>[]{\r\n if (!Array.isArray(list)) return []\r\n return list.map(s3 => {\r\n let split = s3.Key.split('/');\r\n let fileName = split[split.length-1];\r\n fileName = decodeURIComponent(fileName);\r\n let url = config.pythonBackendApi + \"/isn-override/\" + props.paxID + \"/\" + fileName;\r\n\r\n return new Promise((resolve) => {\r\n downloadImagePreview(url)\r\n .then((urlStr) => resolve({\r\n uid: s3.Key,\r\n name: fileName,\r\n url: url,\r\n preview: urlStr,\r\n lastModifiedDate: new Date(s3.LastModified),\r\n size: s3.Size\r\n }))\r\n .catch(() => resolve({\r\n uid: s3.Key,\r\n name: fileName,\r\n url: url,\r\n size: s3.Size\r\n }))\r\n })\r\n })\r\n }\r\n\r\n async function listFiles(){\r\n dispatch({ newState: { loading: true, error: null } })\r\n if (!props.paxID){\r\n return;\r\n }\r\n fetch(config.pythonBackendApi + \"/isn-override/list-files/\" + props.paxID, {\r\n headers: await getHeaders(),\r\n method: 'get'\r\n })\r\n .then(async resp => {\r\n if (resp.ok){\r\n return await resp.json();\r\n }\r\n else\r\n {\r\n throw Error(await resp.text());\r\n }\r\n })\r\n .then(async data => dispatch({ newState: { fileList: await Promise.all(convertS3FileList(data)), loading: false, error: null } }))\r\n .catch((err) => {\r\n console.error('Failed to load file list:', err);\r\n dispatch({ newState: { loading: false, error: 'Failed to list files' } })\r\n refreshUser();\r\n })\r\n }\r\n\r\n useEffect(() => {\r\n listFiles();\r\n }, [ props.paxID ])\r\n\r\n let uploadProps: UploadProps = {\r\n className: cn({\r\n 'mc-iofu': true,\r\n 'mc-iofu-readonly': props.readOnly,\r\n 'mc-iofu-addonly': props.addOnly\r\n }),\r\n multiple: true,\r\n disabled: props.readOnly,\r\n onChange: (info) => {\r\n dispatch({ newState: { fileList: info.fileList } })\r\n },\r\n fileList: state.fileList,\r\n onRemove: (file) => {\r\n if (props.addOnly){\r\n console.warn(\"Attempt to remove file in addOnly mode was prevented.\");\r\n }\r\n if (file.status === 'error'){\r\n return true;\r\n }\r\n\r\n return new Promise(async (resolve, reject) => {\r\n // Assume successful delete and immediately remove file from fileList\r\n let fileIdx = state.fileList.findIndex(f => f.name === file.name);\r\n let prevStatus = 'done';\r\n if (fileIdx > -1){\r\n let newFileList = [...state.fileList];\r\n prevStatus = newFileList[fileIdx].status;\r\n newFileList[fileIdx] = {\r\n ...newFileList[fileIdx],\r\n status: 'removed'\r\n }\r\n dispatch({ newState: { fileList: newFileList } })\r\n }\r\n\r\n // If delete request fails, add the file back to the fileList\r\n function handleFail(){\r\n if (fileIdx <= -1) return;\r\n\r\n let newFileList = [...state.fileList];\r\n newFileList[fileIdx] = {\r\n ...newFileList[fileIdx],\r\n status: prevStatus\r\n }\r\n dispatch({ newState: { fileList: newFileList } })\r\n }\r\n Modal.confirm({\r\n title: 'Are you sure?',\r\n content: 'Are you sure you want to remove this file? This action cannot be undone!!',\r\n okButtonProps: {\r\n type: 'danger',\r\n children: 'Delete'\r\n },\r\n onOk: async () => {\r\n return fetch(config.pythonBackendApi + \"/isn-override/\" + props.paxID + '/' + file.name, {\r\n method: 'delete',\r\n headers: await getHeaders()\r\n })\r\n .then(resp => {\r\n let success = resp.status >= 200 && resp.status < 300;\r\n if (!success){\r\n message.error('Failed to remove file due to an error.');\r\n console.error(\"Failed to remove file:\", resp.text());\r\n reject('API returned ' + resp.status);\r\n handleFail();\r\n }\r\n else\r\n {\r\n resolve(success);\r\n message.success(`Successfully deleted '${file.name}'`);\r\n }\r\n })\r\n .catch((err) => {\r\n console.error(\"Failed to remove file:\", err);\r\n message.error('Failed to remove file due to an error.');\r\n reject(err);\r\n handleFail();\r\n })\r\n }\r\n })\r\n })\r\n },\r\n onPreview: async (file) => {\r\n console.log('Downloading file', file.name);\r\n fetch(config.pythonBackendApi + \"/isn-override/\" + props.paxID + \"/\" + file.name, {\r\n method: 'get',\r\n headers: await getHeaders()\r\n })\r\n .then((resp) => resp.blob())\r\n .then(blob => {\r\n let url = window.URL.createObjectURL(blob);\r\n let anchor = document.createElement('a');\r\n document.body.appendChild(anchor);\r\n\r\n anchor.href = url;\r\n anchor.download = file.name;\r\n anchor.click();\r\n\r\n window.URL.revokeObjectURL(url);\r\n document.body.removeChild(anchor);\r\n })\r\n },\r\n onDownload: async (file) => {\r\n console.log('Downloading file', file.name);\r\n fetch(config.pythonBackendApi + \"/isn-override/\" + props.paxID + \"/\" + file.name, {\r\n method: 'get',\r\n headers: await getHeaders()\r\n })\r\n .then((resp) => resp.blob())\r\n .then(blob => {\r\n let url = window.URL.createObjectURL(blob);\r\n let anchor = document.createElement('a');\r\n document.body.appendChild(anchor);\r\n\r\n anchor.href = url;\r\n anchor.download = file.name;\r\n anchor.click();\r\n\r\n window.URL.revokeObjectURL(url);\r\n document.body.removeChild(anchor);\r\n })\r\n },\r\n listType: 'picture',\r\n customRequest: async ({ file, onSuccess, onError, onProgress }) => {\r\n if (props.readOnly){\r\n console.error('Uploading is not allowed after override is complete.')\r\n return;\r\n }\r\n fetch(config.pythonBackendApi + \"/isn-override/\" + props.paxID + \"/\" + file.name, {\r\n method: 'post',\r\n body: file,\r\n headers: await getHeaders()\r\n })\r\n .then(async resp => {\r\n if (resp.ok){\r\n onSuccess(resp, file);\r\n message.success(\"Upload successful!\");\r\n }\r\n else\r\n {\r\n throw new Error(await resp.text());\r\n }\r\n })\r\n .catch((err) => {\r\n onError(err);\r\n console.log(err);\r\n message.error(\"Failed to upload due to an error. Make sure the file size doesn't exceed 4MB.\");\r\n })\r\n }\r\n }\r\n\r\n if (state.loading){\r\n return } />\r\n }\r\n\r\n return (\r\n \r\n \r\n {state.error ?
    {state.error}
    : null}\r\n {props.readOnly ? null :
    File size limit: 4MB
    }\r\n \r\n )\r\n}\r\n\r\nIsnOverrideFileUploader.defaultProps = {\r\n readOnly: false\r\n}\r\n\r\nexport default IsnOverrideFileUploader;","import * as React from 'react';\r\nimport { safeGet } from '../common/util';\r\nimport { OrgDataContext } from '../context/orgData';\r\n\r\nexport type OrgTypes = 'employer' | 'transporter' | 'customer';\r\ntype ClassTypes = 'flytsuite.customer' | 'flytsuite.transporter' | 'flytsuite.employer'\r\n\r\nexport interface OrgDataProps {\r\n /**\r\n * _id and name of current customer account.\r\n */\r\n customer?: any,\r\n\r\n /**\r\n * _id and name of transporter account (or transporter selected as active for customer accounts.)\r\n */\r\n transporter?: any,\r\n\r\n /**\r\n * List of transporters the current customer is contracted with\r\n */\r\n tpList?: any[]\r\n\r\n /**\r\n * _id and name of employer account.\r\n */\r\n employer?: any,\r\n\r\n /**\r\n * _id, name, type, and classType of user's organization. (The organization from the user's custom:organization Cognito user attribute).\r\n */\r\n organization: any,\r\n\r\n /**\r\n * Checks if the user's organization is of a certain type.\r\n * @param classType classType of the organization.\r\n */\r\n userOrgIsOfType: (classType: ClassTypes) => boolean,\r\n\r\n /**\r\n * _id and name of current selected organization (transporter, customer, or employer depending on the user who is signed in)\r\n */\r\n activeOrg: any,\r\n\r\n /**\r\n * Get the active organization ID if available.\r\n */\r\n getActiveOrgID: () => string,\r\n\r\n /**\r\n * Get the active organization Object if available.\r\n */\r\n getActiveOrg: () => any,\r\n\r\n /**\r\n * Get the active organization name if available.\r\n */\r\n getActiveOrgName: () => string,\r\n\r\n /**\r\n * Checks if the active organization is of a certain type.\r\n * @param classType classType of the organization.\r\n */\r\n activeOrgIsOfType: (classType: ClassTypes) => boolean,\r\n /**\r\n * Get organization object by type of organization.\r\n * If no type is provided the plain organization is returned.\r\n * @param type Org type.\r\n */\r\n getOrgByType: (type?: OrgTypes) => any,\r\n\r\n /**\r\n * Get organization ID by type of organization.\r\n * If no type is provided the plain organization ID is returned.\r\n * @param type Org type.\r\n */\r\n getOrgIDByType: (type?: OrgTypes) => any,\r\n\r\n /**\r\n * Get organization name by type of organization.\r\n * If no type is provided the plain organization name is returned.\r\n * @param type Org type.\r\n */\r\n getOrgNameByType: (type?: OrgTypes) => any\r\n}\r\n\r\nexport interface WithOrgDataProps {\r\n /**\r\n * Contains all organization information such as the current customer, transporter, employer, etc.\r\n */\r\n orgData?: OrgDataProps\r\n}\r\n\r\n/**\r\n * Higher-order-component that allows any component to read current organization information.\r\n * \r\n * IMPORTANT: In TypeScript, the wrapped component must extend the interface WithOrgDataProps.\r\n */\r\n// eslint-disable-next-line import/no-anonymous-default-export\r\nexport default

    (Component: React.ComponentType

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

    = (props) => \r\n {(data) => {\r\n let getActiveOrg = () => {\r\n switch (safeGet(['organization', 'classType'], data)) {\r\n case 'flytsuite.employer':\r\n return data.employer;\r\n case 'flytsuite.transporter':\r\n case 'flytsuite.customer':\r\n return data.transporter;\r\n default:\r\n return data.organization;\r\n }\r\n }\r\n const getOrgByType = (type?: OrgTypes) => {\r\n switch (type) {\r\n case 'employer':\r\n return data.employer\r\n case 'transporter':\r\n return data.transporter\r\n case 'customer':\r\n return data.customer\r\n default:\r\n return data.organization;\r\n }\r\n }\r\n if (!data) return null\r\n Component.displayName = 'withOrgData(' + Component.displayName + ')'\r\n return {\r\n const org = data.organization;\r\n return (org && org.classType) === classType;\r\n },\r\n getActiveOrgID: () => {\r\n const activeOrg = getActiveOrg();\r\n return activeOrg && activeOrg._id;\r\n },\r\n getActiveOrg,\r\n getActiveOrgName: () => {\r\n const activeOrg = getActiveOrg();\r\n return activeOrg && activeOrg.name;\r\n },\r\n activeOrgIsOfType: (classType: ClassTypes) => {\r\n const activeOrg = getActiveOrg();\r\n return (activeOrg && activeOrg.classType) === classType;\r\n },\r\n getOrgByType: getOrgByType,\r\n getOrgNameByType: (type: OrgTypes) => {\r\n let org = getOrgByType(type);\r\n return org && org.name\r\n },\r\n getOrgIDByType: (type: OrgTypes) => {\r\n let def:OrgTypes = 'transporter';\r\n let org = getOrgByType(type ? type : def);\r\n return org && org._id\r\n }\r\n }} />\r\n }}\r\n \r\n return withOrgData\r\n}","import React from 'react';\r\n\r\nexport interface WrapCtxProviderOptions {\r\n\r\n /** Wrap the child component with a custom provider component. Uses context.Provider if not specified. */\r\n providerComponent: any,\r\n\r\n /** Maps props passed to the wrapper to the provider. Necessary if the provider component needs props. */\r\n wrapperPropsToProviderProps?: (wrapperProps: any) => any\r\n}\r\n\r\nexport interface ContextProviderWrapperProps {\r\n /** If true, the child component will use a provider from higher in the tree instead of creating one. */\r\n useExternalContextProvider?: boolean,\r\n\r\n /** Use a different implementation of the provider. IMPORTANT: The provider used to override must return the same context specified in overrideContext (or the default context type that the this component is expecting). */\r\n overrideProvider?: any,\r\n\r\n /** Use a different implementation of the context: IMPORTANT: The context used to override must be the same context returned by the provider. */\r\n overrideContext?: React.Context\r\n}\r\n\r\nexport interface WithContextOverrideProps {\r\n overrideContext?: React.Context\r\n}\r\n\r\n/**\r\n * Wraps a component with a context provider of your choice.\r\n * If useExternalContextProvider is set to true on the wrapper's props,\r\n * it will not wrap the child component with a provider so an external provider can be used instead.\r\n * @param options providerComponent option is required.\r\n * @returns Function that wraps the child component. Pass the child component variable into here. NOTE: The child component's interface MUST EXTEND WithContextOverrideProps!\r\n */\r\nfunction wrapCtxProvider(options: WrapCtxProviderOptions){\r\n return (Comp: React.FC>) => {\r\n Comp.displayName = 'ContextProviderWrapper(' + Comp.displayName + ')'\r\n\r\n // TODO: Line below to be React.FC, but then you could not pass anything other than ContextProviderWrapperProps attributes\r\n // This should be fixed so prop names and types are properly enforced\r\n const ContextProviderWrapper: React.FC\r\n\r\n = ({useExternalContextProvider, overrideContext, overrideProvider, ...childProps}) => {\r\n if (useExternalContextProvider) return // Child component will use external provider instead\r\n \r\n // Create a Provider component to wrap the child component and map the props from the wrapper to the provider\r\n let Provider = overrideProvider ? overrideProvider : options.providerComponent;\r\n let cp_props = options.wrapperPropsToProviderProps ? \r\n options.wrapperPropsToProviderProps(childProps) : {};\r\n cp_props.children = \r\n return \r\n }\r\n return ContextProviderWrapper\r\n }\r\n}\r\n\r\nexport default wrapCtxProvider","import { useEffect, useRef } from 'react';\r\n\r\nfunction useInterval(callback, delay) {\r\n const savedCallback = useRef();\r\n\r\n // Remember the latest callback.\r\n useEffect(() => {\r\n savedCallback.current = callback;\r\n }, [callback]);\r\n\r\n // Set up the interval.\r\n useEffect(() => {\r\n function tick() {\r\n savedCallback.current();\r\n }\r\n if (delay !== null) {\r\n let id = setInterval(tick, delay);\r\n return () => clearInterval(id);\r\n }\r\n }, [delay]);\r\n}\r\n\r\nexport default useInterval","/**\r\n * Contains stateful logic for report UI.\r\n * Wrap the ReportUIContextProvider component around your child component to use stateful functionality.\r\n */\r\n\r\nimport { message } from 'antd';\r\nimport { NetworkStatus } from 'apollo-client';\r\nimport { formFieldsValuesHaveChanged } from 'common/form';\r\nimport getGenericStateReducer from 'common/reducer/generic-state-reducer';\r\nimport useReportDetails, { ReportDetailsResult } from 'components/reporting/hooks/report-details';\r\nimport useReportSubmitter, { useQuickReportQuery } from 'components/reporting/hooks/report-submitter';\r\nimport { OrgDataContext } from 'context/orgData';\r\nimport usePersistence from 'hooks/persistence';\r\nimport React, { createContext, PropsWithChildren, useContext, useReducer, useRef } from 'react';\r\n\r\nexport interface ReportUIContextInterface {\r\n criteriaFormFields?: { [key: string]: any },\r\n onCriteriaFieldsChange?: (values: { [key: string]: any }) => void,\r\n resetCriteriaForm?: () => void,\r\n formRef?: any,\r\n reportID?: string,\r\n displayReportCriteria?: boolean,\r\n reportSubmitting?: boolean,\r\n submitReport?: (reportData: any) => Promise,\r\n reportDetails?: ReportDetailsResult,\r\n autoRefreshMode: boolean,\r\n setAutoRefreshInterval: (ms: number) => void,\r\n setAutoRefreshMode?: (on: boolean) => void\r\n}\r\n\r\nconst DEFAULT_CONTEXT_VALUE: ReportUIContextInterface = {\r\n autoRefreshMode: false,\r\n setAutoRefreshInterval: undefined\r\n}\r\n\r\nexport const ReportUIContext = createContext(DEFAULT_CONTEXT_VALUE);\r\n\r\nexport interface ReportUIContextProviderProps {\r\n reportID?: string,\r\n reportName: string,\r\n submitReportHandler: (formValues: any, submitFunction: (reportData: any) => Promise) => Promise,\r\n\r\n /** Example: \"flytwatch.historical-reporting.criteria-form\" */\r\n persistenceName: string,\r\n reportType: string,\r\n\r\n /**\r\n * Converts JSON values stored in local storage back to the format that the form expect.\r\n * For example: convert startDateTime and endDateTime fields from an ISO string to a moment() object\r\n */\r\n convertPersistentFormData?: (unconverted: any, updateTs: any) => any\r\n}\r\n\r\ninterface ReducerState {\r\n autoRefreshMode?: boolean,\r\n reportId: string,\r\n autoRefreshInterval: number\r\n}\r\n\r\nconst ACTION_TYPES = {\r\n SET_AUTO_REFRESH_INTERVAL: 'SET_AUTO_REFRESH_INTERVAL',\r\n SET_AUTO_REFRESH_MODE: 'SET_AUTO_REFRESH_MODE'\r\n}\r\n\r\nfunction reducer(state: ReducerState, type: string, payload: any){\r\n console.debug('reducer called', state, type, payload);\r\n switch (type){\r\n case ACTION_TYPES.SET_AUTO_REFRESH_INTERVAL:\r\n return {\r\n ...state,\r\n autoRefreshInterval: payload\r\n }\r\n case ACTION_TYPES.SET_AUTO_REFRESH_MODE:\r\n return {\r\n ...state,\r\n autoRefreshMode: payload\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst DEFAULT_STATE: ReducerState = {\r\n autoRefreshMode: false,\r\n reportId: null,\r\n autoRefreshInterval: 30000\r\n}\r\n\r\nexport const ReportUIContextProvider: React.FC> = (props) => {\r\n const [ state, dispatch ] = useReducer(getGenericStateReducer(reducer), DEFAULT_STATE);\r\n const { transporterID } = useContext(OrgDataContext);\r\n \r\n const formRef: any = useRef();\r\n \r\n const { lastUpdate, persistentData, setPersistentValues, updateTs } = usePersistence(props.persistenceName);\r\n \r\n const criteriaFormFields = persistentData?.formData ? props.convertPersistentFormData(persistentData.formData, updateTs) : undefined;\r\n\r\n let reportSubmitting = false;\r\n\r\n let reportName: string;\r\n let criteria: any;\r\n\r\n let autoRefreshMode = persistentData?.autoRefreshMode;\r\n\r\n if (autoRefreshMode){\r\n if (!formRef.current){\r\n console.error('formRef REQUIRED to use autoRefreshMode');\r\n }\r\n else\r\n {\r\n formRef.current.validateFieldsAndScroll((err, values) => {\r\n console.debug('updating criteria', values);\r\n if (!err){\r\n props.submitReportHandler(\r\n values,\r\n async (options) => {\r\n reportName = options.name;\r\n criteria = options.criteria;\r\n return true\r\n }\r\n );\r\n }\r\n })\r\n }\r\n }\r\n\r\n let res1 = useQuickReportQuery(props.reportType, transporterID, reportName, criteria, {\r\n pollInterval: state.autoRefreshInterval,\r\n skip: !autoRefreshMode || !reportName || !criteria\r\n });\r\n\r\n let reportState = undefined;\r\n\r\n if (res1.loading){\r\n reportSubmitting = true;\r\n }\r\n\r\n if (autoRefreshMode && res1.networkStatus === NetworkStatus.loading){\r\n reportState = 'IN_PROGRESS';\r\n }\r\n else if (autoRefreshMode && res1.networkStatus === NetworkStatus.setVariables){\r\n reportState = 'IN_PROGRESS';\r\n }\r\n else if (autoRefreshMode && res1.error){\r\n reportState = 'QUERY_FAILED';\r\n }\r\n else if (autoRefreshMode && res1.networkStatus === NetworkStatus.ready){\r\n reportState = 'COMPLETE';\r\n }\r\n else if (autoRefreshMode && res1.networkStatus === NetworkStatus.poll){\r\n reportState = 'COMPLETE';\r\n reportSubmitting = true;\r\n }\r\n \r\n\r\n let reportDetails = useReportDetails(state.reportId, reportState);\r\n\r\n if (autoRefreshMode && res1.error){\r\n reportDetails.error = res1.error;\r\n }\r\n else if (autoRefreshMode && res1.networkStatus === NetworkStatus.ready && res1?.data?.run_quick_report){\r\n reportDetails = {...reportDetails}\r\n reportDetails.reportData = res1?.data?.run_quick_report;\r\n if (typeof reportDetails.reportData.result?.docs === 'string'){\r\n reportDetails.reportData.result.docs = JSON.parse(reportDetails.reportData.result.docs);\r\n }\r\n \r\n reportDetails.reportState = reportState;\r\n }\r\n\r\n let res2 = useReportSubmitter(props.reportType, transporterID, {\r\n onCompleted: ({ id }) => {\r\n console.log('Report submitted. report id: ' + id)\r\n dispatch({ newState: { reportId: id } })\r\n },\r\n onError: (error) => {\r\n console.error('Failed to submit report: ', error);\r\n message.error(\"Failed to submit report due to an error\");\r\n }\r\n });\r\n\r\n const submitReport = res2[0];\r\n if (res2[1]?.called && res2[1].loading){\r\n reportSubmitting = true;\r\n }\r\n\r\n return {\r\n \r\n // Check if each field value is equal. This prevents an infinite loop from happening.\r\n if (formFieldsValuesHaveChanged(criteriaFormFields, fields)){\r\n // setCriteriaFormFields(fields);\r\n setPersistentValues({ autoRefreshMode: autoRefreshMode, formData: fields });\r\n }\r\n },\r\n resetCriteriaForm: () => {\r\n // setCriteriaFormFields({});\r\n setPersistentValues({ autoRefreshMode: autoRefreshMode, formData: {} });\r\n },\r\n setAutoRefreshMode: (on) => {\r\n setPersistentValues({ formData: criteriaFormFields, autoRefreshMode: on });\r\n },\r\n formRef,\r\n reportID: state.reportId,\r\n submitReport: (formValues: any) => {\r\n\r\n dispatch({ newState: { reportId: null } })\r\n\r\n return props.submitReportHandler(formValues, submitReport);\r\n },\r\n reportSubmitting: reportSubmitting,\r\n reportDetails: reportDetails,\r\n autoRefreshMode: autoRefreshMode || false,\r\n setAutoRefreshInterval: (ms: number) => {\r\n if (typeof ms !== 'number') return;\r\n\r\n dispatch({ type: ACTION_TYPES.SET_AUTO_REFRESH_INTERVAL, payload: ms });\r\n }\r\n }}>\r\n {props.children}\r\n \r\n}","import gql from \"graphql-tag\";\r\n\r\nexport default gql`\r\nmutation SubmitReport(\r\n $name: String!\r\n $type: ReportType!\r\n $criteria: [ReportCriteriaInput!]!\r\n $tpID: ID!\r\n $contractIDs: [ID!]\r\n){\r\n run_report(\r\n name: $name\r\n type: $type\r\n criteria: $criteria\r\n tpID: $tpID\r\n contractIDs: $contractIDs\r\n )\r\n}\r\n`","import { Dropdown, Menu, Checkbox, Button } from 'antd';\r\nimport MCIcon from 'components/icon';\r\nimport { GlobalAppStateContext, McMapSettings } from 'context/global-app-state';\r\nimport React, { useContext, useEffect, useRef, useState } from 'react';\r\nimport ReactDOM, { createPortal } from 'react-dom';\r\nimport { ControlPosition, useControl } from 'react-map-gl';\r\nimport './style.less';\r\n\r\nexport interface McMapLayerDropdown {\r\n position?: ControlPosition\r\n}\r\n\r\nlet DEFAULT_SETTINGS: McMapSettings = {\r\n layers: {\r\n 'nexrad': {\r\n enabled: true\r\n }\r\n }\r\n}\r\n\r\nclass LayerDropdownControl {\r\n _map: any\r\n _container: HTMLDivElement\r\n\r\n constructor(container: HTMLDivElement){\r\n this._container = container;\r\n }\r\n\r\n onAdd(map){\r\n this._map = map;\r\n this._container.className = 'maplibregl-ctrl maplibregl-ctrl-group';\r\n return this._container;\r\n }\r\n\r\n onRemove(){\r\n this._container.parentNode.removeChild(this._container);\r\n this._map = undefined;\r\n }\r\n}\r\n\r\nconst McMapLayerDropdown: React.FC = React.forwardRef((props, ref: any) => {\r\n const { getUserSettings, setUserSettings } = useContext(GlobalAppStateContext);\r\n const [ layerDropdownVisible, setLayerDropDownVisible ] = useState(false);\r\n const [ divContainer, setDivContainer ] = useState(null);\r\n\r\n let uSettings = getUserSettings('mcMap');\r\n\r\n useControl(\r\n () => {\r\n const div = document.createElement('div');\r\n const control = new LayerDropdownControl(div);\r\n setDivContainer(div);\r\n return control;\r\n },\r\n {\r\n position: props.position\r\n }\r\n );\r\n\r\n let settings = {\r\n ...DEFAULT_SETTINGS,\r\n ...uSettings,\r\n layers: {\r\n ...DEFAULT_SETTINGS.layers,\r\n ...uSettings?.layers\r\n }\r\n };\r\n\r\n function toggleLayer(id: string){\r\n setUserSettings('mcMap', {\r\n ...settings,\r\n layers: {\r\n ...settings.layers,\r\n [id]: {\r\n ...settings.layers[id],\r\n enabled: !settings.layers[id]?.enabled\r\n }\r\n }\r\n })\r\n }\r\n\r\n if (!divContainer) return;\r\n\r\n let dropdown = setLayerDropDownVisible(visible)}\r\n overlay={\r\n { p.domEvent.preventDefault(); toggleLayer(p.key); }}\r\n >\r\n \r\n \r\n Weather Radar (NEXRAD)\r\n \r\n \r\n \r\n }>\r\n \r\n \r\n\r\n return createPortal(dropdown, divContainer);\r\n})\r\n\r\nexport default McMapLayerDropdown","import { Button, Checkbox, Dropdown, Menu } from 'antd';\r\nimport MCIcon from 'components/icon';\r\nimport config from 'config';\r\nimport { GlobalAppStateContext, McMapSettings } from 'context/global-app-state';\r\nimport React, { Ref, useContext, useEffect, useRef, useState } from 'react';\r\nimport ReactMapGL, { FullscreenControl, Layer, MapProps, MapRef, NavigationControl, ScaleControl } from 'react-map-gl';\r\n// eslint-disable-next-line import/no-webpack-loader-syntax\r\nimport maplibregl, { AttributionControl } from 'maplibre-gl';\r\nimport McMapLayerDropdown from './layer-dropdown';\r\nimport './style.less';\r\nimport maplibreglWorker from 'maplibre-gl/dist/maplibre-gl-csp-worker';\r\n\r\n// @ts-ignore\r\nmaplibregl.workerClass = maplibreglWorker;\r\n\r\nconst availableLayers = config.reactmapgl.availableLayers;\r\n\r\n// react-map-gl component with built-in UI for navigation and changing layers\r\nexport interface McMapProps extends MapProps {\r\n ref?: Ref\r\n}\r\n\r\nconst McMap: React.FC = React.forwardRef((props, ref: Ref) => {\r\n\r\n const { getUserSettings } = useContext(GlobalAppStateContext);\r\n\r\n const settings = getUserSettings('mcMap');\r\n\r\n let attributions = [\r\n \"Iowa Environmental Mesonet\",\r\n \"MapLibre\",\r\n \"© OpenStreetMap contributers\",\r\n \"Improve this map\"\r\n ];\r\n\r\n function getDependencies(){\r\n let deps = [];\r\n if (!settings) return []\r\n Object.values(settings?.layers).forEach((layer: any) => {\r\n deps.push(layer.enabled);\r\n if (layer.config){\r\n deps.push(JSON.stringify(config));\r\n }\r\n })\r\n return deps\r\n }\r\n \r\n function getLayers(){\r\n let layers = [];\r\n \r\n availableLayers.forEach(layer => {\r\n let layerSetting = settings.layers[layer.id];\r\n if (layerSetting && (layerSetting.enabled || layer.permanent)){\r\n layers.push();\r\n }\r\n })\r\n \r\n return layers\r\n }\r\n \r\n let layers = React.useMemo(() => getLayers(), getDependencies())\r\n\r\n return

    \r\n \r\n \r\n \r\n \r\n \r\n {layers}\r\n {props.children}\r\n \r\n
    \r\n})\r\n\r\nMcMap.defaultProps = {\r\n \r\n}\r\n\r\nexport default McMap","import McMap from './mc-map';\r\n\r\nexport default McMap;","import McMap from 'common/mc-map';\r\nimport { McMapProps } from 'common/mc-map/mc-map';\r\nimport getGenericStateReducer from 'common/reducer/generic-state-reducer';\r\nimport React, { CSSProperties, Ref, useCallback, useEffect, useReducer } from 'react';\r\nimport { MapProps, MapRef } from 'react-map-gl';\r\n\r\nexport interface FlytWatchDetailsMapProps extends McMapProps {\r\n viewport?: {\r\n height: number,\r\n width: number\r\n },\r\n style?: CSSProperties,\r\n ref?: Ref\r\n}\r\n\r\ninterface ReducerState {\r\n viewport: any\r\n}\r\n\r\nconst ACTION_TYPES = {\r\n SET_VIEWPORT: 'SET_VIEWPORT'\r\n}\r\n\r\nconst DEFAULT_STATE: ReducerState = {\r\n viewport: {\r\n width: '100%',\r\n height: '100%',\r\n latitude: 28.592096591682588,\r\n longitude: -90.72440040014745,\r\n zoom: 6\r\n }\r\n}\r\n\r\nfunction reducer(state: ReducerState, type: string, payload: any){\r\n switch (type){\r\n case ACTION_TYPES.SET_VIEWPORT:\r\n return {\r\n ...state,\r\n viewport: {\r\n ...state.viewport,\r\n ...payload\r\n }\r\n }\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst FlytWatchDetailsMap: React.FC = React.forwardRef((props, ref: Ref) => {\r\n\r\n let [ state, dispatch ] = useReducer(getGenericStateReducer(reducer), DEFAULT_STATE)\r\n\r\n let viewport = {\r\n ...state.viewport,\r\n ...props.viewport\r\n }\r\n\r\n const handleMove = useCallback(({ viewState }) => {\r\n dispatch({ type: ACTION_TYPES.SET_VIEWPORT, payload: viewState });\r\n }, [])\r\n \r\n useEffect(() => {\r\n setTimeout(() => {\r\n dispatch({ type: ACTION_TYPES.SET_VIEWPORT, payload: {\r\n latitude: props.latitude,\r\n longitude: props.longitude,\r\n zoom: props.zoom || state.viewport.zoom,\r\n // transitionDuration: 5000,\r\n // transitionInterpolator: new FlyToInterpolator(),\r\n // transitionEasing: easeCubicOut\r\n } })\r\n }, 100)\r\n // eslint-disable-next-line\r\n }, [])\r\n\r\n return \r\n {props.children}\r\n \r\n})\r\n\r\nexport default FlytWatchDetailsMap;","import { MutationResult, QueryResult } from '@apollo/react-common';\r\nimport { useMutation, useQuery } from '@apollo/react-hooks';\r\nimport { Checkbox, Form, Icon, Input, InputNumber, message, Spin, Tooltip } from 'antd';\r\nimport { FormComponentProps } from 'antd/lib/form';\r\nimport { WrappedFormUtils } from 'antd/lib/form/Form';\r\nimport { ColumnProps } from 'antd/lib/table';\r\nimport { NetworkStatus } from 'apollo-client/core/networkStatus';\r\nimport { createFormField, createFormFields, getFieldKey, validateLabelInValue } from 'common/form';\r\nimport { cleanGraphQLErrorMsg, dateMtimeMtoMoment, dateMtimeMtoZuluStr, dateToZulu, detectInvalidDate, getMinuteDurationAsHrMin, getMomentIntervalsWithOverlaps, getPilotName, momentOrNull } from 'common/util';\r\nimport DateTimePicker, { DateTimePickerValue, strToDateTimePickerValue } from 'components/date-time-picker';\r\nimport EditableCell from 'components/editable-cell';\r\nimport ETable from 'components/enchanced-antd-table';\r\nimport ContractSelect from 'components/form/ContractSelect';\r\nimport LocationSelect from 'components/form/select/LocationSelect/LocationSelect2';\r\nimport PilotSelect from 'components/form/PilotSelect';\r\nimport { OrgDataContext } from 'context/orgData';\r\nimport { ThemeContext } from 'context/theme';\r\nimport gql from 'graphql-tag';\r\nimport useUserGroups from 'hooks/useUserGroups';\r\nimport moment, { Moment } from 'moment';\r\nimport React, { MutableRefObject, PropsWithChildren, useContext, useEffect, useMemo, useRef, useState } from 'react';\r\nimport uuid from 'uuid/v4';\r\nimport { dispatchFormDataToArray, formatDateTime, getTotalDurationHoursMinutes } from 'components/flytwatch/aircraft-history/util';\r\n\r\nexport interface FWHistoryEditorProps {\r\n aircraftID: string,\r\n flightDate: string,\r\n /**\r\n * By default, this component will use a context provider declared within itself to handle state.\r\n * However, if you need to handle this component's higher up in the hierarchy, set this to true.\r\n * Just make sure that you use the Provider component in a parent component when setting this to true.\r\n */\r\n useExternalContextProvider?: boolean,\r\n onFormFieldsChange?: (fields: any) => void,\r\n formFields?: any,\r\n onFieldReset?: (fieldName: string) => void,\r\n onDiscard?: () => void\r\n}\r\n\r\nexport interface FWHistoryEditorContextProps {\r\n data: Array,\r\n queryResult: QueryResult,\r\n formRef: MutableRefObject,\r\n newRecords: NewRecord[],\r\n // setNewRecordAdded: (id: string, added: boolean) => void,\r\n formData: any,\r\n setFormData: (data: any) => void,\r\n initFormData: any,\r\n\r\n // All new records that have data in them\r\n changedNewRecords: Set,\r\n\r\n // All new records that are completely blank\r\n notChangedNewRecords: Set,\r\n\r\n // Mapping of new record IDs to number of fields that were changed\r\n addableRecordsChangedFieldCount: Map,\r\n\r\n // Calls mutation and returns changedHistory and returns a promise with results\r\n approve: () => Promise<{ changedHistory: any[], deletedHistoryIDs: string[] }>,\r\n\r\n // Calls mutation and returns deletedHistoryIDs and returns a promise with results\r\n remove: () => Promise<{ deletedHistoryIDs: string[] }>,\r\n\r\n approveMutationResult: MutationResult,\r\n deleteMutationResult: MutationResult,\r\n isApproved?: boolean\r\n}\r\n\r\nexport const FWHistoryEditorContext = React.createContext(null);\r\n\r\nexport interface FWHistoryEditorContextProviderProps {\r\n aircraftID: string,\r\n flightDate: string,\r\n numNewEmptyRows?: number,\r\n onApproved?: (flightDate: string) => void,\r\n onDiscard?: () => void\r\n}\r\n\r\nconst QUERY = gql`\r\nquery DispatchHistoryFlights($aircraftID: ID!, $dateStart: AWSDateTime!, $dateEnd: AWSDateTime!, $tpID: ID!) {\r\n DispatchHistoryFlights(aircraftID: $aircraftID, dateStart: $dateStart, dateEnd: $dateEnd, tpID: $tpID, limit: 1000) {\r\n bookmark\r\n warning\r\n warningCode\r\n docs {\r\n _id\r\n ... on DispatchHistory {\r\n _id\r\n name\r\n ato\r\n eta\r\n ata\r\n pob\r\n scheduledFlightDate\r\n approvedBy\r\n dispatchDoc {\r\n _id\r\n getTzAbbr\r\n }\r\n aircraftDoc {\r\n _id\r\n tailNum\r\n }\r\n contractID\r\n contractDoc {\r\n _id\r\n name\r\n }\r\n departingID\r\n departingDoc {\r\n _id\r\n name\r\n areaBlockName\r\n }\r\n destinationID\r\n destinationDoc {\r\n _id\r\n name\r\n areaBlockName\r\n }\r\n pilotID\r\n pilotDoc {\r\n _id\r\n name {\r\n firstName\r\n lastName\r\n }\r\n }\r\n coPilotID\r\n coPilotDoc {\r\n _id\r\n name {\r\n firstName\r\n lastName\r\n }\r\n }\r\n _r_latestRemark {\r\n remark\r\n remarkTime\r\n }\r\n remark {\r\n remark\r\n remarkTime\r\n }\r\n getTzAbbr\r\n }\r\n }\r\n }\r\n getAircraft(_id: $aircraftID){\r\n _id\r\n tailNum\r\n }\r\n}\r\n`\r\n\r\nconst MUTATION_APPROVE = gql`\r\nmutation ApproveDispatchHistory(\r\n $aircraftID: ID!\r\n $startTime: AWSDateTime!\r\n $endTime: AWSDateTime!\r\n $changedHistory: [ApproveDispatchFlightHistoryInput!]\r\n $deleteHistoryIDs: [ID!]\r\n $tpID: ID!\r\n $tzAbbr: String!\r\n){\r\n ApproveDispatchFlightHistory(\r\n aircraftID: $aircraftID,\r\n startTime: $startTime,\r\n endTime: $endTime,\r\n tpID: $tpID,\r\n changedHistory: $changedHistory,\r\n deleteHistoryIDs: $deleteHistoryIDs,\r\n tzAbbr: $tzAbbr\r\n ){\r\n changedOrAdded {\r\n _id\r\n name\r\n ato\r\n eta\r\n ata\r\n pob\r\n aircraftDoc {\r\n _id\r\n tailNum\r\n }\r\n contractID\r\n contractDoc {\r\n _id\r\n name\r\n }\r\n departingDoc {\r\n _id\r\n name\r\n areaBlockName\r\n }\r\n destinationDoc {\r\n _id\r\n name\r\n areaBlockName\r\n }\r\n pilotDoc {\r\n _id\r\n name {\r\n firstName\r\n lastName\r\n }\r\n }\r\n coPilotDoc {\r\n _id\r\n name {\r\n firstName\r\n lastName\r\n }\r\n }\r\n _r_latestRemark {\r\n remark\r\n remarkTime\r\n }\r\n }\r\n deletedIDs\r\n }\r\n}\r\n`\r\n\r\nconst MUTATION_DELETE = gql`\r\nmutation ApproveDispatchHistory(\r\n $deleteHistoryIDs: [ID!]\r\n $tzAbbr: String!\r\n){\r\n DeleteDispatchFlightHistory(\r\n deleteHistoryIDs: $deleteHistoryIDs,\r\n tzAbbr: $tzAbbr\r\n ){\r\n deletedIDs\r\n }\r\n}\r\n`\r\n\r\ninterface NewRecord {\r\n _id: string,\r\n new: boolean,\r\n added: boolean\r\n}\r\n\r\nconst FormValueGetters = {\r\n dep: (record) => ({ key: record.departingDoc?._id, label: record.departingDoc?.areaBlockName }),\r\n dest: (record) => ({ key: record.destinationDoc?._id, label: record.destinationDoc?.areaBlockName }),\r\n ato: (record) => strToDateTimePickerValue(record.ato),\r\n ata: (record) => strToDateTimePickerValue(record.ata),\r\n pob: (record) => record.pob || 0,\r\n contract: (record) => ({ key: record.contractDoc?._id, label: record.contractDoc?.name }),\r\n pilot: (record) => ({ key: record.pilotDoc?._id, label: getPilotName(record.pilotDoc) }),\r\n coPilot: (record) => ({ key: record.coPilotDoc?._id, label: getPilotName(record.coPilotDoc) }),\r\n remarks: (record) => record.remarks\r\n}\r\n\r\nconst FormValueGettersNewRecords = {\r\n dep: () => ({ key: '' }),\r\n dest: () => ({ key: '' }),\r\n ato: (lastRecord) => ({ date: momentOrNull(lastRecord?.ato) }),\r\n ata: (lastRecord) => ({ date: momentOrNull(lastRecord?.ata) }),\r\n pob: () => 0,\r\n contract: (lastRecord) => ({ key: lastRecord?.contractDoc?._id, label: lastRecord?.contractDoc?.name }),\r\n pilot: (lastRecord) => ({ key: lastRecord?.pilotDoc?._id, label: getPilotName(lastRecord?.pilotDoc) }),\r\n coPilot: (lastRecord) => ({ key: lastRecord?.coPilotDoc?._id, label: getPilotName(lastRecord?.coPilotDoc) }),\r\n remarks: () => ''\r\n}\r\n\r\nfunction genNewRecordId(){\r\n return 'new-' + uuid()\r\n}\r\n\r\n/**\r\n * Finds index of the last row that is partially filled out\r\n */\r\n function lastFilledRecordIdx(form: WrappedFormUtils, newRecords: NewRecord[]){\r\n let fieldValues = form?.getFieldsValue() || {}; // Sometimes form is null on first render. Need to check for that.\r\n let fieldKeys = Object.keys(fieldValues);\r\n\r\n for (let i = newRecords.length-1; i !== 0; i--){\r\n let r = newRecords[i];\r\n for (let j = 0; j < fieldKeys.length; j++){\r\n let k = fieldKeys[j];\r\n\r\n if (k.startsWith(r._id) && (k.endsWith('add') || k.endsWith('pob') || k.endsWith('contract') || k.endsWith('pilot') || k.endsWith('coPilot'))){\r\n continue\r\n }\r\n\r\n if (k.startsWith(r._id) && (k.endsWith('ato') || k.endsWith('ata'))){\r\n if (fieldValues[k]?.time){\r\n return i\r\n }\r\n else{\r\n continue\r\n }\r\n }\r\n if (k.startsWith(r._id) && getFieldKey(fieldValues[k])){\r\n return i\r\n }\r\n }\r\n }\r\n\r\n return -1\r\n}\r\n\r\nfunction initNewRecords(len: number): Map{\r\n let data = new Map();\r\n\r\n for (let i = 0; i < len; i++){\r\n let newR = {\r\n \"_id\": genNewRecordId(),\r\n \"new\": true,\r\n \"added\": false\r\n }\r\n data.set(newR._id, newR);\r\n }\r\n\r\n return data\r\n}\r\n\r\n/**\r\n * Builds a list of all new records where the value of each field has changed by the user.\r\n * @param formState Current state of the form fields\r\n * @param initFormState Initial state of the form fields (will be checked against by formState)\r\n * @param sideValues Other results computed, such as notChangedNewRecords (inverse of the main return)\r\n * @returns Set of all ids of the new records\r\n */\r\nfunction getChangedNewRecordIDs(formState: any, initFormState: any, sideValues?: {\r\n notAddableRecords: Set,\r\n addableRecordsChangedFieldCount: Map\r\n}){\r\n let formStateEntries = Object.entries(formState || {});\r\n\r\n // Build a list of all row ids\r\n let uniqueIDs = new Set();\r\n\r\n // Build a list of all fieldNames to look for\r\n let uniqueFields = new Set();\r\n\r\n for (let i = 0; i < formStateEntries.length; i++) {\r\n const [ key ] = formStateEntries[i];\r\n let id = key.split(\"::\")[0]\r\n let fieldName = key.split(\"::\")[1]\r\n uniqueIDs.add(id);\r\n uniqueFields.add(fieldName);\r\n }\r\n\r\n uniqueFields.delete('add')\r\n\r\n let addableRecordIds = new Set();\r\n\r\n let uniqueIDsArray = Array.from(uniqueIDs);\r\n let uniqueFieldsArray = Array.from(uniqueFields);\r\n\r\n for (let i = 0; i < uniqueIDsArray.length; i++) {\r\n const id = uniqueIDsArray[i]\r\n\r\n let isAddable = false;\r\n\r\n let fieldCountMap = new Map();\r\n\r\n for (let j = 0; j < uniqueFieldsArray.length; j++) {\r\n const fieldName = uniqueFieldsArray[j];\r\n \r\n // Does this id and field combination have a different value from initial?\r\n if (formState[id + \"::\" + fieldName]?.value !== initFormState[id + \"::\" + fieldName]){\r\n addableRecordIds.add(id);\r\n isAddable = true;\r\n\r\n if (sideValues){\r\n fieldCountMap[id] = (fieldCountMap[id] || 0) + 1;\r\n }\r\n }\r\n }\r\n\r\n if (isAddable === false && sideValues?.notAddableRecords){\r\n sideValues.notAddableRecords.add(id);\r\n }\r\n\r\n if (sideValues){\r\n sideValues.addableRecordsChangedFieldCount = fieldCountMap\r\n }\r\n\r\n }\r\n\r\n return addableRecordIds\r\n}\r\n\r\nexport const FWHistoryEditorContextProvider: React.FC> = props => {\r\n\r\n const orgData = useContext(OrgDataContext);\r\n\r\n const formRef = useRef(null);\r\n const [ newRecords, setNewRecords ] = useState(initNewRecords(props.numNewEmptyRows))\r\n const [ formData, setFormData ] = useState({});\r\n const [ initFormData, setInitFormData ] = useState({});\r\n const [ approved, setApproved ] = useState(false);\r\n\r\n // Expand and shrink the newRecords array depending on if the last record is filled in or not\r\n useEffect(() => {\r\n let newRecordsArray = Array.from(newRecords.values());\r\n let lastFilledRecord = lastFilledRecordIdx(formRef.current, newRecordsArray);\r\n\r\n if (lastFilledRecord === newRecords.size-1){\r\n // Add a new empty row\r\n let n = {\r\n \"_id\": genNewRecordId(),\r\n \"added\": false,\r\n \"new\": true\r\n }\r\n let newRecordsCopy = new Map(newRecords);\r\n newRecordsCopy.set(n._id, n);\r\n setNewRecords(newRecordsCopy);\r\n }\r\n\r\n if (newRecords.size > props.numNewEmptyRows && lastFilledRecord < newRecords.size-2){\r\n // There are extra empty rows that can be removed\r\n let entries = Array.from(newRecords.entries());\r\n\r\n let newRecordsCopy = new Map(newRecords);\r\n let deleteOccurred = false;\r\n\r\n for (let i = Math.max(props.numNewEmptyRows, lastFilledRecord+1); i < entries.length; i++){\r\n let key = entries[i][0];\r\n newRecordsCopy.delete(key);\r\n deleteOccurred = true;\r\n }\r\n \r\n if (deleteOccurred){\r\n setNewRecords(newRecordsCopy);\r\n }\r\n }\r\n // eslint-disable-next-line\r\n }, [newRecords, formData])\r\n\r\n let sideValues = {\r\n notAddableRecords: new Set(),\r\n addableRecordsChangedFieldCount: new Map()\r\n }\r\n\r\n // getChangedNewRecordIDs should be recalculated only when the form changes (i hope)\r\n // eslint-disable-next-line\r\n let changedNewRecords = useMemo(() => getChangedNewRecordIDs(formData, initFormData, sideValues), [ formData, initFormData ]);\r\n let notChangedNewRecords = sideValues.notAddableRecords;\r\n\r\n let queryVars = {\r\n aircraftID: props.aircraftID,\r\n dateStart: dateToZulu(moment(props.flightDate)),\r\n dateEnd: dateToZulu(moment(props.flightDate).add(1, 'day')),\r\n tpID: orgData.getOrgIDByType('transporter')\r\n }\r\n\r\n const result = useQuery(QUERY, {\r\n variables: queryVars,\r\n skip: !props.flightDate,\r\n fetchPolicy: 'cache-and-network',\r\n errorPolicy: 'all',\r\n pollInterval: 15000,\r\n onError: (err) => {\r\n let notFoundAircraft = err.graphQLErrors.find(e => e.path?.[0] === \"getAircraft\" && e.errorType === \"404\");\r\n // We cannot deal with flight history with an aircraft that doesn't exist! Get out of here!\r\n if (notFoundAircraft){\r\n message.error(\"This aircraft could not be found in the database. Exiting this page...\");\r\n props.onDiscard(); // We have no business being here\r\n }\r\n }\r\n })\r\n\r\n const [ approveMutation, approveMutationRes ] = useMutation(MUTATION_APPROVE);\r\n\r\n const [ deleteMutation, deleteMutationRes ] = useMutation(MUTATION_DELETE);\r\n\r\n let hisData: any[] = result.data?.DispatchHistoryFlights?.docs || [];\r\n\r\n // Show only the historical data\r\n hisData = hisData.filter((doc) => String(doc._id).endsWith(\"--HIST\"))\r\n\r\n hisData.sort((a, b) => {\r\n if (a.ato < b.ato){\r\n return -1;\r\n }\r\n else if (a.ato === b.ato){\r\n return 0;\r\n }\r\n else {\r\n return 1;\r\n }\r\n })\r\n\r\n let hisTzAbbr = null;\r\n if (hisData.length > 0){\r\n for (let i = 0; i < hisData.length; i++) {\r\n if (hisData[i]?.dispatchDoc){\r\n hisTzAbbr = hisData[i].dispatchDoc.getTzAbbr\r\n break;\r\n }\r\n else\r\n {\r\n hisTzAbbr = hisData[i].getTzAbbr\r\n }\r\n } \r\n }\r\n\r\n useEffect(() => {\r\n if (approved){\r\n props.onApproved?.(dateToZulu(hisData[0].ato));\r\n }\r\n // eslint-disable-next-line\r\n }, [ approved ])\r\n\r\n // Simplify remarks field\r\n let tableData = hisData.map((item) => ({\r\n ...item,\r\n remarks: item._r_latestRemark?.remark\r\n }))\r\n\r\n let lastRecord = tableData[tableData.length-1]\r\n\r\n function toFormData(){\r\n let data = {};\r\n hisData.forEach((record: any) => {\r\n Object.entries(FormValueGetters).forEach(([key, func]) => {\r\n let dataKey = buildFieldKey(record, key);\r\n let dataValue = func(record);\r\n data[dataKey] = createFormField(dataValue);\r\n })\r\n })\r\n newRecords.forEach((record: any) => {\r\n Object.entries(FormValueGettersNewRecords).forEach(([key, func]) => {\r\n let dataKey = buildFieldKey(record, key);\r\n let dataValue = func(lastRecord);\r\n data[dataKey] = createFormField(dataValue);\r\n })\r\n })\r\n return data\r\n }\r\n\r\n useEffect(() => {\r\n if (result.networkStatus === NetworkStatus.ready || result.networkStatus === NetworkStatus.loading){\r\n setInitFormData(toFormData())\r\n }\r\n // eslint-disable-next-line\r\n }, [result.networkStatus, newRecords])\r\n\r\n if (!result) return null\r\n\r\n return {\r\n return new Promise(async (resolve, reject) => {\r\n let deletedIDs = [];\r\n if (Object.keys(formData).length > 0){\r\n dispatchFormDataToArray(formData)\r\n .forEach((item) => {\r\n if (item.remove){\r\n deletedIDs.push(item._id);\r\n return false\r\n }\r\n return true\r\n })\r\n }\r\n\r\n if (!deletedIDs){\r\n message.error(\"Cannot delete. There is nothing to delete.\");\r\n return;\r\n }\r\n\r\n deleteMutation({\r\n variables: {\r\n tzAbbr: hisTzAbbr,\r\n deleteHistoryIDs: deletedIDs.length > 0 ? deletedIDs : undefined\r\n },\r\n update: (cache, result) => {\r\n cache.writeQuery({\r\n query: QUERY,\r\n variables: queryVars,\r\n data: {\r\n ...result.data,\r\n DispatchHistoryFlights: {\r\n ...result.data.DispatchHistoryFlights,\r\n docs: hisData.filter((record) => !deletedIDs.includes(record._id) )\r\n }\r\n }\r\n })\r\n }\r\n })\r\n .then((res) => {\r\n resolve(res.data);\r\n })\r\n .catch((err) => {\r\n reject(err);\r\n if (String(err.message).includes('permission')){\r\n message.error(cleanGraphQLErrorMsg(err.message));\r\n }\r\n else\r\n {\r\n message.error(\"Failed to delete due to an error\")\r\n }\r\n })\r\n })\r\n },\r\n approve: () => {\r\n const findHis = (id) => (his) => his._id === id\r\n return new Promise(async (resolve, reject) => {\r\n let changedData: any[] = undefined;\r\n let deletedIDs = [];\r\n if (Object.keys(formData).length > 0){\r\n changedData = dispatchFormDataToArray(formData)\r\n .filter((item) => {\r\n if (item.remove){\r\n deletedIDs.push(item._id);\r\n return false\r\n }\r\n return true\r\n })\r\n .map((item) => {\r\n return {\r\n _id: item._id,\r\n ata: detectInvalidDate(\r\n dateMtimeMtoZuluStr(item.ata.date, item.ata.time),\r\n hisData.find(findHis(item._id))?.ata\r\n ),\r\n ato: detectInvalidDate(\r\n dateMtimeMtoZuluStr(item.ato.date, item.ato.time),\r\n hisData.find(findHis(item._id))?.ato\r\n ),\r\n contractID: item.contract?.key,\r\n departingID: item.dep?.key,\r\n destinationID: item.dest?.key,\r\n pilotID: item.pilot?.key,\r\n coPilotID: item.coPilot?.key,\r\n pob: item.pob,\r\n remark: item.remarks\r\n }\r\n })\r\n }\r\n if (!hisTzAbbr){\r\n message.error(\"Cannot approve. This flight history has no timezone information.\")\r\n return;\r\n }\r\n approveMutation({\r\n variables: {\r\n aircraftID: props.aircraftID,\r\n startTime: dateToZulu(moment(props.flightDate)),\r\n endTime: dateToZulu(moment(props.flightDate).add(1, 'day')),\r\n tpID: orgData.getOrgIDByType('transporter'),\r\n tzAbbr: hisTzAbbr,\r\n changedHistory: changedData,\r\n deleteHistoryIDs: deletedIDs.length > 0 ? deletedIDs : undefined\r\n }\r\n })\r\n .then((res) => {\r\n resolve(res.data);\r\n setApproved(true);\r\n })\r\n .catch((err) => {\r\n reject(err);\r\n if (String(err.message).includes('permission')){\r\n message.error(cleanGraphQLErrorMsg(err.message));\r\n }\r\n else\r\n {\r\n message.error(\"Failed to submit approval due to an error\")\r\n }\r\n })\r\n })\r\n },\r\n approveMutationResult: approveMutationRes,\r\n deleteMutationResult: deleteMutationRes,\r\n isApproved: approved\r\n // setNewRecordAdded: (id: string, added: boolean) => {\r\n // let modifiedNewRecs = new Map(newRecords);\r\n // if (modifiedNewRecs.has(id)){\r\n // modifiedNewRecs.get(id).added = added || false\r\n // }\r\n // else\r\n // {\r\n // modifiedNewRecs.set(id,\r\n // {\r\n // \"_id\": genNewRecordId(),\r\n // \"added\": added || false,\r\n // \"new\": true\r\n // }\r\n // )\r\n // }\r\n\r\n // setNewRecords(modifiedNewRecs);\r\n // }\r\n }}>\r\n {props.children}\r\n \r\n}\r\n\r\nFWHistoryEditorContextProvider.defaultProps = {\r\n numNewEmptyRows: 5\r\n}\r\n\r\nfunction validateDateTimePicker(rule, value: DateTimePickerValue, callback){\r\n if (rule.required && !value){\r\n callback(rule.message)\r\n }\r\n else if (!value.date){\r\n callback('Please enter a date')\r\n }\r\n else if (!value.time){\r\n callback('Please enter a time')\r\n }\r\n else\r\n {\r\n callback()\r\n }\r\n}\r\n\r\nclass AtoAtaMap extends Map{\r\n put(id: string, ato?: Moment, ata?: Moment){\r\n if (this.has(id)){\r\n let val = this.get(id);\r\n if (ata)\r\n val.ata = ata;\r\n if (ato)\r\n val.ato = ato;\r\n }\r\n else\r\n {\r\n super.set(id, { ato, ata })\r\n }\r\n }\r\n}\r\n\r\nfunction validateReverseTimeRange(form: WrappedFormUtils, docID: string, fieldType: 'ato' | 'ata'){\r\n return (_, value, callback) => {\r\n let ato: Moment, ata: Moment;\r\n if (fieldType === 'ato'){\r\n ato = dateMtimeMtoMoment(value);\r\n ata = dateMtimeMtoMoment(form.getFieldValue(buildFieldKey(docID, 'ata')));\r\n }\r\n else\r\n {\r\n ato = dateMtimeMtoMoment(form.getFieldValue(buildFieldKey(docID, 'ato')));\r\n ata = dateMtimeMtoMoment(value);\r\n }\r\n\r\n // Seconds don't matter\r\n ato.set({ seconds: 0, ms: 0 });\r\n ata.set({ seconds: 0, ms: 1 });\r\n\r\n if (ato && ata){\r\n if (fieldType === 'ata' && ata.isBefore(ato)){\r\n console.debug('ATA cannot be before ATO.', ato.format(), ata.format());\r\n callback('ATA cannot be before ATO.');\r\n return\r\n }\r\n else if (fieldType === 'ato' && ato.isAfter(ata)){\r\n console.debug('ATO cannot be after ATA.', ato.format(), ata.format());\r\n callback('ATO cannot be after ATA.');\r\n return\r\n }\r\n }\r\n callback();\r\n }\r\n}\r\n\r\nfunction validateTimeOverlaps(form: WrappedFormUtils, docID: string, fieldType: 'ata' | 'ato'){\r\n return (_, value, callback) => {\r\n\r\n let atoAtaMap = new AtoAtaMap();\r\n let allValuesEntries = Object.entries(form.getFieldsValue());\r\n\r\n for (let i = 0; i < allValuesEntries.length; i++) {\r\n const [ k, v ] = allValuesEntries[i];\r\n let splitK = k.split('::');\r\n let fieldName: string;\r\n if (splitK.length > 1){\r\n fieldName = splitK[1];\r\n }\r\n\r\n if (form.getFieldValue(splitK[0] + '::remove')){\r\n continue\r\n }\r\n\r\n // Skip if is a new record and is not added\r\n if ((fieldName === 'ato' || fieldName === 'ata') && k.startsWith('new') && !form.getFieldValue(splitK[0] + '::add')){\r\n continue\r\n }\r\n if (fieldName === 'ato'){\r\n atoAtaMap.put(splitK[0], dateMtimeMtoMoment(v));\r\n }\r\n if (fieldName === 'ata'){\r\n atoAtaMap.put(splitK[0], undefined, dateMtimeMtoMoment(v));\r\n }\r\n }\r\n\r\n let currAtoAta = atoAtaMap.get(docID); // Get a ref of the current ato and ata before we remove it from the map\r\n\r\n let docIDToIntervalIdxMap = new Map();\r\n\r\n // Convert to list of time ranges\r\n let timeRanges: Array<[Moment, Moment]> = Array.from(atoAtaMap.entries())\r\n .map(([docId, { ato, ata }], i) => {\r\n docIDToIntervalIdxMap.set(docId, i);\r\n return [ato, ata];\r\n });\r\n\r\n // If we are ato, find the ata, and vice versa\r\n let ato: Moment, ata: Moment;\r\n if (fieldType === 'ato'){\r\n ato = dateMtimeMtoMoment(value);\r\n ata = currAtoAta?.ata\r\n }\r\n else\r\n {\r\n ata = dateMtimeMtoMoment(value);\r\n ato = currAtoAta?.ato\r\n }\r\n if (!ata){\r\n callback('Please enter a corresponding ATA');\r\n return\r\n }\r\n else if (!ato){\r\n callback('Please enter a corresponding ATO');\r\n return\r\n }\r\n \r\n let overlappingIntervals = getMomentIntervalsWithOverlaps(timeRanges);\r\n\r\n let currentIntervalIdx = docIDToIntervalIdxMap.get(docID) || -1;\r\n\r\n if (overlappingIntervals.get(currentIntervalIdx) === 0 && fieldType === 'ato'){\r\n callback('Overlapping ATA detected!');\r\n }\r\n else if (overlappingIntervals.get(currentIntervalIdx) === 1 && fieldType === 'ata'){\r\n callback('Overlapping ATO detected!');\r\n }\r\n else {\r\n callback()\r\n }\r\n }\r\n}\r\n\r\nfunction buildFieldKey(record: any, fieldName: string){\r\n let id: string;\r\n if (typeof record === 'object'){\r\n id = record._id;\r\n }\r\n else{\r\n id = record;\r\n }\r\n return id + '::' + fieldName\r\n}\r\n\r\nfunction validateRow(enable: boolean, additionalValidator?: Function){\r\n return (rule, value, callback) => {\r\n if (enable && rule.required && !getFieldKey(value)){\r\n console.debug('Field validation failed: ' + rule.message)\r\n callback(rule.message)\r\n }\r\n else if (enable && additionalValidator){\r\n additionalValidator(rule, value, callback);\r\n }\r\n else\r\n {\r\n callback()\r\n }\r\n }\r\n}\r\n\r\nconst FWHistoryEditor_Internal: React.FC = (props) => {\r\n const { form: { getFieldDecorator, getFieldValue, resetFields, setFieldsValue } } = props;\r\n\r\n let { data, newRecords, changedNewRecords, notChangedNewRecords, initFormData, formData, setFormData, queryResult } = React.useContext(FWHistoryEditorContext);\r\n const [ userGroups ] = useUserGroups();\r\n\r\n const userCanEdit = userGroups.includes('flytsuite.flytwatch.history.edit');\r\n const userCanDelete = userGroups.includes('flytsuite.flytwatch.history.delete');\r\n const { themeName } = useContext(ThemeContext);\r\n\r\n function renderFlightDuration(_, record) {\r\n let ato = dateMtimeMtoMoment(getFieldValue(buildFieldKey(record, 'ato')));\r\n let ata = dateMtimeMtoMoment(getFieldValue(buildFieldKey(record, 'ata')));\r\n \r\n if (!ata || !ato) return null;\r\n \r\n return getMinuteDurationAsHrMin(ato, ata);\r\n }\r\n\r\n useEffect(() => {\r\n notChangedNewRecords.forEach((id) => {\r\n if (getFieldValue(id + '::add')){\r\n setFieldsValue({\r\n [id + '::add']: false\r\n })\r\n }\r\n })\r\n // eslint-disable-next-line\r\n }, [ notChangedNewRecords.size ])\r\n\r\n function resetField(record: any, fieldName: string){\r\n let key = buildFieldKey(record, fieldName);\r\n resetFields([key])\r\n setFormData({\r\n ...formData,\r\n [key]: initFormData[key]\r\n })\r\n props.onFieldReset?.(key);\r\n }\r\n\r\n function isRecordAdded(record: any){\r\n let id = record?._id;\r\n if (!id) return false\r\n if (formData[id + '::add']?.value)\r\n return true\r\n else\r\n return false\r\n }\r\n\r\n const handleNewRecordFieldChange = (id: string) => {\r\n if (!changedNewRecords.has(id)){\r\n setFieldsValue({\r\n [id + '::add']: true\r\n })\r\n }\r\n }\r\n\r\n function isRecordRemoved(record: any){\r\n return formData[buildFieldKey(record, 'remove')]?.value === true;\r\n }\r\n\r\n let columns: ColumnProps[] = [\r\n {\r\n key: 'flt',\r\n title: 'FLT',\r\n width: 40,\r\n render: (_,__,i) => i+1\r\n },\r\n {\r\n key: 'aircraft',\r\n title: 'Aircraft',\r\n width: 80,\r\n render: (_, record) => record.aircraftDoc?.tailNum\r\n },\r\n {\r\n key: 'dep',\r\n title: 'Departing',\r\n width: 140,\r\n render: (_, record) => resetField(record, 'dep')}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'dep'), {\r\n rules: [ { required: true, message: 'Please select a departing location', validator: validateRow(!isRecordRemoved(record), validateLabelInValue) } ],\r\n initialValue: FormValueGetters.dep(record)\r\n })(\r\n \r\n )}\r\n \r\n \r\n },\r\n {\r\n key: 'dest',\r\n title: 'Destination',\r\n width: 140,\r\n render: (_, record) => resetField(record, 'dest')}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'dest'), {\r\n rules: [ { required: true, message: 'Please select a destination location', validator: validateRow(!isRecordRemoved(record), validateLabelInValue) } ],\r\n initialValue: FormValueGetters.dest(record)\r\n })(\r\n \r\n )}\r\n \r\n \r\n },\r\n {\r\n key: 'ato',\r\n title: 'ATO',\r\n width: 190,\r\n render: (_, record) => resetField(record, 'ato')}\r\n maxTextWidth={120}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'ato'), {\r\n rules: [\r\n { required: true, message: 'Please enter an ATO', validator: validateRow(!isRecordRemoved(record), validateDateTimePicker) },\r\n { validator: validateRow(!isRecordRemoved(record), validateTimeOverlaps(props.form, record._id, 'ato')) },\r\n { validator: validateRow(!isRecordRemoved(record), validateReverseTimeRange(props.form, record._id, 'ato')) }\r\n ],\r\n initialValue: FormValueGetters.ato(record)\r\n })(\r\n \r\n )}\r\n \r\n \r\n },\r\n {\r\n key: 'ata',\r\n title: 'ATA',\r\n width: 190,\r\n render: (_, record) => resetField(record, 'ata')}\r\n maxTextWidth={120}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'ata'), {\r\n rules: [\r\n { required: true, message: 'Please enter an ATA', validator: validateRow(!isRecordRemoved(record), validateDateTimePicker) },\r\n { validator: validateRow(!isRecordRemoved(record), validateTimeOverlaps(props.form, record._id, 'ata')) },\r\n { validator: validateRow(!isRecordRemoved(record), validateReverseTimeRange(props.form, record._id, 'ata')) }\r\n ],\r\n initialValue: FormValueGetters.ata(record)\r\n })(\r\n \r\n )}\r\n \r\n \r\n },\r\n {\r\n key: 'time',\r\n title: 'Time',\r\n width: 75,\r\n render: renderFlightDuration\r\n },\r\n {\r\n key: 'pob',\r\n title: 'POB',\r\n dataIndex: 'pob',\r\n width: 50,\r\n render: (value, record) => resetField(record, 'pob')}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'pob'), {\r\n rules: [ { required: true, message: 'Please enter POB', validator: validateRow(!isRecordRemoved(record)) } ],\r\n initialValue: FormValueGetters.pob(record)\r\n })(\r\n \r\n )}\r\n \r\n \r\n },\r\n {\r\n key: 'contract',\r\n title: 'Contract',\r\n width: 180,\r\n render: (_, record) => resetField(record, 'contract')}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'contract'), {\r\n rules: [ { required: true, message: 'Please select a contract', validator: validateRow(!isRecordRemoved(record), validateLabelInValue) } ],\r\n initialValue: FormValueGetters.contract(record)\r\n })(\r\n \r\n )}\r\n \r\n \r\n },\r\n {\r\n key: 'pilot',\r\n title: 'Pilot',\r\n width: 180,\r\n render: (_, record) => resetField(record, 'pilot')}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'pilot'), {\r\n rules: [ { required: true, message: 'Please select a pilot', validator: validateRow(!isRecordRemoved(record), validateLabelInValue) } ],\r\n initialValue: FormValueGetters.pilot(record)\r\n })(\r\n \r\n )}\r\n \r\n \r\n },\r\n {\r\n key: 'coPilot',\r\n title: 'Co-Pilot',\r\n width: 180,\r\n render: (_, record) => resetField(record, 'coPilot')}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'coPilot'), {\r\n initialValue: FormValueGetters.coPilot(record)\r\n })(\r\n \r\n )}\r\n \r\n \r\n },\r\n {\r\n key: 'remarks',\r\n title: 'Remarks',\r\n dataIndex: 'remarks',\r\n width: 140,\r\n render: (value, record) => resetField(record, 'remarks')}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'remarks'), {\r\n initialValue: FormValueGetters.remarks(record)\r\n })(\r\n \r\n )}\r\n \r\n \r\n }\r\n ]\r\n\r\n if (userCanDelete){\r\n columns.unshift({\r\n key: 'remove',\r\n title: ,\r\n width: 33,\r\n render: (_, record) => getFieldDecorator(buildFieldKey(record, 'remove'), {\r\n valuePropName: 'checked'\r\n })(\r\n
    \r\n \r\n
    \r\n )\r\n })\r\n }\r\n else\r\n {\r\n columns.unshift({\r\n key: 'remove',\r\n title: ,\r\n width: 70,\r\n render: (_, record) => \r\n
    \r\n \r\n
    \r\n
    \r\n })\r\n }\r\n\r\n let lastRecord = data[data.length-1]\r\n\r\n let atoAtaList = []\r\n\r\n let fullData = [...data, ...newRecords];\r\n\r\n fullData.forEach(row => {\r\n\r\n // Exclude new records that are not checked\r\n if (row.new && !getFieldValue(buildFieldKey(row, 'add'))) return\r\n\r\n atoAtaList.push({\r\n ato: getFieldValue(buildFieldKey(row, 'ato')),\r\n ata: getFieldValue(buildFieldKey(row, 'ata'))\r\n })\r\n })\r\n\r\n return }>\r\n
    \r\n \r\n Total time
    \r\n Includes missing records\r\n
    ,\r\n colNum: 6,\r\n td: [
    ],\r\n sticky: true\r\n }}\r\n rowKey=\"_id\"\r\n size=\"small\"\r\n bordered\r\n columns={columns}\r\n stickyHeader\r\n pagination={false}\r\n />\r\n

    Add missing flight records

    \r\n getFieldDecorator(buildFieldKey(record, 'add'), {\r\n valuePropName: 'checked'\r\n })(\r\n \r\n )\r\n },\r\n {\r\n key: 'aircraft',\r\n title: 'Aircraft',\r\n width: 80,\r\n render: () => lastRecord?.aircraftDoc?.tailNum\r\n },\r\n {\r\n key: 'dep',\r\n title: 'Departing',\r\n width: 140,\r\n render: (_, record) => resetField(record, 'dep')}\r\n showChanges={false}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'dep'), {\r\n rules: [ { required: true, message: 'Please select a departing location', validator: validateRow(isRecordAdded(record)) } ],\r\n initialValue: FormValueGettersNewRecords.dep()\r\n })(\r\n handleNewRecordFieldChange(record._id)}\r\n disabled={!userCanEdit}\r\n />\r\n )}\r\n \r\n \r\n },\r\n {\r\n key: 'dest',\r\n title: 'Destination',\r\n width: 140,\r\n render: (_, record) => resetField(record, 'dest')}\r\n showChanges={false}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'dest'), {\r\n rules: [ { required: true, message: 'Please select a destination location', validator: validateRow(isRecordAdded(record)) } ],\r\n initialValue: FormValueGettersNewRecords.dest()\r\n })(\r\n handleNewRecordFieldChange(record._id)}\r\n disabled={!userCanEdit}\r\n />\r\n )}\r\n \r\n \r\n },\r\n {\r\n key: 'ato',\r\n title: 'ATO',\r\n width: 190,\r\n render: (_, record) => resetField(record, 'ato')}\r\n maxTextWidth={120}\r\n showChanges={false}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'ato'), {\r\n rules: [\r\n { required: true, message: 'Please enter an ATO', validator: validateRow(isRecordAdded(record), validateDateTimePicker) },\r\n { validator: validateRow(isRecordAdded(record), validateTimeOverlaps(props.form, record._id, 'ato')) },\r\n { validator: validateRow(isRecordAdded(record), validateReverseTimeRange(props.form, record._id, 'ato')) }\r\n ],\r\n initialValue: FormValueGettersNewRecords.ato(lastRecord)\r\n })(\r\n handleNewRecordFieldChange(record._id)}\r\n />\r\n )}\r\n \r\n \r\n },\r\n {\r\n key: 'ata',\r\n title: 'ATA',\r\n width: 190,\r\n render: (_, record) => resetField(record, 'ata')}\r\n maxTextWidth={120}\r\n showChanges={false}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'ata'), {\r\n rules: [\r\n { required: true, message: 'Please enter an ATA', validator: validateRow(isRecordAdded(record), validateDateTimePicker) },\r\n { validator: validateRow(isRecordAdded(record), validateTimeOverlaps(props.form, record._id, 'ata')) },\r\n { validator: validateRow(isRecordAdded(record), validateReverseTimeRange(props.form, record._id, 'ata')) }\r\n ],\r\n initialValue: FormValueGettersNewRecords.ata(lastRecord)\r\n })(\r\n handleNewRecordFieldChange(record._id)}\r\n />\r\n )}\r\n \r\n \r\n },\r\n {\r\n key: 'time',\r\n title: 'Time',\r\n width: 75,\r\n render: renderFlightDuration\r\n },\r\n {\r\n key: 'pob',\r\n title: 'POB',\r\n dataIndex: 'pob',\r\n width: 50,\r\n render: (value, record) => resetField(record, 'pob')}\r\n showChanges={false}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'pob'), {\r\n rules: [ { required: true, message: 'Please enter POB', validator: validateRow(isRecordAdded(record)) } ],\r\n initialValue: FormValueGettersNewRecords.pob()\r\n })(\r\n handleNewRecordFieldChange(record._id)}\r\n disabled={!userCanEdit}\r\n />\r\n )}\r\n \r\n \r\n },\r\n {\r\n key: 'contract',\r\n title: 'Contract',\r\n width: 180,\r\n render: (_, record) => resetField(record, 'contract')}\r\n showChanges={false}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'contract'), {\r\n rules: [ { required: true, message: 'Please select a contract', validator: validateRow(isRecordAdded(record)) } ],\r\n initialValue: FormValueGettersNewRecords.contract(lastRecord)\r\n })(\r\n handleNewRecordFieldChange(record._id)}\r\n disabled={!userCanEdit}\r\n />\r\n )}\r\n \r\n \r\n },\r\n {\r\n key: 'pilot',\r\n title: 'Pilot',\r\n width: 180,\r\n render: (_, record) => resetField(record, 'pilot')}\r\n showChanges={false}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'pilot'), {\r\n rules: [ { required: true, message: 'Please select a pilot', validator: validateRow(isRecordAdded(record)) } ],\r\n initialValue: FormValueGettersNewRecords.pilot(lastRecord)\r\n })(\r\n handleNewRecordFieldChange(record._id)}\r\n disabled={!userCanEdit}\r\n />\r\n )}\r\n \r\n \r\n },\r\n {\r\n key: 'coPilot',\r\n title: 'Co-Pilot',\r\n width: 180,\r\n render: (_, record) => resetField(record, 'coPilot')}\r\n showChanges={false}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'coPilot'), {\r\n initialValue: FormValueGettersNewRecords.coPilot(lastRecord)\r\n })(\r\n handleNewRecordFieldChange(record._id)}\r\n disabled={!userCanEdit}\r\n />\r\n )}\r\n \r\n \r\n },\r\n {\r\n key: 'remarks',\r\n title: 'Remarks',\r\n dataIndex: 'remarks',\r\n width: 140,\r\n render: (value, record) => resetField(record, 'remarks')}\r\n showChanges={false}\r\n >\r\n \r\n {getFieldDecorator(buildFieldKey(record, 'remarks'), {\r\n initialValue: FormValueGettersNewRecords.remarks()\r\n })(\r\n handleNewRecordFieldChange(record._id)}\r\n disabled={!userCanEdit}\r\n />\r\n )}\r\n \r\n \r\n }\r\n ]}\r\n pagination={false}\r\n />\r\n \r\n \r\n}\r\n\r\nconst FWHistoryEditorWithForm = Form.create({\r\n mapPropsToFields(props){\r\n if (!props.formFields) return;\r\n return createFormFields(props.formFields)\r\n },\r\n onFieldsChange(props, _, fields){\r\n props.onFormFieldsChange?.(fields);\r\n }\r\n})(FWHistoryEditor_Internal)\r\n\r\nlet FWHistoryEditor: React.FC = (props) => {\r\n\r\n function renderWithConsumer(){\r\n return \r\n {({ formRef, formData, setFormData }) => (\r\n {\r\n setFormData(fields);\r\n }}\r\n formFields={formData}\r\n onFieldReset={(fieldName) => {\r\n let newFormData = { ...formData }\r\n delete newFormData[fieldName]\r\n setFormData(newFormData);\r\n }}\r\n />\r\n )}\r\n \r\n }\r\n\r\n if (props.useExternalContextProvider){\r\n return renderWithConsumer()\r\n }\r\n else\r\n {\r\n return \r\n {renderWithConsumer()}\r\n \r\n }\r\n}\r\n\r\nFWHistoryEditor.displayName = 'FWHistoryEditor'\r\n\r\nexport default FWHistoryEditor","import { message, Select } from 'antd';\r\nimport { SelectProps } from 'antd/lib/select';\r\nimport { getZoneList } from 'common/util-ts';\r\nimport moment from 'moment-timezone';\r\nimport React, { useEffect, useState } from 'react';\r\n\r\nexport interface TimezonePickerProps extends SelectProps {\r\n date: string,\r\n noDST?: boolean\r\n}\r\n\r\nconst TimezonePicker: React.FC = (props) => {\r\n\r\n const { date, ...selectProps } = props;\r\n\r\n const [ data, setData ] = useState([]);\r\n\r\n const style = {\r\n width: '6rem',\r\n ...selectProps.style\r\n }\r\n\r\n useEffect(() => {\r\n let zoneData = getZoneList(date, props.noDST)\r\n setData(zoneData);\r\n }, [ date ])\r\n\r\n return \r\n}\r\n\r\nTimezonePicker.defaultProps = {\r\n noDST: false\r\n}\r\n\r\nexport default TimezonePicker","export default __webpack_public_path__ + \"static/media/map-arrow.97e7a1cd.svg\";","import { Alert } from 'antd';\r\nimport { NetworkStatus } from 'apollo-client';\r\nimport { castArray, dateToZulu, getDurationHoursMinutes, getPilotName } from 'common/util';\r\nimport { getTzNameFromDoc } from 'common/util-ts';\r\nimport CenteredLoadingScreen from 'components/CenteredLoadingScreen';\r\nimport ETable from 'components/enchanced-antd-table';\r\nimport NonIdealState from 'components/NonIdealState';\r\nimport { OrgDataContext } from 'context/orgData';\r\nimport gql from 'graphql-tag';\r\nimport useUserGroups from 'hooks/useUserGroups';\r\nimport moment from 'moment';\r\nimport React, { useContext } from 'react';\r\nimport { useQuery } from 'react-apollo';\r\nimport './style.less';\r\nimport { getTotalDurationHoursMinutes } from './util';\r\n\r\nconst BASE_CLS = 'mc-fw-aircraft-history';\r\n\r\nexport interface FWAircraftHistoryProps {\r\n flightID: string,\r\n flightDate: string\r\n}\r\n\r\nconst QUERY = gql`\r\nquery DispatchHistoryFlights($flightName: String!, $dateStart: AWSDateTime!, $dateEnd: AWSDateTime!, $tpID: ID!) {\r\n DispatchHistoryFlights(flightName: $flightName, dateStart: $dateStart, dateEnd: $dateEnd, tpID: $tpID, limit: 2000) {\r\n bookmark\r\n warning\r\n warningCode\r\n docs {\r\n _id\r\n ... on DispatchHistory {\r\n _id\r\n name\r\n ato\r\n eta\r\n ata\r\n pob\r\n scheduledFlightDate\r\n approvedBy\r\n dispatchDoc {\r\n _id\r\n getTzAbbr\r\n }\r\n aircraftDoc {\r\n _id\r\n tailNum\r\n }\r\n contractID\r\n contractDoc {\r\n _id\r\n name\r\n }\r\n departingID\r\n departingDoc {\r\n _id\r\n name\r\n areaBlockName\r\n }\r\n destinationID\r\n destinationDoc {\r\n _id\r\n name\r\n areaBlockName\r\n }\r\n pilotID\r\n pilotDoc {\r\n _id\r\n name {\r\n firstName\r\n lastName\r\n }\r\n }\r\n coPilotID\r\n coPilotDoc {\r\n _id\r\n name {\r\n firstName\r\n lastName\r\n }\r\n }\r\n _r_latestRemark {\r\n remark\r\n remarkTime\r\n }\r\n remark {\r\n remark\r\n remarkTime\r\n }\r\n getTzAbbr\r\n }\r\n }\r\n }\r\n}\r\n`\r\n\r\nexport const FWAircraftHistory: React.FC = (props) => {\r\n\r\n let orgData = useContext(OrgDataContext);\r\n let [ userGroups ] = useUserGroups();\r\n\r\n let { data: qData, networkStatus, error } = useQuery(QUERY, {\r\n variables: {\r\n flightName: props.flightID,\r\n dateStart: dateToZulu(moment(props.flightDate)),\r\n dateEnd: dateToZulu(moment(props.flightDate).add(1, 'day')),\r\n tpID: orgData.getOrgIDByType('transporter')\r\n },\r\n skip: !props.flightDate,\r\n fetchPolicy: 'cache-and-network',\r\n errorPolicy: 'all',\r\n pollInterval: 15000\r\n })\r\n\r\n // if (!userGroups.includes('flytsuite.flytwatch.history.read')){\r\n // return \r\n // }\r\n\r\n let data = castArray(qData?.DispatchHistoryFlights?.docs)\r\n\r\n const loading = networkStatus === NetworkStatus.loading;\r\n\r\n if (!data.length && !loading && !error) {\r\n return \r\n }\r\n\r\n if (loading){\r\n return \r\n }\r\n \r\n return
    \r\n {error ? : null}\r\n {getTotalDurationHoursMinutes(data, (time) => moment(time))}]\r\n }}\r\n columns={[\r\n {\r\n title: 'ID',\r\n dataIndex: 'name'\r\n },\r\n {\r\n title: 'Aircraft',\r\n render: (_, record: any) => record.aircraftDoc?.tailNum,\r\n width: 80\r\n },\r\n {\r\n title: 'Departing',\r\n render: (_, record: any) => record.dep?.label || record.departingDoc?.areaBlockName,\r\n width: 140\r\n },\r\n {\r\n title: 'Destination',\r\n render: (_, record: any) => record.dest?.label || record.destinationDoc?.areaBlockName,\r\n width: 140\r\n },\r\n {\r\n title: 'ATO',\r\n dataIndex: 'ato',\r\n render: (ato, record) => moment.utc(ato).tz(getTzNameFromDoc(record)).format('MMMM Do, YYYY H:mm z'),\r\n sorter: (a, b) => {\r\n let aMom = moment(a.ato);\r\n let bMom = moment(b.ato);\r\n if (aMom.isAfter(bMom)){\r\n return 1;\r\n }\r\n else if (bMom.isAfter(aMom)){\r\n return -1;\r\n }\r\n return 0;\r\n },\r\n defaultSortOrder: 'descend',\r\n width: 190\r\n },\r\n // {\r\n // title: 'ETA',\r\n // key: 'eta',\r\n // dataIndex: 'eta',\r\n // render: (eta, record) => (String(record.ata).startsWith('-') || !record.ata)\r\n // ? moment.utc(eta).tz(getTzNameFromDoc(record)).format('MMM Do, YYYY H:mm z')\r\n // : 'Arrived'\r\n // },\r\n {\r\n title: 'ATA',\r\n dataIndex: 'ata',\r\n render: (ata, record) => moment.utc(ata).tz(getTzNameFromDoc(record)).format('MMM Do, YYYY H:mm z'),\r\n sorter: (a, b) => {\r\n let aMom = moment(a.ata);\r\n let bMom = moment(b.ata);\r\n if (aMom.isAfter(bMom)){\r\n return 1;\r\n }\r\n else if (bMom.isAfter(aMom)){\r\n return -1;\r\n }\r\n return 0;\r\n },\r\n width: 190\r\n },\r\n {\r\n title: 'Time',\r\n render: (_, record) => getDurationHoursMinutes(moment(record.ata).diff(moment(record.ato))),\r\n width: 110\r\n },\r\n {\r\n title: 'POB',\r\n dataIndex: 'pob',\r\n width: 50,\r\n render: (pob) => pob\r\n },\r\n {\r\n title: 'Contract',\r\n render: (_, record: any) => record.contract?.label || record.contractDoc?.name,\r\n width: 140\r\n },\r\n {\r\n title: 'Pilot',\r\n render: (_, record: any) => record.pilot?.label || getPilotName(record.pilotDoc),\r\n width: 140\r\n },\r\n {\r\n title: 'Co-Pilot',\r\n render: (_, record: any) => record.coPilot?.label || getPilotName(record.coPilotDoc),\r\n width: 140\r\n },\r\n {\r\n title: 'Remarks',\r\n dataIndex: '_r_latestRemark',\r\n render: (_r_latestRemark) => _r_latestRemark?.remark\r\n }\r\n ]}\r\n />\r\n
    \r\n}\r\n\r\nexport default FWAircraftHistory;","import { default as FWAircraftHistory } from './aircraft-history';\r\n\r\nexport default FWAircraftHistory;","/**\r\n * Aircraft Details flyout panel in the FlytWatch homepage.\r\n * This component is responsible for showing details of a flytwatch.dispatch object\r\n * and displaying a map of its route from location A to location B.\r\n */\r\n\r\nimport { library } from '@fortawesome/fontawesome-svg-core';\r\nimport { faMapMarkerAlt } from '@fortawesome/free-solid-svg-icons';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { Alert, Button, Descriptions, Drawer, Icon } from 'antd';\r\nimport { DrawerProps } from 'antd/lib/drawer';\r\nimport { NetworkStatus } from 'apollo-client';\r\nimport cn from 'classnames';\r\nimport { cleanGraphQLErrorMsg, getDegAngleFromPoints, getPilotName, momentOrNull } from 'common/util';\r\nimport { getAreaBlock, getTzNameFromDoc } from 'common/util-ts';\r\nimport CenteredLoadingScreen from 'components/CenteredLoadingScreen';\r\nimport MapArrowSvg from 'components/icon/icons/map-arrow.svg';\r\nimport LocationMarker from 'components/mapping/location-marker';\r\nimport NonIdealState from 'components/NonIdealState';\r\nimport { RequireUserGroup, RequireUserGroups } from 'components/userGroup';\r\nimport { OrgDataContext } from 'context/orgData';\r\nimport gql from 'graphql-tag';\r\nimport useControlledState from 'hooks/useControlledState';\r\nimport moment from 'moment';\r\nimport React, { CSSProperties, HTMLAttributes, Ref, useContext, useEffect, useRef, useState } from 'react';\r\nimport { useQuery } from 'react-apollo';\r\nimport { ErrorBoundary } from 'react-error-boundary';\r\nimport { Layer, MapRef, Marker, Source } from 'react-map-gl';\r\nimport FWAircraftHistory from '../aircraft-history';\r\nimport FlytWatchDetailsMap from '../details-map';\r\nimport { LocCoords } from '../interfaces';\r\nimport './style.less';\r\n\r\nlibrary.add(faMapMarkerAlt);\r\n\r\nconst BASE_CLS = 'mc-flytwatch-aircraft-details';\r\n\r\nconst DItem = Descriptions.Item;\r\n\r\ninterface AircraftDetailsState {\r\n historyDrawer: Omit\r\n}\r\n\r\ninterface AircraftData {\r\n aircraftID: string,\r\n tailNum?: string,\r\n departure?: string,\r\n departureID?: string,\r\n departureAreaBlock?: string,\r\n destination?: string,\r\n destinationID?: string,\r\n destinationAreaBlock?: string,\r\n departureCoordinates?: LocCoords,\r\n destinationCoordinates?: LocCoords,\r\n ato?: string,\r\n eta?: string,\r\n ata?: string,\r\n pob?: string,\r\n contract?: string,\r\n pilot?: string,\r\n status: 'BASE' | 'AIR' | 'CHECK',\r\n name: string,\r\n createdBy: string\r\n}\r\n\r\nexport interface AircraftDetailsProps extends HTMLAttributes {\r\n aircraftID?: string,\r\n data?: AircraftData,\r\n loading?: boolean,\r\n title?: string,\r\n overrideState?: AircraftDetailsState,\r\n onStateChange?: (newState: AircraftDetailsState) => void,\r\n historyDrawerProps?: DrawerProps,\r\n buttonBarStyle?: CSSProperties\r\n}\r\n\r\nfunction renderTime(time: string, record: any){\r\n let m = time ? moment(time) : undefined;\r\n if (!m) return null;\r\n let text = moment.utc(m).tz(getTzNameFromDoc(record))\r\n .format('MMM Do, YYYY [::] H:mm z')\r\n .split('::');\r\n return \r\n {text[0]}\r\n
    \r\n {text[1]}\r\n
    \r\n}\r\n\r\nconst AircraftDetails: React.FC = React.forwardRef(({\r\n aircraftID,\r\n data: propData,\r\n loading: propLoading,\r\n title,\r\n className,\r\n overrideState,\r\n onStateChange,\r\n historyDrawerProps,\r\n buttonBarStyle,\r\n ...restProps\r\n}, ref: Ref) => {\r\n\r\n /*\r\n This component has two ways of receiving aircraft data:\r\n 1. \"data\" attribute in props. If not null, the useQuery hook below is skipped.\r\n 2. \"aircraftID\" attribute followed by the useQuery hook. When aircraftID is not null and\r\n \"data\" is null, the query will execute and the response is transformed to the same structure\r\n as the \"data\" attribute.\r\n */\r\n\r\n let skipQuery = propData ? true : false || !aircraftID;\r\n\r\n const { data: queryData, networkStatus, loading: queryLoading, error: queryError } = useQuery(gql`\r\n query GetDispatchAircraft($id: ID!){\r\n GetDispatchByID(id: $id){\r\n _id\r\n status\r\n ata\r\n eta\r\n ato\r\n pob\r\n checkTime\r\n aircraftID\r\n createdBy\r\n aircraftDoc {\r\n _id\r\n tailNum\r\n }\r\n contractDoc {\r\n _id\r\n name\r\n customerID {\r\n _id\r\n name\r\n }\r\n tpID {\r\n _id\r\n name\r\n }\r\n }\r\n departingID\r\n departingDoc {\r\n _id\r\n name\r\n block\r\n field\r\n type\r\n resolvedCoordinates {\r\n latitude\r\n longitude\r\n source\r\n }\r\n }\r\n destinationID\r\n destinationDoc {\r\n _id\r\n name\r\n block\r\n field\r\n type\r\n resolvedCoordinates {\r\n latitude\r\n longitude\r\n source\r\n }\r\n }\r\n pilotDoc {\r\n _id\r\n name {\r\n firstName\r\n lastName\r\n }\r\n }\r\n name\r\n }\r\n }\r\n `, {\r\n variables: {\r\n id: aircraftID\r\n },\r\n skip: skipQuery,\r\n fetchPolicy: 'cache-and-network',\r\n pollInterval: 30000, // Update aircraft details data every 30 seconds\r\n })\r\n\r\n let data: AircraftData = null;\r\n let loading = false;\r\n\r\n // Convert propData or queryData to data variable. Same with loading variable.\r\n if (!skipQuery){\r\n let af = queryData?.GetDispatchByID;\r\n\r\n if (af){\r\n data = {\r\n aircraftID: af.aircraftID,\r\n tailNum: af.aircraftDoc.tailNum,\r\n departure: af.departingDoc?.name,\r\n departureID: af.departingDoc?._id,\r\n departureAreaBlock: getAreaBlock(af.departingDoc),\r\n departureCoordinates: af.departingDoc?.resolvedCoordinates,\r\n destination: af.destinationDoc?.name,\r\n destinationID: af.destinationDoc?._id,\r\n destinationAreaBlock: getAreaBlock(af.destinationDoc),\r\n destinationCoordinates: af.destinationDoc?.resolvedCoordinates,\r\n ato: af.ato,\r\n eta: af.eta,\r\n ata: af.ata,\r\n pob: af.pob,\r\n contract: af.contractDoc?.name,\r\n pilot: getPilotName(af.pilotDoc),\r\n status: af.status,\r\n createdBy: af.createdBy,\r\n name: af.name\r\n }\r\n }\r\n\r\n loading = queryLoading;\r\n console.debug('queryLoading', queryLoading);\r\n }\r\n else\r\n {\r\n data = propData;\r\n loading = propLoading;\r\n console.debug('propLoading', propLoading);\r\n }\r\n\r\n\r\n const [ dimensions, setDimensions ] = useState([0, 0]); // [x, y]\r\n const [ state, setState ] = useControlledState({\r\n historyDrawer: {\r\n visible: false,\r\n title: 'Aircraft History'\r\n }\r\n },\r\n overrideState, onStateChange)\r\n const orgData = useContext(OrgDataContext);\r\n\r\n const mapContainerRef = useRef();\r\n\r\n function getMapDimensions(){\r\n let mc = mapContainerRef.current;\r\n if (mc){\r\n let x = mc.clientWidth;\r\n let y = mc.clientHeight;\r\n setDimensions([x, y]);\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n getMapDimensions();\r\n // Get the map container dimensions\r\n window.addEventListener('resize', getMapDimensions)\r\n return () => {\r\n window.removeEventListener('resize', getMapDimensions);\r\n }\r\n }, [ mapContainerRef.current ])\r\n\r\n let divProps = {\r\n className: cn(BASE_CLS, className),\r\n ...restProps\r\n }\r\n\r\n function renderMap(){\r\n \r\n if (data.status === 'BASE' && data.departureCoordinates){\r\n return (\r\n \r\n \r\n \r\n \r\n null} />\r\n \r\n )\r\n }\r\n else if (data.status === 'AIR' && data.departureCoordinates && data.destinationCoordinates){\r\n let avgCoords = {\r\n latitude: (data.departureCoordinates.latitude + data.destinationCoordinates.latitude) / 2,\r\n longitude: (data.departureCoordinates.longitude + data.destinationCoordinates.longitude) / 2\r\n };\r\n let lineData: any = {\r\n type: 'Feature',\r\n properties: {},\r\n geometry: {\r\n type: 'LineString',\r\n coordinates: [\r\n [ data.departureCoordinates.longitude, data.departureCoordinates.latitude ],\r\n [ data.destinationCoordinates.longitude, data.destinationCoordinates.latitude ]\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 null} />\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n else if (data.status === 'CHECK' && data.departureCoordinates){\r\n return (\r\n \r\n \r\n \r\n \r\n null} />\r\n \r\n )\r\n }\r\n else if (!data.departureCoordinates && !data.destinationCoordinates){\r\n let noDataMsg = \r\n Coordinate data is missing for {data.departure} and {data.destination}.
    \r\n null}>\r\n Update {data.departure}\r\n Update {data.destination}\r\n \r\n
    \r\n return \r\n }\r\n else if (!data.departureCoordinates) {\r\n let noDataMsg = \r\n Coordinate data is missing for {data.departure}.
    \r\n null}>\r\n Update {data.departure}\r\n \r\n
    \r\n return \r\n }\r\n else if (!data.destinationCoordinates) {\r\n let noDataMsg = \r\n Coordinate data is missing for {data.destination}.
    \r\n null}>\r\n Update {data.destination}\r\n \r\n
    \r\n return \r\n }\r\n }\r\n\r\n if (loading && !data){\r\n return \r\n }\r\n\r\n if (queryError) {\r\n return \r\n }\r\n\r\n if (!data){\r\n return
    \r\n \r\n
    \r\n }\r\n\r\n function renderLocIcons(): [React.ReactNode, React.ReactNode]{\r\n let nodes: [React.ReactNode, React.ReactNode] = [null, null];\r\n\r\n let start = \r\n\r\n let end = \r\n\r\n if (data.status === 'BASE' && data.departureCoordinates){\r\n nodes[0] = end;\r\n }\r\n else if (data.status === 'AIR' && data.departureCoordinates && data.destinationCoordinates){\r\n nodes[0] = start;\r\n nodes[1] = end;\r\n }\r\n else if (data.status === 'CHECK' && data.departureCoordinates){\r\n nodes[0] = end;\r\n }\r\n\r\n return nodes;\r\n }\r\n\r\n let locIcons = renderLocIcons();\r\n\r\n function getAcTime(){\r\n let time: string;\r\n switch (data.status) {\r\n case 'BASE':\r\n time = data.ata;\r\n break;\r\n case 'AIR':\r\n time = data.ato;\r\n break;\r\n case 'CHECK':\r\n time = data.ata;\r\n break;\r\n default:\r\n break;\r\n }\r\n return time;\r\n }\r\n\r\n function getDrawerTitle(){\r\n let time = getAcTime();\r\n if (!time || moment().isSame(momentOrNull(time), 'date')){\r\n return 'Today\\'s flight history for ' + data.name + ' (' + orgData.transporter?.name + ')'\r\n }\r\n return 'Flight history for ' + data.name + ' at ' + moment(time).format('ddd, MMM DD YYYY') + ' (' + orgData.transporter?.name + ')'\r\n }\r\n\r\n function renderButtonBar(){\r\n const className = cn({\r\n [BASE_CLS + '-buttonbar']: true,\r\n [BASE_CLS + '-buttonbar-header']: title ? true : false\r\n })\r\n return
    \r\n {title ?

    {title}

    : null}\r\n {/* */}\r\n setState({ ...state, historyDrawer:\r\n {\r\n ...state.historyDrawer,\r\n visible: true,\r\n title: getDrawerTitle()\r\n }\r\n })}\r\n >View History\r\n {/* */}\r\n
    \r\n }\r\n\r\n return
    \r\n {renderButtonBar()}\r\n \r\n \r\n {data.name}\r\n
    \r\n {/* No Manifest */}\r\n
    \r\n \r\n {locIcons[0]}\r\n {data.departure}\r\n \r\n \r\n {locIcons[1]}\r\n {data.destination}\r\n \r\n {renderTime(data.ato, data)}\r\n {renderTime(data.eta, data)}\r\n {renderTime(data.ata, data)}\r\n {data.pob}\r\n {data.contract}\r\n {data.pilot}\r\n
    \r\n (\r\n
    \r\n }\r\n />\r\n
    \r\n )}\r\n >\r\n
    \r\n {renderMap()}\r\n
    \r\n \r\n setState({ ...state, historyDrawer: { ...state.historyDrawer, visible: false } })}\r\n >\r\n \r\n \r\n
    \r\n})\r\n\r\nAircraftDetails.displayName = 'AircraftDetails';\r\n\r\nexport default AircraftDetails;","import React from 'react';\r\nimport { Query, QueryResult } from 'react-apollo';\r\nimport gql from 'graphql-tag';\r\nimport { message } from 'antd';\r\nimport {getDisplayName, safeGet} from \"../common/util\";\r\nimport {OrganizationFragment} from \"../Queries/Organization\";\r\n\r\nexport type OrgTypes = 'employer' | 'transporter' | 'customer';\r\n\r\nconst query = gql`\r\n query GetOrgData {\r\n customer @client {\r\n ...OrganizationFragment\r\n }\r\n transporter @client {\r\n ...OrganizationFragment\r\n }\r\n employer @client {\r\n ...OrganizationFragment\r\n }\r\n organization @client {\r\n ...OrganizationFragment\r\n }\r\n tpList @client{\r\n _id\r\n name\r\n }\r\n }\r\n ${OrganizationFragment}\r\n`\r\n\r\nexport interface OrgDataProviderContext {\r\n customer: any,\r\n customerID: string,\r\n customerName: string,\r\n transporter: any,\r\n transporterID: any,\r\n employer: any,\r\n employerID: string,\r\n employerName: string,\r\n organization: any,\r\n\r\n /**\r\n * List of transporters contracted with the current customer.\r\n */\r\n tpList: any[],\r\n\r\n /**\r\n * Get organization object by type of organization.\r\n * If no type is provided the plain organization is returned.\r\n * @param type Org type.\r\n */\r\n getOrgByType: (type?: OrgTypes) => any,\r\n\r\n /**\r\n * Get organization ID by type of organization.\r\n * If no type is provided the plain organization ID is returned.\r\n * @param type Org type.\r\n */\r\n getOrgIDByType: (type?: OrgTypes) => any,\r\n\r\n /**\r\n * Get the active organization if available.\r\n */\r\n getActiveOrg: () => any,\r\n\r\n /**\r\n * Get the active organization ID if available.\r\n */\r\n getActiveOrgID: () => any,\r\n}\r\n\r\nexport const OrgDataContext: React.Context = React.createContext(null)\r\n\r\n/**\r\n * Provides global access to organization data.\r\n */\r\nexport const OrgDataProvider = ({ children }) => {\r\n return \r\n {({ data, loading, error }: QueryResult) => {\r\n if (error){\r\n message.error('Failed to get organization data', 3)\r\n .then(() => message.error(error.message, 5), null)\r\n }\r\n if (loading || error) return null\r\n\r\n let getActiveOrg = () => {\r\n switch (safeGet(['organization', 'classType'], data)) {\r\n case 'flytsuite.employer':\r\n return data.employer;\r\n case 'flytsuite.transporter':\r\n case 'flytsuite.customer':\r\n return data.transporter;\r\n default:\r\n return data.organization;\r\n }\r\n }\r\n\r\n const getOrgByType = (type?: OrgTypes) => {\r\n switch (type) {\r\n case 'employer':\r\n return data?.employer\r\n case 'transporter':\r\n return data?.transporter\r\n case 'customer':\r\n return data?.customer\r\n default:\r\n return data?.organization;\r\n }\r\n }\r\n\r\n return {\r\n let def:OrgTypes = 'transporter';\r\n let org = getOrgByType(type ? type : def);\r\n return org && org._id\r\n },\r\n getActiveOrg: () => {\r\n const activeOrg = getActiveOrg();\r\n return activeOrg;\r\n },\r\n getActiveOrgID: () => {\r\n const activeOrg = getActiveOrg();\r\n return activeOrg?._id;\r\n }\r\n }}>\r\n {children}\r\n \r\n }}\r\n \r\n}\r\n\r\n/**\r\n * Provides global access to organization data.\r\n */\r\nexport const withOrgDataProvider =

    (WrappedComponent: React.ComponentType

    ) => {\r\n return (props: P) => {\r\n return class extends React.Component {\r\n static displayName = `withOrgDataprovider(${getDisplayName(WrappedComponent)})`\r\n render(){\r\n return \r\n \r\n \r\n }\r\n }\r\n }\r\n}","\r\nclass AutoScroll {\r\n \r\n element: Element;\r\n enabled = false;\r\n waitMsBeforeScroll: number;\r\n waitMsOnReachBottom: number;\r\n repeat: boolean;\r\n\r\n // Callback for when scroll cycle is completed\r\n finishCb: () => void;\r\n\r\n // Callback for when scrolling is needed or not needed due to scroll height being smaller than element height\r\n scrollNeededCb: (needed: boolean) => void;\r\n \r\n // Computed on auto scroll start\r\n private computedDuration: number;\r\n private scrollSpeed: number; // Pixels per second\r\n private scrollNeeded: boolean; // Whether scrolling is needed or not.\r\n private stepping: boolean = false;\r\n private finished: boolean = false;\r\n\r\n currScrollTop = 0;\r\n\r\n animation: Animation = null;\r\n\r\n constructor(element: Element, defaultScrollSpeed=5, repeat=true, waitMsBeforeScroll=8000, waitMsOnReachBottom=8000){\r\n console.debug('AutoScroll class instantiated. Element: ', element);\r\n this.element = element;\r\n this.scrollSpeed = defaultScrollSpeed;\r\n this.waitMsBeforeScroll = waitMsBeforeScroll;\r\n this.waitMsOnReachBottom = waitMsOnReachBottom;\r\n this.repeat = repeat;\r\n }\r\n\r\n // Computes the duration of the scroll by dividing the remaining scroll distance by scroll speed and multiplied by a constant\r\n // If the height of the element is greater than or equal to the scroll height, then there is no need for a scroll. Therefore it returns false.\r\n // Otherwise it returns true\r\n computeDuration = () => {\r\n let clientRect = this.element.getBoundingClientRect();\r\n if ((clientRect.height + 1 >= this.element.scrollHeight && this.enabled) || !this.enabled){\r\n this.enabled = false;\r\n if (this.scrollNeededCb && this.scrollNeeded !== false){\r\n this.scrollNeededCb(false);\r\n }\r\n this.scrollNeeded = false;\r\n return false;\r\n }\r\n else\r\n {\r\n if (this.scrollNeededCb && this.scrollNeeded !== true){\r\n this.scrollNeededCb(true);\r\n }\r\n this.scrollNeeded = true;\r\n }\r\n\r\n const scrollHeight = this.element.scrollHeight - (this.element.scrollTop + clientRect.height);\r\n const scrollSpeed = this.scrollSpeed;\r\n\r\n let result = (scrollHeight / scrollSpeed) * 100\r\n this.computedDuration = result;\r\n return true;\r\n }\r\n\r\n start = async (backToTop=false, delay=false) => {\r\n if (this.finished){\r\n return;\r\n }\r\n if (this.stepping){\r\n // Already stepping going on\r\n return;\r\n }\r\n this.enabled = true;\r\n\r\n if (backToTop){\r\n this.element.scrollTo({ top: 0, behavior: 'smooth' });\r\n }\r\n\r\n if (delay){\r\n await this.sleep(this.waitMsBeforeScroll);\r\n }\r\n\r\n if (!this.computeDuration()){\r\n return;\r\n }\r\n\r\n const startY = this.element.scrollTop;\r\n const difference = this.element.scrollHeight - startY;\r\n const startTime = performance.now();\r\n console.log('difference:', difference);\r\n\r\n const step = () => {\r\n const progress = (performance.now() - startTime) / this.computedDuration;\r\n this.element.scrollTo({ top: startY + progress * difference });\r\n if (progress <= 1 && this.enabled) {\r\n // console.log('progress: ' + progress);\r\n window.requestAnimationFrame(step);\r\n this.stepping = true;\r\n }\r\n else if (this.enabled)\r\n {\r\n this.stepping = false;\r\n this.onFinish();\r\n }\r\n else\r\n {\r\n this.stepping = false;\r\n }\r\n };\r\n\r\n step();\r\n }\r\n\r\n onFinish = async () => {\r\n if (this.finished){\r\n return;\r\n }\r\n console.debug('Auto scroll animation finished. Waiting ' + this.waitMsOnReachBottom + \" ms to restart animation.\");\r\n this.finished = true;\r\n await this.sleep(this.waitMsOnReachBottom);\r\n this.finished = false;\r\n \r\n if (this.finishCb){\r\n // Run external callback if available\r\n // Allows external code to fire when scroll finishes\r\n this.finishCb();\r\n }\r\n if (this.enabled && this.repeat){\r\n console.debug('Restarting scroll animation.');\r\n this.start(true, true);\r\n }\r\n else\r\n {\r\n console.debug('Could not restart animation because repeat=' + this.repeat + \" and enabled=\" + this.enabled);\r\n }\r\n }\r\n\r\n stop = () => {\r\n this.enabled = false;\r\n this.computeDuration();\r\n }\r\n\r\n sleep(ms: number): Promise {\r\n return new Promise((resolve) => setTimeout(resolve, ms));\r\n }\r\n\r\n setScrollSpeed = (speed: number) => {\r\n this.scrollSpeed = speed;\r\n console.debug('setScrollSpeed:', speed);\r\n this.computeDuration();\r\n }\r\n\r\n getScrollSpeed = () => this.scrollSpeed;\r\n\r\n onFinishCallback = (callback) => {\r\n this.finishCb = callback;\r\n }\r\n\r\n scrollNeededCallback = (callback) => {\r\n this.scrollNeededCb = callback;\r\n }\r\n}\r\n\r\nexport default AutoScroll","import {ReactElement, useEffect, useRef} from \"react\";\r\nimport {ETableProps} from \"./index\";\r\nimport './enhanced-antd-table-group.less';\r\n\r\nexport interface ETableGroupProps {\r\n children: ReactElement | ReactElement[]\r\n}\r\n\r\n/**\r\n * A kind of nasty hack to make the fixed columns of the tables stay fixed only on the X-axis.\r\n * Y-axis coordinates are computed by the table offset.\r\n * Without this, the fixed columns will all attach to the top-left corner of the ETableGroup component's body.\r\n */\r\nexport function offsetFixedColumnsInTableGroup(tableGroupContainer: HTMLDivElement) {\r\n\r\n if (!tableGroupContainer) return;\r\n\r\n const groupElements = Array.from(tableGroupContainer.children);\r\n\r\n for (let groupElement of groupElements) {\r\n const tables = Array.from(groupElement.getElementsByClassName('ant-table')) as HTMLElement[];\r\n\r\n let idx = 0;\r\n for (let table of tables) {\r\n let offset = table.offsetTop;\r\n if (idx > 0) {\r\n offset += 0.5;\r\n }\r\n const fixedTables = [\r\n ...Array.from(table.getElementsByClassName('ant-table-fixed-left')),\r\n ...Array.from(table.getElementsByClassName('ant-table-fixed-right')),\r\n ];\r\n\r\n for (let fixedTable of fixedTables) {\r\n fixedTable.setAttribute('style', `top:${offset}px`);\r\n }\r\n idx++;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Used to group ETable components vertically with scrolling.\r\n * Fixed columns in the table will display correctly within the group.\r\n */\r\nconst ETableGroup: React.FC = ({ children }) => {\r\n\r\n const containerRef = useRef(null);\r\n\r\n offsetFixedColumnsInTableGroup(containerRef.current);\r\n\r\n return

    \r\n
    \r\n {children}\r\n
    \r\n
    \r\n}\r\n\r\nexport default ETableGroup;","import { TableComponents, TableProps } from 'antd/lib/table';\r\nimport { Table } from 'antd';\r\nimport React, { HTMLAttributes, PropsWithChildren, ReactElement } from 'react';\r\nimport Column from 'antd/lib/table/Column';\r\nimport cn from 'classnames';\r\nimport './enhanced-antd-table.less';\r\nimport ReactDOM from 'react-dom';\r\nimport AutoScroll from 'common/auto-scroll';\r\nimport { ThemeContext } from 'context/theme';\r\nimport ETableGroup from \"./table-group\";\r\nexport { default as ETableGroup } from './table-group';\r\n\r\nexport interface ETableTotals {\r\n colNum: number,\r\n label: any,\r\n masterLabel?: any,\r\n td?: React.ReactElement>[],\r\n\r\n /** Gets all rows of a certain group so you can calculate a total from that. Also puts the totals row in each group. */\r\n renderTdFromGroup?: ((groupData: any[]) => React.ReactElement>[]),\r\n\r\n /** Adds a master total that shows at the bottom of all of the groups */\r\n renderMasterTotalTd?: ((data: any[]) => React.ReactElement>[]),\r\n\r\n sticky?: boolean,\r\n masterSticky?: boolean,\r\n\r\n /** Include the totals on the top of the table as well as the footer */\r\n includeTotalOnTop?: boolean\r\n}\r\n\r\n// @ts-ignore\r\nexport interface ETableProps extends TableProps {\r\n totals?: ETableTotals,\r\n overrideFooter?: React.ReactElement>,\r\n\r\n squareCorners?: boolean,\r\n\r\n /** Groups data according to the value of the column. Each group will have it's own table header. */\r\n groupByColKey?: string,\r\n\r\n /**\r\n * Change the value of the group before it is factored in the grouping mechanism.\r\n * Ex for grouping by first letter of lastName: (groupValue) => groupValue[0]\r\n * */\r\n transformGroupValue?: (groupValue: any) => any,\r\n \r\n groupHeaderType?: 'header' | ((groupValue: any, body: any, idx: number) => React.ReactElement),\r\n\r\n /** Empty space between groups */\r\n groupSpacing?: number | boolean,\r\n stickyHeader?: boolean,\r\n stickyHeaderOffset?: 12,\r\n\r\n /** Allows height of table to shrink to the available space of a flexbox and enables scrolling internally */\r\n flexMode?: boolean,\r\n\r\n autoScroll?: {\r\n enabled?: boolean,\r\n speed?: number,\r\n stopOnMouseHover?: boolean,\r\n hideIdleMouse?: boolean,\r\n onScrollReachEnd?: () => void,\r\n onScrollNeeded?: (needed: boolean) => void\r\n },\r\n\r\n components?: {\r\n table?: EnhancedTableCompWrapper;\r\n header?: {\r\n wrapper?: EnhancedHeaderComp;\r\n row?: React.ReactType;\r\n cell?: React.ReactType;\r\n };\r\n body?: {\r\n wrapper?: EnchancedBodyCompWrapper;\r\n row?: React.ReactType;\r\n cell?: React.ReactType;\r\n }\r\n }\r\n}\r\n\r\nexport interface EnhancedTableCompProps extends ETableProps {\r\n tableProps: TableProps,\r\n isFixed: boolean\r\n}\r\n\r\nclass EnhancedTableComp extends React.Component> {\r\n\r\n getColumns(): Array>{\r\n let headTable = this.props.tableProps.children[0];\r\n return headTable.props.columns;\r\n }\r\n\r\n getNumColumns(){\r\n return this.getColumns().length;\r\n }\r\n\r\n renderTotalRow(){\r\n return
    \r\n {this.props.totals.colNum ? (\r\n \r\n {this.props.totals.td}\r\n {this.props.totals.colNum === 0 && this.getNumColumns() <= 2 ? null : (\r\n \r\n }\r\n\r\n renderFooter(){\r\n if (this.props.isFixed){\r\n return null\r\n }\r\n if (this.props.overrideFooter){ // Rendering footer takes priority over totals\r\n let footer = React.cloneElement(this.props.overrideFooter, { className: 'ant-table-tbody mc-enhanced-table-footer' })\r\n return footer;\r\n }\r\n if (this.props.totals && !this.props.totals.renderTdFromGroup){\r\n return \r\n {this.renderTotalRow()}\r\n \r\n }\r\n return null;\r\n }\r\n\r\n renderTotalTop(){\r\n if (this.props.totals?.includeTotalOnTop){\r\n return \r\n {this.renderTotalRow()}\r\n \r\n }\r\n return null\r\n }\r\n\r\n render(): React.ReactNode {\r\n let children = React.Children.toArray(this.props.tableProps.children);\r\n children.splice(2, 0, this.renderTotalTop());\r\n return
    {getTotalDurationHoursMinutes(atoAtaList)}
    \r\n ) : null}\r\n {this.props.totals.label}\r\n )}\r\n
    \r\n {children}\r\n {this.renderFooter()}\r\n
    \r\n }\r\n}\r\n\r\nclass EnhancedTableCompWrapper extends React.Component> {\r\n\r\n constructor(props){\r\n super(props);\r\n }\r\n\r\n render(): React.ReactNode {\r\n return \r\n {(value) => (\r\n \r\n tableProps={this.props} {...value} isFixed={this.props.className.includes('ant-table-fixed')} />\r\n \r\n )}\r\n \r\n }\r\n}\r\n\r\nexport interface EnchancedTableBodyCompProps extends HTMLAttributes {\r\n\r\n}\r\n\r\nclass EnhancedBodyComp extends React.Component {\r\n\r\n getGroupSpacing(){\r\n let groupSpacing = this.props.groupSpacing;\r\n if (groupSpacing === true){\r\n return 24\r\n }\r\n return groupSpacing;\r\n }\r\n\r\n getColumns(): Array>{\r\n return this.props.columns;\r\n }\r\n\r\n renderHeader(key: any){\r\n return \r\n {this.getGroupSpacing() ? (\r\n \r\n ) : null}\r\n \r\n {this.props.columns.map((col, idx) => (\r\n {col.title}\r\n ))}\r\n \r\n \r\n }\r\n\r\n getNumColumns(){\r\n return this.getColumns().length;\r\n }\r\n\r\n renderFooter(records: any[], key: any){\r\n if (this.props.overrideFooter){ // Rendering footer takes priority over totals\r\n let footer = React.cloneElement(this.props.overrideFooter, { className: 'ant-table-tbody mc-enhanced-table-footer mc-enhanced-table-grouped-footer' })\r\n return footer;\r\n }\r\n if (this.props.totals && this.props.totals.renderTdFromGroup){\r\n let td = this.props.totals.renderTdFromGroup?.(records) || this.props.totals.td;\r\n return \r\n \r\n {this.props.totals.colNum ? (\r\n \r\n ) : null}\r\n {this.props.totals.label}\r\n {td}\r\n {this.props.totals.colNum === 0 && this.getNumColumns() <= 2 ? null : (\r\n \r\n )}\r\n \r\n \r\n }\r\n\r\n return null;\r\n }\r\n\r\n renderMasterFooter(records: any[]){\r\n if (this.props.totals && this.props.totals.renderMasterTotalTd){\r\n let td = this.props.totals.renderMasterTotalTd?.(records) || this.props.totals.td;\r\n return \r\n \r\n {this.props.totals.colNum ? (\r\n \r\n ) : null}\r\n {this.props.totals.masterLabel || this.props.totals.label}\r\n {td}\r\n \r\n \r\n \r\n }\r\n return null;\r\n }\r\n\r\n renderHeaderElement = (groupValue: any, body: any, idx: number) => {\r\n if (!this.props.groupHeaderType || this.props.groupHeaderType === 'header'){\r\n return idx > 0 ? this.renderHeader(groupValue) : null\r\n }\r\n else if (typeof this.props.groupHeaderType === 'function'){\r\n return this.props.groupHeaderType(groupValue, body, idx);\r\n }\r\n return null\r\n }\r\n\r\n renderGroupedBody(){\r\n let rowItems = React.Children.toArray(this.props.children);\r\n rowItems = rowItems.sort((a: any, b: any) => {\r\n function getVal(item): string{\r\n if (typeof item === 'object' && item !== null && item !== undefined){\r\n return String(item._id);\r\n }\r\n return String(item);\r\n }\r\n let aVal = getVal(a.props.record[this.props.groupByColKey]);\r\n let bVal = getVal(b.props.record[this.props.groupByColKey]);\r\n let compareRes = aVal.localeCompare(bVal);\r\n\r\n if (compareRes > 0) return 1;\r\n if (compareRes < 0) return -1;\r\n return 0;\r\n })\r\n\r\n let records = rowItems\r\n .filter((child: any) => child.props.record)\r\n .map((child: any) => child.props.record)\r\n \r\n let tableBodies = new Map();\r\n \r\n rowItems.forEach((child: any, idx) => {\r\n let groupKey = this.props.groupByColKey;\r\n let groupValue = child.props.record[groupKey];\r\n if (this.props.transformGroupValue){\r\n groupValue = this.props.transformGroupValue(groupValue);\r\n }\r\n if (!tableBodies.has(groupValue)){\r\n // New group is started. Add a new header.\r\n \r\n tableBodies.set(groupValue, [child]);\r\n }\r\n else\r\n {\r\n tableBodies.get(groupValue).push(child)\r\n }\r\n })\r\n\r\n return <>\r\n {Array.from(tableBodies.entries()).map(([groupValue, body], idx) => [\r\n this.renderHeaderElement(groupValue, body, idx),\r\n {body},\r\n this.renderFooter(body.map(row => row.props.record), groupValue)\r\n ])}\r\n {this.renderMasterFooter(records)}\r\n \r\n }\r\n\r\n render(): React.ReactNode {\r\n if (this.props.groupByColKey){\r\n return this.renderGroupedBody();\r\n }\r\n return \r\n {this.props.children}\r\n \r\n }\r\n}\r\n\r\nclass EnchancedBodyCompWrapper extends React.Component {\r\n render(): React.ReactNode {\r\n return \r\n {(tableProps) => (\r\n \r\n {({ children: tableChildren }) => (\r\n \r\n )}\r\n \r\n )}\r\n \r\n }\r\n}\r\n\r\nclass EnhancedHeaderComp extends React.Component {\r\n render(){\r\n return \r\n {this.props.children}\r\n \r\n }\r\n}\r\n\r\nconst ETableWrapperContext = React.createContext({\r\n totals: null,\r\n groupByColKey: null\r\n})\r\n\r\nconst ETableContext = React.createContext<{ children: React.ReactNode}>(null);\r\n\r\nclass ETable extends React.Component> {\r\n\r\n static Group = ETableGroup;\r\n\r\n tableRef = null;\r\n tableWrapperBody: Element = null;\r\n\r\n autoScroll: AutoScroll\r\n\r\n private scrollTimeoutHandle: NodeJS.Timeout;\r\n private mouseHideTimeoutHandle: NodeJS.Timeout;\r\n private mouseInTable = false;\r\n private isScrolling = false;\r\n\r\n getComponents = (): TableComponents => {\r\n return {\r\n table: EnhancedTableCompWrapper,\r\n header: {\r\n ...this.props.components?.header,\r\n wrapper: this.props.components?.header?.wrapper || EnhancedHeaderComp\r\n },\r\n body: {\r\n ...this.props.components?.body,\r\n wrapper: this.props.components?.body?.wrapper || EnchancedBodyCompWrapper\r\n }\r\n }\r\n }\r\n\r\n /** \r\n * Grabs the ant-table-body class element and stores it into the tableWrapperBody member variable.\r\n * Will be used to scroll automatically.\r\n */\r\n initAutoScroll = () => {\r\n // Ant Design does not forward the ref to a DOM Node. So we have to find the DOM node this way.\r\n // Use of findDOMNode is discouraged, but I cannot find any other way around this without having to modify\r\n // the Ant Design source code.\r\n let textOrElement: any = ReactDOM.findDOMNode(this.tableRef);\r\n\r\n if ( textOrElement instanceof Text){\r\n console.error('Table element is a text object for some reason?');\r\n return;\r\n }\r\n\r\n let tableElement: Element = textOrElement;\r\n \r\n if (!tableElement){\r\n console.error('Could not find ref to table DOM element!');\r\n return;\r\n }\r\n\r\n let elems = tableElement.getElementsByClassName('ant-table-body');\r\n \r\n if (!elems){\r\n console.error('Could not find ref to table wrapper body element!');\r\n }\r\n this.tableWrapperBody = elems[0];\r\n\r\n if (!this.autoScroll){\r\n this.autoScroll = new AutoScroll(this.tableWrapperBody, this.props.autoScroll?.speed || 5);\r\n \r\n // Listen for when the scroll is finished\r\n if (this.props.autoScroll?.onScrollReachEnd){\r\n this.autoScroll.onFinishCallback(this.props.autoScroll.onScrollReachEnd);\r\n }\r\n\r\n // Listen for when scroll is needed or not\r\n if (this.props.autoScroll?.onScrollNeeded){\r\n this.autoScroll.scrollNeededCallback((needed) => {\r\n this.props.autoScroll?.onScrollNeeded(needed);\r\n if (this.props.autoScroll?.enabled){\r\n this.startAutoScroll();\r\n }\r\n });\r\n }\r\n }\r\n\r\n if (this.props.autoScroll?.enabled){\r\n this.startAutoScroll();\r\n }\r\n }\r\n\r\n onBodyMouseOver = (ev) => {\r\n this.mouseInTable = true;\r\n if (this.props.autoScroll?.stopOnMouseHover){\r\n this.props.autoScroll?.enabled && this.stopAutoScroll()\r\n }\r\n };\r\n onBodyMouseLeave = (ev) => {\r\n this.mouseInTable = false;\r\n this.props.autoScroll?.enabled && this.startAutoScroll(false, false);\r\n }\r\n\r\n onBodyScroll = (ev) => {\r\n if (!this.autoScroll){ return; }\r\n if (!this.props.autoScroll?.enabled){ return; }\r\n\r\n this.isScrolling = true;\r\n window.clearTimeout(this.scrollTimeoutHandle);\r\n this.autoScroll.stop();\r\n this.scrollTimeoutHandle = setTimeout(() => {\r\n this.autoScroll.start();\r\n this.isScrolling = false;\r\n }, 1000);\r\n\r\n }\r\n\r\n onBodyMouseDown = (ev) => {\r\n if (!this.autoScroll){ return; }\r\n if (!this.props.autoScroll?.enabled){ return; }\r\n this.autoScroll.stop();\r\n }\r\n\r\n onBodyMouseUp = (ev) => {\r\n if (!this.autoScroll){ return; }\r\n if (!this.props.autoScroll?.enabled){ return; }\r\n\r\n setTimeout(() => {\r\n this.autoScroll.start();\r\n }, 1000);\r\n }\r\n\r\n onBodyMouseMove = (ev) => {\r\n if (this.tableWrapperBody.hasAttribute('style')){\r\n this.tableWrapperBody.removeAttribute('style');\r\n }\r\n if (this.mouseInTable && this.autoScroll?.enabled){\r\n window.clearTimeout(this.mouseHideTimeoutHandle);\r\n this.mouseHideTimeoutHandle = setTimeout(() => {\r\n this.tableWrapperBody.setAttribute('style', 'cursor: none;');\r\n }, 5000);\r\n }\r\n else\r\n {\r\n window.clearTimeout(this.mouseHideTimeoutHandle);\r\n }\r\n }\r\n\r\n addMouseEvents = () => {\r\n this.tableWrapperBody.addEventListener('mouseover', this.onBodyMouseOver)\r\n this.tableWrapperBody.addEventListener('mouseleave', this.onBodyMouseLeave)\r\n this.tableWrapperBody.addEventListener('mousemove', this.onBodyMouseMove);\r\n this.tableWrapperBody.addEventListener('mousedown', this.onBodyMouseDown);\r\n this.tableWrapperBody.addEventListener('mouseup', this.onBodyMouseUp);\r\n this.tableWrapperBody.addEventListener('wheel', this.onBodyScroll)\r\n }\r\n\r\n removeMouseEvents = () => {\r\n this.tableWrapperBody.removeEventListener('mouseover', this.onBodyMouseOver);\r\n this.tableWrapperBody.removeEventListener('mouseleave', this.onBodyMouseLeave);\r\n this.tableWrapperBody.removeEventListener('mousemove', this.onBodyMouseMove);\r\n this.tableWrapperBody.removeEventListener('mousedown', this.onBodyMouseDown);\r\n this.tableWrapperBody.removeEventListener('mouseup', this.onBodyMouseUp);\r\n this.tableWrapperBody.removeEventListener('wheel', this.onBodyScroll);\r\n }\r\n\r\n startAutoScroll(startFromTop=false, delay=true){\r\n if (!this.autoScroll.enabled){\r\n this.autoScroll.start(startFromTop, delay);\r\n console.debug('Started auto scroll');\r\n }\r\n }\r\n\r\n stopAutoScroll(){\r\n if (this.autoScroll.enabled){\r\n this.autoScroll.stop();\r\n console.debug('Stopped auto scroll');\r\n }\r\n }\r\n\r\n recomputeScrollDuration(){\r\n if (this.autoScroll){\r\n this.autoScroll.computeDuration();\r\n }\r\n }\r\n \r\n componentDidMount(): void {\r\n this.initAutoScroll();\r\n this.addMouseEvents();\r\n window.addEventListener('resize', this.recomputeScrollDuration);\r\n }\r\n\r\n componentDidUpdate(prevProps: Readonly>): void {\r\n if (this.props.autoScroll?.enabled && !prevProps.autoScroll?.enabled){\r\n this.startAutoScroll(false, false);\r\n }\r\n else if (!this.props.autoScroll?.enabled && prevProps.autoScroll?.enabled){\r\n this.stopAutoScroll();\r\n }\r\n\r\n if (this.autoScroll && typeof this.props.autoScroll?.speed == 'number' && this.props.autoScroll?.speed !== prevProps.autoScroll?.speed){\r\n this.autoScroll.setScrollSpeed(this.props.autoScroll.speed);\r\n }\r\n }\r\n\r\n componentWillUnmount(): void {\r\n this.removeMouseEvents();\r\n window.removeEventListener('resize', this.recomputeScrollDuration);\r\n }\r\n\r\n render(): React.ReactNode {\r\n return \r\n \r\n {({ themeName }) => (\r\n this.tableRef = elem}\r\n />\r\n )}\r\n \r\n \r\n }\r\n}\r\n\r\nexport default ETable;","import React, { PropsWithChildren } from 'react';\r\nimport gql from \"graphql-tag\";\r\nimport { Query } from 'react-apollo';\r\nimport { Alert, Result, Icon } from 'antd';\r\nimport { IconProps } from 'antd/lib/icon';\r\n\r\nconst USER_GROUPS = gql`\r\n{\r\n userGroups @client\r\n}\r\n`\r\n\r\n// const DefaultError = ({error}) => \r\n\r\nexport interface RequireUserGroupProps {\r\n group: string | Array,\r\n unauthorizedTitle?: string,\r\n unauthorizedSubTitle?: string,\r\n unauthorizedIcon?: React.ReactElement,\r\n renderUnauthorized?: () => any\r\n}\r\n\r\nexport const RequireUserGroup: React.FC> = (props) => {\r\n return \r\n {\r\n (result) => {\r\n if (result.loading) return null\r\n if (result.error) {\r\n console.error(result.error);\r\n return \r\n }\r\n var authorized = false;\r\n const checkGroup = (group) => {\r\n if (result.data.userGroups.includes(group))\r\n {\r\n authorized = true;\r\n }\r\n }\r\n switch (typeof props.group) {\r\n case 'string':\r\n checkGroup(props.group)\r\n break;\r\n default:\r\n props.group.forEach(g => {\r\n checkGroup(g)\r\n })\r\n break;\r\n }\r\n if (authorized){\r\n return props.children\r\n }\r\n\r\n if (props.renderUnauthorized){\r\n return props.renderUnauthorized();\r\n }\r\n\r\n return }\r\n title={props.unauthorizedTitle || \"Invalid permissions\"}\r\n subTitle={props.unauthorizedSubTitle || \"You do not have permission to access this feature\"}\r\n />\r\n }\r\n }\r\n \r\n}\r\n\r\nexport interface WithRequireUserGroupOptions {\r\n\r\n}\r\n\r\nexport const requireUserGroup =

    (group: string | Array, options?: Omit) => (Component: React.ComponentType

    ) => {\r\n class WithRequireUserGroup extends React.Component

    {\r\n render(){\r\n return \r\n \r\n \r\n }\r\n }\r\n return WithRequireUserGroup\r\n}\r\n\r\nconst GroupWrapper = ({ children, renderError = null, renderNotAuthorized = null, group }) => (\r\n \r\n {\r\n ({ data, loading, error }: any) => {\r\n if (loading) return null\r\n if (error) {\r\n console.error(error);\r\n return renderError\r\n }\r\n var authorized = false;\r\n const checkGroup = (group) => {\r\n if (data.userGroups.includes(group))\r\n {\r\n authorized = true;\r\n }\r\n }\r\n switch (typeof group) {\r\n case 'string':\r\n checkGroup(group)\r\n break;\r\n default:\r\n group.forEach(g => {\r\n checkGroup(g)\r\n })\r\n break;\r\n }\r\n if (authorized){\r\n return children\r\n }\r\n return renderNotAuthorized\r\n }\r\n }\r\n \r\n)\r\n\r\nconst Master = {\r\n All: props => \r\n}\r\n\r\nconst Isn = {\r\n Override: props => \r\n}\r\n\r\nconst Schedule = {\r\n Flight: props => ,\r\n Passenger: props => ,\r\n PassengerViewOnly: props => ,\r\n Sets: props => ,\r\n Any: props => \r\n}\r\n\r\nconst Times = {\r\n HistoryEdit: props => ,\r\n Default: props => ,\r\n}\r\n\r\nconst Flight = {\r\n Times\r\n}\r\n\r\nconst Flytwatch = {\r\n View: props => ,\r\n History: props => ,\r\n Report: props => \r\n}\r\n\r\n\r\nconst Flytsuite = {\r\n Master,\r\n Isn,\r\n Schedule,\r\n Flight,\r\n Flytwatch,\r\n Default: props => \r\n}\r\n\r\nexport const UserGroup = {\r\n Flytsuite\r\n}\r\n\r\nexport interface WithUserGroupsProps {\r\n userGroups?: string[]\r\n}\r\n\r\nexport const withUserGroups =

    (Component: React.ComponentType

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

    = (props) => (\r\n \r\n {\r\n ({ data, error }: any) => {\r\n if (error) {\r\n console.error(error)\r\n }\r\n const userGroups = (data && data.userGroups) || [];\r\n return \r\n }\r\n }\r\n \r\n )\r\n return withOrgDataWrapper\r\n}\r\n\r\nexport interface RequireUserGroupsProps extends PropsWithChildren<{}> {\r\n groups: string[],\r\n render?: any\r\n}\r\n\r\nexport const RequireUserGroups: React.FC = ({ groups=[], render=null, children=[] }) => {\r\n return (\r\n \r\n {\r\n ({ data, loading, error }: any) => {\r\n if (loading) return null\r\n if (error) return Failed to load user permissions\r\n const userGroups = (data && data.userGroups) || [];\r\n const inGroup = groups.find(group => userGroups.includes(group)) ? true : false;\r\n if (inGroup){\r\n return children\r\n }\r\n return render\r\n }\r\n }\r\n \r\n )\r\n}","import React from 'react';\r\nimport Icon, { IconProps } from 'antd/lib/icon';\r\nimport cn from 'classnames';\r\n\r\nconst iconSvgs = {\r\n \r\n 'bed': (\r\n\r\n\t\r\n\t\r\n\r\n\r\n ),\r\n 'location-pin': (\r\n \r\n \r\n \r\n \r\n \r\n ),\r\n 'groups': (\r\n \r\n \r\n \r\n \r\n \r\n \r\n ),\r\n 'moon': (\r\n \r\n \r\n \r\n \r\n \r\n ),\r\n 'helicopter-flight': (\r\n \r\n \r\n \r\n \r\n \r\n ),\r\n 'helicopter': (\r\n \r\n \r\n \r\n \r\n \r\n ),\r\n 'external-link': (\r\n \r\n \r\n \r\n ),\r\n 'smile-colored': (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ),\r\n 'frown-colored': (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ),\r\n 'rig': (\r\n \r\n \r\n \r\n ),\r\n 'flytwatch': (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ),\r\n 'map-layers': (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ),\r\n 'cargo': (\r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport interface MCIconProps extends Omit {\r\n type: 'moon' | 'helicopter-flight' | 'helicopter' |\r\n 'external-link' | 'smile-colored' | 'cargo' | string\r\n}\r\n\r\nconst MCIcon: React.FC = (props) => {\r\n let icon = iconSvgs[props.type];\r\n if (!icon) {\r\n return \r\n }\r\n return }>{icon.props.children}\r\n}\r\n\r\nexport default MCIcon;","import { Stream } from 'stream';\r\nimport moment, { Moment } from 'moment-timezone';\r\nimport {array} from \"prop-types\";\r\n\r\n// Based on https://github.com/aws/aws-sdk-js-v3/issues/1877#issuecomment-967223047\r\n// To help with AWS's stupid change that makes reading S3 objects overly complicated.\r\nexport async function readableStreamToBuffer(stream: ReadableStream): Promise {\r\n const chunks: Buffer[] = [];\r\n \r\n const reader = stream.getReader();\r\n \r\n let moreData = true;\r\n do {\r\n // eslint-disable-next-line no-await-in-loop\r\n const { done, value } = await reader.read();\r\n if (done) {\r\n moreData = false;\r\n } else {\r\n chunks.push(Buffer.from(value as Uint8Array));\r\n }\r\n } while (moreData);\r\n \r\n return Buffer.concat(chunks);\r\n }\r\n\r\nexport interface TzZone {\r\n name: string,\r\n shorthand: string,\r\n offset: number\r\n}\r\n\r\nlet timezones = {\r\n \"America/Chicago\": [\"CST\", -6, \"CDT\", -5],\r\n \"America/Denver\": [\"MST\", -7, \"MDT\", -6],\r\n \"America/Los_Angeles\": [\"PST\", -8, \"PDT\", -7],\r\n \"America/Phoenix\": [\"AZST\", -7, \"AZDT\", -7],\r\n \"America/New_York\": [\"EST\", -5, \"EDT\", -4],\r\n \"Pacific/Honolulu\": [\"HST\", -10, \"HDT\", -10]\r\n}\r\n\r\nlet sAbbrToName = {}\r\n\r\nObject.entries(timezones)\r\n .map(([ k, v ]) => sAbbrToName[v[0]] = k)\r\n\r\nexport function getZoneList(date: string, noDST=false): Array {\r\n\r\n let zoneNames = Object.entries>(timezones);\r\n let zoneList = zoneNames.map(([ name, [ abbrS, s, abbrD, d ] ]) => {\r\n let zone = moment.tz(date, name);\r\n if (zone.isDST() && !noDST){\r\n return {\r\n name,\r\n shorthand: String(abbrD),\r\n offset: Number(d)\r\n }\r\n }\r\n return {\r\n name: name,\r\n shorthand: String(abbrS),\r\n offset: Number(s)\r\n }\r\n })\r\n .sort((a, b) => {\r\n if (a.offset > b.offset){\r\n return -1\r\n }\r\n else\r\n {\r\n return 1\r\n }\r\n })\r\n return zoneList\r\n}\r\n\r\nexport function getTzDataFromName(tzList: Array, tzName: string): TzZone {\r\n let tzEntry = tzList.find((entry) => entry.name === tzName);\r\n return tzEntry;\r\n}\r\n\r\nexport function getTzNameFromDoc(doc: any){\r\n let defaultTz = \"America/Chicago\";\r\n const createdBy = doc.createdBy;\r\n if (!createdBy) return defaultTz;\r\n\r\n const cbArray = String(createdBy).split(\".\");\r\n const abbr = cbArray.find(el => String(el).toUpperCase() in sAbbrToName)?.toUpperCase();\r\n\r\n if (!abbr || !sAbbrToName[abbr]){\r\n return defaultTz;\r\n }\r\n\r\n return sAbbrToName[abbr];\r\n}\r\n\r\n/**\r\n * Appends or inserts an element into a mapping where the value is an array\r\n * @param map Map object to append to\r\n * @param key Key of the key/value pair to append to\r\n * @param valueToInsert Value to append to the value array\r\n * @returns 0 if value is appened to an existing element in the map; 1 if a new key is created in the map\r\n */\r\nexport function appendOrInsertMapValue(map: Map>, key: K, valueToInsert: V): number {\r\n if (map.has(key)){\r\n map.get(key).push(valueToInsert);\r\n return 0\r\n }\r\n else\r\n {\r\n map.set(key, [valueToInsert]);\r\n return 1\r\n }\r\n}\r\n\r\nexport function getLocalizedMoment(dateTime: string, doc: any): Moment{\r\n if (!dateTime) return null;\r\n\r\n let tzName = doc ? getTzNameFromDoc(doc) : 'America/Chicago';\r\n let tzAwareDT = moment(dateTime).parseZone().tz(tzName, false);\r\n return tzAwareDT;\r\n}\r\n\r\nexport function getSortFunction(itemGetter: ((item: T) => any) | string, order: 'asc' | 'desc'='asc'): (a: T, b: T) => number{\r\n const getValue = (obj: T) => {\r\n if (typeof itemGetter === 'function'){\r\n return itemGetter(obj);\r\n }\r\n return obj[itemGetter];\r\n }\r\n return (a, b) => {\r\n const aVal = getValue(a);\r\n const bVal = getValue(b);\r\n\r\n if (aVal > bVal){\r\n return order === 'asc' ? 1 : -1;\r\n }\r\n else if (bVal > aVal){\r\n return order === 'asc' ? -1 : 1;\r\n }\r\n return 0;\r\n }\r\n}\r\n\r\nexport function momentSorter(fieldName, a, b) {\r\n const aa = moment(a[fieldName]);\r\n const bb = moment(b[fieldName]);\r\n if (aa.isBefore(bb)) return -1\r\n if (aa.isAfter(bb)) return 1\r\n return 0\r\n}\r\n\r\nexport function getAreaBlock(locDoc: any){\r\n if (!locDoc) return null;\r\n if (locDoc.type === \"OFFSHORE\" && locDoc.block && locDoc.field){\r\n return `${locDoc.block}${locDoc.field}`\r\n }\r\n return null;\r\n}\r\n\r\n// Adds props to a component that keeps click events from\r\n// propagating.\r\nexport function stopPropagationProps(){\r\n return {\r\n onClick: (e) => {\r\n e.stopPropagation();\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Converts an array to a Map object.\r\n * @param array Array to convert.\r\n * @param keyGetter Field name/func to use as key.\r\n * @param transformElement Transform each array element before storing it in the map.\r\n *\r\n * @example\r\n * const data = [\r\n * { id: \"1\", name: \"John\" },\r\n * { id: \"2\", name: \"Jane\" }\r\n * ];\r\n *\r\n * const result = arrayToMap(array, \"id\", (element) => element.name);\r\n * const sameResult = arrayToMap(array, (value) => value.id, (element) => element.name); // <-- Equivalent to above\r\n *\r\n * // result:\r\n * // {\"1\": \"John\", \"2\": \"Jane\"}\r\n */\r\nexport function arrayToMap(\r\n array: V[],\r\n keyGetter: string | ((value: V) => K),\r\n transformElement?: (value: V) => T\r\n){\r\n const map = new Map();\r\n if (!array) return map;\r\n\r\n let getter: (value: V) => K;\r\n\r\n if (typeof keyGetter === 'string'){\r\n getter = (value: V) => value[keyGetter];\r\n }\r\n else\r\n {\r\n getter = keyGetter;\r\n }\r\n\r\n array.forEach((item: V) => {\r\n const key = getter(item);\r\n let finalValue: T = item as unknown as T;\r\n if (transformElement){\r\n finalValue = transformElement(item);\r\n }\r\n map.set(key, finalValue);\r\n })\r\n\r\n return map;\r\n}\r\n\r\n/**\r\n * Converts an array to a Map object where each value is an array.\r\n * @param array Array to convert.\r\n * @param keyGetter Field name/func to use as key.\r\n * @param transformElement Transform each array element before storing it in the map.\r\n *\r\n * @example\r\n * const data = [\r\n * { type: \"truck\", name: \"Ford F150\" },\r\n * { type: \"truck\", name: \"Ford Raptor\" },\r\n * { type: \"car\", name: \"Ford Escort\" }\r\n * ];\r\n *\r\n * const result = arrayToMap(array, \"id\", (element) => element.name);\r\n * const sameResult = arrayToMap(array, (value) => value.id, (element) => element.name); // <-- Equivalent to above\r\n *\r\n * // result:\r\n * // {\"truck\": [\"Ford F150\", \"Ford Raptor\"], \"car\": [\"Ford Escort\"]}\r\n */\r\nexport function arrayToMapAccumulate(\r\n array: V[],\r\n keyGetter: string | ((value: V) => K),\r\n transformElement?: (value: V) => T\r\n){\r\n const map = new Map();\r\n if (!array) return map;\r\n\r\n let getter: (value: V) => K;\r\n\r\n if (typeof keyGetter === 'string'){\r\n getter = (value: V) => value[keyGetter];\r\n }\r\n else\r\n {\r\n getter = keyGetter;\r\n }\r\n\r\n array.forEach((item: V) => {\r\n const key = getter(item);\r\n let finalValue: V|T = item;\r\n if (transformElement){\r\n finalValue = transformElement(item);\r\n }\r\n\r\n if (map.has(key)){\r\n map.get(key).push(finalValue);\r\n }\r\n else\r\n {\r\n map.set(key, [finalValue]);\r\n }\r\n })\r\n\r\n return map;\r\n}\r\n\r\n/**\r\n * If v is truey (not null, not empty string, not undefined, etc), returns true. Otherwise false.\r\n * @param v\r\n *\r\n * @example\r\n * const text = [\"h\", \"e\", \"l\", undefined, \"l\", null, \"o\", \"\"];\r\n * const filteredText = text.filter(isTruey);\r\n * // filteredText: [\"h\", \"e\", \"l\", \"l\", \"o\"]\r\n */\r\nexport function isTruey(v: any){\r\n return !!v;\r\n}"],"sourceRoot":""}