plone.restapi icon indicating copy to clipboard operation
plone.restapi copied to clipboard

Add @userschema endpoint for getting the user schema.

Open sneridagh opened this issue 6 years ago • 23 comments

Related to #706

sneridagh avatar Mar 23 '19 22:03 sneridagh

@sneridagh thanks for creating this Pull Request and help improve Plone!

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass.

Whenever you feel that the pull request is ready to be tested, either start all jenkins jobs pull requests by yourself, or simply add a comment in this pull request stating:

@jenkins-plone-org please run jobs

With this simple comment all the jobs will be started automatically.

Happy hacking!

mister-roboto avatar Mar 23 '19 22:03 mister-roboto

@jenkins-plone-org please run jobs

sneridagh avatar Mar 23 '19 22:03 sneridagh

This is the initial work for adding support to get the schema of zc3.forms (#480), that's why the directory is just called schema, for later add the forms support. I will draft the documentation first for such endpoint.

sneridagh avatar Mar 23 '19 22:03 sneridagh

@jenkins-plone-org please run jobs

sneridagh avatar Mar 23 '19 23:03 sneridagh

Talked about the @schema endpoint with @tisto, agreed on leave it in the fridge for now, since if we have to define the form in the backend is the same effort than we directly customize it in the frontend. Then still, we will have to define the widget mapping (and overrides for specific forms, if any) somehow. So the pros of having it might be very little.

sneridagh avatar Mar 25 '19 10:03 sneridagh

@jenkins-plone-org please run jobs

sneridagh avatar Mar 25 '19 10:03 sneridagh

We need this @userschema endpoint in a project, we can work on updating this PR, at least to have the endpoint working.

erral avatar Jun 15 '21 10:06 erral

@erral awesome!

tisto avatar Jun 15 '21 14:06 tisto

@jenkins-plone-org please run jobs

erral avatar Jun 17 '21 09:06 erral

We have checked the endpoint and it works as expected, it returns the correct jsonschema for the user profile schema.

I have rebased the branch and run black.

erral avatar Jun 17 '21 14:06 erral

@jenkins-plone-org please run jobs

erral avatar Jun 18 '21 08:06 erral

@jenkins-plone-org please run jobs

erral avatar Aug 31 '21 09:08 erral

@jenkins-plone-org please run jobs

erral avatar Dec 13 '21 19:12 erral

@jenkins-plone-org please run jobs

erral avatar Dec 14 '21 17:12 erral

@jenkins-plone-org please run jobs

erral avatar Dec 23 '21 07:12 erral

@nileshgulia1 but this error is related to the @users endpoint and not to @userschema right? I am adding a test with different field types and the user schema information is rendered correctly. Perhaps what we need is a more complete @users endpoint test that checks all possible field types. Right now it only tests basic stuff.

erral avatar Feb 03 '22 07:02 erral

I have checked it and indeed the user serializer does not take into account datetime objects: https://github.com/plone/plone.restapi/blob/master/src/plone/restapi/serializer/user.py#L50

erral avatar Feb 03 '22 07:02 erral

@erral Indeed, its with @users endpoint. Apart from date_time, some of the existing member fields like "portrait" currently does not work well with volto.

nileshgulia1 avatar Feb 03 '22 08:02 nileshgulia1

The other fields work well, I think we can merge it then and take care of other tasks/bugs in subsequent PRs.

nileshgulia1 avatar Feb 03 '22 08:02 nileshgulia1

And there is no deserializer of users, the property set is done manually without deserializing the user: https://github.com/plone/plone.restapi/blob/master/src/plone/restapi/services/users/update.py#L104

erral avatar Feb 03 '22 08:02 erral

The other fields work well, I think we can merge it then and take care of other tasks/bugs in subsequent PRs.

Yes I do agree. I have some changes and tests for the @users endpoint, and we can discuss it further there.

erral avatar Feb 03 '22 08:02 erral

@jenkins-plone-org please run jobs

erral avatar Feb 03 '22 09:02 erral

LGTM!

@tisto could you please take a look? Since I opened it I cannot approve it :)

Then we could merge https://github.com/plone/volto/pull/2917 and release it on 15

sneridagh avatar Mar 02 '22 14:03 sneridagh

Deploy Preview for plone-restapi ready!

Name Link
Latest commit 540346790e462c96c6afe475c124ef5f2a0cc58f
Latest deploy log https://app.netlify.com/sites/plone-restapi/deploys/6333faaca5a9b40009df2591
Deploy Preview https://deploy-preview-707--plone-restapi.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Sep 17 '22 11:09 netlify[bot]

@jenkins-plone-org please run jobs

sneridagh avatar Sep 17 '22 11:09 sneridagh

Ok, another attempt to merge this one. @tisto I think all is good enough to have this one in. Could you please take a look? Since I opened it I cannot approve it :)

Then we could merge https://github.com/plone/volto/pull/2917

@stevepiercy the Netlify build is red? Could you please take a look?

sneridagh avatar Sep 17 '22 11:09 sneridagh

@stevepiercy uh I got what happened. I didn't know that we move to md in here! Solved!

sneridagh avatar Sep 17 '22 11:09 sneridagh

@jenkins-plone-org please run jobs

nileshgulia1 avatar Sep 28 '22 07:09 nileshgulia1