Skip to content

Settings UI: Load in the person social profiles when the switching to represent a person#19317

Merged
nolledgeable merged 1 commit intotrunkfrom
DUPP-811-settings-ui-site-representation-person-overwrites-profile-settings
Nov 30, 2022
Merged

Settings UI: Load in the person social profiles when the switching to represent a person#19317
nolledgeable merged 1 commit intotrunkfrom
DUPP-811-settings-ui-site-representation-person-overwrites-profile-settings

Conversation

@igorschoester
Copy link
Copy Markdown
Contributor

@igorschoester igorschoester commented Nov 30, 2022

Context

Summary

This PR can be summarized in the following changelog entry:

  • Fixes a bug where the social profiles of a user would not be loaded in when switching from representing an organization to representing a person.

Relevant technical choices:

  • Moved and renamed the supportedPersonSocialProfiles for clarity and preventing side effects (window variable) in the component.
  • Had to move the sync out of PersonSocialProfiles and into SiteRepresentation due to it now needing the current and previous value of the companyOrPerson to check if it changed.
  • Used an "overkill" useCallback to keep the useEffect dependencies a bit cleaner.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • In Settings > Site representation
    • Configure person to "admin"
    • Configure representation (back) to organization
    • Save
  • Go to WP Users > "admin"
    • Add a Facebook profile URL
  • Go to Settings > Site representation
  • Switch to Person “admin“
  • Verify that Facebook URL is no longer empty

Verify empty

Either reset your database and try the above without configuring the person to "admin" step.
Or update the company_or_person_user_id to 0 in wpseo_titles in your database. This means you never entered a user.

  • In Settings > Site representation
    • Configure representation to organization
  • Go to WP Users > "admin"
    • Add a Facebook profile URL
  • Go to Settings > Site representation
  • Ensure you have the network tab in your browser developer tools open
  • Switch to Person “admin“
  • Verify that Facebook URL is empty
  • Verify no request to person_social_profiles with user_id 0 went out

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Block/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change.

Quality assurance

  • I have tested this code to the best of my abilities
  • I have added unit tests to verify the code works as intended
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label and noted the work hours.

Fixes https://yoast.atlassian.net/browse/DUPP-811

@igorschoester igorschoester added innovation Innovative issue. Relating to performance, memory or data-flow. changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog labels Nov 30, 2022
Copy link
Copy Markdown
Contributor

@nolledgeable nolledgeable left a comment

Choose a reason for hiding this comment

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

CR & ACC ✅

@nolledgeable nolledgeable added this to the 19.13 milestone Nov 30, 2022
@nolledgeable nolledgeable merged commit 3714600 into trunk Nov 30, 2022
@nolledgeable nolledgeable deleted the DUPP-811-settings-ui-site-representation-person-overwrites-profile-settings branch November 30, 2022 15:09
@enricobattocchi enricobattocchi modified the milestones: 19.13, 19.14 Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog innovation Innovative issue. Relating to performance, memory or data-flow.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants