So the module can manage REST resources, but the UI is completely messed up. I need a hand with this.

REST   d8b.local_.png

Comments

juampynr’s picture

The hierarchy should be:

- Resources (ie. node, user, taxonomy).
- Methods (GET, POST, PATCH, PUT)
- Formats (json, xml...)
- Autentication (cookie, http_basic...)

Ideally each level should toggle automatically.

hypertext200’s picture

@juampy, this is an interesting module that I can put my time in, So Methods, Formats etc are going to be global settings or individual setting those correspond to the Resources?. What do you mean by "Ideally each level should toggle automatically."?.

yoroy’s picture

One approach could be

1. Have a page that only lists the resources but in two sections: enabled, disabled. Similar to the views overview
2. For each enabled resource have a dropbutton with links to Methods, Formats, Auth.

But looks like each resource has its own methods and each method has its own formats and each format has its own authentication?

Resource 1
- Format A
-- Authentication
- Format B
-- Authentication
Resource 2
- Format A
-- Auth

etc?

yoroy’s picture

Issue tags: +D9UX usability
yoroy’s picture

Issue tags: -D9UX usability +Usability

tags

juampynr’s picture

Each resource AND HTTP method has its own formats and authentication providers.

juampynr’s picture

At the end all this module does is to provide an interface for the settings of rest module. These are written at sites/default/files/config_somelongid/active/rest.settings.yml.

Here is an example of how it looks like. You can see the tree structure that I was trying to resemble in the UI:

resources:
  'entity:node':
    GET: {  }
    POST: {  }
    DELETE: {  }
    PATCH: {  }
  'entity:user':
    GET:
      supported_auth:
        - http_basic
        - oauth
        - cookie
      supported_formats:
        - hal_json
        - json
    POST:
      supported_auth:
        - http_basic
    DELETE:
      supported_auth:
        - http_basic
        - oauth
        - cookie
    PATCH:
      supported_auth:
        - http_basic
        - oauth
        - cookie
capynet’s picture

Assigned: Unassigned » capynet
Status: Active » Needs review
StatusFileSize
new6.46 KB

Hi, Here is a patch may help.
I've needed modify submit callback to work properly with the new changes.

juampynr’s picture

Status: Needs review » Active

Definitively an improvement. Thanks! I have committed it.

I started implementing a simpler approach that resembles the UI to administer Views (see admin/structure/views). Progress can be seen and contributed at branch 2065855-improve-ui.

juampynr’s picture

StatusFileSize
new218.69 KB

Now resources are listed as Views UI does it. Pending to add the status of each enabled resource and a select button with operations.

Here is the UI so far at branch 2065855-improve-ui:

restui.png

juampynr’s picture

Assigned: capynet » Unassigned
StatusFileSize
new29.1 KB

Operations are now listed. Pending to implement them. First I want to fix the Description column.

Selection_001.png

juampynr’s picture

StatusFileSize
new22.47 KB

Added description column and implemented dummy handler for Enable/Disable operations.

juampynr’s picture

Status: Active » Fixed
StatusFileSize
new114.07 KB
new308.09 KB

Fixed.

Here are two attachments of how the new UI looks like.

List of all resources (enabled and then disabled). The Enabled ones have a description column:

rest_revamped.png

And this is the edit page for an enabled resource (thanks @capynet for the tips on theming):

resource_settings.png

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