diff options
author | 2021-08-24 10:22:22 +0530 | |
---|---|---|
committer | 2021-08-24 10:22:22 +0530 | |
commit | 2dc7b2fd3976853f3dc2f182f12cfe11c3b83688 (patch) | |
tree | 22fc7a9e4d3ddd2be16821c871259fb067c7df30 /src/components | |
parent | docs: upgraded version to 5.6.1-beta.1 (diff) | |
parent | 5.6.1-nightly.37 [skip ci] (diff) | |
download | ferdium-app-2dc7b2fd3976853f3dc2f182f12cfe11c3b83688.tar.gz ferdium-app-2dc7b2fd3976853f3dc2f182f12cfe11c3b83688.tar.zst ferdium-app-2dc7b2fd3976853f3dc2f182f12cfe11c3b83688.zip |
Merge remote-tracking branch 'origin/develop' into release
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/layout/AppLayout.js | 2 | ||||
-rw-r--r-- | src/components/layout/Sidebar.js | 3 | ||||
-rw-r--r-- | src/components/services/content/ServiceWebview.js | 4 | ||||
-rw-r--r-- | src/components/services/tabs/TabItem.js | 6 | ||||
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 51 | ||||
-rw-r--r-- | src/components/ui/AppLoader/index.js | 1 | ||||
-rw-r--r-- | src/components/ui/Link.js | 10 |
7 files changed, 58 insertions, 19 deletions
diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index d5e1deb39..00d7a759b 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js | |||
@@ -7,7 +7,6 @@ import injectSheet from 'react-jss'; | |||
7 | 7 | ||
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'; | ||
11 | import { Component as QuickSwitch } from '../../features/quickSwitch'; | 10 | import { Component as QuickSwitch } from '../../features/quickSwitch'; |
12 | import { Component as NightlyBuilds } from '../../features/nightlyBuilds'; | 11 | import { Component as NightlyBuilds } from '../../features/nightlyBuilds'; |
13 | import { Component as PublishDebugInfo } from '../../features/publishDebugInfo'; | 12 | import { Component as PublishDebugInfo } from '../../features/publishDebugInfo'; |
@@ -204,7 +203,6 @@ class AppLayout extends Component { | |||
204 | /> | 203 | /> |
205 | )} | 204 | )} |
206 | <BasicAuth /> | 205 | <BasicAuth /> |
207 | <ShareFranz /> | ||
208 | <QuickSwitch /> | 206 | <QuickSwitch /> |
209 | <NightlyBuilds /> | 207 | <NightlyBuilds /> |
210 | <PublishDebugInfo /> | 208 | <PublishDebugInfo /> |
diff --git a/src/components/layout/Sidebar.js b/src/components/layout/Sidebar.js index daa5642c3..a9fb73f33 100644 --- a/src/components/layout/Sidebar.js +++ b/src/components/layout/Sidebar.js | |||
@@ -216,8 +216,7 @@ export default @inject('stores', 'actions') @observer class Sidebar extends Comp | |||
216 | className="sidebar__button sidebar__button--settings" | 216 | className="sidebar__button sidebar__button--settings" |
217 | data-tip={`${intl.formatMessage(messages.settings)} (${settingsShortcutKey(false)})`} | 217 | data-tip={`${intl.formatMessage(messages.settings)} (${settingsShortcutKey(false)})`} |
218 | > | 218 | > |
219 | {/* TODO: Because of https://github.com/Templarian/MaterialDesign-Webfont/issues/81 bug in @mdi/font in 5.9.55, added `mdi-memory` as a fallback */} | 219 | <i className="mdi mdi-cog" /> |
220 | <i className="mdi mdi-settings mdi-memory" /> | ||
221 | { (this.props.stores.app.updateStatus === this.props.stores.app.updateStatusTypes.AVAILABLE | 220 | { (this.props.stores.app.updateStatus === this.props.stores.app.updateStatusTypes.AVAILABLE |
222 | || this.props.stores.app.updateStatus === this.props.stores.app.updateStatusTypes.DOWNLOADED) && ( | 221 | || this.props.stores.app.updateStatus === this.props.stores.app.updateStatusTypes.DOWNLOADED) && ( |
223 | <span className="update-available"> | 222 | <span className="update-available"> |
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index 3b499a5db..c0f48793a 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js | |||
@@ -24,7 +24,9 @@ class ServiceWebview extends Component { | |||
24 | super(props); | 24 | super(props); |
25 | 25 | ||
26 | reaction( | 26 | reaction( |
27 | () => this.webview, | 27 | () => ( |
28 | this.webview | ||
29 | ), | ||
28 | () => { | 30 | () => { |
29 | if (this.webview && this.webview.view) { | 31 | if (this.webview && this.webview.view) { |
30 | this.webview.view.addEventListener('console-message', (e) => { | 32 | this.webview.view.addEventListener('console-message', (e) => { |
diff --git a/src/components/services/tabs/TabItem.js b/src/components/services/tabs/TabItem.js index 6a6d2c8c5..6ad925670 100644 --- a/src/components/services/tabs/TabItem.js +++ b/src/components/services/tabs/TabItem.js | |||
@@ -10,7 +10,7 @@ import ms from 'ms'; | |||
10 | 10 | ||
11 | import { observable, autorun } from 'mobx'; | 11 | import { observable, autorun } from 'mobx'; |
12 | import ServiceModel from '../../../models/Service'; | 12 | import ServiceModel from '../../../models/Service'; |
13 | import { shortcutKey } from '../../../environment'; | 13 | import { cmdOrCtrlShortcutKey } from '../../../environment'; |
14 | 14 | ||
15 | const IS_SERVICE_DEBUGGING_ENABLED = ( | 15 | const IS_SERVICE_DEBUGGING_ENABLED = ( |
16 | localStorage.getItem('debug') || '' | 16 | localStorage.getItem('debug') || '' |
@@ -201,7 +201,7 @@ class TabItem extends Component { | |||
201 | { | 201 | { |
202 | label: intl.formatMessage(messages.reload), | 202 | label: intl.formatMessage(messages.reload), |
203 | click: reload, | 203 | click: reload, |
204 | accelerator: `${shortcutKey()}+R`, | 204 | accelerator: `${cmdOrCtrlShortcutKey()}+R`, |
205 | }, | 205 | }, |
206 | { | 206 | { |
207 | label: intl.formatMessage(messages.edit), | 207 | label: intl.formatMessage(messages.edit), |
@@ -307,7 +307,7 @@ class TabItem extends Component { | |||
307 | onClick={clickHandler} | 307 | onClick={clickHandler} |
308 | onContextMenu={() => menu.popup(getCurrentWindow())} | 308 | onContextMenu={() => menu.popup(getCurrentWindow())} |
309 | data-tip={`${service.name} ${ | 309 | data-tip={`${service.name} ${ |
310 | shortcutIndex <= 9 ? `(${shortcutKey(false)}+${shortcutIndex})` : '' | 310 | shortcutIndex <= 9 ? `(${cmdOrCtrlShortcutKey(false)}+${shortcutIndex})` : '' |
311 | }`} | 311 | }`} |
312 | > | 312 | > |
313 | <img src={service.icon} className="tab-item__icon" alt="" /> | 313 | <img src={service.icon} className="tab-item__icon" alt="" /> |
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 87a4ada27..41580ca78 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -1,4 +1,4 @@ | |||
1 | import { app, systemPreferences } from '@electron/remote'; | 1 | import { systemPreferences } from '@electron/remote'; |
2 | import React, { Component } from 'react'; | 2 | import React, { Component } from 'react'; |
3 | import PropTypes from 'prop-types'; | 3 | import PropTypes from 'prop-types'; |
4 | import { observer } from 'mobx-react'; | 4 | import { observer } from 'mobx-react'; |
@@ -12,11 +12,9 @@ import ToggleRaw from '../../ui/ToggleRaw'; | |||
12 | import Select from '../../ui/Select'; | 12 | import Select from '../../ui/Select'; |
13 | import Input from '../../ui/Input'; | 13 | import Input from '../../ui/Input'; |
14 | 14 | ||
15 | import { | 15 | import { FRANZ_TRANSLATION, GITHUB_FRANZ_URL } from '../../../config'; |
16 | FRANZ_TRANSLATION, | 16 | import { DEFAULT_APP_SETTINGS, ferdiVersion, isMac, isWindows, lockFerdiShortcutKey, userDataPath, userDataRecipesPath } from '../../../environment'; |
17 | GITHUB_FRANZ_URL, | 17 | import { openPath } from '../../../helpers/url-helpers'; |
18 | } from '../../../config'; | ||
19 | import { DEFAULT_APP_SETTINGS, isMac, isWindows, lockFerdiShortcutKey } from '../../../environment'; | ||
20 | import globalMessages from '../../../i18n/globalMessages'; | 18 | import globalMessages from '../../../i18n/globalMessages'; |
21 | 19 | ||
22 | const messages = defineMessages({ | 20 | const messages = defineMessages({ |
@@ -116,6 +114,18 @@ const messages = defineMessages({ | |||
116 | id: 'settings.app.buttonClearAllCache', | 114 | id: 'settings.app.buttonClearAllCache', |
117 | defaultMessage: '!!!Clear cache', | 115 | defaultMessage: '!!!Clear cache', |
118 | }, | 116 | }, |
117 | subheadlineFerdiProfile: { | ||
118 | id: 'settings.app.subheadlineFerdiProfile', | ||
119 | defaultMessage: '!!!Ferdi Profile', | ||
120 | }, | ||
121 | buttonOpenFerdiProfileFolder: { | ||
122 | id: 'settings.app.buttonOpenFerdiProfileFolder', | ||
123 | defaultMessage: '!!!Open Profile folder', | ||
124 | }, | ||
125 | buttonOpenFerdiServiceRecipesFolder: { | ||
126 | id: 'settings.app.buttonOpenFerdiServiceRecipesFolder', | ||
127 | defaultMessage: '!!!Open Service Recipes folder', | ||
128 | }, | ||
119 | buttonSearchForUpdate: { | 129 | buttonSearchForUpdate: { |
120 | id: 'settings.app.buttonSearchForUpdate', | 130 | id: 'settings.app.buttonSearchForUpdate', |
121 | defaultMessage: '!!!Check for updates', | 131 | defaultMessage: '!!!Check for updates', |
@@ -259,6 +269,9 @@ export default @observer class EditSettingsForm extends Component { | |||
259 | } | 269 | } |
260 | } | 270 | } |
261 | 271 | ||
272 | const profileFolder = userDataPath(); | ||
273 | const recipeFolder = userDataRecipesPath(); | ||
274 | |||
262 | return ( | 275 | return ( |
263 | <div className="settings__main"> | 276 | <div className="settings__main"> |
264 | <div className="settings__header"> | 277 | <div className="settings__header"> |
@@ -631,6 +644,30 @@ export default @observer class EditSettingsForm extends Component { | |||
631 | /> | 644 | /> |
632 | </p> | 645 | </p> |
633 | </div> | 646 | </div> |
647 | |||
648 | <Hr /> | ||
649 | |||
650 | <div className="settings__settings-group"> | ||
651 | <h3> | ||
652 | {intl.formatMessage(messages.subheadlineFerdiProfile)} | ||
653 | </h3> | ||
654 | <p> | ||
655 | <div className="settings__open-settings-file-container"> | ||
656 | <Button | ||
657 | buttonType="secondary" | ||
658 | label={intl.formatMessage(messages.buttonOpenFerdiProfileFolder)} | ||
659 | className="settings__open-settings-file-button" | ||
660 | onClick={() => openPath(profileFolder)} | ||
661 | /> | ||
662 | <Button | ||
663 | buttonType="secondary" | ||
664 | label={intl.formatMessage(messages.buttonOpenFerdiServiceRecipesFolder)} | ||
665 | className="settings__open-settings-file-button" | ||
666 | onClick={() => openPath(recipeFolder)} | ||
667 | /> | ||
668 | </div> | ||
669 | </p> | ||
670 | </div> | ||
634 | </div> | 671 | </div> |
635 | )} | 672 | )} |
636 | 673 | ||
@@ -669,7 +706,7 @@ export default @observer class EditSettingsForm extends Component { | |||
669 | )} | 706 | )} |
670 | {intl.formatMessage(messages.currentVersion)} | 707 | {intl.formatMessage(messages.currentVersion)} |
671 | {' '} | 708 | {' '} |
672 | {app.getVersion()} | 709 | {ferdiVersion} |
673 | {noUpdateAvailable && ( | 710 | {noUpdateAvailable && ( |
674 | <> | 711 | <> |
675 | <br /> | 712 | <br /> |
diff --git a/src/components/ui/AppLoader/index.js b/src/components/ui/AppLoader/index.js index 31d7ca249..bbfd5de28 100644 --- a/src/components/ui/AppLoader/index.js +++ b/src/components/ui/AppLoader/index.js | |||
@@ -8,6 +8,7 @@ import { shuffleArray } from '../../../helpers/array-helpers'; | |||
8 | 8 | ||
9 | import styles from './styles'; | 9 | import styles from './styles'; |
10 | 10 | ||
11 | // TODO: Need to externalize for i18n | ||
11 | const textList = shuffleArray([ | 12 | const textList = shuffleArray([ |
12 | 'Adding free features', | 13 | 'Adding free features', |
13 | 'Making application usable', | 14 | 'Making application usable', |
diff --git a/src/components/ui/Link.js b/src/components/ui/Link.js index fd14b7018..003211e5c 100644 --- a/src/components/ui/Link.js +++ b/src/components/ui/Link.js | |||
@@ -1,4 +1,3 @@ | |||
1 | import { shell } from 'electron'; | ||
2 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
3 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
4 | import { inject, observer } from 'mobx-react'; | 3 | import { inject, observer } from 'mobx-react'; |
@@ -7,15 +6,18 @@ import classnames from 'classnames'; | |||
7 | 6 | ||
8 | import { oneOrManyChildElements } from '../../prop-types'; | 7 | import { oneOrManyChildElements } from '../../prop-types'; |
9 | import { matchRoute } from '../../helpers/routing-helpers'; | 8 | import { matchRoute } from '../../helpers/routing-helpers'; |
9 | import { openExternalUrl } from '../../helpers/url-helpers'; | ||
10 | 10 | ||
11 | // TODO: create container component for this component | 11 | // TODO: create container component for this component |
12 | export default @inject('stores') @observer class Link extends Component { | 12 | export default @inject('stores') @observer class Link extends Component { |
13 | onClick(e) { | 13 | onClick(e) { |
14 | if (this.props.disabled) e.preventDefault(); | 14 | if (this.props.disabled) { |
15 | else if (this.props.target === '_blank') { | ||
16 | e.preventDefault(); | 15 | e.preventDefault(); |
17 | shell.openExternal(this.props.to); | 16 | } else if (this.props.target === '_blank') { |
17 | e.preventDefault(); | ||
18 | openExternalUrl(this.props.to, true); | ||
18 | } | 19 | } |
20 | // Note: if neither of the above, then let the other onClick handlers process it | ||
19 | } | 21 | } |
20 | 22 | ||
21 | render() { | 23 | render() { |