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
311 changed files with 1899 additions and 2194 deletions

View File

@@ -66,7 +66,7 @@ export default class ConflictsTab extends TabsBase {
this.documentContentsGridId = `conflictsContentsGrid${this.tabId}`;
this.documentContentsContainerId = `conflictsContentsContainer${this.tabId}`;
this.editorState = ko.observable<ViewModels.DocumentExplorerState>(
ViewModels.DocumentExplorerState.noDocumentSelected
ViewModels.DocumentExplorerState.noDocumentSelected,
);
this.selectedConflictId = ko.observable<ConflictId>();
this.selectedConflictContent = editable.observable<any>("");
@@ -100,7 +100,7 @@ export default class ConflictsTab extends TabsBase {
this.accessibleDocumentList = new AccessibleVerticalList(this.conflictIds());
this.accessibleDocumentList.setOnSelect(
(selectedDocument: ConflictId) => selectedDocument && selectedDocument.click()
(selectedDocument: ConflictId) => selectedDocument && selectedDocument.click(),
);
this.selectedConflictId.subscribe((newSelectedDocumentId: ConflictId) => {
this.accessibleDocumentList.updateCurrentItem(newSelectedDocumentId);
@@ -110,7 +110,7 @@ export default class ConflictsTab extends TabsBase {
this.conflictIds.subscribe((newDocuments: ConflictId[]) => {
this.accessibleDocumentList.updateItemList(newDocuments);
this.dataContentsGridScrollHeight(
newDocuments.length * DocumentsGridMetrics.IndividualRowHeight + DocumentsGridMetrics.BufferHeight + "px"
newDocuments.length * DocumentsGridMetrics.IndividualRowHeight + DocumentsGridMetrics.BufferHeight + "px",
);
});
@@ -262,7 +262,7 @@ export default class ConflictsTab extends TabsBase {
"OK",
async () => await this.resolveConflict(),
"Cancel",
undefined
undefined,
);
} else {
await this.resolveConflict();
@@ -290,7 +290,7 @@ export default class ConflictsTab extends TabsBase {
await updateDocument(
this.collection,
selectedConflict.buildDocumentIdFromConflict(documentContent[selectedConflict.partitionKeyProperty]),
documentContent
documentContent,
);
}
@@ -308,7 +308,7 @@ export default class ConflictsTab extends TabsBase {
await deleteDocument(
this.collection,
selectedConflict.buildDocumentIdFromConflict(documentContent[selectedConflict.partitionKeyProperty])
selectedConflict.buildDocumentIdFromConflict(documentContent[selectedConflict.partitionKeyProperty]),
);
}
@@ -327,7 +327,7 @@ export default class ConflictsTab extends TabsBase {
conflictOperationType: selectedConflict.operationType,
conflictResourceId: selectedConflict.resourceId,
},
startKey
startKey,
);
} catch (error) {
this.isExecutionError(true);
@@ -344,7 +344,7 @@ export default class ConflictsTab extends TabsBase {
error: errorMessage,
errorStack: getErrorStack(error),
},
startKey
startKey,
);
} finally {
this.isExecuting(false);
@@ -381,7 +381,7 @@ export default class ConflictsTab extends TabsBase {
conflictOperationType: selectedConflict.operationType,
conflictResourceId: selectedConflict.resourceId,
},
startKey
startKey,
);
} catch (error) {
this.isExecutionError(true);
@@ -398,7 +398,7 @@ export default class ConflictsTab extends TabsBase {
error: errorMessage,
errorStack: getErrorStack(error),
},
startKey
startKey,
);
} finally {
this.isExecuting(false);
@@ -454,7 +454,7 @@ export default class ConflictsTab extends TabsBase {
error: getErrorMessage(error),
errorStack: getErrorStack(error),
},
this.onLoadStartKey
this.onLoadStartKey,
);
this.onLoadStartKey = null;
}
@@ -501,7 +501,7 @@ export default class ConflictsTab extends TabsBase {
dataExplorerArea: Constants.Areas.Tab,
tabTitle: this.tabTitle(),
},
this.onLoadStartKey
this.onLoadStartKey,
);
this.onLoadStartKey = null;
}
@@ -520,11 +520,11 @@ export default class ConflictsTab extends TabsBase {
error: getErrorMessage(error),
errorStack: getErrorStack(error),
},
this.onLoadStartKey
this.onLoadStartKey,
);
this.onLoadStartKey = null;
}
}
},
)
.finally(() => this.isExecuting(false));
}
@@ -564,7 +564,7 @@ export default class ConflictsTab extends TabsBase {
public initDocumentEditorForReplace(
documentId: ConflictId,
conflictContent: any,
currentContent: any
currentContent: any,
): Q.Promise<any> {
if (documentId) {
currentContent = ConflictsTab.removeSystemProperties(currentContent);
@@ -654,7 +654,7 @@ export default class ConflictsTab extends TabsBase {
this.discardButton.enabled,
this.deleteButton.visible,
this.deleteButton.enabled,
])
]),
).subscribe(() => this.updateNavbarWithTabsButtons());
this.updateNavbarWithTabsButtons();
}

