Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bda6d75

Browse files
committed
🧹
1 parent e768bcd commit bda6d75

File tree

5 files changed

+23
-11
lines changed

5 files changed

+23
-11
lines changed

‎site/src/components/Alert/Alert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const Alert: FC<AlertProps> = ({
5252
size="small"
5353
onClick={() => {
5454
setOpen(false);
55-
onDismiss && onDismiss();
55+
onDismiss?.();
5656
}}
5757
data-testid="dismiss-banner-btn"
5858
>

‎site/src/pages/ManagementSettingsPage/CreateOrganizationPage.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { ErrorAlert } from "components/Alert/ErrorAlert";
66
import { displaySuccess } from "components/GlobalSnackbar/utils";
77
import { Stack } from "components/Stack/Stack";
88
import { CreateOrganizationPageView } from "./CreateOrganizationPageView";
9+
import { isApiValidationError } from "api/errors";
910

1011
const CreateOrganizationPage: FC = () => {
1112
const navigate = useNavigate();
@@ -19,13 +20,15 @@ const CreateOrganizationPage: FC = () => {
1920

2021
return (
2122
<Stack>
22-
{Boolean(error) && <ErrorAlert error={error} />}
23+
{Boolean(error) && !isApiValidationError(error) && (
24+
<ErrorAlert error={error} />
25+
)}
2326

2427
<CreateOrganizationPageView
2528
error={error}
2629
onSubmit={async (values) => {
2730
await createOrganizationMutation.mutateAsync(values);
28-
displaySuccess("Organization settings updated.");
31+
displaySuccess("Organization created.");
2932
navigate(`/organizations/${values.name}`);
3033
}}
3134
/>

‎site/src/pages/ManagementSettingsPage/OrganizationSettingsPage.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import {
55
updateOrganization,
66
deleteOrganization,
77
} from "api/queries/organizations";
8+
import { isApiValidationError } from "api/errors";
89
import { ErrorAlert } from "components/Alert/ErrorAlert";
910
import { displaySuccess } from "components/GlobalSnackbar/utils";
1011
import { Stack } from "components/Stack/Stack";
1112
import { useOrganizationSettings } from "./ManagementSettingsLayout";
1213
import { OrganizationSettingsPageView } from "./OrganizationSettingsPageView";
14+
import { EmptyState } from "components/EmptyState/EmptyState";
1315

1416
const OrganizationSettingsPage: FC = () => {
1517
const navigate = useNavigate();
@@ -29,17 +31,15 @@ const OrganizationSettingsPage: FC = () => {
2931
const error =
3032
updateOrganizationMutation.error ?? deleteOrganizationMutation.error;
3133

32-
if (!currentOrganizationId) {
33-
return null;
34-
}
35-
36-
if (!org) {
37-
return null;
34+
if (!currentOrganizationId || !org) {
35+
return <EmptyState message="Organization not found" />;
3836
}
3937

4038
return (
4139
<Stack>
42-
{Boolean(error) && <ErrorAlert error={error} />}
40+
{Boolean(error) && !isApiValidationError(error) && (
41+
<ErrorAlert error={error} />
42+
)}
4343

4444
<OrganizationSettingsPageView
4545
organization={org}

‎site/src/pages/ManagementSettingsPage/Sidebar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ const DeploymentSettingsNavigation: FC = () => {
5656
<SidebarNavItem
5757
active={active}
5858
href="/deployment/general"
59-
icon={<SettingsIcon css={{ width: 16, height: 16 }} />}
59+
// 24px matches the width of the organization icons, and the component is smart enough
60+
// to keep the icon itself square. It looks too big if it's 24x24.
61+
icon={<SettingsIcon css={{ width: 24, height: 20 }} />}
6062
>
6163
Deployment
6264
</SidebarNavItem>

‎site/src/theme/mui.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ export const components = {
4646
::placeholder {
4747
color: ${theme.palette.text.disabled};
4848
}
49+
50+
fieldset {
51+
border: unset;
52+
padding: 0;
53+
margin: 0;
54+
width: 100%;
55+
}
4956
`,
5057
},
5158
MuiAvatar: {

0 commit comments

Comments
 (0)