aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/settings
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/settings')
-rw-r--r--src/components/settings/SettingsLayout.js23
-rw-r--r--src/components/settings/account/AccountDashboard.js48
-rw-r--r--src/components/settings/navigation/SettingsNavigation.js5
-rw-r--r--src/components/settings/recipes/RecipeItem.js1
-rw-r--r--src/components/settings/recipes/RecipesDashboard.js10
-rw-r--r--src/components/settings/services/EditServiceForm.js53
-rw-r--r--src/components/settings/services/ServiceItem.js1
-rw-r--r--src/components/settings/services/ServicesDashboard.js20
-rw-r--r--src/components/settings/settings/EditSettingsForm.js14
-rw-r--r--src/components/settings/user/EditUserForm.js4
10 files changed, 101 insertions, 78 deletions
diff --git a/src/components/settings/SettingsLayout.js b/src/components/settings/SettingsLayout.js
index 3cb08feb1..72ba7b2e3 100644
--- a/src/components/settings/SettingsLayout.js
+++ b/src/components/settings/SettingsLayout.js
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
2import PropTypes from 'prop-types'; 2import PropTypes from 'prop-types';
3import { observer } from 'mobx-react'; 3import { observer } from 'mobx-react';
4 4
5import ErrorBoundary from '../util/ErrorBoundary';
5import { oneOrManyChildElements } from '../../prop-types'; 6import { oneOrManyChildElements } from '../../prop-types';
6import Appear from '../ui/effects/Appear'; 7import Appear from '../ui/effects/Appear';
7 8
@@ -36,18 +37,22 @@ export default @observer class SettingsLayout extends Component {
36 return ( 37 return (
37 <Appear transitionName="fadeIn-fast"> 38 <Appear transitionName="fadeIn-fast">
38 <div className="settings-wrapper"> 39 <div className="settings-wrapper">
39 <button 40 <ErrorBoundary>
40 className="settings-wrapper__action"
41 onClick={closeSettings}
42 />
43 <div className="settings franz-form">
44 {navigation}
45 {children}
46 <button 41 <button
47 className="settings__close mdi mdi-close" 42 type="button"
43 className="settings-wrapper__action"
48 onClick={closeSettings} 44 onClick={closeSettings}
49 /> 45 />
50 </div> 46 <div className="settings franz-form">
47 {navigation}
48 {children}
49 <button
50 type="button"
51 className="settings__close mdi mdi-close"
52 onClick={closeSettings}
53 />
54 </div>
55 </ErrorBoundary>
51 </div> 56 </div>
52 </Appear> 57 </Appear>
53 ); 58 );
diff --git a/src/components/settings/account/AccountDashboard.js b/src/components/settings/account/AccountDashboard.js
index 06c7074dd..9c9543749 100644
--- a/src/components/settings/account/AccountDashboard.js
+++ b/src/components/settings/account/AccountDashboard.js
@@ -1,4 +1,4 @@
1import React, { Component } from 'react'; 1import React, { Component, Fragment } from 'react';
2import PropTypes from 'prop-types'; 2import PropTypes from 'prop-types';
3import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; 3import { observer, PropTypes as MobxPropTypes } from 'mobx-react';
4import { defineMessages, intlShape } from 'react-intl'; 4import { defineMessages, intlShape } from 'react-intl';
@@ -132,21 +132,19 @@ export default @observer class AccountDashboard extends Component {
132 )} 132 )}
133 133
134 {!isLoading && userInfoRequestFailed && ( 134 {!isLoading && userInfoRequestFailed && (
135 <div> 135 <Infobox
136 <Infobox 136 icon="alert"
137 icon="alert" 137 type="danger"
138 type="danger" 138 ctaLabel={intl.formatMessage(messages.tryReloadUserInfoRequest)}
139 ctaLabel={intl.formatMessage(messages.tryReloadUserInfoRequest)} 139 ctaLoading={isLoading}
140 ctaLoading={isLoading} 140 ctaOnClick={retryUserInfoRequest}
141 ctaOnClick={retryUserInfoRequest} 141 >
142 > 142 {intl.formatMessage(messages.userInfoRequestFailed)}
143 {intl.formatMessage(messages.userInfoRequestFailed)} 143 </Infobox>
144 </Infobox>
145 </div>
146 )} 144 )}
147 145
148 {!userInfoRequestFailed && ( 146 {!userInfoRequestFailed && (
149 <div> 147 <Fragment>
150 {!isLoading && ( 148 {!isLoading && (
151 <div className="account"> 149 <div className="account">
152 <div className="account__box account__box--flex"> 150 <div className="account__box account__box--flex">
@@ -169,7 +167,8 @@ export default @observer class AccountDashboard extends Component {
169 {`${user.firstname} ${user.lastname}`} 167 {`${user.firstname} ${user.lastname}`}
170 </h2> 168 </h2>
171 {user.organization && `${user.organization}, `} 169 {user.organization && `${user.organization}, `}
172 {user.email}<br /> 170 {user.email}
171 <br />
173 {!user.isEnterprise && !user.isPremium && ( 172 {!user.isEnterprise && !user.isPremium && (
174 <span className="badge badge">{intl.formatMessage(messages.accountTypeBasic)}</span> 173 <span className="badge badge">{intl.formatMessage(messages.accountTypeBasic)}</span>
175 )} 174 )}
@@ -194,7 +193,7 @@ export default @observer class AccountDashboard extends Component {
194 ) : ( 193 ) : (
195 <div className="account franz-form"> 194 <div className="account franz-form">
196 {orders.length > 0 && ( 195 {orders.length > 0 && (
197 <div> 196 <Fragment>
198 <div className="account__box"> 197 <div className="account__box">
199 <h2>{intl.formatMessage(messages.headlineSubscription)}</h2> 198 <h2>{intl.formatMessage(messages.headlineSubscription)}</h2>
200 <div className="account__subscription"> 199 <div className="account__subscription">
@@ -219,6 +218,7 @@ export default @observer class AccountDashboard extends Component {
219 </td> 218 </td>
220 <td className="invoices__action"> 219 <td className="invoices__action">
221 <button 220 <button
221 type="button"
222 onClick={() => openExternalUrl(order.invoiceUrl)} 222 onClick={() => openExternalUrl(order.invoiceUrl)}
223 > 223 >
224 {intl.formatMessage(messages.invoiceDownload)} 224 {intl.formatMessage(messages.invoiceDownload)}
@@ -229,7 +229,7 @@ export default @observer class AccountDashboard extends Component {
229 </tbody> 229 </tbody>
230 </table> 230 </table>
231 </div> 231 </div>
232 </div> 232 </Fragment>
233 )} 233 )}
234 </div> 234 </div>
235 ) 235 )
@@ -262,20 +262,6 @@ export default @observer class AccountDashboard extends Component {
262 </div> 262 </div>
263 )} 263 )}
264 264
265 {user.isMiner && (
266 <div className="account franz-form">
267 <div className="account__box account__box">
268 <h2>Miner Info</h2>
269 <div className="account__subscription">
270 <div>
271 <p>To maintain a high security level for all our Franz users, we had to remove the miner. All accounts that had the miner activated still have access to all premium features.</p>
272 <p>Every financial support is still much appreciated.</p>
273 </div>
274 </div>
275 </div>
276 </div>
277 )}
278
279 {!user.isEnterprise && !user.isPremium && ( 265 {!user.isEnterprise && !user.isPremium && (
280 isLoadingPlans ? ( 266 isLoadingPlans ? (
281 <Loader /> 267 <Loader />
@@ -312,7 +298,7 @@ export default @observer class AccountDashboard extends Component {
312 </div> 298 </div>
313 </div> 299 </div>
314 )} 300 )}
315 </div> 301 </Fragment>
316 )} 302 )}
317 </div> 303 </div>
318 <ReactTooltip place="right" type="dark" effect="solid" /> 304 <ReactTooltip place="right" type="dark" effect="solid" />
diff --git a/src/components/settings/navigation/SettingsNavigation.js b/src/components/settings/navigation/SettingsNavigation.js
index b86d94ac7..953f702f8 100644
--- a/src/components/settings/navigation/SettingsNavigation.js
+++ b/src/components/settings/navigation/SettingsNavigation.js
@@ -59,7 +59,9 @@ export default @inject('stores') @observer class SettingsNavigation extends Comp
59 className="settings-navigation__link" 59 className="settings-navigation__link"
60 activeClassName="is-active" 60 activeClassName="is-active"
61 > 61 >
62 {intl.formatMessage(messages.yourServices)} <span className="badge">{serviceCount}</span> 62 {intl.formatMessage(messages.yourServices)}
63 {' '}
64 <span className="badge">{serviceCount}</span>
63 </Link> 65 </Link>
64 <Link 66 <Link
65 to="/settings/user" 67 to="/settings/user"
@@ -93,4 +95,3 @@ export default @inject('stores') @observer class SettingsNavigation extends Comp
93 ); 95 );
94 } 96 }
95} 97}
96
diff --git a/src/components/settings/recipes/RecipeItem.js b/src/components/settings/recipes/RecipeItem.js
index dae8891b3..3bb0852b2 100644
--- a/src/components/settings/recipes/RecipeItem.js
+++ b/src/components/settings/recipes/RecipeItem.js
@@ -15,6 +15,7 @@ export default @observer class RecipeItem extends Component {
15 15
16 return ( 16 return (
17 <button 17 <button
18 type="button"
18 className="recipe-teaser" 19 className="recipe-teaser"
19 onClick={onClick} 20 onClick={onClick}
20 > 21 >
diff --git a/src/components/settings/recipes/RecipesDashboard.js b/src/components/settings/recipes/RecipesDashboard.js
index cd783200f..00cd725cf 100644
--- a/src/components/settings/recipes/RecipesDashboard.js
+++ b/src/components/settings/recipes/RecipesDashboard.js
@@ -129,11 +129,17 @@ export default @observer class RecipesDashboard extends Component {
129 activeClassName={`${!searchNeedle ? 'badge--primary' : ''}`} 129 activeClassName={`${!searchNeedle ? 'badge--primary' : ''}`}
130 onClick={() => resetSearch()} 130 onClick={() => resetSearch()}
131 > 131 >
132 {intl.formatMessage(messages.devRecipes)} ({devRecipesCount}) 132 {intl.formatMessage(messages.devRecipes)}
133 {' '}
134(
135 {devRecipesCount}
136)
133 </Link> 137 </Link>
134 )} 138 )}
135 <a href={FRANZ_SERVICE_REQUEST} target="_blank" className="link recipes__service-request"> 139 <a href={FRANZ_SERVICE_REQUEST} target="_blank" className="link recipes__service-request">
136 {intl.formatMessage(messages.missingService)} <i className="mdi mdi-open-in-new" /> 140 {intl.formatMessage(messages.missingService)}
141 {' '}
142 <i className="mdi mdi-open-in-new" />
137 </a> 143 </a>
138 </div> 144 </div>
139 {/* )} */} 145 {/* )} */}
diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js
index d16ec35b8..468d85c45 100644
--- a/src/components/settings/services/EditServiceForm.js
+++ b/src/components/settings/services/EditServiceForm.js
@@ -1,4 +1,4 @@
1import React, { Component } from 'react'; 1import React, { Component, Fragment } from 'react';
2import PropTypes from 'prop-types'; 2import PropTypes from 'prop-types';
3import { observer } from 'mobx-react'; 3import { observer } from 'mobx-react';
4import { Link } from 'react-router'; 4import { Link } from 'react-router';
@@ -14,6 +14,7 @@ import Input from '../../ui/Input';
14import Toggle from '../../ui/Toggle'; 14import Toggle from '../../ui/Toggle';
15import Button from '../../ui/Button'; 15import Button from '../../ui/Button';
16import ImageUpload from '../../ui/ImageUpload'; 16import ImageUpload from '../../ui/ImageUpload';
17import Select from '../../ui/Select';
17 18
18import PremiumFeatureContainer from '../../ui/PremiumFeatureContainer'; 19import PremiumFeatureContainer from '../../ui/PremiumFeatureContainer';
19 20
@@ -96,7 +97,11 @@ const messages = defineMessages({
96 }, 97 },
97 headlineProxy: { 98 headlineProxy: {
98 id: 'settings.service.form.proxy.headline', 99 id: 'settings.service.form.proxy.headline',
99 defaultMessage: '!!!Proxy Settings', 100 defaultMessage: '!!!HTTP/HTTPS Proxy Settings',
101 },
102 proxyRestartInfo: {
103 id: 'settings.service.form.proxy.restartInfo',
104 defaultMessage: '!!!Please restart Franz after changing proxy Settings.',
100 }, 105 },
101 proxyInfo: { 106 proxyInfo: {
102 id: 'settings.service.form.proxy.info', 107 id: 'settings.service.form.proxy.info',
@@ -129,6 +134,7 @@ export default @observer class EditServiceForm extends Component {
129 static defaultProps = { 134 static defaultProps = {
130 service: {}, 135 service: {},
131 }; 136 };
137
132 static contextTypes = { 138 static contextTypes = {
133 intl: intlShape, 139 intl: intlShape,
134 }; 140 };
@@ -270,14 +276,14 @@ export default @observer class EditServiceForm extends Component {
270 {recipe.hasCustomUrl && ( 276 {recipe.hasCustomUrl && (
271 <TabItem title={intl.formatMessage(messages.tabOnPremise)}> 277 <TabItem title={intl.formatMessage(messages.tabOnPremise)}>
272 {user.isPremium || recipe.author.find(a => a.email === user.email) ? ( 278 {user.isPremium || recipe.author.find(a => a.email === user.email) ? (
273 <div> 279 <Fragment>
274 <Input field={form.$('customUrl')} /> 280 <Input field={form.$('customUrl')} />
275 {form.error === 'url-validation-error' && ( 281 {form.error === 'url-validation-error' && (
276 <p className="franz-form__error"> 282 <p className="franz-form__error">
277 {intl.formatMessage(messages.customUrlValidationError, { name: recipe.name })} 283 {intl.formatMessage(messages.customUrlValidationError, { name: recipe.name })}
278 </p> 284 </p>
279 )} 285 )}
280 </div> 286 </Fragment>
281 ) : ( 287 ) : (
282 <div className="center premium-info"> 288 <div className="center premium-info">
283 <p>{intl.formatMessage(messages.customUrlPremiumInfo)}</p> 289 <p>{intl.formatMessage(messages.customUrlPremiumInfo)}</p>
@@ -307,12 +313,12 @@ export default @observer class EditServiceForm extends Component {
307 <h3>{intl.formatMessage(messages.headlineBadges)}</h3> 313 <h3>{intl.formatMessage(messages.headlineBadges)}</h3>
308 <Toggle field={form.$('isBadgeEnabled')} /> 314 <Toggle field={form.$('isBadgeEnabled')} />
309 {recipe.hasIndirectMessages && form.$('isBadgeEnabled').value && ( 315 {recipe.hasIndirectMessages && form.$('isBadgeEnabled').value && (
310 <div> 316 <Fragment>
311 <Toggle field={form.$('isIndirectMessageBadgeEnabled')} /> 317 <Toggle field={form.$('isIndirectMessageBadgeEnabled')} />
312 <p className="settings__help"> 318 <p className="settings__help">
313 {intl.formatMessage(messages.indirectMessageInfo)} 319 {intl.formatMessage(messages.indirectMessageInfo)}
314 </p> 320 </p>
315 </div> 321 </Fragment>
316 )} 322 )}
317 </div> 323 </div>
318 324
@@ -333,6 +339,12 @@ export default @observer class EditServiceForm extends Component {
333 </div> 339 </div>
334 </div> 340 </div>
335 341
342 <PremiumFeatureContainer>
343 <div className="settings__settings-group">
344 <Select field={form.$('spellcheckerLanguage')} />
345 </div>
346 </PremiumFeatureContainer>
347
336 {isProxyFeatureEnabled && ( 348 {isProxyFeatureEnabled && (
337 <PremiumFeatureContainer condition={isProxyFeaturePremiumFeature}> 349 <PremiumFeatureContainer condition={isProxyFeaturePremiumFeature}>
338 <div className="settings__settings-group"> 350 <div className="settings__settings-group">
@@ -342,18 +354,31 @@ export default @observer class EditServiceForm extends Component {
342 </h3> 354 </h3>
343 <Toggle field={form.$('proxy.isEnabled')} /> 355 <Toggle field={form.$('proxy.isEnabled')} />
344 {form.$('proxy.isEnabled').value && ( 356 {form.$('proxy.isEnabled').value && (
345 <div> 357 <Fragment>
346 <Input field={form.$('proxy.host')} /> 358 <div className="grid">
347 <Input field={form.$('proxy.user')} /> 359 <div className="grid__row">
348 <Input 360 <Input field={form.$('proxy.host')} className="proxyHost" />
349 field={form.$('proxy.password')} 361 <Input field={form.$('proxy.port')} />
350 showPasswordToggle 362 </div>
351 /> 363 </div>
364 <div className="grid">
365 <div className="grid__row">
366 <Input field={form.$('proxy.user')} />
367 <Input
368 field={form.$('proxy.password')}
369 showPasswordToggle
370 />
371 </div>
372 </div>
373 <p>
374 <span className="mdi mdi-information" />
375 {intl.formatMessage(messages.proxyRestartInfo)}
376 </p>
352 <p> 377 <p>
353 <span className="mdi mdi-information" /> 378 <span className="mdi mdi-information" />
354 {intl.formatMessage(messages.proxyInfo)} 379 {intl.formatMessage(messages.proxyInfo)}
355 </p> 380 </p>
356 </div> 381 </Fragment>
357 )} 382 )}
358 </div> 383 </div>
359 </PremiumFeatureContainer> 384 </PremiumFeatureContainer>
diff --git a/src/components/settings/services/ServiceItem.js b/src/components/settings/services/ServiceItem.js
index 84080519b..ebc618a00 100644
--- a/src/components/settings/services/ServiceItem.js
+++ b/src/components/settings/services/ServiceItem.js
@@ -27,6 +27,7 @@ export default @observer class ServiceItem extends Component {
27 service: PropTypes.instanceOf(ServiceModel).isRequired, 27 service: PropTypes.instanceOf(ServiceModel).isRequired,
28 goToServiceForm: PropTypes.func.isRequired, 28 goToServiceForm: PropTypes.func.isRequired,
29 }; 29 };
30
30 static contextTypes = { 31 static contextTypes = {
31 intl: intlShape, 32 intl: intlShape,
32 }; 33 };
diff --git a/src/components/settings/services/ServicesDashboard.js b/src/components/settings/services/ServicesDashboard.js
index e7dfaf106..a12df7372 100644
--- a/src/components/settings/services/ServicesDashboard.js
+++ b/src/components/settings/services/ServicesDashboard.js
@@ -101,17 +101,15 @@ export default @observer class ServicesDashboard extends Component {
101 /> 101 />
102 )} 102 )}
103 {!isLoading && servicesRequestFailed && ( 103 {!isLoading && servicesRequestFailed && (
104 <div> 104 <Infobox
105 <Infobox 105 icon="alert"
106 icon="alert" 106 type="danger"
107 type="danger" 107 ctaLabel={intl.formatMessage(messages.tryReloadServices)}
108 ctaLabel={intl.formatMessage(messages.tryReloadServices)} 108 ctaLoading={isLoading}
109 ctaLoading={isLoading} 109 ctaOnClick={retryServicesRequest}
110 ctaOnClick={retryServicesRequest} 110 >
111 > 111 {intl.formatMessage(messages.servicesRequestFailed)}
112 {intl.formatMessage(messages.servicesRequestFailed)} 112 </Infobox>
113 </Infobox>
114 </div>
115 )} 113 )}
116 114
117 {status.length > 0 && status.includes('updated') && ( 115 {status.length > 0 && status.includes('updated') && (
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js
index 1ec2ab614..a92e559f3 100644
--- a/src/components/settings/settings/EditSettingsForm.js
+++ b/src/components/settings/settings/EditSettingsForm.js
@@ -1,5 +1,5 @@
1import { remote } from 'electron'; 1import { remote } from 'electron';
2import React, { Component } from 'react'; 2import React, { Component, Fragment } from 'react';
3import PropTypes from 'prop-types'; 3import PropTypes from 'prop-types';
4import { observer } from 'mobx-react'; 4import { observer } from 'mobx-react';
5import { defineMessages, intlShape } from 'react-intl'; 5import { defineMessages, intlShape } from 'react-intl';
@@ -171,21 +171,23 @@ export default @observer class EditSettingsForm extends Component {
171 <PremiumFeatureContainer 171 <PremiumFeatureContainer
172 condition={isSpellcheckerPremiumFeature} 172 condition={isSpellcheckerPremiumFeature}
173 > 173 >
174 <div> 174 <Fragment>
175 <Toggle 175 <Toggle
176 field={form.$('enableSpellchecking')} 176 field={form.$('enableSpellchecking')}
177 /> 177 />
178 {form.$('enableSpellchecking').value && ( 178 {form.$('enableSpellchecking').value && (
179 <Select field={form.$('spellcheckerLanguage')} /> 179 <Select field={form.$('spellcheckerLanguage')} />
180 )} 180 )}
181 </div> 181 </Fragment>
182 </PremiumFeatureContainer> 182 </PremiumFeatureContainer>
183 <a 183 <a
184 href={FRANZ_TRANSLATION} 184 href={FRANZ_TRANSLATION}
185 target="_blank" 185 target="_blank"
186 className="link" 186 className="link"
187 > 187 >
188 {intl.formatMessage(messages.translationHelp)} <i className="mdi mdi-open-in-new" /> 188 {intl.formatMessage(messages.translationHelp)}
189 {' '}
190 <i className="mdi mdi-open-in-new" />
189 </a> 191 </a>
190 192
191 {/* Advanced */} 193 {/* Advanced */}
@@ -233,7 +235,9 @@ export default @observer class EditSettingsForm extends Component {
233 )} 235 )}
234 <br /> 236 <br />
235 <Toggle field={form.$('beta')} /> 237 <Toggle field={form.$('beta')} />
236 {intl.formatMessage(messages.currentVersion)} {remote.app.getVersion()} 238 {intl.formatMessage(messages.currentVersion)}
239 {' '}
240 {remote.app.getVersion()}
237 </form> 241 </form>
238 </div> 242 </div>
239 </div> 243 </div>
diff --git a/src/components/settings/user/EditUserForm.js b/src/components/settings/user/EditUserForm.js
index b825f844a..0e3ac6b10 100644
--- a/src/components/settings/user/EditUserForm.js
+++ b/src/components/settings/user/EditUserForm.js
@@ -48,10 +48,6 @@ export default @observer class EditServiceForm extends Component {
48 isEnterprise: PropTypes.bool.isRequired, 48 isEnterprise: PropTypes.bool.isRequired,
49 }; 49 };
50 50
51 static defaultProps = {
52 service: {},
53 };
54
55 static contextTypes = { 51 static contextTypes = {
56 intl: intlShape, 52 intl: intlShape,
57 }; 53 };