Skip to content

Commit

Permalink
Merge pull request #67 from microsoft/joselea/narrator
Browse files Browse the repository at this point in the history
Add aria labels to response status
  • Loading branch information
joselea committed Jun 3, 2021
2 parents 4b02023 + 9c2463b commit b1820ab
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import LocText from 'ui/LocText';
import { ILocalized, LocalizationConsumer } from 'utility/loc-context';
import TableHeader from './table/TableHeader';
import { cancelRequestAction } from 'actions/response';
import { getText, LocalizationContext } from 'utility/loc-context';

interface IConnectedProps {
response: INetConsoleResponseInternal;
Expand Down Expand Up @@ -100,6 +101,7 @@ export function ResponseViewer(props: IResponseViewerProps) {
}

function ResponseViewerWithLocale(props: IResponseViewerProps & ILocalized) {
const locale = React.useContext(LocalizationContext);
// TODO: Promote to per-request state in the Store
const [currentTab, setCurrentTab] = React.useState<ActivityState>('body');
const headerData = React.useMemo(() => {
Expand Down Expand Up @@ -175,7 +177,9 @@ function ResponseViewerWithLocale(props: IResponseViewerProps & ILocalized) {

return (
<ContainerWithStatusBar>
<div className="response-tabs" {...Styles.HEIGHT_100}>
<div className="response-tabs" {...Styles.HEIGHT_100}
aria-live='polite' role='status'
aria-label={ getText("RequestEditor.pivotTitleLabel", { locale })}>
<DesignSystemProvider designSystem={{ density: 2 }}>
<Pivot
activeId={currentTab}
Expand Down Expand Up @@ -229,7 +233,7 @@ function ResponseViewerWithLocale(props: IResponseViewerProps & ILocalized) {
function NotIssued() {
return (
<div {...Styles.NO_REQ_STYLE}>
<div>
<div aria-live='assertive'>
<LocText textKey="Response.requestNotIssuedLabel" />
</div>
</div>
Expand All @@ -244,7 +248,7 @@ function Pending({ requestId }: { requestId: string; }) {
<div>
<Progress circular style={{ transform: 'scale(2.0) translateY(-12px)' }} />
</div>
<div>
<div aria-live='assertive'>
<LocText textKey="Response.requestPendingLabel" />
</div>
{requestId && cookie && (<div>
Expand All @@ -262,7 +266,7 @@ function ErrorBelowApplication() {
<h2>
<LocText textKey="Response.requestFailedTitleLabel" />
</h2>
<p>
<p aria-live='assertive'>
<LocText textKey="Response.requestFailedDescriptionLabel" />
</p>
</div>
Expand Down

0 comments on commit b1820ab

Please sign in to comment.