fix: various gating

This commit is contained in:
mertmit
2026-04-15 08:26:26 +00:00
parent 910c37d20a
commit 9873330cba
3 changed files with 22 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
<script lang="ts" setup>
import type { VNodeRef } from '@vue/runtime-core'
import { IntegrationCategoryType } from 'nocodb-sdk'
import { IntegrationCategoryType, PlanFeatureTypes } from 'nocodb-sdk'
import NcModal from '~/components/nc/Modal.vue'
import { type IntegrationItemType, SyncDataType } from '#imports'
@@ -42,7 +42,7 @@ const { activeWorkspace } = storeToRefs(useWorkspace())
const { isSyncFeatureEnabled } = storeToRefs(useSyncStore())
const { isEEFeatureBlocked } = useEeConfig()
const { isEEFeatureBlocked, blockAiIntegrations, showUpgradeToUseAiIntegrations } = useEeConfig()
const easterEggToggle = computed(() => isFeatureEnabled(FEATURE_FLAG.INTEGRATIONS))
@@ -238,6 +238,11 @@ const handleAddIntegration = async (category: IntegrationCategoryType, integrati
return
}
if (category === IntegrationCategoryType.AI && blockAiIntegrations.value) {
showUpgradeToUseAiIntegrations({})
return
}
await addIntegration(integration)
}
@@ -464,8 +469,14 @@ watch(activeViewTab, (value) => {
>
<div class="category-type-title flex gap-2">
{{ $t(category.title) }}
<LazyPaymentUpgradeBadge
v-if="category.value === IntegrationCategoryType.AI && blockAiIntegrations"
:feature="PlanFeatureTypes.FEATURE_AI_INTEGRATIONS"
:feature-enabled-callback="() => !blockAiIntegrations"
remove-click
/>
<NcBadge
v-if="!category.isAvailable"
v-else-if="!category.isAvailable"
:border="false"
class="text-nc-content-brand !h-5 bg-nc-bg-brand text-xs font-normal px-2"
>{{ $t('msg.toast.futureRelease') }}</NcBadge