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

chore: improve the design of the create workspace page for dynamic parameters#17654

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

Merged
jaaydenh merged 3 commits intomainfromjaaydenh/design-improvements
May 2, 2025
Merged
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
9 changes: 7 additions & 2 deletionssite/src/components/Badge/Badge.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,10 +26,15 @@ const badgeVariants = cva(
sm: "text-2xs font-regular h-5.5 [&_svg]:size-icon-xs",
md: "text-xs font-medium [&_svg]:size-icon-sm",
},
border: {
none: "border-transparent",
solid: "border border-solid",
},
},
defaultVariants: {
variant: "default",
size: "md",
border: "solid",
},
},
);
Expand All@@ -41,14 +46,14 @@ export interface BadgeProps
}

export const Badge = forwardRef<HTMLDivElement, BadgeProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
({ className, variant, size,border,asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "div";

return (
<Comp
{...props}
ref={ref}
className={cn(badgeVariants({ variant, size }), className)}
className={cn(badgeVariants({ variant, size, border }), className)}
/>
);
},
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -106,7 +106,7 @@ const ParameterLabel: FC<ParameterLabelProps> = ({ parameter, isPreset }) => {
<Tooltip>
<TooltipTrigger asChild>
<span className="flex items-center">
<Badge size="sm" variant="warning">
<Badge size="sm" variant="warning" border="none">
<TriangleAlert />
Immutable
</Badge>
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,12 +5,17 @@ import { ErrorAlert } from "components/Alert/ErrorAlert";
import { Avatar } from "components/Avatar/Avatar";
import { Button } from "components/Button/Button";
import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge";
import { SelectFilter } from "components/Filter/SelectFilter";
import { Input } from "components/Input/Input";
import { Label } from "components/Label/Label";
import { Pill } from "components/Pill/Pill";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "components/Select/Select";
import { Spinner } from "components/Spinner/Spinner";
import { Stack } from "components/Stack/Stack";
import { Switch } from "components/Switch/Switch";
import { UserAutocomplete } from "components/UserAutocomplete/UserAutocomplete";
import { type FormikContextType, useFormik } from "formik";
Expand DownExpand Up@@ -153,11 +158,11 @@ export const CreateWorkspacePageViewExperimental: FC<
}, [form.submitCount, form.errors]);

const [presetOptions, setPresetOptions] = useState([
{ label: "None", value: "" },
{ label: "None", value: "None" },
]);
useEffect(() => {
setPresetOptions([
{ label: "None", value: "" },
{ label: "None", value: "None" },
...presets.map((preset) => ({
label: preset.Name,
value: preset.ID,
Expand DownExpand Up@@ -421,38 +426,47 @@ export const CreateWorkspacePageViewExperimental: FC<
)}

{parameters.length > 0 && (
<section className="flex flex-col gap-6">
<section className="flex flex-col gap-9">
<hgroup>
<h2 className="text-xl font-semibold m-0">Parameters</h2>
<p className="text-sm text-content-secondary m-0">
These are the settings used by your template. Immutable
parameters cannot be modified once the workspace is created.
</p>
</hgroup>
<Diagnostics diagnostics={diagnostics} />
{diagnostics.length > 0 && (
<Diagnostics diagnostics={diagnostics} />
)}
{presets.length > 0 && (
<Stack direction="column" spacing={2}>
<div className="flex flex-col gap-2">
<div className="flex gap-2 items-center">
<Label className="text-sm">Preset</Label>
<FeatureStageBadge contentType={"beta"} size="md" />
</div>
<div className="flex">
<SelectFilter
label="Preset"
options={presetOptions}
onSelect={(option) => {
<div className="flex flex-col gap-2">
<div className="flex gap-2 items-center">
<Label className="text-sm">Preset</Label>
<FeatureStageBadge contentType={"beta"} size="md" />
</div>
<div className="flex flex-col gap-4">
<div className="max-w-lg">
<Select
onValueChange={(option) => {
const index = presetOptions.findIndex(
(preset) => preset.value === option?.value,
(preset) => preset.value === option,
);
if (index === -1) {
return;
}
setSelectedPresetIndex(index);
}}
placeholder="Select a preset"
selectedOption={presetOptions[selectedPresetIndex]}
/>
>
<SelectTrigger>
<SelectValue placeholder={"Select a preset"} />
</SelectTrigger>
<SelectContent>
{presetOptions.map((option) => (
<SelectItem key={option.value} value={option.value}>
{option.label}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
<span className="flex items-center gap-3">
<Switch
Expand All@@ -465,7 +479,7 @@ export const CreateWorkspacePageViewExperimental: FC<
</Label>
</span>
</div>
</Stack>
</div>
)}

<div className="flex flex-col gap-9">
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp