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: manual sort for query parameters #2289

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

krummbar
Copy link
Contributor

@krummbar krummbar commented May 11, 2024

Description

Fixes #2053

Adds sorting capabilities to the request query parameters. It uses react-dnd internally. Sorting happens already while hovering other items, but changes are only permanent if the request object is saved.

I moved the rendering of the individual table rows into a dedicated file for better separation. Let me know if I should revert this and move everything back into the index.js.

I'm not 100% happy with the solution as it requires copy & paste if this kind of sorting should apply to other components. I see a valid use-case adding this to request headers, vars and asserts as well. It would be possible to move some of the logic into a common utils location, but this increases complexity about the internal workings due to abstraction. If this is the way forward I can refactor here a bit.

Handle Icon

See my comment below for alternative icon proposals, feedback is very much appreciated.

Drag & Drop in Action

bruno-pr2289-draft-example.mp4

Looks

Light Theme
bruno-2289-drag-light

Dark Theme
bruno-2289-drag-dark

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

@krummbar krummbar force-pushed the feat/reorder-request-parameters branch from 78c938d to 386a19f Compare May 12, 2024 05:13
@krummbar
Copy link
Contributor Author

I would be thankful for feedback about the used icon, not sure if this is the best fitting one.
Here are some alternative proposals.
icons

@krummbar krummbar force-pushed the feat/reorder-request-parameters branch from 386a19f to e176b39 Compare May 12, 2024 06:26
@krummbar krummbar marked this pull request as ready for review May 12, 2024 06:57
@krummbar krummbar changed the title feat: query parameters can be manually sorted feat: manual sort for query parameters May 12, 2024
@sanjai0py sanjai0py self-assigned this May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reordering parameter
2 participants