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

Descriptionlist complex content demo #10237

Open
wants to merge 1 commit into
base: v5
Choose a base branch
from
Open
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
25 changes: 25 additions & 0 deletions packages/react-core/src/demos/DescriptionList/DescriptionList.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
id: Description list
section: components
---

import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
Copy link
Contributor

Choose a reason for hiding this comment

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

The imports here just need to be cleaned up to remove things that aren't actually being used in this demo.

import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
import ThIcon from '@patternfly/react-icons/dist/esm/icons/th-icon';
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
import imgAvatar from '@patternfly/react-core/src/components/assets/avatarImg.svg';
import pfIcon from '../assets/pf-logo-small.svg';
import pfLogo from '../assets/pf-logo.svg';
import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon';
import { Link } from '@reach/router';
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';

## Demos

### Complex content

```js file='./examples/DescriptionListComplexContent.tsx' isFullscreen
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
import React from 'react';
import {
DescriptionList,
DescriptionListTerm,
DescriptionListGroup,
DescriptionListDescription,
PageSection,
PageSectionVariants,
TextContent,
Text,
Grid,
GridItem,
Divider,
Title
} from '@patternfly/react-core';
import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';

export const DescriptionListComplexContent: React.FunctionComponent = () => (
<DashboardWrapper>
<PageSection variant={PageSectionVariants.light}>
<TextContent>
<Text component="h1">Main title</Text>
<Text component="p">This is a full page demo.</Text>
</TextContent>
</PageSection>
<Divider component="div" />
<PageSection variant={PageSectionVariants.light}>
<Grid hasGutter>
<GridItem span={4}>
<Grid hasGutter>
<GridItem>
<Title headingLevel="h2">Service overview</Title>
</GridItem>
<GridItem>
<DescriptionList columnModifier={{ default: '2Col', lg: '2Col' }}>
<DescriptionListGroup>
<DescriptionListTerm>Name</DescriptionListTerm>
<DescriptionListDescription>Example</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Label</DescriptionListTerm>
<DescriptionListDescription>No label</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Annotations</DescriptionListTerm>
<DescriptionListDescription>2 Annotations</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Created at:</DescriptionListTerm>
<DescriptionListDescription>3 minutes ago</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Namespace</DescriptionListTerm>
<DescriptionListDescription>ajay-test</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Pod selector</DescriptionListTerm>
<DescriptionListDescription>app=MyApp</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Session affi nity</DescriptionListTerm>
<DescriptionListDescription>None</DescriptionListDescription>
</DescriptionListGroup>
</DescriptionList>
</GridItem>
</Grid>
</GridItem>
<GridItem span={8}>
<Grid hasGutter>
<GridItem>
<Title headingLevel="h2">Service routing</Title>
</GridItem>
<GridItem>
<DescriptionList isFillColumns columnModifier={{ default: '2Col', lg: '2Col' }}>
<DescriptionListGroup>
<DescriptionListTerm>Service address</DescriptionListTerm>
<DescriptionListDescription>
<Table>
<Thead>
<Tr>
<Th key={0}>Type</Th>
<Th key={1}>Location</Th>
</Tr>
</Thead>
<Tbody>
<Tr key={0}>
<Td>Cluster IP</Td>
<Td>172.30.126.106</Td>
</Tr>
<Tr key={1}>
<Td>Accessible within the cluster only</Td>
<Td>n/a</Td>
</Tr>
</Tbody>
</Table>
</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Service port mapping</DescriptionListTerm>
<DescriptionListDescription>
<Table>
<Thead>
<Tr key={0}>
<Th key={0}>Name</Th>
<Th key={1}>Port</Th>
<Th key={2}>Protocol</Th>
<Th key={3}>Pod port or ...</Th>
</Tr>
</Thead>
<Tbody>
<Tr key={1}>
<Td>test</Td>
<Td>80</Td>
<Td>TCP</Td>
<Td>80</Td>
</Tr>
</Tbody>
</Table>
</DescriptionListDescription>
</DescriptionListGroup>
</DescriptionList>
</GridItem>
</Grid>
</GridItem>
</Grid>
</PageSection>
</DashboardWrapper>
);
Loading