Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"pluralize": "^8.0.0",
"qs": "^6.11.1",
"socket.io-client": "^4.6.1",
"unleash-proxy-client": "^2.4.3",
"uuid": "8.3.0",
"vite": "^4.4.7",
"vue": "^3.3.1",
Expand Down
2 changes: 0 additions & 2 deletions frontend/scripts/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ declare -a ENV_VARIABLES=(
"VUE_APP_STRIPE_GROWTH_PLAN_PAYMENT_LINK"
"VUE_APP_STRIPE_EAGLE_EYE_PLAN_PAYMENT_LINK"
"VUE_APP_STRIPE_CUSTOMER_PORTAL_LINK"
"VUE_APP_UNLEASH_URL"
"VUE_APP_UNLEASH_API_KEY"
"VUE_APP_IS_GIT_ENABLED"
"VUE_APP_AUTH0_DOMAIN"
"VUE_APP_AUTH0_CLIENT_ID"
Expand Down
11 changes: 1 addition & 10 deletions frontend/src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
</template>

<script>
import { mapActions, mapState } from 'vuex';
import { mapActions } from 'vuex';
import AppResizePage from '@/modules/layout/pages/resize-page.vue';
import { FeatureFlag } from '@/utils/featureFlag';
import { mapActions as piniaMapActions, storeToRefs } from 'pinia';
import { useActivityStore } from '@/modules/activity/store/pinia';
import { useActivityTypeStore } from '@/modules/activity/store/type';
Expand Down Expand Up @@ -49,12 +48,6 @@ export default {
};
},

computed: {
...mapState({
featureFlag: (state) => state.tenant.featureFlag,
}),
},

