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

893 upgrade client dependencies reopened #1028

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6f8e566
Update packages to latest and fix broken test
atomicgamedeveloper Sep 24, 2024
8449592
Update eslint
atomicgamedeveloper Sep 25, 2024
bd99735
Fix new eslint issues
atomicgamedeveloper Sep 25, 2024
31f6035
Eslint fixes: add img alt text and missing useEffect dependency
atomicgamedeveloper Sep 25, 2024
d5fa623
Install @babel/plugin-proposal-private-property-in-object
atomicgamedeveloper Sep 25, 2024
60d77fb
Fix formatting
atomicgamedeveloper Oct 1, 2024
59d3161
Change function names to camel case
atomicgamedeveloper Oct 1, 2024
6b9d83d
Match upgrades in yarn and package.json
atomicgamedeveloper Oct 1, 2024
191a67a
Eslint fixes: Turn getAndSetUsername and signOut into hooks
atomicgamedeveloper Oct 2, 2024
0a0f7d6
Format correctly
atomicgamedeveloper Oct 2, 2024
606eea9
Fix warnings when installing packages
atomicgamedeveloper Oct 2, 2024
cdc0359
Upgrade mui and emotion packages to latest
atomicgamedeveloper Oct 2, 2024
ef87ca9
Refactor useSignOut
atomicgamedeveloper Oct 2, 2024
abd141b
Rename Hooks hook into useSetupMiniDrawer
atomicgamedeveloper Oct 2, 2024
ff4e0f2
Add Windows as OS in client.yml
atomicgamedeveloper Oct 8, 2024
c47a776
Upgrade all client dependencies to latest
atomicgamedeveloper Oct 8, 2024
e9a5a0b
Downgrade typescript for Eslint
atomicgamedeveloper Oct 9, 2024
fcf744a
Manual merge
atomicgamedeveloper Oct 9, 2024
65547d1
Downgrade Typescript to 5.1.6, fix new eslint issues
atomicgamedeveloper Oct 11, 2024
be13430
Fix broken preview unit tests
atomicgamedeveloper Oct 16, 2024
feeb415
Fix broken preview int tests
atomicgamedeveloper Oct 16, 2024
b2621e2
Add network timeout to yarn install in client.yml
atomicgamedeveloper Oct 16, 2024
21f4956
Add OS check for playwright report name
atomicgamedeveloper Oct 16, 2024
076eae4
Refactor store in preview tests
atomicgamedeveloper Oct 16, 2024
73a5eab
Add ignore pattern for unused errors and upgrade jest-dom
atomicgamedeveloper Oct 18, 2024
44746e9
Add changes made to yarn.lock
atomicgamedeveloper Oct 18, 2024
0103a9c
Fix broken preview tests
atomicgamedeveloper Oct 23, 2024
c8ea46c
Update packages to latest and fix broken test
atomicgamedeveloper Sep 24, 2024
d87b1b0
Update eslint
atomicgamedeveloper Sep 25, 2024
231c5ca
Fix new eslint issues
atomicgamedeveloper Sep 25, 2024
4af828d
Install @babel/plugin-proposal-private-property-in-object
atomicgamedeveloper Sep 25, 2024
91cb4e7
Change function names to camel case
atomicgamedeveloper Oct 1, 2024
118e92e
Match upgrades in yarn and package.json
atomicgamedeveloper Oct 1, 2024
e9e9d06
Eslint fixes: Turn getAndSetUsername and signOut into hooks
atomicgamedeveloper Oct 2, 2024
2cc1baf
Format correctly
atomicgamedeveloper Oct 2, 2024
8fe3a44
Resolve packages with yarn rather than npm
atomicgamedeveloper Oct 2, 2024
2c5d085
Upgrade mui and emotion packages to latest
atomicgamedeveloper Oct 2, 2024
0bc4e2d
Upgrade all client dependencies to latest
atomicgamedeveloper Oct 8, 2024
8769b40
Downgrade typescript for Eslint
atomicgamedeveloper Oct 9, 2024
d9a7562
Downgrade Typescript to 5.1.6, fix new eslint issues
atomicgamedeveloper Oct 11, 2024
037e832
Fix broken preview unit tests
atomicgamedeveloper Oct 16, 2024
5ff6a89
Fix broken preview int tests
atomicgamedeveloper Oct 16, 2024
f8c8a52
Add ignore pattern for unused errors and upgrade jest-dom
atomicgamedeveloper Oct 18, 2024
8d1bf2b
Add changes made to yarn.lock
atomicgamedeveloper Oct 18, 2024
53f7db7
Fix broken preview tests
atomicgamedeveloper Oct 23, 2024
6a49ee5
Format and add 1 local retry to inconsistent e2e tests
atomicgamedeveloper Oct 30, 2024
680c487
Remove extra error string
atomicgamedeveloper Nov 1, 2024
05f53e7
Update test.js
atomicgamedeveloper Nov 1, 2024
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
Prev Previous commit
Next Next commit
Change function names to camel case
  • Loading branch information
