mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-03-26 03:29:14 +00:00
* autoscale and manual radiobuutton fixes * alt text attribute for images * Revert "alt text attribute for images" This reverts commit 5a660551c6289d475b6298f90abc9d149146772e. * alt text for decorative images * sev2 accessibilitydefects in data explorer * Revert "sev2 accessibilitydefects in data explorer" This reverts commit b84d5b572c6f127cd17033995c919867285d897e. * Sev2 accessibilitydefects * Revert "Sev2 accessibilitydefects" This reverts commit a4e60f106c43d0fe994fc9a0749b084ae427397e. * accessibilitydefects-data explorer * Accessibility sev-2 defects-2 * corrections for 2278347,2278096 and fix for 2264174 * corrections for 2278347,2278096 and fix for 2264174 * fix for defect 2276938 * wrong aria attibute used * refresh, expand, collapse tree does not have proper label for screenreader * wrong role is assigned to anchor link * Update MiddlePaneComponent.tsx * Update treeComponent.less * Update CollapsedResourceTree.tsx * Update ResourceTreeContainer.tsx * Update TableEntity.tsx * Update ResourceTreeContainer.tsx
59 lines
1.9 KiB
TypeScript
59 lines
1.9 KiB
TypeScript
import { Icon, Link, Stack, Text } from "@fluentui/react";
|
|
import React from "react";
|
|
import { useNotificationConsole } from "../../hooks/useNotificationConsole";
|
|
|
|
export interface PanelInfoErrorProps {
|
|
message: string;
|
|
messageType: string;
|
|
showErrorDetails: boolean;
|
|
link?: string;
|
|
linkText?: string;
|
|
formError?: boolean;
|
|
}
|
|
|
|
export const PanelInfoErrorComponent: React.FunctionComponent<PanelInfoErrorProps> = ({
|
|
message,
|
|
messageType,
|
|
showErrorDetails,
|
|
link,
|
|
linkText,
|
|
}: PanelInfoErrorProps): JSX.Element => {
|
|
const expandConsole = useNotificationConsole((state) => state.expandConsole);
|
|
|
|
let icon: JSX.Element = <Icon iconName="InfoSolid" className="panelLargeInfoIcon" aria-label="Infomation" />;
|
|
if (messageType === "error") {
|
|
icon = <Icon iconName="StatusErrorFull" className="panelErrorIcon" aria-label="error" />;
|
|
} else if (messageType === "warning") {
|
|
icon = <Icon iconName="WarningSolid" className="panelWarningIcon" aria-label="warning" />;
|
|
} else if (messageType === "info") {
|
|
icon = <Icon iconName="InfoSolid" className="panelLargeInfoIcon" aria-label="Infomation" />;
|
|
}
|
|
|
|
return (
|
|
<Stack className="panelInfoErrorContainer" horizontal verticalAlign="center">
|
|
{icon}
|
|
<span className="panelWarningErrorDetailsLinkContainer">
|
|
<Text
|
|
role="alert"
|
|
aria-live="assertive"
|
|
aria-label={message}
|
|
className="panelWarningErrorMessage"
|
|
variant="small"
|
|
>
|
|
{message}
|
|
{link && linkText && (
|
|
<Link target="_blank" href={link}>
|
|
{" " + linkText}
|
|
</Link>
|
|
)}
|
|
</Text>
|
|
{showErrorDetails && (
|
|
<a className="paneErrorLink" role="button" onClick={expandConsole} tabIndex={0} onKeyPress={expandConsole}>
|
|
More details
|
|
</a>
|
|
)}
|
|
</span>
|
|
</Stack>
|
|
);
|
|
};
|