View File

@@ -31,7 +31,7 @@ export const ConnectTab: React.FC = (): JSX.Element => {
const listKeysResult: DatabaseAccountListKeysResult = await listKeys(
userContext.subscriptionId,
userContext.resourceGroup,
userContext.databaseAccount.name
userContext.databaseAccount.name,
);
setPrimaryMasterKey(listKeysResult.primaryMasterKey);
setSecondaryMasterKey(listKeysResult.secondaryMasterKey);
@@ -41,7 +41,7 @@ export const ConnectTab: React.FC = (): JSX.Element => {
const listReadonlyKeysResult: DatabaseAccountListReadOnlyKeysResult = await listReadOnlyKeys(
userContext.subscriptionId,
userContext.resourceGroup,
userContext.databaseAccount.name
userContext.databaseAccount.name,
);
setPrimaryReadonlyMasterKey(listReadonlyKeysResult.primaryReadonlyMasterKey);
setSecondaryReadonlyMasterKey(listReadonlyKeysResult.secondaryReadonlyMasterKey);

View File

@@ -88,7 +88,7 @@ export default class DocumentsTab extends TabsBase {
this.documentContentsGridId = `documentContentsGrid${this.tabId}`;
this.documentContentsContainerId = `documentContentsContainer${this.tabId}`;
this.editorState = ko.observable<ViewModels.DocumentExplorerState>(
ViewModels.DocumentExplorerState.noDocumentSelected
ViewModels.DocumentExplorerState.noDocumentSelected,
);
this.selectedDocumentId = ko.observable<DocumentId>();
this.selectedDocumentContent = editable.observable<string>("");
@@ -99,7 +99,7 @@ export default class DocumentsTab extends TabsBase {
this.partitionKeyPropertyHeaders = this.collection?.partitionKeyPropertyHeaders || this.partitionKey?.paths;
this.partitionKeyProperties = this.partitionKeyPropertyHeaders?.map((partitionKeyPropertyHeader) =>
partitionKeyPropertyHeader.replace(/[/]+/g, ".").substring(1).replace(/[']+/g, "")
partitionKeyPropertyHeader.replace(/[/]+/g, ".").substring(1).replace(/[']+/g, ""),
);
this.isFilterExpanded = ko.observable<boolean>(false);
@@ -134,20 +134,20 @@ export default class DocumentsTab extends TabsBase {
this.accessibleDocumentList = new AccessibleVerticalList(this.documentIds());
this.accessibleDocumentList.setOnSelect(
(selectedDocument: DocumentId) => selectedDocument && selectedDocument.click()
(selectedDocument: DocumentId) => selectedDocument && selectedDocument.click(),
);
this.selectedDocumentId.subscribe((newSelectedDocumentId: DocumentId) =>
this.accessibleDocumentList.updateCurrentItem(newSelectedDocumentId)
this.accessibleDocumentList.updateCurrentItem(newSelectedDocumentId),
);
this.documentIds.subscribe((newDocuments: DocumentId[]) => {
this.accessibleDocumentList.updateItemList(newDocuments);
if (newDocuments.length > 0) {
this.dataContentsGridScrollHeight(
newDocuments.length * DocumentsGridMetrics.IndividualRowHeight + DocumentsGridMetrics.BufferHeight + "px"
newDocuments.length * DocumentsGridMetrics.IndividualRowHeight + DocumentsGridMetrics.BufferHeight + "px",
);
} else {
this.dataContentsGridScrollHeight(
DocumentsGridMetrics.IndividualRowHeight + DocumentsGridMetrics.BufferHeight + "px"
DocumentsGridMetrics.IndividualRowHeight + DocumentsGridMetrics.BufferHeight + "px",
);
}
});
@@ -421,7 +421,7 @@ export default class DocumentsTab extends TabsBase {
"OK",
() => this.initializeNewDocument(),
"Cancel",
undefined
undefined,
);
} else {
this.initializeNewDocument();
@@ -452,7 +452,7 @@ export default class DocumentsTab extends TabsBase {
this.initialDocumentContent(value);
const partitionKeyValueArray = extractPartitionKey(
savedDocument,
this.partitionKey as PartitionKeyDefinition
this.partitionKey as PartitionKeyDefinition,
);
let id = new DocumentId(this, savedDocument, partitionKeyValueArray);
let ids = this.documentIds();
@@ -467,7 +467,7 @@ export default class DocumentsTab extends TabsBase {
dataExplorerArea: Constants.Areas.Tab,
tabTitle: this.tabTitle(),
},
startKey
startKey,
);
},
(error) => {
@@ -482,9 +482,9 @@ export default class DocumentsTab extends TabsBase {
error: errorMessage,
errorStack: getErrorStack(error),
},
startKey
startKey,
);
}
},
)
.finally(() => this.isExecuting(false));
};
@@ -528,7 +528,7 @@ export default class DocumentsTab extends TabsBase {
dataExplorerArea: Constants.Areas.Tab,
tabTitle: this.tabTitle(),
},
startKey
startKey,
);
},
(error) => {
@@ -543,9 +543,9 @@ export default class DocumentsTab extends TabsBase {
error: errorMessage,
errorStack: getErrorStack(error),
},
startKey
startKey,
);
}
},
)
.finally(() => this.isExecuting(false));
};
@@ -572,7 +572,7 @@ export default class DocumentsTab extends TabsBase {
"Delete",
async () => await this._deleteDocument(selectedDocumentId),
"Cancel",
undefined
undefined,
);
};
@@ -634,7 +634,7 @@ export default class DocumentsTab extends TabsBase {
error: getErrorMessage(error),
errorStack: getErrorStack(error),
},
this.onLoadStartKey
this.onLoadStartKey,
);
this.onLoadStartKey = null;
}
@@ -666,7 +666,7 @@ export default class DocumentsTab extends TabsBase {
dataExplorerArea: Constants.Areas.Tab,
tabTitle: this.tabTitle(),
},
startKey
startKey,
);
},
(error) => {
@@ -680,9 +680,9 @@ export default class DocumentsTab extends TabsBase {
error: getErrorMessage(error),
errorStack: getErrorStack(error),
},
startKey
startKey,
);
}
},
)
.finally(() => this.isExecuting(false));
}
@@ -741,7 +741,7 @@ export default class DocumentsTab extends TabsBase {
dataExplorerArea: Constants.Areas.Tab,
tabTitle: this.tabTitle(),
},
this.onLoadStartKey
this.onLoadStartKey,
);
this.onLoadStartKey = null;
}
@@ -762,11 +762,11 @@ export default class DocumentsTab extends TabsBase {
error: errorMessage,
errorStack: getErrorStack(error),
},
this.onLoadStartKey
this.onLoadStartKey,
);
this.onLoadStartKey = null;
}
}
},
)
.finally(() => this.isExecuting(false));
}
@@ -923,7 +923,7 @@ export default class DocumentsTab extends TabsBase {
this.discardExisitingDocumentChangesButton.enabled,
this.deleteExisitingDocumentButton.visible,
this.deleteExisitingDocumentButton.enabled,
])
]),
).subscribe(() => this.updateNavbarWithTabsButtons());
this.updateNavbarWithTabsButtons();
}

