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

fix: display error when fetching OAuth2 provider apps#11713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
code-asher merged 2 commits intomainfromasher/display-oauth2-app/error
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,7 @@ const OAuth2AppsSettingsPage: FC = () => {
<OAuth2AppsSettingsPageView
apps={appsQuery.data}
isLoading={appsQuery.isLoading}
error={appsQuery.error}
isEntitled={
entitlements.features.oauth2_provider.entitlement !== "not_entitled"
}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,6 +16,13 @@ export const Loading: Story = {
},
};

export const Error: Story = {
args: {
isLoading: false,
error: "some error",
},
};

export const Unentitled: Story = {
args: {
isLoading: false,
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,6 +19,7 @@ import {
EnterpriseBadge,
EntitledBadge,
} from "components/Badges/Badges";
import { ErrorAlert } from "components/Alert/ErrorAlert";
import { TableLoader } from "components/TableLoader/TableLoader";
import { Stack } from "components/Stack/Stack";
import { useClickableTableRow } from "hooks/useClickableTableRow";
Expand All@@ -28,12 +29,14 @@ type OAuth2AppsSettingsProps = {
apps?: TypesGen.OAuth2ProviderApp[];
isEntitled: boolean;
isLoading: boolean;
error: unknown;
};

const OAuth2AppsSettingsPageView: FC<OAuth2AppsSettingsProps> = ({
apps,
isEntitled,
isLoading,
error,
}) => {
return (
<>
Expand DownExpand Up@@ -62,6 +65,8 @@ const OAuth2AppsSettingsPageView: FC<OAuth2AppsSettingsProps> = ({
</Button>
</Stack>

{error && <ErrorAlert error={error} />}

<TableContainer css={{ marginTop: 32 }}>
<Table>
<TableHead>
Expand All@@ -72,9 +77,8 @@ const OAuth2AppsSettingsPageView: FC<OAuth2AppsSettingsProps> = ({
</TableHead>
<TableBody>
{isLoading && <TableLoader />}
{!isLoading &&
apps?.map((app) => <OAuth2AppRow key={app.id} app={app} />)}
{!isLoading && (!apps || apps?.length === 0) && (
{apps?.map((app) => <OAuth2AppRow key={app.id} app={app} />)}
{apps?.length === 0 && (
<TableRow>
<TableCell colSpan={999}>
<div css={{ textAlign: "center" }}>
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp