Skip to content

Commit 1db70be

Browse files
authored
feat: create dynamic parameter component (#17351)
- Create DynamicParameter component and test with locally run preview websocket. - Adapt CreateWorkspacePageExperimental to work with PreviewParameter instead of TemplateVersionParameter - Small changes to checkbox, multi-select combobox and radiogroup The websocket implementation is temporary for testing purpose with a locally run preview websocket
1 parent a7646d1 commit 1db70be

File tree

10 files changed

+760
-117
lines changed

10 files changed

+760
-117
lines changed

site/src/components/Checkbox/Checkbox.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import * as React from "react";
88

99
import { cn } from "utils/cn";
1010

11+
/**
12+
* To allow for an indeterminate state the checkbox must be controlled, otherwise the checked prop would remain undefined
13+
*/
1114
export const Checkbox = React.forwardRef<
1215
React.ElementRef<typeof CheckboxPrimitive.Root>,
1316
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>

site/src/components/MultiSelectCombobox/MultiSelectCombobox.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const meta: Meta<typeof MultiSelectCombobox> = {
1616
All organizations selected
1717
</p>
1818
),
19-
defaultOptions: organizations.map((org) => ({
19+
options: organizations.map((org) => ({
2020
label: org.display_name,
2121
value: org.id,
2222
})),

site/src/components/MultiSelectCombobox/MultiSelectCombobox.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,11 @@ export const MultiSelectCombobox = forwardRef<
203203
const [open, setOpen] = useState(false);
204204
const [onScrollbar, setOnScrollbar] = useState(false);
205205
const [isLoading, setIsLoading] = useState(false);
206-
const dropdownRef = useRef<HTMLDivElement>(null); // Added this
206+
const dropdownRef = useRef<HTMLDivElement>(null);
207207

208-
const [selected, setSelected] = useState<Option[]>(value || []);
208+
const [selected, setSelected] = useState<Option[]>(
209+
arrayDefaultOptions ?? [],
210+
);
209211
const [options, setOptions] = useState<GroupOption>(
210212
transitionToGroupOption(arrayDefaultOptions, groupBy),
211213
);

site/src/components/RadioGroup/RadioGroup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const RadioGroupItem = React.forwardRef<
3434
focus:outline-none focus-visible:ring-2 focus-visible:ring-content-link
3535
focus-visible:ring-offset-4 focus-visible:ring-offset-surface-primary
3636
disabled:cursor-not-allowed disabled:opacity-25 disabled:border-surface-invert-primary
37-
hover:border-border-hover`,
37+
hover:border-border-hover data-[state=checked]:border-border-hover`,
3838
className,
3939
)}
4040
{...props}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy