mirror of
https://github.com/zadam/trilium.git
synced 2025-11-26 10:34:25 +01:00
chore(react/promoted_attributes): add more attributes to the input
This commit is contained in:
parent
598bb6d742
commit
aca390ee19
@ -66,6 +66,12 @@ export default function PromotedAttributes() {
|
|||||||
|
|
||||||
for (const valueAttr of valueAttrs) {
|
for (const valueAttr of valueAttrs) {
|
||||||
const definition = definitionAttr.getDefinition();
|
const definition = definitionAttr.getDefinition();
|
||||||
|
|
||||||
|
// if not owned, we'll force creation of a new attribute instead of updating the inherited one
|
||||||
|
if (valueAttr.noteId !== note.noteId) {
|
||||||
|
valueAttr.attributeId = "";
|
||||||
|
}
|
||||||
|
|
||||||
cells.push({ definitionAttr, definition, valueAttr, valueName });
|
cells.push({ definitionAttr, definition, valueAttr, valueName });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -103,8 +109,14 @@ function PromotedAttributeCell(props: CellProps) {
|
|||||||
<label for={inputId}>{definition.promotedAlias ?? valueName}</label>
|
<label for={inputId}>{definition.promotedAlias ?? valueName}</label>
|
||||||
<div className="input-group">
|
<div className="input-group">
|
||||||
<input
|
<input
|
||||||
|
className="form-control promoted-attribute-input"
|
||||||
tabIndex={200 + definitionAttr.position}
|
tabIndex={200 + definitionAttr.position}
|
||||||
id={inputId}
|
id={inputId}
|
||||||
|
value={valueAttr.value}
|
||||||
|
placeholder={t("promoted_attributes.unset-field-placeholder")}
|
||||||
|
data-attribute-id={valueAttr.attributeId}
|
||||||
|
data-attribute-type={valueAttr.type}
|
||||||
|
data-attribute-name={valueAttr.name}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<ActionCell />
|
<ActionCell />
|
||||||
|
|||||||
@ -23,13 +23,6 @@ export default class PromotedAttributesWidget extends NoteContextAwareWidget {
|
|||||||
const definition = definitionAttr.getDefinition();
|
const definition = definitionAttr.getDefinition();
|
||||||
|
|
||||||
const $input = $("<input>")
|
const $input = $("<input>")
|
||||||
.attr("data-attribute-id", valueAttr.noteId === this.noteId ? valueAttr.attributeId ?? "" : "") // if not owned, we'll force creation of a new attribute instead of updating the inherited one
|
|
||||||
.attr("data-attribute-type", valueAttr.type)
|
|
||||||
.attr("data-attribute-name", valueAttr.name)
|
|
||||||
.prop("value", valueAttr.value)
|
|
||||||
.prop("placeholder", t("promoted_attributes.unset-field-placeholder"))
|
|
||||||
.addClass("form-control")
|
|
||||||
.addClass("promoted-attribute-input")
|
|
||||||
.on("change", (event) => this.promotedAttributeChanged(event));
|
.on("change", (event) => this.promotedAttributeChanged(event));
|
||||||
|
|
||||||
if (valueAttr.type === "label") {
|
if (valueAttr.type === "label") {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user