Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Hide change email when auth_type !== 'EMAIL' #4712

Merged
merged 3 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading