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

feat(ui/console): add copy as curl button #2474

Conversation

AmineRhazzar
Copy link
Contributor

@AmineRhazzar AmineRhazzar commented Dec 1, 2023

fixes: #2255

  • implemented 'Copy as curl' button
  • Fixed the following ui bugs:
    • Request Context editor hides the 'Evaluate' button on smaller heights
    • The component showing the response gets highlighted (using hljs) only on the first request, and not on subsequent requests or when an error happens.

I wasn't sure how to specify the need for an API token for the curl command if auth was required. I just put -H "Authorization: Bearer <api-token>".

@AmineRhazzar AmineRhazzar requested a review from a team as a code owner December 1, 2023 14:58
Copy link

codecov bot commented Dec 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0e86ff8) 70.73% compared to head (5dac283) 70.73%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2474   +/-   ##
=======================================
  Coverage   70.73%   70.73%           
=======================================
  Files          81       81           
  Lines        8130     8130           
=======================================
  Hits         5751     5751           
  Misses       2033     2033           
  Partials      346      346           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AmineRhazzar AmineRhazzar force-pushed the feature/issue-2255/copy-evaluation-as-curl branch from 457feff to 4192b14 Compare December 1, 2023 20:48
@erka
Copy link
Collaborator

erka commented Dec 1, 2023

@AmineRhazzar could you please change Refs: #2255 to fixes: #2255. Github will link issue with current PR and close the issue when PR is merged.

@GeorgeMac
Copy link
Contributor

This is really awesome, thank you @AmineRhazzar 🙏

I think what you have there for auth makes sense. We could have a little input field for supplying a token, but unsure if we really want that and could always come in a later change if we decided we want it.

Copy link
Contributor

@GeorgeMac GeorgeMac left a comment

Choose a reason for hiding this comment

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

This looks awesome and thanks for fixing the highlighting bug too!

@AmineRhazzar
Copy link
Contributor Author

You're welcome! Happy to help

| 'METHOD_TOKEN'
| 'METHOD_OIDC'
| 'METHOD_GITHUB'
| 'METHOD_KUBERNETES';
Copy link
Collaborator

Choose a reason for hiding this comment

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

good catch!

Copy link
Collaborator

@markphelps markphelps left a comment

Choose a reason for hiding this comment

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

couple minor suggestions @AmineRhazzar

thank you very much for doing this! works great!

ui/src/app/console/Console.tsx Outdated Show resolved Hide resolved
ui/src/app/console/Console.tsx Outdated Show resolved Hide resolved
@markphelps
Copy link
Collaborator

@all-contributors please add @AmineRhazzar for code

Copy link
Contributor

@markphelps

I've put up a pull request to add @AmineRhazzar! 🎉

@markphelps markphelps enabled auto-merge (squash) December 2, 2023 17:00
Copy link
Collaborator

@markphelps markphelps left a comment

Choose a reason for hiding this comment

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

thanks again @AmineRhazzar !!

@markphelps markphelps merged commit 44e34fa into flipt-io:main Dec 2, 2023
29 checks passed
@AmineRhazzar
Copy link
Contributor Author

My pleasure 👌

@AmineRhazzar AmineRhazzar deleted the feature/issue-2255/copy-evaluation-as-curl branch December 2, 2023 18:32
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.

[FLI-638] Idea: copy as curl button
4 participants