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.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | categories_listing_endpoint-3278333-3.patch | 1.66 KB | fjgarlin |
Issue fork project_browser-3278333
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
Comment #2
fjgarlin commentedI 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.
Comment #3
fjgarlin commentedThis quick addition can unblock the second task. The mentioned endpoint will be available and will return all categories.
Comment #4
fjgarlin commentedNote that if https://www.drupal.org/project/project_browser/issues/3278352#comment-14... gets merged first, then the provided patch is no longer needed.
Comment #5
fjgarlin commentedComment #6
fjgarlin commentedThe 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.
Comment #7
fjgarlin commentedComment #8
fjgarlin commentedComment #11
narendrarComment #12
fjgarlin commentedGreat 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.
Comment #15
tim.plunkettMerged! Thanks