Skip to content

Commit

Permalink
Merge branch 'dev' into bugFix-sign-id
Browse files Browse the repository at this point in the history
  • Loading branch information
mauberti-bc authored Sep 24, 2024
2 parents d98fa07 + abdc539 commit bbe006d
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 127 deletions.
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;
};

0 comments on commit bbe006d

Please sign in to comment.