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

Add primary Taxon to products (#6047) #6109

Merged

Conversation

fthobe
Copy link
Contributor

@fthobe fthobe commented Feb 9, 2025

Summary

Concerns #6047
Concerns Starter_Frontend #390 #450

Caution

To implement this feature on starter_frontend also #418 needs to be merged.

This PR fixes outcome variability on the breadcrumbs rendered on the frontpage and is part of a couple of PRs addressing the lack of some SEO features that became prevalent.

Issue: Breadcrumbs are not rendered reliably given that any of multiple taxons can be used

Breadcrumbs are used to tell search engines more about the overal page structure of a website. Currently the starter frontend pulls the first taxon identified on the website and renders that including all ancestors as breadcrumbs terminating the trail with the current page.

While this renders valid breadcrumbs (opposite to some other pages) it does neccessarily reinforce the desired keyword as the taxon rendered as breadcrumb does not always reflect the keyword desired.

To solve that issue @shahmayur001 implemented an additional instrument to select the desired breadcrumb taxon in the admin interface.

Fixes #6047

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@github-actions github-actions bot added changelog:solidus_api Changes to the solidus_api gem changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_core Changes to the solidus_core gem labels Feb 9, 2025
@fthobe fthobe force-pushed the add-primary-breadcrumb-to-product branch from 37502e3 to 0e48541 Compare February 9, 2025 17:44
Copy link

codecov bot commented Feb 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.63%. Comparing base (95a9ea8) to head (f35f325).
Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6109      +/-   ##
==========================================
- Coverage   88.68%   86.63%   -2.06%     
==========================================
  Files         830      512     -318     
  Lines       18013    11819    -6194     
==========================================
- Hits        15975    10239    -5736     
+ Misses       2038     1580     -458     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shahmayur001 shahmayur001 force-pushed the add-primary-breadcrumb-to-product branch from 4290f45 to 1968ce9 Compare February 10, 2025 09:24
@fthobe
Copy link
Contributor Author

fthobe commented Feb 10, 2025

@elia ready as discussed in #6047

@fthobe fthobe changed the title [WIP] Add primary breadcrumb to product Add primary breadcrumb to product Feb 10, 2025
@fthobe fthobe marked this pull request as ready for review February 10, 2025 09:30
@fthobe fthobe requested a review from a team as a code owner February 10, 2025 09:30
@shahmayur001 shahmayur001 force-pushed the add-primary-breadcrumb-to-product branch from 1968ce9 to fc7a95d Compare February 10, 2025 10:52
@fthobe
Copy link
Contributor Author

fthobe commented Feb 10, 2025

@shahmayur001 if you rebase I add the open api description

@shahmayur001 shahmayur001 force-pushed the add-primary-breadcrumb-to-product branch from fc7a95d to 26d3df0 Compare February 10, 2025 19:11
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Thanks. I left a comment on the placeholder. Also, do we need to add the same field in the new admin products/show?

@fthobe
Copy link
Contributor Author

fthobe commented Feb 11, 2025

I would yes

@fthobe
Copy link
Contributor Author

fthobe commented Feb 11, 2025

It would be great to know if we still care about the old admin? Are new features still supported on it?

@kennyadsl
Copy link
Member

@fthobe right now there is no edit page for products in the new admin, so we need to put them in the old one.

@fthobe
Copy link
Contributor Author

fthobe commented Feb 11, 2025

Why? Seriously I am not arguing here, if the product editing page is ready let's use that one.

Please pick one of these

  • new features new admin
  • new features old and new if page present
  • new features old admin

@tvdeyen
Copy link
Member

tvdeyen commented Feb 11, 2025

Why? Seriously I am not arguing here, if the product editing page is ready let's use that one.

Please pick one of these

The new admin is still in beta (and will probably be for a long time).

We still need to support the old current admin.

So

  • new features new admin
  • new features old and new if page present
  • new features old admin

and let's please use "current admin" as name for the current admin. It will be old (and obsolete) the moment we consider the new admin stable and ship it as default.

@fthobe
Copy link
Contributor Author

fthobe commented Feb 11, 2025

Ok that's a clear statement. @shahmayur001

@shahmayur001 shahmayur001 force-pushed the add-primary-breadcrumb-to-product branch 2 times, most recently from b7320de to fb02b5e Compare February 12, 2025 09:41
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Approved, but I just noticed we didn't add the primary taxon to sample products. Ok for me to add it in another PR if needed. Up to you!

@fthobe
Copy link
Contributor Author

fthobe commented Feb 12, 2025

I would actually make some adjustments to starter regarding brands and make one run on sample data as a total as we need it to test structured data. Is that acceptable for everybody?

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Great work @shahmayur001

I have to change requests, then this can be merged.

@shahmayur001 shahmayur001 force-pushed the add-primary-breadcrumb-to-product branch 3 times, most recently from f7f91c0 to a456863 Compare February 12, 2025 12:33
@fthobe fthobe changed the title Add primary breadcrumb to product Add primary Taxon to products Feb 12, 2025
@fthobe fthobe requested a review from tvdeyen February 12, 2025 13:59
@fthobe fthobe changed the title Add primary Taxon to products [SEO] Add primary Taxon to products Feb 12, 2025
@fthobe fthobe changed the title [SEO] Add primary Taxon to products Fix[SEO]: Add primary Taxon to products Feb 12, 2025
@fthobe fthobe changed the title Fix[SEO]: Add primary Taxon to products Fix[SEO]: Add primary Taxon to products (#6047) Feb 12, 2025
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Thanks. I just saw that the taxonAutocomplete jQuery function has been renamed for no obvious reason. Please revert this change or provide good reasons for the change and add backwards compatibility.

Also please create a dedicated commit that introduces the changes for the options that now can be passed in. This is a welcome change, but it needs a separate commit at least.

@shahmayur001 shahmayur001 force-pushed the add-primary-breadcrumb-to-product branch from a456863 to 3f204c4 Compare February 13, 2025 10:06
Created a new association between Product and Primary Taxon using the existing Taxon model.
Allows access to the newly added attribute through existing product APIs.
Updated the product form for primary taxon and modified the related jQuery to display and select a specific taxon.
@shahmayur001 shahmayur001 force-pushed the add-primary-breadcrumb-to-product branch from 3f204c4 to f35f325 Compare February 13, 2025 10:21
@fthobe
Copy link
Contributor Author

fthobe commented Feb 13, 2025

@tvdeyen sorry for the mixup with the jscript, should be fine now.

Test seems flaky, should I open a ticket to add a retry to

rspec ./spec/features/admin/orders/return_payment_state_spec.rb:70 # Return payment state spec disables the "Create Reimbursement" button at submit

@tvdeyen tvdeyen changed the title Fix[SEO]: Add primary Taxon to products (#6047) Add primary Taxon to products (#6047) Feb 14, 2025
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Thanks.

@tvdeyen tvdeyen added this to the 4.5 milestone Feb 14, 2025
@tvdeyen tvdeyen merged commit 1b4e1f4 into solidusio:main Feb 14, 2025
18 of 19 checks passed
@tvdeyen
Copy link
Member

tvdeyen commented Feb 14, 2025

Reran flaky spec. But this is unrelated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_api Changes to the solidus_api gem changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SEO / Structured Data] Define main taxon for usage in breadcrumbs
4 participants