Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const AnsiblePermissionDenied = props => {

return (
<EmptyState
iconType="fa"
icon="lock"
header={__('Permission Denied')}
description={description}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ const noop = () => {};
const fixtures = {
'should render a role to add': {
role: { name: 'test.role', id: 5 },
icon: 'fa fa-plus-circle',
icon: 'plus-circle',
onClick: noop,
index: 0,
},
'should render a role to remove': {
role: { name: 'test.role', id: 5 },
icon: 'fa fa-minus-circle',
icon: 'minus-circle',
onClick: noop,
index: 0,
},
'should render inherited role to remove': {
role: { name: 'test.role', id: 5, inherited: true },
icon: 'fa fa-minus-circle',
icon: 'minus-circle',
onClick: noop,
index: 0,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
import React from 'react';
import PropTypes from 'prop-types';

import { Icon } from 'patternfly-react';
import { Icon } from '@patternfly/react-core';
import { PlusCircleIcon, MinusCircleIcon } from '@patternfly/react-icons';

const AnsibleRoleActionButton = ({ icon }) => (
<button href="#" className="role-add-remove-btn">
<Icon className="fa-2x" type="fa" name={icon} />
</button>
);
const iconMap = {
'plus-circle': PlusCircleIcon,
'minus-circle': MinusCircleIcon,
};

const AnsibleRoleActionButton = ({ icon }) => {
const IconComponent = iconMap[icon] || PlusCircleIcon;

return (
<button href="#" className="role-add-remove-btn">
<Icon size="2xl">
<IconComponent />
</Icon>
</button>
);
};

AnsibleRoleActionButton.propTypes = {
icon: PropTypes.string.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const AssignedRolesList = ({
key={role.id}
role={role}
index={idx}
icon="fa fa-minus-circle"
icon="minus-circle"
onClick={onRemoveRole}
resourceName={resourceName}
/>
Expand All @@ -54,7 +54,7 @@ const AssignedRolesList = ({
role={role}
index={idx}
moveValue={moveValue}
icon="fa fa-minus-circle"
icon="minus-circle"
onClick={onRemoveRole}
resourceName={resourceName}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const AvailableRolesList = ({
<AnsibleRole
key={role.id}
role={role}
icon="fa fa-plus-circle"
icon="plus-circle"
onClick={onAddRole}
index={index}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exports[`AnsiblePermissionDenied should render 1`] = `
}
header="Permission Denied"
icon="lock"
iconType="fa"
secondaryActions={Array []}
variant="xl"
/>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`AnsibleRole should render a role to add 1`] = `
<ListViewItem
actions={
<AnsibleRoleActionButton
icon="fa fa-plus-circle"
icon="plus-circle"
role={
Object {
"id": 5,
Expand Down Expand Up @@ -36,7 +36,7 @@ exports[`AnsibleRole should render a role to remove 1`] = `
<ListViewItem
actions={
<AnsibleRoleActionButton
icon="fa fa-minus-circle"
icon="minus-circle"
role={
Object {
"id": 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`AssignedRolesList should render 1`] = `
className=""
>
<DropTarget(DragSource(Orderable(AnsibleRole)))
icon="fa fa-minus-circle"
icon="minus-circle"
index={0}
key="1"
moveValue={[Function]}
Expand All @@ -22,7 +22,7 @@ exports[`AssignedRolesList should render 1`] = `
}
/>
<DropTarget(DragSource(Orderable(AnsibleRole)))
icon="fa fa-minus-circle"
icon="minus-circle"
index={1}
key="2"
moveValue={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports[`AvailableRolesList should render 1`] = `
timeout={300}
>
<AnsibleRole
icon="fa fa-plus-circle"
icon="plus-circle"
index={0}
key="1"
onClick={[Function]}
Expand All @@ -41,7 +41,7 @@ exports[`AvailableRolesList should render 1`] = `
}
/>
<AnsibleRole
icon="fa fa-plus-circle"
icon="plus-circle"
index={1}
key="2"
onClick={[Function]}
Expand Down
Loading