diff options
Diffstat (limited to 'src/components/auth')
-rw-r--r-- | src/components/auth/AuthLayout.js | 4 | ||||
-rw-r--r-- | src/components/auth/Import.js | 4 | ||||
-rw-r--r-- | src/components/auth/Locked.js | 115 | ||||
-rw-r--r-- | src/components/auth/Login.js | 26 | ||||
-rw-r--r-- | src/components/auth/Pricing.js | 2 | ||||
-rw-r--r-- | src/components/auth/Signup.js | 9 | ||||
-rw-r--r-- | src/components/auth/Welcome.js | 15 |
7 files changed, 165 insertions, 10 deletions
diff --git a/src/components/auth/AuthLayout.js b/src/components/auth/AuthLayout.js index 75a8cfc61..0c5198583 100644 --- a/src/components/auth/AuthLayout.js +++ b/src/components/auth/AuthLayout.js | |||
@@ -52,7 +52,7 @@ export default @observer class AuthLayout extends Component { | |||
52 | 52 | ||
53 | return ( | 53 | return ( |
54 | <> | 54 | <> |
55 | {isWindows && !isFullScreen && <TitleBar menu={window.franz.menu.template} icon="assets/images/logo.svg" />} | 55 | {isWindows && !isFullScreen && <TitleBar menu={window.ferdi.menu.template} icon="assets/images/logo.svg" />} |
56 | <div className="auth"> | 56 | <div className="auth"> |
57 | {!isOnline && ( | 57 | {!isOnline && ( |
58 | <InfoBar | 58 | <InfoBar |
@@ -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://adlk.io" 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/auth/Import.js b/src/components/auth/Import.js index 0d5feb274..3e34c3162 100644 --- a/src/components/auth/Import.js +++ b/src/components/auth/Import.js | |||
@@ -12,11 +12,11 @@ import Button from '../ui/Button'; | |||
12 | const messages = defineMessages({ | 12 | const messages = defineMessages({ |
13 | headline: { | 13 | headline: { |
14 | id: 'import.headline', | 14 | id: 'import.headline', |
15 | defaultMessage: '!!!Import your Franz 4 services', | 15 | defaultMessage: '!!!Import your Ferdi 4 services', |
16 | }, | 16 | }, |
17 | notSupportedHeadline: { | 17 | notSupportedHeadline: { |
18 | id: 'import.notSupportedHeadline', | 18 | id: 'import.notSupportedHeadline', |
19 | defaultMessage: '!!!Services not yet supported in Franz 5', | 19 | defaultMessage: '!!!Services not yet supported in Ferdi 5', |
20 | }, | 20 | }, |
21 | submitButtonLabel: { | 21 | submitButtonLabel: { |
22 | id: 'import.submit.label', | 22 | id: 'import.submit.label', |
diff --git a/src/components/auth/Locked.js b/src/components/auth/Locked.js new file mode 100644 index 000000000..045621d0a --- /dev/null +++ b/src/components/auth/Locked.js | |||
@@ -0,0 +1,115 @@ | |||
1 | import React, { Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { observer } from 'mobx-react'; | ||
4 | import { defineMessages, intlShape } from 'react-intl'; | ||
5 | |||
6 | import Form from '../../lib/Form'; | ||
7 | import { required } from '../../helpers/validation-helpers'; | ||
8 | import Input from '../ui/Input'; | ||
9 | import Button from '../ui/Button'; | ||
10 | import Infobox from '../ui/Infobox'; | ||
11 | |||
12 | import { globalError as globalErrorPropType } from '../../prop-types'; | ||
13 | |||
14 | const messages = defineMessages({ | ||
15 | headline: { | ||
16 | id: 'locked.headline', | ||
17 | defaultMessage: '!!!Locked', | ||
18 | }, | ||
19 | info: { | ||
20 | id: 'locked.info', | ||
21 | defaultMessage: '!!!Ferdi is currently locked. Please unlock Ferdi with your password to see your messages.', | ||
22 | }, | ||
23 | passwordLabel: { | ||
24 | id: 'locked.password.label', | ||
25 | defaultMessage: '!!!Password', | ||
26 | }, | ||
27 | submitButtonLabel: { | ||
28 | id: 'locked.submit.label', | ||
29 | defaultMessage: '!!!Unlock', | ||
30 | }, | ||
31 | invalidCredentials: { | ||
32 | id: 'locked.invalidCredentials', | ||
33 | defaultMessage: '!!!Password invalid', | ||
34 | }, | ||
35 | }); | ||
36 | |||
37 | export default @observer class Locked extends Component { | ||
38 | static propTypes = { | ||
39 | onSubmit: PropTypes.func.isRequired, | ||
40 | isSubmitting: PropTypes.bool.isRequired, | ||
41 | error: globalErrorPropType.isRequired, | ||
42 | }; | ||
43 | |||
44 | static contextTypes = { | ||
45 | intl: intlShape, | ||
46 | }; | ||
47 | |||
48 | form = new Form({ | ||
49 | fields: { | ||
50 | password: { | ||
51 | label: this.context.intl.formatMessage(messages.passwordLabel), | ||
52 | value: '', | ||
53 | validators: [required], | ||
54 | type: 'password', | ||
55 | }, | ||
56 | }, | ||
57 | }, this.context.intl); | ||
58 | |||
59 | submit(e) { | ||
60 | e.preventDefault(); | ||
61 | this.form.submit({ | ||
62 | onSuccess: (form) => { | ||
63 | this.props.onSubmit(form.values()); | ||
64 | }, | ||
65 | onError: () => { }, | ||
66 | }); | ||
67 | } | ||
68 | |||
69 | render() { | ||
70 | const { form } = this; | ||
71 | const { intl } = this.context; | ||
72 | const { | ||
73 | isSubmitting, | ||
74 | error, | ||
75 | } = this.props; | ||
76 | |||
77 | return ( | ||
78 | <div className="auth__container"> | ||
79 | <form className="franz-form auth__form" onSubmit={e => this.submit(e)}> | ||
80 | <img | ||
81 | src="./assets/images/logo.svg" | ||
82 | className="auth__logo" | ||
83 | alt="" | ||
84 | /> | ||
85 | <h1>{intl.formatMessage(messages.headline)}</h1> | ||
86 | <Infobox type="warning"> | ||
87 | {intl.formatMessage(messages.info)} | ||
88 | </Infobox> | ||
89 | <Input | ||
90 | field={form.$('password')} | ||
91 | showPasswordToggle | ||
92 | /> | ||
93 | {error.code === 'invalid-credentials' && ( | ||
94 | <p className="error-message center">{intl.formatMessage(messages.invalidCredentials)}</p> | ||
95 | )} | ||
96 | {isSubmitting ? ( | ||
97 | <Button | ||
98 | className="auth__button is-loading" | ||
99 | buttonType="secondary" | ||
100 | label={`${intl.formatMessage(messages.submitButtonLabel)} ...`} | ||
101 | loaded={false} | ||
102 | disabled | ||
103 | /> | ||
104 | ) : ( | ||
105 | <Button | ||
106 | type="submit" | ||
107 | className="auth__button" | ||
108 | label={intl.formatMessage(messages.submitButtonLabel)} | ||
109 | /> | ||
110 | )} | ||
111 | </form> | ||
112 | </div> | ||
113 | ); | ||
114 | } | ||
115 | } | ||
diff --git a/src/components/auth/Login.js b/src/components/auth/Login.js index 5d21f8b60..eea5a09bf 100644 --- a/src/components/auth/Login.js +++ b/src/components/auth/Login.js | |||
@@ -34,6 +34,14 @@ const messages = defineMessages({ | |||
34 | id: 'login.invalidCredentials', | 34 | id: 'login.invalidCredentials', |
35 | defaultMessage: '!!!Email or password not valid', | 35 | defaultMessage: '!!!Email or password not valid', |
36 | }, | 36 | }, |
37 | customServerQuestion: { | ||
38 | id: 'login.customServerQuestion', | ||
39 | defaultMessage: '!!!Using a Franz account to log in?', | ||
40 | }, | ||
41 | customServerSuggestion: { | ||
42 | id: 'login.customServerSuggestion', | ||
43 | defaultMessage: '!!!Try importing your Franz account into Ferdi', | ||
44 | }, | ||
37 | tokenExpired: { | 45 | tokenExpired: { |
38 | id: 'login.tokenExpired', | 46 | id: 'login.tokenExpired', |
39 | defaultMessage: '!!!Your session expired, please login again.', | 47 | defaultMessage: '!!!Your session expired, please login again.', |
@@ -137,7 +145,22 @@ export default @observer class Login extends Component { | |||
137 | showPasswordToggle | 145 | showPasswordToggle |
138 | /> | 146 | /> |
139 | {error.code === 'invalid-credentials' && ( | 147 | {error.code === 'invalid-credentials' && ( |
140 | <p className="error-message center">{intl.formatMessage(messages.invalidCredentials)}</p> | 148 | <> |
149 | <p className="error-message center">{intl.formatMessage(messages.invalidCredentials)}</p> | ||
150 | { window.ferdi.stores.settings.all.app.server !== 'https://api.franzinfra.com' && ( | ||
151 | <p className="error-message center"> | ||
152 | {intl.formatMessage(messages.customServerQuestion)} | ||
153 | {' '} | ||
154 | <Link | ||
155 | to={`${window.ferdi.stores.settings.all.app.server.replace('v1', '')}/import`} | ||
156 | target="_blank" | ||
157 | style={{ cursor: 'pointer', textDecoration: 'underline' }} | ||
158 | > | ||
159 | {intl.formatMessage(messages.customServerSuggestion)} | ||
160 | </Link> | ||
161 | </p> | ||
162 | )} | ||
163 | </> | ||
141 | )} | 164 | )} |
142 | {isSubmitting ? ( | 165 | {isSubmitting ? ( |
143 | <Button | 166 | <Button |
@@ -156,6 +179,7 @@ export default @observer class Login extends Component { | |||
156 | )} | 179 | )} |
157 | </form> | 180 | </form> |
158 | <div className="auth__links"> | 181 | <div className="auth__links"> |
182 | <Link to="/settings/app">Change server</Link> | ||
159 | <Link to={signupRoute}>{intl.formatMessage(messages.signupLink)}</Link> | 183 | <Link to={signupRoute}>{intl.formatMessage(messages.signupLink)}</Link> |
160 | <Link to={passwordRoute}>{intl.formatMessage(messages.passwordLink)}</Link> | 184 | <Link to={passwordRoute}>{intl.formatMessage(messages.passwordLink)}</Link> |
161 | </div> | 185 | </div> |
diff --git a/src/components/auth/Pricing.js b/src/components/auth/Pricing.js index cbeaaa5d9..a77ad7742 100644 --- a/src/components/auth/Pricing.js +++ b/src/components/auth/Pricing.js | |||
@@ -42,7 +42,7 @@ const messages = defineMessages({ | |||
42 | }, | 42 | }, |
43 | ctaSkip: { | 43 | ctaSkip: { |
44 | id: 'pricing.trial.cta.skip', | 44 | id: 'pricing.trial.cta.skip', |
45 | defaultMessage: '!!!Continue to Franz', | 45 | defaultMessage: '!!!Continue to Ferdi', |
46 | }, | 46 | }, |
47 | featuresHeadline: { | 47 | featuresHeadline: { |
48 | id: 'pricing.trial.features.headline', | 48 | id: 'pricing.trial.features.headline', |
diff --git a/src/components/auth/Signup.js b/src/components/auth/Signup.js index 0499d764b..b36e71ce1 100644 --- a/src/components/auth/Signup.js +++ b/src/components/auth/Signup.js | |||
@@ -40,7 +40,7 @@ const messages = defineMessages({ | |||
40 | }, | 40 | }, |
41 | legalInfo: { | 41 | legalInfo: { |
42 | id: 'signup.legal.info', | 42 | id: 'signup.legal.info', |
43 | defaultMessage: '!!!By creating a Franz account you accept the', | 43 | defaultMessage: '!!!By creating a Ferdi account you accept the', |
44 | }, | 44 | }, |
45 | terms: { | 45 | terms: { |
46 | id: 'signup.legal.terms', | 46 | id: 'signup.legal.terms', |
@@ -117,6 +117,8 @@ export default @observer class Signup extends Component { | |||
117 | const { intl } = this.context; | 117 | const { intl } = this.context; |
118 | const { isSubmitting, loginRoute, error } = this.props; | 118 | const { isSubmitting, loginRoute, error } = this.props; |
119 | 119 | ||
120 | const termsBase = window.ferdi.stores.settings.all.app.server !== 'https://api.franzinfra.com' ? window.ferdi.stores.settings.all.app.server : 'https://meetfranz.com'; | ||
121 | |||
120 | return ( | 122 | return ( |
121 | <div className="auth__scroll-container"> | 123 | <div className="auth__scroll-container"> |
122 | <div className="auth__container auth__container--signup"> | 124 | <div className="auth__container auth__container--signup"> |
@@ -163,7 +165,7 @@ export default @observer class Signup extends Component { | |||
163 | {intl.formatMessage(messages.legalInfo)} | 165 | {intl.formatMessage(messages.legalInfo)} |
164 | <br /> | 166 | <br /> |
165 | <Link | 167 | <Link |
166 | to="https://meetfranz.com/terms" | 168 | to={`${termsBase}/terms`} |
167 | target="_blank" | 169 | target="_blank" |
168 | className="link" | 170 | className="link" |
169 | > | 171 | > |
@@ -171,7 +173,7 @@ export default @observer class Signup extends Component { | |||
171 | </Link> | 173 | </Link> |
172 | & | 174 | & |
173 | <Link | 175 | <Link |
174 | to="https://meetfranz.com/privacy" | 176 | to={`${termsBase}/privacy`} |
175 | target="_blank" | 177 | target="_blank" |
176 | className="link" | 178 | className="link" |
177 | > | 179 | > |
@@ -181,6 +183,7 @@ export default @observer class Signup extends Component { | |||
181 | </p> | 183 | </p> |
182 | </form> | 184 | </form> |
183 | <div className="auth__links"> | 185 | <div className="auth__links"> |
186 | <Link to="/settings/app">Change server</Link> | ||
184 | <Link to={loginRoute}>{intl.formatMessage(messages.loginLink)}</Link> | 187 | <Link to={loginRoute}>{intl.formatMessage(messages.loginLink)}</Link> |
185 | </div> | 188 | </div> |
186 | </div> | 189 | </div> |
diff --git a/src/components/auth/Welcome.js b/src/components/auth/Welcome.js index f6d77f70f..ef917e336 100644 --- a/src/components/auth/Welcome.js +++ b/src/components/auth/Welcome.js | |||
@@ -41,7 +41,7 @@ export default @observer class Login extends Component { | |||
41 | <img src="./assets/images/logo.svg" className="welcome__logo" alt="" /> | 41 | <img src="./assets/images/logo.svg" className="welcome__logo" alt="" /> |
42 | {/* <img src="./assets/images/welcome.png" className="welcome__services" alt="" /> */} | 42 | {/* <img src="./assets/images/welcome.png" className="welcome__services" alt="" /> */} |
43 | <div className="welcome__text"> | 43 | <div className="welcome__text"> |
44 | <h1>Franz</h1> | 44 | <h1>Ferdi</h1> |
45 | </div> | 45 | </div> |
46 | </div> | 46 | </div> |
47 | <div className="welcome__buttons"> | 47 | <div className="welcome__buttons"> |
@@ -51,6 +51,19 @@ export default @observer class Login extends Component { | |||
51 | <Link to={loginRoute} className="button"> | 51 | <Link to={loginRoute} className="button"> |
52 | {intl.formatMessage(messages.loginButton)} | 52 | {intl.formatMessage(messages.loginButton)} |
53 | </Link> | 53 | </Link> |
54 | <br /> | ||
55 | <br /> | ||
56 | |||
57 | <Link to="settings/app"> | ||
58 | <span style={{ | ||
59 | textAlign: 'center', | ||
60 | width: '100%', | ||
61 | cursor: 'pointer', | ||
62 | }} | ||
63 | > | ||
64 | Change server | ||
65 | </span> | ||
66 | </Link> | ||
54 | </div> | 67 | </div> |
55 | <div className="welcome__featured-services"> | 68 | <div className="welcome__featured-services"> |
56 | {recipes.map(recipe => ( | 69 | {recipes.map(recipe => ( |