View File

@@ -19,7 +19,10 @@ interface Props {
}
export default class GalleryTab extends TabsBase {
constructor(options: TabOptions, private props: Props) {
constructor(
options: TabOptions,
private props: Props,
) {
super(options);
}

View File

@@ -163,7 +163,7 @@ export default class GraphTab extends TabsBase {
onSubmit={(
result: ViewModels.NewVertexData,
onError: (errorMessage: string) => void,
onSuccess: () => void
onSuccess: () => void,
): void => {
this.graphAccessor.addVertex(result).then(
() => {
@@ -172,10 +172,10 @@ export default class GraphTab extends TabsBase {
},
(error: GraphExplorerError) => {
onError(error.title);
}
},
);
}}
/>
/>,
);
}
public openStyling(): void {
@@ -188,7 +188,7 @@ export default class GraphTab extends TabsBase {
this.igraphConfig = igraphConfig;
this.graphAccessor.shareIGraphConfig(igraphConfig);
}}
/>
/>,
);
}

View File

@@ -72,7 +72,7 @@ export default class MongoDocumentsTab extends DocumentsTab {
tabTitle: this.tabTitle(),
error: message,
},
startKey
startKey,
);
Logger.logError("Failed to save new document: Document shard key not defined", "MongoDocumentsTab");
throw new Error("Document without shard key");
@@ -84,13 +84,13 @@ export default class MongoDocumentsTab extends DocumentsTab {
this.collection.databaseId,
this.collection,
this.partitionKeyProperties?.[0],
documentContent
documentContent,
)
.then(
(savedDocument: any) => {
let partitionKeyArray = extractPartitionKey(
savedDocument,
this._getPartitionKeyDefinition() as PartitionKeyDefinition
this._getPartitionKeyDefinition() as PartitionKeyDefinition,
);
let id = new ObjectId(this, savedDocument, partitionKeyArray);
@@ -110,7 +110,7 @@ export default class MongoDocumentsTab extends DocumentsTab {
dataExplorerArea: Constants.Areas.Tab,
tabTitle: this.tabTitle(),
},
startKey
startKey,
);
},
(error) => {
@@ -125,9 +125,9 @@ export default class MongoDocumentsTab extends DocumentsTab {
error: errorMessage,
errorStack: getErrorStack(error),
},
startKey
startKey,
);
}
},
)
.finally(() => this.isExecuting(false));
};
@@ -152,7 +152,7 @@ export default class MongoDocumentsTab extends DocumentsTab {
if (documentId.rid === updatedDocument._rid) {
const partitionKeyArray = extractPartitionKey(
updatedDocument,
this._getPartitionKeyDefinition() as PartitionKeyDefinition
this._getPartitionKeyDefinition() as PartitionKeyDefinition,
);
const id = new ObjectId(this, updatedDocument, partitionKeyArray);
@@ -166,7 +166,7 @@ export default class MongoDocumentsTab extends DocumentsTab {
dataExplorerArea: Constants.Areas.Tab,
tabTitle: this.tabTitle(),
},
startKey
startKey,
);
},
(error) => {
@@ -181,9 +181,9 @@ export default class MongoDocumentsTab extends DocumentsTab {
error: errorMessage,
errorStack: getErrorStack(error),
},
startKey
startKey,
);
}
},
)
.finally(() => this.isExecuting(false));
};
@@ -240,7 +240,7 @@ export default class MongoDocumentsTab extends DocumentsTab {
dataExplorerArea: Constants.Areas.Tab,
tabTitle: this.tabTitle(),
},
this.onLoadStartKey
this.onLoadStartKey,
);
this.onLoadStartKey = null;
}
@@ -258,11 +258,11 @@ export default class MongoDocumentsTab extends DocumentsTab {
error: getErrorMessage(error),
errorStack: getErrorStack(error),
},
this.onLoadStartKey
this.onLoadStartKey,
);
this.onLoadStartKey = null;
}
}
},
)
.finally(() => this.isExecuting(false));
}

