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

fix: Breadcrumb broken links #1306

Merged
merged 2 commits into from
May 18, 2022
Merged

fix: Breadcrumb broken links #1306

merged 2 commits into from
May 18, 2022

Conversation

tlgimenes
Copy link
Contributor

@tlgimenes tlgimenes commented May 18, 2022

What's the purpose of this pull request?

Fix broken breadcrumb links

How it works

This PR uses VTEX Catalog's slugify function to generate breadcrumb links so we don't get 404s while navigating through the store.

How to test it?

  1. Open the product /tasty-frozen-computer-80186276/p on any of our starters.
  2. Click on the first breadcrumb link (Kitchen & Home Appliances)
  3. On production, you will get a 404. After this PR, you will get to the category page

Starters Deploy Preview

@vercel
Copy link

vercel bot commented May 18, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
faststore ✅ Ready (Inspect) Visit Preview May 18, 2022 at 2:38PM (UTC)

@tlgimenes tlgimenes marked this pull request as ready for review May 18, 2022 14:38
@tlgimenes tlgimenes requested a review from a team as a code owner May 18, 2022 14:38
@tlgimenes tlgimenes added bug Something isn't working store-api labels May 18, 2022
@tlgimenes tlgimenes changed the title fix: Breadcrumb links fix: Breadcrumb broken links May 18, 2022
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e32f315:

Sandbox Source
Store UI Typescript Configuration

@tlgimenes tlgimenes merged commit e1d74d4 into main May 18, 2022
@tlgimenes tlgimenes deleted the fix/breadcrumb-links branch May 18, 2022 14:58
const categoryNames = categoryPath.split('/')
const splitted = categoryPath.split('/')
const name = splitted[splitted.length - 2]
const item = splitted.map(slugify).join('/')
Copy link
Contributor

Choose a reason for hiding this comment

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

slice the category path isn't better?

@tlgimenes tlgimenes restored the fix/breadcrumb-links branch May 19, 2022 15:05
@filipewl filipewl deleted the fix/breadcrumb-links branch July 13, 2022 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants