Disable PasswordModal when needed in user edit page.

This commit is contained in:
Gucheng Wang
2022-01-15 21:34:37 +08:00
parent 82d0e895e0
commit cee2c608a2
2 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ export const PasswordModal = (props) => {
return ( return (
<Row> <Row>
<Button type="default" onClick={showModal}> <Button type="default" disabled={props.disabled} onClick={showModal}>
{ hasOldPassword ? i18next.t("user:Modify password...") : i18next.t("user:Set password...")} { hasOldPassword ? i18next.t("user:Modify password...") : i18next.t("user:Set password...")}
</Button> </Button>
<Modal <Modal

View File

@ -214,7 +214,7 @@ class UserEditPage extends React.Component {
{Setting.getLabel(i18next.t("general:Password"), i18next.t("general:Password - Tooltip"))} : {Setting.getLabel(i18next.t("general:Password"), i18next.t("general:Password - Tooltip"))} :
</Col> </Col>
<Col span={22} > <Col span={22} >
<PasswordModal user={this.state.user} account={this.props.account} /> <PasswordModal user={this.state.user} account={this.props.account} disabled={this.state.userName !== this.state.user.name} />
</Col> </Col>
</Row> </Row>
<Row style={{marginTop: '20px'}} > <Row style={{marginTop: '20px'}} >