Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fluent v9 upgrade accessibility issues #3593

Open
wants to merge 12 commits into
base: feat/fluent-v9-upgrade
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import { ProfileV9 } from '../profile/Profile';
export const PersonaSignIn = (props: Partial<PersonaProps>) => {
return (
<Persona
aria-hidden={true}
presence={{ status: 'offline' }}
{...props}
/>
);
};

const SignInButton = ({signIn}: {signIn: ()=> void})=>{
const styles = useHeaderStyles()
const styles = useHeaderStyles();
return (
<Tooltip
content={translateMessage('sign in')}
Expand Down
33 changes: 20 additions & 13 deletions src/app/views/common/popups/DrawerWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
DrawerHeaderTitle,
Button,
Spinner,
makeStyles
makeStyles,
Tooltip
} from '@fluentui/react-components';
import { ArrowLeft24Regular, Dismiss24Regular } from '@fluentui/react-icons';

Expand Down Expand Up @@ -66,22 +67,28 @@ export function DrawerWrapper(props: WrapperProps) {
>
<DrawerHeader>
<DrawerHeaderTitle action={
<Button
icon={<Dismiss24Regular />}
appearance='subtle'
onClick={() => dismissPopup()}
aria-label={translateMessage('Close')}
/>

}>
{showBackButton && (
<Tooltip
content={translateMessage('Close')} relationship='label'>
<Button
icon={<ArrowLeft24Regular />}
icon={<Dismiss24Regular />}
appearance='subtle'
onClick={() => dismissPopup()}
aria-label={translateMessage('Back')}
className={drawerStyles.button}
aria-label={translateMessage('Close')}
/>
</Tooltip>
}>
{showBackButton && (
<Tooltip
content={translateMessage('Back')}
relationship='label'>
<Button
icon={<ArrowLeft24Regular />}
appearance='subtle'
onClick={() => dismissPopup()}
aria-label={translateMessage('Back')}
className={drawerStyles.button}
/>
</Tooltip>
)}
{title || ''}
</DrawerHeaderTitle>
Expand Down
3 changes: 2 additions & 1 deletion src/app/views/layout/LayoutResizeHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ export const LayoutResizeHandler = React.forwardRef<HTMLDivElement, HandleProps>
ref={ref}
onClick={handleClick}
onMouseDown={onMouseDown}
tabIndex={0}
tabIndex={-1}
className={hoverStyles}
style={{
position: 'absolute',
borderRadius: '2px',
...positioningProps
}}
aria-hidden={true}
/>
);
}
Expand Down
1 change: 1 addition & 0 deletions src/app/views/main-header/FeedbackButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const FeedbackButton = ()=>{
<>
<Tooltip content={translateMessage('Feedback')} relationship="description">
<Button
aria-label={translateMessage('Feedback')}
onClick={activateSurvey}
className={styles.iconButton} appearance="subtle" icon={<PersonFeedback20Regular />} />
</Tooltip>
Expand Down
1 change: 1 addition & 0 deletions src/app/views/main-header/Help.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const Help = ()=>{
<Tooltip content={translateMessage('Help')} relationship="description">
<MenuTrigger disableButtonEnhancement>
<Button
aria-label={translateMessage('Help')}
onClick={trackHelpButtonClickEvent}
className={styles.iconButton} appearance="subtle" icon={<ChatHelp20Regular />} />
</MenuTrigger>
Expand Down
1 change: 1 addition & 0 deletions src/app/views/main-header/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const Settings = ()=>{
<Tooltip content={translateMessage('Settings')} relationship="description">
<MenuTrigger disableButtonEnhancement>
<Button
aria-label={translateMessage('Settings')}
onClick={trackSettingsButtonClickEvent}
className={styles.iconButton} appearance="subtle" icon={<Settings20Regular />} />
</MenuTrigger>
Expand Down
36 changes: 21 additions & 15 deletions src/app/views/query-response/QueryResponse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import {
DialogSurface,
DialogTrigger,
makeStyles,
tokens
tokens,
Tooltip
} from '@fluentui/react-components';
import { DismissRegular, ExpandUpLeftRegular } from '@fluentui/react-icons';
import { useState } from 'react';
import { GetPivotItems } from './pivot-items/pivot-item';
import { translateMessage } from '../../utils/translate-messages';

const useStyles = makeStyles({
container: {
Expand Down Expand Up @@ -45,13 +47,15 @@ const PivotItemsDialog = () => {

return (
<div>
<Button
appearance='transparent'
icon={<ExpandUpLeftRegular />}
aria-label='Expand'
className={styles.dialogBtn}
onClick={() => setOpen(true)}
/>
<Tooltip content={translateMessage('Expand')} relationship='label'>
<Button
appearance='transparent'
icon={<ExpandUpLeftRegular />}
aria-label={translateMessage('Expand')}
className={styles.dialogBtn}
onClick={() => setOpen(true)}
/>
</Tooltip>
<Dialog open={open} onOpenChange={(_event, data) => setOpen(data.open)}>
<DialogSurface className={styles.dialog}>
<DialogBody>
Expand All @@ -60,13 +64,15 @@ const PivotItemsDialog = () => {
</DialogContent>
</DialogBody>
<DialogTrigger disableButtonEnhancement>
<Button
appearance='transparent'
icon={<DismissRegular />}
aria-label='Collapse'
className={styles.dismissBtn}
onClick={() => setOpen(false)}
/>
<Tooltip relationship='label' content={translateMessage('Close')}>
<Button
appearance='transparent'
icon={<DismissRegular />}
aria-label={translateMessage('Close')}
className={styles.dismissBtn}
onClick={() => setOpen(false)}
/>
</Tooltip>
</DialogTrigger>
</DialogSurface>
</Dialog>
Expand Down
5 changes: 4 additions & 1 deletion src/app/views/query-response/pivot-items/pivot-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ const useStyles = makeStyles({
height: '100%',
overflow: 'hidden'
},
tabList:{
padding: '5px 5px'
},
tabContent: {
flex: 1,
display: 'flex',
Expand Down Expand Up @@ -137,7 +140,7 @@ export const GetPivotItems = () => {
</TabList>
</Overflow>
) : (
<TabList selectedValue={selectedValue} onTabSelect={onTabSelect} size='small'>
<TabList selectedValue={selectedValue} onTabSelect={onTabSelect} size='small' className={styles.tabList}>
{tabs.map((tab) => (
<Tab key={tab.id} value={tab.id} icon={tab.icon}>
{tab.name}
Expand Down
8 changes: 7 additions & 1 deletion src/app/views/query-runner/request/RequestV9.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ const useStyles = makeStyles({
flexShrink: 0,
overflowX: 'hidden'
},
tabList: {
padding: '5px 5px'
},
tabContent: {
flex: 1,
display: 'flex',
Expand Down Expand Up @@ -142,7 +145,10 @@ const Request = (props: IRequestProps) => {
</TabList>
</Overflow>
) : (
<TabList selectedValue={selectedTab} onTabSelect={(_, data) => handleTabSelect(data.value)} size='small'>
<TabList selectedValue={selectedTab}
onTabSelect={(_, data) => handleTabSelect(data.value)}
size='small' className={styles.tabList}
>
{tabs.map((tab) => (
<Tab key={tab.id} value={tab.id} icon={tab.icon}>
{tab.name}
Expand Down
11 changes: 9 additions & 2 deletions src/app/views/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
Button, ButtonProps, makeStyles, SelectTabData, SelectTabEvent, Tab, TabList, tokens
Button, ButtonProps, makeStyles, SelectTabData, SelectTabEvent, Tab, TabList, tokens,
Tooltip
} from '@fluentui/react-components';
import {
GroupList20Regular, History20Regular, PanelLeftContract20Regular, PanelLeftExpand20Regular, Rocket20Regular
Expand Down Expand Up @@ -34,7 +35,13 @@ const SidebarToggle = (props: IShowSidebar & ButtonProps)=>{
const {show, handleShow} = props;
const PanelIcon = ()=> show ? <PanelLeftContract20Regular/>: <PanelLeftExpand20Regular/>

return <Button appearance='subtle' icon={PanelIcon()} onClick={handleShow} {...props}></Button>
return (
<Tooltip content={show? translateMessage('Minimize sidebar'): translateMessage('Maximize sidebar')}
relationship='label'>
<Button appearance='subtle' icon={PanelIcon()} onClick={handleShow} {...props}>
</Button>
</Tooltip>
)
}

interface SidebarProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ const ResourceExplorer = () => {
</Label>
<div className={resourceExplorerStyles.versioning}>
<Switch
aria-label={translateMessage('Switch to beta')}
onChange={changeVersion}
labelPosition='after'
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { formatScopeLabel, scopeOptions } from './collection.util';
import { PERMS_SCOPE } from '../../../../services/graph-constants';
import pathStyles from './Paths.styles';
import { METHOD_COLORS } from '../../sidebar-utils/SidebarUtils';
import { translateMessage } from '../../../../utils/translate-messages';

interface IPathProps {
resources: ResourcePath[];
Expand Down Expand Up @@ -79,6 +80,7 @@ const Paths: React.FC<IPathProps> = ({ resources, columns, isSelectable, onSelec
{isSelectable && (
<TableHeaderCell>
<Checkbox
aria-label={translateMessage('Select all')}
checked={allSelected}
onChange={handleSelectAllChange}
/>
Expand All @@ -95,6 +97,7 @@ const Paths: React.FC<IPathProps> = ({ resources, columns, isSelectable, onSelec
{isSelectable && (
<TableCell>
<Checkbox
aria-label={translateMessage('Select item')}
checked={selection.has(resource)}
onChange={() => handleSelectionChange(resource)}
/>
Expand Down
4 changes: 3 additions & 1 deletion src/messages/GE.json
Original file line number Diff line number Diff line change
Expand Up @@ -524,5 +524,7 @@
"Delete All Selected": "Delete All Selected",
"edit query scopes":"To edit query scopes, select the queries to update, choose a new scope from the dropdown menu, and click ",
"Save all": "Save all",
"expand resources to view details":"You can expand each resource and add specific operations into your API collection."
"expand resources to view details":"You can expand each resource and add specific operations into your API collection.",
"Select all": "Select all",
"Select item": "Select item"
}
Loading