Skip to content

Commit

Permalink
refactor(buttons): discovery-149 scans,credentials pf buttons (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
jenny-s51 authored and cdcabrera committed Sep 20, 2022
1 parent b917eb0 commit 637464c
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 133 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,14 @@ exports[`CredentialListItem Component should render a non-connected component: n
placement="top"
>
<Button
active={false}
block={false}
bsClass="btn"
bsStyle="link"
disabled={false}
className="quipucords-view__row-button"
onClick={[Function]}
variant="plain"
>
<Icon
name="eye"
type="fa"
<EyeIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
/>
</Button>
</Tooltip>,
Expand All @@ -56,16 +54,14 @@ exports[`CredentialListItem Component should render a non-connected component: n
placement="top"
>
<Button
active={false}
block={false}
bsClass="btn"
bsStyle="link"
disabled={false}
className="quipucords-view__row-button"
onClick={[Function]}
variant="plain"
>
<Icon
name="delete"
type="pf"
<TrashIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
/>
</Button>
</Tooltip>,
Expand Down Expand Up @@ -170,16 +166,14 @@ exports[`CredentialListItem Component should render a non-connected component: n
placement="top"
>
<Button
active={false}
block={false}
bsClass="btn"
bsStyle="link"
disabled={false}
className="quipucords-view__row-button"
onClick={[Function]}
variant="plain"
>
<Icon
name="eye"
type="fa"
<EyeIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
/>
</Button>
</Tooltip>,
Expand All @@ -191,16 +185,14 @@ exports[`CredentialListItem Component should render a non-connected component: n
placement="top"
>
<Button
active={false}
block={false}
bsClass="btn"
bsStyle="link"
disabled={false}
className="quipucords-view__row-button"
onClick={[Function]}
variant="plain"
>
<Icon
name="delete"
type="pf"
<TrashIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
/>
</Button>
</Tooltip>,
Expand Down Expand Up @@ -395,16 +387,14 @@ exports[`CredentialListItem Component should render a non-connected component: n
}
trigger={
<Button
active={false}
block={false}
bsClass="btn"
bsStyle="link"
disabled={false}
className="quipucords-view__row-button"
onClick={[Function]}
variant="plain"
>
<Icon
name="eye"
type="fa"
<EyeIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
/>
</Button>
}
Expand All @@ -414,34 +404,54 @@ exports[`CredentialListItem Component should render a non-connected component: n
onFoundRef={[Function]}
>
<Button
active={false}
block={false}
bsClass="btn"
bsStyle="link"
disabled={false}
key="editButton"
className="quipucords-view__row-button"
onClick={[Function]}
variant="plain"
>
<button
className="btn btn-link"
disabled={false}
<ButtonBase
className="quipucords-view__row-button"
innerRef={null}
onClick={[Function]}
type="button"
variant="plain"
>
<Icon
name="eye"
type="fa"
<button
aria-disabled={false}
aria-label={null}
className="pf-c-button pf-m-plain quipucords-view__row-button"
data-ouia-component-id="OUIA-Generated-Button-plain-1"
data-ouia-component-type="PF4/Button"
data-ouia-safe={true}
disabled={false}
onClick={[Function]}
role={null}
type="button"
>
<FontAwesome
name="eye"
<EyeIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
>
<span
<svg
aria-hidden={true}
className="fa fa-eye"
/>
</FontAwesome>
</Icon>
</button>
aria-labelledby={null}
fill="currentColor"
height="1em"
role="img"
style={
Object {
"verticalAlign": "-0.125em",
}
}
viewBox="0 0 576 512"
width="1em"
>
<path
d="M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"
/>
</svg>
</EyeIcon>
</button>
</ButtonBase>
</Button>
</FindRefWrapper>
</Popper>
Expand Down Expand Up @@ -528,16 +538,14 @@ exports[`CredentialListItem Component should render a non-connected component: n
}
trigger={
<Button
active={false}
block={false}
bsClass="btn"
bsStyle="link"
disabled={false}
className="quipucords-view__row-button"
onClick={[Function]}
variant="plain"
>
<Icon
name="delete"
type="pf"
<TrashIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
/>
</Button>
}
Expand All @@ -547,35 +555,54 @@ exports[`CredentialListItem Component should render a non-connected component: n
onFoundRef={[Function]}
>
<Button
active={false}
block={false}
bsClass="btn"
bsStyle="link"
disabled={false}
key="removeButton"
className="quipucords-view__row-button"
onClick={[Function]}
variant="plain"
>
<button
className="btn btn-link"
disabled={false}
<ButtonBase
className="quipucords-view__row-button"
innerRef={null}
onClick={[Function]}
type="button"
variant="plain"
>
<Icon
name="delete"
type="pf"
<button
aria-disabled={false}
aria-label={null}
className="pf-c-button pf-m-plain quipucords-view__row-button"
data-ouia-component-id="OUIA-Generated-Button-plain-2"
data-ouia-component-type="PF4/Button"
data-ouia-safe={true}
disabled={false}
onClick={[Function]}
role={null}
type="button"
>
<PatternflyIcon
className=""
name="delete"
<TrashIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
>
<span
aria-hidden="true"
className="pficon pficon-delete"
/>
</PatternflyIcon>
</Icon>
</button>
<svg
aria-hidden={true}
aria-labelledby={null}
fill="currentColor"
height="1em"
role="img"
style={
Object {
"verticalAlign": "-0.125em",
}
}
viewBox="0 0 448 512"
width="1em"
>
<path
d="M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"
/>
</svg>
</TrashIcon>
</button>
</ButtonBase>
</Button>
</FindRefWrapper>
</Popper>
Expand Down
17 changes: 9 additions & 8 deletions src/components/credentials/credentialListItem.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import { ListView, Button, Icon, Checkbox } from 'patternfly-react';
import { List, ListItem } from '@patternfly/react-core';
import { ListView, Icon, Checkbox } from 'patternfly-react';
import { Button, ButtonVariant, List, ListItem } from '@patternfly/react-core';
import { EyeIcon, TrashIcon } from '@patternfly/react-icons';
import _find from 'lodash/find';
import _get from 'lodash/get';
import { connect, reduxTypes, store } from '../../redux';
Expand Down Expand Up @@ -74,24 +75,24 @@ class CredentialListItem extends React.Component {
return [
<Tooltip key="editButton" content="View Credential">
<Button
className="quipucords-view__row-button"
onClick={() => {
onEdit(item);
}}
bsStyle="link"
key="editButton"
variant={ButtonVariant.plain}
>
<Icon type="fa" name="eye" />
<EyeIcon />
</Button>
</Tooltip>,
<Tooltip key="deleteButton" content="Delete Credential">
<Button
className="quipucords-view__row-button"
onClick={() => {
onDelete(item);
}}
bsStyle="link"
key="removeButton"
variant={ButtonVariant.plain}
>
<Icon type="pf" name="delete" />
<TrashIcon />
</Button>
</Tooltip>
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,14 @@ exports[`ScanListItem Component should render a non-connected component: non-con
placement="top"
>
<Button
active={false}
block={false}
bsClass="btn"
bsStyle="link"
disabled={false}
aria-label="Start"
onClick={[Function]}
variant="plain"
>
<Icon
aria-label="Start"
name="spinner2"
type="pf"
<RedoIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
/>
</Button>
</Tooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,10 @@ exports[`Scans Component should render a non-connected component: non-connected
placement="top"
>
<Button
active={false}
block={false}
bsClass="btn"
bsStyle="default"
disabled={true}
id="merge-reports"
isDisabled={true}
onClick={[Function]}
variant="primary"
>
Merge reports
</Button>
Expand Down
Loading

0 comments on commit 637464c

Please sign in to comment.