mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-22 10:21:37 +00:00
Make Data Explorer work on node v18 (#1654)
* Upgrade packages to enable npm i with node 18 * Fix crypto and querystring issue * Fix webpack errors during npm start * Upgrade monaco editor. Fix alias in webconfig * Remove deprecated file-loader. Upgrade webpack to latest. * Fix format * Upgrade webpack, eslint and typescript * Update p-retry and fluentui packages * Revert monaco package upgrade * Fix notebook compile errors * Fix lint errors * Update jest snapshots * Fix unit tests * Update node version to 18 * Fix compile error * Fix compile error * Fix format * Turn off warning overlay for webpack devServer * Fix format * Re-add monaco webpack plugin and upgrade monaco-editor * Update package-lock.json * Fix build issue * Move MonacoWebpackPlugin to previous place in webpack.config.js * update package-lock.json * Fix package-lock.json * Update package-lock.json * Fix export ChoiceItem not found warning for self serve. Remove warning turn off in webpack config. * Update checkout and setup actions in for ci tests * Disable Gallery callout * Fix disable gallery header * Totally disable New gallery callout * Upgrade all github actions to latest
This commit is contained in:
@@ -57,7 +57,7 @@ describe("Pinned repos", () => {
|
||||
const response = await junoClient.updatePinnedRepos(samplePinnedRepos);
|
||||
|
||||
expect(response.status).toBe(HttpStatusCodes.OK);
|
||||
expect(callback).toBeCalledWith(samplePinnedRepos);
|
||||
expect(callback).toHaveBeenCalledWith(samplePinnedRepos);
|
||||
});
|
||||
|
||||
it("getPinnedRepos invokes pinned repos subscribers", async () => {
|
||||
@@ -68,7 +68,7 @@ describe("Pinned repos", () => {
|
||||
const response = await junoClient.getPinnedRepos("scope");
|
||||
|
||||
expect(response.status).toBe(HttpStatusCodes.OK);
|
||||
expect(callback).toBeCalledWith(samplePinnedRepos);
|
||||
expect(callback).toHaveBeenCalledWith(samplePinnedRepos);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -94,7 +94,7 @@ describe("GitHub", () => {
|
||||
|
||||
expect(response.status).toBe(HttpStatusCodes.OK);
|
||||
expect(response.data.access_token).toBeDefined();
|
||||
expect(window.fetch).toBeCalled();
|
||||
expect(window.fetch).toHaveBeenCalled();
|
||||
|
||||
const fetchUrlParams = new URLSearchParams(new URL(fetchUrl).search);
|
||||
let fetchUrlParamsCount = 0;
|
||||
@@ -119,7 +119,7 @@ describe("GitHub", () => {
|
||||
const response = await junoClient.deleteAppAuthorization("token");
|
||||
|
||||
expect(response.status).toBe(HttpStatusCodes.NoContent);
|
||||
expect(window.fetch).toBeCalled();
|
||||
expect(window.fetch).toHaveBeenCalled();
|
||||
|
||||
const fetchUrlParams = new URLSearchParams(new URL(fetchUrl).search);
|
||||
let fetchUrlParamsCount = 0;
|
||||
@@ -161,7 +161,10 @@ describe("Gallery", () => {
|
||||
const response = await junoClient.getSampleNotebooks();
|
||||
|
||||
expect(response.status).toBe(HttpStatusCodes.OK);
|
||||
expect(window.fetch).toBeCalledWith(`${JunoClient.getJunoEndpoint()}/api/notebooks/gallery/samples`, undefined);
|
||||
expect(window.fetch).toHaveBeenCalledWith(
|
||||
`${JunoClient.getJunoEndpoint()}/api/notebooks/gallery/samples`,
|
||||
undefined,
|
||||
);
|
||||
});
|
||||
|
||||
it("getPublicNotebooks", async () => {
|
||||
@@ -173,7 +176,10 @@ describe("Gallery", () => {
|
||||
const response = await junoClient.getPublicNotebooks();
|
||||
|
||||
expect(response.status).toBe(HttpStatusCodes.OK);
|
||||
expect(window.fetch).toBeCalledWith(`${JunoClient.getJunoEndpoint()}/api/notebooks/gallery/public`, undefined);
|
||||
expect(window.fetch).toHaveBeenCalledWith(
|
||||
`${JunoClient.getJunoEndpoint()}/api/notebooks/gallery/public`,
|
||||
undefined,
|
||||
);
|
||||
});
|
||||
|
||||
it("getNotebook", async () => {
|
||||
@@ -186,7 +192,7 @@ describe("Gallery", () => {
|
||||
const response = await junoClient.getNotebookInfo(id);
|
||||
|
||||
expect(response.status).toBe(HttpStatusCodes.OK);
|
||||
expect(window.fetch).toBeCalledWith(`${JunoClient.getJunoEndpoint()}/api/notebooks/gallery/${id}`);
|
||||
expect(window.fetch).toHaveBeenCalledWith(`${JunoClient.getJunoEndpoint()}/api/notebooks/gallery/${id}`);
|
||||
});
|
||||
|
||||
it("getNotebookContent", async () => {
|
||||
@@ -199,7 +205,7 @@ describe("Gallery", () => {
|
||||
const response = await junoClient.getNotebookContent(id);
|
||||
|
||||
expect(response.status).toBe(HttpStatusCodes.OK);
|
||||
expect(window.fetch).toBeCalledWith(`${JunoClient.getJunoEndpoint()}/api/notebooks/gallery/${id}/content`);
|
||||
expect(window.fetch).toHaveBeenCalledWith(`${JunoClient.getJunoEndpoint()}/api/notebooks/gallery/${id}/content`);
|
||||
});
|
||||
|
||||
it("increaseNotebookViews", async () => {
|
||||
@@ -211,7 +217,7 @@ describe("Gallery", () => {
|
||||
const response = await junoClient.increaseNotebookViews(id);
|
||||
|
||||
expect(response.status).toBe(HttpStatusCodes.OK);
|
||||
expect(window.fetch).toBeCalledWith(`${JunoClient.getJunoEndpoint()}/api/notebooks/gallery/${id}/views`, {
|
||||
expect(window.fetch).toHaveBeenCalledWith(`${JunoClient.getJunoEndpoint()}/api/notebooks/gallery/${id}/views`, {
|
||||
method: "PATCH",
|
||||
});
|
||||
});
|
||||
@@ -227,7 +233,7 @@ describe("Gallery", () => {
|
||||
|
||||
const authorizationHeader = getAuthorizationHeader();
|
||||
expect(response.status).toBe(HttpStatusCodes.OK);
|
||||
expect(window.fetch).toBeCalledWith(
|
||||
expect(window.fetch).toHaveBeenCalledWith(
|
||||
`${JunoClient.getJunoEndpoint()}/api/notebooks/subscriptions/${sampleSubscriptionId}/databaseAccounts/${
|
||||
sampleDatabaseAccount.name
|
||||
}/gallery/${id}/downloads`,
|
||||
@@ -252,7 +258,7 @@ describe("Gallery", () => {
|
||||
|
||||
const authorizationHeader = getAuthorizationHeader();
|
||||
expect(response.status).toBe(HttpStatusCodes.OK);
|
||||
expect(window.fetch).toBeCalledWith(
|
||||
expect(window.fetch).toHaveBeenCalledWith(
|
||||
`${JunoClient.getJunoEndpoint()}/api/notebooks/subscriptions/${sampleSubscriptionId}/databaseAccounts/${
|
||||
sampleDatabaseAccount.name
|
||||
}/gallery/${id}/favorite`,
|
||||
@@ -277,7 +283,7 @@ describe("Gallery", () => {
|
||||
|
||||
const authorizationHeader = getAuthorizationHeader();
|
||||
expect(response.status).toBe(HttpStatusCodes.OK);
|
||||
expect(window.fetch).toBeCalledWith(
|
||||
expect(window.fetch).toHaveBeenCalledWith(
|
||||
`${JunoClient.getJunoEndpoint()}/api/notebooks/subscriptions/${sampleSubscriptionId}/databaseAccounts/${
|
||||
sampleDatabaseAccount.name
|
||||
}/gallery/${id}/unfavorite`,
|
||||
@@ -301,7 +307,7 @@ describe("Gallery", () => {
|
||||
|
||||
const authorizationHeader = getAuthorizationHeader();
|
||||
expect(response.status).toBe(HttpStatusCodes.OK);
|
||||
expect(window.fetch).toBeCalledWith(
|
||||
expect(window.fetch).toHaveBeenCalledWith(
|
||||
`${JunoClient.getJunoEndpoint()}/api/notebooks/subscriptions/${sampleSubscriptionId}/databaseAccounts/${
|
||||
sampleDatabaseAccount.name
|
||||
}/gallery/favorites`,
|
||||
@@ -324,7 +330,7 @@ describe("Gallery", () => {
|
||||
|
||||
const authorizationHeader = getAuthorizationHeader();
|
||||
expect(response.status).toBe(HttpStatusCodes.OK);
|
||||
expect(window.fetch).toBeCalledWith(
|
||||
expect(window.fetch).toHaveBeenCalledWith(
|
||||
`${JunoClient.getJunoEndpoint()}/api/notebooks/subscriptions/${sampleSubscriptionId}/databaseAccounts/${
|
||||
sampleDatabaseAccount.name
|
||||
}/gallery/published`,
|
||||
@@ -348,7 +354,7 @@ describe("Gallery", () => {
|
||||
|
||||
const authorizationHeader = getAuthorizationHeader();
|
||||
expect(response.status).toBe(HttpStatusCodes.OK);
|
||||
expect(window.fetch).toBeCalledWith(
|
||||
expect(window.fetch).toHaveBeenCalledWith(
|
||||
`${JunoClient.getJunoEndpoint()}/api/notebooks/subscriptions/${sampleSubscriptionId}/databaseAccounts/${
|
||||
sampleDatabaseAccount.name
|
||||
}/gallery/${id}`,
|
||||
@@ -378,7 +384,7 @@ describe("Gallery", () => {
|
||||
|
||||
const authorizationHeader = getAuthorizationHeader();
|
||||
expect(response.status).toBe(HttpStatusCodes.OK);
|
||||
expect(window.fetch).toBeCalledWith(
|
||||
expect(window.fetch).toHaveBeenCalledWith(
|
||||
`${JunoClient.getJunoEndpoint()}/api/notebooks/subscriptions/${sampleSubscriptionId}/databaseAccounts/${
|
||||
sampleDatabaseAccount.name
|
||||
}/gallery`,
|
||||
|
||||
Reference in New Issue
Block a user