Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4587ef0

Browse files
committed
Display error when fetching OAuth2 provider apps
1 parentf5a9f5c commit4587ef0

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

‎site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/OAuth2AppsSettingsPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const OAuth2AppsSettingsPage: FC = () => {
1818
<OAuth2AppsSettingsPageView
1919
apps={appsQuery.data}
2020
isLoading={appsQuery.isLoading}
21+
error={appsQuery.error}
2122
isEntitled={
2223
entitlements.features.oauth2_provider.entitlement!=="not_entitled"
2324
}

‎site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/OAuth2AppsSettingsPageView.stories.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ export const Loading: Story = {
1616
},
1717
};
1818

19+
exportconstError:Story={
20+
args:{
21+
isLoading:false,
22+
error:"some error",
23+
},
24+
};
25+
1926
exportconstUnentitled:Story={
2027
args:{
2128
isLoading:false,

‎site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/OAuth2AppsSettingsPageView.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
EnterpriseBadge,
2020
EntitledBadge,
2121
}from"components/Badges/Badges";
22+
import{ErrorAlert}from"components/Alert/ErrorAlert";
2223
import{TableLoader}from"components/TableLoader/TableLoader";
2324
import{Stack}from"components/Stack/Stack";
2425
import{useClickableTableRow}from"hooks/useClickableTableRow";
@@ -28,12 +29,14 @@ type OAuth2AppsSettingsProps = {
2829
apps?:TypesGen.OAuth2ProviderApp[];
2930
isEntitled:boolean;
3031
isLoading:boolean;
32+
error?:unknown;
3133
};
3234

3335
constOAuth2AppsSettingsPageView:FC<OAuth2AppsSettingsProps>=({
3436
apps,
3537
isEntitled,
3638
isLoading,
39+
error,
3740
})=>{
3841
return(
3942
<>
@@ -77,9 +80,13 @@ const OAuth2AppsSettingsPageView: FC<OAuth2AppsSettingsProps> = ({
7780
{!isLoading&&(!apps||apps?.length===0)&&(
7881
<TableRow>
7982
<TableCellcolSpan={999}>
80-
<divcss={{textAlign:"center"}}>
81-
No OAuth2 applications have been configured.
82-
</div>
83+
{error ?(
84+
<ErrorAlerterror={error}/>
85+
) :(
86+
<divcss={{textAlign:"center"}}>
87+
No OAuth2 applications have been configured.
88+
</div>
89+
)}
8390
</TableCell>
8491
</TableRow>
8592
)}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp