diff --git a/web/apps/console/src/workspace/authoring/AuthoringPathPicker.tsx b/web/apps/console/src/workspace/authoring/AuthoringPathPicker.tsx index 14232964..47c35fbe 100644 --- a/web/apps/console/src/workspace/authoring/AuthoringPathPicker.tsx +++ b/web/apps/console/src/workspace/authoring/AuthoringPathPicker.tsx @@ -16,6 +16,7 @@ export type AuthoringPathPickerProps = { readonly allowCustom?: boolean; readonly describedBy?: string | undefined; readonly invalid?: boolean; + readonly selection?: AuthoringPathSelection; }; type OptionGroup = { @@ -50,6 +51,7 @@ export const AuthoringPathPicker = ({ allowCustom = false, describedBy, invalid = false, + selection = "catalog", }: AuthoringPathPickerProps) => { const id = safeId(useId()); const searchId = `${id}-search`; @@ -57,7 +59,9 @@ export const AuthoringPathPicker = ({ const [search, setSearch] = useState(""); const [customValue, setCustomValue] = useState(value); const [advancedOpen, setAdvancedOpen] = useState( - () => allowCustom && value.trim() !== "" && !options.some((option) => option.path === value), + () => allowCustom && value.trim() !== "" && ( + selection === "custom" || !options.some((option) => option.path === value) + ), ); const requestedUses = normalizedUses(uses); const normalizedSearch = search.trim().toLocaleLowerCase(); @@ -102,11 +106,12 @@ export const AuthoringPathPicker = ({ return (