-
Notifications
You must be signed in to change notification settings - Fork 133
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
Changes from 13 commits
fa64f57
e6e081b
321ba82
73d1e30
e47d1cb
8316307
8e12906
8843069
c2f86fa
b7f4c1c
d727ffd
cec68a2
d58a5ad
c5b1fd5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,11 +23,11 @@ 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'); | ||
cy.contains('View all').should('exist'); | ||
cy.contains('Favorites').click(); | ||
cy.contains('Test section').click(); | ||
cy.contains('Test link').click(); | ||
cy.contains('All services').should('not.exist'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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'); | ||
} | ||
cy.intercept('http://localhost:8080/api/chrome-service/v1/static/stable/stage/services/services-generated.json', [ | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.pf-v5-c-tabs.pf-m-vertical .pf-v5-c-tabs__list { | ||
max-width: 100%; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,11 @@ import StarIcon from '@patternfly/react-icons/dist/dynamic/icons/star-icon'; | |
import { FAVORITE_TAB_ID, TAB_CONTENT_ID } from './common'; | ||
import type { AllServicesSection as AllServicesSectionType } from '../AllServices/allServicesLinks'; | ||
import { isBeta } from '../../utils/common'; | ||
import { Divider } from '@patternfly/react-core/dist/dynamic/components/Divider'; | ||
import { Text, TextVariants } from '@patternfly/react-core/dist/dynamic/components/Text'; | ||
import ChromeLink from '../ChromeLink'; | ||
import './AllServicesTabs.scss'; | ||
import PlatformServiceslinks from './PlatformServicesLinks'; | ||
|
||
export type AllServicesTabsProps = { | ||
activeTabKey: string | number; | ||
|
@@ -74,25 +79,37 @@ const AllServicesTabs = ({ | |
onToggle={onToggle} | ||
toggleText={activeTabTitle} | ||
role="region" | ||
className="pf-v5-u-p-md pf-v5-u-pr-0" | ||
className="pf-v5-u-p-md pf-v5-u-pr-0 pf-v5-u-pl-0-on-md" | ||
ouiaId={'all-services-tabs'} | ||
> | ||
<TabWrapper | ||
ouiaId="AllServices-favorites-Tab" | ||
onClick={(e) => { | ||
handleTabClick?.(e, FAVORITE_TAB_ID); | ||
}} | ||
eventKey={FAVORITE_TAB_ID} | ||
title={ | ||
<TabTitleText> | ||
Favorites | ||
<Icon className="chr-c-icon-service-tab pf-v5-u-ml-sm" status="warning" isInline> | ||
<StarIcon /> | ||
</Icon> | ||
</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}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. extracted |
||
Platform | ||
</Text> | ||
<Divider className="pf-v5-u-pb-md" /> | ||
<PlatformServiceslinks /> | ||
<> | ||
<Text className="pf-v5-u-pl-lg pf-v5-u-pr-0 pf-v5-u-pt-lg pf-v5-u-pb-sm" component={TextVariants.p}> | ||
Solutions{' '} | ||
<ChromeLink href="/allservices" className="pf-v5-u-font-size-sm pf-v5-u-p-md" data-ouia-component-id="View all link"> | ||
View all | ||
</ChromeLink> | ||
</Text> | ||
<Divider className="pf-v5-u-pb-sm" /> | ||
<TabWrapper | ||
ouiaId="AllServices-favorites-Tab" | ||
onClick={(e) => { | ||
handleTabClick?.(e, FAVORITE_TAB_ID); | ||
}} | ||
eventKey={FAVORITE_TAB_ID} | ||
title={ | ||
<TabTitleText className="pf-v5-u-pl-sm"> | ||
Favorites | ||
<Icon className="chr-c-icon-service-tab pf-v5-u-ml-sm" status="warning" isInline> | ||
<StarIcon /> | ||
</Icon> | ||
</TabTitleText> | ||
} | ||
/> | ||
{/* The tabs children type is busted and does not accept array. Hence the fragment wrapper */} | ||
{linkSections.map((section, index) => ( | ||
<TabWrapper | ||
|
@@ -103,6 +120,7 @@ const AllServicesTabs = ({ | |
tabContentId={TAB_CONTENT_ID} | ||
tabContentRef={tabContentRef} | ||
onClick={() => onTabClick(section, index)} | ||
className="pf-v5-u-pl-sm" | ||
/> | ||
))} | ||
</> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import ChromeLink from '../ChromeLink'; | ||
|
||
const PlatformServiceslinks = () => { | ||
return ( | ||
<> | ||
<ChromeLink href="/ansible" className="pf-v5-u-pl-lg pf-v5-u-pb-sm"> | ||
Red Hat Ansible Platform | ||
</ChromeLink> | ||
<ChromeLink href="/insights" className="pf-v5-u-pl-lg pf-v5-u-pb-sm"> | ||
Red Hat Enterprise Linux | ||
</ChromeLink> | ||
<ChromeLink href="/openshift/overview" className="pf-v5-u-pl-lg pf-v5-u-pb-sm"> | ||
Red Hat OpenShift | ||
</ChromeLink> | ||
</> | ||
); | ||
}; | ||
export default PlatformServiceslinks; |
There was a problem hiding this comment.
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.