Compare commits

..

4 Commits

Author SHA1 Message Date
MokireddySampath
c32b859f83 Update QuickstartCarousel.tsx 2023-09-27 19:55:47 +05:30
MokireddySampath
5358333384 Update QuickstartCarousel.tsx 2023-09-27 19:50:18 +05:30
Sampath
e45abde0bf File name changed, since the video is not playing in the portal's data explorer blade 2023-09-26 09:45:28 +05:30
Sampath
551bc0f973 "Dummy video has been added and instead of using the reactyoutube library using hte native
video player "
2023-09-25 12:16:06 +05:30
340 changed files with 3209 additions and 3662 deletions

View File

@@ -124,13 +124,12 @@ table.dataTable thead td:active {
table.dataTable thead th:focus,
table.dataTable thead td:focus {
outline: 1px dashed #605E5C;
outline-offset: -2px;
border-width: 1px;
border-style: solid;
border-color: #007ACC;
/*[{datatable-header-cell-focus-background}]*/
}
table.dataTable tbody tr:focus{
outline: 1px dashed #605E5C;
}
table.dataTable thead th:hover,
table.dataTable thead td:hover {
border: 1px solid #007ACC;

1666
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -13,7 +13,7 @@
"@babel/plugin-proposal-class-properties": "7.12.1",
"@babel/plugin-proposal-decorators": "7.12.12",
"@fluentui/react": "8.14.3",
"@fluentui/react-components": "9.32.1",
"@fluentui/react-components": "9.30.1",
"@jupyterlab/services": "6.0.2",
"@jupyterlab/terminal": "3.0.3",
"@microsoft/applicationinsights-web": "2.6.1",
@@ -141,7 +141,7 @@
"buffer": "5.1.0",
"case-sensitive-paths-webpack-plugin": "2.3.0",
"create-file-webpack": "1.0.2",
"css-loader": "6.8.1",
"css-loader": "1.0.0",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.5",
"enzyme-to-json": "3.6.1",
@@ -170,7 +170,7 @@
"monaco-editor-webpack-plugin": "1.7.0",
"node-fetch": "2.6.1",
"playwright": "1.13.0",
"prettier": "3.0.3",
"prettier": "2.2.1",
"process": "0.11.10",
"raw-loader": "0.5.1",
"react-dev-utils": "11.0.4",
@@ -178,6 +178,8 @@
"sinon": "3.2.1",
"style-loader": "0.23.0",
"ts-loader": "9.2.4",
"tslint": "5.11.0",
"tslint-microsoft-contrib": "6.0.0",
"typedoc": "0.20.36",
"typescript": "4.3.4",
"url-loader": "1.1.1",
@@ -208,7 +210,7 @@
"compile:strict": "tsc -p ./tsconfig.strict.json",
"format": "prettier --write \"{src,test}/**/*.{ts,tsx,html}\" \"*.{js,html}\"",
"format:check": "prettier --check \"{src,test}/**/*.{ts,tsx,html}\" \"*.{js,html}\"",
"lint": "eslint \"**/*.{ts,tsx}\"",
"lint": "tslint --project tsconfig.json && eslint \"**/*.{ts,tsx}\"",
"build:contracts": "npm run compile:contracts",
"strict:find": "node ./strict-null-checks/find.js",
"strict:add": "node ./strict-null-checks/auto-add.js",
@@ -231,7 +233,6 @@
},
"homepage": "https://github.com/Azure/cosmos-explorer",
"prettier": {
"printWidth": 120,
"endOfLine": "auto"
"printWidth": 120
}
}
}

View File

@@ -10,7 +10,7 @@ export class BindingHandlersRegisterer {
wrappedValueAccessor: () => any,
allBindings?: ko.AllBindings,
viewModel?: any,
bindingContext?: ko.BindingContext,
bindingContext?: ko.BindingContext
) {
const value = ko.unwrap(wrappedValueAccessor());
bindingContext?.$data.isTemplateReady(value);

View File

@@ -31,7 +31,7 @@ export class Registerer {
// If any of the ko observable change inside parameters, trigger a new render.
ko.computed(() => ko.toJSON(adapter.parameters)).subscribe(() =>
ReactDOM.render(adapter.renderComponent(), element),
ReactDOM.render(adapter.renderComponent(), element)
);
// Initial rendering at mount point

View File

@@ -66,7 +66,7 @@ const onInit = async () => {
);
ReactDOM.render(outputs, document.getElementById("cellOutput"));
},
}
);
postRobot.on(
@@ -89,14 +89,14 @@ const onInit = async () => {
topNode,
snapshotRequest.aspectRatio,
undefined,
snapshotRequest.downloadFilename,
snapshotRequest.downloadFilename
);
return {
imageSrc: result.imageSrc,
requestId: snapshotRequest.requestId,
};
},
}
);
};

View File

@@ -112,7 +112,7 @@ const getMediaInfo = (props: TransformMediaProps) => {
const mediaType = displayOrder.find(
(key) =>
Object.prototype.hasOwnProperty.call(output.data, key) &&
(Object.prototype.hasOwnProperty.call(transformsById, key) || transformsById.get(key)),
(Object.prototype.hasOwnProperty.call(transformsById, key) || transformsById.get(key))
);
if (mediaType) {

View File

@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />

View File

@@ -271,7 +271,7 @@ export class HashRoutePrefixes {
databaseId: string,
collectionId: string,
sprocId: string,
stripFirstSlash: boolean = true,
stripFirstSlash: boolean = true
): string {
const transformedDatabasePrefix: string = this.sprocs.replace("{db_id}", databaseId);

View File

@@ -66,7 +66,7 @@ describe("getTokenFromAuthService", () => {
getTokenFromAuthService("GET", "dbs", "foo");
expect(window.fetch).toHaveBeenCalledWith(
"https://main.documentdb.ext.azure.com/api/guest/runtimeproxy/authorizationTokens",
expect.any(Object),
expect.any(Object)
);
});
@@ -77,7 +77,7 @@ describe("getTokenFromAuthService", () => {
getTokenFromAuthService("GET", "dbs", "foo");
expect(window.fetch).toHaveBeenCalledWith(
"https://localhost:1234/api/guest/runtimeproxy/authorizationTokens",
expect.any(Object),
expect.any(Object)
);
});
});

View File

@@ -109,7 +109,7 @@ export function client(): Cosmos.CosmosClient {
(options as any).plugins = [{ on: "request", plugin: requestPlugin }];
}
if (userContext.databaseAccount?.properties?.enablePriorityBasedExecution && userContext.apiType === "SQL") {
if (userContext.features.enablePriorityBasedThrottling && userContext.apiType === "SQL") {
const plugins = (options as any).plugins || [];
plugins.push({ on: "request", plugin: PriorityBasedExecutionUtils.requestPlugin });
(options as any).plugins = plugins;

View File

@@ -1,6 +1,5 @@
import { DatePicker, TextField } from "@fluentui/react";
import React, { FunctionComponent } from "react";
import { attributeValueLabel } from "../Explorer/Panes/Tables/Validators/EntityTableHelper";
export interface TableEntityProps {
entityValueLabel?: string;
@@ -59,7 +58,6 @@ export const EntityValue: FunctionComponent<TableEntityProps> = ({
placeholder={entityValuePlaceholder}
value={typeof entityValue === "string" ? entityValue : ""}
onChange={onEntityValueChange}
ariaLabel={attributeValueLabel}
/>
);
};

View File

@@ -53,7 +53,7 @@ function _generateLogEntry(
level: Diagnostics.LogEntryLevel,
message: string,
area: string,
code?: number | string,
code?: number | string
): Diagnostics.LogEntry {
return {
timestamp: new Date().getUTCSeconds(),

View File

@@ -30,7 +30,7 @@ export function handleCachedDataMessage(message: any): void {
export function sendCachedDataMessage<TResponseDataModel>(
messageType: MessageTypes,
params: Object[],
timeoutInMs?: number,
timeoutInMs?: number
): Q.Promise<TResponseDataModel> {
let cachedDataPromise: CachedDataPromise<TResponseDataModel> = {
deferred: Q.defer<TResponseDataModel>(),
@@ -43,7 +43,7 @@ export function sendCachedDataMessage<TResponseDataModel>(
//TODO: Use telemetry to measure optimal time to resolve/reject promises
return cachedDataPromise.deferred.promise.timeout(
timeoutInMs || Constants.ClientDefaults.requestTimeoutMs,
"Timed out while waiting for response from portal",
"Timed out while waiting for response from portal"
);
}

View File

@@ -38,7 +38,7 @@ const collection = {
},
} as Collection;
const documentId = {
const documentId = ({
partitionKeyHeader: () => "[]",
self: "db/testDB/db/testCollection/docs/testId",
partitionKeyProperties,
@@ -47,7 +47,7 @@ const documentId = {
kind: "Hash",
version: 1,
},
} as unknown as DocumentId;
} as unknown) as DocumentId;
const databaseAccount = {
id: "foo",
@@ -83,7 +83,7 @@ describe("MongoProxyClient", () => {
queryDocuments(databaseId, collection, true, "{}");
expect(window.fetch).toHaveBeenCalledWith(
"https://main.documentdb.ext.azure.com/api/mongo/explorer/resourcelist?db=testDB&coll=testCollection&resourceUrl=bardbs%2FtestDB%2Fcolls%2FtestCollection%2Fdocs%2F&rid=testCollectionrid&rtype=docs&sid=&rg=&dba=foo&pk=pk",
expect.any(Object),
expect.any(Object)
);
});
@@ -92,7 +92,7 @@ describe("MongoProxyClient", () => {
queryDocuments(databaseId, collection, true, "{}");
expect(window.fetch).toHaveBeenCalledWith(
"https://localhost:1234/api/mongo/explorer/resourcelist?db=testDB&coll=testCollection&resourceUrl=bardbs%2FtestDB%2Fcolls%2FtestCollection%2Fdocs%2F&rid=testCollectionrid&rtype=docs&sid=&rg=&dba=foo&pk=pk",
expect.any(Object),
expect.any(Object)
);
});
});
@@ -115,7 +115,7 @@ describe("MongoProxyClient", () => {
readDocument(databaseId, collection, documentId);
expect(window.fetch).toHaveBeenCalledWith(
"https://main.documentdb.ext.azure.com/api/mongo/explorer?db=testDB&coll=testCollection&resourceUrl=bardb%2FtestDB%2Fdb%2FtestCollection%2FtestId&rid=testId&rtype=docs&sid=&rg=&dba=foo&pk=pk",
expect.any(Object),
expect.any(Object)
);
});
@@ -124,7 +124,7 @@ describe("MongoProxyClient", () => {
readDocument(databaseId, collection, documentId);
expect(window.fetch).toHaveBeenCalledWith(
"https://localhost:1234/api/mongo/explorer?db=testDB&coll=testCollection&resourceUrl=bardb%2FtestDB%2Fdb%2FtestCollection%2FtestId&rid=testId&rtype=docs&sid=&rg=&dba=foo&pk=pk",
expect.any(Object),
expect.any(Object)
);
});
});
@@ -147,7 +147,7 @@ describe("MongoProxyClient", () => {
readDocument(databaseId, collection, documentId);
expect(window.fetch).toHaveBeenCalledWith(
"https://main.documentdb.ext.azure.com/api/mongo/explorer?db=testDB&coll=testCollection&resourceUrl=bardb%2FtestDB%2Fdb%2FtestCollection%2FtestId&rid=testId&rtype=docs&sid=&rg=&dba=foo&pk=pk",
expect.any(Object),
expect.any(Object)
);
});
@@ -156,7 +156,7 @@ describe("MongoProxyClient", () => {
readDocument(databaseId, collection, documentId);
expect(window.fetch).toHaveBeenCalledWith(
"https://localhost:1234/api/mongo/explorer?db=testDB&coll=testCollection&resourceUrl=bardb%2FtestDB%2Fdb%2FtestCollection%2FtestId&rid=testId&rtype=docs&sid=&rg=&dba=foo&pk=pk",
expect.any(Object),
expect.any(Object)
);
});
});
@@ -179,7 +179,7 @@ describe("MongoProxyClient", () => {
updateDocument(databaseId, collection, documentId, "{}");
expect(window.fetch).toHaveBeenCalledWith(
"https://main.documentdb.ext.azure.com/api/mongo/explorer?db=testDB&coll=testCollection&resourceUrl=bardb%2FtestDB%2Fdb%2FtestCollection%2Fdocs%2FtestId&rid=testId&rtype=docs&sid=&rg=&dba=foo&pk=pk",
expect.any(Object),
expect.any(Object)
);
});
@@ -188,7 +188,7 @@ describe("MongoProxyClient", () => {
updateDocument(databaseId, collection, documentId, "{}");
expect(window.fetch).toHaveBeenCalledWith(
"https://localhost:1234/api/mongo/explorer?db=testDB&coll=testCollection&resourceUrl=bardb%2FtestDB%2Fdb%2FtestCollection%2Fdocs%2FtestId&rid=testId&rtype=docs&sid=&rg=&dba=foo&pk=pk",
expect.any(Object),
expect.any(Object)
);
});
});
@@ -211,7 +211,7 @@ describe("MongoProxyClient", () => {
deleteDocument(databaseId, collection, documentId);
expect(window.fetch).toHaveBeenCalledWith(
"https://main.documentdb.ext.azure.com/api/mongo/explorer?db=testDB&coll=testCollection&resourceUrl=bardb%2FtestDB%2Fdb%2FtestCollection%2Fdocs%2FtestId&rid=testId&rtype=docs&sid=&rg=&dba=foo&pk=pk",
expect.any(Object),
expect.any(Object)
);
});
@@ -220,7 +220,7 @@ describe("MongoProxyClient", () => {
deleteDocument(databaseId, collection, documentId);
expect(window.fetch).toHaveBeenCalledWith(
"https://localhost:1234/api/mongo/explorer?db=testDB&coll=testCollection&resourceUrl=bardb%2FtestDB%2Fdb%2FtestCollection%2Fdocs%2FtestId&rid=testId&rtype=docs&sid=&rg=&dba=foo&pk=pk",
expect.any(Object),
expect.any(Object)
);
});
});

View File

