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

UIDATIMP-1634: Refactor away from default props for functional components #1655

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Change history for ui-data-import

## [8.0.2] (IN PROGRESS)
## [8.1.0] (IN PROGRESS)
OleksandrHladchenko1 marked this conversation as resolved.
Show resolved Hide resolved

### Features added:
* `React v19`: refactor away from default props for functional components. (UIDATIMP-1634)

### Bugs fixed:
* Display placeholder in `Job profile` and `User` filters on the `View all` page after clicking on `Reset all` button. (UIDATIMP-1675)
Expand Down
23 changes: 12 additions & 11 deletions src/settings/JobProfiles/ViewJobProfile/ViewJobProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ const jobPartsCellFormatter = record => (
/>
);

const DEFAULT_ACTION_ITEMS = [
'edit',
'duplicate',
'delete',
];

const ViewJobProfileComponent = props => {
const {
resources,
Expand All @@ -116,7 +122,7 @@ const ViewJobProfileComponent = props => {
location,
onDelete,
onClose,
actionMenuItems,
actionMenuItems = DEFAULT_ACTION_ITEMS,
accordionStatusRef,
} = props;

Expand Down Expand Up @@ -239,7 +245,11 @@ const ViewJobProfileComponent = props => {
return (
<ActionMenu
entity={{
props,
props: {
...props,
actionMenuItems,
ENTITY_KEY: ENTITY_KEYS.JOB_PROFILES,
},
showRunConfirmation: () => setShowRunConfirmation(true),
showDeleteConfirmation: () => setShowDeleteConfirmation(true),
}}
Expand Down Expand Up @@ -635,15 +645,6 @@ ViewJobProfileComponent.propTypes = {
accordionStatusRef: PropTypes.object,
};

ViewJobProfileComponent.defaultProps = {
ENTITY_KEY: ENTITY_KEYS.JOB_PROFILES,
actionMenuItems: [
'edit',
'duplicate',
'delete',
],
};

export const ViewJobProfile = compose(
stripesConnect,
withTags,
Expand Down
Loading