# Report view UX improvements when filtering on category

**URL:** https://meta.discourse.org/t/report-view-ux-improvements-when-filtering-on-category/93245
**Category:** UX
**Created:** [July 26, 2018, 11:30pm UTC](https://meta.discourse.org/t/report-view-ux-improvements-when-filtering-on-category/93245 "2018-07-26T23:30:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [July 26, 2018, 11:30pm UTC](https://meta.discourse.org/t/report-view-ux-improvements-when-filtering-on-category/93245/1 "2018-07-26T23:30:14Z")

</div>

I would like to improve the `/admin/reports/xxx` page category filtering . This improvement would require two tasks:

- Check every report for category filtering: should make sure that each report in `report.rb` which could potentially be filtered on category have it, that `report_spec.rb` tests it and than the category filter is correctly shown on the page.

- It should make the difference between parent and child category. If you select parent category it should always include children.

@misaka4e21 would you be interested to work on this? I can offer any assistance and review you need on this.

---

<div class="post-metadata">

### Author: ![misaka4e21](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@misaka4e21](https://meta.discourse.org/u/misaka4e21)
#### Post date: [July 29, 2018, 9:27pm UTC](https://meta.discourse.org/t/report-view-ux-improvements-when-filtering-on-category/93245/2 "2018-07-29T21:27:00Z")

</div>

So, is it true that the two tasks are:

1. Test category filtering in `report_spec.rb`
2. Include child category data in their parent category’s report

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [July 30, 2018, 1:38pm UTC](https://meta.discourse.org/t/report-view-ux-improvements-when-filtering-on-category/93245/3 "2018-07-30T13:38:40Z")

</div>

We need to make sure sub categories are included in parent categories, eg:

First one is filtered on: Support-\>wordpress and we see there are 2 flags 24th march 2018 but second screen is Filtering only on Support and we don’t see these 2 flags on 24th march 2018:

 ![19](https://global.discourse-cdn.com/meta/original/3X/7/f/7fade77093d36b5e03e6a5a8d2011b31573f9440.png)  
 ![26](https://global.discourse-cdn.com/meta/original/3X/6/1/61b091f504b2359fd4cd8aae1437359aae911bea.png)

Also it’s not only about tests about category filtering in report\_spec.rb, there are already tests for some of them. It’s in multiple parts:

- checking if any report doesn’t support category filtering today and you think should support it and then add it
- add category filtering tests to any report that support category filtering

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [August 1, 2018, 7:29am UTC](https://meta.discourse.org/t/report-view-ux-improvements-when-filtering-on-category/93245/4 "2018-08-01T07:29:07Z")

</div>

Also, many of the current reports in admin are missing the category dropdown even though it is applicable, that needs fixing sooner rather than later.

---

<div class="post-metadata">

### Author: ![misaka4e21](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@misaka4e21](https://meta.discourse.org/u/misaka4e21)
#### Post date: [August 1, 2018, 9:21am UTC](https://meta.discourse.org/t/report-view-ux-improvements-when-filtering-on-category/93245/5 "2018-08-01T09:21:25Z")

</div>

Making some changes about [Report view UX improvements when filtering on category](https://meta.discourse.org/t/report-view-ux-improvements-when-filtering-on-category/93245)  
[Comparing discourse:master…misaka4e21:report-specs · discourse/discourse · GitHub](https://github.com/discourse/discourse/compare/master...misaka4e21:report-specs?expand=1)  
[https://github.com/discourse/discourse/pull/6241](https://github.com/discourse/discourse/pull/6241)

Currently implemented:

- category\_filtering
  1. report\_top\_referred\_topics
  2. report\_top\_traffic\_sources
  3. report\_post\_edit

- category\_filtering with subcategory topics
  1. report\_top\_referred\_topics
  2. report\_top\_traffic\_sources
  3. report\_post\_edit
  4. report\_posts
  5. report\_topics
  6. report\_topics\_with\_no\_response

- category\_filtering tests (without subcategory topics)
  1. report\_posts
  2. report\_topics\_with\_no\_response

- subcategory topics tests
  1. `in_category_and_subcategories` in `topic_spec.rb`
  2. flags and topics\_with\_no\_response in `report_spec.rb`
