diff options
author | 2019-09-24 10:55:15 +0700 | |
---|---|---|
committer | 2019-09-24 10:55:15 +0700 | |
commit | d88b04b05b64b6fea38e226c3bf344f58c2ceefb (patch) | |
tree | 37d0453f258414f483c2ce27623b12de6ce1b09f /src/components | |
parent | Trigger pull request build after replugging Travis (diff) | |
parent | Add darkreader to feature list and changelog (diff) | |
download | ferdium-app-d88b04b05b64b6fea38e226c3bf344f58c2ceefb.tar.gz ferdium-app-d88b04b05b64b6fea38e226c3bf344f58c2ceefb.tar.zst ferdium-app-d88b04b05b64b6fea38e226c3bf344f58c2ceefb.zip |
Merge branch 'master' into feat/macos-signing
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/auth/AuthLayout.js | 2 | ||||
-rw-r--r-- | src/components/layout/AppLayout.js | 2 | ||||
-rw-r--r-- | src/components/services/content/ServiceWebview.js | 20 | ||||
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 68 | ||||
-rw-r--r-- | src/components/ui/Modal/index.js | 3 |
5 files changed, 91 insertions, 4 deletions
diff --git a/src/components/auth/AuthLayout.js b/src/components/auth/AuthLayout.js index 641b754ed..0c5198583 100644 --- a/src/components/auth/AuthLayout.js +++ b/src/components/auth/AuthLayout.js | |||
@@ -87,7 +87,7 @@ export default @observer class AuthLayout extends Component { | |||
87 | })} | 87 | })} |
88 | </div> | 88 | </div> |
89 | {/* </div> */} | 89 | {/* </div> */} |
90 | <Link to="https://github.com/kytwb/ferdi" className="auth__adlk" target="_blank"> | 90 | <Link to="https://github.com/getferdi/ferdi" className="auth__adlk" target="_blank"> |
91 | <img src="./assets/images/adlk.svg" alt="" /> | 91 | <img src="./assets/images/adlk.svg" alt="" /> |
92 | </Link> | 92 | </Link> |
93 | </div> | 93 | </div> |
diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index e82275b9f..2b0719f92 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js | |||
@@ -8,6 +8,7 @@ import injectSheet from 'react-jss'; | |||
8 | import InfoBar from '../ui/InfoBar'; | 8 | import InfoBar from '../ui/InfoBar'; |
9 | import { Component as BasicAuth } from '../../features/basicAuth'; | 9 | import { Component as BasicAuth } from '../../features/basicAuth'; |
10 | import { Component as ShareFranz } from '../../features/shareFranz'; | 10 | import { Component as ShareFranz } from '../../features/shareFranz'; |
11 | import { Component as QuickSwitch } from '../../features/quickSwitch'; | ||
11 | import ErrorBoundary from '../util/ErrorBoundary'; | 12 | import ErrorBoundary from '../util/ErrorBoundary'; |
12 | 13 | ||
13 | // import globalMessages from '../../i18n/globalMessages'; | 14 | // import globalMessages from '../../i18n/globalMessages'; |
@@ -185,6 +186,7 @@ class AppLayout extends Component { | |||
185 | )} | 186 | )} |
186 | <BasicAuth /> | 187 | <BasicAuth /> |
187 | <ShareFranz /> | 188 | <ShareFranz /> |
189 | <QuickSwitch /> | ||
188 | {services} | 190 | {services} |
189 | {children} | 191 | {children} |
190 | </div> | 192 | </div> |
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index 7252c695f..75b3d2cf0 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js | |||
@@ -1,10 +1,13 @@ | |||
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 { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
4 | import { observable, reaction } from 'mobx'; | ||
4 | import ElectronWebView from 'react-electron-web-view'; | 5 | import ElectronWebView from 'react-electron-web-view'; |
5 | 6 | ||
6 | import ServiceModel from '../../../models/Service'; | 7 | import ServiceModel from '../../../models/Service'; |
7 | 8 | ||
9 | const debug = require('debug')('Ferdi:Services'); | ||
10 | |||
8 | @observer | 11 | @observer |
9 | class ServiceWebview extends Component { | 12 | class ServiceWebview extends Component { |
10 | static propTypes = { | 13 | static propTypes = { |
@@ -13,7 +16,22 @@ class ServiceWebview extends Component { | |||
13 | detachService: PropTypes.func.isRequired, | 16 | detachService: PropTypes.func.isRequired, |
14 | }; | 17 | }; |
15 | 18 | ||
16 | webview = null; | 19 | @observable webview = null; |
20 | |||
21 | constructor(props) { | ||
22 | super(props); | ||
23 | |||
24 | reaction( | ||
25 | () => this.webview, | ||
26 | () => { | ||
27 | if (this.webview.view) { | ||
28 | this.webview.view.addEventListener('console-message', (e) => { | ||
29 | debug('Service logged a message:', e.message); | ||
30 | }); | ||
31 | } | ||
32 | }, | ||
33 | ); | ||
34 | } | ||
17 | 35 | ||
18 | componentWillUnmount() { | 36 | componentWillUnmount() { |
19 | const { service, detachService } = this.props; | 37 | const { service, detachService } = this.props; |
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index ef6ab2707..52bd18603 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -38,6 +38,14 @@ const messages = defineMessages({ | |||
38 | id: 'settings.app.lockedPasswordInfo', | 38 | id: 'settings.app.lockedPasswordInfo', |
39 | defaultMessage: '!!!Please make sure to set a password you\'ll remember.\nIf you loose this password, you will have to reinstall Ferdi.', | 39 | defaultMessage: '!!!Please make sure to set a password you\'ll remember.\nIf you loose this password, you will have to reinstall Ferdi.', |
40 | }, | 40 | }, |
41 | scheduledDNDTimeInfo: { | ||
42 | id: 'settings.app.scheduledDNDTimeInfo', | ||
43 | defaultMessage: '!!!Times in 24-Hour-Format. End time can be before start time (e.g. start 17:00, end 09:00) to enable Do-not-Disturb overnight.', | ||
44 | }, | ||
45 | scheduledDNDInfo: { | ||
46 | id: 'settings.app.scheduledDNDInfo', | ||
47 | defaultMessage: '!!!Scheduled Do-not-Disturb allows you to define a period of time in which you do not want to get Notifications from Ferdi.', | ||
48 | }, | ||
41 | headlineLanguage: { | 49 | headlineLanguage: { |
42 | id: 'settings.app.headlineLanguage', | 50 | id: 'settings.app.headlineLanguage', |
43 | defaultMessage: '!!!Language', | 51 | defaultMessage: '!!!Language', |
@@ -167,7 +175,11 @@ export default @observer class EditSettingsForm extends Component { | |||
167 | } | 175 | } |
168 | 176 | ||
169 | const isLoggedIn = Boolean(localStorage.getItem('authToken')); | 177 | const isLoggedIn = Boolean(localStorage.getItem('authToken')); |
170 | const lockingFeatureEnabled = window.ferdi.stores.settings.all.app.lockingFeatureEnabled; | 178 | |
179 | const { | ||
180 | lockingFeatureEnabled, | ||
181 | scheduledDNDEnabled, | ||
182 | } = window.ferdi.stores.settings.all.app; | ||
171 | 183 | ||
172 | return ( | 184 | return ( |
173 | <div className="settings__main"> | 185 | <div className="settings__main"> |
@@ -217,7 +229,7 @@ export default @observer class EditSettingsForm extends Component { | |||
217 | {' '} | 229 | {' '} |
218 | or | 230 | or |
219 | {' '} | 231 | {' '} |
220 | <a href="https://github.com/vantezzen/ferdi-server" target="_blank">using a self-hosted ferdi-server</a> | 232 | <a href="https://github.com/getferdi/server" target="_blank">using a self-hosted ferdi-server</a> |
221 | {' '} | 233 | {' '} |
222 | (if you have the knowledge and resources to do so). | 234 | (if you have the knowledge and resources to do so). |
223 | <br /> | 235 | <br /> |
@@ -248,6 +260,8 @@ export default @observer class EditSettingsForm extends Component { | |||
248 | onChange={e => this.submit(e)} | 260 | onChange={e => this.submit(e)} |
249 | field={form.$('lockedPassword')} | 261 | field={form.$('lockedPassword')} |
250 | type="password" | 262 | type="password" |
263 | scorePassword | ||
264 | showPasswordToggle | ||
251 | /> | 265 | /> |
252 | <p> | 266 | <p> |
253 | { intl.formatMessage(messages.lockedPasswordInfo) } | 267 | { intl.formatMessage(messages.lockedPasswordInfo) } |
@@ -271,6 +285,56 @@ export default @observer class EditSettingsForm extends Component { | |||
271 | </p> | 285 | </p> |
272 | 286 | ||
273 | 287 | ||
288 | <Toggle field={form.$('scheduledDNDEnabled')} /> | ||
289 | {scheduledDNDEnabled && ( | ||
290 | <> | ||
291 | <div style={{ | ||
292 | display: 'flex', | ||
293 | justifyContent: 'center', | ||
294 | }} | ||
295 | > | ||
296 | <div style={{ | ||
297 | padding: '0 1rem', | ||
298 | width: '100%', | ||
299 | }} | ||
300 | > | ||
301 | <Input | ||
302 | placeholder="17:00" | ||
303 | onChange={e => this.submit(e)} | ||
304 | field={form.$('scheduledDNDStart')} | ||
305 | type="time" | ||
306 | /> | ||
307 | </div> | ||
308 | <div style={{ | ||
309 | padding: '0 1rem', | ||
310 | width: '100%', | ||
311 | }} | ||
312 | > | ||
313 | <Input | ||
314 | placeholder="09:00" | ||
315 | onChange={e => this.submit(e)} | ||
316 | field={form.$('scheduledDNDEnd')} | ||
317 | type="time" | ||
318 | /> | ||
319 | </div> | ||
320 | </div> | ||
321 | <p> | ||
322 | { intl.formatMessage(messages.scheduledDNDTimeInfo) } | ||
323 | </p> | ||
324 | </> | ||
325 | )} | ||
326 | <p | ||
327 | className="settings__message" | ||
328 | style={{ | ||
329 | borderTop: 0, marginTop: 0, paddingTop: 0, marginBottom: '2rem', | ||
330 | }} | ||
331 | > | ||
332 | <span> | ||
333 | { intl.formatMessage(messages.scheduledDNDInfo) } | ||
334 | </span> | ||
335 | </p> | ||
336 | |||
337 | |||
274 | {/* Appearance */} | 338 | {/* Appearance */} |
275 | <h2 id="apperance">{intl.formatMessage(messages.headlineAppearance)}</h2> | 339 | <h2 id="apperance">{intl.formatMessage(messages.headlineAppearance)}</h2> |
276 | <Toggle field={form.$('showDisabledServices')} /> | 340 | <Toggle field={form.$('showDisabledServices')} /> |
diff --git a/src/components/ui/Modal/index.js b/src/components/ui/Modal/index.js index 63d858c47..0af521452 100644 --- a/src/components/ui/Modal/index.js +++ b/src/components/ui/Modal/index.js | |||
@@ -41,6 +41,8 @@ export default @injectCSS(styles) class Modal extends Component { | |||
41 | showClose, | 41 | showClose, |
42 | } = this.props; | 42 | } = this.props; |
43 | 43 | ||
44 | const appRoot = document.getElementById('root'); | ||
45 | |||
44 | return ( | 46 | return ( |
45 | <ReactModal | 47 | <ReactModal |
46 | isOpen={isOpen} | 48 | isOpen={isOpen} |
@@ -53,6 +55,7 @@ export default @injectCSS(styles) class Modal extends Component { | |||
53 | portal={portal} | 55 | portal={portal} |
54 | onRequestClose={close} | 56 | onRequestClose={close} |
55 | shouldCloseOnOverlayClick={shouldCloseOnOverlayClick} | 57 | shouldCloseOnOverlayClick={shouldCloseOnOverlayClick} |
58 | appElement={appRoot} | ||
56 | > | 59 | > |
57 | {showClose && close && ( | 60 | {showClose && close && ( |
58 | <button | 61 | <button |