From d77d224d53f81d751a03d812fa26211e7c1cb82e Mon Sep 17 00:00:00 2001 From: Martin Hradil Date: Mon, 10 Jun 2024 20:41:29 +0000 Subject: [PATCH] Documentation link - move from left nav to top nav in standalone mode (#5106) * Documentation link - move from left nav to top nav in standalone mode community Documentation link is still supposed to be the last item in left nav afaik AAP-25057 No-Issue * update tests * reorder Documentation to go first --- src/loaders/standalone/layout.tsx | 13 ++++++++++++- src/loaders/standalone/menu.tsx | 8 -------- test/cypress/e2e/community/view-only.js | 8 +++----- test/cypress/e2e/namespaces/docs-menu.js | 2 ++ test/cypress/e2e/namespaces/menu.js | 12 ------------ 5 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/loaders/standalone/layout.tsx b/src/loaders/standalone/layout.tsx index 2224cb295b..e532a9ee48 100644 --- a/src/loaders/standalone/layout.tsx +++ b/src/loaders/standalone/layout.tsx @@ -95,6 +95,17 @@ export const StandaloneLayout = ({ ]; docsDropdownItems = [ + !IS_COMMUNITY && ( + {t`Documentation`} + } + /> + ), - !IS_COMMUNITY && - (settings.GALAXY_ENABLE_UNAUTHENTICATED_COLLECTION_ACCESS || - !user.is_anonymous), - }), menuItem(t`Documentation`, { url: 'https://ansible.readthedocs.io/projects/galaxy-ng/en/latest/community/userguide/', external: true, diff --git a/test/cypress/e2e/community/view-only.js b/test/cypress/e2e/community/view-only.js index fab44423e9..468330a10e 100644 --- a/test/cypress/e2e/community/view-only.js +++ b/test/cypress/e2e/community/view-only.js @@ -8,11 +8,9 @@ describe('view-only mode - with download', () => { it('has limited menu, nav', () => { cy.visit(uiPrefix); - [ - 'Collections > Collections', - 'Collections > Namespaces', - 'Documentation', - ].forEach((item) => cy.menuPresent(item)); + ['Collections > Collections', 'Collections > Namespaces'].forEach((item) => + cy.menuPresent(item), + ); [ 'Collections > Repositories', diff --git a/test/cypress/e2e/namespaces/docs-menu.js b/test/cypress/e2e/namespaces/docs-menu.js index a7178b12de..24364e79cb 100644 --- a/test/cypress/e2e/namespaces/docs-menu.js +++ b/test/cypress/e2e/namespaces/docs-menu.js @@ -19,6 +19,8 @@ describe('Documentation dropdown', () => { .should('have.attr', 'href') .and('contain', 'https://www.ansible.com/resources/webinars-training'); + cy.get('.pf-v5-c-dropdown__menu').contains('Documentation'); + cy.get('.pf-v5-c-dropdown__menu').contains('About'); }); diff --git a/test/cypress/e2e/namespaces/menu.js b/test/cypress/e2e/namespaces/menu.js index 8dcc1249ce..e11f3b5d21 100644 --- a/test/cypress/e2e/namespaces/menu.js +++ b/test/cypress/e2e/namespaces/menu.js @@ -13,7 +13,6 @@ describe('Hub Menu Tests', () => { 'Execution Environments > Remote Registries', 'Task Management', 'Signature Keys', - 'Documentation', 'User Access > Users', 'User Access > Groups', 'User Access > Roles', @@ -38,7 +37,6 @@ describe('Hub Menu Tests', () => { 'Collections > Collections', 'Collections > Namespaces', 'Collections > Repositories', - 'Documentation', 'Execution Environments > Execution Environments', 'Execution Environments > Remote Registries', 'Signature Keys', @@ -58,15 +56,5 @@ describe('Hub Menu Tests', () => { visibleMenuItems.forEach((item) => cy.menuPresent(item)); missingMenuItems.forEach((item) => cy.menuMissing(item)); }); - - it('has Documentation tab', () => { - cy.login(username, password); - - cy.menuPresent('Documentation').should( - 'have.attr', - 'href', - 'https://docs.redhat.com/documentation/en-us/red_hat_ansible_automation_platform/', - ); - }); }); });