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

[CLA Needed] Addresses #6593 #7684

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

TheFuturist32
Copy link

@TheFuturist32 TheFuturist32 commented Apr 12, 2024

Closes #6593

Describe your changes:

  • Fixes the valid indicators not updating properly for Gauge plugin limits
  • Fixes OK button not properly disabling when data is invalid

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this a notable change that will require a special callout in the release notes? For example, will this break compatibility with existing APIs or projects that consume these plugins?

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Has this been smoke tested?
  • Have you associated this PR with a type: label? Note: this is not necessarily the same as the original issue.
  • Have you associated a milestone with this PR? Note: leave blank if unsure.
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?

fix: valid indicators not updating properly for Gauge plugin limits

refactor: enforce limitLow to be less than or equal to limitHigh
fix: OK button not properly disabling when data is invalid

note: (implementation works around the broken validation mechanism)
const validate = data.model.validate;
if (valid && validate) {
valid = validate(data);
if (data.isValid !== undefined && data.isValid !== null && !data.isValid) {
Copy link
Author

Choose a reason for hiding this comment

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

I created an 'isValid' property on 'data' to work around the broken 'data.model.validate' logic below.

@codecov-commenter
Copy link

codecov-commenter commented Apr 12, 2024

Codecov Report

Attention: Patch coverage is 11.11111% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 56.31%. Comparing base (b18aa48) to head (4c00e1c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7684      +/-   ##
==========================================
- Coverage   56.62%   56.31%   -0.32%     
==========================================
  Files         672      672              
  Lines       27124    27125       +1     
  Branches     2632     2634       +2     
==========================================
- Hits        15359    15275      -84     
- Misses      11437    11521      +84     
- Partials      328      329       +1     
Flag Coverage Δ
e2e-full 23.64% <0.00%> (-18.38%) ⬇️
e2e-stable 60.39% <0.00%> (+0.05%) ⬆️
unit 49.09% <11.11%> (-0.04%) ⬇️
Files Coverage Δ
src/plugins/gauge/GaugePlugin.js 45.45% <0.00%> (+3.78%) ⬆️
...c/plugins/gauge/components/GaugeFormController.vue 0.00% <0.00%> (ø)
src/api/forms/components/FormRow.vue 72.22% <20.00%> (-4.25%) ⬇️

... and 11 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

@TheFuturist32
Copy link
Author

I need assistance completing the unchecked 'Author Checklist':

  1. Need help identifying if any tests are needed for these changes.
  2. Unsure how to associate the PR with a type label, or which to associate it with.
  3. Unsure how to associate the PR with a milestone, or which to associate it with.

@ozyx ozyx added type:bug source:community Community contribution or request labels Apr 12, 2024
@ozyx
Copy link
Member

ozyx commented Apr 12, 2024

Hi @TheFuturist32,

Awesome, thanks for taking a look at this!

If you haven't already, please complete and submit a Contributor License Agreement (CLA). This is required before we can merge your code.

Need help identifying if any tests are needed for these changes.

The short answer is yes-- the question is what kind of tests would best cover these changes? I think an e2e test which does the following would be sufficient:

  • opens the "Create" modal by creating a Gauge
  • enters various inputs
  • validates the indicators
  • validates the disabled status of the OK button

We use Playwright for our e2e testing framework. To learn more about our e2e framework and testing strategies, check out our e2e docs. Let us know if we there's anything we can do to help you get started.

Unsure how to associate the PR with a type label, or which to associate it with.
Unsure how to associate the PR with a milestone, or which to associate it with.

We can take care of these for you 😎

Thanks again for your contribution and let us know if you have any questions!

@ozyx ozyx changed the title Addresses #6593 [CLA Needed] Addresses #6593 Apr 12, 2024
@TheFuturist32
Copy link
Author

FYSA: I have not abandoned this PR. "there is a bit of work required to get from 0 to 1 test contributed", there's certainly a learning curve and I am working on it. In fact, I am not experienced with JS/Vue so the entire project is a learning curve, which is why I chose this project to support. I appreciate the opportunity to learn.

Side note: While looking through all of the documentation around contributing and testing, I found some broken links and typos. Is that something I can add to this PR, or should I create a separate PR to address those?

@ozyx
Copy link
Member

ozyx commented May 3, 2024

FYSA: I have not abandoned this PR. "there is a bit of work required to get from 0 to 1 test contributed", there's certainly a learning curve and I am working on it. In fact, I am not experienced with JS/Vue so the entire project is a learning curve, which is why I chose this project to support. I appreciate the opportunity to learn.

Side note: While looking through all of the documentation around contributing and testing, I found some broken links and typos. Is that something I can add to this PR, or should I create a separate PR to address those?

Sure, feel free to fix any typos as a part of this PR. Let us know if you have any questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source:community Community contribution or request type:bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Gauge] Value range and limit indicators are broken
3 participants