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

Expose good job labels in dashboard #1561

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

Conversation

BClark88
Copy link

@BClark88 BClark88 commented Dec 12, 2024

Does the following:

  • Exposes labels in the dashboard
  • Allows the user to search by label using a filter

Supports selecting multiple labels:
image

What I haven't done: translations for all languages. This does emit a warning in the console:

A span tag was parsed inside of a <select> which was not inserted into the document. This is not valid HTML and the behavior may be changed in future versions of chrome. <option value=​"_all" selected=​"'selected'">​All Labels​</option>​slot

<select name="labels[]" id="label_filter" class="form-select form-select-sm" size="2" multiple="">
            <option value="_all" selected="'selected'">All Labels</option>

              <option value="blah label">blah label (5)</option>
              <option value="my label 1">my label 1 (1,778)</option>
              <option value="my_labe">my_labe (490)</option>
              <option value="my_label2">my_label2 (1,778)</option>
              <option value="other label">other label (5)</option>
          </select>

@@ -71,5 +82,29 @@
});
})
})

document.addEventListener("DOMContentLoaded", () => {
Copy link
Author

Choose a reason for hiding this comment

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

I don't write a lot of javascript, so I wouldn't be surprised if there's a better way to do this

<div class="me-md-2 mb-2 mb-md-0 flex-fill">
<%= label_tag "query", t(".search"), class: "visually-hidden" %>
<%= search_field_tag "query", params[:query], class: "form-control form-control-sm", placeholder: t(".placeholder"), autocomplete: "off" %>
</div>

<div class="d-flex flex-col align-items-end">
<div class="d-flex flex-col align-items-start">
Copy link
Author

Choose a reason for hiding this comment

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

I did this so that the Search and Clear buttons were positioned nicely. Otherwise it would look like this:
image

@BClark88 BClark88 marked this pull request as ready for review December 12, 2024 22:42
@BClark88 BClark88 marked this pull request as draft December 12, 2024 23:25
@BClark88 BClark88 marked this pull request as ready for review December 13, 2024 02:41
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