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

add RHEL, Ansible, and OpenShift to services dropdown #2855

Merged
merged 14 commits into from
Jun 11, 2024

Conversation

InsaneZein
Copy link
Contributor

@InsaneZein InsaneZein commented May 31, 2024

@InsaneZein InsaneZein marked this pull request as ready for review June 4, 2024 17:28
@epwinchell epwinchell self-requested a review June 4, 2024 18:20
Comment on lines 10 to 11
import { Divider } from '@patternfly/react-core/dist/esm/components/Divider';
import { Text, TextVariants } from '@patternfly/react-core/dist/esm/components/Text';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use esm imports. Use /dynamic

import { Divider } from '@patternfly/react-core/dist/esm/components/Divider';
import { Text, TextVariants } from '@patternfly/react-core/dist/esm/components/Text';
import ChromeLink from '../ChromeLink';
import { Button } from '@patternfly/react-core';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use absolute import path for dependency sharing optimization purposes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

</TabTitleText>
}
/>
<Text className="pf-v5-u-pl-lg pf-v5-u-pr-0 pf-v5-u-pt-0 pf-v5-u-pb-sm" component={TextVariants.p}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you extract the new links into a separate component? The JSX is starting to be kind of long.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extracted

</Button>
</ChromeLink>
<ChromeLink href="/insights/dashboard#SIDs=&tags=">
<Button variant="link" component="a" className="pf-v5-u-pl-lg">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will throw an invalid DOM nesting error. You can't have a tag within a tag.

Warning: validateDOMNesting(...): <a> cannot appear as a descendant of <a>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i got rid of the that caused these errors

@epwinchell epwinchell self-requested a review June 6, 2024 14:58
Copy link
Contributor

@epwinchell epwinchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Styling looks fine

@codecov-commenter
Copy link

codecov-commenter commented Jun 6, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 61.75%. Comparing base (6032eda) to head (e93e775).

Current head e93e775 differs from pull request most recent head c5b1fd5

Please upload reports for the commit c5b1fd5 to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2855      +/-   ##
==========================================
+ Coverage   61.74%   61.75%   +0.01%     
==========================================
  Files         204      205       +1     
  Lines        4540     4542       +2     
  Branches      856      856              
==========================================
+ Hits         2803     2805       +2     
  Misses       1726     1726              
  Partials       11       11              
Files Coverage Δ
...components/AllServicesDropdown/AllServicesMenu.tsx 86.95% <ø> (ø)
...ents/AllServicesDropdown/PlatformServicesLinks.tsx 100.00% <100.00%> (ø)
...components/AllServicesDropdown/AllServicesTabs.tsx 86.36% <0.00%> (ø)

@InsaneZein
Copy link
Contributor Author

/retest

@@ -23,7 +23,7 @@ describe('<AllServicesDropdown />', () => {
it('should close all services dropdown in link matches current pathname', () => {
function checkMenuClosed() {
cy.get('.pf-v5-c-menu-toggle__text').click();
cy.contains('All services').should('exist');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also a cy.contains('All services').should('not.exist'); bellow. This check has to be changed because now its always true. The test does not verify if the dropdown was closed or not.

<ChromeLink href="/ansible/ansible-dashboard" className="pf-v5-u-pl-lg pf-v5-u-pb-sm">
Red Hat Ansible Platform
</ChromeLink>
<ChromeLink href="/insights/dashboard#SIDs=&tags=" className="pf-v5-u-pl-lg pf-v5-u-pb-sm">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to apply any filter, or even use the empty ones in the URL.

The URL should be /insights. Otherwise, it will do a full page refresh. The app is not registered for such a pathname.

const PlatformServiceslinks = () => {
return (
<>
<ChromeLink href="/ansible/ansible-dashboard" className="pf-v5-u-pl-lg pf-v5-u-pb-sm">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The URL should be /ansible. Otherwise, it will do a full page refresh. The is not registered for such a pathname.

cy.contains('Favorites').click();
cy.contains('Test section').click();
cy.contains('Test link').click();
cy.contains('All services').should('not.exist');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to verify the dropdown is closed. YOu are now looking for a different string.

cy.contains('View all').should('not.exist');

@InsaneZein
Copy link
Contributor Author

/retest

@Hyperkid123 Hyperkid123 merged commit 19729f0 into master Jun 11, 2024
9 of 10 checks passed
@Hyperkid123 Hyperkid123 deleted the add-big3-dropdown branch June 11, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants