Skip to content
Snippets Groups Projects

Colorize labels in issue search field

Merged Winnie Hellmann requested to merge winh-visual-token-labels into master
All threads resolved!

Screenshots

Before

Screen_Shot_2017-05-04_at_12.28.07

After

Screen_Shot_2017-05-04_at_13.37.28

Related Issues

Fixes #30467 (closed)

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
  • Winnie Hellmann marked as a Work In Progress

    marked as a Work In Progress

  • Winnie Hellmann resolved all discussions

    resolved all discussions

  • Winnie Hellmann added 2 commits

    added 2 commits

    • c7ea4b8a - Introduce AjaxCache class
    • f071ca00 - Colorize labels in search field

    Compare with previous version

  • Luke "Jared" Bennett resolved all discussions

    resolved all discussions

  • Winnie Hellmann mentioned in commit 870f712e

    mentioned in commit 870f712e

  • Winnie Hellmann added 2 commits

    added 2 commits

    Compare with previous version

  • Luke "Jared" Bennett mentioned in merge request !10713

    mentioned in merge request !10713

  • Winnie Hellmann mentioned in commit 63ca1b5a

    mentioned in commit 63ca1b5a

  • Winnie Hellmann added 1744 commits

    added 1744 commits

    Compare with previous version

  • Winnie Hellmann mentioned in commit 87d2b804

    mentioned in commit 87d2b804

  • Winnie Hellmann added 8 commits

    added 8 commits

    Compare with previous version

  • Winnie Hellmann mentioned in commit 2949a809

    mentioned in commit 2949a809

  • Winnie Hellmann added 21 commits

    added 21 commits

    Compare with previous version

  • Winnie Hellmann mentioned in commit 8275b927

    mentioned in commit 8275b927

  • Winnie Hellmann added 3 commits

    added 3 commits

    Compare with previous version

  • Winnie Hellmann mentioned in commit cef34d48

    mentioned in commit cef34d48

  • Winnie Hellmann added 10 commits

    added 10 commits

    Compare with previous version

  • Checked out the branch and reviewed the UX. Everything looks and works as it should :thumbsup:

  • Author Developer

    Tests and code review are remaining. The rest should be finished. :slight_smile:

  • Winnie Hellmann mentioned in commit 7122debe

    mentioned in commit 7122debe

  • added 1 commit

    Compare with previous version

  • Author Developer

    @grzesiek I haven't looked into the label controller specs yet. Apart from that, the backend work should be finished. Could you already take a look at it please? :smiley:

    Edited by Winnie Hellmann
  • Winnie Hellmann mentioned in commit 77a563ba

    mentioned in commit 77a563ba

  • Winnie Hellmann added 30 commits

    added 30 commits

    Compare with previous version

  • Winnie Hellmann
  • Winnie Hellmann mentioned in commit 1997fa44

    mentioned in commit 1997fa44

  • added 1 commit

    Compare with previous version

  • Winnie Hellmann mentioned in commit 91656a23

    mentioned in commit 91656a23

  • Winnie Hellmann added 2 commits

    added 2 commits

    Compare with previous version

  • Winnie Hellmann mentioned in commit d73a2c86

    mentioned in commit d73a2c86

  • added 1 commit

    Compare with previous version

  • Winnie Hellmann mentioned in commit 04805948

    mentioned in commit 04805948

  • Winnie Hellmann added 27 commits

    added 27 commits

    Compare with previous version

  • Winnie Hellmann mentioned in commit 6aaa48ef

    mentioned in commit 6aaa48ef

  • added 1 commit

    Compare with previous version

  • Winnie Hellmann mentioned in commit 224ce397

    mentioned in commit 224ce397

  • added 1 commit

    Compare with previous version

  • Winnie Hellmann mentioned in commit 76ea6ea0

    mentioned in commit 76ea6ea0

  • Winnie Hellmann added 10 commits

    added 10 commits

    Compare with previous version

  • Author Developer

    Only now I found out how to reproduce https://gitlab.com/gitlab-org/gitlab-ce/issues/30468#note_27698422 and pasting multiple filters at once doesn't color the labels.

    @victorwu Is that something we can cover in a subsequent merge request?

  • Is that something we can cover in a subsequent merge request?

    If my opinion is worth anything, I think this is a good idea. 14 changed files with 429 additions and 7 deletions is plenty. :)

  • Author Developer

    It looks like pasting doesn't always work anyway: #31859 (moved)

  • Author Developer

    @jschatz1 Can you review please? :smiley:

  • Winnie Hellmann unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Grzegorz Bizon
  • Grzegorz Bizon
  • @winh I left just a few questions, it looks really good, nice work!

  • Winnie Hellmann mentioned in commit 1d79ba48

    mentioned in commit 1d79ba48

  • Author Developer

    @grzesiek Thank you for the review and all the help! :thumbsup:

  • Winnie Hellmann added 81 commits

    added 81 commits

    Compare with previous version

  • Winnie Hellmann changed milestone to %9.2

    changed milestone to %9.2

  • Jacob Schatz resolved all discussions

    resolved all discussions

  • @winh no need to call labels.json twice. Grab the data before.

    cooooldude

  • assigned to @winh

  • @winh Some background for the approach you'll want for this with the current code you've provided...


    The label dropdown is a droplab dropdown that performs a single ajax request using the Ajax plugin and then filters them using the Filter plugin.

    You can see where the FilteredSearchDropdownManager maps this here: http://gitlab.com/gitlab-org/gitlab-ce/blob/c89849af47dc3ce788adbc7ef06af8a39a5347fd/app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js#L48-53

    You'll see the gl property is set to DropdownNonUser, this refers to the dropdown class used by the label dropdown.

    So, in the DropdownNonUser class, we can see we use the Ajax and Filter plugins. http://gitlab.com/gitlab-org/gitlab-ce/blob/c89849af47dc3ce788adbc7ef06af8a39a5347fd/app/assets/javascripts/filtered_search/dropdown_non_user.js#L45

    You'll want to remove all references to the Ajax plugin, including is configuration. http://gitlab.com/gitlab-org/gitlab-ce/blob/c89849af47dc3ce788adbc7ef06af8a39a5347fd/app/assets/javascripts/filtered_search/dropdown_non_user.js#L13-22

    Then, after DropdownNonUser.prototype.init does this.droplab.addHook, you'll want to do this.droplab.setData(theDataFromAjaxCache).

  • Author Developer

    no need to call labels.json twice. Grab the data before.

    @jschatz1 I agree, calling it twice is unfortunate. However changing that requires refactoring in the dropdown code which I wouldn't finish before feature freeze for %9.2. Do you want it to be moved to %9.3 then?

  • added 1 commit

    • d3cd9c33 - temporary disable spec/javascripts/bootstrap_linked_tabs_spec.js

    Compare with previous version

  • added 1 commit

    • 91815ab4 - Use absolute URLs for fixtures

    Compare with previous version

  • Author Developer

    Sorry about the confusion—the last two pushes were not intended to go into this branch.

  • Jacob Schatz approved this merge request

    approved this merge request

  • Jacob Schatz mentioned in commit a4c90a41

    mentioned in commit a4c90a41

  • merged

  • username-removed-408677 resolved all discussions

    resolved all discussions

  • Winnie Hellmann mentioned in merge request !11170 (merged)

    mentioned in merge request !11170 (merged)

  • Winnie Hellmann mentioned in issue #36852

    mentioned in issue #36852

  • Please register or sign in to reply
    Loading