watch: {
tenant: {
handler(tenant, oldTenant) {
Expand All @@ -67,8 +60,6 @@ export default {
},

async created() {
FeatureFlag.init(this.tenant);

window.addEventListener('resize', this.handleResize);
this.handleResize();
const queryParameters = new URLSearchParams(window.location.search);
Expand Down
8 changes: 0 additions & 8 deletions frontend/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ const defaultConfig = {
env: import.meta.env.VUE_APP_ENV,
hotjarKey: import.meta.env.VUE_APP_HOTJAR_KEY,
nangoUrl: import.meta.env.VUE_APP_NANGO_URL,
unleash: {
apiKey: import.meta.env.VUE_APP_UNLEASH_API_KEY,
url: import.meta.env.VUE_APP_UNLEASH_URL,
},
formbricks: {
url: import.meta.env.VUE_APP_FORMBRICKS_URL,
environmentId: import.meta.env.VUE_APP_FORMBRICKS_ENVIRONMENT_ID,
Expand Down Expand Up @@ -97,10 +93,6 @@ const composedConfig = {
nangoUrl: 'CROWD_VUE_APP_NANGO_URL',
typeformId: 'CROWD_VUE_APP_TYPEFORM_ID',
typeformTitle: 'CROWD_VUE_APP_TYPEFORM_TITLE',
unleash: {
apiKey: 'CROWD_VUE_APP_UNLEASH_API_KEY',
url: 'CROWD_VUE_APP_UNLEASH_URL',
},
formbricks: {
url: 'CROWD_VUE_APP_FORMBRICKS_URL',
environmentId: 'CROWD_VUE_APP_FORMBRICKS_ENVIRONMENT_ID',
Expand Down
21 changes: 3 additions & 18 deletions frontend/src/integrations/hubspot/components/hubspot-connect.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
<template>
<slot
:connect="isHubspotEnabled ? connect : upgradePlan"
:connect="connect"
:settings="settings"
:has-settings="true"
:has-integration="isHubspotEnabled"
:has-integration="true"
/>
<app-hubspot-settings-drawer v-if="openSettingsDrawer" v-model="openSettingsDrawer" />
</template>

<script setup lang="ts">
import {
defineProps, onMounted,
defineProps,
ref,
} from 'vue';
import Nango from '@nangohq/frontend';
import config from '@/config';
import AppHubspotSettingsDrawer from '@/integrations/hubspot/components/hubspot-settings-drawer.vue';
import { mapActions } from '@/shared/vuex/vuex.helpers';
import { useRouter } from 'vue-router';
import { FeatureFlag } from '@/utils/featureFlag';
import { useAuthStore } from '@/modules/auth/store/auth.store';
import { storeToRefs } from 'pinia';

Expand All @@ -29,16 +27,12 @@ defineProps({
},
});

const router = useRouter();

const authStore = useAuthStore();
const { tenant } = storeToRefs(authStore);
const { doHubspotConnect } = mapActions('integration');

const openSettingsDrawer = ref<boolean>(false);

const isHubspotEnabled = ref(false);

const connect = () => {
const nango = new Nango({ host: config.nangoUrl });
nango.auth(
Expand All @@ -51,19 +45,10 @@ const connect = () => {
});
};

const upgradePlan = () => {
router.push('/settings?activeTab=plans');
};

const settings = () => {
openSettingsDrawer.value = true;
};

onMounted(async () => {
isHubspotEnabled.value = FeatureFlag.isFlagEnabled(
FeatureFlag.flags.hubspot,
);
});
</script>

<script lang="ts">
Expand Down
15 changes: 0 additions & 15 deletions frontend/src/modules/automation/components/automation-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@
<div class="pl-2">
<h6 class="text-xs leading-5 font-medium mb-0.5 text-gray-900">
{{ automationType.name }}
<sup v-if="plan(automationType)" class="text-primary-500">
{{ plan(automationType) }}
</sup>
</h6>
<p class="text-2xs leading-4.5 text-gray-500 text-left break-normal">
{{ automationType.description }}
Expand Down Expand Up @@ -131,9 +128,7 @@ import pluralize from 'pluralize';
import AppAutomationForm from '@/modules/automation/components/automation-form.vue';
import AppAutomationListTable from '@/modules/automation/components/list/automation-list-table.vue';
import AppAutomationExecutions from '@/modules/automation/components/automation-executions.vue';
import { FeatureFlag } from '@/utils/featureFlag';
import { useStore } from 'vuex';
import config from '@/config';
import usePermissions from '@/shared/modules/permissions/helpers/usePermissions';
import { LfPermission } from '@/shared/modules/permissions/types/Permissions';
import LfIcon from '@/ui-kit/icon/Icon.vue';
Expand Down Expand Up @@ -182,16 +177,6 @@ const updateAutomation = (automation) => {
editAutomation.value = automation;
};

const plan = (type) => {
if (type.plan && type.featureFlag && !FeatureFlag.isFlagEnabled(type.featureFlag)) {
if (config.isCommunityVersion) {
return 'Premium';
}
return type.plan;
}
return null;
};

onMounted(async () => {
fetchIntegrations();
getAutomations();
Expand Down
29 changes: 1 addition & 28 deletions frontend/src/modules/automation/components/automation-toggle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
:model-value="props.automation.state === 'active'"
class="!grow-0 !ml-0"
:disabled="!canEnable || !hasPermission(LfPermission.automationEdit)"
:before-change="beforeChange"
:before-change="true"
@change="handleChange"
/>
<span class="ml-2 text-gray-900 text-sm">
Expand All @@ -17,10 +17,6 @@
import { computed, defineProps } from 'vue';
import { useAutomationStore } from '@/modules/automation/store';
import { useStore } from 'vuex';
import { getWorkflowMax, showWorkflowLimitDialog } from '@/modules/automation/automation-limit';
import { FeatureFlag } from '@/utils/featureFlag';
import { useAuthStore } from '@/modules/auth/store/auth.store';
import { storeToRefs } from 'pinia';
import usePermissions from '@/shared/modules/permissions/helpers/usePermissions';
import { LfPermission } from '@/shared/modules/permissions/types/Permissions';
import { automationTypes } from '../config/automation-types';
Expand All @@ -38,9 +34,6 @@ const { hasPermission } = usePermissions();

const { changePublishState } = useAutomationStore();

const authStore = useAuthStore();
const { tenant } = storeToRefs(authStore);

const canEnable = computed(() => {
const { type } = props.automation;

Expand All @@ -51,26 +44,6 @@ const canEnable = computed(() => {
return true;
});

const beforeChange = () => {
if (props.automation.state === 'active') {
return true;
}

const isFeatureEnabled = FeatureFlag.isFlagEnabled(
FeatureFlag.flags.automations,
);

if (!isFeatureEnabled) {
const planWorkflowCountMax = getWorkflowMax(
tenant.value.plan,
);

showWorkflowLimitDialog({ planWorkflowCountMax });
}

return isFeatureEnabled;
};

const handleChange = (value) => {
changePublishState(props.automation.id, value);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export interface AutomationTypeConfig {
description: string; // Description shown under name in dropdown
icon: string; // Icon of the automation type
plan?: string; // Plan name
featureFlag?: string; // Plan name
canCreate: (store: any) => boolean; // method if creation of that automation type is disabled
actionButton?: (store: any) => AutomationTypeAction | null; // Action button to show in dropdown
disabled?: (store: any) => boolean | string; // If dropdown option is disabled
Expand Down
11 changes: 9 additions & 2 deletions frontend/src/modules/eagle-eye/pages/eagle-eye-onboard-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import {
} from 'vue';
import { onBeforeRouteLeave, useRouter } from 'vue-router';
import { useStore } from 'vuex';
import { FeatureFlag } from '@/utils/featureFlag';
import EagleEyeBanner from '@/modules/eagle-eye/components/onboard/eagle-eye-banner.vue';
import EagleEyeIntro from '@/modules/eagle-eye/components/onboard/eagle-eye-intro-step.vue';
import EagleEyeKeywords from '@/modules/eagle-eye/components/onboard/eagle-eye-keywords-step.vue';
Expand All @@ -55,6 +54,7 @@ import publishedDateOptions from '@/modules/eagle-eye/constants/eagle-eye-date-p
import platformOptions from '@/modules/eagle-eye/constants/eagle-eye-platforms.json';
import ConfirmDialog from '@/shared/dialog/confirm-dialog';
import { mapActions } from '@/shared/vuex/vuex.helpers';
import config from '@/config';

const store = useStore();
const router = useRouter();
Expand All @@ -76,11 +76,18 @@ const form = reactive({
}), {}),
});

const isPremiumFeatureCopy = () => {
if (config.isCommunityVersion) {
return 'Enterprise';
}
return 'Scale';
};

const headerContent = computed(() => {
if (step.value === 1) {
return {
title: 'Community Lens',
preTitle: `${FeatureFlag.premiumFeatureCopy()} App`,
preTitle: `${isPremiumFeatureCopy()} App`,
showImage: true,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
</button>
</router-link>
<button
v-if="isFindGitHubFeatureEnabled"
class="h-10 el-dropdown-menu__item w-full mb-1"
type="button"
:disabled="isFindingGitHubDisabled"
Expand Down Expand Up @@ -188,7 +187,6 @@ import Message from '@/shared/message/message';
import ConfirmDialog from '@/shared/dialog/confirm-dialog';
import { useMemberStore } from '@/modules/member/store/pinia';
import { HubspotApiService } from '@/integrations/hubspot/hubspot.api.service';
import { FEATURE_FLAGS, FeatureFlag } from '@/utils/featureFlag';
import { useRoute } from 'vue-router';
import { computed } from 'vue';
import { storeToRefs } from 'pinia';
Expand Down Expand Up @@ -258,10 +256,6 @@ const isFindingGitHubDisabled = computed(() => (
!!props.member.username?.github
));

const isFindGitHubFeatureEnabled = computed(() => FeatureFlag.isFlagEnabled(
FEATURE_FLAGS.findGitHub,
));

const doManualAction = async ({
loadingMessage,
actionFn,
Expand Down
38 changes: 0 additions & 38 deletions frontend/src/modules/member/member-enrichment.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { router } from '@/router';
import ConfirmDialog from '@/shared/dialog/confirm-dialog';
import { formatNumber } from '@/utils/number';
import Message from '@/shared/message/message';
import { FeatureFlag, FEATURE_FLAGS } from '@/utils/featureFlag';

const scaleEnrichmentMax = 10000;
const growthEnrichmentMax = 1000;
Expand Down Expand Up @@ -35,43 +34,6 @@ export const getEnrichmentMax = (plan) => {
return essentialEnrichmentMax;
};

/**
* @param {*} planEnrichmentCountMax maximum plan enrichment count
* @returns if enrichment has reached limit
*/
export const checkEnrichmentLimit = (
planEnrichmentCountMax,
) => {
const isFeatureEnabled = FeatureFlag.isFlagEnabled(
FEATURE_FLAGS.memberEnrichment,
);

if (planEnrichmentCountMax === 'unlimited') {
return false;
}

if (!isFeatureEnabled) {
ConfirmDialog({
vertical: true,
type: 'danger',
title: `You have reached the limit of ${formatNumber(
planEnrichmentCountMax,
)} enrichments per month on your current plan`,
message:
'Upgrade your plan in order to increase your quota of available profile enrichments.',
icon: 'ri-error-warning-line',
confirmButtonText: 'Upgrade plan',
showCancelButton: false,
}).then(() => {
router.push('/settings?activeTab=plans');
});

return true;
}

return false;
};

export const checkEnrichmentPlan = ({
enrichmentCount,
planEnrichmentCountMax,
Expand Down
Loading
Loading