• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / codegate-ui / 12906676440

22 Jan 2025 10:55AM UTC coverage: 69.143% (+0.1%) from 69.048%
12906676440

Pull #165

github

web-flow
Merge b4f867116 into 6fb502c2e
Pull Request #165: fix: show banner in archived workspace

303 of 530 branches covered (57.17%)

Branch coverage included in aggregate %.

10 of 12 new or added lines in 5 files covered. (83.33%)

609 of 789 relevant lines covered (77.19%)

56.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/src/routes/route-workspace.tsx
1
import { BreadcrumbHome } from "@/components/BreadcrumbHome";
2
import { ArchiveWorkspace } from "@/features/workspace/components/archive-workspace";
3
import { SystemPromptEditor } from "@/features/workspace-system-prompt/components/system-prompt-editor";
4
import { WorkspaceHeading } from "@/features/workspace/components/workspace-heading";
5
import { WorkspaceName } from "@/features/workspace/components/workspace-name";
6
import { Alert, Breadcrumb, Breadcrumbs } from "@stacklok/ui-kit";
7
import { useParams } from "react-router-dom";
8
import { useArchivedWorkspaces } from "@/features/workspace/hooks/use-archived-workspaces";
9
import { useRestoreWorkspaceButton } from "@/features/workspace/hooks/use-restore-workspace-button";
10

11
function WorkspaceArchivedBanner({ name }: { name: string }) {
NEW
12
  const restoreButtonProps = useRestoreWorkspaceButton({ workspaceName: name });
×
13

14
  return (
15
    <Alert
16
      variant="warning"
17
      title="This workspace has been archived"
18
      className="mb-8 animate-in fade-in zoom-in-95"
19
      actionButtonProps={restoreButtonProps}
20
    >
21
      You can still view this workspace's configuration. To begin using it
22
      again, you must restore it.
23
    </Alert>
24
  );
25
}
26

27
export function RouteWorkspace() {
28
  const { name } = useParams();
5✔
29

30
  if (!name) throw Error("Workspace name is required");
5!
31

32
  const { data: isArchived } = useArchivedWorkspaces<boolean>({
5✔
33
    select: (data) =>
34
      data?.workspaces.find((w) => w.name === name) !== undefined,
2✔
35
  });
36

37
  return (
38
    <>
39
      <Breadcrumbs>
40
        <BreadcrumbHome />
41
        <Breadcrumb href="/workspaces">Manage Workspaces</Breadcrumb>
42
        <Breadcrumb>Workspace Settings</Breadcrumb>
43
      </Breadcrumbs>
44

45
      <WorkspaceHeading title="Workspace settings" />
46

47
      {isArchived ? <WorkspaceArchivedBanner name={name} /> : null}
5!
48

49
      <WorkspaceName
50
        isArchived={isArchived}
51
        className="mb-4"
52
        workspaceName={name}
53
      />
54
      <SystemPromptEditor
55
        isArchived={isArchived}
56
        workspaceName={name}
57
        className="mb-4"
58
      />
59
      <ArchiveWorkspace isArchived={isArchived} workspaceName={name} />
60
    </>
61
  );
62
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc