Merge pull request #6348 from AlexSCorey/5895-SurveyList

Adds word wrap functionality

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot]
2020-03-24 19:07:05 +00:00
committed by GitHub
24 changed files with 730 additions and 554 deletions

View File

@@ -4,10 +4,10 @@ import {
DataListItem, DataListItem,
DataListItemRow, DataListItemRow,
DataListItemCells, DataListItemCells,
DataListCell,
DataListCheck, DataListCheck,
Radio, Radio,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
const CheckboxListItem = ({ const CheckboxListItem = ({
isDisabled = false, isDisabled = false,

View File

@@ -0,0 +1,9 @@
import { DataListCell } from '@patternfly/react-core';
import styled from 'styled-components';
DataListCell.displayName = 'PFDataListCell';
// Once https://github.com/patternfly/patternfly-react/issues/3938
// has been resolved this component can be removed
export default styled(DataListCell)`
word-break: break-word;
`;

View File

@@ -0,0 +1 @@
export { default } from './DataListCell';

View File

@@ -5,13 +5,13 @@ import { t } from '@lingui/macro';
import { import {
Button, Button,
DataListAction as _DataListAction, DataListAction as _DataListAction,
DataListCell,
DataListCheck, DataListCheck,
DataListItem, DataListItem,
DataListItemRow, DataListItemRow,
DataListItemCells, DataListItemCells,
Tooltip, Tooltip,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import { RocketIcon } from '@patternfly/react-icons'; import { RocketIcon } from '@patternfly/react-icons';
import LaunchButton from '@components/LaunchButton'; import LaunchButton from '@components/LaunchButton';
import StatusIcon from '@components/StatusIcon'; import StatusIcon from '@components/StatusIcon';

View File

@@ -5,12 +5,13 @@ import { t } from '@lingui/macro';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { import {
DataListAction as _DataListAction, DataListAction as _DataListAction,
DataListCell,
DataListItem, DataListItem,
DataListItemCells, DataListItemCells,
DataListItemRow, DataListItemRow,
Switch, Switch,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import styled from 'styled-components'; import styled from 'styled-components';
const DataListAction = styled(_DataListAction)` const DataListAction = styled(_DataListAction)`

View File

@@ -71,42 +71,102 @@ exports[`<NotificationListItem canToggleNotifications /> initially renders succe
<DataListCell <DataListCell
key="name" key="name"
> >
<div <StyledComponent
className="pf-c-data-list__cell" forwardedComponent={
> Object {
<Link "$$typeof": Symbol(react.forward_ref),
to={ "attrs": Array [],
Object { "componentStyle": ComponentStyle {
"pathname": "/foo", "componentId": "DataListCell-sc-18ntxrx-0",
} "isStatic": true,
"lastClassName": "flJMIO",
"rules": Array [
"word-break:break-word;",
],
},
"displayName": "DataListCell",
"foldedComponentIds": Array [],
"render": [Function],
"styledComponentId": "DataListCell-sc-18ntxrx-0",
"target": [Function],
"toString": [Function],
"warnTooManyClasses": [Function],
"withComponent": [Function],
} }
}
forwardedRef={null}
>
<PFDataListCell
className="DataListCell-sc-18ntxrx-0 flJMIO"
> >
<LinkAnchor <div
href="/foo" className="pf-c-data-list__cell DataListCell-sc-18ntxrx-0 flJMIO"
navigate={[Function]}
> >
<a <Link
href="/foo" to={
onClick={[Function]} Object {
"pathname": "/foo",
}
}
> >
<b <LinkAnchor
id="items-list-item-9000" href="/foo"
navigate={[Function]}
> >
Foo <a
</b> href="/foo"
</a> onClick={[Function]}
</LinkAnchor> >
</Link> <b
</div> id="items-list-item-9000"
>
Foo
</b>
</a>
</LinkAnchor>
</Link>
</div>
</PFDataListCell>
</StyledComponent>
</DataListCell> </DataListCell>
<DataListCell <DataListCell
key="type" key="type"
> >
<div <StyledComponent
className="pf-c-data-list__cell" forwardedComponent={
Object {
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
"componentId": "DataListCell-sc-18ntxrx-0",
"isStatic": true,
"lastClassName": "flJMIO",
"rules": Array [
"word-break:break-word;",
],
},
"displayName": "DataListCell",
"foldedComponentIds": Array [],
"render": [Function],
"styledComponentId": "DataListCell-sc-18ntxrx-0",
"target": [Function],
"toString": [Function],
"warnTooManyClasses": [Function],
"withComponent": [Function],
}
}
forwardedRef={null}
> >
Slack <PFDataListCell
</div> className="DataListCell-sc-18ntxrx-0 flJMIO"
>
<div
className="pf-c-data-list__cell DataListCell-sc-18ntxrx-0 flJMIO"
>
Slack
</div>
</PFDataListCell>
</StyledComponent>
</DataListCell> </DataListCell>
</div> </div>
</DataListItemCells> </DataListItemCells>

View File

@@ -4,9 +4,9 @@ import {
DataListItem, DataListItem,
DataListItemRow, DataListItemRow,
DataListItemCells, DataListItemCells,
DataListCell,
TextContent, TextContent,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import styled from 'styled-components'; import styled from 'styled-components';
const DetailWrapper = styled(TextContent)` const DetailWrapper = styled(TextContent)`

View File

@@ -8,11 +8,11 @@ import {
DataListItem, DataListItem,
DataListItemRow, DataListItemRow,
DataListItemCells as PFDataListItemCells, DataListItemCells as PFDataListItemCells,
DataListCell,
Text, Text,
TextContent, TextContent,
TextVariants, TextVariants,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import styled from 'styled-components'; import styled from 'styled-components';

View File

@@ -6,13 +6,13 @@ import { Link } from 'react-router-dom';
import { import {
Button, Button,
DataListAction as _DataListAction, DataListAction as _DataListAction,
DataListCell,
DataListCheck, DataListCheck,
DataListItem, DataListItem,
DataListItemRow, DataListItemRow,
DataListItemCells, DataListItemCells,
Tooltip, Tooltip,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import { PencilAltIcon } from '@patternfly/react-icons'; import { PencilAltIcon } from '@patternfly/react-icons';
import { DetailList, Detail } from '@components/DetailList'; import { DetailList, Detail } from '@components/DetailList';
import { ScheduleToggle } from '@components/Schedule'; import { ScheduleToggle } from '@components/Schedule';

View File

@@ -6,13 +6,14 @@ import { Link } from 'react-router-dom';
import { import {
Button, Button,
DataListAction as _DataListAction, DataListAction as _DataListAction,
DataListCell,
DataListCheck, DataListCheck,
DataListItem, DataListItem,
DataListItemRow, DataListItemRow,
DataListItemCells, DataListItemCells,
Tooltip, Tooltip,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import { PencilAltIcon } from '@patternfly/react-icons'; import { PencilAltIcon } from '@patternfly/react-icons';
import { Credential } from '@types'; import { Credential } from '@types';
import styled from 'styled-components'; import styled from 'styled-components';

View File

@@ -5,13 +5,14 @@ import { t } from '@lingui/macro';
import { import {
Button, Button,
DataListAction as _DataListAction, DataListAction as _DataListAction,
DataListCell,
DataListCheck, DataListCheck,
DataListItem, DataListItem,
DataListItemRow, DataListItemRow,
DataListItemCells, DataListItemCells,
Tooltip, Tooltip,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { PencilAltIcon } from '@patternfly/react-icons'; import { PencilAltIcon } from '@patternfly/react-icons';

View File

@@ -7,13 +7,14 @@ import { t } from '@lingui/macro';
import { import {
Button, Button,
DataListAction as _DataListAction, DataListAction as _DataListAction,
DataListCell,
DataListCheck, DataListCheck,
DataListItem, DataListItem,
DataListItemCells, DataListItemCells,
DataListItemRow, DataListItemRow,
Tooltip, Tooltip,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import { PencilAltIcon } from '@patternfly/react-icons'; import { PencilAltIcon } from '@patternfly/react-icons';
import HostToggle from '@components/HostToggle'; import HostToggle from '@components/HostToggle';
import Sparkline from '@components/Sparkline'; import Sparkline from '@components/Sparkline';

View File

@@ -7,13 +7,14 @@ import { Group } from '@types';
import { import {
Button, Button,
DataListAction, DataListAction,
DataListCell,
DataListCheck, DataListCheck,
DataListItem, DataListItem,
DataListItemCells, DataListItemCells,
DataListItemRow, DataListItemRow,
Tooltip, Tooltip,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { PencilAltIcon } from '@patternfly/react-icons'; import { PencilAltIcon } from '@patternfly/react-icons';

View File

@@ -5,13 +5,14 @@ import { t } from '@lingui/macro';
import { import {
Button, Button,
DataListAction as _DataListAction, DataListAction as _DataListAction,
DataListCell,
DataListCheck, DataListCheck,
DataListItem, DataListItem,
DataListItemCells, DataListItemCells,
DataListItemRow, DataListItemRow,
Tooltip, Tooltip,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { PencilAltIcon } from '@patternfly/react-icons'; import { PencilAltIcon } from '@patternfly/react-icons';
import HostToggle from '@components/HostToggle'; import HostToggle from '@components/HostToggle';

View File

@@ -4,13 +4,14 @@ import { withI18n } from '@lingui/react';
import { import {
Button, Button,
DataListAction as _DataListAction, DataListAction as _DataListAction,
DataListCell,
DataListCheck, DataListCheck,
DataListItem, DataListItem,
DataListItemCells, DataListItemCells,
DataListItemRow, DataListItemRow,
Tooltip, Tooltip,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import { t } from '@lingui/macro'; import { t } from '@lingui/macro';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import styled from 'styled-components'; import styled from 'styled-components';

View File

@@ -6,13 +6,14 @@ import {
Badge as PFBadge, Badge as PFBadge,
Button, Button,
DataListAction as _DataListAction, DataListAction as _DataListAction,
DataListCell,
DataListCheck, DataListCheck,
DataListItem, DataListItem,
DataListItemCells, DataListItemCells,
DataListItemRow, DataListItemRow,
Tooltip, Tooltip,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import styled from 'styled-components'; import styled from 'styled-components';
import { PencilAltIcon } from '@patternfly/react-icons'; import { PencilAltIcon } from '@patternfly/react-icons';

View File

@@ -3,13 +3,14 @@ import { Link } from 'react-router-dom';
import { import {
Button, Button,
DataListAction as _DataListAction, DataListAction as _DataListAction,
DataListCell,
DataListCheck, DataListCheck,
DataListItem, DataListItem,
DataListItemRow, DataListItemRow,
DataListItemCells, DataListItemCells,
Tooltip, Tooltip,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import { t } from '@lingui/macro'; import { t } from '@lingui/macro';
import { withI18n } from '@lingui/react'; import { withI18n } from '@lingui/react';
import { import {

View File

@@ -4,13 +4,14 @@ import { withI18n } from '@lingui/react';
import { import {
Button, Button,
DataListAction as _DataListAction, DataListAction as _DataListAction,
DataListCell,
DataListCheck, DataListCheck,
DataListItem, DataListItem,
DataListItemRow, DataListItemRow,
DataListItemCells, DataListItemCells,
Tooltip, Tooltip,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import { t } from '@lingui/macro'; import { t } from '@lingui/macro';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { PencilAltIcon, SyncIcon } from '@patternfly/react-icons'; import { PencilAltIcon, SyncIcon } from '@patternfly/react-icons';

View File

@@ -5,13 +5,14 @@ import { t } from '@lingui/macro';
import { import {
Button, Button,
DataListAction as _DataListAction, DataListAction as _DataListAction,
DataListCell,
DataListCheck, DataListCheck,
DataListItem, DataListItem,
DataListItemCells, DataListItemCells,
DataListItemRow, DataListItemRow,
Tooltip, Tooltip,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import styled from 'styled-components'; import styled from 'styled-components';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { PencilAltIcon } from '@patternfly/react-icons'; import { PencilAltIcon } from '@patternfly/react-icons';

View File

@@ -9,10 +9,10 @@ import {
DataListItemCells, DataListItemCells,
DataListItemRow, DataListItemRow,
DataListItem, DataListItem,
DataListCell,
Stack, Stack,
StackItem, StackItem,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import { CaretDownIcon, CaretUpIcon } from '@patternfly/react-icons'; import { CaretDownIcon, CaretUpIcon } from '@patternfly/react-icons';
import styled from 'styled-components'; import styled from 'styled-components';

View File

@@ -3,13 +3,14 @@ import { Link } from 'react-router-dom';
import { import {
Button, Button,
DataListAction as _DataListAction, DataListAction as _DataListAction,
DataListCell,
DataListCheck, DataListCheck,
DataListItem, DataListItem,
DataListItemRow, DataListItemRow,
DataListItemCells, DataListItemCells,
Tooltip, Tooltip,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import { t } from '@lingui/macro'; import { t } from '@lingui/macro';
import { withI18n } from '@lingui/react'; import { withI18n } from '@lingui/react';
import { import {

View File

@@ -5,13 +5,14 @@ import { t } from '@lingui/macro';
import { import {
Button, Button,
DataListAction, DataListAction,
DataListCell,
DataListCheck, DataListCheck,
DataListItem, DataListItem,
DataListItemCells, DataListItemCells,
DataListItemRow, DataListItemRow,
Tooltip, Tooltip,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { PencilAltIcon } from '@patternfly/react-icons'; import { PencilAltIcon } from '@patternfly/react-icons';

View File

@@ -0,0 +1,33 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { withI18n } from '@lingui/react';
import { t } from '@lingui/macro';
import {
DataListItemCells,
DataListItemRow,
DataListItem,
} from '@patternfly/react-core';
import DataListCell from '@components/DataListCell';
function UserOrganizationListItem({ organization, i18n }) {
return (
<DataListItem aria-labelledby={i18n._(t`User Organization List Item`)}>
<DataListItemRow>
<DataListItemCells
dataListCells={[
<DataListCell key={organization.id}>
<Link to={`/organizations/${organization.id}/details`}>
{organization.name}
</Link>
</DataListCell>,
<DataListCell key={organization.description}>
{organization.description}
</DataListCell>,
]}
/>
</DataListItemRow>
</DataListItem>
);
}
export default withI18n()(UserOrganizationListItem);