Skip to content

Commit

Permalink
Update Feature Flags for new plans (#1622)
Browse files Browse the repository at this point in the history
  • Loading branch information
skwowet authored Oct 6, 2023
1 parent 3f1cca5 commit c0590a8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 55 deletions.
4 changes: 1 addition & 3 deletions backend/src/api/conversation/conversationSettingsUpdate.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import Error403 from '../../errors/Error403'
import isFeatureEnabled from '../../feature-flags/isFeatureEnabled'
import Permissions from '../../security/permissions'
import ConversationService from '../../services/conversationService'
import PermissionChecker from '../../services/user/permissionChecker'
import { FeatureFlag } from '../../types/common'

export default async (req, res) => {
new PermissionChecker(req).validateHas(Permissions.values.conversationEdit)

if (req.body.customUrl && !(await isFeatureEnabled(FeatureFlag.COMMUNITY_HELP_CENTER_PRO, req))) {
if (req.body.customUrl) {
await req.responseHandler.error(
req,
res,
Expand Down
45 changes: 0 additions & 45 deletions backend/src/bin/scripts/unleash-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,6 @@ const constaintConfiguration = {
},
],
],
[FeatureFlag.COMMUNITY_HELP_CENTER_PRO]: [
[
{
values: [Plans.values.growth],
inverted: false,
operator: 'IN',
contextName: 'plan',
caseInsensitive: false,
},
],
],
[FeatureFlag.CSV_EXPORT]: [
[
{
Expand Down Expand Up @@ -197,23 +186,6 @@ const constaintConfiguration = {
caseInsensitive: false,
},
],
[
{
values: [Plans.values.essential],
inverted: false,
operator: 'IN',
contextName: 'plan',
caseInsensitive: false,
},
{
value: PLAN_LIMITS[Plans.values.essential][FeatureFlag.MEMBER_ENRICHMENT].toString(),
values: [],
inverted: false,
operator: 'NUM_LT',
contextName: 'memberEnrichmentCount',
caseInsensitive: false,
},
],
],
[FeatureFlag.ORGANIZATION_ENRICHMENT]: [
[
Expand Down Expand Up @@ -250,23 +222,6 @@ const constaintConfiguration = {
caseInsensitive: false,
},
],
[
{
values: [Plans.values.essential],
inverted: false,
operator: 'IN',
contextName: 'plan',
caseInsensitive: false,
},
{
value: PLAN_LIMITS[Plans.values.essential][FeatureFlag.ORGANIZATION_ENRICHMENT].toString(),
values: [],
inverted: false,
operator: 'NUM_LT',
contextName: 'organizationEnrichmentCount',
caseInsensitive: false,
},
],
],
[FeatureFlag.SEGMENTS]: [],
}
Expand Down
10 changes: 4 additions & 6 deletions backend/src/feature-flags/isFeatureEnabled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export const PLAN_LIMITS = {
[Plans.values.essential]: {
[FeatureFlag.AUTOMATIONS]: 2,
[FeatureFlag.CSV_EXPORT]: 2,
[FeatureFlag.MEMBER_ENRICHMENT]: 5,
[FeatureFlag.ORGANIZATION_ENRICHMENT]: 5,
},
[Plans.values.growth]: {
[FeatureFlag.AUTOMATIONS]: 10,
Expand All @@ -19,10 +17,10 @@ export const PLAN_LIMITS = {
[FeatureFlag.ORGANIZATION_ENRICHMENT]: 200,
},
[Plans.values.scale]: {
[FeatureFlag.AUTOMATIONS]: 100,
[FeatureFlag.CSV_EXPORT]: 100,
[FeatureFlag.MEMBER_ENRICHMENT]: 10000,
[FeatureFlag.ORGANIZATION_ENRICHMENT]: 2000,
[FeatureFlag.AUTOMATIONS]: 20,
[FeatureFlag.CSV_EXPORT]: 20,
[FeatureFlag.MEMBER_ENRICHMENT]: Infinity,
[FeatureFlag.ORGANIZATION_ENRICHMENT]: Infinity,
},
[Plans.values.enterprise]: {
[FeatureFlag.AUTOMATIONS]: Infinity,
Expand Down
1 change: 0 additions & 1 deletion backend/src/types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export interface SearchCriteria {

export enum FeatureFlag {
AUTOMATIONS = 'automations',
COMMUNITY_HELP_CENTER_PRO = 'community-help-center-pro',
EAGLE_EYE = 'eagle-eye',
CSV_EXPORT = 'csv-export',
LINKEDIN = 'linkedin',
Expand Down

0 comments on commit c0590a8

Please sign in to comment.