Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: hide Create Workspace button for deleted templates#18063

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

Open
kuluruvineeth wants to merge1 commit intocoder:main
base:main
Choose a base branch
Loading
fromkuluruvineeth:fix/hide-create-workspace-for-deleted-templates
Open
Show file tree
Hide file tree
Changes fromall 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
1 change: 1 addition & 0 deletionscoderd/templates.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1079,6 +1079,7 @@ func (api *API) convertTemplate(
DeprecationMessage: templateAccessControl.Deprecated,
MaxPortShareLevel: maxPortShareLevel,
UseClassicParameterFlow: template.UseClassicParameterFlow,
Deleted: template.Deleted,
}
}

Expand Down
3 changes: 3 additions & 0 deletionscodersdk/templates.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,6 +63,9 @@ type Template struct {
MaxPortShareLevel WorkspaceAgentPortShareLevel `json:"max_port_share_level"`

UseClassicParameterFlow bool `json:"use_classic_parameter_flow"`

// Deleted indicates whether the template has been deleted.
Deleted bool `json:"deleted"`
}

// WeekdaysToBitmap converts a list of weekdays to a bitmap in accordance with
Expand Down
1 change: 1 addition & 0 deletionssite/src/api/typesGenerated.ts
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

6 changes: 6 additions & 0 deletionssite/src/components/Badges/Badges.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -191,6 +191,12 @@ export const DeprecatedBadge: FC = () => {
);
};

export const DeletedBadge: FC = () => {
return (
<span css={[styles.badge, styles.errorBadge]}>Deleted</span>
);
};

export const Badges: FC<PropsWithChildren> = ({ children }) => {
return (
<Stack
Expand Down
1 change: 1 addition & 0 deletionssite/src/pages/TemplatesPage/TemplatesFilter.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,7 @@ export const TemplatesFilter: FC<TemplatesFilterProps> = ({
presets={[
{ query: "", name: "All templates" },
{ query: "deprecated:true", name: "Deprecated templates" },
{ query: "deleted:true", name: "Deleted templates" },
]}
// TODO: Add docs for this
// learnMoreLink={docs("/templates#template-filtering")}
Expand Down
6 changes: 4 additions & 2 deletionssite/src/pages/TemplatesPage/TemplatesPageView.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ import { ErrorAlert } from "components/Alert/ErrorAlert";
import { Avatar } from "components/Avatar/Avatar";
import { AvatarData } from "components/Avatar/AvatarData";
import { AvatarDataSkeleton } from "components/Avatar/AvatarDataSkeleton";
import { DeprecatedBadge } from "components/Badges/Badges";
import {DeletedBadge,DeprecatedBadge } from "components/Badges/Badges";
import { Button } from "components/Button/Button";
import type { useFilter } from "components/Filter/Filter";
import {
Expand DownExpand Up@@ -158,7 +158,9 @@ const TemplateRow: FC<TemplateRowProps> = ({
</TableCell>

<TableCell css={styles.actionCell}>
{template.deprecated ? (
{template.deleted ? (
<DeletedBadge />
) : template.deprecated ? (
<DeprecatedBadge />
) : workspacePermissions?.[template.organization_id]
?.createWorkspaceForUserID ? (
Expand Down
1 change: 1 addition & 0 deletionssite/src/testHelpers/entities.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -823,6 +823,7 @@ export const MockTemplate: TypesGen.Template = {
require_active_version: false,
deprecated: false,
deprecation_message: "",
deleted: false,
max_port_share_level: "public",
use_classic_parameter_flow: false,
};
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp