-
Notifications
You must be signed in to change notification settings - Fork 192
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
feat: http response explorer for RunIt #800
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move a little bit of code
packages/run-it/src/components/CopyClipboardIconButton/CopyClipboardIconButton.tsx
Outdated
Show resolved
Hide resolved
packages/run-it/src/components/CopyClipboardIconButton/CopyClipboardIconButton.tsx
Outdated
Show resolved
Hide resolved
packages/run-it/src/components/CopyClipboardIconButton/CopyClipboardIconButton.tsx
Outdated
Show resolved
Hide resolved
packages/run-it/src/components/CopyClipboardIconButton/CopyClipboardIconButton.tsx
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is looking great! 👏
specs={specs} | ||
envAdaptor={extensionEnvAdaptor} | ||
setVersionsUrl={runItNoSet} | ||
// TODO We need expand/collapse side nav for the headless extension before we enabled this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a ticket for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet. Wanted to discuss with you and @bryans99
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and @jhardy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in favor of the expand/collapse sidebar hamburger alternative. Created a ticket yet?
|
||
export type RunItHttpMethod = 'GET' | 'PUT' | 'POST' | 'PATCH' | 'DELETE' | ||
|
||
/** | ||
* Generic collection | ||
*/ | ||
export type RunItValues = { [key: string]: any } | ||
export type RunItValues = Record<string, any> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much cleaner :)
packages/run-it/src/components/ResponseExplorer/ResponseExplorer.spec.tsx
Outdated
Show resolved
Hide resolved
packages/run-it/src/components/ResponseExplorer/ResponseExplorer.spec.tsx
Outdated
Show resolved
Hide resolved
packages/run-it/src/components/ResponseExplorer/ResponseExplorer.spec.tsx
Outdated
Show resolved
Hide resolved
// TODO make a badge for the verb. | ||
// Once we are satisfied with the badge in the api-explorer package it should be moved here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have a ticket for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was an existing comment, and I did try method badge but it looked wonky. Want to give @jhardy a chance to look at it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont forget the ticket
const getHeaders = (response: ResponseContent): HeaderTable => { | ||
if (!response?.headers) return [] | ||
const result: HeaderTable = [] | ||
Object.entries(response.headers).forEach(([key, val]) => | ||
result.push([key, val]) | ||
) | ||
return result | ||
} | ||
|
||
const getBodySize = (response: ResponseContent): string => { | ||
const size = | ||
!response || !response.body | ||
? 0 | ||
: response?.body instanceof Blob | ||
? response?.body.size | ||
: response?.body.toString().length | ||
|
||
return `${size} bytes` | ||
} | ||
|
||
export const NoWrap = styled(Span)` | ||
display: inline-block; | ||
direction: rtl; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you consider putting these into a separate utils file? Are there any related unit tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't think of a need for them outside of this component so I left them in this file.
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
2 similar comments
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@googlebot I fixed it. |
- added yarn scripts to the root `package.json`: - `yarn dev:apix` for stand-alone API Explorer - `yarn dev:apixx` for extension API Explorer - added `CodeCopy` component which is a wrapper for `CodeDisplay` and the clipboard UI - copy to clipboard works both stand-alone and in extension - ConfigForm.tsx `Verify` button no longer clears stored config. Only remove or save change the stored config. - WIP on CopyClipboardIconButton.tsx but it's not working yet
- `yarn:xapix` - code cleanup, but `CopyClipboardIconButton` doesn't work yet
- Login returns and reopens the RunIt form with whatever values are set ... if values *have* been set - Removed CopyClipboardIconButton.tsx because it does not pass A11y and is not mobile friendly
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
APIX Tests 1 files 77 suites 2m 15s ⏱️ Results for commit 68716e4. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
APIX Tests 1 files 77 suites 2m 22s ⏱️ Results for commit 73bbd66. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
APIX Tests 1 files 77 suites 2m 22s ⏱️ Results for commit 6d9001b. |
Typescript Tests 6 files 75 suites 2m 51s ⏱️ Results for commit 6d9001b. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
APIX Tests 1 files 77 suites 3m 1s ⏱️ Results for commit c723df5. |
Typescript Tests 6 files 75 suites 2m 52s ⏱️ Results for commit c723df5. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - there are a couple of items that could be cleaned up (they bug me :D ) but I'm okay without them.
There are a couple of buganizer tickets to write as well.
specs={specs} | ||
envAdaptor={extensionEnvAdaptor} | ||
setVersionsUrl={runItNoSet} | ||
// TODO We need expand/collapse side nav for the headless extension before we enabled this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in favor of the expand/collapse sidebar hamburger alternative. Created a ticket yet?
// TODO make a badge for the verb. | ||
// Once we are satisfied with the badge in the api-explorer package it should be moved here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont forget the ticket
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
APIX Tests 1 files 77 suites 2m 57s ⏱️ Results for commit 5991eac. |
Typescript Tests 6 files 75 suites 2m 40s ⏱️ Results for commit 5991eac. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ResponseExplorer
adds to the RunIt Response tab:CodeCopy
componentSave
is clicked on the config form, API specifications are reloaded from the configured serverLogin
is clicked, when OAuth returns, RunIt is re-opened and the entered values are restored in the Request formyarn dev:apix
yarn dev:xapix
New PR because old one was blocked by CLA requirements