From 8ab0084e100f388db2c2d22b29467ee8677d8a08 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 24 Feb 2025 13:45:36 +0200 Subject: [PATCH] chore(client/ts): port search_definition --- src/public/app/components/app_context.ts | 4 + ...rch_definition.js => search_definition.ts} | 109 +++++++++++------- ...ch_option.js => abstract_search_option.ts} | 34 +++--- 3 files changed, 95 insertions(+), 52 deletions(-) rename src/public/app/widgets/ribbon_widgets/{search_definition.js => search_definition.ts} (83%) rename src/public/app/widgets/search_options/{abstract_search_option.js => abstract_search_option.ts} (55%) diff --git a/src/public/app/components/app_context.ts b/src/public/app/components/app_context.ts index f54fd88fa..25bdb1daa 100644 --- a/src/public/app/components/app_context.ts +++ b/src/public/app/components/app_context.ts @@ -288,6 +288,10 @@ type EventMappings = { showHighlightsListWidget: { noteId: string; }; + showSearchError: { + error: string; + }; + searchRefreshed: { ntxId?: string | null }; hoistedNoteChanged: { noteId: string; ntxId: string | null; diff --git a/src/public/app/widgets/ribbon_widgets/search_definition.js b/src/public/app/widgets/ribbon_widgets/search_definition.ts similarity index 83% rename from src/public/app/widgets/ribbon_widgets/search_definition.js rename to src/public/app/widgets/ribbon_widgets/search_definition.ts index 9f3bb5cb0..2328f996f 100644 --- a/src/public/app/widgets/ribbon_widgets/search_definition.js +++ b/src/public/app/widgets/ribbon_widgets/search_definition.ts @@ -14,13 +14,15 @@ import OrderBy from "../search_options/order_by.js"; import SearchScript from "../search_options/search_script.js"; import Limit from "../search_options/limit.js"; import Debug from "../search_options/debug.js"; -import appContext from "../../components/app_context.js"; +import appContext, { type EventData } from "../../components/app_context.js"; import bulkActionService from "../../services/bulk_action.js"; import { Dropdown } from "bootstrap"; +import type FNote from "../../entities/fnote.js"; +import type { AttributeType } from "../../entities/fattribute.js"; const TPL = `
-