Skip to content

Commit

Permalink
storage: Add aria-label for usage bars
Browse files Browse the repository at this point in the history
  • Loading branch information
marusak committed May 27, 2021
1 parent c7909bc commit 00da54e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/storaged/fsys-panel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class FilesystemsPanel extends React.Component {
{ title: mount_point || "-" },
{
title: fsys_size
? <StorageUsageBar stats={fsys_size} critical={0.95} />
? <StorageUsageBar stats={fsys_size} critical={0.95} block={block.IdLabel || block_name(block)} />
: fmt_size(block.Size)
}
]
Expand Down
2 changes: 1 addition & 1 deletion pkg/storaged/nfs-details.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ export class NFSDetails extends React.Component {
<DescriptionListTerm className="control-DescriptionListTerm">{_("Size")}</DescriptionListTerm>
<DescriptionListDescription>
{ entry.mounted
? <StorageUsageBar stats={fsys_size} critical={0.95} />
? <StorageUsageBar stats={fsys_size} critical={0.95} block={entry.fields[1]} />
: "--"
}
</DescriptionListDescription>
Expand Down
3 changes: 2 additions & 1 deletion pkg/storaged/storage-controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class StorageOnOff extends React.Component {
* in a dangerous color.
*/

export const StorageUsageBar = ({ stats, critical }) => {
export const StorageUsageBar = ({ stats, critical, block }) => {
if (!stats)
return null;

Expand All @@ -204,6 +204,7 @@ export const StorageUsageBar = ({ stats, critical }) => {
<Progress value={stats[0]} max={stats[1]}
valueText={labelText}
label={labelText}
aria-label={cockpit.format(_("Usage of $0"), block)}
variant={fraction > critical ? ProgressVariant.danger : ProgressVariant.info}
measureLocation={ProgressMeasureLocation.outside} />
);
Expand Down

0 comments on commit 00da54e

Please sign in to comment.