From e1e334dd5fcb8a4446ec34671c4fe9fd736fbca8 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 17 Apr 2025 22:57:43 -0400 Subject: [PATCH 1/2] fix: Deleted users appear in mention menu before search query (#9003) --- app/stores/base/Store.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/stores/base/Store.ts b/app/stores/base/Store.ts index 9bce939270..048ecb5ddb 100644 --- a/app/stores/base/Store.ts +++ b/app/stores/base/Store.ts @@ -99,7 +99,14 @@ export default abstract class Store { const normalized = deburr((query ?? "").trim().toLocaleLowerCase()); if (!normalized) { - return this.orderedData.slice(0, options?.maxResults); + return this.orderedData + .filter((item) => { + if ("deletedAt" in item && item.deletedAt) { + return false; + } + return true; + }) + .slice(0, options?.maxResults); } return this.orderedData From 65bb3b11f3c6fd7fef4fc40cb8fa1b68ebd9b408 Mon Sep 17 00:00:00 2001 From: Hemachandar <132386067+hmacr@users.noreply.github.com> Date: Fri, 18 Apr 2025 20:15:17 +0530 Subject: [PATCH 2/2] fix: Parse emoji and url only as workspace icon (#9009) * fix: Parse emoji and url only as workspace icon * scope emoji regex to transform function --- plugins/notion/server/notion.ts | 13 ++++++++++++- shared/i18n/locales/en_US/translation.json | 5 ----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/plugins/notion/server/notion.ts b/plugins/notion/server/notion.ts index f2bf11d170..22a7783517 100644 --- a/plugins/notion/server/notion.ts +++ b/plugins/notion/server/notion.ts @@ -13,9 +13,11 @@ import { RichTextItemResponse, } from "@notionhq/client/build/src/api-endpoints"; import { RateLimit } from "async-sema"; +import emojiRegex from "emoji-regex"; import compact from "lodash/compact"; import { z } from "zod"; import { Second } from "@shared/utils/time"; +import { isUrl } from "@shared/utils/urls"; import { NotionUtils } from "../shared/NotionUtils"; import { Block, Page, PageType } from "../shared/types"; import env from "./env"; @@ -37,7 +39,16 @@ const AccessTokenResponseSchema = z.object({ bot_id: z.string(), workspace_id: z.string(), workspace_name: z.string().nullish(), - workspace_icon: z.string().url().nullish(), + workspace_icon: z + .string() + .nullish() + .transform((val) => { + const emojiRegexp = emojiRegex(); + if (val && (isUrl(val) || emojiRegexp.test(val))) { + return val; + } + return undefined; + }), }); export class NotionClient { diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 8fbf8b128e..69080e8369 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -520,7 +520,6 @@ "Groups": "Groups", "Shared Links": "Shared Links", "Import": "Import", - "Self Hosted": "Self Hosted", "Integrations": "Integrations", "Revoke token": "Revoke token", "Revoke": "Revoke", @@ -1045,10 +1044,6 @@ "Allow editors to create new collections within the workspace": "Allow editors to create new collections within the workspace", "Workspace creation": "Workspace creation", "Allow editors to create new workspaces": "Allow editors to create new workspaces", - "Draw.io deployment": "Draw.io deployment", - "Add your self-hosted draw.io installation url here to enable automatic embedding of diagrams within documents.": "Add your self-hosted draw.io installation url here to enable automatic embedding of diagrams within documents.", - "Grist deployment": "Grist deployment", - "Add your self-hosted grist installation URL here.": "Add your self-hosted grist installation URL here.", "Could not load shares": "Could not load shares", "Sharing is currently disabled.": "Sharing is currently disabled.", "You can globally enable and disable public document sharing in the security settings.": "You can globally enable and disable public document sharing in the security settings.",