aboutsummaryrefslogtreecommitdiffstats
path: root/src/containers/settings
diff options
context:
space:
mode:
Diffstat (limited to 'src/containers/settings')
-rw-r--r--src/containers/settings/AccountScreen.js20
-rw-r--r--src/containers/settings/EditServiceScreen.js3
-rw-r--r--src/containers/settings/EditSettingsScreen.js6
-rw-r--r--src/containers/settings/RecipesScreen.js4
-rw-r--r--src/containers/settings/TeamScreen.js3
5 files changed, 4 insertions, 32 deletions
diff --git a/src/containers/settings/AccountScreen.js b/src/containers/settings/AccountScreen.js
index db3b2a4a7..4ee932895 100644
--- a/src/containers/settings/AccountScreen.js
+++ b/src/containers/settings/AccountScreen.js
@@ -2,7 +2,6 @@ import React, { Component } from 'react';
2import PropTypes from 'prop-types'; 2import PropTypes from 'prop-types';
3import { inject, observer } from 'mobx-react'; 3import { inject, observer } from 'mobx-react';
4 4
5import PaymentStore from '../../stores/PaymentStore';
6import UserStore from '../../stores/UserStore'; 5import UserStore from '../../stores/UserStore';
7import AppStore from '../../stores/AppStore'; 6import AppStore from '../../stores/AppStore';
8import FeaturesStore from '../../stores/FeaturesStore'; 7import FeaturesStore from '../../stores/FeaturesStore';
@@ -24,10 +23,9 @@ class AccountScreen extends Component {
24 } 23 }
25 24
26 reloadData() { 25 reloadData() {
27 const { user, payment } = this.props.stores; 26 const { user } = this.props.stores;
28 27
29 user.getUserInfoRequest.reload(); 28 user.getUserInfoRequest.reload();
30 payment.plansRequest.reload();
31 } 29 }
32 30
33 handleWebsiteLink(route) { 31 handleWebsiteLink(route) {
@@ -50,26 +48,18 @@ class AccountScreen extends Component {
50 render() { 48 render() {
51 const { 49 const {
52 user, 50 user,
53 payment,
54 features,
55 settings, 51 settings,
56 } = this.props.stores; 52 } = this.props.stores;
57 const { user: userActions, payment: paymentActions } = this.props.actions; 53 const { user: userActions } = this.props.actions;
58 54
59 const isLoadingUserInfo = user.getUserInfoRequest.isExecuting; 55 const isLoadingUserInfo = user.getUserInfoRequest.isExecuting;
60 const isLoadingPlans = payment.plansRequest.isExecuting;
61
62 const { upgradeAccount } = paymentActions;
63 56
64 return ( 57 return (
65 <ErrorBoundary> 58 <ErrorBoundary>
66 <AccountDashboard 59 <AccountDashboard
67 server={settings.all.app.server} 60 server={settings.all.app.server}
68 user={user.data} 61 user={user.data}
69 isPremiumOverrideUser={user.isPremiumOverride}
70 isProUser={user.isPro}
71 isLoading={isLoadingUserInfo} 62 isLoading={isLoadingUserInfo}
72 isLoadingPlans={isLoadingPlans}
73 userInfoRequestFailed={ 63 userInfoRequestFailed={
74 user.getUserInfoRequest.wasExecuted 64 user.getUserInfoRequest.wasExecuted
75 && user.getUserInfoRequest.isError 65 && user.getUserInfoRequest.isError
@@ -83,10 +73,6 @@ class AccountScreen extends Component {
83 && !user.deleteAccountRequest.isError 73 && !user.deleteAccountRequest.isError
84 } 74 }
85 openEditAccount={() => this.handleWebsiteLink('/user/profile')} 75 openEditAccount={() => this.handleWebsiteLink('/user/profile')}
86 upgradeToPro={() => upgradeAccount({
87 planId: features.features.pricingConfig.plans.pro.yearly.id,
88 })}
89 openBilling={() => this.handleWebsiteLink('/user/billing')}
90 openInvoices={() => this.handleWebsiteLink('/user/invoices')} 76 openInvoices={() => this.handleWebsiteLink('/user/invoices')}
91 /> 77 />
92 </ErrorBoundary> 78 </ErrorBoundary>
@@ -98,12 +84,10 @@ AccountScreen.wrappedComponent.propTypes = {
98 stores: PropTypes.shape({ 84 stores: PropTypes.shape({
99 user: PropTypes.instanceOf(UserStore).isRequired, 85 user: PropTypes.instanceOf(UserStore).isRequired,
100 features: PropTypes.instanceOf(FeaturesStore).isRequired, 86 features: PropTypes.instanceOf(FeaturesStore).isRequired,
101 payment: PropTypes.instanceOf(PaymentStore).isRequired,
102 settings: PropTypes.instanceOf(SettingsStore).isRequired, 87 settings: PropTypes.instanceOf(SettingsStore).isRequired,
103 app: PropTypes.instanceOf(AppStore).isRequired, 88 app: PropTypes.instanceOf(AppStore).isRequired,
104 }).isRequired, 89 }).isRequired,
105 actions: PropTypes.shape({ 90 actions: PropTypes.shape({
106 payment: PropTypes.instanceOf(PaymentStore).isRequired,
107 app: PropTypes.instanceOf(AppStore).isRequired, 91 app: PropTypes.instanceOf(AppStore).isRequired,
108 user: PropTypes.instanceOf(UserStore).isRequired, 92 user: PropTypes.instanceOf(UserStore).isRequired,
109 }).isRequired, 93 }).isRequired,
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js
index ddf2d2d25..e22e91822 100644
--- a/src/containers/settings/EditServiceScreen.js
+++ b/src/containers/settings/EditServiceScreen.js
@@ -19,7 +19,6 @@ import { required, url, oneRequired } from '../../helpers/validation-helpers';
19import { getSelectOptions } from '../../helpers/i18n-helpers'; 19import { getSelectOptions } from '../../helpers/i18n-helpers';
20 20
21import { config as proxyFeature } from '../../features/serviceProxy'; 21import { config as proxyFeature } from '../../features/serviceProxy';
22import { config as spellcheckerFeature } from '../../features/spellchecker';
23 22
24import { SPELLCHECKER_LOCALES } from '../../i18n/languages'; 23import { SPELLCHECKER_LOCALES } from '../../i18n/languages';
25 24
@@ -399,8 +398,6 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex
399 onDelete={() => this.deleteService()} 398 onDelete={() => this.deleteService()}
400 openRecipeFile={file => this.openRecipeFile(file)} 399 openRecipeFile={file => this.openRecipeFile(file)}
401 isProxyFeatureEnabled={proxyFeature.isEnabled} 400 isProxyFeatureEnabled={proxyFeature.isEnabled}
402 isServiceProxyIncludedInCurrentPlan={proxyFeature.isIncludedInCurrentPlan}
403 isSpellcheckerIncludedInCurrentPlan={spellcheckerFeature.isIncludedInCurrentPlan}
404 isHibernationFeatureActive={settings.app.hibernate} 401 isHibernationFeatureActive={settings.app.hibernate}
405 /> 402 />
406 </ErrorBoundary> 403 </ErrorBoundary>
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js
index d601e03d4..3b8f03ae4 100644
--- a/src/containers/settings/EditSettingsScreen.js
+++ b/src/containers/settings/EditSettingsScreen.js
@@ -14,7 +14,6 @@ import {
14 DEFAULT_SETTING_KEEP_ALL_WORKSPACES_LOADED, DEFAULT_IS_FEATURE_ENABLED_BY_USER, 14 DEFAULT_SETTING_KEEP_ALL_WORKSPACES_LOADED, DEFAULT_IS_FEATURE_ENABLED_BY_USER,
15} from '../../config'; 15} from '../../config';
16import { DEFAULT_APP_SETTINGS, isMac } from '../../environment'; 16import { DEFAULT_APP_SETTINGS, isMac } from '../../environment';
17import { config as spellcheckerConfig } from '../../features/spellchecker';
18 17
19import { getSelectOptions } from '../../helpers/i18n-helpers'; 18import { getSelectOptions } from '../../helpers/i18n-helpers';
20import { hash } from '../../helpers/password-helpers'; 19import { hash } from '../../helpers/password-helpers';
@@ -516,8 +515,8 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e
516 }, 515 },
517 enableSpellchecking: { 516 enableSpellchecking: {
518 label: intl.formatMessage(messages.enableSpellchecking), 517 label: intl.formatMessage(messages.enableSpellchecking),
519 value: !this.props.stores.user.data.isPremium && !spellcheckerConfig.isIncludedInCurrentPlan ? false : settings.all.app.enableSpellchecking, 518 value: settings.all.app.enableSpellchecking,
520 default: !this.props.stores.user.data.isPremium && !spellcheckerConfig.isIncludedInCurrentPlan ? false : DEFAULT_APP_SETTINGS.enableSpellchecking, 519 default: DEFAULT_APP_SETTINGS.enableSpellchecking,
521 }, 520 },
522 spellcheckerLanguage: { 521 spellcheckerLanguage: {
523 label: intl.formatMessage(globalMessages.spellcheckerLanguage), 522 label: intl.formatMessage(globalMessages.spellcheckerLanguage),
@@ -650,7 +649,6 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e
650 getCacheSize={() => app.cacheSize} 649 getCacheSize={() => app.cacheSize}
651 isClearingAllCache={isClearingAllCache} 650 isClearingAllCache={isClearingAllCache}
652 onClearAllCache={clearAllCache} 651 onClearAllCache={clearAllCache}
653 isSpellcheckerIncludedInCurrentPlan={spellcheckerConfig.isIncludedInCurrentPlan}
654 isTodosEnabled={todos.isFeatureActive} 652 isTodosEnabled={todos.isFeatureActive}
655 isWorkspaceEnabled={workspaces.isFeatureActive} 653 isWorkspaceEnabled={workspaces.isFeatureActive}
656 lockingFeatureEnabled={lockingFeatureEnabled} 654 lockingFeatureEnabled={lockingFeatureEnabled}
diff --git a/src/containers/settings/RecipesScreen.js b/src/containers/settings/RecipesScreen.js
index f12f67b1f..9a16fd064 100644
--- a/src/containers/settings/RecipesScreen.js
+++ b/src/containers/settings/RecipesScreen.js
@@ -107,7 +107,6 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend
107 recipePreviews, 107 recipePreviews,
108 recipes, 108 recipes,
109 services, 109 services,
110 user,
111 } = this.props.stores; 110 } = this.props.stores;
112 111
113 const { 112 const {
@@ -155,7 +154,6 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend
155 customWebsiteRecipe={customWebsiteRecipe} 154 customWebsiteRecipe={customWebsiteRecipe}
156 isLoading={isLoading} 155 isLoading={isLoading}
157 addedServiceCount={services.all.length} 156 addedServiceCount={services.all.length}
158 isPremium={user.data.isPremium}
159 hasLoadedRecipes={recipePreviews.featuredRecipePreviewsRequest.wasExecuted} 157 hasLoadedRecipes={recipePreviews.featuredRecipePreviewsRequest.wasExecuted}
160 showAddServiceInterface={serviceActions.showAddServiceInterface} 158 showAddServiceInterface={serviceActions.showAddServiceInterface}
161 searchRecipes={e => this.searchRecipes(e)} 159 searchRecipes={e => this.searchRecipes(e)}
@@ -171,8 +169,6 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend
171 openDevDocs={() => { 169 openDevDocs={() => {
172 appActions.openExternalUrl({ url: FRANZ_DEV_DOCS }); 170 appActions.openExternalUrl({ url: FRANZ_DEV_DOCS });
173 }} 171 }}
174 isCommunityRecipesIncludedInCurrentPlan={communityRecipesStore.isCommunityRecipesIncludedInCurrentPlan}
175 isUserPremiumUser={user.isPremium}
176 /> 172 />
177 </ErrorBoundary> 173 </ErrorBoundary>
178 ); 174 );
diff --git a/src/containers/settings/TeamScreen.js b/src/containers/settings/TeamScreen.js
index a627a047a..10c2e36ef 100644
--- a/src/containers/settings/TeamScreen.js
+++ b/src/containers/settings/TeamScreen.js
@@ -9,7 +9,6 @@ import SettingsStore from '../../stores/SettingsStore';
9import TeamDashboard from '../../components/settings/team/TeamDashboard'; 9import TeamDashboard from '../../components/settings/team/TeamDashboard';
10import ErrorBoundary from '../../components/util/ErrorBoundary'; 10import ErrorBoundary from '../../components/util/ErrorBoundary';
11import { DEV_API_FRANZ_WEBSITE } from '../../config'; 11import { DEV_API_FRANZ_WEBSITE } from '../../config';
12import PaymentStore from '../../stores/PaymentStore';
13 12
14export default @inject('stores', 'actions') @observer class TeamScreen extends Component { 13export default @inject('stores', 'actions') @observer class TeamScreen extends Component {
15 handleWebsiteLink(route) { 14 handleWebsiteLink(route) {
@@ -33,7 +32,6 @@ export default @inject('stores', 'actions') @observer class TeamScreen extends C
33 userInfoRequestFailed={user.getUserInfoRequest.wasExecuted && user.getUserInfoRequest.isError} 32 userInfoRequestFailed={user.getUserInfoRequest.wasExecuted && user.getUserInfoRequest.isError}
34 retryUserInfoRequest={() => this.reloadData()} 33 retryUserInfoRequest={() => this.reloadData()}
35 openTeamManagement={() => this.handleWebsiteLink('/user/team')} 34 openTeamManagement={() => this.handleWebsiteLink('/user/team')}
36 isProUser={user.isPro}
37 server={server} 35 server={server}
38 /> 36 />
39 </ErrorBoundary> 37 </ErrorBoundary>
@@ -48,7 +46,6 @@ TeamScreen.wrappedComponent.propTypes = {
48 settings: PropTypes.instanceOf(SettingsStore).isRequired, 46 settings: PropTypes.instanceOf(SettingsStore).isRequired,
49 }).isRequired, 47 }).isRequired,
50 actions: PropTypes.shape({ 48 actions: PropTypes.shape({
51 payment: PropTypes.instanceOf(PaymentStore).isRequired,
52 app: PropTypes.instanceOf(AppStore).isRequired, 49 app: PropTypes.instanceOf(AppStore).isRequired,
53 user: PropTypes.instanceOf(UserStore).isRequired, 50 user: PropTypes.instanceOf(UserStore).isRequired,
54 }).isRequired, 51 }).isRequired,