mirror of
https://github.com/zadam/trilium.git
synced 2025-12-04 14:34:24 +01:00
Compare commits
18 Commits
22c5428c42
...
289895c35f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
289895c35f | ||
|
|
67d2175ce9 | ||
|
|
8a3283f1ea | ||
|
|
2fb47fc186 | ||
|
|
4530c9a40c | ||
|
|
d51a0d415b | ||
|
|
a79c8b4add | ||
|
|
b359b48ec3 | ||
|
|
a0e1cc4154 | ||
|
|
625c0ed7dc | ||
|
|
1ac241ad1b | ||
|
|
2c447a4293 | ||
|
|
6c1886c5ca | ||
|
|
9c86145ff8 | ||
|
|
6dcc3a7e81 | ||
|
|
921b56a89e | ||
|
|
9d0b532aeb | ||
|
|
cc468d964f |
@ -386,6 +386,7 @@
|
||||
"workspace_template": "This note will appear in the selection of available template when creating new note, but only when hoisted into a workspace containing this template",
|
||||
"search_home": "new search notes will be created as children of this note",
|
||||
"workspace_search_home": "new search notes will be created as children of this note when hoisted to some ancestor of this workspace note",
|
||||
"auto_execute_search": "Automatically executes the search defined in a saved search note and switches to the Collection Properties tab if any notes match the query",
|
||||
"inbox": "default inbox location for new notes - when you create a note using \"new note\" button in the sidebar, notes will be created as child notes in the note marked as with <code>#inbox</code> label.",
|
||||
"workspace_inbox": "default inbox location for new notes when hoisted to some ancestor of this workspace note",
|
||||
"sql_console_home": "default location of SQL console notes",
|
||||
|
||||
@ -1306,8 +1306,8 @@
|
||||
"zpetne_odkazy": {
|
||||
"relation": "relazione",
|
||||
"backlink_one": "{{count}} Backlink",
|
||||
"backlink_many": "",
|
||||
"backlink_other": "{{count}} Backlink"
|
||||
"backlink_many": "{{count}} Backlinks",
|
||||
"backlink_other": "{{count}} Backlinks"
|
||||
},
|
||||
"mobile_detail_menu": {
|
||||
"insert_child_note": "Inserisci nota secondaria",
|
||||
@ -1801,8 +1801,8 @@
|
||||
"relation-map": "Mappa delle relazioni",
|
||||
"note-map": "Nota Mappa",
|
||||
"render-note": "Nota di rendering",
|
||||
"book": "Collezione",
|
||||
"mermaid-diagram": "Diagramma della sirena",
|
||||
"book": "Raccolta",
|
||||
"mermaid-diagram": "Diagramma Mermaid",
|
||||
"canvas": "Tela",
|
||||
"web-view": "Visualizzazione Web",
|
||||
"mind-map": "Mappa mentale",
|
||||
@ -1967,7 +1967,8 @@
|
||||
"open_note_in_new_tab": "Apri la nota in una nuova scheda",
|
||||
"open_note_in_new_split": "Apri nota in una nuova divisione",
|
||||
"open_note_in_new_window": "Apri la nota in una nuova finestra",
|
||||
"open_note_in_popup": "Modifica rapida"
|
||||
"open_note_in_popup": "Modifica rapida",
|
||||
"open_note_in_other_split": "Apri nota nell'altra divisione"
|
||||
},
|
||||
"help-button": {
|
||||
"title": "Apri la pagina di aiuto pertinente"
|
||||
|
||||
@ -1158,7 +1158,8 @@
|
||||
"open_note_in_popup": "クイック編集",
|
||||
"open_note_in_new_tab": "新しいタブでノートを開く",
|
||||
"open_note_in_new_split": "新しく分割してノートを開く",
|
||||
"open_note_in_new_window": "新しいウィンドウでノートを開く"
|
||||
"open_note_in_new_window": "新しいウィンドウでノートを開く",
|
||||
"open_note_in_other_split": "他の分割画面でノートを開く"
|
||||
},
|
||||
"note_tooltip": {
|
||||
"quick-edit": "クイック編集",
|
||||
|
||||
@ -236,6 +236,7 @@ const ATTR_HELP: Record<string, Record<string, string>> = {
|
||||
workspaceTemplate: t("attribute_detail.workspace_template"),
|
||||
searchHome: t("attribute_detail.search_home"),
|
||||
workspaceSearchHome: t("attribute_detail.workspace_search_home"),
|
||||
autoExecuteSearch: t("attribute_detail.auto_execute_search"),
|
||||
inbox: t("attribute_detail.inbox"),
|
||||
workspaceInbox: t("attribute_detail.workspace_inbox"),
|
||||
sqlConsoleHome: t("attribute_detail.sql_console_home"),
|
||||
|
||||
@ -22,7 +22,7 @@ import RenameNoteBulkAction from "../bulk_actions/note/rename_note";
|
||||
import { getErrorMessage } from "../../services/utils";
|
||||
import "./SearchDefinitionTab.css";
|
||||
|
||||
export default function SearchDefinitionTab({ note, ntxId, hidden }: TabContext) {
|
||||
export default function SearchDefinitionTab({ note, ntxId, hidden, noteContext }: TabContext) {
|
||||
const parentComponent = useContext(ParentComponent);
|
||||
const [ searchOptions, setSearchOptions ] = useState<{ availableOptions: SearchOption[], activeOptions: SearchOption[] }>();
|
||||
const [ error, setError ] = useState<{ message: string }>();
|
||||
@ -73,6 +73,27 @@ export default function SearchDefinitionTab({ note, ntxId, hidden }: TabContext)
|
||||
}
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
async function autoExecute() {
|
||||
if (!note || note.type !== "search" || !note.hasLabel("autoExecuteSearch")) {
|
||||
executionState.save("");
|
||||
return;
|
||||
}
|
||||
|
||||
const lastExecutedNoteId = executionState.load();
|
||||
if (lastExecutedNoteId !== note.noteId) {
|
||||
executionState.save(note.noteId);
|
||||
|
||||
await refreshResults();
|
||||
|
||||
if (noteContext?.viewScope?.viewMode === "default" && note.children.length > 0) {
|
||||
parentComponent?.triggerCommand("toggleRibbonTabBookProperties", {});
|
||||
}
|
||||
}
|
||||
}
|
||||
autoExecute();
|
||||
}, [note]);
|
||||
|
||||
return (
|
||||
<div className="search-definition-widget">
|
||||
<div className="search-settings">
|
||||
@ -160,6 +181,14 @@ export default function SearchDefinitionTab({ note, ntxId, hidden }: TabContext)
|
||||
)
|
||||
}
|
||||
|
||||
const executionState = function() {
|
||||
let lastAutoExecutedSearchNoteId = "";
|
||||
return {
|
||||
load: () => lastAutoExecutedSearchNoteId,
|
||||
save: (noteId: string) => lastAutoExecutedSearchNoteId = noteId,
|
||||
};
|
||||
}();
|
||||
|
||||
function BulkActionsList({ note }: { note: FNote }) {
|
||||
const [ bulkActions, setBulkActions ] = useState<RenameNoteBulkAction[]>();
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -23,6 +23,7 @@ type Labels = {
|
||||
ancestorDepth: string;
|
||||
orderBy: string;
|
||||
orderDirection: string;
|
||||
autoExecuteSearch: boolean;
|
||||
|
||||
// Collection-specific
|
||||
viewType: string;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user