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 - UI and contextual titles for search displays #22319

Merged
merged 4 commits into from
Jan 6, 2022

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Dec 26, 2021

Overview

Makes it easy to create drilldown search displays, passing in a url arg to specify a category/container. E.g. "Custom fields in group X", "Option values for Individual Prefix", "Email addresses for Bob Smith".

Related: https://lab.civicrm.org/dev/user-interface/-/issues/44#note_68378

Before

It could be done but was clunky; the form code had to be hand-tweaked to pass in the url arg, and getting a contextual title required a big hack in the form using crm-api4-ctrl.

After

Now there's a UI for adding filters, and the contextual title displays automatically.

image

Technical Details

The upshot of the change can be summarized by looking at the changes in afAdminFormSubmissionList.aff.html which no longer requires inline APIv4 code to make a title appear, and the screenshot above which shows how the filters="{afform_name: routeParams.name}" markup which was previously hand-written into that file is now configurable in the FormBuilder UI.

Allows filters from the URL and/or fixed values to be
added to an embedded search display.
…n entity

The html type info is needed for the fields to be usable in the Afform GUI.

The reason for adding the pseudoconstant is to facilitate automatically fetching
the title from the afAdminFormSubmissionList form.

This could be inefficient for sites with thousands of forms,
but I think that's sufficiently mitigated by the fact that
this pseudoconstant won'be be used for much;
it won't generally be loaded onto the client-side.
…ndalone mode

When displaying a full-page search with contextual filters, e.g. submissions for a particular form,
provides a contextual title based on the url filter arg, e.g. "My Great Form Submissions"
@civibot
Copy link

civibot bot commented Dec 26, 2021

(Standard links)

@civibot civibot bot added the master label Dec 26, 2021
@eileenmcnaughton
Copy link
Contributor

test this please

@seamuslee001
Copy link
Contributor

I've seen this working and happy with this

@colemanw
Copy link
Member Author

colemanw commented Jan 6, 2022

Unrelated fail.

@colemanw colemanw merged commit 840f2e2 into civicrm:master Jan 6, 2022
@colemanw colemanw deleted the afformSearchFilters branch January 6, 2022 23:05
colemanw added a commit to colemanw/civicrm-core that referenced this pull request Jun 15, 2022
This narrows the scope of contextual titles from civicrm#22319 to
only those filters passed internally, as used in drilldown forms.

It makes sense to exclude values from exposed filters because that
can lead to a confusing UI.
colemanw added a commit to colemanw/civicrm-core that referenced this pull request Jun 16, 2022
This narrows the scope of contextual titles from civicrm#22319 to
only those filters passed internally, as used in drilldown forms.

It makes sense to exclude values from exposed filters because that
can lead to a confusing UI.
eileenmcnaughton pushed a commit to eileenmcnaughton/civicrm-core that referenced this pull request Jun 20, 2022
This narrows the scope of contextual titles from civicrm#22319 to
only those filters passed internally, as used in drilldown forms.

It makes sense to exclude values from exposed filters because that
can lead to a confusing UI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants