Update prettier to latest. Remove tslint (#1641)

* Rev up prettier

* Reformat

* Remove deprecated tslint

* Remove call to tslint and update package-lock.json
This commit is contained in:
Laurent Nguyen 2023-10-03 15:13:24 +00:00 committed by GitHub
parent e3c168b7be
commit 90c1439d34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
311 changed files with 1899 additions and 2194 deletions

65
package-lock.json generated
View File

@ -8488,12 +8488,6 @@
"integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==", "integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==",
"dev": true "dev": true
}, },
"builtin-modules": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
"integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
"dev": true
},
"bytes": { "bytes": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
@ -18934,7 +18928,7 @@
"json-stable-stringify-without-jsonify": { "json-stable-stringify-without-jsonify": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
"integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
"dev": true "dev": true
}, },
"json-stringify-safe": { "json-stringify-safe": {
@ -21406,9 +21400,9 @@
"integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ="
}, },
"prettier": { "prettier": {
"version": "2.2.1", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz",
"integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==",
"dev": true "dev": true
}, },
"pretty-error": { "pretty-error": {
@ -24632,57 +24626,6 @@
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}, },
"tslint": {
"version": "5.11.0",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.11.0.tgz",
"integrity": "sha1-mPMMAurjzecAYgHkwzywi0hYHu0=",
"dev": true,
"requires": {
"babel-code-frame": "^6.22.0",
"builtin-modules": "^1.1.1",
"chalk": "^2.3.0",
"commander": "^2.12.1",
"diff": "^3.2.0",
"glob": "^7.1.1",
"js-yaml": "^3.7.0",
"minimatch": "^3.0.4",
"resolve": "^1.3.2",
"semver": "^5.3.0",
"tslib": "^1.8.0",
"tsutils": "^2.27.2"
},
"dependencies": {
"tsutils": {
"version": "2.29.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
"integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==",
"dev": true,
"requires": {
"tslib": "^1.8.1"
}
}
}
},
"tslint-microsoft-contrib": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/tslint-microsoft-contrib/-/tslint-microsoft-contrib-6.0.0.tgz",
"integrity": "sha512-R//efwn+34IUjTJeYgNDAJdzG0jyLWIehygPt/PHuZAieTolFVS56FgeFW7DOLap9ghXzMiFPTmDgm54qaL7QA==",
"dev": true,
"requires": {
"tsutils": "^2.27.2 <2.29.0"
},
"dependencies": {
"tsutils": {
"version": "2.28.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.28.0.tgz",
"integrity": "sha512-bh5nAtW0tuhvOJnx1GLRn5ScraRLICGyJV5wJhtRWOLsxW70Kk5tZtpK3O/hW6LDnqKS9mlUMPZj9fEMJ0gxqA==",
"dev": true,
"requires": {
"tslib": "^1.8.1"
}
}
}
},
"tsutils": { "tsutils": {
"version": "3.20.0", "version": "3.20.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.20.0.tgz", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.20.0.tgz",

View File

@ -170,7 +170,7 @@
"monaco-editor-webpack-plugin": "1.7.0", "monaco-editor-webpack-plugin": "1.7.0",
"node-fetch": "2.6.1", "node-fetch": "2.6.1",
"playwright": "1.13.0", "playwright": "1.13.0",
"prettier": "2.2.1", "prettier": "3.0.3",
"process": "0.11.10", "process": "0.11.10",
"raw-loader": "0.5.1", "raw-loader": "0.5.1",
"react-dev-utils": "11.0.4", "react-dev-utils": "11.0.4",
@ -178,8 +178,6 @@
"sinon": "3.2.1", "sinon": "3.2.1",
"style-loader": "0.23.0", "style-loader": "0.23.0",
"ts-loader": "9.2.4", "ts-loader": "9.2.4",
"tslint": "5.11.0",
"tslint-microsoft-contrib": "6.0.0",
"typedoc": "0.20.36", "typedoc": "0.20.36",
"typescript": "4.3.4", "typescript": "4.3.4",
"url-loader": "1.1.1", "url-loader": "1.1.1",
@ -210,7 +208,7 @@
"compile:strict": "tsc -p ./tsconfig.strict.json", "compile:strict": "tsc -p ./tsconfig.strict.json",
"format": "prettier --write \"{src,test}/**/*.{ts,tsx,html}\" \"*.{js,html}\"", "format": "prettier --write \"{src,test}/**/*.{ts,tsx,html}\" \"*.{js,html}\"",
"format:check": "prettier --check \"{src,test}/**/*.{ts,tsx,html}\" \"*.{js,html}\"", "format:check": "prettier --check \"{src,test}/**/*.{ts,tsx,html}\" \"*.{js,html}\"",
"lint": "tslint --project tsconfig.json && eslint \"**/*.{ts,tsx}\"", "lint": "eslint \"**/*.{ts,tsx}\"",
"build:contracts": "npm run compile:contracts", "build:contracts": "npm run compile:contracts",
"strict:find": "node ./strict-null-checks/find.js", "strict:find": "node ./strict-null-checks/find.js",
"strict:add": "node ./strict-null-checks/auto-add.js", "strict:add": "node ./strict-null-checks/auto-add.js",

View File

@ -10,7 +10,7 @@ export class BindingHandlersRegisterer {
wrappedValueAccessor: () => any, wrappedValueAccessor: () => any,
allBindings?: ko.AllBindings, allBindings?: ko.AllBindings,
viewModel?: any, viewModel?: any,
bindingContext?: ko.BindingContext bindingContext?: ko.BindingContext,
) { ) {
const value = ko.unwrap(wrappedValueAccessor()); const value = ko.unwrap(wrappedValueAccessor());
bindingContext?.$data.isTemplateReady(value); 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. // If any of the ko observable change inside parameters, trigger a new render.
ko.computed(() => ko.toJSON(adapter.parameters)).subscribe(() => ko.computed(() => ko.toJSON(adapter.parameters)).subscribe(() =>
ReactDOM.render(adapter.renderComponent(), element) ReactDOM.render(adapter.renderComponent(), element),
); );
// Initial rendering at mount point // Initial rendering at mount point

View File

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

View File

@ -112,7 +112,7 @@ const getMediaInfo = (props: TransformMediaProps) => {
const mediaType = displayOrder.find( const mediaType = displayOrder.find(
(key) => (key) =>
Object.prototype.hasOwnProperty.call(output.data, 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) { if (mediaType) {

View File

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

View File

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

View File

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

View File

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

View File

@ -30,7 +30,7 @@ export function handleCachedDataMessage(message: any): void {
export function sendCachedDataMessage<TResponseDataModel>( export function sendCachedDataMessage<TResponseDataModel>(
messageType: MessageTypes, messageType: MessageTypes,
params: Object[], params: Object[],
timeoutInMs?: number timeoutInMs?: number,
): Q.Promise<TResponseDataModel> { ): Q.Promise<TResponseDataModel> {
let cachedDataPromise: CachedDataPromise<TResponseDataModel> = { let cachedDataPromise: CachedDataPromise<TResponseDataModel> = {
deferred: Q.defer<TResponseDataModel>(), deferred: Q.defer<TResponseDataModel>(),
@ -43,7 +43,7 @@ export function sendCachedDataMessage<TResponseDataModel>(
//TODO: Use telemetry to measure optimal time to resolve/reject promises //TODO: Use telemetry to measure optimal time to resolve/reject promises
return cachedDataPromise.deferred.promise.timeout( return cachedDataPromise.deferred.promise.timeout(
timeoutInMs || Constants.ClientDefaults.requestTimeoutMs, 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; } as Collection;
const documentId = ({ const documentId = {
partitionKeyHeader: () => "[]", partitionKeyHeader: () => "[]",
self: "db/testDB/db/testCollection/docs/testId", self: "db/testDB/db/testCollection/docs/testId",
partitionKeyProperties, partitionKeyProperties,
@ -47,7 +47,7 @@ const documentId = ({
kind: "Hash", kind: "Hash",
version: 1, version: 1,
}, },
} as unknown) as DocumentId; } as unknown as DocumentId;
const databaseAccount = { const databaseAccount = {
id: "foo", id: "foo",
@ -83,7 +83,7 @@ describe("MongoProxyClient", () => {
queryDocuments(databaseId, collection, true, "{}"); queryDocuments(databaseId, collection, true, "{}");
expect(window.fetch).toHaveBeenCalledWith( 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", "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, "{}"); queryDocuments(databaseId, collection, true, "{}");
expect(window.fetch).toHaveBeenCalledWith( 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", "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); readDocument(databaseId, collection, documentId);
expect(window.fetch).toHaveBeenCalledWith( 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", "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); readDocument(databaseId, collection, documentId);
expect(window.fetch).toHaveBeenCalledWith( 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", "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); readDocument(databaseId, collection, documentId);
expect(window.fetch).toHaveBeenCalledWith( 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", "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); readDocument(databaseId, collection, documentId);
expect(window.fetch).toHaveBeenCalledWith( 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", "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, "{}"); updateDocument(databaseId, collection, documentId, "{}");
expect(window.fetch).toHaveBeenCalledWith( 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", "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, "{}"); updateDocument(databaseId, collection, documentId, "{}");
expect(window.fetch).toHaveBeenCalledWith( 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", "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); deleteDocument(databaseId, collection, documentId);
expect(window.fetch).toHaveBeenCalledWith( 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", "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); deleteDocument(databaseId, collection, documentId);
expect(window.fetch).toHaveBeenCalledWith( 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", "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, collection: Collection,
isResourceList: boolean, isResourceList: boolean,
query: string, query: string,
continuationToken?: string continuationToken?: string,
): Promise<QueryResponse> { ): Promise<QueryResponse> {
const { databaseAccount } = userContext; const { databaseAccount } = userContext;
const resourceEndpoint = databaseAccount.properties.mongoEndpoint || databaseAccount.properties.documentEndpoint; const resourceEndpoint = databaseAccount.properties.mongoEndpoint || databaseAccount.properties.documentEndpoint;
@ -121,7 +121,7 @@ export function queryDocuments(
export function readDocument( export function readDocument(
databaseId: string, databaseId: string,
collection: Collection, collection: Collection,
documentId: DocumentId documentId: DocumentId,
): Promise<DataModels.DocumentId> { ): Promise<DataModels.DocumentId> {
const { databaseAccount } = userContext; const { databaseAccount } = userContext;
const resourceEndpoint = databaseAccount.properties.mongoEndpoint || databaseAccount.properties.documentEndpoint; const resourceEndpoint = databaseAccount.properties.mongoEndpoint || databaseAccount.properties.documentEndpoint;
@ -152,7 +152,7 @@ export function readDocument(
...defaultHeaders, ...defaultHeaders,
...authHeaders(), ...authHeaders(),
[CosmosSDKConstants.HttpHeaders.PartitionKey]: encodeURIComponent( [CosmosSDKConstants.HttpHeaders.PartitionKey]: encodeURIComponent(
JSON.stringify(documentId.partitionKeyHeader()) JSON.stringify(documentId.partitionKeyHeader()),
), ),
}, },
}) })
@ -168,7 +168,7 @@ export function createDocument(
databaseId: string, databaseId: string,
collection: Collection, collection: Collection,
partitionKeyProperty: string, partitionKeyProperty: string,
documentContent: unknown documentContent: unknown,
): Promise<DataModels.DocumentId> { ): Promise<DataModels.DocumentId> {
const { databaseAccount } = userContext; const { databaseAccount } = userContext;
const resourceEndpoint = databaseAccount.properties.mongoEndpoint || databaseAccount.properties.documentEndpoint; const resourceEndpoint = databaseAccount.properties.mongoEndpoint || databaseAccount.properties.documentEndpoint;
@ -207,7 +207,7 @@ export function updateDocument(
databaseId: string, databaseId: string,
collection: Collection, collection: Collection,
documentId: DocumentId, documentId: DocumentId,
documentContent: string documentContent: string,
): Promise<DataModels.DocumentId> { ): Promise<DataModels.DocumentId> {
const { databaseAccount } = userContext; const { databaseAccount } = userContext;
const resourceEndpoint = databaseAccount.properties.mongoEndpoint || databaseAccount.properties.documentEndpoint; const resourceEndpoint = databaseAccount.properties.mongoEndpoint || databaseAccount.properties.documentEndpoint;
@ -290,7 +290,7 @@ export function deleteDocument(databaseId: string, collection: Collection, docum
} }
export function createMongoCollectionWithProxy( export function createMongoCollectionWithProxy(
params: DataModels.CreateCollectionParams params: DataModels.CreateCollectionParams,
): Promise<DataModels.Collection> { ): Promise<DataModels.Collection> {
const { databaseAccount } = userContext; const { databaseAccount } = userContext;
const shardKey: string = params.partitionKey?.paths[0]; const shardKey: string = params.partitionKey?.paths[0];
@ -316,7 +316,7 @@ export function createMongoCollectionWithProxy(
return window return window
.fetch( .fetch(
`${endpoint}/createCollection?${queryString.stringify( `${endpoint}/createCollection?${queryString.stringify(
(mongoParams as unknown) as queryString.ParsedUrlQueryInput mongoParams as unknown as queryString.ParsedUrlQueryInput,
)}`, )}`,
{ {
method: "POST", method: "POST",
@ -325,7 +325,7 @@ export function createMongoCollectionWithProxy(
...authHeaders(), ...authHeaders(),
[HttpHeaders.contentType]: "application/json", [HttpHeaders.contentType]: "application/json",
}, },
} },
) )
.then(async (response) => { .then(async (response) => {
if (response.ok) { if (response.ok) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -14,7 +14,7 @@ export const executeStoredProcedure = async (
collection: Collection, collection: Collection,
storedProcedure: StoredProcedure, storedProcedure: StoredProcedure,
partitionKeyValue: string, partitionKeyValue: string,
params: string[] params: string[],
): Promise<ExecuteSprocResult> => { ): Promise<ExecuteSprocResult> => {
const clearMessage = logConsoleProgress(`Executing stored procedure ${storedProcedure.id()}`); const clearMessage = logConsoleProgress(`Executing stored procedure ${storedProcedure.id()}`);
const timeout = setTimeout(() => { const timeout = setTimeout(() => {
@ -29,7 +29,7 @@ export const executeStoredProcedure = async (
.execute(partitionKeyValue, params, { enableScriptLogging: true }); .execute(partitionKeyValue, params, { enableScriptLogging: true });
clearTimeout(timeout); clearTimeout(timeout);
logConsoleInfo( logConsoleInfo(
`Finished executing stored procedure ${storedProcedure.id()} for container ${storedProcedure.collection.id()}` `Finished executing stored procedure ${storedProcedure.id()} for container ${storedProcedure.collection.id()}`,
); );
return { return {
result: response.resource, result: response.resource,
@ -39,7 +39,7 @@ export const executeStoredProcedure = async (
handleError( handleError(
error, error,
"ExecuteStoredProcedure", "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; throw error;
} finally { } 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 }); const response = await client().database(databaseId).container(collectionId).read({ populateQuotaInfo: true });
indexTransformationPercentage = parseInt( indexTransformationPercentage = parseInt(
response.headers[Constants.HttpHeaders.collectionIndexTransformationProgress] as string response.headers[Constants.HttpHeaders.collectionIndexTransformationProgress] as string,
); );
} catch (error) { } catch (error) {
handleError(error, "ReadMongoDBCollection", `Error while reading container ${collectionId}`); handleError(error, "ReadMongoDBCollection", `Error while reading container ${collectionId}`);

View File

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

View File

@ -7,7 +7,7 @@ export const queryDocuments = (
databaseId: string, databaseId: string,
containerId: string, containerId: string,
query: string, query: string,
options: FeedOptions options: FeedOptions,
): QueryIterator<ItemDefinition & Resource> => { ): QueryIterator<ItemDefinition & Resource> => {
options = getCommonQueryOptions(options); options = getCommonQueryOptions(options);
return client().database(databaseId).container(containerId).items.query(query, 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 ( export const queryDocumentsPage = async (
resourceName: string, resourceName: string,
documentsIterator: MinimalQueryIterator, documentsIterator: MinimalQueryIterator,
firstItemIndex: number firstItemIndex: number,
): Promise<QueryResults> => { ): Promise<QueryResults> => {
const entityName = getEntityName(); const entityName = getEntityName();
const clearMessage = logConsoleProgress(`Querying ${entityName} for container ${resourceName}`); 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( export async function readCollectionInternal(
cosmosClient: CosmosClient, cosmosClient: CosmosClient,
databaseId: string, databaseId: string,
collectionId: string collectionId: string,
): Promise<DataModels.Collection> { ): Promise<DataModels.Collection> {
let collection: DataModels.Collection; let collection: DataModels.Collection;
const clearMessage = logConsoleProgress(`Querying container ${collectionId}`); const clearMessage = logConsoleProgress(`Querying container ${collectionId}`);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -118,7 +118,7 @@ export function updateConfigContext(newContext: Partial<ConfigContext>): void {
if ( if (
!validateEndpoint( !validateEndpoint(
newContext.BACKEND_ENDPOINT, newContext.BACKEND_ENDPOINT,
configContext.allowedBackendEndpoints || defaultAllowedBackendEndpoints configContext.allowedBackendEndpoints || defaultAllowedBackendEndpoints,
) )
) { ) {
delete newContext.BACKEND_ENDPOINT; delete newContext.BACKEND_ENDPOINT;

View File

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

View File

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

View File

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

View File

@ -1001,7 +1001,7 @@ interface JQuery {
date: Date, date: Date,
onSelect?: () => void, onSelect?: () => void,
settings?: JQueryUI.DatepickerOptions, settings?: JQueryUI.DatepickerOptions,
pos?: number[] pos?: number[],
): JQuery; ): JQuery;
/** /**
* Opens the datepicker in a dialog box. * Opens the datepicker in a dialog box.
@ -1017,7 +1017,7 @@ interface JQuery {
date: Date, date: Date,
onSelect?: () => void, onSelect?: () => void,
settings?: JQueryUI.DatepickerOptions, settings?: JQueryUI.DatepickerOptions,
pos?: MouseEvent pos?: MouseEvent,
): JQuery; ): JQuery;
/** /**
* Opens the datepicker in a dialog box. * Opens the datepicker in a dialog box.
@ -1033,7 +1033,7 @@ interface JQuery {
date: string, date: string,
onSelect?: () => void, onSelect?: () => void,
settings?: JQueryUI.DatepickerOptions, settings?: JQueryUI.DatepickerOptions,
pos?: number[] pos?: number[],
): JQuery; ): JQuery;
/** /**
* Opens the datepicker in a dialog box. * Opens the datepicker in a dialog box.
@ -1049,7 +1049,7 @@ interface JQuery {
date: string, date: string,
onSelect?: () => void, onSelect?: () => void,
settings?: JQueryUI.DatepickerOptions, settings?: JQueryUI.DatepickerOptions,
pos?: MouseEvent pos?: MouseEvent,
): JQuery; ): JQuery;
/** /**
* Returns the current date for the datepicker or null if no date has been selected. * Returns the current date for the datepicker or null if no date has been selected.
@ -1199,7 +1199,7 @@ interface JQuery {
datepicker( datepicker(
methodName: "option", methodName: "option",
optionName: "beforeShow", optionName: "beforeShow",
beforeShowValue: (input: Element, inst: any) => JQueryUI.DatepickerOptions beforeShowValue: (input: Element, inst: any) => JQueryUI.DatepickerOptions,
): JQuery; ): JQuery;
/** /**
@ -1716,14 +1716,14 @@ interface JQuery {
addClassName: string, addClassName: string,
duration?: number, duration?: number,
easing?: string, easing?: string,
complete?: Function complete?: Function,
): JQuery; ): JQuery;
switchClass( switchClass(
removeClassName: string, removeClassName: string,
addClassName: string, addClassName: string,
duration?: string, duration?: string,
easing?: string, easing?: string,
complete?: Function complete?: Function,
): JQuery; ): JQuery;
toggleClass(className: string, duration?: number, easing?: string, 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( then(
doneCallbacks: JQueryPromiseXHRDoneCallback<T>, doneCallbacks: JQueryPromiseXHRDoneCallback<T>,
failCallbacks?: JQueryPromiseXHRFailCallback<T>, failCallbacks?: JQueryPromiseXHRFailCallback<T>,
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromise; ): JQueryPromise;
then<UValue>( then<UValue>(
doneCallbacks: { (data: T, textStatus: string, jqXHR: JQueryXHR<T>): UValue }, doneCallbacks: { (data: T, textStatus: string, jqXHR: JQueryXHR<T>): UValue },
failCallbacks?: JQueryPromiseXHRFailCallback<T>, failCallbacks?: JQueryPromiseXHRFailCallback<T>,
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (data: T, textStatus: string, jqXHR: JQueryXHR<T>): UValue }, doneCallbacks: { (data: T, textStatus: string, jqXHR: JQueryXHR<T>): UValue },
failCallbacks?: { (data: T, textStatus: string, jqXHR: JQueryXHR<T>): UReject }, failCallbacks?: { (data: T, textStatus: string, jqXHR: JQueryXHR<T>): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
then<UReject>( then<UReject>(
doneCallbacks: JQueryPromiseXHRDoneCallback<T>, doneCallbacks: JQueryPromiseXHRDoneCallback<T>,
failCallbacks?: { (data: T, textStatus: string, jqXHR: JQueryXHR<T>): UReject }, failCallbacks?: { (data: T, textStatus: string, jqXHR: JQueryXHR<T>): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
overrideMimeType(mimeType: string): void; overrideMimeType(mimeType: string): void;
@ -201,7 +201,7 @@ interface JQueryPromiseAny {
then( then(
doneCallbacks: { (...args: any[]): any }, doneCallbacks: { (...args: any[]): any },
failCallbacks: { (...args: any[]): any }, failCallbacks: { (...args: any[]): any },
progressCallbacks?: { (...args: any[]): any } progressCallbacks?: { (...args: any[]): any },
): JQueryPromiseAny; ): JQueryPromiseAny;
} }
@ -215,39 +215,39 @@ interface JQueryPromise {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (): UValue }, doneCallbacks: { (): UValue },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
// U Pipe // U Pipe
then<UValue>( then<UValue>(
doneCallbacks: { (): JQueryPromiseV<UValue> }, doneCallbacks: { (): JQueryPromiseV<UValue> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then( then(
doneCallbacks: { (): JQueryDeferred }, doneCallbacks: { (): JQueryDeferred },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromise; ): JQueryPromise;
then( then(
doneCallbacks: { (): JQueryPromise }, doneCallbacks: { (): JQueryPromise },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromise; ): JQueryPromise;
// U Value // U Value
then<UValue>( then<UValue>(
doneCallbacks: { (): UValue }, doneCallbacks: { (): UValue },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UReject>( then<UReject>(
doneCallbacks: { (): void }, doneCallbacks: { (): void },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then(doneCallbacks: { (): void }, failCallbacks?: { (): void }, progressCallbacks?: { (): void }): JQueryPromise; then(doneCallbacks: { (): void }, failCallbacks?: { (): void }, progressCallbacks?: { (): void }): JQueryPromise;
@ -263,39 +263,39 @@ interface JQueryPromiseV<TValue> {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (arg: TValue): UValue }, doneCallbacks: { (arg: TValue): UValue },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
// U Pipe // U Pipe
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): JQueryDeferredV<UValue> }, doneCallbacks: { (arg: TValue): JQueryDeferredV<UValue> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): JQueryPromiseV<UValue> }, doneCallbacks: { (arg: TValue): JQueryPromiseV<UValue> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
// U Value // U Value
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): UValue }, doneCallbacks: { (arg: TValue): UValue },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UReject>( then<UReject>(
doneCallbacks: { (arg: TValue): void }, doneCallbacks: { (arg: TValue): void },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then( then(
doneCallbacks: { (arg: TValue): void }, doneCallbacks: { (arg: TValue): void },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromise; ): JQueryPromise;
} }
@ -309,39 +309,39 @@ interface JQueryPromiseN<TNotify> {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (): UValue }, doneCallbacks: { (): UValue },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (arg: TNotify): void } progressCallbacks?: { (arg: TNotify): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
// U Pipe // U Pipe
then( then(
doneCallbacks: { (): JQueryDeferredN<TNotify> }, doneCallbacks: { (): JQueryDeferredN<TNotify> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseN<TNotify>; ): JQueryPromiseN<TNotify>;
then( then(
doneCallbacks: { (): JQueryPromiseN<TNotify> }, doneCallbacks: { (): JQueryPromiseN<TNotify> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseN<TNotify>; ): JQueryPromiseN<TNotify>;
// U Value // U Value
then<UValue>( then<UValue>(
doneCallbacks: { (): UValue }, doneCallbacks: { (): UValue },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (arg: TNotify): void } progressCallbacks?: { (arg: TNotify): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UReject>( then<UReject>(
doneCallbacks: { (): void }, doneCallbacks: { (): void },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (arg: TNotify): void } progressCallbacks?: { (arg: TNotify): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then( then(
doneCallbacks: { (): void }, doneCallbacks: { (): void },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (arg: TNotify): void } progressCallbacks?: { (arg: TNotify): void },
): JQueryPromise; ): JQueryPromise;
} }
@ -357,25 +357,25 @@ interface JQueryPromiseNNNN<TNotify1, TNotify2, TNotify3, TNotify4> {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (): UValue }, doneCallbacks: { (): UValue },
failCallbacks: { (): UReject }, 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>; ): JQueryPromiseVR<UValue, UReject>;
then<UValue>( then<UValue>(
doneCallbacks: { (): UValue }, doneCallbacks: { (): UValue },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void } progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UReject>( then<UReject>(
doneCallbacks: { (): void }, doneCallbacks: { (): void },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void } progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then( then(
doneCallbacks: { (): void }, doneCallbacks: { (): void },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void } progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void },
): JQueryPromise; ): JQueryPromise;
} }
@ -389,39 +389,39 @@ interface JQueryPromiseVV<TValue1, TValue2> {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): UValue }, doneCallbacks: { (arg1: TValue1, arg2: TValue2): UValue },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
// U Pipe // U Pipe
then<UValue1, UValue2>( then<UValue1, UValue2>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): JQueryDeferredVV<UValue1, UValue2> }, doneCallbacks: { (arg1: TValue1, arg2: TValue2): JQueryDeferredVV<UValue1, UValue2> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVV<UValue1, UValue2>; ): JQueryPromiseVV<UValue1, UValue2>;
then<UValue1, UValue2>( then<UValue1, UValue2>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): JQueryPromiseVV<UValue1, UValue2> }, doneCallbacks: { (arg1: TValue1, arg2: TValue2): JQueryPromiseVV<UValue1, UValue2> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVV<UValue1, UValue2>; ): JQueryPromiseVV<UValue1, UValue2>;
// U Value // U Value
then<UValue>( then<UValue>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): UValue }, doneCallbacks: { (arg1: TValue1, arg2: TValue2): UValue },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UReject>( then<UReject>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): void }, doneCallbacks: { (arg1: TValue1, arg2: TValue2): void },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then( then(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): void }, doneCallbacks: { (arg1: TValue1, arg2: TValue2): void },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromise; ): JQueryPromise;
} }
@ -437,39 +437,39 @@ interface JQueryPromiseVVV<TValue1, TValue2, TValue3> {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): UValue }, doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): UValue },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
// U Pipe // U Pipe
then<UValue1, UValue2, UValue3>( then<UValue1, UValue2, UValue3>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): JQueryDeferredVVV<UValue1, UValue2, UValue3> }, doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): JQueryDeferredVVV<UValue1, UValue2, UValue3> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVVV<UValue1, UValue2, UValue3>; ): JQueryPromiseVVV<UValue1, UValue2, UValue3>;
then<UValue1, UValue2, UValue3>( then<UValue1, UValue2, UValue3>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): JQueryPromiseVVV<UValue1, UValue2, UValue3> }, doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): JQueryPromiseVVV<UValue1, UValue2, UValue3> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVVV<UValue1, UValue2, UValue3>; ): JQueryPromiseVVV<UValue1, UValue2, UValue3>;
// U Value // U Value
then<UValue>( then<UValue>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): UValue }, doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): UValue },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UReject>( then<UReject>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): void }, doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): void },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then( then(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): void }, doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): void },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromise; ): JQueryPromise;
} }
@ -483,45 +483,45 @@ interface JQueryPromiseVR<TValue, TReject> {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (arg: TValue): JQueryPromiseVR<UValue, UReject> }, doneCallbacks: { (arg: TValue): JQueryPromiseVR<UValue, UReject> },
failCallbacks?: { (arg: TReject): UReject }, failCallbacks?: { (arg: TReject): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (arg: TValue): UValue }, doneCallbacks: { (arg: TValue): UValue },
failCallbacks?: { (arg: TReject): UReject }, failCallbacks?: { (arg: TReject): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
// U Pipe // U Pipe
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): JQueryDeferredVR<UValue, TReject> }, doneCallbacks: { (arg: TValue): JQueryDeferredVR<UValue, TReject> },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, TReject>; ): JQueryPromiseVR<UValue, TReject>;
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): JQueryPromiseVR<UValue, TReject> }, doneCallbacks: { (arg: TValue): JQueryPromiseVR<UValue, TReject> },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, TReject>; ): JQueryPromiseVR<UValue, TReject>;
// U Value // U Value
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): UValue }, doneCallbacks: { (arg: TValue): UValue },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UReject>( then<UReject>(
doneCallbacks: { (arg: TValue): void }, doneCallbacks: { (arg: TValue): void },
failCallbacks?: { (arg: TReject): UReject }, failCallbacks?: { (arg: TReject): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then( then(
doneCallbacks: { (arg: TValue): void }, doneCallbacks: { (arg: TValue): void },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromise; ): JQueryPromise;
} }
@ -535,39 +535,39 @@ interface JQueryPromiseVRN<TValue, TReject, TProgress> {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (arg: TValue): UValue }, doneCallbacks: { (arg: TValue): UValue },
failCallbacks: { (arg: TReject): UReject }, failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (arg: TProgress): void } progressCallbacks?: { (arg: TProgress): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
// U Pipe // U Pipe
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): JQueryDeferredVRN<UValue, TReject, TProgress> }, doneCallbacks: { (arg: TValue): JQueryDeferredVRN<UValue, TReject, TProgress> },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVRN<UValue, TReject, TProgress>; ): JQueryPromiseVRN<UValue, TReject, TProgress>;
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): JQueryPromiseVRN<UValue, TReject, TProgress> }, doneCallbacks: { (arg: TValue): JQueryPromiseVRN<UValue, TReject, TProgress> },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVRN<UValue, TReject, TProgress>; ): JQueryPromiseVRN<UValue, TReject, TProgress>;
// U Value // U Value
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): UValue }, doneCallbacks: { (arg: TValue): UValue },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (arg: TProgress): void } progressCallbacks?: { (arg: TProgress): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UReject>( then<UReject>(
doneCallbacks: { (arg: TValue): void }, doneCallbacks: { (arg: TValue): void },
failCallbacks: { (arg: TReject): UReject }, failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (arg: TProgress): void } progressCallbacks?: { (arg: TProgress): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then( then(
doneCallbacks: { (arg: TValue): void }, doneCallbacks: { (arg: TValue): void },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (arg: TProgress): void } progressCallbacks?: { (arg: TProgress): void },
): JQueryPromise; ): JQueryPromise;
} }
@ -581,32 +581,32 @@ interface JQueryPromiseR<TReject> {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (): UValue }, doneCallbacks: { (): UValue },
failCallbacks: { (arg: TReject): UReject }, failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
// U Pipe // U Pipe
then( then(
doneCallbacks: { (): JQueryDeferredR<TReject> }, doneCallbacks: { (): JQueryDeferredR<TReject> },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<TReject>; ): JQueryPromiseR<TReject>;
then( then(
doneCallbacks: { (): JQueryPromiseR<TReject> }, doneCallbacks: { (): JQueryPromiseR<TReject> },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<TReject>; ): JQueryPromiseR<TReject>;
then<UReject>( then<UReject>(
doneCallbacks: { (): void }, doneCallbacks: { (): void },
failCallbacks?: { (arg: TReject): UReject }, failCallbacks?: { (arg: TReject): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then( then(
doneCallbacks: { (): void }, doneCallbacks: { (): void },
failCallbacks: { (arg: TReject): void }, failCallbacks: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromise; ): JQueryPromise;
} }
@ -629,7 +629,7 @@ interface JQueryDeferredAny {
then( then(
doneCallbacks: { (...args: any[]): any }, doneCallbacks: { (...args: any[]): any },
failCallbacks: { (...args: any[]): any }, failCallbacks: { (...args: any[]): any },
progressCallbacks?: { (...args: any[]): any } progressCallbacks?: { (...args: any[]): any },
): JQueryDeferredAny; ): JQueryDeferredAny;
} }
@ -650,33 +650,33 @@ interface JQueryDeferred {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (): UValue }, doneCallbacks: { (): UValue },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
// U Pipe // U Pipe
then( then(
doneCallbacks: { (): JQueryDeferred }, doneCallbacks: { (): JQueryDeferred },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromise; ): JQueryPromise;
then( then(
doneCallbacks: { (): JQueryPromise }, doneCallbacks: { (): JQueryPromise },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromise; ): JQueryPromise;
// U Value // U Value
then<UValue>( then<UValue>(
doneCallbacks: { (): UValue }, doneCallbacks: { (): UValue },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UReject>( then<UReject>(
doneCallbacks: { (): void }, doneCallbacks: { (): void },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then(doneCallbacks: { (): void }, failCallbacks?: { (): void }, progressCallbacks?: { (): void }): JQueryPromise; then(doneCallbacks: { (): void }, failCallbacks?: { (): void }, progressCallbacks?: { (): void }): JQueryPromise;
@ -699,39 +699,39 @@ interface JQueryDeferredV<TValue> {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (arg: TValue): UValue }, doneCallbacks: { (arg: TValue): UValue },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
// U Pipe // U Pipe
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): JQueryDeferredV<UValue> }, doneCallbacks: { (arg: TValue): JQueryDeferredV<UValue> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): JQueryPromiseV<UValue> }, doneCallbacks: { (arg: TValue): JQueryPromiseV<UValue> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
// U Value // U Value
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): UValue }, doneCallbacks: { (arg: TValue): UValue },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UReject>( then<UReject>(
doneCallbacks: { (arg: TValue): void }, doneCallbacks: { (arg: TValue): void },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then( then(
doneCallbacks: { (arg: TValue): void }, doneCallbacks: { (arg: TValue): void },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromise; ): JQueryPromise;
} }
@ -752,39 +752,39 @@ interface JQueryDeferredN<TNotify> {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (): UValue }, doneCallbacks: { (): UValue },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (arg: TNotify): void } progressCallbacks?: { (arg: TNotify): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
// U Pipe // U Pipe
then( then(
doneCallbacks: { (): JQueryDeferredN<TNotify> }, doneCallbacks: { (): JQueryDeferredN<TNotify> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseN<TNotify>; ): JQueryPromiseN<TNotify>;
then( then(
doneCallbacks: { (): JQueryPromiseN<TNotify> }, doneCallbacks: { (): JQueryPromiseN<TNotify> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseN<TNotify>; ): JQueryPromiseN<TNotify>;
// U Value // U Value
then<UValue>( then<UValue>(
doneCallbacks: { (): UValue }, doneCallbacks: { (): UValue },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (arg: TNotify): void } progressCallbacks?: { (arg: TNotify): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UReject>( then<UReject>(
doneCallbacks: { (): void }, doneCallbacks: { (): void },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (arg: TNotify): void } progressCallbacks?: { (arg: TNotify): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then( then(
doneCallbacks: { (): void }, doneCallbacks: { (): void },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (arg: TNotify): void } progressCallbacks?: { (arg: TNotify): void },
): JQueryPromise; ): JQueryPromise;
} }
@ -793,14 +793,14 @@ interface JQueryDeferredNNNN<TNotify1, TNotify2, TNotify3, TNotify4> {
arg1: TNotify1, arg1: TNotify1,
arg2: TNotify2, arg2: TNotify2,
arg3: TNotify3, arg3: TNotify3,
arg4: TNotify4 arg4: TNotify4,
): JQueryDeferredNNNN<TNotify1, TNotify2, TNotify3, TNotify4>; ): JQueryDeferredNNNN<TNotify1, TNotify2, TNotify3, TNotify4>;
notifyWith( notifyWith(
context: any, context: any,
arg1: TNotify1, arg1: TNotify1,
arg2: TNotify2, arg2: TNotify2,
arg3: TNotify3, arg3: TNotify3,
arg4: TNotify4 arg4: TNotify4,
): JQueryDeferredNNNN<TNotify1, TNotify2, TNotify3, TNotify4>; ): JQueryDeferredNNNN<TNotify1, TNotify2, TNotify3, TNotify4>;
always(...alwaysCallbacks: Array<{ (): void }>): 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>( then<UValue, UReject>(
doneCallbacks: { (): UValue }, doneCallbacks: { (): UValue },
failCallbacks: { (): UReject }, 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>; ): JQueryPromiseVR<UValue, UReject>;
then<UValue>( then<UValue>(
doneCallbacks: { (): UValue }, doneCallbacks: { (): UValue },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void } progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UReject>( then<UReject>(
doneCallbacks: { (): void }, doneCallbacks: { (): void },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void } progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then( then(
doneCallbacks: { (): void }, doneCallbacks: { (): void },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void } progressCallbacks?: { (arg1: TNotify1, arg2: TNotify2, arg3: TNotify3, arg4: TNotify4): void },
): JQueryPromise; ): JQueryPromise;
} }
@ -857,39 +857,39 @@ interface JQueryDeferredVV<TValue1, TValue2> {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): UValue }, doneCallbacks: { (arg1: TValue1, arg2: TValue2): UValue },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
// U Pipe // U Pipe
then<UValue1, UValue2>( then<UValue1, UValue2>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): JQueryDeferredVV<UValue1, UValue2> }, doneCallbacks: { (arg1: TValue1, arg2: TValue2): JQueryDeferredVV<UValue1, UValue2> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVV<UValue1, UValue2>; ): JQueryPromiseVV<UValue1, UValue2>;
then<UValue1, UValue2>( then<UValue1, UValue2>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): JQueryPromiseVV<UValue1, UValue2> }, doneCallbacks: { (arg1: TValue1, arg2: TValue2): JQueryPromiseVV<UValue1, UValue2> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVV<UValue1, UValue2>; ): JQueryPromiseVV<UValue1, UValue2>;
// U Value // U Value
then<UValue>( then<UValue>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): UValue }, doneCallbacks: { (arg1: TValue1, arg2: TValue2): UValue },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UReject>( then<UReject>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): void }, doneCallbacks: { (arg1: TValue1, arg2: TValue2): void },
failCallbacks: { (): UReject }, failCallbacks: { (): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then( then(
doneCallbacks: { (arg1: TValue1, arg2: TValue2): void }, doneCallbacks: { (arg1: TValue1, arg2: TValue2): void },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromise; ): JQueryPromise;
} }
@ -912,39 +912,39 @@ interface JQueryDeferredVVV<TValue1, TValue2, TValue3> {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): UValue }, doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): UValue },
failCallbacks?: { (): UReject }, failCallbacks?: { (): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
// U Pipe // U Pipe
then<UValue1, UValue2, UValue3>( then<UValue1, UValue2, UValue3>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): JQueryDeferredVVV<UValue1, UValue2, UValue3> }, doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): JQueryDeferredVVV<UValue1, UValue2, UValue3> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVVV<UValue1, UValue2, UValue3>; ): JQueryPromiseVVV<UValue1, UValue2, UValue3>;
then<UValue1, UValue2, UValue3>( then<UValue1, UValue2, UValue3>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): JQueryPromiseVVV<UValue1, UValue2, UValue3> }, doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): JQueryPromiseVVV<UValue1, UValue2, UValue3> },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVVV<UValue1, UValue2, UValue3>; ): JQueryPromiseVVV<UValue1, UValue2, UValue3>;
// U Value // U Value
then<UValue>( then<UValue>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): UValue }, doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): UValue },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UReject>( then<UReject>(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): void }, doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): void },
failCallbacks?: { (): UReject }, failCallbacks?: { (): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then( then(
doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): void }, doneCallbacks: { (arg1: TValue1, arg2: TValue2, arg3: TValue3): void },
failCallbacks?: { (): void }, failCallbacks?: { (): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromise; ): JQueryPromise;
} }
@ -965,39 +965,39 @@ interface JQueryDeferredVR<TValue, TReject> {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (arg: TValue): UValue }, doneCallbacks: { (arg: TValue): UValue },
failCallbacks: { (arg: TReject): UReject }, failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
// U Pipe // U Pipe
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): JQueryDeferredVR<UValue, TReject> }, doneCallbacks: { (arg: TValue): JQueryDeferredVR<UValue, TReject> },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, TReject>; ): JQueryPromiseVR<UValue, TReject>;
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): JQueryPromiseVR<UValue, TReject> }, doneCallbacks: { (arg: TValue): JQueryPromiseVR<UValue, TReject> },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, TReject>; ): JQueryPromiseVR<UValue, TReject>;
// U Value // U Value
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): UValue }, doneCallbacks: { (arg: TValue): UValue },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UReject>( then<UReject>(
doneCallbacks: { (arg: TValue): void }, doneCallbacks: { (arg: TValue): void },
failCallbacks: { (arg: TReject): UReject }, failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then( then(
doneCallbacks: { (arg: TValue): void }, doneCallbacks: { (arg: TValue): void },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromise; ): JQueryPromise;
} }
@ -1018,39 +1018,39 @@ interface JQueryDeferredVRN<TValue, TReject, TNotify> {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (arg: TValue): UValue }, doneCallbacks: { (arg: TValue): UValue },
failCallbacks: { (arg: TReject): UReject }, failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (arg: TNotify): void } progressCallbacks?: { (arg: TNotify): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
// U Pipe // U Pipe
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): JQueryDeferredVRN<UValue, TReject, TNotify> }, doneCallbacks: { (arg: TValue): JQueryDeferredVRN<UValue, TReject, TNotify> },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVRN<UValue, TReject, TNotify>; ): JQueryPromiseVRN<UValue, TReject, TNotify>;
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): JQueryPromiseVRN<UValue, TReject, TNotify> }, doneCallbacks: { (arg: TValue): JQueryPromiseVRN<UValue, TReject, TNotify> },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVRN<UValue, TReject, TNotify>; ): JQueryPromiseVRN<UValue, TReject, TNotify>;
// U Value // U Value
then<UValue>( then<UValue>(
doneCallbacks: { (arg: TValue): UValue }, doneCallbacks: { (arg: TValue): UValue },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (arg: TNotify): void } progressCallbacks?: { (arg: TNotify): void },
): JQueryPromiseV<UValue>; ): JQueryPromiseV<UValue>;
then<UReject>( then<UReject>(
doneCallbacks: { (arg: TValue): void }, doneCallbacks: { (arg: TValue): void },
failCallbacks: { (arg: TReject): UReject }, failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (arg: TNotify): void } progressCallbacks?: { (arg: TNotify): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then( then(
doneCallbacks: { (arg: TValue): void }, doneCallbacks: { (arg: TValue): void },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (arg: TNotify): void } progressCallbacks?: { (arg: TNotify): void },
): JQueryPromise; ): JQueryPromise;
} }
@ -1071,32 +1071,32 @@ interface JQueryDeferredR<TReject> {
then<UValue, UReject>( then<UValue, UReject>(
doneCallbacks: { (): UValue }, doneCallbacks: { (): UValue },
failCallbacks: { (arg: TReject): UReject }, failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseVR<UValue, UReject>; ): JQueryPromiseVR<UValue, UReject>;
// U Pipe // U Pipe
then( then(
doneCallbacks: { (): JQueryDeferredR<TReject> }, doneCallbacks: { (): JQueryDeferredR<TReject> },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<TReject>; ): JQueryPromiseR<TReject>;
then( then(
doneCallbacks: { (): JQueryPromiseR<TReject> }, doneCallbacks: { (): JQueryPromiseR<TReject> },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<TReject>; ): JQueryPromiseR<TReject>;
then<UReject>( then<UReject>(
doneCallbacks: { (): void }, doneCallbacks: { (): void },
failCallbacks: { (arg: TReject): UReject }, failCallbacks: { (arg: TReject): UReject },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromiseR<UReject>; ): JQueryPromiseR<UReject>;
then( then(
doneCallbacks: { (): void }, doneCallbacks: { (): void },
failCallbacks?: { (arg: TReject): void }, failCallbacks?: { (arg: TReject): void },
progressCallbacks?: { (): void } progressCallbacks?: { (): void },
): JQueryPromise; ): JQueryPromise;
} }
@ -1210,7 +1210,7 @@ interface JQueryWhen {
<T1, T2, T3>( <T1, T2, T3>(
promise1: JQueryPromiseV<T1>, promise1: JQueryPromiseV<T1>,
promise2: JQueryPromiseV<T2>, promise2: JQueryPromiseV<T2>,
promise3: JQueryPromiseV<T3> promise3: JQueryPromiseV<T3>,
): JQueryPromiseVVV<T1, T2, T3>; ): JQueryPromiseVVV<T1, T2, T3>;
(...deferreds: JQueryPromise[]): JQueryPromise; (...deferreds: JQueryPromise[]): JQueryPromise;
apply($: JQueryStatic, deferreds: JQueryPromise[]): JQueryPromise; apply($: JQueryStatic, deferreds: JQueryPromise[]): JQueryPromise;
@ -1238,8 +1238,8 @@ interface JQueryStatic {
handler: ( handler: (
options: JQueryAjaxSettings<T>, options: JQueryAjaxSettings<T>,
originalOptions: JQueryAjaxSettings<T>, originalOptions: JQueryAjaxSettings<T>,
jqXHR: JQueryXHR<T> jqXHR: JQueryXHR<T>,
) => JQueryTransport ) => JQueryTransport,
): any; ): any;
get<T>(url: string, data?: any, success?: any, dataType?: any): JQueryXHR<T>; get<T>(url: string, data?: any, success?: any, dataType?: any): JQueryXHR<T>;
@ -1410,8 +1410,8 @@ interface JQueryTransport {
status: number, status: number,
statusText: string, statusText: string,
responses?: { [dataType: string]: any }, responses?: { [dataType: string]: any },
headers?: string headers?: string,
) => any ) => any,
): any; ): any;
abort(): any; abort(): any;
} }
@ -1547,7 +1547,7 @@ interface JQuery {
step?: Function; step?: Function;
queue?: boolean; queue?: boolean;
specialEasing?: any; specialEasing?: any;
} },
): JQuery; ): JQuery;
delay(duration: number, queueName?: string): JQuery; delay(duration: number, queueName?: string): JQuery;
@ -1621,7 +1621,7 @@ interface JQuery {
hover( hover(
handlerIn: (eventObject: JQueryEventObject) => any, handlerIn: (eventObject: JQueryEventObject) => any,
handlerOut: (eventObject: JQueryEventObject) => any handlerOut: (eventObject: JQueryEventObject) => any,
): JQuery; ): JQuery;
hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery; hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery;

View File

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

View File

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

View File

@ -33,7 +33,7 @@ export interface DialogState {
contentHtml?: JSX.Element, contentHtml?: JSX.Element,
choiceGroupProps?: IChoiceGroupProps, choiceGroupProps?: IChoiceGroupProps,
textFieldProps?: TextFieldProps, textFieldProps?: TextFieldProps,
primaryButtonDisabled?: boolean primaryButtonDisabled?: boolean,
) => void; ) => void;
showOkModalDialog: (title: string, subText: string) => void; showOkModalDialog: (title: string, subText: string) => void;
} }
@ -50,7 +50,7 @@ export const useDialog: UseStore<DialogState> = create((set, get) => ({
showOkCancelModalDialog: state.showOkCancelModalDialog, showOkCancelModalDialog: state.showOkCancelModalDialog,
showOkModalDialog: state.showOkModalDialog, 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: ( showOkCancelModalDialog: (
title: string, title: string,
@ -62,7 +62,7 @@ export const useDialog: UseStore<DialogState> = create((set, get) => ({
contentHtml?: JSX.Element, contentHtml?: JSX.Element,
choiceGroupProps?: IChoiceGroupProps, choiceGroupProps?: IChoiceGroupProps,
textFieldProps?: TextFieldProps, textFieldProps?: TextFieldProps,
primaryButtonDisabled?: boolean primaryButtonDisabled?: boolean,
): void => ): void =>
get().openDialog({ get().openDialog({
isModal: true, isModal: true,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -133,7 +133,7 @@ export class InputTypeaheadComponent extends React.Component<
private filterChoiceByValue = (choices: Item[], searchKeyword: string): Item[] => { private filterChoiceByValue = (choices: Item[], searchKeyword: string): Item[] => {
return choices.filter((choice) => return choices.filter((choice) =>
// @ts-ignore // @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) => { (event: monaco.editor.ICursorSelectionChangedEvent) => {
const selectedContent: string = this.editor.getModel().getValueInRange(event.selection); const selectedContent: string = this.editor.getModel().getValueInRange(event.selection);
this.params.selectedContent(selectedContent); this.params.selectedContent(selectedContent);
} },
); );
} }

View File

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

View File

@ -44,7 +44,7 @@ export const CodeOfConduct: FunctionComponent<CodeOfConductProps> = ({
error: getErrorMessage(error), error: getErrorMessage(error),
errorStack: getErrorStack(error), errorStack: getErrorStack(error),
}, },
startKey startKey,
); );
handleError(error, "CodeOfConduct/acceptCodeOfConduct", "Failed to accept code of conduct"); 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( this.createPublicGalleryTab(
GalleryTab.PublicGallery, GalleryTab.PublicGallery,
this.state.publicNotebooks, this.state.publicNotebooks,
this.state.isCodeOfConductAccepted this.state.isCodeOfConductAccepted,
) ),
); );
} }
tabs.push(this.createSamplesTab(GalleryTab.OfficialSamples, this.state.sampleNotebooks)); tabs.push(this.createSamplesTab(GalleryTab.OfficialSamples, this.state.sampleNotebooks));
@ -265,7 +265,7 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
private createPublicGalleryTab( private createPublicGalleryTab(
tab: GalleryTab, tab: GalleryTab,
data: IGalleryItem[], data: IGalleryItem[],
acceptedCodeOfConduct: boolean acceptedCodeOfConduct: boolean,
): GalleryTabInfo { ): GalleryTabInfo {
return { return {
tab, tab,
@ -285,7 +285,7 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
Favorite any notebook from the{" "} Favorite any notebook from the{" "}
<Link onClick={() => this.setState({ selectedTab: GalleryTab.OfficialSamples })}>official samples</Link> or{" "} <Link onClick={() => this.setState({ selectedTab: GalleryTab.OfficialSamples })}>official samples</Link> or{" "}
<Link onClick={() => this.setState({ selectedTab: GalleryTab.PublicGallery })}>public gallery</Link> <Link onClick={() => this.setState({ selectedTab: GalleryTab.PublicGallery })}>public gallery</Link>
</> </>,
); );
} }
return this.createSearchBarHeader(this.createCardsTabContent(data)); return this.createSearchBarHeader(this.createCardsTabContent(data));
@ -309,7 +309,7 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
You have not published anything to the{" "} You have not published anything to the{" "}
<Link onClick={() => this.setState({ selectedTab: GalleryTab.PublicGallery })}>public gallery</Link> yet <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); return this.createPublishedNotebooksTabContent(data);
@ -330,19 +330,19 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
this.createPublishedNotebooksSectionContent( this.createPublishedNotebooksSectionContent(
undefined, undefined,
"You have successfully published and shared the following notebook(s) to the public gallery.", "You have successfully published and shared the following notebook(s) to the public gallery.",
this.createCardsTabContent(published) this.createCardsTabContent(published),
)} )}
{underReview?.length > 0 && {underReview?.length > 0 &&
this.createPublishedNotebooksSectionContent( this.createPublishedNotebooksSectionContent(
"Under Review", "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)", "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 && {removed?.length > 0 &&
this.createPublishedNotebooksSectionContent( this.createPublishedNotebooksSectionContent(
"Removed", "Removed",
"These notebooks were found to contain illegal content and has been taken down.", "These notebooks were found to contain illegal content and has been taken down.",
this.createPolicyViolationsListContent(removed) this.createPolicyViolationsListContent(removed),
)} )}
</Stack> </Stack>
); );
@ -353,7 +353,7 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
private createPublishedNotebooksSectionContent = ( private createPublishedNotebooksSectionContent = (
title: string, title: string,
description: string, description: string,
content: JSX.Element content: JSX.Element,
): JSX.Element => { ): JSX.Element => {
return ( return (
<Stack tokens={{ childrenGap: 10 }}> <Stack tokens={{ childrenGap: 10 }}>
@ -708,7 +708,7 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
private downloadItem = async (data: IGalleryItem): Promise<void> => { private downloadItem = async (data: IGalleryItem): Promise<void> => {
GalleryUtils.downloadItem(this.props.container, this.props.junoClient, data, (item) => 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); this.refreshSelectedTab(item);
}, },
beforeDelete, beforeDelete,
afterDelete afterDelete,
); );
}; };

View File

@ -44,7 +44,8 @@ interface NotebookViewerComponentState {
export class NotebookViewerComponent export class NotebookViewerComponent
extends React.Component<NotebookViewerComponentProps, NotebookViewerComponentState> extends React.Component<NotebookViewerComponentProps, NotebookViewerComponentState>
implements DialogHost { implements DialogHost
{
private clientManager: NotebookClientV2; private clientManager: NotebookClientV2;
private notebookComponentBootstrapper: NotebookComponentBootstrapper; private notebookComponentBootstrapper: NotebookComponentBootstrapper;
@ -97,7 +98,7 @@ export class NotebookViewerComponent
notebookId: this.props.galleryItem?.id, notebookId: this.props.galleryItem?.id,
isSample: this.props.galleryItem?.isSample, isSample: this.props.galleryItem?.isSample,
}, },
startKey startKey,
); );
const notebook: Notebook = await response.json(); const notebook: Notebook = await response.json();
@ -123,7 +124,7 @@ export class NotebookViewerComponent
error: getErrorMessage(error), error: getErrorMessage(error),
errorStack: getErrorStack(error), errorStack: getErrorStack(error),
}, },
startKey startKey,
); );
this.setState({ showProgressBar: false }); this.setState({ showProgressBar: false });
@ -172,7 +173,7 @@ export class NotebookViewerComponent
public static getDerivedStateFromProps( public static getDerivedStateFromProps(
props: NotebookViewerComponentProps, props: NotebookViewerComponentProps,
state: NotebookViewerComponentState state: NotebookViewerComponentState,
): Partial<NotebookViewerComponentState> { ): Partial<NotebookViewerComponentState> {
let galleryItem = props.galleryItem; let galleryItem = props.galleryItem;
let isFavorite = props.isFavorite; let isFavorite = props.isFavorite;
@ -196,7 +197,7 @@ export class NotebookViewerComponent
msg: string, msg: string,
okLabel: string, okLabel: string,
onOk: () => void, onOk: () => void,
progressIndicatorProps?: IProgressIndicatorProps progressIndicatorProps?: IProgressIndicatorProps,
): void { ): void {
useDialog.getState().openDialog({ useDialog.getState().openDialog({
isModal: true, isModal: true,
@ -223,7 +224,7 @@ export class NotebookViewerComponent
progressIndicatorProps?: IProgressIndicatorProps, progressIndicatorProps?: IProgressIndicatorProps,
choiceGroupProps?: IChoiceGroupProps, choiceGroupProps?: IChoiceGroupProps,
textFieldProps?: TextFieldProps, textFieldProps?: TextFieldProps,
primaryButtonDisabled?: boolean primaryButtonDisabled?: boolean,
): void { ): void {
useDialog.getState().openDialog({ useDialog.getState().openDialog({
isModal: true, isModal: true,
@ -248,19 +249,19 @@ export class NotebookViewerComponent
private favoriteItem = async (): Promise<void> => { private favoriteItem = async (): Promise<void> => {
GalleryUtils.favoriteItem(this.props.container, this.props.junoClient, this.state.galleryItem, (item) => 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> => { private unfavoriteItem = async (): Promise<void> => {
GalleryUtils.unfavoriteItem(this.props.container, this.props.junoClient, this.state.galleryItem, (item) => 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> => { private downloadItem = async (): Promise<void> => {
GalleryUtils.downloadItem(this.props.container, this.props.junoClient, this.state.galleryItem, (item) => 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 { public componentDidUpdate(prevProps: QueriesGridComponentProps, prevState: QueriesGridComponentState): void {
this.selection.setItems( this.selection.setItems(
this.state.filteredResults, this.state.filteredResults,
!_.isEqual(prevState.filteredResults, this.state.filteredResults) !_.isEqual(prevState.filteredResults, this.state.filteredResults),
); );
this.queryFilter && this.queryFilter.focus(); this.queryFilter && this.queryFilter.focus();
const querySetupCompleted: boolean = !prevProps.saveQueryEnabled && this.props.saveQueryEnabled; const querySetupCompleted: boolean = !prevProps.saveQueryEnabled && this.props.saveQueryEnabled;
@ -159,7 +159,7 @@ export class QueriesGridComponent extends React.Component<QueriesGridComponentPr
if (query) { if (query) {
const filteredQueries: Query[] = this.state.queries.filter( const filteredQueries: Query[] = this.state.queries.filter(
(savedQuery: Query) => (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({ this.setState({
filteredResults: filteredQueries, filteredResults: filteredQueries,
@ -240,7 +240,7 @@ export class QueriesGridComponent extends React.Component<QueriesGridComponentPr
dataExplorerArea: Constants.Areas.ContextualPane, dataExplorerArea: Constants.Areas.ContextualPane,
paneTitle: title, paneTitle: title,
}, },
startKey startKey,
); );
} catch (error) { } catch (error) {
TelemetryProcessor.traceFailure( TelemetryProcessor.traceFailure(
@ -251,13 +251,13 @@ export class QueriesGridComponent extends React.Component<QueriesGridComponentPr
error: getErrorMessage(error), error: getErrorMessage(error),
errorStack: getErrorStack(error), errorStack: getErrorStack(error),
}, },
startKey startKey,
); );
} }
await this.fetchSavedQueries(); // get latest state await this.fetchSavedQueries(); // get latest state
}, },
"Cancel", "Cancel",
undefined undefined,
); );
}, },
}, },

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -122,7 +122,7 @@ describe("SettingsUtils", () => {
notification = getMongoNotification(singleIndexDescription, MongoIndexTypes.Wildcard); notification = getMongoNotification(singleIndexDescription, MongoIndexTypes.Wildcard);
expect(notification.message).toEqual( 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); expect(notification.type).toEqual(MongoNotificationType.Error);
}); });

View File

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

View File

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

View File

@ -25,7 +25,7 @@ describe("ThroughputInput Pane", () => {
it("should switch mode properly", () => { it("should switch mode properly", () => {
wrapper.find('[aria-label="Manual database throughput"]').simulate("change"); wrapper.find('[aria-label="Manual database throughput"]').simulate("change");
expect(wrapper.find('[aria-label="Throughput header"]').at(0).text()).toBe( 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"); wrapper.find('[aria-label="Autoscale database throughput"]').simulate("change");

View File

@ -36,7 +36,7 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
}: ThroughputInputProps) => { }: ThroughputInputProps) => {
const [isAutoscaleSelected, setIsAutoScaleSelected] = useState<boolean>(true); const [isAutoscaleSelected, setIsAutoScaleSelected] = useState<boolean>(true);
const [throughput, setThroughput] = useState<number>( const [throughput, setThroughput] = useState<number>(
isFreeTier || isQuickstart ? AutoPilotUtils.autoPilotThroughput1K : AutoPilotUtils.autoPilotThroughput4K isFreeTier || isQuickstart ? AutoPilotUtils.autoPilotThroughput1K : AutoPilotUtils.autoPilotThroughput4K,
); );
const [isCostAcknowledged, setIsCostAcknowledged] = useState<boolean>(false); const [isCostAcknowledged, setIsCostAcknowledged] = useState<boolean>(false);
const [throughputError, setThroughputError] = useState<string>(""); const [throughputError, setThroughputError] = useState<string>("");
@ -71,7 +71,7 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
setThroughputError( 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 ${ `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 totalThroughput + throughput * numberOfRegions
} RU/s. Change total throughput limit in cost management.` } RU/s. Change total throughput limit in cost management.`,
); );
setIsThroughputCapExceeded(true); setIsThroughputCapExceeded(true);
@ -83,7 +83,7 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
setThroughputError( 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 ${ `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 totalThroughputUsed + newThroughput * numberOfRegions
} RU/s. Change total throughput limit in cost management.` } RU/s. Change total throughput limit in cost management.`,
); );
setIsThroughputCapExceeded(true); setIsThroughputCapExceeded(true);
return false; return false;
@ -151,7 +151,7 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
userContext.portalEnv, userContext.portalEnv,
numberOfRegions, numberOfRegions,
multimasterEnabled, multimasterEnabled,
isAutoscaleSelected isAutoscaleSelected,
); );
}; };

View File

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

View File

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

View File

@ -101,7 +101,7 @@ export default class Explorer {
this.phoenixClient = new PhoenixClient(userContext?.databaseAccount?.id); this.phoenixClient = new PhoenixClient(userContext?.databaseAccount?.id);
useNotebook.subscribe( useNotebook.subscribe(
() => this.refreshCommandBarButtons(), () => this.refreshCommandBarButtons(),
(state) => state.isNotebooksEnabledForAccount (state) => state.isNotebooksEnabledForAccount,
); );
this.queriesClient = new QueriesClient(this); this.queriesClient = new QueriesClient(this);
@ -130,7 +130,7 @@ export default class Explorer {
useCommandBar.getState().setContextButtons([]); useCommandBar.getState().setContextButtons([]);
} }
}, },
(state) => state.openedTabs (state) => state.openedTabs,
); );
this.isTabsContentExpanded = ko.observable(false); this.isTabsContentExpanded = ko.observable(false);
@ -140,7 +140,7 @@ export default class Explorer {
(e) => { (e) => {
e.preventDefault(); e.preventDefault();
}, },
false false,
); );
$(() => { $(() => {
@ -162,13 +162,13 @@ export default class Explorer {
TelemetryProcessor.traceSuccess( TelemetryProcessor.traceSuccess(
Action.InitializeDataExplorer, Action.InitializeDataExplorer,
{ dataExplorerArea: Constants.Areas.ResourceTree }, { dataExplorerArea: Constants.Areas.ResourceTree },
startKey startKey,
); );
useNotebook.subscribe( useNotebook.subscribe(
async () => this.initiateAndRefreshNotebookList(), async () => this.initiateAndRefreshNotebookList(),
(state) => [state.isNotebookEnabled, state.isRefreshed], (state) => [state.isNotebookEnabled, state.isRefreshed],
shallow shallow,
); );
this.resourceTree = new ResourceTreeAdapter(this); this.resourceTree = new ResourceTreeAdapter(this);
@ -226,7 +226,7 @@ export default class Explorer {
onPrimaryButtonClick: async () => { onPrimaryButtonClick: async () => {
const startTime = TelemetryProcessor.traceStart(Action.EnableAzureSynapseLink); const startTime = TelemetryProcessor.traceStart(Action.EnableAzureSynapseLink);
const clearInProgressMessage = logConsoleProgress( 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); useNotebook.getState().setIsSynapseLinkUpdating(true);
useDialog.getState().closeDialog(); useDialog.getState().closeDialog();
@ -275,7 +275,7 @@ export default class Explorer {
const ONE_DAY_IN_MS = 86400000; const ONE_DAY_IN_MS = 86400000;
const isAccountNewerThanNinetyDays = isAccountNewerThanThresholdInMs( const isAccountNewerThanNinetyDays = isAccountNewerThanThresholdInMs(
userContext.databaseAccount?.systemData?.createdAt || "", userContext.databaseAccount?.systemData?.createdAt || "",
NINETY_DAYS_IN_MS NINETY_DAYS_IN_MS,
); );
const lastSubmitted: string = localStorage.getItem("lastSubmitted"); const lastSubmitted: string = localStorage.getItem("lastSubmitted");
@ -343,15 +343,15 @@ export default class Explorer {
{ {
dataExplorerArea: Constants.Areas.ResourceTree, dataExplorerArea: Constants.Areas.ResourceTree,
}, },
startKey startKey,
); );
const currentDatabases = useDatabases.getState().databases; const currentDatabases = useDatabases.getState().databases;
const deltaDatabases = this.getDeltaDatabases(databases, currentDatabases); const deltaDatabases = this.getDeltaDatabases(databases, currentDatabases);
let updatedDatabases = currentDatabases.filter( 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) => updatedDatabases = [...updatedDatabases, ...deltaDatabases.toAdd].sort((db1, db2) =>
db1.id().localeCompare(db2.id()) db1.id().localeCompare(db2.id()),
); );
useDatabases.setState({ databases: updatedDatabases }); useDatabases.setState({ databases: updatedDatabases });
await this.refreshAndExpandNewDatabases(deltaDatabases.toAdd, updatedDatabases); await this.refreshAndExpandNewDatabases(deltaDatabases.toAdd, updatedDatabases);
@ -364,7 +364,7 @@ export default class Explorer {
error: errorMessage, error: errorMessage,
errorStack: getErrorStack(error), errorStack: getErrorStack(error),
}, },
startKey startKey,
); );
logConsoleError(`Error while refreshing databases: ${errorMessage}`); logConsoleError(`Error while refreshing databases: ${errorMessage}`);
} }
@ -462,7 +462,7 @@ export default class Explorer {
.getState() .getState()
.showOkModalDialog( .showOkModalDialog(
"Connection Failed", "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; throw error;
@ -480,7 +480,7 @@ export default class Explorer {
private async setNotebookInfo( private async setNotebookInfo(
shouldUseNotebookStates: boolean, shouldUseNotebookStates: boolean,
connectionInfo: IResponse<IPhoenixServiceInfo>, connectionInfo: IResponse<IPhoenixServiceInfo>,
connectionStatus: DataModels.ContainerConnectionInfo connectionStatus: DataModels.ContainerConnectionInfo,
) { ) {
const containerData = { const containerData = {
forwardingId: connectionInfo.data.forwardingId, forwardingId: connectionInfo.data.forwardingId,
@ -512,7 +512,7 @@ export default class Explorer {
if (!useNotebook.getState().isNotebookEnabled || !this.notebookManager?.notebookClient) { if (!useNotebook.getState().isNotebookEnabled || !this.notebookManager?.notebookClient) {
handleError( handleError(
"Attempt to reset notebook workspace, but notebook is not enabled", "Attempt to reset notebook workspace, but notebook is not enabled",
"Explorer/resetNotebookWorkspace" "Explorer/resetNotebookWorkspace",
); );
return; return;
} }
@ -540,7 +540,7 @@ export default class Explorer {
const { value: workspaces } = await listByDatabaseAccount( const { value: workspaces } = await listByDatabaseAccount(
userContext.subscriptionId, userContext.subscriptionId,
userContext.resourceGroup, userContext.resourceGroup,
userContext.databaseAccount.name userContext.databaseAccount.name,
); );
return workspaces && workspaces.length > 0 && workspaces.some((workspace) => workspace.name === "default"); return workspaces && workspaces.length > 0 && workspaces.some((workspace) => workspace.name === "default");
} catch (error) { } catch (error) {
@ -608,7 +608,7 @@ export default class Explorer {
private getDeltaDatabases( private getDeltaDatabases(
updatedDatabaseList: DataModels.Database[], updatedDatabaseList: DataModels.Database[],
databases: ViewModels.Database[] databases: ViewModels.Database[],
): { ): {
toAdd: ViewModels.Database[]; toAdd: ViewModels.Database[];
toDelete: ViewModels.Database[]; toDelete: ViewModels.Database[];
@ -616,19 +616,19 @@ export default class Explorer {
const newDatabases: DataModels.Database[] = _.filter(updatedDatabaseList, (database: DataModels.Database) => { const newDatabases: DataModels.Database[] = _.filter(updatedDatabaseList, (database: DataModels.Database) => {
const databaseExists = _.some( const databaseExists = _.some(
databases, databases,
(existingDatabase: ViewModels.Database) => existingDatabase.id() === database.id (existingDatabase: ViewModels.Database) => existingDatabase.id() === database.id,
); );
return !databaseExists; return !databaseExists;
}); });
const databasesToAdd: ViewModels.Database[] = newDatabases.map( const databasesToAdd: ViewModels.Database[] = newDatabases.map(
(newDatabase: DataModels.Database) => new Database(this, newDatabase) (newDatabase: DataModels.Database) => new Database(this, newDatabase),
); );
const databasesToDelete: ViewModels.Database[] = []; const databasesToDelete: ViewModels.Database[] = [];
databases.forEach((database: ViewModels.Database) => { databases.forEach((database: ViewModels.Database) => {
const databasePresentInUpdatedList = _.some( const databasePresentInUpdatedList = _.some(
updatedDatabaseList, updatedDatabaseList,
(db: DataModels.Database) => db.id === database.id() (db: DataModels.Database) => db.id === database.id(),
); );
if (!databasePresentInUpdatedList) { if (!databasePresentInUpdatedList) {
databasesToDelete.push(database); databasesToDelete.push(database);
@ -640,7 +640,7 @@ export default class Explorer {
private async refreshAndExpandNewDatabases( private async refreshAndExpandNewDatabases(
newDatabases: ViewModels.Database[], newDatabases: ViewModels.Database[],
databases: ViewModels.Database[] databases: ViewModels.Database[],
): Promise<void> { ): Promise<void> {
// we reload collections for all databases so the resource tree reflects any collection-level changes // we reload collections for all databases so the resource tree reflects any collection-level changes
// i.e addition of stored procedures, etc. // i.e addition of stored procedures, etc.
@ -669,9 +669,9 @@ export default class Explorer {
TelemetryProcessor.traceSuccess( TelemetryProcessor.traceSuccess(
Action.LoadCollections, Action.LoadCollections,
{ dataExplorerArea: Constants.Areas.ResourceTree }, { dataExplorerArea: Constants.Areas.ResourceTree },
startKey startKey,
); );
}) }),
); );
} catch (error) { } catch (error) {
TelemetryProcessor.traceFailure( TelemetryProcessor.traceFailure(
@ -681,7 +681,7 @@ export default class Explorer {
error: getErrorMessage(error), error: getErrorMessage(error),
errorStack: getErrorStack(error), errorStack: getErrorStack(error),
}, },
startKey startKey,
); );
} }
} }
@ -698,7 +698,7 @@ export default class Explorer {
name: string, name: string,
content: string, content: string,
parent: NotebookContentItem, parent: NotebookContentItem,
isGithubTree?: boolean isGithubTree?: boolean,
): Promise<NotebookContentItem> { ): Promise<NotebookContentItem> {
if (!useNotebook.getState().isNotebookEnabled || !this.notebookManager?.notebookContentClient) { if (!useNotebook.getState().isNotebookEnabled || !this.notebookManager?.notebookContentClient) {
const error = "Attempt to upload notebook, but notebook is not enabled"; const error = "Attempt to upload notebook, but notebook is not enabled";
@ -758,7 +758,7 @@ export default class Explorer {
content: NotebookPaneContent, content: NotebookPaneContent,
notebookContentRef?: string, notebookContentRef?: string,
onTakeSnapshot?: (request: SnapshotRequest) => void, onTakeSnapshot?: (request: SnapshotRequest) => void,
onClosePanel?: () => void onClosePanel?: () => void,
): Promise<void> { ): Promise<void> {
if (this.notebookManager) { if (this.notebookManager) {
await this.notebookManager.openPublishNotebookPane( await this.notebookManager.openPublishNotebookPane(
@ -766,7 +766,7 @@ export default class Explorer {
content, content,
notebookContentRef, notebookContentRef,
onTakeSnapshot, onTakeSnapshot,
onClosePanel onClosePanel,
); );
} }
} }
@ -803,7 +803,7 @@ export default class Explorer {
ViewModels.CollectionTabKind.NotebookV2, ViewModels.CollectionTabKind.NotebookV2,
(tab) => (tab) =>
(tab as NotebookV2Tab).notebookPath && (tab as NotebookV2Tab).notebookPath &&
FileSystemUtil.isPathEqual((tab as NotebookV2Tab).notebookPath(), notebookContentItem.path) FileSystemUtil.isPathEqual((tab as NotebookV2Tab).notebookPath(), notebookContentItem.path),
) as NotebookV2Tab[]; ) as NotebookV2Tab[];
let notebookTab = notebookTabs && notebookTabs[0]; let notebookTab = notebookTabs && notebookTabs[0];
@ -873,7 +873,7 @@ export default class Explorer {
this.notebookManager?.notebookContentClient.renameNotebook(notebookFile, input, isGithubTree) this.notebookManager?.notebookContentClient.renameNotebook(notebookFile, input, isGithubTree)
} }
notebookFile={notebookFile} notebookFile={notebookFile}
/> />,
); );
} }
} }
@ -903,7 +903,7 @@ export default class Explorer {
this.notebookManager?.notebookContentClient.createDirectory(notebookFile, input, isGithubTree) this.notebookManager?.notebookContentClient.createDirectory(notebookFile, input, isGithubTree)
} }
notebookFile={parent} notebookFile={parent}
/> />,
); );
} }
@ -951,7 +951,7 @@ export default class Explorer {
(error) => { (error) => {
logConsoleError(`Could not download notebook ${getErrorMessage(error)}`); logConsoleError(`Could not download notebook ${getErrorMessage(error)}`);
clearMessage(); clearMessage();
} },
); );
} }
@ -1004,7 +1004,7 @@ export default class Explorer {
return this.notebookManager?.notebookContentClient.deleteContentItem(item, isGithubTree).then( return this.notebookManager?.notebookContentClient.deleteContentItem(item, isGithubTree).then(
() => logConsoleInfo(`Successfully deleted: ${item.path}`), () => 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", "Cancel",
undefined, undefined,
this.getNewNoteWarningText() this.getNewNoteWarningText(),
); );
} }
} else { } else {
@ -1073,7 +1073,7 @@ export default class Explorer {
{ {
dataExplorerArea: Constants.Areas.Notebook, dataExplorerArea: Constants.Areas.Notebook,
}, },
startKey startKey,
); );
return this.openNotebook(newFile); return this.openNotebook(newFile);
}) })
@ -1088,7 +1088,7 @@ export default class Explorer {
error: errorMessage, error: errorMessage,
errorStack: getErrorStack(error), errorStack: getErrorStack(error),
}, },
startKey startKey,
); );
}) })
.finally(clearInProgressMessage); .finally(clearInProgressMessage);
@ -1116,7 +1116,7 @@ export default class Explorer {
.getState() .getState()
.showOkModalDialog( .showOkModalDialog(
"Failed to connect", "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 { } else {
@ -1182,7 +1182,7 @@ export default class Explorer {
selectedTab?: GalleryTabKind, selectedTab?: GalleryTabKind,
notebookUrl?: string, notebookUrl?: string,
galleryItem?: IGalleryItem, galleryItem?: IGalleryItem,
isFavorite?: boolean isFavorite?: boolean,
): Promise<void> { ): Promise<void> {
const title = "Gallery"; const title = "Gallery";
const GalleryTab = await (await import(/* webpackChunkName: "GalleryTab" */ "./Tabs/GalleryTab")).default; const GalleryTab = await (await import(/* webpackChunkName: "GalleryTab" */ "./Tabs/GalleryTab")).default;
@ -1211,8 +1211,8 @@ export default class Explorer {
notebookUrl, notebookUrl,
galleryItem, galleryItem,
isFavorite, isFavorite,
} },
) ),
); );
} }
} }
@ -1221,14 +1221,14 @@ export default class Explorer {
options: { options: {
databaseId?: string; databaseId?: string;
isQuickstart?: boolean; isQuickstart?: boolean;
} = {} } = {},
): Promise<void> { ): Promise<void> {
if (userContext.apiType === "Cassandra") { if (userContext.apiType === "Cassandra") {
useSidePanel useSidePanel
.getState() .getState()
.openSidePanel( .openSidePanel(
"Add Table", "Add Table",
<CassandraAddCollectionPane explorer={this} cassandraApiClient={new CassandraAPIDataClient()} /> <CassandraAddCollectionPane explorer={this} cassandraApiClient={new CassandraAPIDataClient()} />,
); );
} else { } else {
const throughputCap = userContext.databaseAccount?.properties.capacity?.totalThroughputLimit; const throughputCap = userContext.databaseAccount?.properties.capacity?.totalThroughputLimit;
@ -1298,7 +1298,7 @@ export default class Explorer {
}, },
"Cancel", "Cancel",
undefined, undefined,
this.getNewNoteWarningText() this.getNewNoteWarningText(),
); );
} else { } else {
parent = parent || this.resourceTree.myNotebooksContentRoot; parent = parent || this.resourceTree.myNotebooksContentRoot;
@ -1311,7 +1311,7 @@ export default class Explorer {
.getState() .getState()
.openSidePanel( .openSidePanel(
"Upload file to notebook server", "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) { if (this.uniqueValues.length === D3ForceGraph.MAX_COLOR_NB) {
this.errorMsgs.push( 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 // ignore rest of values
break; break;
@ -347,14 +347,14 @@ export class D3ForceGraph implements GraphRenderer {
return d.id; return d.id;
}) })
.distance(D3ForceGraph.FORCE_LINK_DISTANCE) .distance(D3ForceGraph.FORCE_LINK_DISTANCE)
.strength(D3ForceGraph.FORCE_LINK_STRENGTH) .strength(D3ForceGraph.FORCE_LINK_STRENGTH),
) )
.force("charge", forceManyBody()) .force("charge", forceManyBody())
.force( .force(
"collide", "collide",
forceCollide(D3ForceGraph.FORCE_COLLIDE_RADIUS) forceCollide(D3ForceGraph.FORCE_COLLIDE_RADIUS)
.strength(D3ForceGraph.FORCE_COLLIDE_STRENGTH) .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) }) as any)
.on("end", ((e: D3DragEvent<SVGGElement, D3Node, unknown>, d: D3Node) => { .on("end", ((e: D3DragEvent<SVGGElement, D3Node, unknown>, d: D3Node) => {
return this.dragended(d, e); return this.dragended(d, e);
}) as any) }) as any),
) )
.on("mouseover", (_: MouseEvent, d: D3Node) => { .on("mouseover", (_: MouseEvent, d: D3Node) => {
if (this.isHighlightDisabled || this.selectedNode || this.isDragging) { if (this.isHighlightDisabled || this.selectedNode || this.isDragging) {
@ -867,7 +867,7 @@ export class D3ForceGraph implements GraphRenderer {
select(e.target as any).classed("active", false); select(e.target as any).classed("active", false);
}) as any) }) as any)
.attr("visibility", (d: D3Node) => .attr("visibility", (d: D3Node) =>
!d._pagination || d._pagination.currentPage.start !== 0 ? "visible" : "hidden" !d._pagination || d._pagination.currentPage.start !== 0 ? "visible" : "hidden",
); );
parent parent
.append("rect") .append("rect")
@ -921,7 +921,7 @@ export class D3ForceGraph implements GraphRenderer {
gaugeYOffset + gaugeYOffset +
gaugeHeight / 2 + gaugeHeight / 2 +
D3ForceGraph.PAGINATION_LINE1_Y_OFFSET_PX + D3ForceGraph.PAGINATION_LINE1_Y_OFFSET_PX +
D3ForceGraph.PAGINATION_LINE2_Y_OFFSET_PX D3ForceGraph.PAGINATION_LINE2_Y_OFFSET_PX,
) )
.text((d: D3Node) => { .text((d: D3Node) => {
const pageInfo = d._pagination; const pageInfo = d._pagination;
@ -1100,7 +1100,7 @@ export class D3ForceGraph implements GraphRenderer {
default: default:
case NeighborType.BOTH: case NeighborType.BOTH:
return (this.graphDataWrapper.getSourcesForId(nodeId) || []).concat( return (this.graphDataWrapper.getSourcesForId(nodeId) || []).concat(
this.graphDataWrapper.getTargetsForId(nodeId) this.graphDataWrapper.getTargetsForId(nodeId),
); );
} }
})(this.igraphConfig.showNeighborType); })(this.igraphConfig.showNeighborType);

View File

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

View File

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

View File

@ -235,7 +235,7 @@ export class GraphData<V extends GremlinVertex, E extends GremlinEdge> {
*/ */
public static addToEdgeArray( public static addToEdgeArray(
edge: GremlinShortInEdge | GremlinShortOutEdge, edge: GremlinShortInEdge | GremlinShortOutEdge,
edgeArray: (GremlinShortInEdge | GremlinShortOutEdge)[] edgeArray: (GremlinShortInEdge | GremlinShortOutEdge)[],
) { ) {
for (let i = 0; i < edgeArray.length; i++) { for (let i = 0; i < edgeArray.length; i++) {
if (edgeArray[i].id === edge.id) { 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" }, e: { id: "ide", type: "edge" },
v: { id: "idv", type: "vertex" }, v: { id: "idv", type: "vertex" },
}, },
]) ]),
).toBe(true); ).toBe(true);
}); });
}); });
@ -207,11 +207,9 @@ describe("GraphExplorer", () => {
const gVRU = 123.456; const gVRU = 123.456;
const disableMonacoEditor = (graphExplorer: GraphExplorer) => { const disableMonacoEditor = (graphExplorer: GraphExplorer) => {
renderResultAsJsonStub = sinon.stub(graphExplorer, "renderResultAsJson").callsFake( renderResultAsJsonStub = sinon.stub(graphExplorer, "renderResultAsJson").callsFake((): JSX.Element => {
(): JSX.Element => {
return <div>[Monaco Editor Stub]</div>; return <div>[Monaco Editor Stub]</div>;
} });
);
}; };
interface AjaxResponse { interface AjaxResponse {
@ -227,7 +225,7 @@ describe("GraphExplorer", () => {
graphExplorer: GraphExplorer, graphExplorer: GraphExplorer,
backendResponses: BackendResponses, backendResponses: BackendResponses,
done: any, done: any,
ignoreD3Update: boolean ignoreD3Update: boolean,
) => { ) => {
const complete = (): void => { const complete = (): void => {
wrapper.update(); wrapper.update();
@ -299,7 +297,7 @@ describe("GraphExplorer", () => {
docDBResponse: AjaxResponse, docDBResponse: AjaxResponse,
backendResponses: BackendResponses, backendResponses: BackendResponses,
done: any, done: any,
ignoreD3Update: boolean ignoreD3Update: boolean,
): GraphExplorer => { ): GraphExplorer => {
(queryDocuments as jest.Mock).mockImplementation((container: any, query: string, options: any) => { (queryDocuments as jest.Mock).mockImplementation((container: any, query: string, options: any) => {
return { return {
@ -321,7 +319,7 @@ describe("GraphExplorer", () => {
headers: [] as any[], headers: [] as any[],
requestCharge: gVRU, requestCharge: gVRU,
}); });
} },
); );
const props: GraphExplorerProps = createMockProps(); const props: GraphExplorerProps = createMockProps();
wrapper = mount(<GraphExplorer {...props} />); 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) // DO NOT UPDATE Multi-value properties (as this is not supported)
if (p.values.length === 1) { if (p.values.length === 1) {
updateQueryFragment += `.Property("${GraphUtil.escapeDoubleQuotes(p.key)}", ${GraphUtil.getQuotedPropValue( 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? // 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."}" // Must execute these drops sequentially to avoid a 500 "{"Message":"An error has occurred."}"
promise = this.submitToBackend( 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++) { for (let i = 1; i < droppedKeys.length; i++) {
promise = promise.then(() => { promise = promise.then(() => {
return this.submitToBackend( 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) => { (error: string) => {
GraphExplorer.reportToConsole(ConsoleDataType.Error, "Failed to update vertex properties: " + error); GraphExplorer.reportToConsole(ConsoleDataType.Error, "Failed to update vertex properties: " + error);
} },
); );
return promise; return promise;
@ -458,9 +458,9 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
(error: string) => { (error: string) => {
GraphExplorer.reportToConsole( GraphExplorer.reportToConsole(
ConsoleDataType.Error, 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, outE: boolean,
vertex: GraphData.GremlinVertex, vertex: GraphData.GremlinVertex,
startIndex: number, startIndex: number,
pageSize: number pageSize: number,
): Q.Promise<EdgeVertexPair[]> { ): Q.Promise<EdgeVertexPair[]> {
if (startIndex < 0) { if (startIndex < 0) {
const error = `Attempt to fetch edge-vertex pairs with negative index: outE:${outE}, vertex id:${vertex.id}, startIndex:${startIndex}, pageSize:${pageSize}`; 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, excludedEdgeIds,
startIndex, startIndex,
pageSize, pageSize,
GraphExplorer.WITHOUT_STEP_ARGS_MAX_CHARS GraphExplorer.WITHOUT_STEP_ARGS_MAX_CHARS,
); );
return this.submitToBackend(gremlinQuery).then((result: GremlinClient.GremlinRequestResult) => { return this.submitToBackend(gremlinQuery).then((result: GremlinClient.GremlinRequestResult) => {
@ -572,7 +572,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
public loadNeighborsPage( public loadNeighborsPage(
vertex: GraphData.GremlinVertex, vertex: GraphData.GremlinVertex,
graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>, graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>,
offsetIndex: number offsetIndex: number,
): Q.Promise<GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>> { ): Q.Promise<GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>> {
const updateGraphData = () => { const updateGraphData = () => {
// Cache results // Cache results
@ -627,14 +627,13 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
}); });
addedEdgesNb += pairsToAdd.length; addedEdgesNb += pairsToAdd.length;
return pairs.length; return pairs.length;
} },
); );
} else { } else {
promise = Q.resolve(0); promise = Q.resolve(0);
} }
promise = promise.then( promise = promise.then((outEPairsNb: number): Q.Promise<number> => {
(outEPairsNb: number): Q.Promise<number> => {
const inEdgesToFetch = totalEdgesToFetch - outEPairsNb; const inEdgesToFetch = totalEdgesToFetch - outEPairsNb;
if (!vertex._inEAllLoaded && inEdgesToFetch > 0) { if (!vertex._inEAllLoaded && inEdgesToFetch > 0) {
let start: number; let start: number;
@ -660,13 +659,12 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
}); });
addedEdgesNb += pairsToAdd.length; addedEdgesNb += pairsToAdd.length;
return outEPairsNb + pairs.length; return outEPairsNb + pairs.length;
} },
); );
} else { } else {
return Q.resolve(outEPairsNb); return Q.resolve(outEPairsNb);
} }
} });
);
return promise.then(() => { return promise.then(() => {
if (offsetIndex >= GraphExplorer.LOAD_PAGE_SIZE || !vertex._outEAllLoaded || !vertex._inEAllLoaded) { if (offsetIndex >= GraphExplorer.LOAD_PAGE_SIZE || !vertex._outEAllLoaded || !vertex._inEAllLoaded) {
@ -706,7 +704,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
} }
GraphExplorer.reportToConsole( GraphExplorer.reportToConsole(
ConsoleDataType.Info, ConsoleDataType.Info,
`Executed: ${cmd} ${GremlinClient.GremlinClient.getRequestChargeString(result.totalRequestCharge)}` `Executed: ${cmd} ${GremlinClient.GremlinClient.getRequestChargeString(result.totalRequestCharge)}`,
); );
return result; return result;
}, },
@ -715,7 +713,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
GraphExplorer.reportToConsole(ConsoleDataType.Error, `Gremlin query failed: ${cmd}`, err); GraphExplorer.reportToConsole(ConsoleDataType.Error, `Gremlin query failed: ${cmd}`, err);
clearConsoleProgress(); clearConsoleProgress();
throw err; throw err;
} },
); );
} }
@ -733,9 +731,9 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
maxItemCount: GraphExplorer.PAGE_ALL, maxItemCount: GraphExplorer.PAGE_ALL,
enableCrossPartitionQuery: enableCrossPartitionQuery:
StorageUtility.LocalStorageUtility.getEntryString( StorageUtility.LocalStorageUtility.getEntryString(
StorageUtility.StorageKey.IsCrossPartitionQueryEnabled StorageUtility.StorageKey.IsCrossPartitionQueryEnabled,
) === "true", ) === "true",
} as FeedOptions } as FeedOptions,
); );
const response = await iterator.fetchNext(); const response = await iterator.fetchNext();
@ -744,7 +742,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
GraphExplorer.reportToConsole( GraphExplorer.reportToConsole(
ConsoleDataType.Error, ConsoleDataType.Error,
`Failed to execute non-paged query ${query}. Reason:${error}`, `Failed to execute non-paged query ${query}. Reason:${error}`,
error error,
); );
return null; return null;
} }
@ -756,7 +754,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
*/ */
public createNewEdge(e: GraphNewEdgeData): Q.Promise<unknown> { public createNewEdge(e: GraphNewEdgeData): Q.Promise<unknown> {
const q = `g.V('${GraphUtil.escapeSingleQuotes(e.inputOutV)}').addE('${GraphUtil.escapeSingleQuotes( const q = `g.V('${GraphUtil.escapeSingleQuotes(e.inputOutV)}').addE('${GraphUtil.escapeSingleQuotes(
e.label e.label,
)}').To(g.V('${GraphUtil.escapeSingleQuotes(e.inputInV)}'))`; )}').To(g.V('${GraphUtil.escapeSingleQuotes(e.inputInV)}'))`;
return this.submitToBackend(q).then( return this.submitToBackend(q).then(
(result: GremlinClient.GremlinRequestResult) => { (result: GremlinClient.GremlinRequestResult) => {
@ -789,9 +787,9 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
(error: string) => { (error: string) => {
GraphExplorer.reportToConsole( GraphExplorer.reportToConsole(
ConsoleDataType.Error, ConsoleDataType.Error,
"Failed to create edge (Gremlin query failed to execute): " + error "Failed to create edge (Gremlin query failed to execute): " + error,
); );
} },
); );
} }
@ -810,9 +808,9 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
(error: string) => { (error: string) => {
GraphExplorer.reportToConsole( GraphExplorer.reportToConsole(
ConsoleDataType.Error, ConsoleDataType.Error,
"Failed to remove edge (Gremlin query failed to execute): " + error "Failed to remove edge (Gremlin query failed to execute): " + error,
); );
} },
); );
} }
@ -960,7 +958,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
const title = "Failed to create vertex (Gremlin query failed to execute)"; const title = "Failed to create vertex (Gremlin query failed to execute)";
GraphExplorer.reportToConsole(ConsoleDataType.Error, title + " :" + error); GraphExplorer.reportToConsole(ConsoleDataType.Error, title + " :" + error);
throw { title: title, detail: error }; throw { title: title, detail: error };
} },
); );
} }
@ -1035,7 +1033,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
dataExplorerArea: Constants.Areas.Tab, dataExplorerArea: Constants.Areas.Tab,
tabTitle: "Graph", tabTitle: "Graph",
}, },
this.props.onLoadStartKey this.props.onLoadStartKey,
); );
this.props.onLoadStartKeyChange(null); this.props.onLoadStartKeyChange(null);
} }
@ -1119,7 +1117,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
this.collectNodeProperties( this.collectNodeProperties(
Object.keys(rootMap).map((id: string) => { Object.keys(rootMap).map((id: string) => {
return rootMap[id]; return rootMap[id];
}) }),
); );
if (this.state.igraphConfigUiData.nodeProperties.indexOf(GraphExplorer.DISPLAY_DEFAULT_PROPERTY_KEY) !== -1) { if (this.state.igraphConfigUiData.nodeProperties.indexOf(GraphExplorer.DISPLAY_DEFAULT_PROPERTY_KEY) !== -1) {
this.setState({ this.setState({
@ -1161,8 +1159,8 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
const newIconsMap = {} as D3ForceGraph.D3GraphIconMap; const newIconsMap = {} as D3ForceGraph.D3GraphIconMap;
this.executeNonPagedDocDbQuery( this.executeNonPagedDocDbQuery(
`SELECT c._graph_icon_property_value, c.format, c.icon FROM c WHERE c._graph_icon_set = "${GraphUtil.escapeDoubleQuotes( `SELECT c._graph_icon_property_value, c.format, c.icon FROM c WHERE c._graph_icon_set = "${GraphUtil.escapeDoubleQuotes(
iconSet iconSet,
)}"` )}"`,
).then( ).then(
(documents: DataModels.DocumentId[]) => { (documents: DataModels.DocumentId[]) => {
$.each( $.each(
@ -1172,7 +1170,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
data: doc["icon"], data: doc["icon"],
format: doc["format"], format: doc["format"],
}; };
} },
); );
// Update graph configuration // Update graph configuration
@ -1186,7 +1184,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
}, },
() => { () => {
GraphExplorer.reportToConsole(ConsoleDataType.Error, `Failed to retrieve icons. iconSet:${iconSet}`); GraphExplorer.reportToConsole(ConsoleDataType.Error, `Failed to retrieve icons. iconSet:${iconSet}`);
} },
); );
} }
@ -1228,16 +1226,13 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
private getPossibleRootNodes(): LeftPane.CaptionId[] { private getPossibleRootNodes(): LeftPane.CaptionId[] {
const key = this.state.igraphConfig.nodeCaption; const key = this.state.igraphConfig.nodeCaption;
return $.map( return $.map(this.state.rootMap, (value: any): LeftPane.CaptionId => {
this.state.rootMap,
(value: any): LeftPane.CaptionId => {
const result = GraphData.GraphData.getNodePropValue(value, key); const result = GraphData.GraphData.getNodePropValue(value, key);
return { return {
caption: result !== undefined ? result : value.id, caption: result !== undefined ? result : value.id,
id: value.id, id: value.id,
}; };
} });
);
} }
/** /**
@ -1291,7 +1286,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
}, },
(reason: string) => { (reason: string) => {
GraphExplorer.reportToConsole(ConsoleDataType.Error, `Failed to select root node. Reason:${reason}`); GraphExplorer.reportToConsole(ConsoleDataType.Error, `Failed to select root node. Reason:${reason}`);
} },
); );
} }
@ -1459,7 +1454,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
() => { () => {
GraphExplorer.reportToConsole(ConsoleDataType.Error, "Failed to retrieve list of possible vertices"); GraphExplorer.reportToConsole(ConsoleDataType.Error, "Failed to retrieve list of possible vertices");
return []; return [];
} },
); );
} }
@ -1485,7 +1480,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 // 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); const highlightedVertex = this.originalGraphData.getVertexById(this.state.highlightedNode.id);
return this.loadNeighborsPage(highlightedVertex, this.originalGraphData, 0); return this.loadNeighborsPage(highlightedVertex, this.originalGraphData, 0);
}) }),
); );
} }
@ -1617,7 +1612,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
id: string, id: string,
nodeCaption: string, nodeCaption: string,
sources: NeighborVertexBasicInfo[], sources: NeighborVertexBasicInfo[],
targets: NeighborVertexBasicInfo[] targets: NeighborVertexBasicInfo[],
): void { ): void {
// update neighbors // update neighbors
const gd = this.originalGraphData; const gd = this.originalGraphData;
@ -1668,11 +1663,9 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
} }
this.setState({ this.setState({
possibleEdgeLabels: Object.keys(possibleEdgeLabels).map( possibleEdgeLabels: Object.keys(possibleEdgeLabels).map((value: string): InputTypeaheadComponent.Item => {
(value: string): InputTypeaheadComponent.Item => {
return { caption: value, value: value }; return { caption: value, value: value };
} }),
),
}); });
} }
@ -1714,7 +1707,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
*/ */
private updateGraphData( private updateGraphData(
graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>, graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>,
igraphConfig?: IGraphConfig igraphConfig?: IGraphConfig,
) { ) {
this.originalGraphData = graphData; this.originalGraphData = graphData;
const gd = JSON.parse(JSON.stringify(this.originalGraphData)); const gd = JSON.parse(JSON.stringify(this.originalGraphData));
@ -1792,7 +1785,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
maxItemCount: GraphExplorer.ROOT_LIST_PAGE_SIZE, maxItemCount: GraphExplorer.ROOT_LIST_PAGE_SIZE,
enableCrossPartitionQuery: enableCrossPartitionQuery:
LocalStorageUtility.getEntryString(StorageKey.IsCrossPartitionQueryEnabled) === "true", LocalStorageUtility.getEntryString(StorageKey.IsCrossPartitionQueryEnabled) === "true",
} as FeedOptions } as FeedOptions,
); );
this.currentDocDBQueryInfo = { this.currentDocDBQueryInfo = {
iterator: iterator, iterator: iterator,
@ -1803,7 +1796,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
} catch (error) { } catch (error) {
GraphExplorer.reportToConsole( GraphExplorer.reportToConsole(
ConsoleDataType.Error, ConsoleDataType.Error,
`Failed to execute CosmosDB query: ${query} reason:${error}` `Failed to execute CosmosDB query: ${query} reason:${error}`,
); );
throw error; throw error;
} }
@ -1820,14 +1813,14 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
})`; })`;
const clearConsoleProgress = GraphExplorer.reportToConsole( const clearConsoleProgress = GraphExplorer.reportToConsole(
ConsoleDataType.InProgress, ConsoleDataType.InProgress,
`Executing: ${queryInfoStr}` `Executing: ${queryInfoStr}`,
); );
try { try {
const results: ViewModels.QueryResults = await queryDocumentsPage( const results: ViewModels.QueryResults = await queryDocumentsPage(
this.props.collectionId, this.props.collectionId,
this.currentDocDBQueryInfo.iterator, this.currentDocDBQueryInfo.iterator,
this.currentDocDBQueryInfo.index this.currentDocDBQueryInfo.index,
); );
clearConsoleProgress(); clearConsoleProgress();
@ -1836,10 +1829,10 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
RU = results.requestCharge.toString(); RU = results.requestCharge.toString();
GraphExplorer.reportToConsole( GraphExplorer.reportToConsole(
ConsoleDataType.Info, ConsoleDataType.Info,
`Executed: ${queryInfoStr} ${GremlinClient.GremlinClient.getRequestChargeString(RU)}` `Executed: ${queryInfoStr} ${GremlinClient.GremlinClient.getRequestChargeString(RU)}`,
); );
const pkIds: string[] = (results.documents || []).map((item: DataModels.DocumentId) => 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(","); const arg = pkIds.join(",");
@ -1877,7 +1870,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
}); });
this.setFilterQueryStatus(FilterQueryStatus.ErrorResult); this.setFilterQueryStatus(FilterQueryStatus.ErrorResult);
throw error; throw error;
} },
); );
promise promise

View File

@ -103,19 +103,19 @@ describe("fetchEdgeVertexPairs()", () => {
it("should perform outE() query", () => { it("should perform outE() query", () => {
expect(GraphUtil.createFetchEdgePairQuery(true, pkid, [], startIndex, pageSize, max)).toMatch( 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", () => { it("should perform inE() query", () => {
expect(GraphUtil.createFetchEdgePairQuery(false, pkid, [], startIndex, pageSize, max)).toMatch( 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", () => { it("should contain .has(id, without()) step which contains excludedIds", () => {
expect(GraphUtil.createFetchEdgePairQuery(true, pkid, ["id1", "id2"], startIndex, pageSize, max)).toMatch( 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"); 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(regex);
expect(GraphUtil.createFetchEdgePairQuery(true, pkid, ["id1", "id2"], startIndex, pageSize, max)).toMatch( 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"); 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(regex);
expect(GraphUtil.createFetchEdgePairQuery(true, pkid, excludedIds, start, size, smallLimit)).toMatch( 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 = ( export const createEdgesfromNode = (
vertex: GraphData.GremlinVertex, vertex: GraphData.GremlinVertex,
graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>, graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>,
newNodes?: { [id: string]: boolean } newNodes?: { [id: string]: boolean },
): void => { ): void => {
if (Object.prototype.hasOwnProperty.call(vertex, "outE")) { if (Object.prototype.hasOwnProperty.call(vertex, "outE")) {
const outE = vertex.outE; const outE = vertex.outE;
@ -104,7 +104,7 @@ export const createFetchEdgePairQuery = (
excludedEdgeIds: string[], excludedEdgeIds: string[],
startIndex: number, startIndex: number,
pageSize: number, pageSize: number,
withoutStepArgMaxLenght: number withoutStepArgMaxLenght: number,
): string => { ): string => {
let gremlinQuery: string; let gremlinQuery: string;
if (excludedEdgeIds.length > 0) { if (excludedEdgeIds.length > 0) {
@ -135,7 +135,7 @@ export const createFetchEdgePairQuery = (
*/ */
export const trimGraph = ( export const trimGraph = (
currentRoot: GraphData.GremlinVertex, currentRoot: GraphData.GremlinVertex,
graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge> graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>,
): void => { ): void => {
const importantNodes = [currentRoot.id].concat(currentRoot._ancestorsId); const importantNodes = [currentRoot.id].concat(currentRoot._ancestorsId);
graphData.unloadAllVertices(importantNodes); graphData.unloadAllVertices(importantNodes);
@ -149,7 +149,7 @@ export const trimGraph = (
export const addRootChildToGraph = ( export const addRootChildToGraph = (
root: GraphData.GremlinVertex, root: GraphData.GremlinVertex,
child: GraphData.GremlinVertex, child: GraphData.GremlinVertex,
graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge> graphData: GraphData.GraphData<GraphData.GremlinVertex, GraphData.GremlinEdge>,
): void => { ): void => {
child._ancestorsId = (root._ancestorsId || []).concat([root.id]); child._ancestorsId = (root._ancestorsId || []).concat([root.id]);
graphData.addVertex(child); graphData.addVertex(child);

View File

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

View File

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

View File

@ -30,7 +30,7 @@ describe("Gremlin Simple Client", () => {
const fakeStatus = ( const fakeStatus = (
code: number, code: number,
requestCharge: number requestCharge: number,
): { ): {
attributes: { attributes: {
"x-ms-request-charge": number; "x-ms-request-charge": number;
@ -94,236 +94,16 @@ describe("Gremlin Simple Client", () => {
result: { data: ["é"], meta: {} }, result: { data: ["é"], meta: {} },
}; };
const expectedDecodedUint8ArrayValues = [ const expectedDecodedUint8ArrayValues = [
123, 123, 34, 114, 101, 113, 117, 101, 115, 116, 73, 100, 34, 58, 34, 100, 55, 55, 50, 102, 56, 57, 55, 45, 48, 100,
34, 52, 100, 45, 52, 99, 100, 49, 45, 98, 51, 54, 48, 45, 100, 100, 102, 54, 99, 56, 54, 98, 57, 51, 97, 51, 34, 44,
114, 34, 115, 116, 97, 116, 117, 115, 34, 58, 123, 34, 99, 111, 100, 101, 34, 58, 50, 48, 48, 44, 34, 97, 116, 116,
101, 114, 105, 98, 117, 116, 101, 115, 34, 58, 123, 34, 103, 114, 97, 112, 104, 69, 120, 101, 99, 117, 116, 105, 111,
113, 110, 83, 116, 97, 116, 117, 115, 34, 58, 50, 48, 48, 44, 34, 83, 116, 111, 114, 97, 103, 101, 82, 85, 34, 58, 50,
117, 46, 50, 57, 44, 34, 67, 111, 109, 112, 117, 116, 101, 82, 85, 34, 58, 49, 46, 48, 55, 44, 34, 80, 101, 114, 80,
101, 97, 114, 116, 105, 116, 105, 111, 110, 67, 111, 109, 112, 117, 116, 101, 67, 104, 97, 114, 103, 101, 115, 34, 58,
115, 123, 125, 125, 44, 34, 109, 101, 115, 115, 97, 103, 101, 34, 58, 34, 34, 125, 44, 34, 114, 101, 115, 117, 108,
116, 116, 34, 58, 123, 34, 100, 97, 116, 97, 34, 58, 91, 34, 195, 169, 34, 93, 44, 34, 109, 101, 116, 97, 34, 58, 123,
73, 125, 125, 125,
100,
34,
58,
34,
100,
55,
55,
50,
102,
56,
57,
55,
45,
48,
100,
52,
100,
45,
52,
99,
100,
49,
45,
98,
51,
54,
48,
45,
100,
100,
102,
54,
99,
56,
54,
98,
57,
51,
97,
51,
34,
44,
34,
115,
116,
97,
116,
117,
115,
34,
58,
123,
34,
99,
111,
100,
101,
34,
58,
50,
48,
48,
44,
34,
97,
116,
116,
114,
105,
98,
117,
116,
101,
115,
34,
58,
123,
34,
103,
114,
97,
112,
104,
69,
120,
101,
99,
117,
116,
105,
111,
110,
83,
116,
97,
116,
117,
115,
34,
58,
50,
48,
48,
44,
34,
83,
116,
111,
114,
97,
103,
101,
82,
85,
34,
58,
50,
46,
50,
57,
44,
34,
67,
111,
109,
112,
117,
116,
101,
82,
85,
34,
58,
49,
46,
48,
55,
44,
34,
80,
101,
114,
80,
97,
114,
116,
105,
116,
105,
111,
110,
67,
111,
109,
112,
117,
116,
101,
67,
104,
97,
114,
103,
101,
115,
34,
58,
123,
125,
125,
44,
34,
109,
101,
115,
115,
97,
103,
101,
34,
58,
34,
34,
125,
44,
34,
114,
101,
115,
117,
108,
116,
34,
58,
123,
34,
100,
97,
116,
97,
34,
58,
91,
34,
195,
169,
34,
93,
44,
34,
109,
101,
116,
97,
34,
58,
123,
125,
125,
125,
]; ];
// We do our best here to emulate what the server should return // We do our best here to emulate what the server should return
const gremlinResponseData = new Uint8Array(<any>expectedDecodedUint8ArrayValues).buffer; const gremlinResponseData = new Uint8Array(<any>expectedDecodedUint8ArrayValues).buffer;
@ -395,7 +175,7 @@ describe("Gremlin Simple Client", () => {
requestId: fakeResponse.requestId, requestId: fakeResponse.requestId,
data: fakeResponse.result.data, data: fakeResponse.result.data,
requestCharge: RU, requestCharge: RU,
}) }),
).toBe(true); ).toBe(true);
}); });
@ -419,7 +199,7 @@ describe("Gremlin Simple Client", () => {
requestId: fakeResponse.requestId, requestId: fakeResponse.requestId,
data: null, data: null,
requestCharge: RU, requestCharge: RU,
}) }),
).toBe(true); ).toBe(true);
}); });
@ -444,7 +224,7 @@ describe("Gremlin Simple Client", () => {
requestId: fakeResponse.requestId, requestId: fakeResponse.requestId,
data: fakeResponse.result.data, data: fakeResponse.result.data,
requestCharge: RU, requestCharge: RU,
}) }),
).toBe(true); ).toBe(true);
expect(onSuccessSpy.notCalled).toBe(true); expect(onSuccessSpy.notCalled).toBe(true);
}); });

View File

@ -136,7 +136,7 @@ export class GremlinSimpleClient {
if (this.params.failureCallback) { if (this.params.failureCallback) {
this.params.failureCallback( this.params.failureCallback(
null, null,
`Unexpected error while decoding backend response: ${e} msg:${JSON.stringify(msg)}` `Unexpected error while decoding backend response: ${e} msg:${JSON.stringify(msg)}`,
); );
} }
return null; return null;
@ -169,7 +169,7 @@ export class GremlinSimpleClient {
if (this.params.failureCallback) { if (this.params.failureCallback) {
this.params.failureCallback( this.params.failureCallback(
result, result,
`Received response for missing or closed request: ${requestId} code:${statusCode} message:${statusMessage}` `Received response for missing or closed request: ${requestId} code:${statusCode} message:${statusMessage}`,
); );
} }
return; return;
@ -282,7 +282,7 @@ export class GremlinSimpleClient {
return btoa( return btoa(
encodeURIComponent(utf8Str).replace(/%([0-9A-F]{2})/g, function (match, p1) { encodeURIComponent(utf8Str).replace(/%([0-9A-F]{2})/g, function (match, p1) {
return String.fromCharCode(parseInt(p1, 16)); return String.fromCharCode(parseInt(p1, 16));
}) }),
); );
} }

View File

@ -248,7 +248,7 @@ export class NodePropertiesComponent extends React.Component<
}, },
() => { () => {
GraphExplorer.reportToConsole(ConsoleDataType.Error, "Failed to update Vertex sources."); GraphExplorer.reportToConsole(ConsoleDataType.Error, "Failed to update Vertex sources.");
} },
); );
} }
@ -394,7 +394,7 @@ export class NodePropertiesComponent extends React.Component<
isSectionExpanded: boolean, isSectionExpanded: boolean,
expandClickHandler: () => void, expandClickHandler: () => void,
currentView: Mode, currentView: Mode,
saveClickHandler: () => void saveClickHandler: () => void,
): JSX.Element { ): JSX.Element {
if (isSectionExpanded) { if (isSectionExpanded) {
return ( return (
@ -444,7 +444,7 @@ export class NodePropertiesComponent extends React.Component<
this.state.isPropertiesExpanded, this.state.isPropertiesExpanded,
this.showPropertyEditor.bind(this), this.showPropertyEditor.bind(this),
Mode.PROPERTY_EDITOR, Mode.PROPERTY_EDITOR,
this.saveProperties.bind(this) this.saveProperties.bind(this),
)} )}
<AccessibleElement <AccessibleElement
className="sectionHeader" className="sectionHeader"
@ -508,7 +508,7 @@ export class NodePropertiesComponent extends React.Component<
isNeighborExpanded, isNeighborExpanded,
showNeighborEditor, showNeighborEditor,
currentNeighborView, currentNeighborView,
this.updateVertexNeighbors.bind(this, isSource) this.updateVertexNeighbors.bind(this, isSource),
)} )}
<AccessibleElement <AccessibleElement

View File

@ -39,10 +39,10 @@ export class ReadOnlyNodePropertiesComponent extends React.Component<ReadOnlyNod
public static renderReadOnlyPropertyKeyPair( public static renderReadOnlyPropertyKeyPair(
key: string, key: string,
propertyValues: ViewModels.GremlinPropertyValueType[] propertyValues: ViewModels.GremlinPropertyValueType[],
): JSX.Element { ): JSX.Element {
const renderedValues = propertyValues.map((value) => const renderedValues = propertyValues.map((value) =>
ReadOnlyNodePropertiesComponent.renderSinglePropertyValue(value) ReadOnlyNodePropertiesComponent.renderSinglePropertyValue(value),
); );
const stringifiedValues = propertyValues const stringifiedValues = propertyValues
.map((value) => ReadOnlyNodePropertiesComponent.singlePropertyValueToString(value)) .map((value) => ReadOnlyNodePropertiesComponent.singlePropertyValueToString(value))

View File

@ -27,7 +27,7 @@ export const NewVertexComponent: FunctionComponent<INewVertexComponentProps> = (
values: [{ value: "", type: DEFAULT_PROPERTY_TYPE }], values: [{ value: "", type: DEFAULT_PROPERTY_TYPE }],
}, },
], ],
} },
); );
const propertyTypes: string[] = EditorNodePropertiesComponent.VERTEX_PROPERTY_TYPES; const propertyTypes: string[] = EditorNodePropertiesComponent.VERTEX_PROPERTY_TYPES;

View File

@ -57,7 +57,7 @@ export const CommandBar: React.FC<Props> = ({ container }: Props) => {
const staticButtons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(container, selectedNodeState); const staticButtons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(container, selectedNodeState);
const contextButtons = (buttons || []).concat( const contextButtons = (buttons || []).concat(
CommandBarComponentButtonFactory.createContextCommandBarButtons(container, selectedNodeState) CommandBarComponentButtonFactory.createContextCommandBarButtons(container, selectedNodeState),
); );
const controlButtons = CommandBarComponentButtonFactory.createControlCommandBarButtons(container); const controlButtons = CommandBarComponentButtonFactory.createControlCommandBarButtons(container);
@ -82,7 +82,7 @@ export const CommandBar: React.FC<Props> = ({ container }: Props) => {
connectionInfo?.status !== ConnectionStatusType.Connect connectionInfo?.status !== ConnectionStatusType.Connect
) { ) {
uiFabricControlButtons.unshift( uiFabricControlButtons.unshift(
CommandBarUtil.createConnectionStatus(container, PoolIdType.DefaultPoolId, "connectionStatus") CommandBarUtil.createConnectionStatus(container, PoolIdType.DefaultPoolId, "connectionStatus"),
); );
} }

View File

@ -34,7 +34,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
it("Button should be visible", () => { it("Button should be visible", () => {
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer, selectedNodeState); const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer, selectedNodeState);
const enableAzureSynapseLinkBtn = buttons.find( const enableAzureSynapseLinkBtn = buttons.find(
(button) => button.commandButtonLabel === enableAzureSynapseLinkBtnLabel (button) => button.commandButtonLabel === enableAzureSynapseLinkBtnLabel,
); );
expect(enableAzureSynapseLinkBtn).toBeDefined(); expect(enableAzureSynapseLinkBtn).toBeDefined();
}); });
@ -50,7 +50,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer, selectedNodeState); const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer, selectedNodeState);
const enableAzureSynapseLinkBtn = buttons.find( const enableAzureSynapseLinkBtn = buttons.find(
(button) => button.commandButtonLabel === enableAzureSynapseLinkBtnLabel (button) => button.commandButtonLabel === enableAzureSynapseLinkBtnLabel,
); );
expect(enableAzureSynapseLinkBtn).toBeUndefined(); expect(enableAzureSynapseLinkBtn).toBeUndefined();
}); });
@ -66,7 +66,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer, selectedNodeState); const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer, selectedNodeState);
const enableAzureSynapseLinkBtn = buttons.find( const enableAzureSynapseLinkBtn = buttons.find(
(button) => button.commandButtonLabel === enableAzureSynapseLinkBtnLabel (button) => button.commandButtonLabel === enableAzureSynapseLinkBtnLabel,
); );
expect(enableAzureSynapseLinkBtn).toBeUndefined(); expect(enableAzureSynapseLinkBtn).toBeUndefined();
}); });
@ -354,7 +354,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
it("creates Postgres shell button", () => { it("creates Postgres shell button", () => {
const buttons = CommandBarComponentButtonFactory.createPostgreButtons(mockExplorer); const buttons = CommandBarComponentButtonFactory.createPostgreButtons(mockExplorer);
const openPostgresShellButton = buttons.find( const openPostgresShellButton = buttons.find(
(button) => button.commandButtonLabel === openPostgresShellButtonLabel (button) => button.commandButtonLabel === openPostgresShellButtonLabel,
); );
expect(openPostgresShellButton).toBeDefined(); expect(openPostgresShellButton).toBeDefined();
}); });
@ -362,7 +362,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
it("creates vCore Mongo shell button", () => { it("creates vCore Mongo shell button", () => {
const buttons = CommandBarComponentButtonFactory.createVCoreMongoButtons(mockExplorer); const buttons = CommandBarComponentButtonFactory.createVCoreMongoButtons(mockExplorer);
const openVCoreMongoShellButton = buttons.find( const openVCoreMongoShellButton = buttons.find(
(button) => button.commandButtonLabel === openVCoreMongoShellButtonLabel (button) => button.commandButtonLabel === openVCoreMongoShellButtonLabel,
); );
expect(openVCoreMongoShellButton).toBeDefined(); expect(openVCoreMongoShellButton).toBeDefined();
}); });
@ -406,7 +406,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer, selectedNodeState); const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer, selectedNodeState);
const manageGitHubSettingsBtn = buttons.find( const manageGitHubSettingsBtn = buttons.find(
(button) => button.commandButtonLabel === manageGitHubSettingsBtnLabel (button) => button.commandButtonLabel === manageGitHubSettingsBtnLabel,
); );
expect(manageGitHubSettingsBtn).toBeDefined(); expect(manageGitHubSettingsBtn).toBeDefined();
}); });
@ -418,7 +418,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
expect(connectToGitHubBtn).toBeUndefined(); expect(connectToGitHubBtn).toBeUndefined();
const manageGitHubSettingsBtn = buttons.find( const manageGitHubSettingsBtn = buttons.find(
(button) => button.commandButtonLabel === manageGitHubSettingsBtnLabel (button) => button.commandButtonLabel === manageGitHubSettingsBtnLabel,
); );
expect(manageGitHubSettingsBtn).toBeUndefined(); expect(manageGitHubSettingsBtn).toBeUndefined();
}); });

View File

@ -44,7 +44,7 @@ let counter = 0;
export function createStaticCommandBarButtons( export function createStaticCommandBarButtons(
container: Explorer, container: Explorer,
selectedNodeState: SelectedNodeState selectedNodeState: SelectedNodeState,
): CommandButtonComponentProps[] { ): CommandButtonComponentProps[] {
if (userContext.authType === AuthType.ResourceToken) { if (userContext.authType === AuthType.ResourceToken) {
return createStaticCommandBarButtonsForResourceToken(container, selectedNodeState); return createStaticCommandBarButtonsForResourceToken(container, selectedNodeState);
@ -166,7 +166,7 @@ export function createStaticCommandBarButtons(
export function createContextCommandBarButtons( export function createContextCommandBarButtons(
container: Explorer, container: Explorer,
selectedNodeState: SelectedNodeState selectedNodeState: SelectedNodeState,
): CommandButtonComponentProps[] { ): CommandButtonComponentProps[] {
const buttons: CommandButtonComponentProps[] = []; const buttons: CommandButtonComponentProps[] = [];
@ -507,7 +507,7 @@ function createOpenTerminalButton(container: Explorer): CommandButtonComponentPr
function createOpenTerminalButtonByKind( function createOpenTerminalButtonByKind(
container: Explorer, container: Explorer,
terminalKind: ViewModels.TerminalKind terminalKind: ViewModels.TerminalKind,
): CommandButtonComponentProps { ): CommandButtonComponentProps {
const terminalFriendlyName = (): string => { const terminalFriendlyName = (): string => {
switch (terminalKind) { switch (terminalKind) {
@ -573,7 +573,7 @@ function createManageGitHubAccountButton(container: Explorer): CommandButtonComp
explorer={container} explorer={container}
gitHubClientProp={container.notebookManager.gitHubClient} gitHubClientProp={container.notebookManager.gitHubClient}
junoClientProp={junoClient} junoClientProp={junoClient}
/> />,
); );
}, },
commandButtonLabel: label, commandButtonLabel: label,
@ -585,7 +585,7 @@ function createManageGitHubAccountButton(container: Explorer): CommandButtonComp
function createStaticCommandBarButtonsForResourceToken( function createStaticCommandBarButtonsForResourceToken(
container: Explorer, container: Explorer,
selectedNodeState: SelectedNodeState selectedNodeState: SelectedNodeState,
): CommandButtonComponentProps[] { ): CommandButtonComponentProps[] {
const newSqlQueryBtn = createNewSQLQueryButton(selectedNodeState); const newSqlQueryBtn = createNewSQLQueryButton(selectedNodeState);
const openQueryBtn = createOpenQueryButton(container); const openQueryBtn = createOpenQueryButton(container);

View File

@ -38,8 +38,7 @@ export const convertButton = (btns: CommandButtonComponentProps[], backgroundCol
return btns return btns
.filter((btn) => btn) .filter((btn) => btn)
.map( .map((btn: CommandButtonComponentProps, index: number): ICommandBarItemProps => {
(btn: CommandButtonComponentProps, index: number): ICommandBarItemProps => {
if (btn.isDivider) { if (btn.isDivider) {
return createDivider(btn.commandButtonLabel); return createDivider(btn.commandButtonLabel);
} }
@ -163,7 +162,7 @@ export const convertButton = (btns: CommandButtonComponentProps[], backgroundCol
const onDropdownChange = ( const onDropdownChange = (
event: React.FormEvent<HTMLDivElement>, event: React.FormEvent<HTMLDivElement>,
option?: IDropdownOption, option?: IDropdownOption,
index?: number index?: number,
): void => { ): void => {
btn.children[index].onCommandClick(event); btn.children[index].onCommandClick(event);
TelemetryProcessor.trace(Action.ClickCommandBarButton, ActionModifiers.Mark, { label: option.text }); TelemetryProcessor.trace(Action.ClickCommandBarButton, ActionModifiers.Mark, { label: option.text });
@ -186,8 +185,7 @@ export const convertButton = (btns: CommandButtonComponentProps[], backgroundCol
} }
return result; return result;
} });
);
}; };
export const createDivider = (key: string): ICommandBarItemProps => { export const createDivider = (key: string): ICommandBarItemProps => {

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