-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add form preview documentation and create a generic form preview controller #17589
Conversation
26e28db
to
66522e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very solid, thanks for taking the time to write that down so detailed 🙇 I just have one remark.
@@ -31,22 +31,13 @@ | |||
import { Controller } from '@hotwired/stimulus'; | |||
|
|||
export default class ProjectLifeCyclesFormController extends Controller { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you thought about letting ProjectLifeCyclesFormController
inherit from FormPreviewController
? Thus you would not have register two controllers and handle the dispatched event in the html but can do it directly in the controller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea was that the FormPreviewController
can also be used as a standalone controller and wanted to communicate with it that way.
However, inheritance in this case would definitely make things simpler. The dispatching logic could be spared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HDinger I changed the ProjectLifeCyclesFormController
to inherit from the FormPreviewController
.
I also cherry picked a bugfix related to this code from the release branch and updated the docs.
0ab9106
to
c7fa8b3
Compare
This way the live example can be accessed from the previews library too, and not just from the form pattern documentation.
…sing. Update docs.
Ticket
https://community.openproject.org/wp/60573
What are you trying to accomplish?
Follow up documentation of the form preview pattern implemented in the Stages and Gates Project Overview page. Additionally a general form preview stimulus controller has been extracted that could be used as plug and play on any form.
Screenshots
What approach did you choose and why?
The documentation includes a live example of how to use the form preview stimulus controller. Additionally it describes how our backend services can handle the previews easily.
Merge checklist