Problem/Motivation

Currently, the category list rendered on the left is created by reading from "fixtures/category_list.json" directly. The code in the svelte file is:
import category_list from '../../fixtures/category_list.json';

We should not read from a fixture, instead we should read from the internal endpoint which will read from the fixture or from d.org (depending on the plugin that is in use). The endpoint is "/drupal-org-proxy/categories".

Proposed resolution

Change the svelte logic to read from the endpoint.

Remaining tasks

  • ✅ Create internal endpoint
  • ☐ Use that endpoint in svelte

User interface changes

None.

API changes

Yes, create a new endpoint. UPDATE: this is done already and in the main branch.

Data model changes

None.

Release notes snippet

Add and consume endpoint to get the available categories.

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

fjgarlin created an issue. See original summary.

fjgarlin’s picture

I suggest to use the "/drupal-org-proxy/categories" path to retrieve the information. I'm working on some deeper d.org integration and I am creating that endpoint as part of it.

fjgarlin’s picture

Status: Active » Needs review
StatusFileSize
new1.66 KB

This quick addition can unblock the second task. The mentioned endpoint will be available and will return all categories.

fjgarlin’s picture

Note that if https://www.drupal.org/project/project_browser/issues/3278352#comment-14... gets merged first, then the provided patch is no longer needed.

fjgarlin’s picture

fjgarlin’s picture

The patch is not needed any more, but the rest of the issue should now focus on reading from the endpoint on the Svelte side of things.
I will update the description.

fjgarlin’s picture

Status: Needs review » Active
fjgarlin’s picture

Issue summary: View changes

narendraR made their first commit to this issue’s fork.

narendrar’s picture

Status: Active » Needs review
fjgarlin’s picture

Status: Needs review » Reviewed & tested by the community

Great work here @narendraR. I tested the code and saw the call to the "categories" endpoint and how everything is populated from there.

The code changes look good too.

Marking as RTBC.

tim.plunkett made their first commit to this issue’s fork.

tim.plunkett’s picture

Status: Reviewed & tested by the community » Fixed

Merged! Thanks

Status: Fixed » Closed (fixed)

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