Skip to content

Commit

Permalink
UIPFIMP-71: React v19: refactor away from default props for functiona…
Browse files Browse the repository at this point in the history
…l components (#186)
  • Loading branch information
OleksandrHladchenko1 authored Nov 29, 2024
1 parent 34db112 commit df20b8e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change history for ui-plugin-find-import-profile

## [8.1.0] In progress

### Features added:
* `React v19`: refactor away from default props for functional components (UIPFIMP-71)

## [8.0.0](https://github.com/folio-org/ui-plugin-find-import-profile/tree/v8.0.0) (2024-10-31)

### Features added:
Expand Down
26 changes: 12 additions & 14 deletions src/FindImportProfile/FindImportProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,25 @@ const profileContainers = {
[ENTITY_KEYS.MAPPING_PROFILES]: containers.MappingProfilesContainer,
};

const defaultPluginProps = {
disabled: false,
marginBottom0: true,
marginTop0: true,
searchButtonStyle: 'primary',
searchLabel: <FormattedMessage id="ui-plugin-find-import-profile.addProfile" />,
};

const FindImportProfile = ({
entityKey,
parentType,
masterType,
profileType,
profileName,
onLink,
onClose,
isSingleSelect,
isMultiLink,
filterParams,
onClose = noop,
isSingleSelect = false,
isMultiLink = true,
...rest
}) => {
const FindImportProfileContainer = profileContainers[entityKey];
Expand Down Expand Up @@ -180,6 +188,7 @@ const FindImportProfile = ({

return (
<PluginFindRecord
{...defaultPluginProps}
{...rest}
selectRecordsCb={onLink}
>
Expand Down Expand Up @@ -264,15 +273,4 @@ FindImportProfile.propTypes = {
onClose: PropTypes.func,
};

FindImportProfile.defaultProps = {
disabled: false,
marginBottom0: true,
marginTop0: true,
searchButtonStyle: 'primary',
searchLabel: <FormattedMessage id="ui-plugin-find-import-profile.addProfile" />,
isSingleSelect: false,
isMultiLink: true,
onClose: noop,
};

export default FindImportProfile;

0 comments on commit df20b8e

Please sign in to comment.