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

Incorporate Custom Footer Text on the Authorize Application Screen #8510

Closed
10 tasks done
hussain-t opened this issue Apr 9, 2024 · 4 comments
Closed
10 tasks done
Labels
P0 High priority Squad 2 (Team M) Issues for Squad 2 Type: Enhancement Improvement of an existing feature

Comments

@hussain-t
Copy link
Collaborator

hussain-t commented Apr 9, 2024

Feature Description

Custom footer text should be implemented for the enhanced Authorize Application screen. The custom footer should include a "Powered by Site Kit" message and be styled according to the Figma design.

Refer to the Adding Custom Footer Text section in the design doc.


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

Acceptance criteria

  • Conditional Display Based on success_url Domain:
    • The custom footer text "Powered by Site Kit" should be implemented only when the user is on the Authorize Application screen, and the success_url query parameter includes the .google.com domain.
  • Implementation and Styling:
    • The footer text must be implemented using the admin_footer action hook, ensuring it is added just below the default WordPress footer text.
    • The text "Powered by Site Kit" should match the font size, color, and alignment specified in the Figma design.

Implementation Brief

In includes/Core/Admin/Authorize_Application.php:

  • Create render_footer_text Method:
    • Check that the current screen is the authorize_application using the is_authorize_application_screen method.
    • Check that the success_url query parameter contains a .google.com domain using the is_google_service method.
    • If both conditions are met, echo the footer text "Powered by Site Kit". Wrap this text in a <div> with a <p> tag styled via custom selectors.
  • Hook Registration:
    • Locate the Authorize_ApplicationTest::register method.
    • Register the render_footer_text method to the admin_footer action.

In assets/sass/authorize-application/_googlesitekit-authorize-application.scss:

  • Custom Styles Application:
    • Apply the custom styles for the "Powered by Site Kit" footer text.
    • The footer text should match the font size, color, and alignment specified in the Figma design.

Test Coverage

In tests/phpunit/integration/Core/Admin/Authorize_ApplicationTest.php:

  • Add a test case to verify the custom footer text is rendered on the Authorize Application screen when the success_url query parameter includes the .google.com domain.
  • Add a test case to verify the custom footer text is not rendered on the Authorize Application screen when the success_url query parameter does not include the .google.com domain.
  • Add a test case to verify that the custom footer text is not rendered on screens other than the Authorize Application screen.

QA Brief

  • Ensure that Site Kit is installed and activated on your WordPress installation.
  • Navigate to the following URL on your WordPress site, replacing example.com with your actual site domain:
https://example.com/wp-admin/authorize-application.php?app_name=GoogleServiceIntegration&app_id=123e4567-e89b-12d3-a456-426614174000&success_url=https%3A%2F%2Fexample.google.com%2Fsettings%2Fauthorization%2Fwordpress&sitekit=true
  • Verify that the custom footer text "Powered by Site Kit" is displayed below the default footer text on the Authorize Application screen.
  • Modify the success_url Domain: Change the success_url to a non-Google domain and access the same URL:
https://example.com/wp-admin/authorize-application.php?app_name=GoogleServiceIntegration&app_id=123e4567-e89b-12d3-a456-426614174000&success_url=https%3A%2F%2Fexample.com%2Fsettings%2Fauthorization%2Fwordpress&sitekit=true
  • Verify that the custom footer text is not displayed on the Authorize Application screen.
  • Deactivate Site Kit.
  • Access the URL again with the original success_url pointing to a Google domain:
https://example.com/wp-admin/authorize-application.php?app_name=GoogleServiceIntegration&app_id=123e4567-e89b-12d3-a456-426614174000&success_url=https%3A%2F%2Fexample.google.com%2Fsettings%2Fauthorization%2Fwordpress&sitekit=true
  • Verify that the custom footer text is not displayed on the Authorize Application screen.
  • Note: The footer content was placed just below the form content in the Figma design. However, the current implementation places it at the bottom of the page to maintain the existing footer structure.

Changelog entry

  • Add "Powered by Site Kit" to the Authorize Application screen footer when authorizing a Google application.
@hussain-t hussain-t added P0 High priority Type: Enhancement Improvement of an existing feature Squad 2 (Team M) Issues for Squad 2 labels Apr 9, 2024
@ivonac4 ivonac4 added the Next Up Issues to prioritize for definition label Apr 12, 2024
@hussain-t hussain-t changed the title Incorporate Custom Footer Text on the Application Passwords Screen Incorporate Custom Footer Text on the Authorize Application Screen Apr 15, 2024
@hussain-t hussain-t assigned hussain-t and unassigned hussain-t Apr 17, 2024
@techanvil techanvil self-assigned this Apr 19, 2024
@techanvil
Copy link
Collaborator

IB ✅

@techanvil techanvil removed their assignment Apr 19, 2024
@hussain-t hussain-t self-assigned this Apr 19, 2024
@ivonac4 ivonac4 removed the Next Up Issues to prioritize for definition label Apr 22, 2024
@hussain-t hussain-t removed their assignment Apr 29, 2024
@techanvil techanvil self-assigned this Apr 29, 2024
techanvil added a commit that referenced this issue Apr 29, 2024
Enhance/#8510 - Custom Footer Text on the Authorize Application Screen
@techanvil techanvil removed their assignment Apr 29, 2024
@kelvinballoo
Copy link
Collaborator

kelvinballoo commented Apr 30, 2024

QA Update ❌

This is tested good overall.

  • The text 'Powered by Site Kit' appears accordingly when the Site Kit plugin is active and there is a google domain ✅
    The text also follows figma accordingly.

    Screenshot 2024-04-30 at 16 13 37
  • When plugin is deactivated or it's active and using a non-google domain, the text doesn't appear. ✅

    Screenshot 2024-04-30 at 16 13 24
  • One minor point of clarification: ⚠️
    I understand that we are preserving the footer structure as much as possible.
    I only noticed the gap from the bottom to the text on figma as 60px.
    I am thinking if we kept it at 20px also to preserve the footer structure?

    Figma: Screenshot 2024-04-30 at 16 17 31

    Implementation: 20px
    Screenshot 2024-04-30 at 16 17 46

  • On breakpoints below 783 px, the text doesn't appear. Neither do the other wordings like the WordPress version and 'Thank you for creating with WordPress' ❌
    Is there any special requirements for those breakpoints?

    Screenshot 2024-04-30 at 16 21 16

@hussain-t
Copy link
Collaborator Author

Hi @kelvinballoo. Regarding your observations:

One minor point of clarification: ⚠️
I understand that we are preserving the footer structure as much as possible.
I only noticed the gap from the bottom to the text on figma as 60px.
I am thinking if we kept it at 20px also to preserve the footer structure?

Yes, that's to maintain the default footer structure. If you see the default one, it has only 10px padding. However, with the slightly larger custom footer, it is better to increase it slightly. Hence, I set it to 20px, which is fine.

On breakpoints below 783 px, the text doesn't appear. Neither do the other wordings like the WordPress version and 'Thank you for creating with WordPress' ❌
Is there any special requirements for those breakpoints?

That's the default functionality. We only display the custom footer only when the default one is shown. Please check the default one for clarity.

@hussain-t hussain-t assigned kelvinballoo and unassigned hussain-t Apr 30, 2024
@kelvinballoo
Copy link
Collaborator

Noted on that @hussain-t .

All good.
Moving this ticket to Approval.

@kelvinballoo kelvinballoo removed their assignment Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 High priority Squad 2 (Team M) Issues for Squad 2 Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

5 participants