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

Allow filtering by label #1568

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

BClark88
Copy link
Contributor

@BClark88 BClark88 commented Jan 2, 2025

Adds a means of selecting labels in the GoodJob Dashboard

image

const selectedValues = Array.from(labelFilter.selectedOptions).map(option => option.value);
const allLabelsOption = labelFilter.querySelector('option[value="_all"]');

if (selectedValues.includes('_all')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's probably a better way to do this; I don't write a lot of javascript

Comment on lines +35 to +40
filtered_query(params.slice(:queue_name))
.joins("CROSS JOIN unnest(labels) AS label")
.group("label")
.order("label")
.count
.to_h
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As you mentioned, this probably needs to be moved into something that can be done asynchronously

@BClark88 BClark88 marked this pull request as ready for review January 2, 2025 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Inbox
Development

Successfully merging this pull request may close these issues.

1 participant