-
Notifications
You must be signed in to change notification settings - Fork 534
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: add proxy-mirror plugin form #1725
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1725 +/- ##
==========================================
+ Coverage 72.01% 72.07% +0.06%
==========================================
Files 160 161 +1
Lines 5820 5826 +6
Branches 651 652 +1
==========================================
+ Hits 4191 4199 +8
+ Misses 1385 1383 -2
Partials 244 244
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Can you provide a screenshot of the effect? |
sure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please file a new PR to update the
|
updated. |
web/cypress/integration/consumer/create-consumer-with-proxy-mirror-form.spec.js
Outdated
Show resolved
Hide resolved
const data = { | ||
correctHost: 'http://127.0.0.1', | ||
wrongHost: '127.0.0.1:1999' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please write directly in the test case, not this layer of data structure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, I think it's more intuitive to write it this way.
wrongHost: '127.0.0.1:1999' | ||
} | ||
|
||
it('creates consumer with proxy-mirror form', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need consumer?
@@ -21,4 +21,7 @@ export default { | |||
'component.step.select.pluginTemplate.select.option': '手动配置', | |||
'component.plugin.pluginTemplate.tip1': '1. 若路由已配置插件,则插件模板数据将与已配置的插件数据合并。', | |||
'component.plugin.pluginTemplate.tip2': '2. 插件模板相同的插件会覆盖掉原有的插件。', | |||
|
|||
// proxxy-mirror | |||
'component.pluginForm.proxy-mirror.host.tooltip': '指定镜像服务地址,例如:http://127.0.0.1:9797(地址中需要包含 schema :http或https,不能包含 URI 部分)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add judgment on the front end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Here is tip for user
- the front-end will do a schema check on the data entered by the user
cy.contains(this.domSelector.pluginCard, 'key-auth').within(() => { | ||
cy.contains('Enable').click({ | ||
force: true, | ||
}); | ||
}); | ||
cy.focused(this.domSelector.drawer).should('exist'); | ||
cy.get(this.domSelector.disabledSwitcher).click(); | ||
// edit codemirror | ||
cy.get(this.domSelector.codeMirror) | ||
.first() | ||
.then((editor) => { | ||
editor[0].CodeMirror.setValue( | ||
JSON.stringify({ | ||
key: 'test', | ||
}), | ||
); | ||
cy.contains('button', 'Submit').click(); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need key-auth plugin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because an authentication plugin is required when creating a Consumer.
Deploy preview for apisix-dashboard ready! Built with commit 43a6890 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Form.Item | ||
label="host" | ||
name="host" | ||
extra={formatMessage({ id: 'component.pluginForm.proxy-mirror.host.extra' })} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we have tooltip
, so we don't need this extra
.
Please answer these questions before submitting a pull request, or your PR will get closed.
Why submit this pull request?
What changes will this PR take into?
Add proxy-mirror plugin form
Related issues
Checklist: