mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-03 00:06:56 +00:00
fix: various gating
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -90,6 +90,8 @@ export const useEeConfig = createSharedComposable(() => {
|
||||
|
||||
const blockAiChat = computed(() => true)
|
||||
|
||||
const blockAiIntegrations = computed(() => true)
|
||||
|
||||
const blockDocAi = computed(() => true)
|
||||
|
||||
const blockButtonVisibility = computed(() => true)
|
||||
@@ -212,6 +214,8 @@ export const useEeConfig = createSharedComposable(() => {
|
||||
|
||||
const showUpgradeToUseAiChat = (..._args: any[]) => {}
|
||||
|
||||
const showUpgradeToUseAiIntegrations = (..._args: any[]) => {}
|
||||
|
||||
const showUpgradeToUseDocAi = (..._args: any[]) => {}
|
||||
|
||||
const showUpgradeToUseButtonVisibility = (..._args: any[]) => {}
|
||||
@@ -358,6 +362,8 @@ export const useEeConfig = createSharedComposable(() => {
|
||||
showUpgradeToUseAiButtonField,
|
||||
blockAiChat,
|
||||
showUpgradeToUseAiChat,
|
||||
blockAiIntegrations,
|
||||
showUpgradeToUseAiIntegrations,
|
||||
blockDocAi,
|
||||
showUpgradeToUseDocAi,
|
||||
blockButtonVisibility,
|
||||
|
||||
@@ -209,6 +209,8 @@
|
||||
"upgradeToUseAiButtonFieldSubtitle": "Upgrade to the {plan} plan to let AI Button use record data with NocoAI to fill multiple fields automatically.",
|
||||
"upgradeToUseAiChat": "Upgrade to use AI Chat",
|
||||
"upgradeToUseAiChatSubtitle": "Upgrade to the {plan} plan to use AI Chat to manage your base with natural language.",
|
||||
"upgradeToUseAiIntegrations": "Upgrade to add AI Integrations",
|
||||
"upgradeToUseAiIntegrationsSubtitle": "Upgrade to the {plan} plan to connect your own AI provider.",
|
||||
"upgradeToUseDocAi": "Upgrade to use Document AI",
|
||||
"upgradeToUseDocAiSubtitle": "Upgrade to the {plan} plan to use AI writing, summarization, and translation in documents.",
|
||||
"upgradeToUseColourField": "Upgrade to use Colour fields",
|
||||
|
||||
Reference in New Issue
Block a user