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

Enhancement/5451 twg widget #5577

Merged
merged 14 commits into from
Jul 27, 2022
Merged

Enhancement/5451 twg widget #5577

merged 14 commits into from
Jul 27, 2022

Conversation

eugene-manuilov
Copy link
Collaborator

@eugene-manuilov eugene-manuilov commented Jul 20, 2022

Summary

Addresses issue:

Relevant technical choices

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 4.7 and PHP 5.6.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

@eugene-manuilov eugene-manuilov marked this pull request as ready for review July 21, 2022 18:31
Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

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

Hi @eugene-manuilov, code-wise this is looking good with just a couple of minor comments from me.

However when it comes to testing it, I'm unable to follow the QAB as specified. The reason being, although the QAB mentions simply activating the TwG module, in fact the module needs to be connected in order for the widget to be registered:

if ( ! $this->is_connected() ) {
return;
}

At the moment it's not possibly to get as far as connecting the TwG module, unless I am missing something?

So at the moment when I add a Legacy Widget it doesn't give me the option for the TwG: Supporter Wall widget. Whereas if I comment out that check for is_connected(), it does show up. Not sure if I have missed something here, or if the QAB needs a rethink, or possibly this should be tested once TwG can be fully connected...

public function __construct() {
parent::__construct(
self::WIDGET_ID,
sprintf( 'Thank with Google: %s', __( 'Supporter Wall', 'google-site-kit' ) )
Copy link
Collaborator

Choose a reason for hiding this comment

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

The "Thank with Google" string here also needs to be translated...

Copy link
Collaborator Author

@eugene-manuilov eugene-manuilov Jul 26, 2022

Choose a reason for hiding this comment

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

I am not sure about this... As far as I know product names are not translated since they are "international" names. For example, take a look at https://www.thinkwithgoogle.com/ - you can switch between different languages and see that "Think with Google" remains untranslated.

Copy link
Collaborator

Choose a reason for hiding this comment

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

From what I can see we are translating the service names, for example -

'name' => _x( 'Thank with Google', 'Service name', 'google-site-kit' ),

This can be also seen for other modules and in JS too...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fair point, I'll update 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated, should be good now.

@eugene-manuilov
Copy link
Collaborator Author

However when it comes to testing it, I'm unable to follow the QAB as specified. The reason being, although the QAB mentions simply activating the TwG module, in fact the module needs to be connected in order for the widget to be registered:

At the moment it's not possibly to get as far as connecting the TwG module, unless I am missing something?

So at the moment when I add a Legacy Widget it doesn't give me the option for the TwG: Supporter Wall widget. Whereas if I comment out that check for is_connected(), it does show up. Not sure if I have missed something here, or if the QAB needs a rethink, or possibly this should be tested once TwG can be fully connected...

I have added one step to QAB to use a snippet from another ticket to fake TwG setup. Does it help?

@techanvil
Copy link
Collaborator

However when it comes to testing it, I'm unable to follow the QAB as specified. The reason being, although the QAB mentions simply activating the TwG module, in fact the module needs to be connected in order for the widget to be registered:
At the moment it's not possibly to get as far as connecting the TwG module, unless I am missing something?
So at the moment when I add a Legacy Widget it doesn't give me the option for the TwG: Supporter Wall widget. Whereas if I comment out that check for is_connected(), it does show up. Not sure if I have missed something here, or if the QAB needs a rethink, or possibly this should be tested once TwG can be fully connected...

I have added one step to QAB to use a snippet from another ticket to fake TwG setup. Does it help?

Thanks @eugene-manuilov, that did help and I've been able to connect TwG. One thing to note, though is that as well as inserting the PHP snippet I also had to run the JS snippet from the issue's QA Brief, so it might be worth a mention of this. E.g.

-Add a snippet from the https://github.com/google/site-kit-wp/issues/5450 to fake TwG setup into the functions.php file or into a mu-plugin.
+Follow the Setup instructions in the QA Brief for https://github.com/google/site-kit-wp/issues/5450 to connect the TwG module.

@eugene-manuilov
Copy link
Collaborator Author

However when it comes to testing it, I'm unable to follow the QAB as specified. The reason being, although the QAB mentions simply activating the TwG module, in fact the module needs to be connected in order for the widget to be registered:
At the moment it's not possibly to get as far as connecting the TwG module, unless I am missing something?
So at the moment when I add a Legacy Widget it doesn't give me the option for the TwG: Supporter Wall widget. Whereas if I comment out that check for is_connected(), it does show up. Not sure if I have missed something here, or if the QAB needs a rethink, or possibly this should be tested once TwG can be fully connected...

I have added one step to QAB to use a snippet from another ticket to fake TwG setup. Does it help?

Thanks @eugene-manuilov, that did help and I've been able to connect TwG. One thing to note, though is that as well as inserting the PHP snippet I also had to run the JS snippet from the issue's QA Brief, so it might be worth a mention of this. E.g.

-Add a snippet from the https://github.com/google/site-kit-wp/issues/5450 to fake TwG setup into the functions.php file or into a mu-plugin.
+Follow the Setup instructions in the QA Brief for https://github.com/google/site-kit-wp/issues/5450 to connect the TwG module.

Yep, sounds good to me. Updated. Thanks.

Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

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

LGTM! Nice one @eugene-manuilov

@techanvil techanvil merged commit 8720bad into develop Jul 27, 2022
@techanvil techanvil deleted the enhancement/5451-twg-widget branch July 27, 2022 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants