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: locked input to a min of "0" for Retries #2777

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Neilblaze
Copy link

@Neilblaze Neilblaze commented Mar 18, 2023

Why submit this pull request?

  • Bugfix
  • Improve performance ?

What changes will this PR take into?

In the Apisix dashboard, in the inputfield of Retries under Services, we cannot set a negative value as of currently it doesn't supports it. Hence the up/down arrows have no function if the value is in the negative range.

RE: Primarily we can apply a visibility: hidden for .ant-input-number-handler-wrap, but I think the better way is to not remove those up/down arrows and instead, we can lock the input to a minimum value of 0.

Related issues

resolves #2775

Checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

cc: @Baoyuantop, @FreemanKevin

@Neilblaze Neilblaze changed the title fix: locked input to a min of "0" of Retries fix: locked input to a min of "0" for Retries Mar 18, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 18, 2023

Codecov Report

Merging #2777 (0f29350) into master (4a2b50f) will decrease coverage by 5.43%.
The diff coverage is n/a.

❗ Current head 0f29350 differs from pull request most recent head 50a524c. Consider uploading reports for the commit 50a524c to get more accurate results

@@            Coverage Diff             @@
##           master    #2777      +/-   ##
==========================================
- Coverage   74.02%   68.60%   -5.43%     
==========================================
  Files         201      139      -62     
  Lines        7874     3774    -4100     
  Branches      886      886              
==========================================
- Hits         5829     2589    -3240     
+ Misses       1738     1185     -553     
+ Partials      307        0     -307     
Flag Coverage Δ
backend-e2e-test-ginkgo ?
backend-unit-test ?
frontend-e2e-test 68.60% <ø> (-8.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
web/src/components/Upstream/components/Retries.tsx 100.00% <ø> (ø)

... and 82 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@Baoyuantop Baoyuantop left a comment

Choose a reason for hiding this comment

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

We need an E2E case to prove that this change is effective.

@Neilblaze
Copy link
Author

@Baoyuantop Will this work or should I have to refactor it a little bit?

it('should not allow negative values for retries', () => {
  cy.visit('/routes/list');
  cy.get('[name="Retries"]').type('-1').blur();
  cy.contains('Retry times should not be less than 0');
});

@Baoyuantop
Copy link
Contributor

You can just commit your code directly.

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.

Negative value option reports an error.
3 participants