From 5f87e4d72e6603389914c1d412e8127c3a60ad0b Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Fri, 26 Jan 2024 15:28:40 +0600 Subject: [PATCH] Improve integration disabled message (#4461) Signed-off-by: Denis Bykhov --- server-plugins/setting-resources/src/index.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server-plugins/setting-resources/src/index.ts b/server-plugins/setting-resources/src/index.ts index 84a25e8a46..4e1acde186 100644 --- a/server-plugins/setting-resources/src/index.ts +++ b/server-plugins/setting-resources/src/index.ts @@ -22,10 +22,7 @@ import setting, { Integration } from '@hcengineering/setting' * @public */ export async function integrationHTMLPresenter (doc: Doc, control: TriggerControl): Promise { - const integration = doc as Integration - const type = (await control.modelDb.findAll(setting.class.IntegrationType, { _id: integration.type }))[0] - if (type === undefined) return '' - return await translate(type.label, {}) + return await integrationTextPresenter(doc, control) } /** @@ -35,7 +32,8 @@ export async function integrationTextPresenter (doc: Doc, control: TriggerContro const integration = doc as Integration const type = (await control.modelDb.findAll(setting.class.IntegrationType, { _id: integration.type }))[0] if (type === undefined) return '' - return await translate(type.label, {}) + const label = await translate(type.label, {}) + return `${label} (${integration.value})` } // eslint-disable-next-line @typescript-eslint/explicit-function-return-type