View File

@@ -15,7 +15,10 @@ export class NewMongoQueryTab extends NewQueryTab {
public iMongoQueryTabComponentProps: IQueryTabComponentProps;
public queryText: string;
constructor(options: ViewModels.QueryTabOptions, private mongoQueryTabProps: IMongoQueryTabProps) {
constructor(
options: ViewModels.QueryTabOptions,
private mongoQueryTabProps: IMongoQueryTabProps,
) {
super(options, mongoQueryTabProps);
this.queryText = "";
this.iMongoQueryTabComponentProps = {

View File

@@ -17,7 +17,10 @@ export class NewMongoShellTab extends TabsBase {
public iMongoShellTabComponentProps: IMongoShellTabComponentProps;
public iMongoShellTabAccessor: IMongoShellTabAccessor;
constructor(options: TabOptions, private props: IMongoShellTabProps) {
constructor(
options: TabOptions,
private props: IMongoShellTabProps,
) {
super(options);
this.iMongoShellTabComponentProps = {
collection: this.collection,

View File

@@ -79,7 +79,7 @@ export default class MongoShellTabComponent extends Component<
}
const shellIframe: HTMLIFrameElement = document.getElementById(
this.props.tabsBaseInstance.tabId
this.props.tabsBaseInstance.tabId,
) as HTMLIFrameElement;
if (!shellIframe) {
@@ -115,7 +115,7 @@ export default class MongoShellTabComponent extends Component<
documentEndpoint.substr(
Constants.MongoDBAccounts.protocol.length + 3,
documentEndpoint.length -
(Constants.MongoDBAccounts.protocol.length + 2 + Constants.MongoDBAccounts.defaultPort.length)
(Constants.MongoDBAccounts.protocol.length + 2 + Constants.MongoDBAccounts.defaultPort.length),
) + Constants.MongoDBAccounts.defaultPort.toString();
const databaseId = this.props.collection.databaseId;
const collectionId = this.props.collection.id();
@@ -137,7 +137,7 @@ export default class MongoShellTabComponent extends Component<
apiEndpoint: apiEndpoint,
},
},
targetOrigin
targetOrigin,
);
}

View File

@@ -15,7 +15,7 @@ describe("getMongoShellOrigin", () => {
"feature.enableLegacyMongoShellV1Debug": "false",
"feature.enableLegacyMongoShellV2Debug": "false",
"feature.loadLegacyMongoShellFromBE": "false",
})
}),
),
});
});
@@ -29,7 +29,7 @@ describe("getMongoShellOrigin", () => {
features: extractFeatures(
new URLSearchParams({
"feature.enableLegacyMongoShellV1": "true",
})
}),
),
});
@@ -41,7 +41,7 @@ describe("getMongoShellOrigin", () => {
features: extractFeatures(
new URLSearchParams({
"feature.enableLegacyMongoShellV2": "true",
})
}),
),
});
@@ -53,7 +53,7 @@ describe("getMongoShellOrigin", () => {
features: extractFeatures(
new URLSearchParams({
"feature.enableLegacyMongoShellV1Debug": "true",
})
}),
),
});
@@ -65,7 +65,7 @@ describe("getMongoShellOrigin", () => {
features: extractFeatures(
new URLSearchParams({
"feature.enableLegacyMongoShellV2Debug": "true",
})
}),
),
});
@@ -77,7 +77,7 @@ describe("getMongoShellOrigin", () => {
features: extractFeatures(
new URLSearchParams({
"feature.loadLegacyMongoShellFromBE": "true",
})
}),
),
});

