aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
authorLibravatar Bennett <hello@vantezzen.io>2020-04-17 14:32:53 +0200
committerLibravatar GitHub <noreply@github.com>2020-04-17 13:32:53 +0100
commit3239172af9fb68226e1e11392b16f833b726ad72 (patch)
treefdafdea17c8873cffdec64351e532ffdb2c7d233 /src/components
parentNew Crowdin translations (#570) (diff)
downloadferdium-app-3239172af9fb68226e1e11392b16f833b726ad72.tar.gz
ferdium-app-3239172af9fb68226e1e11392b16f833b726ad72.tar.zst
ferdium-app-3239172af9fb68226e1e11392b16f833b726ad72.zip
Merge Franz 5.5.0 beta.1 and 2 (#549)
* Automatic i18n update (i18n.meetfranz.com) * Fix zoom not working * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Add environment variable FRANZ_APPDATA_DIR * Add environment variable for config FRANZ_APPDATA_DIR * fix stuff that shouldn't need fixing in the first place * notarize app * bump version to 5.4.1 * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * update to electron 7.1.7 * bump version to 5.5.0 * Automatic i18n update (i18n.meetfranz.com) * Bump electron to 7.1.10 * plan changes * filter plan variants * add missing string * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Replace/remove deprecated electron function calls Electron replaced several function calls with object properties. Franz still uses some of these deprecated functions, so this commit will replace these with their new property counterpart. This commit is only transferring the changes made in getferdi/ferdi#371 and getferdi/ferdi#384 into the upstream repository. * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Update to electron 8.0.1 * feat(Service): Add service hibernation to save system resources * Fix linting issues * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Bump version to electron 8.1.1 * update strings * update electron-notarize * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * Add audio & video permission request for cataline * Automatic i18n update (i18n.meetfranz.com) * bump version to beta 1 * Automatic i18n update (i18n.meetfranz.com) * enable external links * Fix main content href * Automatic i18n update (i18n.meetfranz.com) * fix(Service): Fix issue with user agent override in service workers * Automatic i18n update (i18n.meetfranz.com) * fix macOS string replacement * Automatic i18n update (i18n.meetfranz.com) * fix(Experimental): Fix Google signin * fix(Service): Add integrity checks to prevent services recipes getting lost * Remove service reload on app-resume * update strings * bump version to beta 2 * Automatic i18n update (i18n.meetfranz.com) * bump electron-builder and electron-updater deps * test video permissions * fix `extendInfo` keys * fix typo * fix permission request * update camera/microphone entitlements * Automatic i18n update (i18n.meetfranz.com) * Test screen capture permissions * unpack `mac-screen-capture-permissions` * don't require localstorage temp key for permissions request * move macOS permission request to main process * Fix checking for permissions * fix(macOS): Ask the user to move Franz to the `/Applications` Folder * only try to recover recipe when user is online * update service request link * Update changelog * Reset `service.lostRecipeReloadAttempt` once service is alive again * Update translations * Fix crash on macOS * Fix merge errors * Fix lint * Disable ConnectionLostBanner * #551 Add information about Ferdi to the user agent * Fix requested changes * Remove tsbuildinfo files * Add .tsbuildinfo files to gitignore * Fix "Cannot destructure property 'app' of '_electron.remote' as it is undefined" Co-authored-by: FranzBot <i18n@meetfranz.com> Co-authored-by: Makazzz <makazzzpro@live.ca> Co-authored-by: Stefan Malzner <stefan@adlk.io>
Diffstat (limited to 'src/components')
-rw-r--r--src/components/services/content/ConnectionLostBanner.js119
-rw-r--r--src/components/services/content/ServiceView.js8
-rw-r--r--src/components/services/tabs/TabItem.js2
-rw-r--r--src/components/settings/services/EditServiceForm.js14
-rw-r--r--src/components/ui/FeatureList.js5
5 files changed, 146 insertions, 2 deletions
diff --git a/src/components/services/content/ConnectionLostBanner.js b/src/components/services/content/ConnectionLostBanner.js
new file mode 100644
index 000000000..9609a65b1
--- /dev/null
+++ b/src/components/services/content/ConnectionLostBanner.js
@@ -0,0 +1,119 @@
1import React, { Component } from 'react';
2import PropTypes from 'prop-types';
3import { observer } from 'mobx-react';
4import injectSheet from 'react-jss';
5import { Icon } from '@meetfranz/ui';
6import { intlShape, defineMessages } from 'react-intl';
7
8import {
9 mdiAlert,
10} from '@mdi/js';
11import { LIVE_API_WEBSITE } from '../../../config';
12// import { Button } from '@meetfranz/forms';
13
14const messages = defineMessages({
15 text: {
16 id: 'connectionLostBanner.message',
17 defaultMessage: '!!!Oh no! Franz lost the connection to {name}.',
18 },
19 moreInformation: {
20 id: 'connectionLostBanner.informationLink',
21 defaultMessage: '!!!What happened?',
22 },
23 cta: {
24 id: 'connectionLostBanner.cta',
25 defaultMessage: '!!!Reload Service',
26 },
27});
28
29const styles = theme => ({
30 root: {
31 background: theme.colorBackground,
32 borderRadius: theme.borderRadius,
33 position: 'absolute',
34 zIndex: 300,
35 height: 50,
36 display: 'flex',
37 flexDirection: 'row',
38 alignItems: 'center',
39 bottom: 10,
40 right: 10,
41 justifyContent: 'center',
42 padding: 10,
43 fontSize: 12,
44 },
45 link: {
46 display: 'inline-flex',
47 opacity: 0.7,
48 },
49 button: {
50 transition: 'opacity 0.25s',
51 color: theme.colorText,
52 border: [1, 'solid', theme.colorText],
53 borderRadius: theme.borderRadiusSmall,
54 padding: 4,
55 fontSize: 12,
56 marginLeft: 15,
57
58 '&:hover': {
59 opacity: 0.8,
60 },
61 },
62 icon: {
63 marginRight: 10,
64 fill: theme.styleTypes.danger.accent,
65 },
66});
67
68@injectSheet(styles) @observer
69class ConnectionLostBanner extends Component {
70 static propTypes = {
71 classes: PropTypes.object.isRequired,
72 name: PropTypes.string.isRequired,
73 reload: PropTypes.func.isRequired,
74 }
75
76 static contextTypes = {
77 intl: intlShape,
78 };
79
80 inputRef = React.createRef();
81
82 render() {
83 const {
84 classes,
85 name,
86 reload,
87 } = this.props;
88
89 const { intl } = this.context;
90
91 return (
92 <div className={classes.root}>
93 <Icon
94 icon={mdiAlert}
95 className={classes.icon}
96 />
97 <p>
98 {intl.formatMessage(messages.text, { name })}
99 <br />
100 <a
101 href={`${LIVE_API_WEBSITE}/support#what-does-franz-lost-the-connection-to-service-mean`}
102 className={classes.link}
103 >
104 {intl.formatMessage(messages.moreInformation)}
105 </a>
106 </p>
107 <button
108 type="button"
109 className={classes.button}
110 onClick={reload}
111 >
112 {intl.formatMessage(messages.cta)}
113 </button>
114 </div>
115 );
116 }
117}
118
119export default ConnectionLostBanner;
diff --git a/src/components/services/content/ServiceView.js b/src/components/services/content/ServiceView.js
index f6832038a..d91016c71 100644
--- a/src/components/services/content/ServiceView.js
+++ b/src/components/services/content/ServiceView.js
@@ -193,7 +193,7 @@ export default @inject('stores', 'actions') @observer class ServiceView extends
193 </Fragment> 193 </Fragment>
194 ) : ( 194 ) : (
195 <> 195 <>
196 {!service.isHibernating ? ( 196 {(!service.isHibernating || service.disableHibernation) ? (
197 <> 197 <>
198 {showNavBar && ( 198 {showNavBar && (
199 <WebControlsScreen service={service} /> 199 <WebControlsScreen service={service} />
@@ -203,6 +203,12 @@ export default @inject('stores', 'actions') @observer class ServiceView extends
203 setWebviewReference={setWebviewReference} 203 setWebviewReference={setWebviewReference}
204 detachService={detachService} 204 detachService={detachService}
205 /> 205 />
206 {/* {service.lostRecipeConnection && (
207 <ConnectionLostBanner
208 name={service.name}
209 reload={reload}
210 />
211 )} */}
206 </> 212 </>
207 ) : ( 213 ) : (
208 <div> 214 <div>
diff --git a/src/components/services/tabs/TabItem.js b/src/components/services/tabs/TabItem.js
index 36338a910..ea7a66a62 100644
--- a/src/components/services/tabs/TabItem.js
+++ b/src/components/services/tabs/TabItem.js
@@ -145,7 +145,7 @@ class TabItem extends Component {
145 145
146 </span> 146 </span>
147 )} 147 )}
148 {service.isHibernating && ( 148 {service.isHibernating && !service.disableHibernation && (
149 <span className="tab-item__message-count hibernating"> 149 <span className="tab-item__message-count hibernating">
150 150
151 </span> 151 </span>
diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js
index bb4f4a76f..4fd1f99ef 100644
--- a/src/components/settings/services/EditServiceForm.js
+++ b/src/components/settings/services/EditServiceForm.js
@@ -94,6 +94,10 @@ const messages = defineMessages({
94 id: 'settings.service.form.isMutedInfo', 94 id: 'settings.service.form.isMutedInfo',
95 defaultMessage: '!!!When disabled, all notification sounds and audio playback are muted', 95 defaultMessage: '!!!When disabled, all notification sounds and audio playback are muted',
96 }, 96 },
97 disableHibernationInfo: {
98 id: 'settings.service.form.disableHibernationInfo',
99 defaultMessage: '!!!You currently have hibernation enabled but you can disable hibernation for individual services using this option.',
100 },
97 headlineNotifications: { 101 headlineNotifications: {
98 id: 'settings.service.form.headlineNotifications', 102 id: 'settings.service.form.headlineNotifications',
99 defaultMessage: '!!!Notifications', 103 defaultMessage: '!!!Notifications',
@@ -154,6 +158,7 @@ export default @observer class EditServiceForm extends Component {
154 isProxyFeatureEnabled: PropTypes.bool.isRequired, 158 isProxyFeatureEnabled: PropTypes.bool.isRequired,
155 isServiceProxyIncludedInCurrentPlan: PropTypes.bool.isRequired, 159 isServiceProxyIncludedInCurrentPlan: PropTypes.bool.isRequired,
156 isSpellcheckerIncludedInCurrentPlan: PropTypes.bool.isRequired, 160 isSpellcheckerIncludedInCurrentPlan: PropTypes.bool.isRequired,
161 isHibernationFeatureActive: PropTypes.bool.isRequired,
157 }; 162 };
158 163
159 static defaultProps = { 164 static defaultProps = {
@@ -219,6 +224,7 @@ export default @observer class EditServiceForm extends Component {
219 isProxyFeatureEnabled, 224 isProxyFeatureEnabled,
220 isServiceProxyIncludedInCurrentPlan, 225 isServiceProxyIncludedInCurrentPlan,
221 isSpellcheckerIncludedInCurrentPlan, 226 isSpellcheckerIncludedInCurrentPlan,
227 isHibernationFeatureActive,
222 } = this.props; 228 } = this.props;
223 const { intl } = this.context; 229 const { intl } = this.context;
224 230
@@ -365,6 +371,14 @@ export default @observer class EditServiceForm extends Component {
365 <div className="settings__settings-group"> 371 <div className="settings__settings-group">
366 <h3>{intl.formatMessage(messages.headlineGeneral)}</h3> 372 <h3>{intl.formatMessage(messages.headlineGeneral)}</h3>
367 <Toggle field={form.$('isEnabled')} /> 373 <Toggle field={form.$('isEnabled')} />
374 {isHibernationFeatureActive && (
375 <>
376 <Toggle field={form.$('disableHibernation')} />
377 <p className="settings__help">
378 {intl.formatMessage(messages.disableHibernationInfo)}
379 </p>
380 </>
381 )}
368 <Toggle field={form.$('isDarkModeEnabled')} /> 382 <Toggle field={form.$('isDarkModeEnabled')} />
369 {form.$('isDarkModeEnabled').value 383 {form.$('isDarkModeEnabled').value
370 && ( 384 && (
diff --git a/src/components/ui/FeatureList.js b/src/components/ui/FeatureList.js
index f1039709c..dbc2a9078 100644
--- a/src/components/ui/FeatureList.js
+++ b/src/components/ui/FeatureList.js
@@ -66,6 +66,10 @@ const messages = defineMessages({
66 id: 'pricing.features.adFree', 66 id: 'pricing.features.adFree',
67 defaultMessage: '!!!Forever ad-free', 67 defaultMessage: '!!!Forever ad-free',
68 }, 68 },
69 appDelayEnabled: {
70 id: 'pricing.features.appDelaysEnabled',
71 defaultMessage: '!!!Occasional Waiting Screens',
72 },
69}); 73});
70 74
71export class FeatureList extends Component { 75export class FeatureList extends Component {
@@ -96,6 +100,7 @@ export class FeatureList extends Component {
96 const features = []; 100 const features = [];
97 if (plan === PLANS.FREE) { 101 if (plan === PLANS.FREE) {
98 features.push( 102 features.push(
103 messages.appDelayEnabled,
99 messages.upToThreeServices, 104 messages.upToThreeServices,
100 messages.availableRecipes, 105 messages.availableRecipes,
101 messages.accountSync, 106 messages.accountSync,