upgrade to patternfly 2.x, pf/react-core 3.x (#184)

This commit is contained in:
Keith Grant
2019-04-30 08:19:19 -04:00
committed by GitHub
parent 6fe93f474f
commit ffade973a9
13 changed files with 1317 additions and 904 deletions

View File

@@ -29,10 +29,96 @@ exports[`<NotificationListItem canToggleNotifications /> initially renders succe
aria-labelledby="items-list-item-9000" aria-labelledby="items-list-item-9000"
className="pf-c-data-list__item" className="pf-c-data-list__item"
> >
<DataListCell <DataListItemRow
className="" className=""
key=".0" key=".0"
rowid="items-list-item-9000" rowid="items-list-item-9000"
>
<div
className="pf-c-data-list__item-row"
>
<DataListItemCells
className=""
dataListCells={
Array [
<DataListCell
alignRight={false}
className=""
isFilled={true}
isIcon={false}
width={1}
>
<Link
replace={false}
style={
Object {
"marginRight": "1.5em",
}
}
to={
Object {
"pathname": "/foo",
}
}
>
<b
id="items-list-item-9000"
>
Foo
</b>
</Link>
<Badge
className=""
isRead={true}
style={
Object {
"textTransform": "capitalize",
}
}
>
slack
</Badge>
</DataListCell>,
<DataListCell
alignRight={true}
className=""
isFilled={true}
isIcon={false}
width={1}
>
<Switch
aria-label="Toggle notification success"
className=""
id="notification-9000-success-toggle"
isChecked={false}
isDisabled={false}
label="Successful"
onChange={[Function]}
/>
<Switch
aria-label="Toggle notification failure"
className=""
id="notification-9000-error-toggle"
isChecked={false}
isDisabled={false}
label="Failure"
onChange={[Function]}
/>
</DataListCell>,
]
}
key=".0"
rowid="items-list-item-9000"
>
<div
className="pf-c-data-list__item-content"
>
<DataListCell
alignRight={false}
className=""
isFilled={true}
isIcon={false}
key="name"
width={1} width={1}
> >
<div <div
@@ -91,13 +177,13 @@ exports[`<NotificationListItem canToggleNotifications /> initially renders succe
<DataListCell <DataListCell
alignRight={true} alignRight={true}
className="" className=""
key=".1" isFilled={true}
rowid="items-list-item-9000" isIcon={false}
key="toggles"
width={1} width={1}
> >
<div <div
alignRight={true} className="pf-c-data-list__cell pf-m-align-right"
className="pf-c-data-list__cell"
> >
<Switch <Switch
aria-label="Toggle notification success" aria-label="Toggle notification success"
@@ -179,6 +265,10 @@ exports[`<NotificationListItem canToggleNotifications /> initially renders succe
</Switch> </Switch>
</div> </div>
</DataListCell> </DataListCell>
</div>
</DataListItemCells>
</div>
</DataListItemRow>
</li> </li>
</DataListItem> </DataListItem>
</I18n> </I18n>

View File

@@ -45,10 +45,117 @@ exports[`<OrganizationAccessItem /> initially renders succesfully 1`] = `
aria-labelledby="access-list-item" aria-labelledby="access-list-item"
className="pf-c-data-list__item" className="pf-c-data-list__item"
> >
<DataListCell <DataListItemRow
className="" className=""
key=".0" key=".0"
rowid="access-list-item" rowid="access-list-item"
>
<div
className="pf-c-data-list__item-row"
>
<DataListItemCells
className=""
dataListCells={
Array [
<DataListCell
alignRight={false}
className=""
isFilled={true}
isIcon={false}
width={1}
>
<TextContent
className=""
style={
Object {
"display": "grid",
"gridTemplateColumns": "minmax(70px, max-content) minmax(60px, max-content)",
}
}
>
<Link
replace={false}
to={
Object {
"pathname": "/bar",
}
}
>
<Text
className=""
component="h6"
style={
Object {
"fontWeight": "700",
"lineHeight": "24px",
"marginRight": "20px",
}
}
>
jane
</Text>
</Link>
</TextContent>
<Detail
customStyles={null}
label="Name"
url={null}
value="jane brown"
/>
</DataListCell>,
<DataListCell
alignRight={false}
className=""
isFilled={true}
isIcon={false}
width={1}
>
<ul
style={
Object {
"display": "flex",
"flexWrap": "wrap",
}
}
>
<Text
className=""
component="h6"
style={
Object {
"fontWeight": "700",
"lineHeight": "24px",
"marginRight": "20px",
}
}
>
Team Roles
</Text>
<Chip
className="awx-c-chip"
closeBtnAriaLabel="close"
isOverflowChip={false}
onClick={[Function]}
tooltipPosition="top"
>
Member
</Chip>
</ul>
</DataListCell>,
]
}
key=".0"
rowid="access-list-item"
>
<div
className="pf-c-data-list__item-content"
>
<DataListCell
alignRight={false}
className=""
isFilled={true}
isIcon={false}
key="name"
width={1} width={1}
> >
<div <div
@@ -190,9 +297,11 @@ exports[`<OrganizationAccessItem /> initially renders succesfully 1`] = `
</div> </div>
</DataListCell> </DataListCell>
<DataListCell <DataListCell
alignRight={false}
className="" className=""
key=".1" isFilled={true}
rowid="access-list-item" isIcon={false}
key="roles"
width={1} width={1}
> >
<div <div
@@ -319,6 +428,10 @@ exports[`<OrganizationAccessItem /> initially renders succesfully 1`] = `
</ul> </ul>
</div> </div>
</DataListCell> </DataListCell>
</div>
</DataListItemCells>
</div>
</DataListItemRow>
</li> </li>
</DataListItem> </DataListItem>
</I18n> </I18n>

View File

@@ -2,14 +2,16 @@ import React from 'react';
import { mountWithContexts } from '../../../../enzymeHelpers'; import { mountWithContexts } from '../../../../enzymeHelpers';
import Organization from '../../../../../src/pages/Organizations/screens/Organization/Organization'; import Organization from '../../../../../src/pages/Organizations/screens/Organization/Organization';
describe('<OrganizationView />', () => { describe.only('<Organization />', () => {
const me = { const me = {
is_super_user: true, is_super_user: true,
is_system_auditor: false is_system_auditor: false
}; };
test('initially renders succesfully', () => { test('initially renders succesfully', () => {
mountWithContexts(<Organization me={me} />); mountWithContexts(<Organization me={me} />);
}); });
test('notifications tab shown/hidden based on permissions', () => { test('notifications tab shown/hidden based on permissions', () => {
const wrapper = mountWithContexts(<Organization me={me} />); const wrapper = mountWithContexts(<Organization me={me} />);
expect(wrapper.find('.pf-c-tabs__item').length).toBe(3); expect(wrapper.find('.pf-c-tabs__item').length).toBe(3);
@@ -18,6 +20,6 @@ describe('<OrganizationView />', () => {
isNotifAdmin: true isNotifAdmin: true
}); });
expect(wrapper.find('.pf-c-tabs__item').length).toBe(4); expect(wrapper.find('.pf-c-tabs__item').length).toBe(4);
expect(wrapper.find('.pf-c-tabs__button[children="Notifications"]').length).toBe(1); expect(wrapper.find('button.pf-c-tabs__button[children="Notifications"]').length).toBe(1);
}); });
}); });

View File

@@ -71,9 +71,9 @@ describe('<OrganizationAccess />', () => {
}; };
}); });
test.only('initially renders succesfully', () => { test('initially renders succesfully', () => {
const wrapper = mountWithContexts( const wrapper = mountWithContexts(
<OrganizationAccess id={1} organization={organization} />, <OrganizationAccess organization={organization} />,
{ context: { network } } { context: { network } }
); );
expect(wrapper.find('OrganizationAccess')).toMatchSnapshot(); expect(wrapper.find('OrganizationAccess')).toMatchSnapshot();
@@ -81,7 +81,7 @@ describe('<OrganizationAccess />', () => {
test('should fetch and display access records on mount', async () => { test('should fetch and display access records on mount', async () => {
const wrapper = mountWithContexts( const wrapper = mountWithContexts(
<OrganizationAccess id={1} />, <OrganizationAccess organization={organization} />,
{ context: { network } } { context: { network } }
); );
await sleep(0); await sleep(0);
@@ -94,7 +94,7 @@ describe('<OrganizationAccess />', () => {
test('should open confirmation dialog when deleting role', async () => { test('should open confirmation dialog when deleting role', async () => {
const wrapper = mountWithContexts( const wrapper = mountWithContexts(
<OrganizationAccess id={1} />, <OrganizationAccess organization={organization} />,
{ context: { network } } { context: { network } }
); );
await sleep(0); await sleep(0);
@@ -114,7 +114,7 @@ describe('<OrganizationAccess />', () => {
it('should close dialog when cancel button clicked', async () => { it('should close dialog when cancel button clicked', async () => {
const wrapper = mountWithContexts( const wrapper = mountWithContexts(
<OrganizationAccess id={1} />, <OrganizationAccess organization={organization} />,
{ context: { network } } { context: { network } }
); );
await sleep(0); await sleep(0);
@@ -133,7 +133,7 @@ describe('<OrganizationAccess />', () => {
it('should delete user role', async () => { it('should delete user role', async () => {
const wrapper = mountWithContexts( const wrapper = mountWithContexts(
<OrganizationAccess id={1} />, <OrganizationAccess organization={organization} />,
{ context: { network } } { context: { network } }
); );
await sleep(0); await sleep(0);
@@ -156,7 +156,7 @@ describe('<OrganizationAccess />', () => {
it('should delete team role', async () => { it('should delete team role', async () => {
const wrapper = mountWithContexts( const wrapper = mountWithContexts(
<OrganizationAccess id={1} />, <OrganizationAccess organization={organization} />,
{ context: { network } } { context: { network } }
); );
await sleep(0); await sleep(0);

View File

@@ -5,7 +5,6 @@ exports[`<OrganizationAccess /> initially renders succesfully 1`] = `
api={"/api/"} api={"/api/"}
handleHttpError={[Function]} handleHttpError={[Function]}
history={"/history/"} history={"/history/"}
id={1}
location={ location={
Object { Object {
"hash": "", "hash": "",

View File

@@ -666,10 +666,96 @@ exports[`<OrganizationNotifications /> initially renders succesfully 1`] = `
aria-labelledby="items-list-item-1" aria-labelledby="items-list-item-1"
className="pf-c-data-list__item" className="pf-c-data-list__item"
> >
<DataListCell <DataListItemRow
className="" className=""
key=".0" key=".0"
rowid="items-list-item-1" rowid="items-list-item-1"
>
<div
className="pf-c-data-list__item-row"
>
<DataListItemCells
className=""
dataListCells={
Array [
<DataListCell
alignRight={false}
className=""
isFilled={true}
isIcon={false}
width={1}
>
<Link
replace={false}
style={
Object {
"marginRight": "1.5em",
}
}
to={
Object {
"pathname": "/notifications/1",
}
}
>
<b
id="items-list-item-1"
>
Notification one
</b>
</Link>
<Badge
className=""
isRead={true}
style={
Object {
"textTransform": "capitalize",
}
}
>
email
</Badge>
</DataListCell>,
<DataListCell
alignRight={true}
className=""
isFilled={true}
isIcon={false}
width={1}
>
<Switch
aria-label="Toggle notification success"
className=""
id="notification-1-success-toggle"
isChecked={true}
isDisabled={false}
label="Successful"
onChange={[Function]}
/>
<Switch
aria-label="Toggle notification failure"
className=""
id="notification-1-error-toggle"
isChecked={false}
isDisabled={false}
label="Failure"
onChange={[Function]}
/>
</DataListCell>,
]
}
key=".0"
rowid="items-list-item-1"
>
<div
className="pf-c-data-list__item-content"
>
<DataListCell
alignRight={false}
className=""
isFilled={true}
isIcon={false}
key="name"
width={1} width={1}
> >
<div <div
@@ -728,13 +814,13 @@ exports[`<OrganizationNotifications /> initially renders succesfully 1`] = `
<DataListCell <DataListCell
alignRight={true} alignRight={true}
className="" className=""
key=".1" isFilled={true}
rowid="items-list-item-1" isIcon={false}
key="toggles"
width={1} width={1}
> >
<div <div
alignRight={true} className="pf-c-data-list__cell pf-m-align-right"
className="pf-c-data-list__cell"
> >
<Switch <Switch
aria-label="Toggle notification success" aria-label="Toggle notification success"
@@ -816,6 +902,10 @@ exports[`<OrganizationNotifications /> initially renders succesfully 1`] = `
</Switch> </Switch>
</div> </div>
</DataListCell> </DataListCell>
</div>
</DataListItemCells>
</div>
</DataListItemRow>
</li> </li>
</DataListItem> </DataListItem>
</I18n> </I18n>
@@ -850,10 +940,96 @@ exports[`<OrganizationNotifications /> initially renders succesfully 1`] = `
aria-labelledby="items-list-item-2" aria-labelledby="items-list-item-2"
className="pf-c-data-list__item" className="pf-c-data-list__item"
> >
<DataListCell <DataListItemRow
className="" className=""
key=".0" key=".0"
rowid="items-list-item-2" rowid="items-list-item-2"
>
<div
className="pf-c-data-list__item-row"
>
<DataListItemCells
className=""
dataListCells={
Array [
<DataListCell
alignRight={false}
className=""
isFilled={true}
isIcon={false}
width={1}
>
<Link
replace={false}
style={
Object {
"marginRight": "1.5em",
}
}
to={
Object {
"pathname": "/notifications/2",
}
}
>
<b
id="items-list-item-2"
>
Notification two
</b>
</Link>
<Badge
className=""
isRead={true}
style={
Object {
"textTransform": "capitalize",
}
}
>
email
</Badge>
</DataListCell>,
<DataListCell
alignRight={true}
className=""
isFilled={true}
isIcon={false}
width={1}
>
<Switch
aria-label="Toggle notification success"
className=""
id="notification-2-success-toggle"
isChecked={false}
isDisabled={false}
label="Successful"
onChange={[Function]}
/>
<Switch
aria-label="Toggle notification failure"
className=""
id="notification-2-error-toggle"
isChecked={true}
isDisabled={false}
label="Failure"
onChange={[Function]}
/>
</DataListCell>,
]
}
key=".0"
rowid="items-list-item-2"
>
<div
className="pf-c-data-list__item-content"
>
<DataListCell
alignRight={false}
className=""
isFilled={true}
isIcon={false}
key="name"
width={1} width={1}
> >
<div <div
@@ -912,13 +1088,13 @@ exports[`<OrganizationNotifications /> initially renders succesfully 1`] = `
<DataListCell <DataListCell
alignRight={true} alignRight={true}
className="" className=""
key=".1" isFilled={true}
rowid="items-list-item-2" isIcon={false}
key="toggles"
width={1} width={1}
> >
<div <div
alignRight={true} className="pf-c-data-list__cell pf-m-align-right"
className="pf-c-data-list__cell"
> >
<Switch <Switch
aria-label="Toggle notification success" aria-label="Toggle notification success"
@@ -1000,6 +1176,10 @@ exports[`<OrganizationNotifications /> initially renders succesfully 1`] = `
</Switch> </Switch>
</div> </div>
</DataListCell> </DataListCell>
</div>
</DataListItemCells>
</div>
</DataListItemRow>
</li> </li>
</DataListItem> </DataListItem>
</I18n> </I18n>

101
package-lock.json generated
View File

@@ -1748,18 +1748,18 @@
} }
}, },
"@patternfly/patternfly": { "@patternfly/patternfly": {
"version": "1.0.248", "version": "2.6.5",
"resolved": "https://registry.npmjs.org/@patternfly/patternfly/-/patternfly-1.0.248.tgz", "resolved": "https://registry.npmjs.org/@patternfly/patternfly/-/patternfly-2.6.5.tgz",
"integrity": "sha512-x+fz3cP0nyFsK0ZRt1H58ESZxoy4wKqqb2uhyaNIg5jC3x5KC0PCr0gfUmBvNOiHnOePmc+ZC5nWcAOKN9tGBA==" "integrity": "sha512-L0k+ea2N679ytQwTqYJ7RewVDx6FDpm9burtHgD8fhcIN0UJJo7v2IkhLya2WzH2/O7L7TiF45lb/ZVoFVckDA=="
}, },
"@patternfly/react-core": { "@patternfly/react-core": {
"version": "2.9.2", "version": "3.2.6",
"resolved": "https://registry.npmjs.org/@patternfly/react-core/-/react-core-2.9.2.tgz", "resolved": "https://registry.npmjs.org/@patternfly/react-core/-/react-core-3.2.6.tgz",
"integrity": "sha512-v93pAA9dXTzsgFeR8W4+fg0kC0joB4BISFoSqzb22+/cNvSnEypC/DjBN4pOUEoBvsFC/JI8FotQoj9ZAx3GAw==", "integrity": "sha512-58GBM8SfhoggQldGArUR3LwvcMe+GaW/uTjB1/a3RTG6HXTfFfs33UXnQnN2IgWZmHOyxpjnWq2yEh5xwJs5HQ==",
"requires": { "requires": {
"@patternfly/react-icons": "^3.6.1", "@patternfly/react-icons": "^3.7.4",
"@patternfly/react-styles": "^2.4.0", "@patternfly/react-styles": "^3.0.2",
"@patternfly/react-tokens": "^2.2.1", "@patternfly/react-tokens": "^2.3.3",
"@tippy.js/react": "^1.1.1", "@tippy.js/react": "^1.1.1",
"emotion": "^9.2.9", "emotion": "^9.2.9",
"exenv": "^1.2.2", "exenv": "^1.2.2",
@@ -1767,26 +1767,26 @@
}, },
"dependencies": { "dependencies": {
"@patternfly/react-icons": { "@patternfly/react-icons": {
"version": "3.6.1", "version": "3.7.5",
"resolved": "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-3.6.1.tgz", "resolved": "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-3.7.5.tgz",
"integrity": "sha512-7PkP7NC3sDmsFAnQIGl+9p14vgx7gj0TZSwtL1ABkAEV9tXcEjWsyyZP2fahfTKVE9aPrOZ/YINsr8+iGCOTnA==" "integrity": "sha512-Bejd6GAWfcDgA7YxvIcrohcBPVZUG34E3LWaJSHLUf8XADf33q7UvQ4YQ1eWk477o/GjZA3AX/71Y6op71WdDA=="
}, },
"@patternfly/react-tokens": { "@patternfly/react-tokens": {
"version": "2.2.1", "version": "2.3.3",
"resolved": "https://registry.npmjs.org/@patternfly/react-tokens/-/react-tokens-2.2.1.tgz", "resolved": "https://registry.npmjs.org/@patternfly/react-tokens/-/react-tokens-2.3.3.tgz",
"integrity": "sha512-DVGrHRPpNvIhS9ekn7lqvXdHHAbkCawwfc8hRCuGvGS2Z6O45u1JFTyKWTyvW9b94pigaDTArtMlp++k5o1Xpw==" "integrity": "sha512-+2SSGvOV1rZr1l6+p2QzORVJhpOKjrHqCBfkp10La7O93+mVLYU0vugTp1elhxeh32IuLCJAPDLrCJPBAfmYKw=="
} }
} }
}, },
"@patternfly/react-icons": { "@patternfly/react-icons": {
"version": "3.6.1", "version": "3.7.5",
"resolved": "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-3.6.1.tgz", "resolved": "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-3.7.5.tgz",
"integrity": "sha512-7PkP7NC3sDmsFAnQIGl+9p14vgx7gj0TZSwtL1ABkAEV9tXcEjWsyyZP2fahfTKVE9aPrOZ/YINsr8+iGCOTnA==" "integrity": "sha512-Bejd6GAWfcDgA7YxvIcrohcBPVZUG34E3LWaJSHLUf8XADf33q7UvQ4YQ1eWk477o/GjZA3AX/71Y6op71WdDA=="
}, },
"@patternfly/react-styles": { "@patternfly/react-styles": {
"version": "2.4.0", "version": "3.0.2",
"resolved": "https://registry.npmjs.org/@patternfly/react-styles/-/react-styles-2.4.0.tgz", "resolved": "https://registry.npmjs.org/@patternfly/react-styles/-/react-styles-3.0.2.tgz",
"integrity": "sha512-BJQtg4zjj5Gw6OixHu2MGiT2T3vFTvyiGSXPQ+wk+vqR/wl0Y7/OOGNqI3fGYm1ON4q2ySOlGuJdHF+1NLbVyA==", "integrity": "sha512-JiGxDkC4JArQJ13RQOjSUE4jPmwrAq8f5E+qg0tVws1A9BQ2l3uGCRFMVbfa57qqjqk0jXNmIVdFSeCG18qwJQ==",
"requires": { "requires": {
"@babel/helper-plugin-utils": "^7.0.0-beta.48", "@babel/helper-plugin-utils": "^7.0.0-beta.48",
"camel-case": "^3.0.0", "camel-case": "^3.0.0",
@@ -1803,9 +1803,9 @@
} }
}, },
"@patternfly/react-tokens": { "@patternfly/react-tokens": {
"version": "2.2.1", "version": "2.3.3",
"resolved": "https://registry.npmjs.org/@patternfly/react-tokens/-/react-tokens-2.2.1.tgz", "resolved": "https://registry.npmjs.org/@patternfly/react-tokens/-/react-tokens-2.3.3.tgz",
"integrity": "sha512-DVGrHRPpNvIhS9ekn7lqvXdHHAbkCawwfc8hRCuGvGS2Z6O45u1JFTyKWTyvW9b94pigaDTArtMlp++k5o1Xpw==" "integrity": "sha512-+2SSGvOV1rZr1l6+p2QzORVJhpOKjrHqCBfkp10La7O93+mVLYU0vugTp1elhxeh32IuLCJAPDLrCJPBAfmYKw=="
}, },
"@tippy.js/react": { "@tippy.js/react": {
"version": "1.1.1", "version": "1.1.1",
@@ -4988,9 +4988,9 @@
} }
}, },
"csstype": { "csstype": {
"version": "2.6.3", "version": "2.6.4",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.3.tgz", "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.4.tgz",
"integrity": "sha512-rINUZXOkcBmoHWEyu7JdHu5JMzkGRoMX4ov9830WNgxf5UYxcBUO0QTKAqeJ5EZfSdlrcJYkC8WwfVW7JYi4yg==" "integrity": "sha512-lAJUJP3M6HxFXbqtGRc0iZrdyeN+WzOWeY0q/VnFzI+kqVrYIzC7bWlKqCW7oCIdzoPkvfp82EVvrTlQ8zsWQg=="
}, },
"currently-unhandled": { "currently-unhandled": {
"version": "0.4.1", "version": "0.4.1",
@@ -7027,8 +7027,7 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@@ -7049,14 +7048,12 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@@ -7071,20 +7068,17 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@@ -7201,8 +7195,7 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@@ -7214,7 +7207,6 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@@ -7229,7 +7221,6 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@@ -7237,14 +7228,12 @@
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@@ -7263,7 +7252,6 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@@ -7344,8 +7332,7 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@@ -7357,7 +7344,6 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@@ -7443,8 +7429,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@@ -7480,7 +7465,6 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@@ -7500,7 +7484,6 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@@ -7544,14 +7527,12 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
} }
} }
}, },
@@ -12539,9 +12520,9 @@
"dev": true "dev": true
}, },
"popper.js": { "popper.js": {
"version": "1.14.7", "version": "1.15.0",
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.14.7.tgz", "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.15.0.tgz",
"integrity": "sha512-4q1hNvoUre/8srWsH7hnoSJ5xVmIL4qgz+s4qf2TnJIMyZFUFMGH+9vE7mXynAlHSZ/NdTmmow86muD0myUkVQ==" "integrity": "sha512-w010cY1oCUmI+9KwwlWki+r5jxKfTFDVoadl7MSrIujHU5MJ5OR6HTDj6Xo8aoR/QsA56x8jKjA59qGH4ELtrA=="
}, },
"portfinder": { "portfinder": {
"version": "1.0.20", "version": "1.0.20",

View File

@@ -50,10 +50,10 @@
}, },
"dependencies": { "dependencies": {
"@lingui/react": "^2.7.2", "@lingui/react": "^2.7.2",
"@patternfly/patternfly": "^1.0.248", "@patternfly/patternfly": "^2.6.5",
"@patternfly/react-core": "^2.9.2", "@patternfly/react-core": "^3.2.6",
"@patternfly/react-icons": "^3.6.1", "@patternfly/react-icons": "^3.7.5",
"@patternfly/react-tokens": "^2.2.1", "@patternfly/react-tokens": "^2.3.3",
"axios": "^0.18.0", "axios": "^0.18.0",
"formik": "^1.5.1", "formik": "^1.5.1",
"prop-types": "^15.6.2", "prop-types": "^15.6.2",

View File

@@ -88,16 +88,27 @@
} }
} }
.pf-c-data-list__item-row {
--pf-c-data-list__item-row--PaddingRight: 20px;
--pf-c-data-list__item-row--PaddingLeft: 20px;
}
.pf-c-data-list__item-content {
--pf-c-data-list__item-content--PaddingBottom: 16px;
}
.pf-c-data-list__item-control {
--pf-c-data-list__item-control--PaddingTop: 16px;
--pf-c-data-list__item-control--MarginRight: 8px;
}
.pf-c-data-list__item { .pf-c-data-list__item {
--pf-c-data-list__item--PaddingLeft: 20px; --pf-c-data-list__item--PaddingLeft: 20px;
--pf-c-data-list__item--PaddingRight: 20px; --pf-c-data-list__item--PaddingRight: 20px;
align-items: center;
} }
.pf-c-data-list__cell { .pf-c-data-list__cell {
--pf-c-data-list__cell--PaddingTop: 16px; --pf-c-data-list__cell--PaddingTop: 16px;
--pf-c-data-list__cell--PaddingBottom: 16px;
--pf-c-data-list__cell-cell--PaddingTop: 16px; --pf-c-data-list__cell-cell--PaddingTop: 16px;
.awx-c-list-group { .awx-c-list-group {
@@ -111,6 +122,11 @@
margin-left: 10px; margin-left: 10px;
} }
} }
&.pf-c-data-list__cell--divider {
flex-grow: 0;
margin-right: 0;
}
} }
// //

View File

@@ -3,7 +3,14 @@ import { shape, number, string, bool, func } from 'prop-types';
import { I18n } from '@lingui/react'; import { I18n } from '@lingui/react';
import { t } from '@lingui/macro'; import { t } from '@lingui/macro';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { Badge, Switch, DataListItem, DataListCell } from '@patternfly/react-core'; import {
Badge,
Switch,
DataListItem,
DataListItemRow,
DataListItemCells,
DataListCell,
} from '@patternfly/react-core';
function NotificationListItem (props) { function NotificationListItem (props) {
const { const {
@@ -25,7 +32,9 @@ function NotificationListItem (props) {
aria-labelledby={`items-list-item-${notification.id}`} aria-labelledby={`items-list-item-${notification.id}`}
key={notification.id} key={notification.id}
> >
<DataListCell> <DataListItemRow>
<DataListItemCells dataListCells={[
<DataListCell key="name">
<Link <Link
to={{ to={{
pathname: detailUrl pathname: detailUrl
@@ -40,8 +49,8 @@ function NotificationListItem (props) {
> >
{notification.notification_type} {notification.notification_type}
</Badge> </Badge>
</DataListCell> </DataListCell>,
<DataListCell alignRight> <DataListCell key="toggles" alignRight>
<Switch <Switch
id={`notification-${notification.id}-success-toggle`} id={`notification-${notification.id}-success-toggle`}
label={i18n._(t`Successful`)} label={i18n._(t`Successful`)}
@@ -67,6 +76,9 @@ function NotificationListItem (props) {
aria-label={i18n._(t`Toggle notification failure`)} aria-label={i18n._(t`Toggle notification failure`)}
/> />
</DataListCell> </DataListCell>
]}
/>
</DataListItemRow>
</DataListItem> </DataListItem>
)} )}
</I18n> </I18n>

View File

@@ -3,6 +3,8 @@ import PropTypes, { arrayOf, shape, string, bool } from 'prop-types';
import { import {
DataList, DataList,
DataListItem, DataListItem,
DataListItemRow,
DataListItemCells,
DataListCell, DataListCell,
Text, Text,
TextContent, TextContent,
@@ -154,7 +156,9 @@ class PaginatedDataList extends React.Component {
aria-labelledby={`items-list-item-${item.id}`} aria-labelledby={`items-list-item-${item.id}`}
key={item.id} key={item.id}
> >
<DataListCell> <DataListItemRow>
<DataListItemCells dataListCells={[
<DataListCell key="team-name">
<TextContent style={detailWrapperStyle}> <TextContent style={detailWrapperStyle}>
<Link to={{ pathname: item.url }}> <Link to={{ pathname: item.url }}>
<Text <Text
@@ -169,6 +173,9 @@ class PaginatedDataList extends React.Component {
</Link> </Link>
</TextContent> </TextContent>
</DataListCell> </DataListCell>
]}
/>
</DataListItemRow>
</DataListItem> </DataListItem>
)))} )))}
</DataList> </DataList>

View File

@@ -4,6 +4,8 @@ import { I18n } from '@lingui/react';
import { t } from '@lingui/macro'; import { t } from '@lingui/macro';
import { import {
DataListItem, DataListItem,
DataListItemRow,
DataListItemCells,
DataListCell, DataListCell,
Text, Text,
TextContent, TextContent,
@@ -86,7 +88,9 @@ class OrganizationAccessItem extends React.Component {
<I18n> <I18n>
{({ i18n }) => ( {({ i18n }) => (
<DataListItem aria-labelledby="access-list-item" key={accessRecord.id}> <DataListItem aria-labelledby="access-list-item" key={accessRecord.id}>
<DataListCell> <DataListItemRow>
<DataListItemCells dataListCells={[
<DataListCell key="name">
{accessRecord.username && ( {accessRecord.username && (
<TextContent style={detailWrapperStyle}> <TextContent style={detailWrapperStyle}>
{accessRecord.url ? ( {accessRecord.url ? (
@@ -112,8 +116,8 @@ class OrganizationAccessItem extends React.Component {
) : ( ) : (
null null
)} )}
</DataListCell> </DataListCell>,
<DataListCell> <DataListCell key="roles">
{userRoles.length > 0 && ( {userRoles.length > 0 && (
<ul style={userRolesWrapperStyle}> <ul style={userRolesWrapperStyle}>
<Text component={TextVariants.h6} style={detailLabelStyle}> <Text component={TextVariants.h6} style={detailLabelStyle}>
@@ -159,6 +163,9 @@ class OrganizationAccessItem extends React.Component {
</ul> </ul>
)} )}
</DataListCell> </DataListCell>
]}
/>
</DataListItemRow>
</DataListItem> </DataListItem>
)} )}
</I18n> </I18n>

View File

@@ -1,9 +1,12 @@
import React from 'react'; import React from 'react';
import { I18n } from '@lingui/react'; import { Trans } from '@lingui/macro';
import { Trans, t } from '@lingui/macro';
import { import {
Badge, Badge,
Checkbox, DataListItem,
DataListItemRow,
DataListItemCells,
DataListCheck,
DataListCell,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import { import {
Link Link
@@ -22,29 +25,30 @@ class OrganizationListItem extends React.Component {
onSelect, onSelect,
detailUrl, detailUrl,
} = this.props; } = this.props;
const labelId = `check-action-${itemId}`;
return ( return (
<li key={itemId} className="pf-c-data-list__item" aria-labelledby="check-action-item1"> <DataListItem key={itemId} aria-labelledby={labelId}>
<I18n> <DataListItemRow>
{({ i18n }) => ( <DataListCheck
<Checkbox id={`select-organization-${itemId}`}
checked={isSelected} checked={isSelected}
onChange={onSelect} onChange={onSelect}
aria-label={i18n._(t`select organization ${itemId}`)} aria-labelledby={labelId}
id={`select-organization-${itemId}`}
/> />
)} <DataListItemCells dataListCells={[
</I18n> <DataListCell key="divider" className="pf-c-data-list__cell--divider">
<VerticalSeparator /> <VerticalSeparator />
<div className="pf-c-data-list__cell"> </DataListCell>,
<span id="check-action-item1"> <DataListCell key="org-name">
<span id={labelId}>
<Link <Link
to={`${detailUrl}`} to={`${detailUrl}`}
> >
<b>{name}</b> <b>{name}</b>
</Link> </Link>
</span> </span>
</div> </DataListCell>,
<div className="pf-c-data-list__cell"> <DataListCell key="org-members">
<span className="awx-c-list-group"> <span className="awx-c-list-group">
<Trans>Members</Trans> <Trans>Members</Trans>
<Badge className="awx-c-list-group--badge" isRead> <Badge className="awx-c-list-group--badge" isRead>
@@ -57,9 +61,11 @@ class OrganizationListItem extends React.Component {
{teamCount} {teamCount}
</Badge> </Badge>
</span> </span>
</div> </DataListCell>
<div className="pf-c-data-list__cell" /> ]}
</li> />
</DataListItemRow>
</DataListItem>
); );
} }
} }