Skip to content

Commit

Permalink
Documentation link - move from left nav to top nav in standalone mode (
Browse files Browse the repository at this point in the history
…#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
  • Loading branch information
himdel authored Jun 10, 2024
1 parent b365cc3 commit d77d224
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 26 deletions.
13 changes: 12 additions & 1 deletion src/loaders/standalone/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ export const StandaloneLayout = ({
];

docsDropdownItems = [
!IS_COMMUNITY && (
<DropdownItem
key='documentation'
component={
<ExternalLink
href={UI_DOCS_URL}
variant='menu'
>{t`Documentation`}</ExternalLink>
}
/>
),
<DropdownItem
key='customer_support'
component={
Expand Down Expand Up @@ -137,7 +148,7 @@ export const StandaloneLayout = ({
),
IS_COMMUNITY && (
<DropdownItem
key='communication'
key='community'
component={
<ExternalLink
href='https://ansible.readthedocs.io/projects/galaxy-ng/en/latest/community/userguide/'
Expand Down
8 changes: 0 additions & 8 deletions src/loaders/standalone/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,6 @@ function standaloneMenu() {
alternativeUrls: [altPath(Paths.roleEdit)],
}),
]),
menuItem(t`Documentation`, {
url: UI_DOCS_URL,
external: true,
condition: ({ settings, user }) =>
!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,
Expand Down
8 changes: 3 additions & 5 deletions test/cypress/e2e/community/view-only.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions test/cypress/e2e/namespaces/docs-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

Expand Down
12 changes: 0 additions & 12 deletions test/cypress/e2e/namespaces/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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/',
);
});
});
});

0 comments on commit d77d224

Please sign in to comment.