Problem/Motivation

I think for some applications, we only want a few resources enabled. See the following example:

Proposed resolution

Add an option to only display enabled resources in the UI.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dagmar created an issue. See original summary.

dagmar’s picture

Title: Hide disabled items » Allow to hide disabled resources
FileSize
3.32 KB

Here is the patch.

dagmar’s picture

Status: Active » Needs review
shadcn’s picture

What if we moved disabled resources inside a collapsed fieldset? Like Views UI does it.

dagmar’s picture

FileSize
3.46 KB

Good idea. Here is the patch.

e0ipso’s picture

@dagmar can you add a screenshot?

dagmar’s picture

Of course :)

dagmar’s picture

Title: Allow to hide disabled resources » Separate enabled from disabled resources
dagmar’s picture

Status: Needs review » Needs work

New resources (not overridden) are hidden in both fieldsets.

e0ipso’s picture

New resources (not overridden) are hidden in both fieldsets.

Should they be a separate fieldset instead?

Also, is the search still working as expected?

dagmar’s picture

Status: Needs work » Needs review
FileSize
3.24 KB
771 bytes

Yes the search works for both fieldsets.

This solves the problem with not overridden resources.

e0ipso’s picture

This solves the problem with not overridden resources.

How did you solve it? can you post a screenshot?

dagmar’s picture

FileSize
60.33 KB

Here is the screenshot.

logickal’s picture

Just chiming in to say that I love this idea, and the screenshots look great. I'm going to try the patch on our stack this evening and test things out.

logickal’s picture

Patch is throwing:
Notice: Undefined variable: status in Drupal\jsonapi_extras\JsonapiResourceConfigListBuilder->render() (line 92 of modules/contrib/jsonapi_extras/src/JsonapiResourceConfigListBuilder.php).

Sure enough, the filter is looking for $status, but not defined. Attached patch replaces the variable with a string, and the filter functionality works as I would expect it to.

Besides that, this is a great UI improvement!

  • e0ipso committed 3f3d8f4 on 8.x-1.x authored by logickal
    feat(UI): Separate enabled from disabled resources (#2886887 by dagmar,...

  • e0ipso committed 9a67e44 on 8.x-1.x authored by dagmar
    feat(UI): Separate enabled from disabled resources (#2886887 by dagmar,...
e0ipso’s picture

Thanks for the patch! I did not review the code (for API is hard to review). I did some smoke testing instead.

I made 2 commits to give authorship to the both of you. You rock!

dagmar’s picture

Thanks! Should we move this to fixed then?

e0ipso’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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