Skip to content

Commit

Permalink
feat: Hide change email when auth_type !== 'EMAIL' (#4712)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-ssg authored Oct 11, 2024
1 parent febf35f commit 27109fd
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 42 deletions.
1 change: 1 addition & 0 deletions docs/docs/deployment/hosting/locally-frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Current variables used between 'frontend/environment.js' and 'frontend/common/pr
signups.
- `PREVENT_FORGOT_PASSWORD`: Determines whether to prevent forgot password functionality, useful for LDAP/SAML. Set it
to any value to prevent forgot password functionality.
- `PREVENT_EMAIL_PASSWORD`: Disables email address signup, login and change email functionality.
- `ENABLE_MAINTENANCE_MODE`: Puts the site into maintenance mode. Set it to any value to enable maintenance.
- `AMPLITUDE_API_KEY`: The Amplitude key to use for behaviour tracking.
- `MIXPANEL_API_KEY`: Mixpanel analytics key to use for behaviour tracking.
Expand Down
86 changes: 44 additions & 42 deletions frontend/web/components/pages/AccountSettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,48 +188,50 @@ class TheComponent extends Component {
/>
<div className='col-md-6'>
<form className='mb-0' onSubmit={this.save}>
<div>
<InputGroup
className='mt-2'
title='Email Address'
data-test='firstName'
inputProps={{
className: 'full-width',
name: 'groupName',
readOnly: true,
}}
value={email}
onChange={(e) =>
this.setState({
first_name: Utils.safeParseEventValue(e),
})
}
type='text'
name='Email Address'
/>
<div className='text-right mt-5'>
<Button
onClick={() =>
openModal(
'Change Email Address',
<ChangeEmailAddress
onComplete={() => {
closeModal()
AppActions.logout()
}}
/>,
'p-0',
)
}
id='change-email-button'
data-test='change-email-button'
type='button'
class='input-group-addon'
>
Change Email Address
</Button>
</div>
</div>
{AccountStore.model.auth_type === 'EMAIL' && (
<div>
<InputGroup
className='mt-2'
title='Email Address'
data-test='firstName'
inputProps={{
className: 'full-width',
name: 'groupName',
readOnly: true,
}}
value={email}
onChange={(e) =>
this.setState({
first_name: Utils.safeParseEventValue(e),
})
}
type='text'
name='Email Address'
/>
<div className='text-right mt-5'>
<Button
onClick={() =>
openModal(
'Change Email Address',
<ChangeEmailAddress
onComplete={() => {
closeModal()
AppActions.logout()
}}
/>,
'p-0',
)
}
id='change-email-button'
data-test='change-email-button'
type='button'
class='input-group-addon'
>
Change Email Address
</Button>
</div>
</div>
)}
<InputGroup
className='mt-2 mb-4'
title='First Name'
Expand Down

0 comments on commit 27109fd

Please sign in to comment.