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

Expose mapping search task to Search Kit #19561

Merged
merged 1 commit into from
Mar 31, 2021

Conversation

seamuslee001
Copy link
Contributor

Overview

Expose Contact Mapping task to Search Kit

Before

No Mapping task

After

Mapping task option

Technical Details

This is also a work in progress but it at least gets it show in the list of search tasks, the issue I am currently running into is that at least with Open Street Maps is that when the popup opens this code https://github.com/civicrm/civicrm-core/blob/master/templates/CRM/Contact/Form/Task/Map/OpenStreetMaps.tpl#L156 doesn't seem to fire correctly so initmap doesn't get run not sure what the correct change should be

ping @colemanw @eileenmcnaughton @JoeMurray

@civibot
Copy link

civibot bot commented Feb 8, 2021

(Standard links)

@civibot civibot bot added the master label Feb 8, 2021
@@ -86,7 +86,7 @@ public static function preProcessCommon(&$form) {
$form->_contactIds = [];
$form->_contactTypes = [];

$isStandAlone = in_array('task', $form->urlPath) || in_array('standalone', $form->urlPath);
$isStandAlone = in_array('task', $form->urlPath) || in_array('standalone', $form->urlPath) || in_array('map', $form->urlPath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could call $form->isStandAlone() & then on the CRM_Contact_Form_Task_Map form it could return TRUE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eileenmcnaughton is that a new function or just something I haven't come across but yeh I'm thinking that might be what is needed, the map task does get used in a number of different contexts so will need to check if this does anything to them (don't think so but maybe)

Fix OSM Javascript to work on Search Kit display
@seamuslee001 seamuslee001 changed the title WIP: Expose mapping search task to Search Kit Expose mapping search task to Search Kit Mar 23, 2021
@seamuslee001
Copy link
Contributor Author

@eileenmcnaughton @JoeMurray @colemanw the display task of Mapping Contacts now works, I have tested as best as I can using both OSM and also Google Maps and both seem to work now. The only thing would be about the isStandAlone question IMO

@demeritcowboy
Copy link
Contributor

demeritcowboy commented Mar 31, 2021

Works for me for google. It uses a popup even if you have popups turned off but that's not a blocker just the map is kind of the wrong size for the popup. Regular search + map still works.

I don't have any comment on the isStandalone.

@eileenmcnaughton
Copy link
Contributor

OK merging based on @demeritcowboy's testing - I think that standalone thing is still a bit of a mess but I won't make it a blocker on this PR

@eileenmcnaughton eileenmcnaughton merged commit 88ecb42 into civicrm:master Mar 31, 2021
@eileenmcnaughton eileenmcnaughton deleted the search_task_map branch March 31, 2021 20:47
@colemanw
Copy link
Member

Cool.

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