Skip to content

Commit e9d3712

Browse files
committed
design: adjust sidebar styling for Community and SME (#17629)
1 parent f27b8d6 commit e9d3712

File tree

21 files changed

+210
-114
lines changed

21 files changed

+210
-114
lines changed

airbyte-webapp/cypress/e2e/connection/configuration.cy.ts

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
requestDeleteSource,
66
requestUpdateConnection,
77
} from "@cy/commands/api";
8+
import { getWorkspaceId } from "@cy/commands/api/workspace";
89
import { deleteEntity, submitButtonClick } from "@cy/commands/common";
910
import {
1011
createNewConnectionViaApi,
@@ -359,7 +360,11 @@ describe("Connection Configuration", { tags: "@connection-configuration" }, () =
359360
.as("pokeConnection");
360361

361362
cy.get<WebBackendConnectionRead>("@pokeConnection").then((connection) => {
362-
cy.visit(`/${RoutePaths.Connections}/${connection.connectionId}/${ConnectionRoutePaths.Settings}`);
363+
cy.visit(
364+
`/workspaces/${getWorkspaceId()}/${RoutePaths.Connections}/${connection.connectionId}/${
365+
ConnectionRoutePaths.Settings
366+
}`
367+
);
363368
});
364369

365370
connectionForm.toggleAdvancedSettingsSection();
@@ -405,21 +410,29 @@ describe("Connection Configuration", { tags: "@connection-configuration" }, () =
405410
});
406411

407412
it("should not be listed on connection list page", () => {
408-
cy.visit(`/${RoutePaths.Connections}`);
413+
cy.visit(`/workspaces/${getWorkspaceId()}/${RoutePaths.Connections}`);
409414
cy.get<WebBackendConnectionRead>("@connection").then((connection) => {
410415
cy.get("td").contains(connection.name).should("not.exist");
411416
});
412417
});
413418
describe("Job History tab", () => {
414419
it("can visit the connection", () => {
415420
cy.get<WebBackendConnectionRead>("@connection").then((connection) => {
416-
cy.visit(`/${RoutePaths.Connections}/${connection.connectionId}/${ConnectionRoutePaths.JobHistory}/`);
421+
cy.visit(
422+
`/workspaces/${getWorkspaceId()}/${RoutePaths.Connections}/${connection.connectionId}/${
423+
ConnectionRoutePaths.JobHistory
424+
}/`
425+
);
417426
cy.get("div").contains("This connection has been deleted").should("exist");
418427
});
419428
});
420429
it("cannot toggle enabled/disabled state or trigger a sync", () => {
421430
cy.get<WebBackendConnectionRead>("@connection").then((connection) => {
422-
cy.visit(`/${RoutePaths.Connections}/${connection.connectionId}/${ConnectionRoutePaths.JobHistory}/`);
431+
cy.visit(
432+
`/workspaces/${getWorkspaceId()}/${RoutePaths.Connections}/${connection.connectionId}/${
433+
ConnectionRoutePaths.JobHistory
434+
}/`
435+
);
423436
getSyncEnabledSwitch().should("be.disabled");
424437
cy.contains(/Sync now/).should("be.disabled");
425438
});
@@ -429,7 +442,11 @@ describe("Connection Configuration", { tags: "@connection-configuration" }, () =
429442
describe("Settings tab", () => {
430443
it("Cannot edit non-name fields", () => {
431444
cy.get<WebBackendConnectionRead>("@connection").then((connection) => {
432-
cy.visit(`/${RoutePaths.Connections}/${connection.connectionId}/${ConnectionRoutePaths.Settings}`);
445+
cy.visit(
446+
`/workspaces/${getWorkspaceId()}/${RoutePaths.Connections}/${connection.connectionId}/${
447+
ConnectionRoutePaths.Settings
448+
}`
449+
);
433450
connectionForm.toggleAdvancedSettingsSection();
434451
cy.get(getTestId("connectionName")).should("be.disabled");
435452
cy.get(connectionForm.scheduleTypeDropdown).should("be.disabled");
@@ -441,7 +458,11 @@ describe("Connection Configuration", { tags: "@connection-configuration" }, () =
441458

442459
it("cannot reset data or delete connection", () => {
443460
cy.get<WebBackendConnectionRead>("@connection").then((connection) => {
444-
cy.visit(`/${RoutePaths.Connections}/${connection.connectionId}/${ConnectionRoutePaths.Settings}/`);
461+
cy.visit(
462+
`/workspaces/${getWorkspaceId()}/${RoutePaths.Connections}/${connection.connectionId}/${
463+
ConnectionRoutePaths.Settings
464+
}/`
465+
);
445466
cy.get(connectionSettings.resetDataButton).should("not.exist");
446467
cy.get(connectionSettings.deleteConnectionButton).should("not.exist");
447468
});
@@ -464,25 +485,33 @@ describe("Connection Configuration", { tags: "@connection-configuration" }, () =
464485

465486
it("should show empty streams table", () => {
466487
cy.get<WebBackendConnectionRead>("@postgresConnection").then((connection) => {
467-
cy.visit(`/${RoutePaths.Connections}/${connection.connectionId}/`);
488+
cy.visit(`/workspaces/${getWorkspaceId()}/${RoutePaths.Connections}/${connection.connectionId}/`);
468489
cy.contains("users").should("exist");
469490
});
470491
});
471492

472493
it("should not be allowed to trigger a reset or a sync", () => {
473494
cy.get<WebBackendConnectionRead>("@postgresConnection").then((connection) => {
474-
cy.visit(`/${RoutePaths.Connections}/${connection.connectionId}/`);
495+
cy.visit(`/workspaces/${getWorkspaceId()}/${RoutePaths.Connections}/${connection.connectionId}/`);
475496
cy.get(statusPage.manualSyncButton).should("be.disabled");
476497
});
477498
});
478499

479500
it("should be able to edit the connection and refresh source schema", () => {
480501
interceptUpdateConnectionRequest();
481502
cy.get<WebBackendConnectionRead>("@postgresConnection").then((postgresConnection) => {
482-
cy.visit(`/${RoutePaths.Connections}/${postgresConnection.connectionId}/${ConnectionRoutePaths.Replication}`);
503+
cy.visit(
504+
`/workspaces/${getWorkspaceId()}/${RoutePaths.Connections}/${postgresConnection.connectionId}/${
505+
ConnectionRoutePaths.Replication
506+
}`
507+
);
483508
streamsTable.isRefreshSourceSchemaBtnEnabled(true);
484509

485-
cy.visit(`/${RoutePaths.Connections}/${postgresConnection.connectionId}/${ConnectionRoutePaths.Settings}`);
510+
cy.visit(
511+
`/workspaces/${getWorkspaceId()}/${RoutePaths.Connections}/${postgresConnection.connectionId}/${
512+
ConnectionRoutePaths.Settings
513+
}`
514+
);
486515
connectionForm.selectScheduleType("Scheduled");
487516
submitButtonClick();
488517

airbyte-webapp/cypress/e2e/connection/createConnection.cy.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ describe("Connection - Create new connection", { testIsolation: false }, () => {
9999
interceptDiscoverSchemaRequest();
100100

101101
cy.visit(
102-
`/${RoutePaths.Connections}/${ConnectionRoutePaths.ConnectionNew}/${ConnectionRoutePaths.Configure}?sourceId=${source.sourceId}&destinationId=${destination.destinationId}`
102+
`/workspaces/${getWorkspaceId()}/${RoutePaths.Connections}/${ConnectionRoutePaths.ConnectionNew}/${
103+
ConnectionRoutePaths.Configure
104+
}?sourceId=${source.sourceId}&destinationId=${destination.destinationId}`
103105
);
104106
waitForDiscoverSchemaRequest();
105107
});
@@ -164,7 +166,9 @@ describe("Connection - Create new connection", { testIsolation: false }, () => {
164166
interceptDiscoverSchemaRequest();
165167

166168
cy.visit(
167-
`/${RoutePaths.Connections}/${ConnectionRoutePaths.ConnectionNew}/${ConnectionRoutePaths.Configure}?sourceId=${source.sourceId}&destinationId=${destination.destinationId}`
169+
`/workspaces/${getWorkspaceId()}/${RoutePaths.Connections}/${ConnectionRoutePaths.ConnectionNew}/${
170+
ConnectionRoutePaths.Configure
171+
}?sourceId=${source.sourceId}&destinationId=${destination.destinationId}`
168172
);
169173
waitForDiscoverSchemaRequest();
170174
});

airbyte-webapp/cypress/e2e/connection/status.cy.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { requestDeleteConnection, requestDeleteDestination, requestDeleteSource } from "@cy/commands/api";
2+
import { getWorkspaceId } from "@cy/commands/api/workspace";
23
import {
34
createNewConnectionViaApi,
45
createPostgresDestinationViaApi,
@@ -55,14 +56,22 @@ describe("Status tab", () => {
5556

5657
it("should initialize as pending", () => {
5758
cy.get<WebBackendConnectionRead>("@connection").then((connection) => {
58-
cy.visit(`/${RoutePaths.Connections}/${connection.connectionId}/${ConnectionRoutePaths.Status}/`);
59+
cy.visit(
60+
`/workspaces/${getWorkspaceId()}/${RoutePaths.Connections}/${connection.connectionId}/${
61+
ConnectionRoutePaths.Status
62+
}/`
63+
);
5964
statusPage.connectionStatusShouldBe("pending");
6065
});
6166
});
6267

6368
it("should allow starting a sync", () => {
6469
cy.get<WebBackendConnectionRead>("@connection").then((connection) => {
65-
cy.visit(`/${RoutePaths.Connections}/${connection.connectionId}/${ConnectionRoutePaths.Status}/`);
70+
cy.visit(
71+
`/workspaces/${getWorkspaceId()}/${RoutePaths.Connections}/${connection.connectionId}/${
72+
ConnectionRoutePaths.Status
73+
}/`
74+
);
6675

6776
// sync & verify the button enters and exits its disabled state as the status updates
6877
startManualSync();
@@ -81,7 +90,11 @@ describe("Status tab", () => {
8190
// skipping for now, these controls have gone away but the logic is still a useful thing to test
8291
it.skip("should allow clearing data", () => {
8392
cy.get<WebBackendConnectionRead>("@connection").then((connection) => {
84-
cy.visit(`/${RoutePaths.Connections}/${connection.connectionId}/${ConnectionRoutePaths.Status}/`);
93+
cy.visit(
94+
`/workspaces/${getWorkspaceId()}/${RoutePaths.Connections}/${connection.connectionId}/${
95+
ConnectionRoutePaths.Status
96+
}/`
97+
);
8598

8699
// reset & verify the button enters and exits its disabled state as the status updates
87100
startManualReset();

airbyte-webapp/cypress/e2e/destination.cy.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { requestDeleteDestination } from "@cy/commands/api";
1+
import { requestDeleteDestination, requestWorkspaceId } from "@cy/commands/api";
2+
import { getWorkspaceId } from "@cy/commands/api/workspace";
23
import { createE2ETestingDestinationViaApi } from "@cy/commands/connection";
34
import { DestinationRead } from "@src/core/api/types/AirbyteClient";
45
import { createE2ETestingDestination, deleteDestination, updateDestination } from "commands/destination";
@@ -13,21 +14,23 @@ describe("Destination main actions", () => {
1314
});
1415

1516
it("Should redirect from destination list page to create destination page if no destinations are configured", () => {
16-
cy.intercept("POST", "/api/v1/destinations/list", {
17-
statusCode: 200,
18-
body: {
19-
destinations: [],
20-
},
21-
});
17+
requestWorkspaceId().then(() => {
18+
cy.intercept("POST", "/api/v1/destinations/list", {
19+
statusCode: 200,
20+
body: {
21+
destinations: [],
22+
},
23+
});
2224

23-
cy.visit("/destination");
25+
cy.visit(`/workspaces/${getWorkspaceId()}/destination`);
2426

25-
cy.url().should("match", /.*\/destination\/new-destination/);
27+
cy.url().should("match", new RegExp(`.*\\/workspaces\\/${getWorkspaceId()}\\/destination\\/new-destination`));
28+
});
2629
});
2730
it("Create new destination", () => {
2831
createE2ETestingDestination("E2E Test destination cypress");
2932

30-
cy.url().should("include", `/destination/`);
33+
cy.url().should("include", `/workspaces/${getWorkspaceId()}/destination/`);
3134
});
3235

3336
it("Update destination", () => {
@@ -68,7 +71,7 @@ describe("Destination main actions", () => {
6871
createE2ETestingDestinationViaApi().then((e2eTestingDestination) => {
6972
deleteDestination(e2eTestingDestination.name);
7073

71-
cy.visit("/destination");
74+
cy.visit(`/workspaces/${getWorkspaceId()}/destination`);
7275
cy.get("div").contains(e2eTestingDestination.name).should("not.exist");
7376
});
7477
});

airbyte-webapp/cypress/e2e/source.cy.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { requestWorkspaceId } from "@cy/commands/api";
2+
import { getWorkspaceId } from "@cy/commands/api/workspace";
13
import { createPokeApiSourceViaApi, createPostgresSourceViaApi } from "@cy/commands/connection";
24
import { submitButtonClick, updateField } from "commands/common";
35
import { fillPokeAPIForm } from "commands/connector";
@@ -9,24 +11,26 @@ import { goToSourcePage, openNewSourcePage } from "pages/sourcePage";
911

1012
describe("Source main actions", () => {
1113
it("Should redirect from source list page to create source page if no sources are configured", () => {
12-
cy.intercept("POST", "/api/v1/sources/list", {
13-
statusCode: 200,
14-
body: {
15-
sources: [],
16-
},
17-
});
14+
requestWorkspaceId().then(() => {
15+
cy.intercept("POST", "/api/v1/sources/list", {
16+
statusCode: 200,
17+
body: {
18+
sources: [],
19+
},
20+
});
1821

19-
cy.visit("/source");
22+
cy.visit(`/workspaces/${getWorkspaceId()}/source`);
2023

21-
cy.url().should("match", /.*\/source\/new-source/);
24+
cy.url().should("match", new RegExp(`.*\\/workspaces\\/${getWorkspaceId()}\\/source\\/new-source`));
25+
});
2226
});
2327

2428
it("Create new source", () => {
2529
cy.intercept("/api/v1/sources/create").as("createSource");
2630
createPostgresSource("Test source cypress");
2731

2832
cy.wait("@createSource", { timeout: 30000 }).then(({ response }) => {
29-
cy.url().should("include", `/source/${response?.body.sourceId}`);
33+
cy.url().should("include", `/workspaces/${getWorkspaceId()}/source/${response?.body.sourceId}`);
3034
});
3135
});
3236

@@ -56,7 +60,7 @@ describe("Source main actions", () => {
5660
createPostgresSourceViaApi().then((postgresSource) => {
5761
deleteSource(postgresSource.sourceName);
5862

59-
cy.visit("/source");
63+
cy.visit(`/workspaces/${getWorkspaceId()}/source`);
6064
cy.get("div").contains(postgresSource.sourceName).should("not.exist");
6165
});
6266
});
@@ -69,7 +73,7 @@ describe("Unsaved changes modal on create source page", () => {
6973

7074
openHomepage();
7175

72-
cy.url().should("include", "/connections");
76+
cy.url().should("include", `/workspaces/${getWorkspaceId()}/connections`);
7377
cy.get("[data-testid='confirmationModal']").should("not.exist");
7478
});
7579

@@ -80,7 +84,7 @@ describe("Unsaved changes modal on create source page", () => {
8084

8185
openHomepage();
8286

83-
cy.url().should("include", "/connections");
87+
cy.url().should("include", `/workspaces/${getWorkspaceId()}/connections`);
8488
cy.get("[data-testid='confirmationModal']").should("not.exist");
8589
});
8690

airbyte-webapp/cypress/pages/connection/createConnectionPageObject.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { getWorkspaceId } from "@cy/commands/api/workspace";
12
import { getTestId } from "@cy/utils/selectors";
23

34
export type ConnectorType = "source" | "destination";
@@ -24,7 +25,7 @@ export const isNextPageButtonEnabled = (expectedResult: boolean) => {
2425
};
2526

2627
export const isAtConnectionConfigurationStep = () =>
27-
cy.url().should("include", `/connections/new-connection/configure`);
28+
cy.url().should("include", `/workspaces/${getWorkspaceId()}/connections/new-connection/configure`);
2829

2930
export const isAtConnectionOverviewPage = (connectionId: string) =>
30-
cy.url().should("include", `connections/${connectionId}/status`);
31+
cy.url().should("include", `/workspaces/${getWorkspaceId()}/connections/${connectionId}/status`);

airbyte-webapp/cypress/pages/destinationPage.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { requestWorkspaceId } from "@cy/commands/api";
2+
import { getWorkspaceId } from "@cy/commands/api/workspace";
13
import { clickOnCellInTable } from "@cy/commands/common";
24

35
const newDestination = "button[data-id='new-destination']";
@@ -8,7 +10,9 @@ const destinationNameColumn = "Name";
810

911
export const goToDestinationPage = () => {
1012
cy.intercept("/api/v1/destinations/list").as("getDestinationsList");
11-
cy.visit("/destination");
13+
requestWorkspaceId().then(() => {
14+
cy.visit(`/workspaces/${getWorkspaceId()}/destination`);
15+
});
1216
};
1317

1418
export const openDestinationConnectionsPage = (destinationName: string) => {
@@ -22,7 +26,7 @@ export const openNewDestinationForm = () => {
2226
cy.get(newDestination).click();
2327
}
2428
});
25-
cy.url().should("include", `/destination/new-destination`);
29+
cy.url().should("include", `/workspaces/${getWorkspaceId()}/destination/new-destination`);
2630
};
2731

2832
export const openCreateConnection = () => {

airbyte-webapp/cypress/pages/sourcePage.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { requestWorkspaceId } from "commands/api";
2+
import { getWorkspaceId } from "commands/api/workspace";
13
import { clickOnCellInTable } from "commands/common";
24

35
const newSource = "button[data-id='new-source']";
@@ -6,7 +8,9 @@ const sourceNameColumn = "Name";
68

79
export const goToSourcePage = () => {
810
cy.intercept("/api/v1/sources/list").as("getSourcesList");
9-
cy.visit("/source");
11+
requestWorkspaceId().then(() => {
12+
cy.visit(`/workspaces/${getWorkspaceId()}/source`);
13+
});
1014
};
1115

1216
export const openSourceConnectionsPage = (sourceName: string) => {
@@ -20,5 +24,5 @@ export const openNewSourcePage = () => {
2024
cy.get(newSource).click();
2125
}
2226
});
23-
cy.url().should("include", `/source/new-source`);
27+
cy.url().should("include", `/workspaces/${getWorkspaceId()}/source/new-source`);
2428
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Page } from "@playwright/test";
2+
3+
const DEFAULT_ORGANIZATION_ID = "00000000-0000-0000-0000-000000000000";
4+
5+
export const getWorkspaceId = async (page: Page): Promise<string> => {
6+
const serverHost = process.env.AIRBYTE_SERVER_HOST;
7+
const apiBaseUrl = serverHost ? `${serverHost}/api/v1` : `${page.url().split("/").slice(0, 3).join("/")}/api/v1`;
8+
9+
const response = await page.request.post(`${apiBaseUrl}/workspaces/list_by_organization_id`, {
10+
data: {
11+
organizationId: DEFAULT_ORGANIZATION_ID,
12+
pagination: { pageSize: 1, rowOffset: 0 },
13+
},
14+
});
15+
16+
const { workspaces } = await response.json();
17+
return workspaces[0].workspaceId;
18+
};

0 commit comments

Comments
 (0)