diff --git a/apps/client/src/widgets/ribbon/CollectionPropertiesTab.tsx b/apps/client/src/widgets/ribbon/CollectionPropertiesTab.tsx index 3ff283589..4554054d6 100644 --- a/apps/client/src/widgets/ribbon/CollectionPropertiesTab.tsx +++ b/apps/client/src/widgets/ribbon/CollectionPropertiesTab.tsx @@ -121,6 +121,7 @@ function CheckboxPropertyView({ note, property }: { note: FNote, property: Check function NumberPropertyView({ note, property }: { note: FNote, property: NumberProperty }) { //@ts-expect-error Interop with text box which takes in string values even for numbers. const [ value, setValue ] = useNoteLabel(note, property.bindToLabel); + const disabled = property.disabled?.(note); return ( @@ -129,6 +130,7 @@ function NumberPropertyView({ note, property }: { note: FNote, property: NumberP currentValue={value ?? ""} onChange={setValue} style={{ width: (property.width ?? 100) + "px" }} min={property.min ?? 0} + disabled={disabled} /> ) diff --git a/apps/client/src/widgets/ribbon/collection-properties-config.ts b/apps/client/src/widgets/ribbon/collection-properties-config.ts index fd3d6251e..f59415b79 100644 --- a/apps/client/src/widgets/ribbon/collection-properties-config.ts +++ b/apps/client/src/widgets/ribbon/collection-properties-config.ts @@ -31,6 +31,7 @@ export interface NumberProperty { bindToLabel: FilterLabelsByType; width?: number; min?: number; + disabled?: (note: FNote) => boolean; } interface ComboBoxItem { @@ -154,7 +155,8 @@ export const bookPropertiesConfig: Record = { label: t("book_properties_config.max-nesting-depth"), type: "number", bindToLabel: "maxNestingDepth", - width: 65 + width: 65, + disabled: (note) => note.type === "search" } ] },