Skip to content

Commit 1d80c9f

Browse files
fix: buttons in workspace page (#159)
1 parent ff6ce7f commit 1d80c9f

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

src/features/workspace-system-prompt/components/__tests__/system-prompt-editor.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test("can update system prompt", async () => {
4343
await userEvent.type(input, "new prompt from test");
4444
expect(input).toHaveTextContent("new prompt from test");
4545

46-
await userEvent.click(getByRole("button", { name: /save changes/i }));
46+
await userEvent.click(getByRole("button", { name: /Save/i }));
4747

4848
server.use(
4949
http.get("*/api/v1/workspaces/:name/system-prompt", () => {

src/features/workspace-system-prompt/components/system-prompt-editor.tsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
CardBody,
66
CardFooter,
77
DarkModeContext,
8-
LinkButton,
98
Loader,
109
Text,
1110
} from "@stacklok/ui-kit";
@@ -207,9 +206,6 @@ export function SystemPromptEditor({
207206
</div>
208207
</CardBody>
209208
<CardFooter className="justify-end gap-2">
210-
<LinkButton href="/workspaces" variant="secondary">
211-
Cancel
212-
</LinkButton>
213209
<Button
214210
isPending={isMutationPending}
215211
isDisabled={Boolean(isGetPromptPending ?? saved)}
@@ -220,7 +216,7 @@ export function SystemPromptEditor({
220216
<span>Saved</span> <Check />
221217
</>
222218
) : (
223-
"Save changes"
219+
"Save"
224220
)}
225221
</Button>
226222
</CardFooter>

src/features/workspace/components/archive-workspace.tsx

+13-11
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,24 @@ export function ArchiveWorkspace({
1313

1414
return (
1515
<Card className={twMerge(className, "shrink-0")}>
16-
<CardBody>
17-
<Text className="text-primary">Archive Workspace</Text>
18-
<div className="flex justify-between items-center">
16+
<CardBody className="flex justify-between items-center">
17+
<div>
18+
<Text className="text-primary">Archive Workspace</Text>
1919
<Text className="flex items-center text-secondary mb-0">
2020
Archiving this workspace removes it from the main workspaces list,
2121
though it can be restored if needed.
2222
</Text>
23-
<Button
24-
isPending={isPending}
25-
onPress={() => {
26-
mutate({ path: { workspace_name: workspaceName } });
27-
}}
28-
>
29-
Archive
30-
</Button>
3123
</div>
24+
25+
<Button
26+
isDestructive
27+
isPending={isPending}
28+
onPress={() => {
29+
mutate({ path: { workspace_name: workspaceName } });
30+
}}
31+
>
32+
Archive
33+
</Button>
3234
</CardBody>
3335
</Card>
3436
);

0 commit comments

Comments
 (0)