Skip to content

Commit 43892aa

Browse files
chore: bump pwa dependencies (#584)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Vincent Chalamon <407859+vincentchalamon@users.noreply.github.com>
1 parent e8865d8 commit 43892aa

37 files changed

+1567
-2464
lines changed

pwa/.eslintrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

pwa/app/auth.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface Account {
3232

3333
export const { handlers: { GET, POST }, auth } = NextAuth({
3434
callbacks: {
35-
// @ts-ignore
35+
// @ts-expect-error Ignore Eslint error
3636
async jwt({ token, account }: { token: JWT, account: Account }): Promise<JWT> {
3737
if (account) {
3838
// Save the access token and refresh token in the JWT on the initial login
@@ -65,11 +65,11 @@ export const { handlers: { GET, POST }, auth } = NextAuth({
6565

6666
return {
6767
...token, // Keep the previous token properties
68-
// @ts-ignore
68+
// @ts-expect-error Ignore Eslint error
6969
accessToken: tokens.access_token,
70-
// @ts-ignore
70+
// @ts-expect-error Ignore Eslint error
7171
idToken: tokens.id_token,
72-
// @ts-ignore
72+
// @ts-expect-error Ignore Eslint error
7373
expiresAt: Math.floor(Date.now() / 1000 + tokens.expires_at),
7474
// Fall back to old refresh token, but note that
7575
// many providers may only allow using a refresh token once.
@@ -85,7 +85,7 @@ export const { handlers: { GET, POST }, auth } = NextAuth({
8585
}
8686
}
8787
},
88-
// @ts-ignore
88+
// @ts-expect-error Ignore Eslint error
8989
async session({ session, token }: { session: Session, token: JWT }): Promise<Session> {
9090
// Save the access token in the Session for API calls
9191
if (token) {
@@ -105,7 +105,6 @@ export const { handlers: { GET, POST }, auth } = NextAuth({
105105

106106
// user information will be extracted from the `id_token` claims, instead of making a request to the `userinfo` endpoint
107107
// https://next-auth.js.org/configuration/providers/oauth
108-
// @ts-ignore
109108
idToken: true,
110109

111110
// https://github.com/nextauthjs/next-auth/issues/685#issuecomment-785212676

pwa/app/bookmarks/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async function getServerSideProps({ page = 1 }: Query, session: Session): Promis
3333
}
3434

3535
export default async function Page({ searchParams }: { searchParams: Promise<Query> }) {
36-
// @ts-ignore
36+
// @ts-expect-error Ignore Eslint error
3737
const session: Session|null = await auth();
3838
if (!session || session?.error === "RefreshAccessTokenError") {
3939
// todo find a way to redirect directly to keycloak from here

pwa/app/books/[id]/[slug]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async function getServerSideProps(id: string, session: Session|null): Promise<Sh
5454
}
5555

5656
export default async function Page({ params }: Props) {
57-
// @ts-ignore
57+
// @ts-expect-error Ignore Eslint error
5858
const session: Session|null = await auth();
5959
const props = await getServerSideProps((await params).id, session);
6060
if (!props) {

pwa/app/books/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const metadata: Metadata = {
6464
title: 'Books Store',
6565
}
6666
export default async function Page({ searchParams }: Props) {
67-
// @ts-ignore
67+
// @ts-expect-error Ignore Eslint error
6868
const session: Session|null = await auth();
6969
const props = await getServerSideProps(await searchParams, session);
7070

pwa/components/admin/Admin.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const apiDocumentationParser = (session: Session) => async () => {
2525
},
2626
});
2727
} catch (result) {
28-
// @ts-ignore
28+
// @ts-expect-error Ignore Eslint error
2929
const { api, response, status } = result;
3030
if (status !== 401 || !response) {
3131
throw result;
@@ -46,7 +46,7 @@ const AdminAdapter = ({
4646
session: Session;
4747
children?: React.ReactNode | undefined;
4848
}) => {
49-
// @ts-ignore
49+
// @ts-expect-error Ignore Eslint error
5050
const dataProvider = useRef<DataProvider>();
5151
const { docType } = useContext(DocContext);
5252

@@ -66,7 +66,7 @@ const AdminAdapter = ({
6666
<HydraAdmin
6767
requireAuth
6868
authProvider={authProvider}
69-
// @ts-ignore
69+
// @ts-expect-error Ignore Eslint error
7070
dataProvider={dataProvider.current}
7171
entrypoint={window.origin}
7272
i18nProvider={i18nProvider}
@@ -78,7 +78,7 @@ const AdminAdapter = ({
7878
<OpenApiAdmin
7979
requireAuth
8080
authProvider={authProvider}
81-
// @ts-ignore
81+
// @ts-expect-error Ignore Eslint error
8282
dataProvider={dataProvider.current}
8383
entrypoint={window.origin}
8484
docEntrypoint={`${window.origin}/docs.json`}
@@ -98,6 +98,7 @@ const AdminWithContext = ({ session }: { session: Session }) => {
9898
);
9999

100100
return (
101+
// @ts-expect-error Ignore Eslint error
101102
<DocContext.Provider value={{ docType, setDocType }}>
102103
<AdminAdapter session={session}>
103104
<ResourceGuesser name="admin/books" {...bookResourceProps} />
@@ -115,14 +116,14 @@ const AdminWithOIDC = () => {
115116
return <SyncLoader size={8} color="#46B6BF" />;
116117
}
117118

118-
// @ts-ignore
119+
// @ts-expect-error Ignore Eslint error
119120
if (!session || session?.error === "RefreshAccessTokenError") {
120121
(async () => await signIn("keycloak"))();
121122

122123
return;
123124
}
124125

125-
// @ts-ignore
126+
// @ts-expect-error Ignore Eslint error
126127
return <AdminWithContext session={session} />;
127128
};
128129

@@ -132,7 +133,6 @@ const Admin = () => (
132133
<title>API Platform Admin</title>
133134
</Head>
134135

135-
{/*@ts-ignore*/}
136136
<AdminWithOIDC />
137137
</>
138138
);

pwa/components/admin/authProvider.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ const authProvider: AuthProvider = {
1313
}
1414

1515
await signOut({
16-
// @ts-ignore
16+
// @ts-expect-error Ignore Eslint error
1717
callbackUrl: `${NEXT_PUBLIC_OIDC_SERVER_URL}/protocol/openid-connect/logout?id_token_hint=${session.idToken}&post_logout_redirect_uri=${window.location.origin}`,
1818
});
1919
},
2020
checkError: async (error) => {
2121
const session = getSession();
2222
const status = error.status;
23-
// @ts-ignore
23+
// @ts-expect-error Ignore Eslint error
2424
if (!session || session?.error === "RefreshAccessTokenError" || status === 401) {
2525
await signIn("keycloak");
2626

@@ -33,7 +33,7 @@ const authProvider: AuthProvider = {
3333
},
3434
checkAuth: async () => {
3535
const session = getSession();
36-
// @ts-ignore
36+
// @ts-expect-error Ignore Eslint error
3737
if (!session || session?.error === "RefreshAccessTokenError") {
3838
await signIn("keycloak");
3939

@@ -46,7 +46,7 @@ const authProvider: AuthProvider = {
4646
getIdentity: async () => {
4747
const session = getSession();
4848

49-
// @ts-ignore
49+
// @ts-expect-error Ignore Eslint error
5050
return session ? Promise.resolve(session.user) : Promise.reject();
5151
},
5252
// Nothing to do here, this function will never be called

pwa/components/admin/book/BookInput.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,10 @@ const fetchOpenLibrarySearch = async (
5353
})
5454
.map(({ title, author_name, seed }): Result => {
5555
return {
56-
// @ts-ignore
56+
// @ts-expect-error Ignore Eslint error
5757
title,
58-
// @ts-ignore
58+
// @ts-expect-error Ignore Eslint error
5959
author: author_name[0],
60-
// @ts-ignore
6160
value: `https://openlibrary.org${
6261
seed?.filter((seed) => seed.match(/^\/books\/OL\d{7}M/))[0]
6362
}.json`,
@@ -99,11 +98,10 @@ const fetchGutendexSearch = async (
9998
})
10099
.map(({ id, title, authors }): Result => {
101100
return {
102-
// @ts-ignore
101+
// @ts-expect-error Ignore Eslint error
103102
title,
104-
// @ts-ignore
103+
// @ts-expect-error Ignore Eslint error
105104
author: authors[0].name,
106-
// @ts-ignore
107105
value: `https://gutendex.com/books/${id}.json`,
108106
};
109107
});

pwa/components/admin/book/BooksEdit.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ import {TopToolbar} from "react-admin";
44
import {BookForm} from "./BookForm";
55
import {ShowButton} from "./ShowButton";
66

7-
// @ts-ignore
87
const Actions = () => (
98
<TopToolbar>
109
<ShowButton />
1110
</TopToolbar>
1211
);
1312
export const BooksEdit = () => (
14-
// @ts-ignore
1513
<EditGuesser title="Edit book" actions={<Actions />}>
1614
<BookForm />
1715
</EditGuesser>

pwa/components/admin/book/ShowButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const ShowButton = () => {
99
return record ? (
1010
<Button
1111
label="ra.action.show"
12-
// @ts-ignore
12+
// @ts-expect-error Ignore Eslint error
1313
target="_blank"
1414
href={getItemPath(
1515
{

0 commit comments

Comments
 (0)