From 9ac5053a0eec98c2fafa71d2781bc4df3f5a22f8 Mon Sep 17 00:00:00 2001 From: ssmucny Date: Mon, 17 Apr 2023 20:29:40 -0400 Subject: [PATCH] Add simple display of event to note in UI --- .../api/endpoints/notes/events/search.ts | 2 +- packages/frontend/src/components/MkEvent.vue | 23 +++++++++++++++++++ packages/frontend/src/components/MkNote.vue | 2 ++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 packages/frontend/src/components/MkEvent.vue diff --git a/packages/backend/src/server/api/endpoints/notes/events/search.ts b/packages/backend/src/server/api/endpoints/notes/events/search.ts index 51c192714d..f286ed808d 100644 --- a/packages/backend/src/server/api/endpoints/notes/events/search.ts +++ b/packages/backend/src/server/api/endpoints/notes/events/search.ts @@ -100,7 +100,7 @@ export default class extends Endpoint { const matches = filters[f].filter(x => x !== null); if (matches.length < 1) throw new ApiError(meta.errors.invalidParam); query.andWhere(new Brackets((qb) => { - qb.where('event.metadata ->> :key IN (:...values)', { key: f, values: filters[f].filter(x => x !== null) }); + qb.where('event.metadata ->> :key IN (:...values)', { key: f, values: matches }); if (filters[f].filter(x => x === null).length > 0) { qb.orWhere('event.metadata ->> :key IS NULL', { key: f }); } diff --git a/packages/frontend/src/components/MkEvent.vue b/packages/frontend/src/components/MkEvent.vue new file mode 100644 index 0000000000..9fa351dcee --- /dev/null +++ b/packages/frontend/src/components/MkEvent.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 36ec778a14..8b87136966 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -45,6 +45,7 @@
+

@@ -144,6 +145,7 @@ import MkPoll from '@/components/MkPoll.vue'; import MkUsersTooltip from '@/components/MkUsersTooltip.vue'; import MkUrlPreview from '@/components/MkUrlPreview.vue'; import MkInstanceTicker from '@/components/MkInstanceTicker.vue'; +import MkEvent from '@/components/MkEvent.vue'; import { pleaseLogin } from '@/scripts/please-login'; import { focusPrev, focusNext } from '@/scripts/focus'; import { checkWordMute } from '@/scripts/check-word-mute';