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: Fix invalid DOM props and other minor JS console errors #3915

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

timopollmeier
Copy link
Member

What

This fixes various minor errors that do not visibly affect the content visible to users but appear in the JS console.

This includes:

  • internal props are no longer passed to the DOM
  • invalid prop types are fixed
  • better handling of models and missing data
  • tr elements are nested in the correct parent elements
  • keys in reference lists are made unique
  • correct functions are defined for gmp mock in tests

Why

Fixing these errors makes it easier to spot errors that do have an effect on the visible content.

References

GEA-350

Checklist

  • Tests

This fixes various minor errors that do not visibly affect the
content visible to users but appear in the JS console.

This includes:
- internal props are no longer passed to the DOM
- invalid prop types are fixed
- better handling of models and missing data
- tr elements are nested in the correct parent elements
- keys in reference lists are made unique
- correct functions are defined for gmp mock in tests

Fixing these errors makes it easier to spot errors that do have
an effect on the visible content.
Copy link

Conventional Commits Report

Type Number
Bug Fixes 1

🚀 Conventional commits found.

Copy link

codecov bot commented Nov 10, 2023

Codecov Report

Merging #3915 (715fe4f) into main (161cc7b) will increase coverage by 0.02%.
The diff coverage is 69.85%.

❗ Current head 715fe4f differs from pull request most recent head f7a6ffd. Consider uploading reports for the commit f7a6ffd to get more accurate results

@@            Coverage Diff             @@
##             main    #3915      +/-   ##
==========================================
+ Coverage   59.95%   59.97%   +0.02%     
==========================================
  Files        1022     1023       +1     
  Lines       25137    25163      +26     
  Branches     7452     7462      +10     
==========================================
+ Hits        15070    15092      +22     
- Misses       9119     9123       +4     
  Partials      948      948              
Files Coverage Δ
src/gmp/model.js 100.00% <100.00%> (ø)
src/web/components/badge/badge.js 100.00% <100.00%> (ø)
src/web/components/bar/progressbar.js 100.00% <100.00%> (ø)
src/web/components/dialog/scrollablecontent.js 100.00% <100.00%> (ø)
src/web/components/folding/folding.js 39.53% <100.00%> (ø)
src/web/components/form/field.js 100.00% <100.00%> (ø)
src/web/components/form/formgroup.js 100.00% <100.00%> (ø)
src/web/components/form/loadingbutton.js 100.00% <100.00%> (ø)
src/web/components/form/radio.js 100.00% <100.00%> (ø)
src/web/components/form/select.js 92.77% <100.00%> (ø)
... and 42 more

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@timopollmeier timopollmeier marked this pull request as ready for review November 10, 2023 08:39
@timopollmeier timopollmeier requested a review from a team as a code owner November 10, 2023 08:39
Copy link
Contributor

@bjoernricks bjoernricks left a comment

Choose a reason for hiding this comment

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

Really nice! Something I would loved to be fixed years ago already.

Maybe make it even simpler to exclude props by adding something like

const styledExcludeProps = (styledComponent, excludedProps) => styledComponent.withConfig(
  excludePropsConfig(excludedProps)
);

usage

styledExcludeProps(styled.div`
...
`, ["foo", "bar"])

@timopollmeier timopollmeier marked this pull request as draft November 10, 2023 14:00
@timopollmeier timopollmeier marked this pull request as ready for review November 14, 2023 07:43
@bjoernricks bjoernricks merged commit 177128e into main Nov 14, 2023
11 checks passed
@bjoernricks bjoernricks deleted the fix-console-only-errors branch November 14, 2023 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants