aboutsummaryrefslogtreecommitdiffstats
path: root/src/containers/settings
diff options
context:
space:
mode:
authorLibravatar Bennett <hello@vantezzen.io>2020-01-31 17:24:30 +0100
committerLibravatar GitHub <noreply@github.com>2020-01-31 17:24:30 +0100
commit9277d42ee8fd6d9e3eccf948f71c8688f726784e (patch)
tree6f167ea9eb2ed50a079596048993a79c7aeb9447 /src/containers/settings
parentUpdate (diff)
parentFix lint (diff)
downloadferdium-app-9277d42ee8fd6d9e3eccf948f71c8688f726784e.tar.gz
ferdium-app-9277d42ee8fd6d9e3eccf948f71c8688f726784e.tar.zst
ferdium-app-9277d42ee8fd6d9e3eccf948f71c8688f726784e.zip
Merge branch 'develop' into start-in-tray
Diffstat (limited to 'src/containers/settings')
-rw-r--r--src/containers/settings/AccountScreen.js37
-rw-r--r--src/containers/settings/EditServiceScreen.js2
-rw-r--r--src/containers/settings/EditSettingsScreen.js22
3 files changed, 46 insertions, 15 deletions
diff --git a/src/containers/settings/AccountScreen.js b/src/containers/settings/AccountScreen.js
index 93ab44690..12c912bac 100644
--- a/src/containers/settings/AccountScreen.js
+++ b/src/containers/settings/AccountScreen.js
@@ -6,12 +6,16 @@ import PaymentStore from '../../stores/PaymentStore';
6import UserStore from '../../stores/UserStore'; 6import UserStore from '../../stores/UserStore';
7import AppStore from '../../stores/AppStore'; 7import AppStore from '../../stores/AppStore';
8import FeaturesStore from '../../stores/FeaturesStore'; 8import FeaturesStore from '../../stores/FeaturesStore';
9import SettingsStore from '../../stores/SettingsStore';
9 10
10import AccountDashboard from '../../components/settings/account/AccountDashboard'; 11import AccountDashboard from '../../components/settings/account/AccountDashboard';
11import ErrorBoundary from '../../components/util/ErrorBoundary'; 12import ErrorBoundary from '../../components/util/ErrorBoundary';
12import { WEBSITE } from '../../environment'; 13import { WEBSITE } from '../../environment';
13 14
14export default @inject('stores', 'actions') @observer class AccountScreen extends Component { 15export default
16@inject('stores', 'actions')
17@observer
18class AccountScreen extends Component {
15 onCloseWindow() { 19 onCloseWindow() {
16 const { user, features } = this.props.stores; 20 const { user, features } = this.props.stores;
17 user.getUserInfoRequest.invalidate({ immediately: true }); 21 user.getUserInfoRequest.invalidate({ immediately: true });
@@ -32,7 +36,9 @@ export default @inject('stores', 'actions') @observer class AccountScreen extend
32 36
33 let url; 37 let url;
34 if (api === 'https://api.franzinfra.com') { 38 if (api === 'https://api.franzinfra.com') {
35 url = stores.user.getAuthURL(`${WEBSITE}${route}?utm_source=app&utm_medium=account_dashboard`); 39 url = stores.user.getAuthURL(
40 `${WEBSITE}${route}?utm_source=app&utm_medium=account_dashboard`,
41 );
36 } else { 42 } else {
37 url = `${api}${route}`; 43 url = `${api}${route}`;
38 } 44 }
@@ -41,11 +47,13 @@ export default @inject('stores', 'actions') @observer class AccountScreen extend
41 } 47 }
42 48
43 render() { 49 render() {
44 const { user, payment, features } = this.props.stores;
45 const { 50 const {
46 user: userActions, 51 user,
47 payment: paymentActions, 52 payment,
48 } = this.props.actions; 53 features,
54 settings,
55 } = this.props.stores;
56 const { user: userActions, payment: paymentActions } = this.props.actions;
49 57
50 const isLoadingUserInfo = user.getUserInfoRequest.isExecuting; 58 const isLoadingUserInfo = user.getUserInfoRequest.isExecuting;
51 const isLoadingPlans = payment.plansRequest.isExecuting; 59 const isLoadingPlans = payment.plansRequest.isExecuting;
@@ -55,19 +63,29 @@ export default @inject('stores', 'actions') @observer class AccountScreen extend
55 return ( 63 return (
56 <ErrorBoundary> 64 <ErrorBoundary>
57 <AccountDashboard 65 <AccountDashboard
66 server={settings.all.app.server}
58 user={user.data} 67 user={user.data}
59 isPremiumOverrideUser={user.isPremiumOverride} 68 isPremiumOverrideUser={user.isPremiumOverride}
60 isProUser={user.isPro} 69 isProUser={user.isPro}
61 isLoading={isLoadingUserInfo} 70 isLoading={isLoadingUserInfo}
62 isLoadingPlans={isLoadingPlans} 71 isLoadingPlans={isLoadingPlans}
63 userInfoRequestFailed={user.getUserInfoRequest.wasExecuted && user.getUserInfoRequest.isError} 72 userInfoRequestFailed={
73 user.getUserInfoRequest.wasExecuted
74 && user.getUserInfoRequest.isError
75 }
64 retryUserInfoRequest={() => this.reloadData()} 76 retryUserInfoRequest={() => this.reloadData()}
65 onCloseSubscriptionWindow={() => this.onCloseWindow()} 77 onCloseSubscriptionWindow={() => this.onCloseWindow()}
66 deleteAccount={userActions.delete} 78 deleteAccount={userActions.delete}
67 isLoadingDeleteAccount={user.deleteAccountRequest.isExecuting} 79 isLoadingDeleteAccount={user.deleteAccountRequest.isExecuting}
68 isDeleteAccountSuccessful={user.deleteAccountRequest.wasExecuted && !user.deleteAccountRequest.isError} 80 isDeleteAccountSuccessful={
81 user.deleteAccountRequest.wasExecuted
82 && !user.deleteAccountRequest.isError
83 }
69 openEditAccount={() => this.handleWebsiteLink('/user/profile')} 84 openEditAccount={() => this.handleWebsiteLink('/user/profile')}
70 upgradeToPro={() => upgradeAccount({ planId: features.features.pricingConfig.plans.pro.yearly.id })} 85 upgradeToPro={() => upgradeAccount({
86 planId: features.features.pricingConfig.plans.pro.yearly.id,
87 })
88 }
71 openBilling={() => this.handleWebsiteLink('/user/billing')} 89 openBilling={() => this.handleWebsiteLink('/user/billing')}
72 openInvoices={() => this.handleWebsiteLink('/user/invoices')} 90 openInvoices={() => this.handleWebsiteLink('/user/invoices')}
73 /> 91 />
@@ -81,6 +99,7 @@ AccountScreen.wrappedComponent.propTypes = {
81 user: PropTypes.instanceOf(UserStore).isRequired, 99 user: PropTypes.instanceOf(UserStore).isRequired,
82 features: PropTypes.instanceOf(FeaturesStore).isRequired, 100 features: PropTypes.instanceOf(FeaturesStore).isRequired,
83 payment: PropTypes.instanceOf(PaymentStore).isRequired, 101 payment: PropTypes.instanceOf(PaymentStore).isRequired,
102 settings: PropTypes.instanceOf(SettingsStore).isRequired,
84 app: PropTypes.instanceOf(AppStore).isRequired, 103 app: PropTypes.instanceOf(AppStore).isRequired,
85 }).isRequired, 104 }).isRequired,
86 actions: PropTypes.shape({ 105 actions: PropTypes.shape({
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js
index d18d7fb9b..99c40b086 100644
--- a/src/containers/settings/EditServiceScreen.js
+++ b/src/containers/settings/EditServiceScreen.js
@@ -51,7 +51,7 @@ const messages = defineMessages({
51 }, 51 },
52 customUrl: { 52 customUrl: {
53 id: 'settings.service.form.customUrl', 53 id: 'settings.service.form.customUrl',
54 defaultMessage: '!!!Custom server', 54 defaultMessage: '!!!Service URL',
55 }, 55 },
56 indirectMessages: { 56 indirectMessages: {
57 id: 'settings.service.form.indirectMessages', 57 id: 'settings.service.form.indirectMessages',
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js
index f404f8e8c..665444f50 100644
--- a/src/containers/settings/EditSettingsScreen.js
+++ b/src/containers/settings/EditSettingsScreen.js
@@ -10,7 +10,7 @@ import UserStore from '../../stores/UserStore';
10import TodosStore from '../../features/todos/store'; 10import TodosStore from '../../features/todos/store';
11import Form from '../../lib/Form'; 11import Form from '../../lib/Form';
12import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; 12import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages';
13import { DEFAULT_APP_SETTINGS, DEFAULT_LOCK_PASSWORD, HIBERNATION_STRATEGIES } from '../../config'; 13import { DEFAULT_APP_SETTINGS, HIBERNATION_STRATEGIES } from '../../config';
14import { config as spellcheckerConfig } from '../../features/spellchecker'; 14import { config as spellcheckerConfig } from '../../features/spellchecker';
15 15
16import { getSelectOptions } from '../../helpers/i18n-helpers'; 16import { getSelectOptions } from '../../helpers/i18n-helpers';
@@ -76,11 +76,15 @@ const messages = defineMessages({
76 }, 76 },
77 enableLock: { 77 enableLock: {
78 id: 'settings.app.form.enableLock', 78 id: 'settings.app.form.enableLock',
79 defaultMessage: '!!!Enable Ferdi password lock', 79 defaultMessage: '!!!Enable Password Lock',
80 }, 80 },
81 lockPassword: { 81 lockPassword: {
82 id: 'settings.app.form.lockPassword', 82 id: 'settings.app.form.lockPassword',
83 defaultMessage: '!!!Ferdi Lock password', 83 defaultMessage: '!!!Password',
84 },
85 inactivityLock: {
86 id: 'settings.app.form.inactivityLock',
87 defaultMessage: '!!!Lock after inactivity',
84 }, 88 },
85 scheduledDNDEnabled: { 89 scheduledDNDEnabled: {
86 id: 'settings.app.form.scheduledDNDEnabled', 90 id: 'settings.app.form.scheduledDNDEnabled',
@@ -104,7 +108,7 @@ const messages = defineMessages({
104 }, 108 },
105 adaptableDarkMode: { 109 adaptableDarkMode: {
106 id: 'settings.app.form.adaptableDarkMode', 110 id: 'settings.app.form.adaptableDarkMode',
107 defaultMessage: '!!!Enable adaptable Dark Mode', 111 defaultMessage: '!!!Synchronize dark mode with my Mac\'s dark mode setting',
108 }, 112 },
109 universalDarkMode: { 113 universalDarkMode: {
110 id: 'settings.app.form.universalDarkMode', 114 id: 'settings.app.form.universalDarkMode',
@@ -183,6 +187,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e
183 todoServer: settingsData.todoServer, 187 todoServer: settingsData.todoServer,
184 lockingFeatureEnabled: settingsData.lockingFeatureEnabled, 188 lockingFeatureEnabled: settingsData.lockingFeatureEnabled,
185 lockedPassword: settingsData.lockedPassword, 189 lockedPassword: settingsData.lockedPassword,
190 inactivityLock: settingsData.inactivityLock,
186 scheduledDNDEnabled: settingsData.scheduledDNDEnabled, 191 scheduledDNDEnabled: settingsData.scheduledDNDEnabled,
187 scheduledDNDStart: settingsData.scheduledDNDStart, 192 scheduledDNDStart: settingsData.scheduledDNDStart,
188 scheduledDNDEnd: settingsData.scheduledDNDEnd, 193 scheduledDNDEnd: settingsData.scheduledDNDEnd,
@@ -319,9 +324,15 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e
319 lockedPassword: { 324 lockedPassword: {
320 label: intl.formatMessage(messages.lockPassword), 325 label: intl.formatMessage(messages.lockPassword),
321 value: settings.all.app.lockedPassword, 326 value: settings.all.app.lockedPassword,
322 default: DEFAULT_LOCK_PASSWORD, 327 default: '',
323 type: 'password', 328 type: 'password',
324 }, 329 },
330 inactivityLock: {
331 label: intl.formatMessage(messages.inactivityLock),
332 value: settings.all.app.inactivityLock,
333 default: 0,
334 type: 'number',
335 },
325 scheduledDNDEnabled: { 336 scheduledDNDEnabled: {
326 label: intl.formatMessage(messages.scheduledDNDEnabled), 337 label: intl.formatMessage(messages.scheduledDNDEnabled),
327 value: settings.all.app.scheduledDNDEnabled || false, 338 value: settings.all.app.scheduledDNDEnabled || false,
@@ -466,6 +477,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e
466 hibernationEnabled={this.props.stores.settings.app.hibernate} 477 hibernationEnabled={this.props.stores.settings.app.hibernate}
467 isDarkmodeEnabled={this.props.stores.settings.app.darkMode} 478 isDarkmodeEnabled={this.props.stores.settings.app.darkMode}
468 isTrayEnabled={this.props.stores.settings.app.enableSystemTray} 479 isTrayEnabled={this.props.stores.settings.app.enableSystemTray}
480 isAdaptableDarkModeEnabled={this.props.stores.settings.app.adaptableDarkMode}
469 openProcessManager={() => this.openProcessManager()} 481 openProcessManager={() => this.openProcessManager()}
470 /> 482 />
471 </ErrorBoundary> 483 </ErrorBoundary>