Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !7928

Closed
Created Oct 01, 2014 by Administrator@rootOwner
  • Report abuse
Report abuse

Remove empty query params from many filters [failure unrelated]

  • Overview 15
  • Commits 1
  • Changes 5

Created by: cirosantilli

Before this PR, clicking on filters like sort at the issues index would give a URL with many empty parameters like:

assignee_id=&label_name=&milestone_id=&scope=all&sort=newest&state=opened

Now, assignee_id=&label_name=&milestone_id= only show if explicitly set, so the URL would be:

scope=all&sort=oldest&state=opened

The change should affect issues and merge request in indexes, group and global searches.

This works because we were using the built-in helper url_for, which removes keys which have nil values from params, while before params was being built with to_params which does not.

scope and state should also be removed if not set, but implementation there is more delicate because those params are always being set from controller and used in the logic as in https://github.com/gitlabhq/gitlabhq/blob/0f12e051c072521460fadfce2cec4e9768bc35ba/app/controllers/projects/issues_controller.rb#L131

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/cirosantilli/factor-sort-dropdown