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

Afform - Dispatch event to alter admin metadata; provide mixin #23303

Merged
merged 1 commit into from
Apr 27, 2022

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Apr 26, 2022

Overview

Makes Form-Builder more extensible by allowing extensions to add to the list of available entities, elements, input types, styles, etc.

Before

Entities were gathered only by file-scanning. Other metadata like elements & styles not alterable.

After

Instead of scanning files for Afform entities, this dispatches an event to allow metadata be altered.
It provides a mixin which extensions can use to automatically do the file scanning for entities, similar to the scanning for Ang modules and managed entities.

Technical Details

Extensions which rely on file scanning should subscribe to the mixin and also add a small shim for backward-compatibility.
Like this.

Instead of scanning files for Afform entities, this dispatches an event to allow them to be altered.
It provides a mixin which extensions can use to automatically do the file scanning.
@civibot
Copy link

civibot bot commented Apr 26, 2022

(Standard links)

@colemanw
Copy link
Member Author

ping @MegaphoneJon in case you are creating Afform entities.

@MegaphoneJon
Copy link
Contributor

I wasn't but now I might! :)

@jaapjansma
Copy link
Contributor

I have tested this with the config items extensions and the form builder and to me it looks like it works.

@MegaphoneJon
Copy link
Contributor

@jaapjansma @colemanw Could one of you please post some sample code here? Full updating of docs.civicrm.org is best, but I think at this point, documenting events is probably going to require a more concerted effort.

@seamuslee001
Copy link
Contributor

This seems to make sense but I agree with Jon that we need some dev docs on this

@colemanw
Copy link
Member Author

OK I've added dev docs here: https://lab.civicrm.org/documentation/docs/dev/-/merge_requests/996

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

Successfully merging this pull request may close these issues.

4 participants