apidash icon indicating copy to clipboard operation
apidash copied to clipboard

Sync url and params tab

Open CH1NRU5T opened this issue 1 year ago • 13 comments

Describe the bug/problem Syncing of url and params tab

Steps to Reproduce the bug/problem

  1. After opening the app, paste https://api.foss42.com/country/data?code=US in the url field Screenshot 2024-02-23 at 7 05 41 PM

Expected behavior

  1. If we paste a url which has parameters in it, it should be synced with params tab Screenshot 2024-02-23 at 7 06 35 PM
  2. If we add params in the params tab, they should get added in the url.

Device Info (The device where you encountered this issue):

  • OS: MacOS
  • Version: Sonoma 14.3.1

CH1NRU5T avatar Feb 23 '24 13:02 CH1NRU5T

Yes this syncup should be added to API Dash

animator avatar Feb 24 '24 00:02 animator

@animator I would like to work on this. Can you assign it to me?

YoussefMoRabie avatar Feb 24 '24 10:02 YoussefMoRabie

@animator I reckon I have figured out a way to fix this. Will finish the implementation and submit a PR after testing.

mohnishdeshpande avatar Feb 27 '24 02:02 mohnishdeshpande

@Yousef-Rabia We do not assign issues. You are free to work on it and send across a PR.

ashitaprasad avatar Feb 27 '24 02:02 ashitaprasad

Sure @mohnishdeshpande.

ashitaprasad avatar Feb 27 '24 02:02 ashitaprasad

@ashitaprasad Please see the 'Note' in the PR description regarding 'kNameValueEmptyModel'. Cheers!

mohnishdeshpande avatar Feb 27 '24 09:02 mohnishdeshpande

We had a thorough discussion regarding the approach. And we want to focus on user experience and keep it easy to use for the end user who should be able to view/edit the API endpoint without any difficulty. Adding URL parameters in the URL field hampers the readability and makes editing difficult. Proposed solution:

  • Have a separate URL preview section under the URL card (simple text with small font size with copy button) which shows the final url including all the query parameters. Users should be able to turn it off via Settings. Any query params entered in the row will automatically update the URL preview.
  • Now, coming to the point - what happens when a user pastes a url with query params or adds a query param in the url field. It should automatically get removed and should get added as a row(s) in the URL parameter section. Note, the URL previewer will show the the full URL including the query params.

cc: @mohnishdeshpande @amankumarmahavar @Tanish2002

ashitaprasad avatar Mar 13 '24 13:03 ashitaprasad