-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into alerts-table-refactor
- Loading branch information
Showing
44 changed files
with
1,411 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { render } from "./lib/test-utils"; | ||
import Page from "./Page"; | ||
|
||
test("render NotFound route", () => { | ||
const { getByText, getByRole } = render(<Page />, { | ||
routeConfig: { | ||
initialEntries: ["/fake-route"], | ||
}, | ||
}); | ||
|
||
expect(getByText(/Oops! There's nothing here/i)).toBeVisible(); | ||
expect(getByRole("button", { name: "Home" })).toBeVisible(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
interface EmptyStateProps { | ||
children?: React.ReactNode; | ||
title?: string | React.ReactNode; | ||
description?: string | React.ReactNode; | ||
illustration?: React.ReactNode; | ||
} | ||
|
||
export function EmptyState({ | ||
illustration, | ||
title, | ||
children, | ||
description, | ||
}: EmptyStateProps) { | ||
return ( | ||
<> | ||
<div className="my-4"> | ||
{illustration != null && ( | ||
<div className="m-auto flex w-full justify-center pb-2"> | ||
{illustration} | ||
</div> | ||
)} | ||
<div className="mb-1 text-center text-xl font-medium text-gray-900"> | ||
{title} | ||
</div> | ||
<div className="m-auto mb-6 text-center font-normal text-secondary"> | ||
{description} | ||
</div> | ||
{children != null && ( | ||
<div className="flex justify-center">{children}</div> | ||
)} | ||
</div> | ||
</> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
export { default as Continue } from "./Continue"; | ||
export { default as Copilot } from "./Copilot"; | ||
export { default as Discord } from "./Discord"; | ||
export { default as FlipBackward } from "./FlipBackward"; | ||
export { default as Github } from "./Github"; | ||
export { default as Youtube } from "./Youtube"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
"use client"; | ||
|
||
import { | ||
Button, | ||
Dialog, | ||
DialogContent, | ||
DialogFooter, | ||
DialogHeader, | ||
DialogModal, | ||
DialogModalOverlay, | ||
DialogTitle, | ||
} from "@stacklok/ui-kit"; | ||
import type { ReactNode } from "react"; | ||
import { createContext, useState } from "react"; | ||
|
||
type Buttons = { | ||
yes: ReactNode; | ||
no: ReactNode; | ||
}; | ||
|
||
type Config = { | ||
buttons: Buttons; | ||
title?: ReactNode; | ||
isDestructive?: boolean; | ||
}; | ||
|
||
type Question = { | ||
message: ReactNode; | ||
config: Config; | ||
resolve: (value: boolean) => void; | ||
}; | ||
|
||
type ConfirmContextType = { | ||
confirm: (message: ReactNode, config: Config) => Promise<boolean>; | ||
}; | ||
|
||
export const ConfirmContext = createContext<ConfirmContextType | null>(null); | ||
|
||
export function ConfirmProvider({ children }: { children: ReactNode }) { | ||
const [activeQuestion, setActiveQuestion] = useState<Question | null>(null); | ||
const [isOpen, setIsOpen] = useState<boolean>(false); | ||
|
||
const handleAnswer = (answer: boolean) => { | ||
if (activeQuestion === null) return; | ||
activeQuestion.resolve(answer); | ||
setIsOpen(false); | ||
}; | ||
|
||
const confirm = (message: ReactNode, config: Config) => { | ||
return new Promise<boolean>((resolve) => { | ||
setActiveQuestion({ message, config, resolve }); | ||
setIsOpen(true); | ||
}); | ||
}; | ||
|
||
return ( | ||
<ConfirmContext.Provider value={{ confirm }}> | ||
{children} | ||
|
||
<DialogModalOverlay isDismissable={false} isOpen={isOpen}> | ||
<DialogModal> | ||
<Dialog> | ||
<DialogHeader> | ||
<DialogTitle>{activeQuestion?.config.title}</DialogTitle> | ||
</DialogHeader> | ||
<DialogContent>{activeQuestion?.message}</DialogContent> | ||
<DialogFooter> | ||
<div className="flex grow justify-end gap-2"> | ||
<Button variant="secondary" onPress={() => handleAnswer(false)}> | ||
{activeQuestion?.config.buttons.no ?? " "} | ||
</Button> | ||
<Button | ||
isDestructive={activeQuestion?.config.isDestructive} | ||
variant="primary" | ||
onPress={() => handleAnswer(true)} | ||
> | ||
{activeQuestion?.config.buttons.yes ?? " "} | ||
</Button> | ||
</div> | ||
</DialogFooter> | ||
</Dialog> | ||
</DialogModal> | ||
</DialogModalOverlay> | ||
</ConfirmContext.Provider> | ||
); | ||
} |
15 changes: 0 additions & 15 deletions
15
src/features/workspace-system-prompt/hooks/use-archive-workspace.ts
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/features/workspace-system-prompt/hooks/use-set-system-prompt.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.