View File

@@ -39,7 +39,7 @@ describe("getMongoShellUrl", () => {
"feature.enableLegacyMongoShellV1Debug": "false",
"feature.enableLegacyMongoShellV2Debug": "false",
"feature.loadLegacyMongoShellFromBE": "false",
})
}),
),
portalEnv: "prod",
});
@@ -64,7 +64,7 @@ describe("getMongoShellUrl", () => {
features: extractFeatures(
new URLSearchParams({
"feature.enableLegacyMongoShellV1": "true",
})
}),
),
});
@@ -76,7 +76,7 @@ describe("getMongoShellUrl", () => {
features: extractFeatures(
new URLSearchParams({
"feature.enableLegacyMongoShellV2": "true",
})
}),
),
});
@@ -88,7 +88,7 @@ describe("getMongoShellUrl", () => {
features: extractFeatures(
new URLSearchParams({
"feature.enableLegacyMongoShellV1Debug": "true",
})
}),
),
});
@@ -100,7 +100,7 @@ describe("getMongoShellUrl", () => {
features: extractFeatures(
new URLSearchParams({
"feature.enableLegacyMongoShellV2Debug": "true",
})
}),
),
});
@@ -119,7 +119,7 @@ describe("getMongoShellUrl", () => {
features: extractFeatures(
new URLSearchParams({
"feature.loadLegacyMongoShellFromBE": "true",
})
}),
),
});
});

View File

@@ -35,7 +35,7 @@ export default class NotebookTabBase extends TabsBase {
NotebookTabBase.clientManager = undefined;
}
},
(state) => state.notebookServerInfo
(state) => state.notebookServerInfo,
);
if (!NotebookTabBase.clientManager) {
NotebookTabBase.clientManager = new NotebookClientV2({

View File

@@ -45,7 +45,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
this.notebookPath = ko.observable(options.notebookContentItem.path);
useNotebook.subscribe(
() => logConsoleInfo("New notebook server info received."),
(state) => state.notebookServerInfo
(state) => state.notebookServerInfo,
);
this.notebookComponentAdapter = new NotebookComponentAdapter({
contentItem: options.notebookContentItem,
@@ -72,7 +72,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
"Close",
cleanup,
"Cancel",
undefined
undefined,
);
return Q.resolve(null);
} else {
@@ -184,7 +184,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
hasPopup: false,
disabled: false,
ariaLabel: kernel.displayName,
} as CommandButtonComponentProps)
}) as CommandButtonComponentProps,
),
ariaLabel: kernelLabel,
},
@@ -379,7 +379,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
this.notebookPath(),
notebookConnectionInfo,
kernelName,
sparkClusterConnectionInfo
sparkClusterConnectionInfo,
);
}
@@ -413,7 +413,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
notebookContent.content,
notebookContentRef,
(request: SnapshotRequest) => notebookReduxStore.dispatch(CdbActions.takeNotebookSnapshot(request)),
onPanelClose
onPanelClose,
);
};

View File

@@ -142,7 +142,7 @@ export const QueryResultSection: React.FC<QueryResultProps> = ({
// for IE and Edge
navigator.msSaveBlob(
new Blob([csvData], { type: "data:text/csv;charset=utf-8" }),
"PerPartitionQueryMetrics.csv"
"PerPartitionQueryMetrics.csv",
);
} else {
const downloadLink: HTMLAnchorElement = document.createElement("a");
@@ -329,7 +329,7 @@ export const QueryResultSection: React.FC<QueryResultProps> = ({
metric: "Document write time",
value: `${aggregatedQueryMetrics.documentWriteTime.toString() || 0} ms`,
toolTip: "Time spent to write query result set to response buffer",
}
},
);
}

