aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-06-17 16:52:46 +0200
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-06-17 16:52:46 +0200
commit2887eee3935e75640fc45111a904e78496dab62e (patch)
tree5ecd66727b8056f62771e20bb42fca9cfde1745c /src/features
parentMerge branch 'feature/3rd-party-limit' into feature/new-pricing (diff)
downloadferdium-app-2887eee3935e75640fc45111a904e78496dab62e.tar.gz
ferdium-app-2887eee3935e75640fc45111a904e78496dab62e.tar.zst
ferdium-app-2887eee3935e75640fc45111a904e78496dab62e.zip
Rename feature flags
Diffstat (limited to 'src/features')
-rw-r--r--src/features/communityRecipes/index.js4
-rw-r--r--src/features/communityRecipes/store.js2
-rw-r--r--src/features/serviceProxy/index.js8
-rw-r--r--src/features/spellchecker/index.js8
-rw-r--r--src/features/workspaces/store.js6
5 files changed, 14 insertions, 14 deletions
diff --git a/src/features/communityRecipes/index.js b/src/features/communityRecipes/index.js
index 78e87855e..4d050f90e 100644
--- a/src/features/communityRecipes/index.js
+++ b/src/features/communityRecipes/index.js
@@ -15,11 +15,11 @@ export default function initCommunityRecipes(stores, actions) {
15 // Toggle communityRecipe premium status 15 // Toggle communityRecipe premium status
16 reaction( 16 reaction(
17 () => ( 17 () => (
18 features.features.isCommunityRecipesPremiumFeature 18 features.features.isCommunityRecipesIncludedInCurrentPlan
19 ), 19 ),
20 (isPremiumFeature) => { 20 (isPremiumFeature) => {
21 debug('Community recipes is premium feature: ', isPremiumFeature); 21 debug('Community recipes is premium feature: ', isPremiumFeature);
22 communityRecipesStore.isCommunityRecipesPremiumFeature = isPremiumFeature; 22 communityRecipesStore.isCommunityRecipesIncludedInCurrentPlan = isPremiumFeature;
23 }, 23 },
24 { 24 {
25 fireImmediately: true, 25 fireImmediately: true,
diff --git a/src/features/communityRecipes/store.js b/src/features/communityRecipes/store.js
index 165b753e8..4d45c3b33 100644
--- a/src/features/communityRecipes/store.js
+++ b/src/features/communityRecipes/store.js
@@ -4,7 +4,7 @@ import { FeatureStore } from '../utils/FeatureStore';
4const debug = require('debug')('Franz:feature:communityRecipes:store'); 4const debug = require('debug')('Franz:feature:communityRecipes:store');
5 5
6export class CommunityRecipesStore extends FeatureStore { 6export class CommunityRecipesStore extends FeatureStore {
7 @observable isCommunityRecipesPremiumFeature = false; 7 @observable isCommunityRecipesIncludedInCurrentPlan = false;
8 8
9 start(stores, actions) { 9 start(stores, actions) {
10 debug('start'); 10 debug('start');
diff --git a/src/features/serviceProxy/index.js b/src/features/serviceProxy/index.js
index 4bea327ad..55c600de4 100644
--- a/src/features/serviceProxy/index.js
+++ b/src/features/serviceProxy/index.js
@@ -9,17 +9,17 @@ const debug = require('debug')('Franz:feature:serviceProxy');
9 9
10export const config = observable({ 10export const config = observable({
11 isEnabled: DEFAULT_FEATURES_CONFIG.isServiceProxyEnabled, 11 isEnabled: DEFAULT_FEATURES_CONFIG.isServiceProxyEnabled,
12 isPremium: DEFAULT_FEATURES_CONFIG.isServiceProxyPremiumFeature, 12 isPremium: DEFAULT_FEATURES_CONFIG.isServiceProxyIncludedInCurrentPlan,
13}); 13});
14 14
15export default function init(stores) { 15export default function init(stores) {
16 debug('Initializing `serviceProxy` feature'); 16 debug('Initializing `serviceProxy` feature');
17 17
18 autorun(() => { 18 autorun(() => {
19 const { isServiceProxyEnabled, isServiceProxyPremiumFeature } = stores.features.features; 19 const { isServiceProxyEnabled, isServiceProxyIncludedInCurrentPlan } = stores.features.features;
20 20
21 config.isEnabled = isServiceProxyEnabled !== undefined ? isServiceProxyEnabled : DEFAULT_FEATURES_CONFIG.isServiceProxyEnabled; 21 config.isEnabled = isServiceProxyEnabled !== undefined ? isServiceProxyEnabled : DEFAULT_FEATURES_CONFIG.isServiceProxyEnabled;
22 config.isPremium = isServiceProxyPremiumFeature !== undefined ? isServiceProxyPremiumFeature : DEFAULT_FEATURES_CONFIG.isServiceProxyPremiumFeature; 22 config.isIncludedInCurrentPlan = isServiceProxyIncludedInCurrentPlan !== undefined ? isServiceProxyIncludedInCurrentPlan : DEFAULT_FEATURES_CONFIG.isServiceProxyIncludedInCurrentPlan;
23 23
24 const services = stores.services.enabled; 24 const services = stores.services.enabled;
25 const isPremiumUser = stores.user.data.isPremium; 25 const isPremiumUser = stores.user.data.isPremium;
@@ -30,7 +30,7 @@ export default function init(stores) {
30 services.forEach((service) => { 30 services.forEach((service) => {
31 const s = session.fromPartition(`persist:service-${service.id}`); 31 const s = session.fromPartition(`persist:service-${service.id}`);
32 32
33 if (config.isEnabled && (isPremiumUser || !config.isPremium)) { 33 if (config.isEnabled && (isPremiumUser || !config.isIncludedInCurrentPlan)) {
34 const serviceProxyConfig = proxySettings[service.id]; 34 const serviceProxyConfig = proxySettings[service.id];
35 35
36 if (serviceProxyConfig && serviceProxyConfig.isEnabled && serviceProxyConfig.host) { 36 if (serviceProxyConfig && serviceProxyConfig.isEnabled && serviceProxyConfig.host) {
diff --git a/src/features/spellchecker/index.js b/src/features/spellchecker/index.js
index 79a2172b4..a07f9f63a 100644
--- a/src/features/spellchecker/index.js
+++ b/src/features/spellchecker/index.js
@@ -5,18 +5,18 @@ import { DEFAULT_FEATURES_CONFIG } from '../../config';
5const debug = require('debug')('Franz:feature:spellchecker'); 5const debug = require('debug')('Franz:feature:spellchecker');
6 6
7export const config = observable({ 7export const config = observable({
8 isPremium: DEFAULT_FEATURES_CONFIG.isSpellcheckerPremiumFeature, 8 isIncludedInCurrentPlan: DEFAULT_FEATURES_CONFIG.isSpellcheckerIncludedInCurrentPlan,
9}); 9});
10 10
11export default function init(stores) { 11export default function init(stores) {
12 debug('Initializing `spellchecker` feature'); 12 debug('Initializing `spellchecker` feature');
13 13
14 autorun(() => { 14 autorun(() => {
15 const { isSpellcheckerPremiumFeature } = stores.features.features; 15 const { isSpellcheckerIncludedInCurrentPlan } = stores.features.features;
16 16
17 config.isPremium = isSpellcheckerPremiumFeature !== undefined ? isSpellcheckerPremiumFeature : DEFAULT_FEATURES_CONFIG.isSpellcheckerPremiumFeature; 17 config.isIncludedInCurrentPlan = isSpellcheckerIncludedInCurrentPlan !== undefined ? isSpellcheckerIncludedInCurrentPlan : DEFAULT_FEATURES_CONFIG.isSpellcheckerIncludedInCurrentPlan;
18 18
19 if (!stores.user.data.isPremium && config.isPremium && stores.settings.app.enableSpellchecking) { 19 if (!stores.user.data.isPremium && config.isIncludedInCurrentPlan && stores.settings.app.enableSpellchecking) {
20 debug('Override settings.spellcheckerEnabled flag to false'); 20 debug('Override settings.spellcheckerEnabled flag to false');
21 21
22 Object.assign(stores.settings.app, { 22 Object.assign(stores.settings.app, {
diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js
index 07b16ff23..e1adc9cab 100644
--- a/src/features/workspaces/store.js
+++ b/src/features/workspaces/store.js
@@ -251,9 +251,9 @@ export default class WorkspacesStore extends FeatureStore {
251 _setIsPremiumFeatureReaction = () => { 251 _setIsPremiumFeatureReaction = () => {
252 const { features, user } = this.stores; 252 const { features, user } = this.stores;
253 const { isPremium } = user.data; 253 const { isPremium } = user.data;
254 const { isWorkspacePremiumFeature } = features.features; 254 const { isWorkspaceIncludedInCurrentPlan } = features.features;
255 this.isPremiumFeature = isWorkspacePremiumFeature; 255 this.isPremiumFeature = isWorkspaceIncludedInCurrentPlan;
256 this.isPremiumUpgradeRequired = isWorkspacePremiumFeature && !isPremium; 256 this.isPremiumUpgradeRequired = isWorkspaceIncludedInCurrentPlan && !isPremium;
257 }; 257 };
258 258
259 _setWorkspaceBeingEditedReaction = () => { 259 _setWorkspaceBeingEditedReaction = () => {