From 9e3bfe23f67dca8d31bcff8758ed5d076477f9f3 Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Tue, 25 Mar 2025 05:49:21 -0400 Subject: [PATCH] fix(editor): Check for when to show the community+ modal for the folder's feature (#14146) Co-authored-by: Milorad Filipovic --- .../frontend/editor-ui/src/views/WorkflowsView.vue | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/frontend/editor-ui/src/views/WorkflowsView.vue b/packages/frontend/editor-ui/src/views/WorkflowsView.vue index 107eafb4131..ef5f4737f8b 100644 --- a/packages/frontend/editor-ui/src/views/WorkflowsView.vue +++ b/packages/frontend/editor-ui/src/views/WorkflowsView.vue @@ -327,11 +327,16 @@ const hasFilters = computed(() => { ); }); -const isCommunity = computed(() => usageStore.planName.toLowerCase() === 'community'); +const isSelfHostedDeployment = computed(() => settingsStore.deploymentType === 'default'); + const canUserRegisterCommunityPlus = computed( () => getResourcePermissions(usersStore.currentUser?.globalScopes).community.register, ); +const showRegisteredCommunityCTA = computed( + () => isSelfHostedDeployment.value && !foldersEnabled.value && canUserRegisterCommunityPlus.value, +); + /** * WATCHERS, STORE SUBSCRIPTIONS AND EVENT BUS HANDLERS */ @@ -1042,8 +1047,8 @@ const renameFolder = async (folderId: string) => { }; const createFolderInCurrent = async () => { - // Show the community plus enrollment modal if the user is in a community plan - if (isCommunity.value && canUserRegisterCommunityPlus.value) { + // Show the community plus enrollment modal if the user is self-hosted, and hasn't enabled folders + if (showRegisteredCommunityCTA.value) { uiStore.openModalWithData({ name: COMMUNITY_PLUS_ENROLLMENT_MODAL, data: { customHeading: i18n.baseText('folders.registeredCommunity.cta.heading') }, @@ -1125,7 +1130,7 @@ const moveWorkflowToFolder = async (payload: { name: string; parentFolderId?: string; }) => { - if (isCommunity.value && canUserRegisterCommunityPlus.value) { + if (showRegisteredCommunityCTA.value) { uiStore.openModalWithData({ name: COMMUNITY_PLUS_ENROLLMENT_MODAL, data: { customHeading: i18n.baseText('folders.registeredCommunity.cta.heading') },