mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-25 15:06:55 +00:00
parent
babda4d9cb
commit
9a1e8b2d87
@ -11,8 +11,8 @@ import ErrorBlackIcon from "../../../../images/error_black.svg";
|
||||
import infoBubbleIcon from "../../../../images/info-bubble-9x9.svg";
|
||||
import InfoIcon from "../../../../images/info_color.svg";
|
||||
import ErrorRedIcon from "../../../../images/error_red.svg";
|
||||
import LoaderIcon from "../../../../images/circular_loader_black_16x16.gif";
|
||||
import ClearIcon from "../../../../images/Clear.svg";
|
||||
import LoaderIcon from "../../../../images/circular_loader_black_16x16.gif";
|
||||
import ChevronUpIcon from "../../../../images/QueryBuilder/CollapseChevronUp_16x.png";
|
||||
import ChevronDownIcon from "../../../../images/QueryBuilder/CollapseChevronDown_16x.png";
|
||||
|
||||
@ -59,9 +59,9 @@ export class NotificationConsoleComponent extends React.Component<
|
||||
{ key: "Info", text: "Info" },
|
||||
{ key: "Error", text: "Error" }
|
||||
];
|
||||
private headerTimeoutId: number;
|
||||
private prevHeaderStatus: string;
|
||||
private consoleHeaderElement: HTMLElement;
|
||||
private headerTimeoutId?: number;
|
||||
private prevHeaderStatus: string | null;
|
||||
private consoleHeaderElement?: HTMLElement;
|
||||
|
||||
constructor(props: NotificationConsoleComponentProps) {
|
||||
super(props);
|
||||
@ -99,6 +99,10 @@ export class NotificationConsoleComponent extends React.Component<
|
||||
}
|
||||
}
|
||||
|
||||
public setElememntRef = (element: HTMLElement) => {
|
||||
this.consoleHeaderElement = element;
|
||||
};
|
||||
|
||||
public render(): JSX.Element {
|
||||
const numInProgress = this.props.consoleData.filter((data: ConsoleData) => data.type === ConsoleDataType.InProgress)
|
||||
.length;
|
||||
@ -110,7 +114,7 @@ export class NotificationConsoleComponent extends React.Component<
|
||||
<div className="notificationConsoleContainer">
|
||||
<div
|
||||
className="notificationConsoleHeader"
|
||||
ref={(element: HTMLElement) => (this.consoleHeaderElement = element)}
|
||||
ref={this.setElememntRef}
|
||||
onClick={(event: React.MouseEvent<HTMLDivElement>) => this.expandCollapseConsole()}
|
||||
onKeyDown={(event: React.KeyboardEvent<HTMLDivElement>) => this.onExpandCollapseKeyPress(event)}
|
||||
tabIndex={0}
|
||||
@ -220,12 +224,12 @@ export class NotificationConsoleComponent extends React.Component<
|
||||
));
|
||||
}
|
||||
|
||||
private onFilterSelected(event: React.ChangeEvent<HTMLSelectElement>, option: IDropdownOption): void {
|
||||
private onFilterSelected = (event: React.ChangeEvent<HTMLSelectElement>, option: IDropdownOption): void => {
|
||||
this.setState({ selectedFilter: String(option.key) });
|
||||
}
|
||||
};
|
||||
|
||||
private getFilteredConsoleData(): ConsoleData[] {
|
||||
let filterType: ConsoleDataType = null;
|
||||
let filterType: ConsoleDataType | null = null;
|
||||
|
||||
switch (this.state.selectedFilter) {
|
||||
case "All":
|
||||
@ -272,7 +276,7 @@ export class NotificationConsoleComponent extends React.Component<
|
||||
|
||||
private onConsoleWasExpanded = (): void => {
|
||||
this.props.onConsoleExpandedChange(this.state.isExpanded);
|
||||
if (this.state.isExpanded) {
|
||||
if (this.state.isExpanded && this.consoleHeaderElement) {
|
||||
this.consoleHeaderElement.focus();
|
||||
}
|
||||
};
|
||||
|
@ -808,7 +808,7 @@ const closeUnsupportedMimetypesEpic = (
|
||||
const filepath = action.payload.filepath;
|
||||
// Close tab and show error message
|
||||
explorer.tabsManager.closeTabsByComparator(
|
||||
tab => (tab as any).notebookPath && FileSystemUtil.isPathEqual((tab as any).notebookPath(), filepath)
|
||||
(tab: any) => (tab as any).notebookPath && FileSystemUtil.isPathEqual((tab as any).notebookPath(), filepath)
|
||||
);
|
||||
const msg = `${filepath} cannot be rendered. Please download the file, in order to view it outside of Data Explorer.`;
|
||||
explorer.showOkModalDialog("File cannot be rendered", msg);
|
||||
@ -836,7 +836,7 @@ const closeContentFailedToFetchEpic = (
|
||||
const filepath = action.payload.filepath;
|
||||
// Close tab and show error message
|
||||
explorer.tabsManager.closeTabsByComparator(
|
||||
tab => (tab as any).notebookPath && FileSystemUtil.isPathEqual((tab as any).notebookPath(), filepath)
|
||||
(tab: any) => (tab as any).notebookPath && FileSystemUtil.isPathEqual((tab as any).notebookPath(), filepath)
|
||||
);
|
||||
const msg = `Failed to load file: ${filepath}.`;
|
||||
explorer.showOkModalDialog("Failure to load", msg);
|
||||
|
@ -192,7 +192,7 @@ export class NotebookContentClient {
|
||||
const dir = xhr.response;
|
||||
const item = NotebookUtil.createNotebookContentItem(dir.name, dir.path, dir.type);
|
||||
item.parent = parent;
|
||||
parent.children!.push(item);
|
||||
parent.children?.push(item);
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
import * as Constants from "../Common/Constants";
|
||||
import { AutoPilotOfferSettings, Offer } from "../Contracts/DataModels";
|
||||
|
||||
export const manualToAutoscaleDisclaimer = `The starting autoscale max RU/s will be determined by the system, based on the current manual throughput settings and storage of your resource. After autoscale has been enabled, you can change the max RU/s. <a href="${Constants.Urls.autoscaleMigration}">Learn more</a>.`;
|
||||
|
||||
|
@ -21,7 +21,7 @@ export function logConsoleMessage(type: ConsoleDataType, message: string, id?: s
|
||||
}
|
||||
dataExplorer.logConsoleData({ type: type, date: formattedDate, message: message, id: id });
|
||||
}
|
||||
return id;
|
||||
return id || "";
|
||||
}
|
||||
|
||||
export function clearInProgressMessageWithId(id: string): void {
|
||||
|
@ -95,6 +95,8 @@
|
||||
"./src/Utils/StringUtils.ts",
|
||||
"./src/Utils/WindowUtils.ts",
|
||||
"./src/Utils/arm/generatedClients/2020-04-01/types.ts",
|
||||
"./src/Utils/AutoPilotUtils.ts",
|
||||
"./src/Utils/PricingUtils.ts",
|
||||
"./src/Utils/arm/generatedClients/2020-04-01/cassandraResources.ts",
|
||||
"./src/Utils/arm/generatedClients/2020-04-01/collection.ts",
|
||||
"./src/Utils/arm/generatedClients/2020-04-01/collectionPartition.ts",
|
||||
|
Loading…
Reference in New Issue
Block a user