Skip to content

Commit

Permalink
add aria label for password textfield (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
YingXue authored Feb 16, 2024
1 parent 4fa7fa8 commit b83b246
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/devices/addDevice/components/addDevice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export const AddDevice: React.FC = () => {
onChange={changePrimaryKey}
type={'password'}
canRevealPassword={true}
revealPasswordAriaLabel={t(ResourceKeys.common.revealPassword)}
errorMessage={!!primaryKey.error ? t(primaryKey.error) : ''}
description={t(ResourceKeys.deviceIdentity.authenticationType.symmetricKey.primaryKeyTooltip)}
/>
Expand All @@ -124,6 +125,7 @@ export const AddDevice: React.FC = () => {
onChange={changeSecondaryKey}
type={'password'}
canRevealPassword={true}
revealPasswordAriaLabel={t(ResourceKeys.common.revealPassword)}
errorMessage={!!secondaryKey.error ? t(secondaryKey.error) : ''}
description={t(ResourceKeys.deviceIdentity.authenticationType.symmetricKey.secondaryKeyTooltip)}
/>
Expand All @@ -142,6 +144,7 @@ export const AddDevice: React.FC = () => {
onChange={changePrimaryThumbprint}
type={'password'}
canRevealPassword={true}
revealPasswordAriaLabel={t(ResourceKeys.common.revealPassword)}
errorMessage={!!primaryKey.thumbprintError ? t(primaryKey.thumbprintError) : ''}
description={t(ResourceKeys.deviceIdentity.authenticationType.selfSigned.primaryThumbprintTooltip)}
/>
Expand All @@ -153,6 +156,7 @@ export const AddDevice: React.FC = () => {
onChange={changeSecondaryThumbprint}
type={'password'}
canRevealPassword={true}
revealPasswordAriaLabel={t(ResourceKeys.common.revealPassword)}
errorMessage={!!secondaryKey.thumbprintError ? t(secondaryKey.thumbprintError) : ''}
description={t(ResourceKeys.deviceIdentity.authenticationType.selfSigned.secondaryThumbprintTooltip)}
/>
Expand Down
8 changes: 8 additions & 0 deletions src/app/devices/deviceIdentity/components/deviceIdentity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export const DeviceIdentityInformation: React.FC<DeviceIdentityDataProps & Devic
value={state.identity.authentication.x509Thumbprint.primaryThumbprint}
type={'password'}
canRevealPassword={true}
revealPasswordAriaLabel={t(ResourceKeys.common.revealPassword)}
readOnly={true}
description={t(ResourceKeys.deviceIdentity.authenticationType.selfSigned.primaryThumbprintTooltip)}
/>
Expand All @@ -140,6 +141,7 @@ export const DeviceIdentityInformation: React.FC<DeviceIdentityDataProps & Devic
value={state.identity.authentication.x509Thumbprint.secondaryThumbprint}
type={'password'}
canRevealPassword={true}
revealPasswordAriaLabel={t(ResourceKeys.common.revealPassword)}
readOnly={true}
description={t(ResourceKeys.deviceIdentity.authenticationType.selfSigned.secondaryThumbprintTooltip)}
/>
Expand All @@ -149,6 +151,7 @@ export const DeviceIdentityInformation: React.FC<DeviceIdentityDataProps & Devic
value={generateX509ConnectionString(hostName, identity.deviceId)}
type={'password'}
canRevealPassword={true}
revealPasswordAriaLabel={t(ResourceKeys.common.revealPassword)}
readOnly={true}
description={t(ResourceKeys.deviceIdentity.authenticationType.selfSigned.connectionStringTooltip)}
/>
Expand All @@ -164,6 +167,7 @@ export const DeviceIdentityInformation: React.FC<DeviceIdentityDataProps & Devic
value={generateX509ConnectionString(hostName, identity.deviceId)}
type={'password'}
canRevealPassword={true}
revealPasswordAriaLabel={t(ResourceKeys.common.revealPassword)}
readOnly={true}
description={t(ResourceKeys.deviceIdentity.authenticationType.ca.connectionStringTooltip)}
/>
Expand All @@ -178,6 +182,7 @@ export const DeviceIdentityInformation: React.FC<DeviceIdentityDataProps & Devic
value={state.identity.authentication.symmetricKey.primaryKey}
type={'password'}
canRevealPassword={true}
revealPasswordAriaLabel={t(ResourceKeys.common.revealPassword)}
onChange={changePrimaryKey}
description={t(ResourceKeys.deviceIdentity.authenticationType.symmetricKey.primaryKeyTooltip)}
/>
Expand All @@ -188,6 +193,7 @@ export const DeviceIdentityInformation: React.FC<DeviceIdentityDataProps & Devic
value={state.identity.authentication.symmetricKey.secondaryKey}
type={'password'}
canRevealPassword={true}
revealPasswordAriaLabel={t(ResourceKeys.common.revealPassword)}
onChange={changeSecondaryKey}
description={t(ResourceKeys.deviceIdentity.authenticationType.symmetricKey.secondaryKeyTooltip)}
/>
Expand All @@ -198,6 +204,7 @@ export const DeviceIdentityInformation: React.FC<DeviceIdentityDataProps & Devic
value={generateConnectionString(hostName, identity.deviceId, identity.authentication.symmetricKey.primaryKey)}
type={'password'}
canRevealPassword={true}
revealPasswordAriaLabel={t(ResourceKeys.common.revealPassword)}
readOnly={true}
description={t(ResourceKeys.deviceIdentity.authenticationType.symmetricKey.primaryConnectionStringTooltip)}
/>
Expand All @@ -208,6 +215,7 @@ export const DeviceIdentityInformation: React.FC<DeviceIdentityDataProps & Devic
value={generateConnectionString(hostName, identity.deviceId, identity.authentication.symmetricKey.secondaryKey)}
type={'password'}
canRevealPassword={true}
revealPasswordAriaLabel={t(ResourceKeys.common.revealPassword)}
readOnly={true}
description={t(ResourceKeys.deviceIdentity.authenticationType.symmetricKey.secondaryConnectionStringTooltip)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export const AddModuleIdentity: React.FC = () => {
onChange={changePrimaryKey}
type={'password'}
canRevealPassword={true}
revealPasswordAriaLabel={t(ResourceKeys.common.revealPassword)}
errorMessage={!!primaryKey.error ? t(primaryKey.error) : ''}
description={t(ResourceKeys.moduleIdentity.authenticationType.symmetricKey.primaryKeyTooltip)}
/>
Expand All @@ -138,6 +139,7 @@ export const AddModuleIdentity: React.FC = () => {
onChange={changeSecondaryKey}
type={'password'}
canRevealPassword={true}
revealPasswordAriaLabel={t(ResourceKeys.common.revealPassword)}
errorMessage={!!secondaryKey.error ? t(secondaryKey.error) : ''}
description={t(ResourceKeys.moduleIdentity.authenticationType.symmetricKey.secondaryKeyTooltip)}
/>
Expand All @@ -156,6 +158,7 @@ export const AddModuleIdentity: React.FC = () => {
onChange={changePrimaryThumbprint}
type={'password'}
canRevealPassword={true}
revealPasswordAriaLabel={t(ResourceKeys.common.revealPassword)}
errorMessage={!!primaryKey.thumbprintError ? t(primaryKey.thumbprintError) : ''}
description={t(ResourceKeys.moduleIdentity.authenticationType.selfSigned.primaryThumbprintTooltip)}
/>
Expand All @@ -167,6 +170,7 @@ export const AddModuleIdentity: React.FC = () => {
onChange={changeSecondaryThumbprint}
type={'password'}
canRevealPassword={true}
revealPasswordAriaLabel={t(ResourceKeys.common.revealPassword)}
readOnly={false}
errorMessage={!!secondaryKey.thumbprintError ? t(secondaryKey.thumbprintError) : ''}
description={t(ResourceKeys.moduleIdentity.authenticationType.selfSigned.secondaryThumbprintTooltip)}
Expand Down
1 change: 1 addition & 0 deletions src/localization/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"home": "Home",
"learnMore": "Learn more",
"loading": "Loading...",
"revealPassword": "Show content",
"maskedCopyableTextField": {
"toggleMask": {
"label": {
Expand Down
1 change: 1 addition & 0 deletions src/localization/resourceKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export class ResourceKeys {
confirm : "common.navigation.confirm",
expand : "common.navigation.expand",
},
revealPassword : "common.revealPassword",
};
public static connectionStrings = {
addConnectionCommand : {
Expand Down

0 comments on commit b83b246

Please sign in to comment.