Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dropped deprecated critterbase signup #1373

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions app/src/components/security/RouteGuards.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ const nullAuthState = getMockAuthState({
refresh: () => {
// do nothing
}
},
critterbaseUserWrapper: {
isLoading: false,
critterbaseUserUuid: 'fakeguid'
}
}
});
Expand Down
13 changes: 1 addition & 12 deletions app/src/contexts/authStateContext.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { default as useCritterbaseUserWrapper } from 'hooks/useCritterbaseUserWrapper';
import useSimsUserWrapper, { ISimsUserWrapper } from 'hooks/useSimsUserWrapper';
import React from 'react';
import { AuthContextProps, useAuth } from 'react-oidc-context';
Expand All @@ -18,13 +17,6 @@ export interface IAuthState {
* @memberof IAuthState
*/
simsUserWrapper: ISimsUserWrapper;
/**
* THe logged in user's Critterbase user information.
*
* @type {ReturnType<typeof useCritterbaseUserWrapper>}
* @memberof IAuthState
*/
critterbaseUserWrapper: ReturnType<typeof useCritterbaseUserWrapper>;
}

export const AuthStateContext = React.createContext<IAuthState | undefined>(undefined);
Expand All @@ -46,14 +38,11 @@ export const AuthStateContextProvider: React.FC<React.PropsWithChildren> = (prop

const simsUserWrapper = useSimsUserWrapper();

const critterbaseUserWrapper = useCritterbaseUserWrapper(simsUserWrapper);

return (
<AuthStateContext.Provider
value={{
auth,
simsUserWrapper,
critterbaseUserWrapper
simsUserWrapper
}}>
{props.children}
</AuthStateContext.Provider>
Expand Down
28 changes: 0 additions & 28 deletions app/src/hooks/cb_api/useAuthenticationApi.test.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions app/src/hooks/cb_api/useAuthenticationApi.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions app/src/hooks/useCritterbaseApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useXrefApi } from 'hooks/cb_api/useXrefApi';
import { useConfigContext } from 'hooks/useContext';
import { useMemo } from 'react';
import useAxios from './api/useAxios';
import { useAuthentication } from './cb_api/useAuthenticationApi';
import { useCaptureApi } from './cb_api/useCaptureApi';
import { useCollectionUnitApi } from './cb_api/useCollectionUnitApi';
import { useCritterApi } from './cb_api/useCritterApi';
Expand All @@ -22,8 +21,6 @@ export const useCritterbaseApi = () => {

const critters = useCritterApi(apiAxios);

const authentication = useAuthentication(apiAxios);

const lookup = useLookupApi(apiAxios);

const xref = useXrefApi(apiAxios);
Expand All @@ -41,7 +38,6 @@ export const useCritterbaseApi = () => {
return useMemo(
() => ({
critters,
authentication,
lookup,
xref,
marking,
Expand Down
36 changes: 0 additions & 36 deletions app/src/hooks/useCritterbaseUserWrapper.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions app/src/test-helpers/auth-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ export const UnauthenticatedUserAuthState: IAuthState = {
refresh: () => {
// do nothing
}
},
critterbaseUserWrapper: {
isLoading: false,
critterbaseUserUuid: 'fakeguid'
}
};

Expand Down Expand Up @@ -73,10 +69,6 @@ export const SystemUserAuthState: IAuthState = {
refresh: () => {
// do nothing
}
},
critterbaseUserWrapper: {
isLoading: false,
critterbaseUserUuid: 'fakeguid'
}
};

Expand Down Expand Up @@ -113,10 +105,6 @@ export const SystemAdminAuthState: IAuthState = {
refresh: () => {
// do nothing
}
},
critterbaseUserWrapper: {
isLoading: false,
critterbaseUserUuid: 'fakeguid'
}
};

Expand Down Expand Up @@ -144,10 +132,6 @@ export const getMockAuthState = (options: { base: IAuthState; overrides?: Subset
simsUserWrapper: {
...base.simsUserWrapper,
...overrides?.simsUserWrapper
},
critterbaseUserWrapper: {
...base.simsUserWrapper,
...overrides?.critterbaseUserWrapper
}
} as unknown as IAuthState;
};