Skip to content

Jetpack Sync: Adding name of importer to sync details for activity log#7455

Merged
gititon merged 5 commits intomasterfrom
add/importer_details
Jul 18, 2017
Merged

Jetpack Sync: Adding name of importer to sync details for activity log#7455
gititon merged 5 commits intomasterfrom
add/importer_details

Conversation

@gititon
Copy link
Copy Markdown
Contributor

@gititon gititon commented Jul 12, 2017

Fixes #7451

Adding name of importer to sync details for activity log

Changes proposed in this Pull Request:

Adding name of importer to sync details for activity log

Testing instructions:

phpunit

Proposed changelog entry for your changes:

@gititon gititon added [Package] Sync [Status] Needs Review This PR is ready for review. [Status] Ready to Merge Go ahead, you can push that green button! [Team] Poseidon labels Jul 12, 2017
@gititon gititon requested review from lezama and roccotripaldi July 12, 2017 15:29
@gititon
Copy link
Copy Markdown
Contributor Author

gititon commented Jul 12, 2017

I looked into using a jetpack_sync_before_send_jetpack_sync_import_end callback to expand the name in init_before_send(), but found the array of importers returned by get_importers() wasn't available there.


//Identify importer
$importers = get_importers();
$importer_name = isset( $importers[ $importer ] ) ? $importers[ $importer ][0] : 'Unknown Importer';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we put this block into its own method?

@roccotripaldi roccotripaldi added [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] Ready to Merge Go ahead, you can push that green button! [Status] Needs Review This PR is ready for review. labels Jul 12, 2017
Copy link
Copy Markdown
Contributor

@roccotripaldi roccotripaldi left a comment

Choose a reason for hiding this comment

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

LGTM! @georgestephanis - the CIs seem to be throwing errors unrelated to this PR. do you know what's going on? Am i missing something?

@gititon gititon added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Jul 12, 2017
@roccotripaldi
Copy link
Copy Markdown
Contributor

@beaulebens mentioned that we could perhaps include the entire importer object, but i think we'll be solid with just the name.

@gititon
Copy link
Copy Markdown
Contributor Author

gititon commented Jul 12, 2017

@roccotripaldi , I'm not sure what including the entire importer object would mean in this case. My understanding was that Beau wanted to include the name of which importer ran in the AL. @beaulebens, can you please clarify whether you wanted something else? Thanks!

@beaulebens
Copy link
Copy Markdown
Member

My main goal was to include enough detail that we could 1. should something meaningful in the UI (e.g. "Beau ran the Super Wonderful importer", and preferably 2. that we could provide contextual links to relevant places within either Calypso or wp-admin.

For importers, I think that means also including the slug of the importer, which is required to build a link to the importer in wp-admin (and eventually maybe in Calypso). As an example, I have a Twitter importer on my site, and the URL of it is /wp-admin/admin.php?import=twitter

@gititon
Copy link
Copy Markdown
Contributor Author

gititon commented Jul 12, 2017

Thanks, @beaulebens. This PR will make both the slug and the name available in the AL (when coupled with the changes in my .com diff).

}

private function get_importer_name( $importer ) {
return isset( $importers[ $importer ] ) ? $importers[ $importer ][0] : 'Unknown Importer';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we need to pass $importers here?

@gititon gititon merged commit 463bf9f into master Jul 18, 2017
@gititon gititon deleted the add/importer_details branch July 25, 2017 14:15
@kraftbj kraftbj removed the [Status] Needs Review This PR is ready for review. label Sep 29, 2021
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.

Sync: Include importer object when an import is run.

5 participants