Merge remote-tracking branch 'origin/main' into react/type_widgets

This commit is contained in:
Elian Doran
2025-09-25 11:12:28 +03:00
98 changed files with 3564 additions and 2104 deletions

View File

@@ -341,7 +341,7 @@ function NoteLanguageSwitch({ note }: { note?: FNote | null }) {
return <FormListItem
rtl={locale.rtl}
checked={checked}
onClick={() => setCurrentNoteLanguage(locale.id)}
onClick={() => setCurrentNoteLanguage(locale.id || null)}
>{locale.name}</FormListItem>
} else {
return <FormDropdownDivider />

View File

@@ -96,7 +96,7 @@ const TAB_CONFIGURATION = numberObjectsInPlace<TabConfiguration>([
content: FilePropertiesTab,
show: ({ note }) => note?.type === "file",
toggleCommand: "toggleRibbonTabFileProperties",
activate: true
activate: ({ note }) => note?.mime !== "application/pdf"
},
{
title: t("image_properties.title"),

View File

@@ -33,7 +33,7 @@ export default function SearchDefinitionTab({ note, ntxId }: TabContext) {
const activeOptions: SearchOption[] = [];
for (const searchOption of SEARCH_OPTIONS) {
const attr = note.getAttribute(searchOption.attributeType, searchOption.attributeName);
const attr = note.getAttribute(searchOption.attributeType, searchOption.attributeName);
if (attr) {
activeOptions.push(searchOption);
} else {
@@ -75,24 +75,26 @@ export default function SearchDefinitionTab({ note, ntxId }: TabContext) {
return (
<div className="search-definition-widget">
<div className="search-settings">
{note &&
{note &&
<table className="search-setting-table">
<tr>
<td className="title-column">{t("search_definition.add_search_option")}</td>
<td colSpan={2} className="add-search-option">
{searchOptions?.availableOptions.map(({ icon, label, tooltip, attributeName, attributeType, defaultValue }) => (
<Button
size="small"
icon={icon}
text={label}
title={tooltip}
onClick={() => attributes.setAttribute(note, attributeType, attributeName, defaultValue ?? "")}
/>
))}
<tbody>
<tr>
<td className="title-column">{t("search_definition.add_search_option")}</td>
<td colSpan={2} className="add-search-option">
{searchOptions?.availableOptions.map(({ icon, label, tooltip, attributeName, attributeType, defaultValue }) => (
<Button
size="small"
icon={icon}
text={label}
title={tooltip}
onClick={() => attributes.setAttribute(note, attributeType, attributeName, defaultValue ?? "")}
/>
))}
<AddBulkActionButton note={note} />
</td>
</tr>
<AddBulkActionButton note={note} />
</td>
</tr>
</tbody>
<tbody className="search-options">
{searchOptions?.activeOptions.map(({ attributeType, attributeName, component, additionalAttributesToDelete, defaultValue }) => {
const Component = component;
@@ -125,7 +127,7 @@ export default function SearchDefinitionTab({ note, ntxId }: TabContext) {
onClick={async () => {
await server.post(`search-and-execute-note/${note.noteId}`);
refreshResults();
toast.showMessage(t("search_definition.actions_executed"), 3000);
toast.showMessage(t("search_definition.actions_executed"), 3000);
}}
/>
@@ -196,9 +198,9 @@ function AddBulkActionButton({ note }: { note: FNote }) {
{actions.map(({ actionName, actionTitle }) => (
<FormListItem onClick={() => bulk_action.addAction(note.noteId, actionName)}>{actionTitle}</FormListItem>
))}
))}
</>
))}
</Dropdown>
)
}
}

View File

@@ -32,7 +32,7 @@ export default function SimilarNotesTab({ note }: TabContext) {
notePath={notePath}
noTnLink
style={{
"font-size": 24 * (1 - 1 / (1 + score))
"font-size": 20 * (1 - 1 / (1 + score))
}}
/>
))}

View File

@@ -387,7 +387,7 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
items: [
{ title: t("attribute_editor.add_new_label"), command: "addNewLabel", uiIcon: "bx bx-hash" },
{ title: t("attribute_editor.add_new_relation"), command: "addNewRelation", uiIcon: "bx bx-transfer" },
{ title: "----" },
{ kind: "separator" },
{ title: t("attribute_editor.add_new_label_definition"), command: "addNewLabelDefinition", uiIcon: "bx bx-empty" },
{ title: t("attribute_editor.add_new_relation_definition"), command: "addNewRelationDefinition", uiIcon: "bx bx-empty" }
],