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: Added fault-injection plugin form #1740

Closed
wants to merge 15 commits into from

Conversation

guoqqqi
Copy link
Member

@guoqqqi guoqqqi commented Apr 10, 2021

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

Why submit this pull request?
added fault-injection plugin form
image

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

What changes will this PR take into?

Please update this section with detailed description.

Related issues

fix/resolve #1

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

@guoqqqi guoqqqi marked this pull request as draft April 10, 2021 16:59
@netlify
Copy link

netlify bot commented Apr 11, 2021

Deploy preview for apisix-dashboard ready!

Built with commit 9fc1848

https://deploy-preview-1740--apisix-dashboard.netlify.app

@codecov-io
Copy link

codecov-io commented Apr 11, 2021

Codecov Report

Merging #1740 (e3cf82f) into master (990662a) will increase coverage by 8.96%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1740      +/-   ##
==========================================
+ Coverage   62.55%   71.51%   +8.96%     
==========================================
  Files         123       47      -76     
  Lines        5253     3128    -2125     
  Branches      649        0     -649     
==========================================
- Hits         3286     2237    -1049     
+ Misses       1779      647    -1132     
- Partials      188      244      +56     
Flag Coverage Δ
backend-e2e-test 62.30% <ø> (?)
backend-e2e-test-ginkgo 49.23% <ø> (?)
backend-unit-test 52.25% <ø> (-0.04%) ⬇️
frontend-e2e-test ?

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

Impacted Files Coverage Δ
api/cmd/manager/main.go 0.00% <0.00%> (ø)
web/src/libs/iconfont.js
web/src/components/Plugin/data.tsx
.../src/pages/User/components/LoginMethodPassword.tsx
...pages/Route/components/Step1/RequestConfigView.tsx
...src/pages/SSL/components/CertificateForm/index.tsx
web/src/constants.ts
.../src/pages/Route/components/Step1/ProxyRewrite.tsx
...eb/src/pages/PluginTemplate/components/Preview.tsx
web/src/pages/Consumer/Create.tsx
... and 117 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 990662a...e3cf82f. Read the comment docs.

@LiteSun LiteSun marked this pull request as ready for review April 11, 2021 14:21
@LiteSun LiteSun requested a review from juzhiyuan April 11, 2021 14:23
add();
}}
>
<PlusOutlined /> {formatMessage({ id: 'component.global.create' })}
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be better to

Suggested change
<PlusOutlined /> {formatMessage({ id: 'component.global.create' })}
<PlusOutlined /> `$({formatMessage({ id: 'component.global.create' })}) abort.vars`

add();
}}
>
<PlusOutlined /> {formatMessage({ id: 'component.global.create' })}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<PlusOutlined /> {formatMessage({ id: 'component.global.create' })}
<PlusOutlined /> `${{formatMessage({ id: 'component.global.create' })}} delay.vars`

noStyle
>
<Select style={{ width: '70%' }}>
{['==', '`~=', '>', '<', '~~', '~*', 'in', 'has', '!'].map((item) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be better to define a global constant, it would be reuse both here and route vars

<Form.Item
name={['abort', 'http_status']}
label='abort.http_status'
required
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
required
rules={[{ required: true, message: 'Please input abort.http_status!' }]}

<Form.Item
label="delay.duration"
name={['delay', 'duration']}
required
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
required
rules={[{ required: true, message: 'Please input delay.duration!' }]}

@@ -59,7 +59,7 @@ const FaultInjection: React.FC<Props> = ({ form }) => {
<Form.Item
name={['abort', 'http_status']}
label='abort.http_status'
required
rules={[{ required: true, message: 'Please input abort.http_status!' }]}
Copy link
Member

Choose a reason for hiding this comment

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

add i18n please

@LiteSun LiteSun self-requested a review April 13, 2021 09:57
<Input min={200} />
</Form.Item>

<Form.List name={['abort', 'vars']}>
Copy link
Member

Choose a reason for hiding this comment

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

We need to convert the var to the following: "vars": [ [ [ "arg_name","==","jack" ] ] ]

@juzhiyuan
Copy link
Member

Hello, do we still need this change?

@LiteSun
Copy link
Member

LiteSun commented May 12, 2021

Hello, do we still need this change?

Perhaps not.

@juzhiyuan juzhiyuan closed this May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants