Skip to content

Commit

Permalink
[Fix #18] Fixed UI when not auth with Oidc
Browse files Browse the repository at this point in the history
  • Loading branch information
LaChope committed Dec 13, 2023
1 parent d04a32e commit 2488108
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions js/components/user/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,22 +259,26 @@ class User extends React.Component {
<div className="buttons-line-height mt-3 text-center">
{this._impersonateButton()}
{this._passwordChange()}
{this._saveAndSendEmailButton()}
{currentUser.role === ROLE.ADMIN &&
<Button variant='success' size='sm' ref='submit' className="d-inline-flex"
disabled={!UserValidator.isValid(user) || userSaved.status === ACTION_STATUS.PENDING}
onClick={() => this._onSave()}
title={this.i18n('required')}>
{this.i18n('save')}
{!UserValidator.isValid(user) &&
<HelpIcon className="align-self-center" text={this.i18n('required')}/>}
{userSaved.status === ACTION_STATUS.PENDING &&
<LoaderSmall/>}
</Button>
{!isUsingOidcAuth() &&
<>
{this._saveAndSendEmailButton()}
{currentUser.role === ROLE.ADMIN || currentUser.username === user.username &&
<Button variant='success' size='sm' ref='submit' className="d-inline-flex"
disabled={!UserValidator.isValid(user) || userSaved.status === ACTION_STATUS.PENDING}
onClick={() => this._onSave()}
title={this.i18n('required')}>
{this.i18n('save')}
{!UserValidator.isValid(user) &&
<HelpIcon className="align-self-center" text={this.i18n('required')}/>}
{userSaved.status === ACTION_STATUS.PENDING &&
<LoaderSmall/>}
</Button>
}
<Button variant='link' size='sm' onClick={handlers.onCancel}>
{this.i18n(this.props.backToInstitution ? 'users.back-to-institution' : 'cancel')}
</Button>
</>
}
<Button variant='link' size='sm' onClick={handlers.onCancel} hidden={true}>
{this.i18n(this.props.backToInstitution ? 'users.back-to-institution' : 'cancel')}
</Button>
</div>
{showAlert && userSaved.status === ACTION_STATUS.ERROR &&
<AlertMessage type={ALERT_TYPES.DANGER}
Expand Down

0 comments on commit 2488108

Please sign in to comment.