fix: hide linear card when not enabled (#12918)
The Linear card now only appears in conversation sidebar when: - The linear_integration feature flag is enabled for the account - LINEAR_CLIENT_ID is configured (inferred from the integration existing in the store) This matches the backend behavior: if LINEAR_CLIENT_ID is not set, the integration is filtered out of the API response, so it won't exist in the store. In addition, I discovered that Settings/Integrations page showed Linear card even if it was disabled but Linear client_id set. Now the Linear card shows only if both conditions are met. Fixes #12909 ## How Has This Been Tested? #### Before https://github.com/user-attachments/assets/cd21b881-5332-48f8-b230-662abc256ba2 #### After https://github.com/user-attachments/assets/d794cc2e-19d6-4545-b2ef-3af054c2ac81 --------- Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com> Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
This commit is contained in:
committed by
GitHub
parent
3051da1e44
commit
aa21c15d0e
@@ -5,7 +5,9 @@ import {
|
|||||||
useFunctionGetter,
|
useFunctionGetter,
|
||||||
useStore,
|
useStore,
|
||||||
} from 'dashboard/composables/store';
|
} from 'dashboard/composables/store';
|
||||||
|
import { useAccount } from 'dashboard/composables/useAccount';
|
||||||
import { useUISettings } from 'dashboard/composables/useUISettings';
|
import { useUISettings } from 'dashboard/composables/useUISettings';
|
||||||
|
import { FEATURE_FLAGS } from 'dashboard/featureFlags';
|
||||||
|
|
||||||
import AccordionItem from 'dashboard/components/Accordion/AccordionItem.vue';
|
import AccordionItem from 'dashboard/components/Accordion/AccordionItem.vue';
|
||||||
import ContactConversations from './ContactConversations.vue';
|
import ContactConversations from './ContactConversations.vue';
|
||||||
@@ -52,12 +54,22 @@ const isShopifyFeatureEnabled = computed(
|
|||||||
() => shopifyIntegration.value.enabled
|
() => shopifyIntegration.value.enabled
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const { isCloudFeatureEnabled } = useAccount();
|
||||||
|
|
||||||
|
const isLinearFeatureEnabled = computed(() =>
|
||||||
|
isCloudFeatureEnabled(FEATURE_FLAGS.LINEAR)
|
||||||
|
);
|
||||||
|
|
||||||
const linearIntegration = useFunctionGetter(
|
const linearIntegration = useFunctionGetter(
|
||||||
'integrations/getIntegration',
|
'integrations/getIntegration',
|
||||||
'linear'
|
'linear'
|
||||||
);
|
);
|
||||||
|
|
||||||
const isLinearIntegrationEnabled = computed(
|
const isLinearClientIdConfigured = computed(() => {
|
||||||
|
return !!linearIntegration.value?.id;
|
||||||
|
});
|
||||||
|
|
||||||
|
const isLinearConnected = computed(
|
||||||
() => linearIntegration.value?.enabled || false
|
() => linearIntegration.value?.enabled || false
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -238,7 +250,13 @@ onMounted(() => {
|
|||||||
<MacrosList :conversation-id="conversationId" />
|
<MacrosList :conversation-id="conversationId" />
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
</woot-feature-toggle>
|
</woot-feature-toggle>
|
||||||
<div v-else-if="element.name === 'linear_issues'">
|
<div
|
||||||
|
v-else-if="
|
||||||
|
element.name === 'linear_issues' &&
|
||||||
|
isLinearFeatureEnabled &&
|
||||||
|
isLinearClientIdConfigured
|
||||||
|
"
|
||||||
|
>
|
||||||
<AccordionItem
|
<AccordionItem
|
||||||
:title="$t('CONVERSATION_SIDEBAR.ACCORDION.LINEAR_ISSUES')"
|
:title="$t('CONVERSATION_SIDEBAR.ACCORDION.LINEAR_ISSUES')"
|
||||||
:is-open="isContactSidebarItemOpen('is_linear_issues_open')"
|
:is-open="isContactSidebarItemOpen('is_linear_issues_open')"
|
||||||
@@ -247,7 +265,7 @@ onMounted(() => {
|
|||||||
value => toggleSidebarUIState('is_linear_issues_open', value)
|
value => toggleSidebarUIState('is_linear_issues_open', value)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<LinearSetupCTA v-if="!isLinearIntegrationEnabled" />
|
<LinearSetupCTA v-if="!isLinearConnected" />
|
||||||
<LinearIssuesList v-else :conversation-id="conversationId" />
|
<LinearIssuesList v-else :conversation-id="conversationId" />
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class Integrations::App
|
|||||||
when 'slack'
|
when 'slack'
|
||||||
GlobalConfigService.load('SLACK_CLIENT_SECRET', nil).present?
|
GlobalConfigService.load('SLACK_CLIENT_SECRET', nil).present?
|
||||||
when 'linear'
|
when 'linear'
|
||||||
GlobalConfigService.load('LINEAR_CLIENT_ID', nil).present?
|
account.feature_enabled?('linear_integration') && GlobalConfigService.load('LINEAR_CLIENT_ID', nil).present?
|
||||||
when 'shopify'
|
when 'shopify'
|
||||||
shopify_enabled?(account)
|
shopify_enabled?(account)
|
||||||
when 'leadsquared'
|
when 'leadsquared'
|
||||||
|
|||||||
Reference in New Issue
Block a user