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

Create partials for the relation controller form footers #954

Merged
merged 3 commits into from
Aug 4, 2023

Conversation

mjauvin
Copy link
Member

@mjauvin mjauvin commented Jul 27, 2023

We can now override the different Relation Controller form footers (buttons).

@mjauvin mjauvin added enhancement PRs that implement a new feature or substantial change needs review Issues/PRs that require a review from a maintainer labels Jul 27, 2023
@mjauvin mjauvin added this to the v1.2.4 milestone Jul 27, 2023
@mjauvin mjauvin requested a review from LukeTowers July 27, 2023 19:04
@mjauvin mjauvin self-assigned this Jul 27, 2023
@LukeTowers
Copy link
Member

@mjauvin it would be better to replace the contents of the footer with a call to make a relation partial as that would allow for overriding the footer contents in the same way as the other behaviors, placing a properly named partial in your controller folder.

@LukeTowers LukeTowers added needs response Issues/PRs where a maintainer is awaiting a response from the submitter and removed needs review Issues/PRs that require a review from a maintainer labels Jul 27, 2023
@mjauvin
Copy link
Member Author

mjauvin commented Jul 27, 2023

@mjauvin it would be better to replace the contents of the footer with a call to make a relation partial as that would allow for overriding the footer contents in the same way as the other behaviors, placing a properly named partial in your controller folder.

Perhaps, but would it also allow to replace this dynamically when extending a third party plugin controller?

@LukeTowers
Copy link
Member

@mjauvin sure, because plugins can extend controller's viewPaths arrays. Same way the Tailwind UI plugin works.

@mjauvin mjauvin changed the title Fire view event for the relation controller manage form partial Create partials for the relation controller form footers Jul 28, 2023
@mjauvin
Copy link
Member Author

mjauvin commented Jul 31, 2023

This is ready to review.

@LukeTowers
Copy link
Member

@mjauvin can the partials include their containing divs as well? Also can you make a PR to the docs to accompany this?

@mjauvin
Copy link
Member Author

mjauvin commented Aug 1, 2023

@mjauvin can the partials include their containing divs as well? Also can you make a PR to the docs to accompany this?

Why ?

@LukeTowers
Copy link
Member

I don't have a good enough reason so fair enough 😜

Can we rename it to manage_form_footer_create and manage_form_footer_update though? That way the relevant partials will be right next to each other in the file list

@mjauvin
Copy link
Member Author

mjauvin commented Aug 2, 2023

I don't have a good enough reason so fair enough stuck_out_tongue_winking_eye

Can we rename it to manage_form_footer_create and manage_form_footer_update though? That way the relevant partials will be right next to each other in the file list

Done!

@LukeTowers
Copy link
Member

Just need a docs PR to mention the new partials now

@mjauvin
Copy link
Member Author

mjauvin commented Aug 2, 2023

Just need a docs PR to mention the new partials now

In here ?
https://wintercms.com/docs/v1.2/docs/backend/relations#overriding-relation-partials

We don't document any of the partials specifically, why these ?

@LukeTowers
Copy link
Member

@mjauvin TBH I just didn't check what we had documented already or not, the current docs are fine for this change. Thanks! 😂

@LukeTowers LukeTowers added Status: Completed and removed needs response Issues/PRs where a maintainer is awaiting a response from the submitter labels Aug 4, 2023
@LukeTowers LukeTowers merged commit 6d641af into develop Aug 4, 2023
@LukeTowers LukeTowers deleted the relation-manageform-view-event branch August 4, 2023 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement PRs that implement a new feature or substantial change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants