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

SearchKit - Allow creation of new records via in-place edit #22376

Merged
merged 1 commit into from
Apr 2, 2022

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Jan 5, 2022

Overview

Allows e.g. an email record to be created if one does not already exist via in-place edit.

Before

For joined records (e.g. email), SeachKit in-place edit would not work if one did not already exist.

After

Now you can create a new record, same as editing an existing one.

Technical Details

The create params get taken from the join clause. E.g. if you join on an email with a clause like "location type = work" and "is_primary = true" then when creating via edit-in-place the new email will have those values (primary, work).

Comments

@eileenmcnaughton requested this: dev/core#2853

@civibot
Copy link

civibot bot commented Jan 5, 2022

(Standard links)

@civibot civibot bot added the master label Jan 5, 2022
@colemanw colemanw force-pushed the searchKitInPlaceCreate branch from 67054ea to c981ee7 Compare January 5, 2022 03:13
@eileenmcnaughton
Copy link
Contributor

@colemanw I tested this & was able to create an edit in place email field and could either edit or create using the field. When creating it fill in is_primary and location_type_id were both not null.

I added other entities (phone, website, related contact & activity) and it did not work for any of them - I can't see any entity hard-coding so it must be in the metadata somewhere?

You can't specify the location type id - I can think of some edge cases where it would be better if you could but out of scope.

@colemanw
Copy link
Member Author

Ok @eileenmcnaughton, I'll take another look. But first I want to get #22358 resolved because that validation logic will be needed here as well. I'm going to revisit that PR shortly and make any changes needed to resolve your concerns.

@colemanw colemanw force-pushed the searchKitInPlaceCreate branch from c981ee7 to 61753b3 Compare January 28, 2022 16:00
@colemanw
Copy link
Member Author

@eileenmcnaughton I've got this rebased and working now. Added basic validation so you can't enter a blank value when creating a new record, and fixed it to work with multiple joins.

@eileenmcnaughton
Copy link
Contributor

test this please

@eileenmcnaughton
Copy link
Contributor

I'm not sure what that fail was (it was one of those ones you have to trawl the console log for) so I've just set it re-running in the hope...

@colemanw colemanw force-pushed the searchKitInPlaceCreate branch from 61753b3 to a3ef0df Compare February 2, 2022 20:22
@colemanw colemanw force-pushed the searchKitInPlaceCreate branch from a3ef0df to 35ceb7e Compare March 22, 2022 02:08
Allows e.g. an email record to be created if one does not already exist.
Fixes dev/core#2853
@colemanw colemanw force-pushed the searchKitInPlaceCreate branch from 35ceb7e to 129e10b Compare March 22, 2022 02:14
@colemanw
Copy link
Member Author

@eileenmcnaughton I spotted the problem & fixed. It's passing now.

@eileenmcnaughton
Copy link
Contributor

OK - seems to work in r-run

@eileenmcnaughton eileenmcnaughton merged commit 3052581 into civicrm:master Apr 2, 2022
@eileenmcnaughton eileenmcnaughton deleted the searchKitInPlaceCreate branch April 2, 2022 21:20
@allinappliadmin
Copy link
Contributor

I confirm it works on 5.47.3 we were able to record an e-mail address when there wasn't one

@eileenmcnaughton
Copy link
Contributor

thanks for testing @ALLINAPPLI

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.

3 participants