diff options
Diffstat (limited to 'src/containers')
19 files changed, 175 insertions, 71 deletions
diff --git a/src/containers/auth/AuthLayoutContainer.js b/src/containers/auth/AuthLayoutContainer.js index 004054fdd..b73598f3d 100644 --- a/src/containers/auth/AuthLayoutContainer.js +++ b/src/containers/auth/AuthLayoutContainer.js | |||
@@ -5,11 +5,11 @@ import { inject, observer } from 'mobx-react'; | |||
5 | import AuthLayout from '../../components/auth/AuthLayout'; | 5 | import AuthLayout from '../../components/auth/AuthLayout'; |
6 | import AppStore from '../../stores/AppStore'; | 6 | import AppStore from '../../stores/AppStore'; |
7 | import GlobalErrorStore from '../../stores/GlobalErrorStore'; | 7 | import GlobalErrorStore from '../../stores/GlobalErrorStore'; |
8 | import AppLoader from '../../components/ui/AppLoader'; | ||
8 | 9 | ||
9 | import { oneOrManyChildElements } from '../../prop-types'; | 10 | import { oneOrManyChildElements } from '../../prop-types'; |
10 | 11 | ||
11 | @inject('stores', 'actions') @observer | 12 | export default @inject('stores', 'actions') @observer class AuthLayoutContainer extends Component { |
12 | export default class AuthLayoutContainer extends Component { | ||
13 | static propTypes = { | 13 | static propTypes = { |
14 | children: oneOrManyChildElements.isRequired, | 14 | children: oneOrManyChildElements.isRequired, |
15 | location: PropTypes.shape({ | 15 | location: PropTypes.shape({ |
@@ -19,14 +19,27 @@ export default class AuthLayoutContainer extends Component { | |||
19 | 19 | ||
20 | render() { | 20 | render() { |
21 | const { stores, actions, children, location } = this.props; | 21 | const { stores, actions, children, location } = this.props; |
22 | const { app, features, globalError } = stores; | ||
23 | |||
24 | const isLoadingBaseFeatures = features.defaultFeaturesRequest.isExecuting | ||
25 | && !features.defaultFeaturesRequest.wasExecuted; | ||
26 | |||
27 | if (isLoadingBaseFeatures) { | ||
28 | return ( | ||
29 | <AppLoader /> | ||
30 | ); | ||
31 | } | ||
32 | |||
22 | return ( | 33 | return ( |
23 | <AuthLayout | 34 | <AuthLayout |
24 | error={stores.globalError.response} | 35 | error={globalError.response} |
25 | pathname={location.pathname} | 36 | pathname={location.pathname} |
26 | isOnline={stores.app.isOnline} | 37 | isOnline={app.isOnline} |
27 | isAPIHealthy={!stores.app.healthCheckRequest.isError} | 38 | isAPIHealthy={!app.healthCheckRequest.isError} |
28 | retryHealthCheck={actions.app.healthCheck} | 39 | retryHealthCheck={actions.app.healthCheck} |
29 | isHealthCheckLoading={stores.app.healthCheckRequest.isExecuting} | 40 | isHealthCheckLoading={app.healthCheckRequest.isExecuting} |
41 | isFullScreen={app.isFullScreen} | ||
42 | darkMode={app.isSystemDarkModeEnabled} | ||
30 | > | 43 | > |
31 | {children} | 44 | {children} |
32 | </AuthLayout> | 45 | </AuthLayout> |
diff --git a/src/containers/auth/ImportScreen.js b/src/containers/auth/ImportScreen.js index ddd56ffb6..fc46f8b54 100644 --- a/src/containers/auth/ImportScreen.js +++ b/src/containers/auth/ImportScreen.js | |||
@@ -5,8 +5,7 @@ import Import from '../../components/auth/Import'; | |||
5 | import UserStore from '../../stores/UserStore'; | 5 | import UserStore from '../../stores/UserStore'; |
6 | import { gaPage } from '../../lib/analytics'; | 6 | import { gaPage } from '../../lib/analytics'; |
7 | 7 | ||
8 | @inject('stores', 'actions') @observer | 8 | export default @inject('stores', 'actions') @observer class ImportScreen extends Component { |
9 | export default class ImportScreen extends Component { | ||
10 | componentDidMount() { | 9 | componentDidMount() { |
11 | gaPage('Auth/Import'); | 10 | gaPage('Auth/Import'); |
12 | } | 11 | } |
diff --git a/src/containers/auth/InviteScreen.js b/src/containers/auth/InviteScreen.js index 059888c99..26bf97038 100644 --- a/src/containers/auth/InviteScreen.js +++ b/src/containers/auth/InviteScreen.js | |||
@@ -4,8 +4,7 @@ import { inject, observer } from 'mobx-react'; | |||
4 | import Invite from '../../components/auth/Invite'; | 4 | import Invite from '../../components/auth/Invite'; |
5 | import { gaPage } from '../../lib/analytics'; | 5 | import { gaPage } from '../../lib/analytics'; |
6 | 6 | ||
7 | @inject('stores', 'actions') @observer | 7 | export default @inject('stores', 'actions') @observer class InviteScreen extends Component { |
8 | export default class InviteScreen extends Component { | ||
9 | componentDidMount() { | 8 | componentDidMount() { |
10 | gaPage('Auth/Invite'); | 9 | gaPage('Auth/Invite'); |
11 | } | 10 | } |
diff --git a/src/containers/auth/LoginScreen.js b/src/containers/auth/LoginScreen.js index 9e22c5141..865bd38f8 100644 --- a/src/containers/auth/LoginScreen.js +++ b/src/containers/auth/LoginScreen.js | |||
@@ -7,8 +7,7 @@ import { gaPage } from '../../lib/analytics'; | |||
7 | 7 | ||
8 | import { globalError as globalErrorPropType } from '../../prop-types'; | 8 | import { globalError as globalErrorPropType } from '../../prop-types'; |
9 | 9 | ||
10 | @inject('stores', 'actions') @observer | 10 | export default @inject('stores', 'actions') @observer class LoginScreen extends Component { |
11 | export default class LoginScreen extends Component { | ||
12 | static propTypes = { | 11 | static propTypes = { |
13 | error: globalErrorPropType.isRequired, | 12 | error: globalErrorPropType.isRequired, |
14 | }; | 13 | }; |
diff --git a/src/containers/auth/PasswordScreen.js b/src/containers/auth/PasswordScreen.js index d88cb08e6..236fd2031 100644 --- a/src/containers/auth/PasswordScreen.js +++ b/src/containers/auth/PasswordScreen.js | |||
@@ -5,8 +5,7 @@ import Password from '../../components/auth/Password'; | |||
5 | import UserStore from '../../stores/UserStore'; | 5 | import UserStore from '../../stores/UserStore'; |
6 | import { gaPage } from '../../lib/analytics'; | 6 | import { gaPage } from '../../lib/analytics'; |
7 | 7 | ||
8 | @inject('stores', 'actions') @observer | 8 | export default @inject('stores', 'actions') @observer class PasswordScreen extends Component { |
9 | export default class PasswordScreen extends Component { | ||
10 | componentDidMount() { | 9 | componentDidMount() { |
11 | gaPage('Auth/Password Retrieve'); | 10 | gaPage('Auth/Password Retrieve'); |
12 | } | 11 | } |
diff --git a/src/containers/auth/PricingScreen.js b/src/containers/auth/PricingScreen.js index 7e1586535..34b512e15 100644 --- a/src/containers/auth/PricingScreen.js +++ b/src/containers/auth/PricingScreen.js | |||
@@ -10,8 +10,7 @@ import { gaPage } from '../../lib/analytics'; | |||
10 | 10 | ||
11 | import { globalError as globalErrorPropType } from '../../prop-types'; | 11 | import { globalError as globalErrorPropType } from '../../prop-types'; |
12 | 12 | ||
13 | @inject('stores', 'actions') @observer | 13 | export default @inject('stores', 'actions') @observer class PricingScreen extends Component { |
14 | export default class PricingScreen extends Component { | ||
15 | static propTypes = { | 14 | static propTypes = { |
16 | error: globalErrorPropType.isRequired, | 15 | error: globalErrorPropType.isRequired, |
17 | }; | 16 | }; |
diff --git a/src/containers/auth/SignupScreen.js b/src/containers/auth/SignupScreen.js index 3b86ab138..caf75de90 100644 --- a/src/containers/auth/SignupScreen.js +++ b/src/containers/auth/SignupScreen.js | |||
@@ -8,8 +8,7 @@ import { gaPage } from '../../lib/analytics'; | |||
8 | 8 | ||
9 | import { globalError as globalErrorPropType } from '../../prop-types'; | 9 | import { globalError as globalErrorPropType } from '../../prop-types'; |
10 | 10 | ||
11 | @inject('stores', 'actions') @observer | 11 | export default @inject('stores', 'actions') @observer class SignupScreen extends Component { |
12 | export default class SignupScreen extends Component { | ||
13 | static propTypes = { | 12 | static propTypes = { |
14 | error: globalErrorPropType.isRequired, | 13 | error: globalErrorPropType.isRequired, |
15 | }; | 14 | }; |
diff --git a/src/containers/auth/WelcomeScreen.js b/src/containers/auth/WelcomeScreen.js index e413264a6..2c120f81c 100644 --- a/src/containers/auth/WelcomeScreen.js +++ b/src/containers/auth/WelcomeScreen.js | |||
@@ -7,8 +7,7 @@ import UserStore from '../../stores/UserStore'; | |||
7 | import RecipePreviewsStore from '../../stores/RecipePreviewsStore'; | 7 | import RecipePreviewsStore from '../../stores/RecipePreviewsStore'; |
8 | import { gaPage } from '../../lib/analytics'; | 8 | import { gaPage } from '../../lib/analytics'; |
9 | 9 | ||
10 | @inject('stores', 'actions') @observer | 10 | export default @inject('stores', 'actions') @observer class LoginScreen extends Component { |
11 | export default class LoginScreen extends Component { | ||
12 | componentDidMount() { | 11 | componentDidMount() { |
13 | gaPage('Auth/Welcome'); | 12 | gaPage('Auth/Welcome'); |
14 | } | 13 | } |
diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index 9212f809f..e1423bdaa 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js | |||
@@ -1,10 +1,12 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { inject, observer } from 'mobx-react'; | 3 | import { inject, observer } from 'mobx-react'; |
4 | import { ThemeProvider } from 'react-jss'; | ||
4 | 5 | ||
5 | import AppStore from '../../stores/AppStore'; | 6 | import AppStore from '../../stores/AppStore'; |
6 | import RecipesStore from '../../stores/RecipesStore'; | 7 | import RecipesStore from '../../stores/RecipesStore'; |
7 | import ServicesStore from '../../stores/ServicesStore'; | 8 | import ServicesStore from '../../stores/ServicesStore'; |
9 | import FeaturesStore from '../../stores/FeaturesStore'; | ||
8 | import UIStore from '../../stores/UIStore'; | 10 | import UIStore from '../../stores/UIStore'; |
9 | import NewsStore from '../../stores/NewsStore'; | 11 | import NewsStore from '../../stores/NewsStore'; |
10 | import SettingsStore from '../../stores/SettingsStore'; | 12 | import SettingsStore from '../../stores/SettingsStore'; |
@@ -17,8 +19,9 @@ import Sidebar from '../../components/layout/Sidebar'; | |||
17 | import Services from '../../components/services/content/Services'; | 19 | import Services from '../../components/services/content/Services'; |
18 | import AppLoader from '../../components/ui/AppLoader'; | 20 | import AppLoader from '../../components/ui/AppLoader'; |
19 | 21 | ||
20 | @inject('stores', 'actions') @observer | 22 | import { state as delayAppState } from '../../features/delayApp'; |
21 | export default class AppLayoutContainer extends Component { | 23 | |
24 | export default @inject('stores', 'actions') @observer class AppLayoutContainer extends Component { | ||
22 | static defaultProps = { | 25 | static defaultProps = { |
23 | children: null, | 26 | children: null, |
24 | }; | 27 | }; |
@@ -26,6 +29,7 @@ export default class AppLayoutContainer extends Component { | |||
26 | render() { | 29 | render() { |
27 | const { | 30 | const { |
28 | app, | 31 | app, |
32 | features, | ||
29 | services, | 33 | services, |
30 | ui, | 34 | ui, |
31 | news, | 35 | news, |
@@ -39,7 +43,6 @@ export default class AppLayoutContainer extends Component { | |||
39 | handleIPCMessage, | 43 | handleIPCMessage, |
40 | setWebviewReference, | 44 | setWebviewReference, |
41 | openWindow, | 45 | openWindow, |
42 | reloadUpdatedServices, | ||
43 | reorder, | 46 | reorder, |
44 | reload, | 47 | reload, |
45 | toggleNotifications, | 48 | toggleNotifications, |
@@ -64,10 +67,13 @@ export default class AppLayoutContainer extends Component { | |||
64 | 67 | ||
65 | const { children } = this.props; | 68 | const { children } = this.props; |
66 | 69 | ||
70 | const isLoadingFeatures = features.featuresRequest.isExecuting | ||
71 | && !features.featuresRequest.wasExecuted; | ||
72 | |||
67 | const isLoadingServices = services.allServicesRequest.isExecuting | 73 | const isLoadingServices = services.allServicesRequest.isExecuting |
68 | && services.allServicesRequest.isExecutingFirstTime; | 74 | && services.allServicesRequest.isExecutingFirstTime; |
69 | 75 | ||
70 | if (isLoadingServices) { | 76 | if (isLoadingFeatures || isLoadingServices) { |
71 | return ( | 77 | return ( |
72 | <AppLoader /> | 78 | <AppLoader /> |
73 | ); | 79 | ); |
@@ -105,25 +111,29 @@ export default class AppLayoutContainer extends Component { | |||
105 | ); | 111 | ); |
106 | 112 | ||
107 | return ( | 113 | return ( |
108 | <AppLayout | 114 | <ThemeProvider theme={ui.theme}> |
109 | isFullScreen={app.isFullScreen} | 115 | <AppLayout |
110 | isOnline={app.isOnline} | 116 | isFullScreen={app.isFullScreen} |
111 | showServicesUpdatedInfoBar={ui.showServicesUpdatedInfoBar} | 117 | isOnline={app.isOnline} |
112 | appUpdateIsDownloaded={app.updateStatus === app.updateStatusTypes.DOWNLOADED} | 118 | showServicesUpdatedInfoBar={ui.showServicesUpdatedInfoBar} |
113 | sidebar={sidebar} | 119 | appUpdateIsDownloaded={app.updateStatus === app.updateStatusTypes.DOWNLOADED} |
114 | services={servicesContainer} | 120 | sidebar={sidebar} |
115 | news={news.latest} | 121 | services={servicesContainer} |
116 | removeNewsItem={hide} | 122 | news={news.latest} |
117 | reloadServicesAfterUpdate={reloadUpdatedServices} | 123 | removeNewsItem={hide} |
118 | installAppUpdate={installUpdate} | 124 | reloadServicesAfterUpdate={() => window.location.reload()} |
119 | globalError={globalError.error} | 125 | installAppUpdate={installUpdate} |
120 | showRequiredRequestsError={requests.showRequiredRequestsError} | 126 | globalError={globalError.error} |
121 | areRequiredRequestsSuccessful={requests.areRequiredRequestsSuccessful} | 127 | showRequiredRequestsError={requests.showRequiredRequestsError} |
122 | retryRequiredRequests={retryRequiredRequests} | 128 | areRequiredRequestsSuccessful={requests.areRequiredRequestsSuccessful} |
123 | areRequiredRequestsLoading={requests.areRequiredRequestsLoading} | 129 | retryRequiredRequests={retryRequiredRequests} |
124 | > | 130 | areRequiredRequestsLoading={requests.areRequiredRequestsLoading} |
125 | {React.Children.count(children) > 0 ? children : null} | 131 | darkMode={settings.all.app.darkMode} |
126 | </AppLayout> | 132 | isDelayAppScreenVisible={delayAppState.isDelayAppScreenVisible} |
133 | > | ||
134 | {React.Children.count(children) > 0 ? children : null} | ||
135 | </AppLayout> | ||
136 | </ThemeProvider> | ||
127 | ); | 137 | ); |
128 | } | 138 | } |
129 | } | 139 | } |
@@ -131,6 +141,7 @@ export default class AppLayoutContainer extends Component { | |||
131 | AppLayoutContainer.wrappedComponent.propTypes = { | 141 | AppLayoutContainer.wrappedComponent.propTypes = { |
132 | stores: PropTypes.shape({ | 142 | stores: PropTypes.shape({ |
133 | services: PropTypes.instanceOf(ServicesStore).isRequired, | 143 | services: PropTypes.instanceOf(ServicesStore).isRequired, |
144 | features: PropTypes.instanceOf(FeaturesStore).isRequired, | ||
134 | recipes: PropTypes.instanceOf(RecipesStore).isRequired, | 145 | recipes: PropTypes.instanceOf(RecipesStore).isRequired, |
135 | app: PropTypes.instanceOf(AppStore).isRequired, | 146 | app: PropTypes.instanceOf(AppStore).isRequired, |
136 | ui: PropTypes.instanceOf(UIStore).isRequired, | 147 | ui: PropTypes.instanceOf(UIStore).isRequired, |
diff --git a/src/containers/settings/AccountScreen.js b/src/containers/settings/AccountScreen.js index c5c2982b0..5818af0b1 100644 --- a/src/containers/settings/AccountScreen.js +++ b/src/containers/settings/AccountScreen.js | |||
@@ -12,8 +12,7 @@ import AccountDashboard from '../../components/settings/account/AccountDashboard | |||
12 | 12 | ||
13 | const { BrowserWindow } = remote; | 13 | const { BrowserWindow } = remote; |
14 | 14 | ||
15 | @inject('stores', 'actions') @observer | 15 | export default @inject('stores', 'actions') @observer class AccountScreen extends Component { |
16 | export default class AccountScreen extends Component { | ||
17 | componentDidMount() { | 16 | componentDidMount() { |
18 | gaPage('Settings/Account Dashboard'); | 17 | gaPage('Settings/Account Dashboard'); |
19 | } | 18 | } |
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js index 67c2731fc..639e8b070 100644 --- a/src/containers/settings/EditServiceScreen.js +++ b/src/containers/settings/EditServiceScreen.js | |||
@@ -6,6 +6,8 @@ import { defineMessages, intlShape } from 'react-intl'; | |||
6 | import UserStore from '../../stores/UserStore'; | 6 | import UserStore from '../../stores/UserStore'; |
7 | import RecipesStore from '../../stores/RecipesStore'; | 7 | import RecipesStore from '../../stores/RecipesStore'; |
8 | import ServicesStore from '../../stores/ServicesStore'; | 8 | import ServicesStore from '../../stores/ServicesStore'; |
9 | import SettingsStore from '../../stores/SettingsStore'; | ||
10 | import FeaturesStore from '../../stores/FeaturesStore'; | ||
9 | import Form from '../../lib/Form'; | 11 | import Form from '../../lib/Form'; |
10 | import { gaPage } from '../../lib/analytics'; | 12 | import { gaPage } from '../../lib/analytics'; |
11 | 13 | ||
@@ -13,6 +15,8 @@ import ServiceError from '../../components/settings/services/ServiceError'; | |||
13 | import EditServiceForm from '../../components/settings/services/EditServiceForm'; | 15 | import EditServiceForm from '../../components/settings/services/EditServiceForm'; |
14 | import { required, url, oneRequired } from '../../helpers/validation-helpers'; | 16 | import { required, url, oneRequired } from '../../helpers/validation-helpers'; |
15 | 17 | ||
18 | import { config as proxyFeature } from '../../features/serviceProxy'; | ||
19 | |||
16 | const messages = defineMessages({ | 20 | const messages = defineMessages({ |
17 | name: { | 21 | name: { |
18 | id: 'settings.service.form.name', | 22 | id: 'settings.service.form.name', |
@@ -50,10 +54,29 @@ const messages = defineMessages({ | |||
50 | id: 'settings.service.form.icon', | 54 | id: 'settings.service.form.icon', |
51 | defaultMessage: '!!!Custom icon', | 55 | defaultMessage: '!!!Custom icon', |
52 | }, | 56 | }, |
57 | enableDarkMode: { | ||
58 | id: 'settings.service.form.enableDarkMode', | ||
59 | defaultMessage: '!!!Enable Dark Mode', | ||
60 | }, | ||
61 | enableProxy: { | ||
62 | id: 'settings.service.form.proxy.isEnabled', | ||
63 | defaultMessage: '!!!Use Proxy', | ||
64 | }, | ||
65 | proxyHost: { | ||
66 | id: 'settings.service.form.proxy.host', | ||
67 | defaultMessage: '!!!Proxy Host/IP', | ||
68 | }, | ||
69 | proxyUser: { | ||
70 | id: 'settings.service.form.proxy.user', | ||
71 | defaultMessage: '!!!User', | ||
72 | }, | ||
73 | proxyPassword: { | ||
74 | id: 'settings.service.form.proxy.password', | ||
75 | defaultMessage: '!!!Password', | ||
76 | }, | ||
53 | }); | 77 | }); |
54 | 78 | ||
55 | @inject('stores', 'actions') @observer | 79 | export default @inject('stores', 'actions') @observer class EditServiceScreen extends Component { |
56 | export default class EditServiceScreen extends Component { | ||
57 | static contextTypes = { | 80 | static contextTypes = { |
58 | intl: intlShape, | 81 | intl: intlShape, |
59 | }; | 82 | }; |
@@ -77,7 +100,7 @@ export default class EditServiceScreen extends Component { | |||
77 | } | 100 | } |
78 | } | 101 | } |
79 | 102 | ||
80 | prepareForm(recipe, service) { | 103 | prepareForm(recipe, service, proxy) { |
81 | const { intl } = this.context; | 104 | const { intl } = this.context; |
82 | const config = { | 105 | const config = { |
83 | fields: { | 106 | fields: { |
@@ -112,6 +135,11 @@ export default class EditServiceScreen extends Component { | |||
112 | default: null, | 135 | default: null, |
113 | type: 'file', | 136 | type: 'file', |
114 | }, | 137 | }, |
138 | isDarkModeEnabled: { | ||
139 | label: intl.formatMessage(messages.enableDarkMode), | ||
140 | value: service.isDarkModeEnabled, | ||
141 | default: this.props.stores.settings.all.app.darkMode, | ||
142 | }, | ||
115 | }, | 143 | }, |
116 | }; | 144 | }; |
117 | 145 | ||
@@ -163,6 +191,40 @@ export default class EditServiceScreen extends Component { | |||
163 | }); | 191 | }); |
164 | } | 192 | } |
165 | 193 | ||
194 | if (proxy.isEnabled) { | ||
195 | const serviceProxyConfig = this.props.stores.settings.proxy[service.id] || {}; | ||
196 | |||
197 | Object.assign(config.fields, { | ||
198 | proxy: { | ||
199 | name: 'proxy', | ||
200 | label: 'proxy', | ||
201 | fields: { | ||
202 | isEnabled: { | ||
203 | label: intl.formatMessage(messages.enableProxy), | ||
204 | value: serviceProxyConfig.isEnabled, | ||
205 | default: false, | ||
206 | }, | ||
207 | host: { | ||
208 | label: intl.formatMessage(messages.proxyHost), | ||
209 | value: serviceProxyConfig.host, | ||
210 | default: '', | ||
211 | }, | ||
212 | user: { | ||
213 | label: intl.formatMessage(messages.proxyUser), | ||
214 | value: serviceProxyConfig.user, | ||
215 | default: '', | ||
216 | }, | ||
217 | password: { | ||
218 | label: intl.formatMessage(messages.proxyPassword), | ||
219 | value: serviceProxyConfig.password, | ||
220 | default: '', | ||
221 | type: 'password', | ||
222 | }, | ||
223 | }, | ||
224 | }, | ||
225 | }); | ||
226 | } | ||
227 | |||
166 | return new Form(config); | 228 | return new Form(config); |
167 | } | 229 | } |
168 | 230 | ||
@@ -215,7 +277,7 @@ export default class EditServiceScreen extends Component { | |||
215 | ); | 277 | ); |
216 | } | 278 | } |
217 | 279 | ||
218 | const form = this.prepareForm(recipe, service); | 280 | const form = this.prepareForm(recipe, service, proxyFeature); |
219 | 281 | ||
220 | return ( | 282 | return ( |
221 | <EditServiceForm | 283 | <EditServiceForm |
@@ -229,6 +291,8 @@ export default class EditServiceScreen extends Component { | |||
229 | isDeleting={services.deleteServiceRequest.isExecuting} | 291 | isDeleting={services.deleteServiceRequest.isExecuting} |
230 | onSubmit={d => this.onSubmit(d)} | 292 | onSubmit={d => this.onSubmit(d)} |
231 | onDelete={() => this.deleteService()} | 293 | onDelete={() => this.deleteService()} |
294 | isProxyFeatureEnabled={proxyFeature.isEnabled} | ||
295 | isProxyFeaturePremiumFeature={proxyFeature.isPremium} | ||
232 | /> | 296 | /> |
233 | ); | 297 | ); |
234 | } | 298 | } |
@@ -239,6 +303,8 @@ EditServiceScreen.wrappedComponent.propTypes = { | |||
239 | user: PropTypes.instanceOf(UserStore).isRequired, | 303 | user: PropTypes.instanceOf(UserStore).isRequired, |
240 | recipes: PropTypes.instanceOf(RecipesStore).isRequired, | 304 | recipes: PropTypes.instanceOf(RecipesStore).isRequired, |
241 | services: PropTypes.instanceOf(ServicesStore).isRequired, | 305 | services: PropTypes.instanceOf(ServicesStore).isRequired, |
306 | settings: PropTypes.instanceOf(SettingsStore).isRequired, | ||
307 | features: PropTypes.instanceOf(FeaturesStore).isRequired, | ||
242 | }).isRequired, | 308 | }).isRequired, |
243 | router: PropTypes.shape({ | 309 | router: PropTypes.shape({ |
244 | params: PropTypes.shape({ | 310 | params: PropTypes.shape({ |
@@ -251,5 +317,8 @@ EditServiceScreen.wrappedComponent.propTypes = { | |||
251 | updateService: PropTypes.func.isRequired, | 317 | updateService: PropTypes.func.isRequired, |
252 | deleteService: PropTypes.func.isRequired, | 318 | deleteService: PropTypes.func.isRequired, |
253 | }).isRequired, | 319 | }).isRequired, |
320 | // settings: PropTypes.shape({ | ||
321 | // update: PropTypes.func.isRequred, | ||
322 | // }).isRequired, | ||
254 | }).isRequired, | 323 | }).isRequired, |
255 | }; | 324 | }; |
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index 018ce663f..ea1d319d9 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -7,9 +7,10 @@ import AppStore from '../../stores/AppStore'; | |||
7 | import SettingsStore from '../../stores/SettingsStore'; | 7 | import SettingsStore from '../../stores/SettingsStore'; |
8 | import UserStore from '../../stores/UserStore'; | 8 | import UserStore from '../../stores/UserStore'; |
9 | import Form from '../../lib/Form'; | 9 | import Form from '../../lib/Form'; |
10 | import { APP_LOCALES } from '../../i18n/languages'; | 10 | import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; |
11 | import { gaPage } from '../../lib/analytics'; | 11 | import { gaPage } from '../../lib/analytics'; |
12 | import { DEFAULT_APP_SETTINGS } from '../../config'; | 12 | import { DEFAULT_APP_SETTINGS } from '../../config'; |
13 | import { config as spellcheckerConfig } from '../../features/spellchecker'; | ||
13 | 14 | ||
14 | 15 | ||
15 | import EditSettingsForm from '../../components/settings/settings/EditSettingsForm'; | 16 | import EditSettingsForm from '../../components/settings/settings/EditSettingsForm'; |
@@ -39,6 +40,10 @@ const messages = defineMessages({ | |||
39 | id: 'settings.app.form.language', | 40 | id: 'settings.app.form.language', |
40 | defaultMessage: '!!!Language', | 41 | defaultMessage: '!!!Language', |
41 | }, | 42 | }, |
43 | darkMode: { | ||
44 | id: 'settings.app.form.darkMode', | ||
45 | defaultMessage: '!!!Dark Mode', | ||
46 | }, | ||
42 | showDisabledServices: { | 47 | showDisabledServices: { |
43 | id: 'settings.app.form.showDisabledServices', | 48 | id: 'settings.app.form.showDisabledServices', |
44 | defaultMessage: '!!!Display disabled services tabs', | 49 | defaultMessage: '!!!Display disabled services tabs', |
@@ -55,8 +60,8 @@ const messages = defineMessages({ | |||
55 | id: 'settings.app.form.enableGPUAcceleration', | 60 | id: 'settings.app.form.enableGPUAcceleration', |
56 | defaultMessage: '!!!Enable GPU Acceleration', | 61 | defaultMessage: '!!!Enable GPU Acceleration', |
57 | }, | 62 | }, |
58 | spellcheckingLanguage: { | 63 | spellcheckerLanguage: { |
59 | id: 'settings.app.form.spellcheckingLanguage', | 64 | id: 'settings.app.form.spellcheckerLanguage', |
60 | defaultMessage: '!!!Language for spell checking', | 65 | defaultMessage: '!!!Language for spell checking', |
61 | }, | 66 | }, |
62 | beta: { | 67 | beta: { |
@@ -65,8 +70,7 @@ const messages = defineMessages({ | |||
65 | }, | 70 | }, |
66 | }); | 71 | }); |
67 | 72 | ||
68 | @inject('stores', 'actions') @observer | 73 | export default @inject('stores', 'actions') @observer class EditSettingsScreen extends Component { |
69 | export default class EditSettingsScreen extends Component { | ||
70 | static contextTypes = { | 74 | static contextTypes = { |
71 | intl: intlShape, | 75 | intl: intlShape, |
72 | }; | 76 | }; |
@@ -91,8 +95,10 @@ export default class EditSettingsScreen extends Component { | |||
91 | minimizeToSystemTray: settingsData.minimizeToSystemTray, | 95 | minimizeToSystemTray: settingsData.minimizeToSystemTray, |
92 | enableGPUAcceleration: settingsData.enableGPUAcceleration, | 96 | enableGPUAcceleration: settingsData.enableGPUAcceleration, |
93 | showDisabledServices: settingsData.showDisabledServices, | 97 | showDisabledServices: settingsData.showDisabledServices, |
98 | darkMode: settingsData.darkMode, | ||
94 | showMessageBadgeWhenMuted: settingsData.showMessageBadgeWhenMuted, | 99 | showMessageBadgeWhenMuted: settingsData.showMessageBadgeWhenMuted, |
95 | enableSpellchecking: settingsData.enableSpellchecking, | 100 | enableSpellchecking: settingsData.enableSpellchecking, |
101 | spellcheckerLanguage: settingsData.spellcheckerLanguage, | ||
96 | beta: settingsData.beta, // we need this info in the main process as well | 102 | beta: settingsData.beta, // we need this info in the main process as well |
97 | locale: settingsData.locale, // we need this info in the main process as well | 103 | locale: settingsData.locale, // we need this info in the main process as well |
98 | }, | 104 | }, |
@@ -118,6 +124,14 @@ export default class EditSettingsScreen extends Component { | |||
118 | }); | 124 | }); |
119 | }); | 125 | }); |
120 | 126 | ||
127 | const spellcheckingLanguages = []; | ||
128 | Object.keys(SPELLCHECKER_LOCALES).sort(Intl.Collator().compare).forEach((key) => { | ||
129 | spellcheckingLanguages.push({ | ||
130 | value: key, | ||
131 | label: SPELLCHECKER_LOCALES[key], | ||
132 | }); | ||
133 | }); | ||
134 | |||
121 | const config = { | 135 | const config = { |
122 | fields: { | 136 | fields: { |
123 | autoLaunchOnStart: { | 137 | autoLaunchOnStart: { |
@@ -157,8 +171,19 @@ export default class EditSettingsScreen extends Component { | |||
157 | }, | 171 | }, |
158 | enableSpellchecking: { | 172 | enableSpellchecking: { |
159 | label: intl.formatMessage(messages.enableSpellchecking), | 173 | label: intl.formatMessage(messages.enableSpellchecking), |
160 | value: settings.all.app.enableSpellchecking, | 174 | value: !this.props.stores.user.data.isPremium && spellcheckerConfig.isPremiumFeature ? false : settings.all.app.enableSpellchecking, |
161 | default: DEFAULT_APP_SETTINGS.enableSpellchecking, | 175 | default: !this.props.stores.user.data.isPremium && spellcheckerConfig.isPremiumFeature ? false : DEFAULT_APP_SETTINGS.enableSpellchecking, |
176 | }, | ||
177 | spellcheckerLanguage: { | ||
178 | label: intl.formatMessage(messages.spellcheckerLanguage), | ||
179 | value: settings.all.app.spellcheckerLanguage, | ||
180 | options: spellcheckingLanguages, | ||
181 | default: DEFAULT_APP_SETTINGS.spellcheckerLanguage, | ||
182 | }, | ||
183 | darkMode: { | ||
184 | label: intl.formatMessage(messages.darkMode), | ||
185 | value: settings.all.app.darkMode, | ||
186 | default: DEFAULT_APP_SETTINGS.darkMode, | ||
162 | }, | 187 | }, |
163 | enableGPUAcceleration: { | 188 | enableGPUAcceleration: { |
164 | label: intl.formatMessage(messages.enableGPUAcceleration), | 189 | label: intl.formatMessage(messages.enableGPUAcceleration), |
@@ -209,6 +234,7 @@ export default class EditSettingsScreen extends Component { | |||
209 | cacheSize={cacheSize} | 234 | cacheSize={cacheSize} |
210 | isClearingAllCache={isClearingAllCache} | 235 | isClearingAllCache={isClearingAllCache} |
211 | onClearAllCache={clearAllCache} | 236 | onClearAllCache={clearAllCache} |
237 | isSpellcheckerPremiumFeature={spellcheckerConfig.isPremiumFeature} | ||
212 | /> | 238 | /> |
213 | ); | 239 | ); |
214 | } | 240 | } |
diff --git a/src/containers/settings/EditUserScreen.js b/src/containers/settings/EditUserScreen.js index dda8ce513..3da3e8d2c 100644 --- a/src/containers/settings/EditUserScreen.js +++ b/src/containers/settings/EditUserScreen.js | |||
@@ -50,8 +50,7 @@ const messages = defineMessages({ | |||
50 | }, | 50 | }, |
51 | }); | 51 | }); |
52 | 52 | ||
53 | @inject('stores', 'actions') @observer | 53 | export default @inject('stores', 'actions') @observer class EditUserScreen extends Component { |
54 | export default class EditUserScreen extends Component { | ||
55 | static contextTypes = { | 54 | static contextTypes = { |
56 | intl: intlShape, | 55 | intl: intlShape, |
57 | }; | 56 | }; |
@@ -145,6 +144,7 @@ export default class EditUserScreen extends Component { | |||
145 | // user={user.data} | 144 | // user={user.data} |
146 | status={user.actionStatus} | 145 | status={user.actionStatus} |
147 | form={form} | 146 | form={form} |
147 | isEnterprise={user.data.isEnterprise} | ||
148 | isSaving={user.updateUserInfoRequest.isExecuting} | 148 | isSaving={user.updateUserInfoRequest.isExecuting} |
149 | onSubmit={d => this.onSubmit(d)} | 149 | onSubmit={d => this.onSubmit(d)} |
150 | /> | 150 | /> |
diff --git a/src/containers/settings/InviteScreen.js b/src/containers/settings/InviteScreen.js index 5f341b1b3..38ca6ec74 100644 --- a/src/containers/settings/InviteScreen.js +++ b/src/containers/settings/InviteScreen.js | |||
@@ -5,8 +5,7 @@ import { inject, observer } from 'mobx-react'; | |||
5 | import Invite from '../../components/auth/Invite'; | 5 | import Invite from '../../components/auth/Invite'; |
6 | import { gaPage } from '../../lib/analytics'; | 6 | import { gaPage } from '../../lib/analytics'; |
7 | 7 | ||
8 | @inject('stores', 'actions') @observer | 8 | export default @inject('stores', 'actions') @observer class InviteScreen extends Component { |
9 | export default class InviteScreen extends Component { | ||
10 | componentDidMount() { | 9 | componentDidMount() { |
11 | gaPage('Settings/Invite'); | 10 | gaPage('Settings/Invite'); |
12 | } | 11 | } |
diff --git a/src/containers/settings/RecipesScreen.js b/src/containers/settings/RecipesScreen.js index 65341e9e3..4efe81505 100644 --- a/src/containers/settings/RecipesScreen.js +++ b/src/containers/settings/RecipesScreen.js | |||
@@ -11,8 +11,7 @@ import { gaPage } from '../../lib/analytics'; | |||
11 | 11 | ||
12 | import RecipesDashboard from '../../components/settings/recipes/RecipesDashboard'; | 12 | import RecipesDashboard from '../../components/settings/recipes/RecipesDashboard'; |
13 | 13 | ||
14 | @inject('stores', 'actions') @observer | 14 | export default @inject('stores', 'actions') @observer class RecipesScreen extends Component { |
15 | export default class RecipesScreen extends Component { | ||
16 | static propTypes = { | 15 | static propTypes = { |
17 | params: PropTypes.shape({ | 16 | params: PropTypes.shape({ |
18 | filter: PropTypes.string, | 17 | filter: PropTypes.string, |
diff --git a/src/containers/settings/ServicesScreen.js b/src/containers/settings/ServicesScreen.js index 12db1bcd3..c1a133ef7 100644 --- a/src/containers/settings/ServicesScreen.js +++ b/src/containers/settings/ServicesScreen.js | |||
@@ -10,8 +10,7 @@ import { gaPage } from '../../lib/analytics'; | |||
10 | 10 | ||
11 | import ServicesDashboard from '../../components/settings/services/ServicesDashboard'; | 11 | import ServicesDashboard from '../../components/settings/services/ServicesDashboard'; |
12 | 12 | ||
13 | @inject('stores', 'actions') @observer | 13 | export default @inject('stores', 'actions') @observer class ServicesScreen extends Component { |
14 | export default class ServicesScreen extends Component { | ||
15 | componentDidMount() { | 14 | componentDidMount() { |
16 | gaPage('Settings/Service Dashboard'); | 15 | gaPage('Settings/Service Dashboard'); |
17 | } | 16 | } |
diff --git a/src/containers/settings/SettingsWindow.js b/src/containers/settings/SettingsWindow.js index 13ca96f72..55589d0be 100644 --- a/src/containers/settings/SettingsWindow.js +++ b/src/containers/settings/SettingsWindow.js | |||
@@ -7,8 +7,7 @@ import ServicesStore from '../../stores/ServicesStore'; | |||
7 | import Layout from '../../components/settings/SettingsLayout'; | 7 | import Layout from '../../components/settings/SettingsLayout'; |
8 | import Navigation from '../../components/settings/navigation/SettingsNavigation'; | 8 | import Navigation from '../../components/settings/navigation/SettingsNavigation'; |
9 | 9 | ||
10 | @inject('stores', 'actions') @observer | 10 | export default @inject('stores', 'actions') @observer class SettingsContainer extends Component { |
11 | export default class SettingsContainer extends Component { | ||
12 | render() { | 11 | render() { |
13 | const { children, stores } = this.props; | 12 | const { children, stores } = this.props; |
14 | const { closeSettings } = this.props.actions.ui; | 13 | const { closeSettings } = this.props.actions.ui; |
diff --git a/src/containers/subscription/SubscriptionFormScreen.js b/src/containers/subscription/SubscriptionFormScreen.js index fc6e3c4be..50ed19bef 100644 --- a/src/containers/subscription/SubscriptionFormScreen.js +++ b/src/containers/subscription/SubscriptionFormScreen.js | |||
@@ -9,8 +9,7 @@ import SubscriptionForm from '../../components/subscription/SubscriptionForm'; | |||
9 | 9 | ||
10 | const { BrowserWindow } = remote; | 10 | const { BrowserWindow } = remote; |
11 | 11 | ||
12 | @inject('stores', 'actions') @observer | 12 | export default @inject('stores', 'actions') @observer class SubscriptionFormScreen extends Component { |
13 | export default class SubscriptionFormScreen extends Component { | ||
14 | static propTypes = { | 13 | static propTypes = { |
15 | onCloseWindow: PropTypes.func, | 14 | onCloseWindow: PropTypes.func, |
16 | content: PropTypes.oneOrManyChildElements, | 15 | content: PropTypes.oneOrManyChildElements, |
@@ -80,7 +79,6 @@ export default class SubscriptionFormScreen extends Component { | |||
80 | return ( | 79 | return ( |
81 | <SubscriptionForm | 80 | <SubscriptionForm |
82 | plan={stores.payment.plan} | 81 | plan={stores.payment.plan} |
83 | // form={this.prepareForm(stores.payment.plan)} | ||
84 | isLoading={stores.payment.plansRequest.isExecuting} | 82 | isLoading={stores.payment.plansRequest.isExecuting} |
85 | retryPlanRequest={() => stores.payment.plansRequest.reload()} | 83 | retryPlanRequest={() => stores.payment.plansRequest.reload()} |
86 | isCreatingHostedPage={stores.payment.createHostedPageRequest.isExecuting} | 84 | isCreatingHostedPage={stores.payment.createHostedPageRequest.isExecuting} |
diff --git a/src/containers/subscription/SubscriptionPopupScreen.js b/src/containers/subscription/SubscriptionPopupScreen.js index bb0603170..6641f236d 100644 --- a/src/containers/subscription/SubscriptionPopupScreen.js +++ b/src/containers/subscription/SubscriptionPopupScreen.js | |||
@@ -5,8 +5,7 @@ import { inject, observer } from 'mobx-react'; | |||
5 | import SubscriptionPopup from '../../components/subscription/SubscriptionPopup'; | 5 | import SubscriptionPopup from '../../components/subscription/SubscriptionPopup'; |
6 | 6 | ||
7 | 7 | ||
8 | @inject('stores', 'actions') @observer | 8 | export default @inject('stores', 'actions') @observer class SubscriptionPopupScreen extends Component { |
9 | export default class SubscriptionPopupScreen extends Component { | ||
10 | state = { | 9 | state = { |
11 | complete: false, | 10 | complete: false, |
12 | }; | 11 | }; |