@@ -61,7 +61,7 @@ export function queryDocuments(
collection: Collection,
isResourceList: boolean,
query: string,
continuationToken?: string,
continuationToken?: string
): Promise<QueryResponse> {
const { databaseAccount } = userContext;
const resourceEndpoint = databaseAccount.properties.mongoEndpoint || databaseAccount.properties.documentEndpoint;
@@ -121,7 +121,7 @@ export function queryDocuments(
export function readDocument(
databaseId: string,
collection: Collection,
documentId: DocumentId,
documentId: DocumentId
): Promise<DataModels.DocumentId> {
const { databaseAccount } = userContext;
const resourceEndpoint = databaseAccount.properties.mongoEndpoint || databaseAccount.properties.documentEndpoint;
@@ -152,7 +152,7 @@ export function readDocument(
...defaultHeaders,
...authHeaders(),
[CosmosSDKConstants.HttpHeaders.PartitionKey]: encodeURIComponent(
JSON.stringify(documentId.partitionKeyHeader()),
JSON.stringify(documentId.partitionKeyHeader())
),
},
})
@@ -168,7 +168,7 @@ export function createDocument(
databaseId: string,
collection: Collection,
partitionKeyProperty: string,
documentContent: unknown,
documentContent: unknown
): Promise<DataModels.DocumentId> {
const { databaseAccount } = userContext;
const resourceEndpoint = databaseAccount.properties.mongoEndpoint || databaseAccount.properties.documentEndpoint;
@@ -207,7 +207,7 @@ export function updateDocument(
databaseId: string,
collection: Collection,
documentId: DocumentId,
documentContent: string,
documentContent: string
): Promise<DataModels.DocumentId> {
const { databaseAccount } = userContext;
const resourceEndpoint = databaseAccount.properties.mongoEndpoint || databaseAccount.properties.documentEndpoint;
@@ -290,7 +290,7 @@ export function deleteDocument(databaseId: string, collection: Collection, docum
}
export function createMongoCollectionWithProxy(
params: DataModels.CreateCollectionParams,
params: DataModels.CreateCollectionParams
): Promise<DataModels.Collection> {
const { databaseAccount } = userContext;
const shardKey: string = params.partitionKey?.paths[0];
@@ -316,7 +316,7 @@ export function createMongoCollectionWithProxy(
return window
.fetch(
`${endpoint}/createCollection?${queryString.stringify(
mongoParams as unknown as queryString.ParsedUrlQueryInput,
(mongoParams as unknown) as queryString.ParsedUrlQueryInput
)}`,
{
method: "POST",
@@ -325,7 +325,7 @@ export function createMongoCollectionWithProxy(
...authHeaders(),
[HttpHeaders.contentType]: "application/json",
},
},
}
)
.then(async (response) => {
if (response.ok) {

View File

@@ -48,7 +48,7 @@ export class QueriesClient {
(error: any) => {
handleError(error, "setupQueriesCollection", "Failed to set up account for saving queries");
return Promise.reject(error);
},
}
)
.finally(() => clearMessage());
}
@@ -83,7 +83,7 @@ export class QueriesClient {
}
handleError(error, "saveQuery", `Failed to save query ${query.queryName}`);
return Promise.reject(error);
},
}
)
.finally(() => clearMessage());
}
@@ -102,7 +102,7 @@ export class QueriesClient {
SavedQueries.DatabaseName,
SavedQueries.CollectionName,
this.fetchQueriesQuery(),
options,
options
).fetchAll();
let queries: DataModels.Query[] = _.map(results.resources, (document: DataModels.Query) => {
@@ -152,7 +152,7 @@ export class QueriesClient {
partitionKeyProperties: ["id"],
} as DocumentsTab,
query,
[query.queryName],
[query.queryName]
); // TODO: Remove DocumentId's dependency on DocumentsTab
const options: any = { partitionKey: query.resourceId };
return deleteDocument(queriesCollection, documentId)
@@ -164,7 +164,7 @@ export class QueriesClient {
(error: any) => {
handleError(error, "deleteQuery", `Failed to delete query ${query.queryName}`);
return Promise.reject(error);
},
}
)
.finally(() => clearMessage());
}
@@ -178,14 +178,14 @@ export class QueriesClient {
private findQueriesCollection(): ViewModels.Collection {
const queriesDatabase: ViewModels.Database = _.find(
useDatabases.getState().databases,
(database: ViewModels.Database) => database.id() === SavedQueries.DatabaseName,
(database: ViewModels.Database) => database.id() === SavedQueries.DatabaseName
);
if (!queriesDatabase) {
return undefined;
}
return _.find(
queriesDatabase.collections(),
(collection: ViewModels.Collection) => collection.id() === SavedQueries.CollectionName,
(collection: ViewModels.Collection) => collection.id() === SavedQueries.CollectionName
);
}

View File

@@ -12,7 +12,6 @@ import {
import React, { FunctionComponent } from "react";
import DeleteIcon from "../../images/delete.svg";
import EditIcon from "../../images/Edit_entity.svg";
import { attributeNameLabel, dataTypeLabel } from "../Explorer/Panes/Tables/Validators/EntityTableHelper";
import { CassandraType, TableType } from "../Explorer/Tables/Constants";
import { userContext } from "../UserContext";
import { EntityValue } from "./EntityValue";
@@ -113,7 +112,6 @@ export const TableEntity: FunctionComponent<TableEntityProps> = ({
value={entityProperty}
onChange={onEntityPropertyChange}
required
ariaLabel={attributeNameLabel}
/>
<Dropdown
label={entityTypeLabel && entityTypeLabel}
@@ -122,7 +120,6 @@ export const TableEntity: FunctionComponent<TableEntityProps> = ({
options={options}
disabled={isPropertyTypeDisable}
styles={dropdownStyles}
ariaLabel={dataTypeLabel}
/>
<EntityValue
entityValueLabel={entityValueLabel}

View File

@@ -6,10 +6,10 @@ import { handleError } from "../ErrorHandlingUtils";
export const bulkCreateDocument = async (
collection: CollectionBase,
documents: JSONObject[],
documents: JSONObject[]
): Promise<OperationResponse[]> => {
const clearMessage = logConsoleProgress(
`Executing ${documents.length} bulk operations for container ${collection.id()}`,
`Executing ${documents.length} bulk operations for container ${collection.id()}`
);
try {
@@ -18,7 +18,7 @@ export const bulkCreateDocument = async (
.container(collection.id())
.items.bulk(
documents.map((doc) => ({ operationType: "Create", resourceBody: doc })),
{ continueOnError: true },
{ continueOnError: true }
);
const successCount = response.filter((r) => r.statusCode === 201).length;
@@ -27,7 +27,7 @@ export const bulkCreateDocument = async (
logConsoleInfo(
`${
documents.length
} operations completed for container ${collection.id()}. ${successCount} operations succeeded. ${throttledCount} operations throttled`,
} operations completed for container ${collection.id()}. ${successCount} operations succeeded. ${throttledCount} operations throttled`
);
return response;
} catch (error) {

View File

@@ -20,7 +20,7 @@ import { createDatabase } from "./createDatabase";
export const createCollection = async (params: DataModels.CreateCollectionParams): Promise<DataModels.Collection> => {
const clearMessage = logConsoleProgress(
`Creating a new container ${params.collectionId} for database ${params.databaseId}`,
`Creating a new container ${params.collectionId} for database ${params.databaseId}`
);
try {
let collection: DataModels.Collection;
@@ -57,7 +57,7 @@ const createCollectionWithARM = async (params: DataModels.CreateCollectionParams
if (!isValid) {
const collectionName = getCollectionName().toLocaleLowerCase();
throw new Error(
`Create ${collectionName} failed: ${collectionName} with id ${params.collectionId} already exists`,
`Create ${collectionName} failed: ${collectionName} with id ${params.collectionId} already exists`
);
}
}
@@ -110,7 +110,7 @@ const createSqlContainer = async (params: DataModels.CreateCollectionParams): Pr
userContext.databaseAccount.name,
params.databaseId,
params.collectionId,
rpPayload,
rpPayload
);
return createResponse && (createResponse.properties.resource as DataModels.Collection);
};
@@ -145,7 +145,7 @@ const createMongoCollection = async (params: DataModels.CreateCollectionParams):
userContext.databaseAccount.name,
params.databaseId,
params.collectionId,
rpPayload,
rpPayload
);
if (params.createMongoWildcardIndex) {
@@ -179,7 +179,7 @@ const createCassandraTable = async (params: DataModels.CreateCollectionParams):
userContext.databaseAccount.name,
params.databaseId,
params.collectionId,
rpPayload,
rpPayload
);
return createResponse && (createResponse.properties.resource as DataModels.Collection);
};
@@ -213,7 +213,7 @@ const createGraph = async (params: DataModels.CreateCollectionParams): Promise<D
userContext.databaseAccount.name,
params.databaseId,
params.collectionId,
rpPayload,
rpPayload
);
return createResponse && (createResponse.properties.resource as DataModels.Collection);
};
@@ -236,7 +236,7 @@ const createTable = async (params: DataModels.CreateCollectionParams): Promise<D
userContext.resourceGroup,
userContext.databaseAccount.name,
params.collectionId,
rpPayload,
rpPayload
);
return createResponse && (createResponse.properties.resource as DataModels.Collection);
};
@@ -287,7 +287,7 @@ const createCollectionWithSDK = async (params: DataModels.CreateCollectionParams
const databaseResponse: DatabaseResponse = await client().databases.createIfNotExists(createDatabaseBody);
const collectionResponse: ContainerResponse = await databaseResponse?.database.containers.create(
createCollectionBody,
collectionOptions,
collectionOptions
);
return collectionResponse?.resource as DataModels.Collection;
};

View File

@@ -77,7 +77,7 @@ async function createSqlDatabase(params: DataModels.CreateDatabaseParams): Promi
userContext.resourceGroup,
userContext.databaseAccount.name,
params.databaseId,
rpPayload,
rpPayload
);
return createResponse && (createResponse.properties.resource as DataModels.Database);
}
@@ -97,7 +97,7 @@ async function createMongoDatabase(params: DataModels.CreateDatabaseParams): Pro
userContext.resourceGroup,
userContext.databaseAccount.name,
params.databaseId,
rpPayload,
rpPayload
);
return createResponse && (createResponse.properties.resource as DataModels.Database);
}
@@ -117,7 +117,7 @@ async function createCassandraKeyspace(params: DataModels.CreateDatabaseParams):
userContext.resourceGroup,
userContext.databaseAccount.name,
params.databaseId,
rpPayload,
rpPayload
);
return createResponse && (createResponse.properties.resource as DataModels.Database);
}
@@ -137,7 +137,7 @@ async function createGremlineDatabase(params: DataModels.CreateDatabaseParams):
userContext.resourceGroup,
userContext.databaseAccount.name,
params.databaseId,
rpPayload,
rpPayload
);
return createResponse && (createResponse.properties.resource as DataModels.Database);
}

View File

@@ -16,7 +16,7 @@ import { handleError } from "../ErrorHandlingUtils";
export async function createStoredProcedure(
databaseId: string,
collectionId: string,
storedProcedure: StoredProcedureDefinition,
storedProcedure: StoredProcedureDefinition
): Promise<StoredProcedureDefinition & Resource> {
const clearMessage = logConsoleProgress(`Creating stored procedure ${storedProcedure.id}`);
try {
@@ -32,11 +32,11 @@ export async function createStoredProcedure(
userContext.databaseAccount.name,
databaseId,
collectionId,
storedProcedure.id,
storedProcedure.id
);
if (getResponse?.properties?.resource) {
throw new Error(
`Create stored procedure failed: stored procedure with id ${storedProcedure.id} already exists`,
`Create stored procedure failed: stored procedure with id ${storedProcedure.id} already exists`
);
}
} catch (error) {
@@ -58,7 +58,7 @@ export async function createStoredProcedure(
databaseId,
collectionId,
storedProcedure.id,
createSprocParams,
createSprocParams
);
return rpResponse && (rpResponse.properties?.resource as StoredProcedureDefinition & Resource);
}

View File

@@ -10,7 +10,7 @@ import { handleError } from "../ErrorHandlingUtils";
export async function createTrigger(
databaseId: string,
collectionId: string,
trigger: SqlTriggerResource,
trigger: SqlTriggerResource
): Promise<TriggerDefinition | SqlTriggerResource> {
const clearMessage = logConsoleProgress(`Creating trigger ${trigger.id}`);
try {
@@ -26,7 +26,7 @@ export async function createTrigger(
userContext.databaseAccount.name,
databaseId,
collectionId,
trigger.id,
trigger.id
);
if (getResponse?.properties?.resource) {
throw new Error(`Create trigger failed: ${trigger.id} already exists`);
@@ -50,7 +50,7 @@ export async function createTrigger(
databaseId,
collectionId,
trigger.id,
createTriggerParams,
createTriggerParams
);
return rpResponse && rpResponse.properties?.resource;
}
@@ -58,7 +58,7 @@ export async function createTrigger(
const response = await client()
.database(databaseId)
.container(collectionId)
.scripts.triggers.create(trigger as unknown as TriggerDefinition); // TODO: TypeScript does not like the SQL SDK trigger type
.scripts.triggers.create((trigger as unknown) as TriggerDefinition); // TODO: TypeScript does not like the SQL SDK trigger type
return response.resource;
} catch (error) {
handleError(error, "CreateTrigger", `Error while creating trigger ${trigger.id}`);

View File

@@ -16,7 +16,7 @@ import { handleError } from "../ErrorHandlingUtils";
export async function createUserDefinedFunction(
databaseId: string,
collectionId: string,
userDefinedFunction: UserDefinedFunctionDefinition,
userDefinedFunction: UserDefinedFunctionDefinition
): Promise<UserDefinedFunctionDefinition & Resource> {
const clearMessage = logConsoleProgress(`Creating user defined function ${userDefinedFunction.id}`);
try {
@@ -32,11 +32,11 @@ export async function createUserDefinedFunction(
userContext.databaseAccount.name,
databaseId,
collectionId,
userDefinedFunction.id,
userDefinedFunction.id
);
if (getResponse?.properties?.resource) {
throw new Error(
`Create user defined function failed: user defined function with id ${userDefinedFunction.id} already exists`,
`Create user defined function failed: user defined function with id ${userDefinedFunction.id} already exists`
);
}
} catch (error) {
@@ -58,7 +58,7 @@ export async function createUserDefinedFunction(
databaseId,
collectionId,
userDefinedFunction.id,
createUDFParams,
createUDFParams
);
return rpResponse && (rpResponse.properties?.resource as UserDefinedFunctionDefinition & Resource);
}
@@ -72,7 +72,7 @@ export async function createUserDefinedFunction(
handleError(
error,
"CreateUserupdateUserDefinedFunction",
`Error while creating user defined function ${userDefinedFunction.id}`,
`Error while creating user defined function ${userDefinedFunction.id}`
);
throw error;
} finally {

View File

@@ -8,7 +8,7 @@ import { handleError } from "../ErrorHandlingUtils";
export async function deleteStoredProcedure(
databaseId: string,
collectionId: string,
storedProcedureId: string,
storedProcedureId: string
): Promise<void> {
const clearMessage = logConsoleProgress(`Deleting stored procedure ${storedProcedureId}`);
try {
@@ -23,7 +23,7 @@ export async function deleteStoredProcedure(
userContext.databaseAccount.name,
databaseId,
collectionId,
storedProcedureId,
storedProcedureId
);
} else {
await client().database(databaseId).container(collectionId).scripts.storedProcedure(storedProcedureId).delete();

View File

@@ -19,7 +19,7 @@ export async function deleteTrigger(databaseId: string, collectionId: string, tr
userContext.databaseAccount.name,
databaseId,
collectionId,
triggerId,
triggerId
);
} else {
await client().database(databaseId).container(collectionId).scripts.trigger(triggerId).delete();

View File

@@ -19,7 +19,7 @@ export async function deleteUserDefinedFunction(databaseId: string, collectionId
userContext.databaseAccount.name,
databaseId,
collectionId,
id,
id
);
} else {
await client().database(databaseId).container(collectionId).scripts.userDefinedFunction(id).delete();

View File

@@ -14,7 +14,7 @@ export const executeStoredProcedure = async (
collection: Collection,
storedProcedure: StoredProcedure,
partitionKeyValue: string,
params: string[],
params: string[]
): Promise<ExecuteSprocResult> => {
const clearMessage = logConsoleProgress(`Executing stored procedure ${storedProcedure.id()}`);
const timeout = setTimeout(() => {
@@ -29,7 +29,7 @@ export const executeStoredProcedure = async (
.execute(partitionKeyValue, params, { enableScriptLogging: true });
clearTimeout(timeout);
logConsoleInfo(
`Finished executing stored procedure ${storedProcedure.id()} for container ${storedProcedure.collection.id()}`,
`Finished executing stored procedure ${storedProcedure.id()} for container ${storedProcedure.collection.id()}`
);
return {
result: response.resource,
@@ -39,7 +39,7 @@ export const executeStoredProcedure = async (
handleError(
error,
"ExecuteStoredProcedure",
`Failed to execute stored procedure ${storedProcedure.id()} for container ${storedProcedure.collection.id()}`,
`Failed to execute stored procedure ${storedProcedure.id()} for container ${storedProcedure.collection.id()}`
);
throw error;
} finally {

View File

@@ -15,7 +15,7 @@ export async function getIndexTransformationProgress(databaseId: string, collect
const response = await client().database(databaseId).container(collectionId).read({ populateQuotaInfo: true });
indexTransformationPercentage = parseInt(
response.headers[Constants.HttpHeaders.collectionIndexTransformationProgress] as string,
response.headers[Constants.HttpHeaders.collectionIndexTransformationProgress] as string
);
} catch (error) {
handleError(error, "ReadMongoDBCollection", `Error while reading container ${collectionId}`);

View File

@@ -5,7 +5,7 @@ export const queryConflicts = (
databaseId: string,
containerId: string,
query: string,
options: FeedOptions,
options: FeedOptions
): QueryIterator<ConflictDefinition & Resource> => {
return client().database(databaseId).container(containerId).conflicts.query(query, options);
};

View File

@@ -7,7 +7,7 @@ export const queryDocuments = (
databaseId: string,
containerId: string,
query: string,
options: FeedOptions,
options: FeedOptions
): QueryIterator<ItemDefinition & Resource> => {
options = getCommonQueryOptions(options);
return client().database(databaseId).container(containerId).items.query(query, options);

View File

@@ -7,7 +7,7 @@ import { MinimalQueryIterator, nextPage } from "../IteratorUtilities";
export const queryDocumentsPage = async (
resourceName: string,
documentsIterator: MinimalQueryIterator,
firstItemIndex: number,
firstItemIndex: number
): Promise<QueryResults> => {
const entityName = getEntityName();
const clearMessage = logConsoleProgress(`Querying ${entityName} for container ${resourceName}`);

View File

@@ -28,7 +28,7 @@ export async function readSampleCollection(): Promise<DataModels.Collection> {
export async function readCollectionInternal(
cosmosClient: CosmosClient,
databaseId: string,
collectionId: string,
collectionId: string
): Promise<DataModels.Collection> {
let collection: DataModels.Collection;
const clearMessage = logConsoleProgress(`Querying container ${collectionId}`);

View File

@@ -44,7 +44,7 @@ const readCollectionOfferWithARM = async (databaseId: string, collectionId: stri
resourceGroup,
accountName,
databaseId,
collectionId,
collectionId
);
break;
case "Mongo":
@@ -53,7 +53,7 @@ const readCollectionOfferWithARM = async (databaseId: string, collectionId: stri
resourceGroup,
accountName,
databaseId,
collectionId,
collectionId
);
break;
case "Cassandra":
@@ -62,7 +62,7 @@ const readCollectionOfferWithARM = async (databaseId: string, collectionId: stri
resourceGroup,
accountName,
databaseId,
collectionId,
collectionId
);
break;
case "Gremlin":
@@ -71,7 +71,7 @@ const readCollectionOfferWithARM = async (databaseId: string, collectionId: stri
resourceGroup,
accountName,
databaseId,
collectionId,
collectionId
);
break;
case "Tables":

View File

@@ -34,7 +34,7 @@ export async function readCollections(databaseId: string): Promise<DataModels.Co
export async function readCollectionsWithPagination(
databaseId: string,
continuationToken?: string,
continuationToken?: string
): Promise<DataModels.CollectionsWithPagination> {
const clearMessage = logConsoleProgress(`Querying containers for database ${databaseId}`);
try {
@@ -45,7 +45,7 @@ export async function readCollectionsWithPagination(
{
continuationToken,
maxItemCount: Queries.containersPerPage,
},
}
)
.fetchNext();
const collectionsWithPagination: DataModels.CollectionsWithPagination = {

View File

@@ -7,7 +7,7 @@ import { handleError } from "../ErrorHandlingUtils";
export async function readMongoDBCollectionThroughRP(
databaseId: string,
collectionId: string,
collectionId: string
): Promise<MongoDBCollectionResource> {
if (userContext.authType !== AuthType.AAD) {
return undefined;

View File

@@ -9,7 +9,7 @@ import { handleError } from "../ErrorHandlingUtils";
export async function readStoredProcedures(
databaseId: string,
collectionId: string,
collectionId: string
): Promise<(StoredProcedureDefinition & Resource)[]> {
const clearMessage = logConsoleProgress(`Querying stored procedures for container ${collectionId}`);
try {
@@ -23,7 +23,7 @@ export async function readStoredProcedures(
userContext.resourceGroup,
userContext.databaseAccount.name,
databaseId,
collectionId,
collectionId
);
const listResult = rpResponse as SqlStoredProcedureListResult;
if (listResult) {

View File

@@ -9,7 +9,7 @@ import { handleError } from "../ErrorHandlingUtils";
export async function readTriggers(
databaseId: string,
collectionId: string,
collectionId: string
): Promise<SqlTriggerResource[] | TriggerDefinition[]> {
const clearMessage = logConsoleProgress(`Querying triggers for container ${collectionId}`);
try {
@@ -23,7 +23,7 @@ export async function readTriggers(
userContext.resourceGroup,
userContext.databaseAccount.name,
databaseId,
collectionId,
collectionId
);
return rpResponse?.value?.map((trigger) => trigger.properties?.resource);
}

View File

@@ -8,7 +8,7 @@ import { handleError } from "../ErrorHandlingUtils";
export async function readUserDefinedFunctions(
databaseId: string,
collectionId: string,
collectionId: string
): Promise<(UserDefinedFunctionDefinition & Resource)[]> {
const clearMessage = logConsoleProgress(`Querying user defined functions for container ${collectionId}`);
const { authType, apiType, subscriptionId, resourceGroup, databaseAccount } = userContext;
@@ -19,7 +19,7 @@ export async function readUserDefinedFunctions(
resourceGroup,
databaseAccount.name,
databaseId,
collectionId,
collectionId
);
return rpResponse?.value?.map((udf) => udf.properties?.resource as UserDefinedFunctionDefinition & Resource);
}
@@ -34,7 +34,7 @@ export async function readUserDefinedFunctions(
handleError(
error,
"ReadUserDefinedFunctions",
`Failed to query user defined functions for container ${collectionId}`,
`Failed to query user defined functions for container ${collectionId}`
);
throw error;
} finally {

View File

@@ -27,7 +27,7 @@ export async function updateCollection(
databaseId: string,
collectionId: string,
newCollection: Partial<Collection>,
options: RequestOptions = {},
options: RequestOptions = {}
): Promise<Collection> {
let collection: Collection;
const clearMessage = logConsoleProgress(`Updating container ${collectionId}`);
@@ -61,7 +61,7 @@ export async function updateCollection(
async function updateCollectionWithARM(
databaseId: string,
collectionId: string,
newCollection: Partial<Collection>,
newCollection: Partial<Collection>
): Promise<Collection> {
const { subscriptionId, resourceGroup, apiType, databaseAccount } = userContext;
const accountName = databaseAccount.name;
@@ -82,7 +82,7 @@ async function updateCollectionWithARM(
subscriptionId,
resourceGroup,
accountName,
newCollection,
newCollection
);
default:
throw new Error(`Unsupported default experience type: ${apiType}`);
@@ -95,7 +95,7 @@ async function updateSqlContainer(
subscriptionId: string,
resourceGroup: string,
accountName: string,
newCollection: Partial<Collection>,
newCollection: Partial<Collection>
): Promise<Collection> {
const getResponse = await getSqlContainer(subscriptionId, resourceGroup, accountName, databaseId, collectionId);
if (getResponse && getResponse.properties && getResponse.properties.resource) {
@@ -106,7 +106,7 @@ async function updateSqlContainer(
accountName,
databaseId,
collectionId,
getResponse as SqlContainerCreateUpdateParameters,
getResponse as SqlContainerCreateUpdateParameters
);
return updateResponse && (updateResponse.properties.resource as Collection);
}
@@ -120,7 +120,7 @@ export async function updateMongoDBCollection(
subscriptionId: string,
resourceGroup: string,
accountName: string,
newCollection: Partial<Collection>,
newCollection: Partial<Collection>
): Promise<Collection> {
const getResponse = await getMongoDBCollection(subscriptionId, resourceGroup, accountName, databaseId, collectionId);
if (getResponse && getResponse.properties && getResponse.properties.resource) {
@@ -131,13 +131,13 @@ export async function updateMongoDBCollection(
accountName,
databaseId,
collectionId,
getResponse as MongoDBCollectionCreateUpdateParameters,
getResponse as MongoDBCollectionCreateUpdateParameters
);
return updateResponse && (updateResponse.properties.resource as Collection);
}
throw new Error(
`MongoDB collection to update does not exist. Database id: ${databaseId} Collection id: ${collectionId}`,
`MongoDB collection to update does not exist. Database id: ${databaseId} Collection id: ${collectionId}`
);
}
@@ -147,7 +147,7 @@ async function updateCassandraTable(
subscriptionId: string,
resourceGroup: string,
accountName: string,
newCollection: Partial<Collection>,
newCollection: Partial<Collection>
): Promise<Collection> {
const getResponse = await getCassandraTable(subscriptionId, resourceGroup, accountName, databaseId, collectionId);
if (getResponse && getResponse.properties && getResponse.properties.resource) {
@@ -158,13 +158,13 @@ async function updateCassandraTable(
accountName,
databaseId,
collectionId,
getResponse as SqlContainerCreateUpdateParameters,
getResponse as SqlContainerCreateUpdateParameters
);
return updateResponse && (updateResponse.properties.resource as Collection);
}
throw new Error(
`Cassandra table to update does not exist. Database id: ${databaseId} Collection id: ${collectionId}`,
`Cassandra table to update does not exist. Database id: ${databaseId} Collection id: ${collectionId}`
);
}
@@ -174,7 +174,7 @@ async function updateGremlinGraph(
subscriptionId: string,
resourceGroup: string,
accountName: string,
newCollection: Partial<Collection>,
newCollection: Partial<Collection>
): Promise<Collection> {
const getResponse = await getGremlinGraph(subscriptionId, resourceGroup, accountName, databaseId, collectionId);
if (getResponse && getResponse.properties && getResponse.properties.resource) {
@@ -185,7 +185,7 @@ async function updateGremlinGraph(
accountName,
databaseId,
collectionId,
getResponse as SqlContainerCreateUpdateParameters,
getResponse as SqlContainerCreateUpdateParameters
);
return updateResponse && (updateResponse.properties.resource as Collection);
}
@@ -198,7 +198,7 @@ async function updateTable(
subscriptionId: string,
resourceGroup: string,
accountName: string,
newCollection: Partial<Collection>,
newCollection: Partial<Collection>
): Promise<Collection> {
const getResponse = await getTable(subscriptionId, resourceGroup, accountName, collectionId);
if (getResponse && getResponse.properties && getResponse.properties.resource) {
@@ -208,7 +208,7 @@ async function updateTable(
resourceGroup,
accountName,
collectionId,
getResponse as SqlContainerCreateUpdateParameters,
getResponse as SqlContainerCreateUpdateParameters
);
return updateResponse && (updateResponse.properties.resource as Collection);
}

View File

@@ -11,7 +11,7 @@ import { getPartitionKeyValue } from "./getPartitionKeyValue";
export const updateDocument = async (
collection: CollectionBase,
documentId: DocumentId,
newDocument: Item,
newDocument: Item
): Promise<Item> => {
const entityName = getEntityName();
const clearMessage = logConsoleProgress(`Updating ${entityName} ${documentId.id()}`);

View File

@@ -152,7 +152,7 @@ const updateSqlContainerOffer = async (params: UpdateOfferParams): Promise<void>
resourceGroup,
accountName,
params.databaseId,
params.collectionId,
params.collectionId
);
} else if (params.migrateToManual) {
await migrateSqlContainerToManualThroughput(
@@ -160,7 +160,7 @@ const updateSqlContainerOffer = async (params: UpdateOfferParams): Promise<void>
resourceGroup,
accountName,
params.databaseId,
params.collectionId,
params.collectionId
);
} else {
const body: ThroughputSettingsUpdateParameters = createUpdateOfferBody(params);
@@ -170,7 +170,7 @@ const updateSqlContainerOffer = async (params: UpdateOfferParams): Promise<void>
accountName,
params.databaseId,
params.collectionId,
body,
body
);
}
};
@@ -185,7 +185,7 @@ const updateMongoCollectionOffer = async (params: UpdateOfferParams): Promise<vo
resourceGroup,
accountName,
params.databaseId,
params.collectionId,
params.collectionId
);
} else if (params.migrateToManual) {
await migrateMongoDBCollectionToManualThroughput(
@@ -193,7 +193,7 @@ const updateMongoCollectionOffer = async (params: UpdateOfferParams): Promise<vo
resourceGroup,
accountName,
params.databaseId,
params.collectionId,
params.collectionId
);
} else {
const body: ThroughputSettingsUpdateParameters = createUpdateOfferBody(params);
@@ -203,7 +203,7 @@ const updateMongoCollectionOffer = async (params: UpdateOfferParams): Promise<vo
accountName,
params.databaseId,
params.collectionId,
body,
body
);
}
};
@@ -218,7 +218,7 @@ const updateCassandraTableOffer = async (params: UpdateOfferParams): Promise<voi
resourceGroup,
accountName,
params.databaseId,
params.collectionId,
params.collectionId
);
} else if (params.migrateToManual) {
await migrateCassandraTableToManualThroughput(
@@ -226,7 +226,7 @@ const updateCassandraTableOffer = async (params: UpdateOfferParams): Promise<voi
resourceGroup,
accountName,
params.databaseId,
params.collectionId,
params.collectionId
);
} else {
const body: ThroughputSettingsUpdateParameters = createUpdateOfferBody(params);
@@ -236,7 +236,7 @@ const updateCassandraTableOffer = async (params: UpdateOfferParams): Promise<voi
accountName,
params.databaseId,
params.collectionId,
body,
body
);
}
};
@@ -251,7 +251,7 @@ const updateGremlinGraphOffer = async (params: UpdateOfferParams): Promise<void>
resourceGroup,
accountName,
params.databaseId,
params.collectionId,
params.collectionId
);
} else if (params.migrateToManual) {
await migrateGremlinGraphToManualThroughput(
@@ -259,7 +259,7 @@ const updateGremlinGraphOffer = async (params: UpdateOfferParams): Promise<void>
resourceGroup,
accountName,
params.databaseId,
params.collectionId,
params.collectionId
);
} else {
const body: ThroughputSettingsUpdateParameters = createUpdateOfferBody(params);
@@ -269,7 +269,7 @@ const updateGremlinGraphOffer = async (params: UpdateOfferParams): Promise<void>
accountName,
params.databaseId,
params.collectionId,
body,
body
);
}
};
@@ -404,7 +404,7 @@ const updateOfferWithSDK = async (params: UpdateOfferParams): Promise<Offer> =>
const sdkResponse = await client()
.offer(params.currentOffer.id)
// TODO Remove casting when SDK types are fixed (https://github.com/Azure/azure-sdk-for-js/issues/10660)
.replace(newOffer as unknown as OfferDefinition, options);
.replace((newOffer as unknown) as OfferDefinition, options);
return parseSDKOfferResponse(sdkResponse);
};

View File

@@ -16,7 +16,7 @@ import { handleError } from "../ErrorHandlingUtils";
export async function updateStoredProcedure(
databaseId: string,
collectionId: string,
storedProcedure: StoredProcedureDefinition,
storedProcedure: StoredProcedureDefinition
): Promise<StoredProcedureDefinition & Resource> {
const clearMessage = logConsoleProgress(`Updating stored procedure ${storedProcedure.id}`);
try {
@@ -29,7 +29,7 @@ export async function updateStoredProcedure(
databaseAccount.name,
databaseId,
collectionId,
storedProcedure.id,
storedProcedure.id
);
if (getResponse?.properties?.resource) {
@@ -46,7 +46,7 @@ export async function updateStoredProcedure(
databaseId,
collectionId,
storedProcedure.id,
createSprocParams,
createSprocParams
);
return rpResponse && (rpResponse.properties?.resource as StoredProcedureDefinition & Resource);
}

View File

@@ -10,7 +10,7 @@ import { handleError } from "../ErrorHandlingUtils";
export async function updateTrigger(
databaseId: string,
collectionId: string,
trigger: SqlTriggerResource,
trigger: SqlTriggerResource
): Promise<SqlTriggerResource | TriggerDefinition> {
const clearMessage = logConsoleProgress(`Updating trigger ${trigger.id}`);
const { authType, apiType, subscriptionId, resourceGroup, databaseAccount } = userContext;
@@ -22,7 +22,7 @@ export async function updateTrigger(
databaseAccount.name,
databaseId,
collectionId,
trigger.id,
trigger.id
);
if (getResponse?.properties?.resource) {
@@ -39,7 +39,7 @@ export async function updateTrigger(
databaseId,
collectionId,
trigger.id,
createTriggerParams,
createTriggerParams
);
return rpResponse && rpResponse.properties?.resource;
}
@@ -51,7 +51,7 @@ export async function updateTrigger(
.database(databaseId)
.container(collectionId)
.scripts.trigger(trigger.id)
.replace(trigger as unknown as TriggerDefinition); // TODO: TypeScript does not like the SQL SDK trigger type
.replace((trigger as unknown) as TriggerDefinition); // TODO: TypeScript does not like the SQL SDK trigger type
return response?.resource;
} catch (error) {
handleError(error, "UpdateTrigger", `Error while updating trigger ${trigger.id}`);

View File

@@ -16,7 +16,7 @@ import { handleError } from "../ErrorHandlingUtils";
export async function updateUserDefinedFunction(
databaseId: string,
collectionId: string,
userDefinedFunction: UserDefinedFunctionDefinition,
userDefinedFunction: UserDefinedFunctionDefinition
): Promise<UserDefinedFunctionDefinition & Resource> {
const clearMessage = logConsoleProgress(`Updating user defined function ${userDefinedFunction.id}`);
const { authType, apiType, subscriptionId, resourceGroup, databaseAccount } = userContext;
@@ -28,7 +28,7 @@ export async function updateUserDefinedFunction(
databaseAccount.name,
databaseId,
collectionId,
userDefinedFunction.id,
userDefinedFunction.id
);
if (getResponse?.properties?.resource) {
@@ -45,7 +45,7 @@ export async function updateUserDefinedFunction(
databaseId,
collectionId,
userDefinedFunction.id,
createUDFParams,
createUDFParams
);
return rpResponse && (rpResponse.properties?.resource as UserDefinedFunctionDefinition & Resource);
}
@@ -63,7 +63,7 @@ export async function updateUserDefinedFunction(
handleError(
error,
"UpdateUserupdateUserDefinedFunction",
`Error while updating user defined function ${userDefinedFunction.id}`,
`Error while updating user defined function ${userDefinedFunction.id}`
);
throw error;
} finally {

View File

@@ -61,9 +61,6 @@ let configContext: Readonly<ConfigContext> = {
`^https:\\/\\/[\\.\\w]*ext\\.azure\\.(com|cn|us)$`,
`^https:\\/\\/[\\.\\w]*\\.ext\\.microsoftazure\\.de$`,
`^https:\\/\\/cosmos-db-dataexplorer-germanycentral\\.azurewebsites\\.de$`,
`^https:\\/\\/.*\\.fabric\\.microsoft\\.com$`,
`^https:\\/\\/.*\\.powerbi\\.com$`,
`^https:\\/\\/.*\\.analysis-df\\.net$`,
], // Webpack injects this at build time
gitSha: process.env.GIT_SHA,
hostedExplorerURL: "https://cosmos.azure.com/",
@@ -118,7 +115,7 @@ export function updateConfigContext(newContext: Partial<ConfigContext>): void {
if (
!validateEndpoint(
newContext.BACKEND_ENDPOINT,
configContext.allowedBackendEndpoints || defaultAllowedBackendEndpoints,
configContext.allowedBackendEndpoints || defaultAllowedBackendEndpoints
)
) {
delete newContext.BACKEND_ENDPOINT;

View File

@@ -38,7 +38,6 @@ export interface DatabaseAccountExtendedProperties {
locations?: DatabaseAccountResponseLocation[];
postgresqlEndpoint?: string;
publicNetworkAccess?: string;
enablePriorityBasedExecution?: boolean;
vcoreMongoEndpoint?: string;
}

View File

@@ -1,25 +0,0 @@
export type FabricMessage =
| {
type: "newContainer";
databaseName: string;
}
| {
type: "initialize";
connectionString: string | undefined;
}
| {
type: "openTab";
databaseName: string;
collectionName: string | undefined;
};
export type DataExploreMessage =
| "ready"
| {
type: number;
data: {
action: "LoadDatabases";
actionModifier: "success" | "start";
defaultExperience: "SQL";
};
};

View File

@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />

View File

@@ -191,7 +191,7 @@ export class Heatmap {
Heatmap.elementId,
this._getChartSettings(),
this._getLayoutSettings(),
this._getChartDisplaySettings(),
this._getChartDisplaySettings()
);
const plotDiv: any = document.getElementById(Heatmap.elementId);
plotDiv.on("plotly_click", (data: any) => {

View File

@@ -41,7 +41,7 @@ declare namespace DataTables {
*/
cell(
cellSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[],
modifier?: ObjectSelectorModifier,
modifier?: ObjectSelectorModifier
): CellMethods;
/**
@@ -54,7 +54,7 @@ declare namespace DataTables {
cell(
rowSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[],
cellSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[],
modifier?: ObjectSelectorModifier,
modifier?: ObjectSelectorModifier
): CellMethods;
/**
@@ -72,7 +72,7 @@ declare namespace DataTables {
*/
cells(
cellSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[],
modifier?: ObjectSelectorModifier,
modifier?: ObjectSelectorModifier
): CellsMethods;
/**
@@ -85,7 +85,7 @@ declare namespace DataTables {
cells(
rowSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[],
cellSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[],
modifier?: ObjectSelectorModifier,
modifier?: ObjectSelectorModifier
): CellsMethods;
//#endregion "Cell/Cells"
@@ -125,7 +125,7 @@ declare namespace DataTables {
* @param tableSelector Table selector.
*/
table(
tableSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[],
tableSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[]
): TableMethods;
/**
@@ -139,7 +139,7 @@ declare namespace DataTables {
* @param tableSelector Table selector.
*/
tables(
tableSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[],
tableSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[]
): TablesMethods;
//#endregion "Table/Tables"

View File

@@ -1001,7 +1001,7 @@ interface JQuery {
date: Date,
onSelect?: () => void,
settings?: JQueryUI.DatepickerOptions,
pos?: number[],
pos?: number[]
): JQuery;
/**
* Opens the datepicker in a dialog box.
@@ -1017,7 +1017,7 @@ interface JQuery {
date: Date,
onSelect?: () => void,
settings?: JQueryUI.DatepickerOptions,
pos?: MouseEvent,
pos?: MouseEvent
): JQuery;
/**
* Opens the datepicker in a dialog box.
@@ -1033,7 +1033,7 @@ interface JQuery {
date: string,
onSelect?: () => void,
settings?: JQueryUI.DatepickerOptions,
pos?: number[],
pos?: number[]
): JQuery;
/**
* Opens the datepicker in a dialog box.
@@ -1049,7 +1049,7 @@ interface JQuery {
date: string,
onSelect?: () => void,
settings?: JQueryUI.DatepickerOptions,
pos?: MouseEvent,
pos?: MouseEvent
): JQuery;
/**
* Returns the current date for the datepicker or null if no date has been selected.
@@ -1199,7 +1199,7 @@ interface JQuery {
datepicker(
methodName: "option",
optionName: "beforeShow",
beforeShowValue: (input: Element, inst: any) => JQueryUI.DatepickerOptions,
beforeShowValue: (input: Element, inst: any) => JQueryUI.DatepickerOptions
): JQuery;
/**
@@ -1716,14 +1716,14 @@ interface JQuery {
addClassName: string,
duration?: number,
easing?: string,
complete?: Function,
complete?: Function
): JQuery;
switchClass(
removeClassName: string,
addClassName: string,
duration?: string,
easing?: string,
complete?: Function,
complete?: Function
): JQuery;
toggleClass(className: string, duration?: number, easing?: string, complete?: Function): JQuery;

View File

@@ -80,25 +80,25 @@ interface JQueryXHR<T> extends XMLHttpRequest {
then(
doneCallbacks: JQueryPromiseXHRDoneCallback<T>,
failCallbacks?: JQueryPromiseXHRFailCallback<T>,
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromise;
then<UValue>(
doneCallbacks: { (data: T, textStatus: string, jqXHR: JQueryXHR<T>): UValue },
failCallbacks?: JQueryPromiseXHRFailCallback<T>,
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseV<UValue>;
then<UValue, UReject>(
doneCallbacks: { (data: T, textStatus: string, jqXHR: JQueryXHR<T>): UValue },
failCallbacks?: { (data: T, textStatus: string, jqXHR: JQueryXHR<T>): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, UReject>;
then<UReject>(
doneCallbacks: JQueryPromiseXHRDoneCallback<T>,
failCallbacks?: { (data: T, textStatus: string, jqXHR: JQueryXHR<T>): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<UReject>;
overrideMimeType(mimeType: string): void;
@@ -201,7 +201,7 @@ interface JQueryPromiseAny {
then(
doneCallbacks: { (...args: any[]): any },
failCallbacks: { (...args: any[]): any },
progressCallbacks?: { (...args: any[]): any },
progressCallbacks?: { (...args: any[]): any }
): JQueryPromiseAny;
}
@@ -215,39 +215,39 @@ interface JQueryPromise {
then<UValue, UReject>(
doneCallbacks: { (): UValue },
failCallbacks: { (): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, UReject>;
// U Pipe
then<UValue>(
doneCallbacks: { (): JQueryPromiseV<UValue> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseV<UValue>;
then(
doneCallbacks: { (): JQueryDeferred },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromise;
then(
doneCallbacks: { (): JQueryPromise },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromise;
// U Value
then<UValue>(
doneCallbacks: { (): UValue },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseV<UValue>;
then<UReject>(
doneCallbacks: { (): void },
failCallbacks: { (): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<UReject>;
then(doneCallbacks: { (): void }, failCallbacks?: { (): void }, progressCallbacks?: { (): void }): JQueryPromise;
@@ -263,39 +263,39 @@ interface JQueryPromiseV<TValue> {
then<UValue, UReject>(
doneCallbacks: { (arg: TValue): UValue },
failCallbacks: { (): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, UReject>;
// U Pipe
then<UValue>(
doneCallbacks: { (arg: TValue): JQueryDeferredV<UValue> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseV<UValue>;
then<UValue>(
doneCallbacks: { (arg: TValue): JQueryPromiseV<UValue> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseV<UValue>;
// U Value
then<UValue>(
doneCallbacks: { (arg: TValue): UValue },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseV<UValue>;
then<UReject>(
doneCallbacks: { (arg: TValue): void },
failCallbacks: { (): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<UReject>;
then(
doneCallbacks: { (arg: TValue): void },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromise;
}
@@ -309,39 +309,39 @@ interface JQueryPromiseN<TNotify> {
then<UValue, UReject>(
doneCallbacks: { (): UValue },
failCallbacks: { (): UReject },
progressCallbacks?: { (arg: TNotify): void },
progressCallbacks?: { (arg: TNotify): void }
): JQueryPromiseVR<UValue, UReject>;
// U Pipe
then(
doneCallbacks: { (): JQueryDeferredN<TNotify> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseN<TNotify>;
then(
doneCallbacks: { (): JQueryPromiseN<TNotify> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseN<TNotify>;
// U Value
then<UValue>(
doneCallbacks: { (): UValue },
failCallbacks?: { (): void },
progressCallbacks?: { (arg: TNotify): void },
progressCallbacks?: { (arg: TNotify): void }
): JQueryPromiseV<UValue>;
then<UReject>(
doneCallbacks: { (): void },
failCallbacks: { (): UReject },
progressCallbacks?: { (arg: TNotify): void },
progressCallbacks?: { (arg: TNotify): void }
): JQueryPromiseR<UReject>;
then(
doneCallbacks: { (): void },
failCallbacks?: { (): void },
progressCallbacks?: { (arg: TNotify): void },
progressCallbacks?: { (arg: TNotify): void }
): JQueryPromise;
}
@@ -357,25 +357,25 @@ interface JQueryPromiseNNNN<TNotify1, TNotify2, TNotify3, TNotify4> {
then<UValue, UReject>(
doneCallbacks: { (): UValue },
failCallbacks: { (): UReject },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void }
): JQueryPromiseVR<UValue, UReject>;
then<UValue>(
doneCallbacks: { (): UValue },
failCallbacks?: { (): void },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void }
): JQueryPromiseV<UValue>;
then<UReject>(
doneCallbacks: { (): void },
failCallbacks: { (): UReject },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void }
): JQueryPromiseR<UReject>;
then(
doneCallbacks: { (): void },
failCallbacks?: { (): void },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void }
): JQueryPromise;
}
@@ -389,39 +389,39 @@ interface JQueryPromiseVV<TValue1, TValue2> {
then<UValue, UReject>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): UValue },
failCallbacks: { (): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, UReject>;
// U Pipe
then<UValue1, UValue2>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): JQueryDeferredVV<UValue1, UValue2> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVV<UValue1, UValue2>;
then<UValue1, UValue2>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): JQueryPromiseVV<UValue1, UValue2> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVV<UValue1, UValue2>;
// U Value
then<UValue>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): UValue },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseV<UValue>;
then<UReject>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): void },
failCallbacks: { (): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<UReject>;
then(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): void },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromise;
}
@@ -437,39 +437,39 @@ interface JQueryPromiseVVV<TValue1, TValue2, TValue3> {
then<UValue, UReject>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): UValue },
failCallbacks: { (): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, UReject>;
// U Pipe
then<UValue1, UValue2, UValue3>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): JQueryDeferredVVV<UValue1, UValue2, UValue3> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVVV<UValue1, UValue2, UValue3>;
then<UValue1, UValue2, UValue3>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): JQueryPromiseVVV<UValue1, UValue2, UValue3> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVVV<UValue1, UValue2, UValue3>;
// U Value
then<UValue>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): UValue },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseV<UValue>;
then<UReject>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): void },
failCallbacks: { (): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<UReject>;
then(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): void },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromise;
}
@@ -483,45 +483,45 @@ interface JQueryPromiseVR<TValue, TReject> {
then<UValue, UReject>(
doneCallbacks: { (arg: TValue): JQueryPromiseVR<UValue, UReject> },
failCallbacks?: { (arg: TReject): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, UReject>;
then<UValue, UReject>(
doneCallbacks: { (arg: TValue): UValue },
failCallbacks?: { (arg: TReject): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, UReject>;
// U Pipe
then<UValue>(
doneCallbacks: { (arg: TValue): JQueryDeferredVR<UValue, TReject> },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, TReject>;
then<UValue>(
doneCallbacks: { (arg: TValue): JQueryPromiseVR<UValue, TReject> },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, TReject>;
// U Value
then<UValue>(
doneCallbacks: { (arg: TValue): UValue },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseV<UValue>;
then<UReject>(
doneCallbacks: { (arg: TValue): void },
failCallbacks?: { (arg: TReject): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<UReject>;
then(
doneCallbacks: { (arg: TValue): void },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromise;
}
@@ -535,39 +535,39 @@ interface JQueryPromiseVRN<TValue, TReject, TProgress> {
then<UValue, UReject>(
doneCallbacks: { (arg: TValue): UValue },
failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (arg: TProgress): void },
progressCallbacks?: { (arg: TProgress): void }
): JQueryPromiseVR<UValue, UReject>;
// U Pipe
then<UValue>(
doneCallbacks: { (arg: TValue): JQueryDeferredVRN<UValue, TReject, TProgress> },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVRN<UValue, TReject, TProgress>;
then<UValue>(
doneCallbacks: { (arg: TValue): JQueryPromiseVRN<UValue, TReject, TProgress> },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVRN<UValue, TReject, TProgress>;
// U Value
then<UValue>(
doneCallbacks: { (arg: TValue): UValue },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (arg: TProgress): void },
progressCallbacks?: { (arg: TProgress): void }
): JQueryPromiseV<UValue>;
then<UReject>(
doneCallbacks: { (arg: TValue): void },
failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (arg: TProgress): void },
progressCallbacks?: { (arg: TProgress): void }
): JQueryPromiseR<UReject>;
then(
doneCallbacks: { (arg: TValue): void },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (arg: TProgress): void },
progressCallbacks?: { (arg: TProgress): void }
): JQueryPromise;
}
@@ -581,32 +581,32 @@ interface JQueryPromiseR<TReject> {
then<UValue, UReject>(
doneCallbacks: { (): UValue },
failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, UReject>;
// U Pipe
then(
doneCallbacks: { (): JQueryDeferredR<TReject> },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<TReject>;
then(
doneCallbacks: { (): JQueryPromiseR<TReject> },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<TReject>;
then<UReject>(
doneCallbacks: { (): void },
failCallbacks?: { (arg: TReject): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<UReject>;
then(
doneCallbacks: { (): void },
failCallbacks: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromise;
}
@@ -629,7 +629,7 @@ interface JQueryDeferredAny {
then(
doneCallbacks: { (...args: any[]): any },
failCallbacks: { (...args: any[]): any },
progressCallbacks?: { (...args: any[]): any },
progressCallbacks?: { (...args: any[]): any }
): JQueryDeferredAny;
}
@@ -650,33 +650,33 @@ interface JQueryDeferred {
then<UValue, UReject>(
doneCallbacks: { (): UValue },
failCallbacks: { (): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, UReject>;
// U Pipe
then(
doneCallbacks: { (): JQueryDeferred },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromise;
then(
doneCallbacks: { (): JQueryPromise },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromise;
// U Value
then<UValue>(
doneCallbacks: { (): UValue },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseV<UValue>;
then<UReject>(
doneCallbacks: { (): void },
failCallbacks: { (): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<UReject>;
then(doneCallbacks: { (): void }, failCallbacks?: { (): void }, progressCallbacks?: { (): void }): JQueryPromise;
@@ -699,39 +699,39 @@ interface JQueryDeferredV<TValue> {
then<UValue, UReject>(
doneCallbacks: { (arg: TValue): UValue },
failCallbacks: { (): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, UReject>;
// U Pipe
then<UValue>(
doneCallbacks: { (arg: TValue): JQueryDeferredV<UValue> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseV<UValue>;
then<UValue>(
doneCallbacks: { (arg: TValue): JQueryPromiseV<UValue> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseV<UValue>;
// U Value
then<UValue>(
doneCallbacks: { (arg: TValue): UValue },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseV<UValue>;
then<UReject>(
doneCallbacks: { (arg: TValue): void },
failCallbacks: { (): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<UReject>;
then(
doneCallbacks: { (arg: TValue): void },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromise;
}
@@ -752,39 +752,39 @@ interface JQueryDeferredN<TNotify> {
then<UValue, UReject>(
doneCallbacks: { (): UValue },
failCallbacks: { (): UReject },
progressCallbacks?: { (arg: TNotify): void },
progressCallbacks?: { (arg: TNotify): void }
): JQueryPromiseVR<UValue, UReject>;
// U Pipe
then(
doneCallbacks: { (): JQueryDeferredN<TNotify> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseN<TNotify>;
then(
doneCallbacks: { (): JQueryPromiseN<TNotify> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseN<TNotify>;
// U Value
then<UValue>(
doneCallbacks: { (): UValue },
failCallbacks?: { (): void },
progressCallbacks?: { (arg: TNotify): void },
progressCallbacks?: { (arg: TNotify): void }
): JQueryPromiseV<UValue>;
then<UReject>(
doneCallbacks: { (): void },
failCallbacks: { (): UReject },
progressCallbacks?: { (arg: TNotify): void },
progressCallbacks?: { (arg: TNotify): void }
): JQueryPromiseR<UReject>;
then(
doneCallbacks: { (): void },
failCallbacks?: { (): void },
progressCallbacks?: { (arg: TNotify): void },
progressCallbacks?: { (arg: TNotify): void }
): JQueryPromise;
}
@@ -793,14 +793,14 @@ interface JQueryDeferredNNNN<TNotify1, TNotify2, TNotify3, TNotify4> {
arg1: TNotify1,
arg2: TNotify2,
arg3: TNotify3,
arg4: TNotify4,
arg4: TNotify4
): JQueryDeferredNNNN<TNotify1, TNotify2, TNotify3, TNotify4>;
notifyWith(
context: any,
arg1: TNotify1,
arg2: TNotify2,
arg3: TNotify3,
arg4: TNotify4,
arg4: TNotify4
): JQueryDeferredNNNN<TNotify1, TNotify2, TNotify3, TNotify4>;
always(...alwaysCallbacks: Array<{ (): void }>): JQueryDeferredNNNN<TNotify1, TNotify2, TNotify3, TNotify4>;
@@ -818,25 +818,25 @@ interface JQueryDeferredNNNN<TNotify1, TNotify2, TNotify3, TNotify4> {
then<UValue, UReject>(
doneCallbacks: { (): UValue },
failCallbacks: { (): UReject },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void }
): JQueryPromiseVR<UValue, UReject>;
then<UValue>(
doneCallbacks: { (): UValue },
failCallbacks?: { (): void },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void }
): JQueryPromiseV<UValue>;
then<UReject>(
doneCallbacks: { (): void },
failCallbacks: { (): UReject },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void }
): JQueryPromiseR<UReject>;
then(
doneCallbacks: { (): void },
failCallbacks?: { (): void },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void }
): JQueryPromise;
}
@@ -857,39 +857,39 @@ interface JQueryDeferredVV<TValue1, TValue2> {
then<UValue, UReject>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): UValue },
failCallbacks: { (): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, UReject>;
// U Pipe
then<UValue1, UValue2>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): JQueryDeferredVV<UValue1, UValue2> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVV<UValue1, UValue2>;
then<UValue1, UValue2>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): JQueryPromiseVV<UValue1, UValue2> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVV<UValue1, UValue2>;
// U Value
then<UValue>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): UValue },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseV<UValue>;
then<UReject>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): void },
failCallbacks: { (): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<UReject>;
then(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): void },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromise;
}
@@ -912,39 +912,39 @@ interface JQueryDeferredVVV<TValue1, TValue2, TValue3> {
then<UValue, UReject>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): UValue },
failCallbacks?: { (): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, UReject>;
// U Pipe
then<UValue1, UValue2, UValue3>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): JQueryDeferredVVV<UValue1, UValue2, UValue3> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVVV<UValue1, UValue2, UValue3>;
then<UValue1, UValue2, UValue3>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): JQueryPromiseVVV<UValue1, UValue2, UValue3> },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVVV<UValue1, UValue2, UValue3>;
// U Value
then<UValue>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): UValue },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseV<UValue>;
then<UReject>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): void },
failCallbacks?: { (): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<UReject>;
then(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): void },
failCallbacks?: { (): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromise;
}
@@ -965,39 +965,39 @@ interface JQueryDeferredVR<TValue, TReject> {
then<UValue, UReject>(
doneCallbacks: { (arg: TValue): UValue },
failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, UReject>;
// U Pipe
then<UValue>(
doneCallbacks: { (arg: TValue): JQueryDeferredVR<UValue, TReject> },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, TReject>;
then<UValue>(
doneCallbacks: { (arg: TValue): JQueryPromiseVR<UValue, TReject> },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, TReject>;
// U Value
then<UValue>(
doneCallbacks: { (arg: TValue): UValue },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseV<UValue>;
then<UReject>(
doneCallbacks: { (arg: TValue): void },
failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<UReject>;
then(
doneCallbacks: { (arg: TValue): void },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromise;
}
@@ -1018,39 +1018,39 @@ interface JQueryDeferredVRN<TValue, TReject, TNotify> {
then<UValue, UReject>(
doneCallbacks: { (arg: TValue): UValue },
failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (arg: TNotify): void },
progressCallbacks?: { (arg: TNotify): void }
): JQueryPromiseVR<UValue, UReject>;
// U Pipe
then<UValue>(
doneCallbacks: { (arg: TValue): JQueryDeferredVRN<UValue, TReject, TNotify> },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVRN<UValue, TReject, TNotify>;
then<UValue>(
doneCallbacks: { (arg: TValue): JQueryPromiseVRN<UValue, TReject, TNotify> },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVRN<UValue, TReject, TNotify>;
// U Value
then<UValue>(
doneCallbacks: { (arg: TValue): UValue },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (arg: TNotify): void },
progressCallbacks?: { (arg: TNotify): void }
): JQueryPromiseV<UValue>;
then<UReject>(
doneCallbacks: { (arg: TValue): void },
failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (arg: TNotify): void },
progressCallbacks?: { (arg: TNotify): void }
): JQueryPromiseR<UReject>;
then(
doneCallbacks: { (arg: TValue): void },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (arg: TNotify): void },
progressCallbacks?: { (arg: TNotify): void }
): JQueryPromise;
}
@@ -1071,32 +1071,32 @@ interface JQueryDeferredR<TReject> {
then<UValue, UReject>(
doneCallbacks: { (): UValue },
failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseVR<UValue, UReject>;
// U Pipe
then(
doneCallbacks: { (): JQueryDeferredR<TReject> },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<TReject>;
then(
doneCallbacks: { (): JQueryPromiseR<TReject> },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<TReject>;
then<UReject>(
doneCallbacks: { (): void },
failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromiseR<UReject>;
then(
doneCallbacks: { (): void },
failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void },
progressCallbacks?: { (): void }
): JQueryPromise;
}
@@ -1210,7 +1210,7 @@ interface JQueryWhen {
<T1, T2, T3>(
promise1: JQueryPromiseV<T1>,
promise2: JQueryPromiseV<T2>,
promise3: JQueryPromiseV<T3>,
promise3: JQueryPromiseV<T3>
): JQueryPromiseVVV<T1, T2, T3>;
(...deferreds: JQueryPromise[]): JQueryPromise;
apply($: JQueryStatic, deferreds: JQueryPromise[]): JQueryPromise;
@@ -1238,8 +1238,8 @@ interface JQueryStatic {
handler: (
options: JQueryAjaxSettings<T>,
originalOptions: JQueryAjaxSettings<T>,
jqXHR: JQueryXHR<T>,
) => JQueryTransport,
jqXHR: JQueryXHR<T>
) => JQueryTransport
): any;
get<T>(url: string, data?: any, success?: any, dataType?: any): JQueryXHR<T>;
@@ -1410,8 +1410,8 @@ interface JQueryTransport {
status: number,
statusText: string,
responses?: { [dataType: string]: any },
headers?: string,
) => any,
headers?: string
) => any
): any;
abort(): any;
}
@@ -1547,7 +1547,7 @@ interface JQuery {
step?: Function;
queue?: boolean;
specialEasing?: any;
},
}
): JQuery;
delay(duration: number, queueName?: string): JQuery;
@@ -1621,7 +1621,7 @@ interface JQuery {
hover(
handlerIn: (eventObject: JQueryEventObject) => any,
handlerOut: (eventObject: JQueryEventObject) => any,
handlerOut: (eventObject: JQueryEventObject) => any
): JQuery;
hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery;

View File

@@ -57,7 +57,7 @@ export const createDatabaseContextMenu = (container: Explorer, databaseId: strin
.getState()
.openSidePanel(
"Delete " + getDatabaseName(),
<DeleteDatabaseConfirmationPanel refreshDatabases={() => container.refreshAllDatabases()} />,
<DeleteDatabaseConfirmationPanel refreshDatabases={() => container.refreshAllDatabases()} />
),
label: `Delete ${getDatabaseName()}`,
styleClass: "deleteDatabaseMenuItem",
@@ -68,7 +68,7 @@ export const createDatabaseContextMenu = (container: Explorer, databaseId: strin
export const createCollectionContextMenuButton = (
container: Explorer,
selectedCollection: ViewModels.Collection,
selectedCollection: ViewModels.Collection
): TreeNodeMenuItem[] => {
const items: TreeNodeMenuItem[] = [];
if (userContext.apiType === "SQL" || userContext.apiType === "Gremlin") {
@@ -137,7 +137,7 @@ export const createCollectionContextMenuButton = (
.getState()
.openSidePanel(
"Delete " + getCollectionName(),
<DeleteCollectionConfirmationPane refreshDatabases={() => container.refreshAllDatabases()} />,
<DeleteCollectionConfirmationPane refreshDatabases={() => container.refreshAllDatabases()} />
);
},
label: `Delete ${getCollectionName()}`,
@@ -175,7 +175,7 @@ export const createSampleCollectionContextMenuButton = (): TreeNodeMenuItem[] =>
export const createStoreProcedureContextMenuItems = (
container: Explorer,
storedProcedure: StoredProcedure,
storedProcedure: StoredProcedure
): TreeNodeMenuItem[] => {
if (userContext.apiType === "Cassandra") {
return [];
@@ -206,7 +206,7 @@ export const createTriggerContextMenuItems = (container: Explorer, trigger: Trig
export const createUserDefinedFunctionContextMenuItems = (
container: Explorer,
userDefinedFunction: UserDefinedFunction,
userDefinedFunction: UserDefinedFunction
): TreeNodeMenuItem[] => {
if (userContext.apiType === "Cassandra") {
return [];

View File

@@ -203,9 +203,11 @@ export class CommandButtonComponent extends React.Component<CommandButtonCompone
}}
>
<div className="commandDropdown">
{this.props.children.map((c: CommandButtonComponentProps, index: number): JSX.Element => {
return CommandButtonComponent.renderButton(c, `${index}`);
})}
{this.props.children.map(
(c: CommandButtonComponentProps, index: number): JSX.Element => {
return CommandButtonComponent.renderButton(c, `${index}`);
}
)}
</div>
</div>
</div>
@@ -215,7 +217,7 @@ export class CommandButtonComponent extends React.Component<CommandButtonCompone
public static renderLabel(
props: CommandButtonComponentProps,
key?: string,
refct?: (input: HTMLElement) => void,
refct?: (input: HTMLElement) => void
): JSX.Element {
if (!props.commandButtonLabel) {
return <React.Fragment />;

View File

@@ -1,9 +1,9 @@
import {
ChoiceGroup,
DefaultButton,
Dialog as FluentDialog,
DialogFooter,
DialogType,
Dialog as FluentDialog,
FontIcon,
IButtonProps,
IChoiceGroupProps,
@@ -15,7 +15,7 @@ import {
ProgressIndicator,
TextField,
} from "@fluentui/react";
import React, { FC, useEffect } from "react";
import React, { FC } from "react";
import create, { UseStore } from "zustand";
export interface DialogState {
@@ -33,7 +33,7 @@ export interface DialogState {
contentHtml?: JSX.Element,
choiceGroupProps?: IChoiceGroupProps,
textFieldProps?: TextFieldProps,
primaryButtonDisabled?: boolean,
primaryButtonDisabled?: boolean
) => void;
showOkModalDialog: (title: string, subText: string) => void;
}
@@ -50,7 +50,7 @@ export const useDialog: UseStore<DialogState> = create((set, get) => ({
showOkCancelModalDialog: state.showOkCancelModalDialog,
showOkModalDialog: state.showOkModalDialog,
}),
true, // TODO: This probably should not be true but its causing a prod bug so easier to just set the proper state above
true // TODO: This probably should not be true but its causing a prod bug so easier to just set the proper state above
),
showOkCancelModalDialog: (
title: string,
@@ -62,7 +62,7 @@ export const useDialog: UseStore<DialogState> = create((set, get) => ({
contentHtml?: JSX.Element,
choiceGroupProps?: IChoiceGroupProps,
textFieldProps?: TextFieldProps,
primaryButtonDisabled?: boolean,
primaryButtonDisabled?: boolean
): void =>
get().openDialog({
isModal: true,
@@ -157,20 +157,6 @@ export const Dialog: FC = () => {
contentHtml,
} = props || {};
const handleKeyDown = (event: KeyboardEvent) => {
if (event.key === "Escape") {
useDialog.getState().closeDialog();
}
};
useEffect(() => {
if (visible) {
document.addEventListener("keydown", handleKeyDown);
} else {
document.removeEventListener("keydown", handleKeyDown);
}
}, [visible]);
const dialogProps: IDialogProps = {
hidden: !visible,
dialogContentProps: {

View File

@@ -95,7 +95,7 @@ export class DiffEditorViewModel {
protected async createDiffEditor(
originalContent: string,
modifiedContent: string,
createCallback: (e: monaco.editor.IStandaloneDiffEditor) => void,
createCallback: (e: monaco.editor.IStandaloneDiffEditor) => void
) {
this.editorContainer = document.getElementById(this.getEditorId());
this.editorContainer.innerHTML = "";
@@ -116,7 +116,7 @@ export class DiffEditorViewModel {
const modifiedModel = monaco.editor.createModel(modifiedContent, language);
const diffEditor: monaco.editor.IStandaloneDiffEditor = monaco.editor.createDiffEditor(
this.editorContainer,
options,
options
);
diffEditor.setModel({
original: originalModel,

View File

@@ -84,7 +84,7 @@ export class EditorReact extends React.Component<EditorReactProps, EditorReactSt
(event: monaco.editor.ICursorSelectionChangedEvent) => {
const selectedContent: string = this.editor.getModel().getValueInRange(event.selection);
this.props.onContentSelected(selectedContent);
},
}
);
}
}

View File

@@ -32,12 +32,12 @@ export const FeaturePanelComponent: React.FunctionComponent = () => {
// React hooks to keep state
const [baseUrl, setBaseUrl] = React.useState<IDropdownOption>(
baseUrlOptions.find((o) => o.key === window.location.origin + window.location.pathname) || baseUrlOptions[0],
baseUrlOptions.find((o) => o.key === window.location.origin + window.location.pathname) || baseUrlOptions[0]
);
const [platform, setPlatform] = React.useState<IDropdownOption>(
urlParams.has("platform")
? platformOptions.find((o) => o.key === urlParams.get("platform")) || platformOptions[0]
: platformOptions[0],
: platformOptions[0]
);
const booleanFeatures: {
@@ -93,10 +93,10 @@ export const FeaturePanelComponent: React.FunctionComponent = () => {
];
booleanFeatures.forEach(
(f) => (f.reactState = React.useState<boolean>(urlParams.has(f.key) ? urlParams.get(f.key) === "true" : false)),
(f) => (f.reactState = React.useState<boolean>(urlParams.has(f.key) ? urlParams.get(f.key) === "true" : false))
);
stringFeatures.forEach(
(f) => (f.reactState = React.useState<string>(urlParams.has(f.key) ? urlParams.get(f.key) : undefined)),
(f) => (f.reactState = React.useState<string>(urlParams.has(f.key) ? urlParams.get(f.key) : undefined))
);
const buildUrl = (): string => {
@@ -121,14 +121,14 @@ export const FeaturePanelComponent: React.FunctionComponent = () => {
(f) =>
(f.onChange = (ev?: React.FormEvent<HTMLElement | HTMLInputElement>, checked?: boolean): void => {
f.reactState[1](checked);
}),
})
);
stringFeatures.forEach(
(f) =>
(f.onChange = (event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string): void => {
f.reactState[1](newValue);
}),
})
);
const onNotebookShortcut = (): void => {

View File

@@ -63,7 +63,7 @@ export class AddRepoComponent extends React.Component<AddRepoComponentProps, Add
private onTextFieldChange = (
event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>,
newValue?: string,
newValue?: string
): void => {
this.setState({
textFieldValue: newValue || "",
@@ -100,7 +100,7 @@ export class AddRepoComponent extends React.Component<AddRepoComponentProps, Add
{
dataExplorerArea: Constants.Areas.Notebook,
},
startKey,
startKey
);
return this.props.pinRepo(item);
}
@@ -115,7 +115,7 @@ export class AddRepoComponent extends React.Component<AddRepoComponentProps, Add
dataExplorerArea: Constants.Areas.Notebook,
error: AddRepoComponent.TextFieldErrorMessage,
},
startKey,
startKey
);
};
}

View File

@@ -211,7 +211,7 @@ export class ReposListComponent extends React.Component<ReposListComponentProps>
};
private onRenderBranchesDropdownList = (
props: ISelectableDroppableTextProps<IDropdown, HTMLDivElement>,
props: ISelectableDroppableTextProps<IDropdown, HTMLDivElement>
): JSX.Element => {
const renderedList: JSX.Element[] = [];
props.options.forEach((option: IDropdownOption) => {

View File

@@ -42,7 +42,7 @@ export class GalleryHeaderComponent extends React.Component {
{this.renderHeaderItem(
GalleryHeaderComponent.azureText,
GalleryHeaderComponent.openPortal,
GalleryHeaderComponent.mainHeaderTextProps,
GalleryHeaderComponent.mainHeaderTextProps
)}
</Stack.Item>
<Stack.Item>
@@ -52,7 +52,7 @@ export class GalleryHeaderComponent extends React.Component {
{this.renderHeaderItem(
GalleryHeaderComponent.cosmosdbText,
GalleryHeaderComponent.openDataExplorer,
GalleryHeaderComponent.headerItemTextProps,
GalleryHeaderComponent.headerItemTextProps
)}
</Stack.Item>
<Stack.Item>
@@ -62,7 +62,7 @@ export class GalleryHeaderComponent extends React.Component {
{this.renderHeaderItem(
GalleryHeaderComponent.galleryText,
() => "",
GalleryHeaderComponent.headerItemTextProps,
GalleryHeaderComponent.headerItemTextProps
)}
</Stack.Item>
<Stack.Item grow>
@@ -72,7 +72,7 @@ export class GalleryHeaderComponent extends React.Component {
{this.renderHeaderItem(
GalleryHeaderComponent.loginText,
GalleryHeaderComponent.openDataExplorer,
GalleryHeaderComponent.headerItemTextProps,
GalleryHeaderComponent.headerItemTextProps
)}
</Stack.Item>
</Stack>

View File

@@ -133,7 +133,7 @@ export class InputTypeaheadComponent extends React.Component<
private filterChoiceByValue = (choices: Item[], searchKeyword: string): Item[] => {
return choices.filter((choice) =>
// @ts-ignore
Object.keys(choice).some((key) => choice[key].toLowerCase().includes(searchKeyword.toLowerCase())),
Object.keys(choice).some((key) => choice[key].toLowerCase().includes(searchKeyword.toLowerCase()))
);
};

View File

@@ -133,7 +133,7 @@ export class JsonEditorViewModel extends WaitsForTemplateViewModel {
(event: monaco.editor.ICursorSelectionChangedEvent) => {
const selectedContent: string = this.editor.getModel().getValueInRange(event.selection);
this.params.selectedContent(selectedContent);
},
}
);
}

View File

@@ -90,7 +90,7 @@ export const GalleryCardComponent: FunctionComponent<GalleryCardComponentProps>
iconName: string,
title: string,
horizontalAlign: "right" | "left",
activate: () => void,
activate: () => void
): JSX.Element => {
return (
<TooltipHost
@@ -116,7 +116,7 @@ export const GalleryCardComponent: FunctionComponent<GalleryCardComponentProps>
HTMLAnchorElement | HTMLButtonElement | HTMLDivElement | BaseButton | Button | HTMLSpanElement,
MouseEvent
>,
activate: () => void,
activate: () => void
): void => {
event.stopPropagation();
event.preventDefault();
@@ -183,7 +183,7 @@ export const GalleryCardComponent: FunctionComponent<GalleryCardComponentProps>
isFavorite ? "HeartFill" : "Heart",
isFavorite ? "Unfavorite" : "Favorite",
"left",
isFavorite ? onUnfavoriteClick : onFavoriteClick,
isFavorite ? onUnfavoriteClick : onFavoriteClick
)}
{showDownload && generateIconButtonWithTooltip("Download", "Download", "left", onDownloadClick)}
@@ -192,8 +192,8 @@ export const GalleryCardComponent: FunctionComponent<GalleryCardComponentProps>
generateIconButtonWithTooltip("Delete", "Remove", "right", () =>
onDeleteClick(
() => setIsDeletingPublishedNotebook(true),
() => setIsDeletingPublishedNotebook(false),
),
() => setIsDeletingPublishedNotebook(false)
)
)}
</span>
</DocumentCardDetails>

View File

@@ -44,7 +44,7 @@ export const CodeOfConduct: FunctionComponent<CodeOfConductProps> = ({
error: getErrorMessage(error),
errorStack: getErrorStack(error),
},
startKey,
startKey
);
handleError(error, "CodeOfConduct/acceptCodeOfConduct", "Failed to accept code of conduct");

View File

@@ -155,8 +155,8 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
this.createPublicGalleryTab(
GalleryTab.PublicGallery,
this.state.publicNotebooks,
this.state.isCodeOfConductAccepted,
),
this.state.isCodeOfConductAccepted
)
);
}
tabs.push(this.createSamplesTab(GalleryTab.OfficialSamples, this.state.sampleNotebooks));
@@ -265,7 +265,7 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
private createPublicGalleryTab(
tab: GalleryTab,
data: IGalleryItem[],
acceptedCodeOfConduct: boolean,
acceptedCodeOfConduct: boolean
): GalleryTabInfo {
return {
tab,
@@ -285,7 +285,7 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
Favorite any notebook from the{" "}
<Link onClick={() => this.setState({ selectedTab: GalleryTab.OfficialSamples })}>official samples</Link> or{" "}
<Link onClick={() => this.setState({ selectedTab: GalleryTab.PublicGallery })}>public gallery</Link>
</>,
</>
);
}
return this.createSearchBarHeader(this.createCardsTabContent(data));
@@ -309,7 +309,7 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
You have not published anything to the{" "}
<Link onClick={() => this.setState({ selectedTab: GalleryTab.PublicGallery })}>public gallery</Link> yet
</>,
<>Publish your notebooks to share your work with other users</>,
<>Publish your notebooks to share your work with other users</>
);
}
return this.createPublishedNotebooksTabContent(data);
@@ -330,19 +330,19 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
this.createPublishedNotebooksSectionContent(
undefined,
"You have successfully published and shared the following notebook(s) to the public gallery.",
this.createCardsTabContent(published),
this.createCardsTabContent(published)
)}
{underReview?.length > 0 &&
this.createPublishedNotebooksSectionContent(
"Under Review",
"Content of a notebook you published is currently being scanned for illegal content. It will not be available to public gallery until the review is completed (may take a few days)",
this.createCardsTabContent(underReview),
this.createCardsTabContent(underReview)
)}
{removed?.length > 0 &&
this.createPublishedNotebooksSectionContent(
"Removed",
"These notebooks were found to contain illegal content and has been taken down.",
this.createPolicyViolationsListContent(removed),
this.createPolicyViolationsListContent(removed)
)}
</Stack>
);
@@ -353,7 +353,7 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
private createPublishedNotebooksSectionContent = (
title: string,
description: string,
content: JSX.Element,
content: JSX.Element
): JSX.Element => {
return (
<Stack tokens={{ childrenGap: 10 }}>
@@ -708,7 +708,7 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
private downloadItem = async (data: IGalleryItem): Promise<void> => {
GalleryUtils.downloadItem(this.props.container, this.props.junoClient, data, (item) =>
this.refreshSelectedTab(item),
this.refreshSelectedTab(item)
);
};
@@ -722,7 +722,7 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
this.refreshSelectedTab(item);
},
beforeDelete,
afterDelete,
afterDelete
);
};

View File

@@ -44,8 +44,7 @@ interface NotebookViewerComponentState {
export class NotebookViewerComponent
extends React.Component<NotebookViewerComponentProps, NotebookViewerComponentState>
implements DialogHost
{
implements DialogHost {
private clientManager: NotebookClientV2;
private notebookComponentBootstrapper: NotebookComponentBootstrapper;
@@ -98,7 +97,7 @@ export class NotebookViewerComponent
notebookId: this.props.galleryItem?.id,
isSample: this.props.galleryItem?.isSample,
},
startKey,
startKey
);
const notebook: Notebook = await response.json();
@@ -124,7 +123,7 @@ export class NotebookViewerComponent
error: getErrorMessage(error),
errorStack: getErrorStack(error),
},
startKey,
startKey
);
this.setState({ showProgressBar: false });
@@ -173,7 +172,7 @@ export class NotebookViewerComponent
public static getDerivedStateFromProps(
props: NotebookViewerComponentProps,
state: NotebookViewerComponentState,
state: NotebookViewerComponentState
): Partial<NotebookViewerComponentState> {
let galleryItem = props.galleryItem;
let isFavorite = props.isFavorite;
@@ -197,7 +196,7 @@ export class NotebookViewerComponent
msg: string,
okLabel: string,
onOk: () => void,
progressIndicatorProps?: IProgressIndicatorProps,
progressIndicatorProps?: IProgressIndicatorProps
): void {
useDialog.getState().openDialog({
isModal: true,
@@ -224,7 +223,7 @@ export class NotebookViewerComponent
progressIndicatorProps?: IProgressIndicatorProps,
choiceGroupProps?: IChoiceGroupProps,
textFieldProps?: TextFieldProps,
primaryButtonDisabled?: boolean,
primaryButtonDisabled?: boolean
): void {
useDialog.getState().openDialog({
isModal: true,
@@ -249,19 +248,19 @@ export class NotebookViewerComponent
private favoriteItem = async (): Promise<void> => {
GalleryUtils.favoriteItem(this.props.container, this.props.junoClient, this.state.galleryItem, (item) =>
this.setState({ galleryItem: item, isFavorite: true }),
this.setState({ galleryItem: item, isFavorite: true })
);
};
private unfavoriteItem = async (): Promise<void> => {
GalleryUtils.unfavoriteItem(this.props.container, this.props.junoClient, this.state.galleryItem, (item) =>
this.setState({ galleryItem: item, isFavorite: false }),
this.setState({ galleryItem: item, isFavorite: false })
);
};
private downloadItem = async (): Promise<void> => {
GalleryUtils.downloadItem(this.props.container, this.props.junoClient, this.state.galleryItem, (item) =>
this.setState({ galleryItem: item }),
this.setState({ galleryItem: item })
);
};

View File

@@ -66,7 +66,7 @@ export class QueriesGridComponent extends React.Component<QueriesGridComponentPr
public componentDidUpdate(prevProps: QueriesGridComponentProps, prevState: QueriesGridComponentState): void {
this.selection.setItems(
this.state.filteredResults,
!_.isEqual(prevState.filteredResults, this.state.filteredResults),
!_.isEqual(prevState.filteredResults, this.state.filteredResults)
);
this.queryFilter && this.queryFilter.focus();
const querySetupCompleted: boolean = !prevProps.saveQueryEnabled && this.props.saveQueryEnabled;
@@ -159,7 +159,7 @@ export class QueriesGridComponent extends React.Component<QueriesGridComponentPr
if (query) {
const filteredQueries: Query[] = this.state.queries.filter(
(savedQuery: Query) =>
savedQuery.queryName.indexOf(query) > -1 || savedQuery.queryName.toLowerCase().indexOf(query) > -1,
savedQuery.queryName.indexOf(query) > -1 || savedQuery.queryName.toLowerCase().indexOf(query) > -1
);
this.setState({
filteredResults: filteredQueries,
@@ -240,7 +240,7 @@ export class QueriesGridComponent extends React.Component<QueriesGridComponentPr
dataExplorerArea: Constants.Areas.ContextualPane,
paneTitle: title,
},
startKey,
startKey
);
} catch (error) {
TelemetryProcessor.traceFailure(
@@ -251,13 +251,13 @@ export class QueriesGridComponent extends React.Component<QueriesGridComponentPr
error: getErrorMessage(error),
errorStack: getErrorStack(error),
},
startKey,
startKey
);
}
await this.fetchSavedQueries(); // get latest state
},
"Cancel",
undefined,
undefined
);
},
},

View File

@@ -251,7 +251,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
if (userContext.apiType === "Mongo" && userContext?.databaseAccount) {
this.mongoDBCollectionResource = await readMongoDBCollectionThroughRP(
this.collection.databaseId,
this.collection.id(),
this.collection.id()
);
if (this.mongoDBCollectionResource) {
@@ -357,7 +357,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
error: getErrorMessage(error),
errorStack: getErrorStack(error),
},
startKey,
startKey
);
} finally {
this.props.settingsTab.isExecuting(false);
@@ -431,7 +431,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
dataExplorerArea: Constants.Areas.Tab,
tabTitle: this.props.settingsTab.tabTitle(),
},
this.props.settingsTab.onLoadStartKey,
this.props.settingsTab.onLoadStartKey
);
this.props.settingsTab.onLoadStartKey = undefined;
}
@@ -566,7 +566,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
this.collection.databaseId,
this.collection.id(),
this.state.conflictResolutionPolicyProcedure,
false,
false
);
}
@@ -640,7 +640,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
const conflictResolutionPolicyMode = parseConflictResolutionMode(conflictResolutionPolicy?.mode);
const conflictResolutionPolicyPath = conflictResolutionPolicy?.conflictResolutionPath;
const conflictResolutionPolicyProcedure = parseConflictResolutionProcedure(
conflictResolutionPolicy?.conflictResolutionProcedure,
conflictResolutionPolicy?.conflictResolutionProcedure
);
const geospatialConfigTypeString: string =
(this.collection.geospatialConfig && this.collection.geospatialConfig()?.type) || GeospatialConfigType.Geometry;
@@ -780,7 +780,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
dataExplorerArea: Constants.Areas.Tab,
tabTitle: this.props.settingsTab.tabTitle(),
},
startKey,
startKey
);
};
@@ -828,7 +828,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
const updatedCollection: DataModels.Collection = await updateCollection(
this.collection.databaseId,
this.collection.id(),
newCollection,
newCollection
);
this.collection.rawDataModel = updatedCollection;
this.collection.defaultTtl(updatedCollection.defaultTtl);
@@ -862,7 +862,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
this.mongoDBCollectionResource = await updateCollection(
this.collection.databaseId,
this.collection.id(),
newMongoCollection,
newMongoCollection
);
await this.refreshIndexTransformationProgress();
@@ -881,7 +881,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
dataExplorerArea: Constants.Areas.Tab,
tabTitle: this.props.settingsTab.tabTitle(),
},
startKey,
startKey
);
} catch (error) {
traceFailure(
@@ -895,7 +895,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
error: getErrorMessage(error),
errorStack: getErrorStack(error),
},
startKey,
startKey
);
throw error;
}
@@ -942,12 +942,12 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
dataExplorerArea: Constants.Areas.Tab,
tabTitle: this.props.settingsTab.tabTitle(),
},
startKey,
startKey
);
};
public getMongoIndexTabContent = (
mongoIndexingPolicyComponentProps: MongoIndexingPolicyComponentProps,
mongoIndexingPolicyComponentProps: MongoIndexingPolicyComponentProps
): JSX.Element => {
if (userContext.authType === AuthType.AAD) {
if (userContext.apiType === "Mongo") {

View File

@@ -179,7 +179,7 @@ export const getRuPriceBreakdown = (
serverId: string,
numberOfRegions: number,
isMultimaster: boolean,
isAutoscale: boolean,
isAutoscale: boolean
): PriceBreakdown => {
const hourlyPrice: number = computeRUUsagePriceHourly({
serverId: serverId,
@@ -207,7 +207,7 @@ export const getEstimatedSpendingElement = (
throughput: number,
numberOfRegions: number,
priceBreakdown: PriceBreakdown,
isAutoscale: boolean,
isAutoscale: boolean
): JSX.Element => {
const ruRange: string = isAutoscale ? throughput / 10 + " RU/s - " : "";
return (
@@ -279,7 +279,7 @@ export const getUpdateThroughputBeyondInstantLimitMessage = (instantMaximumThrou
export const getUpdateThroughputBeyondSupportLimitMessage = (
instantMaximumThroughput: number,
maximumThroughput: number,
maximumThroughput: number
): JSX.Element => {
return (
<>
@@ -333,15 +333,15 @@ const getCurrentThroughput = (
isAutoscale: boolean,
throughput: number,
throughputUnit: string,
targetThroughput?: number,
targetThroughput?: number
): string => {
if (targetThroughput) {
if (throughput) {
return isAutoscale
? `, Current autoscale throughput: ${Math.round(
throughput / 10,
throughput / 10
)} - ${throughput} ${throughputUnit}, Target autoscale throughput: ${Math.round(
targetThroughput / 10,
targetThroughput / 10
)} - ${targetThroughput} ${throughputUnit}`
: `, Current manual throughput: ${throughput} ${throughputUnit}, Target manual throughput: ${targetThroughput}`;
} else {
@@ -366,7 +366,7 @@ export const getThroughputApplyDelayedMessage = (
throughputUnit: string,
databaseName: string,
collectionName: string,
requestedThroughput: number,
requestedThroughput: number
): JSX.Element => (
<Text styles={infoAndToolTipTextStyle}>
The request to increase the throughput has successfully been submitted. This operation will take 1-3 business days
@@ -382,7 +382,7 @@ export const getThroughputApplyShortDelayMessage = (
throughput: number,
throughputUnit: string,
databaseName: string,
collectionName: string,
collectionName: string
): JSX.Element => (
<Text styles={infoAndToolTipTextStyle} id="throughputApplyShortDelayMessage">
A request to increase the throughput is currently in progress. This operation will take some time to complete.
@@ -398,7 +398,7 @@ export const getThroughputApplyLongDelayMessage = (
throughputUnit: string,
databaseName: string,
collectionName: string,
requestedThroughput: number,
requestedThroughput: number
): JSX.Element => (
<Text styles={infoAndToolTipTextStyle} id="throughputApplyLongDelayMessage">
A request to increase the throughput is currently in progress. This operation will take 1-3 business days to
@@ -480,7 +480,7 @@ export const mongoIndexTransformationRefreshingMessage: JSX.Element = (
export const renderMongoIndexTransformationRefreshMessage = (
progress: number,
performRefresh: () => void,
performRefresh: () => void
): JSX.Element => {
if (progress === 0) {
return (
@@ -516,7 +516,7 @@ export const getTextFieldStyles = (current: isDirtyTypes, baseline: isDirtyTypes
export const getChoiceGroupStyles = (
current: isDirtyTypes,
baseline: isDirtyTypes,
isHorizontal?: boolean,
isHorizontal?: boolean
): Partial<IChoiceGroupStyles> => ({
flexContainer: [
{

View File

@@ -68,20 +68,20 @@ export class ConflictResolutionComponent extends React.Component<ConflictResolut
private onConflictResolutionPolicyModeChange = (
event?: React.FormEvent<HTMLElement | HTMLInputElement>,
option?: IChoiceGroupOption,
option?: IChoiceGroupOption
): void =>
this.props.onConflictResolutionPolicyModeChange(
DataModels.ConflictResolutionMode[option.key as keyof typeof DataModels.ConflictResolutionMode],
DataModels.ConflictResolutionMode[option.key as keyof typeof DataModels.ConflictResolutionMode]
);
private onConflictResolutionPolicyPathChange = (
event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>,
newValue?: string,
newValue?: string
): void => this.props.onConflictResolutionPolicyPathChange(newValue);
private onConflictResolutionPolicyProcedureChange = (
event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>,
newValue?: string,
newValue?: string
): void => this.props.onConflictResolutionPolicyProcedureChange(newValue);
private getConflictResolutionModeComponent = (): JSX.Element => (
@@ -92,7 +92,7 @@ export class ConflictResolutionComponent extends React.Component<ConflictResolut
onChange={this.onConflictResolutionPolicyModeChange}
styles={getChoiceGroupStyles(
this.props.conflictResolutionPolicyMode,
this.props.conflictResolutionPolicyModeBaseline,
this.props.conflictResolutionPolicyModeBaseline
)}
/>
);
@@ -108,7 +108,7 @@ export class ConflictResolutionComponent extends React.Component<ConflictResolut
onRenderLabel={this.onRenderLwwComponentTextField}
styles={getTextFieldStyles(
this.props.conflictResolutionPolicyPath,
this.props.conflictResolutionPolicyPathBaseline,
this.props.conflictResolutionPolicyPathBaseline
)}
value={this.props.conflictResolutionPolicyPath}
onChange={this.onConflictResolutionPolicyPathChange}
@@ -126,7 +126,7 @@ export class ConflictResolutionComponent extends React.Component<ConflictResolut
onRenderLabel={this.onRenderCustomComponentTextField}
styles={getTextFieldStyles(
this.props.conflictResolutionPolicyProcedure,
this.props.conflictResolutionPolicyProcedureBaseline,
this.props.conflictResolutionPolicyProcedureBaseline
)}
value={this.props.conflictResolutionPolicyProcedure}
onChange={this.onConflictResolutionPolicyProcedureChange}

View File

@@ -35,7 +35,7 @@ export class IndexingPolicyRefreshComponent extends React.Component<
} else if (isIndexTransforming(this.props.indexTransformationProgress)) {
return renderMongoIndexTransformationRefreshMessage(
this.props.indexTransformationProgress,
this.onClickRefreshIndexingTransformationLink,
this.onClickRefreshIndexingTransformationLink
);
}
return undefined;

View File

@@ -40,12 +40,12 @@ export class AddMongoIndexComponent extends React.Component<AddMongoIndexCompone
(value: MongoIndexTypes) => ({
text: getMongoIndexTypeText(value),
key: value,
}),
})
);
private onDescriptionChange = (
event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>,
newValue?: string,
newValue?: string
): void => {
this.props.onIndexAddOrChange(newValue, this.props.type);
};

View File

@@ -90,7 +90,7 @@ describe("MongoIndexingPolicyComponent", () => {
indexToDropIsPresent: boolean,
isMongoIndexingPolicySaveable: boolean,
isMongoIndexingPolicyDiscardable: boolean,
mongoWarningNotificationMessage: string,
mongoWarningNotificationMessage: string
) => {
const addMongoIndexProps = {
mongoIndex: { key: { keys: ["sampleKey"] } },
@@ -107,7 +107,7 @@ describe("MongoIndexingPolicyComponent", () => {
expect(mongoIndexingPolicyComponent.isMongoIndexingPolicySaveable()).toEqual(isMongoIndexingPolicySaveable);
expect(mongoIndexingPolicyComponent.isMongoIndexingPolicyDiscardable()).toEqual(
isMongoIndexingPolicyDiscardable,
isMongoIndexingPolicyDiscardable
);
if (mongoWarningNotificationMessage) {
const elementAsString = renderToString(mongoIndexingPolicyComponent.getMongoWarningNotificationMessage());
@@ -115,7 +115,7 @@ describe("MongoIndexingPolicyComponent", () => {
} else {
expect(mongoIndexingPolicyComponent.getMongoWarningNotificationMessage()).toBeUndefined();
}
},
}
);
});
});

View File

@@ -130,7 +130,7 @@ export class MongoIndexingPolicyComponent extends React.Component<MongoIndexingP
public getMongoWarningNotificationMessage = (): JSX.Element => {
const warningMessage = this.props.indexesToAdd.find(
(addMongoIndexProps) => addMongoIndexProps.notification?.type === MongoNotificationType.Warning,
(addMongoIndexProps) => addMongoIndexProps.notification?.type === MongoNotificationType.Warning
)?.notification.message;
if (warningMessage) {
@@ -163,7 +163,7 @@ export class MongoIndexingPolicyComponent extends React.Component<MongoIndexingP
private getMongoIndexDisplayProps = (
mongoIndex: MongoIndex,
arrayPosition: number,
isCurrentIndex: boolean,
isCurrentIndex: boolean
): MongoIndexDisplayProps => {
const keys = mongoIndex?.key?.keys;
const type = getMongoIndexType(keys);
@@ -261,7 +261,7 @@ export class MongoIndexingPolicyComponent extends React.Component<MongoIndexingP
private renderIndexesToBeDropped = (): JSX.Element => {
const indexesToBeDropped = this.props.indexesToDrop.map((dropIndex, arrayPosition) =>
this.getMongoIndexDisplayProps(this.props.mongoIndexes[dropIndex], arrayPosition, false),
this.getMongoIndexDisplayProps(this.props.mongoIndexes[dropIndex], arrayPosition, false)
);
return (

View File

@@ -113,7 +113,7 @@ export class ScaleComponent extends React.Component<ScaleComponentProps> {
throughput,
throughputUnit,
this.databaseId,
this.collectionId,
this.collectionId
);
}
@@ -122,7 +122,7 @@ export class ScaleComponent extends React.Component<ScaleComponentProps> {
public getLongDelayMessage = (): JSX.Element => {
const matches: string[] = this.props.initialNotification?.description.match(
`Throughput update for (.*) ${throughputUnit}`,
`Throughput update for (.*) ${throughputUnit}`
);
const throughput = this.props.throughputBaseline;
@@ -134,7 +134,7 @@ export class ScaleComponent extends React.Component<ScaleComponentProps> {
throughputUnit,
this.databaseId,
this.collectionId,
targetThroughput,
targetThroughput
);
}
return <></>;

View File

@@ -145,7 +145,7 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
private onTimeToLiveSecondsChange = (
event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>,
newValue?: string,
newValue?: string
): void => {
const newTimeToLiveSeconds = getSanitizedInputValue(newValue, Int32.Max);
this.props.onDisplayedTtlSecondsChange(newTimeToLiveSeconds.toString());
@@ -154,18 +154,18 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
private onGeoSpatialConfigTypeChange = (
ev?: React.FormEvent<HTMLElement | HTMLInputElement>,
option?: IChoiceGroupOption,
option?: IChoiceGroupOption
): void =>
this.props.onGeoSpatialConfigTypeChange(GeospatialConfigType[option.key as keyof typeof GeospatialConfigType]);
private onAnalyticalStorageTtlSelectionChange = (
ev?: React.FormEvent<HTMLElement | HTMLInputElement>,
option?: IChoiceGroupOption,
option?: IChoiceGroupOption
): void => this.props.onAnalyticalStorageTtlSelectionChange(this.getTtlValue(option.key));
private onAnalyticalStorageTtlSecondsChange = (
event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>,
newValue?: string,
newValue?: string
): void => {
const newAnalyticalStorageTtlSeconds = getSanitizedInputValue(newValue, Int32.Max);
this.props.onAnalyticalStorageTtlSecondsChange(newAnalyticalStorageTtlSeconds);
@@ -173,7 +173,7 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
private onChangeFeedPolicyChange = (
ev?: React.FormEvent<HTMLElement | HTMLInputElement>,
option?: IChoiceGroupOption,
option?: IChoiceGroupOption
): void =>
this.props.onChangeFeedPolicyChange(ChangeFeedPolicyState[option.key as keyof typeof ChangeFeedPolicyState]);
@@ -218,7 +218,6 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
value={this.props.displayedTtlSeconds}
onChange={this.onTimeToLiveSecondsChange}
suffix="second(s)"
ariaLabel={`Time to live in seconds`}
/>
)}
</Stack>
@@ -240,7 +239,7 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
onChange={this.onAnalyticalStorageTtlSelectionChange}
styles={getChoiceGroupStyles(
this.props.analyticalStorageTtlSelection,
this.props.analyticalStorageTtlSelectionBaseline,
this.props.analyticalStorageTtlSelectionBaseline
)}
/>
{this.props.analyticalStorageTtlSelection === TtlType.On && (
@@ -248,7 +247,7 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
id="analyticalStorageTimeToLiveSeconds"
styles={getTextFieldStyles(
this.props.analyticalStorageTtlSeconds,
this.props.analyticalStorageTtlSecondsBaseline,
this.props.analyticalStorageTtlSecondsBaseline
)}
type="number"
required

View File

@@ -202,7 +202,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
userContext.portalEnv,
regions,
multimaster,
isDirty ? this.props.maxAutoPilotThroughput : undefined,
isDirty ? this.props.maxAutoPilotThroughput : undefined
);
} else {
estimatedSpend = this.getEstimatedManualSpendElement(
@@ -211,7 +211,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
userContext.portalEnv,
regions,
multimaster,
isDirty ? this.props.throughput : undefined,
isDirty ? this.props.throughput : undefined
);
}
return estimatedSpend;
@@ -222,7 +222,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
serverId: string,
numberOfRegions: number,
isMultimaster: boolean,
newThroughput?: number,
newThroughput?: number
): JSX.Element => {
const prices: PriceBreakdown = getRuPriceBreakdown(throughput, serverId, numberOfRegions, isMultimaster, true);
@@ -232,7 +232,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
serverId,
numberOfRegions,
isMultimaster,
true,
true
);
return (
<div>
@@ -275,7 +275,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
serverId: string,
numberOfRegions: number,
isMultimaster: boolean,
newThroughput?: number,
newThroughput?: number
): JSX.Element => {
const prices: PriceBreakdown = getRuPriceBreakdown(throughput, serverId, numberOfRegions, isMultimaster, false);
@@ -285,7 +285,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
serverId,
numberOfRegions,
isMultimaster,
true,
true
);
return (
<div>
@@ -331,7 +331,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
private onAutoPilotThroughputChange = (
event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>,
newValue?: string,
newValue?: string
): void => {
const newThroughput = getSanitizedInputValue(newValue);
this.props.onMaxAutoPilotThroughputChange(newThroughput);
@@ -339,7 +339,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
private onThroughputChange = (
event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>,
newValue?: string,
newValue?: string
): void => {
const newThroughput = getSanitizedInputValue(newValue);
if (this.overrideWithAutoPilotSettings()) {
@@ -354,7 +354,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
private onChoiceGroupChange = (
event?: React.FormEvent<HTMLElement | HTMLInputElement>,
option?: IChoiceGroupOption,
option?: IChoiceGroupOption
): void => {
this.props.onAutoPilotSelected(option.key === "true");
TelemetryProcessor.trace(Action.ToggleAutoscaleSetting, ActionModifiers.Mark, {
@@ -557,7 +557,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
case "requireSupport":
return getUpdateThroughputBeyondSupportLimitMessage(
this.props.instantMaximumThroughput,
this.props.softAllowedMaximumThroughput,
this.props.softAllowedMaximumThroughput
);
default:
return <></>;

View File

@@ -62,7 +62,6 @@ exports[`SubSettingsComponent analyticalTimeToLive hidden 1`] = `
}
/>
<StyledTextFieldBase
ariaLabel="Time to live in seconds"
id="timeToLiveSeconds"
max={2147483647}
min={1}
@@ -296,7 +295,6 @@ exports[`SubSettingsComponent analyticalTimeToLiveSeconds hidden 1`] = `
}
/>
<StyledTextFieldBase
ariaLabel="Time to live in seconds"
id="timeToLiveSeconds"
max={2147483647}
min={1}
@@ -585,7 +583,6 @@ exports[`SubSettingsComponent changeFeedPolicy hidden 1`] = `
}
/>
<StyledTextFieldBase
ariaLabel="Time to live in seconds"
id="timeToLiveSeconds"
max={2147483647}
min={1}
@@ -834,7 +831,6 @@ exports[`SubSettingsComponent renders 1`] = `
}
/>
<StyledTextFieldBase
ariaLabel="Time to live in seconds"
id="timeToLiveSeconds"
max={2147483647}
min={1}

View File

@@ -122,7 +122,7 @@ describe("SettingsUtils", () => {
notification = getMongoNotification(singleIndexDescription, MongoIndexTypes.Wildcard);
expect(notification.message).toEqual(
"Wildcard path is not present in the field name. Use a pattern like " + MongoWildcardPlaceHolder,
"Wildcard path is not present in the field name. Use a pattern like " + MongoWildcardPlaceHolder
);
expect(notification.type).toEqual(MongoNotificationType.Error);
});

View File

@@ -5,7 +5,7 @@ import Explorer from "../../Explorer";
export const container = new Explorer();
export const collection = {
export const collection = ({
container: container,
databaseId: "test",
id: ko.observable<string>("test"),
@@ -27,7 +27,7 @@ export const collection = {
offerReplacePending: false,
}),
conflictResolutionPolicy: ko.observable<DataModels.ConflictResolutionPolicy>(
{} as DataModels.ConflictResolutionPolicy,
{} as DataModels.ConflictResolutionPolicy
),
changeFeedPolicy: ko.observable<DataModels.ChangeFeedPolicy>({} as DataModels.ChangeFeedPolicy),
geospatialConfig: ko.observable<DataModels.GeospatialConfig>({} as DataModels.GeospatialConfig),
@@ -43,4 +43,4 @@ export const collection = {
readSettings: () => {
return;
},
} as unknown as ViewModels.Collection;
} as unknown) as ViewModels.Collection;

View File

@@ -122,7 +122,7 @@ describe("SmartUiComponent", () => {
getTranslation={(key: string) => {
return key;
}}
/>,
/>
);
await new Promise((resolve) => setTimeout(resolve, 0));
expect(wrapper).toMatchSnapshot();
@@ -153,7 +153,7 @@ describe("SmartUiComponent", () => {
getTranslation={(key: string) => {
return key;
}}
/>,
/>
);
await new Promise((resolve) => setTimeout(resolve, 0));
expect(wrapper).toMatchSnapshot();

View File

@@ -14,7 +14,3 @@
.throughputInputSpacing > :not(:last-child) {
margin-bottom: @DefaultSpace;
}
.capacitycalculator-link:focus{
text-decoration: underline;
outline-offset: 2px;
}

View File

@@ -25,7 +25,7 @@ describe("ThroughputInput Pane", () => {
it("should switch mode properly", () => {
wrapper.find('[aria-label="Manual database throughput"]').simulate("change");
expect(wrapper.find('[aria-label="Throughput header"]').at(0).text()).toBe(
"Container throughput (400 - unlimited RU/s)",
"Container throughput (400 - unlimited RU/s)"
);
wrapper.find('[aria-label="Autoscale database throughput"]').simulate("change");

View File

@@ -36,7 +36,7 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
}: ThroughputInputProps) => {
const [isAutoscaleSelected, setIsAutoScaleSelected] = useState<boolean>(true);
const [throughput, setThroughput] = useState<number>(
isFreeTier || isQuickstart ? AutoPilotUtils.autoPilotThroughput1K : AutoPilotUtils.autoPilotThroughput4K,
isFreeTier || isQuickstart ? AutoPilotUtils.autoPilotThroughput1K : AutoPilotUtils.autoPilotThroughput4K
);
const [isCostAcknowledged, setIsCostAcknowledged] = useState<boolean>(false);
const [throughputError, setThroughputError] = useState<string>("");
@@ -71,7 +71,7 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
setThroughputError(
`Your account is currently configured with a total throughput limit of ${throughputCap} RU/s. This update isn't possible because it would increase the total throughput to ${
totalThroughput + throughput * numberOfRegions
} RU/s. Change total throughput limit in cost management.`,
} RU/s. Change total throughput limit in cost management.`
);
setIsThroughputCapExceeded(true);
@@ -83,7 +83,7 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
setThroughputError(
`Your account is currently configured with a total throughput limit of ${throughputCap} RU/s. This update isn't possible because it would increase the total throughput to ${
totalThroughputUsed + newThroughput * numberOfRegions
} RU/s. Change total throughput limit in cost management.`,
} RU/s. Change total throughput limit in cost management.`
);
setIsThroughputCapExceeded(true);
return false;
@@ -151,7 +151,7 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
userContext.portalEnv,
numberOfRegions,
multimasterEnabled,
isAutoscaleSelected,
isAutoscaleSelected
);
};

View File

@@ -222,7 +222,7 @@ export class TreeNodeComponent extends React.Component<TreeNodeComponentProps, T
node.children.reduce(
(previous: boolean, child: TreeNode) =>
previous || (child.isSelected && child.isSelected()) || TreeNodeComponent.isAnyDescendantSelected(child),
false,
false
)
);
}

View File

@@ -9,11 +9,8 @@ import {
Tree,
TreeItem,
TreeItemLayout,
TreeOpenChangeData,
TreeOpenChangeEvent,
} from "@fluentui/react-components";
import { MoreHorizontal20Regular } from "@fluentui/react-icons";
import { tokens } from "@fluentui/react-theme";
import * as React from "react";
export interface TreeNode2MenuItem {
@@ -30,7 +27,7 @@ export interface TreeNode2 {
children?: TreeNode2[];
contextMenu?: TreeNode2MenuItem[];
iconSrc?: string;
isExpanded?: boolean;
// isExpanded?: boolean;
className?: string;
isAlphaSorted?: boolean;
// data?: any; // Piece of data corresponding to this node
@@ -40,7 +37,7 @@ export interface TreeNode2 {
isScrollable?: boolean;
isSelected?: () => boolean;
onClick?: () => void; // Only if a leaf, other click will expand/collapse
onExpanded?: () => Promise<void>;
onExpanded?: () => void;
onCollapsed?: () => void;
onContextMenuOpen?: () => void;
}
@@ -49,6 +46,7 @@ export interface TreeNode2ComponentProps {
node: TreeNode2;
className?: string;
treeNodeId: string;
globalOpenIds: string[];
}
const getTreeIcon = (iconSrc: string): JSX.Element => <img src={iconSrc} alt="" style={{ width: 20, height: 20 }} />;
@@ -56,8 +54,20 @@ const getTreeIcon = (iconSrc: string): JSX.Element => <img src={iconSrc} alt=""
export const TreeNode2Component: React.FC<TreeNode2ComponentProps> = ({
node,
treeNodeId,
globalOpenIds,
}: TreeNode2ComponentProps): JSX.Element => {
const [isLoading, setIsLoading] = React.useState<boolean>(false);
// const defaultOpenItems = node.isExpanded ? children?.map((child: TreeNode2) => child.label) : undefined;
const [isExpanded, setIsExpanded] = React.useState<boolean>(false);
// Compute whether node is expanded
React.useEffect(() => {
const isNowExpanded = globalOpenIds && globalOpenIds.includes(treeNodeId);
if (!isExpanded && isNowExpanded) {
// Catch the transition non-expanded to expanded
node.onExpanded?.();
}
setIsExpanded(isNowExpanded);
}, [globalOpenIds, treeNodeId, node, isExpanded]);
const getSortedChildren = (treeNode: TreeNode2): TreeNode2[] => {
if (!treeNode || !treeNode.children) {
@@ -85,24 +95,8 @@ export const TreeNode2Component: React.FC<TreeNode2ComponentProps> = ({
return unsortedChildren;
};
const onOpenChange = (_: TreeOpenChangeEvent, data: TreeOpenChangeData) => {
if (!node.isExpanded && data.open && node.onExpanded) {
// Catch the transition non-expanded to expanded
setIsLoading(true);
node.onExpanded?.().then(() => setIsLoading(false));
} else if (node.isExpanded && !data.open && node.onCollapsed) {
// Catch the transition expanded to non-expanded
node.onCollapsed?.();
}
};
return (
<TreeItem
value={treeNodeId}
itemType={node.children !== undefined ? "branch" : "leaf"}
style={{ height: "100%" }}
onOpenChange={onOpenChange}
>
<TreeItem value={treeNodeId} itemType={node.children !== undefined ? "branch" : "leaf"} style={{ height: "100%" }}>
<TreeItemLayout
className={node.className}
actions={
@@ -123,21 +117,22 @@ export const TreeNode2Component: React.FC<TreeNode2ComponentProps> = ({
</Menu>
)
}
expandIcon={isLoading ? <Spinner size="extra-tiny" /> : undefined}
expandIcon={node.isLoading ? <Spinner size="extra-tiny" /> : undefined}
iconBefore={node.iconSrc && getTreeIcon(node.iconSrc)}
style={{
backgroundColor: node.isSelected && node.isSelected() ? tokens.colorNeutralBackground1Selected : undefined,
}}
>
<span onClick={() => node.onClick?.()}>{node.label}</span>
</TreeItemLayout>
{!node.isLoading && node.children?.length > 0 && (
<Tree style={{ overflow: node.isScrollable ? "auto" : undefined }}>
<Tree
// defaultOpenItems={defaultOpenItems}
style={{ overflow: node.isScrollable ? "auto" : undefined }}
>
{getSortedChildren(node).map((childNode: TreeNode2) => (
<TreeNode2Component
key={childNode.label}
node={childNode}
treeNodeId={`${treeNodeId}/${childNode.label}`}
globalOpenIds={globalOpenIds}
/>
))}
</Tree>

View File

@@ -24,7 +24,7 @@ export class ContainerSampleGenerator {
*/
public static async createSampleGeneratorAsync(
container: Explorer,
isCopilot?: boolean,
isCopilot?: boolean
): Promise<ContainerSampleGenerator> {
const generator = new ContainerSampleGenerator(container);
let dataFileContent: any;
@@ -113,7 +113,7 @@ export class ContainerSampleGenerator {
} catch (error) {
NotificationConsoleUtils.logConsoleError(error);
}
}),
})
);
}
}

View File

@@ -101,7 +101,7 @@ export default class Explorer {
this.phoenixClient = new PhoenixClient(userContext?.databaseAccount?.id);
useNotebook.subscribe(
() => this.refreshCommandBarButtons(),
(state) => state.isNotebooksEnabledForAccount,
(state) => state.isNotebooksEnabledForAccount
);
this.queriesClient = new QueriesClient(this);
@@ -130,7 +130,7 @@ export default class Explorer {
useCommandBar.getState().setContextButtons([]);
}
},
(state) => state.openedTabs,
(state) => state.openedTabs
);
this.isTabsContentExpanded = ko.observable(false);
@@ -140,7 +140,7 @@ export default class Explorer {
(e) => {
e.preventDefault();
},
false,
false
);
$(() => {
@@ -162,13 +162,13 @@ export default class Explorer {
TelemetryProcessor.traceSuccess(
Action.InitializeDataExplorer,
{ dataExplorerArea: Constants.Areas.ResourceTree },
startKey,
startKey
);
useNotebook.subscribe(
async () => this.initiateAndRefreshNotebookList(),
(state) => [state.isNotebookEnabled, state.isRefreshed],
shallow,
shallow
);
this.resourceTree = new ResourceTreeAdapter(this);
@@ -226,7 +226,7 @@ export default class Explorer {
onPrimaryButtonClick: async () => {
const startTime = TelemetryProcessor.traceStart(Action.EnableAzureSynapseLink);
const clearInProgressMessage = logConsoleProgress(
"Enabling Azure Synapse Link for this account. This may take a few minutes before you can enable analytical store for this account.",
"Enabling Azure Synapse Link for this account. This may take a few minutes before you can enable analytical store for this account."
);
useNotebook.getState().setIsSynapseLinkUpdating(true);
useDialog.getState().closeDialog();
@@ -275,7 +275,7 @@ export default class Explorer {
const ONE_DAY_IN_MS = 86400000;
const isAccountNewerThanNinetyDays = isAccountNewerThanThresholdInMs(
userContext.databaseAccount?.systemData?.createdAt || "",
NINETY_DAYS_IN_MS,
NINETY_DAYS_IN_MS
);
const lastSubmitted: string = localStorage.getItem("lastSubmitted");
@@ -343,15 +343,15 @@ export default class Explorer {
{
dataExplorerArea: Constants.Areas.ResourceTree,
},
startKey,
startKey
);
const currentDatabases = useDatabases.getState().databases;
const deltaDatabases = this.getDeltaDatabases(databases, currentDatabases);
let updatedDatabases = currentDatabases.filter(
(database) => !deltaDatabases.toDelete.some((deletedDatabase) => deletedDatabase.id() === database.id()),
(database) => !deltaDatabases.toDelete.some((deletedDatabase) => deletedDatabase.id() === database.id())
);
updatedDatabases = [...updatedDatabases, ...deltaDatabases.toAdd].sort((db1, db2) =>
db1.id().localeCompare(db2.id()),
db1.id().localeCompare(db2.id())
);
useDatabases.setState({ databases: updatedDatabases });
await this.refreshAndExpandNewDatabases(deltaDatabases.toAdd, updatedDatabases);
@@ -364,7 +364,7 @@ export default class Explorer {
error: errorMessage,
errorStack: getErrorStack(error),
},
startKey,
startKey
);
logConsoleError(`Error while refreshing databases: ${errorMessage}`);
}
@@ -462,7 +462,7 @@ export default class Explorer {
.getState()
.showOkModalDialog(
"Connection Failed",
"We are unable to connect to the temporary workspace. Please try again in a few minutes. If the error persists, file a support ticket.",
"We are unable to connect to the temporary workspace. Please try again in a few minutes. If the error persists, file a support ticket."
);
}
throw error;
@@ -480,7 +480,7 @@ export default class Explorer {
private async setNotebookInfo(
shouldUseNotebookStates: boolean,
connectionInfo: IResponse<IPhoenixServiceInfo>,
connectionStatus: DataModels.ContainerConnectionInfo,
connectionStatus: DataModels.ContainerConnectionInfo
) {
const containerData = {
forwardingId: connectionInfo.data.forwardingId,
@@ -512,7 +512,7 @@ export default class Explorer {
if (!useNotebook.getState().isNotebookEnabled || !this.notebookManager?.notebookClient) {
handleError(
"Attempt to reset notebook workspace, but notebook is not enabled",
"Explorer/resetNotebookWorkspace",
"Explorer/resetNotebookWorkspace"
);
return;
}
@@ -540,7 +540,7 @@ export default class Explorer {
const { value: workspaces } = await listByDatabaseAccount(
userContext.subscriptionId,
userContext.resourceGroup,
userContext.databaseAccount.name,
userContext.databaseAccount.name
);
return workspaces && workspaces.length > 0 && workspaces.some((workspace) => workspace.name === "default");
} catch (error) {
@@ -608,7 +608,7 @@ export default class Explorer {
private getDeltaDatabases(
updatedDatabaseList: DataModels.Database[],
databases: ViewModels.Database[],
databases: ViewModels.Database[]
): {
toAdd: ViewModels.Database[];
toDelete: ViewModels.Database[];
@@ -616,19 +616,19 @@ export default class Explorer {
const newDatabases: DataModels.Database[] = _.filter(updatedDatabaseList, (database: DataModels.Database) => {
const databaseExists = _.some(
databases,
(existingDatabase: ViewModels.Database) => existingDatabase.id() === database.id,
(existingDatabase: ViewModels.Database) => existingDatabase.id() === database.id
);
return !databaseExists;
});
const databasesToAdd: ViewModels.Database[] = newDatabases.map(
(newDatabase: DataModels.Database) => new Database(this, newDatabase),
(newDatabase: DataModels.Database) => new Database(this, newDatabase)
);
const databasesToDelete: ViewModels.Database[] = [];
databases.forEach((database: ViewModels.Database) => {
const databasePresentInUpdatedList = _.some(
updatedDatabaseList,
(db: DataModels.Database) => db.id === database.id(),
(db: DataModels.Database) => db.id === database.id()
);
if (!databasePresentInUpdatedList) {
databasesToDelete.push(database);
@@ -640,7 +640,7 @@ export default class Explorer {
private async refreshAndExpandNewDatabases(
newDatabases: ViewModels.Database[],
databases: ViewModels.Database[],
databases: ViewModels.Database[]
): Promise<void> {
// we reload collections for all databases so the resource tree reflects any collection-level changes
// i.e addition of stored procedures, etc.
@@ -669,9 +669,9 @@ export default class Explorer {
TelemetryProcessor.traceSuccess(
Action.LoadCollections,
{ dataExplorerArea: Constants.Areas.ResourceTree },
startKey,
startKey
);
}),
})
);
} catch (error) {
TelemetryProcessor.traceFailure(
@@ -681,7 +681,7 @@ export default class Explorer {
error: getErrorMessage(error),
errorStack: getErrorStack(error),
},
startKey,
startKey
);
}
}
@@ -698,7 +698,7 @@ export default class Explorer {
name: string,
content: string,
parent: NotebookContentItem,
isGithubTree?: boolean,
isGithubTree?: boolean
): Promise<NotebookContentItem> {
if (!useNotebook.getState().isNotebookEnabled || !this.notebookManager?.notebookContentClient) {
const error = "Attempt to upload notebook, but notebook is not enabled";
@@ -758,7 +758,7 @@ export default class Explorer {
content: NotebookPaneContent,
notebookContentRef?: string,
onTakeSnapshot?: (request: SnapshotRequest) => void,
onClosePanel?: () => void,
onClosePanel?: () => void
): Promise<void> {
if (this.notebookManager) {
await this.notebookManager.openPublishNotebookPane(
@@ -766,7 +766,7 @@ export default class Explorer {
content,
notebookContentRef,
onTakeSnapshot,
onClosePanel,
onClosePanel
);
}
}
@@ -803,7 +803,7 @@ export default class Explorer {
ViewModels.CollectionTabKind.NotebookV2,
(tab) =>
(tab as NotebookV2Tab).notebookPath &&
FileSystemUtil.isPathEqual((tab as NotebookV2Tab).notebookPath(), notebookContentItem.path),
FileSystemUtil.isPathEqual((tab as NotebookV2Tab).notebookPath(), notebookContentItem.path)
) as NotebookV2Tab[];
let notebookTab = notebookTabs && notebookTabs[0];
@@ -873,7 +873,7 @@ export default class Explorer {
this.notebookManager?.notebookContentClient.renameNotebook(notebookFile, input, isGithubTree)
}
notebookFile={notebookFile}
/>,
/>
);
}
}
@@ -903,7 +903,7 @@ export default class Explorer {
this.notebookManager?.notebookContentClient.createDirectory(notebookFile, input, isGithubTree)
}
notebookFile={parent}
/>,
/>
);
}
@@ -951,7 +951,7 @@ export default class Explorer {
(error) => {
logConsoleError(`Could not download notebook ${getErrorMessage(error)}`);
clearMessage();
},
}
);
}
@@ -1004,7 +1004,7 @@ export default class Explorer {
return this.notebookManager?.notebookContentClient.deleteContentItem(item, isGithubTree).then(
() => logConsoleInfo(`Successfully deleted: ${item.path}`),
(reason) => logConsoleError(`Failed to delete "${item.path}": ${JSON.stringify(reason)}`),
(reason) => logConsoleError(`Failed to delete "${item.path}": ${JSON.stringify(reason)}`)
);
}
@@ -1034,7 +1034,7 @@ export default class Explorer {
},
"Cancel",
undefined,
this.getNewNoteWarningText(),
this.getNewNoteWarningText()
);
}
} else {
@@ -1073,7 +1073,7 @@ export default class Explorer {
{
dataExplorerArea: Constants.Areas.Notebook,
},
startKey,
startKey
);
return this.openNotebook(newFile);
})
@@ -1088,7 +1088,7 @@ export default class Explorer {
error: errorMessage,
errorStack: getErrorStack(error),
},
startKey,
startKey
);
})
.finally(clearInProgressMessage);
@@ -1116,7 +1116,7 @@ export default class Explorer {
.getState()
.showOkModalDialog(
"Failed to connect",
"Failed to connect to temporary workspace. This could happen because of network issues. Please refresh the page and try again.",
"Failed to connect to temporary workspace. This could happen because of network issues. Please refresh the page and try again."
);
}
} else {
@@ -1182,7 +1182,7 @@ export default class Explorer {
selectedTab?: GalleryTabKind,
notebookUrl?: string,
galleryItem?: IGalleryItem,
isFavorite?: boolean,
isFavorite?: boolean
): Promise<void> {
const title = "Gallery";
const GalleryTab = await (await import(/* webpackChunkName: "GalleryTab" */ "./Tabs/GalleryTab")).default;
@@ -1211,8 +1211,8 @@ export default class Explorer {
notebookUrl,
galleryItem,
isFavorite,
},
),
}
)
);
}
}
@@ -1221,14 +1221,14 @@ export default class Explorer {
options: {
databaseId?: string;
isQuickstart?: boolean;
} = {},
} = {}
): Promise<void> {
if (userContext.apiType === "Cassandra") {
useSidePanel
.getState()
.openSidePanel(
"Add Table",
<CassandraAddCollectionPane explorer={this} cassandraApiClient={new CassandraAPIDataClient()} />,
<CassandraAddCollectionPane explorer={this} cassandraApiClient={new CassandraAPIDataClient()} />
);
} else {
const throughputCap = userContext.databaseAccount?.properties.capacity?.totalThroughputLimit;
@@ -1298,7 +1298,7 @@ export default class Explorer {
},
"Cancel",
undefined,
this.getNewNoteWarningText(),
this.getNewNoteWarningText()
);
} else {
parent = parent || this.resourceTree.myNotebooksContentRoot;
@@ -1311,7 +1311,7 @@ export default class Explorer {
.getState()
.openSidePanel(
"Upload file to notebook server",
<UploadFilePane uploadFile={(name: string, content: string) => this.uploadFile(name, content, parent)} />,
<UploadFilePane uploadFile={(name: string, content: string) => this.uploadFile(name, content, parent)} />
);
}

View File

@@ -298,7 +298,7 @@ export class D3ForceGraph implements GraphRenderer {
if (this.uniqueValues.length === D3ForceGraph.MAX_COLOR_NB) {
this.errorMsgs.push(
`Number of unique values for property ${key} exceeds maximum (${D3ForceGraph.MAX_COLOR_NB})`,
`Number of unique values for property ${key} exceeds maximum (${D3ForceGraph.MAX_COLOR_NB})`
);
// ignore rest of values
break;
@@ -347,14 +347,14 @@ export class D3ForceGraph implements GraphRenderer {
return d.id;
})
.distance(D3ForceGraph.FORCE_LINK_DISTANCE)
.strength(D3ForceGraph.FORCE_LINK_STRENGTH),
.strength(D3ForceGraph.FORCE_LINK_STRENGTH)
)
.force("charge", forceManyBody())
.force(
"collide",
forceCollide(D3ForceGraph.FORCE_COLLIDE_RADIUS)
.strength(D3ForceGraph.FORCE_COLLIDE_STRENGTH)
.iterations(D3ForceGraph.FORCE_COLLIDE_ITERATIONS),
.iterations(D3ForceGraph.FORCE_COLLIDE_ITERATIONS)
);
}
@@ -695,7 +695,7 @@ export class D3ForceGraph implements GraphRenderer {
}) as any)
.on("end", ((e: D3DragEvent<SVGGElement, D3Node, unknown>, d: D3Node) => {
return this.dragended(d, e);
}) as any),
}) as any)
)
.on("mouseover", (_: MouseEvent, d: D3Node) => {
if (this.isHighlightDisabled || this.selectedNode || this.isDragging) {
@@ -867,7 +867,7 @@ export class D3ForceGraph implements GraphRenderer {
select(e.target as any).classed("active", false);
}) as any)
.attr("visibility", (d: D3Node) =>
!d._pagination || d._pagination.currentPage.start !== 0 ? "visible" : "hidden",
!d._pagination || d._pagination.currentPage.start !== 0 ? "visible" : "hidden"
);
parent
.append("rect")
@@ -921,7 +921,7 @@ export class D3ForceGraph implements GraphRenderer {
gaugeYOffset +
gaugeHeight / 2 +
D3ForceGraph.PAGINATION_LINE1_Y_OFFSET_PX +
D3ForceGraph.PAGINATION_LINE2_Y_OFFSET_PX,
D3ForceGraph.PAGINATION_LINE2_Y_OFFSET_PX
)
.text((d: D3Node) => {
const pageInfo = d._pagination;
@@ -1100,7 +1100,7 @@ export class D3ForceGraph implements GraphRenderer {
default:
case NeighborType.BOTH:
return (this.graphDataWrapper.getSourcesForId(nodeId) || []).concat(
this.graphDataWrapper.getTargetsForId(nodeId),
this.graphDataWrapper.getTargetsForId(nodeId)
);
}
})(this.igraphConfig.showNeighborType);

View File

@@ -79,8 +79,8 @@ export class EditorNodePropertiesComponent extends React.Component<EditorNodePro
{this.props.editedProperties.readOnlyProperties.map((nodeProp: ViewModels.InputProperty) =>
ReadOnlyNodePropertiesComponent.renderReadOnlyPropertyKeyPair(
nodeProp.key,
nodeProp.values.map((val) => val.value),
),
nodeProp.values.map((val) => val.value)
)
)}
</React.Fragment>
);

View File

@@ -72,7 +72,7 @@ describe("Graph Data", () => {
testString: [{ id: "123", value: stringValue }],
},
},
"testString",
"testString"
);
expect(value).toEqual(stringValue);
@@ -88,7 +88,7 @@ describe("Graph Data", () => {
testString: [{ id: "123", value: numberValue }],
},
},
"testString",
"testString"
);
expect(value).toEqual(numberValue);
@@ -104,7 +104,7 @@ describe("Graph Data", () => {
testString: [{ id: "123", value: booleanValue }],
},
},
"testString",
"testString"
);
expect(value).toEqual(booleanValue);

View File

@@ -235,7 +235,7 @@ export class GraphData<V extends GremlinVertex, E extends GremlinEdge> {
*/
public static addToEdgeArray(
edge: GremlinShortInEdge | GremlinShortOutEdge,
edgeArray: (GremlinShortInEdge | GremlinShortOutEdge)[],
edgeArray: (GremlinShortInEdge | GremlinShortOutEdge)[]
) {
for (let i = 0; i < edgeArray.length; i++) {
if (edgeArray[i].id === edge.id) {

View File

@@ -54,7 +54,7 @@ describe("Check whether query result is edge-vertex array", () => {
e: { id: "ide", type: "edge" },
v: { id: "idv", type: "vertex" },
},
]),
])
).toBe(true);
});
});
@@ -207,9 +207,11 @@ describe("GraphExplorer", () => {
const gVRU = 123.456;
const disableMonacoEditor = (graphExplorer: GraphExplorer) => {
renderResultAsJsonStub = sinon.stub(graphExplorer, "renderResultAsJson").callsFake((): JSX.Element => {
return <div>[Monaco Editor Stub]</div>;
});
renderResultAsJsonStub = sinon.stub(graphExplorer, "renderResultAsJson").callsFake(
(): JSX.Element => {
return <div>[Monaco Editor Stub]</div>;
}
);
};
interface AjaxResponse {
@@ -225,7 +227,7 @@ describe("GraphExplorer", () => {
graphExplorer: GraphExplorer,
backendResponses: BackendResponses,
done: any,
ignoreD3Update: boolean,
ignoreD3Update: boolean
) => {
const complete = (): void => {
wrapper.update();
@@ -297,7 +299,7 @@ describe("GraphExplorer", () => {
docDBResponse: AjaxResponse,
backendResponses: BackendResponses,
done: any,
ignoreD3Update: boolean,
ignoreD3Update: boolean
): GraphExplorer => {
(queryDocuments as jest.Mock).mockImplementation((container: any, query: string, options: any) => {
return {
@@ -319,7 +321,7 @@ describe("GraphExplorer", () => {
headers: [] as any[],
requestCharge: gVRU,
});
},
}
);
const props: GraphExplorerProps = createMockProps();
wrapper = mount(<GraphExplorer {...props} />);

View File

@@ -346,7 +346,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
// DO NOT UPDATE Multi-value properties (as this is not supported)
if (p.values.length === 1) {
updateQueryFragment += `.Property("${GraphUtil.escapeDoubleQuotes(p.key)}", ${GraphUtil.getQuotedPropValue(
p.values[0],
p.values[0]
)})`;
}
});
@@ -374,12 +374,12 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
// TODO Wait for dropping to end. Can we drop all of them in a single query?
// Must execute these drops sequentially to avoid a 500 "{"Message":"An error has occurred."}"
promise = this.submitToBackend(
`g.V(${pkId}).properties("${GraphUtil.escapeDoubleQuotes(droppedKeys[0])}").drop()`,
`g.V(${pkId}).properties("${GraphUtil.escapeDoubleQuotes(droppedKeys[0])}").drop()`
);
for (let i = 1; i < droppedKeys.length; i++) {
promise = promise.then(() => {
return this.submitToBackend(
`g.V(${pkId}).properties("${GraphUtil.escapeDoubleQuotes(droppedKeys[i])}").drop()`,
`g.V(${pkId}).properties("${GraphUtil.escapeDoubleQuotes(droppedKeys[i])}").drop()`
);
});
}
@@ -413,7 +413,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
},
(error: string) => {
GraphExplorer.reportToConsole(ConsoleDataType.Error, "Failed to update vertex properties: " + error);
},
}
);
return promise;
@@ -458,9 +458,9 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
(error: string) => {
GraphExplorer.reportToConsole(
ConsoleDataType.Error,
`Failed to remove node (Gremlin failed to execute). id=${id} : ${error}`,
`Failed to remove node (Gremlin failed to execute). id=${id} : ${error}`
);
},
}
);
}
@@ -504,7 +504,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
outE: boolean,
vertex: GraphData.GremlinVertex,
startIndex: number,
pageSize: number,
pageSize: number
): Q.Promise<EdgeVertexPair[]> {
if (startIndex < 0) {
const error = `Attempt to fetch edge-vertex pairs with negative index: outE:${outE}, vertex id:${vertex.id}, startIndex:${startIndex}, pageSize:${pageSize}`;
@@ -528,7 +528,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
excludedEdgeIds,
startIndex,
pageSize,
GraphExplorer.WITHOUT_STEP_ARGS_MAX_CHARS,
GraphExplorer.WITHOUT_STEP_ARGS_MAX_CHARS
);
return this.submitToBackend(gremlinQuery).then((result: GremlinClient.GremlinRequestResult) => {
@@ -572,7 +572,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
public loadNeighborsPage(
vertex: GraphData.GremlinVertex,
graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>,
offsetIndex: number,
offsetIndex: number
): Q.Promise<GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>> {
const updateGraphData = () => {
// Cache results
@@ -627,44 +627,46 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
});
addedEdgesNb += pairsToAdd.length;
return pairs.length;
},
}
);
} else {
promise = Q.resolve(0);
}
promise = promise.then((outEPairsNb: number): Q.Promise<number> => {
const inEdgesToFetch = totalEdgesToFetch - outEPairsNb;
if (!vertex._inEAllLoaded && inEdgesToFetch > 0) {
let start: number;
if (offsetIndex <= vertex._outEdgeIds.length) {
start = 0;
promise = promise.then(
(outEPairsNb: number): Q.Promise<number> => {
const inEdgesToFetch = totalEdgesToFetch - outEPairsNb;
if (!vertex._inEAllLoaded && inEdgesToFetch > 0) {
let start: number;
if (offsetIndex <= vertex._outEdgeIds.length) {
start = 0;
} else {
start = offsetIndex - vertex._outEdgeIds.length;
}
return this.fetchEdgeVertexPairs(false, vertex, start, inEdgesToFetch).then(
(pairs: EdgeVertexPair[]): number => {
vertex._inEAllLoaded = pairs.length < inEdgesToFetch;
const pairsToAdd = pairs.slice(0, GraphExplorer.LOAD_PAGE_SIZE - outEPairsNb);
pairsToAdd.forEach((p: EdgeVertexPair) => {
GraphData.GraphData.addInE(vertex, p.e.label, p.e);
GraphUtil.addRootChildToGraph(vertex, p.v, graphData);
graphData.addEdge(p.e);
vertex._inEdgeIds.push(p.e.id);
// Cache results (graphdata now contains a vertex with outE's filled in)
this.edgeInfoCache.addVertex(graphData.getVertexById(p.v.id));
});
addedEdgesNb += pairsToAdd.length;
return outEPairsNb + pairs.length;
}
);
} else {
start = offsetIndex - vertex._outEdgeIds.length;
return Q.resolve(outEPairsNb);
}
return this.fetchEdgeVertexPairs(false, vertex, start, inEdgesToFetch).then(
(pairs: EdgeVertexPair[]): number => {
vertex._inEAllLoaded = pairs.length < inEdgesToFetch;
const pairsToAdd = pairs.slice(0, GraphExplorer.LOAD_PAGE_SIZE - outEPairsNb);
pairsToAdd.forEach((p: EdgeVertexPair) => {
GraphData.GraphData.addInE(vertex, p.e.label, p.e);
GraphUtil.addRootChildToGraph(vertex, p.v, graphData);
graphData.addEdge(p.e);
vertex._inEdgeIds.push(p.e.id);
// Cache results (graphdata now contains a vertex with outE's filled in)
this.edgeInfoCache.addVertex(graphData.getVertexById(p.v.id));
});
addedEdgesNb += pairsToAdd.length;
return outEPairsNb + pairs.length;
},
);
} else {
return Q.resolve(outEPairsNb);
}
});
);
return promise.then(() => {
if (offsetIndex >= GraphExplorer.LOAD_PAGE_SIZE || !vertex._outEAllLoaded || !vertex._inEAllLoaded) {
@@ -704,7 +706,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
}
GraphExplorer.reportToConsole(
ConsoleDataType.Info,
`Executed: ${cmd} ${GremlinClient.GremlinClient.getRequestChargeString(result.totalRequestCharge)}`,
`Executed: ${cmd} ${GremlinClient.GremlinClient.getRequestChargeString(result.totalRequestCharge)}`
);
return result;
},
@@ -713,7 +715,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
GraphExplorer.reportToConsole(ConsoleDataType.Error, `Gremlin query failed: ${cmd}`, err);
clearConsoleProgress();
throw err;
},
}
);
}
@@ -731,9 +733,9 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
maxItemCount: GraphExplorer.PAGE_ALL,
enableCrossPartitionQuery:
StorageUtility.LocalStorageUtility.getEntryString(
StorageUtility.StorageKey.IsCrossPartitionQueryEnabled,
StorageUtility.StorageKey.IsCrossPartitionQueryEnabled
) === "true",
} as FeedOptions,
} as FeedOptions
);
const response = await iterator.fetchNext();
@@ -742,7 +744,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
GraphExplorer.reportToConsole(
ConsoleDataType.Error,
`Failed to execute non-paged query ${query}. Reason:${error}`,
error,
error
);
return null;
}
@@ -754,7 +756,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
*/
public createNewEdge(e: GraphNewEdgeData): Q.Promise<unknown> {
const q = `g.V('${GraphUtil.escapeSingleQuotes(e.inputOutV)}').addE('${GraphUtil.escapeSingleQuotes(
e.label,
e.label
)}').To(g.V('${GraphUtil.escapeSingleQuotes(e.inputInV)}'))`;
return this.submitToBackend(q).then(
(result: GremlinClient.GremlinRequestResult) => {
@@ -787,9 +789,9 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
(error: string) => {
GraphExplorer.reportToConsole(
ConsoleDataType.Error,
"Failed to create edge (Gremlin query failed to execute): " + error,
"Failed to create edge (Gremlin query failed to execute): " + error
);
},
}
);
}
@@ -808,9 +810,9 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
(error: string) => {
GraphExplorer.reportToConsole(
ConsoleDataType.Error,
"Failed to remove edge (Gremlin query failed to execute): " + error,
"Failed to remove edge (Gremlin query failed to execute): " + error
);
},
}
);
}
@@ -958,7 +960,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
const title = "Failed to create vertex (Gremlin query failed to execute)";
GraphExplorer.reportToConsole(ConsoleDataType.Error, title + " :" + error);
throw { title: title, detail: error };
},
}
);
}
@@ -1033,7 +1035,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
dataExplorerArea: Constants.Areas.Tab,
tabTitle: "Graph",
},
this.props.onLoadStartKey,
this.props.onLoadStartKey
);
this.props.onLoadStartKeyChange(null);
}
@@ -1117,7 +1119,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
this.collectNodeProperties(
Object.keys(rootMap).map((id: string) => {
return rootMap[id];
}),
})
);
if (this.state.igraphConfigUiData.nodeProperties.indexOf(GraphExplorer.DISPLAY_DEFAULT_PROPERTY_KEY) !== -1) {
this.setState({
@@ -1159,8 +1161,8 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
const newIconsMap = {} as D3ForceGraph.D3GraphIconMap;
this.executeNonPagedDocDbQuery(
`SELECT c._graph_icon_property_value, c.format, c.icon FROM c WHERE c._graph_icon_set = "${GraphUtil.escapeDoubleQuotes(
iconSet,
)}"`,
iconSet
)}"`
).then(
(documents: DataModels.DocumentId[]) => {
$.each(
@@ -1170,7 +1172,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
data: doc["icon"],
format: doc["format"],
};
},
}
);
// Update graph configuration
@@ -1184,7 +1186,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
},
() => {
GraphExplorer.reportToConsole(ConsoleDataType.Error, `Failed to retrieve icons. iconSet:${iconSet}`);
},
}
);
}
@@ -1226,13 +1228,16 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
private getPossibleRootNodes(): LeftPane.CaptionId[] {
const key = this.state.igraphConfig.nodeCaption;
return $.map(this.state.rootMap, (value: any): LeftPane.CaptionId => {
const result = GraphData.GraphData.getNodePropValue(value, key);
return {
caption: result !== undefined ? result : value.id,
id: value.id,
};
});
return $.map(
this.state.rootMap,
(value: any): LeftPane.CaptionId => {
const result = GraphData.GraphData.getNodePropValue(value, key);
return {
caption: result !== undefined ? result : value.id,
id: value.id,
};
}
);
}
/**
@@ -1286,7 +1291,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
},
(reason: string) => {
GraphExplorer.reportToConsole(ConsoleDataType.Error, `Failed to select root node. Reason:${reason}`);
},
}
);
}
@@ -1454,7 +1459,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
() => {
GraphExplorer.reportToConsole(ConsoleDataType.Error, "Failed to retrieve list of possible vertices");
return [];
},
}
);
}
@@ -1480,7 +1485,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
// Reload neighbors in case we linked to a vertex that isn't loaded in the graph
const highlightedVertex = this.originalGraphData.getVertexById(this.state.highlightedNode.id);
return this.loadNeighborsPage(highlightedVertex, this.originalGraphData, 0);
}),
})
);
}
@@ -1612,7 +1617,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
id: string,
nodeCaption: string,
sources: NeighborVertexBasicInfo[],
targets: NeighborVertexBasicInfo[],
targets: NeighborVertexBasicInfo[]
): void {
// update neighbors
const gd = this.originalGraphData;
@@ -1663,9 +1668,11 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
}
this.setState({
possibleEdgeLabels: Object.keys(possibleEdgeLabels).map((value: string): InputTypeaheadComponent.Item => {
return { caption: value, value: value };
}),
possibleEdgeLabels: Object.keys(possibleEdgeLabels).map(
(value: string): InputTypeaheadComponent.Item => {
return { caption: value, value: value };
}
),
});
}
@@ -1707,7 +1714,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
*/
private updateGraphData(
graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>,
igraphConfig?: IGraphConfig,
igraphConfig?: IGraphConfig
) {
this.originalGraphData = graphData;
const gd = JSON.parse(JSON.stringify(this.originalGraphData));
@@ -1785,7 +1792,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
maxItemCount: GraphExplorer.ROOT_LIST_PAGE_SIZE,
enableCrossPartitionQuery:
LocalStorageUtility.getEntryString(StorageKey.IsCrossPartitionQueryEnabled) === "true",
} as FeedOptions,
} as FeedOptions
);
this.currentDocDBQueryInfo = {
iterator: iterator,
@@ -1796,7 +1803,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
} catch (error) {
GraphExplorer.reportToConsole(
ConsoleDataType.Error,
`Failed to execute CosmosDB query: ${query} reason:${error}`,
`Failed to execute CosmosDB query: ${query} reason:${error}`
);
throw error;
}
@@ -1813,14 +1820,14 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
})`;
const clearConsoleProgress = GraphExplorer.reportToConsole(
ConsoleDataType.InProgress,
`Executing: ${queryInfoStr}`,
`Executing: ${queryInfoStr}`
);
try {
const results: ViewModels.QueryResults = await queryDocumentsPage(
this.props.collectionId,
this.currentDocDBQueryInfo.iterator,
this.currentDocDBQueryInfo.index,
this.currentDocDBQueryInfo.index
);
clearConsoleProgress();
@@ -1829,10 +1836,10 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
RU = results.requestCharge.toString();
GraphExplorer.reportToConsole(
ConsoleDataType.Info,
`Executed: ${queryInfoStr} ${GremlinClient.GremlinClient.getRequestChargeString(RU)}`,
`Executed: ${queryInfoStr} ${GremlinClient.GremlinClient.getRequestChargeString(RU)}`
);
const pkIds: string[] = (results.documents || []).map((item: DataModels.DocumentId) =>
GraphExplorer.getPkIdFromDocumentId(item, this.props.collectionPartitionKeyProperty),
GraphExplorer.getPkIdFromDocumentId(item, this.props.collectionPartitionKeyProperty)
);
const arg = pkIds.join(",");
@@ -1870,7 +1877,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
});
this.setFilterQueryStatus(FilterQueryStatus.ErrorResult);
throw error;
},
}
);
promise

View File

@@ -103,19 +103,19 @@ describe("fetchEdgeVertexPairs()", () => {
it("should perform outE() query", () => {
expect(GraphUtil.createFetchEdgePairQuery(true, pkid, [], startIndex, pageSize, max)).toMatch(
new RegExp(OUT_E_MATCHER, "g"),
new RegExp(OUT_E_MATCHER, "g")
);
});
it("should perform inE() query", () => {
expect(GraphUtil.createFetchEdgePairQuery(false, pkid, [], startIndex, pageSize, max)).toMatch(
new RegExp(IN_E_MATCHER, "g"),
new RegExp(IN_E_MATCHER, "g")
);
});
it("should contain .has(id, without()) step which contains excludedIds", () => {
expect(GraphUtil.createFetchEdgePairQuery(true, pkid, ["id1", "id2"], startIndex, pageSize, max)).toMatch(
/\.has\(id, *without\('id1', *'id2'\)\)/g,
/\.has\(id, *without\('id1', *'id2'\)\)/g
);
});
@@ -127,7 +127,7 @@ describe("fetchEdgeVertexPairs()", () => {
const regex = new RegExp(`\\.limit\\(${pageSize}\\)`, "g");
expect(GraphUtil.createFetchEdgePairQuery(true, pkid, ["id1", "id2"], startIndex, pageSize, max)).toMatch(regex);
expect(GraphUtil.createFetchEdgePairQuery(true, pkid, ["id1", "id2"], startIndex, pageSize, max)).toMatch(
/^((?!range).)*$/g,
/^((?!range).)*$/g
);
});
@@ -140,7 +140,7 @@ describe("fetchEdgeVertexPairs()", () => {
const regex = new RegExp(`\\.range\\(${expectedStart}, *${expectedStart + size}\\)`, "g");
expect(GraphUtil.createFetchEdgePairQuery(true, pkid, excludedIds, start, size, smallLimit)).toMatch(regex);
expect(GraphUtil.createFetchEdgePairQuery(true, pkid, excludedIds, start, size, smallLimit)).toMatch(
/^((?!limit).)*$/g,
/^((?!limit).)*$/g
);
});
});

View File

@@ -26,7 +26,7 @@ export const getNeighborTitle = (neighbor: NeighborVertexBasicInfo): string => {
export const createEdgesfromNode = (
vertex: GraphData.GremlinVertex,
graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>,
newNodes?: { [id: string]: boolean },
newNodes?: { [id: string]: boolean }
): void => {
if (Object.prototype.hasOwnProperty.call(vertex, "outE")) {
const outE = vertex.outE;
@@ -104,7 +104,7 @@ export const createFetchEdgePairQuery = (
excludedEdgeIds: string[],
startIndex: number,
pageSize: number,
withoutStepArgMaxLenght: number,
withoutStepArgMaxLenght: number
): string => {
let gremlinQuery: string;
if (excludedEdgeIds.length > 0) {
@@ -135,7 +135,7 @@ export const createFetchEdgePairQuery = (
*/
export const trimGraph = (
currentRoot: GraphData.GremlinVertex,
graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>,
graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>
): void => {
const importantNodes = [currentRoot.id].concat(currentRoot._ancestorsId);
graphData.unloadAllVertices(importantNodes);
@@ -149,7 +149,7 @@ export const trimGraph = (
export const addRootChildToGraph = (
root: GraphData.GremlinVertex,
child: GraphData.GremlinVertex,
graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>,
graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>
): void => {
child._ancestorsId = (root._ancestorsId || []).concat([root.id]);
graphData.addVertex(child);

View File

@@ -145,7 +145,7 @@ describe("Gremlin Client", () => {
done(e);
}
},
(error) => done.fail(error),
(error) => done.fail(error)
)
.finally(() => {
logConsoleSpy.restore();
@@ -188,7 +188,7 @@ describe("Gremlin Client", () => {
done(e);
}
},
(error) => done.fail(error),
(error) => done.fail(error)
)
.finally(() => {
logConsoleSpy.restore();
@@ -225,7 +225,7 @@ describe("Gremlin Client", () => {
} catch (e) {
done(e);
}
},
}
);
gremlinClient.client.params.failureCallback(
@@ -234,7 +234,7 @@ describe("Gremlin Client", () => {
requestCharge: RU,
requestId: requestId,
},
error,
error
);
});
@@ -260,7 +260,7 @@ describe("Gremlin Client", () => {
requestCharge: undefined,
requestId: undefined,
},
error,
error
);
});
});

View File

@@ -61,7 +61,7 @@ export class GremlinClient {
if (!requestId || !this.pendingResults.has(requestId)) {
const errorMsg = `Error: ${errorMessage}, unknown requestId:${requestId} ${GremlinClient.getRequestChargeString(
result.requestCharge,
result.requestCharge
)}`;
handleError(errorMsg, GremlinClient.LOG_AREA);
@@ -90,7 +90,7 @@ export class GremlinClient {
deferred: deferred,
timeoutId: window.setTimeout(
() => this.abortPendingRequest(requestId, GremlinClient.TIMEOUT_ERROR_MSG, null),
GremlinClient.PENDING_REQUEST_TIMEOUT_MS,
GremlinClient.PENDING_REQUEST_TIMEOUT_MS
),
});
return deferred.promise;
@@ -126,7 +126,7 @@ export class GremlinClient {
this.pendingResults.delete(requestId);
const errorMsg = `Aborting pending request ${requestId}. Error:${error} ${GremlinClient.getRequestChargeString(
requestCharge,
requestCharge
)}`;
handleError(errorMsg, GremlinClient.LOG_AREA);
}

Some files were not shown because too many files have changed in this diff Show More