Problem/Motivation

If you place a mini-browser block somewhere and disable pagination, you'll still see the result count displayed above the projects. This is intrusive and kinda dumb; if pagination is disabled, you can see all the projects right there.

Proposed resolution

If pagination is disabled, don't show the result count in a mini-browser. This is one-line fix in ProjectBrowser.svelte:

          {#if rowsCount}

needs to be:

          {#if rowsCount && paginate}
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

phenaproxima created an issue. See original summary.

ijf8090’s picture

Assigned: Unassigned » ijf8090
matthewsmith619’s picture

I am working on this as part of #Atlanta2025

matthewsmith619’s picture

Issue tags: +Atlanta2025
lostcarpark’s picture

Steps to reproduce:

  1. Install Drupal and Project Browser module.
  2. Go to "Structure->Block Layout"
  3. Find the "Content" block and select "Place Block"
  4. Scroll down the list of blocks and find "Contrib Modules" and "Recipes" in the Project Browser category
  5. Click "Place block" button next to "Recipes"
  6. In the block settings, uncheck "Pagination", then save
  7. Go to front page of site and view mini browser block

The browser will show "12 results" above the list of recipes

tim.plunkett’s picture

There's a test for pagination across multiple project browser instances that *should* be able to test this too.

Look for \Drupal\Tests\project_browser\FunctionalJavascript\MultipleInstancesTest::testIndependentPagination()

lostcarpark’s picture

I think the Tim's suggestion seems overkill for this, and I don't think a FunctionalJavascript test is required.

My thinking is the test should place a block with pagination enabled, and verify the result count is displayed. Then edit the block, disable pagination, and verify result count not shown.

There are some existing Functional tests in the file ProjectBrowserBlockTest.php that should be very similar, and it should be very straightforward to add a very similar test.

chrisfromredfin’s picture

I think because the fix is in Svelte code, we need a FunctionalJavascriptTest to render the JS.

chrisfromredfin’s picture

Issue tags: +Needs tests
chrisfromredfin’s picture

Assigned: ijf8090 » phenaproxima
Status: Active » Needs review
Issue tags: -Needs tests
phenaproxima’s picture

Assigned: phenaproxima » chrisfromredfin
Status: Needs review » Needs work
Issue tags: +Vienna2025

This seems reasonable to me, with solid test coverage, but I have a few questions/suggestions.

chrisfromredfin’s picture

Status: Needs work » Needs review

OK, everything here is green. Could use another look.

phenaproxima’s picture

Version: 2.0.x-dev » 2.1.x-dev
Assigned: chrisfromredfin » Unassigned
Status: Needs review » Reviewed & tested by the community
Issue tags: +backport

Makes sense to me! Thanks for the detailed comments.

chrisfromredfin’s picture

Status: Reviewed & tested by the community » Fixed

merged and cherry-picked

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.