Allow the frontend code to be initialized with a preconfigured query

Created on 1 March 2025, 8 days ago

Problem/Motivation

This is a soft blocker for ✨ Create a "mini-browser" UI Postponed: needs info .

When Project Browser loads, the backend is queried for projects with some default values -- a default set of filter values (defined by the source plugin), and a default page size (12 projects). Users can obviously fiddle with these values once the project browser has booted up, but initially, it always uses those defaults.

This is a problem for "mini" browsers, which will need to initialize with a preconfigured query that lets them choose a subset of projects to show, and presumably a smaller page size. Given how Project Browser's frontend code works, the proper thing to do is to allow the frontend to be initialized with a preconfigured query that deviates from the defaults.

Proposed resolution

Extend the ProjectBrowser render element so that it can accept a #query property. This property can be NULL (default), or an array. It gets injected to the instance settings of a particular project browser. If it's present, the Svelte code uses it to assemble the initial query that gets sent to the backend.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

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

Merge Requests

Comments & Activities

  • Issue created by @phenaproxima
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    I'll deal with this one.

  • Pipeline finished with Failed
    6 days ago
    Total: 461s
    #438977
  • Pipeline finished with Failed
    6 days ago
    Total: 359s
    #438982
  • Pipeline finished with Success
    6 days ago
    Total: 392s
    #439018
  • Pipeline finished with Success
    6 days ago
    Total: 479s
    #439021
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Success
    6 days ago
    Total: 467s
    #439073
  • Pipeline finished with Success
    6 days ago
    Total: 896s
    #439079
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    This actually isn't ready yet, I need to keep working on it.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Failed
    6 days ago
    Total: 598s
    #439128
  • Pipeline finished with Failed
    6 days ago
    Total: 378s
    #439136
  • Pipeline finished with Failed
    6 days ago
    Total: 450s
    #439137
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Success
    6 days ago
    Total: 925s
    #439152
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Failed
    5 days ago
    Total: 534s
    #440129
  • Pipeline finished with Failed
    5 days ago
    Total: 475s
    #440143
  • Pipeline finished with Failed
    5 days ago
    Total: 373s
    #440151
  • Pipeline finished with Failed
    5 days ago
    Total: 464s
    #440158
  • Pipeline finished with Canceled
    5 days ago
    Total: 397s
    #440175
  • Pipeline finished with Failed
    5 days ago
    Total: 397s
    #440178
  • Pipeline finished with Failed
    5 days ago
    Total: 530s
    #440183
  • Pipeline finished with Canceled
    5 days ago
    Total: 149s
    #440217
  • Pipeline finished with Failed
    5 days ago
    Total: 505s
    #440220
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Failed
    5 days ago
    Total: 490s
    #440234
  • Pipeline finished with Success
    5 days ago
    Total: 1170s
    #440246
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Success
    5 days ago
    Total: 580s
    #440317
  • πŸ‡ͺπŸ‡ΈSpain penyaskito Seville πŸ’ƒ, Spain πŸ‡ͺπŸ‡Έ, UTC+2 πŸ‡ͺπŸ‡Ί

    Needs work because of the form validation. Everything else could be follow-ups.

  • πŸ‡ͺπŸ‡ΈSpain penyaskito Seville πŸ’ƒ, Spain πŸ‡ͺπŸ‡Έ, UTC+2 πŸ‡ͺπŸ‡Ί

    Didn't mention but functionality wise worked as expected, aside of WSOD if I have `page_sizes: dafdfadc`, which I can without hacking config.

    Screenshot of 2 PBs in a dashboard:

  • Pipeline finished with Failed
    5 days ago
    Total: 584s
    #440362
  • Pipeline finished with Canceled
    5 days ago
    Total: 223s
    #440365
  • Pipeline finished with Canceled
    5 days ago
    Total: 96s
    #440366
  • Pipeline finished with Failed
    5 days ago
    Total: 424s
    #440367
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Failed
    5 days ago
    Total: 465s
    #440368
  • Pipeline finished with Success
    5 days ago
    Total: 440s
    #440372
  • πŸ‡ͺπŸ‡ΈSpain penyaskito Seville πŸ’ƒ, Spain πŸ‡ͺπŸ‡Έ, UTC+2 πŸ‡ͺπŸ‡Ί

    My only serious concern was the validation. Once that is added, I think this is RTBC. Everything else can be minor follow-ups.

  • Pipeline finished with Success
    4 days ago
    Total: 372s
    #440901
  • Pipeline finished with Failed
    4 days ago
    Total: 426s
    #440958
  • πŸ‡ΊπŸ‡ΈUnited States tim.plunkett Philadelphia

    Saving credit

  • Pipeline finished with Skipped
    4 days ago
    #441020
  • Pipeline finished with Success
    4 days ago
    Total: 2340s
    #440976
  • πŸ‡ΊπŸ‡ΈUnited States tim.plunkett Philadelphia

    PHPStan is never wrongβ„’!
    Love the refactor since yesterday, as well as the docs on the render element. Great work!

    Merged !768 πŸŽ‰

Production build 0.71.5 2024