Skip to content

Commit

Permalink
feat: add address line 1 and 2 in web UI (#2961)
Browse files Browse the repository at this point in the history
  • Loading branch information
dacongda committed May 19, 2024
1 parent c48306d commit bfcfb56
Show file tree
Hide file tree
Showing 24 changed files with 80 additions and 12 deletions.
46 changes: 34 additions & 12 deletions web/src/UserEditPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,20 @@ class UserEditPage extends React.Component {
return value;
}

updateUserField(key, value) {
updateUserField(key, value, idx) {
if (this.props.account === null) {
return;
}

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,
});
Expand Down Expand Up @@ -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 (
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/ar/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "The input is not invoice Tax ID!",
"The input is not invoice title!": "The input is not invoice title!",
"The input is not valid Email!": "The input is not valid Email!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Social logins linked by the user",
"Address": "Address",
"Address - Tooltip": "Residential address",
"Address line": "Address line",
"Affiliation": "Affiliation",
"Affiliation - Tooltip": "Employer, such as company name or organization name",
"Bio": "Bio",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/de/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "Die Eingabe ist keine Rechnungssteuer-ID!",
"The input is not invoice title!": "Der Eingabewert ist nicht die Rechnungsbezeichnung!",
"The input is not valid Email!": "Die Eingabe ist keine gültige E-Mail-Adresse!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Drittanbieter-Anmeldungen, die mit dem Benutzer verknüpft sind",
"Address": "Adresse",
"Address - Tooltip": "Wohnadresse",
"Address line": "Address line",
"Affiliation": "Zugehörigkeit",
"Affiliation - Tooltip": "Arbeitgeber, wie Firmenname oder Organisationsname",
"Bio": "Bio",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/en/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "The input is not invoice Tax ID!",
"The input is not invoice title!": "The input is not invoice title!",
"The input is not valid Email!": "The input is not valid Email!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Social logins linked by the user",
"Address": "Address",
"Address - Tooltip": "Residential address",
"Address line": "Address line",
"Affiliation": "Affiliation",
"Affiliation - Tooltip": "Employer, such as company name or organization name",
"Bio": "Bio",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/es/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "¡La entrada no es el ID fiscal de la factura!",
"The input is not invoice title!": "¡El entrada no es el título de la factura!",
"The input is not valid Email!": "¡La entrada no es un correo electrónico válido!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Accesos sociales ligados por el usuario",
"Address": "Dirección",
"Address - Tooltip": "Dirección residencial",
"Address line": "Address line",
"Affiliation": "Afiliación",
"Affiliation - Tooltip": "Empleador, como el nombre de una empresa u organización",
"Bio": "Bio - Biografía",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/fa/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "The input is not invoice Tax ID!",
"The input is not invoice title!": "The input is not invoice title!",
"The input is not valid Email!": "The input is not valid Email!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Social logins linked by the user",
"Address": "Address",
"Address - Tooltip": "Residential address",
"Address line": "Address line",
"Affiliation": "Affiliation",
"Affiliation - Tooltip": "Employer, such as company name or organization name",
"Bio": "Bio",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/fi/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "The input is not invoice Tax ID!",
"The input is not invoice title!": "The input is not invoice title!",
"The input is not valid Email!": "The input is not valid Email!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Social logins linked by the user",
"Address": "Address",
"Address - Tooltip": "Residential address",
"Address line": "Address line",
"Affiliation": "Affiliation",
"Affiliation - Tooltip": "Employer, such as company name or organization name",
"Bio": "Bio",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/fr/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "L'entrée n'est pas l'identifiant fiscal de la facture !",
"The input is not invoice title!": "L'entrée n'est pas un nom ou une dénomination sociale !",
"The input is not valid Email!": "L'entrée n'est pas une adresse e-mail valide !",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Service de connexions tiers liés au compte",
"Address": "Adresse",
"Address - Tooltip": "Adresse résidentielle",
"Address line": "Address line",
"Affiliation": "Affiliation",
"Affiliation - Tooltip": "Employeur, tel que le nom de l'entreprise ou de l'organisation",
"Bio": "Bio",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/he/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "The input is not invoice Tax ID!",
"The input is not invoice title!": "The input is not invoice title!",
"The input is not valid Email!": "The input is not valid Email!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Social logins linked by the user",
"Address": "Address",
"Address - Tooltip": "Residential address",
"Address line": "Address line",
"Affiliation": "Affiliation",
"Affiliation - Tooltip": "Employer, such as company name or organization name",
"Bio": "Bio",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/id/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "Input ini bukan Tax ID faktur!",
"The input is not invoice title!": "Masukan bukan judul faktur!",
"The input is not valid Email!": "Input yang dimasukkan bukan sesuai dengan format Email yang valid!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Masuk sosial yang terhubung oleh pengguna",
"Address": "Alamat",
"Address - Tooltip": "Alamat tempat tinggal",
"Address line": "Address line",
"Affiliation": "Afiliasi",
"Affiliation - Tooltip": "Pemberi Kerja, seperti nama perusahaan atau nama organisasi",
"Bio": "Bio: Biografi",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/it/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "The input is not invoice Tax ID!",
"The input is not invoice title!": "The input is not invoice title!",
"The input is not valid Email!": "The input is not valid Email!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Social logins linked by the user",
"Address": "Address",
"Address - Tooltip": "Residential address",
"Address line": "Address line",
"Affiliation": "Affiliation",
"Affiliation - Tooltip": "Employer, such as company name or organization name",
"Bio": "Bio",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/ja/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "入力されたものは請求書の税番号ではありません!",
"The input is not invoice title!": "インプットは請求書タイトルではありません!",
"The input is not valid Email!": "入力されたものは有効なメールではありません",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "ユーザーによってリンクされたソーシャルログイン",
"Address": "住所",
"Address - Tooltip": "住所",
"Address line": "Address line",
"Affiliation": "所属",
"Affiliation - Tooltip": "企業名や団体名などの雇用主",
"Bio": "バイオ技術",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/kk/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "The input is not invoice Tax ID!",
"The input is not invoice title!": "The input is not invoice title!",
"The input is not valid Email!": "The input is not valid Email!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Social logins linked by the user",
"Address": "Address",
"Address - Tooltip": "Residential address",
"Address line": "Address line",
"Affiliation": "Affiliation",
"Affiliation - Tooltip": "Employer, such as company name or organization name",
"Bio": "Bio",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/ko/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "입력한 것은 송장 세금 ID가 아닙니다!",
"The input is not invoice title!": "입력값은 송장 제목이 아닙니다!",
"The input is not valid Email!": "입력 값은 유효한 이메일이 아닙니다!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "사용자가 연결한 소셜 로그인",
"Address": "주소",
"Address - Tooltip": "주거지 주소",
"Address line": "Address line",
"Affiliation": "소속",
"Affiliation - Tooltip": "고용주, 회사명 또는 조직명",
"Bio": "바이오",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/ms/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "The input is not invoice Tax ID!",
"The input is not invoice title!": "The input is not invoice title!",
"The input is not valid Email!": "The input is not valid Email!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Social logins linked by the user",
"Address": "Address",
"Address - Tooltip": "Residential address",
"Address line": "Address line",
"Affiliation": "Affiliation",
"Affiliation - Tooltip": "Employer, such as company name or organization name",
"Bio": "Bio",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/nl/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "The input is not invoice Tax ID!",
"The input is not invoice title!": "The input is not invoice title!",
"The input is not valid Email!": "The input is not valid Email!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Social logins linked by the user",
"Address": "Address",
"Address - Tooltip": "Residential address",
"Address line": "Address line",
"Affiliation": "Affiliation",
"Affiliation - Tooltip": "Employer, such as company name or organization name",
"Bio": "Bio",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/pl/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "The input is not invoice Tax ID!",
"The input is not invoice title!": "The input is not invoice title!",
"The input is not valid Email!": "The input is not valid Email!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Social logins linked by the user",
"Address": "Address",
"Address - Tooltip": "Residential address",
"Address line": "Address line",
"Affiliation": "Affiliation",
"Affiliation - Tooltip": "Employer, such as company name or organization name",
"Bio": "Bio",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/pt/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "A entrada não é um ID fiscal de fatura válido!",
"The input is not invoice title!": "A entrada não é um título de fatura válido!",
"The input is not valid Email!": "A entrada não é um Email válido!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Logins sociais vinculados pelo usuário",
"Address": "Endereço",
"Address - Tooltip": "Endereço residencial",
"Address line": "Address line",
"Affiliation": "Afiliação",
"Affiliation - Tooltip": "Empregador, como nome da empresa ou organização",
"Bio": "Biografia",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/ru/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "Входные данные не являются идентификатором налога по счету-фактуре!",
"The input is not invoice title!": "Входные данные не являются названием счета-фактуры!",
"The input is not valid Email!": "Ввод не является действительным адресом электронной почты!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Социальные логины, связанные пользователем",
"Address": "Адрес",
"Address - Tooltip": "Адрес проживания",
"Address line": "Address line",
"Affiliation": "Принадлежность",
"Affiliation - Tooltip": "Работодатель, такой как название компании или организации",
"Bio": "Био",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/sv/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "The input is not invoice Tax ID!",
"The input is not invoice title!": "The input is not invoice title!",
"The input is not valid Email!": "The input is not valid Email!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Social logins linked by the user",
"Address": "Address",
"Address - Tooltip": "Residential address",
"Address line": "Address line",
"Affiliation": "Affiliation",
"Affiliation - Tooltip": "Employer, such as company name or organization name",
"Bio": "Bio",
Expand Down
2 changes: 2 additions & 0 deletions web/src/locales/tr/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
"Text 3": "Text 3",
"Text 4": "Text 4",
"Text 5": "Text 5",
"The input Email doesn't match the signup item regex!": "The input Email doesn't match the signup item regex!",
"The input is not invoice Tax ID!": "The input is not invoice Tax ID!",
"The input is not invoice title!": "The input is not invoice title!",
"The input is not valid Email!": "The input is not valid Email!",
Expand Down Expand Up @@ -1074,6 +1075,7 @@
"3rd-party logins - Tooltip": "Social logins linked by the user",
"Address": "Address",
"Address - Tooltip": "Residential address",
"Address line": "Address line",
"Affiliation": "Affiliation",
"Affiliation - Tooltip": "Employer, such as company name or organization name",
"Bio": "Bio",
Expand Down
Loading

0 comments on commit bfcfb56

Please sign in to comment.