diff options
author | Stefan Malzner <stefan@adlk.io> | 2018-11-28 20:51:17 +0100 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2018-11-28 20:51:17 +0100 |
commit | 8b648553a115ed753f78bb81af2752eadaf47754 (patch) | |
tree | b56cfd517a836dffa6b738896df125940f9936b8 /src/components/settings | |
parent | fix(App): App menu was not initialized on app launch. Resolving copy & paste ... (diff) | |
parent | Fix linting issues (diff) | |
download | ferdium-app-8b648553a115ed753f78bb81af2752eadaf47754.tar.gz ferdium-app-8b648553a115ed753f78bb81af2752eadaf47754.tar.zst ferdium-app-8b648553a115ed753f78bb81af2752eadaf47754.zip |
Merge branch 'update/monetization' into develop
Diffstat (limited to 'src/components/settings')
4 files changed, 63 insertions, 27 deletions
diff --git a/src/components/settings/account/AccountDashboard.js b/src/components/settings/account/AccountDashboard.js index ede519fd6..06c7074dd 100644 --- a/src/components/settings/account/AccountDashboard.js +++ b/src/components/settings/account/AccountDashboard.js | |||
@@ -180,11 +180,9 @@ export default @observer class AccountDashboard extends Component { | |||
180 | <span className="badge badge--success">{intl.formatMessage(messages.accountTypeEnterprise)}</span> | 180 | <span className="badge badge--success">{intl.formatMessage(messages.accountTypeEnterprise)}</span> |
181 | )} | 181 | )} |
182 | </div> | 182 | </div> |
183 | {!user.isSSO && ( | 183 | <Link to="/settings/user/edit" className="button"> |
184 | <Link to="/settings/user/edit" className="button"> | 184 | {intl.formatMessage(messages.accountEditButton)} |
185 | {intl.formatMessage(messages.accountEditButton)} | 185 | </Link> |
186 | </Link> | ||
187 | )} | ||
188 | {user.emailValidated} | 186 | {user.emailValidated} |
189 | </div> | 187 | </div> |
190 | </div> | 188 | </div> |
diff --git a/src/components/settings/navigation/SettingsNavigation.js b/src/components/settings/navigation/SettingsNavigation.js index d8b410aaf..b86d94ac7 100644 --- a/src/components/settings/navigation/SettingsNavigation.js +++ b/src/components/settings/navigation/SettingsNavigation.js | |||
@@ -43,20 +43,17 @@ export default @inject('stores') @observer class SettingsNavigation extends Comp | |||
43 | 43 | ||
44 | render() { | 44 | render() { |
45 | const { serviceCount } = this.props; | 45 | const { serviceCount } = this.props; |
46 | const { features } = this.props.stores.features; | ||
47 | const { intl } = this.context; | 46 | const { intl } = this.context; |
48 | 47 | ||
49 | return ( | 48 | return ( |
50 | <div className="settings-navigation"> | 49 | <div className="settings-navigation"> |
51 | {features.userCanManageServices && ( | 50 | <Link |
52 | <Link | 51 | to="/settings/recipes" |
53 | to="/settings/recipes" | 52 | className="settings-navigation__link" |
54 | className="settings-navigation__link" | 53 | activeClassName="is-active" |
55 | activeClassName="is-active" | 54 | > |
56 | > | 55 | {intl.formatMessage(messages.availableServices)} |
57 | {intl.formatMessage(messages.availableServices)} | 56 | </Link> |
58 | </Link> | ||
59 | )} | ||
60 | <Link | 57 | <Link |
61 | to="/settings/services" | 58 | to="/settings/services" |
62 | className="settings-navigation__link" | 59 | className="settings-navigation__link" |
@@ -97,11 +94,3 @@ export default @inject('stores') @observer class SettingsNavigation extends Comp | |||
97 | } | 94 | } |
98 | } | 95 | } |
99 | 96 | ||
100 | SettingsNavigation.wrappedComponent.propTypes = { | ||
101 | stores: PropTypes.shape({ | ||
102 | features: PropTypes.shape({ | ||
103 | features: PropTypes.object.isRequired, | ||
104 | }).isRequired, | ||
105 | }).isRequired, | ||
106 | }; | ||
107 | |||
diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js index 777a95fcf..47772efae 100644 --- a/src/components/settings/services/EditServiceForm.js +++ b/src/components/settings/services/EditServiceForm.js | |||
@@ -15,6 +15,8 @@ import Toggle from '../../ui/Toggle'; | |||
15 | import Button from '../../ui/Button'; | 15 | import Button from '../../ui/Button'; |
16 | import ImageUpload from '../../ui/ImageUpload'; | 16 | import ImageUpload from '../../ui/ImageUpload'; |
17 | 17 | ||
18 | import PremiumFeatureContainer from '../../ui/PremiumFeatureContainer'; | ||
19 | |||
18 | const messages = defineMessages({ | 20 | const messages = defineMessages({ |
19 | saveService: { | 21 | saveService: { |
20 | id: 'settings.service.form.saveButton', | 22 | id: 'settings.service.form.saveButton', |
@@ -92,6 +94,14 @@ const messages = defineMessages({ | |||
92 | id: 'settings.service.form.iconUpload', | 94 | id: 'settings.service.form.iconUpload', |
93 | defaultMessage: '!!!Drop your image, or click here', | 95 | defaultMessage: '!!!Drop your image, or click here', |
94 | }, | 96 | }, |
97 | headlineProxy: { | ||
98 | id: 'settings.service.form.proxy.headline', | ||
99 | defaultMessage: '!!!Proxy Settings', | ||
100 | }, | ||
101 | proxyInfo: { | ||
102 | id: 'settings.service.form.proxy.info', | ||
103 | defaultMessage: '!!!Proxy settings will not be synchronized with the Franz servers.', | ||
104 | }, | ||
95 | }); | 105 | }); |
96 | 106 | ||
97 | export default @observer class EditServiceForm extends Component { | 107 | export default @observer class EditServiceForm extends Component { |
@@ -106,13 +116,14 @@ export default @observer class EditServiceForm extends Component { | |||
106 | return null; | 116 | return null; |
107 | }, | 117 | }, |
108 | user: PropTypes.instanceOf(User).isRequired, | 118 | user: PropTypes.instanceOf(User).isRequired, |
109 | userCanManageServices: PropTypes.bool.isRequired, | ||
110 | action: PropTypes.string.isRequired, | 119 | action: PropTypes.string.isRequired, |
111 | form: PropTypes.instanceOf(Form).isRequired, | 120 | form: PropTypes.instanceOf(Form).isRequired, |
112 | onSubmit: PropTypes.func.isRequired, | 121 | onSubmit: PropTypes.func.isRequired, |
113 | onDelete: PropTypes.func.isRequired, | 122 | onDelete: PropTypes.func.isRequired, |
114 | isSaving: PropTypes.bool.isRequired, | 123 | isSaving: PropTypes.bool.isRequired, |
115 | isDeleting: PropTypes.bool.isRequired, | 124 | isDeleting: PropTypes.bool.isRequired, |
125 | isProxyFeatureEnabled: PropTypes.bool.isRequired, | ||
126 | isProxyFeaturePremiumFeature: PropTypes.bool.isRequired, | ||
116 | }; | 127 | }; |
117 | 128 | ||
118 | static defaultProps = { | 129 | static defaultProps = { |
@@ -169,11 +180,12 @@ export default @observer class EditServiceForm extends Component { | |||
169 | service, | 180 | service, |
170 | action, | 181 | action, |
171 | user, | 182 | user, |
172 | userCanManageServices, | ||
173 | form, | 183 | form, |
174 | isSaving, | 184 | isSaving, |
175 | isDeleting, | 185 | isDeleting, |
176 | onDelete, | 186 | onDelete, |
187 | isProxyFeatureEnabled, | ||
188 | isProxyFeaturePremiumFeature, | ||
177 | } = this.props; | 189 | } = this.props; |
178 | const { intl } = this.context; | 190 | const { intl } = this.context; |
179 | 191 | ||
@@ -318,6 +330,33 @@ export default @observer class EditServiceForm extends Component { | |||
318 | /> | 330 | /> |
319 | </div> | 331 | </div> |
320 | </div> | 332 | </div> |
333 | |||
334 | {isProxyFeatureEnabled && ( | ||
335 | <PremiumFeatureContainer condition={isProxyFeaturePremiumFeature}> | ||
336 | <div className="settings__settings-group"> | ||
337 | <h3> | ||
338 | {intl.formatMessage(messages.headlineProxy)} | ||
339 | <span className="badge badge--success">beta</span> | ||
340 | </h3> | ||
341 | <Toggle field={form.$('proxy.isEnabled')} /> | ||
342 | {form.$('proxy.isEnabled').value && ( | ||
343 | <div> | ||
344 | <Input field={form.$('proxy.host')} /> | ||
345 | <Input field={form.$('proxy.user')} /> | ||
346 | <Input | ||
347 | field={form.$('proxy.password')} | ||
348 | showPasswordToggle | ||
349 | /> | ||
350 | <p> | ||
351 | <span className="mdi mdi-information" /> | ||
352 | {intl.formatMessage(messages.proxyInfo)} | ||
353 | </p> | ||
354 | </div> | ||
355 | )} | ||
356 | </div> | ||
357 | </PremiumFeatureContainer> | ||
358 | )} | ||
359 | |||
321 | {recipe.message && ( | 360 | {recipe.message && ( |
322 | <p className="settings__message"> | 361 | <p className="settings__message"> |
323 | <span className="mdi mdi-information" /> | 362 | <span className="mdi mdi-information" /> |
@@ -328,7 +367,7 @@ export default @observer class EditServiceForm extends Component { | |||
328 | </div> | 367 | </div> |
329 | <div className="settings__controls"> | 368 | <div className="settings__controls"> |
330 | {/* Delete Button */} | 369 | {/* Delete Button */} |
331 | {action === 'edit' && userCanManageServices && deleteButton} | 370 | {action === 'edit' && deleteButton} |
332 | 371 | ||
333 | {/* Save Button */} | 372 | {/* Save Button */} |
334 | {isSaving || isValidatingCustomUrl ? ( | 373 | {isSaving || isValidatingCustomUrl ? ( |
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index b5c048ebd..280449ead 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -8,6 +8,7 @@ import Form from '../../../lib/Form'; | |||
8 | import Button from '../../ui/Button'; | 8 | import Button from '../../ui/Button'; |
9 | import Toggle from '../../ui/Toggle'; | 9 | import Toggle from '../../ui/Toggle'; |
10 | import Select from '../../ui/Select'; | 10 | import Select from '../../ui/Select'; |
11 | import PremiumFeatureContainer from '../../ui/PremiumFeatureContainer'; | ||
11 | 12 | ||
12 | import { FRANZ_TRANSLATION } from '../../../config'; | 13 | import { FRANZ_TRANSLATION } from '../../../config'; |
13 | 14 | ||
@@ -95,6 +96,7 @@ export default @observer class EditSettingsForm extends Component { | |||
95 | isClearingAllCache: PropTypes.bool.isRequired, | 96 | isClearingAllCache: PropTypes.bool.isRequired, |
96 | onClearAllCache: PropTypes.func.isRequired, | 97 | onClearAllCache: PropTypes.func.isRequired, |
97 | cacheSize: PropTypes.string.isRequired, | 98 | cacheSize: PropTypes.string.isRequired, |
99 | isSpellcheckerPremiumFeature: PropTypes.bool.isRequired, | ||
98 | }; | 100 | }; |
99 | 101 | ||
100 | static contextTypes = { | 102 | static contextTypes = { |
@@ -124,6 +126,7 @@ export default @observer class EditSettingsForm extends Component { | |||
124 | isClearingAllCache, | 126 | isClearingAllCache, |
125 | onClearAllCache, | 127 | onClearAllCache, |
126 | cacheSize, | 128 | cacheSize, |
129 | isSpellcheckerPremiumFeature, | ||
127 | } = this.props; | 130 | } = this.props; |
128 | const { intl } = this.context; | 131 | const { intl } = this.context; |
129 | 132 | ||
@@ -175,7 +178,14 @@ export default @observer class EditSettingsForm extends Component { | |||
175 | 178 | ||
176 | {/* Advanced */} | 179 | {/* Advanced */} |
177 | <h2 id="advanced">{intl.formatMessage(messages.headlineAdvanced)}</h2> | 180 | <h2 id="advanced">{intl.formatMessage(messages.headlineAdvanced)}</h2> |
178 | <Toggle field={form.$('enableSpellchecking')} /> | 181 | <PremiumFeatureContainer |
182 | condition={isSpellcheckerPremiumFeature} | ||
183 | > | ||
184 | <Toggle | ||
185 | field={form.$('enableSpellchecking')} | ||
186 | disabled | ||
187 | /> | ||
188 | </PremiumFeatureContainer> | ||
179 | <Toggle field={form.$('enableGPUAcceleration')} /> | 189 | <Toggle field={form.$('enableGPUAcceleration')} /> |
180 | <p className="settings__help">{intl.formatMessage(messages.enableGPUAccelerationInfo)}</p> | 190 | <p className="settings__help">{intl.formatMessage(messages.enableGPUAccelerationInfo)}</p> |
181 | {/* <Select field={form.$('spellcheckingLanguage')} /> */} | 191 | {/* <Select field={form.$('spellcheckingLanguage')} /> */} |