mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-28 13:21:42 +00:00
Compare commits
6 Commits
defect2280
...
users/aisa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c13759f392 | ||
|
|
a526410e44 | ||
|
|
58cb85156c | ||
|
|
dd5ccade2b | ||
|
|
38ebef6c02 | ||
|
|
7ad5862e8f |
@@ -36,7 +36,7 @@ export const CollapsedResourceTree: FunctionComponent<CollapsedResourceTreeProps
|
|||||||
id="collapseToggleLeftPaneButton"
|
id="collapseToggleLeftPaneButton"
|
||||||
role="button"
|
role="button"
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
aria-label="Expand Tree"
|
aria-label={getApiShortDisplayName() + `Expand tree`}
|
||||||
onClick={toggleLeftPaneExpanded}
|
onClick={toggleLeftPaneExpanded}
|
||||||
onKeyPress={onKeyPressToggleLeftPaneExpanded}
|
onKeyPress={onKeyPressToggleLeftPaneExpanded}
|
||||||
ref={focusButton}
|
ref={focusButton}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export const ResourceTreeContainer: FunctionComponent<ResourceTreeContainerProps
|
|||||||
role="button"
|
role="button"
|
||||||
data-bind="click: onRefreshResourcesClick, clickBubble: false, event: { keypress: onRefreshDatabasesKeyPress }"
|
data-bind="click: onRefreshResourcesClick, clickBubble: false, event: { keypress: onRefreshDatabasesKeyPress }"
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
aria-label="Refresh tree"
|
aria-label={getApiShortDisplayName() + `Refresh tree`}
|
||||||
title="Refresh tree"
|
title="Refresh tree"
|
||||||
>
|
>
|
||||||
<img className="refreshcol" src={refreshImg} alt="Refresh Tree" />
|
<img className="refreshcol" src={refreshImg} alt="Refresh Tree" />
|
||||||
@@ -63,7 +63,7 @@ export const ResourceTreeContainer: FunctionComponent<ResourceTreeContainerProps
|
|||||||
onClick={toggleLeftPaneExpanded}
|
onClick={toggleLeftPaneExpanded}
|
||||||
onKeyPress={onKeyPressToggleLeftPaneExpanded}
|
onKeyPress={onKeyPressToggleLeftPaneExpanded}
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
aria-label="Collapse Tree"
|
aria-label={getApiShortDisplayName() + `Collapse Tree`}
|
||||||
title="Collapse Tree"
|
title="Collapse Tree"
|
||||||
ref={focusButton}
|
ref={focusButton}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ export const TableEntity: FunctionComponent<TableEntityProps> = ({
|
|||||||
{...imageProps}
|
{...imageProps}
|
||||||
src={EditIcon}
|
src={EditIcon}
|
||||||
alt="editEntity"
|
alt="editEntity"
|
||||||
id="editEntity"
|
|
||||||
onClick={onEditEntity}
|
onClick={onEditEntity}
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
onKeyPress={handleKeyPress}
|
onKeyPress={handleKeyPress}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ export class AccordionItemComponent extends React.Component<AccordionItemCompone
|
|||||||
<img
|
<img
|
||||||
className="expandCollapseIcon"
|
className="expandCollapseIcon"
|
||||||
src={this.state.isExpanded ? TriangleDownIcon : TriangleRightIcon}
|
src={this.state.isExpanded ? TriangleDownIcon : TriangleRightIcon}
|
||||||
alt="Hide"
|
alt={this.state.isExpanded ? `${this.props.title} hide` : `${this.props.title} expand`}
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
role="button"
|
role="button"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
import { AccessibleElement } from "../../Controls/AccessibleElement/AccessibleElement";
|
||||||
import "./TabComponent.less";
|
import "./TabComponent.less";
|
||||||
|
|
||||||
export interface TabContent {
|
export interface TabContent {
|
||||||
@@ -18,15 +19,11 @@ interface TabComponentProps {
|
|||||||
onTabIndexChange: (newIndex: number) => void;
|
onTabIndexChange: (newIndex: number) => void;
|
||||||
hideHeader: boolean;
|
hideHeader: boolean;
|
||||||
}
|
}
|
||||||
interface TabRefs {
|
|
||||||
[key: string]: HTMLElement;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We assume there's at least one tab
|
* We assume there's at least one tab
|
||||||
*/
|
*/
|
||||||
export class TabComponent extends React.Component<TabComponentProps> {
|
export class TabComponent extends React.Component<TabComponentProps> {
|
||||||
private tabRefs: TabRefs = {};
|
|
||||||
public constructor(props: TabComponentProps) {
|
public constructor(props: TabComponentProps) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
@@ -36,41 +33,11 @@ export class TabComponent extends React.Component<TabComponentProps> {
|
|||||||
throw new Error(msg);
|
throw new Error(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
state = {
|
|
||||||
activeTabIndex: this.props.currentTabIndex,
|
|
||||||
};
|
|
||||||
|
|
||||||
private setActiveTab(index: number): void {
|
private setActiveTab(index: number): void {
|
||||||
this.setState({ activeTabIndex: index });
|
this.setState({ activeTabIndex: index });
|
||||||
this.props.onTabIndexChange(index);
|
this.props.onTabIndexChange(index);
|
||||||
}
|
}
|
||||||
private setIndex = (index: number) => {
|
|
||||||
const tab = this.tabRefs[index];
|
|
||||||
if (tab) {
|
|
||||||
tab.focus();
|
|
||||||
this.setState({ activeTabIndex: index });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
private handlekeypress = (event: React.KeyboardEvent<HTMLSpanElement>): void => {
|
|
||||||
const { tabs, onTabIndexChange } = this.props;
|
|
||||||
const { activeTabIndex } = this.state;
|
|
||||||
const count = tabs.length;
|
|
||||||
|
|
||||||
const prevTab = () => {
|
|
||||||
this.setIndex((activeTabIndex - 1 + count) % count);
|
|
||||||
onTabIndexChange((activeTabIndex - 1 + count) % count);
|
|
||||||
};
|
|
||||||
const nextTab = () => {
|
|
||||||
this.setIndex((activeTabIndex + 1) % count);
|
|
||||||
onTabIndexChange((activeTabIndex + 1) % count);
|
|
||||||
};
|
|
||||||
|
|
||||||
if (event.key === "ArrowLeft") {
|
|
||||||
prevTab();
|
|
||||||
} else if (event.key === "ArrowRight") {
|
|
||||||
nextTab();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private renderTabTitles(): JSX.Element[] {
|
private renderTabTitles(): JSX.Element[] {
|
||||||
return this.props.tabs.map((tab: Tab, index: number) => {
|
return this.props.tabs.map((tab: Tab, index: number) => {
|
||||||
@@ -80,32 +47,26 @@ export class TabComponent extends React.Component<TabComponentProps> {
|
|||||||
|
|
||||||
let className = "toggleSwitch";
|
let className = "toggleSwitch";
|
||||||
let ariaselected;
|
let ariaselected;
|
||||||
let tabindex;
|
|
||||||
if (index === this.props.currentTabIndex) {
|
if (index === this.props.currentTabIndex) {
|
||||||
className += " selectedToggle";
|
className += " selectedToggle";
|
||||||
ariaselected = true;
|
ariaselected = true;
|
||||||
tabindex = 0;
|
|
||||||
} else {
|
} else {
|
||||||
className += " unselectedToggle";
|
className += " unselectedToggle";
|
||||||
ariaselected = false;
|
ariaselected = false;
|
||||||
tabindex = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="tab" key={index}>
|
<div className="tab" key={index}>
|
||||||
<span
|
<AccessibleElement
|
||||||
|
as="span"
|
||||||
className={className}
|
className={className}
|
||||||
role="tab"
|
role="tab"
|
||||||
onClick={() => this.setActiveTab(index)}
|
onActivated={() => this.setActiveTab(index)}
|
||||||
onKeyDown={(event: React.KeyboardEvent<HTMLSpanElement>) => this.handlekeypress(event)}
|
|
||||||
onFocus={() => this.setState({ activeTabIndex: index })}
|
|
||||||
aria-label={`Select tab: ${tab.title}`}
|
aria-label={`Select tab: ${tab.title}`}
|
||||||
aria-selected={ariaselected}
|
aria-selected={ariaselected}
|
||||||
tabIndex={tabindex}
|
|
||||||
ref={(element) => (this.tabRefs[index] = element)}
|
|
||||||
>
|
>
|
||||||
{tab.title}
|
{tab.title}
|
||||||
</span>
|
</AccessibleElement>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
|
|||||||
step={AutoPilotUtils.autoPilotIncrementStep}
|
step={AutoPilotUtils.autoPilotIncrementStep}
|
||||||
min={AutoPilotUtils.autoPilotThroughput1K}
|
min={AutoPilotUtils.autoPilotThroughput1K}
|
||||||
value={throughput.toString()}
|
value={throughput.toString()}
|
||||||
aria-label="Max request units per second"
|
ariaLabel={`${isDatabase ? "Database" : getCollectionName()} max RU/s`}
|
||||||
required={true}
|
required={true}
|
||||||
errorMessage={throughputError}
|
errorMessage={throughputError}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1640,7 +1640,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
</Stack>
|
</Stack>
|
||||||
<StyledTextFieldBase
|
<StyledTextFieldBase
|
||||||
aria-label="Max request units per second"
|
ariaLabel="Container max RU/s"
|
||||||
errorMessage=""
|
errorMessage=""
|
||||||
id="autoscaleRUValueField"
|
id="autoscaleRUValueField"
|
||||||
key=".0:$.2"
|
key=".0:$.2"
|
||||||
@@ -1663,7 +1663,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
|||||||
value="4000"
|
value="4000"
|
||||||
>
|
>
|
||||||
<TextFieldBase
|
<TextFieldBase
|
||||||
aria-label="Max request units per second"
|
ariaLabel="Container max RU/s"
|
||||||
deferredValidationTime={200}
|
deferredValidationTime={200}
|
||||||
errorMessage=""
|
errorMessage=""
|
||||||
id="autoscaleRUValueField"
|
id="autoscaleRUValueField"
|
||||||
@@ -1961,6 +1961,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
|||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
aria-invalid={false}
|
aria-invalid={false}
|
||||||
|
aria-label="Container max RU/s"
|
||||||
className="ms-TextField-field field-64"
|
className="ms-TextField-field field-64"
|
||||||
id="autoscaleRUValueField"
|
id="autoscaleRUValueField"
|
||||||
min={1000}
|
min={1000}
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ export class MiddlePaneComponent extends React.Component<MiddlePaneComponentProp
|
|||||||
onClick={this.props.toggleExpandGraph}
|
onClick={this.props.toggleExpandGraph}
|
||||||
role="button"
|
role="button"
|
||||||
aria-expanded={this.props.isTabsContentExpanded}
|
aria-expanded={this.props.isTabsContentExpanded}
|
||||||
aria-name="View graph in full screen"
|
aria-label={
|
||||||
|
this.props.isTabsContentExpanded ? "Collapse graph to minimized view" : "View graph in full screen"
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={this.props.isTabsContentExpanded ? CollapseArrowIcon : ExpandIcon}
|
src={this.props.isTabsContentExpanded ? CollapseArrowIcon : ExpandIcon}
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ import { Checkbox, Dropdown, IDropdownOption, Link, Stack, Text, TextField } fro
|
|||||||
import * as Constants from "Common/Constants";
|
import * as Constants from "Common/Constants";
|
||||||
import { getErrorMessage, getErrorStack } from "Common/ErrorHandlingUtils";
|
import { getErrorMessage, getErrorStack } from "Common/ErrorHandlingUtils";
|
||||||
import { InfoTooltip } from "Common/Tooltip/InfoTooltip";
|
import { InfoTooltip } from "Common/Tooltip/InfoTooltip";
|
||||||
import { useSidePanel } from "hooks/useSidePanel";
|
|
||||||
import React, { FunctionComponent, useState } from "react";
|
|
||||||
import * as SharedConstants from "Shared/Constants";
|
import * as SharedConstants from "Shared/Constants";
|
||||||
import { Action } from "Shared/Telemetry/TelemetryConstants";
|
import { Action } from "Shared/Telemetry/TelemetryConstants";
|
||||||
import * as TelemetryProcessor from "Shared/Telemetry/TelemetryProcessor";
|
import * as TelemetryProcessor from "Shared/Telemetry/TelemetryProcessor";
|
||||||
import { userContext } from "UserContext";
|
import { userContext } from "UserContext";
|
||||||
import { isServerlessAccount } from "Utils/CapabilityUtils";
|
import { isServerlessAccount } from "Utils/CapabilityUtils";
|
||||||
|
import { useSidePanel } from "hooks/useSidePanel";
|
||||||
|
import React, { FunctionComponent, useState } from "react";
|
||||||
import { ThroughputInput } from "../../Controls/ThroughputInput/ThroughputInput";
|
import { ThroughputInput } from "../../Controls/ThroughputInput/ThroughputInput";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
import { CassandraAPIDataClient } from "../../Tables/TableDataClient";
|
import { CassandraAPIDataClient } from "../../Tables/TableDataClient";
|
||||||
@@ -86,7 +86,7 @@ export const CassandraAddCollectionPane: FunctionComponent<CassandraAddCollectio
|
|||||||
: `${createKeyspaceQueryPrefix} AND cosmosdb_provisioned_throughput=${newKeySpaceThroughput};`
|
: `${createKeyspaceQueryPrefix} AND cosmosdb_provisioned_throughput=${newKeySpaceThroughput};`
|
||||||
: `${createKeyspaceQueryPrefix};`;
|
: `${createKeyspaceQueryPrefix};`;
|
||||||
let tableQuery: string;
|
let tableQuery: string;
|
||||||
const createTableQueryPrefix = `CREATE TABLE ${keyspaceId}.${tableId.trim()} ${userTableQuery}`;
|
const createTableQueryPrefix = `CREATE TABLE \"${keyspaceId}\".\"${tableId.trim()}\" ${userTableQuery}`;
|
||||||
|
|
||||||
if (tableThroughput) {
|
if (tableThroughput) {
|
||||||
if (isTableAutoscale) {
|
if (isTableAutoscale) {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export const PanelInfoErrorComponent: React.FunctionComponent<PanelInfoErrorProp
|
|||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
{showErrorDetails && (
|
{showErrorDetails && (
|
||||||
<a className="paneErrorLink" role="link" onClick={expandConsole} tabIndex={0} onKeyPress={expandConsole}>
|
<a className="paneErrorLink" role="button" onClick={expandConsole} tabIndex={0} onKeyPress={expandConsole}>
|
||||||
More details
|
More details
|
||||||
</a>
|
</a>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user