View File

@@ -18,7 +18,10 @@ export class NewQueryTab extends TabsBase {
public iQueryTabComponentProps: IQueryTabComponentProps;
public iTabAccessor: ITabAccessor;
constructor(options: QueryTabOptions, private props: IQueryTabProps) {
constructor(
options: QueryTabOptions,
private props: IQueryTabProps,
) {
super(options);
this.partitionKey = options.partitionKey;
this.iQueryTabComponentProps = {

View File

@@ -14,7 +14,7 @@ describe("QueryTabComponent", () => {
beforeEach(() => jest.clearAllMocks());
it("should launch Copilot when ALT+C is pressed", () => {
const propsMock: Readonly<IQueryTabComponentProps> = ({
const propsMock: Readonly<IQueryTabComponentProps> = {
collection: { databaseId: "CopilotSampleDb" },
onTabAccessor: () => jest.fn(),
isExecutionError: false,
@@ -22,7 +22,7 @@ describe("QueryTabComponent", () => {
tabsBaseInstance: {
updateNavbarWithTabsButtons: () => jest.fn(),
},
} as unknown) as IQueryTabComponentProps;
} as unknown as IQueryTabComponentProps;
const { container } = render(<QueryTabComponent {...propsMock} />);

View File

@@ -219,13 +219,13 @@ export default class QueryTabComponent extends React.Component<IQueryTabComponen
? queryIterator(
this.props.collection.databaseId,
this.props.viewModelcollection,
this.state.selectedContent || this.state.sqlQueryEditorContent
this.state.selectedContent || this.state.sqlQueryEditorContent,
)
: queryDocuments(
this.props.collection.databaseId,
this.props.collection.id(),
this.state.selectedContent || this.state.sqlQueryEditorContent,
{ enableCrossPartitionQuery: HeadersUtility.shouldEnableCrossPartitionKey() } as FeedOptions
{ enableCrossPartitionQuery: HeadersUtility.shouldEnableCrossPartitionKey() } as FeedOptions,
);
}
@@ -248,7 +248,7 @@ export default class QueryTabComponent extends React.Component<IQueryTabComponen
try {
const queryResults: ViewModels.QueryResults = await QueryUtils.queryPagesUntilContentPresent(
firstItemIndex,
queryDocuments
queryDocuments,
);
this.setState({ queryResults, error: "" });
} catch (error) {

View File

@@ -108,7 +108,7 @@ export default class QueryTablesTab extends TabsBase {
enabled: ko.computed<boolean>(() => {
return this.tableCommands.isEnabled(
TableCommands.editEntityCommand,
this.tableEntityListViewModel().selected()
this.tableEntityListViewModel().selected(),
);
}),
@@ -121,7 +121,7 @@ export default class QueryTablesTab extends TabsBase {
enabled: ko.computed<boolean>(() => {
return this.tableCommands.isEnabled(
TableCommands.deleteEntitiesCommand,
this.tableEntityListViewModel().selected()
this.tableEntityListViewModel().selected(),
);
}),
@@ -144,7 +144,7 @@ export default class QueryTablesTab extends TabsBase {
tableEntityListViewModel={this.tableEntityListViewModel()}
cassandraApiClient={new CassandraAPIDataClient()}
/>,
"700px"
"700px",
);
};
@@ -159,7 +159,7 @@ export default class QueryTablesTab extends TabsBase {
tableEntityListViewModel={this.tableEntityListViewModel()}
cassandraApiClient={new CassandraAPIDataClient()}
/>,
"700px"
"700px",
);
};
@@ -278,7 +278,7 @@ export default class QueryTablesTab extends TabsBase {
this.editEntityButton.enabled,
this.deleteEntityButton.visible,
this.deleteEntityButton.enabled,
])
]),
).subscribe(() => this.updateNavbarWithTabsButtons());
this.updateNavbarWithTabsButtons();
}

View File

@@ -30,7 +30,7 @@ export const QuickstartTab: React.FC<QuickstartTabProps> = ({ explorer }: Quicks
checkFirewallRules(
"2022-11-08",
(rule) => rule.properties.startIpAddress === "0.0.0.0" && rule.properties.endIpAddress === "255.255.255.255",
setIsAllPublicIPAddressEnabled
setIsAllPublicIPAddressEnabled,
);
});

View File

@@ -16,7 +16,7 @@ export default class SchemaAnalyzerTab extends NotebookTabBase {
notebookClient: NotebookTabBase.clientManager,
},
options.collection?.databaseId,
options.collection?.id()
options.collection?.id(),
);
}
@@ -29,7 +29,7 @@ export default class SchemaAnalyzerTab extends NotebookTabBase {
dataExplorerArea: Constants.Areas.Tab,
tabTitle: "Schema",
},
this.onLoadStartKey
this.onLoadStartKey,
);
super.onActivate();

View File

@@ -257,7 +257,7 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
this.updateButton.enabled,
this.discardButton.visible,
this.discardButton.enabled,
])
]),
).subscribe(() => this.updateNavbarWithTabsButtons());
this.updateNavbarWithTabsButtons();
}

