Skip to content

Commit

Permalink
Remove billing feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
SokratisVidros committed Jun 12, 2024
1 parent 65622dc commit fa83ff6
Show file tree
Hide file tree
Showing 32 changed files with 5 additions and 80 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import { FeatureFlagsKeysEnum } from '@novu/shared';
import { IS_DOCKER_HOSTED, useFeatureFlag } from '@novu/shared-web';
import { IS_DOCKER_HOSTED } from '@novu/shared-web';

export function FreeTrialBanner() {
const isEnabled = useFeatureFlag(FeatureFlagsKeysEnum.IS_BILLING_REVERSE_TRIAL_ENABLED);

if (IS_DOCKER_HOSTED) {
return null;
}

if (!isEnabled) {
return null;
}

try {
const module = require('@novu/ee-billing-web');
const Component = module.FreeTrialBanner;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import { FeatureFlagsKeysEnum } from '@novu/shared';
import { IS_DOCKER_HOSTED, useFeatureFlag } from '@novu/shared-web';
import { IS_DOCKER_HOSTED } from '@novu/shared-web';

export const FreeTrialSidebarWidget = () => {
const isEnabled = useFeatureFlag(FeatureFlagsKeysEnum.IS_BILLING_REVERSE_TRIAL_ENABLED);

if (IS_DOCKER_HOSTED) {
return null;
}

if (!isEnabled) {
return null;
}

try {
const module = require('@novu/ee-billing-web');
const Component = module.FreeTrialSidebarWidget;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import { FeatureFlagsKeysEnum } from '@novu/shared';
import { IS_DOCKER_HOSTED, useFeatureFlag } from '@novu/shared-web';
import { IS_DOCKER_HOSTED } from '@novu/shared-web';
import { FC } from 'react';

export function UpgradePlanBanner({ FeatureActivatedBanner }: { FeatureActivatedBanner: FC }) {
const isEnabled = useFeatureFlag(FeatureFlagsKeysEnum.IS_BILLING_REVERSE_TRIAL_ENABLED);

if (IS_DOCKER_HOSTED) {
return null;
}

if (!isEnabled) {
return null;
}

try {
const module = require('@novu/ee-billing-web');
const Component = module.UpgradePlanBanner;
Expand Down
5 changes: 1 addition & 4 deletions apps/web/src/pages/settings/SettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export function SettingsPage() {
const { classes } = useTabsStyles(false);
const navigate = useNavigate();
const { pathname } = useLocation();
const billingEnabled = useFeatureFlag(FeatureFlagsKeysEnum.IS_BILLING_ENABLED);
const isInformationArchitectureEnabled = useFeatureFlag(FeatureFlagsKeysEnum.IS_INFORMATION_ARCHITECTURE_ENABLED);

const value = useMemo(() => {
Expand Down Expand Up @@ -68,9 +67,7 @@ export function SettingsPage() {
<Tabs.List>
<Tabs.Tab value="/">API Keys</Tabs.Tab>
<Tabs.Tab value="/email">Email Settings</Tabs.Tab>
<When truthy={billingEnabled}>
<Tabs.Tab value="/billing">Billing</Tabs.Tab>
</When>
<Tabs.Tab value="/billing">Billing</Tabs.Tab>
<When truthy={isInformationArchitectureEnabled}>
<Tabs.Tab value="/brand">Branding</Tabs.Tab>
<Tabs.Tab value="/team">Team Members</Tabs.Tab>
Expand Down
2 changes: 0 additions & 2 deletions apps/web/tests/activities-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
4 changes: 1 addition & 3 deletions apps/web/tests/api-keys.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});

test('should show/hide the API key, and display the application and environment identifierw', async ({ page }) => {
test('should show/hide the API key, and display the application and environment identifier', async ({ page }) => {
const apiKeysPage = await ApiKeysPage.goTo(page);
const apiKeyContainer = apiKeysPage.getApiKeyContainer();
const apiKey = session.environment.apiKeys[0].key;
Expand Down
4 changes: 0 additions & 4 deletions apps/web/tests/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ test.beforeEach(async ({ page }) => {
IS_IMPROVED_ONBOARDING_ENABLED: true,
IS_HUBSPOT_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down Expand Up @@ -64,8 +62,6 @@ test('should redirect to the dashboard page when a token exists in query', async
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: true,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});

Expand Down
2 changes: 0 additions & 2 deletions apps/web/tests/billing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ test.describe('Billing', () => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: true,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
2 changes: 0 additions & 2 deletions apps/web/tests/brand.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
2 changes: 0 additions & 2 deletions apps/web/tests/changes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
4 changes: 0 additions & 4 deletions apps/web/tests/create-notification.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ test.describe('Creation functionality', () => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down Expand Up @@ -114,8 +112,6 @@ test.describe('Creation functionality', () => {
newSession.featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
2 changes: 0 additions & 2 deletions apps/web/tests/debugging-test-trigger.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
2 changes: 0 additions & 2 deletions apps/web/tests/drag-and-drop.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
IS_BILLING_ENABLED: false,
});
});

Expand Down
2 changes: 0 additions & 2 deletions apps/web/tests/environment-switch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
2 changes: 0 additions & 2 deletions apps/web/tests/explore.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
2 changes: 0 additions & 2 deletions apps/web/tests/header.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ test.describe('App Header', () => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
user = session.user;
Expand Down
2 changes: 0 additions & 2 deletions apps/web/tests/integrations-list-modal.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
2 changes: 0 additions & 2 deletions apps/web/tests/integrations-list-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
2 changes: 0 additions & 2 deletions apps/web/tests/invites.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ test.describe('Invites', () => {
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_HUBSPOT_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
2 changes: 0 additions & 2 deletions apps/web/tests/main-functionality.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
1 change: 0 additions & 1 deletion apps/web/tests/navbar-sidebar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ test.describe('Main Nav (Sidebar)', () => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
1 change: 0 additions & 1 deletion apps/web/tests/organization-switch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ test.beforeEach(async ({ context, page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
1 change: 0 additions & 1 deletion apps/web/tests/start-from-scratch-tour.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
1 change: 0 additions & 1 deletion apps/web/tests/steps-actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
1 change: 0 additions & 1 deletion apps/web/tests/subscribers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: true,
});
});
Expand Down
2 changes: 0 additions & 2 deletions apps/web/tests/team-members.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
IS_BILLING_ENABLED: false,
});
});

Expand Down
1 change: 0 additions & 1 deletion apps/web/tests/templates-store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: true,
});
});
Expand Down
1 change: 0 additions & 1 deletion apps/web/tests/tenants.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
1 change: 0 additions & 1 deletion apps/web/tests/translations.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ test.describe('Translations', () => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
2 changes: 0 additions & 2 deletions apps/web/tests/variants.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ test.beforeEach(async ({ page }) => {
featureFlagsMock.setFlagsToMock({
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_BILLING_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
});
});
Expand Down
1 change: 0 additions & 1 deletion apps/web/tests/workflows.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ let featureFlagsMock: FeatureFlagsMock;
const WORKFLOWS_ACTIVE_FEATURE_FLAGS = {
IS_IMPROVED_ONBOARDING_ENABLED: false,
IS_INFORMATION_ARCHITECTURE_ENABLED: true,
IS_BILLING_REVERSE_TRIAL_ENABLED: false,
IS_TEMPLATE_STORE_ENABLED: false,
};
test.describe('Workflows tests without templates', () => {
Expand Down
2 changes: 0 additions & 2 deletions libs/shared/src/types/feature-flags/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ export enum FeatureFlagsKeysEnum {
IS_API_RATE_LIMITING_ENABLED = 'IS_API_RATE_LIMITING_ENABLED',
IS_API_IDEMPOTENCY_ENABLED = 'IS_API_IDEMPOTENCY_ENABLED',
IS_API_EXECUTION_LOG_QUEUE_ENABLED = 'IS_API_EXECUTION_LOG_QUEUE_ENABLED',
IS_BILLING_ENABLED = 'IS_BILLING_ENABLED',
IS_ECHO_ENABLED = 'IS_ECHO_ENABLED',
IS_IMPROVED_ONBOARDING_ENABLED = 'IS_IMPROVED_ONBOARDING_ENABLED',
IS_NEW_MESSAGES_API_RESPONSE_ENABLED = 'IS_NEW_MESSAGES_API_RESPONSE_ENABLED',
IS_INFORMATION_ARCHITECTURE_ENABLED = 'IS_INFORMATION_ARCHITECTURE_ENABLED',
IS_BILLING_REVERSE_TRIAL_ENABLED = 'IS_BILLING_REVERSE_TRIAL_ENABLED',
IS_HUBSPOT_ONBOARDING_ENABLED = 'IS_HUBSPOT_ONBOARDING_ENABLED',
IS_QUOTA_LIMITING_ENABLED = 'IS_QUOTA_LIMITING_ENABLED',
IS_EVENT_QUOTA_LIMITING_ENABLED = 'IS_EVENT_QUOTA_LIMITING_ENABLED',
Expand Down

0 comments on commit fa83ff6

Please sign in to comment.