Attributes without a value set are not rendered in the account console (#22968)

Closes #22961
This commit is contained in:
Pedro Igor 2023-09-08 11:43:19 -03:00 committed by GitHub
parent fec6237dca
commit 4d71138f70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -197,7 +197,7 @@ export class AccountPage extends React.Component<AccountPageProps, AccountPageSt
)}
</FormGroup>
)}
{!this.isUpdateEmailFeatureEnabled && fields.email != undefined && <FormGroup
{!this.isUpdateEmailFeatureEnabled && <FormGroup
label={Msg.localize('email')}
fieldId="email-address"
helperTextInvalid={this.state.errors.email}
@ -250,58 +250,56 @@ export class AccountPage extends React.Component<AccountPageProps, AccountPageSt
}
</InputGroup>
</FormGroup> }
{ fields.firstName != undefined && <FormGroup
label={Msg.localize("firstName")}
fieldId="first-name"
helperTextInvalid={this.state.errors.firstName}
<FormGroup
label={Msg.localize("firstName")}
fieldId="first-name"
helperTextInvalid={this.state.errors.firstName}
validated={
this.state.errors.firstName !== ""
? ValidatedOptions.error
: ValidatedOptions.default
}
>
<TextInput
isRequired
type="text"
id="first-name"
name="firstName"
maxLength={254}
value={fields.firstName}
onChange={this.handleChange}
validated={
this.state.errors.firstName !== ""
? ValidatedOptions.error
: ValidatedOptions.default
}
>
<TextInput
isRequired
type="text"
id="first-name"
name="firstName"
maxLength={254}
value={fields.firstName}
onChange={this.handleChange}
validated={
this.state.errors.firstName !== ""
? ValidatedOptions.error
: ValidatedOptions.default
}
></TextInput>
</FormGroup>
}
{fields.lastName != undefined && <FormGroup
label={Msg.localize("lastName")}
fieldId="last-name"
helperTextInvalid={this.state.errors.lastName}
></TextInput>
</FormGroup>
<FormGroup
label={Msg.localize("lastName")}
fieldId="last-name"
helperTextInvalid={this.state.errors.lastName}
validated={
this.state.errors.lastName !== ""
? ValidatedOptions.error
: ValidatedOptions.default
}
>
<TextInput
isRequired
type="text"
id="last-name"
name="lastName"
maxLength={254}
value={fields.lastName}
onChange={this.handleChange}
validated={
this.state.errors.lastName !== ""
? ValidatedOptions.error
: ValidatedOptions.default
}
>
<TextInput
isRequired
type="text"
id="last-name"
name="lastName"
maxLength={254}
value={fields.lastName}
onChange={this.handleChange}
validated={
this.state.errors.lastName !== ""
? ValidatedOptions.error
: ValidatedOptions.default
}
></TextInput>
</FormGroup>
}
></TextInput>
</FormGroup>
{features.isInternationalizationEnabled && (
<FormGroup
label={Msg.localize("selectLocale")}