View File

@@ -8,7 +8,7 @@ export async function checkFirewallRules(
firewallRulesPredicate: (rule: DataModels.FirewallRule) => unknown,
isAllPublicIPAddressesEnabled?: ko.Observable<boolean> | React.Dispatch<React.SetStateAction<boolean>>,
setMessageFunc?: (message: string) => void,
message?: string
message?: string,
): Promise<void> {
const firewallRulesUri = `${userContext.databaseAccount.id}/firewallRules`;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -38,7 +38,7 @@ export async function checkFirewallRules(
setTimeout(
() =>
checkFirewallRules(apiVersion, firewallRulesPredicate, isAllPublicIPAddressesEnabled, setMessageFunc, message),
30000
30000,
);
}
}

View File

@@ -26,7 +26,10 @@ export class NewStoredProcedureTab extends ScriptTabBase {
public onSaveClick: () => void;
public onUpdateClick: () => Promise<void>;
constructor(options: ViewModels.ScriptTabOption, private props: IStoredProcTabProps) {
constructor(
options: ViewModels.ScriptTabOption,
private props: IStoredProcTabProps,
) {
super(options);
this.partitionKey = options.partitionKey;

View File

@@ -73,7 +73,7 @@ export default class StoredProcedureTabComponent extends React.Component<
constructor(
public storedProcTabCompProps: IStoredProcTabComponentProps,
private storedProcTabCompStates: IStoredProcTabComponentStates
private storedProcTabCompStates: IStoredProcTabComponentStates,
) {
super(storedProcTabCompProps);
this.state = {
@@ -213,7 +213,7 @@ export default class StoredProcedureTabComponent extends React.Component<
return updateStoredProcedure(
this.props.scriptTabBaseInstance.collection.databaseId,
this.props.scriptTabBaseInstance.collection.id(),
data
data,
)
.then(
(updatedResource) => {
@@ -245,7 +245,7 @@ export default class StoredProcedureTabComponent extends React.Component<
},
() => {
this.props.scriptTabBaseInstance.isExecutionError(true);
}
},
)
.finally(() => this.props.scriptTabBaseInstance.isExecuting(false));
};
@@ -436,7 +436,7 @@ export default class StoredProcedureTabComponent extends React.Component<
this.props.scriptTabBaseInstance.isExecutionError(true);
return Promise.reject(createError);
}
},
)
.finally(() => this.props.scriptTabBaseInstance.isExecuting(false));
}

View File

