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

feat: autocomplete when people input http header #1679

Merged
merged 5 commits into from Apr 12, 2021
Merged

feat: autocomplete when people input http header #1679

merged 5 commits into from Apr 12, 2021

Conversation

qian0817
Copy link
Contributor

@qian0817 qian0817 commented Mar 26, 2021

Please answer these questions before submitting a pull request, or your PR will get closed.

Why submit this pull request?

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

What changes will this PR take into?

autocomplete when people input http header

image

Related issues

None

Checklist:

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

@juzhiyuan
Copy link
Member

juzhiyuan commented Mar 26, 2021

Wow! Good feature indeed! @qian0817 Would you like to write the test cases for this PR? or need some help about this?

BTW, please update the Checklist :)

@juzhiyuan
Copy link
Member

juzhiyuan commented Mar 26, 2021

also cc @guoqqqi to review

@qian0817
Copy link
Contributor Author

@juzhiyuan I dont't konw how to use cypress,so I may need some help to write test case.

@guoqqqi
Copy link
Member

guoqqqi commented Mar 26, 2021

Very good! I found a small problem: when clicking on the delete icon, the key in the last row is not deleted, shouldn't we delete the key in the last row as well?
image

@qian0817
Copy link
Contributor Author

I'm confused why the behavior of component input and autocomplete appear inconsistent when delete form item. 🤔

@juzhiyuan
Copy link
Member

BTW, @guoqqqi, would you have time to guide @qian0817 to write E2E tests for this PR?

fix the problem that the form is displayed incorrectly when the
delete
button is clicked in the online debugging view.
Modify the
code
according to antd documentation.
https://ant.design/components/form-cn/#components-form-demo-dynamic-form-item
@qian0817
Copy link
Contributor Author

@guoqqqi fixed

@codecov-io
Copy link

Codecov Report

Merging #1679 (7f7d503) into master (88f3232) will increase coverage by 1.67%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1679      +/-   ##
==========================================
+ Coverage   72.41%   74.09%   +1.67%     
==========================================
  Files         133       86      -47     
  Lines        5728     2617    -3111     
  Branches      666      667       +1     
==========================================
- Hits         4148     1939    -2209     
+ Misses       1337      678     -659     
+ Partials      243        0     -243     
Flag Coverage Δ
backend-e2e-test ?
backend-e2e-test-ginkgo ?
backend-unit-test ?
frontend-e2e-test 74.09% <100.00%> (+0.12%) ⬆️

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

Impacted Files Coverage Δ
...ages/Route/components/DebugViews/DebugDrawView.tsx 78.08% <ø> (ø)
...es/Route/components/DebugViews/DebugParamsView.tsx 100.00% <100.00%> (ø)
web/src/pages/Route/constants.ts 100.00% <100.00%> (ø)
api/internal/handler/service/service.go
api/internal/handler/tool/tool.go
api/internal/handler/data_loader/route_import.go
api/internal/utils/closer.go
api/internal/utils/consts/api_error.go
api/internal/handler/consumer/consumer.go
api/internal/core/storage/etcd.go
... and 41 more

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 88f3232...7f7d503. Read the comment docs.

@guoqqqi
Copy link
Member

guoqqqi commented Mar 28, 2021

LGTM! Hi, I can help you to add an E2E test to this PR.

Copy link
Member

@juzhiyuan juzhiyuan left a comment

Choose a reason for hiding this comment

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

LGTM, and you could ask @guoqqqi for help to write E2E.

@qian0817
Copy link
Contributor Author

@guoqqqi Hi,How to simulate clicking on the prompt part of the autocomplete component.I tried to use the following code but not work.

  it('sample', function () {
    cy.visit('/');
    cy.contains(menuLocaleUS['menu.routes']).click();
    const currentToken = localStorage.getItem('token');
    cy.contains(routeLocaleUS['page.route.onlineDebug']).click();
    cy.get(domSelector.debugDraw).should('be.visible');
    cy.get(domSelector.headerTab).should('be.visible').click();
    cy.get(domSelector.headerDataKey0).type('auth').click();
    cy.contains(domSelector.headerAuthorizationKey).click()
    cy.get(domSelector.headerDataValue0).type(currentToken);
  });

Online debug -- sample (failed)

@guoqqqi
Copy link
Member

guoqqqi commented Mar 31, 2021

Hi, @qian0817 You can solve this problem like this:

  it('sample', function () {
    cy.visit('/');
    cy.contains(menuLocaleUS['menu.routes']).click();
    const currentToken = localStorage.getItem('token');
    cy.contains(routeLocaleUS['page.route.onlineDebug']).click();
    cy.get(domSelector.debugDraw).should('be.visible');
    cy.get(domSelector.headerTab).should('be.visible').click();
    cy.get(domSelector.headerDataKey0).click({ force: true });
    cy.get('.ant-select-item-option-content').contains('Accept').click();
    cy.get(domSelector.headerDataValue0).type(currentToken);
  });

Copy link
Contributor

@liuxiran liuxiran left a comment

Choose a reason for hiding this comment

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

LGTM

@juzhiyuan
Copy link
Member

Thanks! @qian0817

BTW, would you like to help to review this PR?

#1707

@liuxiran liuxiran requested review from LiteSun and bzp2010 April 9, 2021 01:44
Copy link
Member

@LiteSun LiteSun left a comment

Choose a reason for hiding this comment

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

LGTM

@juzhiyuan juzhiyuan requested a review from membphis April 11, 2021 13:27
@juzhiyuan juzhiyuan merged commit eb33046 into apache:master Apr 12, 2021
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.

None yet

7 participants