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

283 add keyword difficulty and intent to semrush modal with table in tailwind design #21697

Open
wants to merge 24 commits into
base: trunk
Choose a base branch
from

Conversation

vraja-pro
Copy link
Contributor

@vraja-pro vraja-pro commented Oct 10, 2024

Context

Summary

This PR can be summarized in the following changelog entry:

  • Adds the semrush integration package.

Relevant technical choices:

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Switch to the related-kephrase-suggestions package: cd packages/related-kephrase-suggestions
  • Run:
yarn install
yarn build
yarn storybook
Difficulty bullet

Check there are 6 different variants for the bullets based on the score and each on has a tootip message on hover with the following description. You can change the score in the control in the storybook and that will change the first bullet:

  • Very easy
    • Dark green (#009F81)
    • Range 0-14
    • Tooltip description: "Your chance to start ranking new pages."
  • Easy
    • Light green (#59DDAA)
    • Range 15-29
    • Tooltip description: "You will need quality content focused on the keyword’s intent."
  • Possible
    • Light green (#FDC23C)
    • Range 30-49
    • Tooltip description: "You will need well-structured and unique content."
  • Difficult
    • Light green (#FF8C43)
    • Range 50-69
    • Tooltip description: "You will need lots of ref. domains and optimized content."
  • Hard
    • Light green (#FF4953)
    • Range 70-84
    • Tooltip description: "You will need lots of high-quality ref. domains and optimized content."
  • Very Hard
    • Light green (#D1002F)
    • Range 85-100
    • Tooltip description: "It will take a lot of on-page SEO, link building, and content promotion efforts."
Intent Bade
  • Check there are 4 badges in the story book.
  • Check each badge color and background matches the design.
  • Check the tooltip text matches the design.
  • Use screen reader and check it can read the tooltip.
Difficulty table
  • Check there are 6 difficulty bullets in the story book.
  • Change the number in the story book, the first bullet should change.
  • Change to a single digit number and check it is align to the bullet.
  • Check each bullet color and background matches the design.
  • Check the tooltip text matches the design.
  • Use screen reader and check it can read the tooltip.
Trend graph
  • Check you can the graph in the story book.
  • Remove some of the data items and check you get an error message.
Keyphrases Table
  • Check there is a table with keyphrases, trend graph, intent, difficulty bullets and buttons.
  • Check there is a loading table story that matches the design.
  • Remove the premium prop and check the button column is gone. Check there is a story for that.
Country Selector
  • Check there is a label over the country field "Show results for:".
  • Check there is select field with a list of countries.
  • Check there is a button with a label "Change country".
  • Check it accept the following props:
    • country code
    • active country code
    • onChage
    • onSelect

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 (Default Block/Gutenberg/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. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • 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.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes Add keyword difficulty and intent to Semrush modal with table in Tailwind design

fix import of root

restore elements to build css

cleanup tests files

fix scripts in package.json

add ui library and i18n dependencies
change args and defaults

add the colored initial badge

add difficulty bullet

adds the buttons for the table

fix storybook for table and button

fix difficulty bullet alignment

rename button to button table

fix js lint

remove css files and commented build script

changes args

fix proptype for badge

fix story args

fix copy

country selector component

fix table story for intent

rename intent badge

rename area chart to trend graph

difficulty bullet

table button

table story

difficulty bullet

intent stories

difficulty bullet

difficulty bullet

trend story

intent badge

refactor components

add premium

fix story
@vraja-pro vraja-pro added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Oct 10, 2024
fix eslint error
remove console log
@vraja-pro vraja-pro force-pushed the 283-add-keyword-difficulty-and-intent-to-semrush-modal-with-table-in-tailwind-design branch from f5158cf to 7bc6f7e Compare October 14, 2024 06:08
remove tests from workflow
@vraja-pro vraja-pro force-pushed the 283-add-keyword-difficulty-and-intent-to-semrush-modal-with-table-in-tailwind-design branch 2 times, most recently from 675b6fe to 356a733 Compare October 14, 2024 07:37
@coveralls
Copy link

coveralls commented Oct 14, 2024

Pull Request Test Coverage Report for Build 9ddb38d45b33536d736b35d4f560e2db5e3d9e3b

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 4287 unchanged lines in 144 files lost coverage.
  • Overall coverage decreased (-5.2%) to 49.371%

Files with Coverage Reduction New Missed Lines %
admin/class-option-tabs-formatter.php 1 0.0%
src/actions/configuration/first-time-configuration-action.php 1 91.84%
src/builders/indexable-home-page-builder.php 1 98.0%
src/builders/indexable-term-builder.php 1 99.15%
src/context/meta-tags-context.php 1 28.43%
src/editors/framework/site/post-site-information.php 1 93.18%
src/generators/breadcrumbs-generator.php 1 64.23%
src/generators/schema/webpage.php 1 90.32%
src/integrations/blocks/structured-data-blocks.php 1 16.0%
src/integrations/settings-integration.php 1 28.26%
Totals Coverage Status
Change from base Build aada569f74c56068ded0390da739652ff560c7cc: -5.2%
Covered Lines: 25668
Relevant Lines: 53687

💛 - Coveralls

remove from asset manager

restore lock file
@vraja-pro vraja-pro force-pushed the 283-add-keyword-difficulty-and-intent-to-semrush-modal-with-table-in-tailwind-design branch from 356a733 to 520a6bf Compare October 14, 2024 08:15
@vraja-pro vraja-pro force-pushed the 283-add-keyword-difficulty-and-intent-to-semrush-modal-with-table-in-tailwind-design branch from 7470718 to 8ee8ed7 Compare October 15, 2024 12:12
Copy link
Member

@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 🏗️

Huge PR with lots of work 👏
Though having said that, I really think this could've gone into multiple PRs. Setup + 1 simple component and then components adding one by one in follow-up PRs.

Talking about the PR, it could use a lot more technical choices and a changelog entry for the first of this new package? Definitely making it user facing for that package.

Comment on lines +58 to +68
"import/no-unresolved": [
"error",
{
ignore: [
// Ignore UI library and schema-blocks, or we have to build the code before linting.
// Because `main` in `package.json` points to the `build/index.js` (in the UI library), which is not present before building.
// As we are dealing with our source, not the actual NPM download, due to the monorepo setup.
"^@yoast/(ui-library|schema-blocks|style-guide|components|helpers|search-metadata-previews|social-metadata-forms|replacement-variable-editor|analysis-report|feature-flag)$",
],
},
],
Copy link
Member

Choose a reason for hiding this comment

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

This seems irrelevant to here

Suggested change
"import/no-unresolved": [
"error",
{
ignore: [
// Ignore UI library and schema-blocks, or we have to build the code before linting.
// Because `main` in `package.json` points to the `build/index.js` (in the UI library), which is not present before building.
// As we are dealing with our source, not the actual NPM download, due to the monorepo setup.
"^@yoast/(ui-library|schema-blocks|style-guide|components|helpers|search-metadata-previews|social-metadata-forms|replacement-variable-editor|analysis-report|feature-flag)$",
],
},
],

Comment on lines +26 to +30
"Introduction",
"1) Elements",
"2) Components",
"3) Patterns",
"Other exports",
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this makes sense in the context of this package.
Plus 3 and other are not there right now

"postcss": "^8.4.19",
"postcss-loader": "^7.3.4",
"puppeteer": "^17.1.3",
"storybook": "^7.6.17",
Copy link
Member

Choose a reason for hiding this comment

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

Why did you go for an old version? That gives us technical debt before we start.

Plus we had trouble with the tests in version 7.
Kind of unfortunate to not start fresh now and take when you need it.
That would also give you more understanding why certain things are there.

Not just this, but lots of versions here are just copied from somewhere it seems.

"watch": "yarn watch:js & yarn watch:css",
"watch:js": "yarn build:js --watch",
"watch:css": "node ./scripts/watch-css.js",
"storybook": "storybook dev -p 6007",
Copy link
Member

Choose a reason for hiding this comment

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

I like the sneaky +1 on the UI library 😉

},
"dependencies": {
"classnames": "^2.3.2",
"@heroicons/react": "^1.0.6",
Copy link
Member

Choose a reason for hiding this comment

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

This is again 1 major version down. That gives us technical debt before we start.


return (
<div
className="yst-absolute yst-border-0 yst-h-0 yst-overflow-hidden yst-w-0 yst-p-0"
Copy link
Member

Choose a reason for hiding this comment

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

Don't we have an yst-sr-only for screen-reader things?

Comment on lines +38 to +40
const mapChartDataToTableData = ( y ) => {
return Math.round( y * 100 );
};
Copy link
Member

Choose a reason for hiding this comment

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

Seems this can and should live outside the render function.

Comment on lines +16 to +29
const dataTableHeaderLabels = [
__( "Twelve months ago", "wordpress-seo" ),
__( "Eleven months ago", "wordpress-seo" ),
__( "Ten months ago", "wordpress-seo" ),
__( "Nine months ago", "wordpress-seo" ),
__( "Eight months ago", "wordpress-seo" ),
__( "Seven months ago", "wordpress-seo" ),
__( "Six months ago", "wordpress-seo" ),
__( "Five months ago", "wordpress-seo" ),
__( "Four months ago", "wordpress-seo" ),
__( "Three months ago", "wordpress-seo" ),
__( "Two months ago", "wordpress-seo" ),
__( "Last month", "wordpress-seo" ),
];
Copy link
Member

Choose a reason for hiding this comment

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

Depending on translations being picked up correctly, this could live outside of the render function.

You also might just type this out instead of looping 🤷

}

// When all the y values are zero, make sure the maximumY value is at least 1 to avoid a division by zero later.
const maximumYFromData = Math.max( 1, Math.max( ...data.map( point => point ) ) );
Copy link
Member

Choose a reason for hiding this comment

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

Why the extra Math.max? 🤔

Suggested change
const maximumYFromData = Math.max( 1, Math.max( ...data.map( point => point ) ) );
const maximumYFromData = Math.max( 1, ...data.map( point => point ) );

Copy link
Member

Choose a reason for hiding this comment

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

Maybe make it clear in the name this is more the screen reader version?
TrendGraphScreenReader or TrendGraphA11y or something along those lines?

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants