diff --git a/.eslintrc b/.eslintrc index 8e95ad4fd..948550306 100644 --- a/.eslintrc +++ b/.eslintrc @@ -13,6 +13,7 @@ "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], + "react/forbid-prop-types": 1, "no-underscore-dangle": 0, "max-len": 0, "class-methods-use-this": 0, diff --git a/src/api/LocalApi.js b/src/api/LocalApi.js index 741917104..e2a46874a 100644 --- a/src/api/LocalApi.js +++ b/src/api/LocalApi.js @@ -4,12 +4,12 @@ export default class LocalApi { this.local = local; } - getAppSettings() { - return this.local.getAppSettings(); + getAppSettings(type) { + return this.local.getAppSettings(type); } - updateAppSettings(data) { - return this.local.updateAppSettings(data); + updateAppSettings(type, data) { + return this.local.updateAppSettings(type, data); } getAppCacheSize() { diff --git a/src/api/server/LocalApi.js b/src/api/server/LocalApi.js index 4814bba66..ab1604a27 100644 --- a/src/api/server/LocalApi.js +++ b/src/api/server/LocalApi.js @@ -9,20 +9,23 @@ const { session } = remote; export default class LocalApi { // Settings - getAppSettings() { + getAppSettings(type) { return new Promise((resolve) => { - ipcRenderer.once('appSettings', (event, data) => { - debug('LocalApi::getAppSettings resolves', data); - resolve(data); + ipcRenderer.once('appSettings', (event, resp) => { + debug('LocalApi::getAppSettings resolves', resp.type, resp.data); + resolve(resp); }); - ipcRenderer.send('getAppSettings'); + ipcRenderer.send('getAppSettings', type); }); } - async updateAppSettings(data) { - debug('LocalApi::updateAppSettings resolves', data); - ipcRenderer.send('updateAppSettings', data); + async updateAppSettings(type, data) { + debug('LocalApi::updateAppSettings resolves', type, data); + ipcRenderer.send('updateAppSettings', { + type, + data, + }); } // Services diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index 4b20fc480..3ababe54a 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js @@ -5,7 +5,7 @@ import { defineMessages, intlShape } from 'react-intl'; import { TitleBar } from 'electron-react-titlebar'; import InfoBar from '../ui/InfoBar'; -import { component as DelayApp } from '../../features/delayApp'; +import { Component as DelayApp } from '../../features/delayApp'; import globalMessages from '../../i18n/globalMessages'; import { isWindows } from '../../environment'; 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 { {intl.formatMessage(messages.accountTypeEnterprise)} )} - {!user.isSSO && ( - - {intl.formatMessage(messages.accountEditButton)} - - )} + + {intl.formatMessage(messages.accountEditButton)} + {user.emailValidated} 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 render() { const { serviceCount } = this.props; - const { features } = this.props.stores.features; const { intl } = this.context; return (
- {features.userCanManageServices && ( - - {intl.formatMessage(messages.availableServices)} - - )} + + {intl.formatMessage(messages.availableServices)} +
+ + {isProxyFeatureEnabled && ( + +
+

+ {intl.formatMessage(messages.headlineProxy)} + beta +

+ + {form.$('proxy.isEnabled').value && ( +
+ + + +

+ + {intl.formatMessage(messages.proxyInfo)} +

+
+ )} +
+
+ )} + {recipe.message && (

@@ -328,7 +367,7 @@ export default @observer class EditServiceForm extends Component {

{/* Delete Button */} - {action === 'edit' && userCanManageServices && deleteButton} + {action === 'edit' && deleteButton} {/* Save Button */} {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'; import Button from '../../ui/Button'; import Toggle from '../../ui/Toggle'; import Select from '../../ui/Select'; +import PremiumFeatureContainer from '../../ui/PremiumFeatureContainer'; import { FRANZ_TRANSLATION } from '../../../config'; @@ -95,6 +96,7 @@ export default @observer class EditSettingsForm extends Component { isClearingAllCache: PropTypes.bool.isRequired, onClearAllCache: PropTypes.func.isRequired, cacheSize: PropTypes.string.isRequired, + isSpellcheckerPremiumFeature: PropTypes.bool.isRequired, }; static contextTypes = { @@ -124,6 +126,7 @@ export default @observer class EditSettingsForm extends Component { isClearingAllCache, onClearAllCache, cacheSize, + isSpellcheckerPremiumFeature, } = this.props; const { intl } = this.context; @@ -175,7 +178,14 @@ export default @observer class EditSettingsForm extends Component { {/* Advanced */}

{intl.formatMessage(messages.headlineAdvanced)}

- + + +

{intl.formatMessage(messages.enableGPUAccelerationInfo)}

{/*