From 342491934f4bcfccf251bbd92cf63d9abcf53d6e Mon Sep 17 00:00:00 2001 From: Asher Date: Fri, 12 Jan 2024 11:54:58 -0900 Subject: [PATCH 1/2] Display error when fetching OAuth2 provider apps --- .../OAuth2AppsSettingsPage/OAuth2AppsSettingsPage.tsx | 1 + .../OAuth2AppsSettingsPageView.stories.tsx | 7 +++++++ .../OAuth2AppsSettingsPageView.tsx | 10 +++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/OAuth2AppsSettingsPage.tsx b/site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/OAuth2AppsSettingsPage.tsx index 6e2035f2f9107..4d81d7dfb5f13 100644 --- a/site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/OAuth2AppsSettingsPage.tsx +++ b/site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/OAuth2AppsSettingsPage.tsx @@ -18,6 +18,7 @@ const OAuth2AppsSettingsPage: FC = () => { = ({ apps, isEntitled, isLoading, + error, }) => { return ( <> @@ -62,6 +65,8 @@ const OAuth2AppsSettingsPageView: FC = ({ + {error && } + @@ -72,9 +77,8 @@ const OAuth2AppsSettingsPageView: FC = ({ {isLoading && } - {!isLoading && - apps?.map((app) => )} - {!isLoading && (!apps || apps?.length === 0) && ( + {apps?.map((app) => )} + {apps?.length === 0 && (
From f865f9149688c6c5ac6d5c54c9415ce4872d2074 Mon Sep 17 00:00:00 2001 From: Asher Date: Mon, 22 Jan 2024 09:21:08 -0900 Subject: [PATCH 2/2] No undefined error --- .../OAuth2AppsSettingsPage/OAuth2AppsSettingsPageView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/OAuth2AppsSettingsPageView.tsx b/site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/OAuth2AppsSettingsPageView.tsx index 75c3413f242f2..39f1ad6e30d35 100644 --- a/site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/OAuth2AppsSettingsPageView.tsx +++ b/site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/OAuth2AppsSettingsPageView.tsx @@ -29,7 +29,7 @@ type OAuth2AppsSettingsProps = { apps?: TypesGen.OAuth2ProviderApp[]; isEntitled: boolean; isLoading: boolean; - error?: unknown; + error: unknown; }; const OAuth2AppsSettingsPageView: FC = ({