Skip to content

Commit

Permalink
Review id implementation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ofostier committed Jun 13, 2024
1 parent 010353f commit 3a1b9a9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/components/WifiCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ export const WifiCard = (props) => {
return !eapIdentityFieldLabel() ? '' : t('wifi.encryption.eapMethod');
};

const keyid = props.keyid || '';
const suffixKeyID = (prefix) => `${prefix}-${keyid}`;

return (
<Card
className="card-print"
Expand Down Expand Up @@ -102,7 +105,7 @@ export const WifiCard = (props) => {

<Pane width={'100%'}>
<TextareaField
id={'ssid' + (props.keyid === undefined ? '' : props.keyid)}
id={suffixKeyID('ssid')}
type="text"
marginBottom={5}
autoComplete="off"
Expand All @@ -120,9 +123,7 @@ export const WifiCard = (props) => {
{props.settings.encryptionMode === 'WPA2-EAP' && (
<>
<TextareaField
id={
'eapmethod' + (props.keyid === undefined ? '' : props.keyid)
}
id={suffixKeyID('eapmethod')}
type="text"
marginBottom={5}
readOnly={true}
Expand All @@ -132,7 +133,7 @@ export const WifiCard = (props) => {
/>

<TextareaField
id={'identity' + (props.keyid === undefined ? '' : props.keyid)}
id={suffixKeyID('identity')}
type="text"
marginBottom={5}
autoComplete="off"
Expand All @@ -152,7 +153,7 @@ export const WifiCard = (props) => {
)}
{!(props.settings.hidePassword || !props.settings.encryptionMode) && (
<TextareaField
id={'password' + (props.keyid === undefined ? '' : props.keyid)}
id={suffixKeyID('password')}
type="text"
maxLength="63"
autoComplete="off"
Expand Down

0 comments on commit 3a1b9a9

Please sign in to comment.