- Notifications
You must be signed in to change notification settings - Fork1.1k
feat: create experimental template embed page for dynamic params#17999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
78429baae7cf11e63b45c793aaa2a02e6df62b54d51caf277a0505bbd9af4b2e9671b9File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import * as SeparatorPrimitive from "@radix-ui/react-separator"; | ||
| /** | ||
| * Copied from shadc/ui on 06/20/2025 | ||
| * @see {@link https://ui.shadcn.com/docs/components/separator} | ||
| */ | ||
| import type * as React from "react"; | ||
| import { cn } from "utils/cn"; | ||
| function Separator({ | ||
| className, | ||
| orientation = "horizontal", | ||
| decorative = true, | ||
| ...props | ||
| }: React.ComponentProps<typeof SeparatorPrimitive.Root>) { | ||
| return ( | ||
| <SeparatorPrimitive.Root | ||
| data-slot="separator" | ||
| decorative={decorative} | ||
| orientation={orientation} | ||
| className={cn( | ||
| "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", | ||
| className, | ||
| )} | ||
| {...props} | ||
| /> | ||
| ); | ||
| } | ||
| export { Separator }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /** | ||
| * Copied from shadc/ui on 06/20/2025 | ||
| * @see {@link https://ui.shadcn.com/docs/components/skeleton} | ||
| */ | ||
| import { cn } from "utils/cn"; | ||
| function Skeleton({ className, ...props }: React.ComponentProps<"div">) { | ||
| return ( | ||
| <div | ||
| data-slot="skeleton" | ||
| className={cn("bg-surface-tertiary animate-pulse rounded-md", className)} | ||
| {...props} | ||
| /> | ||
| ); | ||
| } | ||
| export { Skeleton }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import { templateByName } from "api/queries/templates"; | ||
| import { ErrorAlert } from "components/Alert/ErrorAlert"; | ||
| import { Loader } from "components/Loader/Loader"; | ||
| import type { FC } from "react"; | ||
| import { useQuery } from "react-query"; | ||
| import { useParams } from "react-router-dom"; | ||
| import TemplateEmbedPage from "./TemplateEmbedPage"; | ||
| import TemplateEmbedPageExperimental from "./TemplateEmbedPageExperimental"; | ||
| const TemplateEmbedExperimentRouter: FC = () => { | ||
| const { organization: organizationName = "default", template: templateName } = | ||
| useParams() as { organization?: string; template: string }; | ||
| const templateQuery = useQuery( | ||
| templateByName(organizationName, templateName), | ||
| ); | ||
| if (templateQuery.isError) { | ||
| return <ErrorAlert error={templateQuery.error} />; | ||
| } | ||
| if (!templateQuery.data) { | ||
| return <Loader />; | ||
| } | ||
| return ( | ||
| <> | ||
| {templateQuery.data?.use_classic_parameter_flow ? ( | ||
| <TemplateEmbedPage /> | ||
| ) : ( | ||
| <TemplateEmbedPageExperimental /> | ||
| )} | ||
| </> | ||
| ); | ||
| }; | ||
| export default TemplateEmbedExperimentRouter; |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.