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

WP-66: refactor data files components 2 #885

Merged
merged 5 commits into from
Oct 17, 2023

Conversation

asimregmi
Copy link
Contributor

Overview

Updated systemId prop to systemAndHomeDirId in all of the the DataFiles components where it is used to make the prop more descriptive.

Related

Changes

  • Updated prop names in DataFilesSelectModal.jsx and DataFilesCopyModal.jsx

Testing

  1. Go to DataFiles and test all DataFiles functionalities Copy
  2. Go to Applications and submit a job using OpenSeesSP or similar where you can select inputs (SelectModal is used here).

UI

No visible UI change

Notes

Previous PR was #876. In this PR, updated prop names to two more files.

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

Merging #885 (1c41821) into main (d7a003e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #885   +/-   ##
=======================================
  Coverage   63.44%   63.44%           
=======================================
  Files         427      427           
  Lines       12215    12215           
  Branches     2510     2510           
=======================================
  Hits         7750     7750           
  Misses       4259     4259           
  Partials      206      206           
Flag Coverage Δ
javascript 69.67% <ø> (ø)
unittests 57.20% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...s/DataFiles/DataFilesModals/DataFilesCopyModal.jsx 76.27% <ø> (ø)
...DataFiles/DataFilesModals/DataFilesSelectModal.jsx 71.87% <ø> (ø)
...ataFilesProjectMembers/DataFilesProjectMembers.jsx 56.00% <ø> (ø)

@asimregmi asimregmi marked this pull request as ready for review October 11, 2023 18:36
Copy link
Member

@nathanfranklin nathanfranklin left a comment

Choose a reason for hiding this comment

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

LGTM 👍

I've spent a little time to see if we can catch this in linting or unit testing. I looked over https://github.com/jsx-eslint/eslint-plugin-react but can't find any rule that matches this scenario (i.e. using a prop that doesn't exist). sounds like there is no rule due to the use case where a React component might want to forward extra props to child components.

My only other comment to consider, before mering, is marking the property projectId from https://github.com/TACC/Core-Portal/pull/876/files#r1350565668 isRequired (and thanks for catching that the property was missing 💯 ).

@nathanfranklin
Copy link
Member

Out of scope for here (and it wouldn't have caught systemId/systemAndHomeDirId), but it feels like we should configure eslintrc to be more strict on props, like:

    "react/prop-types": 2,
    "react/no-unused-prop-types": 2,

@asimregmi
Copy link
Contributor Author

Thank you!! Added the PropType isRequired for ProjectId.

I went into the rabbit hole to see if there was a library we could use with Jest. It might be possible with Enzyme and a complex test to catch if a component is using a prop that is undefined (doesn't exist, like systemId in this case, after being renamed to systemAndHomeDirId). Not sure if this will be efficient, however.

Copy link
Contributor

@edmondsgarrett edmondsgarrett 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, toolbar functions and input selector working!

@chandra-tacc chandra-tacc merged commit 1b05540 into main Oct 17, 2023
6 checks passed
@chandra-tacc chandra-tacc deleted the WP-66/Refactor-DataFiles-components--2 branch October 17, 2023 15:28
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.

4 participants