File tree 3 files changed +15
-3
lines changed
site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage
3 files changed +15
-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
< >
@@ -62,6 +65,8 @@ const OAuth2AppsSettingsPageView: FC<OAuth2AppsSettingsProps> = ({
62
65
</ Button >
63
66
</ Stack >
64
67
68
+ { error && < ErrorAlert error = { error } /> }
69
+
65
70
< TableContainer css = { { marginTop : 32 } } >
66
71
< Table >
67
72
< TableHead >
@@ -72,9 +77,8 @@ const OAuth2AppsSettingsPageView: FC<OAuth2AppsSettingsProps> = ({
72
77
</ TableHead >
73
78
< TableBody >
74
79
{ isLoading && < TableLoader /> }
75
- { ! isLoading &&
76
- apps ?. map ( ( app ) => < OAuth2AppRow key = { app . id } app = { app } /> ) }
77
- { ! isLoading && ( ! apps || apps ?. length === 0 ) && (
80
+ { apps ?. map ( ( app ) => < OAuth2AppRow key = { app . id } app = { app } /> ) }
81
+ { apps ?. length === 0 && (
78
82
< TableRow >
79
83
< TableCell colSpan = { 999 } >
80
84
< div css = { { textAlign : "center" } } >
You can’t perform that action at this time.
0 commit comments