Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter bugfixes #848

Merged
merged 5 commits into from
May 7, 2024
Merged

Filter bugfixes #848

merged 5 commits into from
May 7, 2024

Conversation

sarahfossheim
Copy link
Contributor

@sarahfossheim sarahfossheim commented May 1, 2024

Fixed:

@@ -88,8 +88,13 @@ class Filters {
techSelector.before(errorMsg);
}

/* Get a list of technologies */
const techs = this.technologies;
const sortedTechs = techs.sort((a, b) => a.technology - b.technology);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per #845 (comment) let's revert back to sorting by # sites

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll just revert back for now, and suggest we add more user-friendly dropdowns as a separate action item (so deciding on a sort order and design for it doesn't block the other bugfixes in this PR). If we keep it by origins, then we should implement a component more similar to the old report, where we can display the numbers as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM!

@@ -107,7 +112,8 @@ class Filters {
updateGeo() {
const select = document.querySelector('select#geo');
select.innerHTML = '';
this.geos.forEach((geo) => {
const sortedGeos = this.geos.sort((a, b) => a.geo !== b.geo ? a.geo < b.geo ? -1 : 1 : 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per #845 (comment) let's revert back to sorting by # sites

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See: #848 (comment)

For geos I'm wondering if alphabetical might make it easier to find specific countries, as that's how most country selectors on the web are sorted alphabetically. If I want to find Norway, I know I still have to scroll further when I see "Finland" but am close when I see "Netherlands" or "North Korea". Maybe a good one to look for some more feedback/user tests on, or try out two different designs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do also like how the Data Studio select list includes a search filter. More complex to reimplement but could give us the best of both.

image

selectedTechs.forEach(selectedTech => selectedTechInfo.push(this.technologies.find(tech => tech.technology === selectedTech)));
// Get the techs associated with the selected category
const selectedCategory = this.categories.find(category => category.category === event.target.value);
const selectedTechs = selectedCategory?.technologies;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a fallback in case selectedCategory is null, to avoid breaking the forEach below

Suggested change
const selectedTechs = selectedCategory?.technologies;
const selectedTechs = selectedCategory?.technologies || [];

Copy link
Member

@rviscomi rviscomi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rviscomi rviscomi merged commit 80a314d into main May 7, 2024
8 checks passed
@rviscomi rviscomi deleted the cwvtech-bugfixes branch May 7, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants