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

DATAP-1510 Conversion of AggregationBranch from Class to Functional Component #530

Merged
merged 20 commits into from
Aug 22, 2024

Conversation

cdmh219
Copy link
Collaborator

@cdmh219 cdmh219 commented Aug 22, 2024

AggregationBranch conversion to functional component, along with associated unit tests

Additions

  • AggregationBranch.js functional component
  • AggregationBranch.spec.js unit tests

Removals

  • AggregationBranch.js class component (with associated unit tests and snapshot)

Changes

  • Update to removeMultipleFilters, to use immutable updates (this was changed due to errors in the unit tests that pointed to a state mutation error in this reducer)

Testing

Screenshots

Notes

Todos

Checklist

  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows the standards laid out in the front end playbook
  • Passes all existing automated tests
  • New functions include new tests
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged
  • Visually tested in supported browsers and devices
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)

desc,
children,
}) => {
const [isOpen, setOpen] = useState(hasChildren);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we got rid of hasChildren, and it should just by default be:

const [isOpen, setOpen] = useState(true);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did, but it likely made its way back in due to a merge conflict on my end. I've taken these references out again.

Comment on lines 43 to 45
title: PropTypes.string,
desc: PropTypes.string,
children: PropTypes.node,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes should be reverted.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

expect(buttonAfter).toBeInTheDocument();
expect(screen.getByText(props.desc)).toBeInTheDocument();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with the changes in this file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Copy link
Contributor

@flacoman91 flacoman91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

You could also update the test coverage threshold in package.json if you want.

@flacoman91 flacoman91 added this pull request to the merge queue Aug 22, 2024
Merged via the queue into main with commit a457df2 Aug 22, 2024
2 checks passed
@flacoman91 flacoman91 deleted the DATA-1510-AggregationBranch-func-comp branch August 22, 2024 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants