Skip to content

Lowercase query before searching in new settings UI#19340

Merged
igorschoester merged 4 commits intotrunkfrom
DUPP-826-settings-ui-search-case-sensitive
Dec 6, 2022
Merged

Lowercase query before searching in new settings UI#19340
igorschoester merged 4 commits intotrunkfrom
DUPP-826-settings-ui-search-case-sensitive

Conversation

@nolledgeable
Copy link
Copy Markdown
Contributor

@nolledgeable nolledgeable commented Dec 5, 2022

Context

  • Makes the search in new settings UI case insensitive.

Summary

This PR can be summarized in the following changelog entry:

  • Makes the search in new settings UI case insensitive.

Relevant technical choices:

  • Move from Lodash toLower to string.toLocaleLowerCase for locale specific lowercasing.
  • Added a safeToLocaleLower helper that doesn't throw breaking errors when locale is invalid.
  • Added a max width to the Force rewrite titles toggle.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Open the search in the new settings UI.
  • Verify that SEO and seo give you the same search results.
  • Verify that XML and xml give you the same search results.
  • Verify that section descriptions for post types and taxonomies still contain lowercase post type or taxonomy name:

image

  • Verify that the Force rewrite titles toggle is now the same width as toggles below it. This toggle is only visible in non block themes that don't support the title-tag

image

Dev only additional test

  • On line 411 of settings-integration.php, assign something invalid to the userLocale variable, ie. false or 10. Then verify that above lowercasing fails and you have console errors, but the new settings UI doesn't break.

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:

  • Only affects the new settings UI.

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-826

@nolledgeable nolledgeable 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 Dec 5, 2022
@nolledgeable nolledgeable added this to the 19.13 milestone Dec 5, 2022
Copy link
Copy Markdown
Contributor

@igorschoester igorschoester left a comment

Choose a reason for hiding this comment

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

CR 🏗️

Comment thread packages/js/src/settings/helpers/search.js Outdated
Copy link
Copy Markdown
Contributor

@igorschoester igorschoester left a comment

Choose a reason for hiding this comment

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

Acc ✅

@igorschoester igorschoester merged commit cd741f1 into trunk Dec 6, 2022
@igorschoester igorschoester deleted the DUPP-826-settings-ui-search-case-sensitive branch December 6, 2022 10:34
@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