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

fix(v6): Introduce component nav categories #313

Merged
merged 10 commits into from
Sep 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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export const MyComponent: React.FunctionComponent<MyComponentProps> = ({ customL
#### Markdown file example:
```
---
section: extensions
subsection: Component groups
section: Component groups
subsection: My component's category
id: MyComponent
propComponents: ['MyComponent']
---
Expand Down
13 changes: 0 additions & 13 deletions cypress/component/Ansible.cy.tsx

This file was deleted.

13 changes: 13 additions & 0 deletions cypress/component/AnsibleSupport.cy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import { AnsibleSupport } from '@patternfly/react-component-groups/dist/dynamic/AnsibleSupport';

describe('AnsibleSupport', () => {
it('renders supported AnsibleSupport', () => {
cy.mount(<AnsibleSupport />)
cy.get('i').should('have.class', 'ansibleSupported-0-2-2');
});
it('renders unsupported Ansible', () => {
cy.mount(<AnsibleSupport isSupported={false}/>)
cy.get('i').should('have.class', 'ansibleUnsupported-0-2-3');
});
});
11 changes: 0 additions & 11 deletions cypress/component/ContentHeader.cy.tsx

This file was deleted.

16 changes: 8 additions & 8 deletions cypress/component/InvalidObject.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import InvalidObject from '../../packages/module/dist/dynamic/InvalidObject';
import MissingPage from '../../packages/module/dist/dynamic/MissingPage';

describe('InvalidObject', () => {
it('renders InvalidObject', () => {
cy.mount(<InvalidObject />)
cy.get('[data-ouia-component-id="InvalidObject"]').should('exist')
cy.get('[data-ouia-component-id="InvalidObject"]').contains('We lost that page');
cy.get('[data-ouia-component-id="InvalidObject-body"]').contains("Let's find you a new one. Try a new search or return home.");
cy.get('[data-ouia-component-id="InvalidObject-home-button"]').contains('Return to homepage');
describe('MissingPage', () => {
it('renders MissingPage', () => {
cy.mount(<MissingPage />)
cy.get('[data-ouia-component-id="MissingPage"]').should('exist')
cy.get('[data-ouia-component-id="MissingPage"]').contains('We lost that page');
cy.get('[data-ouia-component-id="MissingPage-body"]').contains("Let's find you a new one. Try a new search or return home.");
cy.get('[data-ouia-component-id="MissingPage-home-button"]').contains('Return to homepage');
});
})
11 changes: 11 additions & 0 deletions cypress/component/PageHeader.cy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import PageHeader from '@patternfly/react-component-groups/dist/dynamic/PageHeader';

describe('PageHeader', () => {
it('should render PageHeader title and subtitle', () => {
cy.mount(<PageHeader title='My title' subtitle='This is a subtitle for your page header' />);
cy.get('title').should('exist')
cy.get('[data-ouia-component-id="PageHeader-title"]').should('have.text', 'My title')
cy.get('[data-ouia-component-id="PageHeader-subtitle"]').should('have.text', 'This is a subtitle for your page header')
})
});
4 changes: 2 additions & 2 deletions cypress/component/ServiceCard.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('ServiceCard', () => {
title='Example'
subtitle='A basic example'
description='This is a basic ServiceCard Example'
icon={<img src="/" alt="content-header-icon" />}
icon={<img src="/" alt="page-header-icon" />}
helperText='Here is helper text'
ouiaId='Example'
/>)
Expand All @@ -21,7 +21,7 @@ describe('ServiceCard', () => {
title='Example'
subtitle='A basic example'
description='This is a basic ServiceCard Example'
icon={<img src="/" alt="content-header-icon" />}
icon={<img src="/" alt="page-header-icon" />}
helperText='Here is helper text'
ouiaId='Example'
footer={<>
Expand Down
4 changes: 1 addition & 3 deletions cypress/e2e/CloseButton.spec.cy.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
describe('Test the close button', () => {
it('passes', () => {
cy.visit('http://localhost:8006/extensions/component-groups/about-component-groups', { onBeforeLoad: (win) => {cy.stub(win.console, 'log').as('consoleLog');}, });
cy.wait(1000);
cy.get('a[href="/extensions/component-groups/close-button"]').click();
cy.visit('http://localhost:8006/component-groups/controls/close-button', { onBeforeLoad: (win) => {cy.stub(win.console, 'log').as('consoleLog');}, });
cy.wait(1000);

cy.get('[data-test-id="close-button-example"]').click();
Expand Down
72 changes: 0 additions & 72 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions packages/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,8 @@
"@patternfly/patternfly": "6.0.0-alpha.210",
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"@types/react-router-dom": "^5.3.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router": "^6.24.0",
"react-router-dom": "^6.24.0",
"typescript": "^5.5.2"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
section: extensions
subsection: Component groups
section: Component groups
id: About component groups
sortValue: 1
sourceLink: https://github.com/patternfly/react-component-groups/blob/main/packages/module/patternfly-docs/content/extensions/component-groups/about-component-groups.md
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
# Sidenav top-level section
# should be the same for all markdown files
section: extensions
subsection: Component groups
section: Component groups
subsection: Status and state indicators
# Sidenav secondary level section
# should be the same for all markdown files
id: Ansible
id: Ansible support
# Tab (react | react-demos | html | html-demos | design-guidelines | accessibility)
source: react
# If you use typescript, the name of the interface to display props for
# These are found through the sourceProps function provided in patternfly-docs.source.js
propComponents: ['Ansible']
sourceLink: https://github.com/patternfly/react-component-groups/blob/main/packages/module/patternfly-docs/content/extensions/component-groups/examples/Ansible/Ansible.md
propComponents: ['AnsibleSupport']
sourceLink: https://github.com/patternfly/react-component-groups/blob/main/packages/module/patternfly-docs/content/extensions/component-groups/examples/AnsibleSupport/AnsibleSupport.md
---

import Ansible from '@patternfly/react-component-groups/dist/dynamic/Ansible';
import AnsibleSupport from '@patternfly/react-component-groups/dist/dynamic/AnsibleSupport';

The **Ansible** component displays the Ansible project logo, with a support status style.
The **Ansible support** component displays the Ansible project logo, with a support status style.

### Ansible supported

Expand All @@ -28,7 +28,7 @@ By default, the Ansible logo displays as normal and in full color, meaning that

### Ansible unsupported

To specify that Ansible is not supported, add the `unsupported` property to the `<Ansible>` component.
To specify that Ansible is not supported, set the `isSupported` property to `false`.

```js file="./AnsibleUnsupportedExample.tsx"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import React from 'react';
import AnsibleSupport from '@patternfly/react-component-groups/dist/dynamic/AnsibleSupport';

export const BasicExample: React.FunctionComponent = () => <AnsibleSupport />;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import React from 'react';
import AnsibleSupport from '@patternfly/react-component-groups/dist/dynamic/AnsibleSupport';

export const BasicExample: React.FunctionComponent = () => <AnsibleSupport isSupported={false} />;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
# Sidenav top-level section
# should be the same for all markdown files
section: extensions
subsection: Component groups
section: Component groups
subsection: Status and state indicators
# Sidenav secondary level section
# should be the same for all markdown files
id: Battery
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
# Sidenav top-level section
# should be the same for all markdown files
section: extensions
subsection: Component groups
section: Component groups
subsection: Controls
# Sidenav secondary level section
# should be the same for all markdown files
id: Bulk select
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
# Sidenav top-level section
# should be the same for all markdown files
section: extensions
subsection: Component groups
section: Component groups
subsection: Controls
# Sidenav secondary level section
# should be the same for all markdown files
id: Close button
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
# Sidenav top-level section
# should be the same for all markdown files
section: extensions
subsection: Component groups
section: Component groups
subsection: Helpers
# Sidenav secondary level section
# should be the same for all markdown files
id: Column management modal
Expand Down
Loading
Loading