2021-09-11 01:15:36 -07:00
|
|
|
<template>
|
2023-01-27 00:05:43 -08:00
|
|
|
<div :class="$style.container" data-test-id="node-credentials-config-container">
|
2023-12-28 00:49:58 -08:00
|
|
|
<Banner
|
2021-09-11 01:15:36 -07:00
|
|
|
v-show="showValidationWarning"
|
|
|
|
theme="danger"
|
2022-12-21 07:42:07 -08:00
|
|
|
:message="
|
|
|
|
$locale.baseText(
|
|
|
|
`credentialEdit.credentialConfig.pleaseCheckTheErrorsBelow${
|
2024-05-17 01:53:15 -07:00
|
|
|
credentialPermissions.update ? '' : '.sharee'
|
2022-12-21 07:42:07 -08:00
|
|
|
}`,
|
|
|
|
{ interpolate: { owner: credentialOwnerName } },
|
|
|
|
)
|
|
|
|
"
|
2021-09-11 01:15:36 -07:00
|
|
|
/>
|
|
|
|
|
2023-12-28 00:49:58 -08:00
|
|
|
<Banner
|
2021-09-11 01:15:36 -07:00
|
|
|
v-if="authError && !showValidationWarning"
|
|
|
|
theme="danger"
|
2022-12-12 01:53:22 -08:00
|
|
|
:message="
|
|
|
|
$locale.baseText(
|
|
|
|
`credentialEdit.credentialConfig.couldntConnectWithTheseSettings${
|
2024-05-17 01:53:15 -07:00
|
|
|
credentialPermissions.update ? '' : '.sharee'
|
2022-12-12 01:53:22 -08:00
|
|
|
}`,
|
|
|
|
{ interpolate: { owner: credentialOwnerName } },
|
2022-12-14 01:04:10 -08:00
|
|
|
)
|
|
|
|
"
|
2021-09-11 01:15:36 -07:00
|
|
|
:details="authError"
|
2023-12-28 00:49:58 -08:00
|
|
|
:button-label="$locale.baseText('credentialEdit.credentialConfig.retry')"
|
|
|
|
button-loading-label="Retrying"
|
|
|
|
:button-title="$locale.baseText('credentialEdit.credentialConfig.retryCredentialTest')"
|
|
|
|
:button-loading="isRetesting"
|
2021-09-11 01:15:36 -07:00
|
|
|
@click="$emit('retest')"
|
|
|
|
/>
|
|
|
|
|
2023-12-28 00:49:58 -08:00
|
|
|
<Banner
|
2021-09-11 01:15:36 -07:00
|
|
|
v-show="showOAuthSuccessBanner && !showValidationWarning"
|
|
|
|
theme="success"
|
2021-12-15 04:16:53 -08:00
|
|
|
:message="$locale.baseText('credentialEdit.credentialConfig.accountConnected')"
|
2023-12-28 00:49:58 -08:00
|
|
|
:button-label="$locale.baseText('credentialEdit.credentialConfig.reconnect')"
|
|
|
|
:button-title="$locale.baseText('credentialEdit.credentialConfig.reconnectOAuth2Credential')"
|
2021-09-11 01:15:36 -07:00
|
|
|
@click="$emit('oauth')"
|
2024-06-17 04:41:49 -07:00
|
|
|
data-test-id="oauth-connect-success-banner"
|
2023-01-25 06:25:11 -08:00
|
|
|
>
|
2023-12-28 00:49:58 -08:00
|
|
|
<template v-if="isGoogleOAuthType" #button>
|
2023-01-25 06:25:11 -08:00
|
|
|
<p
|
|
|
|
:class="$style.googleReconnectLabel"
|
2023-12-28 00:49:58 -08:00
|
|
|
v-text="`${$locale.baseText('credentialEdit.credentialConfig.reconnect')}:`"
|
2023-01-25 06:25:11 -08:00
|
|
|
/>
|
2023-02-06 09:33:59 -08:00
|
|
|
<GoogleAuthButton @click="$emit('oauth')" />
|
2023-01-25 06:25:11 -08:00
|
|
|
</template>
|
2023-12-28 00:49:58 -08:00
|
|
|
</Banner>
|
2021-09-11 01:15:36 -07:00
|
|
|
|
2023-12-28 00:49:58 -08:00
|
|
|
<Banner
|
2021-09-11 01:15:36 -07:00
|
|
|
v-show="testedSuccessfully && !showValidationWarning"
|
|
|
|
theme="success"
|
2021-12-15 04:16:53 -08:00
|
|
|
:message="$locale.baseText('credentialEdit.credentialConfig.connectionTestedSuccessfully')"
|
2023-12-28 00:49:58 -08:00
|
|
|
:button-label="$locale.baseText('credentialEdit.credentialConfig.retry')"
|
|
|
|
:button-loading-label="$locale.baseText('credentialEdit.credentialConfig.retrying')"
|
|
|
|
:button-title="$locale.baseText('credentialEdit.credentialConfig.retryCredentialTest')"
|
|
|
|
:button-loading="isRetesting"
|
2023-04-28 03:02:28 -07:00
|
|
|
data-test-id="credentials-config-container-test-success"
|
2023-12-28 00:49:58 -08:00
|
|
|
@click="$emit('retest')"
|
2021-09-11 01:15:36 -07:00
|
|
|
/>
|
|
|
|
|
2023-12-08 03:52:25 -08:00
|
|
|
<template v-if="credentialPermissions.update">
|
2022-09-21 01:20:29 -07:00
|
|
|
<n8n-notice v-if="documentationUrl && credentialProperties.length" theme="warning">
|
|
|
|
{{ $locale.baseText('credentialEdit.credentialConfig.needHelpFillingOutTheseFields') }}
|
|
|
|
<span class="ml-4xs">
|
|
|
|
<n8n-link :to="documentationUrl" size="small" bold @click="onDocumentationUrlClick">
|
|
|
|
{{ $locale.baseText('credentialEdit.credentialConfig.openDocs') }}
|
|
|
|
</n8n-link>
|
|
|
|
</span>
|
|
|
|
</n8n-notice>
|
|
|
|
|
2023-01-27 00:05:43 -08:00
|
|
|
<AuthTypeSelector
|
|
|
|
v-if="showAuthTypeSelector && isNewCredential"
|
2023-12-28 00:49:58 -08:00
|
|
|
:credential-type="credentialType"
|
2024-03-26 06:22:57 -07:00
|
|
|
@auth-type-changed="onAuthTypeChange"
|
2023-01-27 00:05:43 -08:00
|
|
|
/>
|
|
|
|
|
2022-09-21 01:20:29 -07:00
|
|
|
<CopyInput
|
2024-04-04 02:30:37 -07:00
|
|
|
v-if="isOAuthType && !allOAuth2BasePropertiesOverridden"
|
2022-09-21 01:20:29 -07:00
|
|
|
:label="$locale.baseText('credentialEdit.credentialConfig.oAuthRedirectUrl')"
|
|
|
|
:value="oAuthCallbackUrl"
|
2023-12-28 00:49:58 -08:00
|
|
|
:copy-button-text="$locale.baseText('credentialEdit.credentialConfig.clickToCopy')"
|
2022-09-21 01:20:29 -07:00
|
|
|
:hint="
|
|
|
|
$locale.baseText('credentialEdit.credentialConfig.subtitle', { interpolate: { appName } })
|
2022-12-14 01:04:10 -08:00
|
|
|
"
|
2023-12-28 00:49:58 -08:00
|
|
|
:toast-title="
|
2022-09-21 01:20:29 -07:00
|
|
|
$locale.baseText('credentialEdit.credentialConfig.redirectUrlCopiedToClipboard')
|
2022-12-14 01:04:10 -08:00
|
|
|
"
|
2023-12-28 00:49:58 -08:00
|
|
|
:redact-value="true"
|
2022-09-21 01:20:29 -07:00
|
|
|
/>
|
|
|
|
</template>
|
2023-12-28 00:49:58 -08:00
|
|
|
<EnterpriseEdition v-else :features="[EnterpriseEditionFeature.Sharing]">
|
2023-07-19 07:51:49 -07:00
|
|
|
<div>
|
2022-09-21 01:20:29 -07:00
|
|
|
<n8n-info-tip :bold="false">
|
|
|
|
{{
|
|
|
|
$locale.baseText('credentialEdit.credentialEdit.info.sharee', {
|
|
|
|
interpolate: { credentialOwnerName },
|
|
|
|
})
|
|
|
|
}}
|
|
|
|
</n8n-info-tip>
|
|
|
|
</div>
|
2023-12-28 00:49:58 -08:00
|
|
|
</EnterpriseEdition>
|
2021-09-11 01:15:36 -07:00
|
|
|
|
|
|
|
<CredentialInputs
|
2023-12-08 03:52:25 -08:00
|
|
|
v-if="credentialType && credentialPermissions.update"
|
2023-12-28 00:49:58 -08:00
|
|
|
:credential-data="credentialData"
|
|
|
|
:credential-properties="credentialProperties"
|
|
|
|
:documentation-url="documentationUrl"
|
|
|
|
:show-validation-warnings="showValidationWarning"
|
2023-07-28 00:51:07 -07:00
|
|
|
@update="onDataChange"
|
2021-09-11 01:15:36 -07:00
|
|
|
/>
|
|
|
|
|
|
|
|
<OauthButton
|
2022-09-21 01:20:29 -07:00
|
|
|
v-if="
|
2024-05-17 01:53:15 -07:00
|
|
|
isOAuthType && requiredPropertiesFilled && !isOAuthConnected && credentialPermissions.update
|
2022-12-14 01:04:10 -08:00
|
|
|
"
|
2023-12-28 00:49:58 -08:00
|
|
|
:is-google-o-auth-type="isGoogleOAuthType"
|
2021-09-11 01:15:36 -07:00
|
|
|
@click="$emit('oauth')"
|
2024-06-17 04:41:49 -07:00
|
|
|
data-test-id="oauth-connect-button"
|
2021-09-11 01:15:36 -07:00
|
|
|
/>
|
2022-09-21 01:20:29 -07:00
|
|
|
|
2023-01-27 00:05:43 -08:00
|
|
|
<n8n-text v-if="isMissingCredentials" color="text-base" size="medium">
|
2022-09-21 01:20:29 -07:00
|
|
|
{{ $locale.baseText('credentialEdit.credentialConfig.missingCredentialType') }}
|
|
|
|
</n8n-text>
|
2023-08-25 01:33:46 -07:00
|
|
|
|
|
|
|
<EnterpriseEdition :features="[EnterpriseEditionFeature.ExternalSecrets]">
|
|
|
|
<template #fallback>
|
|
|
|
<n8n-info-tip class="mt-s">
|
|
|
|
{{ $locale.baseText('credentialEdit.credentialConfig.externalSecrets') }}
|
|
|
|
<n8n-link bold :to="$locale.baseText('settings.externalSecrets.docs')" size="small">
|
|
|
|
{{ $locale.baseText('credentialEdit.credentialConfig.externalSecrets.moreInfo') }}
|
|
|
|
</n8n-link>
|
|
|
|
</n8n-info-tip>
|
|
|
|
</template>
|
|
|
|
</EnterpriseEdition>
|
2021-09-11 01:15:36 -07:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2023-05-16 02:43:46 -07:00
|
|
|
import { defineComponent } from 'vue';
|
2024-05-17 01:53:15 -07:00
|
|
|
import type { PropType } from 'vue';
|
2023-05-16 02:43:46 -07:00
|
|
|
import { mapStores } from 'pinia';
|
|
|
|
|
2024-06-18 06:04:08 -07:00
|
|
|
import type {
|
|
|
|
ICredentialDataDecryptedObject,
|
|
|
|
ICredentialType,
|
|
|
|
INodeProperties,
|
|
|
|
INodeTypeDescription,
|
|
|
|
} from 'n8n-workflow';
|
2023-11-28 03:15:08 -08:00
|
|
|
import { getAppNameFromCredType, isCommunityPackageName } from '@/utils/nodeTypesUtils';
|
2021-09-11 01:15:36 -07:00
|
|
|
|
|
|
|
import Banner from '../Banner.vue';
|
|
|
|
import CopyInput from '../CopyInput.vue';
|
|
|
|
import CredentialInputs from './CredentialInputs.vue';
|
|
|
|
import OauthButton from './OauthButton.vue';
|
2022-01-07 13:02:21 -08:00
|
|
|
import { addCredentialTranslation } from '@/plugins/i18n';
|
2022-12-22 08:01:29 -08:00
|
|
|
import { BUILTIN_CREDENTIALS_DOCS_URL, DOCS_DOMAIN, EnterpriseEditionFeature } from '@/constants';
|
2024-05-17 01:53:15 -07:00
|
|
|
import type { PermissionsMap } from '@/permissions';
|
|
|
|
import type { CredentialScope } from '@n8n/permissions';
|
2023-05-05 01:41:54 -07:00
|
|
|
import { useUIStore } from '@/stores/ui.store';
|
|
|
|
import { useWorkflowsStore } from '@/stores/workflows.store';
|
|
|
|
import { useRootStore } from '@/stores/n8nRoot.store';
|
|
|
|
import { useNDVStore } from '@/stores/ndv.store';
|
|
|
|
import { useCredentialsStore } from '@/stores/credentials.store';
|
|
|
|
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
2024-06-18 06:04:08 -07:00
|
|
|
import type { ICredentialsResponse, IUpdateInformation } from '@/Interface';
|
2023-01-27 00:05:43 -08:00
|
|
|
import AuthTypeSelector from '@/components/CredentialEdit/AuthTypeSelector.vue';
|
2023-01-25 06:25:11 -08:00
|
|
|
import GoogleAuthButton from './GoogleAuthButton.vue';
|
2023-08-25 01:33:46 -07:00
|
|
|
import EnterpriseEdition from '@/components/EnterpriseEdition.ee.vue';
|
2021-09-11 01:15:36 -07:00
|
|
|
|
2023-05-16 02:43:46 -07:00
|
|
|
export default defineComponent({
|
2021-09-11 01:15:36 -07:00
|
|
|
name: 'CredentialConfig',
|
|
|
|
components: {
|
2023-08-25 01:33:46 -07:00
|
|
|
EnterpriseEdition,
|
2023-01-27 00:05:43 -08:00
|
|
|
AuthTypeSelector,
|
2021-09-11 01:15:36 -07:00
|
|
|
Banner,
|
|
|
|
CopyInput,
|
|
|
|
CredentialInputs,
|
|
|
|
OauthButton,
|
2023-01-25 06:25:11 -08:00
|
|
|
GoogleAuthButton,
|
2021-09-11 01:15:36 -07:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
credentialType: {
|
2024-05-17 04:58:26 -07:00
|
|
|
type: Object as PropType<ICredentialType>,
|
|
|
|
required: true,
|
2021-09-11 01:15:36 -07:00
|
|
|
},
|
|
|
|
credentialProperties: {
|
2024-05-17 04:58:26 -07:00
|
|
|
type: Array as PropType<INodeProperties[]>,
|
|
|
|
required: true,
|
2021-09-11 01:15:36 -07:00
|
|
|
},
|
|
|
|
parentTypes: {
|
2024-05-17 04:58:26 -07:00
|
|
|
type: Array as PropType<string[]>,
|
2024-05-17 08:18:15 -07:00
|
|
|
default: () => [],
|
2021-09-11 01:15:36 -07:00
|
|
|
},
|
2024-06-18 06:04:08 -07:00
|
|
|
credentialData: {
|
|
|
|
type: Object as PropType<ICredentialDataDecryptedObject>,
|
|
|
|
required: true,
|
|
|
|
},
|
2022-09-21 01:20:29 -07:00
|
|
|
credentialId: {
|
2023-01-02 08:42:32 -08:00
|
|
|
type: String,
|
2022-09-21 01:20:29 -07:00
|
|
|
default: '',
|
|
|
|
},
|
2021-09-11 01:15:36 -07:00
|
|
|
showValidationWarning: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
authError: {
|
|
|
|
type: String,
|
|
|
|
},
|
|
|
|
testedSuccessfully: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
|
|
|
isOAuthType: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
2024-04-04 02:30:37 -07:00
|
|
|
allOAuth2BasePropertiesOverridden: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
2021-09-11 01:15:36 -07:00
|
|
|
isOAuthConnected: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
|
|
|
isRetesting: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
2022-09-21 01:20:29 -07:00
|
|
|
credentialPermissions: {
|
2024-05-17 01:53:15 -07:00
|
|
|
type: Object as PropType<PermissionsMap<CredentialScope>>,
|
|
|
|
default: () => ({}) as PermissionsMap<CredentialScope>,
|
2022-09-21 01:20:29 -07:00
|
|
|
},
|
2021-09-11 01:15:36 -07:00
|
|
|
requiredPropertiesFilled: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
2023-01-27 00:05:43 -08:00
|
|
|
mode: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
showAuthTypeSelector: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
2021-09-11 01:15:36 -07:00
|
|
|
},
|
2022-09-21 01:20:29 -07:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
EnterpriseEditionFeature,
|
|
|
|
};
|
|
|
|
},
|
2021-11-15 02:19:43 -08:00
|
|
|
async beforeMount() {
|
2022-11-04 06:04:31 -07:00
|
|
|
if (this.rootStore.defaultLocale === 'en') return;
|
2022-01-07 13:02:21 -08:00
|
|
|
|
2022-11-04 06:04:31 -07:00
|
|
|
this.uiStore.activeCredentialType = this.credentialType.name;
|
2022-01-07 13:02:21 -08:00
|
|
|
|
|
|
|
const key = `n8n-nodes-base.credentials.${this.credentialType.name}`;
|
|
|
|
|
|
|
|
if (this.$locale.exists(key)) return;
|
|
|
|
|
2023-04-24 01:50:49 -07:00
|
|
|
const credTranslation = await this.credentialsStore.getCredentialTranslation(
|
|
|
|
this.credentialType.name,
|
|
|
|
);
|
2022-01-07 13:02:21 -08:00
|
|
|
|
|
|
|
addCredentialTranslation(
|
|
|
|
{ [this.credentialType.name]: credTranslation },
|
2022-11-04 06:04:31 -07:00
|
|
|
this.rootStore.defaultLocale,
|
2022-01-07 13:02:21 -08:00
|
|
|
);
|
2021-11-15 02:19:43 -08:00
|
|
|
},
|
2021-09-11 01:15:36 -07:00
|
|
|
computed: {
|
2023-01-27 00:05:43 -08:00
|
|
|
...mapStores(
|
|
|
|
useCredentialsStore,
|
|
|
|
useNDVStore,
|
|
|
|
useNodeTypesStore,
|
|
|
|
useRootStore,
|
|
|
|
useUIStore,
|
|
|
|
useWorkflowsStore,
|
|
|
|
),
|
|
|
|
activeNodeType(): INodeTypeDescription | null {
|
|
|
|
const activeNode = this.ndvStore.activeNode;
|
|
|
|
|
|
|
|
if (activeNode) {
|
|
|
|
return this.nodeTypesStore.getNodeType(activeNode.type, activeNode.typeVersion);
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
},
|
2021-09-11 01:15:36 -07:00
|
|
|
appName(): string {
|
|
|
|
if (!this.credentialType) {
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
2024-05-17 08:18:15 -07:00
|
|
|
const appName = getAppNameFromCredType(this.credentialType.displayName);
|
2021-09-11 01:15:36 -07:00
|
|
|
|
2021-12-15 04:16:53 -08:00
|
|
|
return (
|
|
|
|
appName ||
|
|
|
|
this.$locale.baseText('credentialEdit.credentialConfig.theServiceYouReConnectingTo')
|
|
|
|
);
|
2021-09-11 01:15:36 -07:00
|
|
|
},
|
|
|
|
credentialTypeName(): string {
|
2024-05-17 08:18:15 -07:00
|
|
|
return this.credentialType?.name;
|
2021-09-11 01:15:36 -07:00
|
|
|
},
|
2022-09-21 01:20:29 -07:00
|
|
|
credentialOwnerName(): string {
|
2023-02-14 06:13:22 -08:00
|
|
|
return this.credentialsStore.getCredentialOwnerNameById(`${this.credentialId}`);
|
2022-09-21 01:20:29 -07:00
|
|
|
},
|
2021-09-11 01:15:36 -07:00
|
|
|
documentationUrl(): string {
|
2024-05-17 08:18:15 -07:00
|
|
|
const type = this.credentialType;
|
2022-11-04 06:04:31 -07:00
|
|
|
const activeNode = this.ndvStore.activeNode;
|
2022-07-21 03:50:34 -07:00
|
|
|
const isCommunityNode = activeNode ? isCommunityPackageName(activeNode.type) : false;
|
2021-09-11 01:15:36 -07:00
|
|
|
|
2022-12-22 08:01:29 -08:00
|
|
|
const documentationUrl = type?.documentationUrl;
|
|
|
|
|
|
|
|
if (!documentationUrl) {
|
2021-09-11 01:15:36 -07:00
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
2022-12-22 08:01:29 -08:00
|
|
|
let url: URL;
|
|
|
|
if (documentationUrl.startsWith('https://') || documentationUrl.startsWith('http://')) {
|
|
|
|
url = new URL(documentationUrl);
|
|
|
|
if (url.hostname !== DOCS_DOMAIN) return documentationUrl;
|
|
|
|
} else {
|
|
|
|
// Don't show documentation link for community nodes if the URL is not an absolute path
|
|
|
|
if (isCommunityNode) return '';
|
|
|
|
else url = new URL(`${BUILTIN_CREDENTIALS_DOCS_URL}${documentationUrl}/`);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (url.hostname === DOCS_DOMAIN) {
|
|
|
|
url.searchParams.set('utm_source', 'n8n_app');
|
2023-11-03 08:17:39 -07:00
|
|
|
url.searchParams.set('utm_medium', 'credential_settings');
|
2022-12-22 08:01:29 -08:00
|
|
|
url.searchParams.set('utm_campaign', 'create_new_credentials_modal');
|
2021-09-11 01:15:36 -07:00
|
|
|
}
|
|
|
|
|
2022-12-22 08:01:29 -08:00
|
|
|
return url.href;
|
2021-09-11 01:15:36 -07:00
|
|
|
},
|
|
|
|
isGoogleOAuthType(): boolean {
|
|
|
|
return (
|
|
|
|
this.credentialTypeName === 'googleOAuth2Api' ||
|
|
|
|
this.parentTypes.includes('googleOAuth2Api')
|
|
|
|
);
|
|
|
|
},
|
|
|
|
oAuthCallbackUrl(): string {
|
|
|
|
const oauthType =
|
|
|
|
this.credentialTypeName === 'oAuth2Api' || this.parentTypes.includes('oAuth2Api')
|
|
|
|
? 'oauth2'
|
|
|
|
: 'oauth1';
|
2022-11-04 06:04:31 -07:00
|
|
|
return this.rootStore.oauthCallbackUrls[oauthType as keyof {}];
|
2021-09-11 01:15:36 -07:00
|
|
|
},
|
|
|
|
showOAuthSuccessBanner(): boolean {
|
|
|
|
return (
|
|
|
|
this.isOAuthType &&
|
|
|
|
this.requiredPropertiesFilled &&
|
|
|
|
this.isOAuthConnected &&
|
|
|
|
!this.authError
|
|
|
|
);
|
|
|
|
},
|
2023-01-27 00:05:43 -08:00
|
|
|
isMissingCredentials(): boolean {
|
|
|
|
return this.credentialType === null;
|
|
|
|
},
|
|
|
|
isNewCredential(): boolean {
|
|
|
|
return this.mode === 'new' && !this.credentialId;
|
|
|
|
},
|
2021-09-11 01:15:36 -07:00
|
|
|
},
|
|
|
|
methods: {
|
2023-01-27 00:05:43 -08:00
|
|
|
getCredentialOptions(type: string): ICredentialsResponse[] {
|
|
|
|
return this.credentialsStore.allUsableCredentialsByType[type];
|
|
|
|
},
|
2024-06-18 06:04:08 -07:00
|
|
|
onDataChange(event: IUpdateInformation): void {
|
2023-07-28 00:51:07 -07:00
|
|
|
this.$emit('update', event);
|
2021-09-11 01:15:36 -07:00
|
|
|
},
|
2021-10-18 20:57:49 -07:00
|
|
|
onDocumentationUrlClick(): void {
|
|
|
|
this.$telemetry.track('User clicked credential modal docs link', {
|
|
|
|
docs_link: this.documentationUrl,
|
|
|
|
credential_type: this.credentialTypeName,
|
|
|
|
source: 'modal',
|
2022-11-04 06:04:31 -07:00
|
|
|
workflow_id: this.workflowsStore.workflowId,
|
2021-10-18 20:57:49 -07:00
|
|
|
});
|
|
|
|
},
|
2023-01-27 00:05:43 -08:00
|
|
|
onAuthTypeChange(newType: string): void {
|
|
|
|
this.$emit('authTypeChanged', newType);
|
|
|
|
},
|
2021-09-11 01:15:36 -07:00
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
showOAuthSuccessBanner(newValue, oldValue) {
|
|
|
|
if (newValue && !oldValue) {
|
|
|
|
this.$emit('scrollToTop');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.container {
|
2022-08-30 02:10:17 -07:00
|
|
|
--notice-margin: 0;
|
2021-09-11 01:15:36 -07:00
|
|
|
> * {
|
|
|
|
margin-bottom: var(--spacing-l);
|
|
|
|
}
|
|
|
|
}
|
2023-01-25 06:25:11 -08:00
|
|
|
.googleReconnectLabel {
|
|
|
|
margin-right: var(--spacing-3xs);
|
|
|
|
}
|
2021-09-11 01:15:36 -07:00
|
|
|
</style>
|