mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
Hide invite user button when the form is active (#554)
* fix the invite new user button bug * Remove the sol for scenario 2 Co-authored-by: “Apoorv <“tiwari.apoorv1316@gmail.com”>
This commit is contained in:
parent
553352767d
commit
ab074ba4b0
1 changed files with 22 additions and 19 deletions
|
|
@ -105,16 +105,14 @@ class ManageOrgUsers extends React.Component {
|
|||
history.push('/login');
|
||||
};
|
||||
|
||||
generateInvitationURL = user => window.location.origin + '/invitations/' + user.invitation_token
|
||||
generateInvitationURL = (user) => window.location.origin + '/invitations/' + user.invitation_token;
|
||||
|
||||
invitationLinkCopyHandler = () => {
|
||||
toast.info('Invitation URL copied', { hideProgressBar: true, position: 'bottom-right' });
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
render() {
|
||||
const { isLoading, showNewUserForm, creatingUser, users, newUser, idChangingRole, archivingUser } = this.state;
|
||||
|
||||
return (
|
||||
<div className="wrapper org-users-page">
|
||||
<Header switchDarkMode={this.props.switchDarkMode} darkMode={this.props.darkMode} />
|
||||
|
|
@ -128,9 +126,11 @@ class ManageOrgUsers extends React.Component {
|
|||
<h2 className="page-title">Users & Permissions</h2>
|
||||
</div>
|
||||
<div className="col-auto ms-auto d-print-none">
|
||||
<div className="btn btn-primary" onClick={() => this.setState({ showNewUserForm: true })}>
|
||||
Invite new user
|
||||
</div>
|
||||
{!showNewUserForm && (
|
||||
<div className="btn btn-primary" onClick={() => this.setState({ showNewUserForm: true })}>
|
||||
Invite new user
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -307,18 +307,21 @@ class ManageOrgUsers extends React.Component {
|
|||
className={`badge bg-${user.status === 'invited' ? 'warning' : 'success'} me-1 m-1`}
|
||||
></span>
|
||||
<small className="user-status">{user.status}</small>
|
||||
{
|
||||
user.status === 'invited' && ('invitation_token' in user) ?
|
||||
|
||||
<CopyToClipboard
|
||||
text={this.generateInvitationURL(user)}
|
||||
onCopy={this.invitationLinkCopyHandler}
|
||||
>
|
||||
<img className='svg-icon' src="/assets/images/icons/copy.svg" width="15" height="15"></img>
|
||||
</CopyToClipboard>
|
||||
:
|
||||
''
|
||||
}
|
||||
{user.status === 'invited' && 'invitation_token' in user ? (
|
||||
<CopyToClipboard
|
||||
text={this.generateInvitationURL(user)}
|
||||
onCopy={this.invitationLinkCopyHandler}
|
||||
>
|
||||
<img
|
||||
className="svg-icon"
|
||||
src="/assets/images/icons/copy.svg"
|
||||
width="15"
|
||||
height="15"
|
||||
></img>
|
||||
</CopyToClipboard>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</td>
|
||||
<td>
|
||||
{archivingUser === null && (
|
||||
|
|
|
|||
Loading…
Reference in a new issue