diff --git a/src/public/app/services/attribute_parser.ts b/src/public/app/services/attribute_parser.ts index 7fa442cf4..8797769d8 100644 --- a/src/public/app/services/attribute_parser.ts +++ b/src/public/app/services/attribute_parser.ts @@ -8,9 +8,10 @@ interface Token { } export interface Attribute { + attributeId?: string; type: AttributeType; name: string; - isInheritable: boolean; + isInheritable?: boolean; value?: string; startIndex?: number; endIndex?: number; diff --git a/src/public/app/services/promoted_attribute_definition_parser.ts b/src/public/app/services/promoted_attribute_definition_parser.ts index ca0095f60..e40c24bbc 100644 --- a/src/public/app/services/promoted_attribute_definition_parser.ts +++ b/src/public/app/services/promoted_attribute_definition_parser.ts @@ -1,4 +1,4 @@ -type LabelType = "text" | "number" | "boolean" | "date" | "datetime" | "url"; +type LabelType = "text" | "number" | "boolean" | "date" | "datetime" | "time" | "url"; type Multiplicity = "single" | "multi"; interface DefinitionObject { diff --git a/src/public/app/types.d.ts b/src/public/app/types.d.ts index 942d10f4b..dd618c129 100644 --- a/src/public/app/types.d.ts +++ b/src/public/app/types.d.ts @@ -74,7 +74,7 @@ declare global { interface AutoCompleteArg { displayKey: "name" | "value" | "notePathTitle"; - cache: boolean; + cache?: boolean; source: (term: string, cb: AutoCompleteCallback) => void, templates?: { suggestion: (suggestion: Suggestion) => string | undefined diff --git a/src/public/app/widgets/ribbon_widgets/promoted_attributes.js b/src/public/app/widgets/ribbon_widgets/promoted_attributes.ts similarity index 88% rename from src/public/app/widgets/ribbon_widgets/promoted_attributes.js rename to src/public/app/widgets/ribbon_widgets/promoted_attributes.ts index 3a298047e..d388835d5 100644 --- a/src/public/app/widgets/ribbon_widgets/promoted_attributes.js +++ b/src/public/app/widgets/ribbon_widgets/promoted_attributes.ts @@ -7,6 +7,10 @@ import NoteContextAwareWidget from "../note_context_aware_widget.js"; import attributeService from "../../services/attributes.js"; import options from "../../services/options.js"; import utils from "../../services/utils.js"; +import type FNote from "../../entities/fnote.js"; +import type { Attribute } from "../../services/attribute_parser.js"; +import type FAttribute from "../../entities/fattribute.js"; +import type { EventData } from "../../components/app_context.js"; const TPL = `
`; +// TODO: Deduplicate +interface AttributeResult { + attributeId: string; +} + /** * This widget is quite special because it's used in the desktop ribbon, but in mobile outside of ribbon. * This works without many issues (apart from autocomplete), but it should be kept in mind when changing things * and testing. */ export default class PromotedAttributesWidget extends NoteContextAwareWidget { + + private $container!: JQuery