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

Feature/246 add proptypes and default vals #273

Merged
merged 29 commits into from
Mar 8, 2022

Conversation

Muhaddatha
Copy link
Contributor

No description provided.

@Muhaddatha Muhaddatha linked an issue Feb 2, 2022 that may be closed by this pull request
4 tasks
Copy link
Member

@afonsobspinto afonsobspinto left a comment

Choose a reason for hiding this comment

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

Thank you very much @Muhaddatha.

I think if we solve the ListViewer problem and add a couple of descriptions here and there we are good to go. If something is not clear in the changes I requested let me know.

@afonsobspinto
Copy link
Member

One more thing that you didn't touch but it might make sense to do in the context of this issue:

  • Update the description of plot props
    image

I would also like to bump issue #1 to our attention because flex-layout component will be the only one with dummy prop-types
image

@Muhaddatha Muhaddatha marked this pull request as draft February 4, 2022 04:40
@Muhaddatha
Copy link
Contributor Author

One more thing that you didn't touch but it might make sense to do in the context of this issue:

  • Update the description of plot props
    image

I would also like to bump issue #1 to our attention because flex-layout component will be the only one with dummy prop-types image

Ok, I looked at the plots props but its fields are a bit different. Maybe I am looking at the wrong file. Is this the file you are talking about?

plots: PropTypes.arrayOf(PropTypes.shape({

@afonsobspinto
Copy link
Member

Ok, I looked at the plots props but its fields are a bit different. Maybe I am looking at the wrong file. Is this the file you are talking about?

plots: PropTypes.arrayOf(PropTypes.shape({

That's the correct file. Indeed the inner props seem to be wrongly displayed. If adding a description for x, y and lineOptions doesn't solve it we can create a new issue. Let me know

@Muhaddatha Muhaddatha marked this pull request as ready for review February 8, 2022 15:12
Copy link
Member

@afonsobspinto afonsobspinto left a comment

Choose a reason for hiding this comment

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

Requested a change of a few typos and an enhancement.
No longer have problems with list viewer. Thanks

onShiftClick: 'goToPoint',
onDoubleClick: 'goToPoint',
showDownloadButton: false,
};


DicomViewer.propTypes = {
Copy link
Member

Choose a reason for hiding this comment

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

I believe onClick, onCtrlClick, onShiftClick, onDoubleClick shouldn't be any but rather a string (one of 'goToPoint', 'goToSingleView', 'togglMode'), or a function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also changed 'togglMode' to 'toggleMode'. I made the example DicomViewer match this too.

This is how the DicomViewer Props look like with the new format:
image

Let me know if this is the right way.

Copy link
Member

@afonsobspinto afonsobspinto Feb 10, 2022

Choose a reason for hiding this comment

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

Regarding the change from togglMode to toggleMode I think that's all right. I pushed a new commit to fix one thing you forgot to change. The idea of those 'modes' is to allow the user to choose some default onX strategies. That works because we have those strategies implemented as methods inside the DicomViewer component. When the user chooses 'toggleMode' we map it to the method toggleMode. Because this is using eval (which is something that we probably should change as it, typically, is not very safe/pretty) the 'mode' needs to match with the name of the method.

New format looks very nice in paper. I don't like how it looks in the showcase but I think we can address that in #285.

geppetto.js/geppetto-ui/src/3d-canvas/Canvas.js Outdated Show resolved Hide resolved
geppetto.js/geppetto-ui/src/list-viewer/ListViewer.js Outdated Show resolved Hide resolved
geppetto.js/geppetto-ui/src/loader/Loader.js Show resolved Hide resolved
geppetto.js/geppetto-ui/src/vr-canvas/canvas/Canvas.js Outdated Show resolved Hide resolved
Copy link
Member

@afonsobspinto afonsobspinto 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 to me.
I added the things I don't like to card #285.
Final word on you @enicolasgomez

@enicolasgomez enicolasgomez merged commit 5a8c480 into development Mar 8, 2022
@afonsobspinto afonsobspinto deleted the feature/246_add_proptypes_and_default_vals branch March 21, 2022 15:44
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.

Add complete prop-types and default values to UI components
3 participants