Improve registry_search component query params generation
Context
Improve registry search query params generation inline with behaviour in issues, merge requests pages.
Since the URL generated contains unnecessary query params already, this will look worse as we add one more filter in Filter package registry UI to show packages wit... (#451054 - closed)
The changes affect pages which use the persisted_search component which is package, container, terraform & harbor registry.
Solution
Stops appending query params which are empty, should look like:
Before | After |
---|---|
?type=Generic&version=&orderBy=created_at&sort=desc&search[]=gl&search[]= |
?orderBy=created_at&sort=desc&search[]=gl&type=Generic |