diff options
-rw-r--r-- | src/components/auth/Invite.js | 8 | ||||
-rw-r--r-- | src/components/settings/account/AccountDashboard.js | 29 | ||||
-rw-r--r-- | src/components/ui/Link.js | 5 | ||||
-rw-r--r-- | src/containers/auth/InviteScreen.js | 7 | ||||
-rw-r--r-- | src/containers/settings/AccountScreen.js | 1 | ||||
-rw-r--r-- | src/i18n/locales/de.json | 1 | ||||
-rw-r--r-- | src/i18n/locales/en-US.json | 1 | ||||
-rw-r--r-- | src/i18n/locales/es.json | 1 | ||||
-rw-r--r-- | src/i18n/locales/fr.json | 1 | ||||
-rw-r--r-- | src/i18n/locales/it.json | 1 | ||||
-rw-r--r-- | src/models/User.js | 2 | ||||
-rw-r--r-- | src/stores/UserStore.js | 8 | ||||
-rw-r--r-- | src/styles/settings.scss | 9 |
13 files changed, 63 insertions, 11 deletions
diff --git a/src/components/auth/Invite.js b/src/components/auth/Invite.js index c4c35d538..1fe594d73 100644 --- a/src/components/auth/Invite.js +++ b/src/components/auth/Invite.js | |||
@@ -69,6 +69,11 @@ export default class Invite extends Component { | |||
69 | this.form.submit({ | 69 | this.form.submit({ |
70 | onSuccess: (form) => { | 70 | onSuccess: (form) => { |
71 | 71 | ||
72 | this.props.onSubmit({ | ||
73 | invites: form.values().invite, | ||
74 | from: this.props.from | ||
75 | }); | ||
76 | |||
72 | const atLeastOneEmailAddress = form.$('invite') | 77 | const atLeastOneEmailAddress = form.$('invite') |
73 | .map(invite => {return invite.$('email').value}) | 78 | .map(invite => {return invite.$('email').value}) |
74 | .some(email => email.trim() !== '') | 79 | .some(email => email.trim() !== '') |
@@ -87,6 +92,7 @@ export default class Invite extends Component { | |||
87 | render() { | 92 | render() { |
88 | const { form } = this; | 93 | const { form } = this; |
89 | const { intl } = this.context; | 94 | const { intl } = this.context; |
95 | const { from } = this.props; | ||
90 | 96 | ||
91 | const atLeastOneEmailAddress = form.$('invite') | 97 | const atLeastOneEmailAddress = form.$('invite') |
92 | .map(invite => {return invite.$('email').value}) | 98 | .map(invite => {return invite.$('email').value}) |
@@ -123,7 +129,7 @@ export default class Invite extends Component { | |||
123 | label={intl.formatMessage(messages.submitButtonLabel)} | 129 | label={intl.formatMessage(messages.submitButtonLabel)} |
124 | /> | 130 | /> |
125 | <Link | 131 | <Link |
126 | to="/" | 132 | to={ !!from ? from : '/'} |
127 | className="franz-form__button franz-form__button--secondary auth__button auth__button--skip" | 133 | className="franz-form__button franz-form__button--secondary auth__button auth__button--skip" |
128 | > | 134 | > |
129 | {intl.formatMessage(messages.skipButtonLabel)} | 135 | {intl.formatMessage(messages.skipButtonLabel)} |
diff --git a/src/components/settings/account/AccountDashboard.js b/src/components/settings/account/AccountDashboard.js index 43272fe96..d5f2e238c 100644 --- a/src/components/settings/account/AccountDashboard.js +++ b/src/components/settings/account/AccountDashboard.js | |||
@@ -48,6 +48,11 @@ const messages = defineMessages({ | |||
48 | id: 'settings.account.account.editButton', | 48 | id: 'settings.account.account.editButton', |
49 | defaultMessage: '!!!Edit Account', | 49 | defaultMessage: '!!!Edit Account', |
50 | }, | 50 | }, |
51 | accountInviteButton: { | ||
52 | id: "settings.account.account.inviteButton", | ||
53 | defaultMessage: '!!!Invite Friends', | ||
54 | }, | ||
55 | |||
51 | invoiceDownload: { | 56 | invoiceDownload: { |
52 | id: 'settings.account.invoiceDownload', | 57 | id: 'settings.account.invoiceDownload', |
53 | defaultMessage: '!!!Download', | 58 | defaultMessage: '!!!Download', |
@@ -113,6 +118,7 @@ export default class AccountDashboard extends Component { | |||
113 | deleteAccount, | 118 | deleteAccount, |
114 | isLoadingDeleteAccount, | 119 | isLoadingDeleteAccount, |
115 | isDeleteAccountSuccessful, | 120 | isDeleteAccountSuccessful, |
121 | pathname, | ||
116 | } = this.props; | 122 | } = this.props; |
117 | const { intl } = this.context; | 123 | const { intl } = this.context; |
118 | 124 | ||
@@ -174,10 +180,25 @@ export default class AccountDashboard extends Component { | |||
174 | <span className="badge badge--premium">{intl.formatMessage(messages.accountTypePremium)}</span> | 180 | <span className="badge badge--premium">{intl.formatMessage(messages.accountTypePremium)}</span> |
175 | )} | 181 | )} |
176 | </div> | 182 | </div> |
177 | <Link to="/settings/user/edit" className="button"> | 183 | <div className="grid"> |
178 | {intl.formatMessage(messages.accountEditButton)} | 184 | <div className="grid__row"> |
179 | </Link> | 185 | <Link to="/settings/user/edit" className="button account__edit-button"> |
180 | 186 | {intl.formatMessage(messages.accountEditButton)} | |
187 | </Link> | ||
188 | </div> | ||
189 | <div className="grid__row"> | ||
190 | <Link | ||
191 | to={{ | ||
192 | pathname: '/auth/signup/invite', | ||
193 | query: { from: pathname }, | ||
194 | // state: { "from": 'hi' } // is not being passed to route | ||
195 | }} | ||
196 | className="button account__invite-button"> | ||
197 | {intl.formatMessage(messages.accountInviteButton)} | ||
198 | </Link> | ||
199 | </div> | ||
200 | </div> | ||
201 | |||
181 | {user.emailValidated} | 202 | {user.emailValidated} |
182 | </div> | 203 | </div> |
183 | </div> | 204 | </div> |
diff --git a/src/components/ui/Link.js b/src/components/ui/Link.js index f5da921fa..bc3c2d8aa 100644 --- a/src/components/ui/Link.js +++ b/src/components/ui/Link.js | |||
@@ -62,7 +62,10 @@ Link.wrappedComponent.propTypes = { | |||
62 | oneOrManyChildElements, | 62 | oneOrManyChildElements, |
63 | PropTypes.string, | 63 | PropTypes.string, |
64 | ]).isRequired, | 64 | ]).isRequired, |
65 | to: PropTypes.string.isRequired, | 65 | to: PropTypes.oneOfType([ |
66 | PropTypes.string, | ||
67 | PropTypes.object | ||
68 | ]).isRequired, | ||
66 | className: PropTypes.string, | 69 | className: PropTypes.string, |
67 | activeClassName: PropTypes.string, | 70 | activeClassName: PropTypes.string, |
68 | strictFilter: PropTypes.bool, | 71 | strictFilter: PropTypes.bool, |
diff --git a/src/containers/auth/InviteScreen.js b/src/containers/auth/InviteScreen.js index 51971f436..a624e2245 100644 --- a/src/containers/auth/InviteScreen.js +++ b/src/containers/auth/InviteScreen.js | |||
@@ -11,10 +11,15 @@ export default class InviteScreen extends Component { | |||
11 | } | 11 | } |
12 | 12 | ||
13 | render() { | 13 | render() { |
14 | const { actions } = this.props; | 14 | const { |
15 | actions, | ||
16 | location | ||
17 | } = this.props; | ||
18 | |||
15 | return ( | 19 | return ( |
16 | <Invite | 20 | <Invite |
17 | onSubmit={actions.user.invite} | 21 | onSubmit={actions.user.invite} |
22 | from={location.query.from} | ||
18 | /> | 23 | /> |
19 | ); | 24 | ); |
20 | } | 25 | } |
diff --git a/src/containers/settings/AccountScreen.js b/src/containers/settings/AccountScreen.js index c5c2982b0..b57530884 100644 --- a/src/containers/settings/AccountScreen.js +++ b/src/containers/settings/AccountScreen.js | |||
@@ -83,6 +83,7 @@ export default class AccountScreen extends Component { | |||
83 | deleteAccount={userActions.delete} | 83 | deleteAccount={userActions.delete} |
84 | isLoadingDeleteAccount={user.deleteAccountRequest.isExecuting} | 84 | isLoadingDeleteAccount={user.deleteAccountRequest.isExecuting} |
85 | isDeleteAccountSuccessful={user.deleteAccountRequest.wasExecuted && !user.deleteAccountRequest.isError} | 85 | isDeleteAccountSuccessful={user.deleteAccountRequest.wasExecuted && !user.deleteAccountRequest.isError} |
86 | pathname={this.props.location.pathname} | ||
86 | /> | 87 | /> |
87 | ); | 88 | ); |
88 | } | 89 | } |
diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json index 1ea0554ba..180db3018 100644 --- a/src/i18n/locales/de.json +++ b/src/i18n/locales/de.json | |||
@@ -45,6 +45,7 @@ | |||
45 | "services.getStarted" : "Loslegen", | 45 | "services.getStarted" : "Loslegen", |
46 | "services.welcome" : "Willkommen bei Franz.", | 46 | "services.welcome" : "Willkommen bei Franz.", |
47 | "settings.account.account.editButton" : "Konto bearbeiten", | 47 | "settings.account.account.editButton" : "Konto bearbeiten", |
48 | "settings.account.account.inviteButton" : "Freunde einladen", | ||
48 | "settings.account.accountType.basic" : "Basis Konto", | 49 | "settings.account.accountType.basic" : "Basis Konto", |
49 | "settings.account.accountType.premium" : "Premium-Supporter Konto", | 50 | "settings.account.accountType.premium" : "Premium-Supporter Konto", |
50 | "settings.account.buttonSave" : "Profil aktualisieren", | 51 | "settings.account.buttonSave" : "Profil aktualisieren", |
diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index f58d5634b..c9e9b860b 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json | |||
@@ -77,6 +77,7 @@ | |||
77 | "settings.account.accountType.basic": "Basic Account", | 77 | "settings.account.accountType.basic": "Basic Account", |
78 | "settings.account.accountType.premium": "Premium Supporter Account", | 78 | "settings.account.accountType.premium": "Premium Supporter Account", |
79 | "settings.account.account.editButton": "Edit account", | 79 | "settings.account.account.editButton": "Edit account", |
80 | "settings.account.account.inviteButton" : "Invite friends", | ||
80 | "settings.account.invoiceDownload": "Download", | 81 | "settings.account.invoiceDownload": "Download", |
81 | "settings.account.userInfoRequestFailed": "Could not load user information", | 82 | "settings.account.userInfoRequestFailed": "Could not load user information", |
82 | "settings.account.tryReloadUserInfoRequest": "Try again", | 83 | "settings.account.tryReloadUserInfoRequest": "Try again", |
diff --git a/src/i18n/locales/es.json b/src/i18n/locales/es.json index c4f598bd1..dddd1bf1f 100644 --- a/src/i18n/locales/es.json +++ b/src/i18n/locales/es.json | |||
@@ -45,6 +45,7 @@ | |||
45 | "services.getStarted" : "Primeros pasos", | 45 | "services.getStarted" : "Primeros pasos", |
46 | "services.welcome" : "Bienvenido a Franz", | 46 | "services.welcome" : "Bienvenido a Franz", |
47 | "settings.account.account.editButton" : "Editar cuenta", | 47 | "settings.account.account.editButton" : "Editar cuenta", |
48 | "settings.account.account.inviteButton" : "Invitar amigos", | ||
48 | "settings.account.accountType.basic" : "Cuenta Básica", | 49 | "settings.account.accountType.basic" : "Cuenta Básica", |
49 | "settings.account.accountType.premium" : "Cuenta Colaborador Premium", | 50 | "settings.account.accountType.premium" : "Cuenta Colaborador Premium", |
50 | "settings.account.buttonSave" : "Actualizar perfil", | 51 | "settings.account.buttonSave" : "Actualizar perfil", |
diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json index 4a06975bb..a717577be 100644 --- a/src/i18n/locales/fr.json +++ b/src/i18n/locales/fr.json | |||
@@ -45,6 +45,7 @@ | |||
45 | "services.getStarted" : "Commencer", | 45 | "services.getStarted" : "Commencer", |
46 | "services.welcome" : "Bienvenue dans Franz", | 46 | "services.welcome" : "Bienvenue dans Franz", |
47 | "settings.account.account.editButton" : "Modifier le compte", | 47 | "settings.account.account.editButton" : "Modifier le compte", |
48 | "settings.account.account.inviteButton" : "Inviter des amis", | ||
48 | "settings.account.accountType.basic" : "Compte de base", | 49 | "settings.account.accountType.basic" : "Compte de base", |
49 | "settings.account.accountType.premium" : "Compte supporteur premium", | 50 | "settings.account.accountType.premium" : "Compte supporteur premium", |
50 | "settings.account.buttonSave" : "Mettre à jour le profil", | 51 | "settings.account.buttonSave" : "Mettre à jour le profil", |
diff --git a/src/i18n/locales/it.json b/src/i18n/locales/it.json index 1d2485b19..5b89b3a12 100644 --- a/src/i18n/locales/it.json +++ b/src/i18n/locales/it.json | |||
@@ -45,6 +45,7 @@ | |||
45 | "services.getStarted" : "Iniziamo", | 45 | "services.getStarted" : "Iniziamo", |
46 | "services.welcome" : "Benvenuto in Franz", | 46 | "services.welcome" : "Benvenuto in Franz", |
47 | "settings.account.account.editButton" : "Modifica account", | 47 | "settings.account.account.editButton" : "Modifica account", |
48 | "settings.account.account.inviteButton" : "Invitare amicos", | ||
48 | "settings.account.accountType.basic" : "Account Basic", | 49 | "settings.account.accountType.basic" : "Account Basic", |
49 | "settings.account.accountType.premium" : "Premium Supporter Account", | 50 | "settings.account.accountType.premium" : "Premium Supporter Account", |
50 | "settings.account.buttonSave" : "Aggiorna profilo", | 51 | "settings.account.buttonSave" : "Aggiorna profilo", |
diff --git a/src/models/User.js b/src/models/User.js index 2e5df4795..d2a455e20 100644 --- a/src/models/User.js +++ b/src/models/User.js | |||
@@ -10,7 +10,7 @@ export default class User { | |||
10 | @observable emailIsConfirmed = true; // better assume it's confirmed to avoid noise | 10 | @observable emailIsConfirmed = true; // better assume it's confirmed to avoid noise |
11 | @observable subscription = {}; | 11 | @observable subscription = {}; |
12 | @observable isSubscriptionOwner = false; | 12 | @observable isSubscriptionOwner = false; |
13 | @observable isPremium = false; | 13 | @observable isPremium = true; |
14 | @observable beta = false; | 14 | @observable beta = false; |
15 | @observable donor = {}; | 15 | @observable donor = {}; |
16 | @observable isDonor = false; | 16 | @observable isDonor = false; |
diff --git a/src/stores/UserStore.js b/src/stores/UserStore.js index 09000dcdb..476c1f040 100644 --- a/src/stores/UserStore.js +++ b/src/stores/UserStore.js | |||
@@ -160,13 +160,13 @@ export default class UserStore extends Store { | |||
160 | gaEvent('User', 'retrievePassword'); | 160 | gaEvent('User', 'retrievePassword'); |
161 | } | 161 | } |
162 | 162 | ||
163 | @action _invite({ invites }) { | 163 | @action _invite({ invites, from }) { |
164 | const data = invites.filter(invite => invite.email !== ''); | 164 | const data = invites.filter(invite => invite.email !== ''); |
165 | 165 | ||
166 | this.inviteRequest.execute(data); | 166 | this.inviteRequest.execute(data); |
167 | 167 | ||
168 | // we do not wait for a server response before redirecting the user | 168 | // we do not wait for a server response before redirecting the user |
169 | this.stores.router.push('/'); | 169 | this.stores.router.push(!!from ? from : '/'); |
170 | 170 | ||
171 | gaEvent('User', 'inviteUsers'); | 171 | gaEvent('User', 'inviteUsers'); |
172 | } | 172 | } |
@@ -237,7 +237,9 @@ export default class UserStore extends Store { | |||
237 | && currentRoute.includes(this.BASE_ROUTE) | 237 | && currentRoute.includes(this.BASE_ROUTE) |
238 | && (this.hasCompletedSignup | 238 | && (this.hasCompletedSignup |
239 | || this.hasCompletedSignup === null)) { | 239 | || this.hasCompletedSignup === null)) { |
240 | this.stores.router.push('/'); | 240 | if (!isDevMode) { |
241 | this.stores.router.push('/'); | ||
242 | } | ||
241 | } | 243 | } |
242 | }; | 244 | }; |
243 | 245 | ||
diff --git a/src/styles/settings.scss b/src/styles/settings.scss index 2182c9b5f..f436b1eda 100644 --- a/src/styles/settings.scss +++ b/src/styles/settings.scss | |||
@@ -282,6 +282,15 @@ | |||
282 | } | 282 | } |
283 | } | 283 | } |
284 | 284 | ||
285 | .account__edit-button { | ||
286 | width: 170px; | ||
287 | margin-bottom: 10px; | ||
288 | } | ||
289 | |||
290 | .account__invite-button { | ||
291 | width: 170px; | ||
292 | } | ||
293 | |||
285 | .account__subscription { | 294 | .account__subscription { |
286 | display: flex; | 295 | display: flex; |
287 | align-items: center; | 296 | align-items: center; |