From f2d47223d3bd8429a5d9e4fceadd16db9c4c8d1e Mon Sep 17 00:00:00 2001 From: redallen Date: Tue, 26 Nov 2019 09:44:50 -0500 Subject: [PATCH 1/2] fix(icons): use @patternfly/react-icons --- packages/pf4-component-mapper/package.json | 5 +++-- .../src/form-fields/fieldArray/index.js | 4 ++-- .../src/form-fields/select/clear-indicator.js | 2 +- .../form-fields/select/dropdown-indicator.js | 4 ++-- .../form-fields/select/multi-value-remove.js | 2 +- .../src/form-fields/select/option.js | 2 +- .../src/icons/add-circle-o-icon.js | 20 ------------------- .../src/icons/caret-down-icon.js | 20 ------------------- .../src/icons/check-icon.js | 20 ------------------- .../src/icons/circle-notch-icon.js | 20 ------------------- .../src/icons/close-icon.js | 20 ------------------- .../src/tests/field-array/field-array.test.js | 4 ++-- yarn.lock | 7 +++++++ 13 files changed, 19 insertions(+), 111 deletions(-) delete mode 100644 packages/pf4-component-mapper/src/icons/add-circle-o-icon.js delete mode 100644 packages/pf4-component-mapper/src/icons/caret-down-icon.js delete mode 100644 packages/pf4-component-mapper/src/icons/check-icon.js delete mode 100644 packages/pf4-component-mapper/src/icons/circle-notch-icon.js delete mode 100644 packages/pf4-component-mapper/src/icons/close-icon.js diff --git a/packages/pf4-component-mapper/package.json b/packages/pf4-component-mapper/package.json index fcd1f0f37..36fe90c85 100644 --- a/packages/pf4-component-mapper/package.json +++ b/packages/pf4-component-mapper/package.json @@ -23,6 +23,7 @@ "@babel/preset-react": "^7.0.0", "@data-driven-forms/react-form-renderer": "*", "@patternfly/react-core": "^3.104.0", + "@patternfly/react-icons": "^3.14.23", "@semantic-release/git": "^7.0.5", "@semantic-release/npm": "^5.1.1", "babel-core": "^7.0.0-bridge.0", @@ -88,8 +89,8 @@ }, "dependencies": { "@patternfly/patternfly-next": "^1.0.175", - "react-select": "^3.0.4", - "react-final-form-arrays": "2.0.3" + "react-final-form-arrays": "2.0.3", + "react-select": "^3.0.4" }, "postpublish": "export RELEASE_DEMO=true" } diff --git a/packages/pf4-component-mapper/src/form-fields/fieldArray/index.js b/packages/pf4-component-mapper/src/form-fields/fieldArray/index.js index dca3d88de..a58e9365b 100644 --- a/packages/pf4-component-mapper/src/form-fields/fieldArray/index.js +++ b/packages/pf4-component-mapper/src/form-fields/fieldArray/index.js @@ -2,8 +2,8 @@ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import { Grid, GridItem, Bullseye, FormHelperText } from '@patternfly/react-core'; -import CloseIcon from '../../icons/close-icon'; -import AddCircleOIcon from '../../icons/add-circle-o-icon'; +import CloseIcon from '@patternfly/react-icons/dist/js/icons/close-icon'; +import AddCircleOIcon from '@patternfly/react-icons/dist/js/icons/add-circle-o-icon'; import './final-form-array.scss'; diff --git a/packages/pf4-component-mapper/src/form-fields/select/clear-indicator.js b/packages/pf4-component-mapper/src/form-fields/select/clear-indicator.js index 818e0250c..d5d554c9e 100644 --- a/packages/pf4-component-mapper/src/form-fields/select/clear-indicator.js +++ b/packages/pf4-component-mapper/src/form-fields/select/clear-indicator.js @@ -2,7 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Button, ButtonVariant } from '@patternfly/react-core'; -import TimesCircleIcon from '../../icons/times-circle-icon'; +import TimesCircleIcon from '@patternfly/react-icons/dist/js/icons/times-circle-icon'; const ClearIndicator = ({ clearValue, diff --git a/packages/pf4-component-mapper/src/form-fields/select/dropdown-indicator.js b/packages/pf4-component-mapper/src/form-fields/select/dropdown-indicator.js index 318e65f91..d425d7785 100644 --- a/packages/pf4-component-mapper/src/form-fields/select/dropdown-indicator.js +++ b/packages/pf4-component-mapper/src/form-fields/select/dropdown-indicator.js @@ -1,8 +1,8 @@ import React from 'react'; import PropTypes from 'prop-types'; -import CaretDownIcon from '../../icons/caret-down-icon'; -import CircleNotchIcon from '../../icons/circle-notch-icon'; +import CaretDownIcon from '@patternfly/react-icons/dist/js/icons/caret-down-icon'; +import CircleNotchIcon from '@patternfly/react-icons/dist/js/icons/circle-notch-icon'; const DropdownIndicator = ({ selectProps: { isFetching }}) => isFetching ? : ; diff --git a/packages/pf4-component-mapper/src/form-fields/select/multi-value-remove.js b/packages/pf4-component-mapper/src/form-fields/select/multi-value-remove.js index 7a25d534e..e8d0788b1 100644 --- a/packages/pf4-component-mapper/src/form-fields/select/multi-value-remove.js +++ b/packages/pf4-component-mapper/src/form-fields/select/multi-value-remove.js @@ -1,7 +1,7 @@ import React from 'react'; import { components } from 'react-select'; -import TimesCircleIcon from '../../icons/times-circle-icon'; +import TimesCircleIcon from '@patternfly/react-icons/dist/js/icons/times-circle-icon'; const MultiValueRemove = props => ( diff --git a/packages/pf4-component-mapper/src/form-fields/select/option.js b/packages/pf4-component-mapper/src/form-fields/select/option.js index fa3e4d503..619be7b4d 100644 --- a/packages/pf4-component-mapper/src/form-fields/select/option.js +++ b/packages/pf4-component-mapper/src/form-fields/select/option.js @@ -3,7 +3,7 @@ import { components } from 'react-select'; import PropTypes from 'prop-types'; import { Checkbox } from '@patternfly/react-core'; -import CheckIcon from '../../icons/check-icon'; +import CheckIcon from '@patternfly/react-icons/dist/js/icons/check-icon'; const Option = (props) => (
( - - AddCircleOIcon - - -); - -export default AddCircleOIcon; diff --git a/packages/pf4-component-mapper/src/icons/caret-down-icon.js b/packages/pf4-component-mapper/src/icons/caret-down-icon.js deleted file mode 100644 index 6e64a6bc3..000000000 --- a/packages/pf4-component-mapper/src/icons/caret-down-icon.js +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; - -const CaretDownIcon = props => ( - - CaretDownIcon - - -); - -export default CaretDownIcon; diff --git a/packages/pf4-component-mapper/src/icons/check-icon.js b/packages/pf4-component-mapper/src/icons/check-icon.js deleted file mode 100644 index 6925289a6..000000000 --- a/packages/pf4-component-mapper/src/icons/check-icon.js +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; - -const CheckIcon = props => ( - - CheckIcon - - -); - -export default CheckIcon; diff --git a/packages/pf4-component-mapper/src/icons/circle-notch-icon.js b/packages/pf4-component-mapper/src/icons/circle-notch-icon.js deleted file mode 100644 index 3c70f4fd5..000000000 --- a/packages/pf4-component-mapper/src/icons/circle-notch-icon.js +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; - -const CircleNotchIcon = props => ( - - CircleNotchIcon - - -); - -export default CircleNotchIcon; diff --git a/packages/pf4-component-mapper/src/icons/close-icon.js b/packages/pf4-component-mapper/src/icons/close-icon.js deleted file mode 100644 index 625a43285..000000000 --- a/packages/pf4-component-mapper/src/icons/close-icon.js +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; - -const CloseIcon = props => ( - - CloseIcon - - -); - -export default CloseIcon; diff --git a/packages/pf4-component-mapper/src/tests/field-array/field-array.test.js b/packages/pf4-component-mapper/src/tests/field-array/field-array.test.js index 65c17116a..5f1ae9d72 100644 --- a/packages/pf4-component-mapper/src/tests/field-array/field-array.test.js +++ b/packages/pf4-component-mapper/src/tests/field-array/field-array.test.js @@ -4,8 +4,8 @@ import toJson from 'enzyme-to-json'; import FormRenderer, { componentTypes as components } from '@data-driven-forms/react-form-renderer'; import { TextInput } from '@patternfly/react-core'; -import AddCircleOIcon from '../../icons/add-circle-o-icon'; -import CloseIcon from '../../icons/close-icon'; +import AddCircleOIcon from '@patternfly/react-icons/dist/js/icons/add-circle-o-icon'; +import CloseIcon from '@patternfly/react-icons/dist/js/icons/close-icon'; import { formFieldsMapper, layoutMapper } from '../../index'; describe('FieldArray', () => { diff --git a/yarn.lock b/yarn.lock index ab940345e..fe217b9a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2333,6 +2333,13 @@ dependencies: "@fortawesome/free-brands-svg-icons" "^5.8.1" +"@patternfly/react-icons@^3.14.23": + version "3.14.23" + resolved "https://registry.yarnpkg.com/@patternfly/react-icons/-/react-icons-3.14.23.tgz#f371207155d13fcdae07a8b0fe6b7b6cabfa0ef4" + integrity sha512-l1ji5Gv4LyrSarGwsEAPG9Nq/8wSCwyvWv7j7R3u1LJy4X27wLc6uorzfToAbdvaBeBjjCEf/UJQZCHHzwIOAw== + dependencies: + "@fortawesome/free-brands-svg-icons" "^5.8.1" + "@patternfly/react-styles@^3.2.2", "@patternfly/react-styles@^3.6.6": version "3.6.6" resolved "https://registry.yarnpkg.com/@patternfly/react-styles/-/react-styles-3.6.6.tgz#d4b481fbd34adc28b3129842aea4834c384d4382" From 536fe980a32ffc8b1cec459eba455190aac1856c Mon Sep 17 00:00:00 2001 From: redallen Date: Tue, 26 Nov 2019 09:48:06 -0500 Subject: [PATCH 2/2] update snapshot --- .../src/icons/times-circle-icon.js | 20 ------------------- .../__snapshots__/field-array.test.js.snap | 15 +++++++------- 2 files changed, 7 insertions(+), 28 deletions(-) delete mode 100644 packages/pf4-component-mapper/src/icons/times-circle-icon.js diff --git a/packages/pf4-component-mapper/src/icons/times-circle-icon.js b/packages/pf4-component-mapper/src/icons/times-circle-icon.js deleted file mode 100644 index e6d7616e9..000000000 --- a/packages/pf4-component-mapper/src/icons/times-circle-icon.js +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; - -const TimesCircleIcon = props => ( - - TimesCircleIcon - - -); - -export default TimesCircleIcon; diff --git a/packages/pf4-component-mapper/src/tests/field-array/__snapshots__/field-array.test.js.snap b/packages/pf4-component-mapper/src/tests/field-array/__snapshots__/field-array.test.js.snap index bb438c72d..36a3777bc 100644 --- a/packages/pf4-component-mapper/src/tests/field-array/__snapshots__/field-array.test.js.snap +++ b/packages/pf4-component-mapper/src/tests/field-array/__snapshots__/field-array.test.js.snap @@ -550,10 +550,15 @@ exports[`FieldArray should render array field correctly 1`] = ` > - - AddCircleOIcon -