atomicgamedeveloper committed Nov 1, 2024
commit 59d3161e22c09c0d4c0d6a90db495affe0e4f2b7
4 changes: 2 additions & 2 deletions client/src/page/MenuToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Box from '@mui/material/Box';
import { useAuth } from 'react-oidc-context';
import LinkButtons from 'components/LinkButtons';
import toolbarLinkValues from 'util/toolbarUtil';
import { SignOut } from 'util/auth/Authentication';
import { signOut } from 'util/auth/Authentication';

interface AppBarProps extends MuiAppBarProps {
open?: boolean;
Expand Down Expand Up @@ -68,7 +68,7 @@ function MenuToolbar({

const handleSignOut = async () => {
if (auth) {
await SignOut(auth);
await signOut(auth);
}
};
return (
Expand Down
4 changes: 2 additions & 2 deletions client/src/route/library/Library.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Iframe from 'components/Iframe';
import { useURLforLIB } from 'util/envUtil';
import { Typography } from '@mui/material';
import { useAuth } from 'react-oidc-context';
import { GetAndSetUsername } from 'util/auth/Authentication';
import { getAndSetUsername } from 'util/auth/Authentication';
import { assetType, scope } from './LibraryTabData';

export function createTabs() {
Expand Down Expand Up @@ -38,7 +38,7 @@ export function createCombinedTabs() {

function LibraryContent() {
const auth = useAuth();
GetAndSetUsername(auth);
getAndSetUsername(auth);

const tabsData = createTabs();

Expand Down
4 changes: 2 additions & 2 deletions client/src/util/auth/Authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface CustomAuthContext {
user?: User | null | undefined;
}

export function GetAndSetUsername(auth: CustomAuthContext) {
export function getAndSetUsername(auth: CustomAuthContext) {
const dispatch = useDispatch();
if (auth.user !== null && auth.user !== undefined) {
const profileUrl = auth.user.profile.profile ?? '';
Expand All @@ -22,7 +22,7 @@ export function GetAndSetUsername(auth: CustomAuthContext) {
}
}

export async function SignOut(auth: AuthContextProps) {
export async function signOut(auth: AuthContextProps) {
const APP_URL = cleanURL(useAppURL());
if (!auth.user) {
return;
Expand Down
2 changes: 1 addition & 1 deletion client/test/integration/Auth/authRedux.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { mockUser } from 'test/__mocks__/global_mocks';
import { renderWithRouter } from 'test/unit/unit.testUtil';

jest.mock('util/auth/Authentication', () => ({
GetAndSetUsername: jest.fn(),
getAndSetUsername: jest.fn(),
}));

jest.mock('react-redux', () => ({
Expand Down
18 changes: 9 additions & 9 deletions client/test/unit/util/Auth/Authentication.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SignOut } from 'util/auth/Authentication';
import { signOut } from 'util/auth/Authentication';
import { useAuth } from 'react-oidc-context';
import { getLogoutRedirectURI, useAppURL, cleanURL } from 'util/envUtil';

Expand Down Expand Up @@ -80,7 +80,7 @@ describe('signOut', () => {

it('expires _xsrf cookie', async () => {
const auth = useAuth();
await SignOut(auth);
await signOut(auth);

expect(window.document.cookie).toBe(
'_xsrf=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;',
Expand All @@ -91,15 +91,15 @@ describe('signOut', () => {
const auth = useAuth();
auth.user = null;

const signOutResult = await SignOut(auth);
const signOutResult = await signOut(auth);

expect(signOutResult).toBeUndefined();
expect(mockSignoutRedirect).not.toHaveBeenCalled();
});

it('signsOutRedirect, clearStaleState, removeTokens and removeUer if user is authorized', async () => {
const auth = useAuth();
await SignOut(auth);
await signOut(auth);
expect(useAppURL).toHaveBeenCalled();
expect(cleanURL).toHaveBeenCalled();
expect(mockSignoutRedirect).toHaveBeenCalled();
Expand All @@ -111,7 +111,7 @@ describe('signOut', () => {
it('fetches the URI from window.env', async () => {
const auth = useAuth();
const fetchBody = { signal: AbortSignal.timeout(30000) };
await SignOut(auth);
await signOut(auth);
expect(global.fetch).toHaveBeenCalledWith(
'https://foo.com/_oauth/logout',
fetchBody,
Expand All @@ -121,7 +121,7 @@ describe('signOut', () => {
it('throws an error if fetch rejects', async () => {
const auth = useAuth();
global.fetch = jest.fn().mockRejectedValueOnce('foo');
await expect(SignOut(auth)).rejects.toThrow(
await expect(signOut(auth)).rejects.toThrow(
Error('Error occurred during logout: foo'),
);
});
Expand All @@ -131,21 +131,21 @@ describe('signOut', () => {
auth.signoutRedirect = jest
.fn()
.mockRejectedValueOnce(new Error('signoutRedirect rejected'));
await expect(SignOut(auth)).rejects.toThrow(
await expect(signOut(auth)).rejects.toThrow(
Error('Error occurred during logout: Error: signoutRedirect rejected'),
);
});

it('reloads the page', async () => {
const auth = useAuth();
await SignOut(auth);
await signOut(auth);
jest.advanceTimersByTime(3000);
expect(window.location.reload).toHaveBeenCalled();
});

it('clears sessionStorage', async () => {
const auth = useAuth();
await SignOut(auth);
await signOut(auth);

expect(mockClear).toHaveBeenCalled();
});
Expand Down