Fixes and enhancements for array query param handling#241
Merged
bourdakos1 merged 8 commits intocloud-annotations:mainfrom Mar 14, 2023
Merged
Fixes and enhancements for array query param handling#241bourdakos1 merged 8 commits intocloud-annotations:mainfrom
bourdakos1 merged 8 commits intocloud-annotations:mainfrom
Conversation
✅ Deploy Preview for docusaurus-openapi ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
chris48s
commented
Feb 20, 2023
packages/docusaurus-theme-openapi/src/theme/ApiDemoPanel/ParamOptions/index.tsx
Outdated
Show resolved
Hide resolved
packages/docusaurus-theme-openapi/src/theme/ApiDemoPanel/ParamOptions/index.tsx
Outdated
Show resolved
Hide resolved
Collaborator
Author
|
I've circled back to this and pushed another commit which takes a different approach to fixing the infinite render loop. This gets rid of the loop without introducing any ESLint errors. Would it be possible to get a review on this? |
bourdakos1
reviewed
Mar 11, 2023
packages/docusaurus-theme-openapi/src/theme/ApiDemoPanel/ParamOptions/index.tsx
Outdated
Show resolved
Hide resolved
packages/docusaurus-theme-openapi/src/theme/ApiDemoPanel/ParamOptions/index.tsx
Show resolved
Hide resolved
bourdakos1
reviewed
Mar 14, 2023
Comment on lines
+246
to
+255
| {((param?.schema?.maxItems == null || | ||
| items.length < param.schema.maxItems) && ( | ||
| <button className={styles.buttonThin} onClick={handleAddItem}> | ||
| Add item | ||
| </button> | ||
| )) || ( | ||
| <button className={styles.buttonThin} disabled> | ||
| Add item | ||
| </button> | ||
| )} |
Member
There was a problem hiding this comment.
This is a bit hard to follow. Can we do something like:
<button
className={styles.buttonThin}
onClick={handleAddItem}
disabled={param?.schema?.maxItems != null && param.schema.maxItems <= items.length}
>
Add item
</button>
bourdakos1
approved these changes
Mar 14, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a bit of a mixed bag of related things.
There is an infinite render loop on pages that use query params, causing a
Maximum Update Depth Exceedederror.Respect the
maxItemsproperty for array query params.OpenAPI supports number of different styles for array query params via the
styleandexplodeproperties. This PR adds compatibility for those.