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

Fix issues with facet badges #4057

Merged

Conversation

EreMaijala
Copy link
Contributor

  • Count badges for checkbox facets were on wrong level and not right-aligned properly.
  • Height and top settings in sandal and sandal5 caused misaligned numbers in badges.

- Count badges for checkbox facets were on wrong level and not right-aligned properly.
- Height and top settings in sandal and sandal5 caused misaligned numbers in badges.
@EreMaijala EreMaijala requested a review from demiankatz November 5, 2024 12:44
@demiankatz demiankatz changed the base branch from dev to release-10.1 November 5, 2024 12:55
Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

Merging other PRs created some conflicts here, which I have resolved for you to save time.

Just one question based on a code review; once that's answered, I'll take some time looking at this hands-on (and/or ask for @sturkel89's help).

@@ -493,7 +493,7 @@ VuFind.register('sideFacets', function SideFacets() {
.done(function onGetSideFacetsDone(response) {
$.each(response.data.facets, function initFacet(facet, facetData) {
var containerSelector = typeof facetData.checkboxCount !== 'undefined'
? '.checkbox-filter' : ':not(.checkbox-filter)';
? '.checkboxFilter ' : ':not(.checkbox-filter)';
Copy link
Member

Choose a reason for hiding this comment

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

This is quite confusing. Is it intentional that you're using .checkboxFilter in one case but .checkbox-filter in the other? If so, maybe a comment would be in order to clarify that.

I pondered whether introducing the .checkbox-filters class from #4058 early might help, but actually I'm not convinced that it would -- .checkbox-filter vs. .checkbox-filters also raises questions about whether there might be an accidental typo... so I think in either case, a comment here would be justified.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, that was a bit confusing. Now replaced with .facet-group, which also aligns nicely with #4058.

@demiankatz
Copy link
Member

@EreMaijala, the code looks good to me now, but I confess that I can't remember how to turn on counts in checkbox facets to test! Is that only supported by certain backends? Can you refresh my memory? I wonder if some improved documentation in the .ini files is needed too, if this is just a setting that I couldn't find...

@demiankatz demiankatz added this to the 10.1.1 milestone Nov 5, 2024
@EreMaijala
Copy link
Contributor Author

@EreMaijala, the code looks good to me now, but I confess that I can't remember how to turn on counts in checkbox facets to test! Is that only supported by certain backends? Can you refresh my memory? I wonder if some improved documentation in the .ini files is needed too, if this is just a setting that I couldn't find...

It's not possible without customization at the moment, but I think I can provide another PR to enable them.

@EreMaijala
Copy link
Contributor Author

@demiankatz Meanwhile the easiest way to test this is to hack \VuFind\AjaxHandler\GetSideFacets::getCheckboxFacetCount to:

    protected function getCheckboxFacetCount($facet, Results $results)
    {
        return rand(0, 100000);
    }

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

Thanks, @EreMaijala, looks good to me now!

@demiankatz demiankatz merged commit d62c062 into vufind-org:release-10.1 Nov 7, 2024
6 checks passed
@demiankatz demiankatz deleted the release-10.1-fix-facet-badges branch November 7, 2024 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants