Skip to content

Commit 07b2241

Browse files
committed
pr comments
1 parent 9de069f commit 07b2241

File tree

4 files changed

+33
-24
lines changed

4 files changed

+33
-24
lines changed

site/src/components/Form/Form.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const VerticalForm: FC<HTMLProps<HTMLFormElement>> = ({
7070
export const FormSection: FC<
7171
PropsWithChildren & {
7272
title: string | JSX.Element;
73-
description: string | JSX.Element | undefined;
73+
description: string | JSX.Element;
7474
classes?: {
7575
root?: string;
7676
sectionInfo?: string;

site/src/pages/HealthPage/Content.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export const Pill = forwardRef<HTMLDivElement, PillProps>((props, ref) => {
170170
border: `1px solid ${theme.palette.divider}`,
171171
fontSize: 12,
172172
fontWeight: 500,
173-
padding: "8px 8px 8px 8px",
173+
padding: 8,
174174
gap: 8,
175175
cursor: "default",
176176
}}

site/src/pages/HealthPage/ProvisionerDaemonsPage.tsx

+30-19
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import SwapHoriz from "@mui/icons-material/SwapHoriz";
2222
import Tooltip from "@mui/material/Tooltip";
2323
import Sell from "@mui/icons-material/Sell";
2424
import { FC } from "react";
25-
import { additionalTags } from "utils/provisionertags";
2625
import CloseIcon from '@mui/icons-material/Close';
2726
import IconButton from "@mui/material/IconButton";
2827

@@ -62,7 +61,15 @@ export const ProvisionerDaemonsPage = () => {
6261
const daemonScope = daemon.tags["scope"] || "organization";
6362
const iconScope =
6463
daemonScope === "organization" ? <Business /> : <Person />;
65-
const extraTags = additionalTags(daemon.tags)
64+
const extraTags = Object.keys(daemon.tags)
65+
.filter((key) => key !== "scope" && key !== "owner")
66+
.reduce(
67+
(acc, key) => {
68+
acc[key] = daemon.tags[key];
69+
return acc;
70+
},
71+
{} as Record<string, string>,
72+
);
6673
const isWarning = warnings.length > 0;
6774
return (
6875
<div
@@ -193,25 +200,29 @@ interface ProvisionerTagProps {
193200
export const ProvisionerTag : FC<ProvisionerTagProps> = ({ k, v, onDelete}) => {
194201
const { valid, value: boolValue } = parseBool(v);
195202
const kv = `${k}: ${v}`;
196-
const content = (
203+
const content = onDelete ? (
197204
<>
198-
{onDelete ? (
199-
<>
200-
{kv}
201-
<IconButton aria-label="delete" size="small" color="secondary" onClick={() => {
202-
onDelete(k)
203-
}}>
204-
<CloseIcon fontSize="inherit" css={{
205-
width: 14,
206-
height: 14,
207-
}}/>
208-
</IconButton>
209-
</>
210-
) : (
211-
<>{kv}</>
212-
)}
205+
{kv}
206+
<IconButton
207+
aria-label="delete"
208+
size="small"
209+
color="secondary"
210+
onClick={() => {
211+
onDelete(k);
212+
}}
213+
>
214+
<CloseIcon
215+
fontSize="inherit"
216+
css={{
217+
width: 14,
218+
height: 14,
219+
}}
220+
/>
221+
</IconButton>
213222
</>
214-
)
223+
) : (
224+
kv
225+
);
215226
if (valid) {
216227
return <BooleanPill value={boolValue}>{content}</BooleanPill>;
217228
}

site/src/pages/TemplateVersionEditorPage/ProvisionerTagsPopover.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,9 @@ export const ProviderTagsPopover: FC<ProviderTagsPopoverProps> = ({ tags, onSubm
5454
const getFieldHelpers = getFormHelpers(form);
5555

5656
return (
57-
<Popover isDefaultOpen={false}>
57+
<Popover>
5858
<PopoverTrigger>
5959
<TopbarButton
60-
data-testid="build-parameters-button"
6160
color="neutral"
6261
css={{ paddingLeft: 0, paddingRight: 0, minWidth: "28px !important" }}
6362
>
@@ -76,7 +75,6 @@ export const ProviderTagsPopover: FC<ProviderTagsPopoverProps> = ({ tags, onSubm
7675
}}
7776
>
7877
<VerticalForm onSubmit={form.handleSubmit}>
79-
8078
<Stack>
8179
<FormSection title="Provisioner Tags" description="Tags are a way to control which provisoner daemons process which build jobs. To learn more read the docs. "/>
8280
{Object.keys(tags).length > 0 && (

0 commit comments

Comments
 (0)