File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed
site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ const OAuth2AppsSettingsPage: FC = () => {
18
18
< OAuth2AppsSettingsPageView
19
19
apps = { appsQuery . data }
20
20
isLoading = { appsQuery . isLoading }
21
+ error = { appsQuery . error }
21
22
isEntitled = {
22
23
entitlements . features . oauth2_provider . entitlement !== "not_entitled"
23
24
}
Original file line number Diff line number Diff line change @@ -16,6 +16,13 @@ export const Loading: Story = {
16
16
} ,
17
17
} ;
18
18
19
+ export const Error : Story = {
20
+ args : {
21
+ isLoading : false ,
22
+ error : "some error" ,
23
+ } ,
24
+ } ;
25
+
19
26
export const Unentitled : Story = {
20
27
args : {
21
28
isLoading : false ,
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
19
19
EnterpriseBadge ,
20
20
EntitledBadge ,
21
21
} from "components/Badges/Badges" ;
22
+ import { ErrorAlert } from "components/Alert/ErrorAlert" ;
22
23
import { TableLoader } from "components/TableLoader/TableLoader" ;
23
24
import { Stack } from "components/Stack/Stack" ;
24
25
import { useClickableTableRow } from "hooks/useClickableTableRow" ;
@@ -28,12 +29,14 @@ type OAuth2AppsSettingsProps = {
28
29
apps ?: TypesGen . OAuth2ProviderApp [ ] ;
29
30
isEntitled : boolean ;
30
31
isLoading : boolean ;
32
+ error ?: unknown ;
31
33
} ;
32
34
33
35
const OAuth2AppsSettingsPageView : FC < OAuth2AppsSettingsProps > = ( {
34
36
apps,
35
37
isEntitled,
36
38
isLoading,
39
+ error,
37
40
} ) => {
38
41
return (
39
42
< >
@@ -77,9 +80,13 @@ const OAuth2AppsSettingsPageView: FC<OAuth2AppsSettingsProps> = ({
77
80
{ ! isLoading && ( ! apps || apps ?. length === 0 ) && (
78
81
< TableRow >
79
82
< TableCell colSpan = { 999 } >
80
- < div css = { { textAlign : "center" } } >
81
- No OAuth2 applications have been configured.
82
- </ div >
83
+ { error ? (
84
+ < ErrorAlert error = { error } />
85
+ ) : (
86
+ < div css = { { textAlign : "center" } } >
87
+ No OAuth2 applications have been configured.
88
+ </ div >
89
+ ) }
83
90
</ TableCell >
84
91
</ TableRow >
85
92
) }
You can’t perform that action at this time.
0 commit comments