diff options
author | 2018-11-22 14:14:25 +0100 | |
---|---|---|
committer | 2018-11-22 14:14:25 +0100 | |
commit | 46b8c8c4b3a5b80e0187b284abc84566a7e784db (patch) | |
tree | 7fd378bcdd18e78c42dfeb61a15f89fd10106046 /src/components/settings | |
parent | ADD features loading spinner (diff) | |
parent | feat(App): Add option to enable dark mode for supported services (diff) | |
download | ferdium-app-46b8c8c4b3a5b80e0187b284abc84566a7e784db.tar.gz ferdium-app-46b8c8c4b3a5b80e0187b284abc84566a7e784db.tar.zst ferdium-app-46b8c8c4b3a5b80e0187b284abc84566a7e784db.zip |
Merge branch 'develop' into feature/features-api
Diffstat (limited to 'src/components/settings')
10 files changed, 21 insertions, 20 deletions
diff --git a/src/components/settings/SettingsLayout.js b/src/components/settings/SettingsLayout.js index d5392ddba..3cb08feb1 100644 --- a/src/components/settings/SettingsLayout.js +++ b/src/components/settings/SettingsLayout.js | |||
@@ -5,8 +5,7 @@ import { observer } from 'mobx-react'; | |||
5 | import { oneOrManyChildElements } from '../../prop-types'; | 5 | import { oneOrManyChildElements } from '../../prop-types'; |
6 | import Appear from '../ui/effects/Appear'; | 6 | import Appear from '../ui/effects/Appear'; |
7 | 7 | ||
8 | @observer | 8 | export default @observer class SettingsLayout extends Component { |
9 | export default class SettingsLayout extends Component { | ||
10 | static propTypes = { | 9 | static propTypes = { |
11 | navigation: PropTypes.element.isRequired, | 10 | navigation: PropTypes.element.isRequired, |
12 | children: oneOrManyChildElements.isRequired, | 11 | children: oneOrManyChildElements.isRequired, |
diff --git a/src/components/settings/account/AccountDashboard.js b/src/components/settings/account/AccountDashboard.js index e6ccdaac7..ede519fd6 100644 --- a/src/components/settings/account/AccountDashboard.js +++ b/src/components/settings/account/AccountDashboard.js | |||
@@ -78,8 +78,7 @@ const messages = defineMessages({ | |||
78 | }, | 78 | }, |
79 | }); | 79 | }); |
80 | 80 | ||
81 | @observer | 81 | export default @observer class AccountDashboard extends Component { |
82 | export default class AccountDashboard extends Component { | ||
83 | static propTypes = { | 82 | static propTypes = { |
84 | user: MobxPropTypes.observableObject.isRequired, | 83 | user: MobxPropTypes.observableObject.isRequired, |
85 | orders: MobxPropTypes.arrayOrObservableArray.isRequired, | 84 | orders: MobxPropTypes.arrayOrObservableArray.isRequired, |
diff --git a/src/components/settings/recipes/RecipeItem.js b/src/components/settings/recipes/RecipeItem.js index 7b2f64d26..dae8891b3 100644 --- a/src/components/settings/recipes/RecipeItem.js +++ b/src/components/settings/recipes/RecipeItem.js | |||
@@ -4,8 +4,7 @@ import { observer } from 'mobx-react'; | |||
4 | 4 | ||
5 | import RecipePreviewModel from '../../../models/RecipePreview'; | 5 | import RecipePreviewModel from '../../../models/RecipePreview'; |
6 | 6 | ||
7 | @observer | 7 | export default @observer class RecipeItem extends Component { |
8 | export default class RecipeItem extends Component { | ||
9 | static propTypes = { | 8 | static propTypes = { |
10 | recipe: PropTypes.instanceOf(RecipePreviewModel).isRequired, | 9 | recipe: PropTypes.instanceOf(RecipePreviewModel).isRequired, |
11 | onClick: PropTypes.func.isRequired, | 10 | onClick: PropTypes.func.isRequired, |
diff --git a/src/components/settings/recipes/RecipesDashboard.js b/src/components/settings/recipes/RecipesDashboard.js index 4610c69a5..cd783200f 100644 --- a/src/components/settings/recipes/RecipesDashboard.js +++ b/src/components/settings/recipes/RecipesDashboard.js | |||
@@ -46,8 +46,7 @@ const messages = defineMessages({ | |||
46 | }, | 46 | }, |
47 | }); | 47 | }); |
48 | 48 | ||
49 | @observer | 49 | export default @observer class RecipesDashboard extends Component { |
50 | export default class RecipesDashboard extends Component { | ||
51 | static propTypes = { | 50 | static propTypes = { |
52 | recipes: MobxPropTypes.arrayOrObservableArray.isRequired, | 51 | recipes: MobxPropTypes.arrayOrObservableArray.isRequired, |
53 | isLoading: PropTypes.bool.isRequired, | 52 | isLoading: PropTypes.bool.isRequired, |
diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js index 3ffca99a7..777a95fcf 100644 --- a/src/components/settings/services/EditServiceForm.js +++ b/src/components/settings/services/EditServiceForm.js | |||
@@ -94,8 +94,7 @@ const messages = defineMessages({ | |||
94 | }, | 94 | }, |
95 | }); | 95 | }); |
96 | 96 | ||
97 | @observer | 97 | export default @observer class EditServiceForm extends Component { |
98 | export default class EditServiceForm extends Component { | ||
99 | static propTypes = { | 98 | static propTypes = { |
100 | recipe: PropTypes.instanceOf(Recipe).isRequired, | 99 | recipe: PropTypes.instanceOf(Recipe).isRequired, |
101 | service(props, propName) { | 100 | service(props, propName) { |
@@ -204,6 +203,8 @@ export default class EditServiceForm extends Component { | |||
204 | activeTabIndex = 2; | 203 | activeTabIndex = 2; |
205 | } | 204 | } |
206 | 205 | ||
206 | const requiresUserInput = !recipe.hasHostedOption && (recipe.hasTeamId || recipe.hasCustomUrl); | ||
207 | |||
207 | return ( | 208 | return ( |
208 | <div className="settings__main"> | 209 | <div className="settings__main"> |
209 | <div className="settings__header"> | 210 | <div className="settings__header"> |
@@ -305,6 +306,7 @@ export default class EditServiceForm extends Component { | |||
305 | 306 | ||
306 | <div className="settings__settings-group"> | 307 | <div className="settings__settings-group"> |
307 | <h3>{intl.formatMessage(messages.headlineGeneral)}</h3> | 308 | <h3>{intl.formatMessage(messages.headlineGeneral)}</h3> |
309 | <Toggle field={form.$('isDarkModeEnabled')} /> | ||
308 | <Toggle field={form.$('isEnabled')} /> | 310 | <Toggle field={form.$('isEnabled')} /> |
309 | </div> | 311 | </div> |
310 | </div> | 312 | </div> |
@@ -342,6 +344,7 @@ export default class EditServiceForm extends Component { | |||
342 | type="submit" | 344 | type="submit" |
343 | label={intl.formatMessage(messages.saveService)} | 345 | label={intl.formatMessage(messages.saveService)} |
344 | htmlForm="form" | 346 | htmlForm="form" |
347 | disabled={action !== 'edit' && form.isPristine && requiresUserInput} | ||
345 | /> | 348 | /> |
346 | )} | 349 | )} |
347 | </div> | 350 | </div> |
diff --git a/src/components/settings/services/ServiceError.js b/src/components/settings/services/ServiceError.js index 1f1512927..3cfc080d6 100644 --- a/src/components/settings/services/ServiceError.js +++ b/src/components/settings/services/ServiceError.js | |||
@@ -25,8 +25,7 @@ const messages = defineMessages({ | |||
25 | }, | 25 | }, |
26 | }); | 26 | }); |
27 | 27 | ||
28 | @observer | 28 | export default @observer class ServiceError extends Component { |
29 | export default class ServiceError extends Component { | ||
30 | static contextTypes = { | 29 | static contextTypes = { |
31 | intl: intlShape, | 30 | intl: intlShape, |
32 | }; | 31 | }; |
diff --git a/src/components/settings/services/ServiceItem.js b/src/components/settings/services/ServiceItem.js index 9743315b0..84080519b 100644 --- a/src/components/settings/services/ServiceItem.js +++ b/src/components/settings/services/ServiceItem.js | |||
@@ -22,8 +22,7 @@ const messages = defineMessages({ | |||
22 | }, | 22 | }, |
23 | }); | 23 | }); |
24 | 24 | ||
25 | @observer | 25 | export default @observer class ServiceItem extends Component { |
26 | export default class ServiceItem extends Component { | ||
27 | static propTypes = { | 26 | static propTypes = { |
28 | service: PropTypes.instanceOf(ServiceModel).isRequired, | 27 | service: PropTypes.instanceOf(ServiceModel).isRequired, |
29 | goToServiceForm: PropTypes.func.isRequired, | 28 | goToServiceForm: PropTypes.func.isRequired, |
diff --git a/src/components/settings/services/ServicesDashboard.js b/src/components/settings/services/ServicesDashboard.js index 20e451f01..e7dfaf106 100644 --- a/src/components/settings/services/ServicesDashboard.js +++ b/src/components/settings/services/ServicesDashboard.js | |||
@@ -49,8 +49,7 @@ const messages = defineMessages({ | |||
49 | }, | 49 | }, |
50 | }); | 50 | }); |
51 | 51 | ||
52 | @observer | 52 | export default @observer class ServicesDashboard extends Component { |
53 | export default class ServicesDashboard extends Component { | ||
54 | static propTypes = { | 53 | static propTypes = { |
55 | services: MobxPropTypes.arrayOrObservableArray.isRequired, | 54 | services: MobxPropTypes.arrayOrObservableArray.isRequired, |
56 | isLoading: PropTypes.bool.isRequired, | 55 | isLoading: PropTypes.bool.isRequired, |
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 72aa5a8af..b5c048ebd 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -76,10 +76,13 @@ const messages = defineMessages({ | |||
76 | id: 'settings.app.currentVersion', | 76 | id: 'settings.app.currentVersion', |
77 | defaultMessage: '!!!Current version:', | 77 | defaultMessage: '!!!Current version:', |
78 | }, | 78 | }, |
79 | enableGPUAccelerationInfo: { | ||
80 | id: 'settings.app.restartRequired', | ||
81 | defaultMessage: '!!!Changes require restart', | ||
82 | }, | ||
79 | }); | 83 | }); |
80 | 84 | ||
81 | @observer | 85 | export default @observer class EditSettingsForm extends Component { |
82 | export default class EditSettingsForm extends Component { | ||
83 | static propTypes = { | 86 | static propTypes = { |
84 | checkForUpdates: PropTypes.func.isRequired, | 87 | checkForUpdates: PropTypes.func.isRequired, |
85 | installUpdate: PropTypes.func.isRequired, | 88 | installUpdate: PropTypes.func.isRequired, |
@@ -157,6 +160,7 @@ export default class EditSettingsForm extends Component { | |||
157 | <h2 id="apperance">{intl.formatMessage(messages.headlineAppearance)}</h2> | 160 | <h2 id="apperance">{intl.formatMessage(messages.headlineAppearance)}</h2> |
158 | <Toggle field={form.$('showDisabledServices')} /> | 161 | <Toggle field={form.$('showDisabledServices')} /> |
159 | <Toggle field={form.$('showMessageBadgeWhenMuted')} /> | 162 | <Toggle field={form.$('showMessageBadgeWhenMuted')} /> |
163 | <Toggle field={form.$('darkMode')} /> | ||
160 | 164 | ||
161 | {/* Language */} | 165 | {/* Language */} |
162 | <h2 id="language">{intl.formatMessage(messages.headlineLanguage)}</h2> | 166 | <h2 id="language">{intl.formatMessage(messages.headlineLanguage)}</h2> |
@@ -172,6 +176,8 @@ export default class EditSettingsForm extends Component { | |||
172 | {/* Advanced */} | 176 | {/* Advanced */} |
173 | <h2 id="advanced">{intl.formatMessage(messages.headlineAdvanced)}</h2> | 177 | <h2 id="advanced">{intl.formatMessage(messages.headlineAdvanced)}</h2> |
174 | <Toggle field={form.$('enableSpellchecking')} /> | 178 | <Toggle field={form.$('enableSpellchecking')} /> |
179 | <Toggle field={form.$('enableGPUAcceleration')} /> | ||
180 | <p className="settings__help">{intl.formatMessage(messages.enableGPUAccelerationInfo)}</p> | ||
175 | {/* <Select field={form.$('spellcheckingLanguage')} /> */} | 181 | {/* <Select field={form.$('spellcheckingLanguage')} /> */} |
176 | <div className="settings__settings-group"> | 182 | <div className="settings__settings-group"> |
177 | <h3> | 183 | <h3> |
diff --git a/src/components/settings/user/EditUserForm.js b/src/components/settings/user/EditUserForm.js index 1ac8be80f..b825f844a 100644 --- a/src/components/settings/user/EditUserForm.js +++ b/src/components/settings/user/EditUserForm.js | |||
@@ -39,8 +39,7 @@ const messages = defineMessages({ | |||
39 | }, | 39 | }, |
40 | }); | 40 | }); |
41 | 41 | ||
42 | @observer | 42 | export default @observer class EditServiceForm extends Component { |
43 | export default class EditServiceForm extends Component { | ||
44 | static propTypes = { | 43 | static propTypes = { |
45 | status: MobxPropTypes.observableArray.isRequired, | 44 | status: MobxPropTypes.observableArray.isRequired, |
46 | form: PropTypes.instanceOf(Form).isRequired, | 45 | form: PropTypes.instanceOf(Form).isRequired, |