ongov / ckanext-ontario_theme

Theme for Ontario's CKAN based data catalogues.
https://data.ontario.ca
GNU Affero General Public License v3.0
7 stars 12 forks source link

[Story]: Add checkboxes to the items in the search filters #598

Open aleeexgreeen opened 4 weeks ago

aleeexgreeen commented 4 weeks ago

What this PR accomplishes

Issue(s) addressed

What needs review

Tests should be done on individual ministry and group pages and the dataset search page

KatiRG commented 4 weeks ago

Filters sidebar:

Access level Zero results:

Other things needing review:

Pages to test:

KatiRG commented 4 weeks ago

issue clearing filters: if I select e.g. XLSX, it will display as checked and the filter pill will also display under the search bar. If I select XLSX again to clear it, it does not clear, and a second filter pill will be added: Screenshot 2024-08-20 at 14 22 22

KatiRG commented 4 weeks ago

The count in the filter pill sometimes show 0 instead of the count shown in the facet:

Screenshot 2024-08-20 at 14 30 43

aleeexgreeen commented 4 weeks ago

The count in the filter pill sometimes show 0 instead of the count shown in the facet:

Screenshot 2024-08-20 at 14 30 43

How can I reproduce this issue?

KatiRG commented 4 weeks ago

The count in the filter pill sometimes show 0 instead of the count shown in the facet: Screenshot 2024-08-20 at 14 30 43

How can I reproduce this issue?

This is reproducible on data4. Another example (on data4): choose ministry "Energy". The facet says "Energy (12)" but the pill shows "Energy (0)".

KatiRG commented 3 weeks ago

Some strange behaviour with pill counts again. Steps to reproduce (on data4):

  1. go to datasets page and click DIOXIN (2) topic. Two open datasets will be displayed, as expected.
  2. select Forestry (3) topic. Total 5 open datasets will be displayed, as expected.
  3. now click Restricted (1) checkbox. Total 6 datasets will be displayed, as expected, however:
    • DIOXIN (0) pill shown with 0 counts
    • DIOXIN is no longer in the Topics facet list

Screenshot 2024-08-22 at 13 20 44

A similar test:

  1. go to datasets page and click DIOXIN (2) topic. Two open datasets will be displayed, as expected.
  2. click checkbox Restricted (0). Same two datasets are listed, as expected, however DIOXIN (0) pill shows 0 count.
aleeexgreeen commented 3 weeks ago

Some strange behaviour with pill counts again. Steps to reproduce (on data4):

  1. go to datasets page and click DIOXIN (2) topic. Two open datasets will be displayed, as expected.
  2. select Forestry (3) topic. Total 5 open datasets will be displayed, as expected.
  3. now click Restricted (1) checkbox. Total 6 datasets will be displayed, as expected, however:

    • DIOXIN (0) pill shown with 0 counts
    • DIOXIN is no longer in the Topics facet list

A similar test:

  1. go to datasets page and click DIOXIN (2) topic. Two open datasets will be displayed, as expected.
  2. click checkbox Restricted (0). Same two datasets are listed, as expected, however DIOXIN (0) pill shows 0 count.

@KatiRG I was able to reproduce the issues described, but the issue is because of how the topics works. The topics return the 50 topics in descending order of dataset count. The last topic in displayed in the first test has a dataset count of 3, which is higher than 2 and that's why DIOXIN is not in the topic count. The issue is that topics are no longer reducing based on selected topics, as it does on prod. Maya suggested previously, not using the checkboxes on the topics until the topics/keywords are figured out, we may have to take this approach.

KatiRG commented 3 weeks ago

Re low-count topics: As discussed with team, this case will resolve when the keywords are cleaned up, so we will let this pass for now.

KatiRG commented 1 week ago

Can you djlint the html files?

KatiRG commented 4 days ago

@aleeexgreeen I found the following case where 1 dataset exists at level Restricted but when the Restricted access level is selected with the Open checkbox selected as well (also when all checkboxes are selected), that dataset is not shown and the callout says "No datasets": Screenshot 2024-09-13 at 15 23 16

Steps to reproduce:

  1. select Restricted then deselect Open
  2. select Topic aggregates (1)
  3. select Open checkbox (and can also select Under Review checkbox so that all checkboxes are selected)
aleeexgreeen commented 4 days ago

@aleeexgreeen I found the following case where 1 dataset exists at level Restricted but when the Restricted access level is selected with the Open checkbox selected as well (also when all checkboxes are selected), that dataset is not shown and the callout says "No datasets": Screenshot 2024-09-13 at 15 23 16

Steps to reproduce:

  1. select Restricted then deselect Open
  2. select Topic aggregates (1)
  3. select Open checkbox (and can also select Under Review checkbox so that all checkboxes are selected)

Hi @KatiRG, I don't have the environment or access set up at the moment, but can you revert the change proposed in https://github.com/ongov/ckanext-ontario_theme/pull/598#discussion_r1750608059 and let me know if this is still an issue?

KatiRG commented 1 day ago

@aleeexgreeen I found the following case where 1 dataset exists at level Restricted but when the Restricted access level is selected with the Open checkbox selected as well (also when all checkboxes are selected), that dataset is not shown and the callout says "No datasets": Screenshot 2024-09-13 at 15 23 16 Steps to reproduce:

  1. select Restricted then deselect Open
  2. select Topic aggregates (1)
  3. select Open checkbox (and can also select Under Review checkbox so that all checkboxes are selected)

Hi @KatiRG, I don't have the environment or access set up at the moment, but can you revert the change proposed in #598 (comment) and let me know if this is still an issue?

Thanks @aleeexgreeen ! This solves the problem. I didn't notice the brackets around the second or grouping! I'll revert