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(Pageheader,Tearsheet,Notifications): resolves CSP violations #6340

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

Conversation

AlexanderMelox
Copy link
Contributor

Closes #6190

This PR resolves CSP violation issues

What did you change?

Moved inline styles to useIsomorphicEffect

How did you test and verify your work?

Storybook

Copy link

netlify bot commented Oct 31, 2024

Deploy Preview for ibm-products-web-components ready!

Name Link
🔨 Latest commit 89183a7
🔍 Latest deploy log https://app.netlify.com/sites/ibm-products-web-components/deploys/67339f6cd222a200088acda4
😎 Deploy Preview https://deploy-preview-6340--ibm-products-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Oct 31, 2024

Deploy Preview for carbon-for-ibm-products ready!

Name Link
🔨 Latest commit 89183a7
🔍 Latest deploy log https://app.netlify.com/sites/carbon-for-ibm-products/deploys/67339f6ccaf0bf0008168f51
😎 Deploy Preview https://deploy-preview-6340--carbon-for-ibm-products.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@AlexanderMelox AlexanderMelox changed the title 6190 csp spreadsheet tearsheet notifications page header fix(Pageheader,Tearsheet,Notifications): resolves CSP violations Oct 31, 2024
@AlexanderMelox AlexanderMelox marked this pull request as draft October 31, 2024 18:07
@AlexanderMelox AlexanderMelox marked this pull request as ready for review November 1, 2024 16:58
@AlexanderMelox
Copy link
Contributor Author

Screenshot 2024-11-01 at 1 00 55 PM Everything is good, just having issues getting this TS type error

@matthewgallo
Copy link
Member

matthewgallo commented Nov 1, 2024

I think I found a way to work around this with the following added to page header:

interface HTMLElementStyled extends HTMLElement {
  style: CSSStyleDeclaration;
}
const headerRef = (ref || localHeaderRef) as MutableRefObject<HTMLElementStyled>;

I just extended HTMLElement because when using it directly, I kept getting this read only error. Ideally you could just use HTMLSectionElement since the ref is being passed to a <section> but that doesn't exist 😱
image

@AlexanderMelox
Copy link
Contributor Author

Interesting, thank you! Matt to the rescue 🛟

@AlexanderMelox AlexanderMelox added the hacktoberfest https://hacktoberfest.com/ label Nov 4, 2024
@AlexanderMelox
Copy link
Contributor Author

Should we remove depracted props test? or keep them and still update them?
Screenshot 2024-11-06 at 10 34 04 AM

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.62%. Comparing base (a4465ff) to head (89183a7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6340      +/-   ##
==========================================
+ Coverage   79.61%   79.62%   +0.01%     
==========================================
  Files         394      394              
  Lines       12858    12870      +12     
  Branches     4263     4266       +3     
==========================================
+ Hits        10237    10248      +11     
- Misses       2621     2622       +1     
Components Coverage Δ
ibm-products ∅ <ø> (∅)
ibm-products-web-components ∅ <ø> (∅)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest https://hacktoberfest.com/ status: blocked 🧱
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Address CSP issues in notifications, page header, tearsheet
3 participants