Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): revamping the sidebar navigation design #14625

Merged
merged 20 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export const navigateToCustomizeLandingPage = ({
}) => {
interceptURL('GET', '/api/v1/teams/name/*', 'settingsPage');

cy.get('[data-testid="app-bar-item-settings"]').click();
cy.sidebarClick('app-bar-item-settings');

verifyResponseStatusCode('@settingsPage', 200);
cy.get('[data-testid="settings-left-panel"]').should('be.visible');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ export const updateAssets = (domainObj) => {

cy.get('[data-testid="domain-link"]').should('contain', domainObj.name);

cy.get('[data-testid="app-bar-item-domain"]')
.should('be.visible')
.click({ force: true });
cy.sidebarClick('app-bar-item-domain');

goToAssetsTab(domainObj);

Expand Down Expand Up @@ -181,9 +179,7 @@ export const removeAssets = (domainObj) => {
cy.get('[data-testid="remove-owner"]').click();
verifyResponseStatusCode('@patchDomain', 200);

cy.get('[data-testid="app-bar-item-domain"]')
.should('be.visible')
.click({ force: true });
cy.sidebarClick('app-bar-item-domain');

goToAssetsTab(domainObj);
cy.contains('Adding a new Asset is easy, just give it a spin!').should(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ class UsersTestClass {
}

visitUserListPage() {
cy.get('[data-testid="app-bar-item-settings"]')
.should('exist')
.should('be.visible')
.click();
cy.sidebarClick('app-bar-item-settings');
interceptURL('GET', '/api/v1/users?*', 'getUsers');
cy.get('[data-testid="settings-left-panel"]').contains('Users').click();
}
Expand Down Expand Up @@ -79,14 +76,15 @@ class UsersTestClass {
}

checkStewardServicesPermissions() {
cy.get('[data-testid="app-bar-item-explore"]').click();
cy.sidebarClick('app-bar-item-explore');
Object.values(VISIT_SERVICE_PAGE_DETAILS).forEach((service) => {
cy.get('[data-testid="app-bar-item-settings"]').click();
cy.sidebarClick('app-bar-item-settings');

cy.get(`[data-menu-id*="${service.settingsMenuId}"]`).click();
cy.get('[data-testid="add-service-button"] > span').should('not.exist');
});
cy.get('[data-testid="app-bar-item-explore"]').click();
cy.get('[data-testid="tables-tab"] > .ant-space').click();
cy.sidebarClick('app-bar-item-explore');
cy.get('[data-testid="tables-tab"]').click();
cy.get(
'.ant-drawer-title > [data-testid="entity-link"] > .ant-typography'
).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ import {
export const visitGlossaryPage = () => {
interceptURL('GET', '/api/v1/glossaries?fields=*', 'getGlossaries');

cy.sidebarHover();
cy.get('[data-testid="governance"]').click({
animationDistanceThreshold: 20,
waitForAnimations: true,
});

// Applying force true as the hover over tooltip
cy.get('[data-testid="app-bar-item-glossary"]').click({ force: true });

cy.sidebarClick('app-bar-item-glossary');

verifyResponseStatusCode('@getGlossaries', 200);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ export const validateForm = () => {
export const visitClassificationPage = () => {
interceptURL('GET', '/api/v1/tags*', 'getTags');

cy.sidebarHover();
cy.get('[data-testid="governance"]').click({
animationDistanceThreshold: 20,
waitForAnimations: true,
});

cy.get('[data-testid="app-bar-item-tags"]').click();
cy.sidebarClick('app-bar-item-tags');

verifyResponseStatusCode('@getTags', 200);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export const createCustomPropertyForEntity = ({
}) => {
interceptURL('GET', '/api/v1/teams/name/*', 'settingsPage');

cy.get('[data-testid="app-bar-item-settings"]').click();
cy.sidebarClick('app-bar-item-settings');

verifyResponseStatusCode('@settingsPage', 200);

interceptURL('GET', `/api/v1/metadata/types/name/*`, 'getEntity');
Expand Down Expand Up @@ -80,7 +81,7 @@ export const deleteCustomPropertyForEntity = ({
property: CustomProperty;
type: EntityType;
}) => {
cy.get('[data-testid="app-bar-item-settings"]').click();
cy.sidebarClick('app-bar-item-settings');

interceptURL('GET', `/api/v1/metadata/types/name/*`, 'getEntity');
interceptURL('PATCH', `/api/v1/metadata/types/*`, 'patchEntity');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,8 @@ export const permanentDeleteUser = (username: string) => {
cy.get('[data-testid="search-error-placeholder"]').should('be.exist');
};
export const visitUserListPage = () => {
cy.get('[data-testid="app-bar-item-settings"]')
.should('exist')
.should('be.visible')
.click();
cy.sidebarClick('app-bar-item-settings');

interceptURL('GET', '/api/v1/users?*', 'getUsers');
cy.get('[data-testid="settings-left-panel"]').contains('Users').click();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export const searchForField = (condition, fieldid, searchCriteria, index) => {

export const goToAdvanceSearch = () => {
// Navigate to explore page
cy.get('[data-testid="app-bar-item-explore"]').click();
cy.sidebarClick('app-bar-item-explore');
cy.get('[data-testid="advance-search-button"]').click();
cy.get('[data-testid="reset-btn"]').click();
};
Expand Down
15 changes: 8 additions & 7 deletions openmetadata-ui/src/main/resources/ui/cypress/common/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,9 @@ export const deleteCreatedService = (
'api/v1/teams/name/Organization?fields=*',
'getSettingsPage'
);
cy.get('[data-testid="app-bar-item-settings"]')
.should('be.visible')
.click({ force: true });

cy.sidebarClick('app-bar-item-settings');

verifyResponseStatusCode('@getSettingsPage', 200);
// Services page
interceptURL('GET', '/api/v1/services/*', 'getServices');
Expand Down Expand Up @@ -511,7 +511,8 @@ export const goToAddNewServicePage = (service_type) => {
'getSettingsPage'
);
// Click on settings page
cy.get('[data-testid="app-bar-item-settings"]').should('be.visible').click();
cy.sidebarClick('app-bar-item-settings');

verifyResponseStatusCode('@getSettingsPage', 200);
// Services page
interceptURL('GET', '/api/v1/services/*', 'getServiceList');
Expand Down Expand Up @@ -966,7 +967,7 @@ export const updateDescriptionForIngestedTables = (
verifyResponseStatusCode('@updateEntity', 200);

// re-run ingestion flow
cy.get('[data-testid="app-bar-item-settings"]').should('be.visible').click();
cy.sidebarClick('app-bar-item-settings');

// Services page
cy.get('.ant-menu-title-content').contains(type).should('be.visible').click();
Expand Down Expand Up @@ -1140,7 +1141,7 @@ export const visitServiceDetailsPage = (
);
interceptURL('GET', '/api/v1/teams/name/*', 'getOrganization');

cy.get('[data-testid="app-bar-item-settings"]').click();
cy.sidebarClick('app-bar-item-settings');

verifyResponseStatusCode('@getOrganization', 200);

Expand Down Expand Up @@ -1172,7 +1173,7 @@ export const visitServiceDetailsPage = (
export const visitDataModelPage = (dataModelFQN, dataModelName) => {
interceptURL('GET', '/api/v1/teams/name/*', 'getOrganization');

cy.get('[data-testid="app-bar-item-settings"]').click();
cy.sidebarClick('app-bar-item-settings');

verifyResponseStatusCode('@getOrganization', 200);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export const visitServiceDetailsPage = (service, verifyHeader = true) => {
'api/v1/teams/name/Organization?fields=*',
'getSettingsPage'
);
cy.get('[data-testid="app-bar-item-settings"]').click();

cy.sidebarClick('app-bar-item-settings');

verifyResponseStatusCode('@getSettingsPage', 200);
// Services page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,16 @@ describe('DataConsumer Edit policy should work properly', () => {
cy.url().should('eq', `${BASE_URL}/my-data`);

// Check CRUD for Glossary

cy.sidebarHover();

cy.get(glossary.testid)
.should('be.visible')
.click({ animationDistanceThreshold: 10 });
if (glossary.subMenu) {
cy.get(glossary.subMenu).should('be.visible').click({ force: true });

cy.sidebarHoverOutside();
}
cy.get('body').click();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ describe.skip('Incident Manager', () => {

cy.clickOnLogo();

cy.get('[data-testid="app-bar-item-settings"]')
.should('be.visible')
.click();
cy.sidebarClick('app-bar-item-settings');
cy.get('[data-menu-id*="databases"]').should('be.visible').click();
cy.intercept('/api/v1/services/ingestionPipelines?*').as('ingestionData');
interceptURL(
Expand Down Expand Up @@ -214,8 +212,9 @@ describe.skip('Incident Manager', () => {
});

it('Assign incident to user', () => {
cy.sidebarHover();
cy.get("[data-testid='data-quality'").click();
cy.get("[data-testid='app-bar-item-incident-manager'").click();
cy.sidebarClick('app-bar-item-incident-manager');
cy.get(`[data-testid="test-case-${NEW_TABLE_TEST_CASE.name}"]`).should(
'be.visible'
);
Expand Down Expand Up @@ -252,8 +251,9 @@ describe.skip('Incident Manager', () => {
'getTestCase'
);
interceptURL('GET', '/api/v1/feed?entityLink=*&type=Task', 'getTaskFeed');
cy.sidebarHover();
cy.get("[data-testid='data-quality'").click();
cy.get("[data-testid='app-bar-item-incident-manager'").click();
cy.sidebarClick('app-bar-item-incident-manager');
cy.get(`[data-testid="test-case-${NEW_TABLE_TEST_CASE.name}"]`).click();
verifyResponseStatusCode('@getTestCase', 200);
cy.get('[data-testid="issue"]').click();
Expand Down Expand Up @@ -285,8 +285,9 @@ describe.skip('Incident Manager', () => {
'getTestCase'
);
interceptURL('GET', '/api/v1/feed?entityLink=*&type=Task', 'getTaskFeed');
cy.sidebarHover();
cy.get("[data-testid='data-quality'").click();
cy.get("[data-testid='app-bar-item-incident-manager'").click();
cy.sidebarClick('app-bar-item-incident-manager');
cy.get(`[data-testid="test-case-${NEW_TABLE_TEST_CASE.name}"]`).click();
verifyResponseStatusCode('@getTestCase', 200);
cy.get('[data-testid="issue"]').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ describe('Schema search', () => {
'api/v1/teams/name/Organization?fields=*',
'getSettingsPage'
);
cy.get('[data-testid="app-bar-item-settings"]')
.should('be.visible')
.click();

cy.sidebarClick('app-bar-item-settings');

verifyResponseStatusCode('@getSettingsPage', 200);
// Services page
interceptURL('GET', '/api/v1/services/*', 'getServices');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ describe('Add nested teams and test TeamsSelectable', () => {
beforeEach(() => {
cy.login();

cy.get('[data-testid="app-bar-item-settings"]')
.should('be.visible')
.click();
cy.sidebarClick('app-bar-item-settings');

interceptURL('GET', '/api/v1/teams/name/*', 'getOrganization');
interceptURL('GET', '/api/v1/permissions/team/name/*', 'getPermissions');
// Clicking on teams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ describe('Test Add role and assign it to the user', () => {
cy.login();
interceptURL('GET', '*api/v1/roles*', 'getRoles');
interceptURL('GET', '/api/v1/users?*', 'usersPage');
cy.get('[data-testid="app-bar-item-settings"]')
.should('be.visible')
.click();
cy.sidebarClick('app-bar-item-settings');
});

it('Create role', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe(`Advanced search quick filters should work properly for assets`, () =>

it(`should show the quick filters for respective assets`, () => {
// Navigate to explore page
cy.get('[data-testid="app-bar-item-explore"]').click();
cy.sidebarClick('app-bar-item-explore');
QUICK_FILTERS_BY_ASSETS.map((asset) => {
cy.get(`[data-testid="${asset.tab}"]`).scrollIntoView().click();

Expand All @@ -52,7 +52,7 @@ describe(`Advanced search quick filters should work properly for assets`, () =>
const asset = QUICK_FILTERS_BY_ASSETS[0];

// Navigate to explore page
cy.get('[data-testid="app-bar-item-explore"]').click();
cy.sidebarClick('app-bar-item-explore');
cy.get(`[data-testid="${asset.tab}"]`).scrollIntoView().click();

asset.filters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ describe('Collect end point should work properly', () => {

Object.values(PAGES).map((page) => {
it(`Visit ${page.name} page should trigger collect API`, () => {
cy.sidebarHover();
cy.get(page.mainMenuId)
.should('be.visible')
.click({ animationDistanceThreshold: 10 });
Expand All @@ -74,6 +75,7 @@ describe('Collect end point should work properly', () => {
cy.wait(500);
cy.get(page.subMenu).should('be.visible').click({ force: true });
}
cy.sidebarHoverOutside();
assertCollectEndPoint();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ describe('Persona operations', () => {
cy.login();
interceptURL('GET', '/api/v1/teams/name/*', 'settingsPage');

cy.get('[data-testid="app-bar-item-settings"]').click();
cy.sidebarClick('app-bar-item-settings');

verifyResponseStatusCode('@settingsPage', 200);
cy.get('[data-testid="settings-left-panel"]').should('be.visible');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ describe.skip('Alerts page should work properly', () => {
interceptURL('POST', '/api/v1/events/subscriptions', 'createAlert');
interceptURL('GET', `/api/v1/search/query?q=*`, 'getSearchResult');
cy.login();
cy.get('[data-testid="app-bar-item-settings"]')
.should('exist')
.and('be.visible')
.click();
cy.sidebarClick('app-bar-item-settings');
interceptURL('GET', '/api/v1/events/subscriptions?*', 'alertsPage');
cy.get('[data-testid="global-setting-left-panel"]')
.contains('Alerts')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ const revokeToken = () => {
describe('Bots Page should work properly', () => {
beforeEach(() => {
cy.login();
cy.get('[data-testid="app-bar-item-settings"]')
.should('exist')
.should('be.visible')
.click();
cy.sidebarClick('app-bar-item-settings');
interceptURL(
'GET',
'api/v1/bots?limit=*&include=non-deleted',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('Custom Logo Config', () => {
beforeEach(() => {
cy.login();

cy.get('[data-testid="app-bar-item-settings"]').click();
cy.sidebarClick('app-bar-item-settings');

interceptURL(
'GET',
Expand Down
Loading
Loading