@@ -33,7 +33,7 @@ class NotebookTerminalComponentAdapter implements ReactAdapter {
private getDatabaseAccount: () => DataModels.DatabaseAccount,
private getTabId: () => string,
private getUsername: () => string,
private isAllPublicIPAddressesEnabled: ko.Observable<boolean>
private isAllPublicIPAddressesEnabled: ko.Observable<boolean>,
) {}
public renderComponent(): JSX.Element {
@@ -75,7 +75,7 @@ export default class TerminalTab extends TabsBase {
() => userContext?.databaseAccount,
() => this.tabId,
() => this.getUsername(),
this.isAllPublicIPAddressesEnabled
this.isAllPublicIPAddressesEnabled,
);
this.notebookTerminalComponentAdapter.parameters = ko.computed<boolean>(() => {
if (
@@ -93,7 +93,7 @@ export default class TerminalTab extends TabsBase {
checkFirewallRules(
"2022-11-08",
(rule) => rule.properties.startIpAddress === "0.0.0.0" && rule.properties.endIpAddress === "255.255.255.255",
this.isAllPublicIPAddressesEnabled
this.isAllPublicIPAddressesEnabled,
);
}
@@ -103,7 +103,7 @@ export default class TerminalTab extends TabsBase {
(rule) =>
rule.name.startsWith("AllowAllAzureServicesAndResourcesWithinAzureIps") ||
(rule.properties.startIpAddress === "0.0.0.0" && rule.properties.endIpAddress === "255.255.255.255"),
this.isAllPublicIPAddressesEnabled
this.isAllPublicIPAddressesEnabled,
);
}
}

View File

@@ -94,7 +94,7 @@ export class TriggerTabContent extends Component<TriggerTab, ITriggerTabContentS
const createdResource: TriggerDefinition | SqlTriggerResource = await createTrigger(
this.props.collection.databaseId,
this.props.collection.id(),
resource
resource,
);
if (createdResource) {
this.props.tabTitle(createdResource.id);
@@ -111,7 +111,7 @@ export class TriggerTabContent extends Component<TriggerTab, ITriggerTabContentS
dataExplorerArea: Constants.Areas.Tab,
tabTitle: this.props.tabTitle(),
},
startKey
startKey,
);
this.props.editorState(ViewModels.ScriptEditorState.exisitingNoEdits);
this.props.isExecuting(false);
@@ -126,7 +126,7 @@ export class TriggerTabContent extends Component<TriggerTab, ITriggerTabContentS
error: getErrorMessage(createError),
errorStack: getErrorStack(createError),
},
startKey
startKey,
);
this.props.isExecuting(false);
}
@@ -161,7 +161,7 @@ export class TriggerTabContent extends Component<TriggerTab, ITriggerTabContentS
dataExplorerArea: Constants.Areas.Tab,
tabTitle: this.props.tabTitle(),
},
startKey
startKey,
);
this.props.isExecuting(false);
}
@@ -175,7 +175,7 @@ export class TriggerTabContent extends Component<TriggerTab, ITriggerTabContentS
error: getErrorMessage(createError),
errorStack: getErrorStack(createError),
},
startKey
startKey,
);
this.props.isExecuting(false);
}
@@ -268,7 +268,7 @@ export class TriggerTabContent extends Component<TriggerTab, ITriggerTabContentS
private handleTriggerIdChange = (
_event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>,
newValue?: string
newValue?: string,
): void => {
this.saveButton.enabled = this.isValidId(newValue) && this.isNotEmpty(newValue);
this.setState({ triggerId: newValue });
@@ -277,7 +277,7 @@ export class TriggerTabContent extends Component<TriggerTab, ITriggerTabContentS
private handleTriggerTypeOprationChange = (
_event: React.FormEvent<HTMLElement>,
selectedParam: IDropdownOption,
key: string
key: string,
): void => {
this.setState({ [key]: String(selectedParam.key) });
};

View File

@@ -61,7 +61,7 @@ export default class UserDefinedFunctionTabContent extends Component<
private handleUdfIdChange = (
_event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>,
newValue?: string
newValue?: string,
): void => {
this.saveButton.enabled = this.isValidId(newValue) && this.isNotEmpty(newValue);
this.setState({ udfId: newValue });
@@ -137,7 +137,7 @@ export default class UserDefinedFunctionTabContent extends Component<
const createdResource = await createUserDefinedFunction(
this.props.collection.databaseId,
this.props.collection.id(),
resource
resource,
);
if (createdResource) {
this.props.tabTitle(createdResource.id);
@@ -155,7 +155,7 @@ export default class UserDefinedFunctionTabContent extends Component<
tabTitle: this.props.tabTitle(),
},
startKey
startKey,
);
this.props.editorState(ViewModels.ScriptEditorState.exisitingNoEdits);
}
@@ -169,7 +169,7 @@ export default class UserDefinedFunctionTabContent extends Component<
error: getErrorMessage(createError),
errorStack: getErrorStack(createError),
},
startKey
startKey,
);
this.props.isExecuting(false);
return Promise.reject(createError);
@@ -193,7 +193,7 @@ export default class UserDefinedFunctionTabContent extends Component<
const createdResource = await updateUserDefinedFunction(
this.props.collection.databaseId,
this.props.collection.id(),
resource
resource,
);
this.props.resource(createdResource);
@@ -206,7 +206,7 @@ export default class UserDefinedFunctionTabContent extends Component<
dataExplorerArea: Constants.Areas.Tab,
tabTitle: this.props.tabTitle(),
},
startKey
startKey,
);
this.props.editorContent.setBaseline(createdResource.body as string);
@@ -220,7 +220,7 @@ export default class UserDefinedFunctionTabContent extends Component<
error: getErrorMessage(createError),
errorStack: getErrorStack(createError),
},
startKey
startKey,
);
this.props.isExecuting(false);
}

View File

@@ -34,7 +34,7 @@ export const VcoreMongoQuickstartTab: React.FC<VCoreMongoQuickstartTabProps> = (
(rule) =>
rule.name.startsWith("AllowAllAzureServicesAndResourcesWithinAzureIps") ||
(rule.properties.startIpAddress === "0.0.0.0" && rule.properties.endIpAddress === "255.255.255.255"),
setIsAllPublicIPAddressEnabled
setIsAllPublicIPAddressEnabled,
);
});

View File

@@ -53,7 +53,7 @@ describe("useTabs tests", () => {
},
{
container: container,
}
},
);
documentsTab = new DocumentsTab({