Improve integration disabled message (#4461)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2024-01-26 15:28:40 +06:00 committed by GitHub
parent a26adb5252
commit 5f87e4d72e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,10 +22,7 @@ import setting, { Integration } from '@hcengineering/setting'
* @public
*/
export async function integrationHTMLPresenter (doc: Doc, control: TriggerControl): Promise<string> {
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