Fixed eslint-jsx-a11 issue

This commit is contained in:
sunilyadav840
2021-05-11 18:02:04 +05:30
parent ff3ea402d7
commit aae4036e80
33 changed files with 139 additions and 90 deletions

View File

@@ -34,6 +34,7 @@ module.exports = {
}, },
], ],
rules: { rules: {
"jsx-a11y/anchor-is-valid": 1,
"no-console": ["error", { allow: ["error", "warn", "dir"] }], "no-console": ["error", { allow: ["error", "warn", "dir"] }],
curly: "error", curly: "error",
"@typescript-eslint/switch-exhaustiveness-check": "error", "@typescript-eslint/switch-exhaustiveness-check": "error",

View File

@@ -40,7 +40,6 @@ export const EntityValue: FunctionComponent<TableEntityProps> = ({
<TextField <TextField
label={entityValueLabel && entityValueLabel} label={entityValueLabel && entityValueLabel}
id="entityTimeId" id="entityTimeId"
autoFocus
type="time" type="time"
value={entityTimeValue} value={entityTimeValue}
onChange={onEntityTimeValueChange} onChange={onEntityTimeValueChange}
@@ -55,7 +54,6 @@ export const EntityValue: FunctionComponent<TableEntityProps> = ({
label={entityValueLabel && entityValueLabel} label={entityValueLabel && entityValueLabel}
className="addEntityTextField" className="addEntityTextField"
id="entityValueId" id="entityValueId"
autoFocus
disabled={isEntityValueDisable} disabled={isEntityValueDisable}
type={entityValueType} type={entityValueType}
placeholder={entityValuePlaceholder} placeholder={entityValuePlaceholder}

View File

@@ -96,7 +96,6 @@ export const TableEntity: FunctionComponent<TableEntityProps> = ({
<TextField <TextField
label={entityPropertyLabel && entityPropertyLabel} label={entityPropertyLabel && entityPropertyLabel}
id="entityPropertyId" id="entityPropertyId"
autoFocus
disabled={isPropertyTypeDisable} disabled={isPropertyTypeDisable}
placeholder={entityPropertyPlaceHolder} placeholder={entityPropertyPlaceHolder}
value={entityProperty} value={entityProperty}

View File

@@ -47,7 +47,7 @@ export const Upload: FunctionComponent<UploadProps> = ({
props.onUpload(event); props.onUpload(event);
} }
}; };
const title = label + " to upload";
return ( return (
<div> <div>
<span className="renewUploadItemsHeader">{label}</span> <span className="renewUploadItemsHeader">{label}</span>
@@ -67,7 +67,7 @@ export const Upload: FunctionComponent<UploadProps> = ({
role="button" role="button"
/> />
<a href="#" id="fileImportLinkNotebook" onClick={onImportLinkClick} onKeyPress={onImportLinkKeyPress}> <a href="#" id="fileImportLinkNotebook" onClick={onImportLinkClick} onKeyPress={onImportLinkKeyPress}>
<Image className="fileImportImg" src={FolderIcon} alt={title} title={title} /> <Image className="fileImportImg" src={FolderIcon} alt={label} title={label} />
</a> </a>
</Stack> </Stack>
</div> </div>

View File

@@ -32,6 +32,9 @@
.errorLink { .errorLink {
cursor: pointer; cursor: pointer;
} }
.errorLinkColor {
color: @AccentMediumHigh;
}
} }
.paneErrorIcon { .paneErrorIcon {

View File

@@ -25,6 +25,7 @@ export class RadioSwitchComponent extends React.Component<RadioSwitchComponentPr
<div className="radioSwitchComponent"> <div className="radioSwitchComponent">
{this.props.choices.map((choice: Choice) => ( {this.props.choices.map((choice: Choice) => (
<span <span
role="button"
tabIndex={0} tabIndex={0}
key={choice.key} key={choice.key}
onClick={() => this.onSelect(choice)} onClick={() => this.onSelect(choice)}

View File

@@ -122,7 +122,7 @@ export class IndexingPolicyComponent extends React.Component<
{isDirty(this.props.indexingPolicyContent, this.props.indexingPolicyContentBaseline) && ( {isDirty(this.props.indexingPolicyContent, this.props.indexingPolicyContentBaseline) && (
<MessageBar messageBarType={MessageBarType.warning}>{indexingPolicynUnsavedWarningMessage}</MessageBar> <MessageBar messageBarType={MessageBarType.warning}>{indexingPolicynUnsavedWarningMessage}</MessageBar>
)} )}
<div className="settingsV2IndexingPolicyEditor" tabIndex={0} ref={this.indexingPolicyDiv}></div> <div className="settingsV2IndexingPolicyEditor" role="button" tabIndex={0} ref={this.indexingPolicyDiv}></div>
</Stack> </Stack>
); );
} }

View File

@@ -13,6 +13,7 @@ exports[`IndexingPolicyComponent renders 1`] = `
/> />
<div <div
className="settingsV2IndexingPolicyEditor" className="settingsV2IndexingPolicyEditor"
role="button"
tabIndex={0} tabIndex={0}
/> />
</Stack> </Stack>

View File

@@ -57,7 +57,6 @@ export class ThroughputInput extends React.Component<ThroughputInputProps, Throu
aria-label="Autoscale mode" aria-label="Autoscale mode"
checked={this.state.isAutoscaleSelected} checked={this.state.isAutoscaleSelected}
type="radio" type="radio"
role="radio"
tabIndex={0} tabIndex={0}
onChange={this.onAutoscaleRadioBtnChange.bind(this)} onChange={this.onAutoscaleRadioBtnChange.bind(this)}
/> />
@@ -68,7 +67,6 @@ export class ThroughputInput extends React.Component<ThroughputInputProps, Throu
aria-label="Manual mode" aria-label="Manual mode"
checked={!this.state.isAutoscaleSelected} checked={!this.state.isAutoscaleSelected}
type="radio" type="radio"
role="radio"
tabIndex={0} tabIndex={0}
onChange={this.onManualRadioBtnChange.bind(this)} onChange={this.onManualRadioBtnChange.bind(this)}
/> />

View File

@@ -120,6 +120,7 @@ export class NotificationConsoleComponent extends React.Component<
onClick={() => this.expandCollapseConsole()} onClick={() => this.expandCollapseConsole()}
onKeyDown={(event: React.KeyboardEvent<HTMLDivElement>) => this.onExpandCollapseKeyPress(event)} onKeyDown={(event: React.KeyboardEvent<HTMLDivElement>) => this.onExpandCollapseKeyPress(event)}
tabIndex={0} tabIndex={0}
role="button"
> >
<div className="statusBar"> <div className="statusBar">
<span className="dataTypeIcons"> <span className="dataTypeIcons">
@@ -179,7 +180,7 @@ export class NotificationConsoleComponent extends React.Component<
onKeyDown={(event: React.KeyboardEvent<HTMLSpanElement>) => this.onClearNotificationsKeyPress(event)} onKeyDown={(event: React.KeyboardEvent<HTMLSpanElement>) => this.onClearNotificationsKeyPress(event)}
tabIndex={0} tabIndex={0}
> >
<img src={ClearIcon} alt="clear notifications image" /> <img src={ClearIcon} alt="clear notifications" />
Clear Notifications Clear Notifications
</span> </span>
</div> </div>

View File

@@ -9,6 +9,7 @@ exports[`NotificationConsoleComponent renders the console 1`] = `
id="notificationConsoleHeader" id="notificationConsoleHeader"
onClick={[Function]} onClick={[Function]}
onKeyDown={[Function]} onKeyDown={[Function]}
role="button"
tabIndex={0} tabIndex={0}
> >
<div <div
@@ -150,7 +151,7 @@ exports[`NotificationConsoleComponent renders the console 1`] = `
tabIndex={0} tabIndex={0}
> >
<img <img
alt="clear notifications image" alt="clear notifications"
src="" src=""
/> />
Clear Notifications Clear Notifications
@@ -173,6 +174,7 @@ exports[`NotificationConsoleComponent renders the console 2`] = `
id="notificationConsoleHeader" id="notificationConsoleHeader"
onClick={[Function]} onClick={[Function]}
onKeyDown={[Function]} onKeyDown={[Function]}
role="button"
tabIndex={0} tabIndex={0}
> >
<div <div
@@ -316,7 +318,7 @@ exports[`NotificationConsoleComponent renders the console 2`] = `
tabIndex={0} tabIndex={0}
> >
<img <img
alt="clear notifications image" alt="clear notifications"
src="" src=""
/> />
Clear Notifications Clear Notifications

View File

@@ -139,7 +139,6 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
aria-checked={this.state.createNewDatabase} aria-checked={this.state.createNewDatabase}
name="databaseType" name="databaseType"
type="radio" type="radio"
role="radio"
id="databaseCreateNew" id="databaseCreateNew"
tabIndex={0} tabIndex={0}
onChange={this.onCreateNewDatabaseRadioBtnChange.bind(this)} onChange={this.onCreateNewDatabaseRadioBtnChange.bind(this)}
@@ -153,7 +152,6 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
aria-checked={!this.state.createNewDatabase} aria-checked={!this.state.createNewDatabase}
name="databaseType" name="databaseType"
type="radio" type="radio"
role="radio"
tabIndex={0} tabIndex={0}
onChange={this.onUseExistingDatabaseRadioBtnChange.bind(this)} onChange={this.onUseExistingDatabaseRadioBtnChange.bind(this)}
/> />
@@ -175,7 +173,6 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
size={40} size={40}
className="panelTextField" className="panelTextField"
aria-label="New database id" aria-label="New database id"
autoFocus
value={this.state.newDatabaseId} value={this.state.newDatabaseId}
onChange={(event: React.ChangeEvent<HTMLInputElement>) => onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
this.setState({ newDatabaseId: event.target.value }) this.setState({ newDatabaseId: event.target.value })
@@ -287,7 +284,6 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
aria-label="Turn on indexing" aria-label="Turn on indexing"
aria-checked={this.state.enableIndexing} aria-checked={this.state.enableIndexing}
type="radio" type="radio"
role="radio"
tabIndex={0} tabIndex={0}
onChange={this.onTurnOnIndexing.bind(this)} onChange={this.onTurnOnIndexing.bind(this)}
/> />
@@ -299,7 +295,6 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
aria-label="Turn off indexing" aria-label="Turn off indexing"
aria-checked={!this.state.enableIndexing} aria-checked={!this.state.enableIndexing}
type="radio" type="radio"
role="radio"
tabIndex={0} tabIndex={0}
onChange={this.onTurnOffIndexing.bind(this)} onChange={this.onTurnOffIndexing.bind(this)}
/> />
@@ -342,7 +337,6 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
aria-checked={!this.state.isSharded} aria-checked={!this.state.isSharded}
name="unsharded" name="unsharded"
type="radio" type="radio"
role="radio"
id="unshardedOption" id="unshardedOption"
tabIndex={0} tabIndex={0}
onChange={this.onUnshardedRadioBtnChange.bind(this)} onChange={this.onUnshardedRadioBtnChange.bind(this)}
@@ -356,7 +350,6 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
aria-checked={this.state.isSharded} aria-checked={this.state.isSharded}
name="sharded" name="sharded"
type="radio" type="radio"
role="radio"
id="shardedOption" id="shardedOption"
tabIndex={0} tabIndex={0}
onChange={this.onShardedRadioBtnChange.bind(this)} onChange={this.onShardedRadioBtnChange.bind(this)}
@@ -480,7 +473,6 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
: "Comma separated paths e.g. /firstName,/address/zipCode" : "Comma separated paths e.g. /firstName,/address/zipCode"
} }
className="panelTextField" className="panelTextField"
autoFocus
value={uniqueKey} value={uniqueKey}
onChange={(event: React.ChangeEvent<HTMLInputElement>) => { onChange={(event: React.ChangeEvent<HTMLInputElement>) => {
const uniqueKeys = this.state.uniqueKeys.map((uniqueKey: string, j: number) => { const uniqueKeys = this.state.uniqueKeys.map((uniqueKey: string, j: number) => {
@@ -594,7 +586,6 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
aria-checked={this.state.enableAnalyticalStore} aria-checked={this.state.enableAnalyticalStore}
name="analyticalStore" name="analyticalStore"
type="radio" type="radio"
role="radio"
id="enableAnalyticalStoreBtn" id="enableAnalyticalStoreBtn"
tabIndex={0} tabIndex={0}
onChange={this.onEnableAnalyticalStoreRadioBtnChange.bind(this)} onChange={this.onEnableAnalyticalStoreRadioBtnChange.bind(this)}
@@ -609,7 +600,6 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
aria-checked={!this.state.enableAnalyticalStore} aria-checked={!this.state.enableAnalyticalStore}
name="analyticalStore" name="analyticalStore"
type="radio" type="radio"
role="radio"
id="disableAnalyticalStoreBtn" id="disableAnalyticalStoreBtn"
tabIndex={0} tabIndex={0}
onChange={this.onDisableAnalyticalStoreRadioBtnChange.bind(this)} onChange={this.onDisableAnalyticalStoreRadioBtnChange.bind(this)}

View File

@@ -120,7 +120,6 @@ export const DeleteCollectionConfirmationPane: FunctionComponent<DeleteCollectio
<Text variant="small">Confirm by typing the {collectionName.toLowerCase()} id</Text> <Text variant="small">Confirm by typing the {collectionName.toLowerCase()} id</Text>
<TextField <TextField
id="confirmCollectionId" id="confirmCollectionId"
autoFocus
value={inputCollectionName} value={inputCollectionName}
styles={{ fieldGroup: { width: 300 } }} styles={{ fieldGroup: { width: 300 } }}
onChange={(event, newInput?: string) => { onChange={(event, newInput?: string) => {

View File

@@ -28,21 +28,27 @@ exports[`Delete Collection Confirmation Pane submit() should call delete collect
> >
<div <div
onKeyDown={[Function]} onKeyDown={[Function]}
role="button"
tabIndex={-1} tabIndex={-1}
> >
<div <div
className="contextual-pane-out" className="contextual-pane-out"
onClick={[Function]} onClick={[Function]}
onKeyDown={[Function]}
role="button"
tabIndex={0}
/> />
<div <div
className="contextual-pane" className="contextual-pane"
id="deleteCollectionpane" id="deleteCollectionpane"
onKeyDown={[Function]} onKeyDown={[Function]}
role="button"
style={ style={
Object { Object {
"height": NaN, "height": NaN,
} }
} }
tabIndex={0}
> >
<div <div
className="panelContentWrapper" className="panelContentWrapper"
@@ -1161,14 +1167,16 @@ exports[`Delete Collection Confirmation Pane submit() should call delete collect
className="formErrors" className="formErrors"
title="" title=""
/> />
<a <div
className="errorLink" className="errorLink errorLinkColor"
hidden={true} hidden={true}
onClick={[Function]} onClick={[Function]}
onKeyDown={[Function]}
role="link" role="link"
tabIndex={0}
> >
More details More details
</a> </div>
</span> </span>
</div> </div>
</div> </div>
@@ -1198,7 +1206,6 @@ exports[`Delete Collection Confirmation Pane submit() should call delete collect
</span> </span>
</Text> </Text>
<StyledTextFieldBase <StyledTextFieldBase
autoFocus={true}
id="confirmCollectionId" id="confirmCollectionId"
onChange={[Function]} onChange={[Function]}
styles={ styles={
@@ -1211,7 +1218,6 @@ exports[`Delete Collection Confirmation Pane submit() should call delete collect
value="" value=""
> >
<TextFieldBase <TextFieldBase
autoFocus={true}
deferredValidationTime={200} deferredValidationTime={200}
id="confirmCollectionId" id="confirmCollectionId"
onChange={[Function]} onChange={[Function]}
@@ -1504,7 +1510,6 @@ exports[`Delete Collection Confirmation Pane submit() should call delete collect
> >
<input <input
aria-invalid={false} aria-invalid={false}
autoFocus={true}
className="ms-TextField-field field-215" className="ms-TextField-field field-215"
id="confirmCollectionId" id="confirmCollectionId"
onBlur={[Function]} onBlur={[Function]}
@@ -3664,6 +3669,7 @@ exports[`Delete Collection Confirmation Pane submit() should call delete collect
hidden={true} hidden={true}
> >
<img <img
alt="Loader img"
className="dataExplorerLoader" className="dataExplorerLoader"
src="" src=""
/> />

View File

@@ -1,5 +1,5 @@
import { useBoolean } from "@fluentui/react-hooks";
import { Text, TextField } from "@fluentui/react"; import { Text, TextField } from "@fluentui/react";
import { useBoolean } from "@fluentui/react-hooks";
import React, { FunctionComponent, useState } from "react"; import React, { FunctionComponent, useState } from "react";
import { Areas } from "../../Common/Constants"; import { Areas } from "../../Common/Constants";
import { deleteDatabase } from "../../Common/dataAccess/deleteDatabase"; import { deleteDatabase } from "../../Common/dataAccess/deleteDatabase";
@@ -134,7 +134,6 @@ export const DeleteDatabaseConfirmationPanel: FunctionComponent<DeleteDatabaseCo
<Text variant="small">Confirm by typing the database id</Text> <Text variant="small">Confirm by typing the database id</Text>
<TextField <TextField
id="confirmDatabaseId" id="confirmDatabaseId"
autoFocus
styles={{ fieldGroup: { width: 300 } }} styles={{ fieldGroup: { width: 300 } }}
onChange={(event, newInput?: string) => { onChange={(event, newInput?: string) => {
setDatabaseInput(newInput); setDatabaseInput(newInput);

View File

@@ -63,7 +63,6 @@ export const InputParameter: FunctionComponent<InputParameterProps> = ({
<TextField <TextField
label={inputLabel && inputLabel} label={inputLabel && inputLabel}
id="confirmCollectionId" id="confirmCollectionId"
autoFocus
value={paramValue} value={paramValue}
onChange={onParamValueChange} onChange={onParamValueChange}
/> />

View File

@@ -19,21 +19,27 @@ exports[`Excute Sproc Param Pane should render Default properly 1`] = `
> >
<div <div
onKeyDown={[Function]} onKeyDown={[Function]}
role="button"
tabIndex={-1} tabIndex={-1}
> >
<div <div
className="contextual-pane-out" className="contextual-pane-out"
onClick={[Function]} onClick={[Function]}
onKeyDown={[Function]}
role="button"
tabIndex={0}
/> />
<div <div
className="contextual-pane" className="contextual-pane"
id="executesprocparamspane" id="executesprocparamspane"
onKeyDown={[Function]} onKeyDown={[Function]}
role="button"
style={ style={
Object { Object {
"height": NaN, "height": NaN,
} }
} }
tabIndex={0}
> >
<div <div
className="panelContentWrapper" className="panelContentWrapper"
@@ -1152,14 +1158,16 @@ exports[`Excute Sproc Param Pane should render Default properly 1`] = `
className="formErrors" className="formErrors"
title="" title=""
/> />
<a <div
className="errorLink" className="errorLink errorLinkColor"
hidden={true} hidden={true}
onClick={[Function]} onClick={[Function]}
onKeyDown={[Function]}
role="link" role="link"
tabIndex={0}
> >
More details More details
</a> </div>
</span> </span>
</div> </div>
</div> </div>
@@ -2709,14 +2717,12 @@ exports[`Excute Sproc Param Pane should render Default properly 1`] = `
</DropdownBase> </DropdownBase>
</Dropdown> </Dropdown>
<StyledTextFieldBase <StyledTextFieldBase
autoFocus={true}
id="confirmCollectionId" id="confirmCollectionId"
key=".0:$.1" key=".0:$.1"
label="Value" label="Value"
onChange={[Function]} onChange={[Function]}
> >
<TextFieldBase <TextFieldBase
autoFocus={true}
deferredValidationTime={200} deferredValidationTime={200}
id="confirmCollectionId" id="confirmCollectionId"
label="Value" label="Value"
@@ -3302,7 +3308,6 @@ exports[`Excute Sproc Param Pane should render Default properly 1`] = `
<input <input
aria-invalid={false} aria-invalid={false}
aria-labelledby="TextFieldLabel6" aria-labelledby="TextFieldLabel6"
autoFocus={true}
className="ms-TextField-field field-85" className="ms-TextField-field field-85"
id="confirmCollectionId" id="confirmCollectionId"
onBlur={[Function]} onBlur={[Function]}
@@ -4864,7 +4869,6 @@ exports[`Excute Sproc Param Pane should render Default properly 1`] = `
</DropdownBase> </DropdownBase>
</Dropdown> </Dropdown>
<StyledTextFieldBase <StyledTextFieldBase
autoFocus={true}
id="confirmCollectionId" id="confirmCollectionId"
key=".0:$.1" key=".0:$.1"
label="Param" label="Param"
@@ -4872,7 +4876,6 @@ exports[`Excute Sproc Param Pane should render Default properly 1`] = `
value="" value=""
> >
<TextFieldBase <TextFieldBase
autoFocus={true}
deferredValidationTime={200} deferredValidationTime={200}
id="confirmCollectionId" id="confirmCollectionId"
label="Param" label="Param"
@@ -5459,7 +5462,6 @@ exports[`Excute Sproc Param Pane should render Default properly 1`] = `
<input <input
aria-invalid={false} aria-invalid={false}
aria-labelledby="TextFieldLabel10" aria-labelledby="TextFieldLabel10"
autoFocus={true}
className="ms-TextField-field field-85" className="ms-TextField-field field-85"
id="confirmCollectionId" id="confirmCollectionId"
onBlur={[Function]} onBlur={[Function]}
@@ -8227,6 +8229,7 @@ exports[`Excute Sproc Param Pane should render Default properly 1`] = `
hidden={true} hidden={true}
> >
<img <img
alt="Loader img"
className="dataExplorerLoader" className="dataExplorerLoader"
src="" src=""
/> />

View File

@@ -67,9 +67,16 @@ export const GenericRightPaneComponent: FunctionComponent<GenericRightPaneProps>
<span className="formErrors" title={formError}> <span className="formErrors" title={formError}>
{formError} {formError}
</span> </span>
<a className="errorLink" role="link" hidden={!formErrorDetail} onClick={expandConsole}> <div
className="errorLink errorLinkColor"
role="link"
hidden={!formErrorDetail}
onClick={expandConsole}
tabIndex={0}
onKeyDown={expandConsole}
>
More details More details
</a> </div>
</span> </span>
</div> </div>
</div> </div>
@@ -97,7 +104,7 @@ export const GenericRightPaneComponent: FunctionComponent<GenericRightPaneProps>
const renderLoadingScreen = (): JSX.Element => { const renderLoadingScreen = (): JSX.Element => {
return ( return (
<div className="dataExplorerLoaderContainer dataExplorerPaneLoaderContainer" hidden={!isExecuting}> <div className="dataExplorerLoaderContainer dataExplorerPaneLoaderContainer" hidden={!isExecuting}>
<img className="dataExplorerLoader" src={LoadingIndicatorIcon} /> <img className="dataExplorerLoader" src={LoadingIndicatorIcon} alt="Loader img" />
</div> </div>
); );
}; };
@@ -110,9 +117,16 @@ export const GenericRightPaneComponent: FunctionComponent<GenericRightPaneProps>
}; };
return ( return (
<div tabIndex={-1} onKeyDown={onKeyDown}> <div tabIndex={-1} onKeyDown={onKeyDown} role="button">
<div className="contextual-pane-out" onClick={onClose}></div> <div className="contextual-pane-out" onClick={onClose} role="button" tabIndex={0} onKeyDown={onClose}></div>
<div className="contextual-pane" id={id} style={{ height: panelHeight }} onKeyDown={onKeyDown}> <div
className="contextual-pane"
id={id}
style={{ height: panelHeight }}
onKeyDown={onKeyDown}
role="button"
tabIndex={0}
>
<div className="panelContentWrapper"> <div className="panelContentWrapper">
{renderPanelHeader()} {renderPanelHeader()}
{renderErrorSection()} {renderErrorSection()}

View File

@@ -1,5 +1,5 @@
import { useBoolean } from "@fluentui/react-hooks";
import { IImageProps, Image, ImageFit, Stack, TextField } from "@fluentui/react"; import { IImageProps, Image, ImageFit, Stack, TextField } from "@fluentui/react";
import { useBoolean } from "@fluentui/react-hooks";
import React, { FunctionComponent, useState } from "react"; import React, { FunctionComponent, useState } from "react";
import folderIcon from "../../../../images/folder_16x16.svg"; import folderIcon from "../../../../images/folder_16x16.svg";
import { logError } from "../../../Common/Logger"; import { logError } from "../../../Common/Logger";
@@ -115,7 +115,6 @@ export const LoadQueryPane: FunctionComponent<LoadQueryPaneProps> = ({
id="confirmCollectionId" id="confirmCollectionId"
label="Select a query document" label="Select a query document"
value={selectedFileName} value={selectedFileName}
autoFocus
readOnly readOnly
styles={{ fieldGroup: { width: 300 } }} styles={{ fieldGroup: { width: 300 } }}
/> />

View File

@@ -22,7 +22,6 @@ exports[`Load Query Pane should render Default properly 1`] = `
horizontal={true} horizontal={true}
> >
<StyledTextFieldBase <StyledTextFieldBase
autoFocus={true}
id="confirmCollectionId" id="confirmCollectionId"
label="Select a query document" label="Select a query document"
readOnly={true} readOnly={true}

View File

@@ -89,6 +89,7 @@
.paneErrorLink { .paneErrorLink {
cursor: pointer; cursor: pointer;
font-size: @mediumFontSize; font-size: @mediumFontSize;
color: @AccentMediumHigh;
} }
} }
} }

View File

@@ -43,9 +43,15 @@ export const PanelInfoErrorComponent: React.FunctionComponent<PanelInfoErrorProp
)} )}
</Text> </Text>
{showErrorDetails && ( {showErrorDetails && (
<a className="paneErrorLink" role="link" onClick={openNotificationConsole}> <div
className="paneErrorLink"
role="link"
onClick={openNotificationConsole}
tabIndex={0}
onKeyDown={openNotificationConsole}
>
More details More details
</a> </div>
)} )}
</span> </span>
</Stack> </Stack>

View File

@@ -3,6 +3,6 @@ import LoadingIndicator_3Squares from "../../../images/LoadingIndicator_3Squares
export const PanelLoadingScreen: React.FunctionComponent = () => ( export const PanelLoadingScreen: React.FunctionComponent = () => (
<div className="dataExplorerLoaderContainer dataExplorerPaneLoaderContainer"> <div className="dataExplorerLoaderContainer dataExplorerPaneLoaderContainer">
<img className="dataExplorerLoader" src={LoadingIndicator_3Squares} /> <img className="dataExplorerLoader" src={LoadingIndicator_3Squares} alt="Loader" />
</div> </div>
); );

View File

@@ -78,9 +78,16 @@ export const RightPaneForm: FunctionComponent<RightPaneFormProps> = ({
}; };
return ( return (
<div tabIndex={-1} onKeyDown={onKeyDown}> <div tabIndex={-1} onKeyDown={onKeyDown} role="button">
<div className="contextual-pane-out" onClick={onClose}></div> <div className="contextual-pane-out" onClick={onClose} role="button" tabIndex={0} onKeyDown={onClose}></div>
<div className="contextual-pane" id={id} style={{ height: panelHeight }} onKeyDown={onKeyDown}> <div
className="contextual-pane"
id={id}
style={{ height: panelHeight }}
onKeyDown={onKeyDown}
role="button"
tabIndex={0}
>
<div className="panelContentWrapper"> <div className="panelContentWrapper">
{renderPanelHeader()} {renderPanelHeader()}
<PanelInfoErrorComponent {...panelInfoErrorProps} /> <PanelInfoErrorComponent {...panelInfoErrorProps} />

View File

@@ -15,21 +15,27 @@ exports[`Load Query Pane should render Default properly 1`] = `
> >
<div <div
onKeyDown={[Function]} onKeyDown={[Function]}
role="button"
tabIndex={-1} tabIndex={-1}
> >
<div <div
className="contextual-pane-out" className="contextual-pane-out"
onClick={[MockFunction]} onClick={[MockFunction]}
onKeyDown={[MockFunction]}
role="button"
tabIndex={0}
/> />
<div <div
className="contextual-pane" className="contextual-pane"
id="loadQueryPane" id="loadQueryPane"
onKeyDown={[Function]} onKeyDown={[Function]}
role="button"
style={ style={
Object { Object {
"height": NaN, "height": NaN,
} }
} }
tabIndex={0}
> >
<div <div
className="panelContentWrapper" className="panelContentWrapper"

View File

@@ -109,7 +109,6 @@ export const StringInputPane: FunctionComponent<StringInputPanelProps> = ({
label={inputLabel} label={inputLabel}
name="collectionIdConfirmation" name="collectionIdConfirmation"
value={stringInput} value={stringInput}
autoFocus
required required
onChange={(event: FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string) => onChange={(event: FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string) =>
setStringInput(newValue) setStringInput(newValue)

View File

@@ -1294,21 +1294,27 @@ exports[`StringInput Pane should render Create new directory properly 1`] = `
> >
<div <div
onKeyDown={[Function]} onKeyDown={[Function]}
role="button"
tabIndex={-1} tabIndex={-1}
> >
<div <div
className="contextual-pane-out" className="contextual-pane-out"
onClick={[Function]} onClick={[Function]}
onKeyDown={[Function]}
role="button"
tabIndex={0}
/> />
<div <div
className="contextual-pane" className="contextual-pane"
id="stringInputPane" id="stringInputPane"
onKeyDown={[Function]} onKeyDown={[Function]}
role="button"
style={ style={
Object { Object {
"height": NaN, "height": NaN,
} }
} }
tabIndex={0}
> >
<div <div
className="panelContentWrapper" className="panelContentWrapper"
@@ -2427,14 +2433,16 @@ exports[`StringInput Pane should render Create new directory properly 1`] = `
className="formErrors" className="formErrors"
title="" title=""
/> />
<a <div
className="errorLink" className="errorLink errorLinkColor"
hidden={true} hidden={true}
onClick={[Function]} onClick={[Function]}
onKeyDown={[Function]}
role="link" role="link"
tabIndex={0}
> >
More details More details
</a> </div>
</span> </span>
</div> </div>
</div> </div>
@@ -2443,7 +2451,6 @@ exports[`StringInput Pane should render Create new directory properly 1`] = `
> >
<StyledTextFieldBase <StyledTextFieldBase
aria-label="Enter new directory name" aria-label="Enter new directory name"
autoFocus={true}
label="Enter new directory name" label="Enter new directory name"
name="collectionIdConfirmation" name="collectionIdConfirmation"
onChange={[Function]} onChange={[Function]}
@@ -2452,7 +2459,6 @@ exports[`StringInput Pane should render Create new directory properly 1`] = `
> >
<TextFieldBase <TextFieldBase
aria-label="Enter new directory name" aria-label="Enter new directory name"
autoFocus={true}
deferredValidationTime={200} deferredValidationTime={200}
label="Enter new directory name" label="Enter new directory name"
name="collectionIdConfirmation" name="collectionIdConfirmation"
@@ -3042,7 +3048,6 @@ exports[`StringInput Pane should render Create new directory properly 1`] = `
<input <input
aria-invalid={false} aria-invalid={false}
aria-labelledby="TextFieldLabel5" aria-labelledby="TextFieldLabel5"
autoFocus={true}
className="ms-TextField-field field-165" className="ms-TextField-field field-165"
id="TextField3" id="TextField3"
name="collectionIdConfirmation" name="collectionIdConfirmation"
@@ -4853,6 +4858,7 @@ exports[`StringInput Pane should render Create new directory properly 1`] = `
hidden={true} hidden={true}
> >
<img <img
alt="Loader img"
className="dataExplorerLoader" className="dataExplorerLoader"
src="" src=""
/> />

View File

@@ -23,21 +23,27 @@ exports[`Table query select Panel should render Default properly 1`] = `
> >
<div <div
onKeyDown={[Function]} onKeyDown={[Function]}
role="button"
tabIndex={-1} tabIndex={-1}
> >
<div <div
className="contextual-pane-out" className="contextual-pane-out"
onClick={[Function]} onClick={[Function]}
onKeyDown={[Function]}
role="button"
tabIndex={0}
/> />
<div <div
className="contextual-pane" className="contextual-pane"
id="querySelectPane" id="querySelectPane"
onKeyDown={[Function]} onKeyDown={[Function]}
role="button"
style={ style={
Object { Object {
"height": NaN, "height": NaN,
} }
} }
tabIndex={0}
> >
<div <div
className="panelContentWrapper" className="panelContentWrapper"
@@ -1156,14 +1162,16 @@ exports[`Table query select Panel should render Default properly 1`] = `
className="formErrors" className="formErrors"
title="" title=""
/> />
<a <div
className="errorLink" className="errorLink errorLinkColor"
hidden={true} hidden={true}
onClick={[Function]} onClick={[Function]}
onKeyDown={[Function]}
role="link" role="link"
tabIndex={0}
> >
More details More details
</a> </div>
</span> </span>
</div> </div>
</div> </div>
@@ -4194,6 +4202,7 @@ exports[`Table query select Panel should render Default properly 1`] = `
hidden={true} hidden={true}
> >
<img <img
alt="Loader img"
className="dataExplorerLoader" className="dataExplorerLoader"
src="" src=""
/> />

View File

@@ -1629,7 +1629,6 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database
</span> </span>
</Text> </Text>
<StyledTextFieldBase <StyledTextFieldBase
autoFocus={true}
id="confirmDatabaseId" id="confirmDatabaseId"
onChange={[Function]} onChange={[Function]}
styles={ styles={
@@ -1641,7 +1640,6 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database
} }
> >
<TextFieldBase <TextFieldBase
autoFocus={true}
deferredValidationTime={200} deferredValidationTime={200}
id="confirmDatabaseId" id="confirmDatabaseId"
onChange={[Function]} onChange={[Function]}
@@ -1933,7 +1931,6 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database
> >
<input <input
aria-invalid={false} aria-invalid={false}
autoFocus={true}
className="ms-TextField-field field-209" className="ms-TextField-field field-209"
id="confirmDatabaseId" id="confirmDatabaseId"
onBlur={[Function]} onBlur={[Function]}

View File

@@ -42,6 +42,7 @@ function TabNav({ tab, active }: { tab: Tab; active: boolean }) {
aria-controls={tab.tabId} aria-controls={tab.tabId}
tabIndex={0} tabIndex={0}
role="tab" role="tab"
onFocus={() => setHovering(true)}
> >
<span className="tabNavContentContainer"> <span className="tabNavContentContainer">
<a data-toggle="tab" href={"#" + tab.tabId} tabIndex={-1}> <a data-toggle="tab" href={"#" + tab.tabId} tabIndex={-1}>

View File

@@ -1,24 +1,24 @@
import { useBoolean } from "@fluentui/react-hooks";
import { initializeIcons } from "@fluentui/react"; import { initializeIcons } from "@fluentui/react";
import { useBoolean } from "@fluentui/react-hooks";
import * as React from "react"; import * as React from "react";
import { render } from "react-dom"; import { render } from "react-dom";
import ChevronRight from "../images/chevron-right.svg"; import ChevronRight from "../images/chevron-right.svg";
import "../less/hostedexplorer.less"; import "../less/hostedexplorer.less";
import { AuthType } from "./AuthType"; import { AuthType } from "./AuthType";
import { ConnectExplorer } from "./Platform/Hosted/Components/ConnectExplorer";
import { DatabaseAccount } from "./Contracts/DataModels"; import { DatabaseAccount } from "./Contracts/DataModels";
import { DirectoryPickerPanel } from "./Platform/Hosted/Components/DirectoryPickerPanel";
import { AccountSwitcher } from "./Platform/Hosted/Components/AccountSwitcher";
import "./Explorer/Menus/NavBar/MeControlComponent.less"; import "./Explorer/Menus/NavBar/MeControlComponent.less";
import { useTokenMetadata } from "./hooks/usePortalAccessToken";
import { MeControl } from "./Platform/Hosted/Components/MeControl";
import "./Platform/Hosted/ConnectScreen.less";
import "./Shared/appInsights";
import { SignInButton } from "./Platform/Hosted/Components/SignInButton";
import { useAADAuth } from "./hooks/useAADAuth"; import { useAADAuth } from "./hooks/useAADAuth";
import { FeedbackCommandButton } from "./Platform/Hosted/Components/FeedbackCommandButton"; import { useTokenMetadata } from "./hooks/usePortalAccessToken";
import { HostedExplorerChildFrame } from "./HostedExplorerChildFrame"; import { HostedExplorerChildFrame } from "./HostedExplorerChildFrame";
import { AccountSwitcher } from "./Platform/Hosted/Components/AccountSwitcher";
import { ConnectExplorer } from "./Platform/Hosted/Components/ConnectExplorer";
import { DirectoryPickerPanel } from "./Platform/Hosted/Components/DirectoryPickerPanel";
import { FeedbackCommandButton } from "./Platform/Hosted/Components/FeedbackCommandButton";
import { MeControl } from "./Platform/Hosted/Components/MeControl";
import { SignInButton } from "./Platform/Hosted/Components/SignInButton";
import "./Platform/Hosted/ConnectScreen.less";
import { extractMasterKeyfromConnectionString } from "./Platform/Hosted/HostedUtils"; import { extractMasterKeyfromConnectionString } from "./Platform/Hosted/HostedUtils";
import "./Shared/appInsights";
initializeIcons(); initializeIcons();
@@ -86,8 +86,10 @@ const App: React.FunctionComponent = () => {
<span <span
className="title" className="title"
onClick={() => window.open("https://portal.azure.com", "_blank")} onClick={() => window.open("https://portal.azure.com", "_blank")}
tabIndex={0}
title="Go to Azure Portal" title="Go to Azure Portal"
onKeyDown={() => window.open("https://portal.azure.com", "_blank")}
role="button"
tabIndex={0}
> >
Microsoft Azure Microsoft Azure
</span> </span>

View File

@@ -131,7 +131,12 @@ const App: React.FunctionComponent = () => {
aria-label="Refresh tree" aria-label="Refresh tree"
title="Refresh tree" title="Refresh tree"
> >
<img className="refreshcol" src={refreshImg} data-bind="attr: { alt: refreshTreeTitle }" /> <img
className="refreshcol"
src={refreshImg}
data-bind="attr: { alt: refreshTreeTitle }"
alt="Refresh"
/>
</span> </span>
<span <span
className="padimgcolrefresh1" className="padimgcolrefresh1"
@@ -169,9 +174,7 @@ const App: React.FunctionComponent = () => {
<li <li
className="resourceTreeCollapse" className="resourceTreeCollapse"
id="collapseToggleLeftPaneButton" id="collapseToggleLeftPaneButton"
role="button"
data-bind="event: { keypress: toggleLeftPaneExpandedKeyPress }" data-bind="event: { keypress: toggleLeftPaneExpandedKeyPress }"
tabIndex={0}
aria-label="Expand Tree" aria-label="Expand Tree"
> >
<span <span

View File

@@ -1,9 +1,9 @@
import * as React from "react";
import { useBoolean } from "@fluentui/react-hooks"; import { useBoolean } from "@fluentui/react-hooks";
import { HttpHeaders } from "../../../Common/Constants"; import * as React from "react";
import { GenerateTokenResponse } from "../../../Contracts/DataModels";
import { configContext } from "../../../ConfigContext";
import { AuthType } from "../../../AuthType"; import { AuthType } from "../../../AuthType";
import { HttpHeaders } from "../../../Common/Constants";
import { configContext } from "../../../ConfigContext";
import { GenerateTokenResponse } from "../../../Contracts/DataModels";
import { isResourceTokenConnectionString } from "../Helpers/ResourceTokenUtils"; import { isResourceTokenConnectionString } from "../Helpers/ResourceTokenUtils";
interface Props { interface Props {
@@ -75,16 +75,16 @@ export const ConnectExplorer: React.FunctionComponent<Props> = ({
<p className="connectExplorerContent"> <p className="connectExplorerContent">
<input className="filterbtnstyle" type="submit" value="Connect" /> <input className="filterbtnstyle" type="submit" value="Connect" />
</p> </p>
<p className="switchConnectTypeText" onClick={login}> <div className="switchConnectTypeText" onClick={login} onKeyDown={login} role="button" tabIndex={0}>
Sign In with Azure Account Sign In with Azure Account
</p> </div>
</form> </form>
) : ( ) : (
<div id="connectWithAad"> <div id="connectWithAad">
<input className="filterbtnstyle" type="button" value="Sign In" onClick={login} /> <input className="filterbtnstyle" type="button" value="Sign In" onClick={login} />
<p className="switchConnectTypeText" onClick={showForm}> <div className="switchConnectTypeText" onClick={showForm} onKeyDown={showForm} role="button" tabIndex={0}>
Connect to your account with connection string Connect to your account with connection string
</p> </div>
</div> </div>
)} )}
</div> </div>