Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase getSchemaRequested/getSchemaResponse to public methods #240

Open
robbieaverill opened this issue Sep 11, 2017 · 5 comments
Open

Comments

@robbieaverill
Copy link
Contributor

robbieaverill commented Sep 11, 2017

Controllers that want to use the new React form builder style APIs can use LeftAndMain::getSchemaRequested and ::getSchemaResponse to help with the client app communication.

Extensions to LeftAndMain controllers can't though because they're protected methods.

As a result, you see examples like this happening instead.

At this stage I can only see asset-admin will be affected by this in core packages.

Related issues

@chillu
Copy link
Member

chillu commented Sep 11, 2017

What use case needs Extension rather than extending a base controller? I can see the need in ModalController, but what else is this blocking at the moment?

@robbieaverill
Copy link
Contributor Author

So the use case I have at the moment is content review, which adds some functionality to CMSPageEditController via a LeftAndMainExtension.

I suppose that two immediate possibilities that don't involve changing the visibility in LeftAndMain could be to increase the visibility in the LeftAndMainExtension instead, or to use entirely separate controllers instead of extending the CMS controller.

@tractorcow
Copy link
Contributor

I'd rather move it out of LeftAndMain altogether. What about putting it in FormSchema?

@tractorcow
Copy link
Contributor

getSchemaRequested is 2 lines; I'm not worried so much if someone has to inline this somewhere.

@chillu chillu removed this from the Recipe 4.0.0 milestone Oct 6, 2017
@tractorcow
Copy link
Contributor

tractorcow commented Jan 23, 2018

This logic needs to be shifted out of LeftAndMain, and I would prefer to put it into LeftAndMainFormRequestHandler which is where all form-schema response handling should be done.

The forms themselves are the natural delegates for handling their own schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants