mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-07 19:50:33 +08:00
feat: add address line 1 and 2 in web UI (#2961)
This commit is contained in:
@@ -202,7 +202,7 @@ class UserEditPage extends React.Component {
|
||||
return value;
|
||||
}
|
||||
|
||||
updateUserField(key, value) {
|
||||
updateUserField(key, value, idx) {
|
||||
if (this.props.account === null) {
|
||||
return;
|
||||
}
|
||||
@@ -210,7 +210,12 @@ class UserEditPage extends React.Component {
|
||||
value = this.parseUserField(key, value);
|
||||
|
||||
const user = this.state.user;
|
||||
user[key] = value;
|
||||
if (key === "address") {
|
||||
user[key][idx] = value;
|
||||
} else {
|
||||
user[key] = value;
|
||||
}
|
||||
|
||||
this.setState({
|
||||
user: user,
|
||||
});
|
||||
@@ -501,16 +506,33 @@ class UserEditPage extends React.Component {
|
||||
);
|
||||
} else if (accountItem.name === "Address") {
|
||||
return (
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("user:Address"), i18next.t("user:Address - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input value={this.state.user.address} onChange={e => {
|
||||
this.updateUserField("address", e.target.value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<React.Fragment>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("user:Address"), i18next.t("user:Address - Tooltip"))} :
|
||||
</Col>
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
<span>{i18next.t("user:Address line") + " 1"}</span> :
|
||||
</Col>
|
||||
<Col span={20} >
|
||||
<Input value={this.state.user.address[0]} onChange={e => {
|
||||
this.updateUserField("address", e.target.value, 0);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
</Col>
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
<span>{i18next.t("user:Address line") + " 2"}</span> :
|
||||
</Col>
|
||||
<Col span={20} >
|
||||
<Input value={this.state.user.address[1]} onChange={e => {
|
||||
this.updateUserField("address", e.target.value, 1);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
</React.Fragment>
|
||||
);
|
||||
} else if (accountItem.name === "Affiliation") {
|
||||
return (
|
||||
|
Reference in New Issue
Block a user