Skip to content
Snippets Groups Projects

Allow dashboard and group issues/MRs to be filtered by label

Merged Douwe Maan requested to merge filter-label into master

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 class GroupLabel
  • Would this be better as a Struct?

    For both this and GroupMilestone I'm not sure they need to be "model" classes -- they're only used in their respective service classes. Maybe we can move their definitions there.

    Edited by Robert Speicher
  • Author Maintainer

    I think both make sense as separate models because they are interacted with as such, especially GroupMilestone which is basically the main model on /groups/:group/milestones/:title.

  • 92 92 end
    93 93 end
    94 94
    95 def project_labels_options(project)
    96 labels = project.labels.to_a
    97 labels.unshift(Label::None)
    98 labels.unshift(Label::Any)
    99 options_from_collection_for_select(labels, 'name', 'title', params[:label_name])
    95 def projects_labels_options
    96 labels =
    97 if @project
    98 @project.labels
    99 else
    100 Label.where(project_id: @projects)
    101 end
    • Is this logic branch covered by specs? Is there a case where neither of these instance variables is set?

    • Author Maintainer

      Not specifically, but it's covered by feature specs for the pages this in used in that would fail if this crashed.

      There is no case where neither is set, because it's only used in issuable indexes, more specifically the dashboard, group and project issue and MR indexes, all of which have either.

  • Reassigned to @DouweM

  • Author Maintainer

    @rspeicher It allows us to go to the gitlab-org group and find promised issues across gitlab-ce and gitlab-ee. The use case is basically the same as filtering milestones across projects.

  • Douwe Maan Reassigned to @jeroenvanbaarsen

    Reassigned to @jeroenvanbaarsen

  • Reassigned to @rspeicher

  • Robert Speicher Status changed to merged

    Status changed to merged

  • Picked into 8-1-stable.

  • Robert Speicher mentioned in commit f4d3639a

    mentioned in commit f4d3639a

  • Robert Speicher mentioned in commit c856a7a5

    mentioned in commit c856a7a5

  • Please register or sign in to reply
    Loading