Skip to content

Commit 971036c

Browse files
chore: update PWA minor dependencies (#479)
1 parent 1ec7484 commit 971036c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1311
-1457
lines changed

pwa/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": "next/core-web-vitals"
2+
"extends": ["next/core-web-vitals"]
33
}

pwa/app/auth.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
import { type TokenSet } from "@auth/core/types";
2-
import NextAuth, { type Session as DefaultSession, type User } from "next-auth";
1+
import {type TokenSet} from "@auth/core/types";
2+
import NextAuth, {type Session as DefaultSession, type User} from "next-auth";
33
import KeycloakProvider from "next-auth/providers/keycloak";
44

5-
import { NEXT_PUBLIC_OIDC_CLIENT_ID, NEXT_PUBLIC_OIDC_SERVER_URL, NEXT_PUBLIC_OIDC_SERVER_URL_INTERNAL } from "../config/keycloak";
5+
import {
6+
NEXT_PUBLIC_OIDC_CLIENT_ID,
7+
NEXT_PUBLIC_OIDC_SERVER_URL,
8+
NEXT_PUBLIC_OIDC_SERVER_URL_INTERNAL
9+
} from "../config/keycloak";
610

711
export interface Session extends DefaultSession {
812
error?: "RefreshAccessTokenError"

pwa/app/bookmarks/page.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { type Metadata } from "next";
2-
import { redirect } from "next/navigation";
1+
import {type Metadata} from "next";
2+
import {redirect} from "next/navigation";
33

4-
import { List, type Props as ListProps } from "../../components/bookmark/List";
5-
import { type Bookmark } from "../../types/Bookmark";
6-
import { type PagedCollection } from "../../types/collection";
7-
import { type FetchResponse, fetchApi } from "../../utils/dataAccess";
8-
import { type Session, auth } from "../auth";
4+
import {List, type Props as ListProps} from "../../components/bookmark/List";
5+
import {type Bookmark} from "../../types/Bookmark";
6+
import {type PagedCollection} from "../../types/collection";
7+
import {fetchApi, type FetchResponse} from "../../utils/dataAccess";
8+
import {auth, type Session} from "../auth";
99

1010
interface Query extends URLSearchParams {
1111
page?: number|string|null;
@@ -32,7 +32,7 @@ async function getServerSideProps({ page = 1 }: Query, session: Session): Promis
3232
return { data: null, hubURL: null, page: Number(page) };
3333
}
3434

35-
export default async function Page({ searchParams }: { searchParams: Query }) {
35+
export default async function Page({ searchParams }: { searchParams: Promise<Query> }) {
3636
// @ts-ignore
3737
const session: Session|null = await auth();
3838
if (!session || session?.error === "RefreshAccessTokenError") {
@@ -41,7 +41,7 @@ export default async function Page({ searchParams }: { searchParams: Query }) {
4141
redirect("/api/auth/signin?callbackUrl=/bookmarks");
4242
}
4343

44-
const props = await getServerSideProps(searchParams, session);
44+
const props = await getServerSideProps(await searchParams, session);
4545

4646
return <List {...props}/>;
4747
}

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { type Metadata } from "next";
2-
import { notFound } from "next/navigation";
1+
import {type Metadata} from "next";
2+
import {notFound} from "next/navigation";
33

4-
import { Show, type Props as ShowProps } from "../../../../components/book/Show";
5-
import { Book } from "../../../../types/Book";
6-
import { type FetchResponse, fetchApi } from "../../../../utils/dataAccess";
7-
import { type Session, auth } from "../../../auth";
4+
import {type Props as ShowProps, Show} from "../../../../components/book/Show";
5+
import {Book} from "../../../../types/Book";
6+
import {fetchApi, type FetchResponse} from "../../../../utils/dataAccess";
7+
import {auth, type Session} from "../../../auth";
88

99
interface Props {
10-
params: { id: string };
10+
params: Promise<{ id: string }>;
1111
}
1212

1313
export async function generateMetadata({ params }: Props): Promise<Metadata|undefined> {
14-
const id = params.id;
14+
const id = (await params).id;
1515
try {
1616
const response: FetchResponse<Book> | undefined = await fetchApi(`/books/${id}`, {
1717
// next: { revalidate: 3600 },
@@ -56,7 +56,7 @@ async function getServerSideProps(id: string, session: Session|null): Promise<Sh
5656
export default async function Page({ params }: Props) {
5757
// @ts-ignore
5858
const session: Session|null = await auth();
59-
const props = await getServerSideProps(params.id, session);
59+
const props = await getServerSideProps((await params).id, session);
6060
if (!props) {
6161
notFound();
6262
}

pwa/app/books/page.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { type Metadata } from "next";
1+
import {type Metadata} from "next";
22

33
import {auth, type Session} from "../auth";
4-
import { List, type Props as ListProps } from "../../components/book/List";
5-
import { type Book } from "../../types/Book";
6-
import { type PagedCollection } from "../../types/collection";
7-
import { type FetchResponse, fetchApi } from "../../utils/dataAccess";
8-
import { type FiltersProps, buildUriFromFilters } from "../../utils/book";
4+
import {List, type Props as ListProps} from "../../components/book/List";
5+
import {type Book} from "../../types/Book";
6+
import {type PagedCollection} from "../../types/collection";
7+
import {fetchApi, type FetchResponse} from "../../utils/dataAccess";
8+
import {buildUriFromFilters, type FiltersProps} from "../../utils/book";
99

1010
interface Query extends URLSearchParams {
1111
page?: number|string|undefined;
@@ -17,7 +17,7 @@ interface Query extends URLSearchParams {
1717
}
1818

1919
interface Props {
20-
searchParams: Query;
20+
searchParams: Promise<Query>;
2121
}
2222

2323
async function getServerSideProps(query: Query, session: Session|null): Promise<ListProps> {
@@ -66,7 +66,7 @@ export const metadata: Metadata = {
6666
export default async function Page({ searchParams }: Props) {
6767
// @ts-ignore
6868
const session: Session|null = await auth();
69-
const props = await getServerSideProps(searchParams, session);
69+
const props = await getServerSideProps(await searchParams, session);
7070

7171
return <List {...props}/>;
7272
}

pwa/app/layout.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import type { Metadata } from "next";
2-
import { type ReactNode } from "react";
3-
import { SessionProvider } from "next-auth/react";
1+
import type {Metadata} from "next";
2+
import {type ReactNode} from "react";
3+
import {SessionProvider} from "next-auth/react";
44
import "@fontsource/poppins";
55
import "@fontsource/poppins/600.css";
66
import "@fontsource/poppins/700.css";
77

8-
import { Layout } from "../components/common/Layout";
8+
import {Layout} from "../components/common/Layout";
99
import "../styles/globals.css";
10-
import { Providers } from "./providers";
11-
import { auth } from "./auth";
10+
import {Providers} from "./providers";
11+
import {auth} from "./auth";
1212

1313
export const metadata: Metadata = {
1414
title: 'Welcome to API Platform!',

pwa/app/providers.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"use client";
22

3-
import { type ReactNode, useState } from "react";
4-
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
5-
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
6-
import { ReactQueryStreamedHydration } from "@tanstack/react-query-next-experimental";
3+
import {type ReactNode, useState} from "react";
4+
import {QueryClient, QueryClientProvider} from "@tanstack/react-query";
5+
import {ReactQueryDevtools} from "@tanstack/react-query-devtools";
6+
import {ReactQueryStreamedHydration} from "@tanstack/react-query-next-experimental";
77

88
export function Providers(props: { children: ReactNode }) {
99
const [queryClient] = useState(

pwa/components/admin/Admin.tsx

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
"use client";
22

33
import Head from "next/head";
4-
import { useContext, useRef, useState } from "react";
5-
import { type DataProvider, localStorageStore } from "react-admin";
6-
import { signIn, useSession } from "next-auth/react";
4+
import {useContext, useRef, useState} from "react";
5+
import {type DataProvider, localStorageStore} from "react-admin";
6+
import {signIn, useSession} from "next-auth/react";
77
import SyncLoader from "react-spinners/SyncLoader";
8-
import {
9-
fetchHydra,
10-
HydraAdmin,
11-
hydraDataProvider,
12-
OpenApiAdmin,
13-
ResourceGuesser,
14-
} from "@api-platform/admin";
15-
import { parseHydraDocumentation } from "@api-platform/api-doc-parser";
16-
17-
import { type Session } from "../../app/auth";
8+
import {fetchHydra, HydraAdmin, hydraDataProvider, OpenApiAdmin, ResourceGuesser,} from "@api-platform/admin";
9+
import {parseHydraDocumentation} from "@api-platform/api-doc-parser";
10+
11+
import {type Session} from "../../app/auth";
1812
import DocContext from "../../components/admin/DocContext";
1913
import authProvider from "../../components/admin/authProvider";
2014
import Layout from "./layout/Layout";
21-
import { ENTRYPOINT } from "../../config/entrypoint";
15+
import {ENTRYPOINT} from "../../config/entrypoint";
2216
import bookResourceProps from "./book";
2317
import reviewResourceProps from "./review";
2418
import i18nProvider from "./i18nProvider";

pwa/components/admin/DocContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createContext } from "react";
1+
import {createContext} from "react";
22

33
const DocContext = createContext({
44
docType: "hydra",

pwa/components/admin/authProvider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { AuthProvider } from "react-admin";
2-
import { getSession, signIn, signOut } from "next-auth/react";
1+
import {AuthProvider} from "react-admin";
2+
import {getSession, signIn, signOut} from "next-auth/react";
33

4-
import { NEXT_PUBLIC_OIDC_SERVER_URL } from "../../config/keycloak";
4+
import {NEXT_PUBLIC_OIDC_SERVER_URL} from "../../config/keycloak";
55

66
const authProvider: AuthProvider = {
77
// Nothing to do here, this function will never be called

0 commit comments

Comments
 (0)