carbon-design-system / ibm-products

A Carbon-powered React component library for IBM Products
https://ibm-products.carbondesignsystem.com
Apache License 2.0
92 stars 136 forks source link

[storybook]: broken usage guidelines links #5837

Open davidmenendez opened 1 month ago

davidmenendez commented 1 month ago

Package

Carbon for IBM Products

Description

minor thing here i've noticed throughout our storybook. there appears to be numerous broken links throughout the storybook. probably because the website was updated at some point. AboutModal and RemoveModal being just two examples

Component(s) impacted

i haven't audited every single component and pattern, but AboutModal and RemoveModal for starters

Browser

Chrome

@carbon/ibm-products (previously @carbon/ibm-cloud-cognitive) version

2.47

Suggested Severity

Severity 3 = The problem is visible or noticeable to users but does not impede the usability or functionality. Affects minor functionality, has a workaround.

Product/offering

carbon products

CodeSandbox or Stackblitz example

NA

Steps to reproduce the issue (if applicable)

  1. Go to storybook
  2. Go to docs tab of component or pattern
  3. Verify that the required usage guidelines link is going to the appropriate place

Release date (if applicable)

No response

Code of Conduct

matthewgallo commented 1 month ago

I started compiling a list but after further investigation, I think most of the issues come from how the url is created here.

One issue in particular is that for the "Components" section in our storybook the kind value will be Components, but the way the url is constructed now will cause it to be the following:

https://pages.github.ibm.com/cdai-design/pal/Componentss/${paramCase(...)}

the capital "C" and the extra s in Componentss cause 404s.

davidmenendez commented 1 month ago

i have verified the bug with the url construction.

AboutModal

Tearsheet

davidmenendez commented 1 month ago

shout out to @janhassel for implementing a fix that handles some of the broken urls.

i need to point out this comment i made that addresses the fact that this didn't solve everything though. we're still seeing some links that are broken in-spite of the capitalization and extra characters fix

matthewgallo commented 1 month ago

For those other components where the url doesn't match the standard, we can use the altGuidelinesHref prop in the <StoryDocsPage /> component to specify the exact url it should point to.