Skip to content

feat: add Coder registry links to template creation and editing #18680

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import CardActionArea from "@mui/material/CardActionArea";
import CardContent from "@mui/material/CardContent";
import Stack from "@mui/material/Stack";
import { ErrorAlert } from "components/Alert/ErrorAlert";
import { Button } from "components/Button/Button";
import { ExternalImage } from "components/ExternalImage/ExternalImage";
import { Loader } from "components/Loader/Loader";
import { Margins } from "components/Margins/Margins";
import { PageHeader, PageHeaderTitle } from "components/PageHeader/PageHeader";
import { ExternalLinkIcon } from "lucide-react";
import type { FC } from "react";
import { Link as RouterLink } from "react-router-dom";
import type { StarterTemplatesByTag } from "utils/starterTemplates";
Expand All @@ -23,7 +25,21 @@ export const CreateTemplateGalleryPageView: FC<
> = ({ starterTemplatesByTag, error }) => {
return (
<Margins>
<PageHeader>
<PageHeader
actions={
<Button asChild size="sm" variant="outline">
<a
href="https://registry.coder.com"
target="_blank"
rel="noopener noreferrer"
className="flex items-center"
>
Browse the Coder Registry
<ExternalLinkIcon className="size-icon-sm ml-1" />
</a>
</Button>
}
>
<PageHeaderTitle>Create a Template</PageHeaderTitle>
</PageHeader>
<Stack spacing={8}>
Expand Down
22 changes: 18 additions & 4 deletions site/src/pages/TemplateVersionEditorPage/TemplateVersionEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { type Interpolation, type Theme, useTheme } from "@emotion/react";
import Button from "@mui/material/Button";
import IconButton from "@mui/material/IconButton";
import Tooltip from "@mui/material/Tooltip";
import { getErrorDetail, getErrorMessage } from "api/errors";
Expand All @@ -12,6 +11,7 @@ import type {
WorkspaceResource,
} from "api/typesGenerated";
import { Alert } from "components/Alert/Alert";
import { Button } from "components/Button/Button";
import { Sidebar } from "components/FullPageLayout/Sidebar";
import {
Topbar,
Expand All @@ -25,7 +25,7 @@ import { displayError } from "components/GlobalSnackbar/utils";
import { Loader } from "components/Loader/Loader";
import { TriangleAlertIcon } from "lucide-react";
import { ChevronLeftIcon } from "lucide-react";
import { PlayIcon, PlusIcon, XIcon } from "lucide-react";
import { ExternalLinkIcon, PlayIcon, PlusIcon, XIcon } from "lucide-react";
import { linkToTemplate, useLinks } from "modules/navigation";
import { ProvisionerAlert } from "modules/provisioners/ProvisionerAlert";
import { AlertVariant } from "modules/provisioners/ProvisionerAlert";
Expand Down Expand Up @@ -255,6 +255,20 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({
paddingRight: 16,
}}
>
<span className="mr-2">
<Button asChild size="sm" variant="outline">
<a
href="https://registry.coder.com"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we would like to point to "https://registry.coder.com/templates" here.

target="_blank"
rel="noopener noreferrer"
className="flex items-center"
>
Browse the Coder Registry
<ExternalLinkIcon className="size-icon-sm ml-1" />
</a>
</Button>
</span>

<TemplateVersionStatusBadge version={templateVersion} />

<div className="flex gap-1 items-center">
Expand Down Expand Up @@ -312,8 +326,8 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({
dismissible
actions={
<Button
variant="text"
size="small"
variant="subtle"
size="sm"
onClick={onCreateWorkspace}
>
Create a workspace
Expand Down
Loading