{"version":3,"sources":["components/Forms/ModalForm.tsx","components/Settings/Users/UserListQuery.tsx","components/CustomDatePicker.tsx","components/shared/PeriodPicker.tsx","components/RegionalSalesManagers/RegionalSalesManagerQuery.tsx","components/Settings/Users/userProfileValidationSchema.ts","components/Dealers/DealerContactList/DealerContactListQuery.tsx","components/RegionalSalesManagers/RegionalSalesManagerSelect.tsx","components/Settings/Users/CreateUserMutation.tsx","components/Settings/Users/CreateUserModal.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/Settings/Users/CreateUserForm.tsx","components/RegionalSalesManagers/RegionalSalesManagerListQuery.tsx","components/Forms/EditForm.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","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","DEALER_CONTACT_LIST","DealerContactFragment","DEALER_CONTACT_QUERY","DealerContactQuery","dealerContact","useDealerContact","RegionalSalesManagerSelect","state","onSelectRegionalSalesManager","autoFocus","isClearable","isDisabled","userData","q","length","options","regionalSalesManagers","edges","node","name","selectedOption","inputValue","onInputChange","setState","filterOption","noOptionsMessage","CREATE_USER","UserFragment","CreateUser","mutation","withRouter","display","dealerContactId","fixedRole","history","Modal","CreateUserMutation","CreateUserForm","defaults","payload","cleanFormData","refetchQueries","page","pageSize","includeSuspended","createUser","user","push","ModalHeader","ContextNames","ACCOUNT_MANAGER","ModalBody","CreateUserFormInner","ModalFooter","Button","GET_USER","GET_USER_SHALLOW","useUser","useUserShallow","UserQuery","loggedInUser","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","Object","keys","k","formatEnumValue","RegionalSalesManagerField","field","form","FormGroupWrapper","title","rsmId","setFieldTouched","setFieldValue","narrowCol","wideCol","isDealer","isAccountManager","isRegionalSalesManager","FormikEffects","prev","current","clearField","f","forEach","Row","Col","lg","FormGroup","Label","Input","readOnly","FormFieldWrapper","colSize","option","onBlur","DealerSelect","onSelectDealer","did","component","FormInputField","REGIONAL_SALES_MANAGER","AccountManagerSelect","onSelectAccountManager","amId","RadioField","vertical","userProfile","setTimeout","validateForm","readonly","description","validateOnChange","REGIONAL_SALES_MANAGER_LIST","RegionalSalesManagerListQuery","EditButton","memo","icon","faEdit","SaveChangesButtons","onCancel","isSubmitting","faSpinner","spin","EditForm","Summary","summary","disableEditing","isEditing","setIsEditing","handleStopEditing","useCallback","handleStartEditing","handleFormikSubmit","formValues","WIDE"],"mappings":"wMAyEeA,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,eAAKW,EAAN,CAAmBR,UAASU,SAAUC,IAASC,WAE1D,gBAAC,IAAD,KACE,gBAAC,IAAD,CAAQC,MAAM,YAAYC,SAAS,EAAMC,QAAStB,GAAlD,UAGA,gBAAC,IAAD,CAAQoB,MAAM,UAAUG,KAAK,UAC1BlB,GAAoB,kB,inBClD9B,IAAMmB,EAAYC,IAAH,IAuBlBC,KAmBSC,EAAc,SAACC,GAA2B,IAAD,EAC1BC,YACxBL,EACA,CAAEM,UAAW,CAAEF,WAFTG,EAD4C,EAC5CA,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,UAAU,SAF5D,gBAMA,kBAAC,IAAD,CAAQnB,MAAM,OAAOE,QAASgR,GAA9B,gBA6EKI,IApEE,YAOa,IAN5B7R,EAM2B,EAN3BA,OACAX,EAK2B,EAL3BA,SACSyS,EAIkB,EAJ3BC,QACAxS,EAG2B,EAH3BA,SACAE,EAE2B,EAF3BA,iBACAuS,EAC2B,EAD3BA,eAC2B,EACOxE,oBAAS,GADhB,mBACpByE,EADoB,KACTC,EADS,KAGrBC,EAAoBrM,IAAMsM,aAAY,kBAAMF,GAAa,KAAQ,CACrEA,IAEIG,EAAqBvM,IAAMsM,aAAY,kBAAMF,GAAa,KAAO,CACrEA,IAGII,EAAqBxM,IAAMsM,aAC/B,SAACG,GAAD,OAAwBlT,EAASkT,GAAYtS,KAAKkS,KAClD,CAAC9S,EAAU8S,IAGb,OACE,kBAAC,IAAD,CAAKzQ,UAAU,QACb,kBAAC,IAAD,CAAK8N,GAAI,GACP,kBAAC,IAAD,CAAM9N,UAAU,gBACd,kBAAC,IAAD,MACIsQ,GAAkBC,EAClB,kBAAC,IAAD,CACE3S,cAAeU,EACfX,SAAUiT,EACV7S,iBAAkBA,IAEjB,SAAAS,GAAW,OACV,kBAAC,IAAD,CAAMb,SAAUa,EAAYC,cAC1B,kBAACqR,EAAD,CACEC,SAAUU,EACVT,aAAcxR,EAAYwR,eAE3BnS,EAAS,eAAKW,EAAN,CAAmBE,SAAUC,IAASmS,QAC/C,kBAAChB,EAAD,CACEC,SAAUU,EACVT,aAAcxR,EAAYwR,mBAMlC,qCACIM,GACA,kBAAC,IAAD,KACE,kBAAC,IAAD,CAAKxC,GAAI,IACP,yBAAK9N,UAAU,eACb,kBAAC0P,EAAD,CAAY3Q,QAAS4R,OAK7B,kBAACP,EAAD,CAAS9R,OAAQA","file":"static/js/4.2ae49b15.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 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 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 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 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 { 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 { faEdit, faSpinner } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { Formik, FormikProps } from \"formik\";\nimport React, { useState } from \"react\";\nimport { Button, Card, CardBody, Col, Form, Row } from \"reactstrap\";\nimport { ContextNames, FormSize } from \"../types\";\n\ninterface EditFormProps {\n values: Values;\n onSubmit: (values: Values) => Promise;\n summary: React.ComponentType<{ values: Values }>;\n children: (\n props: FormikProps & { context?: ContextNames; formSize?: FormSize }\n ) => JSX.Element;\n validationSchema: any;\n disableEditing?: boolean;\n context?: ContextNames;\n}\n\nconst EditButton = React.memo(({ onClick }: { onClick: () => void }) => (\n \n));\n\nconst SaveChangesButtons = React.memo(\n ({\n onCancel,\n isSubmitting\n }: {\n onCancel: () => void;\n isSubmitting: boolean;\n }) => (\n \n \n
\n \n \n
\n \n
\n )\n);\n\nconst EditForm = ({\n values,\n onSubmit,\n summary: Summary,\n children,\n validationSchema,\n disableEditing\n}: EditFormProps) => {\n const [isEditing, setIsEditing] = useState(false);\n\n const handleStopEditing = React.useCallback(() => setIsEditing(false), [\n setIsEditing\n ]);\n const handleStartEditing = React.useCallback(() => setIsEditing(true), [\n setIsEditing\n ]);\n\n const handleFormikSubmit = React.useCallback(\n (formValues: Values) => onSubmit(formValues).then(handleStopEditing),\n [onSubmit, handleStopEditing]\n );\n\n return (\n \n \n \n \n {!disableEditing && isEditing ? (\n \n {formikProps => (\n
\n \n {children({ ...formikProps, formSize: FormSize.WIDE })}\n \n \n )}\n \n ) : (\n <>\n {!disableEditing && (\n \n \n
\n \n
\n \n
\n )}\n \n \n )}\n \n \n \n \n );\n};\n\nexport default EditForm;\n"],"sourceRoot":""}