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: remove prop type warning and use only CSS for threshold dot #1380

Merged
merged 5 commits into from Jun 14, 2022

Conversation

adamstankiewicz
Copy link
Member

Description

image

Deploy Preview

Include a direct link to your changes in this PR's deploy preview here (e.g., a specific component page).

Merge Checklist

  • If your update includes visual changes, have they been reviewed by a designer? Send them a link to the Netlify deploy preview, if applicable.
  • Does your change adhere to the documented style conventions?
  • Do any prop types have missing descriptions in the Props API tables in the documentation site (check deploy preview)?
  • Were your changes tested using all available themes (see theme switcher in the header of the deploy preview, under the "Settings" icon)?
  • Were your changes tested in the example app?
  • Is there adequate test coverage for your changes?
  • Consider whether this change needs to reviewed/QA'ed for accessibility (a11y). If so, please add wittjeff and adamstankiewicz as reviewers on this PR.

Post-merge Checklist

  • Verify your changes were released to NPM at the expected version.
  • If you'd like, share your contribution in #show-and-tell.
  • 🎉 🙌 Celebrate! Thanks for your contribution.

@netlify
Copy link

netlify bot commented Jun 14, 2022

Deploy Preview for paragon-openedx ready!

Name Link
🔨 Latest commit 717904c
🔍 Latest deploy log https://app.netlify.com/sites/paragon-openedx/deploys/62a89e537f079c00081bc462
😎 Deploy Preview https://deploy-preview-1380--paragon-openedx.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 settings.

@@ -6,17 +6,17 @@ import Popover from './index';
describe('<Popover />', () => {
describe('correct rendering', () => {
it('renders with correct class for variant success', () => {
const wrapper = mount(<Popover variant="success" />);
const wrapper = mount(<Popover id="popover-id" variant="success" />);
Copy link
Member Author

Choose a reason for hiding this comment

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

Missing required id props

@@ -116,8 +120,6 @@ ProgressBarAnnotated.propTypes = {
variant: PropTypes.oneOf(VARIANTS),
/** Specifies an additional `className` to add to the base element. */
className: PropTypes.string,
/** Hide's the label visually. */
visuallyHidden: PropTypes.bool,
Copy link
Member Author

Choose a reason for hiding this comment

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

This prop doesn't do anything for the annotated progress bar, and is currently causing a prop type warning.

placeInfoAtZero(progressInfoRef, isProgressHintAfter, ANNOTATION_CLASS);
placeInfoAtZero(thresholdInfoRef, isThresholdHintAfter, ANNOTATION_CLASS);
}, [isProgressHintAfter, isThresholdHintAfter]);

useEffect(() => {
positionAnnotations();
const observer = new ResizeObserver(() => {
Copy link
Member Author

Choose a reason for hiding this comment

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

This helps keep the annotation info positioned more accurately when the progress bar itself changes widths (e.g., when the Paragon documentation site theme changes).

@@ -80,12 +90,6 @@ const ProgressBarAnnotated = ({
srOnly
/>
)}
{!!threshold && (
Copy link
Member Author

Choose a reason for hiding this comment

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

Used CSS only for this threshold dot instead of a DOM element.

long74100
long74100 previously approved these changes Jun 14, 2022
@codecov
Copy link

codecov bot commented Jun 14, 2022

Codecov Report

Merging #1380 (717904c) into master (28c60f2) will decrease coverage by 0.15%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##           master    #1380      +/-   ##
==========================================
- Coverage   91.02%   90.87%   -0.16%     
==========================================
  Files         196      198       +2     
  Lines        3243     3266      +23     
  Branches      732      735       +3     
==========================================
+ Hits         2952     2968      +16     
- Misses        278      284       +6     
- Partials       13       14       +1     
Impacted Files Coverage Δ
src/ProgressBar/index.jsx 97.61% <87.50%> (-2.39%) ⬇️
src/utils/propTypesUtils.js
src/utils/propTypes/utils.js 90.90% <0.00%> (ø)
src/utils/propTypes/nonNegativeInteger.js 58.33% <0.00%> (ø)
src/utils/propTypes/greaterThan.js 83.33% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 28c60f2...717904c. Read the comment docs.

@adamstankiewicz adamstankiewicz merged commit 81cae2e into master Jun 14, 2022
@adamstankiewicz adamstankiewicz deleted the ags/progressbar-isChild=prop-warning-fix branch June 14, 2022 14:54
edx-semantic-release pushed a commit that referenced this pull request Jun 14, 2022
## [19.25.2](v19.25.1...v19.25.2) (2022-06-14)

### Bug Fixes

* remove prop type warning and use only CSS for threshold dot in ProgressBar ([#1380](#1380)) ([81cae2e](81cae2e))
@edx-semantic-release
Copy link
Contributor

🎉 This PR is included in version 19.25.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants