Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIPFIMP-71: Refactor away from default props for functional components #186

Merged
merged 1 commit into from
Nov 29, 2024
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
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;
Loading