diff options
Diffstat (limited to 'src/components/settings')
-rw-r--r-- | src/components/settings/account/AccountDashboard.js | 75 | ||||
-rw-r--r-- | src/components/settings/user/EditUserForm.js | 25 |
2 files changed, 28 insertions, 72 deletions
diff --git a/src/components/settings/account/AccountDashboard.js b/src/components/settings/account/AccountDashboard.js index 9c9543749..181b95c8c 100644 --- a/src/components/settings/account/AccountDashboard.js +++ b/src/components/settings/account/AccountDashboard.js | |||
@@ -44,10 +44,6 @@ const messages = defineMessages({ | |||
44 | id: 'settings.account.accountType.premium', | 44 | id: 'settings.account.accountType.premium', |
45 | defaultMessage: '!!!Premium Supporter Account', | 45 | defaultMessage: '!!!Premium Supporter Account', |
46 | }, | 46 | }, |
47 | accountTypeEnterprise: { | ||
48 | id: 'settings.account.accountType.enterprise', | ||
49 | defaultMessage: '!!!Enterprise Account', | ||
50 | }, | ||
51 | accountEditButton: { | 47 | accountEditButton: { |
52 | id: 'settings.account.account.editButton', | 48 | id: 'settings.account.account.editButton', |
53 | defaultMessage: '!!!Edit Account', | 49 | defaultMessage: '!!!Edit Account', |
@@ -169,15 +165,9 @@ export default @observer class AccountDashboard extends Component { | |||
169 | {user.organization && `${user.organization}, `} | 165 | {user.organization && `${user.organization}, `} |
170 | {user.email} | 166 | {user.email} |
171 | <br /> | 167 | <br /> |
172 | {!user.isEnterprise && !user.isPremium && ( | ||
173 | <span className="badge badge">{intl.formatMessage(messages.accountTypeBasic)}</span> | ||
174 | )} | ||
175 | {user.isPremium && ( | 168 | {user.isPremium && ( |
176 | <span className="badge badge--premium">{intl.formatMessage(messages.accountTypePremium)}</span> | 169 | <span className="badge badge--premium">{intl.formatMessage(messages.accountTypePremium)}</span> |
177 | )} | 170 | )} |
178 | {user.isEnterprise && ( | ||
179 | <span className="badge badge--success">{intl.formatMessage(messages.accountTypeEnterprise)}</span> | ||
180 | )} | ||
181 | </div> | 171 | </div> |
182 | <Link to="/settings/user/edit" className="button"> | 172 | <Link to="/settings/user/edit" className="button"> |
183 | {intl.formatMessage(messages.accountEditButton)} | 173 | {intl.formatMessage(messages.accountEditButton)} |
@@ -235,34 +225,7 @@ export default @observer class AccountDashboard extends Component { | |||
235 | ) | 225 | ) |
236 | )} | 226 | )} |
237 | 227 | ||
238 | {user.isEnterprise && ( | 228 | {!user.isPremium && ( |
239 | <div className="account"> | ||
240 | <div className="account__box"> | ||
241 | <h2>{user.company.name}</h2> | ||
242 | <p> | ||
243 | Technical contact: | ||
244 | <Link | ||
245 | className="link" | ||
246 | target="_blank" | ||
247 | to={`mailto:${user.company.contact.technical}?subject=Franz`} | ||
248 | > | ||
249 | {user.company.contact.technical} | ||
250 | </Link> | ||
251 | <br /> | ||
252 | General contact: | ||
253 | <Link | ||
254 | className="link" | ||
255 | target="_blank" | ||
256 | to={`mailto:${user.company.contact.default}?subject=Franz`} | ||
257 | > | ||
258 | {user.company.contact.default} | ||
259 | </Link> | ||
260 | </p> | ||
261 | </div> | ||
262 | </div> | ||
263 | )} | ||
264 | |||
265 | {!user.isEnterprise && !user.isPremium && ( | ||
266 | isLoadingPlans ? ( | 229 | isLoadingPlans ? ( |
267 | <Loader /> | 230 | <Loader /> |
268 | ) : ( | 231 | ) : ( |
@@ -277,27 +240,25 @@ export default @observer class AccountDashboard extends Component { | |||
277 | ) | 240 | ) |
278 | )} | 241 | )} |
279 | 242 | ||
280 | {!user.isEnterprise && ( | 243 | <div className="account franz-form"> |
281 | <div className="account franz-form"> | 244 | <div className="account__box"> |
282 | <div className="account__box"> | 245 | <h2>{intl.formatMessage(messages.headlineDangerZone)}</h2> |
283 | <h2>{intl.formatMessage(messages.headlineDangerZone)}</h2> | 246 | {!isDeleteAccountSuccessful && ( |
284 | {!isDeleteAccountSuccessful && ( | 247 | <div className="account__subscription"> |
285 | <div className="account__subscription"> | 248 | <p>{intl.formatMessage(messages.deleteInfo)}</p> |
286 | <p>{intl.formatMessage(messages.deleteInfo)}</p> | 249 | <Button |
287 | <Button | 250 | label={intl.formatMessage(messages.deleteAccount)} |
288 | label={intl.formatMessage(messages.deleteAccount)} | 251 | buttonType="danger" |
289 | buttonType="danger" | 252 | onClick={() => deleteAccount()} |
290 | onClick={() => deleteAccount()} | 253 | loaded={!isLoadingDeleteAccount} |
291 | loaded={!isLoadingDeleteAccount} | 254 | /> |
292 | /> | ||
293 | </div> | ||
294 | )} | ||
295 | {isDeleteAccountSuccessful && ( | ||
296 | <p>{intl.formatMessage(messages.deleteEmailSent)}</p> | ||
297 | )} | ||
298 | </div> | 255 | </div> |
256 | )} | ||
257 | {isDeleteAccountSuccessful && ( | ||
258 | <p>{intl.formatMessage(messages.deleteEmailSent)}</p> | ||
259 | )} | ||
299 | </div> | 260 | </div> |
300 | )} | 261 | </div> |
301 | </Fragment> | 262 | </Fragment> |
302 | )} | 263 | )} |
303 | </div> | 264 | </div> |
diff --git a/src/components/settings/user/EditUserForm.js b/src/components/settings/user/EditUserForm.js index 0e3ac6b10..a1a353e57 100644 --- a/src/components/settings/user/EditUserForm.js +++ b/src/components/settings/user/EditUserForm.js | |||
@@ -3,11 +3,10 @@ import PropTypes from 'prop-types'; | |||
3 | import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; | 3 | import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; |
4 | import { defineMessages, intlShape } from 'react-intl'; | 4 | import { defineMessages, intlShape } from 'react-intl'; |
5 | import { Link } from 'react-router'; | 5 | import { Link } from 'react-router'; |
6 | 6 | import { Input } from '@meetfranz/forms'; | |
7 | // import { Link } from 'react-router'; | ||
8 | 7 | ||
9 | import Form from '../../../lib/Form'; | 8 | import Form from '../../../lib/Form'; |
10 | import Input from '../../ui/Input'; | 9 | // import Input from '../../ui/Input'; |
11 | import Button from '../../ui/Button'; | 10 | import Button from '../../ui/Button'; |
12 | import Radio from '../../ui/Radio'; | 11 | import Radio from '../../ui/Radio'; |
13 | import Infobox from '../../ui/Infobox'; | 12 | import Infobox from '../../ui/Infobox'; |
@@ -39,13 +38,12 @@ const messages = defineMessages({ | |||
39 | }, | 38 | }, |
40 | }); | 39 | }); |
41 | 40 | ||
42 | export default @observer class EditServiceForm extends Component { | 41 | export default @observer class EditUserForm extends Component { |
43 | static propTypes = { | 42 | static propTypes = { |
44 | status: MobxPropTypes.observableArray.isRequired, | 43 | status: MobxPropTypes.observableArray.isRequired, |
45 | form: PropTypes.instanceOf(Form).isRequired, | 44 | form: PropTypes.instanceOf(Form).isRequired, |
46 | onSubmit: PropTypes.func.isRequired, | 45 | onSubmit: PropTypes.func.isRequired, |
47 | isSaving: PropTypes.bool.isRequired, | 46 | isSaving: PropTypes.bool.isRequired, |
48 | isEnterprise: PropTypes.bool.isRequired, | ||
49 | }; | 47 | }; |
50 | 48 | ||
51 | static contextTypes = { | 49 | static contextTypes = { |
@@ -68,7 +66,6 @@ export default @observer class EditServiceForm extends Component { | |||
68 | // user, | 66 | // user, |
69 | status, | 67 | status, |
70 | form, | 68 | form, |
71 | isEnterprise, | ||
72 | isSaving, | 69 | isSaving, |
73 | } = this.props; | 70 | } = this.props; |
74 | const { intl } = this.context; | 71 | const { intl } = this.context; |
@@ -98,23 +95,21 @@ export default @observer class EditServiceForm extends Component { | |||
98 | )} | 95 | )} |
99 | <h2>{intl.formatMessage(messages.headlineAccount)}</h2> | 96 | <h2>{intl.formatMessage(messages.headlineAccount)}</h2> |
100 | <div className="grid__row"> | 97 | <div className="grid__row"> |
101 | <Input field={form.$('firstname')} focus /> | 98 | <Input {...form.$('firstname').bind()} focus /> |
102 | <Input field={form.$('lastname')} /> | 99 | <Input {...form.$('lastname').bind()} /> |
103 | </div> | 100 | </div> |
104 | <Input field={form.$('email')} /> | 101 | <Input {...form.$('email').bind()} /> |
105 | {!isEnterprise && ( | 102 | <Radio field={form.$('accountType')} /> |
106 | <Radio field={form.$('accountType')} /> | 103 | {form.$('accountType').value === 'company' && ( |
107 | )} | ||
108 | {!isEnterprise && form.$('accountType').value === 'company' && ( | ||
109 | <Input field={form.$('organization')} /> | 104 | <Input field={form.$('organization')} /> |
110 | )} | 105 | )} |
111 | <h2>{intl.formatMessage(messages.headlinePassword)}</h2> | 106 | <h2>{intl.formatMessage(messages.headlinePassword)}</h2> |
112 | <Input | 107 | <Input |
113 | field={form.$('oldPassword')} | 108 | {...form.$('oldPassword').bind()} |
114 | showPasswordToggle | 109 | showPasswordToggle |
115 | /> | 110 | /> |
116 | <Input | 111 | <Input |
117 | field={form.$('newPassword')} | 112 | {...form.$('newPassword').bind()} |
118 | showPasswordToggle | 113 | showPasswordToggle |
119 | scorePassword | 114 | scorePassword |
120 | /> | 115 | /> |