From f2f886b3791ed8e568441f9cc32c0c788952f37a Mon Sep 17 00:00:00 2001 From: garrrikkotua Date: Thu, 12 Sep 2024 14:39:14 +0400 Subject: [PATCH] add noconnect state when connecting outside cm --- .../integrations/github/components/github-connect-modal.vue | 3 ++- .../src/modules/integration/components/integration-list.vue | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/integrations/github/components/github-connect-modal.vue b/frontend/src/integrations/github/components/github-connect-modal.vue index c8ef99051..f08fd42ad 100644 --- a/frontend/src/integrations/github/components/github-connect-modal.vue +++ b/frontend/src/integrations/github/components/github-connect-modal.vue @@ -181,7 +181,8 @@ const openGithubInstallation = () => window.open(config.gitHubInstallationUrl, ' const copy = () => { if (navigator.clipboard) { - navigator.clipboard.writeText(config.gitHubInstallationUrl); + const urlWithState = `${config.gitHubInstallationUrl}?state=noconnect`; + navigator.clipboard.writeText(urlWithState); copied.value = true; setTimeout(() => { copied.value = false; diff --git a/frontend/src/modules/integration/components/integration-list.vue b/frontend/src/modules/integration/components/integration-list.vue index f16f3174b..dc4e510e1 100644 --- a/frontend/src/modules/integration/components/integration-list.vue +++ b/frontend/src/modules/integration/components/integration-list.vue @@ -137,6 +137,12 @@ onMounted(async () => { }); showGitlabDialog.value = false; } else { + const state = params.get('state'); + + if (state === 'noconnect') { + return; + } + showGithubDialog.value = true; await store.dispatch('integration/doGithubConnect', { code,