Closed Bug 1407807 Opened 7 years ago Closed 7 years ago

Remove Tier as a choice from the job filter field dropdown

Categories

(Tree Management :: Treeherder, defect, P4)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jfrench, Assigned: jfrench, Mentored)

Details

(Keywords: good-first-bug, Whiteboard: [lang=js])

Attachments

(1 file)

Maybe this is pilot error, but here's the steps to reproduce:

o Launch production
o Click on the new "filter by job field" icon in the navbar
o Select from the filter field drop down, "Tier"
o Enter either "1" or "2" into the adjacent input field
o Click the Add button

Expected:
Some sort of filtering on the Tier value.

Observed:
The Filter bar disappears.

Optionally, try this:
o Select filter field dropdown "Tier"
o Enter "a", or any other alphabetic character
o Click the Add button

Observed:
"Tier"s "1", "2", and "a" get added. So you have Active Filters: "Tier 1" "Tier 2" and "Tier a".

If Tier is a restricted type of value, I would have thought the UI would only present a drop down of specific choices? Like it does when filtering by the Failure Classification drop down.
Good find.  We should just remove Tier from the list of field filters we accept.  It's redundant anyway.  So it could be removed from https://github.com/mozilla/treeherder/blob/master/ui/js/services/jobfilters.js#L104

That should just eliminate the problem.  :)
Mentor: cdawson
Keywords: good-first-bug
Whiteboard: [lang=js]
I had a quick look at this. Pulling only that element in the array results in a console error, perhaps related to the filter cache which is still expecting tier. So there might be some additional tweak here.
Summary: Job Name tier filter behavior doesn't appear to work as expected → Remove Tier as a choice from the job filter field dropdown
ahh, you're right.  Since it has a default value, it can't just be removed.  we'll have to add a mechanism to just hide it from the dropdown.  maybe adding another field to that FIELD_CHOICES object.  Or by some other mechanism.
I think can do it in one line with an ng-if in the markup. Or with a generalized solution as you say by adding multiple new lines for the new field eg. 'shouldShow' to the FIELD_CHOICES object. I'll put up a PR with the first way, since it is a one-off exclusion at present and you can let me know your preference.
Assignee: nobody → tojonmz
Status: NEW → ASSIGNED
Comment on attachment 8918389 [details] [review]
[treeherder] tojon:suppress-invalid-jobfilters > mozilla:master

For review/merge at your leisure. :)
Attachment #8918389 - Flags: review?(cdawson)
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Attachment #8918389 - Flags: review?(cdawson) → review+
Verified fixed on production.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: