-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Embed afforms & search displays on contact summary screen as blocks and tabs #19887
Conversation
(Standard links)
|
@colemanw This sounds great! Just a note that we need to make sure that |
Yep, just tried it and it works. Just use the name of the afform as the value of selectedChild. |
f0bc90e
to
b6fdf56
Compare
b6fdf56
to
9455ab6
Compare
I gave this a quick spin and it's VERY COOL I'm trying to think of a great use case to demo with it |
@seamuslee001 I'd be happy to merge this based on my testing - but I think you want to do some too? |
9455ab6
to
7a5a12a
Compare
Ok. The other PR has been merged & I've rebased this one. |
Minor code cleanup, help text tweaks and organization on the config-form tab
7a5a12a
to
67e290a
Compare
return; | ||
} | ||
$scanner = \Civi::service('afform_scanner'); | ||
$weight = 111; |
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.
@colemanw is there any reasoning behind this specific weight? are we not able to just get the max weight of the current tabs?
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.
Well, we generally want the "ChangeLog" tab to be last and that has a weight of 120, so this puts the afform tabs after core tabs but before changelog.
The default positions for tabs and blocks can be configured with the Contact Layout Editor, which I think is the right answer for anyone wanting to change it.
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.
Also 111 is the emergency number in NZ
67e290a
to
54a03b7
Compare
I tested this and worked well merging |
woohoo |
Overview
This enables the creation of blocks and tabs on the contact summary screen, using Afform & SearchKit.
Forms containing a search display will automatically receive the id of the contact being viewed as a filter. Tabs will automatically show a counter in the tab of the number of rows (like core tabs do).
The blocks/tabs will be placed in default positions, but can be rearranged with the Contact Layout Editor extension.
Embed Afform Like This:
This is the Contribution tab from core:
And here is the one I made with SearchKit:
Technical Details
One of the technical challenges was the ability to boostrap Angular more than once per page. This has been solved by #19922.