Project Browser makes a pointless API request for categories

Created on 26 January 2025, about 19 hours ago

Problem/Motivation

Source plugins have a getFilterDefinitions() method, the base implementation of which calls $this->getCategories() to produce a list of categories as one of the filters.

The Svelte code also makes an AJAX request to the backend, which...calls getCategories() on the source plugin. Since the categories are available up front when the Svelte app loads, this request is completely pointless, makes the code more confusing, and necessitates an extra route and method of EnabledSourceHandler which is not ultimately needed.

Proposed resolution

Remove EnabledSourceHandler::getCategories() entirely, and the route which calls it. Then refactor the MultipleChoiceFilter component in the Svelte code so that it uses a set of categories passed to it.

πŸ“Œ Task
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

Comments & Activities

Production build 0.71.5 2024