Merge branch 'master' into users/srnara/selfserve

This commit is contained in:
Srinath Narayanan 2021-01-15 07:39:50 -08:00
commit b34628e9fc
7 changed files with 22 additions and 16 deletions

View File

@ -11,8 +11,8 @@ import ErrorBlackIcon from "../../../../images/error_black.svg";
import infoBubbleIcon from "../../../../images/info-bubble-9x9.svg"; import infoBubbleIcon from "../../../../images/info-bubble-9x9.svg";
import InfoIcon from "../../../../images/info_color.svg"; import InfoIcon from "../../../../images/info_color.svg";
import ErrorRedIcon from "../../../../images/error_red.svg"; import ErrorRedIcon from "../../../../images/error_red.svg";
import LoaderIcon from "../../../../images/circular_loader_black_16x16.gif";
import ClearIcon from "../../../../images/Clear.svg"; import ClearIcon from "../../../../images/Clear.svg";
import LoaderIcon from "../../../../images/circular_loader_black_16x16.gif";
import ChevronUpIcon from "../../../../images/QueryBuilder/CollapseChevronUp_16x.png"; import ChevronUpIcon from "../../../../images/QueryBuilder/CollapseChevronUp_16x.png";
import ChevronDownIcon from "../../../../images/QueryBuilder/CollapseChevronDown_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: "Info", text: "Info" },
{ key: "Error", text: "Error" } { key: "Error", text: "Error" }
]; ];
private headerTimeoutId: number; private headerTimeoutId?: number;
private prevHeaderStatus: string; private prevHeaderStatus: string | null;
private consoleHeaderElement: HTMLElement; private consoleHeaderElement?: HTMLElement;
constructor(props: NotificationConsoleComponentProps) { constructor(props: NotificationConsoleComponentProps) {
super(props); super(props);
@ -99,6 +99,10 @@ export class NotificationConsoleComponent extends React.Component<
} }
} }
public setElememntRef = (element: HTMLElement) => {
this.consoleHeaderElement = element;
};
public render(): JSX.Element { public render(): JSX.Element {
const numInProgress = this.props.consoleData.filter((data: ConsoleData) => data.type === ConsoleDataType.InProgress) const numInProgress = this.props.consoleData.filter((data: ConsoleData) => data.type === ConsoleDataType.InProgress)
.length; .length;
@ -110,7 +114,7 @@ export class NotificationConsoleComponent extends React.Component<
<div className="notificationConsoleContainer"> <div className="notificationConsoleContainer">
<div <div
className="notificationConsoleHeader" className="notificationConsoleHeader"
ref={(element: HTMLElement) => (this.consoleHeaderElement = element)} ref={this.setElememntRef}
onClick={(event: React.MouseEvent<HTMLDivElement>) => this.expandCollapseConsole()} onClick={(event: React.MouseEvent<HTMLDivElement>) => this.expandCollapseConsole()}
onKeyDown={(event: React.KeyboardEvent<HTMLDivElement>) => this.onExpandCollapseKeyPress(event)} onKeyDown={(event: React.KeyboardEvent<HTMLDivElement>) => this.onExpandCollapseKeyPress(event)}
tabIndex={0} 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) }); this.setState({ selectedFilter: String(option.key) });
} };
private getFilteredConsoleData(): ConsoleData[] { private getFilteredConsoleData(): ConsoleData[] {
let filterType: ConsoleDataType = null; let filterType: ConsoleDataType | null = null;
switch (this.state.selectedFilter) { switch (this.state.selectedFilter) {
case "All": case "All":
@ -272,7 +276,7 @@ export class NotificationConsoleComponent extends React.Component<
private onConsoleWasExpanded = (): void => { private onConsoleWasExpanded = (): void => {
this.props.onConsoleExpandedChange(this.state.isExpanded); this.props.onConsoleExpandedChange(this.state.isExpanded);
if (this.state.isExpanded) { if (this.state.isExpanded && this.consoleHeaderElement) {
this.consoleHeaderElement.focus(); this.consoleHeaderElement.focus();
} }
}; };

View File

@ -808,7 +808,7 @@ const closeUnsupportedMimetypesEpic = (
const filepath = action.payload.filepath; const filepath = action.payload.filepath;
// Close tab and show error message // Close tab and show error message
explorer.tabsManager.closeTabsByComparator( 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.`; 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); explorer.showOkModalDialog("File cannot be rendered", msg);
@ -836,7 +836,7 @@ const closeContentFailedToFetchEpic = (
const filepath = action.payload.filepath; const filepath = action.payload.filepath;
// Close tab and show error message // Close tab and show error message
explorer.tabsManager.closeTabsByComparator( 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}.`; const msg = `Failed to load file: ${filepath}.`;
explorer.showOkModalDialog("Failure to load", msg); explorer.showOkModalDialog("Failure to load", msg);

View File

@ -192,7 +192,7 @@ export class NotebookContentClient {
const dir = xhr.response; const dir = xhr.response;
const item = NotebookUtil.createNotebookContentItem(dir.name, dir.path, dir.type); const item = NotebookUtil.createNotebookContentItem(dir.name, dir.path, dir.type);
item.parent = parent; item.parent = parent;
parent.children!.push(item); parent.children?.push(item);
return item; return item;
}); });
} }

View File

@ -312,9 +312,10 @@ export class CassandraAPIDataClient extends TableDataClient {
const clearMessage = NotificationConsoleUtils.logConsoleProgress(`Deleting row ${currEntityToDelete.RowKey._}`); const clearMessage = NotificationConsoleUtils.logConsoleProgress(`Deleting row ${currEntityToDelete.RowKey._}`);
const partitionKeyValue = currEntityToDelete[partitionKeyProperty]; const partitionKeyValue = currEntityToDelete[partitionKeyProperty];
const currQuery = const currQuery =
query + this.isStringType(partitionKeyValue.$) query +
(this.isStringType(partitionKeyValue.$)
? `${partitionKeyProperty} = '${partitionKeyValue._}'` ? `${partitionKeyProperty} = '${partitionKeyValue._}'`
: `${partitionKeyProperty} = ${partitionKeyValue._}`; : `${partitionKeyProperty} = ${partitionKeyValue._}`);
try { try {
await this.queryDocuments(collection, currQuery); await this.queryDocuments(collection, currQuery);

View File

@ -1,5 +1,4 @@
import * as Constants from "../Common/Constants"; 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>.`; 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>.`;

View File

@ -21,7 +21,7 @@ export function logConsoleMessage(type: ConsoleDataType, message: string, id?: s
} }
dataExplorer.logConsoleData({ type: type, date: formattedDate, message: message, id: id }); dataExplorer.logConsoleData({ type: type, date: formattedDate, message: message, id: id });
} }
return id; return id || "";
} }
export function clearInProgressMessageWithId(id: string): void { export function clearInProgressMessageWithId(id: string): void {

View File

@ -95,6 +95,8 @@
"./src/Utils/StringUtils.ts", "./src/Utils/StringUtils.ts",
"./src/Utils/WindowUtils.ts", "./src/Utils/WindowUtils.ts",
"./src/Utils/arm/generatedClients/2020-04-01/types.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/cassandraResources.ts",
"./src/Utils/arm/generatedClients/2020-04-01/collection.ts", "./src/Utils/arm/generatedClients/2020-04-01/collection.ts",
"./src/Utils/arm/generatedClients/2020-04-01/collectionPartition.ts", "./src/Utils/arm/generatedClients/2020-04-01/collectionPartition.ts",