Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2024-02-29 14:30:55 +06:00 committed by GitHub
parent 116631a391
commit 53c04f61a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,11 +14,12 @@
-->
<script lang="ts">
import { getCurrentAccount } from '@hcengineering/core'
import { getResource } from '@hcengineering/platform'
import { getResource, translate } from '@hcengineering/platform'
import { getClient } from '@hcengineering/presentation'
import type { Integration, IntegrationType } from '@hcengineering/setting'
import { AnyComponent, Button, Component, Label, eventToHTMLElement, showPopup } from '@hcengineering/ui'
import setting from '../plugin'
import { Analytics } from '@hcengineering/analytics'
export let integrationType: IntegrationType
export let integration: Integration | undefined
@ -41,6 +42,7 @@
type: integrationType._id
})
if (current === undefined) return
Analytics.handleEvent(`Reconnect integration: ${await translate(integrationType.label, {}, 'en')}`)
await client.update(current, {
disabled: false,
value: res.value
@ -50,6 +52,7 @@
async function disconnect (): Promise<void> {
if (integration !== undefined && integrationType.onDisconnect !== undefined) {
Analytics.handleEvent(`Disconnect integration: ${await translate(integrationType.label, {}, 'en')}`)
const disconnect = await getResource(integrationType.onDisconnect)
await disconnect(integration.value)
}
@ -66,6 +69,7 @@
})
integration = await client.findOne(setting.class.Integration, { _id: id })
}
Analytics.handleEvent(`Configure/create integration: ${await translate(integrationType.label, {}, 'en')}`)
showPopup(component, { integration }, 'top', close)
}
const handleReconnect = (e: any) => {