mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 03:59:05 +01:00
feat(client/search): disable nesting depth in collection
This commit is contained in:
parent
5d66b7e66f
commit
1d8b55be5e
@ -121,6 +121,7 @@ function CheckboxPropertyView({ note, property }: { note: FNote, property: Check
|
|||||||
function NumberPropertyView({ note, property }: { note: FNote, property: NumberProperty }) {
|
function NumberPropertyView({ note, property }: { note: FNote, property: NumberProperty }) {
|
||||||
//@ts-expect-error Interop with text box which takes in string values even for numbers.
|
//@ts-expect-error Interop with text box which takes in string values even for numbers.
|
||||||
const [ value, setValue ] = useNoteLabel(note, property.bindToLabel);
|
const [ value, setValue ] = useNoteLabel(note, property.bindToLabel);
|
||||||
|
const disabled = property.disabled?.(note);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LabelledEntry label={property.label}>
|
<LabelledEntry label={property.label}>
|
||||||
@ -129,6 +130,7 @@ function NumberPropertyView({ note, property }: { note: FNote, property: NumberP
|
|||||||
currentValue={value ?? ""} onChange={setValue}
|
currentValue={value ?? ""} onChange={setValue}
|
||||||
style={{ width: (property.width ?? 100) + "px" }}
|
style={{ width: (property.width ?? 100) + "px" }}
|
||||||
min={property.min ?? 0}
|
min={property.min ?? 0}
|
||||||
|
disabled={disabled}
|
||||||
/>
|
/>
|
||||||
</LabelledEntry>
|
</LabelledEntry>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -31,6 +31,7 @@ export interface NumberProperty {
|
|||||||
bindToLabel: FilterLabelsByType<number>;
|
bindToLabel: FilterLabelsByType<number>;
|
||||||
width?: number;
|
width?: number;
|
||||||
min?: number;
|
min?: number;
|
||||||
|
disabled?: (note: FNote) => boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ComboBoxItem {
|
interface ComboBoxItem {
|
||||||
@ -154,7 +155,8 @@ export const bookPropertiesConfig: Record<ViewTypeOptions, BookConfig> = {
|
|||||||
label: t("book_properties_config.max-nesting-depth"),
|
label: t("book_properties_config.max-nesting-depth"),
|
||||||
type: "number",
|
type: "number",
|
||||||
bindToLabel: "maxNestingDepth",
|
bindToLabel: "maxNestingDepth",
|
||||||
width: 65
|
width: 65,
|
||||||
|
disabled: (note) => note.type === "search"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user