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

parameter & operation extensions display #3868

Merged
merged 18 commits into from Nov 23, 2017

Conversation

thompsongl
Copy link
Contributor

Fixes #3052 by adding components to display Parameter and Operation extensions (x- values)

Presentational components for x- value displays are small and explicit intentionally. These changes allow for baseline rendering while giving easy access to override/wrap each extension component granularly. For instance, we plan on wrapping operation extensions to display extra information about our security-related values.

Considerations:

  • Feedback on location, layout, and style are appreciated. This is an initial pass and welcome insight into Swagger design & UX choices/patterns.
  • Same feedback appreciated on component naming conventions.

@webron
Copy link
Contributor

webron commented Nov 8, 2017

@thompsongl thanks for the PR. I'll leave it to @shockey to comment about the code itself. Running this with a definition that has an extension in a parameter - am I supposed to see anything? Could be completely blind...

@shockey shockey self-requested a review November 8, 2017 05:33
@thompsongl
Copy link
Contributor Author

@webron Not blind. I had an uncommitted change hanging out 😳
You should now see extension defs under the type, in, etc., values

@webron
Copy link
Contributor

webron commented Nov 8, 2017

I think for an initial version, the styling is ok. Not a lot of magic that can be done with it.

However, I think rendering the extensions should be optional and by default should be false.

@thompsongl
Copy link
Contributor Author

I can make that happen. Optional by way of configuration parameters or another method?
Model extensions are currently displayed by default. Would you like to see those hidden by default as well or are they fine as is?

@webron
Copy link
Contributor

webron commented Nov 8, 2017

Yeah, a configuration parameter. And yeah, would be great if that would apply to model extensions as well. Thanks for the help.

@thompsongl
Copy link
Contributor Author

@shockey #3875 is (somewhat) blocking this. Specifically, I made getConfigs available inside of <ParameterRow /> there, which we'll now need to read the extensions flag.
Just an FYI that there's overlap. I can adjust commits if #3875 can't merge for whatever reason

@shockey
Copy link
Contributor

shockey commented Nov 9, 2017

@thompsongl, I just merged #3875 😄

@thompsongl
Copy link
Contributor Author

Updated: Uses configuration param to display extensions
Most of the diff is now related to getting getConfigs where needed.
Also, note that (as requested) model extensions are no longer displayed by default. Breaking change in a sense; at the very least worth detailing in release notes

@thompsongl
Copy link
Contributor Author

@shockey, anything else you'd like to see as part of this changeset?

@shockey
Copy link
Contributor

shockey commented Nov 18, 2017

@thompsongl, all good here - hoping to get this reviewed and merged Monday 😄

@shockey shockey added this to the November 24 milestone Nov 21, 2017
Copy link
Contributor

@shockey shockey left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for adding the documentation, and updating the relevant Enzyme test.

For future PRs, more comprehensive tests would be nice 😄

@@ -7,6 +7,7 @@ export default class ArrayModel extends Component {
static propTypes = {
schema: PropTypes.object.isRequired,
getComponent: PropTypes.func.isRequired,
getConfigs: PropTypes.func.isRequired,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a huge fan of the getConfigs handaround - would prefer to see a container component mapping from the configs to props for children.

@shockey shockey merged commit d3cc636 into swagger-api:master Nov 23, 2017
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.

None yet

3 participants