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: Basic plugin UI From #1714

Closed
wants to merge 23 commits into from
Closed

Conversation

LiteSun
Copy link
Member

@LiteSun LiteSun commented Apr 7, 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?
Configuring the UI Form for popular plugins

  • api-breaker
  • limit-conn
  • cors
  • fault-injection
  • basic-auth
  • proxy-mirror
  • limit-req
  • limit-count
  • traffic-split
  • referer-restriction

Please update this section with detailed description.

image

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

fine, due to this PR will get larger, @LiteSun Please resolve this one first. For other plugins, please send new PRs.

ref?: any;
};

const BasicAuth: React.FC<Props> = forwardRef(
Copy link
Member

Choose a reason for hiding this comment

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

Why we need forwardRef?

default:
return <></>
}
}
Copy link
Member

Choose a reason for hiding this comment

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

note here

case 'api-breaker':
return <ApiBreaker form={form} />
default:
return <></>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return <></>
return null


export const PLUGIN_UI_LIST = ['basic-auth', 'limit-conn', 'referer-restriction', 'proxy-mirror', 'api-breaker'];

export const PLUGIN_UI_FORM: React.FC<Props> = ({ name, form }) => {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
export const PLUGIN_UI_FORM: React.FC<Props> = ({ name, form }) => {
export const PluginForm: React.FC<Props> = ({ name, form }) => {

form: FormInstance
}

export const PLUGIN_UI_LIST = ['basic-auth', 'limit-conn', 'referer-restriction', 'proxy-mirror', 'api-breaker'];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
export const PLUGIN_UI_LIST = ['basic-auth', 'limit-conn', 'referer-restriction', 'proxy-mirror', 'api-breaker'];
export const PLUGIN_LIST = ['basic-auth', 'limit-conn', 'referer-restriction', 'proxy-mirror', 'api-breaker'];

Copy link
Member Author

Choose a reason for hiding this comment

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

PLUGIN_UI_LIST variable names are more intuitive imo 🤔

@LiteSun
Copy link
Member Author

LiteSun commented Apr 7, 2021

fine, due to this PR will get larger, @LiteSun Please resolve this one first. For other plugins, please send new PRs.

OK

@moonming
Copy link
Member

moonming commented Apr 7, 2021

One PR only does one feature

@LiteSun
Copy link
Member Author

LiteSun commented Apr 8, 2021

One PR only does one feature

ok

@LiteSun LiteSun marked this pull request as ready for review April 8, 2021 03:55
@codecov-io
Copy link

codecov-io commented Apr 8, 2021

Codecov Report

Merging #1714 (60b0fdb) into master (2c158a1) will decrease coverage by 0.55%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1714      +/-   ##
==========================================
- Coverage   72.08%   71.52%   -0.56%     
==========================================
  Files         130       47      -83     
  Lines        5649     3126    -2523     
  Branches      648        0     -648     
==========================================
- Hits         4072     2236    -1836     
+ Misses       1333      647     -686     
+ Partials      244      243       -1     
Flag Coverage Δ
backend-e2e-test 62.28% <ø> (ø)
backend-e2e-test-ginkgo 48.43% <ø> (-0.07%) ⬇️
backend-unit-test 52.29% <ø> (ø)
frontend-e2e-test ?

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

Impacted Files Coverage Δ
api/internal/core/store/store.go 87.95% <0.00%> (ø)
web/src/pages/Upstream/transform.ts
...src/pages/SSL/components/CertificateForm/index.tsx
web/src/services/user.ts
web/src/pages/Consumer/components/Step1.tsx
web/src/pages/Upstream/service.ts
...ages/Route/components/DebugViews/DebugDrawView.tsx
web/src/pages/Upstream/Create.tsx
...pages/Route/components/Step1/RequestConfigView.tsx
web/src/pages/User/Logout.tsx
... and 73 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 2c158a1...60b0fdb. Read the comment docs.

@LiteSun
Copy link
Member Author

LiteSun commented Apr 8, 2021

This pr is too big and difficult to review, I'll break it down into smaller pr. Thanks for the reviewers.

@LiteSun LiteSun closed this Apr 8, 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.

5 participants