{"version":3,"sources":["reduxStore/cache.ts","shared/userFriendlyErrorMessage/registerErrorMessageConverters.ts","shared/userFriendlyErrorMessage/index.ts","shared/userFriendlyErrorMessage/userFriendlyErrorMessage.ts","shared/useChanges/useChanges.ts","shared/useChanges/index.ts","shared/cacheInRedux/CacheService.ts","shared/cacheInRedux/index.ts","configure/apiAuthorizationConfig.ts","api/api-authorization/AuthorizeService.ts","api/api-authorization/useAuthorizeService.ts","api/api-authorization/useAuthenticatedState.ts","components/layout/UserNav.tsx","components/layout/AppNavbarBrand.tsx","components/layout/Header.tsx","components/layout/Footer.tsx","shared/sidebarNav/SidebarNav.tsx","shared/sidebarNav/SidebarNavTitle.tsx","api/account/AccountService.ts","api/account/ClaimTypes.ts","api/account/useAccountService.ts","shared/useCache/useCache.ts","api/account/useCurrentUserRoles.ts","api/account/useExternalAuthenticationSchemes.ts","api/account/useResendConfirmationEmailCallback.ts","api/account/useStartExternalLoginCallback.ts","shared/authorizeRoute/AuthorizeContainer.tsx","shared/authorizeRoute/AuthorizeRoute.tsx","components/shared/AppRoutes.tsx","components/shared/LoadingIndicator.tsx","components/shared/Background.tsx","components/account/AccountBackground.tsx","components/api-authorization/LoginWaiting.tsx","components/api-authorization/ApiAuthorizationConstants.ts","components/api-authorization/Login.tsx","components/api-authorization/Logout.tsx","components/api-authorization/routes.tsx","shared/alertOnErrors/AlertOnErrors.tsx","components/account/ExternalLoginButton.tsx","components/shared/FormButtons.tsx","components/shared/MainContainer.tsx","components/shared/Banner.tsx","shared/passwordValidation/PasswordOptions.ts","shared/passwordValidation/PasswordValidation.ts","shared/passwordValidation/usePasswordValidation.ts","shared/passwordValidation/generatePasswordRulesDescription.ts","api/main/models/RoleGroup.ts","api/main/models/User.ts","api/main/models/Profile.ts","components/profiles/RegisterProfileDetails.tsx","api/main/profiles/useRegisterProfileCallback.ts","configure/mainApiConfig.ts","components/profiles/ConfirmInviteProfileDetails.tsx","api/main/profiles/useProfileForInvite.ts","components/account/routes.ts","components/account/Login.tsx","api/account/useLoginWithPasswordCallback.ts","components/account/Register.tsx","api/account/useRegisterAccountCallback.ts","components/account/ExternalLoginCallback.tsx","api/account/useCompletedExternalLoginDetails.ts","api/account/useCreateAccountForExternalLoginCallback.ts","components/account/ForgotPassword.tsx","api/account/useSendPasswordResetEmailCallback.ts","components/account/ResetPassword.tsx","api/account/useResetPasswordCallback.ts","components/account/ConfirmEmail.tsx","api/account/useConfirmEmailCallback.ts","components/account/ConfirmEmailChange.tsx","api/account/useConfirmEmailChangeCallback.ts","components/account/ConfirmInvite.tsx","api/account/useConfirmInviteCallback.ts","api/main/profiles/useProfile.ts","shared/useSaveInStore/useSaveInStore.ts","api/main/profiles/useCreateProfileCallback.ts","api/main/profiles/useUpdateProfileCallback.ts","api/main/profiles/useSaveProfileCallback.ts","components/profiles/ProfileDetails.tsx","components/profiles/ChangePassword.tsx","api/account/useChangePasswordCallback.ts","components/profiles/ChangeEmail.tsx","api/main/users/useUser.ts","api/account/useChangeEmailCallback.ts","components/profiles/routes.ts","components/profiles/Profile.tsx","shared/useFetchMoreCallback/useFetchMoreCallback.ts","shared/useURLSearchParams/useURLSearchParams.ts","shared/useURLSearchParams/useReplaceSearchParamsEffect.ts","shared/useURLSearchParams/useSearchParams.ts","components/shared/SearchInput.tsx","components/shared/NoResultsFound.tsx","components/shared/TableRowButtons.tsx","components/shared/StickyToolbar.tsx","api/main/users/useChangeUserRoleGroupCallback.ts","components/users/EditUser.tsx","api/main/profiles/useProfileSupportingData.ts","api/account/useInviteCallback.ts","api/account/useResendInviteEmailCallback.ts","api/account/useChangeAccountEmailCallback.ts","configure/security/IdentityRoles.ts","components/users/DeleteUser.tsx","components/users/routes.ts","components/users/UsersList.tsx","api/main/profiles/useProfiles.ts","api/main/profiles/useDeleteProfileCallback.ts","api/account/useLockoutCallback.ts","components/shared/NavLinkTrackActive.tsx","components/administration/AdministrationNavigation.tsx","components/shared/NavTiles.tsx","components/administration/routes.ts","components/administration/Administration.tsx","components/home/Home.tsx","components/home/routes.ts","api/main/models/University.ts","api/main/models/Product.ts","components/apply/ApplyWizardStep.ts","components/apply/shared/ChoiceButton.tsx","configure/stylesPaths.ts","components/apply/steps/WhoPays.tsx","components/apply/steps/PaymentNotAllowed.tsx","components/shared/FormContainer.tsx","components/apply/steps/WhichUniversity.tsx","components/apply/steps/IsUnder19.tsx","components/apply/steps/IsAnyday.tsx","components/apply/steps/AnydayDays.tsx","components/apply/steps/IsCityArea.tsx","components/apply/steps/ExistingEasyrider.tsx","components/apply/steps/PersonalDetails.tsx","api/main/blobReferences/BlobUploadService.ts","api/main/blobReferences/useUploadBlobCallback.ts","components/apply/shared/CustomEasyriderCard.tsx","components/apply/steps/Photo.tsx","api/main/studentApplications/useSendPaymentConfirmEmailCallback.ts","components/apply/steps/Evidence.tsx","components/apply/steps/EvidenceUnder19.tsx","api/main/models/BlobReference.ts","api/main/models/StudentApplication.ts","api/main/studentApplications/useCreateStudentApplicationCallback.ts","api/main/studentApplications/useUpdateStudentApplicationCallback.ts","api/main/studentApplications/useSaveStudentApplicationCallback.ts","configure/paymentConfig.ts","components/apply/steps/PayFake.tsx","api/main/studentApplications/useSendPaymentFailEmailCallback.ts","components/apply/steps/PayReal.tsx","api/main/studentApplications/usePreparePaymentJson.ts","components/apply/steps/Pay.tsx","components/apply/steps/Success.tsx","components/apply/steps/Failure.tsx","api/main/studentApplications/useStudentApplication.ts","components/apply/steps/PaymentNotAllowedYet.tsx","components/apply/Apply.tsx","configure/secureNctxCoUkConfig.ts","api/main/studentApplications/useStudentApplicationSupportingData.ts","components/apply/routes.ts","components/apply/Success.tsx","components/apply/Failure.tsx","api/main/universities/useUniversity.ts","api/main/universities/useCreateUniversityCallback.ts","api/main/universities/useUpdateUniversityCallback.ts","components/universities/EditUniversity.tsx","api/main/universities/useSaveUniversityCallback.ts","components/universities/DeleteUniversity.tsx","components/universities/routes.ts","components/universities/UniversitiesList.tsx","api/main/universities/useUniversities.ts","api/main/universities/useDeleteUniversityCallback.ts","components/products/ProductsList.tsx","api/main/products/useProduct.ts","api/main/products/useCreateProductCallback.ts","api/main/products/useUpdateProductCallback.ts","components/shared/TwoValueSwitch.tsx","components/products/EditProduct.tsx","api/main/products/useSaveProductCallback.ts","components/products/DeleteProduct.tsx","components/products/routes.ts","api/main/products/useProducts.ts","api/main/products/useDeleteProductCallback.ts","components/shared/ISODateTimeInput.tsx","utilities/calculateApplicationStatus.ts","components/studentApplications/StudentApplicationsList.tsx","api/main/studentApplications/useStudentApplications.ts","components/studentApplications/routes.ts","components/studentApplications/SearchStudentApplicationsList.tsx","components/studentApplications/PendingStudentApplicationsList.tsx","components/studentApplications/CompletedStudentApplicationsList.tsx","components/studentApplications/RejectedStudentApplicationsList.tsx","components/studentApplications/FailedPaymentStudentApplicationsList.tsx","components/studentApplications/EditStudentApplication.tsx","api/account/useCurrentUserId.ts","configure/routeConfig.ts","components/shared/NotFound.tsx","components/shared/NoSidebarUnlessRequired.tsx","components/layout/Navigation.tsx","components/layout/Sidebar.tsx","components/layout/Layout.tsx","configure/iconsConfig.ts","configure/configureApollo.ts","configure/languageConfig.ts","reduxStore/persistConfig.ts","reduxStore/store.ts","configure/configureServices.ts","App.tsx","configure/i18n.ts","configure/errorMessageConfig.ts","registerServiceWorker.ts","index.tsx"],"names":["cacheSlice","createSlice","name","initialState","items","reducers","storeInCache","state","action","payload","id","data","expireAt","expireOnEvents","removeFromCache","clearCache","raiseExpireEvents","events","item","hasEvent","event","filter","it","length","i","actions","cacheReducer","reducer","registerErrorMessageConverters","converters","configuredErrorMessageConverters","userFriendlyErrorMessage","error","friendly","converter","isNullOrUndefined","Array","isArray","message","toString","useChanges","unchanged","initialChanges","React","changes","setChanges","change","prevState","reset","model","ret","CacheService","getCacheState","dispatch","this","cachedItem","Date","options","undefined","apiAuthorizationConfig","endpoint","applicationName","authService","_popUpDisabled","_callbacks","_nextSubscriptionId","_user","_isAuthenticated","_userManager","getUser","user","profile","ensureUserManagerInitialized","userManager","access_token","signinSilent","createArguments","silentUser","updateState","success","console","log","Error","signinPopup","popUpUser","signinRedirect","redirect","url","signinCallback","signoutPopup","signoutRedirect","signoutCallback","response","notifySubscribers","callback","push","subscription","subscriptionId","subscriptionIndex","map","element","index","found","splice","useReplaceToNavigate","status","AuthenticationResultStatus","Fail","Success","Redirect","fetch","ok","json","settings","automaticSilentRenew","includeIdTokenInSilentRenew","userStore","WebStorageStateStore","prefix","UserManager","addUserSignedOut","a","removeUser","useAuthorizeService","useAuthenticatedState","isAuthenticated","setIsAuthenticated","setUser","stateChanged","authenticated","userResult","includeUser","subscribe","unsubscribe","UserNav","useToggleState","dropdownOpen","toggleDropdown","t","useTranslation","Dropdown","direction","isOpen","toggle","nav","DropdownToggle","size","round","email","preferred_username","className","DropdownMenu","right","DropdownItem","header","tag","to","icon","divider","pathname","local","AppNavbarBrand","Header","isAdministration","useLocation","indexOf","fixed","Container","fluid","Row","Col","xs","Nav","NavItem","href","display","mobile","Footer","SidebarNav","props","children","SidebarNavTitle","child","AccountService","api","loginWithPassword","request","returnUrl","post","encodeURIComponent","credentials","result","register","defaultRegisterReturnUrl","getExternalAuthenticationSchemes","get","startExternalLogin","provider","form","document","createElement","method","body","append","submit","completeExternalLogin","remoteError","createAccountForExternalLogin","sendPasswordResetEmail","resetPassword","confirmEmail","confirmEmailChange","currentUserRoles","changePassword","changeEmail","resendConfirmEmail","invite","resendInviteEmail","confirmInvite","changeAccountEmail","lockout","ApiFetch","window","origin","ClaimTypes","useAccountService","useServices","services","accountService","useCache","key","cacheService","setState","value","readFromCache","refreshCurrentUserRoles","setRoles","roles","useCurrentUserRoles","useAsyncCallback","refresh","isLoading","isExecuting","errors","lazy","useExternalAuthenticationSchemes","externalAuthenticationSchemes","setExternalAuthenticationSchemes","useResendConfirmationEmailCallback","useStartExternalLoginCallback","AuthorizeContainer","usersRoles","hasRequiredRole","setHasRequiredRole","requireRole","requireRoles","flat","hasRole","roleToCheck","find","AuthorizeRoute","Component","component","render","rest","redirectUrl","location","AppRoutes","routes","authorize","path","exact","LoadingIndicator","fullWidth","inline","style","width","textAlign","Spinner","type","Background","AccountBackground","LoginWaiting","waiting","QueryParameterNames","LogoutActions","LoginActions","ApplicationPaths","DefaultLoginRedirectPath","ApiAuthorizationPrefix","Login","LoginFailed","LoginCallback","Register","Profile","LogOut","LoggedOut","LogOutCallback","IdentityRegisterPath","IdentityManagePath","login","getReturnUrl","processLoginCallback","URLSearchParams","search","redirectToProfile","redirectToRegister","signIn","navigateToReturnUrl","completeSignIn","fromQuery","startsWith","redirectToApiAuthorizationPath","apiAuthorizationPath","replace","Logout","isReady","history","logout","processLogoutCallback","populateAuthenticationState","signOut","completeSignOut","apiAuthorizationRoutes","loginAction","logoutAction","AlertOnErrors","color","simple","openErrors","setOpenErrors","toggleOpen","friendlyErrors","errorGroups","groups","group","Alert","onClick","cursor","Badge","pill","showIf","details","lang","JSON","stringify","ExternalLoginButton","providerDisplayName","propsClassName","text","Button","context","FormButtons","MainContainer","Banner","defaultPasswordOptions","requireDigit","requiredLength","requireLowercase","requireNonAlphanumeric","requiredUniqueChars","requireUppercase","PasswordValidation","passwordOptions","password","i18n","charMap","char","charAt","RegExp","test","errorDescription","join","valid","usePasswordValidation","passwordValidation","checkPassword","check","passwordRequirements","passwordErrors","requirements","generatePasswordRulesDescrption","roleGroupFieldsFragment","gql","userFieldsFragment","profileFieldsFragment","useRegisterProfileDetailsProps","useMutation","mutationAction","variables","actionErrors","useRegisterProfileCallback","_registerProfile","isRegisteringProfile","registerProfileErrors","Guid","newGuid","firstName","lastName","bio","useValidatorCallback","validation","fieldsToCheck","rules","checkRules","validate","validationErrors","registerProfile","userId","RegisterProfileDetails","FormGroup","Label","htmlFor","onChange","e","currentTarget","onBlur","mainApiConfig","blobUploadEndpoint","defaultFetchPolicy","ConfirmInviteProfileDetails","params","code","useLazyQuery","fetchPolicy","pollInterval","onCompleted","load","loading","refetch","useProfileForInvite","loadingErrors","Input","readOnly","accountRoutes","loadErrors","requiresTwoFactor","requiresEmailConfirmation","useLoginWithPasswordCallback","isLoggingIn","loginErrors","isPendingEmailConfirmation","setIsPendingEmailConfirmation","useHistory","resendConfirmationEmail","isResendingConfirmationEmail","resendConfirmationEmailErrors","hasSentConfirmationEmail","setHasSentConfirmationEmail","rememberMe","isDoingFullPageRedirect","setIsDoingFullPageRedirect","performLogin","succeeded","Form","onSubmit","preventDefault","executingChildren","autoComplete","CustomInput","label","checked","outline","displayName","useRegisterAccountCallback","isRegistering","registerErrors","confirmPassword","registerProfileDetailsProps","singleCheck","performRegister","md","FormText","claims","isNewUser","loginProvider","setData","useCompletedExternalLoginDetails","useCreateAccountForExternalLoginCallback","createAccount","isCreatingAccount","createAccountErrors","emailClaim","emailSent","setEmailSent","useSendPasswordResetEmailCallback","sendResetEmail","isSendingResetEmail","sendResetEmailErrors","hasResetPassword","setHasResetPassword","useResetPasswordCallback","isResettingPassword","resetPasswordErrors","emailConfirmed","setEmailConfirmed","useConfirmEmailCallback","confirmEmailErrors","useConfirmEmailChangeCallback","useConfirmInviteCallback","isConfirmingInvite","confirmInviteErrors","useProfile","isUserId","empty","useSaveInStore","createDataStore","updateDataStore","create","isCreating","createErrors","update","isUpdating","updateErrors","isCreate","beforeSaving","afterSaving","save","isSaving","saveErrors","useCreateProfileCallback","useUpdateProfileCallback","useSaveProfileCallback","_create","createStatus","_update","updateStatus","ProfileDetails","hasSaved","setHasSaved","setIsCreate","sub","storeModel","refreshProfile","ChangePassword","hasChangedPassword","setHasChangedPassword","currentPassword","newPassword","useChangePasswordCallback","isChangingPassword","changePasswordErrors","ChangeEmail","useUser","refreshUserModel","newEmail","useChangeEmailCallback","changeEmailErrors","hasSentEmail","setHasSentEmail","profileRoutes","activeTab","setActiveTab","tabs","NavLink","TabContent","TabPane","tabId","useFetchMoreCallback","fetchMoreFromStore","currentEndOffset","merge","newResultLength","_hasMore","setHasMore","fetchMore","offset","updateQuery","previousQueryResult","fetchMoreResult","hasMore","useURLSearchParams","useReplaceSearchParamsEffect","changesValue","set","delete","hash","useSearchParams","forEach","SearchInput","placeholder","InputGroup","InputGroupAddon","addonType","NoResultsFound","TableRowButtons","StickyToolbar","isStuck","setIsStuck","topOffset","scrollableAncestor","onEnter","onLeave","useChangeUserRoleGroupCallback","resetCurrentUserRoles","useResetCurrentUserRolesCallback","EditUser","useParams","_isLoading","useProfileSupportingData","roleGroups","isLoadingSupportingData","loadSupportingDataErrors","userModel","changeUserModel","roleGroup","roleGroupModel","changeRoleGroupModel","useInviteCallback","inviteErrors","useResendInviteEmailCallback","isResendingInviteEmail","resendInviteEmailErrors","hasResentInviteEmail","setHasResentInviteEmail","currentEmail","useChangeAccountEmailCallback","changeUserRoleGroupInStore","changeUserRoleGroupInStoreErrors","sendEmail","roleGroupId","goBack","saveForm","saveFormErrors","IdentityRoles","userRoutes","searchParam","setSearch","startOffset","first","pageSize","prevResults","newResults","useProfiles","allItems","useToggleStateArray","isMenuOpen","toggleMenuOpen","lowerSearch","toLocaleLowerCase","Table","responsive","striped","onDoubleClick","ButtonGroup","ButtonDropdown","caret","colSpan","useDeleteProfileCallback","remove","removeErrors","useLockoutCallback","lockoutErrors","onRemoveFormSubmit","isRemoving","removeFormErrors","plaintext","NavLinkTrackActive","activeClassName","AdministrationNavigation","NavTiles","administrationRoutes","administrationSidebarRoutes","Home","homeRoutes","universityFieldsFragment","ApplyWizardStep","productFieldsFragment","ChoiceButton","active","title","text2","imageURL","linkURL","linkText","Card","CardBody","src","alt","CardTitle","CardText","stylesPaths","publicRoot","WhoPays","pushStep","isCurrentStepComplete","stepCompleted","setStepCompleted","universityId","paymentNotAllowedYet","whoPays","PaymentNotAllowed","FormContainer","WhichUniversity","popStep","universities","university","canContinue","isEmpty","universityProvidedReferenceNumber","disabled","whichUniversity","isAnyday","IsUnder19","calculateProduct","isUnder19","IsAnyday","isAnydayPass","isCityArea","anydayDays","AnydayDays","lg","IsCityArea","mapImage","existingEasyrider","Media","ExistingEasyrider","easyriderImage","easyriderImageAlt","existingEasyRiderCardNumber","personalDetails","PersonalDetails","validateAndNext","photo","validationerrors","forename","surname","moment","dateOfBirth","format","street","address2","city","county","postcode","BlobUploadService","apiFetch","files","uploadMultiple","FormData","file","init","headers","newHeaders","Headers","dataUrl","useUploadBlobCallback","uploadService","upload","CustomEasyriderCard","cardImageUrl","photoBlob","imageToUse","formattedCardName","Photo","setPhotoBlob","uploadBlob","uploadBlobErrors","blob","photoBlobReferenceId","uploadFile","isUploadingFile","uploadFileErrors","target","rel","evidenceUnder19","evidence","useSendPaymentConfirmEmailCallback","Evidence","evidenceBlob","setEvidenceBlob","proofOfEntitlementBlobReferenceId","evidenceImage","evidenceImageAlt","sendPaymentConfirmEmail","sendPaymentConfirmEmailErrors","pay","saveAndNext","EvidenceUnder19","blobReferenceFieldsFragment","studentApplicationFieldsFragment","useCreateStudentApplicationCallback","useUpdateStudentApplicationCallback","useSaveStudentApplicationCallback","paymentConfig","PayFake","product","useSendPaymentFailEmailCallback","sendPaymentFailEmail","sendPaymentFailEmailErrors","archived","failure","_saveAndNext","useCallbackAwaitStateSync","hasPaid","price","paymentProviderReferenceNumber","paymentTakenDate","toISOString","productPrice","PayReal","hppJson","usePreparePaymentJson","script3","async","appendChild","paymentamount","Pay","Failure","useStudentApplication","PaymentNotAllowedYet","Apply","initialStep","useStudentApplicationSupportingData","products","loadingSupportingDataErrors","country","hasBeenIssued","issuedByUserId","issuedOnDate","productId","submittedDate","_calculateProduct","returnString","hasBeenSaved","setHasBeenSaved","setevidenceBlob","useEffectOnceWhen","photoBlobReference","proofOfEntitlementBlobReference","stepHistory","setStepHistory","newStep","current","untilStep","pop","currentStep","control","paymentNotAllowed","currentStepControl","applyRoutes","useUniversity","useCreateUniversityCallback","useUpdateUniversityCallback","EditUniversity","useSaveUniversityCallback","universityRoutes","useUniversities","useDeleteUniversityCallback","useProduct","useCreateProductCallback","useUpdateProductCallback","TwoValueSwitch","leftLabel","rightLabel","uniqueName","noGutters","EditProduct","useSaveProductCallback","InputGroupText","parseInt","productRoutes","useProducts","sortedItems","sort","b","dayNumber","useDeleteProductCallback","ISODateTimeInput","theType","theFormat","theValue","onChangeWrapper","newValue","utc","newEvent","calculateApplicationStatus","StudentApplicationsList","includeArchived","useStudentApplications","studentApplicationRoutes","issuedByProfile","currentuserID","useCurrentUserId","updateModelAndSave","applicationStatus","toFixed","appRoutes","sidebarRoutes","data-no-sidebar-unless-required","Navigation","Sidebar","Layout","fallback","configureIcons","library","add","faBusinessTime","faCalendarWeek","faCaretUp","faCaretDown","faCaretLeft","faCaretRight","faCheckCircle","faChevronLeft","faChevronRight","faCogs","faCreditCard","faCross","faDesktop","faDownload","faEdit","faExclamationCircle","faEye","faFlagCheckered","faLock","faMinus","faPersonBooth","faPlay","faPlus","faPoundSign","faRuler","faSave","faSchool","faSearch","faSpinner","faStop","faStopwatch","faTimes","faTimesCircle","faTrash","faTrashAlt","faUndo","faUser","faUserCheck","faUserClock","faUsers","faVoteYea","farCircle","farFrown","farFrownOpen","faPhone","faEnvelope","cache","InMemoryCache","apolloCachePersistor","CachePersistor","storage","localStorage","persist","link","HttpLink","uri","apolloClient","ApolloClient","availableLanguages","flagCountryCode","momentLocale","numeralLocale","persistConfig","whitelist","rootReducer","combineReducers","persistedRootReducer","persistReducer","reduxStore","preloadedState","initialReduxState","store","configureStore","middleware","persistor","persistStore","createAppReduxStore","reduxStorePersistor","serviceProvider","ServiceProvider","builder","singleton","getState","purge","use","Backend","LanguageDetector","initReactI18next","fallbackLng","interpolation","escapeValue","isMoment","Number","isNumber","numeral","on","lng","thisLanguage","locale","shouldHandle","graphQLErrors","i18next","externalProviderError","subStr","isLocalhost","Boolean","hostname","match","registerValidSW","swUrl","navigator","serviceWorker","then","registration","onupdatefound","installingWorker","installing","onstatechange","controller","catch","baseUrl","getElementsByTagName","getAttribute","rootElement","getElementById","ReactDOM","basename","Provider","client","defaultTitle","titleTemplate","URL","process","addEventListener","ready","unregister","reload","checkValidServiceWorker","registerServiceWorker"],"mappings":"sSAuCMA,EAAaC,YAAY,CAC3BC,KAAM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,WAAD,CAAgB5D,SAAU,gBAAC,GAAD,CAAkB5mB,WAAW,KACnD,gBAAC,GAAD,CAAQsmB,UAAWA,IACf,gBAAC,KAAD,CAAQ2I,aAAcrpB,GAAKnO,EAAE,6BAA8By3B,cAAetpB,GAAKnO,EAAE,oCAEjF,gBAAC,GAAD,CAAWkI,OAAQ2mB,eIxCvD,OAEFqI,IDOa,WACX,GAA6C,kBAAmBb,UAAW,CAGvE,GADkB,IAAIqB,IAAIC,GAAwBvyB,OAAO4C,SAAS5F,MACpDiD,SAAWD,OAAO4C,SAAS3C,OAIrC,OAGJD,OAAOwyB,iBAAiB,QAAQ,WAC5B,IAAMxB,EAAK,UAAMuB,GAAN,sBAEP5B,GAwChB,SAAiCK,GAE7Bh4B,MAAMg4B,GACDG,MAAK,SAACr5B,GAGqB,MAApBA,EAASa,SACuD,IAAhEb,EAAS0oB,QAAQniB,IAAI,gBAAgB9B,QAAQ,cAG7C00B,UAAUC,cAAcuB,MAAMtB,MAAK,SAAAC,GAC/BA,EAAasB,aAAavB,MAAK,WAC3BnxB,OAAO4C,SAAS+vB,eAKxB5B,GAAgBC,MAGvBU,OAAM,WACHx6B,QAAQC,IACJ,oEA5DAy7B,CAAwB5B,GAGxBD,GAAgBC,OCxBhC6B,K","file":"static/js/main.58acf468.chunk.js","sourcesContent":["import { createSlice } from '@reduxjs/toolkit';\r\n\r\nexport interface CacheState {\r\n items: { [key: string]: CacheItem },\r\n}\r\n\r\nexport interface CacheItem {\r\n data: any,\r\n expireAt?: Date,\r\n expireOnEvents: Array\r\n}\r\n\r\nexport interface StoreInCacheAction {\r\n type: string,\r\n payload: {\r\n id: string,\r\n data: any,\r\n expireAt?: Date,\r\n expireOnEvents: Array\r\n }\r\n}\r\n\r\nexport interface RemoveFromCacheAction {\r\n type: string,\r\n payload: {\r\n id: string\r\n }\r\n}\r\n\r\nexport interface RaiseExpireEventsAction {\r\n type: string,\r\n payload: {\r\n events: Array\r\n }\r\n}\r\n\r\n/**\r\n * General cache for storing name value pairs in redux that don't need their own slices or actions. \r\n */\r\nconst cacheSlice = createSlice({\r\n name: 'currentUserRoles',\r\n initialState: { items: {} } as CacheState,\r\n reducers: {\r\n /**\r\n * Store an item in the cache.\r\n * @param state\r\n * @param action\r\n */\r\n storeInCache(state, action: StoreInCacheAction) {\r\n const { id, data, expireAt, expireOnEvents } = action.payload;\r\n state.items = {\r\n ...state.items,\r\n [id]: { data, expireAt, expireOnEvents }\r\n };\r\n },\r\n\r\n /**\r\n * Remove an item from the cache.\r\n * @param state\r\n * @param action\r\n */\r\n removeFromCache(state, action: RemoveFromCacheAction) {\r\n const { id } = action.payload;\r\n delete state.items[id];\r\n },\r\n\r\n /**\r\n * Clear the entire cache.\r\n * @param state\r\n * @param action\r\n */\r\n clearCache(state) {\r\n state.items = {};\r\n },\r\n\r\n /**\r\n * Remove an item from the cache.\r\n * @param state\r\n * @param action\r\n */\r\n raiseExpireEvents(state, action: RaiseExpireEventsAction) {\r\n const { events } = action.payload;\r\n for (const id in state.items) {\r\n const item = state.items[id];\r\n if (!item.expireOnEvents) {\r\n continue;\r\n }\r\n // If any of the events being raised effect this item then exclude it from the results so it gets removed from the cache.\r\n const hasEvent = (item: CacheItem, event: string) => item.expireOnEvents.filter(it => it === event).length ? true : false;\r\n for (let i = 0; i < events.length; ++i) {\r\n var event = events[i];\r\n if (hasEvent(item, event)) {\r\n delete state.items[id];\r\n }\r\n }\r\n }\r\n },\r\n }\r\n});\r\n\r\nexport const { storeInCache, removeFromCache, clearCache, raiseExpireEvents } = cacheSlice.actions;\r\nexport const cacheReducer = cacheSlice.reducer;\r\n","import { ErrorMessageConverter } from \"./ErrorMessageConverter\";\r\n\r\n/**\r\n * Register all converters to use for error messages when calling userFriendlyErrorMessage().\r\n * \r\n * Convters will be run in array order, with the first non-null/undefined result being returned as the error message.\r\n * \r\n * @param converters\r\n */\r\nexport function registerErrorMessageConverters(converters: Array): void {\r\n configuredErrorMessageConverters = converters;\r\n}\r\n\r\n/**\r\n * Currently registered ErrorMessageConvters set by registerErrorMessageConverters().\r\n */\r\nexport let configuredErrorMessageConverters: Array = [];","export * from './ErrorMessageConverter';\r\nexport * from './FriendlyErrorMessage';\r\nexport * from './registerErrorMessageConverters';\r\nexport * from './userFriendlyErrorMessage';\r\n","import { isNullOrUndefined } from \"util\";\r\nimport { configuredErrorMessageConverters } from \"./registerErrorMessageConverters\";\r\nimport { FriendlyErrorMessage } from \"./FriendlyErrorMessage\";\r\n\r\n/**\r\n * Translate an error message into a user friendly message, also giving the option for wrapping the message for translation if required\r\n * and seperating out additional details from the core error message.\r\n * \r\n * @param error the original error.\r\n */\r\nexport function userFriendlyErrorMessage(error: any): FriendlyErrorMessage | Array {\r\n // Give each converter in order a chance to handle the error until one does.\r\n for (const converter of configuredErrorMessageConverters) {\r\n const friendly = converter(error);\r\n if (!isNullOrUndefined(friendly)) {\r\n if (Array.isArray(friendly)) {\r\n return friendly as Array;\r\n } else if ((friendly as FriendlyErrorMessage)?.error) {\r\n return friendly as FriendlyErrorMessage;\r\n } else {\r\n return { message: friendly as string, error: error };\r\n }\r\n }\r\n }\r\n\r\n // Give up and return the error with a basic wrapper.\r\n return {\r\n message: error?.message ?? error?.toString,\r\n error: error\r\n };\r\n}","import * as React from 'react';\r\nimport { ModelChanges } from './ModelChanges';\r\n\r\n/**\r\n * Hook that makes it easy to apply changes ontop of original data.\r\n */\r\nexport function useChanges(unchanged: T | undefined | null, initialChanges: Partial = {}): ModelChanges {\r\n // Store changes in the state.\r\n const [changes, setChanges] = React.useState>(initialChanges);\r\n\r\n // Provide a method to apply a change or set of changes.\r\n const change = React.useCallback((changes: Partial) => {\r\n setChanges(prevState =>({\r\n ...prevState,\r\n ...changes\r\n }));\r\n }, [setChanges]);\r\n\r\n // Provide a method to reset all changes.\r\n const reset = React.useCallback(() => {\r\n setChanges({});\r\n }, [setChanges]);\r\n\r\n // Combine the initial model with the changes to produce model with its current state.\r\n const model = React.useMemo((): T => {\r\n return {\r\n ...(unchanged ?? {} as T), ...changes\r\n };\r\n }, [unchanged, changes]);\r\n\r\n // Combine everything into a return value and return it (caching it with useMemo()).\r\n const ret = React.useMemo(() => ({\r\n change: change,\r\n changes: changes,\r\n reset: reset,\r\n model: model\r\n }), [changes, change, reset, model]);\r\n\r\n return ret;\r\n}","export * from './ModelArrayChanges';\r\nexport * from './ModelChanges';\r\nexport * from './useChanges';\r\nexport * from './useChangesArray';","import { CacheState, storeInCache, removeFromCache, raiseExpireEvents } from '../../reduxStore/cache';\r\nimport { AnyAction, Dispatch } from \"redux\";\r\nimport { CacheOptions } from './CacheOptions';\r\n\r\n/**\r\n * Cache service that uses the actions redux store and actions to store the cache in redux.\r\n */\r\nexport class CacheService {\r\n private getCacheState: () => CacheState;\r\n private dispatch: Dispatch;\r\n\r\n constructor(getCacheState: () => CacheState, dispatch: Dispatch) {\r\n this.getCacheState = getCacheState;\r\n this.dispatch = dispatch;\r\n }\r\n\r\n readFromCache(id: string): T | null {\r\n const cachedItem = this.getCacheState().items[id];\r\n if (!cachedItem) {\r\n return null;\r\n }\r\n\r\n // If this item has expired, remove it and return null.\r\n if (cachedItem.expireAt && cachedItem.expireAt < new Date()) {\r\n this.removeFromCache(id);\r\n }\r\n\r\n return cachedItem.data;\r\n }\r\n\r\n storeInCache(id: string, data: any, options?: CacheOptions): void {\r\n const expireAt = options ? options.expireAt : undefined;\r\n const expireOnEvents = options ? options.expireOnEvents ? options.expireOnEvents : [] : [];\r\n this.dispatch(storeInCache({ id, data, expireAt, expireOnEvents }));\r\n }\r\n\r\n removeFromCache(id: string): void {\r\n this.dispatch(removeFromCache({ id }));\r\n }\r\n\r\n raiseExpireEvents(...events: Array): void {\r\n this.dispatch(raiseExpireEvents({ events }));\r\n }\r\n}\r\n","export * from './CacheOptions';\r\nexport * from './CacheService';\r\n","import { isRunningOnSecureNctxCoUk } from \"./secureNctxCoUkConfig\";\r\n\r\nexport const apiAuthorizationConfig = {\r\n endpoint: isRunningOnSecureNctxCoUk? 'https://nct-students.azurewebsites.net/': '/',\r\n\r\n applicationName: 'NctAcademicPassPortal',\r\n};","import { UserManager, WebStorageStateStore, User, Profile } from 'oidc-client';\r\nimport { apiAuthorizationConfig } from '../../configure/apiAuthorizationConfig';\r\n\r\nexport interface AuthenticationResult {\r\n status: string,\r\n message?: string,\r\n state?: any,\r\n}\r\n\r\nexport class AuthorizeService {\r\n // By default pop ups are disabled because they don't work properly on Edge.\r\n // If you want to enable pop up authentication simply set this flag to false.\r\n _popUpDisabled = true;\r\n\r\n _callbacks: Array<{ callback: () => void, subscription: number }>;\r\n _nextSubscriptionId: number;\r\n _user: User | null;\r\n _isAuthenticated: boolean = false;\r\n _userManager: UserManager | undefined;\r\n\r\n\r\n\r\n constructor() {\r\n this._callbacks = [];\r\n this._nextSubscriptionId = 0;\r\n this._user = null;\r\n this._isAuthenticated = false;\r\n this._userManager = undefined;\r\n }\r\n\r\n async isAuthenticated(): Promise {\r\n const user = await this.getUser();\r\n return !!user;\r\n }\r\n\r\n async getUser(): Promise {\r\n let user = this._user;\r\n\r\n if (user && user.profile) {\r\n return user.profile;\r\n }\r\n\r\n const userManager = await this.ensureUserManagerInitialized();\r\n user = await userManager.getUser();\r\n return user?.profile ?? null;\r\n }\r\n\r\n async getAccessToken(): Promise {\r\n const userManager = await this.ensureUserManagerInitialized();\r\n const user = await userManager.getUser();\r\n return user?.access_token ?? null;\r\n }\r\n\r\n // We try to authenticate the user in three different ways:\r\n // 1) We try to see if we can authenticate the user silently. This happens\r\n // when the user is already logged in on the IdP and is done using a hidden iframe\r\n // on the client.\r\n // 2) We try to authenticate the user using a PopUp Window. This might fail if there is a\r\n // Pop-Up blocker or the user has disabled PopUps.\r\n // 3) If the two methods above fail, we redirect the browser to the IdP to perform a traditional\r\n // redirect flow.\r\n async signIn(state: any): Promise {\r\n const userManager = await this.ensureUserManagerInitialized();\r\n try {\r\n const silentUser = await userManager.signinSilent(this.createArguments());\r\n this.updateState(silentUser);\r\n return this.success(state);\r\n } catch (silentError) {\r\n // User might not be authenticated, fallback to popup authentication\r\n console.log(\"Silent authentication error: \", silentError);\r\n\r\n try {\r\n if (this._popUpDisabled) {\r\n throw new Error('Popup disabled. Change \\'AuthorizeService.js:AuthorizeService._popupDisabled\\' to false to enable it.')\r\n }\r\n\r\n const popUpUser = await userManager.signinPopup(this.createArguments());\r\n this.updateState(popUpUser);\r\n return this.success(state);\r\n } catch (popUpError) {\r\n if (popUpError.message === \"Popup window closed\") {\r\n // The user explicitly cancelled the login action by closing an opened popup.\r\n return this.error(\"The user closed the window.\");\r\n } else if (!this._popUpDisabled) {\r\n console.log(\"Popup authentication error: \", popUpError);\r\n }\r\n\r\n // PopUps might be blocked by the user, fallback to redirect\r\n try {\r\n await userManager.signinRedirect(this.createArguments(state));\r\n return this.redirect();\r\n } catch (redirectError) {\r\n console.log(\"Redirect authentication error: \", redirectError);\r\n return this.error(redirectError);\r\n }\r\n }\r\n }\r\n }\r\n\r\n async completeSignIn(url: string): Promise {\r\n try {\r\n const userManager = await this.ensureUserManagerInitialized();\r\n const user = await userManager.signinCallback(url);\r\n this.updateState(user);\r\n return this.success(user && user.state);\r\n } catch (error) {\r\n console.log('There was an error signing in: ', error);\r\n return this.error('There was an error signing in.');\r\n }\r\n }\r\n\r\n // We try to sign out the user in two different ways:\r\n // 1) We try to do a sign-out using a PopUp Window. This might fail if there is a\r\n // Pop-Up blocker or the user has disabled PopUps.\r\n // 2) If the method above fails, we redirect the browser to the IdP to perform a traditional\r\n // post logout redirect flow.\r\n async signOut(state: any) {\r\n const userManager = await this.ensureUserManagerInitialized();\r\n try {\r\n if (this._popUpDisabled) {\r\n throw new Error('Popup disabled. Change \\'AuthorizeService.ts:AuthorizeService._popupDisabled\\' to false to enable it.')\r\n }\r\n\r\n await userManager.signoutPopup(this.createArguments());\r\n this.updateState(null);\r\n return this.success(state);\r\n } catch (popupSignOutError) {\r\n console.log(\"Popup signout error: \", popupSignOutError);\r\n try {\r\n await userManager.signoutRedirect(this.createArguments(state));\r\n return this.redirect();\r\n } catch (redirectSignOutError) {\r\n console.log(\"Redirect signout error: \", redirectSignOutError);\r\n return this.error(redirectSignOutError);\r\n }\r\n }\r\n }\r\n\r\n async completeSignOut(url: string) {\r\n const userManager = await this.ensureUserManagerInitialized();\r\n try {\r\n const response = await userManager.signoutCallback(url);\r\n this.updateState(null);\r\n return this.success(response && response.state);\r\n } catch (error) {\r\n console.log(`There was an error trying to log out '${error}'.`);\r\n return this.error(error);\r\n }\r\n }\r\n\r\n updateState(user: User | null) {\r\n this._user = user;\r\n this._isAuthenticated = !!this._user;\r\n this.notifySubscribers();\r\n }\r\n\r\n subscribe(callback: () => void): number {\r\n this._callbacks.push({ callback, subscription: this._nextSubscriptionId++ });\r\n return this._nextSubscriptionId - 1;\r\n }\r\n\r\n unsubscribe(subscriptionId: number) {\r\n const subscriptionIndex = this._callbacks\r\n .map((element, index) => element.subscription === subscriptionId ? { found: true, index } : { found: false })\r\n .filter(element => element.found === true);\r\n if (subscriptionIndex.length === 1) {\r\n this._callbacks = this._callbacks.splice(subscriptionIndex[0].index as number, 1);\r\n } else {\r\n //throw new Error(`Found an invalid number of subscriptions ${subscriptionIndex.length}`);\r\n }\r\n }\r\n\r\n notifySubscribers() {\r\n for (let i = 0; i < this._callbacks.length; i++) {\r\n const callback = this._callbacks[i].callback;\r\n callback();\r\n }\r\n }\r\n\r\n createArguments(state?: any) {\r\n return { useReplaceToNavigate: true, data: state };\r\n }\r\n\r\n error(message: string) : AuthenticationResult {\r\n return { status: AuthenticationResultStatus.Fail, message };\r\n }\r\n\r\n success(state: any): AuthenticationResult {\r\n return { status: AuthenticationResultStatus.Success, state };\r\n }\r\n\r\n redirect(): AuthenticationResult {\r\n return { status: AuthenticationResultStatus.Redirect };\r\n }\r\n\r\n async ensureUserManagerInitialized(): Promise {\r\n if (this._userManager !== undefined) {\r\n return this._userManager;\r\n }\r\n\r\n let response = await fetch(`${apiAuthorizationConfig.endpoint}_configuration/${apiAuthorizationConfig.applicationName}`);\r\n if (!response.ok) {\r\n throw new Error(`Could not load settings for '${apiAuthorizationConfig.applicationName}'`);\r\n }\r\n\r\n let settings = await response.json();\r\n settings.automaticSilentRenew = true;\r\n settings.includeIdTokenInSilentRenew = true;\r\n settings.userStore = new WebStorageStateStore({\r\n prefix: apiAuthorizationConfig.applicationName\r\n });\r\n\r\n this._userManager = new UserManager(settings);\r\n\r\n this._userManager.events.addUserSignedOut(async () => {\r\n await (this._userManager as UserManager).removeUser();\r\n this.updateState(null);\r\n });\r\n\r\n return this._userManager;\r\n }\r\n\r\n static get instance() { return authService }\r\n}\r\n\r\nconst authService = new AuthorizeService();\r\n\r\nexport default authService;\r\n\r\nexport const AuthenticationResultStatus = {\r\n Redirect: 'redirect',\r\n Success: 'success',\r\n Fail: 'fail'\r\n};\r\n","import authService, { AuthorizeService } from './AuthorizeService';\r\n\r\n/**\r\n * Hook to return the authentication service.\r\n */\r\nexport function useAuthorizeService(): AuthorizeService {\r\n return authService;\r\n}\r\n","import * as React from 'react';\r\nimport { useAuthorizeService } from './useAuthorizeService';\r\nimport { Profile } from 'oidc-client';\r\n\r\nexport interface UseAuthenticationStateOptions {\r\n /**\r\n * By default we don't load the user details as they are often unused and require extra loading. When this is set to true we'll load the user record and return it as well.\r\n */\r\n includeUser?: boolean,\r\n}\r\n\r\n/**\r\n * Hook to return the authenticated state of the user. The hook subscribes to authenticate changes by authService and will update the state in components whenever that changes.\r\n * @param onStateChanged\r\n */\r\nexport function useAuthenticatedState(options: UseAuthenticationStateOptions = {}): { isAuthenticated: boolean | null, user: Profile | null } {\r\n const authService = useAuthorizeService();\r\n const [isAuthenticated, setIsAuthenticated] = React.useState(null);\r\n const [user, setUser] = React.useState(null);\r\n\r\n const stateChanged = React.useCallback(async () => {\r\n const authenticated = await authService.isAuthenticated();\r\n\r\n let userResult: Profile | null = null;\r\n if (options.includeUser) {\r\n userResult = await authService.getUser();\r\n setUser(userResult);\r\n }\r\n\r\n setIsAuthenticated(authenticated);\r\n }, [authService, options.includeUser]);\r\n\r\n // Subscribe to changes to the authService state.\r\n React.useEffect(() => {\r\n const subscription = authService.subscribe(() => { stateChanged(); });\r\n stateChanged();\r\n return () => { authService.unsubscribe(subscription); };\r\n }, [authService, stateChanged]);\r\n\r\n return { isAuthenticated: isAuthenticated, user: user };\r\n}\r\n","import * as React from 'react';\r\nimport { DropdownToggle, DropdownMenu, DropdownItem, Dropdown } from 'reactstrap';\r\nimport Avatar from 'react-avatar';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { LinkContainer } from 'react-router-bootstrap';\r\nimport { useAuthenticatedState } from '../../api/api-authorization/useAuthenticatedState';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useToggleState } from 'use-toggle-state';\r\n/**\r\n * Navbar area that is for the current user. \r\n */\r\nexport const UserNav = () => {\r\n const { isAuthenticated, user } = useAuthenticatedState({ includeUser: true });\r\n const [dropdownOpen, toggleDropdown] = useToggleState();\r\n\r\n const { t } = useTranslation();\r\n\r\n // Render the UI\r\n //\r\n\r\n // If the user is not logged in, then give them the login and register options.\r\n if (!isAuthenticated) {\r\n return (\r\n <>\r\n {/*\r\n Register\r\n */}\r\n {/*\r\n \r\n \r\n \r\n */}\r\n \r\n );\r\n }\r\n\r\n // Use is logged in so show their options.\r\n return (\r\n toggleDropdown()} nav>\r\n \r\n \r\n \r\n {user?.name ?? ''}\r\n \r\n \r\n \r\n {t('userNav.administration', 'Administration')}\r\n \r\n \r\n \r\n <> {t('userNav.administration', 'Administration')}\r\n \r\n \r\n {t('userNav.account', 'Account')}\r\n \r\n \r\n \r\n <> {t('userNav.profile', 'Profile')}\r\n \r\n \r\n \r\n \r\n \r\n \r\n <> {t('userNav.signOut', 'Sign out')}\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import './appNavbarBrand.scss';\r\n\r\nimport * as React from 'react';\r\n//import { NavbarBrand } from 'reactstrap'; // Not used as it renders a / and we want to control our / elsewhere.\r\n\r\n/**\r\n * Navbar brand image for the app. \r\n */\r\nexport const AppNavbarBrand = () => {\r\n return (\r\n
\r\n {/*
\r\n
\r\n
\r\n
*/}\r\n
\r\n );\r\n};","import './header.scss';\r\n\r\nimport * as React from 'react';\r\nimport { Nav, Container, Row, Col, NavItem } from 'reactstrap';\r\nimport { AppHeader, AppSidebarToggler } from '@coreui/react';\r\nimport { UserNav } from './UserNav';\r\nimport { Link, useLocation } from 'react-router-dom';\r\n//import { Navigation } from './Navigation';\r\n//import { LanguageSelect } from './LanguageSelect';\r\nimport { AppNavbarBrand } from './AppNavbarBrand';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport const Header = () => {\r\n const { t } = useTranslation();\r\n\r\n const location = useLocation();\r\n const isAdministration = location.pathname.indexOf('/administration') === -1 ? false : true;\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n {/**/}\r\n \r\n\r\n
\r\n
\r\n
\r\n );\r\n};\r\n","import * as React from 'react';\r\n//import { AppFooter } from '@coreui/react';\r\n\r\nexport const Footer = () => {\r\n //return (\r\n // \r\n //
\r\n //
\r\n //
\r\n //);\r\n\r\n return (<>);\r\n};\r\n\r\n","import * as React from 'react';\r\nimport PerfectScrollbar from 'react-perfect-scrollbar';\r\n\r\nexport const SidebarNav = (props: any) => {\r\n return (\r\n \r\n {props.children}\r\n \r\n );\r\n};\r\n","import './sidebarNavTitle.scss';\r\n\r\nimport * as React from 'react';\r\nimport { NavItem } from 'reactstrap';\r\n\r\nexport interface SidebarNavTitleProps {\r\n className?: string,\r\n child?: boolean,\r\n children?: React.ReactNode,\r\n}\r\n\r\nexport const SidebarNavTitle = (props: SidebarNavTitleProps) => {\r\n const { className, child, children } = props;\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\n","import { ApiFetch } from \"apifetch-json\";\r\n\r\n/**\r\n * Class that provides a service for managing an account on the server.\r\n * \r\n * NOTE: not to be confused with AuthoriazationService which manages the authorised state of the current user.\r\n * \r\n * The login() and logout() method here are usually invoked through components used by AuthorizationService's routing to share the authorisation state with the server.\r\n */\r\nexport class AccountService {\r\n api: ApiFetch;\r\n\r\n constructor(api?: ApiFetch) {\r\n this.api = api ?? new ApiFetch();\r\n }\r\n\r\n /**\r\n * Attempt to login to the account with an email and password.\r\n */\r\n loginWithPassword = async (request: LoginWithPasswordRequest, returnUrl: string = ''): Promise => {\r\n const result = await this.api.post(\r\n `/api/account/login?returnUrl=${encodeURIComponent(returnUrl ?? '')}`,\r\n request,\r\n {\r\n credentials: 'include',\r\n });\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Register the user with a new password based account.\r\n */\r\n register = async (request: RegisterRequest, returnUrl: string = ''): Promise => {\r\n const result = await this.api.post(\r\n `/api/account/register?returnUrl=${encodeURIComponent(returnUrl || defaultRegisterReturnUrl)}`,\r\n request,\r\n {\r\n credentials: 'include'\r\n });\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get a list of all external authentication schemes registered for use with accounts on this server.\r\n */\r\n getExternalAuthenticationSchemes = async (): Promise> => {\r\n const result = await this.api.get>('/api/account/getExternalAuthenticationSchemes');\r\n return result;\r\n }\r\n\r\n /**\r\n * Start the process of logging in with an external provider.\r\n */\r\n startExternalLogin = (provider: string, returnUrl: string = '') => {\r\n // We want to post the whole page to the action as it needs to return a redirect. To acheive this we create and post a form.\r\n let form = document.createElement('form');\r\n form.action = `/api/account/startExternalLogin?provider=${encodeURIComponent(provider)}&returnUrl=${encodeURIComponent(returnUrl ?? '')}`;\r\n form.method = 'post';\r\n document.body.append(form);\r\n form.submit();\r\n }\r\n\r\n /**\r\n * Complete the external login process.\r\n */\r\n completeExternalLogin = async (returnUrl: string = '', remoteError: string = '') => {\r\n const result = await this.api.get(`/api/account/completeExternalLogin?returnUrl=${encodeURIComponent(returnUrl ?? '')}&remoteError=${encodeURIComponent(remoteError ?? '')}`);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates an account linked to the current external login with the additional details passed in.\r\n */\r\n createAccountForExternalLogin = async (model: CreateExternalLoginAccountDetails, returnUrl: string = ''): Promise => {\r\n const result = await this.api.post(\r\n `/api/account/createAccountForExternalLogin?returnUrl=${encodeURIComponent(returnUrl ?? '')}`,\r\n model,\r\n {\r\n credentials: 'include'\r\n });\r\n return result;\r\n }\r\n\r\n /**\r\n * Send a password reset email.\r\n */\r\n sendPasswordResetEmail = async (email: string) => {\r\n const result = await this.api.post(`/api/account/sendPasswordResetEmail`, { email: email });\r\n return result;\r\n }\r\n\r\n /**\r\n * Reset password (using an emailed code as varification).\r\n */\r\n resetPassword = async (model: ResetPasswordRequest) => {\r\n const result = await this.api.post(`/api/account/resetPassword`, model);\r\n return result;\r\n }\r\n\r\n /**\r\n * Confirm email (using an emailed code as varification).\r\n */\r\n confirmEmail = async (model: ConfirmEmailRequest) => {\r\n const result = await this.api.post(`/api/account/confirmEmail`, model);\r\n return result;\r\n }\r\n\r\n /**\r\n * Confirm email change (using an emailed code as varification).\r\n */\r\n confirmEmailChange = async (model: ConfirmEmailChangeRequest) => {\r\n const result = await this.api.post(\r\n `/api/account/confirmEmailChange`,\r\n model,\r\n {\r\n credentials: 'include'\r\n });\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns the IdentityRoles names of the current user.\r\n */\r\n currentUserRoles = async (): Promise => {\r\n const result = await this.api.get(\r\n '/api/account/currentUserRoles',\r\n {\r\n credentials: 'include'\r\n });\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Change password of the logged in user.\r\n */\r\n changePassword = async (model: ChangePasswordRequest) => {\r\n const result = await this.api.post(\r\n `/api/account/changePassword`,\r\n model,\r\n {\r\n credentials: 'include'\r\n });\r\n return result;\r\n }\r\n\r\n /**\r\n * Change email of the logged in user.\r\n */\r\n changeEmail = async (model: ChangeEmailRequest) => {\r\n const result = await this.api.post(\r\n `/api/account/changeEmail`,\r\n model,\r\n {\r\n credentials: 'include'\r\n });\r\n return result;\r\n }\r\n\r\n /**\r\n * Resent the email verification email.\r\n */\r\n resendConfirmEmail = async (email: string) => {\r\n const result = await this.api.post(\r\n `/api/account/resendConfirmEmail`,\r\n { email: email }\r\n );\r\n return result;\r\n }\r\n\r\n\r\n /**\r\n * Change email of the logged in user.\r\n */\r\n invite = async (model: InviteRequest) => {\r\n const result = await this.api.post(\r\n `/api/account/invite`,\r\n model,\r\n {\r\n credentials: 'include'\r\n }\r\n );\r\n return result;\r\n }\r\n\r\n /**\r\n * Resent the invite email.\r\n */\r\n resendInviteEmail = async (email: string) => {\r\n const result = await this.api.post(\r\n `/api/account/resendInviteEmail`,\r\n { email: email }\r\n );\r\n return result;\r\n }\r\n\r\n /**\r\n * Confirm an invite and set a password (will also perform a login).\r\n */\r\n confirmInvite = async (model: ConfirmInviteRequest, returnUrl: string = '') => {\r\n const result = await this.api.post(\r\n `/api/account/confirmInvite?returnUrl=${encodeURIComponent(returnUrl || defaultRegisterReturnUrl)}`,\r\n model\r\n );\r\n return result;\r\n }\r\n\r\n /**\r\n * Change email of another user (as an administrator)\r\n */\r\n changeAccountEmail = async (model: ChangeAccountEmailRequest) => {\r\n const result = await this.api.post(\r\n `/api/account/changeAccountEmail`,\r\n model,\r\n {\r\n credentials: 'include'\r\n });\r\n return result;\r\n }\r\n\r\n /**\r\n * Lockout a user.\r\n */\r\n lockout = async (model: LockoutRequest) => {\r\n const result = await this.api.post(\r\n `/api/account/lockout`,\r\n model,\r\n {\r\n credentials: 'include'\r\n }\r\n );\r\n return result;\r\n }\r\n}\r\n\r\nconst defaultRegisterReturnUrl = `/authentication/login?returnUrl=${encodeURIComponent(window.origin + '/')}`;\r\n\r\nexport interface LoginWithPasswordRequest\r\n{\r\n email: string,\r\n password: string,\r\n rememberMe: boolean,\r\n}\r\n\r\nexport interface LoginResult {\r\n succeeded: boolean,\r\n requiresTwoFactor: boolean,\r\n requiresEmailConfirmation: boolean,\r\n returnUrl: string\r\n}\r\n\r\nexport interface RegisterResult extends LoginResult {\r\n userId: string,\r\n}\r\n\r\nexport interface ExternalAuthenticationScheme {\r\n name: string,\r\n displayName: string\r\n}\r\n\r\nexport interface Claim {\r\n type: string,\r\n properties: { [id: string]: string },\r\n originalIssuer: string,\r\n issuer: string,\r\n valueType: string,\r\n value: string,\r\n}\r\n\r\nexport interface CompleteExternalLoginResult {\r\n isNewUser: boolean,\r\n returnUrl: string,\r\n loginProvider: string,\r\n claims: Array,\r\n}\r\n\r\nexport interface CreateExternalLoginAccountDetails {\r\n email: string\r\n}\r\n\r\nexport interface RegisterRequest {\r\n email: string,\r\n password: string,\r\n}\r\n\r\nexport interface ResetPasswordRequest {\r\n userId: string,\r\n code: string,\r\n password: string,\r\n}\r\n\r\nexport interface ConfirmEmailRequest {\r\n userId: string,\r\n code: string,\r\n}\r\n\r\nexport interface CurrentUserRolesResult {\r\n userId: string,\r\n roles: Array,\r\n}\r\n\r\nexport interface ChangePasswordRequest {\r\n currentPassword: string,\r\n newPassword: string,\r\n}\r\n\r\nexport interface ChangeEmailRequest {\r\n newEmail: string,\r\n}\r\n\r\nexport interface ConfirmEmailChangeRequest {\r\n userId: string,\r\n code: string,\r\n email: string,\r\n}\r\n\r\nexport interface InviteRequest {\r\n email: string,\r\n sendEmail: boolean,\r\n}\r\n\r\nexport interface InviteResult {\r\n userId: string,\r\n}\r\n\r\n\r\nexport interface ChangeAccountEmailRequest {\r\n currentEmail: string,\r\n newEmail: string,\r\n}\r\n\r\nexport interface ConfirmInviteRequest {\r\n userId: string,\r\n code: string,\r\n password: string,\r\n}\r\n\r\nexport interface LockoutRequest {\r\n email: string,\r\n endDate?: string,\r\n}\r\n","/**\r\n * URIs of common claim types. \r\n */\r\nexport const ClaimTypes = {\r\n /**\r\n * The URI for a claim that specifies the actor.\r\n */\r\n actor: 'http://schemas.xmlsoap.org/ws/2009/09/identity/claims/actor',\r\n /**\r\n * The URI for a claim that specifies the postal code of an entity.\r\n */\r\n postalCode: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/postalcode',\r\n /**\r\n * The URI for a claim that specifies an RSA key.\r\n */\r\n rsa: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/rsa',\r\n /**\r\n * The URI for a claim that specifies a security identifier (SID).\r\n */\r\n sid: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/sid',\r\n /**\r\n * The URI for a claim that specifies a service principal name (SPN) claim.\r\n */\r\n spn: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/spn',\r\n /**\r\n * The URI for a claim that specifies the state or province in which an entity resides.\r\n */\r\n stateOrProvince: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/stateorprovince',\r\n /**\r\n * The URI for a claim that specifies the street address of an entity.\r\n */\r\n streetAddress: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/streetaddress',\r\n /**\r\n * The URI for a claim that specifies the surname of an entity.\r\n */\r\n surname: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname',\r\n /**\r\n * The URI for a claim that identifies the system entity.\r\n */\r\n system: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/system',\r\n /**\r\n * The URI for a claim that specifies a thumbprint. A thumbprint is a globally unique SHA-1 hash of an X.509 certificate.\r\n */\r\n thumbprint: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/thumbprint',\r\n /**\r\n * The URI for a claim that specifies a user principal name (UPN).\r\n */\r\n upn: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn',\r\n /**\r\n * The URI for a claim that specifies a URI.\r\n */\r\n uri: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/uri',\r\n /**\r\n * The URI for a claim that specifies the webpage of an entity.\r\n */\r\n webpage: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/webpage',\r\n /**\r\n * The URI for a claim that specifies the alternative phone number of an entity.\r\n */\r\n otherPhone: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/otherphone',\r\n /**\r\n * The URI for a claim that specifies the name of an entity.\r\n */\r\n nameIdentifier: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier',\r\n /**\r\n * The URI for a claim that specifies the name of an entity.\r\n */\r\n name: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name',\r\n /**\r\n * The URI for a claim that specifies the mobile phone number of an entity.\r\n */\r\n mobilePhone: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/mobilephone',\r\n /**\r\n * The URI for a claim that specifies the anonymous user.\r\n */\r\n anonymous: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/anonymous',\r\n /**\r\n * The URI for a claim that specifies details about whether an identity is authenticated.\r\n */\r\n authentication: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/authentication',\r\n /**\r\n * The URI for a claim that specifies an authorization decision on an entity.\r\n */\r\n authorizationDecision: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/authorizationdecision',\r\n /**\r\n * The URI for a claim that specifies the country/region in which an entity resides,\r\n */\r\n country: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country',\r\n /**\r\n * The URI for a claim that specifies the date of birth of an entity.\r\n */\r\n dateOfBirth: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dateofbirth',\r\n /**\r\n * The URI for a claim that specifies a deny-only security identifier (SID) for\r\n * an entity. A deny-only SID denies the specified entity to a securable object.\r\n */\r\n denyOnlySid: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/denyonlysid',\r\n /**\r\n * The URI for a claim that specifies the email address of an entity.\r\n */\r\n email: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress',\r\n /**\r\n * The URI for a claim that specifies the gender of an entity.\r\n */\r\n gender: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/gender', \r\n /**\r\n * The URI for a claim that specifies the given name of an entity.\r\n */\r\n givenName: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname',\r\n /**\r\n * The URI for a claim that specifies a hash value.\r\n */\r\n hash: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/hash',\r\n /**\r\n * The URI for a claim that specifies the home phone number of an entity.\r\n */\r\n homePhone: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/homephone',\r\n /**\r\n * The URI for a claim that specifies the locale in which an entity resides.\r\n */\r\n locality: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/locality',\r\n /**\r\n * The URI for a claim that specifies the DNS name associated with the computer\r\n * name or with the alternative name of either the subject or issuer of an X.509\r\n * certificate.\r\n */\r\n dns: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dns',\r\n /**\r\n * The URI for an X.500 distinguished name claim, such as the subject of an X.509\r\n * Public Key Certificate or an entry identifier in a directory services Directory\r\n * Information Tree.\r\n */\r\n x500DistinguishedName: 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/x500distinguishedname',\r\n}\r\n\r\n/**\r\n * URIs of common Microsoft specific claim types. \r\n */\r\nexport const MicrosoftClaimTypes = {\r\n /**\r\n * The URI for a claim that specifies the primary group SID of an entity.\r\n */\r\n primaryGroupSid: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/primarygroupsid',\r\n /**\r\n * The URI for a claim that specifies the primary SID of an entity.\r\n */\r\n primarySid: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid',\r\n /**\r\n * The URI for a claim that specifies the role of an entity.\r\n */\r\n role: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/role',\r\n /**\r\n * The URI for a claim that specifies a serial number.\r\n */\r\n serialNumber: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/serialnumber',\r\n /**\r\n * The URI for a claim that specifies the user data.\r\n */\r\n userData: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/userdata',\r\n /**\r\n * The URI for a claim that specifies the version.\r\n */\r\n version: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/version',\r\n /**\r\n * The URI for a claim that specifies the Windows domain account name of an entity.\r\n */\r\n windowsAccountName: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname',\r\n /**\r\n * The URI for a claim that specifies the Windows device.\r\n */\r\n windowsDeviceClaim: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsdeviceclaim',\r\n /**\r\n * The URI for a claim that specifies the Windows group SID of the device.\r\n */\r\n windowsDeviceGroup: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsdevicegroup',\r\n /**\r\n * \r\n */\r\n windowsFqbnVersion: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsfqbnversion',\r\n /**\r\n * \r\n */\r\n windowsSubAuthority: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/windowssubauthority',\r\n /**\r\n * The URI for a claim that specifies the instant at which an entity was authenticated,\r\n */\r\n authenticationInstant: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationinstant',\r\n /**\r\n * The URI for a claim that specifies the method with which an entity was authenticated,\r\n */\r\n authenticationMethod: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod',\r\n /**\r\n * The URI for a claim that specifies the cookie path.\r\n */\r\n cookiePath: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/cookiepath',\r\n /**\r\n * The URI for a claim that specifies the deny-only primary group SID on an entity,\r\n * A deny-only SID denies the specified entity to a securable object.\r\n */\r\n denyOnlyPrimaryGroupSid: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarygroupsid',\r\n /**\r\n * The URI for a claim that specifies the deny-only primary SID on an entity.\r\n * A deny-only SID denies the specified entity to a securable object.\r\n */\r\n denyOnlyPrimarySid: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarysid',\r\n /**\r\n * \r\n */\r\n windowsUserClaim: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsuserclaim',\r\n /**\r\n * The URI for a claim that specifies the Windows deny-only group SID of the device,\r\n */\r\n denyOnlyWindowsDeviceGroup: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlywindowsdevicegroup',\r\n /**\r\n */\r\n dsa: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/dsa',\r\n /**\r\n * \r\n */\r\n expiration: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/expiration',\r\n /**\r\n * \r\n */\r\n expired: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/expired',\r\n /**\r\n * The URI for a claim that specifies the SID for the group of an entity.\r\n */\r\n groupSid: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid',\r\n /**\r\n * \r\n */\r\n isPersistent: 'http://schemas.microsoft.com/ws/2008/06/identity/claims/ispersistent',\r\n}\r\n","import { AccountService } from \"./AccountService\";\r\nimport { useServices } from \"inject-typesafe-react\";\r\nimport { AppServices } from \"../../configure/configureServices\";\r\n\r\n/**\r\n * Hook to return the AccountService from the context (via useService).\r\n */\r\nexport function useAccountService(): AccountService {\r\n return useServices((services: AppServices) => services.accountService());\r\n}\r\n","import * as React from 'react';\r\nimport { useServices } from \"inject-typesafe-react\";\r\nimport { AppServices } from \"../../configure/configureServices\";\r\nimport { CacheOptions } from '../cacheInRedux';\r\n\r\n/**\r\n * Use state stored in the redux cache via CacheService.\r\n * @param id\r\n */\r\nexport function useCache(key: string): [T | null, (value: T, options?: CacheOptions) => void] {\r\n const cacheService = useServices((services: AppServices) => services.cacheService());\r\n\r\n const setState = React.useCallback((value: T, options?: CacheOptions) => {\r\n cacheService.storeInCache(key, value, options);\r\n }, [cacheService, key]);\r\n\r\n return [cacheService.readFromCache(key), setState];\r\n}","import * as React from \"react\";\r\nimport { AsyncLoadResult, AsyncLoadOptions } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { useAccountService } from \"./useAccountService\";\r\nimport { useAuthenticatedState } from \"../../api/api-authorization/useAuthenticatedState\";\r\nimport { isNullOrUndefined } from \"util\";\r\nimport { useCache } from \"../../shared/useCache\";\r\nimport { AccountService } from \"./AccountService\";\r\n\r\n/**\r\n * Refresh the current user state using the accountService.\r\n * @param isAuthenticated\r\n */\r\nconst refreshCurrentUserRoles = async (isAuthenticated: boolean | null, accountService: AccountService, setRoles: (value: RolesState) => void): Promise => {\r\n // Do nothing if we don't know our authentication state.\r\n if (isNullOrUndefined(isAuthenticated)) {\r\n return;\r\n }\r\n\r\n // If we are not authenticated then we have no roles.\r\n if (!isAuthenticated) {\r\n setRoles({ isAuthenticated: false, roles: [] });\r\n return;\r\n }\r\n\r\n // Otherwise we are authenticated, so load our roles.\r\n let result = await accountService.currentUserRoles();\r\n setRoles({ isAuthenticated: true, roles: result.roles });\r\n};\r\n\r\ninterface RolesState {\r\n isAuthenticated: boolean,\r\n roles: Array,\r\n}\r\n\r\n/**\r\n * Returns the list of roles for the current user.\r\n */\r\nexport function useCurrentUserRoles(options: AsyncLoadOptions = {}): AsyncLoadResult<{ roles: Array | null }> {\r\n const { isAuthenticated } = useAuthenticatedState();\r\n const [roles, setRoles] = useCache('currentUserRoles');\r\n const accountService = useAccountService();\r\n\r\n const [refresh, { isExecuting: isLoading, errors }] = useAsyncCallback(async () => {\r\n await refreshCurrentUserRoles(isAuthenticated, accountService, setRoles); \r\n }, [accountService, isAuthenticated]);\r\n\r\n React.useEffect(() => {\r\n if (options.lazy) {\r\n return;\r\n }\r\n\r\n // Refresh from the store if we need to.\r\n if (isNullOrUndefined(isAuthenticated)) {\r\n return;\r\n }\r\n\r\n if (!roles || roles.isAuthenticated !== isAuthenticated) {\r\n refresh();\r\n }\r\n }, [refresh, options.lazy, isAuthenticated, roles]);\r\n\r\n // TODO handle options.pollInterval.\r\n\r\n return {\r\n data: { roles: roles?.roles ?? null },\r\n refresh: refresh,\r\n isLoading: isLoading,\r\n errors: errors\r\n };\r\n}\r\n\r\n\r\n/**\r\n * Clear the cached user roles.\r\n */\r\nexport function useResetCurrentUserRolesCallback() {\r\n const { isAuthenticated } = useAuthenticatedState();\r\n const [/*roles*/, setRoles] = useCache('currentUserRoles');\r\n const accountService = useAccountService();\r\n\r\n const [refresh] = useAsyncCallback(async () => {\r\n await refreshCurrentUserRoles(isAuthenticated, accountService, setRoles);\r\n }, [accountService, isAuthenticated]);\r\n\r\n return React.useCallback(() => {\r\n refresh();\r\n }, [refresh]);\r\n}\r\n","import * as React from \"react\";\r\nimport { ExternalAuthenticationScheme } from \"./AccountService\";\r\nimport { AsyncLoadResult, AsyncLoadOptions } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Use the store to return a list of external authentication schemes for the app.\r\n */\r\nexport function useExternalAuthenticationSchemes(options: AsyncLoadOptions = {}): AsyncLoadResult<{ externalAuthenticationSchemes: Array }> {\r\n const [externalAuthenticationSchemes, setExternalAuthenticationSchemes] = React.useState>([]);\r\n\r\n const accountService = useAccountService();\r\n\r\n const [refresh, { isExecuting: isLoading, errors }] = useAsyncCallback(async () => {\r\n let result = await accountService.getExternalAuthenticationSchemes();\r\n setExternalAuthenticationSchemes(result);\r\n }, [accountService, setExternalAuthenticationSchemes]);\r\n\r\n React.useEffect(() => {\r\n if (!options.lazy) {\r\n refresh();\r\n }\r\n }, [refresh, options.lazy]);\r\n\r\n // TODO handle options.pollInterval.\r\n\r\n return {\r\n data: { externalAuthenticationSchemes: externalAuthenticationSchemes },\r\n refresh: refresh,\r\n isLoading: isLoading,\r\n errors: errors\r\n };\r\n}\r\n","import { AsyncActionStatus } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Callback to resend the email confirmation email.\r\n */\r\nexport function useResendConfirmationEmailCallback(): [(email: string) => Promise, AsyncActionStatus] {\r\n const accountService = useAccountService();\r\n\r\n const [action, { isExecuting, errors }] = useAsyncCallback(async (email: string) => {\r\n return await accountService.resendConfirmEmail(email);\r\n }, [accountService]);\r\n\r\n return [action, { isExecuting, errors }];\r\n}\r\n","import { AsyncActionStatus } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Callback to Start the external login process for a provider.\r\n */\r\nexport function useStartExternalLoginCallback(): [(provider: string, returnUrl?: string) => Promise, AsyncActionStatus] {\r\n const accountService = useAccountService();\r\n\r\n const [action, { isExecuting, errors }] = useAsyncCallback(async (provider: string, returnUrl?: string): Promise => {\r\n accountService.startExternalLogin(provider, returnUrl);\r\n }, [accountService]);\r\n\r\n return [action, { isExecuting, errors }];\r\n}\r\n","import * as React from 'react';\r\nimport { isNullOrUndefined } from 'util';\r\nimport { useAuthenticatedState } from '../../api/api-authorization/useAuthenticatedState';\r\nimport { useCurrentUserRoles } from '../../api/account';\r\n\r\nexport interface AuthorizeContainerProps {\r\n requireRole?: string | Array,\r\n children?: React.ReactNode,\r\n}\r\n\r\n/**\r\n * Container component that will check for authorization before showing its children.\r\n * @param props\r\n */\r\nexport const AuthorizeContainer = (props: AuthorizeContainerProps) => {\r\n const { isAuthenticated } = useAuthenticatedState();\r\n const { data: { roles: usersRoles } } = useCurrentUserRoles();\r\n const [ hasRequiredRole, setHasRequiredRole ] = React.useState(); \r\n\r\n // Load the roles only if we need to.\r\n React.useEffect(() => {\r\n if (props.requireRole && !isNullOrUndefined(usersRoles)) {\r\n const requireRoles = [props.requireRole].flat(2);\r\n let hasRole = false;\r\n for (let roleToCheck of requireRoles) {\r\n if (usersRoles.find(it => it === roleToCheck)) {\r\n hasRole = true;\r\n break;\r\n }\r\n }\r\n setHasRequiredRole(hasRole);\r\n }\r\n }, [props.requireRole, usersRoles, setHasRequiredRole, isAuthenticated]);\r\n\r\n // Render the UI\r\n //\r\n const { children } = props;\r\n\r\n // Show nothing until we have a defined authenticated state.\r\n if (isNullOrUndefined(isAuthenticated)) {\r\n return (<>);\r\n }\r\n\r\n // If we are not authenticted, then retun nothing.\r\n if (!isAuthenticated) {\r\n return (<>);\r\n }\r\n\r\n // If we need to check a role but don't have the roles to check yet, show nothing.\r\n if (props.requireRole && isNullOrUndefined(usersRoles)) {\r\n return (<>);\r\n }\r\n\r\n // If we checked a role and didn't have one we were looking for, show nothing.\r\n if (hasRequiredRole === false) {\r\n return (<>);\r\n }\r\n\r\n // If we get here then we can render the children.\r\n return (<>{children})\r\n};\r\n","import * as React from 'react';\r\nimport { Route, Redirect, RouteProps } from 'react-router-dom';\r\nimport { isNullOrUndefined } from 'util';\r\nimport { useAuthenticatedState } from '../../api/api-authorization/useAuthenticatedState';\r\nimport { useCurrentUserRoles } from '../../api/account';\r\n\r\nexport interface AuthorizeRouteProps extends RouteProps {\r\n requireRole?: string | Array,\r\n}\r\n\r\n/**\r\n * Route component that will check for authorization before showing its component.\r\n * \r\n * NOTE this was originally based on AuthorizeRoute from Microsoft's template but converted to typescript and React hooks and to support more than just the component prop.\r\n * @param props\r\n */\r\nexport const AuthorizeRoute = (props: AuthorizeRouteProps) => {\r\n const { isAuthenticated } = useAuthenticatedState();\r\n const { data: { roles: usersRoles } } = useCurrentUserRoles();\r\n const [ hasRequiredRole, setHasRequiredRole ] = React.useState(); \r\n\r\n // Load the roles only if we need to.\r\n React.useEffect(() => {\r\n if (props.requireRole && !isNullOrUndefined(usersRoles)) {\r\n const requireRoles = [props.requireRole].flat(2);\r\n let hasRole = false;\r\n for (let roleToCheck of requireRoles) {\r\n if (usersRoles.find(it => it === roleToCheck)) {\r\n hasRole = true;\r\n break;\r\n }\r\n }\r\n setHasRequiredRole(hasRole);\r\n }\r\n }, [props.requireRole, usersRoles, setHasRequiredRole, isAuthenticated]);\r\n\r\n // Render the UI\r\n //\r\n const { component: Component, render, children, ...rest } = props;\r\n\r\n // Show nothing until we have a defined authenticated state.\r\n if (isNullOrUndefined(isAuthenticated)) {\r\n return (<>);\r\n }\r\n \r\n // If we need to check a role, but can't yet return nothing.\r\n if (props.requireRole && isNullOrUndefined(usersRoles)) {\r\n return (<>);\r\n }\r\n\r\n // If we don't have the role we require, show text saying so.\r\n if (hasRequiredRole === false) {\r\n return (<>Sorry you do not have permission to access this area.);\r\n }\r\n\r\n return (\r\n {\r\n if (isAuthenticated) {\r\n if (Component) {\r\n return ;\r\n } else if (render) {\r\n return render(props);\r\n } else {\r\n return children;\r\n }\r\n } else {\r\n const redirectUrl = `/authentication/login?returnUrl=${encodeURIComponent(window.location.href)}`\r\n return \r\n }\r\n }} />\r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { Route, Switch } from 'react-router';\r\nimport { RouteEntry } from '../../shared/routes';\r\nimport { AuthorizeRoute } from '../../shared/authorizeRoute';\r\n\r\nexport interface AppRoutesProps {\r\n routes: Array,\r\n}\r\n\r\nexport const AppRoutes = (props: AppRoutesProps) => {\r\n const { routes } = props;\r\n\r\n return (\r\n \r\n {\r\n routes.map((item, index) => {\r\n // If we need to authorize for this route then use an AuthorizeRoute.\r\n if (item.authorize || item.requireRole) {\r\n return ();\r\n }\r\n\r\n // Otherwise a simple Route will do.\r\n return ();\r\n })\r\n }\r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { Spinner } from 'reactstrap';\r\n\r\nexport interface LoadingIndicatorProps {\r\n className?: string,\r\n fullWidth?: boolean,\r\n size?: 'sm' | 'md' | 'lg',\r\n inline?: boolean,\r\n}\r\n\r\n/**\r\n * Simple spinner that can be shown during loading.\r\n */\r\nexport const LoadingIndicator = (props: LoadingIndicatorProps) => {\r\n const { className, fullWidth, size, inline } = props;\r\n\r\n const style = React.useMemo(() => {\r\n let ret: React.CSSProperties = {};\r\n if (fullWidth) {\r\n ret.width = '100%';\r\n ret.textAlign = 'center';\r\n }\r\n\r\n if (inline) {\r\n ret.display = 'inline';\r\n }\r\n\r\n return ret;\r\n }, [inline, fullWidth])\r\n\r\n return (\r\n
\r\n \r\n Loading\r\n
\r\n );\r\n};\r\n\r\n","import './background.scss';\r\n\r\nimport * as React from 'react';\r\n\r\nexport interface BackgroundProps {\r\n children?: React.ReactNode,\r\n className?: string,\r\n}\r\n\r\n/**\r\n * Background for making the back of screens look nicer.\r\n * @param props\r\n */\r\nexport const Background = (props: BackgroundProps) => {\r\n const { children, className } = props;\r\n\r\n return (\r\n
\r\n {children}\r\n
\r\n );\r\n};","import './accountBackground.scss';\r\n\r\nimport * as React from 'react';\r\nimport { BackgroundProps, Background } from '../shared/Background';\r\n\r\nexport interface AccountBackgroundProps extends BackgroundProps {\r\n}\r\n\r\nexport const AccountBackground = (props: AccountBackgroundProps) => {\r\n const { className, ...rest } = props;\r\n\r\n return ();\r\n};","import * as React from 'react';\r\nimport { LoadingIndicator } from '../shared/LoadingIndicator';\r\nimport { AccountBackground } from '../account/AccountBackground';\r\n\r\nexport interface LoginWaitingProps {\r\n waiting: boolean,\r\n message: string\r\n}\r\n\r\n/**\r\n * Component that is shown during waiting of any login or logout options.\r\n * \r\n * If you want to change the \"waiting\" screen between redirects for all login actions, this is where to do it.\r\n */\r\nexport const LoginWaiting = (props: LoginWaitingProps) => {\r\n const { waiting, message } = props;\r\n\r\n return (\r\n \r\n {/**/}\r\n\r\n {\r\n waiting ? (\r\n <>\r\n \r\n
\r\n {message}\r\n
\r\n \r\n ) : (\r\n <>\r\n {\r\n !!message ? (
{message}
) : null\r\n }\r\n \r\n )\r\n }\r\n
\r\n );\r\n};","export const QueryParameterNames = {\r\n ReturnUrl: 'returnUrl',\r\n Message: 'message'\r\n};\r\n\r\nexport const LogoutActions = {\r\n LogoutCallback: 'logout-callback',\r\n Logout: 'logout',\r\n LoggedOut: 'logged-out'\r\n};\r\n\r\nexport const LoginActions = {\r\n Login: 'login',\r\n LoginCallback: 'login-callback',\r\n LoginFailed: 'login-failed',\r\n Profile: 'profile',\r\n Register: 'register'\r\n};\r\n\r\nconst prefix = '/authentication';\r\n\r\nexport const ApplicationPaths = {\r\n DefaultLoginRedirectPath: '/',\r\n ApiAuthorizationPrefix: prefix,\r\n Login: `${prefix}/${LoginActions.Login}`,\r\n LoginFailed: `${prefix}/${LoginActions.LoginFailed}`,\r\n LoginCallback: `${prefix}/${LoginActions.LoginCallback}`,\r\n Register: `${prefix}/${LoginActions.Register}`,\r\n Profile: `${prefix}/${LoginActions.Profile}`,\r\n LogOut: `${prefix}/${LogoutActions.Logout}`,\r\n LoggedOut: `${prefix}/${LogoutActions.LoggedOut}`,\r\n LogOutCallback: `${prefix}/${LogoutActions.LogoutCallback}`,\r\n IdentityRegisterPath: '/account/register',\r\n IdentityManagePath: '/profile'\r\n};\r\n","import * as React from 'react'\r\nimport { LoginWaiting } from './LoginWaiting';\r\nimport { LoginActions, QueryParameterNames, ApplicationPaths } from './ApiAuthorizationConstants';\r\nimport authService, { AuthenticationResultStatus } from '../../api/api-authorization/AuthorizeService';\r\n\r\nexport interface LoginProps {\r\n action: string,\r\n}\r\n\r\nexport interface LoginState {\r\n message: string | undefined | null,\r\n}\r\n\r\n// The main responsibility of this component is to handle the user's login process.\r\n// This is the starting point for the login process. Any component that needs to authenticate\r\n// a user can simply perform a redirect to this component with a returnUrl query parameter and\r\n// let the component perform the login and return back to the return url.\r\nexport class Login extends React.Component {\r\n constructor(props: LoginProps) {\r\n super(props);\r\n\r\n this.state = {\r\n message: undefined\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n const action = this.props.action;\r\n switch (action) {\r\n case LoginActions.Login:\r\n this.login(this.getReturnUrl());\r\n break;\r\n case LoginActions.LoginCallback:\r\n this.processLoginCallback();\r\n break;\r\n case LoginActions.LoginFailed:\r\n const params = new URLSearchParams(window.location.search);\r\n const error = params.get(QueryParameterNames.Message);\r\n this.setState({ message: error });\r\n break;\r\n case LoginActions.Profile:\r\n this.redirectToProfile();\r\n break;\r\n case LoginActions.Register:\r\n this.redirectToRegister();\r\n break;\r\n default:\r\n throw new Error(`Invalid action '${action}'`);\r\n }\r\n }\r\n\r\n render() {\r\n const action = this.props.action;\r\n const { message } = this.state;\r\n\r\n switch (action) {\r\n case LoginActions.Login:\r\n return ();\r\n case LoginActions.LoginCallback:\r\n return ();\r\n case LoginActions.Profile:\r\n case LoginActions.Register:\r\n return ();\r\n default:\r\n throw new Error(`Invalid action '${action}'`);\r\n }\r\n }\r\n\r\n async login(returnUrl: string) {\r\n const state = { returnUrl };\r\n const result = await authService.signIn(state);\r\n switch (result.status) {\r\n case AuthenticationResultStatus.Redirect:\r\n break;\r\n case AuthenticationResultStatus.Success:\r\n await this.navigateToReturnUrl(returnUrl);\r\n break;\r\n case AuthenticationResultStatus.Fail:\r\n this.setState({ message: result.message });\r\n break;\r\n default:\r\n throw new Error(`Invalid status result ${result.status}.`);\r\n }\r\n }\r\n\r\n async processLoginCallback() {\r\n const url = window.location.href;\r\n const result = await authService.completeSignIn(url);\r\n switch (result.status) {\r\n case AuthenticationResultStatus.Redirect:\r\n // There should not be any redirects as the only time completeSignIn finishes\r\n // is when we are doing a redirect sign in flow.\r\n throw new Error('Should not redirect.');\r\n case AuthenticationResultStatus.Success:\r\n await this.navigateToReturnUrl(this.getReturnUrl(result.state));\r\n break;\r\n case AuthenticationResultStatus.Fail:\r\n this.setState({ message: result.message });\r\n break;\r\n default:\r\n throw new Error(`Invalid authentication result status '${result.status}'.`);\r\n }\r\n }\r\n\r\n getReturnUrl(state?: any) {\r\n const params = new URLSearchParams(window.location.search);\r\n const fromQuery = params.get(QueryParameterNames.ReturnUrl);\r\n if (fromQuery && !fromQuery.startsWith(`${window.location.origin}/`)) {\r\n // This is an extra check to prevent open redirects.\r\n throw new Error(\"Invalid return url. The return url needs to have the same origin as the current page.\")\r\n }\r\n return (state && state.returnUrl) || fromQuery || `${window.location.origin}/`;\r\n }\r\n\r\n redirectToRegister() {\r\n this.redirectToApiAuthorizationPath(`${ApplicationPaths.IdentityRegisterPath}?${QueryParameterNames.ReturnUrl}=${encodeURIComponent(ApplicationPaths.Login)}`);\r\n }\r\n\r\n redirectToProfile() {\r\n this.redirectToApiAuthorizationPath(ApplicationPaths.IdentityManagePath);\r\n }\r\n\r\n redirectToApiAuthorizationPath(apiAuthorizationPath: string) {\r\n const redirectUrl = `${window.location.origin}${apiAuthorizationPath}`;\r\n // It's important that we do a replace here so that when the user hits the back arrow on the\r\n // browser he gets sent back to where it was on the app instead of to an endpoint on this\r\n // component.\r\n window.location.replace(redirectUrl);\r\n }\r\n\r\n navigateToReturnUrl(returnUrl: string) {\r\n // It's important that we do a replace here so that we remove the callback uri with the\r\n // fragment containing the tokens from the browser history.\r\n window.location.replace(returnUrl);\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { LogoutActions, QueryParameterNames, ApplicationPaths } from './ApiAuthorizationConstants';\r\nimport { LoginWaiting } from './LoginWaiting';\r\nimport authService, { AuthenticationResultStatus } from '../../api/api-authorization/AuthorizeService';\r\nimport { Redirect } from 'react-router';\r\n\r\nexport interface LogoutProps {\r\n action: string,\r\n}\r\n\r\nexport interface LogoutState {\r\n message: string | undefined,\r\n isReady: boolean,\r\n authenticated: boolean,\r\n}\r\n\r\n// The main responsibility of this component is to handle the user's logout process.\r\n// This is the starting point for the logout process, which is usually initiated when a\r\n// user clicks on the logout button on the LoginMenu component.\r\nexport class Logout extends React.Component {\r\n constructor(props: LogoutProps) {\r\n super(props);\r\n\r\n this.state = {\r\n message: undefined,\r\n isReady: false,\r\n authenticated: false\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n const action = this.props.action;\r\n switch (action) {\r\n case LogoutActions.Logout:\r\n if (!!window.history.state.state.local) {\r\n this.logout(this.getReturnUrl());\r\n } else {\r\n // This prevents regular links to /authentication/logout from triggering a logout\r\n this.setState({ isReady: true, message: \"The logout was not initiated from within the page.\" });\r\n }\r\n break;\r\n case LogoutActions.LogoutCallback:\r\n this.processLogoutCallback();\r\n break;\r\n case LogoutActions.LoggedOut:\r\n this.setState({ isReady: true, message: \"You successfully logged out!\" });\r\n break;\r\n default:\r\n throw new Error(`Invalid action '${action}'`);\r\n }\r\n\r\n this.populateAuthenticationState();\r\n }\r\n\r\n render() {\r\n const { isReady, message } = this.state;\r\n if (!isReady) {\r\n return ();\r\n }\r\n\r\n const action = this.props.action;\r\n switch (action) {\r\n case LogoutActions.Logout:\r\n return ();\r\n case LogoutActions.LogoutCallback:\r\n return ();\r\n case LogoutActions.LoggedOut:\r\n return ();\r\n default:\r\n throw new Error(`Invalid action '${action}'`);\r\n } }\r\n\r\n async logout(returnUrl: string) {\r\n const state = { returnUrl };\r\n const isauthenticated = await authService.isAuthenticated();\r\n if (isauthenticated) {\r\n const result = await authService.signOut(state);\r\n switch (result.status) {\r\n case AuthenticationResultStatus.Redirect:\r\n break;\r\n case AuthenticationResultStatus.Success:\r\n await this.navigateToReturnUrl(returnUrl);\r\n break;\r\n case AuthenticationResultStatus.Fail:\r\n this.setState({ message: result.message });\r\n break;\r\n default:\r\n throw new Error(\"Invalid authentication result status.\");\r\n }\r\n } else {\r\n this.setState({ message: \"You successfully logged out!\" });\r\n }\r\n }\r\n\r\n async processLogoutCallback() {\r\n const url = window.location.href;\r\n const result = await authService.completeSignOut(url);\r\n switch (result.status) {\r\n case AuthenticationResultStatus.Redirect:\r\n // There should not be any redirects as the only time completeAuthentication finishes\r\n // is when we are doing a redirect sign in flow.\r\n throw new Error('Should not redirect.');\r\n case AuthenticationResultStatus.Success:\r\n await this.navigateToReturnUrl(this.getReturnUrl(result.state));\r\n break;\r\n case AuthenticationResultStatus.Fail:\r\n this.setState({ message: result.message });\r\n break;\r\n default:\r\n throw new Error(\"Invalid authentication result status.\");\r\n }\r\n }\r\n\r\n async populateAuthenticationState() {\r\n const authenticated = await authService.isAuthenticated();\r\n this.setState({ isReady: true, authenticated });\r\n }\r\n\r\n getReturnUrl(state?: any) {\r\n const params = new URLSearchParams(window.location.search);\r\n const fromQuery = params.get(QueryParameterNames.ReturnUrl);\r\n if (fromQuery && !fromQuery.startsWith(`${window.location.origin}/`)) {\r\n // This is an extra check to prevent open redirects.\r\n throw new Error(\"Invalid return url. The return url needs to have the same origin as the current page.\")\r\n }\r\n return (state && state.returnUrl) ||\r\n fromQuery ||\r\n `${window.location.origin}${ApplicationPaths.LoggedOut}`;\r\n }\r\n\r\n navigateToReturnUrl(returnUrl: string) {\r\n return window.location.replace(returnUrl);\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { Login } from './Login'\r\nimport { Logout } from './Logout'\r\nimport { RouteEntry } from '../../shared/routes';\r\n\r\nexport const apiAuthorizationRoutes: Array = [\r\n { path: '/authentication/login', render: () => loginAction('login') },\r\n { path: '/authentication/login-callback', render: () => loginAction('login-callback') },\r\n { path: '/authentication/login-failed', render: () => loginAction('login-failed') },\r\n { path: '/authentication/profile', render: () => loginAction('profile') },\r\n { path: '/authentication/register', render: () => loginAction('register') },\r\n\r\n { path: '/authentication/logout', render: () => logoutAction('logout') },\r\n { path: '/authentication/logout-callback', render: () => logoutAction('logout-callback') },\r\n { path: '/authentication/logged-out', render: () => logoutAction('logged-out') },\r\n];\r\n\r\nfunction loginAction(name: string){\r\n return ();\r\n}\r\n\r\nfunction logoutAction(name: string) {\r\n return ();\r\n}\r\n","import * as React from 'react';\r\nimport { Alert, AlertProps, Row, Col, Badge } from 'reactstrap';\r\nimport { userFriendlyErrorMessage, FriendlyErrorMessage } from '../userFriendlyErrorMessage';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { ConditionalFragment } from 'react-conditionalfragment';\r\n\r\n\r\nexport interface AlertOnErrorsProps extends AlertProps {\r\n errors?: any,\r\n children?: any,\r\n simple?: boolean,\r\n}\r\n\r\n/**\r\n * Alert that shows an if error is set.\r\n * @param props\r\n */\r\nexport const AlertOnErrors = (props: AlertOnErrorsProps) => {\r\n const { errors, color, simple, ...rest } = props;\r\n\r\n const [openErrors, setOpenErrors] = React.useState>([]);\r\n const isOpen = React.useCallback((key: string) => !!openErrors.find(it => it === key), [openErrors]);\r\n const toggleOpen = React.useCallback((key: string) => {\r\n setOpenErrors(prevState => {\r\n if (prevState.find(it => it === key)) {\r\n return prevState.filter(it => it !== key);\r\n } else {\r\n return [...prevState, key];\r\n }\r\n });\r\n }, [setOpenErrors]);\r\n\r\n // Get the friendly version of each error.\r\n const friendlyErrors = React.useMemo(() => {\r\n // Flatten up to three levels of errors (wrapping in our own array first) and removing any\r\n // empty items (e.g. null, undefined, '').\r\n let flatErrors = [errors].flat(4).filter(item => item ? true : false);\r\n\r\n // Make friendly versions of all the error messages.\r\n const ret: Array = [flatErrors.map(error => userFriendlyErrorMessage(error))].flat(2);\r\n return ret;\r\n }, [errors])\r\n\r\n // Group errors with the same message together.\r\n const errorGroups = React.useMemo(() => {\r\n let groups: Array<{ message: string, errors: Array }> = [];\r\n\r\n for (const error of friendlyErrors) {\r\n let group = groups.find(item => item.message === error.message);\r\n if (!group) {\r\n group = { message: error.message, errors: [] };\r\n groups.push(group);\r\n }\r\n\r\n group.errors.push(error);\r\n }\r\n\r\n return groups;\r\n }, [friendlyErrors]);\r\n \r\n // If we have no errors, return nothing.\r\n if (!friendlyErrors.length) {\r\n return null;\r\n }\r\n\r\n // If we are in simple mode, return a list of friendly messages with no grouping or options to expand for more details.\r\n if (!!simple) {\r\n return (\r\n \r\n {props.children}\r\n\r\n {\r\n friendlyErrors.map((item, index) => (\r\n
\r\n {item.message}\r\n
\r\n ))\r\n }\r\n
\r\n );\r\n }\r\n\r\n // If we are not in simple mode (the default) then provide an interactive list of errors with grouping and the ability to expand for more\r\n // details if the user wants to.\r\n return (\r\n \r\n {props.children}\r\n {\r\n errorGroups.map(item => (\r\n
\r\n \r\n \r\n
toggleOpen(item.message)} style={{ cursor: 'pointer' }}>\r\n \r\n <> {\r\n item.errors.length > 1 ? (\r\n \r\n {item.errors.length}\r\n \r\n ) : (\r\n \r\n \r\n \r\n )\r\n }\r\n 1}>\r\n <> \r\n \r\n
\r\n \r\n \r\n
\r\n {item.message}\r\n
\r\n \r\n {\r\n item.errors.map((error, index) => (\r\n
\r\n \r\n
\r\n {error.details}\r\n
\r\n
\r\n \r\n {JSON.stringify(error?.error, null, 4)}\r\n \r\n
\r\n ))\r\n }\r\n
\r\n \r\n
\r\n
\r\n ))\r\n }\r\n
\r\n );\r\n};\r\n","import './externalLoginButton.scss';\r\n\r\nimport * as React from 'react';\r\nimport { ButtonProps, Button } from 'reactstrap';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { IconProp } from '@fortawesome/fontawesome-svg-core';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport interface ExternalLoginButtonProps extends ButtonProps {\r\n provider: string,\r\n providerDisplayName?: string,\r\n}\r\n\r\ninterface ProviderDisplayOptions {\r\n text: string,\r\n icon: IconProp,\r\n className: string,\r\n}\r\n\r\n/**\r\n * Button for a an external service that can be used to log in. \r\n */\r\nexport const ExternalLoginButton = (props: ExternalLoginButtonProps) => {\r\n const { t } = useTranslation();\r\n const { provider, providerDisplayName, className: propsClassName, ...rest } = props;\r\n\r\n const { text, icon, className } = React.useMemo((): ProviderDisplayOptions => {\r\n switch (provider) {\r\n case 'Microsoft':\r\n return { text: t('externalLoginButton.microsoftAccountProviderText', 'Microsoft Account'), icon: ['fab', 'microsoft'], className: 'microsoft' };\r\n case 'Google':\r\n return { text: providerDisplayName ?? provider, icon: ['fab', 'google'], className: 'google' };\r\n case 'Facebook':\r\n return { text: providerDisplayName ?? provider, icon: ['fab', 'facebook'], className: 'facebook' };\r\n case 'Twitter':\r\n return { text: providerDisplayName ?? provider, icon: ['fab', 'twitter'], className: 'twitter' };\r\n default:\r\n return { text: providerDisplayName ?? provider, icon: 'external-link-alt', className: 'other' };\r\n }\r\n }, [provider, providerDisplayName, t]);\r\n\r\n return (\r\n \r\n );\r\n};\r\n","import './formButtons.scss';\r\n\r\nimport * as React from 'react';\r\n\r\nexport interface FormButtonsProps {\r\n className?: string,\r\n children: React.ReactNode\r\n}\r\n\r\n/**\r\n * Container for buttons (e.g. sumbit) at the bottom of a form. \r\n */\r\nexport const FormButtons = (props: FormButtonsProps) => {\r\n const { className, children } = props;\r\n\r\n return (\r\n
\r\n {children}\r\n
\r\n );\r\n};","import './mainContainer.scss'; \r\n\r\nimport * as React from 'react';\r\nimport { Container, ContainerProps } from 'reactstrap';\r\n\r\nexport interface MainContainerProps extends ContainerProps {\r\n}\r\n\r\n/**\r\n * Input that is hooked up for searching as the user types, by introducing an appropriate delay before raising the onSearch event.\r\n */\r\nexport const MainContainer = (props: MainContainerProps) => {\r\n const { className, children, ...rest } = props;\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};","import './banner.scss';\r\n\r\nimport * as React from 'react';\r\nimport { Container } from 'reactstrap';\r\n\r\nexport interface BannerProps {\r\n children?: React.ReactNode,\r\n className?: string,\r\n fluid?: boolean,\r\n}\r\n\r\n/**\r\n * Banner to show title and toolbars at the top of pages.\r\n * @param props\r\n */\r\nexport const Banner = (props: BannerProps) => {\r\n const { children, className, fluid } = props;\r\n\r\n return (\r\n
\r\n \r\n {children}\r\n \r\n
\r\n );\r\n};","\r\n/**\r\n * Rules for a password.\r\n * \r\n * This is designed to mirror PasswordOptions from ASP.NET Core Identity.\r\n */\r\nexport interface PasswordOptions {\r\n requireDigit: boolean,\r\n requiredLength: number,\r\n requireLowercase: boolean,\r\n requireNonAlphanumeric: boolean,\r\n requiredUniqueChars: number,\r\n requireUppercase: boolean\r\n}\r\n\r\n/**\r\n * Default PasswordOptions used when no custom options are supplied.\r\n * \r\n * The default rules match those for ASP.NET Core Identity to make it out-of-the-box compatible with backends using\r\n * ASP.NET Core identity, however there is no dependency on it and it can be used with any backend.\r\n */\r\nexport const defaultPasswordOptions = {\r\n requireDigit: true,\r\n requiredLength: 6,\r\n requireLowercase: true,\r\n requireNonAlphanumeric: true,\r\n requiredUniqueChars: 1,\r\n requireUppercase: true\r\n} as PasswordOptions;\r\n","import i18n from 'i18next';\r\nimport { PasswordOptions, defaultPasswordOptions } from './PasswordOptions';\r\n\r\n/**\r\n * Enforce and describe PasswordOptions.\r\n */\r\nexport class PasswordValidation {\r\n private readonly passwordOptions: PasswordOptions;\r\n\r\n constructor(passwordOptions?: PasswordOptions) {\r\n this.passwordOptions = passwordOptions ?? defaultPasswordOptions;\r\n }\r\n\r\n /**\r\n * Check password against the PasswordOptions and return a success indicator and an array of any errors, and a friendly description of all errors.\r\n * @param password\r\n */\r\n check(password: string): PasswordCheckResults {\r\n let ok = true;\r\n let errors: Array = [];\r\n\r\n if (this.passwordOptions.requiredLength > password.length) {\r\n ok = false;\r\n errors.push(i18n.t('passwordValidation.requiredLengthError', 'must be at least {{requiredLength}} characters long', { requiredLength: this.passwordOptions.requiredLength }));\r\n }\r\n\r\n if (this.passwordOptions.requiredUniqueChars > 1) {\r\n let charMap = Array();\r\n for (let i = 0; i < password.length; ++i) {\r\n let char = password.charAt(i);\r\n if (charMap.indexOf(char) !== -1) {\r\n charMap.push(char);\r\n\r\n // Break if we know enough to let the password pass on this rule.\r\n if (charMap.length > this.passwordOptions.requiredUniqueChars) {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (this.passwordOptions.requiredUniqueChars > charMap.length) {\r\n ok = false;\r\n errors.push(i18n.t('passwordValidation.requiredUniqueCharsError', 'must contain at least {{requiredUniqueChars}} unique characters', { requiredUniqueChars: this.passwordOptions.requiredUniqueChars }));\r\n }\r\n }\r\n\r\n if (this.passwordOptions.requireDigit) {\r\n let regExp = new RegExp('.*[0-9].*');\r\n if (!regExp.test(password)) {\r\n ok = false;\r\n errors.push(i18n.t('passwordValidation.requireDigitError', 'must contain a number'));\r\n }\r\n }\r\n\r\n if (this.passwordOptions.requireLowercase) {\r\n let regExp = new RegExp('.*[a-z].*');\r\n if (!regExp.test(password)) {\r\n ok = false;\r\n errors.push(i18n.t('passwordValidation.requireLowercaseError', 'must contain a lowercase letter'));\r\n }\r\n }\r\n\r\n if (this.passwordOptions.requireUppercase) {\r\n let regExp = new RegExp('.*[A-Z].*');\r\n if (!regExp.test(password)) {\r\n ok = false;\r\n errors.push(i18n.t('passwordValidation.requireUppercaseError', 'must contain a uppercase letter'));\r\n }\r\n }\r\n\r\n if (this.passwordOptions.requireNonAlphanumeric) {\r\n let regExp = new RegExp('.*[^0-9a-zA-Z].*');\r\n if (!regExp.test(password)) {\r\n ok = false;\r\n errors.push(i18n.t('passwordValidation.requireNonAlphanumericError', 'must contain a symbol (such as !$%&*@#)'));\r\n }\r\n }\r\n\r\n // Generate a textual description of all errors, or blank if there are no errors for errorDescription.\r\n let errorDescription: string = '';\r\n if (errors.length) {\r\n errorDescription = i18n.t('passwordValidation.errorDescription', 'Password {{errors}}', { errors: errors.join(', ') });\r\n }\r\n\r\n return { valid: ok, errors, errorDescription };\r\n }\r\n}\r\n\r\nexport interface PasswordCheckResults {\r\n valid: boolean,\r\n errors: Array,\r\n errorDescription: string,\r\n}\r\n\r\n","import * as React from 'react';\r\nimport { PasswordCheckResults, PasswordValidation } from './PasswordValidation';\r\nimport { generatePasswordRulesDescrption } from './generatePasswordRulesDescription';\r\n\r\nexport interface PasswordValidationResult {\r\n checkPassword: (password: string) => PasswordCheckResults,\r\n passwordRequirements: string,\r\n}\r\n\r\n/**\r\n * Hook for password validation.\r\n */\r\nexport function usePasswordValidation(): PasswordValidationResult {\r\n let passwordValidation = React.useMemo(() => new PasswordValidation(), []);\r\n let checkPassword = React.useCallback((password: string) => {\r\n return passwordValidation.check(password);\r\n }, [passwordValidation]);\r\n let passwordRequirements = React.useMemo(() => {\r\n return generatePasswordRulesDescrption(passwordValidation);\r\n }, [passwordValidation])\r\n\r\n return {\r\n checkPassword,\r\n passwordRequirements\r\n };\r\n}","import i18n from 'i18next';\r\nimport { PasswordValidation } from \"./PasswordValidation\";\r\n\r\n/**\r\n * Generates a plain text description of the password rules for passwordValidation.\r\n * @param passwordValidation\r\n */\r\nexport function generatePasswordRulesDescrption(passwordValidation: PasswordValidation): string {\r\n const { valid, errors: passwordErrors } = passwordValidation.check('');\r\n if (valid) {\r\n return '';\r\n }\r\n\r\n return i18n.t('generatePasswordRulesDescription.passwordRequirements', 'Your password {{requirements}}.', { requirements: passwordErrors.join(', ')});\r\n}\r\n","import gql from \"graphql-tag\";\r\nimport { roleGroupFields } from \"../generated/roleGroupFields\";\r\n\r\nexport const roleGroupFieldsFragment = gql`\r\n fragment roleGroupFields on RoleGroup {\r\n id\r\n name\r\n }\r\n`;\r\n\r\n\r\nexport type RoleGroup = Omit;","import gql from \"graphql-tag\";\r\nimport { userFields } from \"../generated/userFields\";\r\nimport { roleGroupFieldsFragment } from \"./RoleGroup\";\r\n\r\nexport const userFieldsFragment = gql`\r\n fragment userFields on User {\r\n id\r\n userName\r\n email\r\n emailConfirmed\r\n phoneNumberConfirmed\r\n twoFactorEnabled\r\n lockoutEnd\r\n lockoutEnabled\r\n accessFailedCount\r\n roleGroup {\r\n ...roleGroupFields\r\n }\r\n }\r\n\r\n ${roleGroupFieldsFragment}\r\n`;\r\n\r\n\r\nexport type User = Omit;\r\n","import gql from \"graphql-tag\";\r\nimport { profileFields } from \"../generated/profileFields\";\r\nimport { userFieldsFragment } from \"./User\";\r\n\r\nexport const profileFieldsFragment = gql`\r\n fragment profileFields on Profile {\r\n id\r\n userId\r\n firstName\r\n lastName\r\n bio\r\n archived\r\n\r\n user {\r\n ...userFields,\r\n }\r\n }\r\n\r\n ${userFieldsFragment}\r\n`;\r\n\r\n\r\nexport type Profile = Omit;\r\n","import * as React from \"react\";\r\nimport { FormGroup, Label } from \"reactstrap\";\r\nimport { useChanges } from \"../../shared/useChanges\";\r\nimport { useValidatorCallback, ValidateCallback } from \"pojo-validator-react\";\r\nimport { ValidatedInput } from \"pojo-validator-reactstrap\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Guid } from \"guid-string\";\r\nimport { Profile as ProfileModel } from '../../api/main/models/Profile';\r\nimport { useRegisterProfileCallback } from \"../../api/main/profiles/useRegisterProfileCallback\";\r\nimport { ProfileCreateInput } from \"../../api/main/generated/globalTypes\";\r\nimport { ValidationErrors } from \"pojo-validator\";\r\n\r\nexport interface RegisterProfileDetailsProps {\r\n // Public\r\n registerProfile: (userId: string) => Promise,\r\n isRegisteringProfile: boolean,\r\n registerProfileErrors: any,\r\n\r\n validate: ValidateCallback,\r\n validationErrors: ValidationErrors\r\n\r\n // Private\r\n model: ProfileModel,\r\n change: (changes: Partial) => void,\r\n changes: Partial\r\n}\r\n\r\n/**\r\n * Custom hook that lets users of RegisterProfileDetails own the state of the Profile without being aware of its format.\r\n * @param userId\r\n */\r\nexport function useRegisterProfileDetailsProps(): RegisterProfileDetailsProps {\r\n const { t } = useTranslation();\r\n\r\n const [_registerProfile, { isExecuting: isRegisteringProfile, errors: registerProfileErrors }] = useRegisterProfileCallback();\r\n const { model, change, changes } = useChanges(null, { id: Guid.newGuid(), firstName: '', lastName: '', bio: '' });\r\n\r\n const [validate, validationErrors] = useValidatorCallback((validation, fieldsToCheck) => {\r\n if (!model) {\r\n return;\r\n }\r\n\r\n const rules = {\r\n firstName: () => !model.firstName ? t('registerProfileDetails.firstNameRequired', 'First name is required') : '',\r\n lastName: () => !model.lastName ? t('registerProfileDetails.lastNameRequired', 'Last name is required') : '',\r\n //bio: () => '', // bio needs no validation.\r\n };\r\n\r\n validation.checkRules(rules, fieldsToCheck);\r\n }, [model]);\r\n\r\n const registerProfile = React.useCallback(async (userId: string) => {\r\n await _registerProfile({ ...model, userId: userId } as ProfileCreateInput);\r\n }, [_registerProfile, model]);\r\n\r\n return {\r\n registerProfile: registerProfile,\r\n isRegisteringProfile: isRegisteringProfile,\r\n registerProfileErrors: registerProfileErrors,\r\n\r\n validate: validate,\r\n validationErrors: validationErrors,\r\n\r\n model: model,\r\n change: change,\r\n changes: changes,\r\n };\r\n};\r\n\r\n\r\n/**\r\n * Allow the user to set their personal details on their profile during registration.\r\n */\r\nexport const RegisterProfileDetails = (props: RegisterProfileDetailsProps) => {\r\n const { model, change, validate, validationErrors } = props;\r\n const { t } = useTranslation();\r\n\r\n // Render the UI.\r\n //\r\n return (\r\n <>\r\n \r\n \r\n change({ firstName: e.currentTarget.value })} onBlur={e => validate('firstName')} validationErrors={validationErrors['firstName']} />\r\n \r\n \r\n \r\n change({ lastName: e.currentTarget.value })} onBlur={e => validate('lastName')} validationErrors={validationErrors['lastName']} />\r\n \r\n \r\n );\r\n};\r\n","import { AsyncActionStatus } from '../../../shared/abstractStore';\r\nimport { ProfileCreateInput } from '../generated/globalTypes';\r\nimport { registerProfileMutation, registerProfileMutationVariables } from '../generated/registerProfileMutation';\r\nimport { profileFieldsFragment } from '../models/Profile';\r\nimport { useMutation } from '@apollo/react-hooks';\r\nimport gql from 'graphql-tag';\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\n\r\n/**\r\n * Get a callback to create a Profile in the store during registration.\r\n */\r\nexport function useRegisterProfileCallback(): [(model: ProfileCreateInput) => Promise, AsyncActionStatus] {\r\n //throw new Error('Users cannot self register for this app.');\r\n\r\n const [mutationAction, { error }] = useMutation(\r\n gql`\r\n mutation registerProfileMutation ($model: ProfileCreateInput!) {\r\n registerProfile(model: $model) {\r\n ...profileFields\r\n }\r\n }\r\n\r\n ${profileFieldsFragment}\r\n `\r\n );\r\n\r\n // Wrap the mutation in a standard callback.\r\n const [action, { isExecuting, errors: actionErrors }] = useAsyncCallback(async (model: ProfileCreateInput) => {\r\n const result = await mutationAction({ variables: { model: model } });\r\n if (result.errors && result.errors.length) {\r\n throw result.errors;\r\n }\r\n }, [mutationAction]);\r\n\r\n return [action, { isExecuting: isExecuting, errors: error ? error.message : actionErrors }];\r\n}\r\n","import { WatchQueryFetchPolicy } from \"apollo-client\";\r\nimport { isRunningOnSecureNctxCoUk } from \"./secureNctxCoUkConfig\";\r\n\r\nexport const mainApiConfig = {\r\n endpoint: isRunningOnSecureNctxCoUk ? 'https://nct-students.azurewebsites.net/graphql' : '/graphql',\r\n blobUploadEndpoint: isRunningOnSecureNctxCoUk ? 'https://nct-students.azurewebsites.net/api/blobs' : '/api/blobs',\r\n defaultFetchPolicy: 'cache-and-network' as WatchQueryFetchPolicy,\r\n //defaultFetchPolicy: 'cache-first' as WatchQueryFetchPolicy,\r\n};","import * as React from \"react\";\r\nimport { FormGroup, Label, Input } from \"reactstrap\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { AlertOnErrors } from \"../../shared/alertOnErrors\";\r\nimport { useProfileForInvite } from \"../../api/main/profiles/useProfileForInvite\";\r\n\r\n/**\r\n * Allow the user to set their personal details on their profile during registration.\r\n */\r\nexport const ConfirmInviteProfileDetails = () => {\r\n const { t } = useTranslation();\r\n\r\n const { data: { model }, errors: loadingErrors } = useProfileForInvite();\r\n\r\n // Render the UI.\r\n //\r\n return (\r\n <>\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { useLazyQuery } from \"@apollo/react-hooks\";\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncLoadResult, AsyncLoadOptions } from '../../../shared/abstractStore';\r\nimport { profileForInviteQuery, profileForInviteQueryVariables } from '../generated/profileForInviteQuery';\r\nimport { profileFieldsFragment } from '../models/Profile';\r\nimport { mainApiConfig } from '../../../configure/mainApiConfig';\r\n\r\n/**\r\n * Get a Profile from the store using the information available when confirming an invite.\r\n * \r\n * This exists because useProfile() is secured to only load information for authenticated users. This method exists to use the details of an invite as\r\n * permission to load the details of the related profile.\r\n * \r\n * This version gets its details from the query string invite code.\r\n * \r\n * @param id\r\n * @param options\r\n */\r\nexport function useProfileForInvite(options: AsyncLoadOptions = {}): AsyncLoadResult {\r\n // Get the details from the query string.\r\n const { userId, code } = React.useMemo(() => {\r\n const params = new URLSearchParams(window.location.search);\r\n const userId = params.get('userId') ?? params.get('UserId') ?? '';\r\n const code = params.get('code') ?? params.get('Code') ?? '';\r\n return { userId, code };\r\n }, []);\r\n\r\n // Query the data we need form the api.\r\n const [load, { data, loading, error, refetch }] = useLazyQuery(\r\n gql`\r\n query profileForInviteQuery ($userId: ID!, $code: String!) {\r\n model: profileForInvite(userId: $userId, code: $code) {\r\n ...profileFields\r\n }\r\n }\r\n\r\n ${profileFieldsFragment}\r\n `,\r\n {\r\n variables: {\r\n userId: userId,\r\n code: code\r\n },\r\n fetchPolicy: options.fetchPolicy ?? mainApiConfig.defaultFetchPolicy,\r\n pollInterval: options.pollInterval,\r\n onCompleted: (data) => {\r\n if (options.onCompleted) {\r\n options.onCompleted(data);\r\n }\r\n }\r\n }\r\n );\r\n\r\n // Run the query (unless we are being lazy).\r\n React.useEffect(() => {\r\n if (!options.lazy) {\r\n load();\r\n }\r\n }, [options.lazy, load])\r\n\r\n // Return the results.\r\n const refresh = React.useCallback(async () => { !refetch ? await load() : await refetch(); }, [refetch, load]);\r\n return React.useMemo(() => ({\r\n data: data ?? ({} as any),\r\n refresh: refresh,\r\n isLoading: loading,\r\n errors: error\r\n }), [data, refresh, loading, error]);\r\n}\r\n","import { RouteEntry } from \"../../shared/routes\";\r\nimport { Login } from \"./Login\";\r\nimport { Register } from \"./Register\";\r\nimport { ExternalLoginCallback } from \"./ExternalLoginCallback\";\r\nimport { ConfirmEmail } from \"./ConfirmEmail\";\r\nimport { ForgotPassword } from './ForgotPassword';\r\nimport { ResetPassword } from \"./ResetPassword\";\r\nimport { ConfirmEmailChange } from \"./ConfirmEmailChange\";\r\nimport { ConfirmInvite } from \"./ConfirmInvite\";\r\n\r\nexport const accountRoutes: Array = [\r\n { path: '/account/login', component: Login },\r\n { path: '/account/register', component: Register },\r\n { path: '/account/externalLogin', component: ExternalLoginCallback },\r\n { path: '/account/forgotPassword', component: ForgotPassword },\r\n { path: '/account/resetPassword', component: ResetPassword },\r\n { path: '/account/confirmEmail', component: ConfirmEmail },\r\n { path: '/account/confirmEmailChange', component: ConfirmEmailChange },\r\n { path: '/account/confirmInvite', component: ConfirmInvite },\r\n];\r\n","import * as React from \"react\";\r\nimport { Form, Alert, FormGroup, Label, Button, CustomInput, Spinner } from \"reactstrap\";\r\nimport { AlertOnErrors } from \"../../shared/alertOnErrors\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { useChanges } from \"../../shared/useChanges\";\r\nimport { useValidatorCallback } from \"pojo-validator-react\";\r\nimport { ValidatedInput } from \"pojo-validator-reactstrap\";\r\nimport { ButtonAsync } from \"reactstrap-buttonasync\"\r\nimport { LoadingIndicator } from \"../../components/shared/LoadingIndicator\";\r\nimport { useExternalAuthenticationSchemes, useLoginWithPasswordCallback, useStartExternalLoginCallback, useResendConfirmationEmailCallback } from \"../../api/account\";\r\nimport { Login as LoginModel } from '../../api/account/models/Login';\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { ExternalLoginButton } from \"./ExternalLoginButton\";\r\nimport { LinkContainer } from \"react-router-bootstrap\";\r\nimport { FormButtons } from \"../shared/FormButtons\";\r\nimport { MainContainer } from \"../shared/MainContainer\";\r\nimport { AccountBackground } from \"./AccountBackground\";\r\nimport { Banner } from \"../shared/Banner\";\r\n\r\n/**\r\n * Login screen.\r\n */\r\nexport const Login = () => {\r\n const { t } = useTranslation();\r\n const { data: { externalAuthenticationSchemes }, isLoading, errors: loadErrors } = useExternalAuthenticationSchemes();\r\n const [login, { isExecuting: isLoggingIn, errors: loginErrors }] = useLoginWithPasswordCallback();\r\n const [startExternalLogin] = useStartExternalLoginCallback();\r\n const [isPendingEmailConfirmation, setIsPendingEmailConfirmation] = React.useState(false);\r\n const history = useHistory();\r\n\r\n const [resendConfirmationEmail, { isExecuting: isResendingConfirmationEmail, errors: resendConfirmationEmailErrors }] = useResendConfirmationEmailCallback();\r\n const [hasSentConfirmationEmail, setHasSentConfirmationEmail] = React.useState(false);\r\n\r\n const { model, change } = useChanges({ email: '', password: '', rememberMe: true });\r\n\r\n // Need the URL to pass on to registration or 2faif we redirect to it.\r\n const params = new URLSearchParams(window.location.search);\r\n const returnUrl = params.get('returnUrl') ?? params.get('ReturnUrl') ?? '';\r\n\r\n /**\r\n * Validate the model before trying to use it.\r\n */\r\n const [validate, validationErrors] = useValidatorCallback((validation, fieldsToCheck) => {\r\n const rules = {\r\n email: () => !model.email ? t('login.emailRequired', 'Email is required') : '',\r\n password: () => !model.password ? t('login.passwordRequired', 'Password is required') : '',\r\n };\r\n\r\n validation.checkRules(rules, fieldsToCheck);\r\n }, [model]);\r\n\r\n /**\r\n * Perform a login by and handle the result.\r\n */\r\n const [isDoingFullPageRedirect, setIsDoingFullPageRedirect] = React.useState(false);\r\n const performLogin = React.useCallback(async (): Promise => {\r\n if (!validate()) {\r\n return;\r\n }\r\n\r\n let result = await login(model);\r\n\r\n if (result) {\r\n setIsPendingEmailConfirmation(result.requiresEmailConfirmation);\r\n\r\n if (result.requiresTwoFactor) {\r\n history.push(`/account/loginWithTwoFactor?returnUrl=${encodeURIComponent(result.returnUrl)}`);\r\n }\r\n\r\n // Redirect the whole page (not just the react app) as its likely the returnUrl is handled on the server.\r\n if (result.succeeded) {\r\n // Redirect the whole page (not just react) to the returnUrl to let the server handle as well as the client.\r\n if (!result.requiresEmailConfirmation && !result.requiresTwoFactor) {\r\n setIsDoingFullPageRedirect(true);\r\n window.location.href = result.returnUrl;\r\n }\r\n }\r\n }\r\n }, [login, model, setIsPendingEmailConfirmation, history, validate, setIsDoingFullPageRedirect]);\r\n\r\n // Render the UI.\r\n return (\r\n \r\n \r\n

{t('login.signInHeading', 'Sign in to academic pass portal')}

\r\n
\r\n \r\n
{ e.preventDefault(); await performLogin(); }}>\r\n \r\n {\r\n isPendingEmailConfirmation ?\r\n hasSentConfirmationEmail ? (\r\n \r\n <>{t('login.confirmationEmailHasBeenResent', 'Confirmation link to verify the email for this account has been resent. Please check your email to confirm.')} \r\n { e.preventDefault(); await resendConfirmationEmail(model.email); setHasSentConfirmationEmail(true); }}\r\n isExecuting={isResendingConfirmationEmail}\r\n executingChildren={<>{t('common.sending', 'Sending...')}}>\r\n {t('common.resendEmail', 'Resend email')}\r\n \r\n \r\n ) : (\r\n \r\n <>{t('login.mustConfirmEmailBeforeLogin', 'You need to confirm your account before you can sign in. Please check your email.')} \r\n { e.preventDefault(); await resendConfirmationEmail(model.email); setHasSentConfirmationEmail(true); }}\r\n isExecuting={isResendingConfirmationEmail}\r\n executingChildren={<>{t('common.sending', 'Sending...')}}>\r\n {t('common.resendEmail', 'Resend email')}\r\n \r\n \r\n ) : null\r\n }\r\n \r\n \r\n change({ email: e.currentTarget.value })} onBlur={e => validate('email')} validationErrors={validationErrors['email']} />\r\n \r\n \r\n \r\n change({ password: e.currentTarget.value })} onBlur={e => validate('password')} validationErrors={validationErrors['password']} />\r\n \r\n \r\n change({ rememberMe: e.currentTarget.checked })} />\r\n \r\n\r\n \r\n {t('login.loggingIn', 'Logging in...')}}>\r\n {t('login.logIn', 'Log in')}\r\n \r\n\r\n \r\n \r\n \r\n {/*\r\n \r\n \r\n */}\r\n \r\n\r\n
\r\n {\r\n isLoading ? (\r\n \r\n ) : (\r\n <>\r\n
\r\n {\r\n !externalAuthenticationSchemes ? null\r\n : externalAuthenticationSchemes.length !== 0 ? (\r\n <>\r\n
{t('login.useExternalService', 'Or sign in using an identity provider')}
\r\n {\r\n externalAuthenticationSchemes.map((item) => (\r\n startExternalLogin(item.name, returnUrl)} />\r\n ))\r\n }\r\n \r\n )\r\n : null\r\n }\r\n
\r\n \r\n )\r\n }\r\n
\r\n \r\n
\r\n
\r\n );\r\n};\r\n","import * as React from \"react\";\r\nimport { LoginResult } from \"../../api/account\";\r\nimport { AsyncActionStatus } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { LoginWithPasswordRequest } from \"./AccountService\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Callback to Login using a password.\r\n */\r\nexport function useLoginWithPasswordCallback(): [(model: LoginWithPasswordRequest) => Promise, AsyncActionStatus] {\r\n const accountService = useAccountService();\r\n\r\n // Get the return url from the query string.\r\n const returnUrl = React.useMemo(() => {\r\n const params = new URLSearchParams(window.location.search);\r\n const returnUrl = params.get('returnUrl') ?? params.get('ReturnUrl') ?? '';\r\n return returnUrl;\r\n }, []);\r\n\r\n const [action, { isExecuting, errors }] = useAsyncCallback(async (model: LoginWithPasswordRequest) => {\r\n let result = await accountService.loginWithPassword(model, returnUrl);\r\n\r\n // If we have additional steps to take before we are completely signed in, handle those now.\r\n if (result.requiresTwoFactor || result.requiresEmailConfirmation) {\r\n // Don't want to redirect to returnUrl.\r\n return result;\r\n }\r\n\r\n // If we get here we have a successful login\r\n\r\n return result;\r\n }, [accountService]);\r\n\r\n return [action, { isExecuting, errors }];\r\n}\r\n","import * as React from \"react\";\r\nimport { Row, Col, Form, Alert, FormGroup, Label, Button, Spinner, FormText } from \"reactstrap\";\r\nimport { AlertOnErrors } from \"../../shared/alertOnErrors\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { useChanges } from \"../../shared/useChanges\";\r\nimport { useValidatorCallback } from \"pojo-validator-react\";\r\nimport { ValidatedInput } from \"pojo-validator-reactstrap\";\r\nimport { ButtonAsync } from \"reactstrap-buttonasync\"\r\nimport { LoadingIndicator } from \"../../components/shared/LoadingIndicator\";\r\nimport { useExternalAuthenticationSchemes, useStartExternalLoginCallback, useRegisterAccountCallback, useResendConfirmationEmailCallback } from \"../../api/account\";\r\nimport { Register as RegisterModel } from '../../api/account/models/Register';\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { ExternalLoginButton } from \"./ExternalLoginButton\";\r\nimport { FormButtons } from \"../shared/FormButtons\";\r\nimport { LinkContainer } from \"react-router-bootstrap\";\r\nimport { usePasswordValidation } from \"../../shared/passwordValidation\";\r\nimport { RegisterProfileDetails, useRegisterProfileDetailsProps } from \"../profiles/RegisterProfileDetails\";\r\nimport { MainContainer } from \"../shared/MainContainer\";\r\nimport { AccountBackground } from \"./AccountBackground\";\r\nimport { Banner } from \"../shared/Banner\";\r\n\r\n/**\r\n * Register screen.\r\n */\r\nexport const Register = () => {\r\n const { t } = useTranslation();\r\n const { data: { externalAuthenticationSchemes }, isLoading, errors: loadErrors } = useExternalAuthenticationSchemes();\r\n const [register, { isExecuting: isRegistering, errors: registerErrors }] = useRegisterAccountCallback();\r\n const [startExternalLogin] = useStartExternalLoginCallback();\r\n const [isPendingEmailConfirmation, setIsPendingEmailConfirmation] = React.useState(false);\r\n const [resendConfirmationEmail, { isExecuting: isResendingConfirmationEmail, errors: resendConfirmationEmailErrors }] = useResendConfirmationEmailCallback();\r\n const history = useHistory();\r\n\r\n const { checkPassword, passwordRequirements } = usePasswordValidation();\r\n\r\n const { model, change } = useChanges({ email: '', password: '', confirmPassword: '' });\r\n\r\n const registerProfileDetailsProps = useRegisterProfileDetailsProps();\r\n\r\n // Need the URL to pass on to registration or 2faif we redirect to it.\r\n const params = new URLSearchParams(window.location.search);\r\n const returnUrl = params.get('returnUrl') ?? params.get('ReturnUrl') ?? '';\r\n \r\n /**\r\n * Validate the model before trying to use it.\r\n */\r\n const [validate, validationErrors] = useValidatorCallback((validation, fieldsToCheck) => {\r\n const rules = {\r\n email: () => !model.email ? t('register.emailRequired', 'Email is required') : '',\r\n password: () => !model.password ? t('register.passwordRequired', 'Password is required')\r\n : checkPassword(model.password).errorDescription,\r\n confirmPassword: () => model.confirmPassword !== model.password ? t('register.passwordsDoNotMatch', 'The password and confirmation password do not match') : '',\r\n };\r\n\r\n validation.checkRules(rules, fieldsToCheck);\r\n\r\n // Check the profile details as well (ensuring an error reflects in our error state).\r\n validation.singleCheck('profileDetails', !registerProfileDetailsProps.validate(fieldsToCheck), 'Profile details has some validation errors');\r\n }, [model, registerProfileDetailsProps.validate]);\r\n\r\n /**\r\n * Perform a login by and handle the result.\r\n */\r\n const [isDoingFullPageRedirect, setIsDoingFullPageRedirect] = React.useState(false);\r\n const performRegister = React.useCallback(async (): Promise => {\r\n if (!validate()) {\r\n return;\r\n }\r\n\r\n const result = await register(model);\r\n\r\n if (result) {\r\n setIsPendingEmailConfirmation(result.requiresEmailConfirmation);\r\n\r\n // Save the profile.\r\n await registerProfileDetailsProps.registerProfile(result.userId);\r\n\r\n if (result.requiresTwoFactor) {\r\n setIsDoingFullPageRedirect(true);\r\n history.push(`/account/loginWithTwoFactor?returnUrl=${encodeURIComponent(result.returnUrl)}`);\r\n }\r\n\r\n // Redirect the whole page (not just the react app) as its likely the returnUrl is handled on the server.\r\n if (result.succeeded) {\r\n // Redirect the whole page (not just react) to the returnUrl to let the server handle as well as the client.\r\n if (!result.requiresEmailConfirmation && !result.requiresTwoFactor) {\r\n setIsDoingFullPageRedirect(true);\r\n window.location.href = result.returnUrl;\r\n }\r\n }\r\n }\r\n }, [register, model, setIsPendingEmailConfirmation, history, validate, registerProfileDetailsProps, setIsDoingFullPageRedirect]);\r\n \r\n // Render the UI.\r\n return (\r\n \r\n \r\n

{t('register.registerNewAccountHeading', 'Register a new account')}

\r\n
\r\n \r\n \r\n \r\n
{ e.preventDefault(); await performRegister(); }}>\r\n \r\n {\r\n isPendingEmailConfirmation ? (\r\n \r\n <>{t('register.confirmationEmailHasBeenResent', 'Please check your email to confirm your account. You won\\'t be able to login until you have confirmed your account.')} \r\n { e.preventDefault(); await resendConfirmationEmail(model.email); }}\r\n isExecuting={isResendingConfirmationEmail}\r\n executingChildren={<>{t('common.sending', 'Sending...')}}>\r\n {t('common.resendEmail', 'Resend email')}\r\n \r\n \r\n ) : null\r\n }\r\n\r\n \r\n\r\n \r\n \r\n change({ email: e.currentTarget.value })} onBlur={e => validate('email')} validationErrors={validationErrors['email']} />\r\n \r\n \r\n \r\n change({ password: e.currentTarget.value })} onBlur={e => validate('password')} validationErrors={validationErrors['password']} />\r\n \r\n {passwordRequirements}\r\n \r\n \r\n \r\n \r\n change({ confirmPassword: e.currentTarget.value })} onBlur={e => validate('confirmPassword')} validationErrors={validationErrors['confirmPassword']} />\r\n \r\n\r\n \r\n {t('register.registering', 'Registering...')}}>\r\n {t('register.register', 'Register')}\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n isLoading ? (\r\n \r\n ) : (\r\n <>\r\n
{t('register.useExternalService', 'Or register using an identity provider')}
\r\n
\r\n {\r\n !externalAuthenticationSchemes ? null\r\n : externalAuthenticationSchemes.length !== 0 ? (\r\n <>\r\n {\r\n externalAuthenticationSchemes.map((item) => (\r\n
\r\n startExternalLogin(item.name, returnUrl)} />\r\n
\r\n ))\r\n }\r\n \r\n ): null\r\n }\r\n
\r\n \r\n )\r\n }\r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n","import * as React from \"react\";\r\nimport { AsyncActionStatus } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { RegisterRequest, RegisterResult } from \"./AccountService\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Callback to Register an account.\r\n */\r\nexport function useRegisterAccountCallback(): [(model: RegisterRequest) => Promise, AsyncActionStatus] {\r\n const accountService = useAccountService();\r\n\r\n // Get the return url from the query string.\r\n const returnUrl = React.useMemo(() => {\r\n const params = new URLSearchParams(window.location.search);\r\n const returnUrl = params.get('returnUrl') ?? params.get('ReturnUrl') ?? '';\r\n return returnUrl;\r\n }, []);\r\n\r\n const [action, { isExecuting, errors }] = useAsyncCallback(async (model: RegisterRequest) => {\r\n let result = await accountService.register(model, returnUrl);\r\n\r\n // If we have additional steps to take before we are completely signed in, handle those now.\r\n if (result.requiresTwoFactor || result.requiresEmailConfirmation) {\r\n // Don't want to redirect to returnUrl.\r\n return result;\r\n }\r\n\r\n // If we get here we have a successful login\r\n\r\n return result;\r\n }, [accountService]);\r\n\r\n return [action, { isExecuting, errors }];\r\n}\r\n","import * as React from \"react\";\r\nimport { useCompletedExternalLoginDetails, useCreateAccountForExternalLoginCallback } from \"../../api/account\";\r\nimport { ClaimTypes } from \"../../api/account\";\r\nimport { useChanges } from \"../../shared/useChanges\";\r\nimport { useValidatorCallback } from \"pojo-validator-react\";\r\nimport { AlertOnErrors } from \"../../shared/alertOnErrors\";\r\nimport { LoadingIndicator } from \"../../components/shared/LoadingIndicator\";\r\nimport { FormGroup, Label, Form, Spinner } from \"reactstrap\";\r\nimport { ValidatedInput } from \"pojo-validator-reactstrap\";\r\nimport { ButtonAsync } from \"reactstrap-buttonasync\";\r\nimport { ExternalLoginCallback as ExternalLoginCallbackModel } from \"../../api/account/models/ExternalLoginCallback\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { RegisterProfileDetails, useRegisterProfileDetailsProps } from \"../profiles/RegisterProfileDetails\";\r\nimport { MainContainer } from \"../shared/MainContainer\";\r\nimport { AccountBackground } from \"./AccountBackground\";\r\nimport { Banner } from \"../shared/Banner\";\r\n\r\n/**\r\n * Complete an the external login.\r\n */\r\nexport const ExternalLoginCallback = () => {\r\n const { t } = useTranslation();\r\n const { data: { isNewUser, loginProvider, returnUrl, claims }, isLoading, errors: loadErrors } = useCompletedExternalLoginDetails();\r\n const [createAccount, { isExecuting: isCreatingAccount, errors: createAccountErrors }] = useCreateAccountForExternalLoginCallback();\r\n\r\n const registerProfileDetailsProps = useRegisterProfileDetailsProps();\r\n\r\n const { model, change } = useChanges({ email: '' });\r\n const [validate, validationErrors] = useValidatorCallback((validation, fieldsToCheck) => {\r\n if (!model) {\r\n return;\r\n }\r\n\r\n const rules = {\r\n email: () => !model.email ? t('externalLoginCallback.emailRequired', 'Email is required') : '',\r\n };\r\n validation.checkRules(rules, fieldsToCheck);\r\n\r\n // Check the profile details as well (ensuring an error reflects in our error state).\r\n validation.singleCheck('profileDetails', !registerProfileDetailsProps.validate(fieldsToCheck), 'Profile details has some validation errors');\r\n }, [model]);\r\n\r\n // When the data returned by the external login changes, we want to use it to either default some changes or redirect away from the page.\r\n React.useEffect(() => {\r\n // If this is not a new user just redirect to their target page.\r\n if (!isNewUser) {\r\n // Redirect the whole page (not just the react app) as its likely the returnUrl is handled on the server.\r\n window.location.href = returnUrl || '/';\r\n } else {\r\n // Default the email in the model for new users (if the external login provided one).\r\n let emailClaim = claims.find(item => item.type === ClaimTypes.email);\r\n if (emailClaim && emailClaim.value) {\r\n change({ email: emailClaim.value });\r\n }\r\n }\r\n }, [isNewUser, returnUrl, claims, change]);\r\n\r\n // Render the UI.\r\n //\r\n\r\n // If we're not ready, show the loading indicator.\r\n if (isLoading || !isNewUser) {\r\n return (\r\n <>\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n // Render the external login registration view.\r\n return (\r\n \r\n \r\n

{t('externalLoginCallback.registerAccountHeading', 'Register with your {{loginProvider}} account', { context: loginProvider, loginProvider: loginProvider })}

\r\n\r\n

\r\n {t('externalLOginCallback.registerHelpText', 'You\\'ve successfully authenticated with {loginProvider}. Please enter an email address for this site below and click the Register button to finish logging in.')}\r\n

\r\n
\r\n \r\n
{\r\n e.preventDefault();\r\n if (!validate()) {\r\n return;\r\n }\r\n\r\n const result = await createAccount(model)\r\n if (result) {\r\n // Save the profile.\r\n await registerProfileDetailsProps.registerProfile(result.userId);\r\n }\r\n }}>\r\n \r\n\r\n\r\n \r\n\r\n \r\n \r\n change({ email: e.currentTarget.value })} onBlur={e => validate('email')} validationErrors={validationErrors['email']} />\r\n \r\n {t('externalLoginCallback.registring', 'Registering...')}}>\r\n {t('externalLoginCallback.register', 'Register')}\r\n \r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\n","import * as React from \"react\";\r\nimport { AsyncLoadResult, AsyncLoadOptions } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { CompleteExternalLoginResult } from \"./AccountService\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Details of the external login that has just completed and invoked our callback.\r\n */\r\nexport function useCompletedExternalLoginDetails(options: AsyncLoadOptions = {}): AsyncLoadResult {\r\n const [data, setData] = React.useState({ claims: [], isNewUser: false, loginProvider: '', returnUrl: '' });\r\n\r\n const accountService = useAccountService();\r\n\r\n // Get the details from the external login off the query string.\r\n const { returnUrl, remoteError } = React.useMemo(() => {\r\n const params = new URLSearchParams(window.location.search);\r\n const returnUrl = params.get('returnUrl') ?? params.get('ReturnUrl') ?? '';\r\n const remoteError = params.get('remoteError') ?? params.get('RemoteError') ?? '';\r\n return { returnUrl, remoteError};\r\n }, []);\r\n\r\n const [refresh, { isExecuting: isLoading, errors }] = useAsyncCallback(async () => {\r\n let result = await accountService.completeExternalLogin(returnUrl, remoteError);\r\n setData(result);\r\n }, [accountService, returnUrl, remoteError, setData]);\r\n\r\n React.useEffect(() => {\r\n if (!options.lazy) {\r\n refresh();\r\n }\r\n }, [refresh, options.lazy]);\r\n\r\n // TODO handle options.pollInterval.\r\n\r\n return {\r\n data: data,\r\n refresh: refresh,\r\n isLoading: isLoading,\r\n errors: errors\r\n };\r\n}\r\n","import * as React from \"react\";\r\nimport { AsyncActionStatus } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { CreateExternalLoginAccountDetails, RegisterResult } from \"./AccountService\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Register an account for an authenticated external login.\r\n */\r\nexport function useCreateAccountForExternalLoginCallback(): [(model: CreateExternalLoginAccountDetails) => Promise, AsyncActionStatus] {\r\n const accountService = useAccountService();\r\n\r\n // Get the return url from the query string.\r\n const returnUrl = React.useMemo(() => {\r\n const params = new URLSearchParams(window.location.search);\r\n const returnUrl = params.get('returnUrl') ?? params.get('ReturnUrl') ?? '';\r\n return returnUrl;\r\n }, []);\r\n\r\n const [action, { isExecuting, errors }] = useAsyncCallback(async (model: CreateExternalLoginAccountDetails) => {\r\n let result = await accountService.createAccountForExternalLogin(model, returnUrl);\r\n\r\n // If we get here everything went well so redirect to the returnUrl.\r\n // Redirect the whole page (not just the react app) as its likely the returnUrl is handled on the server.\r\n window.location.href = result.returnUrl;\r\n\r\n return result;\r\n }, [accountService]);\r\n\r\n return [action, { isExecuting, errors }];\r\n}\r\n","import * as React from \"react\";\r\nimport { Form, Alert, FormGroup, Label, Spinner } from \"reactstrap\";\r\nimport { AlertOnErrors } from \"../../shared/alertOnErrors\";\r\nimport { useChanges } from \"../../shared/useChanges\";\r\nimport { useValidatorCallback } from \"pojo-validator-react\";\r\nimport { ValidatedInput } from \"pojo-validator-reactstrap\";\r\nimport { ButtonAsync } from \"reactstrap-buttonasync\";\r\nimport { useSendPasswordResetEmailCallback } from \"../../api/account\";\r\nimport { ForgotPassword as ForgotPasswordModel } from '../../api/account/models/ForgotPassword';\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { MainContainer } from \"../shared/MainContainer\";\r\nimport { AccountBackground } from \"./AccountBackground\";\r\nimport { Banner } from \"../shared/Banner\";\r\n\r\n/**\r\n * Request a password reset emai because the user has forgotten their password.\r\n */\r\nexport const ForgotPassword = () => {\r\n const { t } = useTranslation();\r\n const [emailSent, setEmailSent] = React.useState(false);\r\n const [sendResetEmail, { isExecuting: isSendingResetEmail, errors: sendResetEmailErrors }] = useSendPasswordResetEmailCallback();\r\n\r\n const { model, change } = useChanges({ email: '' });\r\n\r\n const [validate, validationErrors] = useValidatorCallback((validation, fieldsToCheck) => {\r\n if (!model) {\r\n return;\r\n }\r\n\r\n const rules = {\r\n email: () => !model.email ? t('forgotPassword.emailRequired', 'Email is required') : '',\r\n };\r\n\r\n validation.checkRules(rules, fieldsToCheck);\r\n }, [model]);\r\n\r\n // Render the UI.\r\n // \r\n return (\r\n \r\n \r\n

{t('forgotPassword.forgotPasswordHeading', 'Forgot your password?')}

\r\n

\r\n {t('forgotPassword.helpText', 'Enter your email and we\\'ll send you a link you can use to recover your account and set a new password.')}\r\n

\r\n
\r\n \r\n
{\r\n e.preventDefault();\r\n const ok = await sendResetEmail(model.email);\r\n setEmailSent(ok);\r\n }}>\r\n\r\n \r\n {\r\n emailSent ? (\r\n \r\n <>{t('forgotPassword.emailHasBeenSent', 'Please check your email and follow the link to reset your password.')} \r\n {t('common.sending', 'Sending...')}}>\r\n {t('common.resendEmail', 'Resend email')}\r\n \r\n \r\n ) : null\r\n }\r\n \r\n \r\n change({ email: e.currentTarget.value })} onBlur={e => validate('email')} validationErrors={validationErrors['email']} />\r\n \r\n \r\n {t('common.sending', 'Sending...')}}>\r\n {t('common.send', 'Send')}\r\n \r\n \r\n \r\n
\r\n
\r\n );\r\n};\r\n","import { AsyncActionStatus } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Callback to Send a password reset email.\r\n */\r\nexport function useSendPasswordResetEmailCallback(): [(email: string) => Promise, AsyncActionStatus] {\r\n const accountService = useAccountService();\r\n\r\n const [action, { isExecuting, errors }] = useAsyncCallback(async (email: string) => {\r\n return await accountService.sendPasswordResetEmail(email);\r\n }, [accountService]);\r\n\r\n return [action, { isExecuting, errors }];\r\n}\r\n","import * as React from \"react\";\r\nimport { Form, Alert, FormGroup, Label, Spinner, Button, FormText } from \"reactstrap\";\r\nimport { useChanges } from \"../../shared/useChanges\";\r\nimport { useValidatorCallback } from \"pojo-validator-react\";\r\nimport { ValidatedInput } from \"pojo-validator-reactstrap\";\r\nimport { ButtonAsync } from \"reactstrap-buttonasync\"\r\nimport { useResetPasswordCallback } from \"../../api/account\";\r\nimport { ResetPassword as ResetPasswordModel } from '../../api/account/models/ResetPassword';\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { LoadingIndicator } from \"../shared/LoadingIndicator\";\r\nimport { LinkContainer } from \"react-router-bootstrap\";\r\nimport { usePasswordValidation } from \"../../shared/passwordValidation\";\r\nimport { MainContainer } from \"../shared/MainContainer\";\r\nimport { AccountBackground } from \"./AccountBackground\";\r\nimport { Banner } from \"../shared/Banner\";\r\n\r\n/**\r\n * Reset the password (after following a unique link from an email).\r\n */\r\nexport const ResetPassword = () => {\r\n const { t } = useTranslation();\r\n const [hasResetPassword, setHasResetPassword] = React.useState(false);\r\n const [resetPassword, { isExecuting: isResettingPassword, errors: resetPasswordErrors }] = useResetPasswordCallback();\r\n const { checkPassword, passwordRequirements } = usePasswordValidation();\r\n\r\n const { model, change } = useChanges({ password: '', confirmPassword: '' });\r\n const [validate, validationErrors] = useValidatorCallback((validation, fieldsToCheck) => {\r\n if (!model) {\r\n return;\r\n }\r\n\r\n const rules = {\r\n password: () => !model.password ? t('resetPassword.passwordRequired', 'Password is required')\r\n : checkPassword(model.password).errorDescription,\r\n confirmPassword: () => model.confirmPassword !== model.password ? t('register.passwordsDoNotMatch', 'The password and confirmation password do not match') : '',\r\n };\r\n\r\n validation.checkRules(rules, fieldsToCheck);\r\n }, [model]);\r\n \r\n // Render the UI.\r\n //\r\n\r\n // If we're not ready, show the loading indicator.\r\n if (!model) {\r\n return ();\r\n }\r\n\r\n return (\r\n \r\n \r\n

{t('resetPassword.resetPasswordHeading', 'Reset Password')}

\r\n

\r\n {t('resetPassword.thanksForConfirmingEmail', 'Thanks for confirming your email. You can now set a new password.')}\r\n

\r\n
\r\n \r\n
{\r\n e.preventDefault();\r\n if (!validate()) {\r\n return;\r\n }\r\n\r\n const ok = await resetPassword(model.password);\r\n setHasResetPassword(ok);\r\n }}>\r\n {\r\n resetPasswordErrors ? (\r\n \r\n {resetPasswordErrors}\r\n \r\n ) : null\r\n }\r\n {\r\n hasResetPassword ? (\r\n \r\n <>{t('resetPassword.passwordHasBeenReset', 'Your password has been reset.')} \r\n \r\n \r\n \r\n \r\n ) : null\r\n }\r\n\r\n \r\n \r\n change({ password: e.currentTarget.value })} onBlur={e => validate('password')} validationErrors={validationErrors['password']} />\r\n \r\n {passwordRequirements}\r\n \r\n \r\n \r\n \r\n change({ confirmPassword: e.currentTarget.value })} onBlur={e => validate('confirmPassword')} validationErrors={validationErrors['confirmPassword']} />\r\n \r\n \r\n {t('resetPassword.resetting', 'Resetting password...')}}>\r\n {t('resetPassword.reset', 'Reset')}\r\n \r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n","import * as React from \"react\";\r\nimport { AsyncActionStatus } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Callback to reset the password of an account using a unique URL from an email as authorization.\r\n */\r\nexport function useResetPasswordCallback(): [(password: string) => Promise, AsyncActionStatus] {\r\n const accountService = useAccountService();\r\n\r\n // Get the code from the query string.\r\n const { userId, code } = React.useMemo(() => {\r\n const params = new URLSearchParams(window.location.search);\r\n const userId = params.get('userId') ?? params.get('UserId') ?? '';\r\n const code = params.get('code') ?? params.get('Code') ?? '';\r\n return { userId, code };\r\n }, []);\r\n\r\n const [action, { isExecuting, errors }] = useAsyncCallback(async (password: string) => {\r\n return await accountService.resetPassword({ userId: userId, code: code, password: password });\r\n }, [accountService]);\r\n\r\n return [action, { isExecuting, errors }];\r\n}\r\n","import * as React from \"react\";\r\nimport { Alert, Button } from \"reactstrap\";\r\nimport { useConfirmEmailCallback } from \"../../api/account\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { LinkContainer } from \"react-router-bootstrap\";\r\nimport { LoadingIndicator } from \"../shared/LoadingIndicator\";\r\nimport { MainContainer } from \"../shared/MainContainer\";\r\nimport { AccountBackground } from \"./AccountBackground\";\r\nimport { Banner } from \"../shared/Banner\";\r\n\r\n/**\r\n * Confirm an email address for an account using a unique link included in the email. \r\n */\r\nexport const ConfirmEmail = () => {\r\n const { t } = useTranslation();\r\n const [emailConfirmed, setEmailConfirmed] = React.useState(false);\r\n const [confirmEmail, { errors: confirmEmailErrors }] = useConfirmEmailCallback();\r\n\r\n // Trigger the email confirmation on page load.\r\n React.useEffect(() => {\r\n (async () => {\r\n if (!emailConfirmed) {\r\n const ok = await confirmEmail();\r\n setEmailConfirmed(ok);\r\n }\r\n })();\r\n }, [confirmEmail, setEmailConfirmed, emailConfirmed]);\r\n\r\n // Render the UI.\r\n // \r\n return (\r\n \r\n \r\n {\r\n confirmEmailErrors ? (\r\n

{t('confirmEmail.confirmEmailFailureHeading', 'Sorry we cannot confirm your email using this code')}

\r\n ) : emailConfirmed ? (\r\n

{t('confirmEmail.confirmEmailSuccessHeading', 'Thanks for confirming your email')}

\r\n ) : (\r\n \r\n )\r\n }\r\n
\r\n \r\n {\r\n confirmEmailErrors ? (\r\n <>\r\n \r\n {confirmEmailErrors}\r\n \r\n \r\n ) : emailConfirmed ? (\r\n <>\r\n \r\n <>{t('confirmEmail.thankYouForConfirming', 'Thank you for confirming your email. You account setup is now complete.')} \r\n \r\n \r\n \r\n \r\n \r\n ) : null\r\n }\r\n \r\n
\r\n );\r\n};\r\n","import * as React from \"react\";\r\nimport { AsyncActionStatus } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Confirm an email address.\r\n */\r\nexport function useConfirmEmailCallback(): [() => Promise, AsyncActionStatus] {\r\n const accountService = useAccountService();\r\n\r\n // Get the return url from the query string.\r\n const { userId, code } = React.useMemo(() => {\r\n const params = new URLSearchParams(window.location.search);\r\n const userId = params.get('userId') ?? params.get('UserId') ?? '';\r\n const code = params.get('code') ?? params.get('Code') ?? '';\r\n return { userId, code };\r\n }, []);\r\n\r\n const [action, { isExecuting, errors }] = useAsyncCallback(async () => {\r\n return await accountService.confirmEmail({ userId: userId, code: code });\r\n }, [accountService, userId, code]);\r\n\r\n return [action, { isExecuting, errors }];\r\n}\r\n","import * as React from \"react\";\r\nimport { Alert, Button } from \"reactstrap\";\r\nimport { useConfirmEmailChangeCallback } from \"../../api/account\";\r\nimport { LoadingIndicator } from \"../shared/LoadingIndicator\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { LinkContainer } from \"react-router-bootstrap\";\r\nimport { MainContainer } from \"../shared/MainContainer\";\r\nimport { AccountBackground } from \"./AccountBackground\";\r\nimport { Banner } from \"../shared/Banner\";\r\n\r\n/**\r\n * Confirm an email address change for an account using a unique link included in the email. \r\n */\r\nexport const ConfirmEmailChange = () => {\r\n const { t } = useTranslation();\r\n const [emailConfirmed, setEmailConfirmed] = React.useState(false);\r\n const [confirmEmail, { errors: confirmEmailErrors }] = useConfirmEmailChangeCallback();\r\n\r\n // Trigger the email confirmation on page load.\r\n React.useEffect(() => {\r\n (async () => {\r\n if (!emailConfirmed) {\r\n const ok = await confirmEmail();\r\n setEmailConfirmed(ok);\r\n }\r\n })();\r\n }, [confirmEmail, setEmailConfirmed, emailConfirmed]);\r\n\r\n // Render the UI.\r\n // \r\n return (\r\n \r\n \r\n {\r\n confirmEmailErrors ? (\r\n

{t('confirmEmailChange.confirmEmailChangeFailureHeading', 'Sorry we cannot confirm your change of email using this code')}

\r\n ) : emailConfirmed ? (\r\n

{t('confirmEmailChange.confirmEmailChangeSuccessHeading', 'Thank you for confirming your change of email.')}

\r\n ) : (\r\n \r\n )\r\n }\r\n
\r\n \r\n {\r\n confirmEmailErrors ? (\r\n <>\r\n \r\n {confirmEmailErrors}\r\n \r\n \r\n ) : emailConfirmed ? (\r\n <>\r\n \r\n <>{t('confirmEmailChange.thankYouForConfirming', 'Thank you for confirming your change of email. We\\'ve swapped that over for you.')} \r\n \r\n \r\n \r\n \r\n \r\n ) : null\r\n }\r\n \r\n
\r\n );\r\n};\r\n","import * as React from \"react\";\r\nimport { AsyncActionStatus } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Confirm an email address.\r\n */\r\nexport function useConfirmEmailChangeCallback(): [() => Promise, AsyncActionStatus] {\r\n const accountService = useAccountService();\r\n\r\n // Get the return url from the query string.\r\n const { userId, code, email } = React.useMemo(() => {\r\n const params = new URLSearchParams(window.location.search);\r\n const userId = params.get('userId') ?? params.get('UserId') ?? '';\r\n const code = params.get('code') ?? params.get('Code') ?? '';\r\n const email = params.get('email') ?? params.get('Email') ?? '';\r\n return { userId, code, email };\r\n }, []);\r\n\r\n const [action, { isExecuting, errors }] = useAsyncCallback(async () => {\r\n return await accountService.confirmEmailChange({ userId: userId, code: code, email: email });\r\n }, [accountService, userId, code, email]);\r\n\r\n return [action, { isExecuting, errors }];\r\n}\r\n","import * as React from \"react\";\r\nimport { Form, FormGroup, Label, FormText, Spinner } from \"reactstrap\";\r\nimport { useConfirmInviteCallback } from \"../../api/account\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { MainContainer } from \"../shared/MainContainer\";\r\nimport { AlertOnErrors } from \"../../shared/alertOnErrors\";\r\nimport { useValidatorCallback } from \"pojo-validator-react\";\r\nimport { useChanges } from \"../../shared/useChanges\";\r\nimport { ConfirmInvite as ConfirmInviteModel } from \"../../api/account/models/ConfirmInvite\";\r\nimport { usePasswordValidation } from \"../../shared/passwordValidation\";\r\nimport { ValidatedInput } from \"pojo-validator-reactstrap\";\r\nimport { FormButtons } from \"../shared/FormButtons\";\r\nimport { ButtonAsync } from \"reactstrap-buttonasync\";\r\nimport { useHistory } from \"react-router\";\r\nimport { ConfirmInviteProfileDetails } from \"../profiles/ConfirmInviteProfileDetails\";\r\nimport { AccountBackground } from \"./AccountBackground\";\r\nimport { Banner } from \"../shared/Banner\";\r\n\r\n/**\r\n * Confirm an email address and provide registration details as part of an invite.\r\n */\r\nexport const ConfirmInvite = () => {\r\n const { t } = useTranslation();\r\n const [confirmInvite, { isExecuting: isConfirmingInvite, errors: confirmInviteErrors }] = useConfirmInviteCallback();\r\n const { model, change } = useChanges({ password: '', confirmPassword: '' });\r\n const { checkPassword, passwordRequirements } = usePasswordValidation();\r\n const history = useHistory();\r\n\r\n /**\r\n * Validate the model before trying to use it.\r\n */\r\n const [validate, validationErrors] = useValidatorCallback((validation, fieldsToCheck) => {\r\n const rules = {\r\n password: () => !model.password ? t('confirmInvite.passwordRequired', 'Password is required')\r\n : checkPassword(model.password).errorDescription,\r\n confirmPassword: () => model.confirmPassword !== model.password ? t('confirmInvite.passwordsDoNotMatch', 'The password and confirmation password do not match') : '',\r\n };\r\n\r\n validation.checkRules(rules, fieldsToCheck);\r\n }, [model]);\r\n\r\n /**\r\n * Perform a login by and handle the result.\r\n */\r\n const [isDoingFullPageRedirect, setIsDoingFullPageRedirect] = React.useState(false);\r\n const performRegister = React.useCallback(async (): Promise => {\r\n if (!validate()) {\r\n return;\r\n }\r\n\r\n const result = await confirmInvite(model);\r\n\r\n if (result) {\r\n if (result.requiresTwoFactor) {\r\n history.push(`/account/loginWithTwoFactor?returnUrl=${encodeURIComponent(result.returnUrl)}`);\r\n }\r\n\r\n // Redirect the whole page (not just the react app) as its likely the returnUrl is handled on the server.\r\n if (result.succeeded) {\r\n // Redirect the whole page (not just react) to the returnUrl to let the server handle as well as the client.\r\n if (!result.requiresEmailConfirmation && !result.requiresTwoFactor) {\r\n setIsDoingFullPageRedirect(true);\r\n window.location.href = result.returnUrl;\r\n }\r\n }\r\n }\r\n }, [confirmInvite, model, history, validate, setIsDoingFullPageRedirect]);\r\n\r\n\r\n // Render the UI.\r\n return (\r\n \r\n \r\n

{t('confirmInvite.finishRegistrationHeading', 'Register your account')}

\r\n

\r\n {t('confirmInvite.thanksForAccepting', 'Thanks for accepting the invite. You can now set a password to finish your account creation.')}\r\n

\r\n
\r\n \r\n
{ e.preventDefault(); await performRegister(); }}>\r\n \r\n\r\n \r\n\r\n \r\n \r\n change({ password: e.currentTarget.value })} onBlur={e => validate('password')} validationErrors={validationErrors['password']} />\r\n \r\n {passwordRequirements}\r\n \r\n \r\n \r\n \r\n change({ confirmPassword: e.currentTarget.value })} onBlur={e => validate('confirmPassword')} validationErrors={validationErrors['confirmPassword']} />\r\n \r\n\r\n \r\n {t('confirmInvite.registering', 'Registering...')}}>\r\n {t('confirmInvite.register', 'Register')}\r\n \r\n \r\n \r\n
\r\n
\r\n );\r\n};\r\n","import * as React from \"react\";\r\nimport { AsyncActionStatus } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { useAccountService } from \"./useAccountService\";\r\nimport { RegisterResult } from \"./AccountService\";\r\n\r\n/**\r\n * Confirm an invite and set a password.\r\n */\r\nexport function useConfirmInviteCallback(): [(model: { password: string }) => Promise, AsyncActionStatus] {\r\n const accountService = useAccountService();\r\n\r\n // Get the details from the query string.\r\n const { userId, code } = React.useMemo(() => {\r\n const params = new URLSearchParams(window.location.search);\r\n const userId = params.get('userId') ?? params.get('UserId') ?? '';\r\n const code = params.get('code') ?? params.get('Code') ?? '';\r\n return { userId, code };\r\n }, []);\r\n\r\n const [action, { isExecuting, errors }] = useAsyncCallback(async (model: { password: string }) => {\r\n return await accountService.confirmInvite({ userId: userId, code: code, password: model.password });\r\n }, [accountService, userId, code]);\r\n\r\n return [action, { isExecuting, errors }];\r\n}\r\n","import * as React from 'react';\r\nimport { useLazyQuery } from \"@apollo/react-hooks\";\r\nimport gql from \"graphql-tag\";\r\nimport { Guid } from \"guid-string\";\r\nimport { AsyncLoadResult, AsyncLoadOptions } from '../../../shared/abstractStore';\r\nimport { profileQuery, profileQueryVariables } from '../generated/profileQuery';\r\nimport { profileFieldsFragment } from '../models/Profile';\r\nimport { mainApiConfig } from '../../../configure/mainApiConfig';\r\n\r\nexport interface ProfileOptions extends AsyncLoadOptions {\r\n isUserId?: boolean,\r\n}\r\n\r\n/**\r\n * Get a Profile from the store.\r\n * @param id\r\n * @param options\r\n */\r\nexport function useProfile(id: string | undefined | null, options: ProfileOptions = {}): AsyncLoadResult {\r\n // Query the data we need form the api.\r\n const [load, { data, loading, error, refetch }] = useLazyQuery(\r\n gql`\r\n query profileQuery ($id: ID, $userId: ID) {\r\n model: profile(id: $id, userId: $userId) {\r\n ...profileFields\r\n }\r\n }\r\n\r\n ${profileFieldsFragment}\r\n `,\r\n {\r\n variables: {\r\n id: !options.isUserId ? id ?? Guid.empty : null,\r\n userId: options.isUserId ? id ?? Guid.empty : null\r\n },\r\n fetchPolicy: options.fetchPolicy ?? mainApiConfig.defaultFetchPolicy,\r\n pollInterval: options.pollInterval,\r\n onCompleted: (data) => {\r\n if (options.onCompleted) {\r\n options.onCompleted(data);\r\n }\r\n }\r\n }\r\n );\r\n\r\n // Run the query (unless we are being lazy).\r\n React.useEffect(() => {\r\n if (!options.lazy) {\r\n load();\r\n }\r\n }, [options.lazy, load])\r\n\r\n // Return the results.\r\n const refresh = React.useCallback(async () => { !refetch ? await load() : await refetch(); }, [refetch, load]);\r\n return React.useMemo(() => ({\r\n data: data ?? ({} as any),\r\n refresh: refresh,\r\n isLoading: loading,\r\n errors: error\r\n }), [data, refresh, loading, error]);\r\n}\r\n","import * as React from 'react';\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport { AsyncActionStatus } from '../abstractStore';\r\n\r\n/**\r\n * Options for saiving store data. \r\n */\r\nexport interface SaveInStoreOptions {\r\n beforeSaving?: (id: TId, changes: Partial, isCreate: boolean) => void,\r\n afterSaving?: (id: TId, changes: Partial, isCreate: boolean) => void,\r\n}\r\n\r\n/**\r\n * Hook to give us a save method that can cope with creating or updating the store as appropriate.\r\n */\r\nexport function useSaveInStore(\r\n createDataStore: [(model: T) => Promise, AsyncActionStatus],\r\n updateDataStore: [(id: TId, model: Partial) => Promise, AsyncActionStatus],\r\n options?: SaveInStoreOptions\r\n)\r\n : [(id: TId, changes: Partial, isCreate: boolean) => Promise, AsyncActionStatus]\r\n{\r\n\r\n const [create, { isExecuting: isCreating, errors: createErrors }] = createDataStore;\r\n const [update, { isExecuting: isUpdating, errors: updateErrors }] = updateDataStore;\r\n const [save, { isExecuting: isSaving, errors: saveErrors }] = useAsyncCallback(async (id: TId, changes: Partial, isCreate: boolean) => {\r\n // Run the pre-save option.\r\n if (options && options.beforeSaving) {\r\n options.beforeSaving(id, changes, isCreate);\r\n } \r\n\r\n // Create or update the item in the store.\r\n if (isCreate) {\r\n await create(changes as T);\r\n } else {\r\n await update(id, changes);\r\n }\r\n\r\n // Run the post-save option.\r\n if (options && options.afterSaving) {\r\n options.afterSaving(id, changes, isCreate);\r\n } \r\n }, [create, update, options]);\r\n\r\n // Combine errors from all sources into a single errors result.\r\n const errors = React.useMemo(() => {\r\n let ret = [];\r\n if (createErrors) {\r\n ret.push(createErrors);\r\n }\r\n if (updateErrors) {\r\n ret.push(updateErrors);\r\n }\r\n if (saveErrors) {\r\n ret.push(saveErrors);\r\n }\r\n\r\n if (ret.length === 0) {\r\n return undefined;\r\n }\r\n\r\n if (ret.length === 1) {\r\n return ret[0];\r\n }\r\n\r\n return ret;\r\n }, [createErrors, updateErrors, saveErrors]);\r\n\r\n return [save, { isExecuting: isSaving || isCreating || isUpdating, errors: errors }];\r\n}\r\n","import { useMutation } from \"@apollo/react-hooks\";\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncActionStatus } from '../../../shared/abstractStore';\r\nimport { ProfileCreateInput } from '../generated/globalTypes';\r\nimport { createProfileMutation, createProfileMutationVariables } from '../generated/createProfileMutation';\r\nimport { profileFieldsFragment } from '../models/Profile';\r\n\r\n/**\r\n * Get a callback to create a Profile in the store.\r\n */\r\nexport function useCreateProfileCallback(): [(model: ProfileCreateInput) => Promise, AsyncActionStatus] {\r\n const [mutationAction, { error }] = useMutation(\r\n gql`\r\n mutation createProfileMutation ($model: ProfileCreateInput!) {\r\n createProfile(model: $model) {\r\n ...profileFields\r\n }\r\n }\r\n\r\n ${profileFieldsFragment}\r\n `\r\n );\r\n\r\n // Wrap the mutation in a standard callback.\r\n const [action, { isExecuting, errors: actionErrors }] = useAsyncCallback(async (model: ProfileCreateInput) => {\r\n const result = await mutationAction({ variables: { model: model } });\r\n if (result.errors && result.errors.length) {\r\n throw result.errors;\r\n }\r\n }, [mutationAction]);\r\n\r\n return [action, { isExecuting: isExecuting, errors: error ? error.message : actionErrors }];\r\n}\r\n","import { useMutation } from \"@apollo/react-hooks\";\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncActionStatus } from '../../../shared/abstractStore';\r\nimport { ProfileUpdateInput } from '../generated/globalTypes';\r\nimport { updateProfileMutation, updateProfileMutationVariables } from '../generated/updateProfileMutation';\r\nimport { profileFieldsFragment } from '../models/Profile';\r\n\r\n/**\r\n * Get a callback to update a Profile in the store.\r\n */\r\nexport function useUpdateProfileCallback(): [(id: string, model: ProfileUpdateInput) => Promise, AsyncActionStatus] {\r\n const [mutationAction, { error }] = useMutation(\r\n gql`\r\n mutation updateProfileMutation ($model: ProfileUpdateInput!) {\r\n updateProfile(model: $model) {\r\n ...profileFields\r\n }\r\n }\r\n\r\n ${profileFieldsFragment}\r\n `\r\n );\r\n\r\n // Wrap the mutation in a standard callback.\r\n const [action, { isExecuting, errors: actionErrors }] = useAsyncCallback(async (id: string, model: ProfileUpdateInput) => {\r\n const result = await mutationAction({ variables: { model: { id: id, ...model } } });\r\n if (result.errors && result.errors.length) {\r\n throw result.errors;\r\n }\r\n }, [mutationAction]);\r\n\r\n return [action, { isExecuting: isExecuting, errors: error ? error.message : actionErrors }];\r\n}\r\n","import * as React from 'react';\r\nimport { ProfileCreateInput, ProfileUpdateInput } from '../generated/globalTypes';\r\nimport { useSaveInStore, SaveInStoreOptions } from '../../../shared/useSaveInStore';\r\nimport { useCreateProfileCallback } from './useCreateProfileCallback';\r\nimport { useUpdateProfileCallback } from './useUpdateProfileCallback';\r\nimport { Profile } from '../models/Profile';\r\n\r\n/**\r\n * Get a callback to save a Profile in the store using either a create or update.\r\n */\r\nexport function useSaveProfileCallback(options: SaveInStoreOptions = {}) {\r\n const [_create, createStatus] = useCreateProfileCallback();\r\n const create = React.useCallback((model: Partial) => _create(model as ProfileCreateInput), [_create]);\r\n\r\n const [_update, updateStatus] = useUpdateProfileCallback();\r\n const update = React.useCallback((id: string, changes: Partial) => _update(id, changes as ProfileUpdateInput), [_update]);\r\n\r\n return useSaveInStore(\r\n [create, createStatus],\r\n [update, updateStatus],\r\n options\r\n );\r\n}\r\n","import * as React from \"react\";\r\nimport { Row, Col, Form, FormGroup, Label, Spinner, Alert } from \"reactstrap\";\r\nimport { useChanges } from \"../../shared/useChanges\";\r\nimport { useValidatorCallback } from \"pojo-validator-react\";\r\nimport { ValidatedInput } from \"pojo-validator-reactstrap\";\r\nimport { ButtonAsync } from \"reactstrap-buttonasync\"\r\nimport { useAuthenticatedState } from \"../../api/api-authorization/useAuthenticatedState\";\r\nimport { LoadingIndicator } from \"../shared/LoadingIndicator\";\r\nimport { Guid } from \"guid-string\";\r\nimport { useProfile } from \"../../api/main/profiles/useProfile\";\r\nimport { useSaveProfileCallback } from \"../../api/main/profiles/useSaveProfileCallback\";\r\nimport { AlertOnErrors } from \"../../shared/alertOnErrors\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { FormButtons } from \"../shared/FormButtons\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\n\r\n/**\r\n * Allow the user to change their personal details on their profile.\r\n */\r\nexport const ProfileDetails = () => {\r\n const { t } = useTranslation();\r\n const [hasSaved, setHasSaved] = React.useState(false);\r\n const [isCreate, setIsCreate] = React.useState(false);\r\n const { user } = useAuthenticatedState({ includeUser: true});\r\n const { data: { model: storeModel, }, isLoading, errors: loadErrors, refresh: refreshProfile } = useProfile(user?.sub ?? '', {\r\n isUserId: true,\r\n lazy: true,\r\n onCompleted: (data) => {\r\n // If we don't find a record in the database, create one ready to save.\r\n if (!data) {\r\n setIsCreate(true);\r\n change({ id: Guid.newGuid(), userId: user?.sub ?? '' });\r\n }\r\n } });\r\n const { model, change, changes } = useChanges(storeModel);\r\n const [save, { isExecuting: isSaving, errors: saveErrors }] = useSaveProfileCallback({ afterSaving: () => setIsCreate(false) })\r\n\r\n const [validate, validationErrors] = useValidatorCallback((validation, fieldsToCheck) => {\r\n if (!model) {\r\n return;\r\n }\r\n\r\n const rules = {\r\n firstName: () => !model.firstName ? t('profileDetails.firstNameRequired', 'First name is required') : '',\r\n lastName: () => !model.lastName ? t('profileDetails.lastNameRequired', 'Last name is required') : '',\r\n };\r\n\r\n validation.checkRules(rules, fieldsToCheck);\r\n }, [model]);\r\n\r\n // Only load the profile once we know the user.\r\n React.useEffect(() => {\r\n if (!user) {\r\n return;\r\n }\r\n\r\n refreshProfile();\r\n }, [user, refreshProfile]);\r\n\r\n // Render the UI.\r\n //\r\n\r\n // If we're not ready, show the loading indicator.\r\n if (isLoading || !user || !model) {\r\n return (\r\n <>\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n return (\r\n <>\r\n
{ e.preventDefault(); if (!validate()) { return; } await save(model.id, changes, isCreate); setHasSaved(true); }}>\r\n \r\n\r\n {\r\n hasSaved ? (\r\n \r\n {t('profileDetails.hasSaved', 'Your details have been updated.')}\r\n \r\n ): null\r\n }\r\n\r\n \r\n \r\n \r\n \r\n change({ firstName: e.currentTarget.value })} onBlur={e => validate('firstName')} validationErrors={validationErrors['firstName']} />\r\n \r\n \r\n \r\n \r\n \r\n change({ lastName: e.currentTarget.value })} onBlur={e => validate('lastName')} validationErrors={validationErrors['lastName']} />\r\n \r\n \r\n \r\n\r\n \r\n {t('common.saving', 'Saving...')}}>\r\n \r\n <> {t('common.save', 'Save')}\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import * as React from \"react\";\r\nimport { Form, Alert, FormGroup, Label, Spinner, FormText } from \"reactstrap\";\r\nimport { useChanges } from \"../../shared/useChanges\";\r\nimport { useValidatorCallback } from \"pojo-validator-react\";\r\nimport { ValidatedInput } from \"pojo-validator-reactstrap\";\r\nimport { ButtonAsync } from \"reactstrap-buttonasync\";\r\nimport { ChangePassword as ChangePasswordModel } from '../../api/account/models/ChangePassword';\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { LoadingIndicator } from \"../shared/LoadingIndicator\";\r\nimport { AlertOnErrors } from \"../../shared/alertOnErrors\";\r\nimport { useChangePasswordCallback } from \"../../api/account\";\r\nimport { usePasswordValidation } from \"../../shared/passwordValidation\";\r\n\r\n/**\r\n * Change the logged in user's password.\r\n */\r\nexport const ChangePassword = () => {\r\n const { t } = useTranslation();\r\n const [hasChangedPassword, setHasChangedPassword] = React.useState(false);\r\n const [changePassword, { isExecuting: isChangingPassword, errors: changePasswordErrors }] = useChangePasswordCallback();\r\n const { checkPassword, passwordRequirements } = usePasswordValidation();\r\n\r\n const { model, change } = useChanges({ currentPassword: '', newPassword: '', confirmPassword: '' });\r\n const [validate, validationErrors] = useValidatorCallback((validation, fieldsToCheck) => {\r\n if (!model) {\r\n return;\r\n }\r\n\r\n const rules = {\r\n currentPassword: () => !model.currentPassword ? t('changePassword.currentPasswordRequred', 'Current password is required'): '',\r\n newPassword: () => !model.newPassword ? t('changePassword.newPasswordRequired', 'Password is required')\r\n : checkPassword(model.newPassword).errorDescription,\r\n confirmPassword: () => model.confirmPassword !== model.newPassword ? t('changePassword.passwordsDoNotMatch', 'The password and confirmation password do not match') : '',\r\n };\r\n\r\n validation.checkRules(rules, fieldsToCheck);\r\n }, [model]);\r\n \r\n // Render the UI.\r\n //\r\n\r\n // If we're not ready, show the loading indicator.\r\n if (!model) {\r\n return ();\r\n }\r\n\r\n return (\r\n <>\r\n
{\r\n e.preventDefault();\r\n if (!validate()) {\r\n return;\r\n }\r\n\r\n const ok = await changePassword(model.currentPassword, model.newPassword);\r\n setHasChangedPassword(ok);\r\n }}>\r\n \r\n\r\n {\r\n hasChangedPassword ? (\r\n \r\n {t('changePassword.passwordHasBeenChanged', 'Your password has been changed.')}\r\n \r\n ) : null\r\n }\r\n\r\n \r\n \r\n change({ currentPassword: e.currentTarget.value })} onBlur={e => validate('currentPassword')} validationErrors={validationErrors['currentPassword']} />\r\n \r\n \r\n \r\n change({ newPassword: e.currentTarget.value })} onBlur={e => validate('newPassword')} validationErrors={validationErrors['newPassword']} />\r\n \r\n {passwordRequirements}\r\n \r\n \r\n \r\n \r\n change({ confirmPassword: e.currentTarget.value })} onBlur={e => validate('confirmPassword')} validationErrors={validationErrors['confirmPassword']} />\r\n \r\n \r\n {t('changePassword.updatingPassword', 'Updating password...')}}>\r\n {t('changePassword.updatePassword', 'Update password')}\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import { AsyncActionStatus } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Callback to change the password of the current user..\r\n */\r\nexport function useChangePasswordCallback(): [(currentPassword: string, newPassword: string) => Promise, AsyncActionStatus] {\r\n const accountService = useAccountService();\r\n\r\n const [action, { isExecuting, errors }] = useAsyncCallback(async (currentPassword: string, newPassword: string) => {\r\n return await accountService.changePassword({ currentPassword: currentPassword, newPassword: newPassword });\r\n }, [accountService]);\r\n\r\n return [action, { isExecuting, errors }];\r\n}\r\n","import * as React from \"react\";\r\nimport { Form, Alert, FormGroup, Label, Spinner } from \"reactstrap\";\r\nimport { useChanges } from \"../../shared/useChanges\";\r\nimport { useValidatorCallback } from \"pojo-validator-react\";\r\nimport { ValidatedInput } from \"pojo-validator-reactstrap\";\r\nimport { ButtonAsync } from \"reactstrap-buttonasync\";\r\nimport { ChangeEmail as ChangeEmailModel } from '../../api/account/models/ChangeEmail';\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { LoadingIndicator } from \"../shared/LoadingIndicator\";\r\nimport { AlertOnErrors } from \"../../shared/alertOnErrors\";\r\nimport { useChangeEmailCallback, useResendConfirmationEmailCallback } from \"../../api/account\";\r\nimport { useUser } from \"../../api/main/users/useUser\";\r\nimport { useAuthenticatedState } from \"../../api/api-authorization/useAuthenticatedState\";\r\nimport { FormButtons } from \"../shared/FormButtons\";\r\n\r\n/**\r\n * Change the logged in user's email.\r\n */\r\nexport const ChangeEmail = () => {\r\n const { t } = useTranslation();\r\n const { user } = useAuthenticatedState({ includeUser: true });\r\n const { data: { model: storeModel, }, errors: loadErrors, refresh: refreshUserModel } = useUser(user?.sub ?? '', { lazy: true });\r\n\r\n const [changeEmail, { isExecuting: isChangingPassword, errors: changeEmailErrors }] = useChangeEmailCallback();\r\n const [hasSentEmail, setHasSentEmail] = React.useState(false);\r\n\r\n const [resendConfirmationEmail, { isExecuting: isResendingConfirmationEmail, errors: resendConfirmationEmailErrors }] = useResendConfirmationEmailCallback();\r\n const [hasSentConfirmationEmail, setHasSentConfirmationEmail] = React.useState(false);\r\n\r\n const { model, change } = useChanges({ newEmail: storeModel?.email ?? '' });\r\n const [validate, validationErrors] = useValidatorCallback((validation, fieldsToCheck) => {\r\n if (!model) {\r\n return;\r\n }\r\n\r\n const rules = {\r\n newEmail: () => !model.newEmail ? t('changeEmail.newEmailRequired', 'Email is required')\r\n : storeModel && storeModel.email === model.newEmail ? t('changeEmail.newEmailMatchesOldEmail', 'Your new email is the same as your old email and so does not need to go through an email update process.')\r\n : '',\r\n };\r\n\r\n validation.checkRules(rules, fieldsToCheck);\r\n }, [model]);\r\n\r\n // Only load the user model once we know the user id.\r\n React.useEffect(() => {\r\n if (!user) {\r\n return;\r\n }\r\n\r\n refreshUserModel();\r\n }, [user, refreshUserModel]);\r\n \r\n // Render the UI.\r\n //\r\n\r\n // If we're not ready, show the loading indicator.\r\n if (!model) {\r\n return (\r\n <>\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n return (\r\n <>\r\n
{\r\n e.preventDefault();\r\n if (!validate()) {\r\n return;\r\n }\r\n\r\n const ok = await changeEmail(model.newEmail);\r\n setHasSentEmail(ok);\r\n }}>\r\n \r\n\r\n {\r\n hasSentEmail ? (\r\n \r\n <>{t('changeEmail.emailHasBeenSent', 'Confirmation link to change email sent. Please check your email to confirm.')} \r\n { e.preventDefault(); await changeEmail(model.newEmail); }}\r\n isExecuting={isResendingConfirmationEmail}\r\n executingChildren={<>{t('common.sending', 'Sending...')}}>\r\n {t('common.resendEmail', 'Resend email')}\r\n \r\n \r\n ) : null\r\n }\r\n {\r\n hasSentConfirmationEmail ? (\r\n \r\n <>{t('login.confirmationEmailHasBeenResent', 'Confirmation link to verify the email for this account has been resent. Please check your email to confirm.')} \r\n { e.preventDefault(); await resendConfirmationEmail(storeModel?.email ?? model.newEmail); }}\r\n isExecuting={isResendingConfirmationEmail}\r\n executingChildren={<>{t('common.sending', 'Sending...')}}>\r\n {t('common.resendEmail', 'Resend email')}\r\n \r\n \r\n ) : null\r\n }\r\n\r\n \r\n \r\n change({ newEmail: e.currentTarget.value })} onBlur={e => validate('newEmail')} validationErrors={validationErrors['newEmail']} />\r\n {\r\n storeModel && !storeModel.emailConfirmed && model.newEmail === storeModel.email ? (\r\n
\r\n { e.preventDefault(); await resendConfirmationEmail(model.newEmail); setHasSentConfirmationEmail(true); }}\r\n isExecuting={isResendingConfirmationEmail}\r\n executingChildren={<>{t('common.resendingEmail', 'Resending email...')}}>\r\n {t('changeEmail.resendVerificationEmail', 'Resend verification email')}\r\n \r\n
\r\n ): null\r\n }\r\n
\r\n\r\n \r\n {t('changeEmail.updatingEmail', 'Updating email...')}}>\r\n {t('changeEmail.updateEmail', 'Update email')}\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { useLazyQuery } from \"@apollo/react-hooks\";\r\nimport gql from \"graphql-tag\";\r\nimport { Guid } from \"guid-string\";\r\nimport { AsyncLoadResult, AsyncLoadOptions } from '../../../shared/abstractStore';\r\nimport { userQuery, userQueryVariables } from '../generated/userQuery';\r\nimport { userFieldsFragment } from '../models/User';\r\nimport { mainApiConfig } from '../../../configure/mainApiConfig';\r\n\r\n/**\r\n * Get a User from the store.\r\n * @param id\r\n * @param options\r\n */\r\nexport function useUser(id: string | undefined | null, options: AsyncLoadOptions = {}): AsyncLoadResult {\r\n // Query the data we need from the API.\r\n const [load, { data, loading, error, refetch }] = useLazyQuery(\r\n gql`\r\n query userQuery ($id: ID!) {\r\n model: user(id: $id) {\r\n ...userFields\r\n }\r\n }\r\n\r\n ${userFieldsFragment}\r\n `,\r\n {\r\n variables: { id: id ?? Guid.empty },\r\n pollInterval: options.pollInterval,\r\n fetchPolicy: options.fetchPolicy ?? mainApiConfig.defaultFetchPolicy,\r\n onCompleted: (data) => {\r\n if (options.onCompleted) {\r\n options.onCompleted(data);\r\n }\r\n }\r\n }\r\n );\r\n\r\n // Run the query (unless we are being lazy).\r\n React.useEffect(() => {\r\n if (!options.lazy) {\r\n load();\r\n }\r\n }, [options.lazy, load])\r\n\r\n // Return the results.\r\n const refresh = React.useCallback(async () => { !refetch ? await load() : await refetch(); }, [refetch, load]);\r\n return React.useMemo(() => ({\r\n data: data ?? ({} as any),\r\n refresh: refresh,\r\n isLoading: loading,\r\n errors: error\r\n }), [data, refresh, loading, error]);\r\n}\r\n","import { AsyncActionStatus } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Callback to change the email of the current user..\r\n */\r\nexport function useChangeEmailCallback(): [(newEmail: string) => Promise, AsyncActionStatus] {\r\n const accountService = useAccountService();\r\n\r\n const [action, { isExecuting, errors }] = useAsyncCallback(async (newEmail: string) => {\r\n return await accountService.changeEmail({ newEmail: newEmail });\r\n }, [accountService]);\r\n\r\n return [action, { isExecuting, errors }];\r\n}\r\n","import { RouteEntry } from \"../../shared/routes\";\r\nimport { Profile } from \"./Profile\";\r\n\r\nexport const profileRoutes: Array = [\r\n { path: '/profile', exact: true, component: Profile, authorize: true },\r\n];\r\n","import * as React from \"react\";\r\nimport { Nav, NavItem, NavLink, TabContent, TabPane } from \"reactstrap\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { ProfileDetails } from \"./ProfileDetails\";\r\nimport { ChangePassword } from \"./ChangePassword\";\r\nimport { ChangeEmail } from \"./ChangeEmail\";\r\nimport { MainContainer } from \"../shared/MainContainer\";\r\nimport { Banner } from \"../shared/Banner\";\r\nimport { Background } from \"../shared/Background\";\r\n\r\n/**\r\n * Allow the user to change their profile.\r\n */\r\nexport const Profile = () => {\r\n const { t } = useTranslation();\r\n const [activeTab, setActiveTab] = React.useState('profile');\r\n\r\n return (\r\n \r\n \r\n

{t('profile..heading', 'Profile')}

\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n );\r\n};\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Returns a hook based callback that can be used to fetch more data in a controlled way and will automatically stop fetching when it reaches the end,\r\n * which it identifies by a call that returns less data than we are expecting.\r\n * \r\n * You can check if there is more using the hasMore() function returned in its state.\r\n */\r\nexport function useFetchMoreCallback(\r\n fetchMoreFromStore: (...args: any) => Promise<{ data: T }>,\r\n currentEndOffset: number | undefined | null,\r\n merge: (prevResult: T | undefined | null, newResult: T | undefined | null) => T | undefined | null,\r\n newResultLength: (newResult: T | undefined | null) => number | undefined | null\r\n): { fetchMore: () => void, hasMore: () => boolean }\r\n{\r\n const [_hasMore, setHasMore] = React.useState(true);\r\n\r\n // Read more data.\r\n const fetchMore = React.useCallback(() => {\r\n fetchMoreFromStore({\r\n variables: { offset: currentEndOffset ?? 0 },\r\n updateQuery: (previousQueryResult: T | undefined | null, { fetchMoreResult }: { fetchMoreResult: (T | undefined | null) }) => {\r\n if (!fetchMoreResult) {\r\n return previousQueryResult;\r\n }\r\n\r\n // If we didn't read any extra results, tell the cursor its reached the end.\r\n if (!newResultLength(fetchMoreResult)) {\r\n setHasMore(false);\r\n }\r\n\r\n // Merge everything together.\r\n return merge(previousQueryResult, fetchMoreResult);\r\n\r\n }\r\n });\r\n }, [fetchMoreFromStore, currentEndOffset, merge, newResultLength]);\r\n\r\n // Is there any more data available? True until fetchMore reads past the end of the data.\r\n const hasMore = React.useCallback(() => _hasMore, [_hasMore]);\r\n\r\n return React.useMemo(() => ({\r\n fetchMore: fetchMore,\r\n hasMore: hasMore,\r\n }), [fetchMore, hasMore]);\r\n} ","import * as React from 'react';\r\nimport { useLocation } from \"react-router\";\r\n\r\n/**\r\n * Hook to get the URLSearchParams from the current or passed in location.\r\n * @param search\r\n */\r\nexport function useURLSearchParams(search?: string) {\r\n const location = useLocation();\r\n return React.useMemo(() => new URLSearchParams(search ?? location?.search ?? ''), [search, location]);\r\n}","import * as React from 'react';\r\nimport { useURLSearchParams } from \"./useURLSearchParams\";\r\nimport { useHistory, useLocation } from \"react-router\";\r\n\r\n/**\r\n * Replace the Search params in the browser using history.replace().\r\n * @param name name of the Query param to return the value of.\r\n */\r\nexport function useReplaceSearchParamsEffect(changes: T): void {\r\n const location = useLocation();\r\n const params = useURLSearchParams();\r\n const history = useHistory();\r\n\r\n const url = React.useMemo(() => {\r\n for (let key in changes) {\r\n\r\n // Make sure we treat undefined, null, and empty strings the same to avoid potentially infinate rerenders\r\n // if an empty string is passed in to changes.\r\n let changesValue = changes[key] ?? '';\r\n let paramsValeue = params.get(key) ?? '';\r\n\r\n if (changesValue === paramsValeue) {\r\n continue;\r\n }\r\n\r\n if (!changesValue) {\r\n params.delete(key);\r\n } else {\r\n params.set(key, changesValue);\r\n }\r\n }\r\n\r\n return `${location.pathname}?${params}${location.hash}`;\r\n }, [changes, location, params]);\r\n\r\n // If we have changed the url because of a parameter, apply it with history.replace().\r\n React.useEffect(() => {\r\n if (!url) {\r\n return;\r\n }\r\n\r\n history.replace(url);\r\n }, [url, history]);\r\n}","import * as React from 'react';\r\nimport { useURLSearchParams } from \"./useURLSearchParams\";\r\n\r\n\r\n/**\r\n * Hook to get the value of specific search parameters using deconstruction.\r\n * @param name name of the Query param to return the value of.\r\n */\r\nexport function useSearchParams(): { [key: string]: string | null } {\r\n const params = useURLSearchParams();\r\n const deconstructionObject = React.useMemo(() => {\r\n let ret = {};\r\n params.forEach((value, key) => {\r\n ret = {\r\n ...ret,\r\n [key]: value\r\n }\r\n });\r\n return ret;\r\n }, [params]);\r\n\r\n return deconstructionObject;\r\n}","import * as React from 'react';\r\nimport { Input, InputGroup, InputGroupAddon, Button, InputProps } from 'reactstrap';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport interface SearchInputProps extends InputProps {\r\n}\r\n\r\n/**\r\n * Input that is hooked up for searching as the user types, by introducing an appropriate delay before raising the onSearch event.\r\n */\r\nexport const SearchInput = (props: SearchInputProps) => {\r\n const { type, placeholder, ...rest } = props;\r\n\r\n const { t } = useTranslation();\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};","import './noResultsFound.scss';\r\n\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\n\r\nexport interface NoResultsFoundProps {\r\n className?: string,\r\n search?: string,\r\n children?: React.ReactNode,\r\n}\r\n\r\n/**\r\n * Component to show when a search or query returned no results.\r\n */\r\nexport const NoResultsFound = (props: NoResultsFoundProps) => {\r\n const { className, search, children } = props;\r\n\r\n const { t } = useTranslation();\r\n\r\n // If we have custom children, render them within our cotainer.\r\n if (children) {\r\n return (\r\n
\r\n {children}\r\n
\r\n );\r\n }\r\n\r\n\r\n // Otherwise render th default contents.\r\n return (\r\n
\r\n
\r\n \r\n
\r\n

\r\n {\r\n search ? \r\n t('notResultsFound.nothingMatchedSearch', 'Sorry there were no matches for \"{{search}}.\"', { search: search })\r\n : t('notResultsFound.nothingFound', 'Sorry there is nothing to show you here yet.')\r\n }\r\n

\r\n
\r\n );\r\n};","import './tableRowButtons.scss';\r\n\r\nimport * as React from 'react';\r\n\r\nexport interface TableRowButtonsProps {\r\n className?: string,\r\n children: React.ReactNode\r\n}\r\n\r\n/**\r\n * Container for buttons used in a table's row.\r\n */\r\nexport const TableRowButtons = (props: TableRowButtonsProps) => {\r\n const { className, children } = props;\r\n\r\n return (\r\n
\r\n {children}\r\n
\r\n );\r\n};","import './stickyToolbar.scss';\r\n\r\nimport * as React from 'react';\r\nimport { Waypoint } from 'react-waypoint';\r\nimport { Container } from 'reactstrap';\r\n\r\nexport interface StickyToolbarProps {\r\n className?: string,\r\n children: React.ReactNode\r\n}\r\n\r\n/**\r\n * Container for a toolbar that sticks to the top of the screen when its scrolled off the screen.\r\n * \r\n * NOTE Some code here is specific to the layout rather than the overall functionality. Namely:\r\n * 1. The use of the \"main\" class when top-toolbar-stuck which is used to make sure available margins are kept in sync with the
element\r\n * during sidebar states.\r\n * 2. The topOffset=\"\" which is used to ensure the triggering happens when we would move behind the fixed nav header.\r\n * \r\n * If you want to use this code elsewhere, you will likely need to tweak these values.\r\n */\r\nexport const StickyToolbar = (props: StickyToolbarProps) => {\r\n const [isStuck, setIsStuck] = React.useState(false);\r\n const { className, children } = props;\r\n\r\n return (\r\n <>\r\n setIsStuck(false)} onLeave={() => setIsStuck(true)} />\r\n\r\n {\r\n isStuck ? (\r\n
\r\n \r\n {children}\r\n \r\n
\r\n ) : (\r\n
\r\n {children}\r\n
\r\n )\r\n }\r\n \r\n );\r\n};","import { useMutation } from \"@apollo/react-hooks\";\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncActionStatus } from '../../../shared/abstractStore';\r\nimport { ChangeUserRoleGroupInput } from '../generated/globalTypes';\r\nimport { userFieldsFragment } from \"../models/User\";\r\nimport { changeUserRoleGroupMutationVariables, changeUserRoleGroupMutation } from \"../generated/changeUserRoleGroupMutation\";\r\nimport { useResetCurrentUserRolesCallback } from \"../../account\";\r\n\r\n/**\r\n * Get a callback to change the role grup of a user in the store.\r\n */\r\nexport function useChangeUserRoleGroupCallback(): [(model: ChangeUserRoleGroupInput) => Promise, AsyncActionStatus] {\r\n const resetCurrentUserRoles = useResetCurrentUserRolesCallback();\r\n\r\n const [mutationAction, { error }] = useMutation(\r\n gql`\r\n mutation changeUserRoleGroupMutation ($model: ChangeUserRoleGroupInput!) {\r\n changeUserRoleGroup(model: $model) {\r\n ...userFields\r\n }\r\n }\r\n\r\n ${userFieldsFragment}\r\n `,\r\n {\r\n update: () => resetCurrentUserRoles()\r\n }\r\n );\r\n\r\n // Wrap the mutation in a standard callback.\r\n const [action, { isExecuting, errors: actionErrors }] = useAsyncCallback(async (model: ChangeUserRoleGroupInput) => {\r\n const result = await mutationAction({ variables: { model: model } });\r\n if (result.errors && result.errors.length) {\r\n throw result.errors;\r\n }\r\n }, [mutationAction]);\r\n\r\n return [action, { isExecuting: isExecuting, errors: error ? error.message : actionErrors }];\r\n}\r\n","import * as React from 'react';\r\nimport { Button, Row, Col, Form, Label, FormGroup, Spinner, FormText, Alert } from 'reactstrap';\r\nimport { AlertOnErrors } from '../../shared/alertOnErrors';\r\nimport { LoadingIndicator } from '../shared/LoadingIndicator';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { MainContainer } from '../shared/MainContainer';\r\nimport { useParams, useHistory } from 'react-router';\r\nimport { useProfile } from '../../api/main/profiles/useProfile';\r\nimport { useChanges } from '../../shared/useChanges';\r\nimport { useSaveProfileCallback } from '../../api/main/profiles/useSaveProfileCallback';\r\nimport { useValidatorCallback } from 'pojo-validator-react';\r\nimport { ValidatedInput } from 'pojo-validator-reactstrap';\r\nimport { FormButtons } from '../shared/FormButtons';\r\nimport { ButtonAsync } from 'reactstrap-buttonasync';\r\nimport { useInviteCallback, useChangeAccountEmailCallback, useResendInviteEmailCallback } from '../../api/account';\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport { useChangeUserRoleGroupCallback } from '../../api/main/users/useChangeUserRoleGroupCallback';\r\nimport { Guid } from 'guid-string';\r\nimport { ConditionalFragment } from 'react-conditionalfragment';\r\nimport { useProfileSupportingData } from '../../api/main/profiles/useProfileSupportingData';\r\nimport { Banner } from '../shared/Banner';\r\nimport { Background } from '../shared/Background';\r\n\r\ninterface EditUserProps {\r\n isCreate?: boolean,\r\n}\r\n\r\n/**\r\n * Create and invite a new user.\r\n */\r\nexport const CreateUser = () => ();\r\n\r\n/**\r\n * Edit a user (actually a profile).\r\n */\r\nexport const EditUser = (props: EditUserProps) => {\r\n const { isCreate } = props;\r\n\r\n const { t } = useTranslation();\r\n const { id } = useParams();\r\n const { data: { model: storeModel }, isLoading: _isLoading, errors: loadErrors } = useProfile(id);\r\n const { data: { roleGroups }, isLoading: isLoadingSupportingData, errors: loadSupportingDataErrors } = useProfileSupportingData();\r\n const isLoading = _isLoading || isLoadingSupportingData;\r\n const { model, change, changes } = useChanges(storeModel, isCreate ? { id: Guid.newGuid() } : {});\r\n const { model: userModel, change: changeUserModel } = useChanges(storeModel?.user);\r\n const { model: roleGroupModel, change: changeRoleGroupModel } = useChanges<{ id: string }>({ id: storeModel?.user?.roleGroup?.id ?? '' });\r\n const [save, { errors: saveErrors }] = useSaveProfileCallback();\r\n const [invite, { errors: inviteErrors }] = useInviteCallback();\r\n const [resendInviteEmail, { isExecuting: isResendingInviteEmail, errors: resendInviteEmailErrors }] = useResendInviteEmailCallback();\r\n const [hasResentInviteEmail, setHasResentInviteEmail] = React.useState(false);\r\n const [changeAccountEmail, { errors: changeEmailErrors }] = useChangeAccountEmailCallback();\r\n const [changeUserRoleGroupInStore, { errors: changeUserRoleGroupInStoreErrors }] = useChangeUserRoleGroupCallback();\r\n const history = useHistory();\r\n\r\n const [validate, validationErrors] = useValidatorCallback((validation, fieldsToCheck) => {\r\n const rules = {\r\n firstName: () => !model?.firstName ? t('editUser.firstNameRequired', 'First name is required') : '',\r\n lastName: () => !model?.lastName ? t('editUser.lastNameRequired', 'Last name is required') : '',\r\n email: () => !userModel?.email ? t('editUser.emailRequired', 'Email is required') : '',\r\n };\r\n\r\n validation.checkRules(rules, fieldsToCheck);\r\n }, [model, userModel]);\r\n\r\n const [saveForm, { isExecuting: isSaving, errors: saveFormErrors }] = useAsyncCallback(async () => {\r\n if (!validate()) {\r\n return;\r\n }\r\n\r\n // If we are creating this user, make sure we save the user and get its id before continuing with saving the profile.\r\n let userId = model.userId;\r\n if (isCreate) {\r\n // Create an invited user but don't send the invite yet, we'll send it after the profile has been saved to so we can include their name\r\n // and make it more personal for higher engagement.\r\n const result = await invite({ ...userModel, sendEmail: false });\r\n userId = result.userId;\r\n changeUserModel({ id: userId });\r\n change({ userId: userId});\r\n }\r\n\r\n await save(model.id, { ...changes, userId: userId }, !!isCreate);\r\n\r\n // If we created a user invite, send the email now the profile has been saved so it can include more personal information (e.g. their name).\r\n if (isCreate) {\r\n await resendInviteEmail(userModel.email);\r\n }\r\n\r\n // Handle changes to the email address of existing users.\r\n if (!isCreate && storeModel && storeModel.user.email !== userModel.email) {\r\n await changeAccountEmail(storeModel.user.email, userModel.email);\r\n }\r\n\r\n // Handle the role group change.\r\n if (isCreate || storeModel?.user.roleGroup?.id !== roleGroupModel.id) {\r\n await changeUserRoleGroupInStore({ userId: userId, roleGroupId: roleGroupModel.id });\r\n }\r\n\r\n history.goBack();\r\n }, [validate, save, model, changes, isCreate, history, userModel, invite, changeUserModel, change, changeAccountEmail, resendInviteEmail]);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n

\r\n {\r\n isCreate ? (\r\n <>{t('editUser.createHeading', 'Add user')}\r\n ) : (\r\n <>{t('editUser.editHeading', 'Edit user')}\r\n )\r\n }\r\n

\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n\r\n \r\n \r\n\r\n {\r\n hasResentInviteEmail ? (\r\n \r\n <>{t('editUser.confirmationEmailHasBeenResent', 'Invite email for this user has been resent. Please ask the user to check their email to confirm.')} \r\n { e.preventDefault(); await resendInviteEmail(storeModel?.user?.email ?? userModel.email); }}\r\n isExecuting={isResendingInviteEmail}\r\n executingChildren={<>{t('common.sending', 'Sending...')}}>\r\n {t('common.resendEmail', 'Resend email')}\r\n \r\n \r\n ) : null\r\n }\r\n\r\n
{ e.preventDefault(); saveForm(); }}>\r\n \r\n \r\n \r\n \r\n change({ firstName: e.currentTarget.value })} onBlur={e => validate('firstName')} validationErrors={validationErrors['firstName']} />\r\n \r\n \r\n \r\n \r\n \r\n change({ lastName: e.currentTarget.value })} onBlur={e => validate('lastName')} validationErrors={validationErrors['lastName']} />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n changeUserModel({ email: e.currentTarget.value })} onBlur={e => validate('email')} validationErrors={validationErrors['email']} />\r\n \r\n {\r\n storeModel && !storeModel.user.emailConfirmed && userModel.email === storeModel.user.email ? (\r\n \r\n { e.preventDefault(); await resendInviteEmail(userModel.email); setHasResentInviteEmail(true); }}\r\n isExecuting={isResendingInviteEmail}\r\n executingChildren={<>{t('common.resendingEmail', 'Resending invite...')}}>\r\n \r\n <> {t('editUser.resendInvite', 'Resend invite')}\r\n \r\n \r\n ): null\r\n }\r\n \r\n {\r\n storeModel && !storeModel.user.emailConfirmed && userModel.email === storeModel.user.email ? (\r\n \r\n {t('editUser.userHasNotAcceptedInvite', 'This user has not accepted the invite. You can change their email if required or resend the invite.')}\r\n \r\n ) : storeModel && !storeModel.user.emailConfirmed && userModel.email !== storeModel.user.email ? (\r\n \r\n {t('editUser.userHasNotAcceptedInviteAndEmailChanged', 'This user has not yet accepted the invite, a new invite will be sent to the new email you have supplied.')}\r\n \r\n ) : storeModel && storeModel.user.emailConfirmed && userModel.email !== storeModel.user.email ? (\r\n \r\n {t('editUser.userHasNotAcceptedInviteAndEmailChanged', 'This user will be asked to confirm the email change before it takes affect. The old email address will be shown in the system until the change has been confirmed.')}\r\n \r\n ) : storeModel && storeModel.user.emailConfirmed && userModel.email === storeModel.user.email ? (\r\n \r\n {t('editUser.userHasNotAcceptedInviteAndEmailChanged', 'If you change this user\\'s email they will be sent an email to confirm the change before it takes affect.')}\r\n \r\n ): null\r\n }\r\n \r\n \r\n \r\n changeRoleGroupModel({ id: e.currentTarget.value })} onBlur={e => validate('roleGroup')} validationErrors={validationErrors['roleGroup']}>\r\n {\r\n roleGroups?.map(item => (\r\n \r\n ))\r\n }\r\n \r\n \r\n\r\n \r\n \r\n {t('common.saving', 'Saving...')}}>\r\n \r\n <> {t('common.save', 'Save')}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { useLazyQuery } from \"@apollo/react-hooks\";\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncLoadResult, AsyncLoadOptions } from '../../../shared/abstractStore';\r\nimport { profileSupportingDataQuery } from '../generated/profileSupportingDataQuery';\r\nimport { mainApiConfig } from '../../../configure/mainApiConfig';\r\n\r\nexport interface ProfileOptions extends AsyncLoadOptions {\r\n isUserId?: boolean,\r\n}\r\n\r\n/**\r\n * Get a the supporting data needed to interactivly edit an Profile.\r\n * @param id\r\n * @param options\r\n */\r\nexport function useProfileSupportingData(options: ProfileOptions = {}): AsyncLoadResult {\r\n // Query the data we need form the api.\r\n const [load, { data, loading, error, refetch }] = useLazyQuery(\r\n gql`\r\n query profileSupportingDataQuery {\r\n roleGroups {\r\n id\r\n name\r\n }\r\n }\r\n `,\r\n {\r\n variables: {\r\n },\r\n fetchPolicy: options.fetchPolicy ?? mainApiConfig.defaultFetchPolicy,\r\n pollInterval: options.pollInterval,\r\n onCompleted: (data) => {\r\n if (options.onCompleted) {\r\n options.onCompleted(data);\r\n }\r\n }\r\n }\r\n );\r\n\r\n // Run the query (unless we are being lazy).\r\n React.useEffect(() => {\r\n if (!options.lazy) {\r\n load();\r\n }\r\n }, [options.lazy, load])\r\n\r\n // Return the results.\r\n const refresh = React.useCallback(async () => { !refetch ? await load() : await refetch(); }, [refetch, load]);\r\n return React.useMemo(() => ({\r\n data: data ?? ({} as any),\r\n refresh: refresh,\r\n isLoading: loading,\r\n errors: error\r\n }), [data, refresh, loading, error]);\r\n}\r\n","import { AsyncActionStatus } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { InviteRequest, InviteResult } from \"./AccountService\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Callback to Invite an account to register.\r\n */\r\nexport function useInviteCallback(): [(model: InviteRequest) => Promise, AsyncActionStatus] {\r\n const accountService = useAccountService();\r\n\r\n const [action, { isExecuting, errors }] = useAsyncCallback(async (model: InviteRequest) => {\r\n let result = await accountService.invite(model);\r\n return result;\r\n }, [accountService]);\r\n\r\n return [action, { isExecuting, errors }];\r\n}\r\n","import { AsyncActionStatus } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Callback to resend the inviten email.\r\n */\r\nexport function useResendInviteEmailCallback(): [(email: string) => Promise, AsyncActionStatus] {\r\n const accountService = useAccountService();\r\n\r\n const [action, { isExecuting, errors }] = useAsyncCallback(async (email: string) => {\r\n return await accountService.resendInviteEmail(email);\r\n }, [accountService]);\r\n\r\n return [action, { isExecuting, errors }];\r\n}\r\n","import { AsyncActionStatus } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Callback to change the email of another user as an administrator.\r\n */\r\nexport function useChangeAccountEmailCallback(): [(currentEmail: string, newEmail: string) => Promise, AsyncActionStatus] {\r\n const accountService = useAccountService();\r\n\r\n const [action, { isExecuting, errors }] = useAsyncCallback(async (currentEmail: string, newEmail: string) => {\r\n return await accountService.changeAccountEmail({ currentEmail: currentEmail, newEmail: newEmail });\r\n }, [accountService]);\r\n\r\n return [action, { isExecuting, errors }];\r\n}\r\n","/**\r\n * Constants for the available roles.\r\n */\r\nexport const IdentityRoles = {\r\n Administration: 'Administration'\r\n};\r\n\r\n///**\r\n// * Constants (enum) for the available Roles.\r\n// */\r\n//export enum IdentityRoles {\r\n// Administration = 'Administration'\r\n//}\r\n","import * as React from 'react';\r\nimport { Button, Form, Label, FormGroup, Spinner, Input, Row, Col } from 'reactstrap';\r\nimport { AlertOnErrors } from '../../shared/alertOnErrors';\r\nimport { LoadingIndicator } from '../shared/LoadingIndicator';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { MainContainer } from '../shared/MainContainer';\r\nimport { useParams, useHistory } from 'react-router';\r\nimport { FormButtons } from '../shared/FormButtons';\r\nimport { ButtonAsync } from 'reactstrap-buttonasync';\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport { useProfile } from '../../api/main/profiles/useProfile';\r\nimport { useLockoutCallback } from '../../api/account';\r\nimport { useDeleteProfileCallback } from '../../api/main/profiles/useDeleteProfileCallback';\r\nimport { ConditionalFragment } from 'react-conditionalfragment';\r\nimport { Banner } from '../shared/Banner';\r\nimport { Background } from '../shared/Background';\r\n\r\n/**\r\n * Delete a user (profile) by locking them out permanently.\r\n */\r\nexport const DeleteUser = () => {\r\n const { t } = useTranslation();\r\n const { id } = useParams();\r\n const { data: { model }, isLoading, errors: loadErrors } = useProfile(id);\r\n const [remove, { errors: removeErrors }] = useDeleteProfileCallback();\r\n const [lockout, { errors: lockoutErrors }] = useLockoutCallback();\r\n const history = useHistory();\r\n\r\n const [onRemoveFormSubmit, { isExecuting: isRemoving, errors: removeFormErrors }] = useAsyncCallback(async () => {\r\n if (!model || !model.user) {\r\n return;\r\n }\r\n\r\n await remove(model.id);\r\n await lockout({ email: model.user.email });\r\n\r\n history.goBack();\r\n }, [lockout, model, history]);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n

{t('deleteUser.heading', 'Are you sure you want to delete this user?')}

\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n\r\n \r\n \r\n\r\n
{ e.preventDefault(); onRemoveFormSubmit(); }}>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n {t('common.deleting', 'Deleting...')}}>\r\n \r\n <> {t('common.delete', 'Delete')}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n","import { RouteEntry } from \"../../shared/routes\";\r\nimport { UsersList } from './UsersList';\r\nimport { EditUser, CreateUser } from \"./EditUser\";\r\nimport { IdentityRoles } from \"../../configure/security/IdentityRoles\";\r\nimport { DeleteUser } from \"./DeleteUser\";\r\n\r\nexport const userRoutes: Array = [\r\n { path: '/administration/users', exact: true, component: UsersList, authorize: true, requireRole: IdentityRoles.Administration },\r\n { path: '/administration/users/edit/:id', component: EditUser, authorize: true, requireRole: IdentityRoles.Administration },\r\n { path: '/administration/users/add', component: CreateUser, authorize: true, requireRole: IdentityRoles.Administration },\r\n { path: '/administration/users/delete/:id', component: DeleteUser, authorize: true, requireRole: IdentityRoles.Administration },\r\n];\r\n","import * as React from 'react';\r\nimport { Table, Button, Row, Col, ButtonGroup, ButtonDropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';\r\nimport { LinkContainer } from 'react-router-bootstrap';\r\nimport { AlertOnErrors } from '../../shared/alertOnErrors';\r\nimport { LoadingIndicator } from '../shared/LoadingIndicator';\r\nimport { useProfiles } from '../../api/main/profiles/useProfiles';\r\nimport { Waypoint } from 'react-waypoint';\r\nimport { useReplaceSearchParamsEffect, useSearchParams } from '../../shared/useURLSearchParams';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { SearchInput } from '../shared/SearchInput';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { MainContainer } from '../shared/MainContainer';\r\nimport { NoResultsFound } from '../shared/NoResultsFound';\r\nimport { TableRowButtons } from '../shared/TableRowButtons';\r\nimport { StickyToolbar } from '../shared/StickyToolbar';\r\nimport { useHistory } from 'react-router';\r\nimport { ConditionalFragment } from 'react-conditionalfragment';\r\nimport { Banner } from '../shared/Banner';\r\nimport { useToggleStateArray } from 'use-toggle-state';\r\n\r\n\r\n/**\r\n * List of users.\r\n */\r\nexport const UsersList = () => {\r\n const { t } = useTranslation();\r\n const { search: searchParam } = useSearchParams();\r\n const [search, setSearch] = React.useState(searchParam ?? '');\r\n const { data: { items: allItems }, isLoading, errors: loadingErrors, fetchMore, hasMore } = useProfiles({ pageSize: undefined });\r\n const [isMenuOpen, toggleMenuOpen] = useToggleStateArray();\r\n const history = useHistory();\r\n\r\n // Filter by the user's search client side so it can work when offline as well as online.\r\n const items = React.useMemo(() => {\r\n if (!allItems || !search) {\r\n return allItems;\r\n }\r\n\r\n let lowerSearch = search.toLocaleLowerCase();\r\n\r\n // Filter the items being displayed.\r\n return allItems.filter(item =>\r\n item.firstName.toLocaleLowerCase().indexOf(lowerSearch) >= 0\r\n || item.lastName.toLocaleLowerCase().indexOf(lowerSearch) >= 0\r\n || item.user.email.toLocaleLowerCase().indexOf(lowerSearch) >= 0\r\n || (item.user?.roleGroup?.name?.toLocaleLowerCase()?.indexOf(lowerSearch) ?? -1) >= 0\r\n || `${item.firstName} ${item.lastName}`.toLocaleLowerCase().indexOf(lowerSearch) >= 0 // Full name in languages \"first last\"\r\n || `${item.lastName} ${item.firstName}`.toLocaleLowerCase().indexOf(lowerSearch) >= 0 // Full name in languages \"last first\"\r\n );\r\n }, [allItems, search]);\r\n\r\n useReplaceSearchParamsEffect({ search: search });\r\n\r\n const colCount = 5;\r\n\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n

{t('usersList.heading', 'Users')}

\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n setSearch(e.currentTarget.value)} />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n items?.map(item => (\r\n history.push(`/administration/users/edit/${item.id}`)}>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ))\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
{t('usersList.user', 'User')}{t('usersList.firstName', 'First name')}{t('usersList.lastName', 'Last name')}{t('usersList.email', 'Email')}{t('usersList.securityGroup', 'Security group')} 
\r\n
{item.firstName} {item.lastName}
\r\n
{item.user.email}
\r\n
{item.firstName}{item.lastName}{item.user.email}{item.user.roleGroup?.name ?? ''}\r\n \r\n \r\n \r\n \r\n \r\n toggleMenuOpen(item.id)}>\r\n \r\n {t('common.menuDropdown', 'More')}\r\n \r\n \r\n \r\n \r\n \r\n <> {t('common.delete', 'Delete')}\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { useLazyQuery } from \"@apollo/react-hooks\";\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncLoadPagedResult, AsyncLoadPagedOptions } from '../../../shared/abstractStore';\r\nimport { useFetchMoreCallback } from '../../../shared/useFetchMoreCallback';\r\nimport { profilesQuery, profilesQueryVariables } from '../generated/profilesQuery';\r\nimport { mainApiConfig } from '../../../configure/mainApiConfig';\r\n\r\n/**\r\n * Get a list of profiles from the store.\r\n * @param id\r\n * @param options\r\n */\r\nexport function useProfiles(options: AsyncLoadPagedOptions = {}): AsyncLoadPagedResult {\r\n // Query data we need from the api.\r\n const [load, { data, loading, error, refetch, fetchMore: fetchMoreFromStore }] = useLazyQuery(\r\n gql`\r\n query profilesQuery ($offset: Int, $first: Int) {\r\n items: profiles (offset: $offset, first: $first) {\r\n id\r\n firstName\r\n lastName\r\n user {\r\n id\r\n email\r\n roleGroup {\r\n id\r\n name\r\n }\r\n }\r\n }\r\n }\r\n `,\r\n {\r\n\r\n variables: {\r\n offset: options.startOffset,\r\n first: options.pageSize\r\n },\r\n fetchPolicy: options.fetchPolicy ?? mainApiConfig.defaultFetchPolicy,\r\n pollInterval: options.pollInterval,\r\n onCompleted: (data) => {\r\n if (options.onCompleted) {\r\n options.onCompleted(data);\r\n }\r\n }\r\n }\r\n );\r\n\r\n // Run the query (unless we are being lazy).\r\n React.useEffect(() => {\r\n if (!options.lazy) {\r\n load();\r\n }\r\n }, [options.lazy, load])\r\n\r\n // Get the functions used to manage paging.\r\n const { fetchMore, hasMore: _hasMore } = useFetchMoreCallback(\r\n fetchMoreFromStore,\r\n (options?.startOffset ?? 0) + (data?.items?.length ?? 0),\r\n (prevResults, newResults) => ({\r\n ...prevResults,\r\n ...newResults,\r\n\r\n items: [...(prevResults?.items ?? []), ...(newResults?.items ?? [])]\r\n }),\r\n (newResults) => newResults?.items?.length\r\n );\r\n const hasMore = React.useCallback(() => !options.pageSize ? false : _hasMore(), [options.pageSize, _hasMore]);\r\n \r\n // Return the results.\r\n const refresh = React.useCallback(async () => { !refetch ? await load() : await refetch(); }, [refetch, load]);\r\n return React.useMemo(() => ({\r\n data: data ?? ({} as any),\r\n refresh: refresh,\r\n isLoading: loading,\r\n errors: error,\r\n fetchMore: fetchMore,\r\n hasMore: hasMore,\r\n }), [data, refresh, loading, error, fetchMore, hasMore]);\r\n}\r\n","import { useMutation } from \"@apollo/react-hooks\";\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncActionStatus } from '../../../shared/abstractStore';\r\nimport { deleteProfileMutation, deleteProfileMutationVariables } from '../generated/deleteProfileMutation';\r\nimport { profileFieldsFragment } from '../models/Profile';\r\n\r\n/**\r\n * Get a callback to delete a Profile in the store.\r\n */\r\nexport function useDeleteProfileCallback(): [(id: string) => Promise, AsyncActionStatus] {\r\n const [mutationAction, { error }] = useMutation(\r\n gql`\r\n mutation deleteProfileMutation ($id: ID!) {\r\n deleteProfile(id: $id) {\r\n ...profileFields\r\n }\r\n }\r\n\r\n ${profileFieldsFragment}\r\n `\r\n );\r\n\r\n // Wrap the mutation in a standard callback.\r\n const [action, { isExecuting, errors: actionErrors }] = useAsyncCallback(async (id: string) => {\r\n const result = await mutationAction({ variables: { id: id } });\r\n if (result.errors && result.errors.length) {\r\n throw result.errors;\r\n }\r\n }, [mutationAction]);\r\n\r\n return [action, { isExecuting: isExecuting, errors: error ? error.message : actionErrors }];\r\n}\r\n","import { AsyncActionStatus } from \"../../shared/abstractStore\";\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { LockoutRequest } from \"./AccountService\";\r\nimport { useAccountService } from \"./useAccountService\";\r\n\r\n/**\r\n * Callback to lockout an account.\r\n */\r\nexport function useLockoutCallback(): [(model: LockoutRequest) => Promise, AsyncActionStatus] {\r\n const accountService = useAccountService();\r\n\r\n const [action, { isExecuting, errors }] = useAsyncCallback(async (model: LockoutRequest) => {\r\n let result = await accountService.lockout(model);\r\n return result;\r\n }, [accountService]);\r\n\r\n return [action, { isExecuting, errors }];\r\n}\r\n","import * as React from 'react';\r\nimport { NavLink, NavLinkProps } from 'react-router-dom';\r\n\r\nexport interface NavLinkTrackActiveProps extends NavLinkProps {\r\n}\r\n\r\n/**\r\n * NavLink from react-router configured to track the active component with the active class. \r\n * \r\n * This simply returns a that is preconfigured with activeClassName=\"active\".\r\n */\r\nexport const NavLinkTrackActive = (props: NavLinkTrackActiveProps) => {\r\n const { to, exact, activeClassName, ...rest } = props;\r\n\r\n return (\r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { NavItem, NavLink } from 'reactstrap';\r\nimport { SidebarNavTitle } from '../../shared/sidebarNav';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { NavLinkTrackActive } from '../shared/NavLinkTrackActive';\r\nimport { AuthorizeContainer } from '../../shared/authorizeRoute';\r\nimport { IdentityRoles } from '../../configure/security/IdentityRoles';\r\n\r\nexport const AdministrationNavigation = () => {\r\n const { t } = useTranslation();\r\n\r\n return (\r\n \r\n \r\n {t('administrationNavigation.administrationHeading', 'Administration')}\r\n \r\n\r\n \r\n {t('administrationNavigation.userAdministrationHeading', 'Student applications')}\r\n \r\n \r\n \r\n \r\n <> {t('administrationNavigation.pendingApplications', 'Pending applications')}\r\n \r\n \r\n \r\n \r\n \r\n <> {t('administrationNavigation.completedApplications', 'Issued cards')}\r\n \r\n \r\n \r\n \r\n \r\n <> {t('administrationNavigation.rejectedApplications', 'Rejected applications')}\r\n \r\n \r\n \r\n \r\n \r\n <> {t('administrationNavigation.failedPaymentApplications', 'Failed payments')}\r\n \r\n \r\n \r\n \r\n \r\n <> {t('administrationNavigation.searchApplications', 'Search all applications')}\r\n \r\n \r\n\r\n \r\n \r\n {t('administrationNavigation.activityAdministrationHeading', 'General administration')}\r\n \r\n \r\n \r\n \r\n <> {t('administrationNavigation.universities', 'Bulk buying organisations')}\r\n \r\n \r\n \r\n \r\n \r\n <> {t('administrationNavigation.products', 'Product pricing')}\r\n \r\n \r\n\r\n \r\n {t('administrationNavigation.userAdministrationHeading', 'User administration')}\r\n \r\n \r\n \r\n \r\n <> {t('administrationNavigation.users', 'Users')}\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import './navTiles.scss';\r\n\r\nimport * as React from 'react';\r\nimport { NavProps, Nav } from 'reactstrap';\r\n\r\nexport interface NavTilesProps extends NavProps {\r\n}\r\n\r\n/**\r\n * Component that displays the passed in NavItems as tiles.\r\n * @param props\r\n */\r\nexport const NavTiles = (props: NavTilesProps) => {\r\n const { children, className } = props;\r\n\r\n\r\n return (\r\n \r\n );\r\n}","import { RouteEntry } from \"../../shared/routes\";\r\nimport { AdministrationNavigation } from \"./AdministrationNavigation\";\r\nimport { Administration } from \"./Administration\";\r\n\r\nexport const administrationRoutes: Array = [\r\n { path: '/administration', exact: true, component: Administration, authorize: true },\r\n];\r\n\r\nexport const administrationSidebarRoutes: Array = [\r\n { path: '/administration', component: AdministrationNavigation, authorize: true },\r\n];\r\n","import * as React from 'react';\r\nimport { AdministrationNavigation } from './AdministrationNavigation';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { NavTiles } from '../shared/NavTiles';\r\nimport { Container } from 'reactstrap';\r\nimport { Banner } from '../shared/Banner';\r\nimport { Background } from '../shared/Background';\r\n\r\n/**\r\n * Administration menu. \r\n */\r\nexport const Administration = () => {\r\n const { t } = useTranslation();\r\n\r\n return (\r\n \r\n \r\n

{t('administration.heading', 'Administration')}

\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n );\r\n};","import * as React from 'react';\r\nimport { Redirect } from 'react-router';\r\nimport { useSearchParams } from '../../shared/useURLSearchParams';\r\n\r\n/**\r\n * Default / home page.\r\n */\r\nexport const Home = () => {\r\n // If we have a redirect URL on the query string redirect there.\r\n var { redirectUrl } = useSearchParams();\r\n\r\n return (\r\n <>\r\n \r\n \r\n );\r\n};","import { RouteEntry } from \"../../shared/routes\";\r\nimport { Home } from \"./Home\";\r\n\r\nexport const homeRoutes: Array = [\r\n { path: '/StudentOffer/apply', exact: true, component: Home },\r\n { path: '/StudentOffer/', exact: true, component: Home },\r\n { path: '/', exact: true, component: Home },\r\n];\r\n","import gql from \"graphql-tag\";\r\nimport { universityFields } from \"../generated/universityFields\";\r\n\r\nexport const universityFieldsFragment = gql`\r\n fragment universityFields on University {\r\n id\r\n name\r\n archived\r\n }\r\n`;\r\n\r\n\r\nexport type University = Omit;\r\n","import gql from \"graphql-tag\";\r\nimport { productFields } from \"../generated/productFields\";\r\n\r\nexport const productFieldsFragment = gql`\r\n fragment productFields on Product {\r\n id\r\n name\r\n price\r\n isUnder19\r\n isAnydayPass\r\n isCityArea\r\n archived\r\n anydayDays\r\n }\r\n`;\r\n\r\n\r\nexport type Product = Omit;\r\n","/**\r\n * Steps we work through when completing the Apply wizard.\r\n */\r\nexport enum ApplyWizardStep {\r\n whoPays,\r\n paymentNotAllowed,\r\n paymentNotAllowedYet,\r\n whichUniversity,\r\n isUnder19,\r\n isAnyday,\r\n anydayDays,\r\n isCityArea,\r\n existingEasyrider,\r\n personalDetails,\r\n photo,\r\n evidence,\r\n evidenceUnder19,\r\n pay,\r\n success,\r\n failure,\r\n}\r\n\r\n","import './choiceButton.scss';\r\n\r\nimport * as React from 'react';\r\nimport { Button, Card, CardBody, CardTitle, CardText } from 'reactstrap';\r\nimport { ConditionalFragment } from 'react-conditionalfragment';\r\n\r\nexport interface ChoiceButtonProps {\r\n active?: boolean,\r\n title: string,\r\n text?: string,\r\n text2?: string,\r\n className?: string,\r\n children?: React.ReactNode,\r\n onClick?: () => void,\r\n imageURL?: string,\r\n linkURL?: string,\r\n linkText?: string,\r\n}\r\n\r\n/**\r\n * Useful nice looking button we use to let the user choose between options.\r\n * @param props\r\n */\r\nexport const ChoiceButton = (props: ChoiceButtonProps) => {\r\n const {\r\n active,\r\n title,\r\n text,\r\n text2,\r\n children,\r\n className,\r\n onClick,\r\n imageURL,\r\n linkURL,\r\n linkText,\r\n } = props;\r\n\r\n return (\r\n \r\n );\r\n};","import { isRunningOnSecureNctxCoUk } from \"./secureNctxCoUkConfig\";\r\n\r\n/**\r\n * _paths.scss but in typescript format.\r\n */\r\nexport const stylesPaths = {\r\n publicRoot: isRunningOnSecureNctxCoUk? '/StudentOffer' : '',\r\n};","import './whoPays.scss';\r\n\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Row, Col } from 'reactstrap';\r\nimport { ChoiceButton } from '../shared/ChoiceButton';\r\nimport { ApplyWizardStep } from '../ApplyWizardStep';\r\nimport { StudentApplication } from '../../../api/main/models/StudentApplication';\r\nimport { stylesPaths } from '../../../configure/stylesPaths';\r\n\r\nexport interface WhoPaysProps {\r\n model: StudentApplication,\r\n change: (changes: Partial) => void,\r\n pushStep: (newStep: ApplyWizardStep) => void,\r\n isCurrentStepComplete: boolean,\r\n stepCompleted: ApplyWizardStep | undefined,\r\n setStepCompleted: (value: ApplyWizardStep) => void ,\r\n}\r\n\r\n/**\r\n * Wizard step to decide who pays.\r\n */\r\nexport const WhoPays = (props: WhoPaysProps) => {\r\n const {\r\n model,\r\n change,\r\n pushStep,\r\n isCurrentStepComplete,\r\n stepCompleted,\r\n setStepCompleted,\r\n } = props;\r\n\r\n const { t } = useTranslation();\r\n return (\r\n <>\r\n \r\n \r\n { change({ universityId: null }); pushStep(ApplyWizardStep.isUnder19); setStepCompleted(!stepCompleted || ApplyWizardStep.whoPays > stepCompleted ? ApplyWizardStep.whoPays : stepCompleted); }}\r\n // ENABLE THE NEXT LINE AND DISABLE THE PREVIOUS LINE TO STOP STUDENTS PAYING FOR CARDS THROUGH THE PORTAL\r\n //onClick={() => { change({ universityId: null }); pushStep(ApplyWizardStep.paymentNotAllowed); setStepCompleted(!stepCompleted || ApplyWizardStep.whoPays > stepCompleted ? ApplyWizardStep.whoPays : stepCompleted); }}\r\n // ENABLE THE NEXT LINE AND DISABLE THE OTHER onClick EVENTS TO STOP STUDENTS USING THE PORTAL UNTIL PASSES ARE AVAILABLE.\r\n onClick={() => { change({ universityId: null }); pushStep(ApplyWizardStep.paymentNotAllowedYet); setStepCompleted(!stepCompleted || ApplyWizardStep.whoPays > stepCompleted ? ApplyWizardStep.whoPays : stepCompleted); }}\r\n title={t('whoPays.direct', 'I am buying my own')}\r\n text={t('whoPays.directt', 'I want to buy my own academic pass')}\r\n imageURL={`${stylesPaths.publicRoot}/img/ModelShoot135_NCT.jpg`}\r\n className={!model.universityId && isCurrentStepComplete ? 'highlight-selected' : ''}\r\n >\r\n \r\n \r\n \r\n { pushStep(ApplyWizardStep.whichUniversity); setStepCompleted(!stepCompleted || ApplyWizardStep.whoPays > stepCompleted ? ApplyWizardStep.whoPays : stepCompleted); }}\r\n // ENABLE THE NEXT LINE AND DISABLE THE OTHER onClick EVENTS TO STOP STUDENTS USING THE PORTAL UNTIL PASSES ARE AVAILABLE.\r\n onClick={() => { change({ universityId: null }); pushStep(ApplyWizardStep.paymentNotAllowedYet); setStepCompleted(!stepCompleted || ApplyWizardStep.whoPays > stepCompleted ? ApplyWizardStep.whoPays : stepCompleted); }}\r\n title={t('whoPays.university', 'It is being provided for me')}\r\n text={t('whoPays.universityt', 'My school, college, local authority or accommodation provider is providing me with an academic pass')}\r\n imageURL={`${stylesPaths.publicRoot}/img/ModelShoot132_NCT.jpg`}\r\n className={model.universityId ? 'highlight-selected' : ''}\r\n >\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n {t('chooseType.wrongPlace', 'Not looking for an academic pass? View or register for our general smart travel cards here.')}\r\n \r\n \r\n \r\n \r\n );\r\n};","\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Row, Col } from 'reactstrap';\r\nimport { ChoiceButton } from '../shared/ChoiceButton';\r\nimport { stylesPaths } from '../../../configure/stylesPaths';\r\n\r\nexport interface PaymentNotAllowedProps {\r\n}\r\n\r\n/**\r\n * Wizard step to decide who pays.\r\n */\r\nexport const PaymentNotAllowed = (props: PaymentNotAllowedProps) => {\r\n const { t } = useTranslation();\r\n return (\r\n <>\r\n \r\n \r\n { }}\r\n title={t('paymentNotAllowed.notavailable', 'Student offers are not currently available online')}\r\n text={t('paymentNotAllowed.notavailablet', 'Our offers on student passes are available to buy online between August and the end of October.')}\r\n text2={t('paymentNotAllowed.notavailablet2', 'Please use the NCTX Buses app or apply in person at the Travel Centre outside of these dates.')}\r\n imageURL={`${stylesPaths.publicRoot}/img/ModelShoot135_NCT.jpg`}\r\n className={''}\r\n linkURL={'https://www.nctx.co.uk/easyrider/smartcards/'}\r\n linkText={t('paymentNotAllowed.notavailablelink', 'Register for our general smart travel cards here.')}\r\n >\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n {t('chooseType.wrongPlace', 'Not looking for an academic pass? View or register for our general smart travel cards here.')}\r\n \r\n \r\n \r\n \r\n );\r\n};","import './formContainer.scss'; \r\n\r\nimport * as React from 'react';\r\nimport { Container, ContainerProps } from 'reactstrap';\r\n\r\nexport interface FormContainerProps extends ContainerProps {\r\n}\r\n\r\n/**\r\n * general input form container.\r\n */\r\nexport const FormContainer = (props: FormContainerProps) => {\r\n const { className, children, ...rest } = props;\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Row, Col, FormGroup, Label, Input, Button } from 'reactstrap';\r\nimport { ApplyWizardStep } from '../ApplyWizardStep';\r\nimport { StudentApplication } from '../../../api/main/models/StudentApplication';\r\nimport { University } from '../../../api/main/models/University';\r\nimport { Guid } from 'guid-string';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { FormContainer } from '../../shared/FormContainer';\r\n\r\nexport interface WhichUniversityProps {\r\n model: StudentApplication,\r\n change: (changes: Partial) => void,\r\n pushStep: (newStep: ApplyWizardStep) => void,\r\n popStep: (untilStep?: ApplyWizardStep) => void,\r\n universities: Array | undefined | null,\r\n stepCompleted: ApplyWizardStep | undefined,\r\n setStepCompleted: (value: ApplyWizardStep) => void,\r\n}\r\n\r\n/**\r\n * Wizard step to decide which bulk buyer (university model) is paying.\r\n */\r\nexport const WhichUniversity = (props: WhichUniversityProps) => {\r\n const {\r\n model, change,\r\n pushStep, popStep,\r\n universities,\r\n stepCompleted,\r\n setStepCompleted,\r\n } = props;\r\n\r\n const { t } = useTranslation();\r\n\r\n // Currently selected university.\r\n const university = React.useMemo(() => {\r\n if (!model || !universities) {\r\n return null;\r\n }\r\n\r\n return universities.find(item => item.id === model.universityId);\r\n }, [model, universities]);\r\n\r\n // Can we continue to the next page?\r\n const canContinue = React.useMemo(() => {\r\n if (!model) {\r\n return false;\r\n }\r\n\r\n return !Guid.isEmpty(model.universityId);\r\n }, [model]);\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n change({ universityId: e.currentTarget.value })}>\r\n \r\n {\r\n universities?.map(item => (\r\n \r\n ))\r\n }\r\n \r\n \r\n\r\n\r\n \r\n \r\n change({ universityProvidedReferenceNumber: e.currentTarget.value })} />\r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Row, Col, Button } from 'reactstrap';\r\nimport { ChoiceButton } from '../shared/ChoiceButton';\r\nimport { ApplyWizardStep } from '../ApplyWizardStep';\r\nimport { StudentApplication } from '../../../api/main/models/StudentApplication';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { stylesPaths } from '../../../configure/stylesPaths';\r\n\r\nexport interface IsUnder19Props {\r\n model: StudentApplication,\r\n change: (changes: Partial) => void,\r\n pushStep: (newStep: ApplyWizardStep) => void,\r\n popStep: (untilStep?: ApplyWizardStep) => void,\r\n calculateProduct: () => void,\r\n isCurrentStepComplete: boolean,\r\n stepCompleted: ApplyWizardStep | undefined,\r\n setStepCompleted: (value: ApplyWizardStep) => void,\r\n}\r\n\r\n/**\r\n * Wizard step to decide who pays.\r\n */\r\nexport const IsUnder19 = (props: IsUnder19Props) => {\r\n const {\r\n model,\r\n change,\r\n pushStep, popStep,\r\n calculateProduct,\r\n isCurrentStepComplete,\r\n stepCompleted,\r\n setStepCompleted,\r\n } = props;\r\n\r\n const { t } = useTranslation();\r\n return (\r\n <>\r\n \r\n \r\n { change({ isUnder19: false }); calculateProduct(); pushStep(ApplyWizardStep.isAnyday); setStepCompleted(!stepCompleted || ApplyWizardStep.isUnder19 > stepCompleted ? ApplyWizardStep.isUnder19 : stepCompleted); }}\r\n title={t('isUnder19.student', 'Student Pass')}\r\n text={t('isUnder19.studentt', 'I am a student who is 19 or over')}\r\n imageURL={`${stylesPaths.publicRoot}/img/NTSU.jpg`}\r\n className={!model.isUnder19 && isCurrentStepComplete ? 'highlight-selected' : ''}\r\n >\r\n \r\n \r\n \r\n { change({ isUnder19: true }); calculateProduct(); pushStep(ApplyWizardStep.isAnyday); setStepCompleted(!stepCompleted || ApplyWizardStep.isUnder19 > stepCompleted ? ApplyWizardStep.isUnder19 : stepCompleted); }}\r\n title={t('isUnder19.under19', 'Under 19')}\r\n text={t('isUnder19.under19t', 'I am a student who is under 19')}\r\n imageURL={`${stylesPaths.publicRoot}/img/id.jpg`}\r\n className={model.isUnder19 ? 'highlight-selected' : ''}\r\n >\r\n \r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Row, Col, Button } from 'reactstrap';\r\nimport { ChoiceButton } from '../shared/ChoiceButton';\r\nimport { ApplyWizardStep } from '../ApplyWizardStep';\r\nimport { StudentApplication } from '../../../api/main/models/StudentApplication';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { stylesPaths } from '../../../configure/stylesPaths';\r\n\r\nexport interface IsAnydayProps {\r\n model: StudentApplication,\r\n change: (changes: Partial) => void,\r\n pushStep: (newStep: ApplyWizardStep) => void,\r\n popStep: (untilStep?: ApplyWizardStep) => void,\r\n calculateProduct: () => void,\r\n isCurrentStepComplete: boolean,\r\n stepCompleted: ApplyWizardStep | undefined,\r\n setStepCompleted: (value: ApplyWizardStep) => void,\r\n}\r\n\r\n/**\r\n * Wizard step to decide Everyday or Anyday pass.\r\n */\r\nexport const IsAnyday = (props: IsAnydayProps) => {\r\n const {\r\n model,\r\n change,\r\n pushStep, popStep,\r\n calculateProduct,\r\n isCurrentStepComplete,\r\n stepCompleted,\r\n setStepCompleted,\r\n } = props;\r\n\r\n const { t } = useTranslation();\r\n return (\r\n <>\r\n \r\n \r\n { change({ isAnydayPass: false }); calculateProduct(); pushStep(ApplyWizardStep.isCityArea); setStepCompleted(!stepCompleted || ApplyWizardStep.isAnyday > stepCompleted ? ApplyWizardStep.isAnyday : stepCompleted); }}\r\n title={t('isAnydayPass.false', 'Everyday Academic Year')}\r\n text={t('isAnydayPass.falset', 'Unlimited travel all day, every day (consecutive days) between 1st September 2023 and 31st July 2024.')}\r\n imageURL={`${stylesPaths.publicRoot}/img/ER_Everyday_Cards.jpg`}\r\n className={!model.isAnydayPass && isCurrentStepComplete ? 'highlight-selected' : ''}\r\n >\r\n \r\n \r\n \r\n { change({ isAnydayPass: true }); pushStep(ApplyWizardStep.anydayDays); setStepCompleted(!stepCompleted || ApplyWizardStep.isAnyday > stepCompleted ? ApplyWizardStep.isAnyday : stepCompleted); }}\r\n title={t('isAnydayPass.true', 'Easyrider Academic Anyday')}\r\n text={t('isAnydayPass.truet', 'Unlimited travel all day, where you bulk buy individual days of travel and use each day as and when needed (non-consecutive days).')}\r\n imageURL={`${stylesPaths.publicRoot}/img/ER_Anyday_Cards.jpg`}\r\n className={model.isAnydayPass ? 'highlight-selected' : ''}\r\n >\r\n \r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Row, Col, Button } from 'reactstrap';\r\nimport { ChoiceButton } from '../shared/ChoiceButton';\r\nimport { ApplyWizardStep } from '../ApplyWizardStep';\r\nimport { StudentApplication } from '../../../api/main/models/StudentApplication';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { stylesPaths } from '../../../configure/stylesPaths';\r\n\r\nexport interface AnydayDaysProps {\r\n model: StudentApplication,\r\n change: (changes: Partial) => void,\r\n pushStep: (newStep: ApplyWizardStep) => void,\r\n popStep: (untilStep?: ApplyWizardStep) => void,\r\n calculateProduct: () => void,\r\n isCurrentStepComplete: boolean,\r\n stepCompleted: ApplyWizardStep | undefined,\r\n setStepCompleted: (value: ApplyWizardStep) => void,\r\n}\r\n\r\n/**\r\n * Wizard step for Anyday to decide 20 days or 50 days or 100 days or 150 days.\r\n */\r\nexport const AnydayDays = (props: AnydayDaysProps) => {\r\n const {\r\n model,\r\n change,\r\n pushStep, popStep,\r\n calculateProduct,\r\n isCurrentStepComplete,\r\n stepCompleted,\r\n setStepCompleted,\r\n } = props;\r\n\r\n const { t } = useTranslation();\r\n return (\r\n <>\r\n \r\n \r\n { change({ anydayDays: 20 }); calculateProduct(); pushStep(ApplyWizardStep.isCityArea); setStepCompleted(!stepCompleted || ApplyWizardStep.anydayDays > stepCompleted ? ApplyWizardStep.anydayDays : stepCompleted); }}\r\n title={t('anydayDays.20', '20 days')}\r\n text={t('anydayDays.20t', 'I want to bulk buy 20 individual days of travel')}\r\n imageURL={`${stylesPaths.publicRoot}/img/20_Overlay.jpg`}\r\n className={!model.isUnder19 && isCurrentStepComplete ? 'highlight-selected' : ''}\r\n >\r\n \r\n \r\n \r\n { change({ anydayDays: 50 }); calculateProduct(); pushStep(ApplyWizardStep.isCityArea); setStepCompleted(!stepCompleted || ApplyWizardStep.anydayDays > stepCompleted ? ApplyWizardStep.anydayDays : stepCompleted); }}\r\n title={t('anydayDays.50', '50 days')}\r\n text={t('anydayDays.50t', 'I want to bulk buy 50 individual days of travel')}\r\n imageURL={`${stylesPaths.publicRoot}/img/50_Overlay.jpg`}\r\n className={!model.isUnder19 && isCurrentStepComplete ? 'highlight-selected' : ''}\r\n >\r\n \r\n \r\n \r\n { change({ anydayDays: 100 }); calculateProduct(); pushStep(ApplyWizardStep.isCityArea); setStepCompleted(!stepCompleted || ApplyWizardStep.anydayDays > stepCompleted ? ApplyWizardStep.anydayDays : stepCompleted); }}\r\n title={t('anydayDays.100', '100 days')}\r\n text={t('anydayDays.100t', 'I want to bulk buy 100 individual days of travel')}\r\n imageURL={`${stylesPaths.publicRoot}/img/100_Overlay.jpg`}\r\n className={model.isUnder19 ? 'highlight-selected' : ''}\r\n >\r\n \r\n \r\n \r\n { change({ anydayDays: 150 }); calculateProduct(); pushStep(ApplyWizardStep.isCityArea); setStepCompleted(!stepCompleted || ApplyWizardStep.anydayDays > stepCompleted ? ApplyWizardStep.anydayDays : stepCompleted); }}\r\n title={t('anydayDays.150', '150 days')}\r\n text={t('anydayDays.150t', 'I want to bulk buy 150 individual days of travel')}\r\n imageURL={`${stylesPaths.publicRoot}/img/150_Overlay.jpg`}\r\n className={model.isUnder19 ? 'highlight-selected' : ''}\r\n >\r\n \r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n );\r\n};","import './isCityArea.scss';\r\n\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Row, Col, Button, Media } from 'reactstrap';\r\nimport { ChoiceButton } from '../shared/ChoiceButton';\r\nimport { ApplyWizardStep } from '../ApplyWizardStep';\r\nimport { StudentApplication } from '../../../api/main/models/StudentApplication';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { ConditionalFragment } from 'react-conditionalfragment';\r\nimport { stylesPaths } from '../../../configure/stylesPaths';\r\n\r\nexport interface IsCityAreaProps {\r\n model: StudentApplication,\r\n change: (changes: Partial) => void,\r\n pushStep: (newStep: ApplyWizardStep) => void,\r\n popStep: (untilStep?: ApplyWizardStep) => void,\r\n calculateProduct: () => void,\r\n isCurrentStepComplete: boolean,\r\n stepCompleted: ApplyWizardStep | undefined,\r\n setStepCompleted: (value: ApplyWizardStep) => void,\r\n}\r\n\r\n/**\r\n * Wizard step to decide City Area or Further.\r\n */\r\nexport const IsCityArea = (props: IsCityAreaProps) => {\r\n const {\r\n model,\r\n change,\r\n pushStep, popStep,\r\n calculateProduct,\r\n isCurrentStepComplete,\r\n stepCompleted,\r\n setStepCompleted,\r\n } = props;\r\n\r\n const mapImage = `${stylesPaths.publicRoot}/img/Nottingham_Eazyrider_Zone_Map.jpg`;\r\n const { t } = useTranslation();\r\n\r\n return (\r\n <>\r\n \r\n
\r\n Nottingham Trent University students please select City Zone Only. Your travel card will cover all of our services, including to Brackenhurst Campus thanks to our partnership with and financial support from NTU.\r\n
\r\n
\r\n \r\n \r\n { change({ isCityArea: true }); calculateProduct(); pushStep(ApplyWizardStep.existingEasyrider); setStepCompleted(!stepCompleted || ApplyWizardStep.isCityArea > stepCompleted ? ApplyWizardStep.isCityArea : stepCompleted) }}\r\n title={t('isCityArea.true', 'City Zone Only')}\r\n text={t('isCityArea.truet', 'This is the Greater Nottingham area and covers nearly all of our services, except for parts of the 1, 26/A, 46 and 47.')}\r\n imageURL={`${stylesPaths.publicRoot}/img/COVID051_NCT.jpg`}\r\n className={model.isCityArea && isCurrentStepComplete ? 'highlight-selected' : ''}\r\n >\r\n \r\n \r\n \r\n { change({ isCityArea: false }); calculateProduct(); pushStep(ApplyWizardStep.existingEasyrider); setStepCompleted(!stepCompleted || ApplyWizardStep.isCityArea > stepCompleted ? ApplyWizardStep.isCityArea : stepCompleted) }}\r\n title={t('isCityArea.false', 'City Zone and Outer Zone')}\r\n text={t('isCityArea.falset', 'This covers all of our services without restriction.')}\r\n imageURL={`${stylesPaths.publicRoot}/img/EastLeake12-NCT.jpg`}\r\n className={!model.isCityArea && isCurrentStepComplete ? 'highlight-selected' : ''}\r\n >\r\n \r\n \r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n );\r\n};","import './existingEasyrider.scss';\r\n\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Row, Col, FormGroup, Label, Input, Button, Media } from 'reactstrap';\r\nimport { ApplyWizardStep } from '../ApplyWizardStep';\r\nimport { StudentApplication } from '../../../api/main/models/StudentApplication';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { FormContainer } from '../../shared/FormContainer';\r\nimport { stylesPaths } from '../../../configure/stylesPaths';\r\n\r\nexport interface ExistingEasyriderProps {\r\n model: StudentApplication,\r\n change: (changes: Partial) => void,\r\n pushStep: (newStep: ApplyWizardStep) => void,\r\n popStep: (untilStep?: ApplyWizardStep) => void,\r\n stepCompleted: ApplyWizardStep | undefined,\r\n setStepCompleted: (value: ApplyWizardStep) => void,\r\n}\r\n\r\n/**\r\n * Wizard step to capture an existing eastrider card number if there is one.\r\n */\r\nexport const ExistingEasyrider = (props:ExistingEasyriderProps) => {\r\n const {\r\n model, change,\r\n pushStep, popStep,\r\n stepCompleted,\r\n setStepCompleted,\r\n } = props;\r\n\r\n const { t } = useTranslation();\r\n const easyriderImage = `${stylesPaths.publicRoot}/img/ER_Everyday_Help.jpg`; \r\n const easyriderImageAlt = t('easyriderImage.alt', 'Easyrider card');\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n change({ existingEasyRiderCardNumber: e.currentTarget.value })} />\r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n );\r\n};","import './personalDetails.scss';\r\n\r\n\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Row, Col, FormGroup, Label, Button } from 'reactstrap';\r\nimport { ApplyWizardStep } from '../ApplyWizardStep';\r\nimport { StudentApplication } from '../../../api/main/models/StudentApplication';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { FormContainer } from '../../shared/FormContainer';\r\nimport { ValidatedInput } from 'pojo-validator-reactstrap';\r\nimport { ValidateCallback } from 'pojo-validator-react';\r\nimport { ValidationErrors } from 'pojo-validator';\r\nimport moment from 'moment';\r\n\r\nexport interface PersonalDetailsProps {\r\n model: StudentApplication,\r\n change: (changes: Partial) => void,\r\n pushStep: (newStep: ApplyWizardStep) => void,\r\n popStep: (untilStep?: ApplyWizardStep) => void,\r\n validate: ValidateCallback,\r\n validationErrors: ValidationErrors,\r\n}\r\n\r\n/**\r\n * Wizard step to capture all personal details for the application.\r\n */\r\nexport const PersonalDetails = (props: PersonalDetailsProps) => {\r\n const {\r\n model, change,\r\n pushStep, popStep,\r\n validate, validationErrors\r\n } = props;\r\n\r\n const { t } = useTranslation();\r\n\r\n // Save the application to the database and progress to the next page.\r\n const validateAndNext = React.useCallback(() => {\r\n // Save everthing we've done so far to the database.\r\n if (!validate()) {\r\n return;\r\n }\r\n\r\n // Progress to the next page.\r\n pushStep(ApplyWizardStep.photo)\r\n }, [validate, pushStep]);\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n change({ forename: e.currentTarget.value })} onBlur={e => validate('forename')} validationErrors={validationErrors['forename']} />\r\n \r\n \r\n \r\n change({ surname: e.currentTarget.value })} onBlur={e => validate('surname')} validationErrors={validationErrors['surname']} />\r\n \r\n \r\n \r\n change({ dateOfBirth: moment(e.currentTarget.value).format('YYYY-MM-DD') })} onBlur={e => validate('dateOfBirth')} validationErrors={validationErrors['dateOfBirth']} />\r\n \r\n \r\n \r\n change({ email: e.currentTarget.value })} onBlur={e => validate('email')} validationErrors={validationErrors['email']} />\r\n \r\n \r\n \r\n change({ street: e.currentTarget.value })} onBlur={e => validate('street')} validationErrors={validationErrors['street']} />\r\n \r\n \r\n \r\n change({ address2: e.currentTarget.value })} onBlur={e => validate('address2')} validationErrors={validationErrors['address2']} />\r\n \r\n \r\n \r\n change({ city: e.currentTarget.value })} onBlur={e => validate('city')} validationErrors={validationErrors['city']} />\r\n \r\n \r\n \r\n change({ county: e.currentTarget.value })} onBlur={e => validate('county')} validationErrors={validationErrors['county']} />\r\n \r\n \r\n \r\n change({ postcode: e.currentTarget.value })} onBlur={e => validate('postcode')} validationErrors={validationErrors['postcode']} />\r\n \r\n {t('personalDetails.mandatory', 'fields marked with * must be completed')}\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n );\r\n};","import { ApiFetch } from 'apifetch-json';\r\nimport { BlobReference } from '../models/BlobReference';\r\n\r\n/**\r\n * Service for handling the uploading of files as blobs.\r\n */\r\nexport class BlobUploadService {\r\n private readonly url: string;\r\n private readonly api: ApiFetch;\r\n\r\n\r\n constructor(url: string, apiFetch?: ApiFetch) {\r\n this.url = url;\r\n this.api = apiFetch || new ApiFetch();\r\n }\r\n\r\n async upload(files: FileList): Promise {\r\n let response = await this.uploadMultiple(files);\r\n\r\n if (!response || !response.length) {\r\n return null;\r\n }\r\n\r\n return response[0];\r\n }\r\n\r\n async uploadMultiple(files: FileList): Promise> {\r\n var data = new FormData();\r\n for (let i = 0; i < files.length; ++i) {\r\n let file = files[i];\r\n data.append('files', file, file.name);\r\n }\r\n\r\n // We use fetch() rather than post() here as we want full control over headers and body.\r\n let result = await this.api.fetch>(\r\n `${this.url}/upload`,\r\n (init) => {\r\n let { headers, ...rest } = init;\r\n\r\n // Make sure we don't pass 'Content-Type' as that will break the way browsers\r\n // pass file uploads. They require it to be blank so the browser can handle\r\n // it with an appropriate boundry set etc.\r\n let newHeaders = new Headers(headers);\r\n newHeaders.delete('Content-Type');\r\n\r\n return {\r\n ...rest,\r\n method: 'POST',\r\n headers: newHeaders,\r\n body: data\r\n };\r\n });\r\n\r\n return result;\r\n }\r\n\r\n async uploadDataUrl(dataUrl: string): Promise {\r\n let result = await this.api.post(`${this.url}/uploadDataUrl`, dataUrl);\r\n return result;\r\n }\r\n}\r\n","import { BlobReference } from '../models/BlobReference';\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport { BlobUploadService } from './BlobUploadService';\r\nimport { mainApiConfig } from '../../../configure/mainApiConfig';\r\nimport { useServices } from 'inject-typesafe-react';\r\nimport { AppServices } from '../../../configure/configureServices';\r\n\r\n/**\r\n * Get a callback to upload blobs in bulk.\r\n */\r\nexport function useBulkUploadBlobsCallback() {\r\n const apiFetch = useServices((services: AppServices) => services.apiFetch());\r\n\r\n return useAsyncCallback(async (files: FileList): Promise> => {\r\n const uploadService = new BlobUploadService(mainApiConfig.blobUploadEndpoint, apiFetch);\r\n const ret = await uploadService.uploadMultiple(files);\r\n return ret ?? [];\r\n }, [apiFetch]);\r\n}\r\n\r\n/**\r\n * Get a callback to upload a blob.\r\n */\r\nexport function useUploadBlobCallback() {\r\n const apiFetch = useServices((services: AppServices) => services.apiFetch());\r\n\r\n return useAsyncCallback(async (files: FileList): Promise => {\r\n const uploadService = new BlobUploadService(mainApiConfig.blobUploadEndpoint, apiFetch);\r\n const ret = await uploadService.upload(files);\r\n return ret;\r\n }, [apiFetch]);\r\n}\r\n","import './customEasyriderCard.scss';\r\n\r\nimport * as React from 'react';\r\nimport { Media } from 'reactstrap';\r\nimport { StudentApplication } from '../../../api/main/models/StudentApplication';\r\nimport { BlobReference } from '../../../api/main/models/BlobReference';\r\n\r\nexport interface CustomEasyriderCardProps {\r\n model: StudentApplication,\r\n className?: string,\r\n cardImageUrl: string,\r\n photoBlob: BlobReference | undefined,\r\n}\r\n\r\n/**\r\n * Easyrider card with applicant name and photo. \r\n */\r\nexport const CustomEasyriderCard = (props: CustomEasyriderCardProps) => {\r\n const {\r\n model, className, \r\n cardImageUrl, photoBlob,\r\n } = props;\r\n\r\n const easyriderImage = cardImageUrl;\r\n\r\n const imageToUse = React.useMemo(() => {\r\n if (!model) {\r\n return '';\r\n }\r\n\r\n return photoBlob ? photoBlob.url : '';\r\n\r\n }, [model, photoBlob]);\r\n\r\n const formattedCardName = React.useMemo(() => {\r\n return model.forename + ' ' + model.surname;\r\n\r\n }, [model]);\r\n\r\n return (\r\n
\r\n \r\n \r\n
{formattedCardName}
\r\n
\r\n\r\n );\r\n};","import './photo.scss';\r\n\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Row, Col, Label, Input, Button, Spinner, FormGroup } from 'reactstrap';\r\nimport { ApplyWizardStep } from '../ApplyWizardStep';\r\nimport { StudentApplication } from '../../../api/main/models/StudentApplication';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { useUploadBlobCallback } from '../../../api/main/blobReferences/useUploadBlobCallback';\r\nimport { AlertOnErrors } from '../../../shared/alertOnErrors';\r\nimport { Guid } from 'guid-string';\r\nimport { BlobReference } from '../../../api/main/models/BlobReference';\r\nimport { CustomEasyriderCard } from '../shared/CustomEasyriderCard';\r\n\r\nexport interface photoProps {\r\n model: StudentApplication,\r\n change: (changes: Partial) => void,\r\n pushStep: (newStep: ApplyWizardStep) => void,\r\n popStep: (untilStep?: ApplyWizardStep) => void,\r\n photoBlob: BlobReference | undefined,\r\n setPhotoBlob: (value: BlobReference | undefined) => void,\r\n cardImageUrl: string,\r\n}\r\n\r\n/**\r\n * Wizard step to upload applicant's photo for the card.\r\n */\r\nexport const Photo = (props: photoProps) => {\r\n const {\r\n model, change,\r\n pushStep, popStep,\r\n photoBlob, setPhotoBlob,\r\n cardImageUrl,\r\n } = props;\r\n\r\n const { t } = useTranslation();\r\n\r\n // Upload a photo of the applicant.\r\n const [uploadBlob, { errors: uploadBlobErrors }] = useUploadBlobCallback();\r\n const [uploadFile, { isExecuting: isUploadingFile, errors: uploadFileErrors }] = useAsyncCallback(async (files: FileList | null) => {\r\n if (!files) {\r\n return;\r\n }\r\n\r\n // Upload the file.\r\n const blob = await uploadBlob(files);\r\n if (!blob) {\r\n return;\r\n }\r\n\r\n change({ photoBlobReferenceId: blob.id });\r\n setPhotoBlob(blob);\r\n }, [uploadBlob, change, t, setPhotoBlob]);\r\n\r\n // Can we continue to the next page?\r\n const canContinue = React.useMemo(() => {\r\n if (!model) {\r\n return false;\r\n }\r\n\r\n return !Guid.isEmpty(model.photoBlobReferenceId);\r\n }, [model]);\r\n\r\n return (\r\n <>\r\n
\r\n \r\n \r\n\r\n \r\n \r\n \r\n
\r\n The Easyrider Smartcard you are purchasing requires a photograph.\r\n The photo must be:\r\n
    \r\n
  • in colour
  • \r\n
  • a true likeness of you and of your full head
  • \r\n
  • free of any reflection or glare from glasses
  • \r\n
  • of you on your own
  • \r\n
\r\n You must:\r\n
    \r\n
  • face forward and look straight into the camera
  • \r\n
  • look natural with no facial expressions, for example, smiling, grinning or frowning
  • \r\n
  • have nothing covering your eyes, for example, hair or glasses frame
  • \r\n
  • not wear sunglasses or tinted glassed
  • \r\n
  • not wear a hat or cover your head unless for medical or religious reasons. Religious headwear can be worn, but it must not cover your face.
  • \r\n
\r\n View our advice for customers wearing a Niqab.

\r\n If an inappropriate or poor quality image is uploaded, you will be asked to provide an acceptable replacement, which will delay the issuing of your Easyrider smartcard.\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n \r\n );\r\n};","import { AsyncActionStatus } from '../../../shared/abstractStore';\r\nimport { useServices } from 'inject-typesafe-react';\r\nimport { AppServices } from '../../../configure/configureServices';\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\n\r\n/**\r\n * Send an email to let the user know the payment was a success.\r\n * @param id\r\n * @param options\r\n */\r\nexport function useSendPaymentConfirmEmailCallback(): [(id: string) => Promise, AsyncActionStatus] {\r\n const apiFetch = useServices((services: AppServices) => services.apiFetch());\r\n\r\n // Prepare a callback that calls the rest API to send the email.\r\n const [action, { isExecuting, errors: actionErrors }] = useAsyncCallback(async (id: string) => {\r\n await apiFetch.get(`/api/payment/sendPaymentConfirmEmail/${id}`);\r\n }, [apiFetch]);\r\n\r\n return [action, { isExecuting: isExecuting, errors: actionErrors }];\r\n}\r\n\r\n","import './evidence.scss';\r\n\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Row, Col, Label, Input, Button, Spinner, Media, FormGroup } from 'reactstrap';\r\nimport { ApplyWizardStep } from '../ApplyWizardStep';\r\nimport { StudentApplication } from '../../../api/main/models/StudentApplication';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { useUploadBlobCallback } from '../../../api/main/blobReferences/useUploadBlobCallback';\r\nimport { AlertOnErrors } from '../../../shared/alertOnErrors';\r\nimport { Guid } from 'guid-string';\r\nimport { BlobReference } from '../../../api/main/models/BlobReference';\r\nimport { ButtonAsync } from 'reactstrap-buttonasync';\r\nimport { useSendPaymentConfirmEmailCallback } from '../../../api/main/studentApplications/useSendPaymentConfirmEmailCallback';\r\nimport { stylesPaths } from '../../../configure/stylesPaths';\r\n\r\nexport interface evidenceProps {\r\n model: StudentApplication,\r\n change: (changes: Partial) => void,\r\n pushStep: (newStep: ApplyWizardStep) => void,\r\n popStep: (untilStep?: ApplyWizardStep) => void,\r\n evidenceBlob: BlobReference | undefined,\r\n setEvidenceBlob: (value: BlobReference | undefined) => void,\r\n save: () => Promise,\r\n}\r\n\r\n/**\r\n * Wizard step to upload applicant's evidence photo.\r\n */\r\nexport const Evidence = (props: evidenceProps) => {\r\n const {\r\n model, change,\r\n pushStep, popStep,\r\n evidenceBlob, setEvidenceBlob,\r\n save,\r\n } = props;\r\n\r\n const { t } = useTranslation();\r\n\r\n // Upload a photo of the applicant's proof of identity.\r\n const [uploadBlob, { errors: uploadBlobErrors }] = useUploadBlobCallback();\r\n const [uploadFile, { isExecuting: isUploadingFile, errors: uploadFileErrors }] = useAsyncCallback(async (files: FileList | null) => {\r\n if (!files) {\r\n return;\r\n }\r\n\r\n // Upload the file.\r\n const blob = await uploadBlob(files);\r\n if (!blob) {\r\n return;\r\n }\r\n\r\n change({ proofOfEntitlementBlobReferenceId: blob.id });\r\n setEvidenceBlob(blob);\r\n }, [uploadBlob, change, t, setEvidenceBlob]);\r\n\r\n const evidenceImage = `${stylesPaths.publicRoot}/img/NTSU.jpg`;\r\n const evidenceImageAlt = t('evidenceImage.alt', 'Upload image');\r\n\r\n const imageToUse = React.useMemo(() => {\r\n if (!model) {\r\n return evidenceImage;\r\n }\r\n\r\n return evidenceBlob ? evidenceBlob.url : evidenceImage;\r\n\r\n }, [model, evidenceBlob]);\r\n\r\n // Can we continue to the next page?\r\n const canContinue = React.useMemo(() => {\r\n if (!model) {\r\n return false;\r\n }\r\n\r\n return !Guid.isEmpty(model.proofOfEntitlementBlobReferenceId);\r\n }, [model]);\r\n\r\n const [sendPaymentConfirmEmail, { /*isExecuting: isSendingPaymentConfirmEmail, */ errors: sendPaymentConfirmEmailErrors }] = useSendPaymentConfirmEmailCallback();\r\n\r\n // Save the application to the database and progress to the next page.\r\n const [saveAndNext, { isExecuting: isSaving }] = useAsyncCallback(async () => {\r\n // Save everthing we've done so far to the database.\r\n await save();\r\n\r\n // Progress to the next page.\r\n\r\n // if there is no university id then we need to collect otherwise straight to success\r\n if (!model.universityId) {\r\n pushStep(ApplyWizardStep.pay);\r\n } else {\r\n sendPaymentConfirmEmail(model.id);\r\n pushStep(ApplyWizardStep.success);\r\n }\r\n\r\n }, [save, pushStep, model]);\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n
\r\n {t('evidence.para.1','To qualify for student discount, students must present (at the time of purchase) a valid photo ID issued by their UK college or university that shows a course expiry date. NUS Extra, ISIC and TOTUM cards are not accepted.')}

\r\n {t('evidence.para.1', 'Travel can only be purchased for periods of travel that do not exceed the expiry date shown on the Student ID.')}.\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n saveAndNext()}\r\n isExecuting={isSaving}\r\n executingChildren={<><> {t('evidence.saving', 'Saving application...')}}\r\n >\r\n {t('common.next', 'Next')}\r\n <> \r\n \r\n \r\n \r\n \r\n
\r\n \r\n );\r\n};","import './evidence.scss';\r\n\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Row, Col, Label, Input, Button, Spinner, Media, FormGroup } from 'reactstrap';\r\nimport { ApplyWizardStep } from '../ApplyWizardStep';\r\nimport { StudentApplication } from '../../../api/main/models/StudentApplication';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { useAsyncCallback } from \"react-use-async-callback\";\r\nimport { useUploadBlobCallback } from '../../../api/main/blobReferences/useUploadBlobCallback';\r\nimport { AlertOnErrors } from '../../../shared/alertOnErrors';\r\nimport { Guid } from 'guid-string';\r\nimport { BlobReference } from '../../../api/main/models/BlobReference';\r\nimport { ButtonAsync } from 'reactstrap-buttonasync';\r\nimport { stylesPaths } from '../../../configure/stylesPaths';\r\n\r\nexport interface evidenceUnder19Props {\r\n model: StudentApplication,\r\n change: (changes: Partial) => void,\r\n pushStep: (newStep: ApplyWizardStep) => void,\r\n popStep: (untilStep?: ApplyWizardStep) => void,\r\n evidenceBlob: BlobReference | undefined,\r\n setEvidenceBlob: (value: BlobReference | undefined) => void,\r\n save: () => Promise,\r\n}\r\n\r\n/**\r\n * Wizard step to upload applicant's evidence photo if under 19.\r\n */\r\nexport const EvidenceUnder19 = (props: evidenceUnder19Props) => {\r\n const {\r\n model, change,\r\n pushStep, popStep,\r\n evidenceBlob, setEvidenceBlob,\r\n save,\r\n } = props;\r\n\r\n const { t } = useTranslation();\r\n\r\n // Upload a photo of the applicant's proof of identity.\r\n const [uploadBlob, { errors: uploadBlobErrors }] = useUploadBlobCallback();\r\n const [uploadFile, { isExecuting: isUploadingFile, errors: uploadFileErrors }] = useAsyncCallback(async (files: FileList | null) => {\r\n if (!files) {\r\n return;\r\n }\r\n\r\n // Upload the file.\r\n const blob = await uploadBlob(files);\r\n if (!blob) {\r\n return;\r\n }\r\n\r\n change({ proofOfEntitlementBlobReferenceId: blob.id });\r\n setEvidenceBlob(blob);\r\n }, [uploadBlob, change, t, setEvidenceBlob]);\r\n\r\n const evidenceImage = `${stylesPaths.publicRoot}/img/id.jpg`;\r\n const evidenceImageAlt = t('evidenceImage.alt', 'Upload image');\r\n\r\n const imageToUse = React.useMemo(() => {\r\n if (!model) {\r\n return evidenceImage;\r\n }\r\n\r\n return evidenceBlob ? evidenceBlob.url : evidenceImage;\r\n\r\n }, [model, evidenceBlob]);\r\n\r\n // Can we continue to the next page?\r\n const canContinue = React.useMemo(() => {\r\n if (!model) {\r\n return false;\r\n }\r\n\r\n return !Guid.isEmpty(model.proofOfEntitlementBlobReferenceId);\r\n }, [model]);\r\n\r\n // Save the application to the database and progress to the next page.\r\n const [saveAndNext, { isExecuting: isSaving }] = useAsyncCallback(async () => {\r\n // Save everthing we've done so far to the database.\r\n await save();\r\n\r\n // Progress to the next page.\r\n\r\n // if there is a university id then no need to collect\r\n if (!model.universityId) {\r\n pushStep(ApplyWizardStep.pay)\r\n } else {\r\n pushStep(ApplyWizardStep.success)\r\n }\r\n\r\n }, [save, pushStep, model]);\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n
\r\n If you’re Under 19 you must provide proof of age. Upload a photo of your photo ID that shows your date of birth e.g. passport or driving licence.

\r\n Travel can be purchased for use until the end of the academic year when the course ends.\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n saveAndNext()}\r\n isExecuting={isSaving}\r\n executingChildren={<><> {t('evidence.saving', 'Saving application...')}}\r\n >\r\n {t('common.next', 'Next')}\r\n <> \r\n \r\n \r\n \r\n \r\n
\r\n \r\n );\r\n};","import gql from \"graphql-tag\";\r\nimport { blobReferenceFields } from \"../generated/blobReferenceFields\";\r\n\r\nexport const blobReferenceFieldsFragment = gql`\r\n fragment blobReferenceFields on BlobReference {\r\n id\r\n filename\r\n mimeType\r\n storageReference\r\n archived\r\n createdByUserId\r\n createdDate\r\n url\r\n }\r\n`;\r\n\r\n\r\nexport type BlobReference = Omit;\r\n","import gql from \"graphql-tag\";\r\nimport { studentApplicationFields } from \"../generated/studentApplicationFields\";\r\nimport { universityFieldsFragment } from \"./University\";\r\nimport { productFieldsFragment } from \"./Product\";\r\nimport { blobReferenceFieldsFragment } from \"./BlobReference\";\r\nimport { userFieldsFragment } from \"./User\";\r\n\r\nexport const studentApplicationFieldsFragment = gql`\r\n fragment studentApplicationFields on StudentApplication {\r\n id\r\n forename\r\n surname\r\n street\r\n address2\r\n city\r\n county\r\n postcode\r\n country\r\n dateOfBirth\r\n email\r\n photoBlobReferenceId\r\n proofOfEntitlementBlobReferenceId\r\n isUnder19\r\n isAnydayPass\r\n isCityArea\r\n productId\r\n existingEasyRiderCardNumber\r\n universityId\r\n universityProvidedReferenceNumber\r\n hasBeenIssued\r\n submittedDate\r\n issuedOnDate\r\n issuedByUserId\r\n hasPaid\r\n price\r\n paymentProviderReferenceNumber\r\n paymentTakenDate\r\n archived\r\n anydayDays\r\n\r\n university {\r\n ...universityFields\r\n }\r\n\r\n product {\r\n ...productFields\r\n }\r\n\r\n photoBlobReference {\r\n ...blobReferenceFields\r\n }\r\n\r\n proofOfEntitlementBlobReference {\r\n ...blobReferenceFields\r\n }\r\n\r\n issuedByUser {\r\n ...userFields\r\n }\r\n }\r\n\r\n ${universityFieldsFragment}\r\n ${productFieldsFragment}\r\n ${blobReferenceFieldsFragment}\r\n ${userFieldsFragment}\r\n`;\r\n\r\n\r\nexport type StudentApplication = Omit;\r\n","import { useMutation } from \"@apollo/react-hooks\";\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncActionStatus } from '../../../shared/abstractStore';\r\nimport { StudentApplicationCreateInput } from '../generated/globalTypes';\r\nimport { createStudentApplicationMutation, createStudentApplicationMutationVariables } from '../generated/createStudentApplicationMutation';\r\nimport { studentApplicationFieldsFragment } from '../models/StudentApplication';\r\n\r\n/**\r\n * Get a callback to create a StudentApplication in the store.\r\n */\r\nexport function useCreateStudentApplicationCallback(): [(model: StudentApplicationCreateInput) => Promise, AsyncActionStatus] {\r\n const [mutationAction, { error }] = useMutation(\r\n gql`\r\n mutation createStudentApplicationMutation ($model: StudentApplicationCreateInput!) {\r\n createStudentApplication(model: $model) {\r\n ...studentApplicationFields\r\n }\r\n }\r\n\r\n ${studentApplicationFieldsFragment}\r\n `\r\n );\r\n\r\n // Wrap the mutation in a standard callback.\r\n const [action, { isExecuting, errors: actionErrors }] = useAsyncCallback(async (model: StudentApplicationCreateInput) => {\r\n const result = await mutationAction({ variables: { model: model } });\r\n if (result.errors && result.errors.length) {\r\n throw result.errors;\r\n }\r\n }, [mutationAction]);\r\n\r\n return [action, { isExecuting: isExecuting, errors: error ? error.message : actionErrors }];\r\n}\r\n","import { useMutation } from \"@apollo/react-hooks\";\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncActionStatus } from '../../../shared/abstractStore';\r\nimport { StudentApplicationUpdateInput } from '../generated/globalTypes';\r\nimport { updateStudentApplicationMutation, updateStudentApplicationMutationVariables } from '../generated/updateStudentApplicationMutation';\r\nimport { studentApplicationFieldsFragment } from '../models/StudentApplication';\r\n\r\n/**\r\n * Get a callback to update a StudentApplication in the store.\r\n */\r\nexport function useUpdateStudentApplicationCallback(): [(id: string, model: StudentApplicationUpdateInput) => Promise, AsyncActionStatus] {\r\n const [mutationAction, { error }] = useMutation(\r\n gql`\r\n mutation updateStudentApplicationMutation ($model: StudentApplicationUpdateInput!) {\r\n updateStudentApplication(model: $model) {\r\n ...studentApplicationFields\r\n }\r\n }\r\n\r\n ${studentApplicationFieldsFragment}\r\n `\r\n );\r\n\r\n // Wrap the mutation in a standard callback.\r\n const [action, { isExecuting, errors: actionErrors }] = useAsyncCallback(async (id: string, model: StudentApplicationUpdateInput) => {\r\n const result = await mutationAction({ variables: { model: { id: id, ...model } } });\r\n if (result.errors && result.errors.length) {\r\n throw result.errors;\r\n }\r\n }, [mutationAction]);\r\n\r\n return [action, { isExecuting: isExecuting, errors: error ? error.message : actionErrors }];\r\n}\r\n","import * as React from 'react';\r\nimport { StudentApplicationCreateInput, StudentApplicationUpdateInput } from '../generated/globalTypes';\r\nimport { useSaveInStore, SaveInStoreOptions } from '../../../shared/useSaveInStore';\r\nimport { useCreateStudentApplicationCallback } from './useCreateStudentApplicationCallback';\r\nimport { useUpdateStudentApplicationCallback } from './useUpdateStudentApplicationCallback';\r\nimport { StudentApplication } from '../models/StudentApplication';\r\n\r\n/**\r\n * Get a callback to save a StudentApplication in the store using either a create or update.\r\n */\r\nexport function useSaveStudentApplicationCallback(options: SaveInStoreOptions = {}) {\r\n const [_create, createStatus] = useCreateStudentApplicationCallback();\r\n const create = React.useCallback((model: Partial) => _create(model as StudentApplicationCreateInput), [_create]);\r\n\r\n const [_update, updateStatus] = useUpdateStudentApplicationCallback();\r\n const update = React.useCallback((id: string, changes: Partial) => _update(id, changes as StudentApplicationUpdateInput), [_update]);\r\n\r\n return useSaveInStore(\r\n [create, createStatus],\r\n [update, updateStatus],\r\n options\r\n );\r\n}\r\n","/**\r\n * Settings that control the collection of card payments.\r\n */\r\nexport const paymentConfig = {\r\n useFakePaymentPage: false,\r\n serviceUrl: 'https://pay.realexpayments.com/pay',\r\n //redirectUrl: () => `${window.location.origin}/api/payment/processResponse`,\r\n redirectUrl: () => 'https://secure.nctx.co.uk/StudentOffer/StudentOfferPayMsg.aspx',\r\n //redirectUrl: () => 'https://nct-students.azurewebsites.net/api/payment/processResponse',\r\n};","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Row, Col, Button } from 'reactstrap';\r\nimport { ChoiceButton } from '../shared/ChoiceButton';\r\nimport { ApplyWizardStep } from '../ApplyWizardStep';\r\nimport { StudentApplication } from '../../../api/main/models/StudentApplication';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { Product } from '../../../api/main/models/Product';\r\nimport moment from 'moment';\r\nimport { useSendPaymentConfirmEmailCallback } from '../../../api/main/studentApplications/useSendPaymentConfirmEmailCallback';\r\nimport { useSendPaymentFailEmailCallback } from '../../../api/main/studentApplications/useSendPaymentFailEmailCallback';\r\nimport { AlertOnErrors } from '../../../shared/alertOnErrors';\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport { useCallbackAwaitStateSync } from 'use-callback-await-state-sync';\r\nimport { stylesPaths } from '../../../configure/stylesPaths';\r\n\r\nexport interface PayProps {\r\n model: StudentApplication,\r\n change: (changes: Partial) => void,\r\n pushStep: (newStep: ApplyWizardStep) => void,\r\n popStep: (untilStep?: ApplyWizardStep) => void,\r\n product: Product | undefined | null,\r\n save: () => Promise,\r\n}\r\n\r\n/**\r\n * Wizard step to test payment.\r\n */\r\nexport const PayFake = (props: PayProps) => {\r\n const {\r\n model,\r\n change,\r\n pushStep, popStep,\r\n product,\r\n save,\r\n } = props;\r\n\r\n const { t } = useTranslation();\r\n\r\n const [sendPaymentConfirmEmail, { /*isExecuting: isSendingPaymentConfirmEmail, */ errors: sendPaymentConfirmEmailErrors }] = useSendPaymentConfirmEmailCallback();\r\n const [sendPaymentFailEmail, { /*isExecuting: isSendingPaymentConfirmEmail, */ errors: sendPaymentFailEmailErrors }] = useSendPaymentFailEmailCallback();\r\n\r\n const [_saveAndNext, { errors: saveFormErrors }] = useAsyncCallback(async() => {\r\n // save the model and set the next step\r\n await save();\r\n\r\n if (!model.archived) {\r\n // successful payment\r\n sendPaymentConfirmEmail(model.id);\r\n pushStep(ApplyWizardStep.success);\r\n } else {\r\n // failed payment\r\n sendPaymentFailEmail(model.id);\r\n pushStep(ApplyWizardStep.failure);\r\n }\r\n }, [save, ApplyWizardStep, pushStep]);\r\n const saveAndNext = useCallbackAwaitStateSync(() => _saveAndNext());\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n { change({ hasPaid: true, price: product?.price, paymentProviderReferenceNumber: 'fake123', paymentTakenDate: moment().toISOString(), archived: false }); saveAndNext();}}\r\n title={t('payFake.success', 'Payment Success')}\r\n text={t('payFake.successt', 'Test payment success £{{productPrice}} collected', { productPrice: product?.price })}\r\n imageURL={`${stylesPaths.publicRoot}/img/ModelShoot135_NCT.jpg`}\r\n >\r\n \r\n \r\n \r\n { change({ hasPaid: false, price: product?.price, paymentProviderReferenceNumber: 'fake123', paymentTakenDate: moment().toISOString(), archived: true }); saveAndNext();}}\r\n title={t('payFake.failure', 'Payment Failure')}\r\n text={t('payFake.failuret', 'Test payment failure £{{productPrice}} not collected', { productPrice: product?.price })}\r\n imageURL={`${stylesPaths.publicRoot}/img/ModelShoot135_NCT.jpg`}\r\n >\r\n \r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n );\r\n};","import { AsyncActionStatus } from '../../../shared/abstractStore';\r\nimport { useServices } from 'inject-typesafe-react';\r\nimport { AppServices } from '../../../configure/configureServices';\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\n\r\n/**\r\n * Send an email to let the user know the paymentfailed.\r\n * @param id\r\n * @param options\r\n */\r\nexport function useSendPaymentFailEmailCallback(): [(id: string) => Promise, AsyncActionStatus] {\r\n const apiFetch = useServices((services: AppServices) => services.apiFetch());\r\n\r\n // Prepare a callback that calls the rest API to send the email.\r\n const [action, { isExecuting, errors: actionErrors }] = useAsyncCallback(async (id: string) => {\r\n await apiFetch.get(`/api/payment/sendPaymentFailEmail/${id}`);\r\n }, [apiFetch]);\r\n\r\n return [action, { isExecuting: isExecuting, errors: actionErrors }];\r\n}\r\n\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Button, Row, Col } from 'reactstrap';\r\nimport { StudentApplication } from '../../../api/main/models/StudentApplication';\r\nimport { usePreparePaymentJson } from '../../../api/main/studentApplications/usePreparePaymentJson';\r\nimport { paymentConfig } from '../../../configure/paymentConfig';\r\nimport { ApplyWizardStep } from '../ApplyWizardStep';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { Product } from '../../../api/main/models/Product';\r\n\r\nexport interface PayProps {\r\n model: StudentApplication,\r\n //change: (changes: Partial) => void,\r\n //pushStep: (newStep: ApplyWizardStep) => void,\r\n popStep: (untilStep?: ApplyWizardStep) => void,\r\n //save: () => Promise,\r\n product: Product | undefined | null,\r\n}\r\n\r\n/**\r\n * Wizard step to take payments from the user's card.\r\n */\r\nexport const PayReal = (props: PayProps) => {\r\n const {\r\n model,\r\n popStep,\r\n product,\r\n } = props;\r\n\r\n const { t } = useTranslation();\r\n\r\n const { data: { json: hppJson } } = usePreparePaymentJson(model.id);\r\n\r\n React.useEffect(() => {\r\n if (!hppJson) {\r\n return;\r\n }\r\n\r\n // NOTE these first two scripts are now incuded in index.html so don't get added here.\r\n //let script1 = document.createElement('script');\r\n //script1.src = 'https://code.jquery.com/jquery-3.5.0.js';\r\n //script1.async = false;\r\n //document.body.appendChild(script1);\r\n\r\n //let script2 = document.createElement('script');\r\n //script2.src = '/globalpay/rxp-js.js';\r\n //script2.async = false;\r\n //document.body.appendChild(script2);\r\n\r\n let script3 = document.createElement('script');\r\n script3.text = `\r\n RealexHpp.setHppUrl(\"${paymentConfig.serviceUrl}\");\r\n RealexHpp.redirect.init(\"payButtonId\", \"${paymentConfig.redirectUrl()}\", JSON.parse('${hppJson}'));\r\n `;\r\n //script3.text = `\r\n // RealexHpp.setHppUrl(\"${paymentConfig.serviceUrl}\");\r\n // RealexHpp.embedded.init(\"payButtonId\", \"iFrameId\", \"${paymentConfig.redirectUrl()}\", JSON.parse('${hppJson}'));\r\n // //RealexHpp.lightbox.init(\"payButtonId\", \"${paymentConfig.redirectUrl()}\", JSON.parse('${hppJson}'));\r\n // `;\r\n script3.async = true;\r\n document.body.appendChild(script3);\r\n }, [hppJson]);\r\n\r\n return (\r\n <>\r\n
\r\n

\r\n {t('payReal.paymentAmount', 'Your payment amount will be £{{paymentamount}}', { paymentamount: product?.price })}

\r\n {t('payReal.waitingMessage', 'You will now be redirected to our secure checkout.')}\r\n

\r\n

\r\n {t('payReal.warningMessage', 'Warning do not navigate backwards through this process or risk paying twice.')}\r\n

\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { useLazyQuery } from \"@apollo/react-hooks\";\r\nimport gql from \"graphql-tag\";\r\nimport { Guid } from \"guid-string\";\r\nimport { AsyncLoadResult, AsyncLoadOptions } from '../../../shared/abstractStore';\r\nimport { preparePaymentJsonQuery, preparePaymentJsonQueryVariables } from '../generated/preparePaymentJsonQuery';\r\nimport { mainApiConfig } from '../../../configure/mainApiConfig';\r\n\r\n/**\r\n * Get the Json we need to launch a payment page for a StudentApplication.\r\n * @param id\r\n * @param options\r\n */\r\nexport function usePreparePaymentJson(id: string | undefined | null, options: AsyncLoadOptions = {}): AsyncLoadResult {\r\n // Query the data we need form the api.\r\n const [load, { data, loading, error, refetch }] = useLazyQuery(\r\n gql`\r\n query preparePaymentJsonQuery ($id: ID!) {\r\n json: preparePaymentJson (id: $id)\r\n }\r\n `,\r\n {\r\n variables: {\r\n id: id ?? Guid.empty\r\n },\r\n fetchPolicy: options.fetchPolicy ?? mainApiConfig.defaultFetchPolicy,\r\n pollInterval: options.pollInterval,\r\n onCompleted: (data) => {\r\n if (options.onCompleted) {\r\n options.onCompleted(data);\r\n }\r\n }\r\n }\r\n );\r\n\r\n // Run the query (unless we are being lazy).\r\n React.useEffect(() => {\r\n if (!options.lazy) {\r\n load();\r\n }\r\n }, [options.lazy, load])\r\n\r\n // Return the results.\r\n const refresh = React.useCallback(async () => { !refetch ? await load() : await refetch(); }, [refetch, load]);\r\n return React.useMemo(() => ({\r\n data: data ?? ({} as any),\r\n refresh: refresh,\r\n isLoading: loading,\r\n errors: error\r\n }), [data, refresh, loading, error]);\r\n}\r\n","import * as React from 'react';\r\nimport { ApplyWizardStep } from '../ApplyWizardStep';\r\nimport { StudentApplication } from '../../../api/main/models/StudentApplication';\r\nimport { Product } from '../../../api/main/models/Product';\r\nimport { paymentConfig } from '../../../configure/paymentConfig';\r\nimport { PayFake } from './PayFake';\r\nimport { PayReal } from './PayReal';\r\n\r\nexport interface PayProps {\r\n model: StudentApplication,\r\n change: (changes: Partial) => void,\r\n pushStep: (newStep: ApplyWizardStep) => void,\r\n popStep: (untilStep?: ApplyWizardStep) => void,\r\n save: () => Promise,\r\n product: Product | undefined | null,\r\n}\r\n\r\n/**\r\n * Wizard step to test payment.\r\n */\r\nexport const Pay = (props: PayProps) => {\r\n return (\r\n <>\r\n {\r\n paymentConfig.useFakePaymentPage ? (\r\n \r\n ) : (\r\n \r\n )\r\n }\r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { StudentApplication } from '../../../api/main/models/StudentApplication';\r\nimport { BlobReference } from '../../../api/main/models/BlobReference';\r\nimport { CustomEasyriderCard } from '../shared/CustomEasyriderCard';\r\n\r\nexport interface SuccessProps {\r\n model: StudentApplication,\r\n photoBlob: BlobReference | undefined,\r\n cardImageUrl: string,\r\n}\r\n\r\n/**\r\n * Wizard step to test payment.\r\n */\r\nexport const Success = (props: SuccessProps) => {\r\n const {\r\n model,\r\n photoBlob,\r\n cardImageUrl,\r\n } = props;\r\n\r\n const { t } = useTranslation();\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n

\r\n {t('success.thanks', 'Thank you ')} {model.forename}. {t('success.paymentsuccessful', 'Your application was successful.')}\r\n

\r\n
\r\n \r\n
\r\n {t('success.next', 'Here\\'s what will happen next.')}

\r\n {t('success.send', 'We\\'ll print your Easyrider card and send it to you at the address you provided:')}
\r\n {model?.street}, \r\n {model?.address2 ? model?.address2 + ', ' : null}\r\n {model?.city}, \r\n {model?.county ? model?.county + ', ' : null}\r\n {model?.postcode}, 

\r\n {t('success.email', 'You\\'ll also receive an email confirming your purchase.')}\r\n
\r\n
\r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ApplyWizardStep } from '../ApplyWizardStep';\r\n\r\nexport interface FailureProps {\r\n popStep: (untilStep?: ApplyWizardStep) => void,\r\n}\r\n\r\n/**\r\n * Wizard step to test payment.\r\n */\r\nexport const Failure = (props: FailureProps) => {\r\n const {\r\n } = props;\r\n\r\n const { t } = useTranslation();\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n {t('failure.paymentfailed', 'Your payment was not successful. Please check the information you entered or contact your bank or card issuer.')}\r\n
\r\n
\r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { useLazyQuery } from \"@apollo/react-hooks\";\r\nimport gql from \"graphql-tag\";\r\nimport { Guid } from \"guid-string\";\r\nimport { AsyncLoadResult, AsyncLoadOptions } from '../../../shared/abstractStore';\r\nimport { studentApplicationQuery, studentApplicationQueryVariables } from '../generated/studentApplicationQuery';\r\nimport { studentApplicationFieldsFragment } from '../models/StudentApplication';\r\nimport { mainApiConfig } from '../../../configure/mainApiConfig';\r\n\r\n/**\r\n * Get a StudentApplication from the store.\r\n * @param id\r\n * @param options\r\n */\r\nexport function useStudentApplication(id: string | undefined | null, options: AsyncLoadOptions = {}): AsyncLoadResult {\r\n // Query the data we need form the api.\r\n const [load, { data, loading, error, refetch }] = useLazyQuery(\r\n gql`\r\n query studentApplicationQuery ($id: ID!) {\r\n model: studentApplication(id: $id) {\r\n ...studentApplicationFields\r\n }\r\n }\r\n\r\n ${studentApplicationFieldsFragment}\r\n `,\r\n {\r\n variables: {\r\n id: id ?? Guid.empty\r\n },\r\n fetchPolicy: options.fetchPolicy ?? mainApiConfig.defaultFetchPolicy,\r\n pollInterval: options.pollInterval,\r\n onCompleted: (data) => {\r\n if (options.onCompleted) {\r\n options.onCompleted(data);\r\n }\r\n }\r\n }\r\n );\r\n\r\n // Run the query (unless we are being lazy).\r\n React.useEffect(() => {\r\n if (!options.lazy) {\r\n load();\r\n }\r\n }, [options.lazy, load])\r\n\r\n // Return the results.\r\n const refresh = React.useCallback(async () => { !refetch ? await load() : await refetch(); }, [refetch, load]);\r\n return React.useMemo(() => ({\r\n data: data ?? ({} as any),\r\n refresh: refresh,\r\n isLoading: loading,\r\n errors: error\r\n }), [data, refresh, loading, error]);\r\n}\r\n","\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Row, Col } from 'reactstrap';\r\nimport { ChoiceButton } from '../shared/ChoiceButton';\r\nimport { stylesPaths } from '../../../configure/stylesPaths';\r\n\r\nexport interface PaymentNotAllowedYetProps {\r\n}\r\n\r\n/**\r\n * Wizard step to decide who pays.\r\n */\r\nexport const PaymentNotAllowedYet = (props: PaymentNotAllowedYetProps) => {\r\n const { t } = useTranslation();\r\n return (\r\n <>\r\n \r\n \r\n { }}\r\n title={t('paymentNotAllowed.notavailable', 'Student offers are not yet available')}\r\n text={t('paymentNotAllowed.notavailablet', 'Our offers on student passes are not yet available for this academic year.')}\r\n imageURL={`${stylesPaths.publicRoot}/img/ModelShoot135_NCT.jpg`}\r\n className={''}\r\n linkURL={'https://www.nctx.co.uk/easyrider/smartcards/'}\r\n linkText={t('paymentNotAllowed.notavailablelink', 'Register for our general smart travel cards here.')}\r\n >\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n {t('chooseType.wrongPlace', 'Not looking for an academic pass? View or register for our general smart travel cards here.')}\r\n \r\n \r\n \r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Banner } from '../shared/Banner';\r\nimport { Container, Row, Col, Button } from 'reactstrap';\r\nimport { useStudentApplicationSupportingData } from '../../api/main/studentApplications/useStudentApplicationSupportingData';\r\nimport { AlertOnErrors } from '../../shared/alertOnErrors';\r\nimport { ConditionalFragment } from 'react-conditionalfragment';\r\nimport { ApplyWizardStep } from './ApplyWizardStep';\r\nimport { LoadingIndicator } from '../shared/LoadingIndicator';\r\nimport { WhoPays } from './steps/WhoPays';\r\nimport { PaymentNotAllowed } from './steps/PaymentNotAllowed';\r\nimport { useChanges } from '../../shared/useChanges';\r\nimport { StudentApplication } from '../../api/main/models/StudentApplication';\r\nimport { Guid } from 'guid-string';\r\nimport { WhichUniversity } from './steps/WhichUniversity';\r\nimport { IsUnder19 } from './steps/IsUnder19';\r\nimport { IsAnyday } from './steps/IsAnyday';\r\nimport { AnydayDays } from './steps/AnydayDays';\r\nimport { IsCityArea } from './steps/IsCityArea';\r\nimport { ExistingEasyrider } from './steps/ExistingEasyrider';\r\nimport { PersonalDetails } from './steps/PersonalDetails';\r\nimport { Photo } from './steps/Photo';\r\nimport { Evidence } from './steps/Evidence';\r\nimport { EvidenceUnder19 } from './steps/EvidenceUnder19';\r\nimport { BlobReference } from '../../api/main/models/BlobReference';\r\nimport { useSaveStudentApplicationCallback } from '../../api/main/studentApplications/useSaveStudentApplicationCallback';\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport moment from 'moment';\r\nimport { useCallbackAwaitStateSync } from 'use-callback-await-state-sync';\r\nimport { useValidatorCallback } from 'pojo-validator-react';\r\nimport { Pay } from './steps/Pay';\r\nimport { Success } from './steps/Success';\r\nimport { Failure } from './steps/Failure';\r\nimport { useStudentApplication } from '../../api/main/studentApplications/useStudentApplication';\r\nimport { useParams } from 'react-router';\r\nimport { useEffectOnceWhen } from 'use-effect-once-when';\r\nimport { stylesPaths } from '../../configure/stylesPaths';\r\nimport { forceApplyOnSecureNctxCoUk } from '../../configure/secureNctxCoUkConfig';\r\nimport { PaymentNotAllowedYet } from './steps/PaymentNotAllowedYet';\r\n\r\nexport interface ApplyProps {\r\n initialStep?: ApplyWizardStep,\r\n}\r\n\r\n/**\r\n * Apply for an academic pass.\r\n */\r\nexport const Apply = (props: ApplyProps) => {\r\n const { initialStep } = props;\r\n const { id } = useParams();\r\n\r\n const { t } = useTranslation();\r\n\r\n // Redirect if we can't apply here.\r\n React.useEffect(() => {\r\n if (forceApplyOnSecureNctxCoUk) {\r\n window.location.href = 'https://secure.nctx.co.uk/StudentOffer/';\r\n }\r\n }, []);\r\n\r\n // Load data we need from the server.\r\n const { data: { model: storeModel }, isLoading: _isLoading, errors: loadingErrors } = useStudentApplication(id ?? Guid.empty);\r\n const { data: { universities, products }, isLoading: isLoadingSupportingData, errors: loadingSupportingDataErrors } = useStudentApplicationSupportingData();\r\n const isLoading = _isLoading || isLoadingSupportingData;\r\n\r\n // Create model for capturing the data.\r\n const { model, change, changes } = useChanges(\r\n storeModel,\r\n !!id ? {}:\r\n { // if we are doing a create then initialise an empty model to be populated.\r\n id: Guid.newGuid(),\r\n isCityArea: true,\r\n hasPaid: false,\r\n address2: '',\r\n archived: false,\r\n city: '',\r\n country: '',\r\n county: '',\r\n dateOfBirth: null,\r\n email: '',\r\n existingEasyRiderCardNumber: '',\r\n forename: '',\r\n hasBeenIssued: false,\r\n isAnydayPass: false,\r\n anydayDays: 0,\r\n issuedByUserId: '',\r\n issuedOnDate: moment().toISOString(),\r\n isUnder19: false,\r\n paymentProviderReferenceNumber: '',\r\n paymentTakenDate: null,\r\n photoBlobReferenceId: null,\r\n postcode: '',\r\n price: 0,\r\n productId: '',\r\n proofOfEntitlementBlobReferenceId: null,\r\n street: '',\r\n submittedDate: moment().toISOString(),\r\n surname: '',\r\n universityId: null,\r\n universityProvidedReferenceNumber: '',\r\n });\r\n\r\n // Calculates and sets the productId based on the model's current state.\r\n const _calculateProduct = React.useCallback(() => {\r\n // Find the right product.\r\n const product = products?.find(item => item.isAnydayPass === model?.isAnydayPass && item.anydayDays === model?.anydayDays && item.isCityArea === model?.isCityArea);\r\n change({ productId: product?.id ?? '', price: product?.price ?? 0 });\r\n }, [model, change, products]);\r\n const calculateProduct = useCallbackAwaitStateSync(() => _calculateProduct());\r\n\r\n // Calculate which product we re currently using.\r\n const product = React.useMemo(() => products?.find(item => item.id === model?.productId), [products, model]);\r\n\r\n // sends the url for the right template back ready for the uploaded photo overlay\r\n const cardImageUrl = React.useMemo(() => {\r\n // default to Everyday City\r\n var returnString = `${stylesPaths.publicRoot}/img/Template_ER_Everyday.png`;\r\n if (product?.isAnydayPass && product?.isCityArea) { returnString = `${stylesPaths.publicRoot}/img/Template_ER_Anyday.png`; }\r\n if (product?.isAnydayPass && !product?.isCityArea) { returnString = `${stylesPaths.publicRoot}/img/Template_ER_Anyday_Further.png`; }\r\n if (!product?.isAnydayPass && !product?.isCityArea) { returnString = `${stylesPaths.publicRoot}/img/Template_ER_Everyday_Further.png`; }\r\n return returnString;\r\n }, [product]);\r\n\r\n const [validate, validationErrors] = useValidatorCallback((validation, fieldsToCheck) => {\r\n const rules = {\r\n forename: () => !model?.forename ? t('apply.firstNameRequired', 'First name is required') : '',\r\n surname: () => !model?.surname ? t('apply.surnameRequired', 'Last name is required') : '',\r\n dateOfBirth: () => !model?.dateOfBirth ? t('apply.dateOfBirthRequired', 'Date of birth is required') :\r\n moment(model?.dateOfBirth).toISOString() > moment().toISOString() ? t('apply.dateOfBirthInvalid', 'Date of birth cannot be in the future.') : '',\r\n email: () =>\r\n !model?.email ? t('apply.emailRequired', 'Email is required') :\r\n model.email.indexOf('.') < 0 ||\r\n model.email.indexOf('@') < 0 ||\r\n model.email.indexOf('.') === model.email.length - 1 ||\r\n model.email.indexOf('@') === model.email.length - 1 ? t('apply.emailFormat', 'Email is not properly formatted. It must conatain a \".\" and a \"@\"') : '',\r\n street: () => !model?.street ? t('apply.cityRequired', 'House number and Street is required') : '',\r\n city: () => !model?.city ? t('apply.cityRequired', 'City is required') : '',\r\n postcode: () => !model?.postcode ? t('apply.postcodeRequired', 'Postcode is required') : '',\r\n };\r\n\r\n validation.checkRules(rules, fieldsToCheck);\r\n }, [model]);\r\n\r\n const [save, { errors: saveErrors }] = useSaveStudentApplicationCallback();\r\n const [hasBeenSaved, setHasBeenSaved] = React.useState(false);\r\n const [saveForm, { errors: saveFormErrors }] = useAsyncCallback(async () => {\r\n\r\n await save(model.id, changes, !hasBeenSaved);\r\n\r\n setHasBeenSaved(true);\r\n }, [save, model, changes, hasBeenSaved, setHasBeenSaved]);\r\n\r\n // Photo blobs.\r\n const [photoBlob, setPhotoBlob] = React.useState();\r\n const [evidenceBlob, setevidenceBlob] = React.useState();\r\n\r\n // Default our blobs from the store once they become available (only used when reloading a saved application e.g. after payment success).\r\n useEffectOnceWhen(\r\n !!storeModel,\r\n () => {\r\n setPhotoBlob(storeModel?.photoBlobReference ?? undefined);\r\n setevidenceBlob(storeModel?.proofOfEntitlementBlobReference ?? undefined);\r\n }, [setPhotoBlob, setevidenceBlob]);\r\n\r\n // Manage the step \r\n const [stepHistory, setStepHistory] = React.useState>([initialStep ?? ApplyWizardStep.whoPays]);\r\n\r\n // Push a new step onto the stack.\r\n const pushStep = React.useCallback((newStep: ApplyWizardStep) => {\r\n setStepHistory(prevState => {\r\n // If this step is already at the top of the stack do nothing.\r\n const current = prevState[prevState.length - 1];\r\n if (newStep === current) {\r\n return prevState;\r\n }\r\n\r\n // Otherwise add the new step to the top of the stack.\r\n return [...prevState, newStep];\r\n });\r\n }, [setStepHistory]);\r\n\r\n // Pop the top step off the stack (so we go back to the previous page) or if toStep is provided, until we hit the requested step or the start.\r\n const popStep = React.useCallback((untilStep?: ApplyWizardStep) => {\r\n setStepHistory(prevState => {\r\n if (prevState.length <= 1) {\r\n return prevState;\r\n }\r\n\r\n let ret = [...prevState];\r\n let current: ApplyWizardStep;\r\n do {\r\n current = ret.pop() as ApplyWizardStep;\r\n // Until we hit the step we are looking for (or the bottom of the stack).\r\n } while (!!untilStep && untilStep !== current && ret.length > 1);\r\n\r\n return ret;\r\n });\r\n }, [setStepHistory]);\r\n\r\n // Current step to show.\r\n const currentStep = React.useMemo(() => stepHistory[stepHistory.length - 1], [stepHistory]);\r\n\r\n const [stepCompleted, setStepCompleted] = React.useState();\r\n\r\n // check if the current step is before the last step completed and so is itself complete\r\n const isCurrentStepComplete = React.useMemo(() => {\r\n if (stepCompleted === undefined) {\r\n return false;\r\n }\r\n return stepCompleted >= currentStep;\r\n }, [stepCompleted, currentStep]);\r\n\r\n\r\n // Get the current step to show (done this way to make sure we can use a switch and get compiler warnings if we miss a step).\r\n const { title, control: currentStepControl } = React.useMemo(() => {\r\n switch (currentStep) {\r\n case ApplyWizardStep.whoPays:\r\n return {\r\n title: t('apply.title.whoPays', 'How would you like to apply for your academic pass?'),\r\n //title: t('apply.title.whoPays', 'Academic passes will be available soon'),\r\n control: (),\r\n };\r\n case ApplyWizardStep.paymentNotAllowed:\r\n return {\r\n title: t('apply.title.paymentNotAllowed', 'Student offers are not currently available online'),\r\n control: (),\r\n };\r\n case ApplyWizardStep.paymentNotAllowedYet:\r\n return {\r\n title: t('apply.title.paymentNotAllowedYet', 'Academic passes will be available soon'),\r\n control: (),\r\n };\r\n case ApplyWizardStep.whichUniversity:\r\n return {\r\n title: t('apply.title.whichUniversity', 'Which organisation is providing your pass?'),\r\n control: (),\r\n };\r\n case ApplyWizardStep.isUnder19:\r\n return {\r\n title: t('apply.title.isUnder19', 'Do you require a student pass or under 19 pass?'),\r\n control: (),\r\n };\r\n case ApplyWizardStep.isAnyday:\r\n return {\r\n title: t('apply.title.isAnyday', 'Will you need an Everyday or Anyday pass?'),\r\n control: (),\r\n };\r\n case ApplyWizardStep.anydayDays:\r\n return {\r\n title: t('apply.title.anydayDays', 'How many days of travel would would you like?'),\r\n control: (),\r\n };\r\n case ApplyWizardStep.isCityArea:\r\n return {\r\n title: t('apply.title.isCityArea', 'Which Zone would you like your pass to cover?'),\r\n control: (),\r\n };\r\n case ApplyWizardStep.existingEasyrider:\r\n return {\r\n title: t('apply.title.existingEasyrider', 'Do you have an Existing Easyrider card?'),\r\n control: (),\r\n };\r\n case ApplyWizardStep.personalDetails:\r\n return {\r\n title: t('apply.title.personalDetails', 'Please complete your personal details here'),\r\n control: (),\r\n };\r\n case ApplyWizardStep.photo:\r\n return {\r\n title: t('apply.title.photo', 'Upload a photo of yourself for your Easyrider pass'),\r\n control: (),\r\n };\r\n case ApplyWizardStep.evidence:\r\n return {\r\n title: t('apply.title.evidence', 'Upload a photo of your student card'),\r\n control: (),\r\n };\r\n case ApplyWizardStep.evidenceUnder19:\r\n return {\r\n title: t('apply.title.evidence', 'Upload a photo of your photo ID that shows your date of birth'),\r\n control: (),\r\n };\r\n case ApplyWizardStep.pay:\r\n return {\r\n title: t('apply.title.pay', 'You can pay for your Easyrider pass here'),\r\n control: (),\r\n };\r\n case ApplyWizardStep.failure:\r\n return {\r\n title: t('apply.title.failure', 'Your payment failed'),\r\n control: (),\r\n };\r\n case ApplyWizardStep.success:\r\n return {\r\n title: t('apply.title.success', 'Successful application'),\r\n control: (),\r\n };\r\n default:\r\n return {\r\n title: 'TODO',\r\n control: (<>TODO )\r\n };\r\n }\r\n }, [t, model, change, pushStep, popStep, currentStep, universities, evidenceBlob, photoBlob, saveForm, product, calculateProduct, validate, validationErrors, cardImageUrl, isCurrentStepComplete, stepCompleted]);\r\n\r\n // Render the UI\r\n //\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n

\r\n {title}\r\n

\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n\r\n
\r\n {currentStepControl}\r\n
\r\n
\r\n
\r\n );\r\n};","/**\r\n * When this build is running under secure.nctx.co.uk change this to true to switch the applications mode.\r\n * You will also need to:\r\n * 1. Change the path in styles/_paths.scss to be /StudentOffer as a root\r\n * 2. Change the homepage in packages.json to be /StudentOffer\r\n */\r\nexport const isRunningOnSecureNctxCoUk: boolean = false;\r\nexport const forceApplyOnSecureNctxCoUk: boolean = false;","import * as React from 'react';\r\nimport { useLazyQuery } from \"@apollo/react-hooks\";\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncLoadResult, AsyncLoadOptions } from '../../../shared/abstractStore';\r\nimport { studentApplicationSupportDataQuery } from '../generated/studentApplicationSupportDataQuery';\r\nimport { mainApiConfig } from '../../../configure/mainApiConfig';\r\nimport { universityFieldsFragment } from '../models/University';\r\nimport { productFieldsFragment } from '../models/Product';\r\n\r\n/**\r\n * Get a the supporting data needed to interactivly edit an Customer Form.\r\n * @param options\r\n */\r\nexport function useStudentApplicationSupportingData(options: AsyncLoadOptions = {}): AsyncLoadResult {\r\n // Query the data we need form the api.\r\n const [load, { data, loading, error, refetch }] = useLazyQuery(\r\n gql`\r\n query studentApplicationSupportDataQuery {\r\n universities {\r\n ...universityFields\r\n }\r\n\r\n products {\r\n ...productFields\r\n }\r\n }\r\n\r\n ${universityFieldsFragment}\r\n ${productFieldsFragment}\r\n `,\r\n {\r\n variables: {\r\n },\r\n fetchPolicy: options.fetchPolicy ?? mainApiConfig.defaultFetchPolicy,\r\n pollInterval: options.pollInterval,\r\n onCompleted: (data) => {\r\n if (options.onCompleted) {\r\n options.onCompleted(data);\r\n }\r\n }\r\n }\r\n );\r\n\r\n // Run the query (unless we are being lazy).\r\n React.useEffect(() => {\r\n if (!options.lazy) {\r\n load();\r\n }\r\n }, [options.lazy, load])\r\n\r\n // Return the results.\r\n const refresh = React.useCallback(async () => { !refetch ? await load() : await refetch(); }, [refetch, load]);\r\n return React.useMemo(() => ({\r\n data: data ?? ({} as any),\r\n refresh: refresh,\r\n isLoading: loading,\r\n errors: error\r\n }), [data, refresh, loading, error]);\r\n}\r\n\r\n\r\n","import { RouteEntry } from \"../../shared/routes\";\r\nimport { Apply } from \"./Apply\";\r\nimport { Success } from \"./Success\";\r\nimport { Failure } from \"./Failure\";\r\n\r\n\r\nexport const applyRoutes: Array = [\r\n { path: '/apply', exact: true, component: Apply },\r\n { path: '/apply/success/:id', exact: true, component: Success },\r\n { path: '/apply/failure/:id', exact: true, component: Failure },\r\n];\r\n","import * as React from 'react';\r\nimport { Apply } from './Apply';\r\nimport { ApplyWizardStep } from './ApplyWizardStep';\r\n\r\n/**\r\n * Success after paying for an academic pass.\r\n */\r\nexport const Success = () => {\r\n return (\r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { Apply } from './Apply';\r\nimport { ApplyWizardStep } from './ApplyWizardStep';\r\n\r\n/**\r\n * Failure after paying for an academic pass.\r\n */\r\nexport const Failure = () => {\r\n\r\n return (\r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { useLazyQuery } from \"@apollo/react-hooks\";\r\nimport gql from \"graphql-tag\";\r\nimport { Guid } from \"guid-string\";\r\nimport { AsyncLoadResult, AsyncLoadOptions } from '../../../shared/abstractStore';\r\nimport { universityQuery, universityQueryVariables } from '../generated/universityQuery';\r\nimport { universityFieldsFragment } from '../models/University';\r\nimport { mainApiConfig } from '../../../configure/mainApiConfig';\r\n\r\n/**\r\n * Get a University from the store.\r\n * @param id\r\n * @param options\r\n */\r\nexport function useUniversity(id: string | undefined | null, options: AsyncLoadOptions = {}): AsyncLoadResult {\r\n // Query the data we need form the api.\r\n const [load, { data, loading, error, refetch }] = useLazyQuery(\r\n gql`\r\n query universityQuery ($id: ID!) {\r\n model: university(id: $id) {\r\n ...universityFields\r\n }\r\n }\r\n\r\n ${universityFieldsFragment}\r\n `,\r\n {\r\n variables: {\r\n id: id ?? Guid.empty\r\n },\r\n fetchPolicy: options.fetchPolicy ?? mainApiConfig.defaultFetchPolicy,\r\n pollInterval: options.pollInterval,\r\n onCompleted: (data) => {\r\n if (options.onCompleted) {\r\n options.onCompleted(data);\r\n }\r\n }\r\n }\r\n );\r\n\r\n // Run the query (unless we are being lazy).\r\n React.useEffect(() => {\r\n if (!options.lazy) {\r\n load();\r\n }\r\n }, [options.lazy, load])\r\n\r\n // Return the results.\r\n const refresh = React.useCallback(async () => { !refetch ? await load() : await refetch(); }, [refetch, load]);\r\n return React.useMemo(() => ({\r\n data: data ?? ({} as any),\r\n refresh: refresh,\r\n isLoading: loading,\r\n errors: error\r\n }), [data, refresh, loading, error]);\r\n}\r\n","import { useMutation } from \"@apollo/react-hooks\";\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncActionStatus } from '../../../shared/abstractStore';\r\nimport { UniversityCreateInput } from '../generated/globalTypes';\r\nimport { createUniversityMutation, createUniversityMutationVariables } from '../generated/createUniversityMutation';\r\nimport { universityFieldsFragment } from '../models/University';\r\n\r\n/**\r\n * Get a callback to create a University in the store.\r\n */\r\nexport function useCreateUniversityCallback(): [(model: UniversityCreateInput) => Promise, AsyncActionStatus] {\r\n const [mutationAction, { error }] = useMutation(\r\n gql`\r\n mutation createUniversityMutation ($model: UniversityCreateInput!) {\r\n createUniversity(model: $model) {\r\n ...universityFields\r\n }\r\n }\r\n\r\n ${universityFieldsFragment}\r\n `\r\n );\r\n\r\n // Wrap the mutation in a standard callback.\r\n const [action, { isExecuting, errors: actionErrors }] = useAsyncCallback(async (model: UniversityCreateInput) => {\r\n const result = await mutationAction({ variables: { model: model } });\r\n if (result.errors && result.errors.length) {\r\n throw result.errors;\r\n }\r\n }, [mutationAction]);\r\n\r\n return [action, { isExecuting: isExecuting, errors: error ? error.message : actionErrors }];\r\n}\r\n","import { useMutation } from \"@apollo/react-hooks\";\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncActionStatus } from '../../../shared/abstractStore';\r\nimport { UniversityUpdateInput } from '../generated/globalTypes';\r\nimport { updateUniversityMutation, updateUniversityMutationVariables } from '../generated/updateUniversityMutation';\r\nimport { universityFieldsFragment } from '../models/University';\r\n\r\n/**\r\n * Get a callback to update a University in the store.\r\n */\r\nexport function useUpdateUniversityCallback(): [(id: string, model: UniversityUpdateInput) => Promise, AsyncActionStatus] {\r\n const [mutationAction, { error }] = useMutation(\r\n gql`\r\n mutation updateUniversityMutation ($model: UniversityUpdateInput!) {\r\n updateUniversity(model: $model) {\r\n ...universityFields\r\n }\r\n }\r\n\r\n ${universityFieldsFragment}\r\n `\r\n );\r\n\r\n // Wrap the mutation in a standard callback.\r\n const [action, { isExecuting, errors: actionErrors }] = useAsyncCallback(async (id: string, model: UniversityUpdateInput) => {\r\n const result = await mutationAction({ variables: { model: { id: id, ...model } } });\r\n if (result.errors && result.errors.length) {\r\n throw result.errors;\r\n }\r\n }, [mutationAction]);\r\n\r\n return [action, { isExecuting: isExecuting, errors: error ? error.message : actionErrors }];\r\n}\r\n","import * as React from 'react';\r\nimport { Button, Form, Label, FormGroup, Spinner, Row, Col } from 'reactstrap';\r\nimport { AlertOnErrors } from '../../shared/alertOnErrors';\r\nimport { LoadingIndicator } from '../shared/LoadingIndicator';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { MainContainer } from '../shared/MainContainer';\r\nimport { useParams, useHistory } from 'react-router';\r\nimport { useChanges } from '../../shared/useChanges';\r\nimport { useValidatorCallback } from 'pojo-validator-react';\r\nimport { ValidatedInput } from 'pojo-validator-reactstrap';\r\nimport { FormButtons } from '../shared/FormButtons';\r\nimport { ButtonAsync } from 'reactstrap-buttonasync';\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport { Guid } from 'guid-string';\r\nimport { ConditionalFragment } from 'react-conditionalfragment';\r\nimport { Banner } from '../shared/Banner';\r\nimport { useUniversity } from '../../api/main/universities/useUniversity';\r\nimport { useSaveUniversityCallback } from '../../api/main/universities/useSaveUniversityCallback';\r\nimport { University } from '../../api/main/models/University';\r\nimport { Background } from '../shared/Background';\r\n\r\ninterface EditUniversityProps {\r\n isCreate?: boolean,\r\n}\r\n\r\n/**\r\n * Create a new university.\r\n */\r\nexport const CreateUniversity = () => ();\r\n\r\n/**\r\n * Edit an university\r\n */\r\nexport const EditUniversity = (props: EditUniversityProps) => {\r\n const { isCreate } = props;\r\n\r\n const { t } = useTranslation();\r\n const { id } = useParams();\r\n const { data: { model: storeModel }, isLoading, errors: loadErrors } = useUniversity(id);\r\n const { model, change, changes } = useChanges(storeModel, isCreate ? { id: Guid.newGuid(), name: '', archived: false } : {});\r\n const [save, { errors: saveErrors }] = useSaveUniversityCallback();\r\n const history = useHistory();\r\n \r\n const [validate, validationErrors] = useValidatorCallback((validation, fieldsToCheck) => {\r\n const rules = {\r\n name: () => !model?.name ? t('editUniversity.nameRequired', 'Name is required') : '',\r\n };\r\n\r\n validation.checkRules(rules, fieldsToCheck);\r\n }, [model]);\r\n\r\n const [saveForm, { isExecuting: isSaving, errors: saveFormErrors }] = useAsyncCallback(async () => {\r\n if (!validate()) {\r\n return;\r\n }\r\n\r\n await save(model.id, changes, !!isCreate);\r\n\r\n history.goBack();\r\n }, [validate, save, model, changes, isCreate, history]);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n

\r\n {\r\n isCreate ? (\r\n <>{t('editUniversity.createHeading', 'Add bulk buying organisation')}\r\n ): (\r\n <>{t('editUniversity.editHeading', 'Edit bulk buying organisation')}\r\n )\r\n }\r\n

\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n\r\n \r\n \r\n\r\n
{ e.preventDefault(); saveForm(); }}>\r\n \r\n \r\n change({ name: e.currentTarget.value })} onBlur={e => validate('name')} validationErrors={validationErrors['name']} />\r\n \r\n\r\n \r\n \r\n {t('common.saving', 'Saving...')}}>\r\n \r\n <> {t('common.save', 'Save')}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { UniversityCreateInput, UniversityUpdateInput } from '../generated/globalTypes';\r\nimport { useSaveInStore, SaveInStoreOptions } from '../../../shared/useSaveInStore';\r\nimport { useCreateUniversityCallback } from './useCreateUniversityCallback';\r\nimport { useUpdateUniversityCallback } from './useUpdateUniversityCallback';\r\nimport { University } from '../models/University';\r\n\r\n/**\r\n * Get a callback to save a University in the store using either a create or update.\r\n */\r\nexport function useSaveUniversityCallback(options: SaveInStoreOptions = {}) {\r\n const [_create, createStatus] = useCreateUniversityCallback();\r\n const create = React.useCallback((model: Partial) => _create(model as UniversityCreateInput), [_create]);\r\n\r\n const [_update, updateStatus] = useUpdateUniversityCallback();\r\n const update = React.useCallback((id: string, changes: Partial) => _update(id, changes as UniversityUpdateInput), [_update]);\r\n\r\n return useSaveInStore(\r\n [create, createStatus],\r\n [update, updateStatus],\r\n options\r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { Button, Form, Label, FormGroup, Spinner, Input, Row, Col } from 'reactstrap';\r\nimport { AlertOnErrors } from '../../shared/alertOnErrors';\r\nimport { LoadingIndicator } from '../shared/LoadingIndicator';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { MainContainer } from '../shared/MainContainer';\r\nimport { useParams, useHistory } from 'react-router';\r\nimport { FormButtons } from '../shared/FormButtons';\r\nimport { ButtonAsync } from 'reactstrap-buttonasync';\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport { ConditionalFragment } from 'react-conditionalfragment';\r\nimport { useUniversity } from '../../api/main/universities/useUniversity';\r\nimport { Banner } from '../shared/Banner';\r\nimport { useDeleteUniversityCallback } from '../../api/main/universities/useDeleteUniversityCallback';\r\nimport { Background } from '../shared/Background';\r\n\r\n/**\r\n * Delete a University.\r\n */\r\nexport const DeleteUniversity = () => {\r\n const { t } = useTranslation();\r\n const { id } = useParams();\r\n const { data: { model }, isLoading, errors: loadErrors } = useUniversity(id);\r\n const [remove, { errors: removeErrors }] = useDeleteUniversityCallback();\r\n const history = useHistory();\r\n\r\n const [onRemoveFormSubmit, { isExecuting: isRemoving, errors: removeFormErrors }] = useAsyncCallback(async () => {\r\n if (!model) {\r\n return;\r\n }\r\n\r\n await remove(model.id);\r\n\r\n history.goBack();\r\n }, [remove, model, history]);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n

{t('deleteUniversity.heading', 'Are you sure you want to delete this bulk buying organisation?')}

\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n\r\n \r\n \r\n\r\n
{ e.preventDefault(); onRemoveFormSubmit(); }}>\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n {t('common.deleting', 'Deleting...')}}>\r\n \r\n <> {t('common.delete', 'Delete')}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n","import { RouteEntry } from \"../../shared/routes\";\r\nimport { IdentityRoles } from \"../../configure/security/IdentityRoles\";\r\nimport { UniversitiesList } from \"./UniversitiesList\";\r\nimport { EditUniversity, CreateUniversity } from \"./EditUniversity\";\r\nimport { DeleteUniversity } from \"./DeleteUniversity\";\r\n\r\n\r\nexport const universityRoutes: Array = [\r\n { path: '/administration/bulk-buyers', exact: true, component: UniversitiesList, authorize: true, requireRole: IdentityRoles.Administration },\r\n { path: '/administration/bulk-buyers/edit/:id', component: EditUniversity, authorize: true, requireRole: IdentityRoles.Administration },\r\n { path: '/administration/bulk-buyers/add', component: CreateUniversity, authorize: true, requireRole: IdentityRoles.Administration },\r\n { path: '/administration/bulk-buyers/delete/:id', component: DeleteUniversity, authorize: true, requireRole: IdentityRoles.Administration },\r\n];\r\n","import * as React from 'react';\r\nimport { Table, Button, Row, Col, ButtonGroup, ButtonDropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';\r\nimport { LinkContainer } from 'react-router-bootstrap';\r\nimport { AlertOnErrors } from '../../shared/alertOnErrors';\r\nimport { LoadingIndicator } from '../shared/LoadingIndicator';\r\nimport { Waypoint } from 'react-waypoint';\r\nimport { useReplaceSearchParamsEffect, useSearchParams } from '../../shared/useURLSearchParams';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { SearchInput } from '../shared/SearchInput';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { MainContainer } from '../shared/MainContainer';\r\nimport { NoResultsFound } from '../shared/NoResultsFound';\r\nimport { TableRowButtons } from '../shared/TableRowButtons';\r\nimport { StickyToolbar } from '../shared/StickyToolbar';\r\nimport { useHistory } from 'react-router';\r\nimport { ConditionalFragment } from 'react-conditionalfragment';\r\nimport { useUniversities } from '../../api/main/universities/useUniversities';\r\nimport { Banner } from '../shared/Banner';\r\nimport { useToggleStateArray } from 'use-toggle-state';\r\n\r\n/**\r\n * List of universities (that are not projects).\r\n */\r\nexport const UniversitiesList = () => {\r\n const { t } = useTranslation();\r\n const { search: searchParam } = useSearchParams();\r\n const [search, setSearch] = React.useState(searchParam ?? '');\r\n const { data: { items: allItems }, isLoading, errors: loadingErrors, fetchMore, hasMore } = useUniversities();\r\n\r\n const [isMenuOpen, toggleMenuOpen] = useToggleStateArray();\r\n const history = useHistory();\r\n\r\n // Filter by the user's search client side so it can work when offline as well as online.\r\n const items = React.useMemo(() => {\r\n if (!allItems) {\r\n return allItems;\r\n }\r\n\r\n if (!search) {\r\n return allItems;\r\n }\r\n\r\n let lowerSearch = search.toLocaleLowerCase();\r\n\r\n // Filter the items being displayed.\r\n return allItems.filter(item =>\r\n item.name.toLocaleLowerCase().indexOf(lowerSearch) >= 0\r\n );\r\n }, [allItems, search]);\r\n\r\n // Make sure the URL keeps in sync with the search.\r\n useReplaceSearchParamsEffect({ search: search });\r\n\r\n const colCount = 3;\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n

{t('universitiesList.heading', 'Bulk buying organisations')}

\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n setSearch(e.currentTarget.value)} />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n items?.map(item => (\r\n history.push(`/administration/bulk-buyers/edit/${item.id}`)}>\r\n \r\n \r\n \r\n \r\n ))\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
{t('universitiesList.university', 'Organisation')}{t('universitiesList.name', 'Name')} 
\r\n
{item.name}
\r\n
{item.name}\r\n \r\n \r\n \r\n \r\n \r\n toggleMenuOpen(item.id)}>\r\n \r\n {t('common.menuDropdown', 'More')}\r\n \r\n \r\n \r\n \r\n \r\n <> {t('common.delete', 'Delete')}\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n );\r\n};\r\n\r\n","import * as React from 'react';\r\nimport { useLazyQuery } from \"@apollo/react-hooks\";\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncLoadPagedResult, AsyncLoadPagedOptions } from '../../../shared/abstractStore';\r\nimport { useFetchMoreCallback } from '../../../shared/useFetchMoreCallback';\r\nimport { universitiesQuery, universitiesQueryVariables } from '../generated/universitiesQuery';\r\nimport { mainApiConfig } from '../../../configure/mainApiConfig';\r\nimport { universityFieldsFragment } from '../models/University';\r\n\r\n/**\r\n * Get a list of universities from the store.\r\n * @param id\r\n * @param options\r\n */\r\nexport function useUniversities(options: AsyncLoadPagedOptions = {}): AsyncLoadPagedResult {\r\n // Query data we need from the api.\r\n const [load, { data, loading, error, refetch, fetchMore: fetchMoreFromStore }] = useLazyQuery(\r\n gql`\r\n query universitiesQuery ($offset: Int, $first: Int) {\r\n items: universities (offset: $offset, first: $first) {\r\n ...universityFields\r\n }\r\n }\r\n\r\n ${universityFieldsFragment}\r\n `,\r\n {\r\n\r\n variables: {\r\n offset: options.startOffset,\r\n first: options.pageSize\r\n },\r\n fetchPolicy: options.fetchPolicy ?? mainApiConfig.defaultFetchPolicy,\r\n pollInterval: options.pollInterval,\r\n onCompleted: (data) => {\r\n if (options.onCompleted) {\r\n options.onCompleted(data);\r\n }\r\n }\r\n }\r\n );\r\n\r\n // Run the query (unless we are being lazy).\r\n React.useEffect(() => {\r\n if (!options.lazy) {\r\n load();\r\n }\r\n }, [options.lazy, load])\r\n\r\n // Get the functions used to manage paging.\r\n const { fetchMore, hasMore: _hasMore } = useFetchMoreCallback(\r\n fetchMoreFromStore,\r\n (options?.startOffset ?? 0) + (data?.items?.length ?? 0),\r\n (prevResults, newResults) => ({\r\n ...prevResults,\r\n ...newResults,\r\n\r\n items: [...(prevResults?.items ?? []), ...(newResults?.items ?? [])]\r\n }),\r\n (newResults) => newResults?.items?.length\r\n );\r\n const hasMore = React.useCallback(() => !options.pageSize ? false : _hasMore(), [options.pageSize, _hasMore]);\r\n \r\n // Return the results.\r\n const refresh = React.useCallback(async () => { !refetch ? await load() : await refetch(); }, [refetch, load]);\r\n return React.useMemo(() => ({\r\n data: data ?? ({} as any),\r\n refresh: refresh,\r\n isLoading: loading,\r\n errors: error,\r\n fetchMore: fetchMore,\r\n hasMore: hasMore,\r\n }), [data, refresh, loading, error, fetchMore, hasMore]);\r\n}\r\n","import { useMutation } from \"@apollo/react-hooks\";\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncActionStatus } from '../../../shared/abstractStore';\r\nimport { deleteUniversityMutation, deleteUniversityMutationVariables } from '../generated/deleteUniversityMutation';\r\nimport { universityFieldsFragment } from '../models/University';\r\n\r\n/**\r\n * Get a callback to delete a University in the store.\r\n */\r\nexport function useDeleteUniversityCallback(): [(id: string) => Promise, AsyncActionStatus] {\r\n const [mutationAction, { error }] = useMutation(\r\n gql`\r\n mutation deleteUniversityMutation ($id: ID!) {\r\n deleteUniversity(id: $id) {\r\n ...universityFields\r\n }\r\n }\r\n\r\n ${universityFieldsFragment}\r\n `\r\n );\r\n\r\n // Wrap the mutation in a standard callback.\r\n const [action, { isExecuting, errors: actionErrors }] = useAsyncCallback(async (id: string) => {\r\n const result = await mutationAction({ variables: { id: id } });\r\n if (result.errors && result.errors.length) {\r\n throw result.errors;\r\n }\r\n }, [mutationAction]);\r\n\r\n return [action, { isExecuting: isExecuting, errors: error ? error.message : actionErrors }];\r\n}\r\n","import * as React from 'react';\r\nimport { Table, Button, Row, Col, ButtonGroup, ButtonDropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';\r\nimport { LinkContainer } from 'react-router-bootstrap';\r\nimport { AlertOnErrors } from '../../shared/alertOnErrors';\r\nimport { LoadingIndicator } from '../shared/LoadingIndicator';\r\nimport { Waypoint } from 'react-waypoint';\r\nimport { useReplaceSearchParamsEffect, useSearchParams } from '../../shared/useURLSearchParams';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { SearchInput } from '../shared/SearchInput';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { MainContainer } from '../shared/MainContainer';\r\nimport { NoResultsFound } from '../shared/NoResultsFound';\r\nimport { TableRowButtons } from '../shared/TableRowButtons';\r\nimport { StickyToolbar } from '../shared/StickyToolbar';\r\nimport { useHistory } from 'react-router';\r\nimport { ConditionalFragment } from 'react-conditionalfragment';\r\nimport { useProducts } from '../../api/main/products/useProducts';\r\nimport { Banner } from '../shared/Banner';\r\nimport { useToggleStateArray } from 'use-toggle-state';\r\n\r\n/**\r\n * List of products (that are not projects).\r\n */\r\nexport const ProductsList = () => {\r\n const { t } = useTranslation();\r\n const { search: searchParam } = useSearchParams();\r\n const [search, setSearch] = React.useState(searchParam ?? '');\r\n const { data: { items: allItems }, isLoading, errors: loadingErrors, fetchMore, hasMore } = useProducts();\r\n\r\n const [isMenuOpen, toggleMenuOpen] = useToggleStateArray();\r\n const history = useHistory();\r\n\r\n // Filter by the user's search client side so it can work when offline as well as online.\r\n const items = React.useMemo(() => {\r\n if (!allItems) {\r\n return allItems;\r\n }\r\n\r\n // order the items by type descending to get Anyday City first, then Anyday further, then everyday,\r\n // then by price to get lowest first\r\n let sortedItems = [...allItems].sort((a, b) => {\r\n if (a.isAnydayPass < b.isAnydayPass) {\r\n // a must be everyday and b anyday\r\n return 1;\r\n } else if (a.isAnydayPass > b.isAnydayPass) {\r\n // a must be anyday and b everyday\r\n return -1;\r\n } else {\r\n // equal so sort by isCityArea descending to get city first\r\n if (a.isCityArea < b.isCityArea) {\r\n // a must be further and b city\r\n return 1;\r\n } else if (a.isAnydayPass > b.isAnydayPass) {\r\n // a must be city and b further\r\n return -1;\r\n } else {\r\n // equal so sort by price\r\n if (a.price < b.price) {\r\n return -1;\r\n } else if (a.price > b.price) {\r\n return 1;\r\n } else {\r\n // equal so sort by number of days\r\n if (a.anydayDays < b.anydayDays) {\r\n return -1;\r\n } else if (a.anydayDays > b.anydayDays) {\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n }\r\n }\r\n }\r\n });\r\n\r\n\r\n if (!search) {\r\n return sortedItems;\r\n }\r\n\r\n let lowerSearch = search.toLocaleLowerCase();\r\n\r\n\r\n // Filter the items being displayed.\r\n return sortedItems.filter(item =>\r\n item.name.toLocaleLowerCase().indexOf(lowerSearch) >= 0\r\n );\r\n }, [allItems, search]);\r\n\r\n // Make sure the URL keeps in sync with the search.\r\n useReplaceSearchParamsEffect({ search: search });\r\n\r\n const colCount = 5;\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n

{t('productsList.heading', 'Product pricing')}

\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n setSearch(e.currentTarget.value)} />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n items?.map(item => (\r\n history.push(`/administration/product-prices/edit/${item.id}`)}>\r\n \r\n \r\n \r\n \r\n \r\n \r\n ))\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
{t('productsList.product', 'Product price')}{t('productsList.name', 'Name')}{t('productsList.price', 'price')}{t('productsList.appliesTo', 'Applies to')} 
\r\n
{item.name}
\r\n
\r\n {t('common.currency', '{{value, $0,0.00}}', { value: item.price })}\r\n
\r\n
{item.name}{t('common.currency', '{{value, $0,0.00}}', { value: item.price })}\r\n
{item.isAnydayPass ? t('productsList.isAnydayPass.isAnyday', 'Anyday pass - {{dayNumber}} days', { dayNumber: item.anydayDays }) : t('productsList.isAnydayPass.everyday', 'Everyday academic year')}
\r\n
{item.isCityArea ? t('productsList.isCityArea.cityArea', 'City area') : t('productsList.isCityArea.further', 'Further')}
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n toggleMenuOpen(item.id)}>\r\n \r\n {t('common.menuDropdown', 'More')}\r\n \r\n \r\n \r\n \r\n \r\n <> {t('common.delete', 'Delete')}\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n );\r\n};\r\n\r\n","import * as React from 'react';\r\nimport { useLazyQuery } from \"@apollo/react-hooks\";\r\nimport gql from \"graphql-tag\";\r\nimport { Guid } from \"guid-string\";\r\nimport { AsyncLoadResult, AsyncLoadOptions } from '../../../shared/abstractStore';\r\nimport { productQuery, productQueryVariables } from '../generated/productQuery';\r\nimport { productFieldsFragment } from '../models/Product';\r\nimport { mainApiConfig } from '../../../configure/mainApiConfig';\r\n\r\n/**\r\n * Get a Product from the store.\r\n * @param id\r\n * @param options\r\n */\r\nexport function useProduct(id: string | undefined | null, options: AsyncLoadOptions = {}): AsyncLoadResult {\r\n // Query the data we need form the api.\r\n const [load, { data, loading, error, refetch }] = useLazyQuery(\r\n gql`\r\n query productQuery ($id: ID!) {\r\n model: product(id: $id) {\r\n ...productFields\r\n }\r\n }\r\n\r\n ${productFieldsFragment}\r\n `,\r\n {\r\n variables: {\r\n id: id ?? Guid.empty\r\n },\r\n fetchPolicy: options.fetchPolicy ?? mainApiConfig.defaultFetchPolicy,\r\n pollInterval: options.pollInterval,\r\n onCompleted: (data) => {\r\n if (options.onCompleted) {\r\n options.onCompleted(data);\r\n }\r\n }\r\n }\r\n );\r\n\r\n // Run the query (unless we are being lazy).\r\n React.useEffect(() => {\r\n if (!options.lazy) {\r\n load();\r\n }\r\n }, [options.lazy, load])\r\n\r\n // Return the results.\r\n const refresh = React.useCallback(async () => { !refetch ? await load() : await refetch(); }, [refetch, load]);\r\n return React.useMemo(() => ({\r\n data: data ?? ({} as any),\r\n refresh: refresh,\r\n isLoading: loading,\r\n errors: error\r\n }), [data, refresh, loading, error]);\r\n}\r\n","import { useMutation } from \"@apollo/react-hooks\";\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncActionStatus } from '../../../shared/abstractStore';\r\nimport { ProductCreateInput } from '../generated/globalTypes';\r\nimport { createProductMutation, createProductMutationVariables } from '../generated/createProductMutation';\r\nimport { productFieldsFragment } from '../models/Product';\r\n\r\n/**\r\n * Get a callback to create a Product in the store.\r\n */\r\nexport function useCreateProductCallback(): [(model: ProductCreateInput) => Promise, AsyncActionStatus] {\r\n const [mutationAction, { error }] = useMutation(\r\n gql`\r\n mutation createProductMutation ($model: ProductCreateInput!) {\r\n createProduct(model: $model) {\r\n ...productFields\r\n }\r\n }\r\n\r\n ${productFieldsFragment}\r\n `\r\n );\r\n\r\n // Wrap the mutation in a standard callback.\r\n const [action, { isExecuting, errors: actionErrors }] = useAsyncCallback(async (model: ProductCreateInput) => {\r\n const result = await mutationAction({ variables: { model: model } });\r\n if (result.errors && result.errors.length) {\r\n throw result.errors;\r\n }\r\n }, [mutationAction]);\r\n\r\n return [action, { isExecuting: isExecuting, errors: error ? error.message : actionErrors }];\r\n}\r\n","import { useMutation } from \"@apollo/react-hooks\";\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncActionStatus } from '../../../shared/abstractStore';\r\nimport { ProductUpdateInput } from '../generated/globalTypes';\r\nimport { updateProductMutation, updateProductMutationVariables } from '../generated/updateProductMutation';\r\nimport { productFieldsFragment } from '../models/Product';\r\n\r\n/**\r\n * Get a callback to update a Product in the store.\r\n */\r\nexport function useUpdateProductCallback(): [(id: string, model: ProductUpdateInput) => Promise, AsyncActionStatus] {\r\n const [mutationAction, { error }] = useMutation(\r\n gql`\r\n mutation updateProductMutation ($model: ProductUpdateInput!) {\r\n updateProduct(model: $model) {\r\n ...productFields\r\n }\r\n }\r\n\r\n ${productFieldsFragment}\r\n `\r\n );\r\n\r\n // Wrap the mutation in a standard callback.\r\n const [action, { isExecuting, errors: actionErrors }] = useAsyncCallback(async (id: string, model: ProductUpdateInput) => {\r\n const result = await mutationAction({ variables: { model: { id: id, ...model } } });\r\n if (result.errors && result.errors.length) {\r\n throw result.errors;\r\n }\r\n }, [mutationAction]);\r\n\r\n return [action, { isExecuting: isExecuting, errors: error ? error.message : actionErrors }];\r\n}\r\n","import * as React from 'react';\r\nimport { Row, Col, CustomInput } from 'reactstrap';\r\nimport { Guid } from 'guid-string';\r\n\r\nexport interface TwoValueSwitchProps {\r\n leftLabel: string,\r\n rightLabel: string,\r\n checked: boolean,\r\n onChange?: (checked: boolean) => void,\r\n}\r\n\r\n/**\r\n * A switch component that lets the user select between two values leftLabel (false), rightLabel (true).\r\n */\r\nexport const TwoValueSwitch = (props: TwoValueSwitchProps) => {\r\n const { checked, onChange, leftLabel, rightLabel } = props;\r\n const [uniqueName] = React.useState(Guid.newGuid());\r\n\r\n return (\r\n \r\n \r\n {leftLabel}\r\n \r\n \r\n { if (onChange) { onChange(e.currentTarget.checked); } }} />\r\n \r\n \r\n {rightLabel}\r\n \r\n \r\n );\r\n};","import './editProduct.scss';\r\n\r\nimport * as React from 'react';\r\nimport { Button, Form, Label, FormGroup, Spinner, Row, Col, InputGroup, InputGroupAddon, InputGroupText } from 'reactstrap';\r\nimport { AlertOnErrors } from '../../shared/alertOnErrors';\r\nimport { LoadingIndicator } from '../shared/LoadingIndicator';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { MainContainer } from '../shared/MainContainer';\r\nimport { useParams, useHistory } from 'react-router';\r\nimport { useChanges } from '../../shared/useChanges';\r\nimport { useValidatorCallback } from 'pojo-validator-react';\r\nimport { ValidatedInput } from 'pojo-validator-reactstrap';\r\nimport { FormButtons } from '../shared/FormButtons';\r\nimport { ButtonAsync } from 'reactstrap-buttonasync';\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport { Guid } from 'guid-string';\r\nimport { ConditionalFragment } from 'react-conditionalfragment';\r\nimport { Banner } from '../shared/Banner';\r\nimport { useProduct } from '../../api/main/products/useProduct';\r\nimport { useSaveProductCallback } from '../../api/main/products/useSaveProductCallback';\r\nimport { Product } from '../../api/main/models/Product';\r\nimport { Background } from '../shared/Background';\r\nimport { TwoValueSwitch } from '../shared/TwoValueSwitch';\r\n\r\ninterface EditProductProps {\r\n isCreate?: boolean,\r\n}\r\n\r\n/**\r\n * Create a new product.\r\n */\r\nexport const CreateProduct = () => ();\r\n\r\n/**\r\n * Edit an product\r\n */\r\nexport const EditProduct = (props: EditProductProps) => {\r\n const { isCreate } = props;\r\n\r\n const { t } = useTranslation();\r\n const { id } = useParams();\r\n const { data: { model: storeModel }, isLoading, errors: loadErrors } = useProduct(id);\r\n const { model, change, changes } = useChanges(storeModel, isCreate ? { id: Guid.newGuid(), name: '', archived: false, price: 0, isUnder19: false, isAnydayPass: false, isCityArea: true, anydayDays: 0 } : {});\r\n const [save, { errors: saveErrors }] = useSaveProductCallback();\r\n const history = useHistory();\r\n\r\n const [validate, validationErrors] = useValidatorCallback((validation, fieldsToCheck) => {\r\n const rules = {\r\n name: () => !model?.name ? t('editProduct.nameRequired', 'Name is required') : '',\r\n anydayDays: () =>\r\n model?.isAnydayPass &&\r\n model?.anydayDays !== 150 &&\r\n model?.anydayDays !== 100 &&\r\n model?.anydayDays !== 50 &&\r\n model?.anydayDays !== 20 ? t('editProduct.anydayDays50or100', 'Anyday days must be 20, 50, 100, or 150') : '',\r\n };\r\n\r\n validation.checkRules(rules, fieldsToCheck);\r\n }, [model]);\r\n\r\n const [saveForm, { isExecuting: isSaving, errors: saveFormErrors }] = useAsyncCallback(async () => {\r\n if (!validate()) {\r\n return;\r\n }\r\n\r\n await save(model.id, changes, !!isCreate);\r\n\r\n history.goBack();\r\n }, [validate, save, model, changes, isCreate, history]);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n

\r\n {\r\n isCreate ? (\r\n <>{t('editProduct.createHeading', 'Add product pricing')}\r\n ) : (\r\n <>{t('editProduct.editHeading', 'Edit product pricing')}\r\n )\r\n }\r\n

\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n\r\n \r\n \r\n\r\n
{ e.preventDefault(); saveForm(); }}>\r\n \r\n \r\n change({ name: e.currentTarget.value })} onBlur={e => validate('name')} validationErrors={validationErrors['name']} />\r\n \r\n\r\n \r\n \r\n \r\n \r\n {t('editProduct.currencySign', '£')}\r\n \r\n change({ price: e.currentTarget.value })} onBlur={e => validate('price')} validationErrors={validationErrors['price']} />\r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n {/*\r\n \r\n \r\n \r\n \r\n \r\n change({ isUnder19: checked })} />\r\n \r\n \r\n */}\r\n \r\n \r\n \r\n \r\n \r\n {\r\n if (checked) {\r\n change({ isAnydayPass: checked });\r\n } else {\r\n change({\r\n isAnydayPass: checked,\r\n anydayDays: 0,\r\n });\r\n }\r\n }} />\r\n \r\n \r\n \r\n \r\n \r\n \r\n change({ anydayDays: parseInt(e.currentTarget.value) })} onBlur={e => validate('anydayDays')} validationErrors={validationErrors['anydayDays']} />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n change({ isCityArea: !checked })} />\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n {t('common.saving', 'Saving...')}}>\r\n \r\n <> {t('common.save', 'Save')}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { ProductCreateInput, ProductUpdateInput } from '../generated/globalTypes';\r\nimport { useSaveInStore, SaveInStoreOptions } from '../../../shared/useSaveInStore';\r\nimport { useCreateProductCallback } from './useCreateProductCallback';\r\nimport { useUpdateProductCallback } from './useUpdateProductCallback';\r\nimport { Product } from '../models/Product';\r\n\r\n/**\r\n * Get a callback to save a Product in the store using either a create or update.\r\n */\r\nexport function useSaveProductCallback(options: SaveInStoreOptions = {}) {\r\n const [_create, createStatus] = useCreateProductCallback();\r\n const create = React.useCallback((model: Partial) => _create(model as ProductCreateInput), [_create]);\r\n\r\n const [_update, updateStatus] = useUpdateProductCallback();\r\n const update = React.useCallback((id: string, changes: Partial) => _update(id, changes as ProductUpdateInput), [_update]);\r\n\r\n return useSaveInStore(\r\n [create, createStatus],\r\n [update, updateStatus],\r\n options\r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { Button, Form, Label, FormGroup, Spinner, Input, Row, Col } from 'reactstrap';\r\nimport { AlertOnErrors } from '../../shared/alertOnErrors';\r\nimport { LoadingIndicator } from '../shared/LoadingIndicator';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { MainContainer } from '../shared/MainContainer';\r\nimport { useParams, useHistory } from 'react-router';\r\nimport { FormButtons } from '../shared/FormButtons';\r\nimport { ButtonAsync } from 'reactstrap-buttonasync';\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport { ConditionalFragment } from 'react-conditionalfragment';\r\nimport { useProduct } from '../../api/main/products/useProduct';\r\nimport { Banner } from '../shared/Banner';\r\nimport { useDeleteProductCallback } from '../../api/main/products/useDeleteProductCallback';\r\nimport { Background } from '../shared/Background';\r\n\r\n/**\r\n * Delete a Product.\r\n */\r\nexport const DeleteProduct = () => {\r\n const { t } = useTranslation();\r\n const { id } = useParams();\r\n const { data: { model }, isLoading, errors: loadErrors } = useProduct(id);\r\n const [remove, { errors: removeErrors }] = useDeleteProductCallback();\r\n const history = useHistory();\r\n\r\n const [onRemoveFormSubmit, { isExecuting: isRemoving, errors: removeFormErrors }] = useAsyncCallback(async () => {\r\n if (!model) {\r\n return;\r\n }\r\n\r\n await remove(model.id);\r\n\r\n history.goBack();\r\n }, [remove, model, history]);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n

{t('deleteProduct.heading', 'Are you sure you want to delete this product pricing?')}

\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n\r\n \r\n \r\n\r\n
{ e.preventDefault(); onRemoveFormSubmit(); }}>\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n {t('common.deleting', 'Deleting...')}}>\r\n \r\n <> {t('common.delete', 'Delete')}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n","import { RouteEntry } from \"../../shared/routes\";\r\nimport { IdentityRoles } from \"../../configure/security/IdentityRoles\";\r\nimport { ProductsList } from \"./ProductsList\";\r\nimport { EditProduct, CreateProduct } from \"./EditProduct\";\r\nimport { DeleteProduct } from \"./DeleteProduct\";\r\n\r\n\r\nexport const productRoutes: Array = [\r\n { path: '/administration/product-prices', exact: true, component: ProductsList, authorize: true, requireRole: IdentityRoles.Administration },\r\n { path: '/administration/product-prices/edit/:id', component: EditProduct, authorize: true, requireRole: IdentityRoles.Administration },\r\n { path: '/administration/product-prices/add', component: CreateProduct, authorize: true, requireRole: IdentityRoles.Administration },\r\n { path: '/administration/product-prices/delete/:id', component: DeleteProduct, authorize: true, requireRole: IdentityRoles.Administration },\r\n];\r\n","import * as React from 'react';\r\nimport { useLazyQuery } from \"@apollo/react-hooks\";\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncLoadPagedResult, AsyncLoadPagedOptions } from '../../../shared/abstractStore';\r\nimport { useFetchMoreCallback } from '../../../shared/useFetchMoreCallback';\r\nimport { productsQuery, productsQueryVariables } from '../generated/productsQuery';\r\nimport { mainApiConfig } from '../../../configure/mainApiConfig';\r\nimport { productFieldsFragment } from '../models/Product';\r\n\r\n/**\r\n * Get a list of products from the store.\r\n * @param id\r\n * @param options\r\n */\r\nexport function useProducts(options: AsyncLoadPagedOptions = {}): AsyncLoadPagedResult {\r\n // Query data we need from the api.\r\n const [load, { data, loading, error, refetch, fetchMore: fetchMoreFromStore }] = useLazyQuery(\r\n gql`\r\n query productsQuery ($offset: Int, $first: Int) {\r\n items: products (offset: $offset, first: $first) {\r\n ...productFields\r\n }\r\n }\r\n\r\n ${productFieldsFragment}\r\n `,\r\n {\r\n\r\n variables: {\r\n offset: options.startOffset,\r\n first: options.pageSize\r\n },\r\n fetchPolicy: options.fetchPolicy ?? mainApiConfig.defaultFetchPolicy,\r\n pollInterval: options.pollInterval,\r\n onCompleted: (data) => {\r\n if (options.onCompleted) {\r\n options.onCompleted(data);\r\n }\r\n }\r\n }\r\n );\r\n\r\n // Run the query (unless we are being lazy).\r\n React.useEffect(() => {\r\n if (!options.lazy) {\r\n load();\r\n }\r\n }, [options.lazy, load])\r\n\r\n // Get the functions used to manage paging.\r\n const { fetchMore, hasMore: _hasMore } = useFetchMoreCallback(\r\n fetchMoreFromStore,\r\n (options?.startOffset ?? 0) + (data?.items?.length ?? 0),\r\n (prevResults, newResults) => ({\r\n ...prevResults,\r\n ...newResults,\r\n\r\n items: [...(prevResults?.items ?? []), ...(newResults?.items ?? [])]\r\n }),\r\n (newResults) => newResults?.items?.length\r\n );\r\n const hasMore = React.useCallback(() => !options.pageSize ? false : _hasMore(), [options.pageSize, _hasMore]);\r\n \r\n // Return the results.\r\n const refresh = React.useCallback(async () => { !refetch ? await load() : await refetch(); }, [refetch, load]);\r\n return React.useMemo(() => ({\r\n data: data ?? ({} as any),\r\n refresh: refresh,\r\n isLoading: loading,\r\n errors: error,\r\n fetchMore: fetchMore,\r\n hasMore: hasMore,\r\n }), [data, refresh, loading, error, fetchMore, hasMore]);\r\n}\r\n","import { useMutation } from \"@apollo/react-hooks\";\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncActionStatus } from '../../../shared/abstractStore';\r\nimport { deleteProductMutation, deleteProductMutationVariables } from '../generated/deleteProductMutation';\r\nimport { productFieldsFragment } from '../models/Product';\r\n\r\n/**\r\n * Get a callback to delete a Product in the store.\r\n */\r\nexport function useDeleteProductCallback(): [(id: string) => Promise, AsyncActionStatus] {\r\n const [mutationAction, { error }] = useMutation(\r\n gql`\r\n mutation deleteProductMutation ($id: ID!) {\r\n deleteProduct(id: $id) {\r\n ...productFields\r\n }\r\n }\r\n\r\n ${productFieldsFragment}\r\n `\r\n );\r\n\r\n // Wrap the mutation in a standard callback.\r\n const [action, { isExecuting, errors: actionErrors }] = useAsyncCallback(async (id: string) => {\r\n const result = await mutationAction({ variables: { id: id } });\r\n if (result.errors && result.errors.length) {\r\n throw result.errors;\r\n }\r\n }, [mutationAction]);\r\n\r\n return [action, { isExecuting: isExecuting, errors: error ? error.message : actionErrors }];\r\n}\r\n","import * as React from 'react';\r\nimport moment from 'moment';\r\nimport { InputProps, Input } from 'reactstrap';\r\n\r\nexport interface DateTimeInputProps extends InputProps {\r\n onChange?: (event: React.ChangeEvent) => void,\r\n format?: string\r\n}\r\n\r\n/**\r\n * Input with validation support for a datetime picker using moment() to keep our dates straight.\r\n * @param props\r\n */\r\nexport const ISODateTimeInput = (props: DateTimeInputProps) => {\r\n const { type, value, format, onChange, ...rest } = props;\r\n const theType = type || 'datetime-local';\r\n const theFormat = format || (theType === 'datetime' || theType === 'datetime-local'? 'YYYY-MM-DD[T]HH:mm': 'YYYY-MM-DD');\r\n\r\n // Handle the value\r\n const theValue = React.useMemo(() => moment(value).local().format(theFormat), [value, theFormat]);\r\n\r\n // Wrap the real on change event to always return the ISO date string in UTC time.\r\n const onChangeWrapper = React.useCallback((event: React.ChangeEvent) => {\r\n if (onChange) {\r\n const newValue = moment(event.currentTarget.value).utc().toISOString();\r\n const newEvent = {\r\n ...event,\r\n currentTarget: {\r\n ...event.currentTarget,\r\n value: newValue,\r\n },\r\n target: {\r\n ...event.target,\r\n value: newValue,\r\n }\r\n };\r\n\r\n onChange(newEvent);\r\n }\r\n }, [onChange]);\r\n\r\n return (\r\n \r\n );\r\n};\r\n","import { StudentApplication } from \"../api/main/models/StudentApplication\";\r\nimport { studentApplicationsQuery_items } from \"../api/main/generated/studentApplicationsQuery\";\r\n\r\n/**\r\n * Calculate application status for the passed in application.\r\n * @param application\r\n */\r\nexport function calculateApplicationStatus(model: StudentApplication | studentApplicationsQuery_items): string {\r\n // default to pending\r\n var ret = 'Pending';\r\n\r\n if (model.hasBeenIssued && !model.archived) {\r\n // cannot archive an issued card so no other check needed\r\n ret = 'Issued';\r\n } else if (model.archived && (!model.paymentTakenDate || model.hasPaid || model.universityId)) {\r\n // rejected if they have paid and then been archived \r\n // or a university is paying not the applicant(they don't pay so cannot be a payment failure).\r\n ret = 'Rejected';\r\n } else if (model.archived) {\r\n // any other archived must be a payment failure\r\n ret = 'Payment failed';\r\n }\r\n\r\n return ret;\r\n}","import * as React from 'react';\r\nimport { Table, Button, Row, Col, ButtonGroup, } from 'reactstrap';\r\nimport { LinkContainer } from 'react-router-bootstrap';\r\nimport { AlertOnErrors } from '../../shared/alertOnErrors';\r\nimport { LoadingIndicator } from '../shared/LoadingIndicator';\r\nimport { Waypoint } from 'react-waypoint';\r\nimport { useReplaceSearchParamsEffect, useSearchParams } from '../../shared/useURLSearchParams';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { SearchInput } from '../shared/SearchInput';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { MainContainer } from '../shared/MainContainer';\r\nimport { NoResultsFound } from '../shared/NoResultsFound';\r\nimport { TableRowButtons } from '../shared/TableRowButtons';\r\nimport { StickyToolbar } from '../shared/StickyToolbar';\r\nimport { useHistory } from 'react-router';\r\nimport { ConditionalFragment } from 'react-conditionalfragment';\r\nimport { useStudentApplications } from '../../api/main/studentApplications/useStudentApplications';\r\nimport { Banner } from '../shared/Banner';\r\nimport { studentApplicationsQuery_items, } from '../../api/main/generated/studentApplicationsQuery';\r\nimport moment from 'moment';\r\nimport { calculateApplicationStatus } from '../../utilities/calculateApplicationStatus'\r\n\r\nexport interface StudentApplicationListProps {\r\n title?: string,\r\n // Optional filter that can be passed to the component to filter the items shown (e.g. by state).\r\n filter?: (items: Array | undefined | null) => Array | undefined | null,\r\n // When true we'll include the archived items when loading from the database (e.g. when showing rejected items).\r\n includeArchived?: boolean,\r\n}\r\n\r\n/**\r\n * List of studentApplications.\r\n */\r\nexport const StudentApplicationsList = (props: StudentApplicationListProps) => {\r\n const {\r\n title,\r\n filter, includeArchived,\r\n } = props;\r\n\r\n const { t } = useTranslation();\r\n const { search: searchParam } = useSearchParams();\r\n const [search, setSearch] = React.useState(searchParam ?? '');\r\n const { data: { items: allItems }, isLoading, errors: loadingErrors, fetchMore, hasMore } = useStudentApplications({ includeArchived: includeArchived });\r\n\r\n const history = useHistory();\r\n\r\n // Filter by the user's search client side so it can work when offline as well as online.\r\n const items = React.useMemo(() => {\r\n if (!allItems) {\r\n return allItems;\r\n }\r\n\r\n // Filter by any passed in filter.\r\n let ret = allItems;\r\n if (filter) {\r\n ret = filter(ret) ?? [];\r\n }\r\n\r\n // Filter by the search.\r\n if (!search) {\r\n return ret;\r\n }\r\n\r\n let lowerSearch = search.toLocaleLowerCase();\r\n\r\n // Filter the items being displayed.\r\n return ret.filter(item =>\r\n item.forename.toLocaleLowerCase().indexOf(lowerSearch) >= 0\r\n || item.surname.toLocaleLowerCase().indexOf(lowerSearch) >= 0\r\n || item.email.toLocaleLowerCase().indexOf(lowerSearch) >= 0\r\n || (item.university?.name ?? '').toLocaleLowerCase().indexOf(lowerSearch) >= 0\r\n || (item.product?.name ?? '').toLocaleLowerCase().indexOf(lowerSearch) >= 0\r\n || (calculateApplicationStatus(item)).toLocaleLowerCase().indexOf(lowerSearch) >= 0\r\n );\r\n }, [allItems, search, filter]);\r\n\r\n // Make sure the URL keeps in sync with the search.\r\n useReplaceSearchParamsEffect({ search: search });\r\n\r\n const colCount = 8;\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n

{title ?? t('studentApplicationLists.heading', 'Student applications')}

\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n setSearch(e.currentTarget.value)} />\r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n items?.map(item => (\r\n history.push(`/administration/studentApplication-prices/edit/${item.id}`)}>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ))\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
{t('studentApplicationsList.studentApplication', 'Application')}{t('studentApplicationsList.submittedDate', 'Applied')}{t('studentApplicationsList.forename', 'Forename')}{t('studentApplicationsList.surname', 'Surname')}{t('studentApplicationsList.email', 'Email')}{t('studentApplicationsList.bulkBuyer', 'Payer')}{t('studentApplicationsList.product.name', 'Card')}{t('studentApplicationsList.status', 'Status')} 
\r\n
{t('common.fullName', '{{forename}} {{surname}}', { forename: item.forename, surname: item.surname })}
\r\n
\r\n {item.university?.name ?? ''}\r\n
\r\n
{moment(item.submittedDate).format(\"DD/MM/YYYY\")}{item.forename}{item.surname}{item.email}{item.university?.name ?? 'Applicant'}{item.product?.name ?? ''}{calculateApplicationStatus(item)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* no delete allowed - archiving is done by rejecting the application\r\n \r\n toggleMenuOpen(item.id)}>\r\n \r\n {t('common.menuDropdown', 'More')}\r\n \r\n \r\n \r\n \r\n \r\n <> {t('common.delete', 'Delete')}\r\n \r\n \r\n \r\n \r\n */}\r\n \r\n \r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n );\r\n};\r\n\r\n","import * as React from 'react';\r\nimport { useLazyQuery } from \"@apollo/react-hooks\";\r\nimport gql from \"graphql-tag\";\r\nimport { AsyncLoadPagedResult, AsyncLoadPagedOptions } from '../../../shared/abstractStore';\r\nimport { useFetchMoreCallback } from '../../../shared/useFetchMoreCallback';\r\nimport { studentApplicationsQuery, studentApplicationsQueryVariables } from '../generated/studentApplicationsQuery';\r\nimport { mainApiConfig } from '../../../configure/mainApiConfig';\r\nimport { productFieldsFragment } from '../models/Product';\r\nimport { userFieldsFragment } from '../models/User';\r\nimport { universityFieldsFragment } from '../models/University';\r\n\r\ninterface StudentApplicationsAsyncLoadPagedOptions extends AsyncLoadPagedOptions {\r\n includeArchived?: boolean,\r\n}\r\n\r\n/**\r\n * Get a list of studentApplications from the store.\r\n * @param id\r\n * @param options\r\n */\r\nexport function useStudentApplications(options: StudentApplicationsAsyncLoadPagedOptions = {}): AsyncLoadPagedResult {\r\n // Query data we need from the api.\r\n const [load, { data, loading, error, refetch, fetchMore: fetchMoreFromStore }] = useLazyQuery(\r\n gql`\r\n query studentApplicationsQuery ($offset: Int, $first: Int, $includeArchived: Boolean) {\r\n items: studentApplications (offset: $offset, first: $first, includeArchived: $includeArchived) {\r\n id\r\n forename\r\n surname\r\n street\r\n address2\r\n city\r\n county\r\n postcode\r\n country\r\n dateOfBirth\r\n email\r\n photoBlobReferenceId\r\n proofOfEntitlementBlobReferenceId\r\n isUnder19\r\n isAnydayPass\r\n isCityArea\r\n productId\r\n existingEasyRiderCardNumber\r\n universityId\r\n universityProvidedReferenceNumber\r\n hasBeenIssued\r\n submittedDate\r\n issuedOnDate\r\n issuedByUserId\r\n hasPaid\r\n price\r\n paymentProviderReferenceNumber\r\n paymentTakenDate\r\n archived\r\n anydayDays\r\n\r\n university {\r\n ...universityFields\r\n }\r\n\r\n product {\r\n ...productFields\r\n }\r\n\r\n issuedByUser {\r\n ...userFields\r\n }\r\n }\r\n }\r\n\r\n ${universityFieldsFragment}\r\n ${productFieldsFragment}\r\n ${userFieldsFragment}\r\n `,\r\n {\r\n\r\n variables: {\r\n offset: options.startOffset,\r\n first: options.pageSize,\r\n includeArchived: options.includeArchived,\r\n },\r\n fetchPolicy: options.fetchPolicy ?? mainApiConfig.defaultFetchPolicy,\r\n pollInterval: options.pollInterval,\r\n onCompleted: (data) => {\r\n if (options.onCompleted) {\r\n options.onCompleted(data);\r\n }\r\n }\r\n }\r\n );\r\n\r\n // Run the query (unless we are being lazy).\r\n React.useEffect(() => {\r\n if (!options.lazy) {\r\n load();\r\n }\r\n }, [options.lazy, load])\r\n\r\n // Get the functions used to manage paging.\r\n const { fetchMore, hasMore: _hasMore } = useFetchMoreCallback(\r\n fetchMoreFromStore,\r\n (options?.startOffset ?? 0) + (data?.items?.length ?? 0),\r\n (prevResults, newResults) => ({\r\n ...prevResults,\r\n ...newResults,\r\n\r\n items: [...(prevResults?.items ?? []), ...(newResults?.items ?? [])]\r\n }),\r\n (newResults) => newResults?.items?.length\r\n );\r\n const hasMore = React.useCallback(() => !options.pageSize ? false : _hasMore(), [options.pageSize, _hasMore]);\r\n \r\n // Return the results.\r\n const refresh = React.useCallback(async () => { !refetch ? await load() : await refetch(); }, [refetch, load]);\r\n return React.useMemo(() => ({\r\n data: data ?? ({} as any),\r\n refresh: refresh,\r\n isLoading: loading,\r\n errors: error,\r\n fetchMore: fetchMore,\r\n hasMore: hasMore,\r\n }), [data, refresh, loading, error, fetchMore, hasMore]);\r\n}\r\n","import { RouteEntry } from \"../../shared/routes\";\r\nimport { IdentityRoles } from \"../../configure/security/IdentityRoles\";\r\nimport { EditStudentApplication } from \"./EditStudentApplication\";\r\nimport { SearchStudentApplicationsList } from \"./SearchStudentApplicationsList\";\r\nimport { PendingStudentApplicationsList } from \"./PendingStudentApplicationsList\";\r\nimport { CompletedStudentApplicationsList } from \"./CompletedStudentApplicationsList\";\r\nimport { RejectedStudentApplicationsList } from \"./RejectedStudentApplicationsList\";\r\nimport { FailedPaymentStudentApplicationsList } from \"./FailedPaymentStudentApplicationsList\";\r\n\r\n\r\nexport const studentApplicationRoutes: Array = [\r\n { path: '/administration/applications/search', exact: true, component: SearchStudentApplicationsList, authorize: true, requireRole: IdentityRoles.Administration },\r\n { path: '/administration/applications/pending', exact: true, component: PendingStudentApplicationsList, authorize: true, requireRole: IdentityRoles.Administration },\r\n { path: '/administration/applications/completed', exact: true, component: CompletedStudentApplicationsList, authorize: true, requireRole: IdentityRoles.Administration },\r\n { path: '/administration/applications/rejected', exact: true, component: RejectedStudentApplicationsList, authorize: true, requireRole: IdentityRoles.Administration },\r\n { path: '/administration/applications/failed', exact: true, component: FailedPaymentStudentApplicationsList, authorize: true, requireRole: IdentityRoles.Administration },\r\n { path: '/administration/studentApplication-prices/edit/:id', component: EditStudentApplication, authorize: true, requireRole: IdentityRoles.Administration },\r\n];\r\n","import * as React from 'react';\r\nimport { StudentApplicationsList } from './StudentApplicationsList';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\n/**\r\n * List of all applications that can be searched.\r\n */\r\nexport const SearchStudentApplicationsList = () => {\r\n const { t } = useTranslation();\r\n\r\n return (\r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { studentApplicationsQuery_items } from '../../api/main/generated/studentApplicationsQuery';\r\nimport { StudentApplicationsList } from './StudentApplicationsList';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { calculateApplicationStatus } from '../../utilities/calculateApplicationStatus';\r\n\r\n/**\r\n * List of pending applications.\r\n */\r\nexport const PendingStudentApplicationsList = () => {\r\n const { t } = useTranslation();\r\n\r\n // Filter to show only pending items\r\n const filter = React.useCallback((items: Array | undefined | null) => {\r\n return items?.filter(item => calculateApplicationStatus(item) === 'Pending');\r\n }, []);\r\n\r\n return (\r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { studentApplicationsQuery_items } from '../../api/main/generated/studentApplicationsQuery';\r\nimport { StudentApplicationsList } from './StudentApplicationsList';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { calculateApplicationStatus } from '../../utilities/calculateApplicationStatus';\r\n\r\n/**\r\n * List of completed applications.\r\n */\r\nexport const CompletedStudentApplicationsList = () => {\r\n const { t } = useTranslation();\r\n\r\n // Filter to show only completed items\r\n const filter = React.useCallback((items: Array | undefined | null) => {\r\n return items?.filter(item => calculateApplicationStatus(item) === 'Issued');\r\n }, []);\r\n\r\n return (\r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { studentApplicationsQuery_items } from '../../api/main/generated/studentApplicationsQuery';\r\nimport { StudentApplicationsList } from './StudentApplicationsList';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { calculateApplicationStatus } from '../../utilities/calculateApplicationStatus';\r\n\r\n/**\r\n * List of rejected applications.\r\n */\r\nexport const RejectedStudentApplicationsList = () => {\r\n const { t } = useTranslation();\r\n\r\n // Filter to show only rejected items - if archived and paymentTakenDate is set but without a reference number it is a payment failure not a rejection\r\n const filter = React.useCallback((items: Array | undefined | null) => {\r\n return items?.filter(item => calculateApplicationStatus(item) === 'Rejected');\r\n }, []);\r\n\r\n return (\r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { studentApplicationsQuery_items } from '../../api/main/generated/studentApplicationsQuery';\r\nimport { StudentApplicationsList } from './StudentApplicationsList';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { calculateApplicationStatus } from '../../utilities/calculateApplicationStatus';\r\n\r\n/**\r\n * List of payment failure applications.\r\n */\r\nexport const FailedPaymentStudentApplicationsList = () => {\r\n const { t } = useTranslation();\r\n\r\n // Filter to show only payment failures - if archived and paymentTakenDate is not set it is a rejection not a payment failure\r\n const filter = React.useCallback((items: Array | undefined | null) => {\r\n return items?.filter(item => calculateApplicationStatus(item) === 'Payment failed');\r\n }, []);\r\n\r\n return (\r\n \r\n );\r\n};","import './editStudentApplication.scss';\r\n\r\nimport * as React from 'react';\r\nimport { Button, Label, FormGroup, Spinner, Row, Col, Input } from 'reactstrap';\r\nimport { AlertOnErrors } from '../../shared/alertOnErrors';\r\nimport { LoadingIndicator } from '../shared/LoadingIndicator';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { MainContainer } from '../shared/MainContainer';\r\nimport { useParams, useHistory } from 'react-router';\r\nimport { useChanges } from '../../shared/useChanges';\r\nimport { FormButtons } from '../shared/FormButtons';\r\nimport { ButtonAsync } from 'reactstrap-buttonasync';\r\nimport { useAsyncCallback } from 'react-use-async-callback';\r\nimport { ConditionalFragment } from 'react-conditionalfragment';\r\nimport { Banner } from '../shared/Banner';\r\nimport { useStudentApplication } from '../../api/main/studentApplications/useStudentApplication';\r\nimport { useSaveStudentApplicationCallback } from '../../api/main/studentApplications/useSaveStudentApplicationCallback';\r\nimport { StudentApplication } from '../../api/main/models/StudentApplication';\r\nimport { Background } from '../shared/Background';\r\nimport moment from 'moment';\r\nimport { ISODateTimeInput } from '../shared/ISODateTimeInput';\r\nimport { useProfile } from '../../api/main/profiles/useProfile';\r\nimport { useCurrentUserId } from '../../api/account';\r\nimport { useCallbackAwaitStateSync } from 'use-callback-await-state-sync';\r\nimport { calculateApplicationStatus } from '../../utilities/calculateApplicationStatus';\r\n\r\n/**\r\n * Edit an studentApplication\r\n */\r\nexport const EditStudentApplication = () => {\r\n const { t } = useTranslation();\r\n const { id } = useParams();\r\n const { data: { model: storeModel }, isLoading, errors: loadErrors } = useStudentApplication(id);\r\n const { model, change, changes } = useChanges(storeModel);\r\n const [save, { errors: saveErrors }] = useSaveStudentApplicationCallback();\r\n const history = useHistory();\r\n\r\n const { data: { model: issuedByProfile } } = useProfile(model?.issuedByUserId, { isUserId: true });\r\n\r\n const [saveForm, { isExecuting: isSaving, errors: saveFormErrors }] = useAsyncCallback(async () => {\r\n\r\n await save(model.id, changes, false);\r\n\r\n history.goBack();\r\n }, [save, model, changes, history]);\r\n\r\n const currentuserID = useCurrentUserId();\r\n\r\n const updateModelAndSave = useCallbackAwaitStateSync(() => saveForm());\r\n\r\n const applicationStatus = calculateApplicationStatus(model);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n

\r\n \r\n {t('editStudentApplication.editHeading', 'Process application')}\r\n \r\n \r\n {t('editStudentApplication.viewHeading', 'View application')}\r\n \r\n

\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n\r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \"Uploaded\"\r\n \r\n <> {t('common.download', 'Download photo')}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \"Evidence\"\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n \r\n \r\n\r\n \r\n \r\n {\r\n change({ issuedByUserId: currentuserID, issuedOnDate: moment().toISOString(), hasBeenIssued: true });\r\n updateModelAndSave();\r\n }\r\n }\r\n executingChildren={<> {t('editStudentApplication.saving', 'saving...')}}>\r\n \r\n <> {t('editStudentApplication.passissued', 'Easyrider pass issued')}\r\n \r\n \r\n\r\n \r\n {\r\n change({ issuedByUserId: currentuserID, issuedOnDate: moment().toISOString(), archived: true });\r\n updateModelAndSave();\r\n }\r\n }\r\n executingChildren={<> {t('editStudentApplication.saving', 'saving...')}}>\r\n \r\n <> {t('editStudentApplication.passrejected', 'Application rejected')}\r\n \r\n \r\n\r\n {/*\r\n //hide save button for now but we may need it if editing required\r\n \r\n {t('common.saving', 'Saving...')}}>\r\n \r\n <> {t('common.save', 'Save')}\r\n \r\n \r\n */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n","import { useAuthenticatedState } from \"../api-authorization/useAuthenticatedState\";\r\n\r\n/**\r\n * Hook to get the current user id.\r\n */\r\nexport function useCurrentUserId(): string | undefined {\r\n const { user } = useAuthenticatedState({ includeUser: true });\r\n return user?.sub;\r\n}\r\n","import { RouteEntry } from \"../shared/routes\";\r\nimport { apiAuthorizationRoutes } from \"../components/api-authorization/routes\";\r\nimport { accountRoutes } from \"../components/account/routes\";\r\nimport { profileRoutes } from \"../components/profiles/routes\";\r\nimport { userRoutes } from \"../components/users/routes\";\r\nimport { NotFound } from \"../components/shared/NotFound\";\r\nimport { administrationSidebarRoutes, administrationRoutes } from \"../components/administration/routes\";\r\nimport { NoSidebarUnlessReqired } from \"../components/shared/NoSidebarUnlessRequired\";\r\nimport { homeRoutes } from \"../components/home/routes\";\r\nimport { applyRoutes } from \"../components/apply/routes\";\r\nimport { universityRoutes } from \"../components/universities/routes\";\r\nimport { productRoutes } from \"../components/products/routes\";\r\nimport { studentApplicationRoutes } from \"../components/studentApplications/routes\";\r\n\r\n\r\nexport const appRoutes: Array = [\r\n ...administrationRoutes,\r\n ...apiAuthorizationRoutes,\r\n ...accountRoutes,\r\n ...homeRoutes,\r\n ...profileRoutes,\r\n ...userRoutes,\r\n\r\n ...applyRoutes,\r\n\r\n ...productRoutes,\r\n ...studentApplicationRoutes,\r\n ...universityRoutes,\r\n\r\n { path: undefined, component: NotFound }\r\n];\r\n\r\nexport const sidebarRoutes: Array = [\r\n ...administrationSidebarRoutes,\r\n\r\n { path: undefined, component: NoSidebarUnlessReqired }\r\n];","import * as React from 'react';\r\nimport { Button } from 'reactstrap';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useHistory } from 'react-router';\r\nimport { MainContainer } from './MainContainer';\r\nimport { Banner } from './Banner';\r\nimport { Background } from './Background';\r\n\r\n/**\r\n * Component to show when a route is not found. \r\n */\r\nexport const NotFound = () => {\r\n const { t } = useTranslation();\r\n const history = useHistory();\r\n\r\n return (\r\n \r\n \r\n

{t('notFound.notFoundHeading', 'Sorry the page you have requested cannot be found')}

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

\r\n {t('notFound.helpText', 'The link you have acccessed is for a page that could not be found. Please check and try again, or try navigating to the page you want using the apps menus.')}\r\n

\r\n\r\n \r\n
\r\n
\r\n );\r\n};","import './noSidebarUnlessRequired.scss';\r\n\r\nimport * as React from 'react';\r\nimport { Helmet } from 'react-helmet-async';\r\n\r\n\r\nexport const NoSidebarUnlessReqired = () => {\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { NavItem, NavLink } from 'reactstrap';\r\nimport { AuthorizeContainer } from '../../shared/authorizeRoute';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { NavLinkTrackActive } from '../shared/NavLinkTrackActive';\r\n\r\n/**\r\n * Primary navigation menu for the app. \r\n */\r\nexport const Navigation = () => {\r\n const { t } = useTranslation();\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n <> {t('navigation.apply', 'Apply')}\r\n \r\n \r\n \r\n \r\n \r\n \r\n <> {t('navigation.administration', 'Administration')}\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import './sidebar.scss';\r\n\r\nimport * as React from 'react';\r\nimport { AppSidebar, AppSidebarFooter, AppSidebarForm, AppSidebarHeader, AppSidebarMinimizer } from '@coreui/react';\r\nimport { SidebarNav } from '../../shared/sidebarNav';\r\nimport { AppRoutes } from '../shared/AppRoutes';\r\nimport { sidebarRoutes } from '../../configure/routeConfig';\r\nimport { Navigation } from './Navigation';\r\nimport { Nav } from 'reactstrap';\r\n\r\nexport const Sidebar = () => {\r\n return (\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n );\r\n};\r\n","import './layout.scss';\r\n\r\nimport * as React from 'react';\r\n//import { AppBreadcrumb } from '@coreui/react';\r\nimport { Header } from './Header';\r\nimport { Footer } from './Footer';\r\n\r\nimport { Sidebar } from './Sidebar';\r\nimport { LoadingIndicator } from '../../components/shared/LoadingIndicator';\r\n\r\nimport { RouteEntry } from '../../shared/routes';\r\n\r\nexport interface LayoutProps {\r\n appRoutes: Array,\r\n children: React.ReactNode\r\n}\r\n\r\nexport const Layout = (props: LayoutProps) => {\r\n return (\r\n
\r\n
\r\n
\r\n \r\n
\r\n {/**/}\r\n }>\r\n {props.children}\r\n \r\n
\r\n
\r\n
\r\n
\r\n );\r\n};\r\n","import { Library, library } from '@fortawesome/fontawesome-svg-core';\r\nimport { faSpinner, faLock, faUser, faSearch, faPlus, faCogs, faSave, faEdit, faUsers, faTrash, faCaretUp, faCaretDown, faCaretLeft, faUndo, faMinus, faExclamationCircle, faCaretRight, faTimesCircle, faCalendarWeek, faBusinessTime, faStopwatch, faUserClock, faTimes, faStop, faDesktop, faRuler, faFlagCheckered, faPlay, faUserCheck, faCreditCard, faPhone, faEnvelope, faSchool, faPoundSign, faVoteYea, faPersonBooth, faTrashAlt, faChevronLeft, faChevronRight, faDownload, faCross, faCheckCircle, faEye } from '@fortawesome/free-solid-svg-icons';\r\nimport { faFrown as farFrown, faFrownOpen as farFrownOpen, faCircle as farCircle, } from '@fortawesome/free-regular-svg-icons';\r\n\r\n// Import the fontawsome icons we actually want to use.\r\nexport const initializeIcons = () => {\r\n configureIcons(library);\r\n};\r\n\r\nexport const configureIcons = (library: Library) => {\r\n library.add(\r\n // solid\r\n faBusinessTime,\r\n faCalendarWeek,\r\n faCaretUp,\r\n faCaretDown,\r\n faCaretLeft,\r\n faCaretRight,\r\n faCheckCircle,\r\n faChevronLeft,\r\n faChevronRight,\r\n faCogs,\r\n faCreditCard,\r\n faCross,\r\n faDesktop,\r\n faDownload,\r\n faEdit,\r\n faExclamationCircle,\r\n faEye,\r\n faFlagCheckered,\r\n faLock,\r\n faMinus,\r\n faPersonBooth,\r\n faPlay,\r\n faPlus,\r\n faPoundSign,\r\n faRuler,\r\n faSave,\r\n faSchool,\r\n faSearch,\r\n faSpinner,\r\n faStop,\r\n faStopwatch,\r\n faTimes,\r\n faTimesCircle,\r\n faTrash,\r\n faTrashAlt,\r\n faUndo,\r\n faUser,\r\n faUserCheck,\r\n faUserClock,\r\n faUsers,\r\n faVoteYea,\r\n\r\n // regular\r\n farCircle,\r\n farFrown,\r\n farFrownOpen,\r\n faPhone,\r\n faEnvelope,\r\n );\r\n};\r\n","import { InMemoryCache } from \"apollo-cache-inmemory\";\r\nimport { HttpLink } from \"apollo-link-http\";\r\nimport { mainApiConfig } from \"./mainApiConfig\";\r\nimport ApolloClient from \"apollo-client\";\r\nimport { CachePersistor } from 'apollo-cache-persist';\r\n\r\nconst cache = new InMemoryCache();\r\n\r\n// Load cache from the persisited storage.\r\nexport const apolloCachePersistor = new CachePersistor({\r\n cache,\r\n storage: (window.localStorage as any),\r\n});\r\napolloCachePersistor.persist();\r\n\r\nconst link = new HttpLink({\r\n uri: mainApiConfig.endpoint,\r\n credentials: 'same-origin',\r\n});\r\n\r\nexport const apolloClient = new ApolloClient({\r\n cache,\r\n link\r\n});","// Import the required localization files for momentjs.\r\n//import 'moment/locale/en-us'; // Built in.\r\nimport 'moment/locale/en-gb';\r\n//import 'moment/locale/fr';\r\n//import 'moment/locale/pt';\r\n//import 'moment/locale/es';\r\n\r\n// Import the required localization files for numeraljs.\r\n//import 'numeral/locale/en-us'; // Built in.\r\nimport 'numeral/locales/en-gb';\r\n//import 'numeral/locales/fr';\r\n//import 'numeral/locales/pt-pt';\r\n//import 'numeral/locales/es';\r\n\r\n\r\n/**\r\n * Languages available in the application. \r\n */\r\nexport const availableLanguages = [\r\n { code: 'en-US', name: 'English (American)', flagCountryCode: 'us', momentLocale: 'en', numeralLocale: 'en' },\r\n { code: 'en-GB', name: 'English (British)', flagCountryCode: 'gb', momentLocale: 'en-gb', numeralLocale: 'en-gb' },\r\n //{ code: 'fr', name: 'Français', flagCountryCode: 'fr', momentLocale: 'fr', numeralLocale: 'fr' },\r\n //{ code: 'pt', name: 'Português', flagCountryCode: 'pt', momentLocale: 'pt', numeralLocale: 'pt-pt' },\r\n //{ code: 'es', name: 'Español', flagCountryCode: 'fr', momentLocale: 'fr', numeralLocale: 'fr' }\r\n];\r\n","import storage from 'redux-persist/lib/storage';\r\n\r\nexport const persistConfig = {\r\n key: 'root',\r\n storage,\r\n // List of things we do want persisting, to avoid unexpected side effects we use a whitelist rather than a blacklist here.\r\n whitelist: ['cache']\r\n};\r\n","import { combineReducers, configureStore } from \"@reduxjs/toolkit\";\r\nimport { persistStore, persistReducer } from 'redux-persist';\r\nimport { CacheState, cacheReducer } from './cache';\r\nimport { persistConfig } from \"./persistConfig\";\r\n\r\nexport interface AppReduxStore {\r\n cache: CacheState\r\n}\r\n\r\nexport const rootReducer = combineReducers({\r\n cache: cacheReducer\r\n});\r\n\r\nexport const persistedRootReducer = persistReducer(\r\n persistConfig,\r\n rootReducer\r\n);\r\n\r\n/**\r\n * Create and configure a redux store for the app.\r\n */\r\nexport const createAppReduxStore = () => {\r\n var windowAny = window as any;\r\n const preloadedState = windowAny.initialReduxState;\r\n\r\n const store = configureStore({\r\n reducer: persistedRootReducer,\r\n preloadedState: preloadedState ?? {},\r\n middleware: []\r\n });\r\n\r\n // Persist to locaal storage if needed.\r\n const persistor = persistStore(store);\r\n\r\n //if (process.env.NODE_ENV !== 'production' && module.hot) {\r\n // module.hot.accept('./reducers', () => store.replaceReducer(rootReducer))\r\n //}\r\n\r\n return { store, persistor };\r\n};\r\n","import { ServiceResolver, ServiceProvider, IServiceCollectionBuilder } from \"inject-typesafe\";\r\nimport { AccountService } from \"../api/account\";\r\nimport { ApiFetch } from 'apifetch-json';\r\nimport { CacheService } from \"../shared/cacheInRedux\";\r\nimport { AppReduxStore } from \"../reduxStore/store\";\r\nimport { EnhancedStore, CombinedState } from \"@reduxjs/toolkit\";\r\n\r\n/**\r\n * Returns a configured service provider.\r\n */\r\nexport function createServiceProvider(reduxStore: EnhancedStore>) {\r\n return new ServiceProvider((builder: IServiceCollectionBuilder) => ({\r\n accountService: builder.singleton(services => new AccountService()),\r\n apiFetch: builder.singleton(services => new ApiFetch()),\r\n cacheService: builder.singleton(services => new CacheService(() => services.reduxStore().getState().cache, services.reduxStore().dispatch)),\r\n reduxStore: builder.singleton(() => reduxStore),\r\n }));\r\n}\r\n\r\nexport interface AppServices {\r\n accountService: ServiceResolver,\r\n apiFetch: ServiceResolver,\r\n cacheService: ServiceResolver,\r\n reduxStore: ServiceResolver>>,\r\n}\r\n\r\n","import * as React from 'react';\r\nimport { Layout } from './components/layout/Layout';\r\nimport { ServiceProviderContext } from 'inject-typesafe-react';\r\nimport { createServiceProvider } from './configure/configureServices';\r\nimport { AppRoutes } from './components/shared/AppRoutes';\r\nimport { appRoutes } from './configure/routeConfig';\r\nimport { initializeIcons } from './configure/iconsConfig';\r\nimport { Helmet, HelmetProvider } from 'react-helmet-async';\r\nimport { ApolloProvider } from '@apollo/react-hooks';\r\nimport { apolloClient, apolloCachePersistor } from './configure/configureApollo';\r\nimport { configurei18n } from './configure/i18n';\r\nimport { LoadingIndicator } from './components/shared/LoadingIndicator';\r\nimport { I18nextProvider } from 'react-i18next';\r\nimport { createAppReduxStore } from './reduxStore/store';\r\nimport { Provider as ReduxProvider } from 'react-redux';\r\nimport { PersistGate } from 'redux-persist/integration/react';\r\nimport authService from './api/api-authorization/AuthorizeService';\r\nimport { configureErrorMessages } from './configure/errorMessageConfig';\r\n\r\n// Configure redux.\r\nconst { store: reduxStore, persistor: reduxStorePersistor } = createAppReduxStore();\r\n\r\n// Configure services.\r\nconst serviceProvider = createServiceProvider(reduxStore);\r\n\r\n// When the authorization state changes, clear the right parts of our caches.\r\nauthService.subscribe(() => {\r\n reduxStorePersistor.purge();\r\n apolloCachePersistor.purge();\r\n});\r\n\r\n// Configure icons.\r\ninitializeIcons();\r\n\r\n// Configure i18n\r\nconst i18n = configurei18n();\r\n\r\n// Configure server and 3rd party error messages to make them friendly and translatable.\r\nconfigureErrorMessages();\r\n\r\n// App component.\r\nexport const App = () => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n }>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import i18n from 'i18next';\r\nimport { initReactI18next } from 'react-i18next';\r\nimport Backend from 'i18next-xhr-backend';\r\nimport LanguageDetector from 'i18next-browser-languagedetector';\r\nimport moment, { isMoment } from 'moment';\r\nimport numeral from 'numeral';\r\nimport { isNumber } from 'util';\r\nimport { availableLanguages } from './languageConfig';\r\n\r\n// not like to use this?\r\n// have a look at the Quick start guide \r\n// for passing in lng and translations on init\r\nexport function configurei18n() {\r\n i18n\r\n // load translation using xhr -> see /public/locales\r\n // learn more: https://github.com/i18next/i18next-xhr-backend\r\n .use(Backend)\r\n // detect user language\r\n // learn more: https://github.com/i18next/i18next-browser-languageDetector\r\n .use(LanguageDetector)\r\n // pass the i18n instance to react-i18next.\r\n .use(initReactI18next)\r\n // init i18next\r\n // for all options read: https://www.i18next.com/overview/configuration-options\r\n .init({\r\n fallbackLng: 'en-GB',\r\n //debug: true,\r\n\r\n interpolation: {\r\n escapeValue: false, // not needed for react as it escapes by default\r\n\r\n format: function (value, format, lang) {\r\n // Handle dates with moment.\r\n if (value instanceof Date) {\r\n return moment(value).format(format);\r\n } else if (isMoment(value)) {\r\n return moment(value).format(format);\r\n }\r\n\r\n // Handle numbers with numeral.\r\n if (value instanceof Number) {\r\n return numeral(value).format(format);\r\n } else if (isNumber(value)) {\r\n return numeral(value).format(format);\r\n }\r\n\r\n return value;\r\n }\r\n }\r\n });\r\n\r\n // Keep the moment and numeral formats in sync with the i18n formats.\r\n i18n.on('languageChanged', (lng) => {\r\n // As we are not supporting internationalisation in this app:\r\n // Force all en * language to always be en - GB as this is only for UK use, and Chrome in the UK download defaults to the en/en-US language.\r\n if ((lng?.indexOf('en') ?? 0) !== -1) {\r\n lng = 'en-GB';\r\n }\r\n\r\n const thisLanguage = availableLanguages.find(item => item.code === lng);\r\n\r\n moment.locale(thisLanguage?.momentLocale ?? lng);\r\n numeral.locale(thisLanguage?.numeralLocale ?? lng);\r\n });\r\n\r\n return i18n;\r\n}\r\n","import { registerErrorMessageConverters } from \"../shared/userFriendlyErrorMessage\";\r\nimport i18next from \"i18next\";\r\n\r\n// Register the converters to make friendly versions of error messages.\r\n// This is primarily used to make friendly versions of message from 3rd party libraries, or the server.\r\n// By convention tranlsation keys for returned errors should start \"error.\" rather than \"errorMessageConfig.\".\r\nexport function configureErrorMessages() {\r\n registerErrorMessageConverters([\r\n // Convert the apollo graphql errors message to something more friendly.\r\n (error) => {\r\n let shouldHandle = false;\r\n let message = error?.message ?? error?.toString() ?? ''; /* Sometimes we get an Error sometimes we get a String */\r\n let graphQLErrors: Array = [];\r\n switch (message) {\r\n // Network errors get a friendly message that is nicer given the use of cache for offline support.\r\n case 'Network error: Failed to fetch':\r\n message = i18next.t('error.apollo.networkErrorFailedToFetch', 'Could not synchronize information with the cloud.');\r\n shouldHandle = true;\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n // Handle graphQL errors as they all start with GraphQL error: in their message.\r\n if (message.indexOf('GraphQL error: ') === 0) {\r\n if (message.indexOf('GraphQL error: GraphQL.Validation.ValidationError: ') === 0) {\r\n message = i18next.t('error.apollo.graphQLValidationError', 'GraphQL error: request is not not a valid GraphQL query or mutation.');\r\n } else if (message.indexOf('GraphQL error: GraphQL.ExecutionError: ') === 0) {\r\n message = i18next.t('error.apollo.graphQLExecutionError', 'GraphQL error: query or mutation could not be executed.');\r\n }\r\n\r\n shouldHandle = true;\r\n }\r\n\r\n // If we have a graphQL errors, then lets handle those as seperate errors for the purpose of showing them.\r\n if (error?.graphQLErrors) {\r\n graphQLErrors = error?.graphQLErrors;\r\n shouldHandle = true;\r\n }\r\n\r\n // If we haven't decided we should handle this error by this point then just skip it.\r\n if (!shouldHandle) {\r\n console.log(error);\r\n return null;\r\n }\r\n\r\n // If we have multiple graphQLErrors in one Error object, lets return one error for each GraphQL error.\r\n if (graphQLErrors.length) {\r\n return graphQLErrors.map(item => ({\r\n message: message,\r\n details: i18next.t('errors.apollo.graphQLErrors.detail', '{{message}} location: {{location}}', { message: item.message, location: item.location }),\r\n error: error,\r\n }));\r\n }\r\n\r\n // Return the error.\r\n return { message, error };\r\n },\r\n\r\n // Convert error messages from the Account REST API to make them translatable.\r\n // Note that the original messages are friendly enough so we just use those for English but pass them for translation.\r\n (error) => {\r\n switch (error?.message) {\r\n // General messages used by multiple actions in the API.\r\n case 'This email does not have an account here.':\r\n return i18next.t('error.accountApi.common.NoAccountHere', 'This email does not have an account here.');\r\n case 'This account is not allowed to use this site.':\r\n return i18next.t('error.accountApi.common.notAllowed', 'This account is not allowed to use this site.');\r\n case '\"This account has been locked out, please try again later.':\r\n return i18next.t('error.accountApi.common.lockedOut', '\"This account has been locked out, please try again later.');\r\n case 'This email is already registered.':\r\n return i18next.t('error.accountApi.common.alreadyRegistered', 'This email is already registered.');\r\n case 'Unknown user':\r\n return i18next.t('error.accountApi.common.unknownUser', 'Unknown user');\r\n\r\n // Specific messages that are only used by individual actions.\r\n // Login\r\n case 'Invalid password':\r\n return i18next.t('error.accountApi.login.invalidPassword', 'Invalid password');\r\n // CreateAccountForExternalLogin\r\n case 'Error loading external login information during confirmation.':\r\n return i18next.t('error.accountApi.createAccountForExternalLogin', 'Error loading external login information during confirmation.');\r\n // CompleteExternalLogin\r\n case 'Error loading external login information.':\r\n return i18next.t('error.accountApi.completeExternalLogin.errorLoadingExternalLoginInformation', 'Error loading external login information.');\r\n // SendPasswordResetModel\r\n case 'This email has not been confirmed, so we can\\'t send a password reset until it has been confirmed.':\r\n return i18next.t('error.accountApi.', 'This email has not been confirmed, so we can\\'t send a password reset until it has been confirmed.');\r\n // ConfirmEmail\r\n case 'Error confirming your email.':\r\n return i18next.t('error.accountApi.confirmEmail.errorConfirmingEmail', 'Error confirming your email.');\r\n // ConfirmEmailChange\r\n case 'Error changing email.':\r\n return i18next.t('error.accountApi.errorChangingEmail', 'Error changing email.');\r\n // ConfirmInvite\r\n case 'This email has not been invited.':\r\n return i18next.t('error.accountApi.confirmInvite.notInvited', 'This email has not been invited.');\r\n case 'This invite has already been accepted.':\r\n return i18next.t('error.accountApi.confirmInvite.alreadyAccepted', 'This invite has already been accepted.');\r\n // Lockout\r\n case 'Error setting lockout for user':\r\n return i18next.t('error.accountApi.lockout.errorSettingLockout', 'Error setting lockout for user');\r\n default:\r\n break;\r\n }\r\n\r\n // Handle external authentication provider errors (from CompleteExternalLogin) by passing on the error with a chance to translate the prefix.\r\n if (error?.message?.indexOf('Error from external provider: ') === 0) {\r\n const externalProviderError = error.message.subStr(30);\r\n return i18next.t('error.accountApi.completeExternalLogin.externalProviderError', 'Error from external provider: {{error}}', { error: externalProviderError });\r\n }\r\n\r\n return null;\r\n },\r\n\r\n //(error) => {\r\n // // If we are in debug mode, log any error messages we get that were not made friendly.\r\n // console.debug(error);\r\n //}\r\n ]);\r\n}\r\n","// In production, we register a service worker to serve assets from local cache.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\r\n// cached resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\r\n// This link also includes instructions on opting out of this behavior.\r\n\r\n//let window: any;\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.1/8 is considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\nexport default function register() {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Lets check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl);\r\n } else {\r\n // Is not local host. Just register service worker\r\n registerValidSW(swUrl);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl: any) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker: any = registration.installing;\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the old content will have been purged and\r\n // the fresh content will have been added to the cache.\r\n // It's the perfect time to display a \"New content is\r\n // available; please refresh.\" message in your web app.\r\n console.log('New content is available; please refresh.');\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl: any) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl)\r\n .then((response: any) => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n if (\r\n response.status === 404 ||\r\n response.headers.get('content-type').indexOf('javascript') === -1\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister();\r\n });\r\n }\r\n}\r\n","import './configure/polyfill';\r\n\r\nimport * as React from 'react';\r\nimport * as ReactDOM from 'react-dom';\r\nimport { BrowserRouter } from 'react-router-dom';\r\nimport { App } from './App';\r\nimport registerServiceWorker from './registerServiceWorker';\r\n\r\nconst baseUrl = document.getElementsByTagName('base')[0].getAttribute('href') || undefined;\r\nconst rootElement = document.getElementById('root');\r\n\r\nReactDOM.render(\r\n \r\n \r\n ,\r\n rootElement);\r\n\r\nregisterServiceWorker();\r\n\r\n"],"sourceRoot":""}