mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-22 16:27:22 +00:00
parent
116631a391
commit
53c04f61a2
@ -14,11 +14,12 @@
|
|||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getCurrentAccount } from '@hcengineering/core'
|
import { getCurrentAccount } from '@hcengineering/core'
|
||||||
import { getResource } from '@hcengineering/platform'
|
import { getResource, translate } from '@hcengineering/platform'
|
||||||
import { getClient } from '@hcengineering/presentation'
|
import { getClient } from '@hcengineering/presentation'
|
||||||
import type { Integration, IntegrationType } from '@hcengineering/setting'
|
import type { Integration, IntegrationType } from '@hcengineering/setting'
|
||||||
import { AnyComponent, Button, Component, Label, eventToHTMLElement, showPopup } from '@hcengineering/ui'
|
import { AnyComponent, Button, Component, Label, eventToHTMLElement, showPopup } from '@hcengineering/ui'
|
||||||
import setting from '../plugin'
|
import setting from '../plugin'
|
||||||
|
import { Analytics } from '@hcengineering/analytics'
|
||||||
|
|
||||||
export let integrationType: IntegrationType
|
export let integrationType: IntegrationType
|
||||||
export let integration: Integration | undefined
|
export let integration: Integration | undefined
|
||||||
@ -41,6 +42,7 @@
|
|||||||
type: integrationType._id
|
type: integrationType._id
|
||||||
})
|
})
|
||||||
if (current === undefined) return
|
if (current === undefined) return
|
||||||
|
Analytics.handleEvent(`Reconnect integration: ${await translate(integrationType.label, {}, 'en')}`)
|
||||||
await client.update(current, {
|
await client.update(current, {
|
||||||
disabled: false,
|
disabled: false,
|
||||||
value: res.value
|
value: res.value
|
||||||
@ -50,6 +52,7 @@
|
|||||||
|
|
||||||
async function disconnect (): Promise<void> {
|
async function disconnect (): Promise<void> {
|
||||||
if (integration !== undefined && integrationType.onDisconnect !== undefined) {
|
if (integration !== undefined && integrationType.onDisconnect !== undefined) {
|
||||||
|
Analytics.handleEvent(`Disconnect integration: ${await translate(integrationType.label, {}, 'en')}`)
|
||||||
const disconnect = await getResource(integrationType.onDisconnect)
|
const disconnect = await getResource(integrationType.onDisconnect)
|
||||||
await disconnect(integration.value)
|
await disconnect(integration.value)
|
||||||
}
|
}
|
||||||
@ -66,6 +69,7 @@
|
|||||||
})
|
})
|
||||||
integration = await client.findOne(setting.class.Integration, { _id: id })
|
integration = await client.findOne(setting.class.Integration, { _id: id })
|
||||||
}
|
}
|
||||||
|
Analytics.handleEvent(`Configure/create integration: ${await translate(integrationType.label, {}, 'en')}`)
|
||||||
showPopup(component, { integration }, 'top', close)
|
showPopup(component, { integration }, 'top', close)
|
||||||
}
|
}
|
||||||
const handleReconnect = (e: any) => {
|
const handleReconnect = (e: any) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user