{"version":3,"sources":["components/Forms/ModalForm.tsx","components/Settings/Users/UserListQuery.tsx","components/CustomDatePicker.tsx","components/shared/PeriodPicker.tsx","components/Forms/PeriodPickerField.tsx","components/Dealers/DraftDealers/DraftDealerListQuery.tsx","components/RegionalSalesManagers/RegionalSalesManagerQuery.tsx","components/Settings/Users/userProfileValidationSchema.ts","components/Forms/RadioButtons.tsx","components/Forms/RadioButtonsField.tsx","components/Dealers/dealerSetupQuestionnaireValidationSchema.ts","components/Dealers/DealerContactList/DealerContactListQuery.tsx","components/RegionalSalesManagers/RegionalSalesManagerSelect.tsx","components/Proposals/ProposalDealerOverview/StatsBox.tsx","components/AccountManagers/AccountManagerActivities/types.ts","components/AccountManagers/AccountManagerActivities/accountManagerActivityValidationSchema.ts","components/AccountManagers/AccountManagerActivities/CreateOrUpdateActivityFormInner.tsx","components/AccountManagers/AccountManagerActivities/fragments.ts","components/AccountManagers/AccountManagerActivities/useAccountManagerActivity.ts","components/AccountManagers/AccountManagerActivities/useCreateOrUpdateActivity.ts","components/AccountManagers/AccountManagerActivities/CreateOrUpdateActivityModal.tsx","components/AccountManagers/AccountManagerActivities/AccountManagerActivityActionButtons.tsx","components/AccountManagers/AccountManagerActivities/useDeleteAccountManagerActivity.ts","components/AccountManagers/AccountManagerActivities/DeleteAccountManagerActivityDropdownItem.tsx","components/AccountManagers/AccountManagerActivities/AccountManagerActivityListItem.tsx","components/AccountManagers/AccountManagerActivities/AccountManagerActivityList.tsx","components/Settings/Users/CreateUserMutation.tsx","components/Settings/Users/CreateUserModal.tsx","components/Dealers/dealerValidationSchema.ts","components/Dealers/DealerContacts/dealerContactValidationSchema.ts","components/Dealers/DraftDealers/DraftDealerQuery.tsx","components/Dealers/CreateHouseDealer/CreateHouseDealerMutation.tsx","components/Dealers/DealerList/DealerListFilterPanel.tsx","components/Dealers/DealerBadges.tsx","components/Dealers/DealerList/DealerListSearchForm.tsx","components/RegionalSalesManagers/fragments.ts","components/Settings/Users/UserQuery.tsx","components/Settings/Users/IdentityProviderUserListQuery.tsx","components/Settings/Users/IdentityProviderUserQuery.tsx","components/Settings/Users/IdentityProviderUserSelect.tsx","components/Settings/Users/CreateUserFormInner.tsx","components/Proposals/CreateProposalTypeScene.tsx","components/shared/AutoConvertLogo.svg","components/AccountManagers/AccountManagerActivities/AccountManagerActivityTabContent.tsx","components/Settings/Users/CreateUserForm.tsx","components/RegionalSalesManagers/RegionalSalesManagerListQuery.tsx","components/Proposals/ProposalList/ProposalListActionButtons.tsx","components/Proposals/ProposalList/RunningMannDropDownItem.tsx","components/PagedList/RunningManDropdown.tsx","components/Proposals/ProposalList/SlaDropdown.tsx","components/Proposals/ProposalList/ProposalDropdown.tsx","components/Proposals/ProposalList/ProposalListItem.tsx","components/Proposals/ProposalStatisticsQuery.tsx","components/Proposals/ProposalList/ProposalListTotals.tsx","components/Proposals/ProposalList/ProposalSearchFilterPanel.tsx","components/Proposals/ProposalList/ProposalStatusDropdown.tsx","components/Proposals/ProposalList/ProposalSearchInputField.tsx","components/Proposals/ProposalList/index.tsx","components/Dealers/CreateHouseDealer/HouseDealerFormInner.tsx","components/Dealers/CreateHouseDealer/CreateHouseDealerModal.tsx","components/Dealers/DealerList/DealerListActionButtons.tsx","components/Dealers/DealerList/DealerDropdown.tsx","components/Dealers/DealerList/DealerListItem.tsx","components/Dealers/DealerList/index.tsx","components/Quotations/CreateQuotationMutation.tsx","components/Quotations/QuotationBadges.tsx","components/PagedList/ListTotals.tsx","components/Dealers/CreateDealerMutation.tsx","components/Dealers/DealerLenderList/LendersListQuery.tsx","components/Settings/Users/ResetPasswordDropdownItem.tsx","components/Settings/Users/UserBadges.tsx","components/Dealers/DealerForm/AccountManagerSection.tsx","components/Dealers/DealerForm/CompaniesHouseSearchLink.tsx","components/Dealers/DealerForm/DealerQuestion.tsx","components/Dealers/DealerForm/CompanyDetailsSection.tsx","components/Dealers/DealerForm/CreateQuestionnaireSection.tsx","components/Dealers/DealerForm/CurrentSituationSection.tsx","components/Dealers/DealerForm/DealerBankDetailsSection.tsx","components/Dealers/DealerForm/DealerContactsDetailsSection.tsx","components/Dealers/DealerForm/DealerContactsSection.tsx","components/Dealers/DealerForm/DealerDetailsFormSection.tsx","components/Dealers/DealerForm/DealerInformationSection.tsx","components/Dealers/DealerForm/DealerSummarySection.tsx","components/Dealers/DealerForm/HistoricRelationshipCheckSection.tsx","components/Dealers/DealerForm/ProductMixSection.tsx","components/Dealers/DealerForm/DuplicateDealerFoundModal.tsx","components/Dealers/DealerForm/DealerPricingSection.tsx","components/Dealers/DealerForm/DealerProofsSection.tsx","components/Dealers/DealerForm/LenderPackagesSection.tsx","components/Dealers/DealerForm/index.tsx","components/Dealers/DealerForm/ProofUploadForm.tsx","components/Dealers/DraftDealers/DealerProofsContent.tsx","components/Settings/Users/LinkUserToIdentityProviderMutation.tsx","components/Settings/Users/LinkUserToIdentityProviderModal.tsx","components/Settings/Users/BlockOrUnblockUserMutation.tsx","components/Settings/Users/BlockOrUnblockUserDropdownItem.tsx","components/Quotations/CreateQuotationScene.tsx","components/Proposals/DraftProposals/DraftProposalListFilterPanel.tsx","components/Proposals/DraftProposals/DeleteDraftProposalMutation.tsx","components/Proposals/DraftProposals/DraftProposalListQuery.tsx","components/Proposals/DraftProposals/DeleteDraftProposalDropdownItem.tsx","components/Proposals/DraftProposals/DraftProposalBadges.tsx","components/Proposals/DraftProposals/DraftProposalListItem.tsx","components/Proposals/DraftProposals/DraftProposalList.tsx","components/Proposals/DraftProposals/DraftProposalListScene.tsx","components/Dealers/DraftDealers/DraftDealerListFilterPanel.tsx","components/Dealers/DraftDealers/DeleteDraftDealerMutation.tsx","components/Dealers/DraftDealers/DeleteDraftDealerDropdownItem.tsx","components/Dealers/DraftDealers/DraftDealerBadges.tsx","components/Dealers/DraftDealers/DraftDealerListItem.tsx","components/Dealers/DraftDealers/DraftDealerList.tsx","components/Dealers/DraftDealers/DraftDealerListScene.tsx","components/Quotations/QuotationList/QuotationListActionButtons.tsx","components/Quotations/QuotationList/QuotationListFilterPanel.tsx","components/Quotations/DeleteQuotationMutation.tsx","components/Quotations/DeleteQuotationDropdownItem.tsx","components/Quotations/QuotationList/QuotationListItem.tsx","components/Quotations/QuotationList/index.tsx","components/Settings/Users/DeleteUserMutation.tsx","components/Settings/Users/DeleteUserDropdownItem.tsx","components/Settings/Users/UserListItem.tsx","components/Settings/Users/UserSearchFilterPanel.tsx","components/Settings/Users/UserList.tsx","components/Dealers/CreateDealerBreadcrumbs.tsx","components/Dealers/DraftDealers/CreateOrUpdateDraftDealerMutation.tsx","components/Dealers/DraftDealers/DraftDealerService.tsx","components/Dealers/CreateDealerScene.tsx","components/Dealers/DraftDealers/EsignDocumentViewer.tsx","components/Dealers/DealerListScene.tsx","components/Proposals/ProposalDealerCommissionList/ProposalDealerCommissionListQuery.tsx","components/Dealers/AddDealerToAutoConvertMutation.tsx","components/Dealers/ApproveDealer/approveDealerValidationSchema.tsx","components/Dealers/ApproveDealer/ApproveDealerModal.tsx","components/Dealers/SuspendDealerModal.tsx","components/Dealers/BonafideeModal.tsx","components/Proposals/ProposalDealerCommissionList/ProposalDealerCommissionListItem.tsx","components/Proposals/ProposalDealerCommissionList/ProposalDealerCommissionListTotals.tsx","components/Proposals/ProposalDealerCommissionList/index.tsx","components/Dealers/DealerScene/DealerCommissionTabContent.tsx","components/Dealers/DealerContacts/CreateOrUpdateDealerContactMutation.tsx","components/Dealers/DealerContacts/CreateOrUpdateDealerContactModal.tsx","components/Dealers/DealerContacts/DealerContactBadges.tsx","components/Dealers/DealerContacts/DeleteDealerContactMutation.tsx","components/Dealers/DealerContacts/DeleteDealerContactDropdownItem.tsx","components/Dealers/DealerContactList/DealerContactListItem.tsx","components/Dealers/DealerContactList/index.tsx","components/Dealers/DealerScene/DealerContactsTabContent.tsx","components/Dealers/DealerScene/DealerDetailsTabContent.tsx","components/Proposals/ProposalDealerOverview/ProposalDealerOverviewQuery.tsx","components/Proposals/ProposalDealerOverview/ProposalDealerOverviewSummary.tsx","components/Dealers/UpdateDealerAddressMutation.tsx","components/Dealers/DealerAddressForm/dealerAddressValidationSchema.ts","components/Dealers/DealerAddressForm/index.tsx","components/Dealers/DealerAddressForm/DealerAddressFormControls.tsx","components/Dealers/DealerScene/DealerAddressModal.tsx","components/Dealers/DealerScene/DealerOverviewTabContent.tsx","components/Dealers/DealerScene/DealerProposalsTabContent.tsx","components/Dealers/DealerScene/DealerQuotationsTabContent.tsx","components/Dealers/DealerScene/DealerTabHeaders.tsx","components/Dealers/DealerScene/DealerUsersTabContent.tsx","components/Dealers/DealerLenderList/DealerLenderRatesQuery.tsx","components/Dealers/DealerLenderList/DeleteDealerLenderRateMutation.tsx","components/Dealers/DealerLenderList/DeleteDealerLenderListItem.tsx","components/Dealers/DealerLenderList/DealerLenderListItem.tsx","components/Dealers/DealerLenderList/CreateOrUpdateDealerLenderRateMutation.tsx","components/Dealers/DealerLenderList/LenderRateValidationSchema.tsx","components/Dealers/DealerLenderList/CreateOrUpdateLenderRateModal.tsx","components/Dealers/DealerLenderList/index.tsx","components/Dealers/DealerScene/DealerLendersTabContent.tsx","components/Dealers/AgreePricing/agreePricingValidationSchema.tsx","components/Dealers/AgreePricing/AgreePricingModal.tsx","components/Dealers/ApproveCompliance/approveComplianceValidationSchema.tsx","components/Dealers/ApproveCompliance/approveComplianceModal.tsx","components/Dealers/DraftDealers/EsignatureSummary.tsx","components/Dealers/DraftDealers/DealerEsignContent.tsx","components/Dealers/DealerScene/DealerEsignatureTabContent.tsx","components/Dealers/DealerScene/DealerProofsTabContent.tsx","components/Dealers/DealerScene/index.tsx","components/Dealers/DealerScene/UserDealerScene.tsx","components/Dealers/DraftDealers/SearchConsentScene.tsx","components/Dealers/DraftDealers/TermsAndConditionsScene.tsx","components/Dealers/DealerRouter.tsx"],"names":["ModalForm","isOpen","toggle","headerText","onSubmit","initialValues","children","submitButtonText","validationSchema","context","centered","modalTransition","timeout","merge","default","values","then","formikProps","handleSubmit","formSize","FormSize","NARROW","color","outline","onClick","type","USER_LIST","gql","UserShallowFragment","useUserList","input","useQuery","variables","loading","data","users","UserListQuery","query","MyDatePicker","DatePicker","CustomDatePicker","className","selected","onDayChange","selectsStart","selectsEnd","startDate","endDate","placeholder","showMonthYearPicker","dateFormat","inputStyle","minDate","maxDate","showTimes","disabled","moment","toDate","undefined","onChange","date","customInput","style","placeholderText","showTimeSelect","buttonOptions","label","value","start","end","editDates","divider","getMonthDateRange","subtract","getCurrentQuarter","add","startOf","toISOString","endOf","getYearDateRange","format","getFinancialYearDateRange","getPeriodDescription","range","find","opt","PeriodPicker","props","getDateRange","bind","this","compactView","monthsOnly","dateRange","x","isEqual","classNames","caret","map","i","key","active","onSelectMonth","width","fixStartDate","roundToUnit","startAdjusted","endAdjusted","isBefore","React","PeriodPickerField","submitOnChange","startDateFieldName","endDateFieldName","editDatesFieldName","form","setFieldValue","submitForm","setTimeout","DRAFT_DEALER_LIST","DraftDealerShallowFragment","GET_REGIONAL_SALES_MANAGER","RegionalSalesManagerFragment","useRegionalSalesManager","id","skip","regionalSalesManager","RegionalSalesManagerQuery","result","userProfileValidationSchema","Yup","shape","nullable","forename","max","when","is","create","required","surname","email","identityProviderUserId","createNewLogin","roles","of","min","setPassword1","setPwd","test","validatePassword","setPassword2","pwd","oneOf","dealerId","includes","UserRoles","dealer","moreThan","accountManagerId","account_manager","accountManagerRegionalSalesManagerId","regionalSalesManagerId","regional_sales_manager","regionalSalesManagerRegion","mobile","telephoneValidationSchema","FORMSTATE_createNewLogin","FORMSTATE_enableLinkToExistingLogin","FORMSTATE_setPassword","FORMSTATE_create","getButtonClass","defaultComparer","value1","value2","RadioButtons","name","options","comparer","valueComparer","data-toggle","index","classnames","e","target","checked","RadioButtonsField","title","colSize","Col","lg","field","setFieldTouched","dealerSetupQuestionnaireValidationSchema","hasPreviousRelationship","datePreviousRelationshipClosed","reasonPreviousRelationshipClosed","issuesWithDealingAgain","highWriteOffsOrArrears","isOnLenderZList","employeeRelationshipWithEVC","employeeRelationshipPreviousDealer","employeeRelationshipPreviousDealerRelationship","relationshipAdditionalInformation","longTermLeaseOnPremises","longTermLeaseOnPremisesDetails","numberOfVehiclesInStock","transform","integer","stockReview","isStockFinanceable","reasonNotFinanceable","isMileageWithinLenderPolicy","highestVehicleMileage","isAgeWithinUnderwritingPolicy","highestVehicleAge","sorStock","smartAndReasonable","hasForecourtAndSignage","reasonNoForecourtOrSignage","vehiclesPhotographedConsistently","advertisesSubprimeFinance","customersFreeToVisit","hasComplaintsProcess","complaintsProcessDetails","reputationConcerns","negativeReviewsOnWeb","negativeReviewsOnWebDetails","negativeReviewsOnSocialMedia","negativeReviewsOnSocialMediaDetails","negativeNews","negativeNewsDetails","hasGoodReputation","wasReferred","referredBy","positiveAndAppropriate","directorsAssociatedWithOtherCompanies","directorOtherCompanyName","directorOtherCompanyUrl","matches","directorOtherCompanyRegNumber","ultimateBeneficialOwners","approvedPersons","investors","otherInterestedParties","financeProviders","financeProvidersDuration","hasVisualShowroomFinance","whyDoesTheDealerWantToWorkWithEVC","productSetupPCP","productSetupLTVLoans","productSetupSubprime","productSetupVATAssist","productSetupZeroPercentSubsidy","productSetupLenders","DEALER_CONTACT_LIST","DealerContactFragment","DEALER_CONTACT_QUERY","DealerContactQuery","dealerContact","useDealerContact","RegionalSalesManagerSelect","state","onSelectRegionalSalesManager","autoFocus","isClearable","isDisabled","userData","q","length","regionalSalesManagers","edges","node","selectedOption","inputValue","onInputChange","setState","filterOption","noOptionsMessage","StatsBox","description","units","ActivityType","accountManagerActivityValidationSchema","notes","activityDate","activityType","CreateOrUpdateActivityFormInner","useLoggedInUser","loggedInUser","isAccountManager","useAccountManagerShallow","accountManager","accountManagerLoading","useDealerShallow","dealerLoading","accountManagerFixed","ContextNames","ACCOUNT_MANAGER","DEALER","dealerFixed","Row","fieldProps","FormGroupWrapper","Input","readOnly","to","icon","faCaretRight","AccountManagerSelect","onSelectAccountManager","DealerSelect","onSelectDealer","did","includeSuspended","RadioField","VISIT","TELEPHONE_CALL","rows","AccountManagerActivityFragment","SingleDealerFragment","AccountManagerShallowFragment","GET_ACCOUNT_MANAGER_ACTIVITY","useAccountManagerActivity","activity","CREATE_OR_UPDATE_ACTIVITY_MUTATION","useCreateOrUpdateActivity","useMutation","cleanActivityBeforeSubmit","cleanFormData","CreateOrUpdateActivityModal","accountManagerActivityId","defaults","mutation","refresh","PagedListContext","useDealer","AccountManagerActivityActionButtons","useToggle","Button","DELETE_ACCOUNT_MANAGER_ACTIVITY","useDeleteAccountManagerActivity","DeleteAccountManagerActivityDropdownItem","message","confirmButtonText","confirmButtonColor","confirm","DropdownItem","preventDefault","stopPropagation","faTrash","AccountManagerActivityListItem","item","showAccountManagerAndDealer","sm","faPhoneAlt","faStoreAlt","formatEnumValue","whiteSpace","ActionsDropdown","ACCOUNT_MANAGER_ACTIVITIES_LIST","defaultSearchArgs","page","pageSize","AccountManagerActivityList","isEditing","hideModal","handleClick","activityId","SearchForm","mapValuesToQuerystring","mapQuerystringToValues","qs","fixedValues","defaultValues","getVariables","memoizeOne","PagedList","listItemComponent","getSearchResults","activities","actionButtonsComponent","fetchPolicy","CREATE_USER","UserFragment","CreateUser","withRouter","display","dealerContactId","fixedRole","history","Modal","CreateUserMutation","CreateUserForm","payload","refetchQueries","createUser","user","push","ModalHeader","ModalBody","CreateUserFormInner","ModalFooter","URL_PATTERN","uniqueEmailAddresses","dealerValidationSchema","isSuspended","isMannIslandDealer","isMannIslandZList","isMultiQuote","stockFunding","franchised","url","fax","ccaNumber","vatNumber","ccaExpiry","established","DATE_PATTERN","testDateStringIsValid","location","latitude","longitude","bank","accountNumber","sortCode","accountName","bankAddress","address","line1","line2","line3","town","postcode","countryId","telephone","contacts","dealerContactValidationSchema","uniqArr","emailCount","forEach","v","requestsDealerPortalUserAccount","lower","toLowerCase","indexOf","createError","path","parent","some","isDirector","RegExp","EMAIL_PATTERN","isEmailValid","FORMSTATE_contactsError","companiesHouseUrl","companyRegNumber","tradingStyle","assetClass","fCAStatus","fCAUrl","netWorthFromCompaniesHouse","averageBalance","monthlyVolume","allProofsProvided","isOnICORegister","icoNumber","agreedApr","questionnaire","FORMSTATE_requiresQuestionnaire","dealerSetupV2","documentStorageRef","uuid","addressValidationSchema","position","sMS","emailInclude","requestsLogin","DealerContactEmailInclude","NONE","directorDateOfBirth","typeError","isFCARegulatedPerson","homeAddress","isMainContact","isSAFTested","GET_DRAFT_DEALER","DraftDealerFragment","DealerEsignatureFragment","GET_DEALER_EIGNATURE","useDealerEsignature","docType","dealerEsignature","DraftDealerQuery","draftDealerId","draftDealer","CREATE_HOUSE_DEALER","DealerFragment","useCreateHouseDealer","createHouseDealer","houseDealer","GET_ACCOUNT_MANAGER","DealerListFilterPanel","isAdministrator","DealerMapType","LOCATIONS","PROPOSAL_PAIDOUT_VALUE","DealerMapStyle","LIGHT","DARK","SATELLITE","md","hasProposalsPaidOutInTimePeriod","config","AUTOCONVERT_NAME","dss","Object","keys","DealerSetupStatus","DealerBadges","groups","countOfActiveProposals","contractSigned","autoConvert","setupStatus","isDealer","convertToTitleCase","g","IsStatusFullySetup","el","Math","pow","viewStatePropNames","mapOptionsPropNames","lastMonth","fundedDealersOnly","hasActivityInLastSixWeeks","hasActivityInLastYear","hasActiveProposalsOnly","hasLocationOnly","locationNotFoundOnly","proposalStartDate","proposalEndDate","proposalEditDates","mapType","mapStyle","autoConvertOnly","houseDealersOnly","defaultViewState","zoom","pitch","bearing","DealerListSearchForm","fixedPageSize","fixedPage","fixedHasLocationOnly","cleanNumber","omit","concat","viewState","pick","totalFinanceFilter","prevValues","currentValues","ignorePropNames","prevFormValues","currentFormValues","shouldSubmit","formValuesChanged","searchTextChanged","p","prevViewStateValues","currentViewStateValues","initialViewState","onViewStateChanged","nextViewState","k","GET_USER","GET_USER_SHALLOW","useUser","useUserShallow","UserQuery","IDENTITY_PROVIDER_USER_LIST","IdentityProviderUserFragment","IdentityProviderUserListQuery","debounceKey","DebounceKeys","SEARCH_IDENTITY_PROVIDER_USERS","debounceTimeout","GET_IDENTITY_PROVIDER_USER","IdentityProviderUserQuery","IdentityProviderUserSelect","onSelectIdentityProviderUser","useState","updateQuery","identityProviderUsers","username","identityProviderUser","CustomSelect","roleOptions","RegionalSalesManagerField","rsmId","narrowCol","wideCol","isRegionalSalesManager","FormikEffects","prev","current","clearField","f","FormGroup","Label","FormFieldWrapper","option","onBlur","component","FormInputField","REGIONAL_SALES_MANAGER","amId","vertical","userProfile","validateForm","readonly","getBreadcrumbData","quotation","getFullName","retrieveRedirectLink","quotationId","CreateProposalTypeScene","match","loggedInDealerId","params","convertNumber","parseInt","dealerData","breadcrumbs","ProposalType","INDIVIDUAL","size","faUser","BUSINESS","faBuilding","module","exports","UserAccountManagerActivityTabContent","AccountManagerActivityTabContent","decodeURIComponent","validateOnChange","REGIONAL_SALES_MANAGER_LIST","RegionalSalesManagerListQuery","ProposalListActionButtons","checkCanCreate","checkCanRead","PermissionModuleNames","Proposals","DraftProposals","RunningManDropDownItem","error","runningManText","proposalSlas","sLAs","faArrowDown","LoadingSpinner","RunningManDropdown","allowClicks","UncontrolledDropdown","DropdownToggle","faRunning","DropdownMenu","right","PROPOSAL_SLAS","SlaDropdown","memo","SLAs","setSLAs","useLazyQuery","getSLAs","useEffect","Array","isArray","sla","DELETE_PROPOSAL","REFRESH_PROPOSAL","ProposalDropdown","proposal","proposalRef","autoConvertReference","requestSlas","deleteProposal","refreshProposal","client","useApolloClient","individualCustomer","business","checkCanDelete","canOpenInAutoConvert","href","AUTOCONVERT_URL","rel","src","AutoConvertLogo","alt","ms","Promise","resolve","PROPOSAL_LIST","faSync","ProposalListItemLoadingPlaceholder","colSpan","ProposalListItemNoItemsPlaceholder","compose","encodeURIComponent","vehicle","regNo","toUpperCase","make","model","finance","totalFinance","formatCurrency","round","aprRate","dealerCommission","ProposalBadges","toString","PROPOSAL_STATISTICS","ProposalListTotals","searchArgs","proposalStatistics","useProposalStatistics","ListTotals","totalDealerCommission","getQuerystringForReports","args","status","s","replace","convertedArgs","querystring","stringify","ProposalSearchFilterPanel","isSuperUser","filterByDate","ProposalSearchDateLookup","ProposalSearchDate","CREATED_DATE","BooleanCheckboxField","FileDownloadLink","API_URL","faFileExcel","ProposalStatusDropdownItem","updateStatus","ProposalStatusDropdown","withToggleState","currentStatus","difference","ActiveProposalStatus","ProposalStatusLookup","allStatus","ProposalStatusEnum","activeGroup","inactiveGroup","InputGroupButtonDropdown","addonType","ProposalSearchInputField","InputGroup","InputGroupAddon","faSearch","getQuerystringStatus","hasDebitBackOnly","getStatusFromQuerystring","PAID_OUT_DATE","statisticsFilterByDate","ProposalListTableContainer","ProposalList","defaultArgs","fixedArgs","searchInput","filterPanel","table","setStatusToAll","statusIncludesPaidOut","PAID_OUT","proposals","listItemsContainer","pollInterval","loadingPlaceholder","noItemsPlaceholder","ProposalListItem","withLoggedInUser","HouseDealerFormInner","requiresHouseDealer","houseDealerValidationSchema","CreateHouseDealerModal","useHistory","MapButtonLabel","faMapMarked","getCreateDealerUrl","CreateDealerButton","DealerListActionButtons","selectedAccountManager","useAccountManager","loggedInAccountManager","useLoggedInAccountManager","canCreate","Dealers","showHouseDealerModal","setShowHouseDealerModal","toggleHouseDealerModal","hasHouseDealer","UncontrolledButtonDropdown","RouterDropdownItem","window","search","faHome","DELETE_DEALER","DealerDropdown","deleteDealer","DEALER_LIST","DealerListItem","noGutters","getShortAddress","DealerList","SearchFormControls","dealers","CREATE_QUOTATION","QuotationFragment","CREATE_MANN_ISLAND_QUOTATION","CreateMannIslandMutation","useMannIslandCreateQuotation","useCreateQuotation","CreateQuotation","QuotationBadges","term","productType","monthlyPayment","submittedDate","financeValue","getShortDateAndTime","isSame","distanceInWords","Date","charAt","slice","faSpinner","spin","ListTotalsItem","CREATE_OR_UPDATE_DEALER","FullDealerFragment","useCreateOrUpdateDealer","CreateDealer","LENDERS_LIST","LendersListQuery","RESET_PASSWORD","ResetPasswordButton","onCompleted","userResetPassword","success","console","log","resetPassword","faEnvelope","ResetPasswordDropdownItem","UserBadges","r","administrator","senior_manager","AccountManagerSection","CompaniesHouseSearchLink","faExternalLinkAlt","DealerQuestion","text","Component","fcaStatusList","CompanyDetailsSection","isDealerSetupV2","showFlags","SelectField","FollowUpQuestions","show","CreateQuestionnaireSection","navigateToSection","DealerFormSectionName","HISTORIC_CHECK","CurrentSituationSection","formik","DealerBankDetailsSection","bankDetails","invalidBankAccount","FORMSTATE_invalidBankAccount","accountNotFound","displayType","onValueChange","formattedValue","ValidateBankAccountButton","validateFormData","errors","onBankAccountValidated","isValid","branch","DealerContactsDetailsSection","contact","TitleSelectField","DateSelectRow","AddressFormSection","pathToAddress","ShortContactSummary","DealerContactsSection","isValidated","collapsedItems","_","isSectionTouched","arrayHelpers","collapseItem","expandItem","faChevronUp","faChevronDown","remove","validateContactDetails","array","splice","assetList","asset","CHECK_DEALER_EXISTS","DealerDetailsFormSection_FunctionalComponent","populateModal","handleBlur","checkDealerExists","setDuplicateDealers","creatingNewDealer","prevState","JSON","spellCheck","event","currentTarget","trim","IsDealerSigned","leaseOptions","lease","DealerInformationSection","SummaryRowSection","subtitle","useHtmlElementClass","SummaryRow","highlight","AddressRow","hasAddress","getSingleLineAddress","hasContactDetails","DealerSummarySection","proofref","proofsLoaded","setProofsLoaded","proofEnough","setProofEnough","declaration","pt","DealerProofType","loadingProofs","axios","get","headers","dp","resp","res","proofType","c","documents","doc","d","metadata","Proof","isProofEnough","catch","Alert","fade","scrollTo","document","body","scrollHeight","hasDealerPricingDetails","roundNumber","HistoricRelationshipCheckSection","lenderOptions","sort","ProductMixSection","defaultValue","isMulti","closeMenuOnSelect","showModal","dealerList","scrollable","Table","hover","cursor","newWindow","open","opener","openInNewTab","origin","DealerPricingSection","decimalScale","DealerProofsSection","DealerProofsContent","isDraft","setFieldValueFunc","storageRef","sortByName","a","b","DealerFormSections","summaryComponent","watchFields","DEALER_DETAILS","DealerDetailsFormSection","isRateForRisk","COMPANY_DETAILS","BANK_DETAILS","CREATE_QUESTIONNAIRE","CreateQuestionnnaireSection","AutoGeneratedFormSectionSummary","firstColumnSize","DEALER_INFORMATION","CURRENT_SITUATION","CONTACTS","DEALER_PRICING","LENDER_PACKAGES","onPackageChange","am","action","removedValue","pricing","currL","currP","lender","lenderid","apr","commission","asmoney","lendersListOptions","lendersList","l","xs","unitsPosition","DEALER_PROOFS","PRODUCT_MIX","SUMMARY","DealerForm","setTouched","listOfDealers","duplicateDealerList","toggleModal","getSections","handleSaveDraft","debounce","leading","getDraftDealerValidationMessage","handleSectionChanged","section","initialSection","savingDraft","onSubmitDealer","draftDealerLastSaved","canUpdate","currentSection","setSubmitting","isInitialValid","validateOnBlur","saveDraftProps","saveDraft","draftLastSaved","draftValidationMessage","isSubmitting","dirty","MultiSectionForm","createOrUpdate","CreateOrUpdateMode","UPDATE","CREATE","sections","onSectionChanged","initialTouched","missingFields","join","touched","formData","editMode","includeQuestionnaire","includeBankDetails","hideAccountMgrSection","hideContactsSection","hideLendersSection","filter","isSeparator","getBase64","file","baseURL","reader","FileReader","readAsDataURL","onload","getExtension","substring","removeExtension","filename","ext","endsWith","withAlerts","header","proofRef","onFileUploaded","addAlert","setFile","setTitle","uploading","setUploading","getToken","useAuth0","maxMb","cTitle","DealerProofRef","Filename","Title","Ext","Base64","token","async","tmp","err","post","authorization","method","encType","files","htmlFor","sortByDocumentProof","sortByDocumentTitle","DealerProofsSummaryContent","proofs","rootUrl","rootPath","relativePath","deleting","deletingIndex","faIcons","faIdBadge","faFileAlt","faCreditCard","faCamera","onProofDelete","ev","uniqueId","delete","getFileInfo","ipe","canEdit","canManageProposalFiles","faPlus","LINK_USER","LinkUserToIdentityProvider","LinkUserToIdentityProviderMutation","linkUserToIdentityProvider","updated","BLOCK_USER","BlockOrUnblockUserMutation","BlockOrUnblockUser","refreshSearchArgs","blocked","administratorsOnly","BlockOrUnblockUserButton","faCheckCircle","faBan","fixedWidth","BlockOrUnblockUserDropdownItem","dealerLI","useLoggedInDealer","useParams","mannIslandMutation","NeedsDealerSigned","showDealerSelect","onSubmitQuotation","capId","QUOTATION_LIST","created","createMannIslandQuotation","writeFragment","fragment","fragmentName","imported","createQuotation","DraftProposalListFilterPanel","DELETE_DRAFT_PROPOSAL","DeleteDraftProposalMutation","DRAFT_PROPOSAL_LIST","DraftProposalShallowFragment","DeleteDraftProposalDropdownItem","draftProposal","DraftProposalBadges","isDirectDeal","Badge","DistanceInWordsText","DraftProposalListItem","customerDescription","vehicleDescription","DraftProposalList","draftProposals","DraftProposalBreadcrumbs","Breadcrumbs","DealerQuery","Container","DraftDealerListFilterPanel","DELETE_DRAFT_DEALER","DeleteDraftDealerMutation","DeleteDraftDealerDropdownItem","DraftDealerBadges","DraftDealerListItem","DraftDealerList","draftDealers","DraftDealerBreadcrumbs","DraftDealerListScene","QuotationListActionButtons","Quotations","QuotationListFilterPanel","DELETE_QUOTATION","DeleteQuotationDropdownItem","useDeleteQuotation","QuotationListItem","fullName","cashPrice","partExchangeSettlement","deposit","partExchangeValue","QuotationList","quotations","DELETE_USER","DeleteUserMutation","DeleteUserDropdownItem","UserListItem","onSelectUser","faUserPlus","case_management_team","UserSearchFilterPanel","roleText","updateRoleText","isLoading","UserList","handleSelectUser","selectedUserId","LinkUserToIdentityProviderModal","CreateUserModal","amDealersPath","CreateDealerBreadcrumbs","CREATE_OR_UPDATE_DRAFT_DEALER","CreateOrUpdateDraftDealer","DraftDealerService","draftDealerInitialValues","parse","dealerJson","removeIdFields","hydrateTouchedData","touchedFields","CreateOrUpdateDraftDealerMutation","mutationFunction","mutate","existing","cleanDraftDealer","cloneDeep","serializeTouchedData","draft","createOrUpdateDraftDealer","resetFieldsWithErrors","CreateDealerScene","requiresQuestionnaire","draftDealerLoading","CreateDealerMutation","submitted","createOrUpdateDealer","CreateDealerNoQuestionnaireScene","pdfjs","GlobalWorkerOptions","workerSrc","version","EsignDocumentViewer","docTitle","getUrl","postUrl","formSubmitting","docLoaded","docSigned","pageNumber","pageScale","auth0Token","containerRef","onResize","useCallback","entries","entry","containerWidth","contentRect","setPageNumber","num","useResizeObserver","getBase64PDF","buf","Buffer","from","base64","base64PDF","bufferPDF","signatoryCode","jumpToDealer","createBrowserHistory","forceRefresh","SetErrorState","response","serverError","initialGetBase64PDFAsync","error2","onLoadSuccess","numPages","scale","faSearchPlus","faExpand","faSearchMinus","faFastBackward","faStepBackward","faStepForward","faFastForward","iframe","write","close","handleOpenInNew","faExternalLinkSquareAlt","formikAction","UniqueId","sigCode","hasConfirmed","DealerListScene","PROPOSAL_DEALER_COMMISSION_LIST","ShallowProposalFragment","PROPOSAL_DEALER_COMMISSION_LIST_TOTALS","ADD_DEALER_TO_AUTOCONVERT","AddDealerToAutoConvertMutation","approveDealerValidationSchema","termsAgreedBy","APPROVE_DEALER","approveDealer","userName","GET_DEALER","Form","SUSPEND_OR_UNSUSPEND_DEALER","SuspendDealerModal","suspendOrUnsuspendDealer","suspended","BonafideeModal","alert","setIsLoading","finally","ProposalDealerCommissionListItem","commissionType","debitBackType","getName","commissionDate","ProposalDealerCommissionListTotals","commissionTotals","useProposalDealerCommissionListTotals","totalOutstandingDebitBack","ProposalDealerCommissionListActionButtons","ButtonDropdown","faFilePdf","TableWrapper","LoadingPlaceholder","NoItemsPlaceholder","mapDate","ProposalDealerCommissionList","UserDealerCommissionTabContent","DealerCommissionTabContent","CREATE_OR_UPDATE_DEALER_CONTACT","CreateOrUpdateDealerContactModal","useCreateOrUpdateDealerContact","rawValues","hasLogin","TO","CC","DealerContactBadges","DELETE_DEALER_CONTACT","DeleteDealerContactMutation","DeleteDealerContactDropdownItem","DealerContactListItem","onCreateUser","checkCanUpdate","DealerContacts","Users","DealerContactList","showContactModal","showUserModal","selectedContactId","modalState","setModalState","toggleContactModal","DealerContactsTabContent","cleanDealerBeforeSubmit","staticMapUrl","googleMapsUrl","hasRecentActivity","needsEsignForced","companyType","approvedDate","DealerDetailsTabContentInner","loadingUser","UserDealerDetailsTabContent","useLoggedInDealerWithQuestionnaire","DealerDetailsTabContent","useDealerWithQuestionnaire","PROPOSAL_DEALER_OVERVIEW","ProposalDealerOverviewSummary","formState","setFormState","overview","useProposalDealerOverview","checkCanReadInternal","xl","edit","shortenNumberForDisplay","totalCreatedCount","totalPaidOutCount","getProportion","totalDebitBackAmount","totalNetProfit","UPDATE_DEALER_ADDRESS","validateLatLng","currentValue","otherValue","locationValidationSchema","dealerAddressValidationSchema","FORMSTATE_postcodeNotFound","FORMSTATE_postcodeFound","DealerAddressForm","useUpdateDealerAddress","GET_LOCATION","DealerAddressFormControls","withApollo","locations","locationFromAddress","DealerAddressModal","getGoogleMapsUrl","getMapboxStaticMapUrl","height","baseUrl","MAPBOX_USERNAME","MAPBOX_STYLE","marker","MAPBOX_ACCESS_TOKEN","MapLink","DealerOverviewTabContentInner","setActive","previousApr","UserDealerOverviewTabContent","DealerOverviewTabContent","DealerProposalsTabContent","DealerQuotationsTabContent","DealerTabHeaders","tabs","checkIsAuthorized","PermissionActivityNames","ReadInternal","collapse","AccountManagerActivity","Lenders","DraftDealers","useDealerTabHeaders","FullWidthTabHeaders","DealerUsersTabContent","DEALER_LENDER_RATES_LIST","LenderRatesForDealersFragment","DEALER_LENDER_RATE","DELETE_DEALER_LENDER_RATE","useDeleteDealerLenderRate","DeleteDealerLenderListItem","DealerLenderListItem","rates","dateFromFormatted","dateFrom","dateToFormatted","dateTo","today","rate","asMoney","CREATE_OR_UPDATE_DEALER_LENDER_RATE","useCreateOrUpdateDealerLenderRate","lenderRateValidationSchema","lenderId","CreateOrUpdateLenderRateModal","lenderRate","lenderRateForDealer","useDealerLenderRate","expDate","rateDoesNotExpire","setRateDoesNotExpire","step","preventMaxYear","DealerLenderList","showLenderRateModal","selectedLenderRateId","toggleLenderRateModal","lenderRatesForDealers","UserDealerLendersTabContent","DealerLendersTabContent","AgreePricingValidationSchema","pricingAgreedBy","AGREE_PRICING","AgreePricing","agreePricingValidationSchema","approveComplianceValidationSchema","complianceApprovedBy","COMPLIANCE_APPROVAL","ComplianceApproval","EsignatureSummary","useDE","existingChecked","existingDealerEsignature","remoteAddr","confirmed","DealerEsignContent","UserDealerEsignatureTabContent","DealerDocTypeTitle","SEARCH_CONSENT","DealerDocType","TERMS_AND_CONDITIONS","DealerEsignatureTabContent","DealerProofsTabContent","DealerSceneInner","showApproveModal","setShowApproveModal","showApproveComplianceModal","setShowApproveComplianceModal","showAgreePricingModal","setShowAgreePricingModal","showSuspendModal","setShowSuspendModal","showBonafideeModal","setShowBonafideeModal","showAlert","setShowAlert","isCaseManagementTeam","isSeniorManager","usePreloadedData","addHttp","UpdateInternal","faCheck","bonafidee","SHAREPOINT_URL","sharepointLink","NeedsPricingAgreed","faPiggyBank","NeedsComplianceApproved","NeedsSearchConsent","TabContentContainer","exact","userLoading","GET_DEALER_AND_QUESTIONNAIRE","toggleAlert","SceneLoadingSpinner","UserDealerScene","SearchConsentBreadcrumbs","SearchConsentScene","sharedUrl","TermsAndConditionsBreadcrumbs","TermsAndConditionsScene","DealerMapScene","DealerRouter","fallback","CreateProposalScene","DraftProposalListScene","CreateQuotationScene","DealerScene"],"mappings":"2MAyEeA,IA5CG,YAUa,IAT7BC,EAS4B,EAT5BA,OACAC,EAQ4B,EAR5BA,OACAC,EAO4B,EAP5BA,WACAC,EAM4B,EAN5BA,SACAC,EAK4B,EAL5BA,cACAC,EAI4B,EAJ5BA,SACAC,EAG4B,EAH5BA,iBACAC,EAE4B,EAF5BA,iBACAC,EAC4B,EAD5BA,QAEA,OACE,gBAAC,IAAD,CACER,OAAQA,EACRC,OAAQA,EACRQ,UAAU,EACVC,gBAAiB,CAAEC,QAAS,MAE5B,gBAAC,IAAD,CACEP,cAAeQ,gBAAM,GAAD,OAAKL,QAAL,IAAKA,OAAL,EAAKA,EAAkBM,UAAWT,GACtDD,SAAQ,+GAAE,SAAAW,GAAM,OAAIX,EAASW,GAAQC,KAAKd,MAC1CM,iBAAkBA,IAEjB,SAAAS,GAAW,OACV,gBAAC,IAAD,CAAMb,SAAUa,EAAYC,cAC1B,gBAAC,IAAD,CAAahB,OAAQA,GAASC,GAC9B,gBAAC,IAAD,KACGG,EAAS,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,EACP/6B,UAAWy7B,KAEb,gBAAC,IAAD,CAAOjmC,KAAK,qBAAqBwK,UAAWg8B,KAC5C,gBAAC,IAAD,CAAOxmC,KAAK,WAAWwK,UAAWktB,IAClC,gBAAC,IAAD,CAAO13B,KAAK,UAAUwK,UAAWo7B","file":"static/js/10.b80de23c.chunk.js","sourcesContent":["import { Formik, FormikProps } from \"formik\";\nimport { merge } from \"lodash\";\nimport * as React from \"react\";\nimport {\n Button,\n Form,\n Modal,\n ModalBody,\n ModalFooter,\n ModalHeader\n} from \"reactstrap\";\nimport * as Yup from \"yup\";\nimport { ContextNames, FormSize } from \"../types\";\n\ninterface ModalFormProps {\n initialValues?: Partial;\n isLoading?: boolean;\n onSubmit: (values: Values) => Promise;\n headerText: string;\n submitButtonText?: string;\n children: (\n props: FormikProps & { context?: ContextNames; formSize?: FormSize }\n ) => JSX.Element;\n validationSchema?: Yup.ObjectSchema;\n isOpen: boolean;\n toggle: () => void;\n context?: ContextNames;\n}\n\nconst ModalForm = ({\n isOpen,\n toggle,\n headerText,\n onSubmit,\n initialValues,\n children,\n submitButtonText,\n validationSchema,\n context\n}: ModalFormProps) => {\n return (\n \n onSubmit(values).then(toggle)}\n validationSchema={validationSchema}\n >\n {formikProps => (\n
\n {headerText}\n \n {children({ ...formikProps, context, formSize: FormSize.NARROW })}\n \n \n \n \n \n
\n )}\n \n \n );\n};\n\nexport default ModalForm;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult, useQuery } from \"react-apollo\";\nimport { SearchArgs, SearchResults, User } from \"../../types\";\nimport { UserShallowFragment } from \"./fragments\";\n\nimport { UserProfile, UserSearchArgs } from \"./types\";\n\nexport interface UserListData {\n loggedInUser: User;\n users: SearchResults;\n}\n\nexport const USER_LIST = gql`\n query UserListQuery($input: UserSearchArgsInput) {\n loggedInUser {\n id\n roles\n username\n }\n users(input: $input) {\n pageInfo {\n hasMorePages\n totalResults\n page\n pageSize\n first\n last\n }\n edges {\n node {\n ...UserShallowFragment\n }\n }\n }\n }\n ${UserShallowFragment}\n`;\n\nconst UserListQuery = ({\n children,\n ...input\n}: SearchArgs & {\n children: (\n result: QueryResult\n ) => JSX.Element | null;\n}) => (\n \n query={USER_LIST}\n variables={{ input }}\n >\n {children}\n \n);\n\nexport const useUserList = (input: UserSearchArgs) => {\n const { loading, data } = useQuery(\n USER_LIST,\n { variables: { input } }\n );\n\n return { loading, users: data?.users };\n};\n\nexport default UserListQuery;\n","import moment from \"moment\";\nimport * as React from \"react\";\nimport DatePicker from \"react-datepicker\";\n// tslint:disable-next-line:no-submodule-imports\nimport \"react-datepicker/dist/react-datepicker.css\";\nimport { Input } from \"reactstrap\";\nconst MyDatePicker: React.ComponentType = DatePicker;\n\nconst CustomDatePicker = ({\n className,\n selected,\n onDayChange,\n selectsStart,\n selectsEnd,\n startDate,\n endDate,\n placeholder,\n showMonthYearPicker,\n dateFormat,\n inputStyle,\n minDate,\n maxDate,\n showTimes,\n disabled\n}: {\n className?: string;\n selected?: Date | string;\n selectsStart?: boolean;\n selectsEnd?: boolean;\n startDate?: Date | string;\n endDate?: Date | string;\n placeholder?: string;\n showMonthYearPicker?: boolean;\n dateFormat?: string;\n inputStyle?: React.CSSProperties;\n minDate?: Date | null;\n maxDate?: Date | null;\n showTimes?: boolean;\n disabled?: boolean;\n onDayChange(day?: Date): void;\n}) => (\n onDayChange(date || undefined)}\n dateFormat={dateFormat ? dateFormat : \"dd/MM/yyyy\"}\n customInput={}\n selectsStart={selectsStart}\n selectsEnd={selectsEnd}\n startDate={startDate ? moment(startDate).toDate() : undefined}\n endDate={endDate ? moment(endDate).toDate() : undefined}\n placeholderText={placeholder}\n showMonthYearPicker={showMonthYearPicker}\n minDate={minDate ? moment(minDate).toDate() : null}\n maxDate={maxDate ? moment(maxDate).toDate() : null}\n showTimeSelect={showTimes}\n />\n);\n\nexport default CustomDatePicker;\n","import classNames from \"classnames\";\nimport { isEqual } from \"lodash\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport {\n DropdownItem,\n DropdownMenu,\n DropdownToggle,\n UncontrolledDropdown\n} from \"reactstrap\";\nimport {\n getCurrentQuarter,\n getFinancialYearDateRange,\n getMonthDateRange,\n getYearDateRange\n} from \"../../utils\";\nimport CustomDatePicker from \"../CustomDatePicker\";\n\nexport interface PeriodPickerProps {\n monthsOnly?: boolean;\n editDates?: boolean;\n compactView?: boolean;\n startDate?: Date | string;\n endDate?: Date | string;\n disabled?: boolean;\n onSelectMonth: (\n startDate?: Date,\n endDate?: Date,\n editDates?: boolean\n ) => void;\n className?: string;\n}\n\nconst buttonOptions = [\n {\n label: \"All time\",\n value: { start: undefined, end: undefined }\n },\n {\n label: \"Custom dates\",\n value: { start: undefined, end: undefined },\n editDates: true\n },\n {\n divider: true\n },\n {\n ...getMonthDateRange(moment()),\n label: \"This month\"\n },\n {\n ...getMonthDateRange(moment().subtract(1, \"month\")),\n label: \"Last month\"\n },\n {\n ...getMonthDateRange(moment().subtract(2, \"month\"))\n },\n {\n ...getMonthDateRange(moment().subtract(3, \"month\"))\n },\n {\n ...getMonthDateRange(moment().subtract(4, \"month\"))\n },\n {\n ...getMonthDateRange(moment().subtract(5, \"month\"))\n },\n {\n divider: true\n },\n {\n ...getCurrentQuarter(moment()),\n label: \"Current quarter\"\n },\n {\n ...getCurrentQuarter(moment().subtract(1, 'Q')),\n label: \"Previous quarter\"\n },\n {\n divider: true\n },\n {\n label: \"Last 12 months\",\n value: {\n start: moment()\n .add(1, \"day\")\n .startOf(\"month\")\n .subtract(1, \"year\")\n .toISOString(true),\n end: moment()\n .add(1, \"day\")\n .endOf(\"month\")\n .endOf(\"day\")\n .toISOString(true)\n }\n },\n {\n ...getYearDateRange(moment()),\n label: \"This year\"\n },\n {\n ...getYearDateRange(moment().subtract(1, \"year\")),\n label: `Last year (${moment()\n .subtract(1, \"year\")\n .format(\"YYYY\")})`\n },\n {\n ...getFinancialYearDateRange(moment())\n },\n {\n ...getFinancialYearDateRange(moment().subtract(1, \"year\"))\n }\n];\n\nexport const getPeriodDescription = (\n start?: string | Date,\n end?: string | Date\n) => {\n const startDate = start ? moment(start).toISOString(true) : undefined;\n const endDate = end ? moment(end).toISOString(true) : undefined;\n\n const range = buttonOptions.find(\n opt =>\n opt.value && opt.value.start === startDate && opt.value.end === endDate\n );\n\n if (range) {\n return range.label;\n }\n\n if (!startDate && !endDate) {\n return \"All time\";\n }\n\n if (startDate) {\n if (endDate) {\n return `${moment(start).format(\"LL\")}-${moment(end).format(\"LL\")}`;\n }\n return `On or after ${moment(start).format(\"LL\")}`;\n }\n return `On or before ${moment(end).format(\"LL\")}`;\n};\n\nclass PeriodPicker extends React.Component {\n constructor(props: PeriodPickerProps) {\n super(props);\n this.getDateRange = this.getDateRange.bind(this);\n }\n\n public render() {\n const {\n editDates,\n compactView,\n monthsOnly,\n disabled,\n className\n } = this.props;\n const dateRange = {\n start: this.props.startDate\n ? moment(this.props.startDate).toISOString(true)\n : undefined,\n end: this.props.endDate\n ? moment(this.props.endDate).endOf(\"day\").toISOString(true)\n : undefined\n };\n\n const selected = buttonOptions.find(x =>\n editDates\n ? x.editDates === true\n : !x.editDates && isEqual(dateRange, x.value)\n );\n \n const dateFormat = monthsOnly ? \"MMM yyyy\" : \"dd/MM/yyyy\";\n\n return (\n
\n \n \n {selected ? selected.label : \"Custom date\"}\n \n \n {buttonOptions.map((x, i) =>\n x.divider ? (\n \n ) : (\n {\n const start = x.editDates\n ? this.props.startDate\n : x.value && x.value.start;\n const end = x.editDates\n ? this.props.endDate\n : x.value && x.value.end;\n const { startDate, endDate } = this.getDateRange(\n start,\n end,\n true,\n !!monthsOnly\n );\n\n this.props.onSelectMonth(\n startDate ? moment(startDate).toDate() : undefined,\n endDate ? moment(endDate).toDate() : undefined,\n !!x.editDates\n );\n }}\n >\n {x.label}\n \n )\n )}\n \n \n {(!compactView || editDates) && (\n <>\n {\n const { startDate, endDate } = this.getDateRange(\n date,\n this.props.endDate,\n true,\n !!monthsOnly\n );\n\n this.props.onSelectMonth(startDate, endDate, true);\n }}\n showMonthYearPicker={!!monthsOnly}\n inputStyle={{ width: 120 }}\n />\n {\n const { startDate, endDate } = this.getDateRange(\n this.props.startDate,\n date,\n false,\n !!monthsOnly\n );\n\n this.props.onSelectMonth(startDate, endDate, true);\n }}\n showMonthYearPicker={!!monthsOnly}\n inputStyle={{ width: 120 }}\n />\n \n )}\n
\n );\n }\n\n private getDateRange(\n startDate: Date | string | null | undefined,\n endDate: Date | string | null | undefined,\n fixStartDate: boolean,\n monthsOnly: boolean\n ) {\n const roundToUnit = monthsOnly ? \"month\" : \"day\";\n let startAdjusted = startDate\n ? moment(startDate).startOf(roundToUnit)\n : undefined;\n\n let endAdjusted = endDate\n ? moment(endDate).startOf(roundToUnit)\n : undefined;\n\n if (startAdjusted && endAdjusted && endAdjusted.isBefore(startAdjusted)) {\n if (fixStartDate) {\n endAdjusted = moment(startAdjusted);\n } else {\n startAdjusted = moment(endAdjusted);\n }\n }\n\n return {\n startDate: startAdjusted ? startAdjusted.toDate() : undefined,\n endDate: endAdjusted\n ? endAdjusted\n .add(1, roundToUnit)\n .subtract(1, \"day\")\n .endOf(\"day\")\n .toDate()\n : undefined\n };\n }\n}\n\nexport default PeriodPicker;\n","import { Field, FieldProps } from \"formik\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport PeriodPicker from \"../shared/PeriodPicker\";\n\ninterface PeriodPickerFieldProps {\n compactView?: boolean;\n monthsOnly?: boolean;\n submitOnChange?: boolean;\n startDateFieldName?: string;\n endDateFieldName?: string;\n editDatesFieldName?: string;\n disabled?: boolean;\n}\n\nconst PeriodPickerField = ({\n monthsOnly,\n compactView,\n submitOnChange,\n disabled,\n ...props\n}: PeriodPickerFieldProps) => {\n const {\n startDateFieldName = \"startDate\",\n endDateFieldName = \"endDate\",\n editDatesFieldName = \"editDates\"\n } = props;\n\n return (\n \n {({ form: { values, setFieldValue, submitForm } }: FieldProps) => (\n {\n setFieldValue(\n startDateFieldName,\n startDate ? moment(startDate).format(\"YYYY-MM-DD\") : null,\n !submitOnChange\n );\n setFieldValue(\n endDateFieldName,\n endDate ? moment(endDate).format(\"YYYY-MM-DD\") : null,\n !submitOnChange\n );\n setFieldValue(editDatesFieldName, !!editDates, !submitOnChange);\n submitOnChange && setTimeout(submitForm, 0);\n }}\n />\n )}\n \n );\n};\n\nexport default PeriodPickerField;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult } from \"react-apollo\";\nimport { SearchArgs, SearchResults, User } from \"../../types\";\nimport { DraftDealerShallowFragment } from \"../fragments\";\nimport { DraftDealer } from \"../types\";\n\nexport interface DraftDealerListData {\n loggedInUser: User & {\n draftDealers: SearchResults;\n };\n}\n\nexport const DRAFT_DEALER_LIST = gql`\n query DraftDealerListQuery($input: DraftDealerSearchArgsInput) {\n loggedInUser {\n id\n username\n roles\n draftDealers(input: $input) {\n pageInfo {\n hasMorePages\n totalResults\n page\n pageSize\n first\n last\n }\n edges {\n node {\n ...DraftDealerShallowFragment\n }\n }\n }\n }\n }\n ${DraftDealerShallowFragment}\n`;\n\nconst DraftDealerListQuery = ({\n children,\n ...input\n}: SearchArgs & {\n children: (\n result: QueryResult\n ) => JSX.Element | null;\n}) => (\n \n query={DRAFT_DEALER_LIST}\n variables={{ input }}\n >\n {children}\n \n);\n\nexport default DraftDealerListQuery;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult, useQuery } from \"react-apollo\";\nimport { User } from \"../types\";\nimport { RegionalSalesManagerFragment } from \"./fragments\";\nimport { RegionalSalesManager } from \"./types\";\n\nexport interface LoggedInRegionalSalesManagerProps {\n loggedInUser: User;\n}\n\nexport interface RegionalSalesManagerProps {\n loggedInUser: User;\n regionalSalesManager: RegionalSalesManager;\n}\n\ninterface RegionalSalesManagerData {\n loggedInRegionalSalesManager: RegionalSalesManager;\n regionalSalesManager: RegionalSalesManager;\n}\n\ninterface RegionalSalesManagerArgs {\n id?: string;\n}\n\nexport const GET_REGIONAL_SALES_MANAGER = gql`\n query RegionalSalesManagerQuery($id: ID!) {\n loggedInUser {\n id\n username\n roles\n }\n regionalSalesManager(id: $id) {\n ...RegionalSalesManagerFragment\n }\n }\n ${RegionalSalesManagerFragment}\n`;\n\nconst RegionalSalesManagerQuery = ({\n query,\n children,\n id\n}: RegionalSalesManagerArgs & {\n query?: object;\n children: (\n result: QueryResult & {\n regionalSalesManager?: RegionalSalesManager;\n }\n ) => JSX.Element | null;\n}) => (\n \n query={query || GET_REGIONAL_SALES_MANAGER}\n variables={{ id }}\n skip={!id}\n >\n {result =>\n children({\n ...result,\n regionalSalesManager: result?.data?.regionalSalesManager\n })\n }\n \n);\n\nexport const useRegionalSalesManager = (id?: string) => {\n const { loading, data } = useQuery<\n RegionalSalesManagerData,\n RegionalSalesManagerArgs\n >(GET_REGIONAL_SALES_MANAGER, { variables: { id }, skip: !id });\n\n return { loading, regionalSalesManager: data?.regionalSalesManager };\n};\n\nexport default RegionalSalesManagerQuery;\n","import * as Yup from \"yup\";\nimport { validatePassword } from \"../../../utils\";\nimport telephoneValidationSchema from \"../../Forms/telephoneValidationSchema\";\nimport { UserRoles } from \"../../types\";\nimport { UserProfileInput } from \"./types\";\n\nconst userProfileValidationSchema = Yup.object().shape({\n id: Yup.string()\n .nullable(true)\n .default(undefined),\n forename: Yup.string()\n .label(\"First name\")\n .max(50)\n .nullable(true)\n .when([\"FORMSTATE_createNewLogin\", \"id\"], {\n is: (create: boolean, id?: string) => create && !id,\n then: Yup.string().required()\n }),\n surname: Yup.string()\n .label(\"Last name\")\n .max(50)\n .nullable(true)\n .when([\"FORMSTATE_createNewLogin\", \"id\"], {\n is: (create: boolean, id?: string) => create && !id,\n then: Yup.string().required()\n }),\n email: Yup.string()\n .email()\n .max(255)\n .label(\"Email\")\n .nullable(true)\n .required(),\n identityProviderUserId: Yup.string()\n .nullable(true)\n .default(undefined)\n .label(\"Auth0 user\")\n .when([\"FORMSTATE_createNewLogin\", \"FORMSTATE_create\"], {\n is: (createNewLogin: boolean, create: boolean) =>\n !createNewLogin && create,\n then: Yup.string().required()\n }),\n roles: Yup.array()\n .of(Yup.string().min(1))\n .default(undefined)\n .required()\n .label(\"Role\")\n .min(1, \"At least one role must be specified\"),\n setPassword1: Yup.string()\n .max(100)\n .default(undefined)\n .label(\"Password\")\n .nullable(true)\n .when([\"FORMSTATE_createNewLogin\", \"FORMSTATE_setPassword\"], {\n is: (create: boolean, setPwd: boolean) => create && setPwd,\n then: Yup.string().required()\n })\n .test(\n \"password-complexity\",\n \"Password does not meet complexity requirements\",\n value => !value || validatePassword(value, 3, 8)\n ),\n setPassword2: Yup.string()\n .max(100)\n .default(undefined)\n .label(\"Confirm password\")\n .nullable(true)\n .when(\"setPassword1\", {\n is: (pwd: string) => !!pwd,\n then: Yup.string()\n .required()\n .oneOf([Yup.ref(\"setPassword1\")], \"Passwords must match\")\n }),\n dealerId: Yup.number()\n .label(\"Dealer\")\n .nullable(true)\n .default(undefined)\n .when(\"roles\", {\n is: (roles: UserRoles[]) => roles && roles.includes(UserRoles.dealer),\n then: Yup.number()\n .required()\n .moreThan(0)\n }),\n accountManagerId: Yup.string()\n .label(\"Account manager\")\n .nullable(true)\n .default(undefined)\n .max(10)\n .when(\"roles\", {\n is: (roles: UserRoles[]) =>\n roles && roles.includes(UserRoles.account_manager),\n then: Yup.string().required()\n }),\n accountManagerRegionalSalesManagerId: Yup.string()\n .label(\"Regional sales manager\")\n .nullable(true)\n .default(undefined)\n .when([\"roles\", \"FORMSTATE_create\"], {\n is: (roles: UserRoles[], create: boolean) =>\n create && roles && roles.includes(UserRoles.account_manager),\n then: Yup.string().required()\n }),\n regionalSalesManagerId: Yup.string()\n .nullable(true)\n .default(undefined)\n .label(\"Regional sales manager\")\n .when([\"roles\", \"FORMSTATE_create\"], {\n is: (roles: UserRoles[], create: boolean) =>\n !create && roles && roles.includes(UserRoles.regional_sales_manager),\n then: Yup.string().required()\n }),\n regionalSalesManagerRegion: Yup.string()\n .label(\"Region name\")\n .nullable(true)\n .default(undefined)\n .when([\"roles\", \"FORMSTATE_create\"], {\n is: (roles: UserRoles[], create: boolean) =>\n create && roles && roles.includes(UserRoles.regional_sales_manager),\n then: Yup.string().required()\n }),\n mobile: telephoneValidationSchema.label(\"Mobile\"),\n FORMSTATE_createNewLogin: Yup.boolean()\n .required()\n .default(true),\n FORMSTATE_enableLinkToExistingLogin: Yup.boolean()\n .required()\n .default(true),\n FORMSTATE_setPassword: Yup.boolean()\n .required()\n .default(false),\n FORMSTATE_create: Yup.boolean().default(true)\n});\n\nexport default userProfileValidationSchema;\n","import classnames from \"classnames\";\nimport * as React from \"react\";\nimport \"./formstyles.scss\";\n\nexport interface RadioButtonsProps {\n name: string;\n value?: any;\n options: { label: string | React.ReactElement; value?: any }[];\n onChange: (value?: any) => void;\n color?: string;\n outline?: boolean;\n valueComparer?: (value1?: any, value2?: any) => boolean;\n}\n\nconst getButtonClass = (color?: string, outline?: boolean) => {\n let result = \"btn-\";\n result += outline ? \"outline-\" : \"\";\n result += color ? color : \"secondary\";\n return result;\n};\n\nconst defaultComparer = (value1: any, value2: any) =>\n value1 === value2 || (!value1 && !value2);\n\nconst RadioButtons = ({\n name,\n value,\n options,\n onChange,\n color,\n outline,\n valueComparer\n}: RadioButtonsProps) => {\n const comparer = valueComparer || defaultComparer;\n return (\n
\n {options.map((x, index) => (\n \n {\n e.target.checked && onChange(x.value);\n }}\n checked={comparer(value, x.value)}\n />\n {x.label}\n \n ))}\n
\n );\n};\nexport default RadioButtons;\n","import { Field, FieldProps } from \"formik\";\nimport * as React from \"react\";\nimport { Col } from \"reactstrap\";\nimport \"./formstyles.scss\";\nimport RadioButtons from \"./RadioButtons\";\n\ninterface RadioButtonsFieldProps {\n title?: string;\n name: string;\n options: { label: any; value: any }[];\n color?: string;\n outline?: boolean;\n colSize?: number;\n submitOnChange?: boolean;\n onChange?: (value?: any) => void;\n}\n\nconst RadioButtonsField = ({\n title,\n name,\n options,\n color,\n outline,\n colSize,\n submitOnChange,\n onChange,\n}: RadioButtonsFieldProps) => (\n \n \n {({ form, field }: FieldProps) => (\n <>\n {title && }\n
\n {\n form.setFieldValue(field.name as any, value, !submitOnChange);\n form.setFieldTouched(field.name as any, true, !submitOnChange);\n if (onChange) {\n onChange(value);\n }\n submitOnChange && form.submitForm();\n }}\n />\n
\n \n )}\n
\n \n);\n\nexport default RadioButtonsField;\n","import * as Yup from \"yup\";\nimport { DealerSetupQuestionnaire } from \"./types\";\n\nconst URL_PATTERN = /^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w.-]+)+[\\w\\-._~:/?#[\\]@!$&'()*+,;=.]+$/;\n\nconst dealerSetupQuestionnaireValidationSchema = Yup.object<\n DealerSetupQuestionnaire\n>().shape({\n hasPreviousRelationship: Yup.boolean()\n .label(\"Does the dealer have a previous relationship with EVC\")\n .default(undefined),\n datePreviousRelationshipClosed: Yup.date()\n .label(\"When was the previous relationship closed\")\n .default(undefined)\n .nullable(true),\n reasonPreviousRelationshipClosed: Yup.string()\n .max(100)\n .default(undefined)\n .nullable(true)\n .label(\"Reason previous relationship was closed\"),\n issuesWithDealingAgain: Yup.boolean()\n .label(\n \"Do the reasons that the previous relationship was closed present problems for dealing again?\"\n )\n .default(undefined),\n highWriteOffsOrArrears: Yup.boolean()\n .default(undefined)\n .label(\"Did we experience high levels of write-offs or arrears\"),\n isOnLenderZList: Yup.boolean()\n .default(undefined)\n .label(\"Is the dealer on any lender Z list\"),\n employeeRelationshipWithEVC: Yup.boolean()\n .default(undefined)\n .label(\"Have any dealership employees had a previous relationship with EVC\"),\n employeeRelationshipPreviousDealer: Yup.string()\n .max(100)\n .default(undefined)\n .nullable(true)\n .label(\"What dealership did the employee work for\"),\n employeeRelationshipPreviousDealerRelationship: Yup.string()\n .max(100)\n .default(undefined)\n .nullable(true)\n .label(\"How was the previous dealer's relationship with EVC\"),\n relationshipAdditionalInformation: Yup.string()\n .max(100)\n .label(\"Additional information\")\n .default(undefined)\n .nullable(true),\n longTermLeaseOnPremises: Yup.boolean()\n .default(undefined)\n .label(\"Long term lease on premises\"),\n longTermLeaseOnPremisesDetails: Yup.string()\n .max(100)\n .label(\"Type of ownership or lease\")\n .default(undefined)\n .nullable(true),\n numberOfVehiclesInStock: Yup.number()\n .transform(value => (value || value === 0 ? value : null))\n .label(\"Number of vehicles in stock\")\n .default(undefined)\n .min(0)\n .integer()\n .nullable(true),\n stockReview: Yup.string()\n .max(100)\n .nullable(true)\n .default(undefined),\n isStockFinanceable: Yup.boolean()\n .label(\"Is 90% or more of dealer stock financeable\")\n .default(undefined)\n .nullable(true),\n reasonNotFinanceable: Yup.string()\n .max(100)\n .label(\"Reason 90% or more of dealer stock is not financeable\")\n .default(undefined)\n .nullable(true),\n isMileageWithinLenderPolicy: Yup.boolean()\n .label(\"Is mileage within lender policy\")\n .default(undefined)\n .nullable(true),\n highestVehicleMileage: Yup.number()\n .label(\"Highest vehicle mileage\")\n .min(0)\n .integer()\n .default(undefined)\n .transform(value => (value || value === 0 ? value : null))\n .nullable(true),\n isAgeWithinUnderwritingPolicy: Yup.boolean()\n .label(\"Are the vehicle ages within underwriting policy\")\n .default(undefined)\n .nullable(true),\n highestVehicleAge: Yup.number()\n .label(\"Highest vehicle age\")\n .min(0)\n .integer()\n .default(undefined)\n .transform(value => (value || value === 0 ? value : null))\n .nullable(true),\n sorStock: Yup.boolean()\n .label(\"Does the dealer have SOR stock\")\n .default(undefined)\n .nullable(true),\n smartAndReasonable: Yup.boolean()\n .label(\"Are the vehicles well prepared and reasonably priced\")\n .default(undefined)\n .nullable(true),\n hasForecourtAndSignage: Yup.boolean()\n .label(\"Does the dealer have a forecourt and full signage\")\n .default(undefined)\n .nullable(true),\n reasonNoForecourtOrSignage: Yup.string()\n .max(100)\n .label(\"Reason the dealer does not have a forecourt or signage\")\n .default(undefined)\n .nullable(true),\n vehiclesPhotographedConsistently: Yup.boolean()\n .label(\"Are vehicles photographed consistently on the dealer website\")\n .default(undefined)\n .nullable(true),\n advertisesSubprimeFinance: Yup.boolean()\n .label(\"Does the dealership heavily advertise subprime finance\")\n .default(undefined)\n .nullable(true),\n customersFreeToVisit: Yup.boolean()\n .label(\"Can customers visit the dealership freely\")\n .default(undefined)\n .nullable(true),\n hasComplaintsProcess: Yup.boolean()\n .label(\"Does the dealership have a complaints process\")\n .default(undefined)\n .nullable(true),\n complaintsProcessDetails: Yup.string()\n .label(\"Details of the customer complaints process\")\n .max(100)\n .default(undefined),\n reputationConcerns: Yup.boolean()\n .label(\"Do you have reputation concerns\")\n .default(undefined),\n negativeReviewsOnWeb: Yup.boolean()\n .label(\"Are there negative reviews on the web\")\n .nullable(true)\n .default(undefined),\n negativeReviewsOnWebDetails: Yup.string()\n .max(100)\n .label(\"Details of negative reviews of the dealer from the web\")\n .default(undefined)\n .nullable(true),\n negativeReviewsOnSocialMedia: Yup.boolean()\n .label(\"Are there negative reviews on social media\")\n .nullable(true)\n .default(undefined),\n negativeReviewsOnSocialMediaDetails: Yup.string()\n .max(100)\n .label(\"Details of negative reviews of the dealer on social media\")\n .default(undefined)\n .nullable(true),\n negativeNews: Yup.boolean()\n .label(\"Are there negative news stories or google results about the dealer\")\n .nullable(true)\n .default(undefined),\n negativeNewsDetails: Yup.string()\n .max(100)\n .label(\"Details of negative news stories about the dealer\")\n .default(undefined)\n .nullable(true),\n hasGoodReputation: Yup.boolean()\n .label(\"Does the dealer have a good reputation within the local trade\")\n .default(undefined)\n .nullable(true),\n wasReferred: Yup.boolean()\n .label(\"Was the dealer referred from a local dealer\")\n .default(undefined)\n .nullable(true),\n referredBy: Yup.string()\n .max(100)\n .label(\"Name of the dealer which referred this dealer\")\n .default(undefined)\n .nullable(true),\n positiveAndAppropriate: Yup.boolean()\n .label(\"Will the dealer represent the Eurodrive brand\")\n .default(undefined)\n .nullable(true),\n directorsAssociatedWithOtherCompanies: Yup.boolean()\n .label(\"Is the director associated with other companies\")\n .default(undefined)\n .nullable(true),\n directorOtherCompanyName: Yup.string()\n .max(100)\n .label(\"Name of other companies the directors are associated with\")\n .default(undefined)\n .nullable(true),\n directorOtherCompanyUrl: Yup.string()\n .max(200)\n .matches(URL_PATTERN, \"Website format is not correct\")\n .label(\n \"Companies house url of other companies the directors are associated with\"\n )\n .default(undefined)\n .nullable(true),\n directorOtherCompanyRegNumber: Yup.string()\n .max(100)\n .label(\n \"Registration number of other companies the directors are associated with\"\n )\n .default(undefined)\n .nullable(true),\n ultimateBeneficialOwners: Yup.string()\n .label(\"Who are the dealership's ultimate beneficial owners\")\n .max(100)\n .nullable(true)\n .default(undefined),\n approvedPersons: Yup.string()\n .label(\"Who are the dealership's approved persons\")\n .max(100)\n .nullable(true)\n .default(undefined),\n investors: Yup.string()\n .label(\"Who are the dealership's stock owners / investors\")\n .max(100)\n .nullable(true)\n .default(undefined),\n otherInterestedParties: Yup.string()\n .label(\"Who are the dealership's other interested parties\")\n .max(100)\n .nullable(true)\n .default(undefined),\n financeProviders: Yup.string()\n .label(\"Who are the dealership's current / previous finance providers?\")\n .max(100)\n .nullable(true)\n .default(undefined),\n financeProvidersDuration: Yup.string()\n .label(\"How long has the dealership dealt with these providers?\")\n .max(100)\n .nullable(true)\n .default(undefined),\n hasVisualShowroomFinance: Yup.boolean()\n .label(\"Does the dealership have visual showroom finance offerings?\")\n .default(undefined)\n .nullable(true),\n whyDoesTheDealerWantToWorkWithEVC: Yup.string()\n .label(\"Why does the dealer want to work with EVC?\")\n .default(undefined)\n .max(200)\n .nullable(true),\n productSetupPCP: Yup.boolean()\n .label(\"PCP\")\n .default(false)\n .nullable(true),\n productSetupLTVLoans: Yup.boolean()\n .label(\"LTV\")\n .default(false)\n .nullable(true),\n productSetupSubprime: Yup.boolean()\n .label(\"Sub prime\")\n .default(false)\n .nullable(true),\n productSetupVATAssist: Yup.boolean()\n .label(\"VAT assist\")\n .default(false)\n .nullable(true),\n productSetupZeroPercentSubsidy: Yup.boolean()\n .label(\"0% subsidy\")\n .default(false)\n .nullable(true),\n productSetupLenders: Yup.array(Yup.string().min(1))\n .label(\"Lenders\")\n .default([])\n .nullable(true)\n});\n\nexport default dealerSetupQuestionnaireValidationSchema;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult, useQuery } from \"react-apollo\";\nimport { SearchResults, User } from \"../../types\";\nimport { DealerContactFragment } from \"../fragments\";\nimport { DealerContact, DealerContactSearchArgs } from \"../types\";\n\nexport interface DealerContactListData {\n loggedInUser: User;\n dealer: {\n id?: number;\n contacts: SearchResults;\n };\n}\n\ninterface DealerContactListVariables {\n dealerId: number;\n input: DealerContactSearchArgs;\n}\n\ninterface DealerContactData {\n dealerContact: DealerContact;\n}\n\nexport const DEALER_CONTACT_LIST = gql`\n query DealerContactListQuery(\n $dealerId: Int\n $input: DealerContactSearchArgsInput\n ) {\n loggedInUser {\n id\n username\n roles\n }\n dealer(id: $dealerId) {\n id\n contacts(input: $input) {\n pageInfo {\n hasMorePages\n totalResults\n page\n pageSize\n first\n last\n }\n edges {\n node {\n ...DealerContactFragment\n }\n }\n }\n }\n }\n ${DealerContactFragment}\n`;\n\nconst DealerContactListQuery = ({\n children,\n variables\n}: {\n variables: DealerContactListVariables;\n children: (\n result: QueryResult\n ) => JSX.Element | null;\n}) => (\n \n query={DEALER_CONTACT_LIST}\n variables={variables}\n >\n {children as any}\n \n);\n\nconst DEALER_CONTACT_QUERY = gql`\n query DealerContactQuery($id: Int!) {\n dealerContact(id: $id) {\n ...DealerContactFragment\n }\n }\n ${DealerContactFragment}\n`;\n\nexport const DealerContactQuery = ({\n children,\n id\n}: {\n id?: number;\n children: (\n result: QueryResult & {\n dealerContact?: DealerContact;\n }\n ) => JSX.Element | null;\n}) => (\n \n skip={!id}\n query={DEALER_CONTACT_QUERY}\n variables={{ id }}\n >\n {result =>\n children({\n ...result,\n dealerContact: result?.data?.dealerContact\n } as any)\n }\n \n);\n\nexport const useDealerContact = (id?: number) => {\n const { loading, data } = useQuery(\n DEALER_CONTACT_QUERY,\n { variables: { id }, skip: !id }\n );\n\n return { loading, dealerContact: data?.dealerContact };\n};\n\nexport default DealerContactListQuery;\n","import * as React from \"react\";\nimport CustomSelect from \"../Forms/CustomSelect\";\nimport RegionalSalesManagerListQuery from \"./RegionalSalesManagerListQuery\";\nimport RegionalSalesManagerQuery from \"./RegionalSalesManagerQuery\";\n\ninterface RegionalSalesManagerSelectProps {\n regionalSalesManagerId?: string;\n onSelectRegionalSalesManager: (id: string) => void;\n autoFocus?: boolean;\n isClearable?: boolean;\n isDisabled?: boolean;\n}\n\ninterface RegionalSalesManagerSelectState {\n query?: string;\n}\n\nclass RegionalSalesManagerSelect extends React.Component<\n RegionalSalesManagerSelectProps,\n RegionalSalesManagerSelectState\n> {\n constructor(props: RegionalSalesManagerSelectProps) {\n super(props);\n this.state = {};\n }\n\n public render() {\n const {\n regionalSalesManagerId,\n onSelectRegionalSalesManager,\n autoFocus,\n isClearable,\n isDisabled\n } = this.props;\n const { query } = this.state;\n\n return (\n \n {({ data: userData }) => (\n = 3 ? query : undefined}\n >\n {({ data, loading }) => {\n const options =\n loading || !data || !data.regionalSalesManagers\n ? []\n : data.regionalSalesManagers.edges.map(\n ({ node: { name, id } }) => ({\n label: name,\n value: id\n })\n );\n\n const selectedOption =\n userData && userData.regionalSalesManager\n ? {\n label: userData.regionalSalesManager.name,\n value: userData.regionalSalesManager.id\n }\n : null;\n\n return (\n this.setState({ query: value })}\n options={options}\n filterOption={() => true}\n onChange={(value: any) =>\n onSelectRegionalSalesManager(\n value ? value.value : undefined\n )\n }\n noOptionsMessage={() =>\n loading ? \"Loading...\" : \"No regional sales managers found\"\n }\n placeholder={\"Select a regional sales manager\"}\n autoFocus={autoFocus}\n isClearable={!!isClearable}\n isDisabled={!!isDisabled}\n />\n );\n }}\n \n )}\n \n );\n }\n}\n\nexport default RegionalSalesManagerSelect;\n","import * as React from \"react\";\n\nconst StatsBox = ({\n label,\n description,\n value,\n units,\n loading\n}: {\n label: string;\n description?: string;\n value?: string;\n units?: string;\n loading?: boolean;\n}) => (\n
\n {loading ? (\n

 

\n ) : (\n

\n {units ? {units} : null}\n {value || \"0\"}\n

\n )}\n

{label}

\n

{description}

\n
\n);\n\nexport default StatsBox;\n","import { Dealer } from \"../../Dealers/types\";\nimport { SearchArgs } from \"../../types\";\nimport { AccountManager } from \"../types\";\n\nexport interface AccountManagerActivity {\n id?: number;\n dealerId?: number;\n accountManagerId?: string;\n notes?: string;\n activityDate?: string;\n activityType?: ActivityType;\n dealer?: Dealer;\n accountManager?: AccountManager;\n}\n\nexport enum ActivityType {\n TELEPHONE_CALL = \"TELEPHONE_CALL\",\n VISIT = \"VISIT\"\n}\n\nexport interface AccountManagerActivitySearchArgs extends SearchArgs {\n dealerId?: number;\n accountManagerId?: string;\n regionalSalesManagerId?: string;\n}\n","import * as Yup from \"yup\";\nimport { AccountManagerActivity } from \"./types\";\n\nconst accountManagerActivityValidationSchema = Yup.object<\n AccountManagerActivity\n>().shape({\n id: Yup.number()\n .nullable(true)\n .default(undefined),\n dealerId: Yup.number()\n .required()\n .label(\"Dealer\")\n .default(undefined)\n .nullable(true),\n accountManagerId: Yup.string()\n .required()\n .label(\"Account manager\")\n .default(undefined)\n .nullable(true),\n notes: Yup.string()\n .required()\n .label(\"Notes\")\n .max(1000)\n .default(undefined),\n activityDate: Yup.string()\n .required()\n .default(undefined)\n .label(\"Activity date\"),\n activityType: Yup.string()\n .required()\n .default(undefined)\n .label(\"Activity type\")\n});\n\nexport default accountManagerActivityValidationSchema;\n","import { faCaretRight } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { Field, FieldProps, FormikProps } from \"formik\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport { Link } from \"react-router-dom\";\nimport { Col, Input, Row } from \"reactstrap\";\nimport CustomDatePicker from \"../../CustomDatePicker\";\nimport { useDealerShallow } from \"../../Dealers/DealerQuery\";\nimport DealerSelect from \"../../Dealers/DealerSelect\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport RadioField from \"../../Forms/RadioField\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { ContextNames } from \"../../types\";\nimport { useAccountManagerShallow } from \"../AccountManagerQuery\";\nimport AccountManagerSelect from \"../AccountManagerSelect\";\nimport { AccountManagerActivity, ActivityType } from \"./types\";\n\nconst CreateOrUpdateActivityFormInner = ({\n values,\n setFieldValue,\n setFieldTouched,\n context\n}: FormikProps & { context?: ContextNames }) => {\n const { loggedInUser, isAccountManager } = useLoggedInUser();\n\n const {\n accountManager,\n loading: accountManagerLoading\n } = useAccountManagerShallow(values.accountManagerId);\n const { dealer, loading: dealerLoading } = useDealerShallow(values.dealerId);\n\n const maxDate = moment()\n .endOf(\"day\")\n .toDate();\n\n if (!loggedInUser || accountManagerLoading || dealerLoading) {\n return null;\n }\n\n const create = !values.id;\n\n const accountManagerFixed =\n !!values.accountManagerId &&\n (!create ||\n isAccountManager ||\n context === ContextNames.ACCOUNT_MANAGER ||\n context === ContextNames.DEALER);\n\n const dealerFixed =\n !values.accountManagerId ||\n (!!values.dealerId && (!create || context === ContextNames.DEALER));\n\n return (\n <>\n {!isAccountManager ||\n values.accountManagerId !== loggedInUser.accountManager?.id ? (\n \n \n \n {(fieldProps: any) => (\n \n {accountManagerFixed ? (\n <>\n \n {context !== ContextNames.ACCOUNT_MANAGER && !create ? (\n \n Go to account manager\n \n \n ) : null}\n \n ) : (\n {\n setFieldTouched(\"accountManagerId\", true);\n setFieldValue(\"accountManagerId\", id);\n setFieldValue(\"dealerId\", null);\n }}\n autoFocus={true}\n isClearable={true}\n isDisabled={accountManagerFixed}\n />\n )}\n \n )}\n \n \n \n ) : null}\n \n \n \n {(formikProps: any) => (\n \n {dealerFixed ? (\n <>\n {\" \"}\n {context !== ContextNames.DEALER && !create ? (\n \n Go to dealer\n \n \n ) : null}\n \n ) : (\n {\n setFieldTouched(\"dealerId\", true);\n setFieldValue(\"dealerId\", did);\n }}\n autoFocus={accountManagerFixed}\n isClearable={true}\n isDisabled={dealerFixed}\n includeSuspended={true}\n />\n )}\n \n )}\n \n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n {\n setFieldValue(\"activityDate\", moment(date).toISOString());\n }}\n />\n \n \n )}\n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n );\n};\n\nexport default CreateOrUpdateActivityFormInner;\n","import gql from \"graphql-tag\";\nimport { SingleDealerFragment } from \"../../Dealers/fragments\";\nimport { AccountManagerShallowFragment } from \"../fragments\";\n\nexport const AccountManagerActivityFragment = gql`\n fragment AccountManagerActivityFragment on AccountManagerActivity {\n id\n dealerId\n accountManagerId\n notes\n activityDate\n activityType\n dealer {\n ...SingleDealerFragment\n }\n accountManager {\n ...AccountManagerShallowFragment\n }\n }\n ${SingleDealerFragment}\n ${AccountManagerShallowFragment}\n`;\n","import gql from \"graphql-tag\";\nimport { useQuery } from \"react-apollo\";\nimport { AccountManagerActivityFragment } from \"./fragments\";\nimport { AccountManagerActivity } from \"./types\";\n\ninterface AccountManagerActivityData {\n activity?: AccountManagerActivity;\n}\n\ninterface AccountManagerActivityVariables {\n id?: number;\n}\n\nexport const GET_ACCOUNT_MANAGER_ACTIVITY = gql`\n query AccountManagerActivityQuery($id: ID!) {\n activity(id: $id) {\n ...AccountManagerActivityFragment\n }\n }\n ${AccountManagerActivityFragment}\n`;\n\nexport const useAccountManagerActivity = (id?: number) => {\n const { loading, data } = useQuery<\n AccountManagerActivityData,\n AccountManagerActivityVariables\n >(GET_ACCOUNT_MANAGER_ACTIVITY, { variables: { id }, skip: !id });\n\n return { loading, activity: data?.activity };\n};\n\nexport default useAccountManagerActivity;\n","import gql from \"graphql-tag\";\nimport { useMutation } from \"react-apollo\";\nimport { AccountManagerActivityFragment } from \"./fragments\";\nimport { AccountManagerActivity } from \"./types\";\n\ninterface CreateOrUpdateActivityData {\n createOrUpdateActivity: AccountManagerActivity;\n}\n\ninterface CreateOrUpdateActivityVariables {\n input: AccountManagerActivity;\n}\n\nconst CREATE_OR_UPDATE_ACTIVITY_MUTATION = gql`\n mutation CreateOrUpdateAccountManagerActivity(\n $input: AccountManagerActivityInput\n ) {\n createOrUpdateActivity(input: $input) {\n ...AccountManagerActivityFragment\n }\n }\n ${AccountManagerActivityFragment}\n`;\n\nconst useCreateOrUpdateActivity = () => {\n const [createOrUpdateActivity] = useMutation<\n CreateOrUpdateActivityData,\n CreateOrUpdateActivityVariables\n >(CREATE_OR_UPDATE_ACTIVITY_MUTATION);\n return createOrUpdateActivity;\n};\n\nexport default useCreateOrUpdateActivity;\n","import { merge } from \"lodash\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport { cleanFormData } from \"../../../utils\";\nimport { useDealer } from \"../../Dealers/DealerQuery\";\nimport ModalForm from \"../../Forms/ModalForm\";\nimport { PagedListContext } from \"../../PagedList\";\nimport { ContextNames } from \"../../types\";\nimport accountManagerActivityValidationSchema from \"./accountManagerActivityValidationSchema\";\nimport CreateOrUpdateActivityFormInner from \"./CreateOrUpdateActivityFormInner\";\nimport { AccountManagerActivity } from \"./types\";\nimport useAccountManagerActivity from \"./useAccountManagerActivity\";\nimport useCreateOrUpdateActivity from \"./useCreateOrUpdateActivity\";\n\nconst cleanActivityBeforeSubmit = (values: AccountManagerActivity) => {\n const result = cleanFormData(values);\n\n delete result.accountManager;\n delete result.dealer;\n\n return result;\n};\n\nconst CreateOrUpdateActivityModal = ({\n accountManagerActivityId,\n accountManagerId,\n dealerId,\n context,\n isOpen,\n toggle\n}: {\n accountManagerActivityId?: number;\n accountManagerId?: string;\n dealerId?: number;\n context?: ContextNames;\n isOpen: boolean;\n toggle: () => void;\n}) => {\n const defaults = accountManagerActivityValidationSchema.default() as AccountManagerActivity;\n const { activity, loading } = useAccountManagerActivity(\n accountManagerActivityId\n );\n const mutation = useCreateOrUpdateActivity();\n\n const { refresh } = React.useContext(PagedListContext);\n const { dealer, loading: dealerLoading } = useDealer(dealerId);\n\n if (loading || dealerLoading) {\n return null;\n }\n\n const initialValues = merge(\n {},\n defaults,\n {\n dealerId,\n accountManagerId: accountManagerId || dealer?.accountManager?.id,\n activityDate: moment().toISOString()\n },\n activity\n );\n const create = !initialValues.id;\n\n return (\n {\n const variables = { input: cleanActivityBeforeSubmit(values) };\n\n return mutation({\n variables\n }).then(refresh);\n }}\n >\n {formikProps => (\n \n )}\n \n );\n};\n\nexport default CreateOrUpdateActivityModal;\n","import * as React from \"react\";\nimport { Button } from \"reactstrap\";\nimport { ContextNames } from \"../../types\";\nimport { useToggle } from \"../../withToggleState\";\nimport CreateOrUpdateActivityModal from \"./CreateOrUpdateActivityModal\";\nimport { AccountManagerActivitySearchArgs } from \"./types\";\n\nconst AccountManagerActivityActionButtons = ({\n context,\n variables\n}: {\n context?: ContextNames;\n variables?: { input: AccountManagerActivitySearchArgs };\n}) => {\n const { active, toggle } = useToggle();\n const { dealerId, accountManagerId } = variables?.input || {};\n\n return (\n <>\n
\n \n
\n \n \n );\n};\n\nexport default AccountManagerActivityActionButtons;\n","import gql from \"graphql-tag\";\nimport { useMutation } from \"react-apollo\";\n\nconst DELETE_ACCOUNT_MANAGER_ACTIVITY = gql`\n mutation DeleteAccountManagerActivity($id: ID!) {\n deleteActivity(id: $id) {\n success\n }\n }\n`;\n\nconst useDeleteAccountManagerActivity = () => {\n const [deleteAccountManagerActivity] = useMutation(\n DELETE_ACCOUNT_MANAGER_ACTIVITY\n );\n\n return deleteAccountManagerActivity;\n};\n\nexport default useDeleteAccountManagerActivity;\n","import { faTrash } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport * as React from \"react\";\nimport { DropdownItem } from \"reactstrap\";\nimport { ConfirmDialog } from \"../../Forms/ConfirmDialogProvider\";\nimport { PagedListContext } from \"../../PagedList\";\nimport { AccountManagerActivity } from \"./types\";\nimport useDeleteAccountManagerActivity from \"./useDeleteAccountManagerActivity\";\n\ninterface DeleteAccountManagerActivityDropdownItemProps {\n activity: AccountManagerActivity;\n}\n\nconst DeleteAccountManagerActivityDropdownItem = ({\n activity: { id }\n}: DeleteAccountManagerActivityDropdownItemProps) => {\n const mutation = useDeleteAccountManagerActivity();\n const { refresh } = React.useContext(PagedListContext);\n\n if (!id) {\n return null;\n }\n return (\n \n {confirm => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n confirm(() =>\n mutation({\n variables: { id }\n }).then(refresh)\n );\n }}\n >\n Delete\n \n )}\n \n );\n};\n\nexport default DeleteAccountManagerActivityDropdownItem;\n","import { faPhoneAlt, faStoreAlt } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport { Col, DropdownItem, Row } from \"reactstrap\";\nimport { formatEnumValue } from \"../../../utils\";\nimport ActionsDropdown from \"../../PagedList/ActionsDropdown\";\nimport { ContextNames } from \"../../types\";\nimport DeleteAccountManagerActivityDropdownItem from \"./DeleteAccountManagerActivityDropdownItem\";\nimport { AccountManagerActivity, ActivityType } from \"./types\";\n\nconst AccountManagerActivityListItem = ({\n item,\n context,\n onClick\n}: {\n item: AccountManagerActivity;\n context?: ContextNames;\n onClick?: () => void;\n}) => {\n const showAccountManagerAndDealer =\n context !== ContextNames.ACCOUNT_MANAGER && context !== ContextNames.DEALER;\n\n return (\n
\n \n \n

\n {context !== ContextNames.ACCOUNT_MANAGER ? (\n {item.accountManager?.name}\n ) : null}\n {showAccountManagerAndDealer ? \" | \" : null}\n {context !== ContextNames.DEALER ? (\n {item.dealer?.name}\n ) : null}\n

\n

\n \n {formatEnumValue(item.activityType)}{\" \"}\n {moment(item.activityDate).format(\"Do MMMM YYYY\")}\n

\n

{item.notes}

\n \n \n \n Edit activity\n \n \n \n \n
\n
\n );\n};\n\nexport default AccountManagerActivityListItem;\n","import gql from \"graphql-tag\";\nimport memoizeOne from \"memoize-one\";\nimport * as React from \"react\";\nimport SearchForm from \"../../Forms/SearchForm\";\nimport PagedList from \"../../PagedList\";\nimport { ContextNames } from \"../../types\";\nimport AccountManagerActivityActionButtons from \"./AccountManagerActivityActionButtons\";\nimport AccountManagerActivityListItem from \"./AccountManagerActivityListItem\";\nimport CreateOrUpdateActivityModal from \"./CreateOrUpdateActivityModal\";\nimport { AccountManagerActivityFragment } from \"./fragments\";\nimport {\n AccountManagerActivity,\n AccountManagerActivitySearchArgs\n} from \"./types\";\n\ninterface AccountManagerActivityListProps {\n accountManagerId?: string;\n regionalSalesManagerId?: string;\n dealerId?: number;\n context?: ContextNames;\n}\n\nexport const ACCOUNT_MANAGER_ACTIVITIES_LIST = gql`\n query ActivityListQuery($input: AccountManagerActivitySearchArgsInput) {\n activities(input: $input) {\n pageInfo {\n hasMorePages\n totalResults\n page\n pageSize\n first\n last\n }\n edges {\n node {\n ...AccountManagerActivityFragment\n }\n }\n }\n }\n ${AccountManagerActivityFragment}\n`;\n\nconst defaultSearchArgs = {\n page: 1,\n pageSize: 10\n};\n\nconst AccountManagerActivityList = ({\n accountManagerId,\n regionalSalesManagerId,\n dealerId,\n context\n}: AccountManagerActivityListProps) => {\n const [state, setState] = React.useState<{\n activityId?: number;\n isEditing: boolean;\n }>({ isEditing: false });\n\n const hideModal = React.useCallback(\n () => setState({ ...state, isEditing: false }),\n [state, setState]\n );\n\n const handleClick = React.useCallback(\n (item: AccountManagerActivity) =>\n setState({ activityId: item.id, isEditing: true }),\n [setState]\n );\n\n const { activityId, isEditing } = state;\n\n return (\n <>\n \n placeholder=\"Search activities\"\n context={context}\n mapValuesToQuerystring={values => values}\n mapQuerystringToValues={qs => qs}\n fixedValues={{ accountManagerId, dealerId, regionalSalesManagerId }}\n defaultValues={defaultSearchArgs}\n >\n {formikProps => {\n const getVariables = memoizeOne(initialValues => ({\n input: initialValues || {}\n }));\n return (\n data.activities}\n variables={getVariables(formikProps.initialValues)}\n context={context}\n actionButtonsComponent={AccountManagerActivityActionButtons}\n onClick={handleClick}\n fetchPolicy=\"cache-and-network\"\n >\n \n \n );\n }}\n \n \n );\n};\n\nexport default AccountManagerActivityList;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Mutation, MutationFunction, MutationResult } from \"react-apollo\";\nimport { UserFragment } from \"./fragments\";\nimport { UserProfile, UserProfileInput } from \"./types\";\n\ninterface UserData {\n createUser: UserProfile;\n}\n\ninterface UserVariables {\n input: UserProfileInput;\n}\n\nexport const CREATE_USER = gql`\n mutation CreateUser($input: UserInput) {\n createUser(input: $input) {\n ...UserFragment\n }\n }\n ${UserFragment}\n`;\n\nconst CreateUser = ({\n children\n}: {\n children: (\n mutationFunction: MutationFunction,\n result: MutationResult\n ) => JSX.Element | null;\n}) => {children};\n\nexport default CreateUser;\n","import { defaults } from \"lodash\";\nimport * as React from \"react\";\nimport { RouteComponentProps, withRouter } from \"react-router\";\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from \"reactstrap\";\nimport { cleanFormData } from \"../../../utils\";\nimport { DealerContactQuery } from \"../../Dealers/DealerContactList/DealerContactListQuery\";\nimport { ContextNames, FormSize, UserRoles } from \"../../types\";\nimport CreateUserForm from \"./CreateUserForm\";\nimport CreateUserFormInner from \"./CreateUserFormInner\";\nimport CreateUserMutation from \"./CreateUserMutation\";\nimport { UserProfileInput } from \"./types\";\nimport { USER_LIST } from \"./UserListQuery\";\nimport userProfileValidationSchema from \"./userProfileValidationSchema\";\n\ninterface CreateUserModalProps {\n dealerId?: number;\n dealerContactId?: number;\n regionalSalesManagerId?: string;\n fixedRole?: UserRoles;\n display: boolean;\n context?: ContextNames;\n toggle: () => void;\n}\n\nconst CreateUserModal = ({\n display,\n toggle,\n dealerId,\n dealerContactId,\n regionalSalesManagerId,\n fixedRole,\n context,\n history\n}: CreateUserModalProps & RouteComponentProps) => {\n return (\n \n \n {({ dealerContact }) => (\n \n {mutation => (\n {\n toggle();\n\n const payload: UserProfileInput = cleanFormData(values);\n\n return mutation({\n variables: { input: { ...payload } },\n refetchQueries: [\n {\n query: USER_LIST,\n variables: {\n input: {\n page: 1,\n pageSize: 10,\n q: \"\",\n includeSuspended: true\n }\n }\n }\n ]\n }).then(result => {\n if (result && result.data && result.data.createUser) {\n const user = result.data.createUser;\n history.push(`/settings/users/${user.id}`);\n }\n });\n }}\n >\n {formikProps => (\n <>\n \n {context === ContextNames.ACCOUNT_MANAGER\n ? \"New account manager\"\n : \"New user\"}\n \n \n \n \n \n \n \n \n \n )}\n \n )}\n \n )}\n \n \n );\n};\n\nexport default withRouter(CreateUserModal);\n","import moment from \"moment\";\nimport * as Yup from \"yup\";\nimport {\n DATE_PATTERN,\n EMAIL_PATTERN,\n testDateStringIsValid,\n} from \"../../utils\";\nimport telephoneValidationSchema from \"../Forms/telephoneValidationSchema\";\nimport { Address } from \"../types\";\nimport dealerContactValidationSchema from \"./DealerContacts/dealerContactValidationSchema\";\nimport dealerSetupQuestionnaireValidationSchema from \"./dealerSetupQuestionnaireValidationSchema\";\nimport { Dealer, DealerBank, DealerContact } from \"./types\";\nimport * as uuid from \"uuid\";\n\nconst URL_PATTERN =\n /^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w.-]+)+[\\w\\-._~:/?#[\\]@!$&'()*+,;=.]+$/;\nconst VAT_PATTERN = /^(GB)?([0-9]{9}|[0-9]{12}|(GD|HA)[0-9]{3})$/;\n\nexport const isEmailValid = (value: string | undefined) => {\n // Ignore empty values\n if (!value) {\n return false;\n }\n\n return new RegExp(EMAIL_PATTERN).test(value);\n};\n\nconst uniqueEmailAddresses =\n \"All contacts requesting portal access must have a different email address\";\n\nconst dealerValidationSchema = Yup.object().shape({\n id: Yup.number().nullable(true).default(undefined),\n accountManagerId: Yup.string().nullable(true).default(undefined).required(),\n name: Yup.string().label(\"Dealer name\").nullable(true).max(250).required(),\n isSuspended: Yup.bool().default(true),\n isMannIslandDealer: Yup.bool().default(false),\n isMannIslandZList: Yup.bool().default(false),\n isMultiQuote: Yup.bool().default(true),\n stockFunding: Yup.bool().default(false),\n franchised: Yup.bool().default(false),\n url: Yup.string()\n .label(\"Website\")\n .nullable(true)\n .matches(URL_PATTERN, \"Website format is not correct\")\n .required(),\n email: Yup.string()\n .label(\"Email\")\n .email(\"Email must be in the format example@example.com\")\n .nullable(true)\n .required(),\n mobile: telephoneValidationSchema\n .label(\"Mobile\")\n .when(\"id\", { is: (id) => !id, then: Yup.string().required() }),\n fax: telephoneValidationSchema.label(\"Fax\"),\n ccaNumber: Yup.string().label(\"FCA number\").nullable(true).max(10).required(),\n vatNumber: Yup.string()\n .label(\"VAT number\")\n .matches(VAT_PATTERN, \"VAT number is not correct\")\n .nullable(true)\n .max(20)\n .required(),\n ccaExpiry: Yup.string()\n .nullable(true)\n .default(moment().startOf(\"month\").add(6, \"month\").toISOString(true)),\n established: Yup.string()\n .matches(DATE_PATTERN, \"Established date is a required field\")\n .label(\"Established date\")\n .when(\"id\", { is: (id) => !id, then: Yup.string().required() })\n .default(undefined)\n .test(\n \"date-format-validation\",\n \"Date does not exist\",\n testDateStringIsValid\n )\n .nullable(true),\n location: Yup.object()\n .shape({\n latitude: Yup.number().nullable(true).required().default(undefined),\n longitude: Yup.number().nullable(true).required().default(undefined),\n })\n .nullable(true)\n .default(undefined),\n bank: Yup.object().shape({\n id: Yup.number().default(undefined).nullable(true),\n bank: Yup.string()\n .label(\"Bank\")\n .required()\n .nullable(true)\n .default(undefined)\n .max(100),\n accountNumber: Yup.string()\n .label(\"Account number\")\n .nullable(true)\n .default(undefined)\n .matches(/^\\d{8}$/, \"Bank account number must be 8 digits\")\n .required()\n .max(8),\n sortCode: Yup.string()\n .label(\"Sort code\")\n .nullable(true)\n .default(undefined)\n .matches(/^\\d\\d-\\d\\d-\\d\\d$/, 'Sort code must be in the format \"##-##-##\"')\n .required()\n .max(8),\n accountName: Yup.string()\n .label(\"Account name\")\n .nullable(true)\n .default(undefined)\n .max(100),\n bankAddress: Yup.string()\n .label(\"Bank address\")\n .nullable(true)\n .default(undefined)\n .when(\"id\", { is: (id) => !id, then: Yup.string().required() }),\n }),\n address: Yup.object
()\n .label(\"Address\")\n .shape({\n line1: Yup.string()\n .label(\"Line 1\")\n .default(undefined)\n .nullable(true)\n .required(\"Line 1 of the address is required\")\n .max(50),\n line2: Yup.string()\n .default(undefined)\n .nullable(true)\n .max(50)\n .label(\"Line 2\"),\n line3: Yup.string()\n .default(undefined)\n .nullable(true)\n .max(50)\n .label(\"Line 3\"),\n town: Yup.string()\n .default(undefined)\n .nullable(true)\n .max(50)\n .label(\"Town\"),\n postcode: Yup.string()\n .default(undefined)\n .nullable(true)\n .max(8)\n .label(\"Postcode\"),\n countryId: Yup.string().nullable(true).default(\"GBR\"),\n telephone: telephoneValidationSchema.label(\"Telephone\").required(),\n }),\n contacts: Yup.array(dealerContactValidationSchema)\n .default([dealerContactValidationSchema.default()])\n .nullable(true)\n .when(\"id\", {\n is: (id) => !id,\n then: Yup.array(dealerContactValidationSchema)\n .required(uniqueEmailAddresses)\n .test(\n \"unique-email-addresses\",\n uniqueEmailAddresses,\n // tslint:disable:ter-prefer-arrow-callback\n // tslint:disable:only-arrow-functions\n function (value: DealerContact[]) {\n const uniqArr: string[] = [];\n let emailCount: number = 0;\n value.forEach((v, i) => {\n if (v.email && v.requestsDealerPortalUserAccount) {\n emailCount++;\n const lower = v.email?.toLowerCase();\n if (uniqArr.indexOf(lower) === -1) {\n uniqArr.push(lower);\n }\n }\n });\n if (emailCount !== uniqArr.length) {\n // Use a custom nonexistent path \"FORMSTATE_contactsError\".\n // This stops the other contact messages from being replaced with this one.\n return this.createError({\n path: \"FORMSTATE_contactsError\",\n message: uniqueEmailAddresses,\n });\n }\n return true;\n }\n )\n .test(\n \"director-required\",\n \"At least one director is required\",\n // tslint:disable:ter-prefer-arrow-callback\n // tslint:disable:only-arrow-functions\n function (value: DealerContact[]) {\n if (\n value &&\n !this.parent.id &&\n !value.some(\n (x) => x.isDirector && x.requestsDealerPortalUserAccount\n )\n ) {\n // Use a custom nonexistent path \"FORMSTATE_contactsError\".\n // This stops the other contact messages from being replaced with this one.\n return this.createError({\n path: \"FORMSTATE_contactsError\",\n message: \"At least one director is required with portal access\",\n });\n }\n if (\n value &&\n !this.parent.id &&\n !value.some(\n (x) =>\n x.requestsDealerPortalUserAccount && isEmailValid(x.email)\n )\n ) {\n return this.createError({\n path: \"FORMSTATE_contactsError\",\n message: \"Portal access requires a valid email address\",\n });\n }\n /*\n if (\n value &&\n !this.parent.id &&\n !value.some((x) => x.isFCARegulatedPerson)\n ) {\n return this.createError({\n path: \"FORMSTATE_contactsError\",\n message: \"At least one FCA regulated person is required\",\n });\n }\n */\n return true;\n }\n ),\n }),\n FORMSTATE_contactsError: Yup.string().default(undefined).nullable(true),\n companiesHouseUrl: Yup.string()\n .label(\"Companies House link\")\n .default(undefined)\n .nullable(true)\n .matches(URL_PATTERN, \"Website format is not correct\")\n .max(200),\n companyRegNumber: Yup.string()\n .label(\"Company registration number\")\n .default(undefined)\n .nullable(true)\n .max(100),\n tradingStyle: Yup.string()\n .label(\"Trading style\")\n .default(undefined)\n .nullable(true)\n .when(\"id\", { is: (id) => !id, then: Yup.string().required() })\n .max(100),\n assetClass: Yup.string()\n .label(\"Asset class\")\n .default(undefined)\n .nullable(true)\n .max(100),\n fCAStatus: Yup.string()\n .label(\"FCA status\")\n .default(undefined)\n .nullable(true)\n .max(100),\n fCAUrl: Yup.string()\n .label(\"Link to FCA website\")\n .default(undefined)\n .nullable(true)\n .matches(URL_PATTERN, \"Website format is not correct\")\n .max(200),\n netWorthFromCompaniesHouse: Yup.number()\n .label(\"Net worth from companies house\")\n .default(undefined)\n .nullable(true)\n .moreThan(0),\n averageBalance: Yup.number()\n .label(\"Average balance\")\n .default(undefined)\n .nullable(true)\n .moreThan(0),\n monthlyVolume: Yup.number()\n .label(\"Monthly volume\")\n .default(undefined)\n .nullable(true)\n .moreThan(0),\n allProofsProvided: Yup.boolean()\n .default(undefined)\n .label(\"Are all proofs provided?\")\n .nullable(true)\n .oneOf([true], \"At least one of each type required\")\n .when(\"id\", {\n is: (id) => !id,\n then: Yup.boolean().required(\"Proofs are missing!\"),\n }),\n isOnICORegister: Yup.boolean()\n .default(true)\n .label(\"ICO register check\")\n .nullable(true)\n .required(\"ICO register check has to be performed\"),\n icoNumber: Yup.string()\n .default(undefined)\n .label(\"ICO number\")\n .nullable(true)\n .max(50)\n .when(\"isOnICORegister\", {\n is: (isOnICORegister) => !!isOnICORegister,\n then: Yup.string().required(),\n }),\n agreedApr: Yup.number().default(undefined).label(\"Agreed APR\").nullable(true),\n questionnaire: dealerSetupQuestionnaireValidationSchema\n .default(undefined)\n .nullable(true)\n .when(\"FORMSTATE_requiresQuestionnaire\", {\n is: true,\n then: dealerSetupQuestionnaireValidationSchema.required(),\n }),\n FORMSTATE_requiresQuestionnaire: Yup.boolean().default(true),\n dealerSetupV2: Yup.boolean().default(true),\n documentStorageRef: Yup.string().default(uuid.v4()),\n});\n\nexport default dealerValidationSchema;\n","import * as Yup from \"yup\";\nimport { DATE_PATTERN, testDateStringIsValid } from \"../../../utils\";\nimport telephoneValidationSchema from \"../../Forms/telephoneValidationSchema\";\nimport { Address } from \"../../types\";\nimport { DealerContact, DealerContactEmailInclude } from \"../types\";\n\nconst addressValidationSchema = Yup.object
().shape({\n line1: Yup.string()\n .label(\"Line 1\")\n .default(undefined)\n .required(\"Line 1 of the address is required\")\n .max(50)\n .nullable(true),\n line2: Yup.string()\n .label(\"Line 2\")\n .default(undefined)\n .max(50)\n .nullable(true),\n line3: Yup.string()\n .label(\"Line 3\")\n .default(undefined)\n .max(50)\n .nullable(true),\n town: Yup.string()\n .label(\"Town\")\n .default(undefined)\n .max(50)\n .nullable(true),\n postcode: Yup.string()\n .label(\"Postcode\")\n .default(undefined)\n .max(8)\n .nullable(true)\n});\n\nconst dealerContactValidationSchema = Yup.object().shape({\n id: Yup.string()\n .nullable(true)\n .default(undefined),\n dealerId: Yup.number().default(0),\n title: Yup.string()\n .label(\"Title\")\n .nullable(true)\n .max(10),\n forename: Yup.string()\n .label(\"First name\")\n .max(50)\n .required(),\n surname: Yup.string()\n .label(\"Last name\")\n .max(50)\n .required(),\n position: Yup.string()\n .label(\"Position\")\n .nullable(true)\n .max(100),\n telephone: telephoneValidationSchema.label(\"Telephone\"),\n mobile: telephoneValidationSchema.label(\"Mobile telephone\").when(\"sMS\", {\n is: (sMS?: boolean) => !!sMS,\n then: Yup.string().required()\n }),\n fax: telephoneValidationSchema.label(\"Fax\"),\n email: Yup.string()\n .email()\n .max(255)\n .nullable(true)\n .label(\"Email\")\n .when([\"emailInclude\", \"requestsDealerPortalUserAccount\"], {\n is: (emailInclude?: string, requestsLogin?: boolean) =>\n (!!emailInclude && emailInclude !== DealerContactEmailInclude.NONE) ||\n !!requestsLogin,\n then: Yup.string().required()\n }),\n notes: Yup.string()\n .nullable(true)\n .max(1000),\n emailInclude: Yup.string()\n .default(DealerContactEmailInclude.NONE)\n .label(\"Send notification emails\")\n .nullable(true)\n .required(\"Field is required\"),\n sMS: Yup.boolean()\n .default(false)\n .label(\"Send SMS notifications\")\n .nullable(true),\n isDirector: Yup.boolean()\n .label(\"Director\")\n .default(false)\n .required(),\n directorDateOfBirth: Yup.string()\n .label(\"Director date of birth\")\n .matches(DATE_PATTERN, \"Date of birth is a required field\")\n .default(undefined)\n .nullable(true)\n .test(\n \"director-date-format-validation\",\n \"Date does not exist\",\n testDateStringIsValid\n )\n .typeError(\"Date of birth must be a date\")\n .when(\"isDirector\", {\n is: true,\n then: Yup.string().required()\n }) as any,\n isFCARegulatedPerson: Yup.boolean()\n .label(\"FCA regulated person\")\n .default(false)\n .required(),\n homeAddress: Yup.object
()\n .when(\"isDirector\", { is: true, then: addressValidationSchema.required() })\n .default(addressValidationSchema.default()),\n isMainContact: Yup.boolean()\n .label(\"Is main contact\")\n .default(false)\n .required(),\n isSAFTested: Yup.boolean()\n .label(\"Is user SAF tested?\")\n .default(false)\n .required(),\n requestsDealerPortalUserAccount: Yup.boolean()\n .label(\"Requests dealer portal login\")\n .default(false)\n .required()\n});\n\nexport default dealerContactValidationSchema;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult, useQuery } from \"react-apollo\";\nimport { User } from \"../../types\";\nimport { DraftDealerFragment, DraftDealerShallowFragment } from \"../fragments\";\nimport { DealerEsignature, DraftDealer } from \"../types\";\n\nexport interface DraftDealerProps {\n loggedInUser: User;\n draftDealer: DraftDealer;\n}\n\ninterface DraftDealerData {\n loggedInUser: User;\n draftDealer: DraftDealer;\n}\n\ninterface DraftDealerArgs {\n draftDealerId?: number;\n}\n\nexport const GET_DRAFT_DEALER = gql`\n query DraftDealerQuery($draftDealerId: Int!) {\n loggedInUser {\n id\n username\n roles\n }\n draftDealer(id: $draftDealerId) {\n ...DraftDealerFragment\n }\n }\n ${DraftDealerFragment}\n`;\n\nexport const GET_DRAFT_DEALER_SHALLOW = gql`\n query DraftDealerQuery($draftDealerId: Int!) {\n loggedInUser {\n id\n username\n roles\n }\n draftDealer(id: $draftDealerId) {\n ...DraftDealerShallowFragment\n }\n }\n ${DraftDealerShallowFragment}\n`;\n\nexport const DealerEsignatureFragment = gql`\n fragment DealerEsignatureFragment on DealerEsignature {\n # id\n confirmed\n remoteAddr\n notes\n forename\n surname\n username\n # startDate\n # endDate\n # priority\n }\n`;\n\nexport const GET_DEALER_EIGNATURE = gql`\n query DealerEsignatureQuery($dealerId: Int!, $docType: Int!) {\n loggedInUser {\n id\n username\n roles\n }\n dealerEsignature(id: $dealerId, docType: $docType) {\n ...DealerEsignatureFragment\n }\n }\n ${DealerEsignatureFragment}\n`;\n\nexport const useDealerEsignature = (id?: number, docType?: number) => {\n const { loading, data } = useQuery(GET_DEALER_EIGNATURE, {\n variables: { dealerId: id, docType: docType },\n skip: !id,\n });\n return { loading, dealerEsignature: data };\n};\n\nconst DraftDealerQuery = ({\n children,\n draftDealerId,\n query,\n}: DraftDealerArgs & {\n children: (\n result: QueryResult & {\n draftDealer?: DraftDealer;\n }\n ) => JSX.Element | null;\n query?: any;\n}) => (\n \n query={query || GET_DRAFT_DEALER}\n variables={{ draftDealerId }}\n skip={!draftDealerId}\n >\n {(result) =>\n children({\n ...result,\n draftDealer: result?.data?.draftDealer,\n })\n }\n \n);\n\nexport default DraftDealerQuery;\n","import { gql } from \"apollo-boost\";\nimport { useMutation } from \"react-apollo\";\nimport { GET_ACCOUNT_MANAGER } from \"../../AccountManagers/AccountManagerQuery\";\nimport { DealerFragment } from \"../fragments\";\nimport { HouseDealer } from \"../types\";\n\nconst CREATE_HOUSE_DEALER = gql`\n mutation CreateHouseDealer($input: HouseDealerInput!) {\n createHouseDealer(input: $input) {\n ...DealerFragment\n }\n }\n ${DealerFragment}\n`;\n\nexport const useCreateHouseDealer = () => {\n const [createHouseDealer] = useMutation(CREATE_HOUSE_DEALER);\n\n return (houseDealer: HouseDealer) =>\n createHouseDealer({\n variables: { input: houseDealer },\n refetchQueries: [\n {\n query: GET_ACCOUNT_MANAGER,\n variables: { id: houseDealer.accountManagerId }\n }\n ]\n });\n};\n","import { FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport { Col, FormGroup, Label, Row } from \"reactstrap\";\nimport config from \"../../../config\";\nimport AccountManagerSelect from \"../../AccountManagers/AccountManagerSelect\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport PeriodPickerField from \"../../Forms/PeriodPickerField\";\nimport RadioButtonsField from \"../../Forms/RadioButtonsField\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { ContextNames } from \"../../types\";\nimport { DealerMapStyle, DealerMapType, DealerSearchArgs } from \"../types\";\n\nconst DealerListFilterPanel = ({\n values,\n setFieldValue,\n submitForm,\n context,\n map\n}: FormikProps & {\n context?: ContextNames;\n map?: boolean;\n}) => {\n const {\n loggedInUser,\n loading,\n isAdministrator,\n isAccountManager\n } = useLoggedInUser();\n\n if (loading || !loggedInUser) {\n return null;\n }\n\n return (\n <>\n {map && (\n <>\n \n \n \n \n \n \n \n )}\n \n \n \n \n \n \n\n {context !== ContextNames.ACCOUNT_MANAGER && !isAccountManager && (\n \n \n \n \n {\n setFieldValue(\"accountManagerId\", id, false);\n submitForm();\n }}\n isClearable={true}\n />\n \n \n \n )}\n \n \n \n \n \n {isAdministrator && (\n \n )}\n \n );\n};\n\nexport default DealerListFilterPanel;\n","import classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Badge } from \"reactstrap\";\nimport config from \"../../config\";\nimport { convertToTitleCase } from \"../../utils\";\nimport { useLoggedInUser } from \"../LoggedInUserQuery\";\nimport { ContextNames } from \"../types\";\nimport { Dealer, DealerSetupStatus } from \"./types\";\nimport { IsStatusFullySetup } from \"./dealerSetup\";\n\nconst dss = Object.keys(DealerSetupStatus) as Array<\n keyof typeof DealerSetupStatus\n>;\n\nconst DealerBadges = ({\n dealer: {\n accountManager,\n groups,\n isSuspended,\n countOfActiveProposals,\n location,\n contractSigned,\n autoConvert,\n isOnICORegister,\n setupStatus,\n franchised,\n },\n className,\n context,\n}: {\n dealer: Dealer;\n context?: ContextNames;\n className?: string;\n}) => {\n const { isDealer, isAccountManager } = useLoggedInUser();\n\n return (\n
\n {context !== ContextNames.ACCOUNT_MANAGER &&\n !isAccountManager &&\n accountManager ? (\n {convertToTitleCase(accountManager.name)} (AM)\n ) : null}\n {isOnICORegister === false ? (\n \n Not on ICO register\n \n ) : !isOnICORegister && !isDealer ? (\n \n ICO check required\n \n ) : null}\n {!autoConvert ? (\n \n Not in {config.AUTOCONVERT_NAME}\n \n ) : null}\n {groups &&\n groups.map((g) => (\n \n {g.name}\n \n ))}\n {countOfActiveProposals && !isDealer && (\n \n {countOfActiveProposals}\n {countOfActiveProposals > 1 ? \" proposals\" : \" proposal\"}\n \n )}\n {!location && !isDealer && (\n \n No location specified\n \n )}\n {isSuspended && contractSigned && Suspended}\n {!contractSigned && isDealer && (\n \n Not approved\n \n )}\n {!isDealer &&\n setupStatus != null &&\n !IsStatusFullySetup(setupStatus) &&\n dss.map(\n (el, index) =>\n index > (franchised ? 1 : 0) && (\n \n \n {DealerSetupStatus[el]}\n {\": \"}\n {(setupStatus || 0) & Math.pow(2, index - 1) ? \"Yes\" : \"No\"}\n {\" \"}\n \n )\n )}\n
\n );\n};\n\nexport default DealerBadges;\n","import { FormikProps } from \"formik\";\nimport { isEqual, omit, pick } from \"lodash\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport { ViewState } from \"react-map-gl\";\nimport { cleanNumber, getMonthDateRange } from \"../../../utils\";\nimport FormikEffects from \"../../Forms/FormikEffects\";\nimport SearchFormCore from \"../../Forms/SearchFormCore\";\nimport { ProposalSearchArgs } from \"../../Proposals/types\";\nimport { CompositeComponent, ContextNames } from \"../../types\";\nimport { DealerMapStyle, DealerMapType, DealerSearchArgs } from \"../types\";\n\nexport type DealerListSearchFormValues = DealerSearchArgs &\n Partial & {\n proposalEditDates?: string;\n mapType?: DealerMapType;\n options?: boolean;\n mapStyle?: DealerMapStyle;\n };\n\nconst viewStatePropNames: (keyof ViewState)[] = [\n \"latitude\",\n \"longitude\",\n \"zoom\",\n \"pitch\",\n \"bearing\"\n];\n\nconst mapOptionsPropNames = [\n \"proposalEditDates\",\n \"mapType\",\n \"options\",\n \"mapStyle\"\n];\n\ninterface DealerListProps {\n variables: {\n input: DealerSearchArgs;\n totalFinanceFilter: ProposalSearchArgs;\n };\n initialViewState: Partial;\n context?: ContextNames;\n onViewStateChanged: (viewState: Partial) => void;\n formikProps: FormikProps;\n}\n\ninterface DealerSearchFormProps {\n accountManagerId?: string;\n regionalSalesManagerId?: string;\n fixedPageSize?: number;\n fixedPage?: number;\n fixedHasLocationOnly?: boolean;\n context?: ContextNames;\n className?: string;\n searchPanelWrapper?: CompositeComponent<{ children?: React.ReactNode }>;\n children: (props: DealerListProps) => JSX.Element | null;\n}\n\nconst { value: lastMonth } = getMonthDateRange(moment().subtract(1, \"month\"));\n\nconst defaultSearchArgs = {\n page: 1,\n pageSize: 10,\n includeSuspended: false,\n fundedDealersOnly: false,\n hasActivityInLastSixWeeks: false,\n hasActivityInLastYear: false,\n hasActiveProposalsOnly: false,\n hasLocationOnly: false,\n locationNotFoundOnly: false,\n hasProposalsPaidOutInTimePeriod: false,\n proposalStartDate: lastMonth.start,\n proposalEndDate: lastMonth.end,\n proposalEditDates: false,\n mapType: DealerMapType.LOCATIONS,\n options: false,\n mapStyle: DealerMapStyle.LIGHT,\n autoConvertOnly: false,\n houseDealersOnly: false\n};\n\nconst defaultViewState: any = {\n latitude: null,\n longitude: null,\n zoom: null,\n pitch: null,\n bearing: null\n};\n\nconst DealerListSearchForm = ({\n accountManagerId,\n regionalSalesManagerId,\n fixedPageSize,\n fixedPage,\n fixedHasLocationOnly,\n context,\n className,\n children\n}: DealerSearchFormProps) => (\n ({\n ...qs,\n fundedDealersOnly: qs.fundedDealersOnly === \"true\",\n includeSuspended: qs.includeSuspended === \"true\",\n hasActivityInLastSixWeeks: qs.hasActivityInLastSixWeeks === \"true\",\n hasActivityInLastYear: qs.hasActivityInLastYear === \"true\",\n hasActiveProposalsOnly: qs.hasActiveProposalsOnly === \"true\",\n locationNotFoundOnly: qs.locationNotFoundOnly === \"true\",\n hasLocationOnly: qs.hasLocationOnly === \"true\",\n latitude: cleanNumber(qs.latitude),\n longitude: cleanNumber(qs.longitude),\n pitch: cleanNumber(qs.pitch),\n bearing: cleanNumber(qs.bearing),\n zoom: cleanNumber(qs.zoom),\n proposalEditDates: qs.proposalEditDates === \"true\",\n options: qs.options === \"true\"\n })}\n mapValuesToQuerystring={values => values}\n defaultValues={{ ...defaultSearchArgs, ...defaultViewState }}\n fixedValues={{\n pageSize: fixedPageSize,\n page: fixedPage,\n hasLocationOnly: fixedHasLocationOnly,\n accountManagerId,\n regionalSalesManagerId\n }}\n context={context}\n className={className}\n >\n {(\n formikProps: FormikProps<\n DealerSearchArgs &\n Partial & {\n proposalStartDate?: string;\n proposalEndDate?: string;\n }\n >\n ) => {\n const input: DealerSearchArgs = omit(\n formikProps.initialValues,\n (viewStatePropNames as string[]).concat(mapOptionsPropNames)\n );\n const viewState: Partial = pick(\n formikProps.initialValues,\n viewStatePropNames\n );\n\n const variables = {\n input,\n totalFinanceFilter: {\n startDate: formikProps.initialValues.proposalStartDate,\n endDate: formikProps.initialValues.proposalEndDate\n }\n };\n\n const onViewStateChanged = (nextViewState: Partial) => {\n viewStatePropNames.forEach(k => {\n const value =\n nextViewState[k] || nextViewState[k] === 0\n ? nextViewState[k]\n : null;\n formikProps.setFieldValue(k, value, false);\n });\n };\n\n return (\n <>\n ,\n currentValues: DealerSearchArgs & Partial\n ) => {\n // Do not reset the location when these prop names change\n const ignorePropNames = [\n ...viewStatePropNames,\n \"options\",\n \"mapStyle\",\n \"q\"\n ];\n\n const prevFormValues: DealerSearchArgs & {\n mapType?: string;\n } = omit(prevValues, ignorePropNames);\n const currentFormValues: DealerSearchArgs & {\n mapType?: string;\n } = omit(currentValues, ignorePropNames);\n\n let shouldSubmit = false;\n\n const formValuesChanged = !isEqual(\n prevFormValues,\n currentFormValues\n );\n const searchTextChanged = prevValues.q !== currentValues.q;\n\n // If the search values have changed, reset the map location\n if (formValuesChanged || searchTextChanged) {\n viewStatePropNames.forEach(p =>\n formikProps.setFieldValue(p, null, false)\n );\n }\n\n if (formValuesChanged) {\n shouldSubmit = true;\n }\n\n // If the map type changes to the chart, filter the dealers\n // to only show dealers with recent proposals\n if (\n currentFormValues.mapType ===\n DealerMapType.PROPOSAL_PAIDOUT_VALUE &&\n prevFormValues.mapType !==\n DealerMapType.PROPOSAL_PAIDOUT_VALUE &&\n !currentFormValues.hasProposalsPaidOutInTimePeriod\n ) {\n formikProps.setFieldValue(\n \"hasProposalsPaidOutInTimePeriod\",\n true,\n false\n );\n shouldSubmit = true;\n }\n\n // If the map location has changed, submit the form to update\n // the querystring\n const prevViewStateValues = pick(prevValues, viewStatePropNames);\n const currentViewStateValues = pick(\n currentValues,\n viewStatePropNames\n );\n\n if (!isEqual(prevViewStateValues, currentViewStateValues)) {\n shouldSubmit = true;\n }\n\n // Submit the form after a zero timeout, so the submit happens after\n // any state changes are written\n shouldSubmit && setTimeout(() => formikProps.submitForm(), 0);\n }}\n />\n {children({\n variables,\n context,\n initialViewState: {\n latitude: cleanNumber(viewState.latitude),\n longitude: cleanNumber(viewState.longitude),\n pitch: cleanNumber(viewState.pitch),\n bearing: cleanNumber(viewState.bearing),\n zoom: cleanNumber(viewState.zoom)\n },\n onViewStateChanged,\n formikProps\n })}\n \n );\n }}\n \n);\n\nexport default DealerListSearchForm;\n","import gql from \"graphql-tag\";\n\nexport const RegionalSalesManagerFragment = gql`\n fragment RegionalSalesManagerFragment on RegionalSalesManager {\n id\n name\n region\n email\n mobile\n isSuspended\n user {\n id\n username\n }\n }\n`;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult, useQuery } from \"react-apollo\";\nimport { User } from \"../../types\";\nimport { UserFragment, UserShallowFragment } from \"./fragments\";\nimport { UserProfile } from \"./types\";\n\nexport interface LoggedInUserProps {\n loggedInUser: User;\n}\n\nexport interface UserProps {\n loggedInUser: User;\n user: UserProfile;\n}\n\ninterface UserData {\n loggedInUser: User;\n user: UserProfile;\n}\n\ninterface UserArgs {\n id?: string;\n}\n\nexport const GET_USER = gql`\n query UserQuery($id: ID!) {\n loggedInUser {\n id\n username\n roles\n }\n user(id: $id) {\n ...UserFragment\n }\n }\n ${UserFragment}\n`;\n\nexport const GET_USER_SHALLOW = gql`\n query UserQuery($id: ID!) {\n user(id: $id) {\n ...UserShallowFragment\n }\n }\n ${UserShallowFragment}\n`;\n\nconst UserQuery = ({\n children,\n id\n}: UserArgs & {\n children: (\n result: QueryResult & {\n loggedInUser?: User;\n user?: UserProfile;\n }\n ) => JSX.Element | null;\n}) => (\n query={GET_USER} variables={{ id }} skip={!id}>\n {result =>\n children({\n ...result,\n loggedInUser: result?.data?.loggedInUser,\n user: result?.data?.user\n })\n }\n \n);\n\nexport const useUser = (id?: string) => {\n const { loading, data } = useQuery(GET_USER, {\n variables: { id },\n skip: !id\n });\n return { loading, user: data?.user };\n};\n\nexport const useUserShallow = (id?: string) => {\n const { loading, data } = useQuery(GET_USER_SHALLOW, {\n variables: { id },\n skip: !id\n });\n return { loading, user: data?.user };\n};\nexport default UserQuery;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult } from \"react-apollo\";\nimport { DebounceKeys, SearchArgs, SearchResults, User } from \"../../types\";\nimport { IdentityProviderUserFragment } from \"./fragments\";\nimport { UserProfile } from \"./types\";\n\nexport interface IdentityProviderUserListData {\n loggedInUser: User;\n identityProviderUsers: SearchResults;\n}\n\nexport const IDENTITY_PROVIDER_USER_LIST = gql`\n query IdentityProviderUserListQuery(\n $input: IdentityProviderUserSearchArgsInput\n ) {\n loggedInUser {\n id\n roles\n username\n }\n identityProviderUsers(input: $input) {\n pageInfo {\n hasMorePages\n totalResults\n page\n pageSize\n first\n last\n }\n edges {\n node {\n ...IdentityProviderUserFragment\n }\n }\n }\n }\n ${IdentityProviderUserFragment}\n`;\n\nconst IdentityProviderUserListQuery = ({\n children,\n ...input\n}: SearchArgs & {\n children: (\n result: QueryResult\n ) => JSX.Element | null;\n}) => (\n \n query={IDENTITY_PROVIDER_USER_LIST}\n variables={{ input }}\n context={{\n debounceKey: DebounceKeys.SEARCH_IDENTITY_PROVIDER_USERS,\n debounceTimeout: 300\n }}\n >\n {children}\n \n);\n\nexport default IdentityProviderUserListQuery;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult } from \"react-apollo\";\nimport { User } from \"../../types\";\nimport { IdentityProviderUserFragment } from \"./fragments\";\nimport { IdentityProviderUser } from \"./types\";\n\nexport interface LoggedInUserProps {\n loggedInUser: User;\n}\n\nexport interface IdentityProviderUserProps {\n loggedInUser: User;\n identityProviderUser: IdentityProviderUser;\n}\n\ninterface IdentityProviderUserData {\n loggedInUser: User;\n identityProviderUser: IdentityProviderUser;\n}\n\ninterface IdentityProviderUserArgs {\n id?: string;\n}\n\nexport const GET_IDENTITY_PROVIDER_USER = gql`\n query IdentityProviderUserQuery($id: String!) {\n loggedInUser {\n id\n username\n roles\n }\n identityProviderUser(id: $id) {\n ...IdentityProviderUserFragment\n }\n }\n ${IdentityProviderUserFragment}\n`;\n\nconst IdentityProviderUserQuery = ({\n children,\n id\n}: IdentityProviderUserArgs & {\n children: (\n result: QueryResult\n ) => JSX.Element | null;\n}) => (\n \n query={GET_IDENTITY_PROVIDER_USER}\n variables={{ id }}\n skip={!id}\n >\n {children}\n \n);\n\nexport default IdentityProviderUserQuery;\n","import React, { useState } from \"react\";\nimport CustomSelect from \"../../Forms/CustomSelect\";\nimport IdentityProviderUserListQuery from \"./IdentityProviderUserListQuery\";\nimport IdentityProviderUserQuery from \"./IdentityProviderUserQuery\";\nimport { UserProfile } from \"./types\";\n\ninterface IdentityProviderUserSelectProps {\n id?: string;\n onSelectIdentityProviderUser: (user: UserProfile) => void;\n autoFocus?: boolean;\n}\n\nconst IdentityProviderUserSelect = ({\n id,\n onSelectIdentityProviderUser,\n autoFocus\n}: IdentityProviderUserSelectProps) => {\n const [query, updateQuery] = useState(undefined);\n\n return (\n \n {({ data: userData }) => (\n = 3 ? query : undefined}\n >\n {({ data, loading }) => {\n const options =\n loading || !data || !data.identityProviderUsers\n ? []\n : data.identityProviderUsers.edges.map(({ node: user }) => ({\n label: user.username,\n value: user\n }));\n\n const selectedOption =\n userData && userData.identityProviderUser\n ? {\n label: userData.identityProviderUser.username,\n value: userData.identityProviderUser\n }\n : null;\n\n return (\n updateQuery(value)}\n options={options}\n onChange={(value: any) =>\n onSelectIdentityProviderUser(value ? value.value : undefined)\n }\n filterOption={() => true}\n noOptionsMessage={() =>\n loading ? \"Loading...\" : \"No users found\"\n }\n placeholder={\"Select an existing Auth0 user...\"}\n autoFocus={autoFocus}\n isClearable={true}\n />\n );\n }}\n \n )}\n \n );\n};\n\nexport default IdentityProviderUserSelect;\n","import { Field, FieldProps, FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport { Col, FormGroup, Input, Label, Row } from \"reactstrap\";\nimport { formatEnumValue } from \"../../../utils\";\nimport AccountManagerSelect from \"../../AccountManagers/AccountManagerSelect\";\nimport DealerSelect from \"../../Dealers/DealerSelect\";\nimport CustomSelect from \"../../Forms/CustomSelect\";\nimport FormFieldWrapper from \"../../Forms/FormFieldWrapper\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport FormikEffects from \"../../Forms/FormikEffects\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport RadioField from \"../../Forms/RadioField\";\nimport RegionalSalesManagerSelect from \"../../RegionalSalesManagers/RegionalSalesManagerSelect\";\nimport { ContextNames, FormSize, UserRoles } from \"../../types\";\nimport IdentityProviderUserSelect from \"./IdentityProviderUserSelect\";\nimport { UserProfileInput } from \"./types\";\n\ninterface CreateUserFormInnerProps {\n context?: ContextNames;\n fixedRole?: UserRoles;\n formSize?: FormSize;\n}\n\ntype CreateUserFormInnerPropsEnhanced = FormikProps &\n CreateUserFormInnerProps;\n\nconst roleOptions = Object.keys(UserRoles).map(k => ({\n value: [k],\n label: formatEnumValue(k)\n}));\n\nconst RegionalSalesManagerField = ({\n name,\n isDisabled\n}: {\n name: string;\n isDisabled: boolean;\n}) => (\n \n {({ field, form }: FieldProps) => (\n \n {\n form.setFieldTouched(field.name, true);\n form.setFieldValue(field.name, rsmId);\n }}\n isDisabled={isDisabled}\n isClearable={true}\n />\n \n )}\n \n);\n\nconst CreateUserFormInner = (props: CreateUserFormInnerPropsEnhanced) => {\n const {\n context,\n fixedRole,\n formSize,\n setFieldValue,\n setFieldTouched,\n values: {\n FORMSTATE_create: create,\n FORMSTATE_createNewLogin,\n FORMSTATE_enableLinkToExistingLogin,\n FORMSTATE_setPassword,\n roles,\n dealerId,\n accountManagerRegionalSalesManagerId,\n email,\n identityProviderUserId\n }\n } = props;\n\n const narrowCol = formSize === FormSize.NARROW ? 8 : 6;\n const wideCol = formSize === FormSize.NARROW ? 12 : 8;\n\n const isDealer = roles && roles.includes(UserRoles.dealer);\n const isAccountManager = roles && roles.includes(UserRoles.account_manager);\n const isRegionalSalesManager =\n roles && roles.includes(UserRoles.regional_sales_manager);\n\n return (\n <>\n {\n const clearField = (f: string) => {\n props.setFieldValue(f, null);\n props.setFieldTouched(f, false);\n };\n\n if (\n current.roles &&\n current.roles.length &&\n prev.roles &&\n prev.roles.length &&\n current.roles[0] !== prev.roles[0]\n ) {\n [\n \"dealerId\",\n \"accountManagerId\",\n \"regionalSalesManagerId\",\n \"accountManagerRegionalSalesManagerId\",\n \"regionalSalesManagerRegion\",\n \"mobile\"\n ].forEach(clearField);\n }\n\n if (!current.FORMSTATE_setPassword && prev.FORMSTATE_setPassword) {\n [\"setPassword1\", \"setPassword2\"].forEach(clearField);\n }\n\n if (\n current.FORMSTATE_createNewLogin !== prev.FORMSTATE_createNewLogin\n ) {\n [\n \"setPassword1\",\n \"setPassword2\",\n \"email\",\n \"identityProviderUserId\"\n ].forEach(clearField);\n }\n }}\n />\n {create && fixedRole ? (\n \n \n \n \n \n \n \n \n ) : (\n \n \n {({ field, form }: FieldProps) => {\n return (\n \n {\n form.setFieldValue(field.name, (option as any).value);\n }}\n onBlur={() => form.setFieldTouched(field.name, true)}\n options={roleOptions}\n placeholder={\"Select a user role\"}\n />\n \n );\n }}\n \n \n )}\n {(!fixedRole || !create) && isDealer && (\n
\n \n \n \n {(formikProps: any) => (\n \n {\n setFieldTouched(\"dealerId\", true);\n setFieldValue(\"dealerId\", did);\n }}\n autoFocus={true}\n isClearable={true}\n />\n \n )}\n \n \n \n
\n )}\n {isAccountManager && (\n
\n {create ? (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n ) : (\n \n \n \n {({ field, form }: FieldProps) => (\n \n {\n form.setFieldTouched(field.name, true);\n form.setFieldValue(field.name, amId);\n }}\n isClearable={true}\n />\n \n )}\n \n \n \n )}\n
\n )}\n\n {isRegionalSalesManager && (\n
\n {create ? (\n <>\n \n \n \n \n \n \n \n ) : (\n \n \n \n \n \n )}\n
\n )}\n\n {create && FORMSTATE_enableLinkToExistingLogin && (\n \n \n \n )}\n\n {!FORMSTATE_createNewLogin ? (\n <>\n \n \n \n {({ field, form }: FieldProps) => (\n \n {\n const id = userProfile ? userProfile.id : undefined;\n const { forename, surname, username } = userProfile || {\n ...form.initialValues,\n username: form.initialValues.email\n };\n\n setFieldTouched(\"identityProviderUserId\", true, false);\n setFieldValue(\"identityProviderUserId\", id, false);\n\n setFieldValue(\"email\", username, false);\n setFieldValue(\"forename\", forename, false);\n setFieldValue(\"surname\", surname, false);\n\n setTimeout(form.validateForm, 0);\n }}\n autoFocus={true}\n />\n \n )}\n \n \n \n {!create && (\n \n \n \n \n \n \n \n \n )}\n \n ) : null}\n\n {FORMSTATE_createNewLogin || !create ? (\n \n \n Editing the email address will also update the username in\n Auth0.\n

\n ) : null\n }\n />\n
\n ) : null}\n\n \n \n \n \n \n \n {FORMSTATE_createNewLogin && (\n <>\n \n \n \n {FORMSTATE_setPassword && (\n <>\n \n \n \n \n \n \n \n )}\n \n )}\n \n );\n};\n\nexport default CreateUserFormInner;\n","import { faBuilding, faUser } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport * as React from \"react\";\nimport Helmet from \"react-helmet\";\nimport { RouteComponentProps } from \"react-router\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport {\n Button,\n Card,\n CardBody,\n CardHeader,\n CardTitle,\n Col,\n Container,\n Row\n} from \"reactstrap\";\nimport { convertNumber, getFullName } from \"../../utils\";\nimport Breadcrumbs from \"../Breadcrumbs\";\nimport DealerQuery from \"../Dealers/DealerQuery\";\nimport { Dealer } from \"../Dealers/types\";\nimport { LoggedInUserProps } from \"../LoggedInUserQuery\";\nimport QuotationQuery from \"../Quotations/QuotationQuery\";\nimport { Quotation } from \"../Quotations/types\";\nimport { UserRoles } from \"../types\";\nimport \"./CreateProposalTypeScene.scss\";\nimport { ProposalType } from \"./types\";\n\nconst getBreadcrumbData = (dealer?: Dealer, quotation?: Quotation) =>\n dealer\n ? [\n { to: \"/\", title: \"Home\" },\n { to: \"/dealers\", title: \"Dealers\" },\n { to: `/dealers/${dealer.id}/proposals`, title: dealer.name },\n {\n to: `/dealers/${dealer.id}/proposals/create`,\n title: \"Proposal type\",\n active: true\n }\n ]\n : quotation\n ? [\n { to: \"/\", title: \"Home\" },\n { to: \"/quotations\", title: \"Quotations\" },\n {\n to: `/quotations/${quotation && quotation.id}`,\n title: (quotation && getFullName(quotation)) || \"Untitled quotation\"\n },\n {\n to: `/quotations/${quotation && quotation.id}/convert`,\n title: \"Proposal type\",\n active: true\n }\n ]\n : [\n { to: \"/\", title: \"Home\" },\n { to: \"/proposals\", title: \"Proposals\" },\n { to: \"/proposals/create\", title: \"Proposal type\", active: true }\n ];\n\nconst retrieveRedirectLink = (quotationId?: number, dealerId?: number) => {\n return dealerId\n ? `/dealers/${dealerId}/proposals/create/`\n : quotationId\n ? `/quotations/${quotationId}/convert/`\n : `/proposals/create/`;\n};\n\ntype CreateProposalTypeSceneProps = RouteComponentProps<{\n dealerId?: string;\n quotationId?: string;\n}> &\n LoggedInUserProps;\n\nconst CreateProposalTypeScene = ({\n match,\n loggedInUser\n}: CreateProposalTypeSceneProps) => {\n const loggedInDealerId =\n loggedInUser &&\n loggedInUser.dealer &&\n loggedInUser.roles.includes(UserRoles.dealer)\n ? loggedInUser.dealer.id\n : undefined;\n\n const dealerId =\n loggedInDealerId || match.params.dealerId\n ? convertNumber(match.params.dealerId)\n : undefined;\n\n const quotationId = match.params.quotationId\n ? parseInt(match.params.quotationId, 10)\n : undefined;\n\n return (\n <>\n \n \n \n \n \n {({ loading, data }) => {\n const quotation =\n data && data.quotation ? data.quotation : undefined;\n\n return (\n \n {({ data: dealerData, loading: dealerLoading }) => {\n const dealer = loggedInDealerId\n ? undefined\n : dealerData && dealerData.dealer;\n return !dealerLoading && !loading ? (\n \n ) : null;\n }}\n \n );\n }}\n \n\n \n \n Choose a proposal type\n \n \n \n \n \n \n \n \n
\n Individual\n \n \n \n \n \n \n \n
\n Business\n \n \n \n
\n
\n
\n
\n \n
\n
\n \n );\n};\n\nexport default CreateProposalTypeScene;\n","module.exports = __webpack_public_path__ + \"static/media/AutoConvertLogo.2bd4d6a7.svg\";","import * as React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { ContextNames } from \"../../types\";\nimport AccountManagerActivityList from \"./AccountManagerActivityList\";\n\nconst AccountManagerActivityTabContent = ({\n match\n}: RouteComponentProps<{\n dealerId?: string;\n accountManagerId?: string;\n regionalSalesManagerId?: string;\n}>) => {\n const dealerId = match.params.dealerId\n ? parseInt(match.params.dealerId, 10)\n : undefined;\n const accountManagerId = match.params.accountManagerId\n ? decodeURIComponent(match.params.accountManagerId)\n : undefined;\n const regionalSalesManagerId = match.params.regionalSalesManagerId\n ? decodeURIComponent(match.params.regionalSalesManagerId)\n : undefined;\n\n return (\n \n );\n};\n\nexport const UserAccountManagerActivityTabContent = () => {\n const { loggedInUser, loading } = useLoggedInUser();\n\n if (loading || !loggedInUser) {\n return null;\n }\n\n const accountManagerId = loggedInUser.accountManager?.id;\n const regionalSalesManagerId = loggedInUser.regionalSalesManager?.id;\n\n return (\n \n );\n};\n\nexport default AccountManagerActivityTabContent;\n","import { Formik, FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport { Form } from \"reactstrap\";\nimport { ContextNames, FormSize } from \"../../types\";\nimport { UserProfileInput } from \"./types\";\nimport userProfileValidationSchema from \"./userProfileValidationSchema\";\n\ninterface CreateUserFormProps {\n initialValues: UserProfileInput;\n onSubmit: (value: UserProfileInput) => void;\n dealerId?: string;\n userId?: string;\n context?: ContextNames;\n formSize?: FormSize;\n children: (\n props: FormikProps & {\n context?: ContextNames;\n formSize?: FormSize;\n }\n ) => JSX.Element | null;\n}\n\nconst CreateUserForm = ({\n initialValues,\n onSubmit,\n context,\n formSize,\n children\n}: CreateUserFormProps) => (\n \n {props => {\n return (\n
\n {children({ ...props, context, formSize })}\n
\n );\n }}\n \n);\n\nexport default CreateUserForm;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult } from \"react-apollo\";\nimport { SearchResults, User } from \"../types\";\nimport { RegionalSalesManagerFragment } from \"./fragments\";\nimport { RegionalSalesManager, RegionalSalesManagerSearchArgs } from \"./types\";\n\nexport interface RegionalSalesManagerListData {\n loggedInUser: User;\n regionalSalesManagers: SearchResults;\n}\n\nexport const REGIONAL_SALES_MANAGER_LIST = gql`\n query RegionalSalesManagerListQuery(\n $input: RegionalSalesManagerSearchArgsInput\n ) {\n loggedInUser {\n id\n roles\n username\n }\n regionalSalesManagers(input: $input) {\n pageInfo {\n hasMorePages\n totalResults\n page\n pageSize\n first\n last\n }\n edges {\n node {\n ...RegionalSalesManagerFragment\n }\n }\n }\n }\n ${RegionalSalesManagerFragment}\n`;\n\nconst RegionalSalesManagerListQuery = ({\n children,\n ...input\n}: RegionalSalesManagerSearchArgs & {\n children: (\n result: QueryResult<\n RegionalSalesManagerListData,\n { input: RegionalSalesManagerSearchArgs }\n >\n ) => JSX.Element | null;\n}) => (\n \n query={REGIONAL_SALES_MANAGER_LIST}\n variables={{ input }}\n >\n {children}\n \n);\n\nexport default RegionalSalesManagerListQuery;\n","import classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport { useDealer } from \"../../Dealers/DealerQuery\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport { ContextNames } from \"../../types\";\nimport { ProposalSearchArgs } from \"../types\";\n\nconst ProposalListActionButtons = ({\n variables,\n context,\n}: {\n variables?: { input: ProposalSearchArgs };\n context?: ContextNames;\n}) => {\n const dealerId =\n context === ContextNames.DEALER ? variables?.input?.dealerId : undefined;\n\n const { checkCanCreate, checkCanRead } = useLoggedInUser();\n\n const { dealer, loading: dealerLoading } = useDealer(dealerId);\n\n return (\n
\n {checkCanCreate(PermissionModuleNames.Proposals) ? (\n \n New proposal\n \n ) : null}\n {checkCanRead(PermissionModuleNames.DraftProposals) ? (\n \n Draft proposals\n \n ) : null}\n
\n );\n};\n\nexport default ProposalListActionButtons;\n","import React from \"react\";\nimport { DropdownItem } from \"reactstrap\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faArrowDown } from \"@fortawesome/free-solid-svg-icons\";\nimport { ApolloError } from \"apollo-boost\";\n\ninterface SLAs {\n sLAs: string[];\n}\ninterface RunningManData {\n proposalSlas?: SLAs;\n}\n\ninterface RunningManDropdownItemProps {\n loading: boolean;\n error: ApolloError | undefined;\n data: RunningManData;\n}\n\nconst RunningManDropDownItem: React.FunctionComponent<\n RunningManDropdownItemProps\n> = (props) => {\n const { loading, error, data } = props;\n\n let runningManText = \"No SLA set\";\n if (error) {\n runningManText = \"Issues retrieving SLA\";\n } else if (data && data.proposalSlas != null) {\n runningManText = data.proposalSlas.sLAs[0];\n }\n\n return (\n <>\n \n \n Dealer visible SLA{\" \"}\n \n \n \n {loading ? : runningManText}\n \n \n );\n};\n\nexport default RunningManDropDownItem;\n","import { faRunning } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { DropdownMenu, DropdownToggle, UncontrolledDropdown } from \"reactstrap\";\n\ninterface RunningManDropdownProps {\n className?: string;\n children: React.ReactNode | React.ReactNode[];\n allowClicks?: boolean;\n}\n\nconst RunningManDropdown: React.FunctionComponent = ({\n className,\n children,\n allowClicks,\n}: RunningManDropdownProps) => (\n \n {\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n {\" \"}\n RunningMan\n \n {\n if (!allowClicks) {\n e.preventDefault();\n }\n e.stopPropagation();\n }}\n >\n {children}\n \n \n);\n\nexport default RunningManDropdown;\n","import { Field, FieldProps } from \"formik\";\nimport gql from \"graphql-tag\";\nimport React, { useEffect, useState } from \"react\";\nimport { useLazyQuery } from \"react-apollo\";\nimport { DropdownItem } from \"reactstrap\";\nimport RunningManDropdown from \"../../PagedList/RunningManDropdown\";\n\nexport const PROPOSAL_SLAS = gql`\n query ProposalSlas($input: ProposalIdInput) {\n proposalSlas(input: $input) {\n sLAs\n }\n }\n`;\n\nconst SlaDropdown = React.memo((props: { id: string }) => {\n const [SLAs, setSLAs] = useState();\n const [getSLAs, { loading, error, data }] = useLazyQuery(PROPOSAL_SLAS);\n const { id } = props;\n\n useEffect(() => {\n if (!Array.isArray(SLAs) || loading) {\n getSLAs({ variables: { input: { id: id } } });\n setSLAs(data?.proposalSlas?.sLAs);\n }\n }, [SLAs, data, loading, getSLAs, id]);\n\n if (!Array.isArray(SLAs) || loading || error) {\n return null;\n }\n\n return (\n \n {({\n form: {\n initialValues: { editDates, ...initialValues },\n },\n }: FieldProps) => (\n \n {SLAs?.map((sla, index) => (\n \n {sla}\n \n ))}\n \n )}\n \n );\n});\n\nexport default SlaDropdown;\n","import { faSync, faTrash } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport classnames from \"classnames\";\nimport { Field, FieldProps } from \"formik\";\nimport gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { useApolloClient, useMutation, useLazyQuery } from \"react-apollo\";\nimport { DropdownItem } from \"reactstrap\";\nimport config from \"../../../config\";\nimport { getFullName } from \"../../../utils\";\nimport { ConfirmDialog } from \"../../Forms/ConfirmDialogProvider\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport ActionsDropdown from \"../../PagedList/ActionsDropdown\";\nimport RunningManDropdownItem from \"./RunningMannDropDownItem\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport AutoConvertLogo from \"../../shared/AutoConvertLogo.svg\";\nimport { Proposal } from \"../types\";\nimport { PROPOSAL_LIST } from \"./ProposalListQuery\";\nimport { PROPOSAL_SLAS } from \"./SlaDropdown\";\n\nconst DELETE_PROPOSAL = gql`\n mutation DeleteProposal($id: ID!) {\n deleteProposal(id: $id) {\n success\n }\n }\n`;\n\nconst REFRESH_PROPOSAL = gql`\n mutation RefreshProposal($id: ID!) {\n refreshProposal(id: $id) {\n success\n }\n }\n`;\n\n/** Promise which returns after the specified number of milliseconds */\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nconst ProposalDropdown = ({ proposal }: { proposal: Proposal }) => {\n const { id, proposalRef, autoConvertReference } = proposal;\n\n const [getSLAs, { data, loading, error }] = useLazyQuery(PROPOSAL_SLAS);\n const requestSlas = () => getSLAs({ variables: { input: { id: id } } });\n\n const [deleteProposal] = useMutation<{ success: boolean }, { id: number }>(\n DELETE_PROPOSAL\n );\n const [refreshProposal] = useMutation<{ success: boolean }, { id: number }>(\n REFRESH_PROPOSAL\n );\n const client = useApolloClient();\n\n const name = proposal.individualCustomer\n ? getFullName(proposal.individualCustomer)\n : proposal.business?.name;\n\n const { checkCanDelete, isDealer, isAccountManager, isAdministrator } =\n useLoggedInUser();\n\n const canOpenInAutoConvert = !isDealer && !isAccountManager;\n\n return (\n \n {({\n form: {\n initialValues: { editDates, ...initialValues },\n },\n }: FieldProps) => (\n \n {canOpenInAutoConvert ? (\n {\n if (!autoConvertReference) {\n e.preventDefault();\n }\n\n e.stopPropagation();\n }}\n className={classnames(\"dropdown-item\", {\n disabled: !autoConvertReference,\n })}\n href={`${config.AUTOCONVERT_URL}/application/view/${autoConvertReference}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n \n Open in {config.AUTOCONVERT_NAME}\n \n ) : null}\n {isAdministrator ? (\n <>\n {\n e.preventDefault();\n e.stopPropagation();\n\n refreshProposal({\n variables: { id },\n })\n .then(() => sleep(1000))\n .then(() =>\n client.query({\n query: PROPOSAL_LIST,\n variables: {\n input: initialValues || {},\n },\n fetchPolicy: \"network-only\",\n })\n );\n }}\n >\n \n Sync with {config.AUTOCONVERT_NAME}\n \n \n \n ) : null}\n {checkCanDelete(PermissionModuleNames.Proposals) ? (\n <>\n \n \n

\n Are you sure you want to delete proposal \"{proposalRef}\"\n for {name}?\n

\n

\n This action cannot be undone\n

\n \n }\n confirmButtonText=\"Delete proposal\"\n confirmButtonColor=\"danger\"\n >\n {(confirm) => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n confirm(() =>\n deleteProposal({\n variables: { id },\n refetchQueries: [\n {\n query: PROPOSAL_LIST,\n variables: {\n input: initialValues || {},\n },\n },\n ],\n })\n );\n }}\n >\n \n Delete\n
\n )}\n \n \n ) : null}\n
\n )}\n
\n );\n};\n\nexport default ProposalDropdown;\n","import * as React from \"react\";\nimport { RouteComponentProps, withRouter } from \"react-router-dom\";\nimport { compose } from \"recompose\";\nimport { formatCurrency, getFullName, isAdministrator } from \"../../../utils\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport { ContextNames, User, UserRoles } from \"../../types\";\nimport ProposalBadges from \"../ProposalBadges\";\nimport { Proposal } from \"../types\";\nimport ProposalDropdown from \"./ProposalDropdown\";\nimport SlaDropdown from \"./SlaDropdown\";\n\nconst getName = (proposal: Proposal) => {\n if (proposal.business) {\n return proposal.business.name;\n }\n\n if (proposal.individualCustomer) {\n return getFullName(proposal.individualCustomer);\n }\n return undefined;\n};\n\ninterface ProposalListItemProps {\n loggedInUser: User;\n item: Proposal;\n context?: ContextNames;\n}\n\nconst ProposalListItem = ({\n loggedInUser,\n item,\n context,\n history,\n}: RouteComponentProps & ProposalListItemProps) => {\n const isDealer =\n loggedInUser.roles.includes(UserRoles.dealer) ||\n context === ContextNames.DEALER;\n const proposalRef = encodeURIComponent(item.proposalRef.toLowerCase());\n return (\n history.push(`/proposals/${proposalRef}`)}\n >\n \n
\n

\n {getName(item) || \"[No name]\"}\n

\n

\n {item.vehicle.regNo\n ? `${item.vehicle.regNo.toUpperCase()}, `\n : null}\n {item.vehicle.make || item.vehicle.model\n ? `${item.vehicle.make} ${item.vehicle.model}`\n : \"[vehicle unknown]\"}\n

\n
\n {!isDealer && context !== ContextNames.DEALER && item.dealer ? (\n

{item.dealer.name}

\n ) : null}\n\n

\n Finance:{\" \"}\n {item.finance.totalFinance\n ? formatCurrency(item.finance.totalFinance)\n : \"\"}\n

\n

\n APR: {`${Math.round((item.finance.aprRate || 0) * 100) / 100}%`}\n

\n\n

\n Comm:{\" \"}\n {`${\n item.finance.dealerCommission\n ? formatCurrency(item.finance.dealerCommission)\n : \"-\"\n }`}\n

\n\n \n\n {isAdministrator(loggedInUser) ? (\n
\n \n
\n ) : (\n
\n \n
\n )}\n \n \n {item.finance.totalFinance\n ? formatCurrency(item.finance.totalFinance)\n : \"\"}\n \n {`${\n Math.round((item.finance.aprRate || 0) * 100) / 100\n }%`}\n\n \n {`${\n item.finance.dealerCommission\n ? formatCurrency(item.finance.dealerCommission)\n : \"-\"\n }`}\n \n {isAdministrator(loggedInUser) ? (\n \n \n \n ) : (\n \n \n \n )}\n \n );\n};\n\nexport const ProposalListItemLoadingPlaceholder = () => (\n \n \n \n \n \n);\n\nexport const ProposalListItemNoItemsPlaceholder = () => (\n \n \n

No results found

\n \n \n);\n\nexport default compose<\n RouteComponentProps & ProposalListItemProps,\n ProposalListItemProps\n>(withRouter)(ProposalListItem);\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult, useQuery } from \"react-apollo\";\nimport { ProposalSearchArgs, ProposalStatistics } from \"./types\";\n\nexport interface ProposalStatisticsData {\n proposalStatistics: ProposalStatistics;\n}\n\nexport const PROPOSAL_STATISTICS = gql`\n query ProposalStatisticsQuery($input: ProposalSearchArgsInput) {\n proposalStatistics(input: $input) {\n totalCreatedCount\n totalPaidOutCount\n totalAcceptedCount\n totalCancelledCount\n totalFinance\n averagePaidOutFinance\n averageApr\n averagePeriod\n totalDebitBackAmount\n totalDealerCommission\n averageAcceptedFinance\n acceptance\n }\n }\n`;\n\ninterface ProposalStatisticsVariables {\n input?: ProposalSearchArgs;\n}\n\nconst ProposalStatisticsQuery = ({\n children,\n variables\n}: { variables: ProposalStatisticsVariables } & {\n children: (\n result: QueryResult\n ) => JSX.Element | null;\n}) => (\n \n query={PROPOSAL_STATISTICS}\n variables={variables}\n >\n {children}\n \n);\n\nexport const useProposalStatistics = (searchArgs?: ProposalSearchArgs) => {\n // Remove the page information from the payload, so paging does not cause a re-query\n const { page, pageSize, ...input } = searchArgs || {};\n\n const { loading, data } = useQuery<\n ProposalStatisticsData,\n ProposalStatisticsVariables\n >(PROPOSAL_STATISTICS, {\n variables: { input }\n });\n\n return { loading, proposalStatistics: data?.proposalStatistics };\n};\n\nexport default ProposalStatisticsQuery;\n","import * as React from \"react\";\nimport { formatCurrency } from \"../../../utils\";\nimport ListTotals, { ListTotalsItem } from \"../../PagedList/ListTotals\";\nimport { getPeriodDescription } from \"../../shared/PeriodPicker\";\nimport { useProposalStatistics } from \"../ProposalStatisticsQuery\";\nimport { ProposalSearchArgs } from \"../types\";\n\nconst ProposalListTotals = ({\n searchArgs\n}: {\n searchArgs?: ProposalSearchArgs;\n}) => {\n const { loading, proposalStatistics } = useProposalStatistics(searchArgs);\n\n return (\n \n \n {getPeriodDescription(searchArgs?.startDate, searchArgs?.endDate)}\n \n }\n />\n {formatCurrency(proposalStatistics?.totalFinance)}\n ) : null\n }\n loading={loading}\n />\n {formatCurrency(proposalStatistics?.totalDealerCommission)}\n ) : null\n }\n loading={loading}\n />\n \n );\n};\n\nexport default ProposalListTotals;\n","import { faFileExcel } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { FormikProps } from \"formik\";\nimport querystring from \"querystring\";\nimport * as React from \"react\";\nimport {\n Col,\n DropdownItem,\n DropdownMenu,\n DropdownToggle,\n FormGroup,\n Label,\n Row,\n UncontrolledDropdown\n} from \"reactstrap\";\nimport config from \"../../../config\";\nimport AccountManagerSelect from \"../../AccountManagers/AccountManagerSelect\";\nimport DealerSelect from \"../../Dealers/DealerSelect\";\nimport FileDownloadLink from \"../../FileDownloadLink\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport PeriodPickerField from \"../../Forms/PeriodPickerField\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { ContextNames } from \"../../types\";\nimport {\n ProposalSearchArgs,\n ProposalSearchDate,\n ProposalSearchDateLookup\n} from \"../types\";\n\nconst getQuerystringForReports = (args: ProposalSearchArgs) => {\n const status =\n args.status && args.status.length\n ? args.status.map(s => s.replace(/_/g, \"\"))\n : [];\n\n const convertedArgs = {\n ...args,\n status: status && status.length ? status : []\n };\n\n delete (convertedArgs as any).create;\n delete (convertedArgs as any).editDates;\n\n return querystring.stringify(convertedArgs as any);\n};\n\nconst ProposalSearchFilterPanel = ({\n values,\n setFieldValue,\n submitForm,\n initialValues,\n context\n}: FormikProps & { context?: ContextNames }) => {\n const {\n loading,\n loggedInUser,\n isDealer,\n isAccountManager,\n isSuperUser\n } = useLoggedInUser();\n\n if (loading || !loggedInUser) {\n return null;\n }\n\n return (\n <>\n \n \n \n \n
\n \n \n {values.filterByDate\n ? ProposalSearchDateLookup[values.filterByDate].description\n : ProposalSearchDateLookup[ProposalSearchDate.CREATED_DATE]\n .description}{\" \"}\n \n \n {Object.keys(ProposalSearchDate).map(x => (\n {\n setFieldValue(\"filterByDate\", x, false);\n submitForm();\n }}\n >\n {\n ProposalSearchDateLookup[x as ProposalSearchDate]\n .description\n }\n \n ))}\n \n \n \n
\n
\n \n
\n {context !== ContextNames.DEALER && !isDealer && (\n <>\n {context !== ContextNames.ACCOUNT_MANAGER && !isAccountManager && (\n \n \n \n \n {\n setFieldValue(\"accountManagerId\", id, false);\n submitForm();\n }}\n isClearable={true}\n />\n \n \n \n )}\n \n \n \n \n {\n setFieldValue(\"dealerId\", id, false);\n submitForm();\n }}\n isClearable={true}\n />\n \n \n \n \n \n )}\n {!isDealer && (\n \n \n \n \n \n )}\n {isSuperUser && (\n \n \n \n \n \n )}\n {!isDealer && (\n <>\n \n Download\n report\n \n {(isDealer || isAccountManager) && (\n

Report is limited to 200 proposals

\n )}\n \n )}\n \n );\n};\nexport default ProposalSearchFilterPanel;\n","import { difference } from \"lodash\";\nimport * as React from \"react\";\nimport {\n DropdownItem,\n DropdownMenu,\n DropdownToggle,\n InputGroupButtonDropdown\n} from \"reactstrap\";\nimport withToggleState, { ToggleStateProps } from \"../../withToggleState\";\nimport {\n ActiveProposalStatus,\n ProposalStatusEnum,\n ProposalStatusLookup\n} from \"../types\";\n\n// tslint:disable:jsx-no-lambda\nconst ProposalStatusDropdownItem = ({\n status,\n active,\n updateStatus,\n title\n}: {\n title: string;\n active: boolean;\n status: string[];\n updateStatus: (status: string[]) => void;\n}) => {\n const update = () => updateStatus(status);\n\n return (\n \n {title}\n \n );\n};\n\nconst ProposalStatusDropdown = withToggleState<{\n status?: string[];\n updateStatus: (status: string[]) => void;\n}>(false)(\n ({\n status,\n active,\n toggle,\n updateStatus\n }: ToggleStateProps & {\n status?: string[];\n updateStatus: (status: string[]) => void;\n }) => {\n let currentStatus: string;\n\n if (!status || !status.length) {\n currentStatus = \"all\";\n } else {\n currentStatus = status[0].toUpperCase();\n\n if (status.length > 1) {\n const diff = difference(ActiveProposalStatus, status);\n if (diff.length === 0) {\n currentStatus = \"active\";\n }\n }\n }\n\n const title =\n currentStatus === \"all\"\n ? \"All\"\n : !currentStatus || currentStatus === \"active\"\n ? \"Active\"\n : ProposalStatusLookup[currentStatus as ProposalStatusEnum].description;\n\n const allStatus = Object.keys(ProposalStatusEnum) as ProposalStatusEnum[];\n\n const activeGroup = ActiveProposalStatus;\n const inactiveGroup = difference(allStatus, activeGroup);\n\n return (\n \n {title}\n \n \n \n \n {activeGroup.map(s => (\n \n ))}\n \n {inactiveGroup.map(s => (\n \n ))}\n \n \n );\n }\n);\n\nexport default ProposalStatusDropdown;\n","import { faSearch } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { Field, FieldProps } from \"formik\";\nimport * as React from \"react\";\nimport { Button, Input, InputGroup, InputGroupAddon } from \"reactstrap\";\nimport ProposalStatusDropdown from \"./ProposalStatusDropdown\";\n\nconst ProposalSearchInputField = ({\n name,\n placeholder\n}: {\n name: string;\n placeholder?: string;\n}) => (\n \n \n {({\n field,\n form: { setFieldValue, submitForm, values }\n }: FieldProps) => (\n <>\n \n {\n setFieldValue(\"status\", s, false);\n submitForm();\n }}\n />\n \n )}\n \n \n \n \n \n);\n\nexport default ProposalSearchInputField;\n","import { format } from \"date-fns\";\nimport { FormikProps } from \"formik\";\nimport { defaults, difference } from \"lodash\";\nimport * as React from \"react\";\nimport { isAdministrator } from \"../../../utils\";\nimport FormikEffects from \"../../Forms/FormikEffects\";\nimport SearchForm from \"../../Forms/SearchForm\";\nimport { LoggedInUserProps, withLoggedInUser } from \"../../LoggedInUserQuery\";\nimport PagedList from \"../../PagedList\";\nimport { ContextNames, User } from \"../../types\";\nimport {\n ActiveProposalStatus,\n ProposalSearchArgs,\n ProposalSearchDate,\n ProposalStatusEnum\n} from \"../types\";\nimport \"./index.scss\";\nimport ProposalListActionButtons from \"./ProposalListActionButtons\";\nimport ProposalListItem, {\n ProposalListItemLoadingPlaceholder,\n ProposalListItemNoItemsPlaceholder\n} from \"./ProposalListItem\";\nimport { PROPOSAL_LIST, ProposalListData } from \"./ProposalListQuery\";\nimport ProposalListTotals from \"./ProposalListTotals\";\nimport ProposalSearchFilterPanel from \"./ProposalSearchFilterPanel\";\nimport ProposalSearchInputField from \"./ProposalSearchInputField\";\n\ninterface ProposalListProps {\n context?: ContextNames;\n fixedArgs?: ProposalListFormValues;\n defaultArgs?: ProposalListFormValues;\n}\n\ninterface ProposalListFormValues extends ProposalSearchArgs {\n table?: boolean;\n}\n\nconst mapValuesToQuerystring = (values: ProposalListFormValues) => ({\n ...values,\n status: getQuerystringStatus(values.status as ProposalStatusEnum[]),\n startDate: values.startDate\n ? format(values.startDate, \"YYYY-MM-DD\")\n : undefined,\n endDate: values.endDate ? format(values.endDate, \"YYYY-MM-DD\") : undefined\n});\n\nconst mapQuerystringToValues = (qs: any): ProposalListFormValues => ({\n ...qs,\n fundedDealersOnly: qs.fundedDealersOnly === \"true\",\n editDates: qs.editDates === \"true\",\n hasDebitBackOnly: qs.hasDebitBackOnly === \"true\",\n status: getStatusFromQuerystring(qs.status)\n});\n\nconst defaultValues: ProposalListFormValues = {\n page: 1,\n pageSize: 10,\n status: ActiveProposalStatus,\n fundedDealersOnly: false,\n hasDebitBackOnly: false,\n filterByDate: ProposalSearchDate.PAID_OUT_DATE,\n statisticsFilterByDate: true,\n editDates: false\n};\n\nconst getQuerystringStatus = (\n status?: ProposalStatusEnum[]\n): string[] | string | undefined => {\n if (!status) {\n return undefined;\n }\n\n if (!difference(ActiveProposalStatus, status).length) {\n return \"active\";\n }\n\n if (!status.length || !difference(Object.keys(ProposalStatusEnum), status)) {\n return \"all\";\n }\n\n return status.map(s => s.toLowerCase());\n};\n\nconst getStatusFromQuerystring = (\n status?: string | string[]\n): ProposalStatusEnum[] | undefined => {\n if (status === \"active\") {\n return ActiveProposalStatus;\n }\n\n if (status === \"all\") {\n return [];\n }\n\n if (status) {\n if (typeof status === \"string\") {\n return [status.toUpperCase() as ProposalStatusEnum];\n }\n\n if (Array.isArray(status)) {\n return status.map(x => x.toUpperCase() as ProposalStatusEnum);\n }\n }\n\n return undefined;\n};\n\nconst ProposalListTableContainer = ({\n variables,\n children,\n loggedInUser\n}: {\n variables: { input: ProposalSearchArgs };\n children: React.ReactNode;\n loggedInUser?: User;\n context?: ContextNames;\n}) => {\n const {\n input: { page, pageSize, ...input }\n } = variables;\n\n return (\n <>\n {input.startDate || input.endDate ? (\n \n ) : null}\n \n \n \n \n \n \n {loggedInUser && isAdministrator(loggedInUser) ? (\n \n \n {children}\n
\n FinanceAPRCommission\n ) : null}\n
\n \n );\n};\n\nclass ProposalList extends React.Component<\n ProposalListProps & LoggedInUserProps\n> {\n public render() {\n const { context, defaultArgs, fixedArgs } = this.props;\n\n return (\n \n {(formikProps: FormikProps) => {\n const { table, editDates, ...input } = formikProps.initialValues;\n return (\n <>\n {\n let setStatusToAll = false;\n\n const statusIncludesPaidOut =\n !currentValues.status ||\n !currentValues.status.length ||\n currentValues.status.includes(ProposalStatusEnum.PAID_OUT);\n\n // Change the status filter to \"All\" if the date filter is changed to \"Paid out date\"\n // and paid-out proposals are not visible.\n if (\n prevValues.filterByDate !== currentValues.filterByDate &&\n currentValues.filterByDate ===\n ProposalSearchDate.PAID_OUT_DATE &&\n !statusIncludesPaidOut\n ) {\n setStatusToAll = true;\n }\n\n // Change the status filter to \"All\" if the \"Proposals with debit backs only\" checkbox\n // is ticked, and paid-out proposals are not visible.\n if (\n prevValues.hasDebitBackOnly !==\n currentValues.hasDebitBackOnly &&\n currentValues.hasDebitBackOnly &&\n !statusIncludesPaidOut\n ) {\n setStatusToAll = true;\n }\n\n if (setStatusToAll) {\n formikProps.setFieldValue(\"status\", [], false);\n setTimeout(formikProps.submitForm, 0);\n }\n }}\n />\n \n data.loggedInUser && data.loggedInUser.proposals\n }\n listItemsContainer={ProposalListTableContainer}\n actionButtonsComponent={ProposalListActionButtons}\n pollInterval={30000}\n fetchPolicy=\"cache-and-network\"\n loadingPlaceholder={ProposalListItemLoadingPlaceholder}\n noItemsPlaceholder={ProposalListItemNoItemsPlaceholder}\n listItemComponent={ProposalListItem}\n />\n \n );\n }}\n \n );\n }\n}\n\nexport default withLoggedInUser(ProposalList);\n","import { Field, FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport { Col, Row } from \"reactstrap\";\nimport AccountManagerSelect from \"../../AccountManagers/AccountManagerSelect\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport { ContextNames, FormSize } from \"../../types\";\nimport { HouseDealer } from \"../types\";\n\nconst HouseDealerFormInner = ({\n values,\n setFieldValue,\n setFieldTouched,\n formSize,\n context\n}: FormikProps & {\n context?: ContextNames;\n formSize?: FormSize;\n}) => {\n const wideCol = formSize === FormSize.NARROW ? 12 : 6;\n\n return (\n <>\n \n \n \n {(fieldProps: any) => (\n \n {\n setFieldTouched(\"accountManagerId\", true);\n setFieldValue(\"accountManagerId\", amId);\n }}\n isDisabled={\n !!values.accountManagerId &&\n context === ContextNames.ACCOUNT_MANAGER\n }\n requiresHouseDealer={true}\n />\n \n )}\n \n \n \n \n );\n};\n\nexport default HouseDealerFormInner;\n","import { FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\nimport * as Yup from \"yup\";\nimport { cleanFormData } from \"../../../utils\";\nimport ModalForm from \"../../Forms/ModalForm\";\nimport { ContextNames } from \"../../types\";\nimport { HouseDealer } from \"../types\";\nimport { useCreateHouseDealer } from \"./CreateHouseDealerMutation\";\nimport HouseDealerFormInner from \"./HouseDealerFormInner\";\n\ninterface CreateHouseDealerModalProps {\n isOpen: boolean;\n toggle: () => void;\n context?: ContextNames;\n accountManagerId?: string;\n}\n\nconst houseDealerValidationSchema = Yup.object().shape({\n accountManagerId: Yup.string().required()\n});\n\nconst CreateHouseDealerModal = ({\n isOpen,\n toggle,\n context,\n accountManagerId\n}: CreateHouseDealerModalProps) => {\n const createHouseDealer = useCreateHouseDealer();\n const history = useHistory();\n\n return (\n \n createHouseDealer(cleanFormData(values)).then(result => {\n if (result?.data?.createHouseDealer) {\n history.push(`/dealers/${result.data.createHouseDealer.id}`);\n }\n })\n }\n context={context}\n >\n {(props: FormikProps & { context?: ContextNames }) => (\n \n )}\n \n );\n};\n\nexport default CreateHouseDealerModal;\n","import { faHome, faMapMarked } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport classnames from \"classnames\";\nimport React, { useState } from \"react\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport {\n DropdownItem,\n DropdownMenu,\n DropdownToggle,\n UncontrolledButtonDropdown\n} from \"reactstrap\";\nimport {\n useAccountManager,\n useLoggedInAccountManager\n} from \"../../AccountManagers/AccountManagerQuery\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport RouterDropdownItem from \"../../RouterDropdownItem\";\nimport { ContextNames } from \"../../types\";\nimport CreateHouseDealerModal from \"../CreateHouseDealer/CreateHouseDealerModal\";\n\nconst MapButtonLabel = () => (\n <>\n Map view\n \n);\n\nconst getCreateDealerUrl = (accountManagerId?: string) =>\n accountManagerId\n ? `/accountmanagers/${encodeURIComponent(accountManagerId)}/dealers/create`\n : \"/dealers/create\";\n\nconst CreateDealerButton = ({\n accountManagerId\n}: {\n accountManagerId?: string;\n}) => (\n \n New dealer\n \n);\n\nconst DealerListActionButtons = (props: any) => {\n const { context, variables } = props;\n const amId = variables.input.accountManagerId;\n\n const rsmId =\n context === ContextNames.REGIONAL_SALES_MANAGER &&\n variables.input.regionalSalesManagerId;\n\n const { accountManager: selectedAccountManager } = useAccountManager(amId);\n const {\n accountManager: loggedInAccountManager\n } = useLoggedInAccountManager();\n const { checkCanCreate, isSuperUser } = useLoggedInUser();\n\n const accountManager = selectedAccountManager || loggedInAccountManager;\n\n const canCreate = checkCanCreate(PermissionModuleNames.Dealers);\n\n const [showHouseDealerModal, setShowHouseDealerModal] = useState(false);\n const toggleHouseDealerModal = () =>\n setShowHouseDealerModal(!showHouseDealerModal);\n\n const hasHouseDealer = !!accountManager?.houseDealer;\n\n return (\n
\n {canCreate ? (\n <>\n {isSuperUser ? (\n <>\n \n \n \n \n \n New dealer\n \n \n \n New dealer (no questionnaire)\n \n \n New house dealer\n \n \n \n \n \n ) : (\n \n )}\n \n Draft dealers\n \n \n ) : null}\n \n \n \n {accountManager ? (\n \n \n House dealer\n \n ) : null}\n
\n );\n};\n\nexport default DealerListActionButtons;\n","import { faMapMarked, faTrash } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { Field, FieldProps } from \"formik\";\nimport gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { useMutation } from \"react-apollo\";\nimport { DropdownItem } from \"reactstrap\";\nimport { ConfirmDialog } from \"../../Forms/ConfirmDialogProvider\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport ActionsDropdown from \"../../PagedList/ActionsDropdown\";\nimport RouterDropdownItem from \"../../RouterDropdownItem\";\nimport { Dealer } from \"../types\";\nimport { DEALER_LIST } from \"./DealerListQuery\";\n\nconst DELETE_DEALER = gql`\n mutation DeleteDealer($id: ID!) {\n deleteDealer(id: $id) {\n success\n }\n }\n`;\n\nconst DealerDropdown = ({ dealer }: { dealer: Dealer }) => {\n const { id, name, location } = dealer;\n const [deleteDealer] = useMutation(DELETE_DEALER);\n\n const { loggedInUser, isAdministrator } = useLoggedInUser();\n\n if (!loggedInUser || !isAdministrator) {\n return null;\n }\n\n return (\n \n {({\n form: {\n initialValues: {\n editDates,\n latitude,\n longitude,\n zoom,\n pitch,\n bearing,\n mapType,\n mapStyle,\n options,\n proposalEditDates,\n ...initialValues\n }\n }\n }: FieldProps) => (\n \n \n Show on map\n \n\n \n \n

Are you sure you want to delete dealer \"{name}\"?

\n \n }\n confirmButtonText=\"Delete dealer\"\n confirmButtonColor=\"danger\"\n >\n {confirm => (\n \n confirm(() =>\n deleteDealer({\n variables: { id },\n refetchQueries: [\n {\n query: DEALER_LIST,\n variables: {\n input: initialValues || {}\n }\n }\n ]\n })\n )\n }\n >\n \n Delete\n
\n )}\n \n
\n )}\n
\n );\n};\n\nexport default DealerDropdown;\n","import * as React from \"react\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport { Col, Row } from \"reactstrap\";\nimport { getShortAddress } from \"../../../utils\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport DealerBadges from \"../DealerBadges\";\nimport { DealerProps } from \"../types\";\nimport DealerDropdown from \"./DealerDropdown\";\nimport \"./DealerListItem.scss\";\n\nconst DealerListItem = ({ loggedInUser, dealer, context }: DealerProps) => (\n \n \n \n

\n {dealer.name}\n

\n

{getShortAddress(dealer.address)}

\n \n \n \n \n \n
\n
\n);\n\nexport const DealerListItemLoadingPlaceholder = () => (\n
\n \n
\n);\n\nexport default DealerListItem;\n","import * as React from \"react\";\nimport { SearchFormControlsCore } from \"../../Forms/SearchFormControls\";\nimport PagedList from \"../../PagedList\";\nimport { ContextNames } from \"../../types\";\nimport DealerListActionButtons from \"./DealerListActionButtons\";\nimport DealerListFilterPanel from \"./DealerListFilterPanel\";\nimport DealerListItem from \"./DealerListItem\";\nimport { DEALER_LIST, DealerListData } from \"./DealerListQuery\";\nimport DealerListSearchForm from \"./DealerListSearchForm\";\n\ninterface DealerListProps {\n accountManagerId?: string;\n regionalSalesManagerId?: string;\n context?: ContextNames;\n}\n\nconst DealerList = ({\n accountManagerId,\n regionalSalesManagerId,\n context\n}: DealerListProps) => (\n \n {({ variables, formikProps }) => (\n <>\n {\n formikProps.setFieldValue(\n \"options\",\n !formikProps.values.options,\n false\n );\n formikProps.submitForm();\n }}\n placeholder=\"Search dealers\"\n filterPanel={DealerListFilterPanel}\n formikProps={formikProps}\n context={context}\n />\n \n data.loggedInUser && data.loggedInUser.dealers\n }\n fetchPolicy=\"cache-and-network\"\n actionButtonsComponent={DealerListActionButtons}\n context={context}\n listItemComponent={({ item, loggedInUser }) => (\n \n )}\n />\n \n )}\n \n);\n\nexport default DealerList;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport {\n Mutation,\n MutationFunction,\n MutationResult,\n useMutation,\n} from \"react-apollo\";\nimport { QuotationFragment } from \"./fragments\";\nimport { Quotation, QuotationVariables } from \"./types\";\n\nexport interface CreateQuotationData {\n createQuotation: Quotation;\n}\n\nexport const CREATE_QUOTATION = gql`\n mutation CreateQuotation($input: QuotationInput) {\n createQuotation(input: $input) {\n ...QuotationFragment\n }\n }\n ${QuotationFragment}\n`;\nexport interface CreateMannIslandQuotationData {\n createMannIslandQuotation: Quotation;\n}\n\nexport const CREATE_MANN_ISLAND_QUOTATION = gql`\n mutation CreateMannIslandQuotation($input: QuotationInput) {\n createMannIslandQuotation(input: $input) {\n ...QuotationFragment\n }\n }\n ${QuotationFragment}\n`;\n\nconst CreateQuotation = ({\n children,\n}: {\n children: (\n MutationFunction: MutationFunction,\n result: MutationResult\n ) => JSX.Element | null;\n}) => {children};\n\nexport const CreateMannIslandMutation = ({\n children,\n}: {\n children: (\n MutationFunction: MutationFunction<\n CreateMannIslandQuotationData,\n QuotationVariables\n >,\n result: MutationResult\n ) => JSX.Element | null;\n}) => {children};\n\nexport const useMannIslandCreateQuotation = () => {\n const [createQuotation] = useMutation<\n CreateMannIslandQuotationData,\n QuotationVariables\n >(CREATE_MANN_ISLAND_QUOTATION);\n return createQuotation;\n};\n\nexport const useCreateQuotation = () => {\n const [createQuotation] = useMutation<\n CreateQuotationData,\n QuotationVariables\n >(CREATE_QUOTATION);\n return createQuotation;\n};\n\nexport default CreateQuotation;\n","import classnames from \"classnames\";\nimport { distanceInWords } from \"date-fns\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport { Badge } from \"reactstrap\";\nimport { formatCurrency, getShortDateAndTime } from \"../../utils\";\nimport { QuotationProps } from \"./types\";\n\nfunction capitalizeFirstLetter(s: string) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n}\n\nconst QuotationBadges = ({\n quotation: {\n finance: { term, productType, monthlyPayment, financeValue },\n submittedDate\n },\n className\n}: QuotationProps & { className?: string }) => (\n
\n {submittedDate ? {getShortDateAndTime(submittedDate)} : null}\n {submittedDate && moment(submittedDate).isSame(moment(), \"day\") ? (\n {`${capitalizeFirstLetter(\n distanceInWords(new Date(), submittedDate)\n )} ago`}\n ) : null}\n {`${term} months ${productType}`}\n {monthlyPayment ? (\n {formatCurrency(monthlyPayment)} p/m\n ) : null}\n
\n);\n\nexport default QuotationBadges;\n","import { faSpinner } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport classNames from \"classnames\";\nimport * as React from \"react\";\n\nconst LoadingSpinner = () => (\n \n);\n\ninterface ListTotalsProps {\n children: React.ReactElement | React.ReactElement[];\n className?: string;\n}\n\ninterface ListTotalsItemProps {\n label: string;\n value?: string | React.ReactElement | null;\n loading?: boolean;\n}\n\nexport const ListTotals = ({ children, className }: ListTotalsProps) => {\n return
{children}
;\n};\n\nexport const ListTotalsItem = ({\n label,\n value,\n loading\n}: ListTotalsItemProps) => {\n return (\n
\n {label}\n \n {loading ? : value || null}\n \n
\n );\n};\n\nexport default ListTotals;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport {\n Mutation,\n MutationFunction,\n MutationResult,\n useMutation\n} from \"react-apollo\";\nimport { FullDealerFragment } from \"./fragments\";\nimport { Dealer } from \"./types\";\n\ninterface DealerData {\n createOrUpdateDealer: Dealer;\n}\n\ninterface DealerVariables {\n input: Dealer;\n}\n\nexport const CREATE_OR_UPDATE_DEALER = gql`\n mutation CreateOrUpdateDealer($input: DealerInput) {\n createOrUpdateDealer(input: $input) {\n ...FullDealerFragment\n }\n }\n ${FullDealerFragment}\n`;\n\nconst CreateDealer = ({\n children\n}: {\n children: (\n mutationFunction: MutationFunction,\n result: MutationResult\n ) => JSX.Element | null;\n}) => {children};\n\nexport const useCreateOrUpdateDealer = () => {\n const [createDealer] = useMutation(\n CREATE_OR_UPDATE_DEALER\n );\n\n return createDealer;\n};\n\nexport default CreateDealer;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult, useQuery } from \"react-apollo\";\n\nexport interface LendersListData {\n lendersList: {\n id: number;\n name: string;\n }[]\n}\n\nexport const LENDERS_LIST = gql`\n query LendersListQuery {\n lendersList\n }\n`;\n\nconst LendersListQuery = ({\n children,\n}: {\n children: (result: QueryResult) => JSX.Element | null;\n}) => query={LENDERS_LIST}>{children};\n\nexport const useLendersList = () => {\n const { loading, data } = useQuery(LENDERS_LIST);\n\n return { loading, lendersList: data?.lendersList };\n};\n\nexport default LendersListQuery;\n","import { faEnvelope } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Mutation } from \"react-apollo\";\nimport { Button, DropdownItem } from \"reactstrap\";\n\nimport { UserProfile } from \"./types\";\n\ninterface ResetPasswordDropdownItemProps {\n user: UserProfile;\n}\n\nconst RESET_PASSWORD = gql`\n mutation UserResetPassword($id: ID!) {\n userResetPassword(id: $id) {\n success\n }\n }\n`;\n\nconst ResetPasswordDropdownItem = ({\n user: { id, identityProviderUserId },\n}: ResetPasswordDropdownItemProps) => (\n \n !!result.userResetPassword.success\n ? // tslint:disable-next-line:no-console\n console.log(\"Email successfully sent\")\n : // tslint:disable-next-line:no-console\n console.log(\"Failed to send a reset password email\")\n }\n >\n {(resetPassword: any) => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n resetPassword({\n variables: { id },\n });\n }}\n >\n Send password reset email\n \n )}\n \n);\n\nexport const ResetPasswordButton = ({\n user: { id, identityProviderUserId },\n}: ResetPasswordDropdownItemProps) => (\n \n !!result.userResetPassword.success\n ? // tslint:disable-next-line:no-console\n console.log(\"Email successfully sent\")\n : // tslint:disable-next-line:no-console\n console.log(\"Failed to send a reset password email\")\n }\n >\n {(resetPassword: any) => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n resetPassword({\n variables: { id },\n });\n }}\n >\n Send password reset email\n \n )}\n \n);\n\nexport default ResetPasswordDropdownItem;\n","import classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Badge } from \"reactstrap\";\nimport { formatEnumValue } from \"../../../utils\";\nimport { ContextNames, UserRoles } from \"../../types\";\nimport { UserProfile } from \"./types\";\n\nconst UserBadges = ({\n user: { isSuspended, roles, identityProviderUserId },\n className\n}: {\n user: UserProfile;\n className?: string;\n context?: ContextNames;\n}) => {\n return (\n
\n {roles &&\n roles.map(r => (\n \n {formatEnumValue(r)}\n \n ))}\n {identityProviderUserId ? Auth0 login : null}\n {isSuspended && Blocked}\n
\n );\n};\n\nexport default UserBadges;\n","import React from \"react\";\nimport { Col, FormGroup, Row } from \"reactstrap\";\nimport { useAccountManager } from \"../../AccountManagers/AccountManagerQuery\";\nimport AccountManagerSelect from \"../../AccountManagers/AccountManagerSelect\";\nimport {\n FormSectionProps,\n FormSectionSummaryProps\n} from \"../../Forms/MultiSectionForm\";\nimport SummaryRow from \"../../shared/SummarySection/SummaryRow\";\nimport { Dealer } from \"../types\";\n\nexport const AccountManagerSummarySection = ({\n values: { accountManagerId }\n}: FormSectionSummaryProps) => {\n const { accountManager } = useAccountManager(accountManagerId);\n\n return accountManager ? (\n \n ) : null;\n};\n\nconst AccountManagerSection = (props: FormSectionProps) => (\n \n \n \n {\n props.setFieldTouched(\"accountManagerId\", true);\n props.setFieldValue(\"accountManagerId\", id);\n }}\n autoFocus={true}\n />\n \n \n \n);\n\nexport default AccountManagerSection;\n","import { faExternalLinkAlt } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport React from \"react\";\n\nconst CompaniesHouseSearchLink = ({ name }: { name?: string }) => (\n
\n \n Search the Companies House register{\" \"}\n \n \n \n \n
\n);\n\nexport default CompaniesHouseSearchLink;\n","import { FormikProps } from \"formik\";\nimport React, { Component } from \"react\";\nimport { Row } from \"reactstrap\";\nimport RadioField from \"../../Forms/RadioField\";\nimport { Dealer } from \"../types\";\n\ninterface DealerQuestionProps {\n name: string;\n text: string;\n}\n\ntype DealerQuestionPropsEnhanced = FormikProps & DealerQuestionProps;\n\nexport class DealerQuestion extends Component {\n public render() {\n const { name, text } = this.props;\n return (\n <>\n \n \n \n \n );\n }\n}\n","import { faExternalLinkAlt } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { Field } from \"formik\";\nimport React, { Component } from \"react\";\nimport { Col, Row } from \"reactstrap\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport {\n FormSectionProps,\n FormSectionSummaryProps,\n} from \"../../Forms/MultiSectionForm\";\nimport SelectField from \"../../Forms/SelectField\";\nimport SummaryRow, {\n ExternalLinkSummaryRow,\n} from \"../../shared/SummarySection/SummaryRow\";\nimport { Dealer } from \"../types\";\nimport CompaniesHouseSearchLink from \"./CompaniesHouseSearchLink\";\nimport { DealerQuestion } from \"./DealerQuestion\";\nimport FollowUpQuestions from \"./FollowUpQuestions\";\n\nconst fcaStatusList = [\"Full permissions\", \"Limited Permissions\"].map(\n (status) => ({ label: status, value: status })\n);\n\nexport const CompanyDetailsSummarySection = ({\n values,\n}: FormSectionSummaryProps) => {\n const isDealerSetupV2 = values.dealerSetupV2;\n const showFlags = {\n companiesHouseUrl: !isDealerSetupV2,\n fCAStatus: !isDealerSetupV2,\n fCAUrl: !isDealerSetupV2,\n netWorthFromCompaniesHouse: !isDealerSetupV2,\n };\n\n return (\n <>\n \n {showFlags.companiesHouseUrl && (\n \n )}\n \n \n {showFlags.fCAStatus && (\n \n )}\n {showFlags.fCAUrl && (\n \n )}\n {showFlags.netWorthFromCompaniesHouse && (\n \n )}\n \n \n \n );\n};\n\nclass CompanyDetailsSection extends Component> {\n public render() {\n const { values } = this.props;\n const isDealerSetupV2 = values.dealerSetupV2;\n const showFlags = {\n companiesHouseUrl: !isDealerSetupV2,\n fCAStatus: !isDealerSetupV2,\n fCAUrl: !isDealerSetupV2,\n netWorthFromCompaniesHouse: !isDealerSetupV2,\n };\n // console.log(\"CompanyDetailsSection.isDealerSetupV2: \" + isDealerSetupV2);\n\n return (\n <>\n \n \n \n {showFlags.companiesHouseUrl && (\n \n }\n component={FormInputField}\n />\n \n )}\n \n \n \n \n \n \n {showFlags.fCAStatus && (\n \n \n \n )}\n {showFlags.fCAUrl && (\n \n \n \n Search the FCA register{\" \"}\n \n \n \n \n \n }\n />\n \n )}\n {showFlags.netWorthFromCompaniesHouse && (\n \n \n \n )}\n \n \n \n {!isDealerSetupV2 && (\n \n \n \n

\n ICO register check has to be performed\n

\n

\n Please check if dealer is registered on data protection\n register.\n

\n

\n Follow the link to start the search (opens in a new window):{\" \"}\n \n Search the ICO register{\" \"}\n \n \n \n \n

\n \n
\n \n {!!this.props.values.isOnICORegister && (\n \n \n \n )}\n
\n )}\n {isDealerSetupV2 && (\n \n \n \n )}\n \n );\n }\n}\n\nexport default CompanyDetailsSection;\n","import React from \"react\";\nimport { Button, Col, Row } from \"reactstrap\";\nimport { FormSectionProps } from \"../../Forms/MultiSectionForm\";\nimport dealerSetupQuestionnaireValidationSchema from \"../dealerSetupQuestionnaireValidationSchema\";\nimport { Dealer, DealerFormSectionName } from \"../types\";\n\nexport const CreateQuestionnaireSummarySection = () => (\n

Dealer setup questionnaire not completed

\n);\n\nconst CreateQuestionnaireSection = ({\n setFieldValue,\n validateForm,\n navigateToSection\n}: FormSectionProps) => (\n
\n

\n Create a dealer setup questionnaire for this dealer\n

\n \n \n {\n e.preventDefault();\n navigateToSection(DealerFormSectionName.HISTORIC_CHECK);\n setFieldValue(\n \"questionnaire\" as any,\n dealerSetupQuestionnaireValidationSchema.default(),\n false\n );\n setFieldValue(\n \"FORMSTATE_requiresQuestionnaire\" as any,\n true,\n false\n );\n setTimeout(() => {\n validateForm();\n }, 0);\n }}\n >\n Create a dealer setup questionnaire...\n \n \n \n
\n);\n\nexport default CreateQuestionnaireSection;\n","import { Field, FieldProps } from \"formik\";\nimport React, { Component } from \"react\";\nimport { Col, Row } from \"reactstrap\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport { FormSectionProps } from \"../../Forms/MultiSectionForm\";\nimport { Dealer } from \"../types\";\nimport { DealerQuestion } from \"./DealerQuestion\";\n\nclass CurrentSituationSection extends Component> {\n public render() {\n const { ...formik } = this.props;\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n );\n }\n}\n\nexport default CurrentSituationSection;\n","import { Field, FieldProps } from \"formik\";\nimport React from \"react\";\nimport NumberFormat from \"react-number-format\";\nimport { Col, Row } from \"reactstrap\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport { FormSectionProps } from \"../../Forms/MultiSectionForm\";\nimport ValidateBankAccountButton from \"../../Proposals/ProposalForm/ValidateBankAccountButton\";\nimport { Dealer } from \"../types\";\n\nclass DealerBankDetailsSection extends React.Component<\n FormSectionProps\n> {\n public render() {\n const bankDetails = this.props.values.bank;\n const invalidBankAccount = bankDetails.FORMSTATE_invalidBankAccount;\n const accountNotFound =\n !!invalidBankAccount &&\n bankDetails.accountNumber === invalidBankAccount.accountNumber &&\n bankDetails.sortCode === invalidBankAccount.sortCode;\n\n return (\n <>\n \n \n \n {({ field, form }: FieldProps) => {\n return (\n \n {\n const { formattedValue } = values;\n form.setFieldValue(field.name, formattedValue);\n }}\n onBlur={() => {\n form.setFieldTouched(field.name, true);\n }}\n />\n \n );\n }}\n \n \n \n \n \n \n {({ field, form }: FieldProps) => {\n return (\n \n {\n const { formattedValue } = values;\n form.setFieldValue(field.name, formattedValue);\n }}\n onBlur={() => {\n form.setFieldTouched(field.name, true);\n }}\n />\n \n );\n }}\n \n \n \n \n \n {\n [\"bank.accountNumber\", \"bank.sortCode\"].forEach((x) =>\n this.props.setFieldTouched(x as any, true, false)\n );\n return this.props.validateForm().then((errors) => {\n return (\n !errors.bank ||\n (!errors.bank.accountNumber && !errors.bank.sortCode)\n );\n });\n }}\n onBankAccountValidated={({\n isValid,\n bank,\n branch,\n accountNumber,\n sortCode,\n }) => {\n if (isValid) {\n this.props.setFieldValue(\"bank.bank\", bank || null);\n this.props.setFieldValue(\"bank.bankAddress\", branch || null);\n } else {\n this.props.setFieldValue(\n \"bank.FORMSTATE_invalidBankAccount\",\n { accountNumber, sortCode }\n );\n }\n }}\n />\n \n \n \n \n \n \n \n \n \n \n \n \n );\n }\n}\n\nexport default DealerBankDetailsSection;\n","import { Field, FieldProps, FormikProps } from \"formik\";\nimport React from \"react\";\nimport { Col, Label, Row } from \"reactstrap\";\nimport AddressFormSection from \"../../AddressLookup/AddressFormSection\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport RadioField from \"../../Forms/RadioField\";\nimport DateSelectRow from \"../../Proposals/ProposalForm/DateSelectRow\";\nimport { Dealer, DealerContact } from \"../types\";\nimport FollowUpQuestions from \"./FollowUpQuestions\";\nimport TitleSelectField from \"../../Proposals/ProposalForm/TitleSelectField\";\n\ninterface DealerContactsDetailsSectionProps {\n index: number;\n}\n\nconst DealerContactsDetailsSection = ({\n index,\n ...formikProps\n}: DealerContactsDetailsSectionProps & FormikProps) => {\n const values = formikProps.values;\n const contact = values && values.contacts && values.contacts[index];\n const isDealerSetupV2 = values.dealerSetupV2;\n const showFlags = {\n isFCARegulatedPerson: !isDealerSetupV2,\n };\n // console.log(\"DealerContactsDetailsSection.isDealerSetupV2: \" + isDealerSetupV2);\n\n return (\n <>\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {showFlags.isFCARegulatedPerson && (\n \n \n \n \n \n )}\n \n \n \n \n \n {contact && !contact.isDirector && (\n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n );\n};\n\nexport default DealerContactsDetailsSection;\n","import { faChevronDown, faChevronUp } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { FieldArray } from \"formik\";\nimport React from \"react\";\nimport { Button } from \"reactstrap\";\nimport { getFullName } from \"../../../utils\";\nimport { FormSectionProps } from \"../../Forms/MultiSectionForm\";\nimport dealerContactValidationSchema from \"../DealerContacts/dealerContactValidationSchema\";\nimport { Dealer, DealerContact } from \"../types\";\nimport DealerContactsDetailsSection from \"./DealerContactsDetailsSection\";\n\nconst ShortContactSummary = ({ contact }: { contact: DealerContact }) => {\n return (\n <>\n {contact.forename && contact.surname ? (\n

\n Name:{\" \"}\n {`${contact.title ? contact.title : \"\"} ${contact.forename} ${\n contact.surname\n }`}\n

\n ) : null}\n

\n {contact.mobile ? (\n Mobile: {contact.mobile}\n ) : null}\n {contact.telephone ? (\n Telephone: {contact.telephone}\n ) : null}\n

\n {contact.email ? (\n

Email: {contact.email}

\n ) : null}\n {contact.position || contact.isDirector ? (\n

\n Position: {contact.isDirector ? \"Director\" : contact.position}\n

\n ) : null}\n \n );\n};\n\nconst validateContactDetails = (contact: DealerContact) => {\n return !!(contact.forename && contact.surname);\n};\n\nclass DealerContactsSection extends React.Component<\n FormSectionProps,\n { isValidated: boolean; collapsedItems: number[] }\n> {\n constructor(props: FormSectionProps) {\n super(props);\n\n this.state = {\n isValidated: false,\n collapsedItems: []\n };\n\n const { contacts } = this.props.values;\n\n if (contacts.length > 1) {\n contacts.forEach((_, i) => {\n this.state.collapsedItems.push(i);\n });\n }\n }\n public render() {\n const { contacts } = this.props.values;\n const { errors, isSectionTouched } = this.props;\n\n return (\n \n {arrayHelpers => (\n
\n {contacts &&\n contacts.map((contact, i) => {\n const isOpen = this.state.collapsedItems.indexOf(i) === -1;\n const name = getFullName(contact);\n return (\n
\n this.collapseItem(i)\n : () => this.expandItem(i)\n }\n >\n {name ? name : `Contact ${i + 1}`}\n \n \n\n {isOpen ? (\n <>\n \n\n {i > 0 ? (\n arrayHelpers.remove(i)}\n >\n Remove this contact\n \n ) : null}\n \n ) : (\n {\n this.expandItem(i);\n }}\n >\n \n {!validateContactDetails(contact) ? (\n

\n Contact details section is incomplete\n

\n ) : null}\n
\n )}\n
\n );\n })}\n\n {\n arrayHelpers.push(dealerContactValidationSchema.default());\n this.collapseItem(contacts.length - 1);\n }}\n >\n Add another contact\n \n {isSectionTouched && errors.FORMSTATE_contactsError ? (\n

\n {errors.FORMSTATE_contactsError}\n

\n ) : null}\n \n )}\n
\n );\n }\n\n private collapseItem(i: number) {\n const array = this.state.collapsedItems.slice();\n if (array.indexOf(i) === -1) {\n array.push(i);\n\n this.setState({\n collapsedItems: array\n });\n }\n }\n\n private expandItem(i: number) {\n const array = this.state.collapsedItems.slice();\n array.splice(array.indexOf(i), 1);\n\n this.setState({\n collapsedItems: array\n });\n }\n}\n\nexport default DealerContactsSection;\n","import { Field } from \"formik\";\nimport gql from \"graphql-tag\";\nimport React, { FocusEvent, useEffect, useState } from \"react\";\nimport { useLazyQuery } from \"react-apollo\";\nimport { Col, Label, Row } from \"reactstrap\";\nimport { getSingleLineAddress } from \"../../../utils\";\nimport AddressFormSection from \"../../AddressLookup/AddressFormSection\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport {\n FormSectionProps,\n FormSectionSummaryProps,\n} from \"../../Forms/MultiSectionForm\";\nimport SelectField from \"../../Forms/SelectField\";\nimport DateSelectRow from \"../../Proposals/ProposalForm/DateSelectRow\";\nimport SummaryRow, {\n DateSummaryRow,\n EmailSummaryRow,\n TelephoneSummaryRow,\n YesNoSummaryRow,\n} from \"../../shared/SummarySection/SummaryRow\";\nimport { Dealer } from \"../types\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { IsDealerSigned } from \"../dealerSetup\";\n\nconst assetList = [\"Car\", \"LCV\", \"Bike\", \"Car & LCV\", \"Car & Bike\", \"All\"].map(\n (asset) => {\n return { label: asset, value: asset };\n }\n);\n\nconst CHECK_DEALER_EXISTS = gql`\n query CheckDealerExists($input: DealerNameInput) {\n checkDealerExists(input: $input) {\n id\n name\n address {\n id\n postcode\n }\n }\n }\n`;\n\ninterface Address {\n postcode?: string;\n}\ninterface DuplicateDealer {\n id: string;\n name: string;\n address: Address;\n}\n\nexport const DealerDetailsSummarySection = ({\n values,\n}: FormSectionSummaryProps) => {\n const isDealerSetupV2 = values.dealerSetupV2;\n const showFlags = {\n assetClass: !isDealerSetupV2,\n fax: !isDealerSetupV2,\n isMannIslandDealer: !isDealerSetupV2,\n isMannIslandZList: !isDealerSetupV2,\n };\n\n return (\n <>\n \n \n {showFlags.assetClass && (\n \n )}\n \n \n \n \n {showFlags.fax && }\n \n \n \n {showFlags.isMannIslandDealer && (\n \n )}\n {showFlags.isMannIslandZList && (\n \n )}\n \n \n \n );\n};\n\nconst DealerDetailsFormSection_FunctionalComponent = (\n props: FormSectionProps\n) => {\n const { navigateToSection, populateModal, ...formikProps } = props;\n const { address, id } = props.values;\n const { handleBlur } = formikProps;\n const [checkDealerExists, { data, loading }] =\n useLazyQuery(CHECK_DEALER_EXISTS);\n // eslint-disable-next-line\n const [_duplicateDealers, setDuplicateDealers] = useState([]);\n\n const creatingNewDealer = !id;\n const isDealerSetupV2 = true;\n const showFlags = {\n assetClass: !isDealerSetupV2,\n fax: !isDealerSetupV2,\n isMannIslandDealer: !isDealerSetupV2,\n isMannIslandZList: !isDealerSetupV2,\n };\n\n // console.log(\"DealerDetailsFormSection_FunctionalComponent.isDealerSetupV2: \" + isDealerSetupV2);\n\n const { loggedInUser } = useLoggedInUser();\n\n useEffect(() => {\n if (loading) {\n return;\n }\n const dealersReturned =\n !!data?.checkDealerExists && !!data?.checkDealerExists.length;\n\n if (dealersReturned) {\n setDuplicateDealers((prevState) => {\n const match =\n JSON.stringify(prevState) === JSON.stringify(data.checkDealerExists);\n\n if (!match) {\n populateModal &&\n populateModal(\n data.checkDealerExists.map((dealer: DuplicateDealer) => {\n const {\n id,\n name,\n address: { postcode },\n } = dealer;\n return { id, name, postcode };\n })\n );\n return data.checkDealerExists;\n }\n });\n }\n }, [data, populateModal, loading]);\n\n return (\n <>\n \n ) => {\n handleBlur(event);\n const inputValue = event.currentTarget.value;\n if (inputValue.trim() && creatingNewDealer) {\n checkDealerExists({\n variables: { input: { name: inputValue } },\n });\n }\n }}\n />\n \n \n \n \n {showFlags.assetClass && (\n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n {showFlags.fax && (\n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n \n \n {showFlags.isMannIslandZList && !formikProps.values.isMannIslandZList ? (\n \n \n \n ) : null}\n {showFlags.isMannIslandDealer &&\n !formikProps.values.isMannIslandDealer ? (\n \n \n \n ) : null}\n \n \n \n \n \n \n \n );\n};\n\nexport default DealerDetailsFormSection_FunctionalComponent;\n","import { Field, FieldProps } from \"formik\";\nimport React, { Component } from \"react\";\n// tslint:disable-next-line:no-submodule-imports\nimport Creatable from \"react-select/creatable\";\nimport { Col, Row } from \"reactstrap\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport { FormSectionProps } from \"../../Forms/MultiSectionForm\";\nimport { Dealer } from \"../types\";\nimport CompaniesHouseSearchLink from \"./CompaniesHouseSearchLink\";\nimport { DealerQuestion } from \"./DealerQuestion\";\nimport FollowUpQuestions from \"./FollowUpQuestions\";\n\nconst leaseOptions = [\"Mortgage\", \"Owns\", \"Long Term Lease\"].map(lease => {\n return { label: lease, value: lease };\n});\n\nclass DealerInformationSection extends Component> {\n public render() {\n const { ...formik } = this.props;\n const { setFieldValue, setFieldTouched, validateForm } = formik;\n const {\n values: { questionnaire }\n } = this.props;\n\n if (!questionnaire) {\n return null;\n }\n\n return (\n <>\n \n\n \n \n \n \n {(fieldProps: FieldProps) => (\n \n {\n setFieldValue(\n fieldProps.field.name as any,\n option ? option.value : undefined,\n false\n );\n setFieldTouched(\n fieldProps.field.name as any,\n true,\n false\n );\n setTimeout(validateForm, 0);\n }}\n />\n \n )}\n \n \n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n }\n />\n \n \n \n \n \n \n );\n }\n}\n\nexport default DealerInformationSection;\n","import { faArrowDown } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport classnames from \"classnames\";\nimport { FormikProps } from \"formik\";\nimport moment from \"moment\";\nimport React, { useState } from \"react\";\nimport { Alert, Col, Row } from \"reactstrap\";\nimport {\n getFullName,\n getSingleLineAddress,\n hasAddress,\n roundNumber,\n} from \"../../../utils\";\nimport { Address } from \"../../types\";\nimport useHtmlElementClass from \"../../useHtmlElementClass\";\nimport {\n Dealer,\n DealerBank,\n DealerContact,\n DealerProofResponse,\n DealerProofType,\n} from \"../types\";\nimport config from \"../../../config\";\nimport axios from \"axios\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\n\n//#region Helper components\n\nconst SummaryRowSection = ({\n title,\n subtitle,\n children,\n}: {\n title?: string;\n subtitle?: string;\n children: React.ReactNode;\n}) => {\n useHtmlElementClass(\"smooth-scroll\");\n return (\n
\n {title ?

{title}

: null}\n {subtitle ? (\n
{subtitle}
\n ) : null}\n {children}\n
\n );\n};\n\nconst SummaryRow = ({\n title,\n value,\n highlight,\n}: {\n title: string;\n value?: any;\n highlight?: boolean;\n}) =>\n value || value === 0 ? (\n \n \n

{title}

\n \n \n \n {value}\n

\n \n
\n ) : null;\n\nconst AddressRow = ({ address }: { address: Address }) =>\n hasAddress(address) ? (\n \n ) : null;\n\n//#endregion\n\n//#region Form fields check\n\nconst hasDealerDetails = (dealer: Dealer) => {\n return !!(\n dealer &&\n (dealer.name ||\n dealer.url ||\n dealer.email ||\n dealer.telephone ||\n dealer.mobile ||\n dealer.fax ||\n dealer.ccaNumber ||\n dealer.vatNumber ||\n dealer.established ||\n hasAddress(dealer.address))\n );\n};\n\nconst hasDealerPricingDetails = (dealer: Dealer) => {\n return !!(dealer && (dealer.averageBalance || dealer.monthlyVolume));\n};\n\nconst hasDealerProofs = (dealer: Dealer) => {\n return !!true;\n};\n\nconst hasBankDetails = (bank: DealerBank) => {\n return !!(\n bank &&\n (bank.bank ||\n bank.accountName ||\n bank.accountNumber ||\n bank.bankAddress ||\n bank.sortCode)\n );\n};\n\nconst hasContactDetails = (contact: DealerContact) => {\n return !!(\n contact &&\n (contact.title ||\n (contact.forename && contact.surname) ||\n contact.position ||\n contact.telephone ||\n contact.mobile ||\n contact.email)\n );\n};\n\n//#endregion\n\nconst DealerSummarySection = ({ values, errors }: FormikProps) => {\n const [proofsLoaded, setProofsLoaded] = useState(false);\n const [proofEnough, setProofEnough] = useState(false);\n const isDealerSetupV2 = values.dealerSetupV2;\n const showFlags = {\n declaration: !isDealerSetupV2,\n };\n const pt = Object.keys(DealerProofType) as Array<\n keyof typeof DealerProofType\n >;\n let loadingProofs = false;\n // console.log(\"DealerSummarySection.isDealerSetupV2: \" + isDealerSetupV2);\n\n const isProofEnough = (resp: DealerProofResponse): boolean => {\n let res = true; // Assume everything required is present and return false of that's not the case\n pt.map((proofType) => {\n let c = 0;\n if (resp && resp.documents) {\n resp?.documents.map((doc, d) => {\n if (\n doc.metadata &&\n doc.metadata.Proof &&\n doc.metadata.Proof === DealerProofType[proofType]\n ) {\n c++;\n }\n });\n }\n if (c === 0) {\n res = false;\n }\n return proofType;\n });\n return res;\n };\n\n const getFileInfo = (proofref: any) => {\n loadingProofs = true;\n return axios\n .get(\n `${config.API_URL}/api/dealersetup/proof/${encodeURIComponent(\n proofref\n )}`,\n { headers: { \"Cache-Control\": \"no-cache\" } }\n )\n .then((r: any) => {\n let dp = r?.data as DealerProofResponse;\n setProofEnough(isProofEnough(dp));\n setProofsLoaded(true);\n loadingProofs = false;\n })\n .catch((error: any) => {\n // tslint:disable-next-line:no-console\n console.error(\"Error in getFileInfo\", error);\n loadingProofs = false;\n });\n };\n\n if (!proofsLoaded) {\n getFileInfo(values.documentStorageRef);\n }\n\n return (\n
\n {!Object.keys(errors).length || Object.keys(errors).length === 0 ? (\n window.scrollTo(0, document.body.scrollHeight)}\n >\n \n Scroll down to review the details and save dealer\n \n ) : (\n \n More details are required before the dealer can be saved{\" \"}\n \n )}\n\n {hasDealerDetails(values) ? (\n \n \n \n \n \n \n \n \n \n \n \n \n ) : null}\n\n {hasBankDetails(values.bank) ? (\n \n \n \n \n \n \n \n ) : null}\n\n {values.contacts && hasContactDetails(values.contacts[0]) ? (\n \n {values.contacts.map((contact, i) =>\n hasContactDetails(contact) ? (\n \n \n \n \n \n \n \n ) : null\n )}\n \n ) : null}\n\n {hasDealerPricingDetails(values) ? (\n \n \n \n \n \n ) : null}\n\n {hasDealerProofs(values) ? (\n \n {!loadingProofs && proofEnough && (\n \n Sufficient proofs have been provided\n \n )}\n {!loadingProofs && !proofEnough && (\n \n Insufficient proofs provided. At least one of each type required\n \n )}\n {loadingProofs && }\n \n ) : null}\n\n {showFlags.declaration && (\n \n

Submission declaration

\n

\n By submitting this application, you are confirming that all due\n diligence checks have been completed to an acceptable standard, are\n confident that all information provided is accurate as at the point\n of submission and take full responsibility for the recommendation.\n

\n
\n )}\n
\n );\n};\n\nexport default DealerSummarySection;\n","import { Field, FieldProps } from \"formik\";\nimport React, { Component } from \"react\";\nimport { Col, Label, Row } from \"reactstrap\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport { FormSectionProps } from \"../../Forms/MultiSectionForm\";\nimport DateSelectRow from \"../../Proposals/ProposalForm/DateSelectRow\";\nimport { Dealer } from \"../types\";\nimport { DealerQuestion } from \"./DealerQuestion\";\nimport FollowUpQuestions from \"./FollowUpQuestions\";\n\nclass HistoricRelationshipCheckSection extends Component<\n FormSectionProps\n> {\n public render() {\n const { ...formik } = this.props;\n const {\n values: { questionnaire }\n } = this.props;\n\n if (!questionnaire) {\n return null;\n }\n\n return (\n <>\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n\n \n \n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n \n );\n }\n}\n\nexport default HistoricRelationshipCheckSection;\n","import React from \"react\";\nimport Select from \"react-select\";\nimport { Col, Label, Row } from \"reactstrap\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport { FormSectionProps } from \"../../Forms/MultiSectionForm\";\nimport { Dealer } from \"../types\";\nimport FollowUpQuestions from \"./FollowUpQuestions\";\n\nconst lenderOptions = [\n \"Alphera\",\n \"MotoNovo\",\n \"Paragon\",\n \"Mann Island\",\n \"Oodle\",\n \"Hitachi\",\n \"Close\",\n \"BNP\",\n \"Zopa\",\n \"JBR\",\n \"Shawbrook\",\n \"MoneyBarn\",\n \"Moneyway\",\n \"Advantage\",\n \"P & C\",\n]\n .sort()\n .map((lease) => ({ label: lease, value: lease }));\n\nconst ProductMixSection = (props: FormSectionProps) => (\n <>\n \n \n \n ({\n label: lease,\n value: lease,\n }))\n : []\n }\n isMulti={true}\n closeMenuOnSelect={false}\n title=\"Asset class\"\n autoFocus={false}\n options={lenderOptions}\n onChange={(options: any) => {\n const values = options ? options.map((opt: any) => opt.value) : [];\n props.setFieldValue(\"questionnaire.productSetupLenders\", values);\n }}\n />\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n);\n\nexport default ProductMixSection;\n","import * as React from \"react\";\nimport {\n Button,\n Modal,\n ModalBody,\n ModalFooter,\n ModalHeader,\n Table,\n} from \"reactstrap\";\nimport { DuplicateDealerList } from \"./index\";\n\ninterface DuplicateDealerFoundModalProps {\n showModal: boolean;\n dealerList?: DuplicateDealerList | null;\n toggle: () => void;\n}\n\nexport const openInNewTab = (url: string): void => {\n const newWindow = window.open(url, \"_blank\", \"noopener,noreferrer\");\n if (newWindow) newWindow.opener = null;\n};\n\nconst DuplicateDealerFoundModal: React.SFC = ({\n showModal,\n dealerList,\n toggle,\n}: DuplicateDealerFoundModalProps) => {\n return (\n \n <>\n \n Similar dealer\n {dealerList && dealerList?.length > 1 ? \"s\" : \"\"} found\n \n \n Before creating a new dealer, check it doesn't already exist. Clicking\n one of the below dealers will open it in a new tab.\n \n \n \n \n \n \n \n \n \n \n {dealerList?.map((dealer) => {\n return (\n \n openInNewTab(\n `${window.location.origin}/dealers/${dealer.id}`\n )\n }\n >\n \n \n \n );\n })}\n \n
Dealer NamePost Code
{dealer.name}{dealer.postcode}
\n
\n \n \n \n \n \n );\n};\n\nexport default React.memo(DuplicateDealerFoundModal);\n","import React from \"react\";\nimport { Col, Row, InputGroupAddon, InputGroup } from \"reactstrap\";\nimport { useAccountManager } from \"../../AccountManagers/AccountManagerQuery\";\n// import DealerPricingSelect from \"../../DealerPricings/DealerPricingSelect\";\nimport {\n FormSectionProps,\n FormSectionSummaryProps,\n} from \"../../Forms/MultiSectionForm\";\nimport SummaryRow from \"../../shared/SummarySection/SummaryRow\";\nimport { Dealer } from \"../types\";\nimport { Field, FieldProps } from \"formik\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport { roundNumber } from \"../../../utils\";\nimport NumberFormat from \"react-number-format\";\n\nexport const DealerPricingSummarySection = ({\n values,\n}: FormSectionSummaryProps) => {\n const { accountManager } = useAccountManager(values.accountManagerId);\n\n return accountManager ? (\n <>\n \n \n \n \n ) : null;\n};\n\nconst DealerPricingSection = (props: FormSectionProps) => {\n return (\n <>\n \n \n \n \n \n {({ form, field }: FieldProps) => (\n \n \n \n {\n const { formattedValue } = values;\n form.setFieldValue(field.name, formattedValue);\n }}\n onBlur={() => {\n form.setFieldTouched(field.name, true);\n }}\n />\n\n %\n \n \n \n )}\n \n \n \n \n \n \n );\n};\n\nexport default DealerPricingSection;\n","import React from \"react\";\nimport {\n FormSectionProps,\n FormSectionSummaryProps,\n} from \"../../Forms/MultiSectionForm\";\nimport { Dealer } from \"../types\";\nimport * as uuid from \"uuid\";\nimport {\n DealerProofsContent,\n DealerProofsSummaryContent,\n} from \"../DraftDealers/DealerProofsContent\";\n\nexport const DealerProofsSummarySection = ({\n values,\n}: FormSectionSummaryProps) => {\n return (\n <>\n \n \n );\n};\n\nconst DealerProofsSection = (props: FormSectionProps) => {\n if (!props.values.documentStorageRef) {\n props.setFieldValue(\"documentStorageRef\", uuid.v4());\n }\n\n return (\n <>\n \n \n );\n};\n\nexport default DealerProofsSection;\n","import React from \"react\";\nimport { Col, Label, Row } from \"reactstrap\";\nimport Select, { ValueType } from \"react-select\";\nimport { useAccountManager } from \"../../AccountManagers/AccountManagerQuery\";\nimport {\n FormSectionProps,\n FormSectionSummaryProps,\n} from \"../../Forms/MultiSectionForm\";\nimport { Dealer } from \"../types\";\nimport { Field } from \"formik\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport RadioButtonsField from \"../../Forms/RadioButtonsField\";\nimport LendersListQuery from \"../DealerLenderList/LendersListQuery\";\n\nexport const LenderPackagesSummarySection = ({\n values,\n}: FormSectionSummaryProps) => {\n const { accountManager } = useAccountManager(values.accountManagerId);\n\n return accountManager ? (\n <>\n
N/A
\n \n ) : null;\n};\n\nconst sortByName = (a: any, b: any) =>\n a?.name?.toUpperCase() > b?.name?.toUpperCase() ? 1 : -1;\n\nexport const LenderPackagesSection = (props: FormSectionProps) => {\n const onPackageChange = (options: ValueType, am: any) => {\n console.log(\n \"Select changed: \" +\n JSON.stringify(options) +\n \", action: \" +\n JSON.stringify(am)\n );\n\n if (am.action === \"remove-value\") {\n // Single removal\n if (props.values.questionnaire.productSetupLenders) {\n let index = props.values.questionnaire.productSetupLenders?.indexOf(\n am?.removedValue.label\n );\n // console.log(\"removing: \" + index);\n if (index !== -1) {\n props.values.questionnaire.productSetupLenders?.splice(index, 1);\n props.values.pricing?.splice(index, 1);\n props.setFieldValue(\n \"questionnaire.productSetupLenders\",\n props.values.questionnaire.productSetupLenders\n );\n props.setFieldValue(\"pricing\", props.values.pricing);\n }\n }\n } else if (am.action === \"select-option\") {\n // Single addition (only add what's not already there)?\n let index = props.values.questionnaire.productSetupLenders?.indexOf(\n am?.option.label\n );\n if (index === -1) {\n const currL = props.values.questionnaire.productSetupLenders\n ? props.values.questionnaire.productSetupLenders\n : [];\n currL.push(am.option.label);\n props.setFieldValue(\"questionnaire.productSetupLenders\", currL);\n\n const currP = props.values.pricing ? props.values.pricing : [];\n currP.push({\n lender: am.option.label,\n lenderid: am.option.value,\n apr: 0,\n commission: 0,\n asmoney: 0,\n });\n props.setFieldValue(\"pricing\", currP);\n }\n } else {\n // Anything else e.g. clear all\n const values = options ? options.map((opt: any) => opt.label) : [];\n\n props.setFieldValue(\"questionnaire.productSetupLenders\", values);\n\n const pricing = values.map((opt: any) => ({\n lender: opt,\n lenderid: null,\n apr: 0,\n commission: 0,\n asmoney: 0,\n }));\n props.setFieldValue(\"pricing\", pricing);\n }\n // console.log(\"pricing: \" + JSON.stringify(props.values.pricing));\n };\n\n return (\n <>\n \n \n \n \n {({ data }) => {\n const lendersListOptions =\n data && data.lendersList\n ? data.lendersList.sort(sortByName).map((l) => ({\n label: l.name,\n value: l.id.toString(),\n }))\n : [];\n return (\n ({\n label: lease,\n value: lease,\n })\n )}\n isMulti={true}\n closeMenuOnSelect={false}\n title=\"Asset class\"\n autoFocus={false}\n options={lendersListOptions}\n onChange={onPackageChange}\n />\n );\n }}\n \n \n \n <>\n {(props.values.questionnaire?.productSetupLenders?.length || 0) > 0 && (\n \n \n {\"Lender\"}\n \n \n {\"APR\"}\n \n \n {\"Commission\"}\n \n \n {\"% or £?\"}\n \n \n )}\n \n <>\n {props.values.questionnaire.productSetupLenders?.map((el, index) => (\n \n \n {el}\n \n \n \n \n \n \n \n \n {\n props.setFieldValue(`pricing.${index}.commission`, 0);\n props.setFieldTouched(`pricing.${index}.commission`);\n }}\n />\n \n \n ))}\n \n \n );\n};\n","import {\n Formik,\n FormikProps,\n FormikTouched,\n InjectedFormikProps,\n} from \"formik\";\nimport { debounce } from \"lodash\";\nimport memoizeOne from \"memoize-one\";\nimport React from \"react\";\nimport { Prompt, RouteComponentProps, withRouter } from \"react-router\";\nimport { compose } from \"recompose\";\nimport AutoGeneratedFormSectionSummary from \"../../Forms/AutoGeneratedFormSectionSummary\";\nimport MultiSectionForm, {\n CreateOrUpdateMode,\n FormSectionInfo,\n FormSectionSummaryProps,\n SaveDraftProps,\n} from \"../../Forms/MultiSectionForm\";\nimport { LoggedInUserProps, withLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { ContextNames, RecursivePartial, User, UserRoles } from \"../../types\";\nimport dealerValidationSchema from \"../dealerValidationSchema\";\nimport { DraftDealerFormData } from \"../DraftDealers/DraftDealerService\";\nimport { Dealer, DealerFormSectionName, DraftDealer } from \"../types\";\nimport AccountManagerSection, {\n AccountManagerSummarySection,\n} from \"./AccountManagerSection\";\nimport CompanyDetailsSection, {\n CompanyDetailsSummarySection,\n} from \"./CompanyDetailsSection\";\nimport CreateQuestionnnaireSection, {\n CreateQuestionnaireSummarySection,\n} from \"./CreateQuestionnaireSection\";\nimport CurrentSituationSection from \"./CurrentSituationSection\";\nimport DealerBankDetailsSection from \"./DealerBankDetailsSection\";\nimport DealerContactsSection from \"./DealerContactsSection\";\nimport DealerDetailsFormSection, {\n DealerDetailsSummarySection,\n} from \"./DealerDetailsFormSection\";\nimport DealerInformationSection from \"./DealerInformationSection\";\nimport DealerSummarySection from \"./DealerSummarySection\";\nimport HistoricRelationshipCheckSection from \"./HistoricRelationshipCheckSection\";\nimport ProductMixSection from \"./ProductMixSection\";\nimport DuplicateDealerFoundModal from \"./DuplicateDealerFoundModal\";\nimport DealerPricingSection, {\n DealerPricingSummarySection,\n} from \"./DealerPricingSection\";\nimport DealerProofsSection, {\n DealerProofsSummarySection,\n} from \"./DealerProofsSection\";\nimport {\n LenderPackagesSection,\n LenderPackagesSummarySection,\n} from \"./LenderPackagesSection\";\n\nexport interface DealerFormInitialValues {\n initialValues: Dealer;\n initialSection?: DealerFormSectionName;\n initialTouched?: FormikTouched;\n}\n\ninterface DealerFormProps extends DealerFormInitialValues {\n dealer?: RecursivePartial;\n draftDealerLastSaved?: string;\n saveDraft: (formData: DraftDealerFormData) => Promise;\n onSubmitDealer: (dealer: Dealer) => Promise;\n context?: ContextNames;\n canUpdate?: boolean;\n isDealerSetupV2?: boolean;\n}\n\ntype DealerFormPropsEnhanced = InjectedFormikProps<\n DealerFormProps & LoggedInUserProps & RouteComponentProps,\n Dealer\n>;\n\nexport type WatchFields = {\n [K in keyof Values]?: Values[K] extends object\n ? WatchFields\n : true;\n};\n\nconst DealerFormSections: FormSectionInfo[] = [\n {\n id: DealerFormSectionName.ACCOUNT_MANAGER,\n title: \"Account manager\",\n component: AccountManagerSection,\n summaryComponent: AccountManagerSummarySection,\n watchFields: {\n accountManagerId: true,\n },\n },\n {\n id: DealerFormSectionName.DEALER_DETAILS,\n title: \"Dealer details\",\n component: DealerDetailsFormSection,\n summaryComponent: DealerDetailsSummarySection,\n watchFields: {\n name: true,\n tradingStyle: true,\n assetClass: true,\n address: {\n line1: true,\n line2: true,\n line3: true,\n town: true,\n // county: true,\n postcode: true,\n countryId: true,\n telephone: true,\n },\n email: true,\n mobile: true,\n fax: true,\n established: true,\n franchised: true,\n stockFunding: true,\n isMultiQuote: true,\n isMannIslandDealer: true,\n isMannIslandZList: true,\n // isRateForRisk: true,\n },\n },\n {\n id: DealerFormSectionName.COMPANY_DETAILS,\n title: \"Company details\",\n component: CompanyDetailsSection,\n summaryComponent: CompanyDetailsSummarySection,\n watchFields: {\n url: true,\n // companiesHouseUrl: true,\n companyRegNumber: true,\n ccaNumber: true,\n // fCAStatus: true,\n // fCAUrl: true,\n // netWorthFromCompaniesHouse: true,\n vatNumber: true,\n isOnICORegister: true,\n icoNumber: true,\n },\n },\n {\n id: DealerFormSectionName.BANK_DETAILS,\n title: \"Bank details\",\n component: DealerBankDetailsSection,\n watchFields: {\n bank: {\n bank: true,\n accountNumber: true,\n accountName: true,\n sortCode: true,\n bankAddress: true,\n },\n },\n },\n {\n id: DealerFormSectionName.CREATE_QUESTIONNAIRE,\n title: \"Dealer setup questionnaire\",\n component: CreateQuestionnnaireSection,\n summaryComponent: CreateQuestionnaireSummarySection,\n watchFields: {},\n },\n {\n id: DealerFormSectionName.HISTORIC_CHECK,\n title: \"Previous relationship\",\n component: HistoricRelationshipCheckSection,\n summaryComponent: (props: FormSectionSummaryProps) => (\n \n ),\n watchFields: {\n questionnaire: {\n hasPreviousRelationship: true,\n datePreviousRelationshipClosed: true,\n reasonPreviousRelationshipClosed: true,\n issuesWithDealingAgain: true,\n highWriteOffsOrArrears: true,\n isOnLenderZList: true,\n employeeRelationshipWithEVC: true,\n employeeRelationshipPreviousDealer: true,\n employeeRelationshipPreviousDealerRelationship: true,\n relationshipAdditionalInformation: true,\n },\n },\n },\n {\n id: DealerFormSectionName.DEALER_INFORMATION,\n title: \"Dealer information\",\n component: DealerInformationSection,\n summaryComponent: (props: FormSectionSummaryProps) => (\n \n ),\n watchFields: {\n questionnaire: {\n longTermLeaseOnPremises: true,\n longTermLeaseOnPremisesDetails: true,\n numberOfVehiclesInStock: true,\n stockReview: true,\n isStockFinanceable: true,\n reasonNotFinanceable: true,\n isMileageWithinLenderPolicy: true,\n highestVehicleMileage: true,\n isAgeWithinUnderwritingPolicy: true,\n highestVehicleAge: true,\n sorStock: true,\n smartAndReasonable: true,\n hasForecourtAndSignage: true,\n reasonNoForecourtOrSignage: true,\n vehiclesPhotographedConsistently: true,\n advertisesSubprimeFinance: true,\n customersFreeToVisit: true,\n hasComplaintsProcess: true,\n complaintsProcessDetails: true,\n reputationConcerns: true,\n negativeReviewsOnWeb: true,\n negativeReviewsOnWebDetails: true,\n negativeReviewsOnSocialMedia: true,\n negativeReviewsOnSocialMediaDetails: true,\n negativeNews: true,\n negativeNewsDetails: true,\n hasGoodReputation: true,\n wasReferred: true,\n referredBy: true,\n positiveAndAppropriate: true,\n directorsAssociatedWithOtherCompanies: true,\n directorOtherCompanyName: true,\n directorOtherCompanyUrl: true,\n directorOtherCompanyRegNumber: true,\n },\n },\n },\n {\n id: DealerFormSectionName.CURRENT_SITUATION,\n title: \"Current situation\",\n component: CurrentSituationSection,\n summaryComponent: (props: FormSectionSummaryProps) => (\n \n ),\n watchFields: {\n questionnaire: {\n ultimateBeneficialOwners: true,\n approvedPersons: true,\n investors: true,\n otherInterestedParties: true,\n financeProviders: true,\n financeProvidersDuration: true,\n hasVisualShowroomFinance: true,\n whyDoesTheDealerWantToWorkWithEVC: true,\n },\n },\n },\n {\n id: DealerFormSectionName.CONTACTS,\n title: \"Directors and contacts\",\n subtitle:\n \"Must include at least one company director, proprietor or partner\",\n component: DealerContactsSection,\n watchFields: {\n contacts: [\n {\n title: true,\n forename: true,\n surname: true,\n position: true,\n telephone: true,\n mobile: true,\n email: true,\n notes: true,\n emailInclude: true,\n isDirector: true,\n directorDateOfBirth: true,\n isFCARegulatedPerson: true,\n homeAddress: {\n line1: true,\n line2: true,\n line3: true,\n town: true,\n // county: true,\n postcode: true,\n // countryId: true,\n },\n isMainContact: true,\n requestsDealerPortalUserAccount: true,\n isSAFTested: true,\n fax: true,\n sMS: true,\n },\n ],\n FORMSTATE_contactsError: true,\n },\n },\n {\n id: DealerFormSectionName.DEALER_PRICING,\n title: \"Dealer pricing\",\n component: DealerPricingSection,\n summaryComponent: DealerPricingSummarySection,\n watchFields: {\n averageBalance: true,\n agreedApr: true,\n monthlyVolume: true,\n },\n },\n {\n id: DealerFormSectionName.LENDER_PACKAGES,\n title: \"Lender packages\",\n component: LenderPackagesSection,\n summaryComponent: LenderPackagesSummarySection,\n watchFields: {\n questionnaire: {\n productSetupLenders: true,\n },\n },\n },\n {\n id: DealerFormSectionName.DEALER_PROOFS,\n title: \"Dealer proofs\",\n component: DealerProofsSection,\n summaryComponent: DealerProofsSummarySection,\n watchFields: {\n documentStorageRef: true,\n allProofsProvided: true,\n },\n },\n {\n id: DealerFormSectionName.PRODUCT_MIX,\n title: \"Product mix\",\n component: ProductMixSection,\n watchFields: {\n questionnaire: {\n productSetupLenders: true,\n productSetupPCP: true,\n productSetupLTVLoans: true,\n productSetupSubprime: true,\n productSetupVATAssist: true,\n productSetupZeroPercentSubsidy: true,\n },\n },\n },\n {\n id: DealerFormSectionName.SUMMARY,\n title: \"Summary\",\n component: DealerSummarySection,\n watchFields: {},\n },\n];\n\nexport interface DuplicateDealerList extends Array {}\ninterface DuplicateDealer {\n name: string;\n accountNumber: string;\n postcode: string;\n id: string;\n}\n\nclass DealerForm extends React.Component<\n DealerFormPropsEnhanced,\n {\n section?: string;\n savingDraft: boolean;\n showModal: boolean;\n isDealerSetupV2: boolean;\n duplicateDealerList: DuplicateDealerList;\n }\n> {\n /**\n * Field to store the formik setTouched function,\n * so it can be used to set the initial touched values in componentDidMount\n */\n private setTouched: any;\n\n constructor(props: DealerFormPropsEnhanced) {\n super(props);\n this.getSections = memoizeOne(this.getSections.bind(this));\n this.handleSaveDraft = debounce(this.handleSaveDraft.bind(this), 3000, {\n leading: true,\n });\n this.getDraftDealerValidationMessage =\n this.getDraftDealerValidationMessage.bind(this);\n this.handleSectionChanged = this.handleSectionChanged.bind(this);\n this.populateModal = this.populateModal.bind(this);\n this.toggleModal = this.toggleModal.bind(this);\n this.state = {\n section: this.props.initialSection,\n savingDraft: false,\n showModal: false,\n isDealerSetupV2: this.props.isDealerSetupV2 || true,\n duplicateDealerList: [],\n };\n }\n\n public render() {\n const {\n loggedInUser,\n onSubmitDealer,\n draftDealerLastSaved,\n initialValues,\n context,\n canUpdate,\n } = this.props;\n\n const {\n savingDraft,\n section: currentSection,\n isDealerSetupV2,\n showModal,\n } = this.state;\n // console.log(\"DealerForm.isDealerSetupV2: \" + this.state.isDealerSetupV2);\n\n if (!loggedInUser) {\n return null;\n }\n\n return (\n <>\n {\n onSubmitDealer(values).then(() => setSubmitting(false));\n }}\n validateOnChange={false}\n isInitialValid={({ dealer }: any) => !!(dealer && dealer.id)}\n validationSchema={dealerValidationSchema}\n validateOnBlur={true}\n >\n {(formikProps: FormikProps) => {\n this.setTouched = formikProps.setTouched;\n const create = !formikProps.values.id;\n\n const saveDraftProps: SaveDraftProps = {\n saveDraft: () => this.handleSaveDraft(formikProps),\n draftLastSaved: draftDealerLastSaved,\n savingDraft,\n draftValidationMessage: this.getDraftDealerValidationMessage(\n loggedInUser,\n formikProps.values\n ),\n };\n\n return (\n <>\n {create ? (\n

\n New dealer\n {formikProps.values.name ? (\n \n {\" \"}\n - {formikProps.values.name}\n \n ) : null}\n

\n ) : null}\n \n \n {create ? (\n \n ) : null}\n \n );\n }}\n \n \n );\n }\n\n public componentDidMount() {\n if (this.props.initialTouched && this.setTouched) {\n this.setTouched(this.props.initialTouched);\n }\n }\n\n public componentWillUnmount() {\n this.setTouched = undefined;\n }\n\n private handleSectionChanged(section: string) {\n this.setState({ section });\n }\n\n private populateModal = (listOfDealers: DuplicateDealerList) => {\n const match =\n JSON.stringify(this.state.duplicateDealerList) ===\n JSON.stringify(listOfDealers);\n if (!match) {\n this.setState({ duplicateDealerList: listOfDealers, showModal: true });\n }\n };\n\n private toggleModal = () =>\n this.setState({ showModal: !this.state.showModal });\n\n /** Indicates whether the draft dealer can be saved */\n private getDraftDealerValidationMessage(loggedInUser: User, values: Dealer) {\n const isAccountManager = loggedInUser.roles.includes(\n UserRoles.account_manager\n );\n\n if (!values) {\n return undefined;\n }\n\n const missingFields: string[] = [];\n\n if (!isAccountManager && !values.accountManagerId) {\n missingFields.push(\"account manager\");\n }\n\n if (!values.name) {\n missingFields.push(\"dealer name\");\n }\n\n if (missingFields.length) {\n return `Requires ${missingFields.join(\" and \")} to save as draft`;\n }\n\n return undefined;\n }\n\n /**\n * Save the current form state to the server as a draft.\n * Redirects to the draft dealer url if it is being created for the first time.\n */\n private handleSaveDraft({ values, errors, touched }: FormikProps) {\n const { saveDraft, history, initialValues, context } = this.props;\n const { section: currentSection } = this.state;\n\n const formData = {\n values,\n initialValues,\n errors,\n touched,\n currentSection,\n };\n\n this.setState({ savingDraft: true });\n\n return saveDraft(formData).then((result) => {\n if (result) {\n if (context === ContextNames.ACCOUNT_MANAGER) {\n history.push(\n `/accountmanagers/${\n result.accountManager &&\n encodeURIComponent(result.accountManager.id)\n }/dealers/drafts/${result.id}`\n );\n } else {\n history.push(`/dealers/drafts/${result.id}`);\n }\n }\n this.setState({ savingDraft: false });\n });\n }\n\n private getSections(\n loggedInUser: User,\n editMode: CreateOrUpdateMode,\n dealerId?: number,\n dealerSetupV2?: boolean,\n includeQuestionnaire?: boolean,\n includeBankDetails?: boolean,\n context?: ContextNames\n ): FormSectionInfo[] {\n const hideAccountMgrSection =\n loggedInUser.roles.includes(UserRoles.account_manager) ||\n context === ContextNames.ACCOUNT_MANAGER;\n const hideContactsSection = !!dealerId;\n const hideLendersSection = !!dealerId;\n\n return DealerFormSections.filter((section) => {\n if (section.id === DealerFormSectionName.ACCOUNT_MANAGER) {\n return !hideAccountMgrSection;\n }\n if (section.id === DealerFormSectionName.CONTACTS) {\n return !hideContactsSection;\n }\n if (section.id === DealerFormSectionName.LENDER_PACKAGES) {\n return !hideLendersSection;\n }\n\n if (\n [\n DealerFormSectionName.SUMMARY,\n DealerFormSectionName.DEALER_PROOFS,\n ].includes(section.id as any)\n ) {\n return editMode === CreateOrUpdateMode.CREATE;\n }\n\n if (section.id === DealerFormSectionName.BANK_DETAILS) {\n return includeBankDetails;\n }\n\n if (\n dealerSetupV2 &&\n [\n DealerFormSectionName.HISTORIC_CHECK,\n DealerFormSectionName.PRODUCT_MIX,\n DealerFormSectionName.DEALER_INFORMATION,\n // DealerFormSectionName.DEALER_PROOFS,\n DealerFormSectionName.CURRENT_SITUATION,\n DealerFormSectionName.CREATE_QUESTIONNAIRE,\n ].includes(section.id as any)\n ) {\n return false;\n } else {\n if (!includeQuestionnaire) {\n if (\n [\n DealerFormSectionName.HISTORIC_CHECK,\n DealerFormSectionName.PRODUCT_MIX,\n DealerFormSectionName.DEALER_INFORMATION,\n DealerFormSectionName.DEALER_PROOFS,\n DealerFormSectionName.CURRENT_SITUATION,\n ].includes(section.id as any)\n ) {\n return false;\n }\n } else if (section.id === DealerFormSectionName.CREATE_QUESTIONNAIRE) {\n return false;\n }\n }\n\n return true;\n });\n }\n}\n\nexport default compose(\n withRouter,\n withLoggedInUser\n)(DealerForm);\n","import axios from \"axios\";\nimport React, { useState } from \"react\";\nimport {\n Alert,\n Button,\n Col,\n Modal,\n ModalBody,\n ModalFooter,\n ModalHeader,\n Row,\n} from \"reactstrap\";\nimport { withAlerts } from \"../../Alerts/AlertsProvider\";\nimport { AlertsProps } from \"../../Alerts/types\";\nimport { useAuth0 } from \"../../Auth0Login/Auth0Provider\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faSpinner } from \"@fortawesome/free-solid-svg-icons\";\n\ninterface ProofUploadFormProps {\n isOpen: boolean;\n toggle: () => void;\n url: string;\n header?: string;\n proofType?: string;\n proofRef?: string;\n onFileUploaded: (fileName: string) => void;\n}\n\nconst isSeparator = (value: string): boolean =>\n value === \"/\" || value === \"\\\\\" || value === \":\";\n\nconst getBase64 = (file: any) => {\n return new Promise((resolve) => {\n // let fileInfo;\n let baseURL = null;\n // Make new FileReader\n let reader = new FileReader();\n\n // Convert the file to base64 text\n reader.readAsDataURL(file);\n\n // on reader load somthing...\n reader.onload = () => {\n // Make a fileInfo Object\n // console.log(\"Called\", reader);\n baseURL = reader.result;\n // console.log(baseURL);\n resolve(baseURL);\n };\n // console.log(fileInfo);\n });\n};\n\nconst getExtension = (path: string): string => {\n for (let i = path.length - 1; i > -1; --i) {\n const value = path[i];\n if (value === \".\") {\n if (i > 1) {\n if (isSeparator(path[i - 1])) {\n return \"\";\n }\n return path.substring(i + 1);\n }\n return \"\";\n }\n if (isSeparator(value)) {\n return \"\";\n }\n }\n return \"\";\n};\n\nconst removeExtension = (filename: string): string => {\n let res = filename;\n const ext = getExtension(filename);\n if (filename.endsWith(\".\" + ext)) {\n res = filename.substring(0, filename.length - (ext.length + 1));\n }\n return res;\n};\n\nconst ProofUploadForm = ({\n url,\n header,\n proofType,\n proofRef,\n onFileUploaded,\n isOpen,\n toggle,\n addAlert,\n}: ProofUploadFormProps & AlertsProps) => {\n const [file, setFile] = useState(undefined);\n const [title, setTitle] = useState(\"\");\n const [uploading, setUploading] = useState(false);\n const maxMb = 10;\n const oneMb = 1048576;\n const maxBytes = maxMb * oneMb;\n const { getToken } = useAuth0();\n const handleSubmit = (e: any) => {\n e.preventDefault();\n e.stopPropagation();\n setUploading(true);\n\n if (!file || !(file.size <= maxBytes)) {\n return;\n }\n\n const ext = getExtension(file.name);\n\n let cTitle = title as string;\n if (!title || title === \"\") {\n cTitle = removeExtension(file.name as string);\n }\n\n const payload = {\n DealerProofRef: proofRef,\n Proof: proofType,\n Filename: file.name,\n Title: cTitle,\n Ext: ext,\n Base64: \"\",\n };\n\n let token = null;\n\n if (getToken) {\n (async () => {\n await getBase64(file)\n .then((result) => {\n const tmp = result as string;\n payload.Base64 = tmp.substring(tmp.indexOf(\",\") + 1);\n })\n .catch((err) => {});\n\n await getToken().then((value) => {\n token = value;\n\n return axios\n .post(url, payload, {\n headers: {\n \"content-type\": \"application/json\",\n authorization: `Bearer ${token}`,\n },\n })\n .catch((err) => {\n setUploading(false);\n addAlert({ message: \"Error uploading file to Eurodrive server\" });\n })\n .then(() => {\n setUploading(false);\n setFile(undefined);\n setTitle(\"\");\n onFileUploaded(file.name);\n toggle();\n });\n });\n })();\n }\n };\n\n const handleChange = (e: any) => {\n setFile(e.target.files[0]);\n setTitle(removeExtension(e.target.files[0].name));\n };\n\n return (\n \n \n {header ? header : \"Upload file\"}\n \n \n \n
\n setTitle(event.target.value)}\n />\n
\n \n
\n \n \n
\n \n \n
\n \n
\n {file?.size > maxBytes && (\n \n \n \n Files must not exceed {maxMb}Mb\n \n \n \n )}\n
\n \n \n maxBytes}\n >\n {uploading ? (\n <>\n Uploading{\" \"}\n \n \n ) : (\n Upload\n )}\n \n \n \n
\n );\n};\n\nexport default withAlerts(ProofUploadForm);\n","import React, { useState } from \"react\";\nimport { Col, Row, Button, DropdownItem, Alert } from \"reactstrap\";\nimport {\n DealerProofDocument,\n DealerProofResponse,\n DealerProofType,\n} from \"../types\";\nimport { canManageProposalFiles } from \"../../../utils\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport {\n IconDefinition,\n faCamera,\n faCreditCard,\n faPlus,\n faFileAlt,\n faTrash,\n faIdBadge,\n faSpinner,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport config from \"../../../config\";\nimport axios from \"axios\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport { ConfirmDialog } from \"../../Forms/ConfirmDialogProvider\";\nimport ProofUploadForm from \"../DealerForm/ProofUploadForm\";\n// import * as uuid from \"uuid\";\n\nconst sortByDocumentProof = (a: DealerProofDocument, b: DealerProofDocument) =>\n a.metadata?.Proof > b.metadata?.Proof ? 1 : -1;\n\nconst sortByDocumentTitle = (a: DealerProofDocument, b: DealerProofDocument) =>\n a.title.toUpperCase() < b.title.toUpperCase() ? 1 : -1;\n\nexport const DealerProofsSummaryContent = ({\n storageRef,\n}: {\n storageRef?: string;\n}) => {\n const [state, setState] = useState<{\n proofsLoaded: boolean;\n proofEnough: boolean;\n proofs?: any;\n }>({\n proofsLoaded: false,\n proofEnough: false,\n proofs: null,\n });\n let loadingProofs = false;\n\n const getFileSummaryInfo = (proofref: any) => {\n loadingProofs = true;\n return axios\n .get(\n `${config.API_URL}/api/dealersetup/proof/${encodeURIComponent(\n proofref\n )}`,\n { headers: { \"Cache-Control\": \"no-cache\" } }\n )\n .then((r: any) => {\n // console.info(\"got: \", JSON.stringify(r));\n let dp = r?.data as DealerProofResponse;\n if (dp && dp.documents) {\n dp.documents.sort(sortByDocumentTitle).sort(sortByDocumentProof);\n }\n\n setState((s) => ({\n ...s,\n proofs: dp,\n proofsLoaded: true,\n }));\n loadingProofs = false;\n })\n .catch((error: any) => {\n // tslint:disable-next-line:no-console\n console.error(\"Error in getFileInfo2\", error);\n loadingProofs = false;\n });\n };\n\n if (!state.proofsLoaded) {\n getFileSummaryInfo(storageRef);\n }\n\n return true ? (\n <>\n \n {loadingProofs && (\n \n \n \n )}\n {!loadingProofs && (\n \n {state.proofs && (\n \n Browse All\n \n )}\n
\n \n )}\n
\n {(state.proofs as DealerProofResponse)?.documents?.map(\n (el: any, index: number) => (\n \n {el.metadata?.Proof}\n \n \n {el.title}\n \n \n \n )\n )}\n \n ) : null;\n};\n\nexport const DealerProofsContent = ({\n isDraft,\n storageRef,\n setFieldValueFunc,\n}: {\n isDraft?: boolean;\n storageRef?: string;\n setFieldValueFunc?: (field: string, value: any) => void;\n}) => {\n const [state, setState] = useState<{\n deleting: boolean;\n deletingIndex?: string | null;\n proofsLoaded: boolean;\n proofEnough: boolean;\n showModal: boolean;\n proofs?: any;\n proofType?: any;\n }>({\n deleting: false,\n deletingIndex: null,\n proofsLoaded: false,\n proofEnough: false,\n showModal: false,\n proofs: null,\n proofType: null,\n });\n let faIcons: IconDefinition[] = [\n faIdBadge,\n faFileAlt,\n faCreditCard,\n faCamera,\n ];\n\n const pt = Object.keys(DealerProofType) as Array<\n keyof typeof DealerProofType\n >;\n let loadingProofs = false;\n\n const { loggedInUser } = useLoggedInUser();\n\n if (!loggedInUser) {\n return null;\n }\n\n const deleteProofFile = (proofref: any, uniqueId: string) => {\n setState((s) => ({ ...s, deleting: true, deletingIndex: uniqueId }));\n return axios\n .delete(\n `${config.API_URL}/api/dealersetup/proof/${proofref}/${uniqueId}`,\n {\n headers: { \"Cache-Control\": \"no-cache\" },\n }\n )\n .then((r: any) => {\n // console.error(\"deleteProofFile returned: \", JSON.stringify(r));\n getFileInfo(proofref);\n setState((s) => ({ ...s, deleting: false, deletingIndex: null }));\n })\n .catch((error: any) => {\n setState((s) => ({ ...s, deleting: false, deletingIndex: null }));\n // tslint:disable-next-line:no-console\n console.error(\"Error in deleteProofFile\", error);\n });\n };\n\n const onProofDelete = (ev: any) => {\n // console.log(\"onProofDelete: \" + JSON.stringify(ev));\n deleteProofFile(storageRef, ev);\n };\n\n const isProofEnough = (resp: DealerProofResponse): boolean => {\n let res = true; // Assume everything required is present and return false of that's not the case\n pt.map((proofType) => {\n let c = 0;\n if (resp && resp.documents) {\n resp?.documents.map((doc, d) => {\n if (\n doc.metadata &&\n doc.metadata.Proof &&\n doc.metadata.Proof === DealerProofType[proofType]\n ) {\n c++;\n }\n });\n }\n if (c === 0) {\n res = false;\n }\n return proofType;\n });\n return res;\n };\n\n const getFileInfo = (proofref: any) => {\n loadingProofs = true;\n return axios\n .get(\n `${config.API_URL}/api/dealersetup/proof/${encodeURIComponent(\n proofref\n )}`,\n { headers: { \"Cache-Control\": \"no-cache\" } }\n )\n .then((r: any) => {\n let dp = r?.data as DealerProofResponse;\n if (dp && dp.documents) {\n dp.documents.sort(sortByDocumentTitle).sort(sortByDocumentProof);\n }\n\n // console.error(\"getFileInfo returned: \", JSON.stringify(proofs));\n const ipe = isProofEnough(dp);\n if (isDraft && setFieldValueFunc) {\n setFieldValueFunc(\"allProofsProvided\", ipe);\n }\n setState((s) => ({\n ...s,\n proofs: dp,\n proofEnough: ipe,\n proofsLoaded: true,\n }));\n loadingProofs = false;\n })\n .catch((error: any) => {\n // tslint:disable-next-line:no-console\n console.error(\"Error in getFileInfo\", error);\n loadingProofs = false;\n });\n };\n\n const canEdit = canManageProposalFiles(loggedInUser);\n\n if (!state.proofsLoaded) {\n getFileInfo(storageRef);\n }\n\n return (\n <>\n {!loadingProofs && canEdit && (\n {\n getFileInfo(storageRef);\n }}\n isOpen={state.showModal}\n toggle={() =>\n setState((s) => ({ ...s, showModal: !state.showModal }))\n }\n />\n )}\n {!loadingProofs && canEdit && (\n \n {pt.map((el, index) => (\n \n
\n {canEdit && (\n {\n e.preventDefault();\n e.stopPropagation();\n setState((s) => ({\n ...s,\n showModal: true,\n proofType: DealerProofType[el],\n }));\n return false;\n }}\n >\n {DealerProofType[el]}{\" \"}\n \n \n )}\n
\n \n ))}\n
\n )}\n \n {loadingProofs && (\n \n \n \n )}\n {!loadingProofs && (\n \n {state.proofs && (\n \n Browse All\n \n )}\n
\n \n )}\n
\n {(state.proofs as DealerProofResponse)?.documents?.map(\n (el: any, index: number) => (\n \n {el.metadata?.Proof}\n \n \n {el.title}\n \n \n \n \n {(confirm) => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n confirm(() => onProofDelete(el.uniqueId));\n }}\n >\n {\" \"}\n {state.deleting && state.deletingIndex === el.uniqueId ? (\n <>\n Deleting{\" \"}\n \n \n ) : (\n Delete\n )}\n \n )}\n \n \n \n )\n )}\n {isDraft && (\n \n \n \n \n \n )}\n \n \n {!loadingProofs && state.proofEnough && (\n \n Sufficient proofs have been provided\n \n )}\n {!loadingProofs && !state.proofEnough && (\n \n Insufficient proofs provided. At least one of each type required\n \n )}\n \n \n \n \n
\n \n
\n \n );\n};\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Mutation, MutationFunction, MutationResult } from \"react-apollo\";\nimport { UserFragment } from \"./fragments\";\nimport { UserProfile, UserProfileInput } from \"./types\";\n\ninterface LinkUserData {\n linkUserToIdentityProvider: UserProfile;\n}\n\ninterface LinkUserVariables {\n input: UserProfileInput;\n}\n\nexport const LINK_USER = gql`\n mutation LinkUserToIdentityProvider($input: UserInput) {\n linkUserToIdentityProvider(input: $input) {\n ...UserFragment\n }\n }\n ${UserFragment}\n`;\n\nconst LinkUserToIdentityProvider = ({\n children\n}: {\n children: (\n mutateFn: MutationFunction,\n result: MutationResult\n ) => JSX.Element | null;\n}) => (\n mutation={LINK_USER}>\n {children}\n \n);\n\nexport default LinkUserToIdentityProvider;\n","import { merge } from \"lodash\";\nimport * as React from \"react\";\nimport { RouteComponentProps, withRouter } from \"react-router\";\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from \"reactstrap\";\nimport { cleanFormData } from \"../../../utils\";\nimport { FormSize, UserRoles } from \"../../types\";\nimport CreateUserForm from \"./CreateUserForm\";\nimport CreateUserFormInner from \"./CreateUserFormInner\";\nimport LinkUserToIdentityProviderMutation from \"./LinkUserToIdentityProviderMutation\";\nimport { UserProfile, UserProfileInput } from \"./types\";\nimport { USER_LIST } from \"./UserListQuery\";\nimport userProfileValidationSchema from \"./userProfileValidationSchema\";\nimport UserQuery from \"./UserQuery\";\n\ninterface LinkUserToIdentityProviderModalProps {\n id?: string;\n display: boolean;\n toggle: () => void;\n}\n\nconst LinkUserToIdentityProviderModal = ({\n display,\n toggle,\n id,\n history\n}: LinkUserToIdentityProviderModalProps & RouteComponentProps) => {\n return (\n \n \n {({ data, loading }) => {\n const user: UserProfile | undefined = data && data.user;\n\n if (id && loading) {\n return null;\n }\n\n return (\n \n {mutation => (\n {\n toggle();\n\n const payload: UserProfileInput = cleanFormData(values);\n\n return mutation({\n variables: { input: { ...payload } },\n refetchQueries: [\n {\n query: USER_LIST,\n variables: {\n input: {\n page: 1,\n pageSize: 10,\n q: \"\",\n includeSuspended: true\n }\n }\n }\n ]\n }).then(result => {\n if (\n result &&\n result.data &&\n result.data.linkUserToIdentityProvider\n ) {\n const updated = result.data.linkUserToIdentityProvider;\n history.push(`/settings/users/${updated.id}`);\n }\n });\n }}\n >\n {formikProps => (\n <>\n \n Link user to new Auth0 login\n \n \n \n \n \n \n Cancel\n \n \n \n \n )}\n \n )}\n \n );\n }}\n \n \n );\n};\n\nexport default withRouter(LinkUserToIdentityProviderModal);\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Mutation, MutationFunction, MutationResult } from \"react-apollo\";\nimport { User } from \"../../types\";\nimport { UserFragment } from \"./fragments\";\n\ninterface BlockOrUnblockUserData {\n blockOrUnblockUser: User;\n}\n\ninterface BlockOrUnblockUserVariables {\n id: string;\n blocked: boolean;\n}\n\nexport const BLOCK_USER = gql`\n mutation BlockOrUnblockUser($id: ID!, $blocked: Boolean) {\n blockOrUnblockUser(id: $id, blocked: $blocked) {\n ...UserFragment\n }\n }\n ${UserFragment}\n`;\n\nconst BlockOrUnblockUserMutation = ({\n children\n}: {\n children: (\n mutationFunction: MutationFunction<\n BlockOrUnblockUserData,\n BlockOrUnblockUserVariables\n >,\n result: MutationResult\n ) => JSX.Element | null;\n}) => {children};\n\nexport default BlockOrUnblockUserMutation;\n","import { faBan, faCheckCircle } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { Field, FieldProps } from \"formik\";\nimport * as React from \"react\";\nimport { Button, DropdownItem } from \"reactstrap\";\nimport { ConfirmDialog } from \"../../Forms/ConfirmDialogProvider\";\nimport BlockOrUnblockUserMutation from \"./BlockOrUnblockUserMutation\";\nimport { UserProfile, UserSearchArgs } from \"./types\";\nimport { USER_LIST } from \"./UserListQuery\";\n\ninterface BlockOrUnblockUserDropdownItemProps {\n user: UserProfile;\n refreshSearchArgs?: UserSearchArgs;\n children: (props: {\n isSuspended: boolean;\n toggle: () => void;\n }) => JSX.Element;\n}\n\nconst BlockOrUnblockUser = ({\n user: { id, isSuspended, username },\n refreshSearchArgs,\n children\n}: BlockOrUnblockUserDropdownItemProps) => (\n \n {confirm => (\n \n {mutation =>\n children({\n isSuspended,\n toggle: () =>\n confirm(() =>\n mutation({\n variables: { id, blocked: !isSuspended },\n refetchQueries: [\n {\n query: USER_LIST,\n variables: {\n input: refreshSearchArgs || {\n page: 1,\n pageSize: 10,\n includeSuspended: true,\n administratorsOnly: false,\n roles: []\n }\n }\n }\n ]\n })\n )\n })\n }\n \n )}\n \n);\n\nconst BlockOrUnblockUserDropdownItem = ({ user }: { user: UserProfile }) => (\n \n {({ form: { initialValues } }: FieldProps) => (\n \n {({ isSuspended, toggle }) => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n toggle();\n }}\n >\n {\" \"}\n {isSuspended ? \"Unblock\" : \"Block\"}\n \n )}\n \n )}\n \n);\n\nexport const BlockOrUnblockUserButton = ({ user }: { user: UserProfile }) => (\n \n {({ isSuspended, toggle }) => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n toggle();\n }}\n >\n \n {isSuspended ? \"Unblock user\" : \"Block user\"}\n \n )}\n \n);\n\nexport default BlockOrUnblockUserDropdownItem;\n","import * as React from \"react\";\nimport { useApolloClient } from \"react-apollo\";\nimport Helmet from \"react-helmet\";\nimport {\n Redirect,\n RouteComponentProps,\n useHistory,\n useParams,\n} from \"react-router\";\nimport { Container } from \"reactstrap\";\nimport { convertNumber } from \"../../utils\";\nimport Breadcrumbs from \"../Breadcrumbs\";\nimport { useDealer, useLoggedInDealer } from \"../Dealers/DealerQuery\";\nimport { Dealer } from \"../Dealers/types\";\nimport {\n useCreateQuotation,\n useMannIslandCreateQuotation,\n} from \"./CreateQuotationMutation\";\nimport { QuotationFragment } from \"./fragments\";\nimport QuotationForm from \"./QuotationForm\";\nimport { QUOTATION_LIST } from \"./QuotationList/QuotationListQuery\";\nimport { Quotation } from \"./types\";\nimport { LoggedInUserProps, withLoggedInUser } from \"../LoggedInUserQuery\";\nimport { NeedsDealerSigned } from \"../Dealers/dealerSetup\";\nimport { UserRoles } from \"../types\";\nimport { compose } from \"recompose\";\n\nconst getBreadcrumbData = (dealer?: Dealer) =>\n dealer\n ? [\n { to: \"/\", title: \"Home\" },\n { to: \"/dealers\", title: \"Dealers\" },\n { to: `/dealers/${dealer.id}/quotations`, title: dealer.name },\n {\n to: `/dealers/${dealer.id}/quotations/create`,\n title: \"New quotation\",\n active: true,\n },\n ]\n : [\n { to: \"/\", title: \"Home\" },\n { to: \"/quotations\", title: \"Quotations\" },\n { to: \"/quotations/create\", title: \"New quotation\", active: true },\n ];\n\ntype CreateQuotationSceneProps = RouteComponentProps<{}> & LoggedInUserProps;\n\nconst Quotations = ({ loggedInUser }: CreateQuotationSceneProps) => {\n const dealerLI = useLoggedInDealer();\n const params = useParams<{ dealerId?: string }>();\n const history = useHistory();\n const dealerId = params.dealerId ? convertNumber(params.dealerId) : undefined;\n const { loading: dealerLoading, dealer } = useDealer(dealerId);\n const mutation = useCreateQuotation();\n const mannIslandMutation = useMannIslandCreateQuotation();\n const client = useApolloClient();\n\n if (loggedInUser) {\n const isDealer = [UserRoles.dealer].some((r) =>\n loggedInUser.roles.includes(r)\n );\n\n if (isDealer && NeedsDealerSigned(dealerLI.dealer)) {\n return (\n <>\n \n \n );\n }\n }\n\n return (\n <>\n \n New quotation | Eurodrive\n \n \n {!dealerLoading ? (\n \n ) : null}\n {\n const { isMannIslandDealer, isMultiQuote, ...rest } = quotation;\n quotation = rest;\n if (quotation.vehicle)\n quotation.vehicle.capId = quotation.vehicle?.capId?.toString();\n\n if (!isMultiQuote && isMannIslandDealer) {\n return mannIslandMutation({\n variables: { input: quotation },\n refetchQueries: [\n {\n query: QUOTATION_LIST,\n variables: { input: { page: 1, pageSize: 10 } },\n },\n ],\n }).then((result) => {\n if (result && result.data) {\n const created = result.data.createMannIslandQuotation;\n client?.writeFragment({\n id: (created.id || \"\").toString(),\n fragment: QuotationFragment,\n data: created,\n fragmentName: \"QuotationFragment\",\n });\n history.push(`/quotations/${created.id}`);\n }\n });\n } else {\n delete quotation.vehicle?.imported;\n return mutation({\n variables: { input: quotation },\n refetchQueries: [\n {\n query: QUOTATION_LIST,\n variables: { input: { page: 1, pageSize: 10 } },\n },\n ],\n }).then((result) => {\n if (result && result.data) {\n const created = result.data.createQuotation;\n client?.writeFragment({\n id: (created.id || \"\").toString(),\n fragment: QuotationFragment,\n data: created,\n fragmentName: \"QuotationFragment\",\n });\n history.push(`/quotations/${created.id}`);\n }\n });\n }\n }}\n />\n \n \n );\n};\n\nexport default compose(withLoggedInUser)(\n Quotations\n);\n","import { FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport { Col, FormGroup, Label, Row } from \"reactstrap\";\nimport AccountManagerSelect from \"../../AccountManagers/AccountManagerSelect\";\nimport DealerSelect from \"../../Dealers/DealerSelect\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { ContextNames } from \"../../types\";\nimport { DraftProposalSearchArgs } from \"../types\";\n\nconst DraftProposalListFilterPanel = ({\n values,\n setFieldValue,\n submitForm,\n context\n}: FormikProps & { context?: ContextNames }) => {\n const { loggedInUser, isDealer, isAccountManager } = useLoggedInUser();\n\n if (!loggedInUser) {\n return null;\n }\n\n return (\n <>\n {context !== ContextNames.DEALER && !isDealer && (\n <>\n {context !== ContextNames.ACCOUNT_MANAGER && !isAccountManager && (\n \n \n \n \n {\n setFieldValue(\"accountManagerId\", id, false);\n submitForm();\n }}\n isClearable={true}\n />\n \n \n \n )}\n \n \n \n \n {\n setFieldValue(\"dealerId\", id, false);\n submitForm();\n }}\n isClearable={true}\n />\n \n \n \n \n )}\n \n );\n};\n\nexport default DraftProposalListFilterPanel;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Mutation, MutationFunction, MutationResult } from \"react-apollo\";\n\ninterface DeleteDraftProposalData {\n success: boolean;\n}\n\ninterface DeleteDraftProposalVariables {\n id: number;\n}\n\nexport const DELETE_DRAFT_PROPOSAL = gql`\n mutation DeleteDraftProposal($id: ID!) {\n deleteDraftProposal(id: $id) {\n success\n }\n }\n`;\n\nconst DeleteDraftProposalMutation = ({\n children\n}: {\n children: (\n mutateFn: MutationFunction<\n DeleteDraftProposalData,\n DeleteDraftProposalVariables\n >,\n result: MutationResult\n ) => JSX.Element | null;\n}) => (\n \n mutation={DELETE_DRAFT_PROPOSAL}\n >\n {children}\n \n);\n\nexport default DeleteDraftProposalMutation;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult } from \"react-apollo\";\nimport { SearchArgs, SearchResults, User } from \"../../types\";\nimport { DraftProposalShallowFragment } from \"../fragments\";\nimport { DraftProposal } from \"../types\";\n\nexport interface DraftProposalListData {\n loggedInUser: User & {\n draftProposals: SearchResults;\n };\n}\n\nexport const DRAFT_PROPOSAL_LIST = gql`\n query DraftProposalListQuery($input: DraftProposalSearchArgsInput) {\n loggedInUser {\n id\n username\n roles\n draftProposals(input: $input) {\n pageInfo {\n hasMorePages\n totalResults\n page\n pageSize\n first\n last\n }\n edges {\n node {\n ...DraftProposalShallowFragment\n }\n }\n }\n }\n }\n ${DraftProposalShallowFragment}\n`;\n\nconst DraftProposalListQuery = ({\n children,\n ...input\n}: SearchArgs & {\n children: (\n result: QueryResult\n ) => JSX.Element | null;\n}) => (\n \n query={DRAFT_PROPOSAL_LIST}\n variables={{ input }}\n >\n {children}\n \n);\n\nexport default DraftProposalListQuery;\n","import { faTrash } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport * as React from \"react\";\nimport { DropdownItem } from \"reactstrap\";\nimport { ConfirmDialog } from \"../../Forms/ConfirmDialogProvider\";\nimport { DraftProposal } from \"../types\";\nimport DeleteDraftProposalMutation from \"./DeleteDraftProposalMutation\";\nimport { DRAFT_PROPOSAL_LIST } from \"./DraftProposalListQuery\";\n\ninterface DeleteDraftProposalDropdownItemProps {\n draftProposal: DraftProposal;\n}\n\nconst DeleteDraftProposalDropdownItem = ({\n draftProposal: { id }\n}: DeleteDraftProposalDropdownItemProps) => (\n \n {confirm => (\n \n {mutation => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n confirm(() =>\n mutation({\n variables: { id: id || 0 },\n refetchQueries: [\n {\n query: DRAFT_PROPOSAL_LIST,\n variables: {\n input: {\n page: 1,\n pageSize: 10\n }\n }\n }\n ]\n })\n );\n }}\n >\n Delete\n \n )}\n \n )}\n \n);\n\nexport default DeleteDraftProposalDropdownItem;\n","import classnames from \"classnames\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport { Badge } from \"reactstrap\";\nimport DistanceInWordsText from \"../ProposalForm/DistanceInWordsText\";\nimport { DraftProposalProps } from \"../types\";\n\nconst DraftProposalBadges = ({\n draftProposal: { updated, isDirectDeal },\n className,\n}: DraftProposalProps & { className?: string }) => (\n
\n \n \n \n {isDirectDeal && (\n \n Direct Deal\n \n )}\n
\n);\n\nexport default DraftProposalBadges;\n","import * as React from \"react\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport { Col, Row } from \"reactstrap\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport ActionsDropdown from \"../../PagedList/ActionsDropdown\";\nimport { DraftProposalProps } from \"../types\";\nimport DeleteDraftProposalDropdownItem from \"./DeleteDraftProposalDropdownItem\";\nimport DraftProposalBadges from \"./DraftProposalBadges\";\n\nconst DraftProposalListItem = ({\n loggedInUser,\n draftProposal\n}: DraftProposalProps) => (\n \n \n \n
\n

\n {draftProposal.customerDescription}\n

\n

\n {draftProposal.vehicleDescription}\n

\n
\n {!loggedInUser.dealer && draftProposal.dealer && (\n

{draftProposal.dealer.name}

\n )}\n \n \n \n \n \n \n \n
\n \n);\n\nexport const DraftProposalListItemLoadingPlaceholder = () => (\n
\n \n
\n);\n\nexport default DraftProposalListItem;\n","import { FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport SearchForm from \"../../Forms/SearchForm\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport PagedList from \"../../PagedList\";\nimport { ContextNames } from \"../../types\";\nimport { DraftProposalSearchArgs } from \"../types\";\nimport DraftProposalListFilterPanel from \"./DraftProposalListFilterPanel\";\nimport DraftProposalListItem from \"./DraftProposalListItem\";\nimport {\n DRAFT_PROPOSAL_LIST,\n DraftProposalListData\n} from \"./DraftProposalListQuery\";\n\nconst defaultSearchArgs = {\n page: 1,\n pageSize: 10\n};\n\nconst DraftProposalList = ({\n dealerId,\n context\n}: {\n dealerId?: number;\n context?: ContextNames;\n}) => {\n const { loggedInUser, isDealer } = useLoggedInUser();\n\n if (!loggedInUser) {\n return null;\n }\n\n return (\n qs}\n mapValuesToQuerystring={args => args}\n defaultValues={defaultSearchArgs}\n fixedValues={{ dealerId }}\n filterPanel={\n context === ContextNames.DEALER || isDealer\n ? undefined\n : DraftProposalListFilterPanel\n }\n context={context}\n >\n {(formikProps: FormikProps) => (\n \n data.loggedInUser && data.loggedInUser.draftProposals\n }\n listItemComponent={({ item }) => (\n \n )}\n />\n )}\n \n );\n};\n\nexport default DraftProposalList;\n","import * as React from \"react\";\nimport { RouteComponentProps, withRouter } from \"react-router\";\nimport { Container } from \"reactstrap\";\nimport Breadcrumbs from \"../../Breadcrumbs\";\nimport DealerQuery from \"../../Dealers/DealerQuery\";\nimport { Dealer } from \"../../Dealers/types\";\nimport { ContextNames } from \"../../types\";\nimport DraftProposalList from \"./DraftProposalList\";\n\ntype DraftProposalListProps = {} & RouteComponentProps<{ dealerId?: string }>;\n\nconst DraftProposalBreadcrumbs = ({ dealer }: { dealer?: Dealer }) => {\n const breadcrumbs = dealer\n ? [\n {\n to: \"/\",\n title: \"Home\"\n },\n { to: \"/dealers\", title: \"Dealers\" },\n { to: `/dealers/${dealer.id}/proposals`, title: dealer.name },\n {\n to: `/dealers/${dealer.id}/proposals/drafts`,\n title: \"Draft proposals\",\n active: true\n }\n ]\n : [\n {\n to: \"/\",\n title: \"Home\"\n },\n { to: \"/proposals\", title: \"Proposals\" },\n {\n to: \"/proposals/drafts\",\n title: \"Draft proposals\",\n active: true\n }\n ];\n\n return ;\n};\n\nconst DraftProposalListScene = ({ match }: DraftProposalListProps) => {\n const dealerId = match.params.dealerId\n ? parseInt(match.params.dealerId, 10)\n : undefined;\n\n return (\n \n {({ dealer, loading }) => {\n if (loading) {\n return null;\n }\n\n return (\n \n \n

\n Draft proposals\n {dealer && (\n <>\n {\" - \"}\n {dealer.name}\n \n )}\n

\n \n
\n );\n }}\n
\n );\n};\n\nexport default withRouter(DraftProposalListScene);\n","import { FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport { Col, FormGroup, Label, Row } from \"reactstrap\";\nimport AccountManagerSelect from \"../../AccountManagers/AccountManagerSelect\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { ContextNames } from \"../../types\";\nimport { DraftDealerSearchArgs } from \"../types\";\n\nconst DraftDealerListFilterPanel = ({\n values,\n setFieldValue,\n submitForm,\n context\n}: FormikProps & { context?: ContextNames }) => {\n const { loggedInUser, isAccountManager } = useLoggedInUser();\n\n if (!loggedInUser) {\n return null;\n }\n\n return (\n <>\n {context !== ContextNames.ACCOUNT_MANAGER && !isAccountManager && (\n \n \n \n \n {\n setFieldValue(\"accountManagerId\", id, false);\n submitForm();\n }}\n isClearable={true}\n />\n \n \n \n )}\n \n );\n};\n\nexport default DraftDealerListFilterPanel;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Mutation, MutationFunction, MutationResult } from \"react-apollo\";\n\ninterface DeleteDraftDealerData {\n success: boolean;\n}\n\ninterface DeleteDraftDealerVariables {\n id: number;\n}\n\nexport const DELETE_DRAFT_DEALER = gql`\n mutation DeleteDraftDealer($id: ID!) {\n deleteDraftDealer(id: $id) {\n success\n }\n }\n`;\n\nconst DeleteDraftDealerMutation = ({\n children\n}: {\n children: (\n mutationFunction: MutationFunction<\n DeleteDraftDealerData,\n DeleteDraftDealerVariables\n >,\n result: MutationResult\n ) => JSX.Element | null;\n}) => {children};\n\nexport default DeleteDraftDealerMutation;\n","import { faTrash } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport * as React from \"react\";\nimport { DropdownItem } from \"reactstrap\";\nimport { ConfirmDialog } from \"../../Forms/ConfirmDialogProvider\";\nimport { DraftDealer } from \"../types\";\nimport DeleteDraftDealerMutation from \"./DeleteDraftDealerMutation\";\nimport { DRAFT_DEALER_LIST } from \"./DraftDealerListQuery\";\n\ninterface DeleteDraftDealerDropdownItemProps {\n draftDealer: DraftDealer;\n}\n\nconst DeleteDraftDealerDropdownItem = ({\n draftDealer: { id }\n}: DeleteDraftDealerDropdownItemProps) => (\n \n {confirm => (\n \n {mutation => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n confirm(() =>\n mutation({\n variables: { id: id || 0 },\n refetchQueries: [\n {\n query: DRAFT_DEALER_LIST,\n variables: {\n input: {\n page: 1,\n pageSize: 10\n }\n }\n }\n ]\n })\n );\n }}\n >\n Delete\n \n )}\n \n )}\n \n);\n\nexport default DeleteDraftDealerDropdownItem;\n","import classnames from \"classnames\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport { Badge } from \"reactstrap\";\nimport DistanceInWordsText from \"../../Proposals/ProposalForm/DistanceInWordsText\";\nimport { ContextNames, UserRoles } from \"../../types\";\nimport { DraftDealerProps } from \"../types\";\n\nconst DraftDealerBadges = ({\n loggedInUser,\n draftDealer: { updated, accountManager },\n className,\n context\n}: DraftDealerProps & { className?: string }) => {\n const isAccountManager = loggedInUser.roles.includes(\n UserRoles.account_manager\n );\n\n return (\n
\n {!isAccountManager &&\n context !== ContextNames.ACCOUNT_MANAGER &&\n accountManager ? (\n {accountManager.name}\n ) : null}\n \n \n \n
\n );\n};\n\nexport default DraftDealerBadges;\n","import * as React from \"react\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport { Col, Row } from \"reactstrap\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport ActionsDropdown from \"../../PagedList/ActionsDropdown\";\nimport { ContextNames } from \"../../types\";\nimport { DraftDealerProps } from \"../types\";\nimport DeleteDraftDealerDropdownItem from \"./DeleteDraftDealerDropdownItem\";\nimport DraftDealerBadges from \"./DraftDealerBadges\";\n\nconst DraftDealerListItem = ({\n loggedInUser,\n draftDealer,\n context\n}: DraftDealerProps) => {\n return (\n \n \n \n
\n

\n {draftDealer.name}\n

\n

\n {draftDealer.address}\n

\n
\n \n \n \n \n \n \n \n
\n \n );\n};\n\nexport const DraftDealerListItemLoadingPlaceholder = () => (\n
\n \n
\n);\n\nexport default DraftDealerListItem;\n","import { FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport SearchForm from \"../../Forms/SearchForm\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport PagedList from \"../../PagedList\";\nimport { ContextNames } from \"../../types\";\nimport { DraftDealerSearchArgs } from \"../types\";\nimport DraftDealerListFilterPanel from \"./DraftDealerListFilterPanel\";\nimport DraftDealerListItem from \"./DraftDealerListItem\";\nimport { DRAFT_DEALER_LIST, DraftDealerListData } from \"./DraftDealerListQuery\";\n\nconst defaultSearchArgs = {\n page: 1,\n pageSize: 10\n};\n\nconst DraftDealerList = ({\n accountManagerId,\n context\n}: {\n accountManagerId?: string;\n context?: ContextNames;\n}) => {\n const { loggedInUser, isAccountManager } = useLoggedInUser();\n\n if (!loggedInUser) {\n return null;\n }\n\n return (\n qs}\n mapValuesToQuerystring={args => args}\n defaultValues={defaultSearchArgs}\n fixedValues={{ accountManagerId }}\n filterPanel={\n context === ContextNames.ACCOUNT_MANAGER || isAccountManager\n ? undefined\n : DraftDealerListFilterPanel\n }\n context={context}\n >\n {(formikProps: FormikProps) => (\n \n data.loggedInUser?.draftDealers\n }\n listItemComponent={({ item }) => (\n \n )}\n />\n )}\n \n );\n};\n\nexport default DraftDealerList;\n","import * as React from \"react\";\nimport { useParams } from \"react-router\";\nimport { Container } from \"reactstrap\";\nimport { useAccountManager } from \"../../AccountManagers/AccountManagerQuery\";\nimport { AccountManager } from \"../../AccountManagers/types\";\nimport Breadcrumbs from \"../../Breadcrumbs\";\nimport { ContextNames } from \"../../types\";\nimport DraftDealerList from \"./DraftDealerList\";\n\nconst DraftDealerBreadcrumbs = ({\n accountManager: am\n}: {\n accountManager?: AccountManager;\n}) => {\n const breadcrumbs = am\n ? [\n {\n to: \"/\",\n title: \"Home\"\n },\n { to: \"/accountmanagers\", title: \"Account managers\" },\n {\n to: `/accountmanagers/${encodeURIComponent(am.id)}/dealers`,\n title: am.name\n },\n {\n to: `/accountmanagers/${encodeURIComponent(am.id)}/dealers/drafts`,\n title: \"Draft dealers\",\n active: true\n }\n ]\n : [\n {\n to: \"/\",\n title: \"Home\"\n },\n { to: \"/dealers\", title: \"Dealers\" },\n {\n to: \"/dealers/drafts\",\n title: \"Draft dealers\",\n active: true\n }\n ];\n\n return ;\n};\n\nconst DraftDealerListScene = () => {\n const params = useParams<{ accountManagerId?: string }>();\n\n const accountManagerId = params.accountManagerId\n ? decodeURIComponent(params.accountManagerId)\n : undefined;\n\n const { accountManager, loading } = useAccountManager(accountManagerId);\n\n if (loading) {\n return null;\n }\n\n return (\n \n \n

\n Draft dealers\n {accountManager && (\n <>\n {\" - \"}\n {accountManager.name}\n \n )}\n

\n \n
\n );\n};\n\nexport default DraftDealerListScene;\n","import * as React from \"react\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\n\nconst QuotationListActionButtons = (props: any) => {\n const { checkCanCreate } = useLoggedInUser();\n\n return (\n
\n {checkCanCreate(PermissionModuleNames.Quotations) ? (\n \n New quotation\n \n ) : null}\n
\n );\n};\n\nexport default QuotationListActionButtons;\n","import { FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport { Col, FormGroup, Label, Row } from \"reactstrap\";\nimport AccountManagerSelect from \"../../AccountManagers/AccountManagerSelect\";\nimport DealerSelect from \"../../Dealers/DealerSelect\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { ContextNames } from \"../../types\";\nimport { QuotationSearchArgs } from \"../types\";\n\nconst QuotationListFilterPanel = ({\n values,\n setFieldValue,\n submitForm,\n context\n}: FormikProps & { context?: ContextNames }) => {\n const { loggedInUser, isDealer, isAccountManager } = useLoggedInUser();\n\n if (!loggedInUser) {\n return null;\n }\n\n return (\n <>\n {context !== ContextNames.DEALER && !isDealer && (\n <>\n {context !== ContextNames.ACCOUNT_MANAGER && !isAccountManager && (\n \n \n \n \n {\n setFieldValue(\"accountManagerId\", id, false);\n submitForm();\n }}\n isClearable={true}\n />\n \n \n \n )}\n \n \n \n \n {\n setFieldValue(\"dealerId\", id, false);\n submitForm();\n }}\n isClearable={true}\n />\n \n \n \n \n )}\n \n );\n};\n\nexport default QuotationListFilterPanel;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport {\n Mutation,\n MutationFunction,\n MutationResult,\n useMutation\n} from \"react-apollo\";\n\ninterface DeleteQuotationData {\n success: boolean;\n}\n\ninterface DeleteQuotationVariables {\n id: number;\n}\n\nexport const DELETE_QUOTATION = gql`\n mutation DeleteQuotation($id: ID!) {\n deleteQuotation(id: $id) {\n success\n }\n }\n`;\n\nconst DeleteQuotationMutation = ({\n children\n}: {\n children: (\n mutationFunction: MutationFunction<\n DeleteQuotationData,\n DeleteQuotationVariables\n >,\n result: MutationResult\n ) => JSX.Element | null;\n}) => {children};\n\nexport const useDeleteQuotation = () => {\n const [deleteQuotation] = useMutation<\n DeleteQuotationData,\n DeleteQuotationVariables\n >(DELETE_QUOTATION);\n return deleteQuotation;\n};\n\nexport default DeleteQuotationMutation;\n","import { faTrash } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport * as React from \"react\";\nimport { DropdownItem } from \"reactstrap\";\nimport { ConfirmDialog } from \"../Forms/ConfirmDialogProvider\";\nimport { PagedListContext } from \"../PagedList\";\nimport { useDeleteQuotation } from \"./DeleteQuotationMutation\";\n\ninterface DeleteQuotationDropdownItemProps {\n id: number;\n}\n\nconst DeleteQuotationDropdownItem = ({\n id\n}: DeleteQuotationDropdownItemProps) => {\n const { refresh } = React.useContext(PagedListContext);\n const mutation = useDeleteQuotation();\n\n return (\n \n {confirm => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n confirm(() =>\n mutation({\n variables: { id }\n }).then(refresh)\n );\n }}\n >\n Delete\n \n )}\n \n );\n};\n\nexport default DeleteQuotationDropdownItem;\n","import * as React from \"react\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport { Col, DropdownItem, Row } from \"reactstrap\";\nimport { formatCurrency, getFullName } from \"../../../utils\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport ActionsDropdown from \"../../PagedList/ActionsDropdown\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport RouterDropdownItem from \"../../RouterDropdownItem\";\nimport { ContextNames } from \"../../types\";\nimport DeleteQuotationDropdownItem from \"../DeleteQuotationDropdownItem\";\nimport QuotationBadges from \"../QuotationBadges\";\nimport { QuotationProps } from \"../types\";\nimport \"./index.scss\";\n\nconst QuotationListItem = ({ quotation, context }: QuotationProps) => {\n const fullName = getFullName(quotation);\n const {\n checkCanCreate,\n checkCanDelete,\n isDealer,\n loggedInUser\n } = useLoggedInUser();\n\n if (!loggedInUser) {\n return null;\n }\n\n return (\n \n \n \n

\n {fullName ? (\n <>\n {fullName}\n {\", \"}\n \n ) : null}\n {quotation.vehicle && quotation.vehicle.regNo\n ? `${quotation.vehicle.regNo.toUpperCase()}, `\n : null}\n {quotation.vehicle &&\n (quotation.vehicle.make || quotation.vehicle.model)\n ? `${quotation.vehicle.make} ${quotation.vehicle.model}`\n : \"[vehicle unknown]\"}\n

\n {!isDealer && context !== ContextNames.DEALER ? (\n

{quotation.dealer && quotation.dealer.name}

\n ) : null}\n

\n Finance value:{\" \"}\n {formatCurrency(\n (quotation.finance.cashPrice || 0) +\n (quotation.finance.partExchangeSettlement || 0) -\n ((quotation.finance.deposit || 0) +\n (quotation.finance.partExchangeValue || 0))\n )}\n

\n\n \n \n \n \n {checkCanCreate(PermissionModuleNames.Quotations) ? (\n \n Copy as new quotation\n \n ) : null}\n {checkCanCreate(PermissionModuleNames.Proposals) ? (\n \n Convert to new proposal\n \n ) : null}\n {checkCanDelete(PermissionModuleNames.Quotations) ? (\n <>\n \n \n \n ) : null}\n \n \n
\n \n );\n};\n\nexport const QuotationListItemLoadingPlaceholder = () => (\n
\n \n
\n);\n\nexport default QuotationListItem;\n","import { FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport SearchForm from \"../../Forms/SearchForm\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport PagedList from \"../../PagedList\";\nimport { ContextNames } from \"../../types\";\nimport { QuotationSearchArgs } from \"../types\";\nimport \"./index.scss\";\nimport QuotationListActionButtons from \"./QuotationListActionButtons\";\nimport QuotationListFilterPanel from \"./QuotationListFilterPanel\";\nimport QuotationListItem from \"./QuotationListItem\";\nimport { QUOTATION_LIST, QuotationListData } from \"./QuotationListQuery\";\n\ninterface QuotationListProps {\n accountManagerId?: string;\n dealerId?: number;\n context?: ContextNames;\n}\n\nconst defaultSearchArgs: QuotationSearchArgs = { page: 1, pageSize: 10 };\n\nconst QuotationList = ({\n accountManagerId,\n dealerId,\n context\n}: QuotationListProps) => {\n const { loggedInUser, isDealer } = useLoggedInUser();\n\n if (!loggedInUser) {\n return null;\n }\n\n return (\n qs}\n mapValuesToQuerystring={values => values}\n defaultValues={defaultSearchArgs}\n fixedValues={{ accountManagerId, dealerId }}\n filterPanel={\n context === ContextNames.DEALER || isDealer\n ? undefined\n : QuotationListFilterPanel\n }\n >\n {(formikProps: FormikProps) => (\n \n data.loggedInUser && data.loggedInUser.quotations\n }\n actionButtonsComponent={QuotationListActionButtons}\n listItemComponent={({ item }) => (\n \n )}\n />\n )}\n \n );\n};\n\nexport default QuotationList;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Mutation, MutationFunction, MutationResult } from \"react-apollo\";\n\ninterface DeleteUserData {\n success: boolean;\n}\n\ninterface DeleteUserVariables {\n id: string;\n}\n\nexport const DELETE_USER = gql`\n mutation DeleteUser($id: ID!) {\n deleteUser(id: $id) {\n success\n }\n }\n`;\n\nconst DeleteUserMutation = ({\n children\n}: {\n children: (\n mutationFunction: MutationFunction,\n result: MutationResult\n ) => JSX.Element | null;\n}) => {children};\n\nexport default DeleteUserMutation;\n","import { faTrash } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { Field, FieldProps } from \"formik\";\nimport * as React from \"react\";\nimport { DropdownItem } from \"reactstrap\";\nimport { ConfirmDialog } from \"../../Forms/ConfirmDialogProvider\";\nimport DeleteUserMutation from \"./DeleteUserMutation\";\nimport { UserProfile } from \"./types\";\nimport { USER_LIST } from \"./UserListQuery\";\n\ninterface DeleteUserDropdownItemProps {\n user: UserProfile;\n}\n\nconst DeleteUserDropdownItem = ({\n user: { id }\n}: DeleteUserDropdownItemProps) => (\n \n {({ form: { initialValues } }: FieldProps) => (\n \n {confirm => (\n \n {mutation => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n confirm(() =>\n mutation({\n variables: { id },\n refetchQueries: [\n {\n query: USER_LIST,\n variables: {\n input: initialValues || {}\n }\n }\n ]\n })\n );\n }}\n >\n Delete\n \n )}\n \n )}\n \n )}\n \n);\n\nexport default DeleteUserDropdownItem;\n","import { faUserPlus } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport * as React from \"react\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport { Col, DropdownItem, Row } from \"reactstrap\";\nimport { getFullName } from \"../../../utils\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport ActionsDropdown from \"../../PagedList/ActionsDropdown\";\nimport BlockOrUnblockUserDropdownItem from \"./BlockOrUnblockUserDropdownItem\";\nimport DeleteUserDropdownItem from \"./DeleteUserDropdownItem\";\nimport ResetPasswordDropdownItem from \"./ResetPasswordDropdownItem\";\nimport { UserProfileProps } from \"./types\";\nimport UserBadges from \"./UserBadges\";\n\nconst UserListItem = ({\n user,\n context,\n onSelectUser\n}: UserProfileProps & { onSelectUser: (id: string) => void }) => (\n \n \n \n {user.forename || user.surname ? (\n

\n {getFullName(user)}\n

\n ) : null}\n

{user.username}

\n {user.dealer &&

{user.dealer.name}

}\n \n \n \n \n {\n e.preventDefault();\n onSelectUser(user.id);\n }}\n disabled={!!user.identityProviderUserId}\n >\n \n Link to Auth0\n \n \n \n \n \n \n \n
\n
\n);\n\nexport const UserListItemLoadingPlaceholder = () => (\n
\n \n
\n);\n\nexport default UserListItem;\n","import { FormikProps } from \"formik\";\nimport React, { useState } from \"react\";\nimport Select from \"react-select\";\nimport { Col, FormGroup, Label, Row } from \"reactstrap\";\nimport { formatEnumValue } from \"../../../utils\";\nimport DealerSelect from \"../../Dealers/DealerSelect\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { ContextNames, UserRoles } from \"../../types\";\nimport { UserSearchArgs } from \"./types\";\n\nconst roleOptions = [\n UserRoles.administrator,\n UserRoles.dealer,\n UserRoles.account_manager,\n UserRoles.regional_sales_manager,\n UserRoles.case_management_team,\n UserRoles.senior_manager\n]\n .sort()\n .map(k => ({\n value: [k],\n label: formatEnumValue(k)\n }));\n\nconst UserSearchFilterPanel = ({\n values,\n setFieldValue,\n submitForm,\n context\n}: FormikProps & { context?: ContextNames }) => {\n const [roleText, updateRoleText] = useState(undefined);\n const { loggedInUser, loading, isDealer } = useLoggedInUser();\n\n if (loading || !loggedInUser) {\n return null;\n }\n\n return (\n <>\n {context !== ContextNames.DEALER && !isDealer && (\n <>\n \n \n \n \n updateRoleText(value)}\n closeMenuOnSelect={true}\n isLoading={loading}\n title=\"User roles\"\n autoFocus={false}\n options={roleOptions}\n onChange={(options: any) => {\n const roles = options\n ? options.map((opt: any) => opt.value)\n : [];\n setFieldValue(\"roles\", roles, false);\n setTimeout(submitForm, 0);\n }}\n placeholder=\"Select roles\"\n />\n \n \n \n \n \n \n \n {\n setFieldValue(\"dealerId\", id, false);\n submitForm();\n }}\n isClearable={true}\n />\n \n \n \n \n )}\n\n \n \n );\n};\n\nexport default UserSearchFilterPanel;\n","import { FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport { Button } from \"reactstrap\";\nimport SearchForm from \"../../Forms/SearchForm\";\nimport PagedList from \"../../PagedList\";\nimport { ContextNames, UserRoles } from \"../../types\";\nimport CreateUserModal from \"./CreateUserModal\";\nimport LinkUserToIdentityProviderModal from \"./LinkUserToIdentityProviderModal\";\nimport { UserSearchArgs } from \"./types\";\nimport UserListItem from \"./UserListItem\";\nimport { USER_LIST, UserListData } from \"./UserListQuery\";\nimport UserSearchFilterPanel from \"./UserSearchFilterPanel\";\n\ninterface UserListState {\n showModal: boolean;\n selectedUserId?: string;\n}\n\ninterface UserListProps {\n context?: ContextNames;\n dealerId?: number;\n}\n\nconst defaultSearchArgs: UserSearchArgs = {\n page: 1,\n pageSize: 10,\n includeSuspended: true,\n administratorsOnly: false,\n roles: []\n};\n\nclass UserList extends React.Component {\n constructor(props: UserListProps) {\n super(props);\n\n this.toggleModal = this.toggleModal.bind(this);\n this.handleSelectUser = this.handleSelectUser.bind(this);\n this.state = { showModal: false };\n }\n\n public render() {\n const { context, dealerId } = this.props;\n const { showModal, selectedUserId } = this.state;\n\n return (\n <>\n ({\n ...qs,\n includeSuspended: qs.includeSuspended !== \"false\",\n administratorsOnly: qs.administratorsOnly === \"true\"\n })}\n mapValuesToQuerystring={values => values}\n defaultValues={defaultSearchArgs}\n fixedValues={{ dealerId }}\n filterPanel={UserSearchFilterPanel}\n >\n {(formikProps: FormikProps) => (\n data.users}\n actionButtonsComponent={() => (\n \n New user\n \n )}\n listItemComponent={({ item, loggedInUser }) => (\n \n )}\n fetchPolicy=\"cache-and-network\"\n />\n )}\n \n {selectedUserId ? (\n \n ) : (\n \n )}\n \n );\n }\n\n private handleSelectUser(id: string) {\n this.setState({ showModal: true, selectedUserId: id });\n }\n\n private toggleModal() {\n this.setState(s => ({\n showModal: !s.showModal,\n selectedUserId: undefined\n }));\n }\n}\n\nexport default UserList;\n","import * as React from \"react\";\nimport { useParams } from \"react-router\";\nimport { useAccountManager } from \"../AccountManagers/AccountManagerQuery\";\nimport { AccountManager } from \"../AccountManagers/types\";\nimport Breadcrumbs from \"../Breadcrumbs\";\n\nconst getBreadcrumbData = (\n accountManager?: AccountManager,\n draftDealerId?: number\n) => {\n let breadcrumbs = [{ to: \"/\", title: \"Home\" }];\n if (accountManager) {\n const accountManagerId = encodeURIComponent(accountManager.id);\n const amDealersPath = `/accountmanagers/${accountManagerId}/dealers`;\n\n breadcrumbs = [\n ...breadcrumbs,\n { to: \"/accountmanagers\", title: \"Account managers\" },\n {\n to: amDealersPath,\n title: accountManager.name\n }\n ];\n\n if (draftDealerId) {\n return [\n ...breadcrumbs,\n { to: `${amDealersPath}/drafts`, title: \"Draft dealers\" },\n {\n to: `${amDealersPath}/drafts/${draftDealerId}`,\n title: \"Create new dealer\",\n active: true\n }\n ];\n }\n return [\n ...breadcrumbs,\n {\n to: `${amDealersPath}/create`,\n title: \"New dealer\",\n active: true\n }\n ];\n }\n breadcrumbs = [...breadcrumbs, { to: \"/dealers\", title: \"Dealers\" }];\n if (draftDealerId) {\n return [\n ...breadcrumbs,\n { to: \"/dealers/drafts\", title: \"Draft dealers\" },\n {\n to: `/dealers/drafts/${draftDealerId}`,\n title: `New dealer`,\n active: true\n }\n ];\n }\n return [\n ...breadcrumbs,\n { to: \"/dealers/create\", title: \"New dealer\", active: true }\n ];\n};\n\nconst CreateDealerBreadcrumbs = () => {\n const params = useParams<{\n accountManagerId?: string;\n draftDealerId?: string;\n }>();\n const draftDealerId = params.draftDealerId\n ? parseInt(params.draftDealerId, 10)\n : undefined;\n\n const accountManagerId = params.accountManagerId\n ? decodeURIComponent(params.accountManagerId)\n : undefined;\n\n const { accountManager, loading } = useAccountManager(accountManagerId);\n\n if (loading) {\n return null;\n }\n\n return (\n \n );\n};\n\nexport default CreateDealerBreadcrumbs;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport {\n graphql,\n Mutation,\n MutationFunction,\n MutationResult,\n useMutation\n} from \"react-apollo\";\nimport { CompositeComponent } from \"../../types\";\nimport { DraftDealerFragment } from \"../fragments\";\nimport { DraftDealer } from \"../types\";\n\nexport interface DraftDealerData {\n createOrUpdateDraftDealer: DraftDealer;\n}\n\nexport interface DraftDealerVariables {\n input: DraftDealer;\n}\n\nexport const CREATE_OR_UPDATE_DRAFT_DEALER = gql`\n mutation CreateOrUpdateDraftDealer($input: DraftDealerInput) {\n createOrUpdateDraftDealer(input: $input) {\n ...DraftDealerFragment\n }\n }\n ${DraftDealerFragment}\n`;\n\nconst CreateOrUpdateDraftDealer = ({\n children\n}: {\n children: (\n mutateFn: MutationFunction,\n result: MutationResult\n ) => JSX.Element | null;\n}) => {children};\n\nexport interface CreateOrUpdateDraftDealerProps {\n createOrUpdateDraftDealer: (draftDealer: DraftDealer) => Promise;\n}\n\nexport const withCreateOrUpdateDraftDealer = (\n WrappedComponent: CompositeComponent\n) => {\n return graphql<\n TProps,\n DraftDealerVariables,\n {},\n CreateOrUpdateDraftDealerProps\n >(CREATE_OR_UPDATE_DRAFT_DEALER, {\n props: ({ mutate }) => ({\n createOrUpdateDraftDealer: draftDealer => {\n return mutate\n ? mutate({ variables: { input: draftDealer } })\n : Promise.reject(\"No mutation provided\");\n }\n })\n })(WrappedComponent);\n};\n\nexport const useCreateOrUpdateDraftDealer = () => {\n const [createOrUpdateDraftDealer] = useMutation<\n DraftDealerData,\n DraftDealerVariables\n >(CREATE_OR_UPDATE_DRAFT_DEALER);\n return createOrUpdateDraftDealer;\n};\n\nexport default CreateOrUpdateDraftDealer;\n","import { FormikErrors, FormikTouched } from \"formik\";\nimport { cloneDeep } from \"lodash\";\nimport * as React from \"react\";\nimport { MutationFunction } from \"react-apollo\";\nimport { cleanFormData, getSingleLineAddress } from \"../../../utils\";\nimport {\n hydrateTouchedData,\n resetFieldsWithErrors,\n serializeTouchedData,\n} from \"../../Forms/draftFormUtils\";\nimport { ContextNames } from \"../../types\";\nimport { DealerFormInitialValues } from \"../DealerForm\";\nimport { Dealer, DealerFormSectionName, DraftDealer } from \"../types\";\nimport CreateOrUpdateDraftDealerMutation, {\n DraftDealerData,\n DraftDealerVariables,\n} from \"./CreateOrUpdateDraftDealerMutation\";\nimport { DRAFT_DEALER_LIST } from \"./DraftDealerListQuery\";\nimport DraftDealerQuery from \"./DraftDealerQuery\";\n\ninterface DraftDealerServiceProps {\n draftDealer?: DraftDealer;\n draftDealerInitialValues?: DealerFormInitialValues;\n saveDraft: (formData: DraftDealerFormData) => Promise;\n loading?: boolean;\n}\n\ninterface DraftDealerServiceOuterProps {\n draftDealerId?: number;\n children: (props: DraftDealerServiceProps) => JSX.Element | null;\n context?: ContextNames;\n}\n\nexport interface DraftDealerFormData {\n values: Dealer;\n initialValues: Dealer;\n errors: FormikErrors;\n touched: FormikTouched;\n currentSection?: string;\n}\n\n/** Gets and saves draft proposals */\nclass DraftDealerService extends React.Component {\n public constructor(props: DraftDealerServiceOuterProps) {\n super(props);\n this.saveDraft = this.saveDraft.bind(this);\n }\n\n public render() {\n const { draftDealerId, children } = this.props;\n\n return (\n \n {({ draftDealer, loading }) => {\n let draftDealerInitialValues: DealerFormInitialValues;\n\n if (draftDealer) {\n let dealer: Dealer = JSON.parse(draftDealer.dealerJson);\n dealer = cleanFormData(dealer, {\n removeIdFields: true,\n });\n\n dealer.draftDealerId = draftDealer.id;\n\n draftDealerInitialValues = {\n initialTouched: hydrateTouchedData(draftDealer.touchedFields),\n initialSection:\n draftDealer.currentSection as DealerFormSectionName,\n initialValues: dealer,\n };\n }\n\n return (\n \n {(mutationFunction) =>\n children({\n draftDealer,\n draftDealerInitialValues,\n saveDraft: (formData) =>\n this.saveDraft(mutationFunction, formData, draftDealer),\n loading,\n })\n }\n \n );\n }}\n \n );\n }\n\n /** Saves the state of the proposal form to the server */\n private saveDraft(\n mutate: MutationFunction,\n formData: DraftDealerFormData,\n existing?: DraftDealer\n ) {\n const { context } = this.props;\n const dealer = this.cleanDraftDealer(formData);\n const touched = cloneDeep(formData.touched);\n\n const currentSection = formData.currentSection;\n\n const draftDealer: DraftDealer = {\n id: existing && existing.id,\n dealerJson: JSON.stringify(dealer),\n touchedFields: serializeTouchedData(touched),\n currentSection,\n name: dealer.name,\n address: getSingleLineAddress(dealer.address),\n accountManagerId: dealer.accountManagerId,\n };\n\n const accountManagerId =\n context === ContextNames.ACCOUNT_MANAGER\n ? draftDealer.accountManagerId\n : undefined;\n\n return mutate({\n variables: { input: draftDealer },\n refetchQueries: [\n {\n query: DRAFT_DEALER_LIST,\n variables: {\n input: {\n page: 1,\n pageSize: 10,\n accountManagerId,\n },\n },\n },\n ],\n }).then(({ data }: any) => {\n const draft = data && data.createOrUpdateDraftDealer;\n\n if (!draft) {\n return;\n }\n\n return draft;\n });\n }\n\n /** Removes client only fields from the draft proposal object before submitting it to the server */\n private cleanDraftDealer(formData: DraftDealerFormData): Dealer {\n const { values, initialValues, errors } = formData;\n const dealer = cleanFormData(values, { removeIdFields: true });\n\n // Clean up properties which are not used on the server\n delete dealer.draftDealerId;\n\n // Remove properties which have validation errors, and reset them\n // to default values\n resetFieldsWithErrors(dealer, errors, initialValues);\n\n return dealer;\n }\n}\n\nexport default DraftDealerService;\n","import { FormikTouched } from \"formik\";\nimport { merge } from \"lodash\";\nimport React from \"react\";\nimport Helmet from \"react-helmet\";\nimport { useHistory, useParams } from \"react-router\";\nimport { Container } from \"reactstrap\";\nimport { cleanFormData, isAccountManager } from \"../../utils\";\nimport { useLoggedInUser } from \"../LoggedInUserQuery\";\nimport { ContextNames } from \"../types\";\nimport CreateDealerBreadcrumbs from \"./CreateDealerBreadcrumbs\";\nimport CreateDealerMutation from \"./CreateDealerMutation\";\nimport DealerForm from \"./DealerForm\";\nimport { DEALER_LIST } from \"./DealerList/DealerListQuery\";\nimport dealerSetupQuestionnaireValidationSchema from \"./dealerSetupQuestionnaireValidationSchema\";\nimport dealerValidationSchema from \"./dealerValidationSchema\";\nimport { DRAFT_DEALER_LIST } from \"./DraftDealers/DraftDealerListQuery\";\nimport DraftDealerService from \"./DraftDealers/DraftDealerService\";\nimport { DealerFragment } from \"./fragments\";\nimport { Dealer, DealerFormSectionName } from \"./types\";\n\ninterface CreateDealerSceneProps {\n requiresQuestionnaire?: boolean;\n}\n\nconst CreateDealerScene = ({\n requiresQuestionnaire = true,\n}: CreateDealerSceneProps) => {\n const { loggedInUser } = useLoggedInUser();\n const history = useHistory();\n const params = useParams<{\n accountManagerId?: string;\n draftDealerId?: string;\n }>();\n\n if (!loggedInUser) {\n return null;\n }\n\n const accountManagerId =\n isAccountManager(loggedInUser) && loggedInUser.accountManager?.id\n ? loggedInUser.accountManager.id\n : params.accountManagerId\n ? decodeURIComponent(params.accountManagerId)\n : undefined;\n\n const context = params.accountManagerId\n ? ContextNames.ACCOUNT_MANAGER\n : undefined;\n\n const draftDealerId = params.draftDealerId\n ? parseInt(params.draftDealerId, 10)\n : undefined;\n\n const dealer = dealerValidationSchema.default() as Dealer;\n return (\n \n \n\n \n\n \n {({\n draftDealer,\n draftDealerInitialValues,\n loading: draftDealerLoading,\n saveDraft,\n }) => {\n if (draftDealerId && draftDealerLoading) {\n return null;\n }\n\n let initialValues: Dealer = merge(\n {},\n dealerValidationSchema.default() as Dealer,\n {\n accountManagerId,\n questionnaire: dealerSetupQuestionnaireValidationSchema.default(),\n }\n );\n let initialSection: DealerFormSectionName | undefined;\n let initialTouched: FormikTouched | undefined;\n\n if (draftDealerInitialValues) {\n initialValues = merge(\n {},\n initialValues,\n draftDealerInitialValues.initialValues\n );\n initialSection = draftDealerInitialValues.initialSection;\n initialTouched = draftDealerInitialValues.initialTouched;\n }\n\n if (\n !requiresQuestionnaire ||\n (draftDealerInitialValues &&\n !draftDealerInitialValues?.initialValues?.questionnaire)\n ) {\n (initialValues as any).questionnaire = undefined;\n initialValues.FORMSTATE_requiresQuestionnaire = false;\n }\n\n return (\n \n {(mutation, { client }) => (\n <>\n {\n return mutation({\n variables: {\n input: cleanFormData(submitted),\n },\n refetchQueries: [\n {\n query: DEALER_LIST,\n variables: { input: { page: 1, pageSize: 10 } },\n },\n {\n query: DRAFT_DEALER_LIST,\n variables: {\n input: {\n page: 1,\n pageSize: 10,\n accountManagerId:\n context === ContextNames.ACCOUNT_MANAGER\n ? accountManagerId\n : undefined,\n },\n },\n },\n ],\n }).then((result) => {\n if (result && result.data) {\n const created = result.data.createOrUpdateDealer;\n if (created) {\n client?.writeFragment({\n id: (created.id || \"\").toString(),\n fragment: DealerFragment,\n data: created,\n fragmentName: \"DealerFragment\",\n });\n history.push(`/dealers/${created.id}`);\n }\n }\n });\n }}\n />\n \n )}\n \n );\n }}\n \n \n );\n};\n\nexport const CreateDealerNoQuestionnaireScene = () => (\n \n);\n\nexport default CreateDealerScene;\n","import React, { useCallback, useState } from \"react\";\nimport { pdfjs, Document, Page } from \"react-pdf\";\nimport { useResizeObserver } from \"@wojtekmaj/react-hooks\";\nimport \"./DocumentView.scss\";\nimport { Alert, Button, Col, Row } from \"reactstrap\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport {\n faExpand,\n faExternalLinkSquareAlt,\n faFastBackward,\n faFastForward,\n faSearchMinus,\n faSearchPlus,\n faSpinner,\n faStepBackward,\n faStepForward,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport axios from \"axios\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport { createBrowserHistory } from \"history\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport { Field, Form, Formik, FormikActions, FormikProps } from \"formik\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { useAuth0 } from \"../../Auth0Login/Auth0Provider\";\nimport { Link } from \"react-router-dom\";\n\npdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.js`;\n\nexport const EsignDocumentViewer = ({\n docTitle,\n getUrl,\n postUrl,\n}: {\n docTitle: string;\n getUrl: string;\n postUrl: string;\n}) => {\n const [state, setState] = useState<{\n formSubmitting: boolean;\n docLoaded: boolean;\n docSigned: boolean;\n base64PDF?: string;\n uniqueId?: string;\n bufferPDF?: Buffer;\n signatoryCode?: string;\n containerWidth?: number;\n numPages?: number;\n pageNumber: number;\n pageScale: number;\n auth0Token?: string;\n serverError?: string;\n }>({\n formSubmitting: false,\n docLoaded: false,\n docSigned: false,\n pageNumber: 1,\n pageScale: 1,\n auth0Token: undefined,\n });\n const [containerRef] = useState(null);\n const resizeObserverOptions = {};\n const maxWidth = 800;\n // let loadingDoc = false;\n const { loading } = useLoggedInUser();\n const { getToken } = useAuth0();\n\n const onDocumentLoadSuccess = ({ numPages }: { numPages: number }): void => {\n setState((s) => ({ ...s, numPages: numPages }));\n };\n\n const handleOpenInNew = (event: any) => {\n const iframe =\n \"\";\n const x = window.open();\n if (x) {\n x.document.open();\n x.document.title = \"\";\n x.document.write(iframe);\n x.document.close();\n }\n };\n\n const handleZoomIn = () => {\n if (state.pageScale < 2) {\n setState((s) => ({ ...s, pageScale: state.pageScale + 0.2 }));\n }\n };\n\n const handleResetZoom = () => {\n setState((s) => ({ ...s, pageScale: 1 }));\n };\n\n const handleZoomOut = () => {\n if (state.pageScale > 0.5) {\n setState((s) => ({ ...s, pageScale: state.pageScale - 0.2 }));\n }\n };\n\n const onResize = useCallback((entries) => {\n const [entry] = entries;\n\n if (entry) {\n setState((s) => ({ ...s, containerWidth: entry.contentRect.width }));\n }\n }, []);\n\n const setPageNumber = (num: number) => {\n setState((s) => ({ ...s, pageNumber: num }));\n };\n\n useResizeObserver(containerRef, resizeObserverOptions, onResize);\n\n const getBase64PDF = (token: string): Promise => {\n return axios\n .get(getUrl, {\n headers: {\n \"Cache-Control\": \"no-cache\",\n authorization: `Bearer ${token}`,\n },\n })\n .then((r: any) => {\n const buf = Buffer.from(r?.data.base64 as string, \"base64\");\n setState((s) => ({\n ...s,\n docLoaded: true,\n base64PDF: r?.data.base64 as string,\n uniqueId: r?.data.uniqueId as string,\n bufferPDF: buf,\n signatoryCode: r?.data.signatoryCode as string,\n }));\n })\n .catch((error: any) => {\n // SetErrorState(error);\n });\n };\n\n const jumpToDealer = () => {\n const history = createBrowserHistory({ forceRefresh: true });\n history.push(`/dealer`);\n };\n\n const onFormSubmit = (input: any, formikAction: FormikActions) => {\n setState((s) => ({ ...s, formSubmitting: true }));\n let token = null;\n\n if (getToken) {\n (async () => {\n await getToken().then((value) => {\n token = value;\n const payload = { UniqueId: state.uniqueId };\n\n return axios\n .post(postUrl, payload, {\n headers: {\n authorization: `Bearer ${token}`,\n },\n })\n .then((r: any) => {\n setState((s) => ({\n ...s,\n docSigned: true,\n formSubmitting: false,\n }));\n })\n .catch((error: any) => {\n SetErrorState(error);\n });\n });\n })();\n }\n };\n\n const SetErrorState = (error: any) => {\n let message = error.message;\n if (error.response && error.response.data && error.response.data.message) {\n message = error.response.data.message;\n }\n setState((s) => ({\n ...s,\n serverError: message || undefined,\n formSubmitting: false,\n }));\n };\n\n const getBase64PDFAsync = async () => {\n if (getToken) {\n if (state.auth0Token === undefined) {\n (async () => {\n await getToken()\n .then((value) => {\n setState((s) => ({ ...s, auth0Token: value }));\n\n return getBase64PDF(value);\n })\n .catch((error2: any) => {});\n })();\n } else {\n return getBase64PDF(state.auth0Token);\n }\n }\n };\n\n const initialGetBase64PDFAsync = useCallback(getBase64PDFAsync, []);\n\n React.useEffect(() => {\n if (!loading) {\n if (state.docSigned) {\n setTimeout(jumpToDealer, 5000);\n } else {\n if (!state.docLoaded) {\n initialGetBase64PDFAsync()\n .then((value) => {})\n .catch((error: any) => {});\n }\n }\n }\n }, [initialGetBase64PDFAsync, loading, state.docLoaded, state.docSigned]);\n\n return (\n <>\n {!state.docLoaded && (\n \n \n \n \n \n )}\n {state.serverError && (\n \n \n \n An error has occurred: {state.serverError}\n \n \n \n )}\n {state.docSigned && (\n <>\n \n \n \n {docTitle} document has been successfully signed\n \n \n \n \n \n Click here to go to your own{\" \"}\n \n dealer page\n \n \n \n \n )}\n {state.docLoaded && !state.docSigned && (\n
\n
\n \n Please review the {docTitle} document below and confirm your\n e-signature by entering the signature code shown toward the end\n \n
\n
\n
\n
\n \n \n \n
\n
\n
\n
\n \n \n \n \n handleZoomIn()}\n >\n \n \n \n \n handleResetZoom()}\n >\n \n \n \n \n handleZoomOut()}\n >\n \n \n \n \n \n \n \n \n setPageNumber(1)}\n disabled={state.pageNumber === 1}\n >\n \n \n \n \n setPageNumber(state.pageNumber - 1)}\n disabled={state.pageNumber === 1}\n >\n \n \n \n \n

\n {state.pageNumber} of {state.numPages}\n

\n \n \n setPageNumber(state.pageNumber + 1)}\n disabled={state.pageNumber === state.numPages}\n >\n \n \n \n \n \n setPageNumber(state.numPages || state.pageNumber)\n }\n disabled={state.pageNumber === state.numPages}\n >\n \n \n \n
\n \n \n \n \n handleOpenInNew(event)}\n >\n \n \n \n \n \n
\n
\n
\n \n {(formikProps: FormikProps) => (\n
\n \n \n \n \n \n \n \n
\n Enter the 4 character signature code\n
\n \n \n
\n \n
\n \n \n {formikProps.values?.sigCode?.length === 4 &&\n formikProps.values?.sigCode?.toUpperCase() !==\n state.signatoryCode && (\n Incorrect code\n )}\n \n
\n \n \n
\n \n {state.formSubmitting && (\n \n )}{\" \"}\n Confirm\n \n
\n \n
\n
\n )}\n \n
\n
\n )}\n \n );\n};\n","import * as React from \"react\";\nimport Helmet from \"react-helmet\";\nimport { Container } from \"reactstrap\";\nimport Breadcrumbs from \"../Breadcrumbs\";\nimport DealerList from \"./DealerList\";\nimport { DealerSearchArgs } from \"./types\";\n\ninterface DealerListProps extends DealerSearchArgs {\n updateSearchArgs: (args: DealerSearchArgs) => void;\n}\n\nclass DealerListScene extends React.Component<\n DealerListProps,\n { inputBuffer?: string }\n> {\n public render() {\n const breadcrumbs = [\n {\n to: \"/\",\n title: \"Home\"\n },\n { to: \"/dealers\", title: \"Dealers\", active: true }\n ];\n\n return (\n <>\n \n Dealers | Eurodrive\n \n \n \n

Dealers

\n \n
\n \n );\n }\n}\nexport default DealerListScene;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult, useQuery } from \"react-apollo\";\nimport { ContextNames, SearchResults, User } from \"../../types\";\nimport { ShallowProposalFragment } from \"../fragments\";\nimport {\n Proposal,\n ProposalDealerCommissionSearchArgs,\n ProposalSearchArgs\n} from \"../types\";\n\ninterface ProposalDealerCommission {\n id: string;\n proposal: Proposal;\n commissionType: string;\n debitBackType?: string;\n value: number;\n commissionDate: string;\n}\n\nexport interface ProposalDealerCommissionProps {\n loggedInUser: User;\n commission: ProposalDealerCommission;\n context?: ContextNames;\n}\n\nexport interface ProposalDealerCommissionListData {\n loggedInUser: User;\n dealer: {\n id: number;\n commission: SearchResults;\n };\n}\n\ninterface ProposalDealerCommissionTotals {\n totalDealerCommission?: number;\n totalOutstandingDebitBack?: number;\n totalValue?: number;\n totalFinance?: number;\n}\n\nexport interface ProposalDealerCommissionListTotalsData {\n dealer: {\n id: number;\n commissionTotals: ProposalDealerCommissionTotals;\n };\n}\n\nexport interface ProposalDealerCommissionListVariables {\n input: ProposalDealerCommissionSearchArgs;\n dealerId?: number;\n}\n\nexport const PROPOSAL_DEALER_COMMISSION_LIST = gql`\n query ProposalDealerCommissionListQuery(\n $dealerId: Int!\n $input: ProposalDealerCommissionSearchArgsInput\n ) {\n loggedInUser {\n id\n username\n roles\n }\n dealer(id: $dealerId) {\n id\n commission(input: $input) {\n pageInfo {\n hasMorePages\n totalResults\n page\n pageSize\n first\n last\n }\n edges {\n node {\n id\n proposal {\n ...ShallowProposalFragment\n }\n commissionType\n debitBackType\n value\n commissionDate\n settled\n }\n }\n }\n }\n }\n ${ShallowProposalFragment}\n`;\n\nexport const PROPOSAL_DEALER_COMMISSION_LIST_TOTALS = gql`\n query ProposalDealerCommissionListTotalsQuery(\n $dealerId: Int!\n $input: ProposalDealerCommissionSearchArgsInput\n ) {\n dealer(id: $dealerId) {\n id\n commissionTotals(input: $input) {\n totalDealerCommission\n totalOutstandingDebitBack\n totalValue\n totalFinance\n }\n }\n }\n`;\n\nconst ProposalDealerCommissionListQuery = ({\n children,\n input\n}: { input: ProposalSearchArgs } & {\n children: (\n result: QueryResult<\n ProposalDealerCommissionListData,\n { input: ProposalDealerCommissionSearchArgs }\n >\n ) => JSX.Element | null;\n}) => (\n \n query={PROPOSAL_DEALER_COMMISSION_LIST}\n variables={{ dealerId: input.dealerId, input }}\n >\n {children}\n \n);\n\nexport const useProposalDealerCommissionList = ({\n variables: { input, dealerId }\n}: {\n variables: ProposalDealerCommissionListVariables;\n}) => {\n const { loading, data } = useQuery<\n ProposalDealerCommissionListData,\n ProposalDealerCommissionListVariables\n >(PROPOSAL_DEALER_COMMISSION_LIST, {\n variables: { input, dealerId }\n });\n\n return { loading, commission: data?.dealer?.commission };\n};\n\nexport const useProposalDealerCommissionListTotals = ({\n variables\n}: {\n variables: ProposalDealerCommissionListVariables;\n}) => {\n const {\n dealerId,\n input: { page, pageSize, ...input }\n } = variables;\n\n const { loading, data } = useQuery<\n ProposalDealerCommissionListTotalsData,\n ProposalDealerCommissionListVariables\n >(PROPOSAL_DEALER_COMMISSION_LIST_TOTALS, {\n variables: { dealerId, input }\n });\n\n return { loading, commissionTotals: data?.dealer?.commissionTotals };\n};\n\nexport default ProposalDealerCommissionListQuery;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Mutation, MutationFunction, MutationResult } from \"react-apollo\";\nimport { DealerFragment } from \"./fragments\";\nimport { Dealer } from \"./types\";\n\ninterface DealerData {\n addDealerToAutoConvert: Dealer;\n}\n\ninterface DealerVariables {\n id: number;\n}\n\nexport const ADD_DEALER_TO_AUTOCONVERT = gql`\n mutation AddDealerToAutoConvert($id: ID!) {\n addDealerToAutoConvert(id: $id) {\n ...DealerFragment\n }\n }\n ${DealerFragment}\n`;\n\nconst AddDealerToAutoConvertMutation = ({\n children\n}: {\n children: (\n mutationFunction: MutationFunction,\n result: MutationResult\n ) => JSX.Element | null;\n}) => {children};\n\nexport default AddDealerToAutoConvertMutation;\n","import * as Yup from \"yup\";\nimport { ApproveDealer } from \"../types\";\n\nconst approveDealerValidationSchema = Yup.object().shape({\n dealerId: Yup.number()\n .default(undefined)\n .required(),\n contractSigned: Yup.boolean()\n .default(false)\n .oneOf([true], \"Contract has to be signed before approving a dealer\"),\n termsAgreedBy: Yup.string()\n .label(\"This\")\n .nullable(true)\n .default(undefined)\n .required()\n});\n\nexport default approveDealerValidationSchema;\n","import { Field, FieldProps, Formik } from \"formik\";\nimport gql from \"graphql-tag\";\nimport { defaults } from \"lodash\";\nimport * as React from \"react\";\nimport { useMutation } from \"react-apollo\";\nimport { RouteComponentProps, withRouter } from \"react-router\";\nimport {\n Button,\n Form,\n Modal,\n ModalBody,\n ModalFooter,\n ModalHeader,\n Row\n} from \"reactstrap\";\nimport { getFullName } from \"../../../utils\";\nimport { BooleanCheckbox } from \"../../Forms/BooleanCheckboxField\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { GET_DEALER } from \"../DealerQuery\";\nimport { DealerFragment } from \"../fragments\";\nimport approveDealerValidationSchema from \"./approveDealerValidationSchema\";\n\nconst APPROVE_DEALER = gql`\n mutation ApproveDealer($input: ApproveDealerInput) {\n approveDealer(input: $input) {\n ...DealerFragment\n }\n }\n ${DealerFragment}\n`;\n\ninterface ApproveDealerModal {\n display: boolean;\n toggle: () => void;\n}\n\nconst ApproveDealerModal = ({\n display,\n toggle,\n match\n}: ApproveDealerModal & RouteComponentProps<{ dealerId: string }>) => {\n const [approveDealer] = useMutation(APPROVE_DEALER);\n const dealerId = parseInt(match.params.dealerId, 10);\n const { loggedInUser } = useLoggedInUser();\n const userName = loggedInUser\n ? getFullName(loggedInUser) || loggedInUser?.username\n : \"\";\n\n return (\n \n {\n approveDealer({\n variables: { input },\n refetchQueries: [\n {\n query: GET_DEALER,\n variables: {\n dealerId\n }\n }\n ]\n });\n\n toggle();\n }}\n validateOnChange={true}\n initialValues={defaults(\n { dealerId, termsAgreedBy: userName },\n approveDealerValidationSchema.default()\n )}\n validationSchema={approveDealerValidationSchema}\n >\n {formikProps => (\n
\n Approve dealer\n \n

\n Approving will automatically unsuspend dealer\n

\n \n \n \n\n \n {(fieldProps: FieldProps) => (\n \n \n \n )}\n \n
\n \n \n \n \n
\n )}\n \n
\n );\n};\n\nexport default withRouter(ApproveDealerModal);\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { useMutation } from \"react-apollo\";\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from \"reactstrap\";\nimport { GET_DEALER } from \"./DealerQuery\";\nimport { DealerFragment } from \"./fragments\";\nimport { Dealer } from \"./types\";\n\nconst SUSPEND_OR_UNSUSPEND_DEALER = gql`\n mutation SuspendOrUnsuspendDealer($id: ID, $suspended: Boolean) {\n suspendOrUnsuspendDealer(id: $id, suspended: $suspended) {\n ...DealerFragment\n }\n }\n ${DealerFragment}\n`;\n\ninterface SuspendDealerModal {\n dealer: Dealer;\n display: boolean;\n toggle: () => void;\n}\n\nconst SuspendDealerModal = ({\n dealer: { name, isSuspended, id },\n display,\n toggle\n}: SuspendDealerModal) => {\n const [suspendOrUnsuspendDealer] = useMutation(SUSPEND_OR_UNSUSPEND_DEALER);\n\n return (\n \n \n {isSuspended ? \"Unsuspend dealer\" : \"Suspend dealer\"}\n \n {`Are you sure you want to ${\n isSuspended ? \"unsuspend\" : \"suspend\"\n } ${name}?`}\n \n \n {\n suspendOrUnsuspendDealer({\n variables: { id, suspended: !isSuspended },\n refetchQueries: [\n {\n query: GET_DEALER,\n variables: {\n dealerId: id\n }\n }\n ]\n });\n\n toggle();\n }}\n color={isSuspended ? \"primary\" : \"danger\"}\n >\n {isSuspended ? \"Unsuspend dealer\" : \"Suspend dealer\"}\n \n \n \n );\n};\n\nexport default SuspendDealerModal;\n","import { faSpinner } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport React, { useState } from \"react\";\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from \"reactstrap\";\nimport { handleSubmit } from \"./DealerScene\";\nimport { Dealer } from \"./types\";\n\ninterface BonafideeModal {\n dealer: Dealer;\n display: boolean;\n toggle: () => void;\n alert: () => void;\n}\n\nconst BonafideeModal = ({\n dealer,\n display,\n toggle,\n alert,\n}: BonafideeModal) => {\n const [isLoading, setIsLoading] = useState(false);\n\n return (\n \n WARNING\n \n This action has already been triggered. Are you sure you want to\n proceed?\n \n \n \n {\n setIsLoading(true);\n handleSubmit(dealer, alert).finally(() => {\n setIsLoading(false);\n toggle();\n });\n }}\n >{isLoading ? (\n \n ) : null}\n Proceed\n \n \n \n );\n};\n\nexport default BonafideeModal;\n","import classnames from \"classnames\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport { formatCurrency, formatEnumValue, getFullName } from \"../../../utils\";\nimport { Proposal } from \"../types\";\nimport { ProposalDealerCommissionProps } from \"./ProposalDealerCommissionListQuery\";\n\nconst getName = (proposal: Proposal) => {\n if (proposal.business) {\n return proposal.business.name;\n }\n\n if (proposal.individualCustomer) {\n return getFullName(proposal.individualCustomer);\n }\n return undefined;\n};\n\nconst ProposalDealerCommissionListItem = ({\n loggedInUser,\n commission,\n context\n}: ProposalDealerCommissionProps) => {\n const { id, proposal, commissionType, debitBackType } = commission;\n const proposalRef = encodeURIComponent(proposal.proposalRef.toLowerCase());\n return (\n \n \n \n

\n {getName(proposal) || \"[No name]\"}\n

\n

\n {proposal.vehicle.regNo\n ? `${proposal.vehicle.regNo.toUpperCase()}, `\n : null}\n {proposal.vehicle.make || proposal.vehicle.model\n ? `${proposal.vehicle.make} ${proposal.vehicle.model}`\n : \"[vehicle unknown]\"}\n

\n
\n \n \n

\n {commissionType === \"Commission\" ? \"Commission\" : \"Debit back\"}\n

\n {debitBackType ? (\n

\n {formatEnumValue(debitBackType)}\n

\n ) : null}\n \n {moment(commission.commissionDate).format(\"D MMM YYYY\")}\n \n {formatCurrency(commission.value)}\n \n \n );\n};\n\nexport default ProposalDealerCommissionListItem;\n","import * as React from \"react\";\nimport { formatCurrency } from \"../../../utils\";\nimport ListTotals, { ListTotalsItem } from \"../../PagedList/ListTotals\";\nimport {\n ProposalDealerCommissionListVariables,\n useProposalDealerCommissionListTotals\n} from \"./ProposalDealerCommissionListQuery\";\n\nconst ProposalDealerCommissionListTotals = ({\n variables\n}: {\n variables: ProposalDealerCommissionListVariables;\n}) => {\n const { loading, commissionTotals } = useProposalDealerCommissionListTotals({\n variables\n });\n\n return (\n \n {formatCurrency(commissionTotals.totalFinance)}\n ) : null\n }\n loading={loading}\n />\n {formatCurrency(commissionTotals.totalDealerCommission)}\n ) : null\n }\n loading={loading}\n />\n \n {formatCurrency(\n (commissionTotals.totalOutstandingDebitBack || 0) * -1\n )}\n \n ) : null\n }\n loading={loading}\n />\n \n );\n};\n\nexport default ProposalDealerCommissionListTotals;\n","import { faFileExcel, faFilePdf } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { Field, FieldProps, FormikProps } from \"formik\";\nimport moment from \"moment\";\nimport querystring from \"query-string\";\nimport * as React from \"react\";\nimport { ButtonDropdown, DropdownMenu, DropdownToggle } from \"reactstrap\";\nimport config from \"../../../config\";\nimport { getMonthDateRange } from \"../../../utils\";\nimport FileDownloadLink from \"../../FileDownloadLink\";\nimport PeriodPickerField from \"../../Forms/PeriodPickerField\";\nimport SearchForm from \"../../Forms/SearchForm\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport PagedList from \"../../PagedList\";\nimport { ContextNames } from \"../../types\";\nimport withToggleState, { ToggleStateProps } from \"../../withToggleState\";\nimport { ProposalDealerCommissionSearchArgs } from \"../types\";\nimport \"./index.scss\";\nimport ProposalDealerCommissionListItem from \"./ProposalDealerCommissionListItem\";\nimport {\n PROPOSAL_DEALER_COMMISSION_LIST,\n ProposalDealerCommissionListData,\n ProposalDealerCommissionListVariables\n} from \"./ProposalDealerCommissionListQuery\";\nimport ProposalDealerCommissionListTotals from \"./ProposalDealerCommissionListTotals\";\n\ninterface ProposalDealerCommissionListProps {\n context?: ContextNames;\n dealerId?: number;\n defaultValues?: ProposalDealerCommissionSearchArgs;\n}\n\nconst getQuerystringForReports = (args: ProposalDealerCommissionSearchArgs) => {\n const convertedArgs = {\n ...args\n };\n\n return querystring.stringify(convertedArgs);\n};\n\nconst ProposalDealerCommissionListActionButtons = withToggleState()(\n ({ active, toggle }: ToggleStateProps) => {\n return (\n
\n \n \n {({ form: { values } }: FieldProps) => (\n \n \n Download\n report\n \n \n \n \n {\" \"}\n Download Excel report\n \n \n \n )}\n \n
\n );\n }\n);\n\nconst TableWrapper = ({\n variables,\n children\n}: {\n variables: ProposalDealerCommissionListVariables;\n children: React.ReactNode;\n}) => {\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n {children}\n
ProposalPayment typeDateValue
\n \n );\n};\n\nconst LoadingPlaceholder = () => (\n \n \n \n \n \n);\n\nconst NoItemsPlaceholder = () => (\n \n No results found\n \n);\n\nconst mapDate = (date?: any) =>\n date ? moment(date).format(\"YYYY-MM-DD\") : date === null ? null : undefined;\n\nconst mapValuesToQuerystring = (\n values: ProposalDealerCommissionSearchArgs & { editDates?: boolean }\n) => ({\n ...values,\n startDate: mapDate(values.startDate),\n endDate: mapDate(values.endDate)\n});\n\nconst mapQuerystringToValues = (\n qs: any\n): ProposalDealerCommissionSearchArgs & { editDates?: boolean } => ({\n ...qs,\n startDate: mapDate(qs.startDate),\n endDate: mapDate(qs.endDate),\n fundedDealersOnly: qs.fundedDealersOnly === \"true\",\n editDates: qs.editDates === \"true\"\n});\n\nconst lastMonth = getMonthDateRange(moment().subtract(1, \"month\"));\n\nconst defaultSearchArgs: ProposalDealerCommissionSearchArgs & {\n editDates?: boolean;\n} = {\n page: 1,\n pageSize: 20,\n fundedDealersOnly: false,\n startDate: moment(lastMonth.value.start).format(\"YYYY-MM-DD\"),\n endDate: moment(lastMonth.value.end).format(\"YYYY-MM-DD\"),\n editDates: false\n};\n\nclass ProposalDealerCommissionList extends React.Component<\n ProposalDealerCommissionListProps\n> {\n public render() {\n const { context, dealerId } = this.props;\n\n return (\n \n {(\n formikProps: FormikProps<\n ProposalDealerCommissionSearchArgs & { editDates?: boolean }\n >\n ) => {\n const { editDates, ...searchArgs } = formikProps.initialValues;\n return (\n \n data?.dealer?.commission\n }\n actionButtonsComponent={ProposalDealerCommissionListActionButtons}\n listItemsContainer={TableWrapper}\n loadingPlaceholder={LoadingPlaceholder}\n noItemsPlaceholder={NoItemsPlaceholder}\n listItemComponent={({ item, loggedInUser }) => (\n \n )}\n />\n );\n }}\n \n );\n }\n}\n\nexport default ProposalDealerCommissionList;\n","import * as React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport ProposalDealerCommissionList from \"../../Proposals/ProposalDealerCommissionList\";\nimport { ContextNames } from \"../../types\";\nimport { useLoggedInDealer } from \"../DealerQuery\";\n\nconst DealerCommissionTabContent = ({\n match\n}: RouteComponentProps<{ dealerId: string; tab: string }>) => {\n const dealerId = parseInt(match.params.dealerId, 10);\n return (\n \n );\n};\n\nexport const UserDealerCommissionTabContent = () => {\n const { dealer, loading } = useLoggedInDealer();\n\n if (loading || !dealer) {\n return ;\n }\n\n return (\n \n );\n};\n\nexport default DealerCommissionTabContent;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport {\n Mutation,\n MutationFunction,\n MutationResult,\n useMutation\n} from \"react-apollo\";\nimport { DealerContactFragment } from \"../fragments\";\nimport { DealerContact } from \"../types\";\n\ninterface DealerContactData {\n createOrUpdateDealerContact: DealerContact;\n}\n\ninterface DealerContactVariables {\n input: DealerContact;\n}\n\nexport const CREATE_OR_UPDATE_DEALER_CONTACT = gql`\n mutation CreateOrUpdateDealerContact($input: DealerContactInput) {\n createOrUpdateDealerContact(input: $input) {\n ...DealerContactFragment\n }\n }\n ${DealerContactFragment}\n`;\n\nconst CreateOrUpdateDealerContact = ({\n children\n}: {\n children: (\n mutationFunction: MutationFunction<\n DealerContactData,\n DealerContactVariables\n >,\n result: MutationResult\n ) => JSX.Element | null;\n}) => (\n {children}\n);\n\nexport const useCreateOrUpdateDealerContact = () => {\n const [createOrUpdateDealerContact] = useMutation<\n DealerContactData,\n DealerContactVariables\n >(CREATE_OR_UPDATE_DEALER_CONTACT);\n return createOrUpdateDealerContact;\n};\n\nexport default CreateOrUpdateDealerContact;\n","import { Field, FieldProps } from \"formik\";\nimport { defaults } from \"lodash\";\nimport * as React from \"react\";\nimport { Col, Label, Row } from \"reactstrap\";\nimport { cleanFormData } from \"../../../utils\";\nimport AddressFormSection from \"../../AddressLookup/AddressFormSection\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport ModalForm from \"../../Forms/ModalForm\";\nimport RadioField from \"../../Forms/RadioField\";\nimport DateSelectRow from \"../../Proposals/ProposalForm/DateSelectRow\";\nimport {\n DEALER_CONTACT_LIST,\n useDealerContact\n} from \"../DealerContactList/DealerContactListQuery\";\nimport FollowUpQuestions from \"../DealerForm/FollowUpQuestions\";\nimport { DealerContact, DealerContactEmailInclude } from \"../types\";\nimport { useCreateOrUpdateDealerContact } from \"./CreateOrUpdateDealerContactMutation\";\nimport dealerContactValidationSchema from \"./dealerContactValidationSchema\";\n\ninterface CreateOrUpdateDealerContactModalProps {\n display: boolean;\n dealerId?: number;\n dealerContactId?: number;\n toggle: () => void;\n}\n\nconst CreateOrUpdateDealerContactModal: React.SFC = ({\n display,\n dealerId,\n dealerContactId,\n toggle\n}: CreateOrUpdateDealerContactModalProps) => {\n const { dealerContact } = useDealerContact(dealerContactId);\n const mutation = useCreateOrUpdateDealerContact();\n\n return (\n {\n toggle();\n const values = cleanFormData(rawValues);\n\n if (!values.isDirector) {\n delete values.homeAddress;\n }\n\n delete values.hasLogin;\n\n return mutation({\n variables: { input: { ...values, dealerId } },\n refetchQueries: [\n {\n query: DEALER_CONTACT_LIST,\n variables: {\n dealerId,\n input: { page: 1, pageSize: 10, dealerId }\n }\n },\n {\n query: DEALER_CONTACT_LIST,\n variables: {\n dealerId,\n input: { page: 2, pageSize: 10, dealerId }\n }\n }\n ]\n });\n }}\n validationSchema={dealerContactValidationSchema}\n >\n {formikProps => (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {!formikProps.values.isDirector && (\n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n )}\n \n );\n};\n\nexport default CreateOrUpdateDealerContactModal;\n","import classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Badge } from \"reactstrap\";\nimport { DealerContactProps } from \"../types\";\n\nconst DealerContactBadges = ({\n contact,\n className\n}: DealerContactProps & { className?: string }) => (\n
\n {contact.isMainContact ? Main contact : null}\n {contact.hasLogin ? Login : null}\n {!contact.hasLogin && contact.requestsDealerPortalUserAccount ? (\n Login requested\n ) : null}\n
\n);\n\nexport default DealerContactBadges;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Mutation, MutationFunction, MutationResult } from \"react-apollo\";\n\ninterface DeleteDealerContactData {\n success: boolean;\n}\n\ninterface DeleteDealerContactVariables {\n id: number;\n}\n\nexport const DELETE_DEALER_CONTACT = gql`\n mutation DeleteDealerContact($id: ID!) {\n deleteDealerContact(id: $id) {\n success\n }\n }\n`;\n\nconst DeleteDealerContactMutation = ({\n children\n}: {\n children: (\n mutateFn: MutationFunction<\n DeleteDealerContactData,\n DeleteDealerContactVariables\n >,\n result: MutationResult\n ) => JSX.Element | null;\n}) => {children};\n\nexport default DeleteDealerContactMutation;\n","import { faTrash } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport * as React from \"react\";\nimport { DropdownItem } from \"reactstrap\";\nimport { ConfirmDialog } from \"../../Forms/ConfirmDialogProvider\";\nimport { DEALER_CONTACT_LIST } from \"../DealerContactList/DealerContactListQuery\";\nimport { DealerContact } from \"../types\";\nimport DeleteDealerContactMutation from \"./DeleteDealerContactMutation\";\n\ninterface DeleteDealerContactDropdownItemProps {\n contact: DealerContact;\n}\n\nconst DeleteDealerContactDropdownItem = ({\n contact: { id, dealerId }\n}: DeleteDealerContactDropdownItemProps) => {\n if (!id) {\n return null;\n }\n return (\n \n {confirm => (\n \n {mutation => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n confirm(() =>\n mutation({\n variables: { id },\n refetchQueries: [\n {\n query: DEALER_CONTACT_LIST,\n variables: {\n dealerId,\n input: {\n page: 1,\n pageSize: 10,\n dealerId\n }\n }\n },\n {\n query: DEALER_CONTACT_LIST,\n variables: {\n dealerId,\n input: {\n page: 2,\n pageSize: 10,\n dealerId\n }\n }\n }\n ]\n })\n );\n }}\n >\n Delete\n \n )}\n \n )}\n \n );\n};\n\nexport default DeleteDealerContactDropdownItem;\n","import classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Col, DropdownItem, Row } from \"reactstrap\";\nimport { getFullName } from \"../../../utils\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport ActionsDropdown from \"../../PagedList/ActionsDropdown\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport DealerContactBadges from \"../DealerContacts/DealerContactBadges\";\nimport DeleteDealerContactDropdownItem from \"../DealerContacts/DeleteDealerContactDropdownItem\";\nimport { DealerContact, DealerContactProps } from \"../types\";\n\ninterface DealerContactListItemProps extends DealerContactProps {\n onClick: (dealerContact: DealerContact) => void;\n onCreateUser: (dealerContact: DealerContact) => void;\n selected?: boolean;\n}\n\nconst DealerContactListItem = ({\n contact,\n context,\n onClick,\n onCreateUser,\n selected\n}: DealerContactListItemProps) => {\n const { loggedInUser, checkCanCreate, checkCanUpdate } = useLoggedInUser();\n\n if (!loggedInUser) {\n return null;\n }\n\n return (\n \n checkCanUpdate(PermissionModuleNames.DealerContacts)\n ? onClick(contact)\n : null\n }\n >\n \n \n

\n {getFullName(contact)}\n {contact.position ? ` ${contact.position}` : null}\n

\n {contact.email ? (\n

{contact.email}

\n ) : null}\n \n \n {checkCanCreate(PermissionModuleNames.Users) ? (\n \n \n onClick(contact)}>\n Edit contact\n \n onCreateUser(contact)}\n >\n New user from contact...\n \n \n \n \n \n ) : null}\n
\n \n );\n};\n\nexport default DealerContactListItem;\n","import { FormikProps } from \"formik\";\nimport React, { useState } from \"react\";\nimport { Button } from \"reactstrap\";\nimport SearchForm from \"../../Forms/SearchForm\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport PagedList from \"../../PagedList\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport CreateUserModal from \"../../Settings/Users/CreateUserModal\";\nimport { ContextNames, UserRoles } from \"../../types\";\nimport CreateOrUpdateDealerContactModal from \"../DealerContacts/CreateOrUpdateDealerContactModal\";\nimport { DealerContactSearchArgs } from \"../types\";\nimport DealerContactListItem from \"./DealerContactListItem\";\nimport {\n DEALER_CONTACT_LIST,\n DealerContactListData\n} from \"./DealerContactListQuery\";\n\ninterface DealerContactListState {\n showContactModal: boolean;\n showUserModal: boolean;\n selectedContactId?: number;\n}\n\ninterface DealerContactListProps {\n context?: ContextNames;\n dealerId?: number;\n}\n\nconst defaultSearchArgs = {\n page: 1,\n pageSize: 10\n};\n\nconst DealerContactList = (props: DealerContactListProps) => {\n const [modalState, setModalState] = useState({\n showContactModal: false,\n showUserModal: false,\n selectedContactId: undefined\n });\n\n const { loggedInUser, checkCanCreate } = useLoggedInUser();\n\n const { showContactModal, showUserModal, selectedContactId } = modalState;\n const { context, dealerId } = props;\n\n const toggleContactModal = () =>\n setModalState({\n showContactModal: !showContactModal,\n showUserModal: false,\n selectedContactId: showContactModal ? undefined : selectedContactId\n });\n\n const toggleUserModal = () =>\n setModalState({\n showUserModal: !showUserModal,\n showContactModal: false,\n selectedContactId: showUserModal ? undefined : selectedContactId\n });\n\n if (!loggedInUser) {\n return null;\n }\n\n return (\n <>\n qs}\n mapValuesToQuerystring={values => values}\n defaultValues={defaultSearchArgs}\n fixedValues={{ dealerId }}\n >\n {(formikProps: FormikProps) => (\n \n data.dealer && data.dealer.contacts\n }\n actionButtonsComponent={() =>\n checkCanCreate(PermissionModuleNames.DealerContacts) ? (\n \n New contact\n \n ) : null\n }\n listItemComponent={({ item }) => {\n return (\n \n setModalState({\n selectedContactId: contact.id,\n showContactModal: true,\n showUserModal: false\n })\n }\n onCreateUser={contact =>\n setModalState({\n selectedContactId: contact.id,\n showContactModal: false,\n showUserModal: true\n })\n }\n />\n );\n }}\n />\n )}\n \n \n \n \n );\n};\n\nexport default DealerContactList;\n","import * as React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport { ContextNames } from \"../../types\";\nimport DealerContactList from \"../DealerContactList\";\n\nconst DealerContactsTabContent = ({\n match\n}: RouteComponentProps<{ dealerId: string; tab: string }>) => {\n const id = parseInt(match.params.dealerId, 10);\n\n return ;\n};\n\nexport default DealerContactsTabContent;\n","import { merge } from \"lodash\";\nimport * as React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport { cleanFormData } from \"../../../utils\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport { useCreateOrUpdateDealer } from \"../CreateDealerMutation\";\nimport DealerForm from \"../DealerForm\";\nimport {\n useDealerWithQuestionnaire,\n useLoggedInDealerWithQuestionnaire,\n} from \"../DealerQuery\";\nimport dealerValidationSchema from \"../dealerValidationSchema\";\nimport { Dealer, DealerFormSectionName } from \"../types\";\nimport { UserRoles } from \"../../types\";\n\nconst cleanDealerBeforeSubmit = (formData: Dealer) => {\n const dealer = cleanFormData(formData);\n\n delete dealer.staticMapUrl;\n delete dealer.googleMapsUrl;\n delete dealer.hasRecentActivity;\n delete dealer.needsEsignForced;\n delete dealer.accountManager;\n delete dealer.groups;\n delete dealer.companyType;\n delete dealer.countOfActiveProposals;\n delete dealer.contractSigned;\n delete dealer.approvedDate;\n delete dealer.autoConvert;\n delete dealer.autoConvertReference;\n\n // Only save contacts for new dealers. Contacts for existing\n // dealers are saved via the contacts tab\n if (!!dealer.id) {\n delete dealer.contacts;\n }\n\n return dealer;\n};\n\nconst DealerDetailsTabContentInner = ({ dealer }: { dealer: Dealer }) => {\n const {\n checkCanUpdate,\n loading: loadingUser,\n loggedInUser,\n } = useLoggedInUser();\n const createOrUpdateDealer = useCreateOrUpdateDealer();\n\n if (loadingUser) {\n return null;\n }\n\n const isAccountManager = loggedInUser?.roles.includes(\n UserRoles.account_manager\n );\n const canUpdate =\n checkCanUpdate(PermissionModuleNames.Dealers) && !isAccountManager;\n\n const initialValues: Dealer = merge(\n {},\n dealerValidationSchema.default(),\n cleanFormData(dealer)\n );\n\n if (!dealer.bank && !canUpdate) {\n (initialValues as any).bank = undefined;\n }\n\n if (!dealer.questionnaire) {\n (initialValues as any).questionnaire = undefined;\n initialValues.FORMSTATE_requiresQuestionnaire = false;\n }\n initialValues.contacts = [];\n\n return (\n
\n Promise.resolve()}\n onSubmitDealer={(submitted) => {\n return createOrUpdateDealer({\n variables: { input: cleanDealerBeforeSubmit(submitted) },\n });\n }}\n initialValues={initialValues}\n initialSection={DealerFormSectionName.DEALER_DETAILS}\n canUpdate={canUpdate}\n />\n
\n );\n};\n\nexport const UserDealerDetailsTabContent = ({\n match,\n}: RouteComponentProps<{ dealerId: string }>) => {\n const { dealer, loading } = useLoggedInDealerWithQuestionnaire();\n\n if (loading) {\n return ;\n }\n\n if (!dealer) {\n return null;\n }\n\n return ;\n};\n\nconst DealerDetailsTabContent = ({\n match,\n}: RouteComponentProps<{ dealerId: string }>) => {\n const dealerId = match.params.dealerId\n ? parseInt(match.params.dealerId, 10)\n : undefined;\n\n const { dealer, loading } = useDealerWithQuestionnaire(dealerId);\n\n if (loading) {\n return ;\n }\n\n if (!dealer) {\n return null;\n }\n\n return ;\n};\n\nexport default DealerDetailsTabContent;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult, useQuery } from \"react-apollo\";\nimport { UserRoles } from \"../../types\";\nimport { ProposalSearchArgs, ProposalStatistics } from \"../types\";\n\nexport interface ProposalDealerOverviewData {\n loggedInUser: {\n id: string;\n roles: UserRoles[];\n username: string;\n };\n dealer: {\n id: number;\n overview: ProposalStatistics;\n };\n}\n\nexport const PROPOSAL_DEALER_OVERVIEW = gql`\n query ProposalDealerOverviewQuery(\n $dealerId: Int!\n $input: ProposalSearchArgsInput\n ) {\n loggedInUser {\n id\n username\n roles\n }\n dealer(id: $dealerId) {\n id\n overview(input: $input) {\n totalCreatedCount\n totalPaidOutCount\n totalAcceptedCount\n totalCancelledCount\n totalFinance\n averagePaidOutFinance\n averageApr\n averagePeriod\n totalDebitBackAmount\n totalDealerCommission\n averageAcceptedFinance\n acceptance\n totalNetProfit\n }\n }\n }\n`;\n\ninterface ProposalDealerOverviewVariables {\n dealerId?: number;\n input: ProposalSearchArgs;\n}\n\nconst ProposalDealerOverviewQuery = ({\n children,\n variables,\n}: { variables: ProposalDealerOverviewVariables } & {\n children: (\n result: QueryResult<\n ProposalDealerOverviewData,\n ProposalDealerOverviewVariables\n >\n ) => JSX.Element | null;\n}) => (\n \n query={PROPOSAL_DEALER_OVERVIEW}\n variables={variables}\n >\n {children}\n \n);\n\nexport const useProposalDealerOverview = (searchArgs: ProposalSearchArgs) => {\n const { loading, data } = useQuery<\n ProposalDealerOverviewData,\n ProposalDealerOverviewVariables\n >(PROPOSAL_DEALER_OVERVIEW, {\n variables: { dealerId: searchArgs.dealerId, input: searchArgs },\n });\n\n return { loading, overview: data?.dealer?.overview };\n};\n\nexport default ProposalDealerOverviewQuery;\n","import moment from \"moment\";\nimport React from \"react\";\nimport { Col, Row } from \"reactstrap\";\nimport {\n formatCurrency,\n getProportion,\n shortenNumberForDisplay,\n} from \"../../../utils\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport PeriodPicker from \"../../shared/PeriodPicker\";\nimport { useProposalDealerOverview } from \"./ProposalDealerOverviewQuery\";\nimport StatsBox from \"./StatsBox\";\n\ninterface ProposalDealerOverviewSummaryState {\n startDate?: string;\n endDate?: string;\n editDates?: boolean;\n}\n\ninterface ProposalDealerOverviewSummaryProps {\n dealerId: number;\n}\n\nconst ProposalDealerOverviewSummary = (\n props: ProposalDealerOverviewSummaryProps\n) => {\n const [formState, setFormState] =\n React.useState({\n startDate: moment().startOf(\"month\").toISOString(true),\n endDate: moment()\n .startOf(\"month\")\n .add(1, \"month\")\n .subtract(1, \"day\")\n .endOf(\"day\")\n .toISOString(true),\n editDates: false,\n });\n\n const { startDate, endDate, editDates } = formState;\n const { dealerId } = props;\n\n const { overview, loading } = useProposalDealerOverview({\n startDate,\n endDate,\n dealerId,\n });\n\n const { checkCanReadInternal } = useLoggedInUser();\n\n return (\n <>\n
\n \n \n {\n setFormState({\n startDate: start ? moment(start).toISOString() : undefined,\n endDate: end ? moment(end).toISOString() : undefined,\n editDates: !!edit,\n });\n }}\n />\n \n \n \n \n
\n \n \n \n
\n
\n \n \n {checkCanReadInternal(PermissionModuleNames.Proposals) ? (\n <>\n \n \n \n ) : null}\n
\n \n
\n
\n \n );\n};\n\nexport default ProposalDealerOverviewSummary;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport {\n Mutation,\n MutationFunction,\n MutationResult,\n useMutation\n} from \"react-apollo\";\nimport { DealerFragment } from \"./fragments\";\nimport { Dealer } from \"./types\";\n\ninterface DealerData {\n updateDealer: Dealer;\n}\n\ninterface DealerVariables {\n input: Dealer;\n}\n\nexport const UPDATE_DEALER_ADDRESS = gql`\n mutation UpdateDealerAddress($input: DealerAddressInput) {\n updateDealerAddress(input: $input) {\n ...DealerFragment\n }\n }\n ${DealerFragment}\n`;\n\nconst UpdateDealerAddress = ({\n children\n}: {\n children: (\n mutationFunction: MutationFunction,\n result: MutationResult\n ) => JSX.Element | null;\n}) => {children};\n\nexport const useUpdateDealerAddress = () => {\n const [updateDealerAddress] = useMutation(UPDATE_DEALER_ADDRESS);\n return updateDealerAddress;\n};\n\nexport default UpdateDealerAddress;\n","import * as Yup from \"yup\";\nimport { Address } from \"../../types\";\nimport { Dealer } from \"../types\";\n\n/** Shows an error if the current value is not specified, but the other value is specified */\nconst validateLatLng = (currentValue?: any, otherValue?: any) => {\n if (currentValue || currentValue === 0) {\n return true;\n }\n\n if (!otherValue && otherValue !== 0) {\n return true;\n }\n\n return false;\n};\n\n// tslint:disable:ter-prefer-arrow-callback\n// tslint:disable:only-arrow-functions\nconst locationValidationSchema = Yup.object<{\n latitude: number;\n longitude: number;\n}>().shape({\n latitude: Yup.number()\n .label(\"Latitude\")\n .default(undefined)\n .nullable(true)\n .max(90)\n .min(-90)\n .typeError(\"Latitude must be a number\")\n .transform(value => (value || value === 0 ? value : null))\n .test(\"latitude-required\", \"Latitude is a required field\", function() {\n const { latitude, longitude } = this.parent as any;\n return validateLatLng(latitude, longitude);\n }),\n longitude: Yup.number()\n .label(\"Longitude\")\n .default(undefined)\n .nullable(true)\n .max(180)\n .min(-180)\n .typeError(\"Longitude must be a number\")\n .transform(value => (value || value === 0 ? value : null))\n .test(\"longitude-required\", \"Longitude is a required field\", function() {\n const { latitude, longitude } = this.parent as any;\n return validateLatLng(longitude, latitude);\n })\n});\n\nconst dealerAddressValidationSchema = Yup.object().shape({\n id: Yup.number()\n .nullable(true)\n .default(undefined),\n location: locationValidationSchema\n .required()\n .default(locationValidationSchema.default()),\n FORMSTATE_postcodeNotFound: Yup.string()\n .default(undefined)\n .nullable(true),\n FORMSTATE_postcodeFound: Yup.string()\n .default(undefined)\n .nullable(true),\n address: Yup.object
().shape({\n line1: Yup.string()\n .label(\"Line 1\")\n .default(undefined)\n .nullable(true)\n .required(\"Line 1 of the address is required\")\n .max(50),\n line2: Yup.string()\n .default(undefined)\n .nullable(true)\n .max(50)\n .label(\"Line 2\"),\n line3: Yup.string()\n .default(undefined)\n .nullable(true)\n .max(50)\n .label(\"Line 3\"),\n town: Yup.string()\n .default(undefined)\n .nullable(true)\n .max(50)\n .label(\"Town\"),\n postcode: Yup.string()\n .default(undefined)\n .nullable(true)\n .max(8)\n .label(\"Postcode\")\n })\n});\n\nexport default dealerAddressValidationSchema;\n","import { Formik, FormikProps } from \"formik\";\nimport { defaults } from \"lodash\";\nimport * as React from \"react\";\nimport { cleanFormData } from \"../../../utils\";\nimport { useDealer } from \"../DealerQuery\";\nimport { Dealer } from \"../types\";\nimport { useUpdateDealerAddress } from \"../UpdateDealerAddressMutation\";\nimport dealerAddressValidationSchema from \"./dealerAddressValidationSchema\";\n\ninterface DealerAddressFormProps {\n dealerId: number;\n children: (props: FormikProps) => JSX.Element | null;\n toggle: () => void;\n}\n\nconst DealerAddressForm = ({\n dealerId,\n children,\n toggle\n}: DealerAddressFormProps) => {\n const { dealer } = useDealer(dealerId);\n const mutation = useUpdateDealerAddress();\n\n if (!dealer) {\n return null;\n }\n const { id, address, location } = dealer;\n return (\n \n mutation({\n variables: { input: cleanFormData(values) }\n }).then(toggle)\n }\n initialValues={\n defaults(\n { id, address, location: location || {} },\n dealerAddressValidationSchema.default()\n ) as Dealer\n }\n validationSchema={dealerAddressValidationSchema}\n validateOnChange={true}\n >\n {formikProps => (\n
{children(formikProps)}
\n )}\n \n );\n};\n\nexport default DealerAddressForm;\n","import { Field, FormikProps } from \"formik\";\nimport gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { withApollo } from \"react-apollo\";\nimport { Button, Col, Row } from \"reactstrap\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport { Dealer } from \"../types\";\n\nconst GET_LOCATION = gql`\n query GetLocationFromAddressQuery($input: AddressInput) {\n locations {\n locationFromAddress(input: $input) {\n id\n latitude\n longitude\n }\n }\n }\n`;\n\nconst DealerAddressFormControls = withApollo<\n FormikProps<\n Dealer & {\n FORMSTATE_postcodeNotFound?: string;\n FORMSTATE_postcodeFound?: string;\n }\n >\n>(({ client, values, setFieldValue, validateForm }) => (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {\n const postcode = values.address && values.address.postcode;\n if (postcode) {\n return client\n .query<{\n locations: {\n locationFromAddress?: {\n latitude: number;\n longitude: number;\n };\n };\n }>({\n query: GET_LOCATION,\n variables: {\n input: {\n postcode\n }\n }\n })\n .then(result => {\n if (\n result.data &&\n result.data.locations.locationFromAddress\n ) {\n setFieldValue(\n \"location.latitude\" as any,\n result.data.locations.locationFromAddress.latitude,\n false\n );\n setFieldValue(\n \"location.longitude\" as any,\n result.data.locations.locationFromAddress.longitude,\n false\n );\n\n setFieldValue(\"FORMSTATE_postcodeFound\", postcode, false);\n setFieldValue(\"FORMSTATE_postcodeNotFound\", null, false);\n } else {\n setFieldValue(\"location.latitude\" as any, null, false);\n setFieldValue(\"location.longitude\" as any, null, false);\n setFieldValue(\"FORMSTATE_postcodeFound\", null, false);\n setFieldValue(\n \"FORMSTATE_postcodeNotFound\",\n postcode,\n false\n );\n }\n return validateForm();\n });\n }\n return Promise.resolve();\n }}\n className=\"mb-3\"\n >\n Find location from postcode\n \n {values.address.postcode &&\n values.FORMSTATE_postcodeNotFound === values.address.postcode && (\n

\n Location not found for postcode "{values.address.postcode}\n "\n

\n )}\n {values.address.postcode &&\n values.FORMSTATE_postcodeFound === values.address.postcode && (\n

\n Location found for postcode "{values.address.postcode}\n "\n

\n )}\n \n
\n \n \n \n \n \n));\n\nexport default DealerAddressFormControls;\n","import * as React from \"react\";\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from \"reactstrap\";\nimport { ToggleStateProps } from \"../../withToggleState\";\nimport DealerAddressForm from \"../DealerAddressForm\";\nimport DealerAddressFormControls from \"../DealerAddressForm/DealerAddressFormControls\";\n\nconst DealerAddressModal = ({\n dealerId,\n toggle,\n active\n}: { dealerId: number } & ToggleStateProps) => (\n \n \n {formikProps => (\n <>\n Edit dealer location\n \n \n \n \n \n \n \n \n )}\n \n \n);\n\nexport default DealerAddressModal;\n","import { faExternalLinkAlt } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport * as React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport { Button } from \"reactstrap\";\nimport config from \"../../../config\";\nimport { roundNumber } from \"../../../utils\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport ProposalDealerOverviewSummary from \"../../Proposals/ProposalDealerOverview/ProposalDealerOverviewSummary\";\nimport { User, UserRoles } from \"../../types\";\nimport { useDealer, useLoggedInDealer } from \"../DealerQuery\";\nimport { Dealer } from \"../types\";\nimport DealerAddressModal from \"./DealerAddressModal\";\n\n/** Gets a url to open Google Maps at the specified location */\nconst getGoogleMapsUrl = ({\n latitude,\n longitude,\n}: {\n latitude: number;\n longitude: number;\n}) => {\n return `https://www.google.com/maps/search/?api=1&query=${latitude},${longitude}`;\n};\n\n/** Gets a url to a static map image from mapbox, with a pin in the specified location */\nconst getMapboxStaticMapUrl = ({\n longitude,\n latitude,\n zoom,\n width,\n height,\n}: {\n longitude: number;\n latitude: number;\n zoom: number;\n width: number;\n height: number;\n}) => {\n const baseUrl = `https://api.mapbox.com/styles/v1/${config.MAPBOX_USERNAME}/${config.MAPBOX_STYLE}/static`;\n const marker = `pin-l+ff6b3a(${longitude},${latitude})`;\n const location = `${longitude},${latitude},${zoom}`;\n\n return `${baseUrl}/${marker}/${location}/${width}x${height}@2x?access_token=${config.MAPBOX_ACCESS_TOKEN}`;\n};\n\n/** Links to the dealer map for account managers etc, or to Google Maps for a dealer */\nconst MapLink = ({\n dealer,\n loggedInUser,\n children,\n}: {\n dealer: Dealer;\n loggedInUser: User;\n children: React.ReactNode;\n}) => {\n const isDealer =\n loggedInUser && loggedInUser.roles.includes(UserRoles.dealer);\n\n if (!dealer.location) {\n return null;\n }\n\n if (isDealer) {\n return (\n \n {children}\n \n );\n }\n\n let to = `/dealers/map?longitude=${dealer.location.longitude}&latitude=${dealer.location.latitude}&zoom=12`;\n if (dealer.isSuspended) {\n to = `${to}&includeSuspended=true`;\n }\n\n return {children};\n};\n\nconst DealerOverviewTabContentInner = ({ dealer }: { dealer: Dealer }) => {\n const { loggedInUser, loading, checkCanUpdate } = useLoggedInUser();\n const [active, setActive] = React.useState(false);\n const toggle = () => setActive(!active);\n\n if (loading || !loggedInUser) {\n return null;\n }\n\n const canEdit = checkCanUpdate(PermissionModuleNames.Dealers);\n\n return (\n
\n \n\n
\n {!!dealer.agreedApr && (\n

\n Agreed APR: {roundNumber(dealer.agreedApr)}%\n

\n )}\n {!!dealer.previousApr && (\n

\n Previous agreed APR: {roundNumber(dealer.previousApr)}%\n

\n )}\n
\n {dealer && dealer.location ? (\n
\n \n \n \n
\n ) : null}\n {canEdit && (\n \n )}\n {dealer && dealer.location ? (\n \n Show in Google Maps{\" \"}\n \n \n \n \n ) : null}\n \n
\n );\n};\n\nexport const UserDealerOverviewTabContent = () => {\n const { dealer, loading } = useLoggedInDealer();\n\n if (loading) {\n return ;\n }\n\n if (!dealer) {\n return null;\n }\n\n return ;\n};\n\nconst DealerOverviewTabContent = ({\n match,\n}: RouteComponentProps<{ dealerId: string }>) => {\n const dealerId = match.params.dealerId\n ? parseInt(match.params.dealerId, 10)\n : undefined;\n const { dealer, loading } = useDealer(dealerId);\n\n if (loading) {\n return ;\n }\n\n if (!dealer) {\n return null;\n }\n return ;\n};\n\nexport default DealerOverviewTabContent;\n","import * as React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport ProposalList from \"../../Proposals/ProposalList\";\nimport { ContextNames } from \"../../types\";\n\nconst DealerProposalsTabContent = ({\n match\n}: RouteComponentProps<{ dealerId: string; tab: string }>) => {\n const id = parseInt(match.params.dealerId, 10);\n return (\n \n );\n};\n\nexport default DealerProposalsTabContent;\n","import * as React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport QuotationList from \"../../Quotations/QuotationList\";\nimport { ContextNames } from \"../../types\";\n\nconst DealerQuotationsTabContent = ({\n match\n}: RouteComponentProps<{ dealerId: string; tab: string }>) => {\n const id = parseInt(match.params.dealerId, 10);\n\n return ;\n};\n\nexport default DealerQuotationsTabContent;\n","import * as React from \"react\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport {\n PermissionActivityNames,\n PermissionModuleNames,\n} from \"../../Permissions/types\";\nimport FullWidthTabHeaders, {\n TabHeaderProps,\n} from \"../../Tabs/FullWidthTabHeaders\";\n\ninterface TabHeadersProps {\n tab: string;\n}\n\nconst useDealerTabHeaders = () => {\n const { loading, checkCanRead, checkCanCreate, checkIsAuthorized, isDealer } =\n useLoggedInUser();\n\n if (loading) {\n return null;\n }\n\n const tabs: TabHeaderProps[] = [{ path: \"\", title: \"Overview\" }];\n\n if (\n checkIsAuthorized(\n PermissionModuleNames.Dealers,\n PermissionActivityNames.ReadInternal\n )\n ) {\n tabs.push({ path: \"details\", title: \"Details\" });\n }\n\n if (!isDealer) {\n if (checkCanRead(PermissionModuleNames.Quotations)) {\n tabs.push({\n path: \"quotations\",\n title: \"Quotations\",\n collapse: true,\n });\n }\n if (checkCanRead(PermissionModuleNames.Proposals)) {\n tabs.push({\n path: \"proposals\",\n title: \"Proposals\",\n collapse: true,\n });\n }\n }\n\n if (checkCanRead(PermissionModuleNames.AccountManagerActivity)) {\n tabs.push({ path: \"activity\", title: \"Activity\", collapse: true });\n }\n\n if (checkCanRead(PermissionModuleNames.Proposals)) {\n tabs.push({\n path: \"commission\",\n title: \"Commission\",\n collapse: true,\n });\n }\n\n if (!isDealer && checkCanRead(PermissionModuleNames.DealerContacts)) {\n tabs.push({ path: \"contacts\", title: \"Contacts\", collapse: true });\n }\n\n if (checkCanCreate(PermissionModuleNames.Users)) {\n tabs.push({ path: \"users\", title: \"Users\", collapse: true });\n }\n\n if (isDealer || checkCanRead(PermissionModuleNames.Lenders)) {\n tabs.push({ path: \"lenders\", title: \"Lenders\", collapse: true });\n }\n\n if (!isDealer && checkCanRead(PermissionModuleNames.DraftDealers)) {\n tabs.push({ path: \"proofs\", title: \"Proofs\", collapse: true });\n }\n\n tabs.push({ path: \"esignatures\", title: \"eSignatures\", collapse: true });\n\n return tabs;\n};\n\nconst DealerTabHeaders = (props: TabHeadersProps) => {\n const tabs = useDealerTabHeaders();\n\n if (!tabs) {\n return null;\n }\n\n return ;\n};\n\nexport default DealerTabHeaders;\n","import * as React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport UserList from \"../../Settings/Users/UserList\";\nimport { ContextNames } from \"../../types\";\n\nconst DealerUsersTabContent = ({\n match\n}: RouteComponentProps<{ dealerId: string; tab: string }>) => {\n const id = parseInt(match.params.dealerId, 10);\n return ;\n};\n\nexport default DealerUsersTabContent;\n","import gql from \"graphql-tag\";\nimport { useQuery } from \"react-apollo\";\nimport { SearchResults } from \"../../types\";\nimport { LenderRatesForDealersFragment } from \"../fragments\";\nimport { LenderRatesForDealers } from \"../types\";\n\nexport interface LenderRatesForDealersData {\n lenderRatesForDealers: SearchResults;\n}\n\nexport interface LenderRateData {\n lenderRateForDealer: LenderRatesForDealers;\n}\n\nexport const DEALER_LENDER_RATES_LIST = gql`\n query DealerLenderRatesQuery($input: LenderRatesForDealersSearchArgsInput) {\n lenderRatesForDealers(input: $input) {\n pageInfo {\n hasMorePages\n totalResults\n page\n pageSize\n first\n last\n }\n edges {\n node {\n ...LenderRatesForDealersFragment\n }\n }\n }\n }\n ${LenderRatesForDealersFragment}\n`;\n\nexport const useDealerLenderRatesList = (dealerId: number) => {\n const { loading, data } = useQuery<\n LenderRatesForDealersData,\n { dealerId: number }\n >(DEALER_LENDER_RATES_LIST, {\n variables: { dealerId: dealerId },\n });\n\n return { loading, data: data };\n};\n\nexport const DEALER_LENDER_RATE = gql`\n query DealerLenderRateQuery($id: ID) {\n lenderRateForDealer(id: $id) {\n ...LenderRatesForDealersFragment\n }\n }\n ${LenderRatesForDealersFragment}\n`;\n\nexport const useDealerLenderRate = (id?: number) => {\n const { loading, data } = useQuery(\n DEALER_LENDER_RATE,\n {\n variables: { id },\n }\n );\n\n return { loading, lenderRate: data?.lenderRateForDealer };\n};\n","import gql from \"graphql-tag\";\nimport { useMutation } from \"react-apollo\";\n\ninterface DeleteDealerLenderRateData {\n success: boolean;\n}\n\ninterface DeleteDealerLenderRateVariables {\n id: number;\n}\n\nexport const DELETE_DEALER_LENDER_RATE = gql`\n mutation DeleteDealerLenderRate($id: ID!) {\n deleteDealerLenderRate(id: $id) {\n success\n }\n }\n`;\n\nconst useDeleteDealerLenderRate = () => {\n const [deleteDealerLenderRate] = useMutation<\n DeleteDealerLenderRateData,\n DeleteDealerLenderRateVariables\n >(DELETE_DEALER_LENDER_RATE);\n\n return deleteDealerLenderRate;\n};\n\nexport default useDeleteDealerLenderRate;\n","import { faTrash } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport * as React from \"react\";\nimport { DropdownItem } from \"reactstrap\";\nimport { ConfirmDialog } from \"../../Forms/ConfirmDialogProvider\";\nimport { PagedListContext } from \"../../PagedList\";\nimport { DEALER_LENDER_RATES_LIST } from \"./DealerLenderRatesQuery\";\nimport useDeleteDealerLenderRate from \"./DeleteDealerLenderRateMutation\";\n\ninterface DeleteDealerLenderListItemProps {\n id: number;\n dealerId: number;\n}\n\nconst DeleteDealerLenderListItem = ({\n id,\n dealerId,\n}: DeleteDealerLenderListItemProps) => {\n const mutation = useDeleteDealerLenderRate();\n const { refresh } = React.useContext(PagedListContext);\n\n if (!id) {\n return null;\n }\n\n return (\n \n {(confirm) => (\n {\n e.preventDefault();\n e.stopPropagation();\n confirm(() =>\n mutation({\n variables: { id },\n refetchQueries: [\n {\n query: DEALER_LENDER_RATES_LIST,\n variables: {\n dealerId,\n input: {\n page: 1,\n pageSize: 10,\n dealerId,\n },\n },\n },\n {\n query: DEALER_LENDER_RATES_LIST,\n variables: {\n dealerId,\n input: {\n page: 2,\n pageSize: 10,\n dealerId,\n },\n },\n },\n ],\n }).then(refresh)\n );\n }}\n >\n Delete\n \n )}\n \n );\n};\n\nexport default DeleteDealerLenderListItem;\n","import * as React from \"react\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport moment from \"moment\";\nimport { Col, DropdownItem, Row } from \"reactstrap\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport ActionsDropdown from \"../../PagedList/ActionsDropdown\";\nimport DeleteDealerLenderListItem from \"./DeleteDealerLenderListItem\";\nimport { LenderRatesForDealers, LenderRatesForDealersProps } from \"../types\";\n\ninterface DealerLenderListItemProps extends LenderRatesForDealersProps {\n onClick: (lenderRates: LenderRatesForDealers) => void;\n selected?: boolean;\n}\n\nconst DealerLenderListItem = ({\n rates,\n onClick,\n}: DealerLenderListItemProps) => {\n const { loggedInUser, checkCanCreate, checkCanUpdate } = useLoggedInUser();\n\n if (!loggedInUser) {\n return null;\n }\n\n const dateFromFormatted = moment(rates.dateFrom).format(\"YYYY-MM-DD\");\n const dateToFormatted = moment(rates.dateTo).format(\"YYYY-MM-DD\");\n const today = moment().format(\"YYYY-MM-DD\");\n\n return (\n <>\n \n checkCanUpdate(PermissionModuleNames.Lenders) ? onClick(rates) : null\n }\n >\n \n \n

\n {rates?.lender?.name}\n

\n

Rate: {rates.rate}% APR

\n {rates.asMoney ? (\n

Commission: £{rates.commission}

\n ) : (\n

Commission: {rates.commission}%

\n )}\n

Valid from {dateFromFormatted}

\n {!!rates.dateTo && dateToFormatted > today ? (\n

Expires on {dateToFormatted}

\n ) : !!rates.dateTo && dateToFormatted === today ? (\n

Expires today

\n ) : null}\n \n {checkCanCreate(PermissionModuleNames.Lenders) ? (\n \n \n onClick(rates)}>\n Edit rate\n \n \n \n \n \n ) : null}\n
\n \n \n );\n};\n\nexport default DealerLenderListItem;\n","import gql from \"graphql-tag\";\nimport { LenderRatesForDealers } from \"../types\";\nimport { LenderRatesForDealersFragment } from \"../fragments\";\nimport { useMutation } from \"react-apollo\";\n\ninterface DealerLenderRateData {\n createOrUpdateDealerLenderRate: LenderRatesForDealers;\n}\n\ninterface DealerLenderRateVariables {\n input: LenderRatesForDealers;\n}\n\nexport const CREATE_OR_UPDATE_DEALER_LENDER_RATE = gql`\n mutation CreateOrUpdateDealerLenderRate($input: DealerLenderRateInput) {\n createOrUpdateDealerLenderRate(input: $input) {\n ...LenderRatesForDealersFragment\n }\n }\n ${LenderRatesForDealersFragment}\n`;\n\nconst useCreateOrUpdateDealerLenderRate = () => {\n const [createOrUpdateDealerLenderRate] = useMutation<\n DealerLenderRateData,\n DealerLenderRateVariables\n >(CREATE_OR_UPDATE_DEALER_LENDER_RATE);\n return createOrUpdateDealerLenderRate;\n};\n\nexport default useCreateOrUpdateDealerLenderRate;\n","import moment from \"moment\";\nimport * as Yup from \"yup\";\nimport { LenderRatesForDealers } from \"../types\";\n\nconst lenderRateValidationSchema = Yup.object().shape({\n id: Yup.number().default(undefined).nullable(true),\n dealerId: Yup.number().label(\"Dealer id\").default(undefined),\n lenderId: Yup.number()\n .label(\"Lender id\")\n .default(undefined)\n .required(\"Lender is required\"),\n dateFrom: Yup.date()\n .label(\"Valid from\")\n .nullable(true)\n .required(\"Date is required\")\n .default(moment().format(\"YYYY-MM-DD\")),\n dateTo: Yup.date()\n .label(\"Expires on\")\n .nullable(true)\n .default(null)\n .test(\n \"date-to-validation\",\n \"Expiration date must be greater than start date\",\n function (value) {\n if (value === null) {\n return true;\n } else {\n return !!value && !!this.parent && this.parent.dateFrom < value;\n }\n }\n ),\n rate: Yup.number()\n .label(\"Rate APR\")\n .nullable(true)\n .min(0)\n .required(\"Rate is required\")\n .default(undefined)\n .typeError(\"Rate must be a number\"),\n});\n\nexport default lenderRateValidationSchema;\n","import { Field } from \"formik\";\nimport { defaults } from \"lodash\";\nimport * as React from \"react\";\nimport { useEffect, useState } from \"react\";\nimport { Col, FormGroup, Label, Row } from \"reactstrap\";\nimport { cleanFormData } from \"../../../utils\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport ModalForm from \"../../Forms/ModalForm\";\nimport SelectField from \"../../Forms/SelectField\";\nimport DateSelectRow from \"../../Proposals/ProposalForm/DateSelectRow\";\nimport DealerSelect from \"../DealerSelect\";\nimport { LenderRatesForDealers } from \"../types\";\nimport useCreateOrUpdateDealerLenderRate from \"./CreateOrUpdateDealerLenderRateMutation\";\nimport {\n DEALER_LENDER_RATES_LIST,\n useDealerLenderRate,\n} from \"./DealerLenderRatesQuery\";\nimport lenderRateValidationSchema from \"./LenderRateValidationSchema\";\nimport LendersListQuery from \"./LendersListQuery\";\nimport RadioButtonsField from \"../../Forms/RadioButtonsField\";\n\ninterface CreateOrUpdateLenderRateModalProps {\n display: boolean;\n dealerId: number;\n id?: number;\n toggle: () => void;\n}\n\nconst CreateOrUpdateLenderRateModal = ({\n display,\n dealerId,\n id,\n toggle,\n}: CreateOrUpdateLenderRateModalProps) => {\n const { loading, lenderRate } = useDealerLenderRate(id);\n const mutation = useCreateOrUpdateDealerLenderRate();\n\n const expDate = lenderRate?.dateTo;\n const [rateDoesNotExpire, setRateDoesNotExpire] = useState(!expDate);\n const toggleRateExpState = () => {\n setRateDoesNotExpire(!rateDoesNotExpire);\n };\n\n useEffect(() => {\n if (!loading) {\n setRateDoesNotExpire(!expDate);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [loading, id]);\n\n return (\n <>\n {!loading && (\n {\n toggle();\n delete rawValues.lender;\n const values = cleanFormData(rawValues);\n return mutation({\n variables: { input: { ...values, id } },\n refetchQueries: [\n {\n query: DEALER_LENDER_RATES_LIST,\n variables: {\n dealerId,\n input: { page: 1, pageSize: 10, dealerId },\n },\n },\n {\n query: DEALER_LENDER_RATES_LIST,\n variables: {\n dealerId,\n input: { page: 2, pageSize: 10, dealerId },\n },\n },\n ],\n });\n }}\n >\n {(formikProps) => (\n <>\n \n \n \n \n {\n formikProps.setFieldValue(\"dealerId\", dealerId);\n }}\n />\n \n \n \n \n \n {({ data }) => {\n const lendersListOptions =\n data && data.lendersList\n ? data.lendersList.map((l) => ({\n label: l.name,\n value: l.id,\n }))\n : [];\n return (\n \n );\n }}\n \n \n \n \n \n \n \n \n \n {\n formikProps.setFieldValue(\"commission\", 0);\n formikProps.setFieldTouched(\"commission\", true);\n }}\n />\n \n \n \n \n \n \n \n \n
\n {\n toggleRateExpState();\n formikProps.setFieldValue(\"dateTo\", null);\n }}\n />\n \n Rate does not expire\n \n
\n
\n {!rateDoesNotExpire ? (\n \n \n \n \n \n \n ) : null}\n \n )}\n \n )}\n \n );\n};\n\nexport default CreateOrUpdateLenderRateModal;\n","import * as React from \"react\";\nimport { ContextNames } from \"../../types\";\nimport {\n DEALER_LENDER_RATES_LIST,\n LenderRatesForDealersData,\n} from \"./DealerLenderRatesQuery\";\nimport DealerLenderListItem from \"./DealerLenderListItem\";\nimport SearchForm from \"../../Forms/SearchForm\";\nimport { LenderRatesForDealersSearchArgs } from \"../types\";\nimport { FormikProps } from \"formik\";\nimport PagedList from \"../../PagedList\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport { Button } from \"reactstrap\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { useState } from \"react\";\nimport CreateOrUpdateLenderRateModal from \"./CreateOrUpdateLenderRateModal\";\n\ninterface DealerLenderListState {\n showLenderRateModal: boolean;\n selectedLenderRateId?: number;\n}\n\ninterface DealerLenderListProps {\n context?: ContextNames;\n dealerId: number;\n}\n\nconst defaultSearchArgs = {\n page: 1,\n pageSize: 10,\n};\n\nconst DealerLenderList = (props: DealerLenderListProps) => {\n const [modalState, setModalState] = useState({\n showLenderRateModal: false,\n selectedLenderRateId: undefined,\n });\n\n const { showLenderRateModal, selectedLenderRateId } = modalState;\n const { context, dealerId } = props;\n const { loggedInUser, checkCanCreate } = useLoggedInUser();\n\n const toggleLenderRateModal = () =>\n setModalState({\n showLenderRateModal: !showLenderRateModal,\n selectedLenderRateId: showLenderRateModal\n ? undefined\n : selectedLenderRateId,\n });\n\n if (!loggedInUser) {\n return null;\n }\n\n return (\n <>\n qs}\n mapValuesToQuerystring={(values) => values}\n defaultValues={defaultSearchArgs}\n fixedValues={{ dealerId }}\n >\n {(formikProps: FormikProps) => (\n \n data && data.lenderRatesForDealers\n }\n actionButtonsComponent={() =>\n checkCanCreate(PermissionModuleNames.Lenders) ? (\n \n New rate\n \n ) : null\n }\n listItemComponent={({ item }) => {\n return (\n \n setModalState({\n showLenderRateModal: true,\n selectedLenderRateId: rates.id,\n })\n }\n />\n );\n }}\n />\n )}\n \n \n \n );\n};\n\nexport default DealerLenderList;\n","import * as React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport { ContextNames } from \"../../types\";\nimport DealerLenderList from \"../DealerLenderList\";\nimport { useLoggedInDealer } from \"../DealerQuery\";\n\nconst DealerLendersTabContent = ({\n match,\n}: RouteComponentProps<{ dealerId: string; tab: string }>) => {\n const id = parseInt(match.params.dealerId, 10);\n\n return ;\n};\n\nexport const UserDealerLendersTabContent = () => {\n const { dealer, loading } = useLoggedInDealer();\n\n if (loading || !dealer) {\n return ;\n }\n\n return (\n \n );\n};\n\nexport default DealerLendersTabContent;\n","import * as Yup from \"yup\";\nimport { AgreePricing } from \"../types\";\n\nconst AgreePricingValidationSchema = Yup.object().shape({\n dealerId: Yup.number().default(undefined).required(),\n pricingAgreedBy: Yup.string()\n .label(\"This\")\n .nullable(true)\n .default(undefined)\n .required(),\n});\n\nexport default AgreePricingValidationSchema;\n","import { Field, Formik } from \"formik\";\nimport gql from \"graphql-tag\";\nimport { defaults } from \"lodash\";\nimport * as React from \"react\";\nimport { useMutation } from \"react-apollo\";\nimport { RouteComponentProps, withRouter } from \"react-router\";\nimport {\n Button,\n Form,\n Modal,\n ModalBody,\n ModalFooter,\n ModalHeader,\n Row,\n} from \"reactstrap\";\nimport { getFullName } from \"../../../utils\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { GET_DEALER } from \"../DealerQuery\";\nimport { DealerFragment } from \"../fragments\";\nimport agreePricingValidationSchema from \"./agreePricingValidationSchema\";\n\nconst AGREE_PRICING = gql`\n mutation AgreePricing($input: AgreePricingInput) {\n agreePricing(input: $input) {\n ...DealerFragment\n }\n }\n ${DealerFragment}\n`;\n\ninterface AgreePricingModal {\n display: boolean;\n toggle: () => void;\n}\n\nconst AgreePricingModal = ({\n display,\n toggle,\n match,\n}: AgreePricingModal & RouteComponentProps<{ dealerId: string }>) => {\n const [AgreePricing] = useMutation(AGREE_PRICING);\n const dealerId = parseInt(match.params.dealerId, 10);\n const { loggedInUser } = useLoggedInUser();\n const userName = loggedInUser\n ? getFullName(loggedInUser) || loggedInUser?.username\n : \"\";\n\n return (\n \n {\n AgreePricing({\n variables: { input },\n refetchQueries: [\n {\n query: GET_DEALER,\n variables: {\n dealerId,\n },\n },\n ],\n });\n\n toggle();\n }}\n validateOnChange={true}\n initialValues={defaults(\n { dealerId, pricingAgreedBy: userName },\n agreePricingValidationSchema.default()\n )}\n validationSchema={agreePricingValidationSchema}\n >\n {(formikProps) => (\n
\n Agree pricing\n \n \n \n \n \n \n \n \n \n
\n )}\n \n
\n );\n};\n\nexport default withRouter(AgreePricingModal);\n","import * as Yup from \"yup\";\nimport { IComplianceApproval } from \"../types\";\n\nconst approveComplianceValidationSchema =\n Yup.object().shape({\n dealerId: Yup.number().default(undefined).required(),\n complianceApprovedBy: Yup.string()\n .label(\"This\")\n .nullable(true)\n .default(undefined)\n .required(),\n });\n\nexport default approveComplianceValidationSchema;\n","import { Field, Formik } from \"formik\";\nimport gql from \"graphql-tag\";\nimport { defaults } from \"lodash\";\nimport * as React from \"react\";\nimport { useMutation } from \"react-apollo\";\nimport { RouteComponentProps, withRouter } from \"react-router\";\nimport {\n Button,\n Form,\n Modal,\n ModalBody,\n ModalFooter,\n ModalHeader,\n Row,\n} from \"reactstrap\";\nimport { getFullName } from \"../../../utils\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { GET_DEALER } from \"../DealerQuery\";\nimport { DealerFragment } from \"../fragments\";\nimport approveComplianceValidationSchema from \"./approveComplianceValidationSchema\";\n\nconst COMPLIANCE_APPROVAL = gql`\n mutation ComplianceApproval($input: ApproveComplianceInput) {\n approveCompliance(input: $input) {\n ...DealerFragment\n }\n }\n ${DealerFragment}\n`;\n\ninterface ApproveComplianceModal {\n display: boolean;\n toggle: () => void;\n}\n\nconst ApproveComplianceModal = ({\n display,\n toggle,\n match,\n}: ApproveComplianceModal & RouteComponentProps<{ dealerId: string }>) => {\n const [ComplianceApproval] = useMutation(COMPLIANCE_APPROVAL);\n const dealerId = parseInt(match.params.dealerId, 10);\n const { loggedInUser } = useLoggedInUser();\n const userName = loggedInUser\n ? getFullName(loggedInUser) || loggedInUser?.username\n : \"\";\n\n return (\n \n {\n ComplianceApproval({\n variables: { input },\n refetchQueries: [\n {\n query: GET_DEALER,\n variables: {\n dealerId,\n },\n },\n ],\n });\n\n toggle();\n }}\n validateOnChange={true}\n initialValues={defaults(\n { dealerId, complianceApprovedBy: userName },\n approveComplianceValidationSchema.default()\n )}\n validationSchema={approveComplianceValidationSchema}\n >\n {(formikProps) => (\n
\n Compliance approval\n \n \n \n \n \n \n \n \n \n
\n )}\n \n
\n );\n};\n\nexport default withRouter(ApproveComplianceModal);\n","import React from \"react\";\nimport { DealerDocType, DealerEsignature } from \"../types\";\nimport { useDealerEsignature } from \"./DraftDealerQuery\";\nimport { Alert } from \"reactstrap\";\nimport moment from \"moment\";\n\nconst EsignatureSummary = ({\n docTitle,\n docType,\n dealerId,\n}: {\n docTitle: string;\n docType: DealerDocType;\n dealerId: number;\n}) => {\n const [state, setState] = React.useState<{\n existingChecked: boolean;\n existingDealerEsignature?: DealerEsignature;\n }>({\n existingChecked: false,\n existingDealerEsignature: undefined,\n });\n let useDE: any = null;\n\n useDE = useDealerEsignature(dealerId, docType);\n if (!state.existingChecked && !useDE?.loading && useDE?.dealerEsignature) {\n setState((s) => ({\n ...s,\n existingChecked: true,\n existingDealerEsignature: useDE.dealerEsignature.dealerEsignature,\n }));\n }\n\n return (\n <>\n {state.existingDealerEsignature && (\n \n {docTitle} document was signed by{\" \"}\n {state.existingDealerEsignature?.forename}{\" \"}\n {state.existingDealerEsignature?.surname} (\n {state.existingDealerEsignature?.username}) from IP address{\" \"}\n {state.existingDealerEsignature?.remoteAddr} on{\" \"}\n {moment(state.existingDealerEsignature?.confirmed).format(\n \"Do MMMM YYYY, H:mma\"\n )}\n \n )}\n \n );\n};\n\nexport default EsignatureSummary;\n","import React, { useState } from \"react\";\nimport { Col, Row } from \"reactstrap\";\nimport { DealerProofDocument, DealerProofResponse } from \"../types\";\nimport config from \"../../../config\";\nimport axios from \"axios\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport FileDownloadLink from \"../../FileDownloadLink\";\n\nconst sortByDocumentProof = (a: DealerProofDocument, b: DealerProofDocument) =>\n a.metadata?.Proof > b.metadata?.Proof ? 1 : -1;\n\nconst sortByDocumentTitle = (a: DealerProofDocument, b: DealerProofDocument) =>\n a.title.toUpperCase() < b.title.toUpperCase() ? 1 : -1;\n\nexport const DealerEsignContent = ({ storageRef }: { storageRef?: string }) => {\n const [state, setState] = useState<{\n proofsLoaded: boolean;\n proofEnough: boolean;\n proofs?: any;\n }>({\n proofsLoaded: false,\n proofEnough: false,\n proofs: null,\n });\n let loadingProofs = false;\n\n const getFileSummaryInfo = (proofref: any) => {\n loadingProofs = true;\n return axios\n .get(\n `${config.API_URL}/api/dealersetup/esign/${encodeURIComponent(\n proofref\n )}`,\n { headers: { \"Cache-Control\": \"no-cache\" } }\n )\n .then((r: any) => {\n // console.info(\"got: \", JSON.stringify(r));\n let dp = r?.data as DealerProofResponse;\n if (dp && dp.documents) {\n dp.documents.sort(sortByDocumentTitle).sort(sortByDocumentProof);\n }\n\n setState((s) => ({\n ...s,\n proofs: dp,\n proofsLoaded: true,\n }));\n loadingProofs = false;\n })\n .catch((error: any) => {\n // tslint:disable-next-line:no-console\n console.error(\"Error in getFileSummaryInfo\", error);\n loadingProofs = false;\n });\n };\n\n if (!state.proofsLoaded) {\n getFileSummaryInfo(storageRef);\n }\n\n return true ? (\n <>\n \n {loadingProofs && (\n \n \n \n )}\n \n\n {(state.proofs as DealerProofResponse)?.documents?.map(\n (el: any, index: number) => (\n \n \n \n {el.title}\n \n \n \n )\n )}\n \n ) : null;\n};\n","import * as React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport { useDealer, useLoggedInDealer } from \"../DealerQuery\";\nimport { DealerDocType, DealerDocTypeTitle } from \"../types\";\nimport EsignatureSummary from \"../DraftDealers/EsignatureSummary\";\nimport { DealerEsignContent } from \"../DraftDealers/DealerEsignContent\";\n\nconst DealerEsignatureTabContent = ({\n match,\n}: RouteComponentProps<{ dealerId: string; tab: string }>) => {\n const id = parseInt(match.params.dealerId, 10);\n const { dealer, loading } = useDealer(id);\n\n if (loading || !dealer) {\n return ;\n }\n\n return (\n <>\n \n \n
\n \n \n );\n};\n\nexport const UserDealerEsignatureTabContent = () => {\n const { dealer, loading } = useLoggedInDealer();\n\n if (loading || !dealer) {\n return ;\n }\n\n return (\n <>\n \n \n
\n \n \n );\n};\n\nexport default DealerEsignatureTabContent;\n","import * as React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport { useDealer } from \"../DealerQuery\";\nimport { DealerProofsContent } from \"../DraftDealers/DealerProofsContent\";\n\nconst DealerProofsTabContent = ({\n match,\n}: RouteComponentProps<{ dealerId: string; tab: string }>) => {\n const id = parseInt(match.params.dealerId, 10);\n const { dealer, loading } = useDealer(id);\n\n if (loading) {\n return ;\n }\n\n if (!dealer) {\n return null;\n }\n\n return (\n <>\n \n \n );\n};\n\nexport default DealerProofsTabContent;\n","import {\n faBan,\n faCheck,\n faExternalLinkAlt,\n faFileContract,\n faFileExcel,\n faPiggyBank,\n faSpinner,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport axios from \"axios\";\nimport React, { useState } from \"react\";\nimport { useApolloClient, withApollo } from \"react-apollo\";\nimport Helmet from \"react-helmet\";\nimport { Redirect, Route, RouteComponentProps, Switch } from \"react-router\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport { Alert, Button, Container } from \"reactstrap\";\nimport config from \"../../../config\";\nimport { addHttp, getSingleLineAddress } from \"../../../utils\";\nimport AccountManagerActivityTabContent from \"../../AccountManagers/AccountManagerActivities/AccountManagerActivityTabContent\";\nimport Breadcrumbs from \"../../Breadcrumbs\";\nimport FileDownloadLink from \"../../FileDownloadLink\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport {\n PermissionActivityNames,\n PermissionModuleNames,\n} from \"../../Permissions/types\";\nimport { PROPOSAL_DEALER_COMMISSION_LIST } from \"../../Proposals/ProposalDealerCommissionList/ProposalDealerCommissionListQuery\";\nimport { PROPOSAL_LIST } from \"../../Proposals/ProposalList/ProposalListQuery\";\nimport { ProposalSearchDate } from \"../../Proposals/types\";\nimport SceneLoadingSpinner from \"../../SceneLoadingSpinner\";\nimport AutoConvertLogo from \"../../shared/AutoConvertLogo.svg\";\nimport TabContentContainer from \"../../Tabs/TabContentContainer\";\nimport { ContextNames } from \"../../types\";\nimport AddDealerToAutoConvertMutation from \"../AddDealerToAutoConvertMutation\";\nimport ApproveDealerModal from \"../ApproveDealer/ApproveDealerModal\";\nimport DealerBadges from \"../DealerBadges\";\nimport { DEALER_CONTACT_LIST } from \"../DealerContactList/DealerContactListQuery\";\nimport {\n GET_DEALER_AND_QUESTIONNAIRE,\n useDealer,\n useLoggedInDealer,\n} from \"../DealerQuery\";\nimport SuspendDealerModal from \"../SuspendDealerModal\";\nimport BonafideeModal from \"../BonafideeModal\";\nimport { Dealer } from \"../types\";\nimport DealerCommissionTabContent, {\n UserDealerCommissionTabContent,\n} from \"./DealerCommissionTabContent\";\nimport DealerContactsTabContent from \"./DealerContactsTabContent\";\nimport DealerDetailsTabContent, {\n UserDealerDetailsTabContent,\n} from \"./DealerDetailsTabContent\";\nimport DealerOverviewTabContent, {\n UserDealerOverviewTabContent,\n} from \"./DealerOverviewTabContent\";\nimport DealerProposalsTabContent from \"./DealerProposalsTabContent\";\nimport DealerQuotationsTabContent from \"./DealerQuotationsTabContent\";\nimport DealerTabHeaders from \"./DealerTabHeaders\";\nimport DealerUsersTabContent from \"./DealerUsersTabContent\";\nimport DealerLendersTabContent, {\n UserDealerLendersTabContent,\n} from \"./DealerLendersTabContent\";\nimport \"./index.scss\";\nimport AgreePricingModal from \"../AgreePricing/AgreePricingModal\";\nimport ApproveComplianceModal from \"../ApproveCompliance/approveComplianceModal\";\nimport DealerEsignatureTabContent, {\n UserDealerEsignatureTabContent,\n} from \"./DealerEsignatureTabContent\";\nimport DealerProofsTabContent from \"./DealerProofsTabContent\";\nimport {\n NeedsPricingAgreed,\n NeedsComplianceApproved,\n NeedsSearchConsent,\n NeedsDealerSigned,\n} from \"../dealerSetup\";\n\nconst DealerSceneInner = ({ dealer, url }: { dealer: Dealer; url: string }) => {\n const [showApproveModal, setShowApproveModal] = useState(false);\n const toggleApproveModal = () => setShowApproveModal(!showApproveModal);\n\n const [showApproveComplianceModal, setShowApproveComplianceModal] =\n useState(false);\n const toggleApproveComplianceModal = () =>\n setShowApproveComplianceModal(!showApproveComplianceModal);\n\n const [showAgreePricingModal, setShowAgreePricingModal] = useState(false);\n const toggleAgreePricingModal = () =>\n setShowAgreePricingModal(!showAgreePricingModal);\n\n const [showSuspendModal, setShowSuspendModal] = useState(false);\n const toggleSuspendModal = () => setShowSuspendModal(!showSuspendModal);\n\n const [showBonafideeModal, setShowBonafideeModal] = useState(false);\n const toggleBonafideeModal = () => setShowBonafideeModal(!showBonafideeModal);\n\n const [showAlert, setShowAlert] = useState(false);\n const toggleAlert = () => setShowAlert(!showAlert);\n\n const [isLoading, setIsLoading] = useState(false);\n\n const {\n isAdministrator,\n isDealer,\n isAccountManager,\n isCaseManagementTeam,\n isRegionalSalesManager,\n isSeniorManager,\n checkIsAuthorized,\n } = useLoggedInUser();\n\n usePreloadedData(parseInt(dealer.id as any, 10));\n\n const breadcrumbs = isDealer\n ? [\n { to: \"/\", title: \"Home\" },\n { to: \"/dealer\", title: dealer.name, active: true },\n ]\n : [\n { to: \"/\", title: \"Home\" },\n { to: \"/dealers\", title: \"Dealers\" },\n { to: `/dealers/${dealer.id}`, title: dealer.name, active: true },\n ];\n\n return (\n <>\n \n \n \n

\n Dealer - {dealer.name}\n

\n
\n

{getSingleLineAddress(dealer.address)}

\n {dealer.url ? (\n

\n \n {dealer.url}{\" \"}\n \n \n \n \n

\n ) : null}\n {!isDealer && !isAccountManager && dealer.accountManager && (\n

\n Account manager:{\" \"}\n \n {dealer.accountManager.name}\n \n

\n )}\n
\n\n \n\n {checkIsAuthorized(\n PermissionModuleNames.Dealers,\n PermissionActivityNames.UpdateInternal\n ) && (\n
\n \n \n Dealer setup\n \n\n {!dealer.autoConvert && (\n \n {(mutation) => (\n {\n mutation({ variables: { id: dealer.id } });\n }}\n >\n \n Add to {config.AUTOCONVERT_NAME}\n \n )}\n \n )}\n\n {!dealer.contractSigned ? (\n <>\n {false && (\n setShowApproveModal(!showApproveModal)}\n outline={true}\n color=\"secondary\"\n >\n Approve\n \n )}\n \n ) : (\n setShowSuspendModal(!showSuspendModal)}\n outline={true}\n color=\"secondary\"\n >\n {!dealer.isSuspended ? (\n <>\n Suspend\n \n ) : (\n <>\n Unsuspend\n \n )}\n \n )}\n
\n )}\n
\n {dealer.autoConvert && !isDealer && (\n <>\n \n \n Contact Dealer in {config.AUTOCONVERT_NAME}\n \n {!isCaseManagementTeam ? (\n dealer.bonafidee && dealer.bonafidee.status === 10 ? (\n \n SharepointLink\n \n ) : (\n <>\n {false && (\n {\n setIsLoading(true);\n handleSubmit(dealer, toggleAlert).finally(\n () => {\n setIsLoading(false);\n }\n );\n }\n : () => setShowBonafideeModal(true)\n }\n disabled={isLoading || dealer.bonafidee?.status === 0}\n >\n {isLoading ? (\n \n ) : (\n \n )}{\" \"}\n {dealer.bonafidee?.status === 0\n ? \"Dealer T&C's in progress\"\n : \"Dealer T&C's E-Sign\"}\n \n )}\n\n {false && showAlert && (\n setShowAlert(false)}\n >\n Your request has been sent successfully\n \n )}\n \n )\n ) : null}\n \n )}\n {(isRegionalSalesManager || isSeniorManager || isAdministrator) &&\n NeedsPricingAgreed(dealer) && (\n setShowAgreePricingModal(!showAgreePricingModal)}\n outline={true}\n color=\"secondary\"\n >\n Agree Pricing\n \n )}\n {(isSeniorManager || isAdministrator) &&\n NeedsComplianceApproved(dealer) && (\n \n setShowApproveComplianceModal(!showApproveComplianceModal)\n }\n outline={true}\n color=\"secondary\"\n >\n Compliance Approval\n \n )}\n
\n\n {isDealer && NeedsSearchConsent(dealer) && (\n \n )}\n\n {isDealer && NeedsDealerSigned(dealer) && (\n \n )}\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nconst usePreloadedData = (dealerId: number) => {\n const client = useApolloClient();\n const {\n checkIsAuthorized,\n checkCanRead,\n loading: userLoading,\n } = useLoggedInUser();\n\n React.useEffect(() => {\n if (\n !userLoading &&\n checkIsAuthorized(\n PermissionModuleNames.Dealers,\n PermissionActivityNames.ReadInternal\n )\n ) {\n client.query({\n query: GET_DEALER_AND_QUESTIONNAIRE,\n variables: {\n dealerId,\n },\n });\n }\n\n if (checkCanRead(PermissionModuleNames.Dealers)) {\n // Preload proposals\n client.query({\n query: PROPOSAL_LIST,\n variables: {\n input: {\n page: 1,\n pageSize: 10,\n status: [],\n fundedDealersOnly: false,\n hasDebitBackOnly: false,\n statisticsFilterByDate: true,\n filterByDate: ProposalSearchDate.PAID_OUT_DATE,\n dealerId,\n },\n },\n });\n }\n\n // Preload commissions\n client.query({\n query: PROPOSAL_DEALER_COMMISSION_LIST,\n variables: {\n dealerId,\n input: {\n page: 1,\n pageSize: 20,\n q: \"\",\n dealerId,\n fundedDealersOnly: false,\n },\n },\n });\n\n if (checkCanRead(PermissionModuleNames.DealerContacts)) {\n // Preload contacts\n client.query({\n query: DEALER_CONTACT_LIST,\n variables: {\n dealerId,\n input: {\n page: 1,\n pageSize: 10,\n q: \"\",\n dealerId,\n },\n },\n });\n }\n });\n};\n\nconst DealerScene = ({ match }: RouteComponentProps<{ dealerId: string }>) => {\n const dealerId = parseInt(match.params.dealerId, 10);\n\n const { dealer, loading } = useDealer(dealerId);\n\n if (loading || !dealer) {\n return ;\n }\n\n return ;\n};\n\nexport const handleSubmit = (dealer: Dealer, toggleAlert: () => void) => {\n return axios\n .post(`${config.API_URL}/api/esignature/dealerConfirmation/${dealer.id}`, {\n headers: { \"Cache-Control\": \"no-cache\" },\n })\n .then((r) => {\n if (r.status === 200) {\n toggleAlert();\n }\n })\n .catch((error) => {\n let message = error.message;\n return message;\n });\n};\n\nexport const UserDealerScene = ({ match }: RouteComponentProps) => {\n const { dealer, loading } = useLoggedInDealer();\n const client = useApolloClient();\n\n React.useEffect(() => {\n if (dealer) {\n client.query({\n query: PROPOSAL_DEALER_COMMISSION_LIST,\n variables: {\n dealerId: dealer.id,\n input: {\n page: 1,\n pageSize: 20,\n q: \"\",\n dealerId: dealer.id,\n fundedDealersOnly: false,\n },\n },\n });\n }\n });\n\n if (loading || !dealer) {\n return ;\n }\n\n return ;\n};\n\nexport default withApollo>(\n DealerScene\n);\n","import { UserDealerScene } from \"./index\";\n\nexport default UserDealerScene;\n","import * as React from \"react\";\nimport { Alert, Container } from \"reactstrap\";\nimport moment from \"moment\";\nimport Breadcrumbs from \"../../Breadcrumbs\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { EsignDocumentViewer } from \"./EsignDocumentViewer\";\nimport config from \"../../../config\";\nimport { useLoggedInDealer } from \"../DealerQuery\";\nimport { useDealerEsignature } from \"./DraftDealerQuery\";\nimport { DealerDocType, DealerEsignature } from \"../types\";\n\nconst SearchConsentBreadcrumbs = () => {\n const { dealer } = useLoggedInDealer();\n const breadcrumbs = [\n {\n to: \"/\",\n title: \"Home\",\n },\n { to: \"/dealer\", title: dealer?.name || \"\", active: true },\n ];\n\n return ;\n};\n\nconst SearchConsentScene = () => {\n const docTitle = \"Search Consent\";\n const [state, setState] = React.useState<{\n existingChecked: boolean;\n existingDealerEsignature?: DealerEsignature;\n }>({\n existingChecked: false,\n existingDealerEsignature: undefined,\n });\n\n const { checkIsAuthorized, isDealer } = useLoggedInUser();\n const { dealer } = useLoggedInDealer();\n let useDE: any = null;\n useDE = useDealerEsignature(dealer?.id, DealerDocType.SEARCH_CONSENT);\n\n if (!checkIsAuthorized) {\n return null;\n } else {\n if (!state.existingChecked && !useDE?.loading && useDE?.dealerEsignature) {\n setState((s) => ({\n ...s,\n existingChecked: true,\n existingDealerEsignature: useDE.dealerEsignature.dealerEsignature,\n }));\n }\n }\n\n const sharedUrl = `${\n config.API_URL\n }/api/dealersetup/searchconsent/esign/${encodeURIComponent(\n dealer?.id || \"\"\n )}`;\n\n return (\n \n \n\n {!isDealer ? (\n \n Nothing to see here!\n \n ) : (\n <>\n

{docTitle}

\n\n {state.existingChecked && (\n <>\n {state.existingDealerEsignature ? (\n <>\n \n {docTitle} document was signed by{\" \"}\n {state.existingDealerEsignature?.forename}{\" \"}\n {state.existingDealerEsignature?.surname} (\n {state.existingDealerEsignature?.username}) from IP address{\" \"}\n {state.existingDealerEsignature?.remoteAddr} on{\" \"}\n {moment(state.existingDealerEsignature?.confirmed).format(\n \"Do MMMM YYYY, H:mma\"\n )}\n \n \n ) : (\n <>\n \n \n )}\n \n )}\n \n )}\n
\n );\n};\n\nexport default SearchConsentScene;\n","import * as React from \"react\";\nimport { Alert, Container } from \"reactstrap\";\nimport moment from \"moment\";\nimport Breadcrumbs from \"../../Breadcrumbs\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { EsignDocumentViewer } from \"./EsignDocumentViewer\";\nimport config from \"../../../config\";\nimport { useLoggedInDealer } from \"../DealerQuery\";\nimport { useDealerEsignature } from \"./DraftDealerQuery\";\nimport { DealerDocType, DealerEsignature } from \"../types\";\n\nconst TermsAndConditionsBreadcrumbs = () => {\n const { dealer } = useLoggedInDealer();\n const breadcrumbs = [\n {\n to: \"/\",\n title: \"Home\",\n },\n { to: \"/dealer\", title: dealer?.name || \"\", active: true },\n ];\n\n return ;\n};\n\nconst TermsAndConditionsScene = () => {\n const docTitle = \"Terms & Conditions\";\n const [state, setState] = React.useState<{\n existingChecked: boolean;\n existingDealerEsignature?: DealerEsignature;\n }>({\n existingChecked: false,\n existingDealerEsignature: undefined,\n });\n\n const { checkIsAuthorized, isDealer } = useLoggedInUser();\n const { dealer } = useLoggedInDealer();\n let useDE: any = null;\n useDE = useDealerEsignature(dealer?.id, DealerDocType.TERMS_AND_CONDITIONS);\n\n if (!checkIsAuthorized) {\n return null;\n } else {\n if (!state.existingChecked && !useDE.loading && useDE.dealerEsignature) {\n setState((s) => ({\n ...s,\n existingChecked: true,\n existingDealerEsignature: useDE.dealerEsignature.dealerEsignature,\n }));\n }\n }\n\n const sharedUrl = `${\n config.API_URL\n }/api/dealersetup/termsandconditions/esign/${encodeURIComponent(\n dealer?.id || \"\"\n )}`;\n\n return (\n \n \n\n {!isDealer ? (\n \n Nothing to see here!\n \n ) : (\n <>\n

{docTitle}

\n\n {state.existingChecked && (\n <>\n {state.existingDealerEsignature ? (\n <>\n \n {docTitle} document was signed by{\" \"}\n {state.existingDealerEsignature?.forename}{\" \"}\n {state.existingDealerEsignature?.surname} (\n {state.existingDealerEsignature?.username}) from IP address{\" \"}\n {state.existingDealerEsignature?.remoteAddr} on{\" \"}\n {moment(state.existingDealerEsignature?.confirmed).format(\n \"Do MMMM YYYY, H:mma\"\n )}\n \n \n ) : (\n <>\n \n \n )}\n \n )}\n \n )}\n
\n );\n};\n\nexport default TermsAndConditionsScene;\n","import * as React from \"react\";\nimport { Route, Switch } from \"react-router-dom\";\nimport CreateProposalScene from \"../Proposals/CreateProposalScene\";\nimport CreateProposalTypeScene from \"../Proposals/CreateProposalTypeScene\";\nimport DraftProposalListScene from \"../Proposals/DraftProposals/DraftProposalListScene\";\nimport CreateQuotationScene from \"../Quotations/CreateQuotationScene\";\nimport SceneLoadingSpinner from \"../SceneLoadingSpinner\";\nimport CreateDealerScene, {\n CreateDealerNoQuestionnaireScene,\n} from \"./CreateDealerScene\";\nimport DealerListScene from \"./DealerListScene\";\nimport DealerScene from \"./DealerScene\";\nimport UserDealerScene from \"./DealerScene/UserDealerScene\";\nimport DraftDealerListScene from \"./DraftDealers/DraftDealerListScene\";\nimport SearchConsentScene from \"./DraftDealers/SearchConsentScene\";\nimport TermsAndConditionsScene from \"./DraftDealers/TermsAndConditionsScene\";\n\nconst DealerMapScene = React.lazy(() => import(\"./DealerMapScene\"));\n\nconst DealerRouter = () => {\n return (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default DealerRouter;\n"],"sourceRoot":""}