mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-19 06:47:12 +00:00
Improve integration disabled message (#4461)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
a26adb5252
commit
5f87e4d72e
@ -22,10 +22,7 @@ import setting, { Integration } from '@hcengineering/setting'
|
|||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
export async function integrationHTMLPresenter (doc: Doc, control: TriggerControl): Promise<string> {
|
export async function integrationHTMLPresenter (doc: Doc, control: TriggerControl): Promise<string> {
|
||||||
const integration = doc as Integration
|
return await integrationTextPresenter(doc, control)
|
||||||
const type = (await control.modelDb.findAll(setting.class.IntegrationType, { _id: integration.type }))[0]
|
|
||||||
if (type === undefined) return ''
|
|
||||||
return await translate(type.label, {})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -35,7 +32,8 @@ export async function integrationTextPresenter (doc: Doc, control: TriggerContro
|
|||||||
const integration = doc as Integration
|
const integration = doc as Integration
|
||||||
const type = (await control.modelDb.findAll(setting.class.IntegrationType, { _id: integration.type }))[0]
|
const type = (await control.modelDb.findAll(setting.class.IntegrationType, { _id: integration.type }))[0]
|
||||||
if (type === undefined) return ''
|
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
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
||||||
|
Loading…
Reference in New Issue
Block a user