Retrieve every page of results

Created on 1 February 2023, almost 2 years ago

Problem/Motivation

While working on #3314975: Add radio buttons widget and Add select list widget Needs work , we noticed it is confusing when the API returns more than 50 results.
Only the first 50 are displayed in the widget.

Steps to reproduce

Add a jsonapi_reference field with a select widget referencing a taxonomy with more than 50 terms.
Only the first 50 terms are displayed in the widget

Proposed resolution

JsonApiClient::search() should loop on every page of results.

Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

🇫🇷France prudloff Lille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @prudloff
  • @prudloff opened merge request.
  • Status changed to Needs review almost 2 years ago
  • 🇫🇷France prudloff Lille

    Here is a basic implementation.
    However, it assumes you're not using this on a query with thousands of results.

  • 🇬🇧United Kingdom Eli-T Manchester

    I think this idea makes sense ❤️

    I think we'd have to make such pagination through the results optional though; on a large dataset when using the autocomplete widget, this would lead to a worse user experience; you would have to wait far longer for a response, and if you're getting more than 50 results for an autocomplete, another 50 aren't going to be helpful.

  • 🇫🇷France prudloff Lille

    Indeed, I think it only makes sense for some widgets and if the dataset is not too huge.

Production build 0.71.5 2024