You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/03/10 18:03:05 UTC
[GitHub] [apisix-dashboard] liuxiran opened a new pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
liuxiran opened a new pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576
Please answer these questions before submitting a pull request
- Why submit this pull request?
- [ ] Bugfix
- [ ] New feature provided
- [ ] Improve performance
- [ ] Backport patches
- Related issues
fix: #1241
___
### Bugfix
- Description
- How to fix?

add a new PanelSection called `Request Override` in Step 1 of create/edit route
___
### New feature or improvement
- Describe the details and related test reports.
___
### Please add the corresponding test cases if necessary.
- [ ] add test case
___
### Backport patches
- Why need to backport?
- Source branch
- Related commits and pull requests
- Target branch
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran commented on a change in pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
liuxiran commented on a change in pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#discussion_r594323280
##########
File path: web/src/pages/Route/components/Step1/ProxyRewrite.tsx
##########
@@ -0,0 +1,291 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import React, { useEffect } from 'react';
+import Form from 'antd/es/form';
+import { Button, Input, Radio, Row, Col } from 'antd';
+import { PlusOutlined, MinusCircleOutlined } from '@ant-design/icons';
+import { useIntl } from 'umi';
+import { PanelSection } from '@api7-dashboard/ui';
+
+import {
+ FORM_ITEM_LAYOUT,
+ FORM_ITEM_WITHOUT_LABEL,
+ ShcemeRewrite,
+ URIRewriteType,
+ HostRewriteType
+} from '@/pages/Route/constants';
+
+const ProxyRewrite: React.FC<RouteModule.Step1PassProps> = ({ form, disabled }) => {
+ const { formatMessage } = useIntl();
+
+ const getUriRewriteItems = () => {
+ switch (form.getFieldValue('URIRewriteType')) {
+ case URIRewriteType.STATIC:
+ return (
+ <Form.Item
+ label={formatMessage({ id: 'page.route.form.itemLabel.newPath' })}
+ name={['proxyRewrite', 'uri']}
+ rules={[
+ {
+ required: true,
+ message: `${formatMessage({ id: 'component.global.pleaseEnter' })} ${formatMessage({
+ id: 'page.route.form.itemLabel.newPath',
+ })}`,
+ },
+ ]}
+ >
+ <Input
+ placeholder={`${formatMessage({
+ id: 'component.global.pleaseEnter',
+ })} ${formatMessage({ id: 'page.route.form.itemLabel.newPath' })}`}
+ disabled={disabled}
+ />
+ </Form.Item>
+ );
+ case URIRewriteType.REGEXP:
+ return (
+ <Form.List
+ name={['proxyRewrite', 'regex_uri']}
+ initialValue={['', '']}
+ >
+ {(fields) =>
+ fields.map((field, index) => {
+ switch (index) {
+ case 0:
+ return (
+ <Form.Item
+ label={formatMessage({ id: 'page.route.form.itemLabel.regx' })}
+ name={field.name}
+ key={field.name}
+ rules={[
+ {
+ required: true,
+ message: `${formatMessage({
+ id: 'component.global.pleaseEnter',
+ })} ${formatMessage({ id: 'page.route.form.itemLabel.regx' })}`,
+ },
+ ]}
+ >
+ <Input
+ placeholder={`${formatMessage({
+ id: 'component.global.pleaseEnter',
+ })} ${formatMessage({ id: 'page.route.form.itemLabel.regx' })}`}
+ disabled={disabled}
+ />
+ </Form.Item>
+ );
+ case 1:
+ return (
+ <Form.Item
+ label={formatMessage({ id: 'page.route.form.itemLabel.template' })}
+ name={field.name}
+ key={field.name}
+ rules={[
+ {
+ required: true,
+ message: `${formatMessage({
+ id: 'component.global.pleaseEnter',
+ })} ${formatMessage({ id: 'page.route.form.itemLabel.template' })}`,
+ },
+ ]}
+ >
+ <Input
+ placeholder={`${formatMessage({
+ id: 'component.global.pleaseEnter',
+ })} ${formatMessage({ id: 'page.route.form.itemLabel.template' })}`}
+ disabled={disabled}
+ />
+ </Form.Item>
+ );
+ default:
+ return null;
+ }
+ })
+ }
+ </Form.List>
+ );
+ case URIRewriteType.KEEP:
+ default:
+ return null;
+ }
+ };
+
+ const getHostRewriteItems = () => {
+ switch (form.getFieldValue('hostRewriteType')) {
+ case HostRewriteType.REWRITE:
+ return (
+ <Form.Item
+ label={formatMessage({ id: 'page.route.form.itemLabel.newHost' })}
+ name={['proxyRewrite', 'host']}
+ rules={[
+ {
+ required: true,
+ message: `${formatMessage({ id: 'component.global.pleaseEnter' })} ${formatMessage({
+ id: 'page.route.form.itemLabel.newHost',
+ })}`,
+ },
+ ]}
+ >
+ <Input
+ placeholder={`${formatMessage({
+ id: 'component.global.pleaseEnter',
+ })} ${formatMessage({ id: 'page.route.form.itemLabel.newHost' })}`}
+ disabled={disabled}
+ />
+ </Form.Item>
+ );
+ case HostRewriteType.KEEP:
+ default:
+ return null;
+ }
+ };
+
+ useEffect(() => {}, []);
Review comment:
fixed
##########
File path: web/src/pages/Route/components/Step1/ProxyRewrite.tsx
##########
@@ -0,0 +1,291 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import React, { useEffect } from 'react';
+import Form from 'antd/es/form';
+import { Button, Input, Radio, Row, Col } from 'antd';
+import { PlusOutlined, MinusCircleOutlined } from '@ant-design/icons';
+import { useIntl } from 'umi';
+import { PanelSection } from '@api7-dashboard/ui';
+
+import {
+ FORM_ITEM_LAYOUT,
+ FORM_ITEM_WITHOUT_LABEL,
+ ShcemeRewrite,
+ URIRewriteType,
+ HostRewriteType
+} from '@/pages/Route/constants';
+
+const ProxyRewrite: React.FC<RouteModule.Step1PassProps> = ({ form, disabled }) => {
+ const { formatMessage } = useIntl();
+
+ const getUriRewriteItems = () => {
+ switch (form.getFieldValue('URIRewriteType')) {
+ case URIRewriteType.STATIC:
+ return (
+ <Form.Item
+ label={formatMessage({ id: 'page.route.form.itemLabel.newPath' })}
+ name={['proxyRewrite', 'uri']}
+ rules={[
+ {
+ required: true,
+ message: `${formatMessage({ id: 'component.global.pleaseEnter' })} ${formatMessage({
+ id: 'page.route.form.itemLabel.newPath',
+ })}`,
+ },
+ ]}
+ >
+ <Input
+ placeholder={`${formatMessage({
+ id: 'component.global.pleaseEnter',
+ })} ${formatMessage({ id: 'page.route.form.itemLabel.newPath' })}`}
+ disabled={disabled}
+ />
+ </Form.Item>
+ );
+ case URIRewriteType.REGEXP:
+ return (
+ <Form.List
+ name={['proxyRewrite', 'regex_uri']}
+ initialValue={['', '']}
+ >
+ {(fields) =>
+ fields.map((field, index) => {
+ switch (index) {
+ case 0:
+ return (
+ <Form.Item
+ label={formatMessage({ id: 'page.route.form.itemLabel.regx' })}
Review comment:
fixed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-796368917
cc @guoqqqi to take a review
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] LiteSun commented on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
LiteSun commented on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-798911177
CI failed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-796368769
Wow! A big step!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
bzp2010 commented on a change in pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#discussion_r597677125
##########
File path: web/src/pages/Route/Create.tsx
##########
@@ -93,6 +95,10 @@ const Page: React.FC<Props> = (props) => {
}
}, []);
+ const getProxyrewriteEnable =() => {
Review comment:
This should be `getProxyRewriteEnable` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran commented on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
liuxiran commented on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-802616705


hi @juzhiyuan @LiteSun
It seems that `netlify` errors caused by the build path of fe is `../output/html`, but the expected path is `web/dist`, we have to change the path to `output/html` in netlify configuration file. I need help that how can I change the configuration? looking forward to your reply, thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (e4dbd3a) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/9a92ff95ddbe43432247a8b49ba63a9de115e726?el=desc) (9a92ff9) will **decrease** coverage by `24.61%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
===========================================
- Coverage 70.88% 46.27% -24.62%
===========================================
Files 135 46 -89
Lines 5485 3019 -2466
Branches 583 0 -583
===========================================
- Hits 3888 1397 -2491
+ Misses 1349 1337 -12
- Partials 248 285 +37
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `46.27% <ø> (+6.19%)` | :arrow_up: |
| backend-unit-test | `?` | |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/handler/label/label.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbGFiZWwvbGFiZWwuZ28=) | `9.43% <0.00%> (-72.65%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_export.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfZXhwb3J0Lmdv) | `3.38% <0.00%> (-65.79%)` | :arrow_down: |
| [api/internal/utils/runtime/runtime.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3J1bnRpbWUvcnVudGltZS5nbw==) | `0.00% <0.00%> (-64.29%)` | :arrow_down: |
| [api/internal/handler/global\_rule/global\_rule.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZ2xvYmFsX3J1bGUvZ2xvYmFsX3J1bGUuZ28=) | `27.41% <0.00%> (-56.46%)` | :arrow_down: |
| [api/internal/core/store/validate\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGVfbW9jay5nbw==) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/service/service.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2VydmljZS9zZXJ2aWNlLmdv) | `52.12% <0.00%> (-39.37%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/filter/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9hdXRoZW50aWNhdGlvbi5nbw==) | `36.11% <0.00%> (-36.12%)` | :arrow_down: |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `57.22% <0.00%> (-30.73%)` | :arrow_down: |
| [api/internal/handler/route/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGUvcm91dGUuZ28=) | `48.95% <0.00%> (-29.29%)` | :arrow_down: |
| ... and [104 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [9a92ff9...e4dbd3a](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-801787793
also cc @guoqqqi to review.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (96c8965) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/9a92ff95ddbe43432247a8b49ba63a9de115e726?el=desc) (9a92ff9) will **decrease** coverage by `4.40%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
==========================================
- Coverage 70.88% 66.47% -4.41%
==========================================
Files 135 46 -89
Lines 5485 3019 -2466
Branches 583 0 -583
==========================================
- Hits 3888 2007 -1881
+ Misses 1349 764 -585
Partials 248 248
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `46.40% <ø> (+6.33%)` | :arrow_up: |
| backend-unit-test | `51.54% <ø> (-0.14%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `35.08% <0.00%> (-29.84%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `75.00% <0.00%> (-25.00%)` | :arrow_down: |
| [api/internal/handler/global\_rule/global\_rule.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZ2xvYmFsX3J1bGUvZ2xvYmFsX3J1bGUuZ28=) | `66.12% <0.00%> (-17.75%)` | :arrow_down: |
| [api/internal/utils/utils.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3V0aWxzLmdv) | `54.11% <0.00%> (-11.77%)` | :arrow_down: |
| [api/internal/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3JvdXRlLmdv) | `77.14% <0.00%> (-8.58%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `67.28% <0.00%> (-3.74%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `52.10% <0.00%> (-3.37%)` | :arrow_down: |
| [api/internal/conf/conf.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvbmYvY29uZi5nbw==) | `69.01% <0.00%> (-2.87%)` | :arrow_down: |
| [api/internal/core/store/validate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGUuZ28=) | `67.03% <0.00%> (-2.24%)` | :arrow_down: |
| [api/internal/handler/label/label.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbGFiZWwvbGFiZWwuZ28=) | `80.18% <0.00%> (-1.89%)` | :arrow_down: |
| ... and [90 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [9a92ff9...96c8965](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] guoqqqi commented on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
guoqqqi commented on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-802054194
Please update the master branch code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (0de7250) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/4b8774fe10c809e333253a6b8c34a00c1ac71c90?el=desc) (4b8774f) will **decrease** coverage by `19.71%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
===========================================
- Coverage 71.37% 51.65% -19.72%
===========================================
Files 133 38 -95
Lines 5384 2563 -2821
Branches 592 0 -592
===========================================
- Hits 3843 1324 -2519
+ Misses 1297 1058 -239
+ Partials 244 181 -63
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `51.65% <ø> (+0.03%)` | :arrow_up: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-71.03%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/handler/schema/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2NoZW1hL3NjaGVtYS5nbw==) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
| [api/internal/handler/server\_info/server\_info.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2VydmVyX2luZm8vc2VydmVyX2luZm8uZ28=) | `57.14% <0.00%> (-33.34%)` | :arrow_down: |
| ... and [113 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [4b8774f...0de7250](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran commented on a change in pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
liuxiran commented on a change in pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#discussion_r597786636
##########
File path: web/src/pages/Route/Create.tsx
##########
@@ -93,6 +95,10 @@ const Page: React.FC<Props> = (props) => {
}
}, []);
+ const getProxyrewriteEnable =() => {
Review comment:
fixed, thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (0c6bc6b) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/9a92ff95ddbe43432247a8b49ba63a9de115e726?el=desc) (9a92ff9) will **decrease** coverage by `0.56%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
==========================================
- Coverage 70.88% 70.32% -0.57%
==========================================
Files 135 46 -89
Lines 5485 3019 -2466
Branches 583 0 -583
==========================================
- Hits 3888 2123 -1765
+ Misses 1349 651 -698
+ Partials 248 245 -3
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `60.88% <ø> (+5.16%)` | :arrow_up: |
| backend-e2e-test-ginkgo | `46.40% <ø> (+6.33%)` | :arrow_up: |
| backend-unit-test | `51.54% <ø> (-0.14%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/conf/conf.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvbmYvY29uZi5nbw==) | `69.01% <0.00%> (-2.87%)` | :arrow_down: |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `87.95% <0.00%> (ø)` | |
| [web/src/pages/Route/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9MaXN0LnRzeA==) | | |
| [web/src/components/HeaderDropdown/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL0hlYWRlckRyb3Bkb3duL2luZGV4LnRzeA==) | | |
| [web/src/services/tool.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9zZXJ2aWNlcy90b29sLnRz) | | |
| [api/internal/core/store/query.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvcXVlcnkuZ28=) | | |
| [...Route/components/DebugViews/AuthenticationView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL0RlYnVnVmlld3MvQXV0aGVudGljYXRpb25WaWV3LnRzeA==) | | |
| [api/internal/core/entity/query.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L3F1ZXJ5Lmdv) | | |
| [web/src/components/Footer/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL0Zvb3Rlci9pbmRleC50c3g=) | | |
| [web/src/components/LabelsfDrawer/LabelsDrawer.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL0xhYmVsc2ZEcmF3ZXIvTGFiZWxzRHJhd2VyLnRzeA==) | | |
| ... and [81 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [9a92ff9...0c6bc6b](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (f6a8e63) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/f4f27d1a7b2f2a712c15dd922a30afd7e5d671db?el=desc) (f4f27d1) will **decrease** coverage by `23.91%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
===========================================
- Coverage 71.77% 47.86% -23.92%
===========================================
Files 133 47 -86
Lines 5471 3115 -2356
Branches 592 0 -592
===========================================
- Hits 3927 1491 -2436
- Misses 1301 1340 +39
- Partials 243 284 +41
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `47.86% <ø> (-0.23%)` | :arrow_down: |
| backend-unit-test | `?` | |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/handler/label/label.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbGFiZWwvbGFiZWwuZ28=) | `9.43% <0.00%> (-72.65%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_export.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfZXhwb3J0Lmdv) | `3.38% <0.00%> (-65.79%)` | :arrow_down: |
| [api/internal/utils/runtime/runtime.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3J1bnRpbWUvcnVudGltZS5nbw==) | `0.00% <0.00%> (-64.29%)` | :arrow_down: |
| [api/internal/handler/global\_rule/global\_rule.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZ2xvYmFsX3J1bGUvZ2xvYmFsX3J1bGUuZ28=) | `27.41% <0.00%> (-56.46%)` | :arrow_down: |
| [api/internal/core/store/validate\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGVfbW9jay5nbw==) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/filter/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9hdXRoZW50aWNhdGlvbi5nbw==) | `36.11% <0.00%> (-41.67%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `24.59% <0.00%> (-40.33%)` | :arrow_down: |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `58.43% <0.00%> (-30.73%)` | :arrow_down: |
| [api/internal/handler/service/service.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2VydmljZS9zZXJ2aWNlLmdv) | `62.60% <0.00%> (-29.57%)` | :arrow_down: |
| [api/internal/handler/route/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGUvcm91dGUuZ28=) | `51.83% <0.00%> (-26.94%)` | :arrow_down: |
| ... and [97 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [f4f27d1...f6a8e63](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] LiteSun commented on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
LiteSun commented on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-799531786
CI failed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (e4dbd3a) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/9a92ff95ddbe43432247a8b49ba63a9de115e726?el=desc) (9a92ff9) will **decrease** coverage by `0.69%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
==========================================
- Coverage 70.88% 70.18% -0.70%
==========================================
Files 135 46 -89
Lines 5485 3019 -2466
Branches 583 0 -583
==========================================
- Hits 3888 2119 -1769
+ Misses 1349 655 -694
+ Partials 248 245 -3
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `60.74% <ø> (+5.02%)` | :arrow_up: |
| backend-e2e-test-ginkgo | `46.27% <ø> (+6.19%)` | :arrow_up: |
| backend-unit-test | `51.54% <ø> (-0.14%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/core/storage/etcd.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmFnZS9ldGNkLmdv) | `43.63% <0.00%> (-3.64%)` | :arrow_down: |
| [api/internal/conf/conf.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvbmYvY29uZi5nbw==) | `69.01% <0.00%> (-2.87%)` | :arrow_down: |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `87.95% <0.00%> (ø)` | |
| [web/src/pages/Upstream/service.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9VcHN0cmVhbS9zZXJ2aWNlLnRz) | | |
| [web/src/app.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9hcHAudHN4) | | |
| [api/internal/core/store/selector.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc2VsZWN0b3IuZ28=) | | |
| [web/src/pages/PluginTemplate/components/Step1.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9QbHVnaW5UZW1wbGF0ZS9jb21wb25lbnRzL1N0ZXAxLnRzeA==) | | |
| [...pages/Route/components/Step1/RequestConfigView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAxL1JlcXVlc3RDb25maWdWaWV3LnRzeA==) | | |
| [web/src/components/Upstream/constant.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbnN0YW50LnRz) | | |
| [web/src/pages/Upstream/Create.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9VcHN0cmVhbS9DcmVhdGUudHN4) | | |
| ... and [80 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [9a92ff9...e4dbd3a](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (72a9b9b) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/f4f27d1a7b2f2a712c15dd922a30afd7e5d671db?el=desc) (f4f27d1) will **decrease** coverage by `19.96%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
===========================================
- Coverage 71.77% 51.81% -19.97%
===========================================
Files 133 38 -95
Lines 5471 2650 -2821
Branches 592 0 -592
===========================================
- Hits 3927 1373 -2554
+ Misses 1301 1089 -212
+ Partials 243 188 -55
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `51.81% <ø> (ø)` | |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-71.03%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/handler/handler.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvaGFuZGxlci5nbw==) | `42.59% <0.00%> (-35.19%)` | :arrow_down: |
| [api/internal/handler/schema/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2NoZW1hL3NjaGVtYS5nbw==) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
| ... and [113 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [f4f27d1...72a9b9b](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (f6a8e63) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/f4f27d1a7b2f2a712c15dd922a30afd7e5d671db?el=desc) (f4f27d1) will **decrease** coverage by `9.88%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
==========================================
- Coverage 71.77% 61.89% -9.89%
==========================================
Files 133 47 -86
Lines 5471 3115 -2356
Branches 592 0 -592
==========================================
- Hits 3927 1928 -1999
+ Misses 1301 874 -427
- Partials 243 313 +70
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `61.89% <ø> (-0.07%)` | :arrow_down: |
| backend-e2e-test-ginkgo | `47.86% <ø> (-0.23%)` | :arrow_down: |
| backend-unit-test | `?` | |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/runtime/runtime.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3J1bnRpbWUvcnVudGltZS5nbw==) | `0.00% <0.00%> (-64.29%)` | :arrow_down: |
| [api/internal/core/store/validate\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGVfbW9jay5nbw==) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `58.43% <0.00%> (-30.73%)` | :arrow_down: |
| [api/internal/filter/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9hdXRoZW50aWNhdGlvbi5nbw==) | `47.22% <0.00%> (-30.56%)` | :arrow_down: |
| [api/internal/handler/service/service.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2VydmljZS9zZXJ2aWNlLmdv) | `62.60% <0.00%> (-29.57%)` | :arrow_down: |
| [api/internal/filter/ip\_filter.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9pcF9maWx0ZXIuZ28=) | `48.71% <0.00%> (-23.08%)` | :arrow_down: |
| [api/internal/handler/global\_rule/global\_rule.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZ2xvYmFsX3J1bGUvZ2xvYmFsX3J1bGUuZ28=) | `64.51% <0.00%> (-19.36%)` | :arrow_down: |
| [...pi/internal/handler/plugin\_config/plugin\_config.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcGx1Z2luX2NvbmZpZy9wbHVnaW5fY29uZmlnLmdv) | `59.57% <0.00%> (-18.09%)` | :arrow_down: |
| [api/internal/utils/json\_patch.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL2pzb25fcGF0Y2guZ28=) | `44.82% <0.00%> (-13.80%)` | :arrow_down: |
| [api/internal/handler/upstream/upstream.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvdXBzdHJlYW0vdXBzdHJlYW0uZ28=) | `77.14% <0.00%> (-13.58%)` | :arrow_down: |
| ... and [92 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [f4f27d1...f6a8e63](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran commented on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
liuxiran commented on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-799974217
mark a unstable case: https://github.com/apache/apisix-dashboard/pull/1576/checks?check_run_id=2118588774
try to fix in : https://github.com/apache/apisix-dashboard/pull/1576/commits/92f2cd9b47334b82900f197b3963af8b754519bf
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (15d9c84) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/9a92ff95ddbe43432247a8b49ba63a9de115e726?el=desc) (9a92ff9) will **increase** coverage by `2.66%`.
> The diff coverage is `80.18%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
==========================================
+ Coverage 70.88% 73.54% +2.66%
==========================================
Files 135 87 -48
Lines 5485 2427 -3058
Branches 583 621 +38
==========================================
- Hits 3888 1785 -2103
+ Misses 1349 642 -707
+ Partials 248 0 -248
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `?` | |
| frontend-e2e-test | `73.54% <80.18%> (+0.30%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [web/src/components/Plugin/data.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9kYXRhLnRzeA==) | `100.00% <ø> (ø)` | |
| [web/src/pages/Route/components/Step1/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAxL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
| [web/src/pages/Route/constants.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb25zdGFudHMudHM=) | `100.00% <ø> (ø)` | |
| [web/src/pages/Route/transform.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS90cmFuc2Zvcm0udHM=) | `71.95% <72.05%> (-1.05%)` | :arrow_down: |
| [.../src/pages/Route/components/Step1/ProxyRewrite.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAxL1Byb3h5UmV3cml0ZS50c3g=) | `93.02% <93.02%> (ø)` | |
| [web/src/components/Plugin/PluginDetail.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9QbHVnaW5EZXRhaWwudHN4) | `77.64% <0.00%> (-0.93%)` | :arrow_down: |
| [web/src/pages/Plugin/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9QbHVnaW4vTGlzdC50c3g=) | `93.33% <0.00%> (ø)` | |
| [web/src/components/Plugin/PluginPage.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9QbHVnaW5QYWdlLnRzeA==) | `97.36% <0.00%> (ø)` | |
| [api/internal/filter/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9hdXRoZW50aWNhdGlvbi5nbw==) | | |
| [api/internal/filter/logging.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9sb2dnaW5nLmdv) | | |
| ... and [49 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [9a92ff9...15d9c84](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#discussion_r596705984
##########
File path: web/src/pages/Route/components/Step1/ProxyRewrite.tsx
##########
@@ -0,0 +1,289 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import React from 'react';
+import Form from 'antd/es/form';
+import { Button, Input, Radio, Row, Col } from 'antd';
+import { PlusOutlined, MinusCircleOutlined } from '@ant-design/icons';
+import { useIntl } from 'umi';
+import { PanelSection } from '@api7-dashboard/ui';
+
+import {
+ FORM_ITEM_LAYOUT,
+ FORM_ITEM_WITHOUT_LABEL,
+ ShcemeRewrite,
Review comment:
Uppercase is used in Class IMO, we'd better use something like `A_B_C` in the future.
##########
File path: web/cypress/integration/route/create-route-with-proxy-rewrite-plugin.spec.js
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+import menuLocaleUS from '../../../src/locales/en-US/menu';
+import componentLocaleUS from '../../../src/locales/en-US/component';
+import routeLocaleUS from '../../../src/pages/Route/locales/en-US';
+
+context('create route with proxy-rewrite plugin', () => {
+ const data = {
+ rewriteUri: '/get',
+ rewriteHeaderKey1: 'test1',
+ rewriteHeaderKey2: 'test2',
+ rewriteHeaderValue1: '1',
+ rewriteHeaderValue2: '2',
+ };
+
+ const domSelector = {
+ staticUri: '[data-cy=uri-static]',
+ staticHost: '[data-cy=host-static]',
+ keepHost: '[data-cy=host-keep]',
+ newUri: '#proxyRewrite_uri',
+ uriRewriteReg: '#proxyRewrite_regex_uri_0',
+ uriRewriteTemp: '#proxyRewrite_regex_uri_1',
+ newHost: '#proxyRewrite_host',
+ buttonCreateNewRewriteHeader: '[data-cy=create-new-rewrite-header]',
+ rewriteHeaderKey1: '#proxyRewrite_kvHeaders_0_key',
+ rewriteHeaderValue1: '#proxyRewrite_kvHeaders_0_value',
+ rewriteHeaderKey2: '#proxyRewrite_kvHeaders_1_key',
+ rewriteHeaderValue2: '#proxyRewrite_kvHeaders_1_value',
+ }
+
+ beforeEach(() => {
+ cy.login();
+
+ cy.fixture('selector.json').as('domSelector');
+ cy.fixture('data.json').as('data');
+ });
+
+ it('should create route with proxy-rewrite plugin', function () {
+ cy.visit('/');
+ cy.contains(menuLocaleUS['menu.routes']).click();
+
+ // show create page
+ cy.contains(componentLocaleUS['component.global.create']).click();
+ cy.get(this.domSelector.name).type(this.data.routeName);
+
+ // show requestOverride PanelSection
+ cy.contains(routeLocaleUS['page.route.panelSection.title.requestOverride']).should('be.visible');
+ // should show newPath after the uriRewriteType static clicked
+ cy.get(domSelector.staticUri).click();
+ cy.contains(routeLocaleUS['page.route.form.itemLabel.newPath']).should('be.visible');
+ cy.get(domSelector.newUri).should('be.visible').type(data.rewriteUri);
+ // should show regexp and template after uriRewriteType regexp clicked
+ cy.contains(routeLocaleUS['page.route.radio.regx']).click();
Review comment:
```suggestion
cy.contains(routeLocaleUS['page.route.radio.regex']).click();
```
##########
File path: web/src/pages/Route/components/Step3/index.tsx
##########
@@ -32,16 +32,17 @@ type Props = {
onChange: (data: { plugins: PluginComponent.Data; script: any, plugin_config_id?: string; }) => void;
readonly?: boolean;
isForceHttps: boolean;
+ isProxyEnable: boolean;
Review comment:
could it be optional and default to false?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (32217ab) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/9a92ff95ddbe43432247a8b49ba63a9de115e726?el=desc) (9a92ff9) will **increase** coverage by `1.24%`.
> The diff coverage is `50.45%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
==========================================
+ Coverage 70.88% 72.12% +1.24%
==========================================
Files 135 87 -48
Lines 5485 2429 -3056
Branches 583 621 +38
==========================================
- Hits 3888 1752 -2136
+ Misses 1349 677 -672
+ Partials 248 0 -248
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `?` | |
| frontend-e2e-test | `72.12% <50.45%> (-1.12%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [web/src/components/Plugin/data.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9kYXRhLnRzeA==) | `100.00% <ø> (ø)` | |
| [web/src/pages/Route/components/Step1/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAxL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
| [web/src/pages/Route/constants.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb25zdGFudHMudHM=) | `100.00% <ø> (ø)` | |
| [web/src/pages/Route/transform.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS90cmFuc2Zvcm0udHM=) | `60.97% <45.58%> (-12.03%)` | :arrow_down: |
| [.../src/pages/Route/components/Step1/ProxyRewrite.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAxL1Byb3h5UmV3cml0ZS50c3g=) | `58.13% <58.13%> (ø)` | |
| [web/src/components/Plugin/PluginDetail.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9QbHVnaW5EZXRhaWwudHN4) | `77.64% <0.00%> (-0.93%)` | :arrow_down: |
| [web/src/pages/Plugin/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9QbHVnaW4vTGlzdC50c3g=) | `93.33% <0.00%> (ø)` | |
| [web/src/components/Plugin/PluginPage.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9QbHVnaW5QYWdlLnRzeA==) | `97.36% <0.00%> (ø)` | |
| [api/internal/handler/ssl/ssl.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc3NsL3NzbC5nbw==) | | |
| [api/cmd/managerapi.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2NtZC9tYW5hZ2VyYXBpLmdv) | | |
| ... and [48 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [9a92ff9...32217ab](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
liuxiran edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-802621063
> @liuxiran just ignored it, Netlify still has some issues to resolve, I'm working on it.
got it, thanks.
then since all the errors fixed, please take a look when you are free, thanks @juzhiyuan @LiteSun @imjoey @guoqqqi
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (f6a8e63) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/f4f27d1a7b2f2a712c15dd922a30afd7e5d671db?el=desc) (f4f27d1) will **decrease** coverage by `0.63%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
==========================================
- Coverage 71.77% 71.13% -0.64%
==========================================
Files 133 47 -86
Lines 5471 3115 -2356
Branches 592 0 -592
==========================================
- Hits 3927 2216 -1711
+ Misses 1301 655 -646
- Partials 243 244 +1
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `61.89% <ø> (-0.07%)` | :arrow_down: |
| backend-e2e-test-ginkgo | `47.86% <ø> (-0.23%)` | :arrow_down: |
| backend-unit-test | `51.77% <ø> (-0.04%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `87.34% <0.00%> (-1.81%)` | :arrow_down: |
| [web/src/components/ActionBar/ActionBar.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL0FjdGlvbkJhci9BY3Rpb25CYXIudHN4) | | |
| [web/src/pages/SSL/components/Step1/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9TU0wvY29tcG9uZW50cy9TdGVwMS9pbmRleC50c3g=) | | |
| [web/src/pages/Consumer/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Db25zdW1lci9MaXN0LnRzeA==) | | |
| [web/src/pages/Consumer/Create.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Db25zdW1lci9DcmVhdGUudHN4) | | |
| [web/src/components/RawDataEditor/RawDataEditor.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1Jhd0RhdGFFZGl0b3IvUmF3RGF0YUVkaXRvci50c3g=) | | |
| [web/src/app.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9hcHAudHN4) | | |
| [web/src/pages/User/Login.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Vc2VyL0xvZ2luLnRzeA==) | | |
| [web/src/pages/Service/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9TZXJ2aWNlL0xpc3QudHN4) | | |
| [web/src/components/Upstream/UpstreamForm.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL1Vwc3RyZWFtRm9ybS50c3g=) | | |
| ... and [71 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [f4f27d1...f6a8e63](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io commented on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (8dc46ec) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/9a92ff95ddbe43432247a8b49ba63a9de115e726?el=desc) (9a92ff9) will **decrease** coverage by `19.33%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
===========================================
- Coverage 70.88% 51.54% -19.34%
===========================================
Files 135 37 -98
Lines 5485 2555 -2930
Branches 583 0 -583
===========================================
- Hits 3888 1317 -2571
+ Misses 1349 1057 -292
+ Partials 248 181 -67
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `51.54% <ø> (-0.14%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-71.03%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/handler/server\_info/server\_info.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2VydmVyX2luZm8vc2VydmVyX2luZm8uZ28=) | `57.14% <0.00%> (-33.34%)` | :arrow_down: |
| [api/internal/utils/closer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL2Nsb3Nlci5nbw==) | `0.00% <0.00%> (-33.34%)` | :arrow_down: |
| ... and [115 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [9a92ff9...8dc46ec](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran commented on a change in pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
liuxiran commented on a change in pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#discussion_r597083443
##########
File path: web/src/pages/Route/components/Step3/index.tsx
##########
@@ -32,16 +32,17 @@ type Props = {
onChange: (data: { plugins: PluginComponent.Data; script: any, plugin_config_id?: string; }) => void;
readonly?: boolean;
isForceHttps: boolean;
+ isProxyEnable: boolean;
Review comment:
yep, already fixed, thanks a lot
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] juzhiyuan merged pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
juzhiyuan merged pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran commented on a change in pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
liuxiran commented on a change in pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#discussion_r594853988
##########
File path: web/cypress/integration/route/create-route-with-proxy-rewrite-plugin.spec.js
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+import menuLocaleUS from '../../../src/locales/en-US/menu';
+import componentLocaleUS from '../../../src/locales/en-US/component';
+import routeLocaleUS from '../../../src/pages/Route/locales/en-US';
+
+context('create route with proxy-rewrite plugin', () => {
+ const data = {
+ rewriteUri: '/get',
+ rewriteHeaderKey1: 'test1',
+ rewriteHeaderKey2: 'test2',
+ rewriteHeaderValue1: '1',
+ rewriteHeaderValue2: '2',
+ };
+
+ const domSelector = {
+ staticUri: '[data-cy=uri-static]',
+ staticHost: '[data-cy=host-static]',
+ keepHost: '[data-cy=host-keep]',
+ newUri: '#proxyRewrite_uri',
+ uriRewriteReg: '#proxyRewrite_regex_uri_0',
+ uriRewriteTemp: '#proxyRewrite_regex_uri_1',
+ newHost: '#proxyRewrite_host',
+ buttonCreateNewRewriteHeader: '[data-cy=create-new-rewrite-header]',
+ rewriteHeaderKey1: '#proxyRewrite_kvHeaders_0_key',
+ rewriteHeaderValue1: '#proxyRewrite_kvHeaders_0_value',
+ rewriteHeaderKey2: '#proxyRewrite_kvHeaders_1_key',
+ rewriteHeaderValue2: '#proxyRewrite_kvHeaders_1_value',
+ }
+
+ beforeEach(() => {
+ cy.login();
+
+ cy.fixture('selector.json').as('domSelector');
+ cy.fixture('data.json').as('data');
+ });
+
+ it('should create route with proxy-rewrite plugin', function () {
+ cy.visit('/');
+ cy.contains(menuLocaleUS['menu.routes']).click();
+
+ // show create page
+ cy.contains(componentLocaleUS['component.global.create']).click();
+ cy.get(this.domSelector.name).type(this.data.routeName);
+
+ // show requestOverride PanelSection
+ cy.contains(routeLocaleUS['page.route.panelSection.title.requestOverride']).should('be.visible');
+ // should show newPath after the uriRewriteType static clicked
+ cy.get(domSelector.staticUri).click();
+ cy.contains(routeLocaleUS['page.route.form.itemLabel.newPath']).should('be.visible');
+ cy.get(domSelector.newUri).should('be.visible').type(data.rewriteUri);
+ // should show regexp and template after uriRewriteType regexp clicked
+ cy.contains(routeLocaleUS['page.route.radio.regx']).click();
+ cy.contains(routeLocaleUS['page.route.form.itemLabel.regx']).should('be.visible');
+ cy.get(domSelector.uriRewriteReg).should('be.visible');
+ cy.contains(routeLocaleUS['page.route.form.itemLabel.template']).should('be.visible');
+ cy.get(domSelector.uriRewriteTemp).should('be.visible');
+
+ cy.get(domSelector.staticUri).click();
+
+ // should show newhost after static host clicked
+ cy.get(domSelector.staticHost).click();
+ cy.contains(routeLocaleUS['page.route.form.itemLabel.newHost']).should('be.visible');
+ cy.get(domSelector.newHost).should('be.visible');
+ cy.get(domSelector.keepHost).click();
+ cy.get(domSelector.newHost).should('not.exist');
+
+ // new header key value input after createNewRewriteHeader button clicked
+ cy.get(domSelector.buttonCreateNewRewriteHeader).click();
+ cy.get(domSelector.rewriteHeaderKey1).should('be.visible').type(data.rewriteHeaderKey1);
+ cy.get(domSelector.rewriteHeaderValue1).should('be.visible').type(data.rewriteHeaderValue1);
+ cy.get(domSelector.rewriteHeaderKey2).should('be.visible').type(data.rewriteHeaderKey2);
+ cy.get(domSelector.rewriteHeaderValue2).should('be.visible').type(data.rewriteHeaderValue2);
+
+ cy.contains('Next').click();
+ cy.get(this.domSelector.nodes_0_host).type(this.data.host2);
+ cy.contains('Next').click();
+
+ // should not see proxy-rewrite plugin in the step3
+ cy.contains('proxy-rewrite').should('not.exist');
+ cy.contains('Next').click();
+ cy.contains('Submit').click();
+ cy.contains(this.data.submitSuccess).should('be.visible');
+ });
+
+ it('should keep the same proxy-rewrite data in edit route page with the create data', function () {
+ cy.visit('/');
+ cy.contains(menuLocaleUS['menu.routes']).click();
+
+ cy.get(this.domSelector.nameSelector).type(this.data.routeName);
+ cy.contains('Search').click();
+ cy.contains(this.data.routeName).siblings().contains('Edit').click();
+ cy.get(this.domSelector.name).type(this.data.routeName);
+
+ cy.contains(routeLocaleUS['page.route.form.itemLabel.newPath']).should('be.visible');
+ cy.get(domSelector.newUri).should('have.value',data.rewriteUri);
+
+ cy.get(domSelector.newHost).should('not.exist');
+
+ cy.get(domSelector.rewriteHeaderKey1).should('have.value', data.rewriteHeaderKey1);
+ cy.get(domSelector.rewriteHeaderValue1).should('have.value', data.rewriteHeaderValue1);
+ cy.get(domSelector.rewriteHeaderKey2).should('have.value', data.rewriteHeaderKey2);
+ cy.get(domSelector.rewriteHeaderValue2).should('have.value', data.rewriteHeaderValue2);
+
+ cy.contains('Next').click();
+ cy.get(this.domSelector.nodes_0_host).should('have.value', this.data.host2);
+ cy.contains('Next').click();
+
+ // should not see proxy-rewrite plugin in the step3
+ cy.contains('proxy-rewrite').should('not.exist');
+ cy.contains('Next').click();
+ cy.contains('Submit').click();
+ cy.contains(this.data.submitSuccess).should('be.visible');
+ });
+
+ it('should delete the route', function () {
+ cy.visit('/routes/list');
+ cy.get(this.domSelector.nameSelector).type(this.data.routeName);
+ cy.contains('Search').click();
+ cy.contains(this.data.routeName).siblings().contains('Delete').click();
+ cy.contains('button', 'Confirm').click();
+ cy.get(this.domSelector.notification).should('contain', this.data.deleteRouteSuccess);
+ });
+});
Review comment:
fixed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (0c6bc6b) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/9a92ff95ddbe43432247a8b49ba63a9de115e726?el=desc) (9a92ff9) will **decrease** coverage by `4.40%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
==========================================
- Coverage 70.88% 66.47% -4.41%
==========================================
Files 135 46 -89
Lines 5485 3019 -2466
Branches 583 0 -583
==========================================
- Hits 3888 2007 -1881
+ Misses 1349 764 -585
Partials 248 248
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `46.40% <ø> (+6.33%)` | :arrow_up: |
| backend-unit-test | `51.54% <ø> (-0.14%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `35.08% <0.00%> (-29.84%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `75.00% <0.00%> (-25.00%)` | :arrow_down: |
| [api/internal/handler/global\_rule/global\_rule.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZ2xvYmFsX3J1bGUvZ2xvYmFsX3J1bGUuZ28=) | `66.12% <0.00%> (-17.75%)` | :arrow_down: |
| [api/internal/utils/utils.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3V0aWxzLmdv) | `54.11% <0.00%> (-11.77%)` | :arrow_down: |
| [api/internal/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3JvdXRlLmdv) | `77.14% <0.00%> (-8.58%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `67.28% <0.00%> (-3.74%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `52.10% <0.00%> (-3.37%)` | :arrow_down: |
| [api/internal/conf/conf.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvbmYvY29uZi5nbw==) | `69.01% <0.00%> (-2.87%)` | :arrow_down: |
| [api/internal/core/store/validate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGUuZ28=) | `67.03% <0.00%> (-2.24%)` | :arrow_down: |
| [api/internal/handler/label/label.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbGFiZWwvbGFiZWwuZ28=) | `80.18% <0.00%> (-1.89%)` | :arrow_down: |
| ... and [90 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [9a92ff9...0c6bc6b](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (0c6bc6b) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/9a92ff95ddbe43432247a8b49ba63a9de115e726?el=desc) (9a92ff9) will **decrease** coverage by `19.33%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
===========================================
- Coverage 70.88% 51.54% -19.34%
===========================================
Files 135 37 -98
Lines 5485 2555 -2930
Branches 583 0 -583
===========================================
- Hits 3888 1317 -2571
+ Misses 1349 1057 -292
+ Partials 248 181 -67
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `51.54% <ø> (-0.14%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-71.03%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/handler/server\_info/server\_info.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2VydmVyX2luZm8vc2VydmVyX2luZm8uZ28=) | `57.14% <0.00%> (-33.34%)` | :arrow_down: |
| [api/internal/utils/closer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL2Nsb3Nlci5nbw==) | `0.00% <0.00%> (-33.34%)` | :arrow_down: |
| ... and [116 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [9a92ff9...0c6bc6b](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (96c8965) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/9a92ff95ddbe43432247a8b49ba63a9de115e726?el=desc) (9a92ff9) will **decrease** coverage by `19.33%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
===========================================
- Coverage 70.88% 51.54% -19.34%
===========================================
Files 135 37 -98
Lines 5485 2555 -2930
Branches 583 0 -583
===========================================
- Hits 3888 1317 -2571
+ Misses 1349 1057 -292
+ Partials 248 181 -67
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `51.54% <ø> (-0.14%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-71.03%)` | :arrow_down: |
| [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
| [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
| [api/internal/handler/server\_info/server\_info.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2VydmVyX2luZm8vc2VydmVyX2luZm8uZ28=) | `57.14% <0.00%> (-33.34%)` | :arrow_down: |
| [api/internal/utils/closer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL2Nsb3Nlci5nbw==) | `0.00% <0.00%> (-33.34%)` | :arrow_down: |
| ... and [116 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [9a92ff9...96c8965](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (96c8965) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/9a92ff95ddbe43432247a8b49ba63a9de115e726?el=desc) (9a92ff9) will **decrease** coverage by `0.56%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
==========================================
- Coverage 70.88% 70.32% -0.57%
==========================================
Files 135 46 -89
Lines 5485 3019 -2466
Branches 583 0 -583
==========================================
- Hits 3888 2123 -1765
+ Misses 1349 651 -698
+ Partials 248 245 -3
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `60.88% <ø> (+5.16%)` | :arrow_up: |
| backend-e2e-test-ginkgo | `46.40% <ø> (+6.33%)` | :arrow_up: |
| backend-unit-test | `51.54% <ø> (-0.14%)` | :arrow_down: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/conf/conf.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvbmYvY29uZi5nbw==) | `69.01% <0.00%> (-2.87%)` | :arrow_down: |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `87.95% <0.00%> (ø)` | |
| [api/internal/core/store/selector.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc2VsZWN0b3IuZ28=) | | |
| [web/src/pages/SSL/service.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9TU0wvc2VydmljZS50cw==) | | |
| [web/src/pages/Consumer/service.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Db25zdW1lci9zZXJ2aWNlLnRz) | | |
| [web/src/pages/User/Logout.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Vc2VyL0xvZ291dC50c3g=) | | |
| [...ages/Route/components/DebugViews/DebugDrawView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL0RlYnVnVmlld3MvRGVidWdEcmF3Vmlldy50c3g=) | | |
| [web/src/pages/SSL/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9TU0wvTGlzdC50c3g=) | | |
| [web/src/pages/Consumer/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Db25zdW1lci9MaXN0LnRzeA==) | | |
| [web/src/pages/PluginTemplate/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9QbHVnaW5UZW1wbGF0ZS9MaXN0LnRzeA==) | | |
| ... and [81 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [9a92ff9...96c8965](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#discussion_r597774968
##########
File path: web/src/pages/Route/Create.tsx
##########
@@ -93,6 +95,10 @@ const Page: React.FC<Props> = (props) => {
}
}, []);
+ const getProxyrewriteEnable =() => {
Review comment:
More like a spelling issue 🤔 but not hurry
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-795836615
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=h1) Report
> Merging [#1576](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=desc) (e4dbd3a) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/9a92ff95ddbe43432247a8b49ba63a9de115e726?el=desc) (9a92ff9) will **decrease** coverage by `10.13%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1576 +/- ##
===========================================
- Coverage 70.88% 60.74% -10.14%
===========================================
Files 135 46 -89
Lines 5485 3019 -2466
Branches 583 0 -583
===========================================
- Hits 3888 1834 -2054
+ Misses 1349 873 -476
- Partials 248 312 +64
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `60.74% <ø> (+5.02%)` | :arrow_up: |
| backend-e2e-test-ginkgo | `46.27% <ø> (+6.19%)` | :arrow_up: |
| backend-unit-test | `?` | |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/runtime/runtime.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3J1bnRpbWUvcnVudGltZS5nbw==) | `0.00% <0.00%> (-64.29%)` | :arrow_down: |
| [api/internal/core/store/validate\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGVfbW9jay5nbw==) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
| [api/internal/handler/service/service.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2VydmljZS9zZXJ2aWNlLmdv) | `57.44% <0.00%> (-34.05%)` | :arrow_down: |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `58.43% <0.00%> (-29.52%)` | :arrow_down: |
| [api/internal/filter/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9hdXRoZW50aWNhdGlvbi5nbw==) | `47.22% <0.00%> (-25.00%)` | :arrow_down: |
| [api/internal/filter/ip\_filter.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9pcF9maWx0ZXIuZ28=) | `48.71% <0.00%> (-23.08%)` | :arrow_down: |
| [api/internal/handler/global\_rule/global\_rule.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZ2xvYmFsX3J1bGUvZ2xvYmFsX3J1bGUuZ28=) | `64.51% <0.00%> (-19.36%)` | :arrow_down: |
| [...pi/internal/handler/plugin\_config/plugin\_config.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcGx1Z2luX2NvbmZpZy9wbHVnaW5fY29uZmlnLmdv) | `59.57% <0.00%> (-18.09%)` | :arrow_down: |
| [api/internal/handler/route/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGUvcm91dGUuZ28=) | `63.59% <0.00%> (-14.65%)` | :arrow_down: |
| [api/internal/handler/upstream/upstream.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvdXBzdHJlYW0vdXBzdHJlYW0uZ28=) | `74.76% <0.00%> (-14.02%)` | :arrow_down: |
| ... and [99 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1576/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=footer). Last update [9a92ff9...e4dbd3a](https://codecov.io/gh/apache/apisix-dashboard/pull/1576?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran commented on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
liuxiran commented on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-802621063
> @liuxiran just ignored it, Netlify still has some issues to resolve, I'm working on it.
got
> @liuxiran just ignored it, Netlify still has some issues to resolve, I'm working on it.
got it, thanks.
then since all the errors fixed, please take a look when you are free, thanks @juzhiyuan @LiteSun @imjoey @guoqqqi
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran commented on a change in pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
liuxiran commented on a change in pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#discussion_r597082996
##########
File path: web/cypress/integration/route/create-route-with-proxy-rewrite-plugin.spec.js
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+import menuLocaleUS from '../../../src/locales/en-US/menu';
+import componentLocaleUS from '../../../src/locales/en-US/component';
+import routeLocaleUS from '../../../src/pages/Route/locales/en-US';
+
+context('create route with proxy-rewrite plugin', () => {
+ const data = {
+ rewriteUri: '/get',
+ rewriteHeaderKey1: 'test1',
+ rewriteHeaderKey2: 'test2',
+ rewriteHeaderValue1: '1',
+ rewriteHeaderValue2: '2',
+ };
+
+ const domSelector = {
+ staticUri: '[data-cy=uri-static]',
+ staticHost: '[data-cy=host-static]',
+ keepHost: '[data-cy=host-keep]',
+ newUri: '#proxyRewrite_uri',
+ uriRewriteReg: '#proxyRewrite_regex_uri_0',
+ uriRewriteTemp: '#proxyRewrite_regex_uri_1',
+ newHost: '#proxyRewrite_host',
+ buttonCreateNewRewriteHeader: '[data-cy=create-new-rewrite-header]',
+ rewriteHeaderKey1: '#proxyRewrite_kvHeaders_0_key',
+ rewriteHeaderValue1: '#proxyRewrite_kvHeaders_0_value',
+ rewriteHeaderKey2: '#proxyRewrite_kvHeaders_1_key',
+ rewriteHeaderValue2: '#proxyRewrite_kvHeaders_1_value',
+ }
+
+ beforeEach(() => {
+ cy.login();
+
+ cy.fixture('selector.json').as('domSelector');
+ cy.fixture('data.json').as('data');
+ });
+
+ it('should create route with proxy-rewrite plugin', function () {
+ cy.visit('/');
+ cy.contains(menuLocaleUS['menu.routes']).click();
+
+ // show create page
+ cy.contains(componentLocaleUS['component.global.create']).click();
+ cy.get(this.domSelector.name).type(this.data.routeName);
+
+ // show requestOverride PanelSection
+ cy.contains(routeLocaleUS['page.route.panelSection.title.requestOverride']).should('be.visible');
+ // should show newPath after the uriRewriteType static clicked
+ cy.get(domSelector.staticUri).click();
+ cy.contains(routeLocaleUS['page.route.form.itemLabel.newPath']).should('be.visible');
+ cy.get(domSelector.newUri).should('be.visible').type(data.rewriteUri);
+ // should show regexp and template after uriRewriteType regexp clicked
+ cy.contains(routeLocaleUS['page.route.radio.regx']).click();
Review comment:
done
##########
File path: web/src/pages/Route/components/Step1/ProxyRewrite.tsx
##########
@@ -0,0 +1,289 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import React from 'react';
+import Form from 'antd/es/form';
+import { Button, Input, Radio, Row, Col } from 'antd';
+import { PlusOutlined, MinusCircleOutlined } from '@ant-design/icons';
+import { useIntl } from 'umi';
+import { PanelSection } from '@api7-dashboard/ui';
+
+import {
+ FORM_ITEM_LAYOUT,
+ FORM_ITEM_WITHOUT_LABEL,
+ ShcemeRewrite,
Review comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran commented on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
liuxiran commented on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-802413581
@imjoey @guoqqqi thanks for review, after update to the latest master branch, there are some new errors occurred in ci, let me try to fix it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] imjoey commented on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
imjoey commented on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-801706213
@liuxiran the FE e2e test still seems broken. Shall we fix it beforehand?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#discussion_r594013700
##########
File path: web/src/pages/Route/components/Step1/ProxyRewrite.tsx
##########
@@ -0,0 +1,291 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import React, { useEffect } from 'react';
+import Form from 'antd/es/form';
+import { Button, Input, Radio, Row, Col } from 'antd';
+import { PlusOutlined, MinusCircleOutlined } from '@ant-design/icons';
+import { useIntl } from 'umi';
+import { PanelSection } from '@api7-dashboard/ui';
+
+import {
+ FORM_ITEM_LAYOUT,
+ FORM_ITEM_WITHOUT_LABEL,
+ ShcemeRewrite,
+ URIRewriteType,
+ HostRewriteType
+} from '@/pages/Route/constants';
+
+const ProxyRewrite: React.FC<RouteModule.Step1PassProps> = ({ form, disabled }) => {
+ const { formatMessage } = useIntl();
+
+ const getUriRewriteItems = () => {
+ switch (form.getFieldValue('URIRewriteType')) {
+ case URIRewriteType.STATIC:
+ return (
+ <Form.Item
+ label={formatMessage({ id: 'page.route.form.itemLabel.newPath' })}
+ name={['proxyRewrite', 'uri']}
+ rules={[
+ {
+ required: true,
+ message: `${formatMessage({ id: 'component.global.pleaseEnter' })} ${formatMessage({
+ id: 'page.route.form.itemLabel.newPath',
+ })}`,
+ },
+ ]}
+ >
+ <Input
+ placeholder={`${formatMessage({
+ id: 'component.global.pleaseEnter',
+ })} ${formatMessage({ id: 'page.route.form.itemLabel.newPath' })}`}
+ disabled={disabled}
+ />
+ </Form.Item>
+ );
+ case URIRewriteType.REGEXP:
+ return (
+ <Form.List
+ name={['proxyRewrite', 'regex_uri']}
+ initialValue={['', '']}
+ >
+ {(fields) =>
+ fields.map((field, index) => {
+ switch (index) {
+ case 0:
+ return (
+ <Form.Item
+ label={formatMessage({ id: 'page.route.form.itemLabel.regx' })}
Review comment:
regex.
##########
File path: web/src/pages/Route/components/Step1/ProxyRewrite.tsx
##########
@@ -0,0 +1,291 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import React, { useEffect } from 'react';
+import Form from 'antd/es/form';
+import { Button, Input, Radio, Row, Col } from 'antd';
+import { PlusOutlined, MinusCircleOutlined } from '@ant-design/icons';
+import { useIntl } from 'umi';
+import { PanelSection } from '@api7-dashboard/ui';
+
+import {
+ FORM_ITEM_LAYOUT,
+ FORM_ITEM_WITHOUT_LABEL,
+ ShcemeRewrite,
+ URIRewriteType,
+ HostRewriteType
+} from '@/pages/Route/constants';
+
+const ProxyRewrite: React.FC<RouteModule.Step1PassProps> = ({ form, disabled }) => {
+ const { formatMessage } = useIntl();
+
+ const getUriRewriteItems = () => {
+ switch (form.getFieldValue('URIRewriteType')) {
+ case URIRewriteType.STATIC:
+ return (
+ <Form.Item
+ label={formatMessage({ id: 'page.route.form.itemLabel.newPath' })}
+ name={['proxyRewrite', 'uri']}
+ rules={[
+ {
+ required: true,
+ message: `${formatMessage({ id: 'component.global.pleaseEnter' })} ${formatMessage({
+ id: 'page.route.form.itemLabel.newPath',
+ })}`,
+ },
+ ]}
+ >
+ <Input
+ placeholder={`${formatMessage({
+ id: 'component.global.pleaseEnter',
+ })} ${formatMessage({ id: 'page.route.form.itemLabel.newPath' })}`}
+ disabled={disabled}
+ />
+ </Form.Item>
+ );
+ case URIRewriteType.REGEXP:
+ return (
+ <Form.List
+ name={['proxyRewrite', 'regex_uri']}
+ initialValue={['', '']}
+ >
+ {(fields) =>
+ fields.map((field, index) => {
+ switch (index) {
+ case 0:
+ return (
+ <Form.Item
+ label={formatMessage({ id: 'page.route.form.itemLabel.regx' })}
+ name={field.name}
+ key={field.name}
+ rules={[
+ {
+ required: true,
+ message: `${formatMessage({
+ id: 'component.global.pleaseEnter',
+ })} ${formatMessage({ id: 'page.route.form.itemLabel.regx' })}`,
+ },
+ ]}
+ >
+ <Input
+ placeholder={`${formatMessage({
+ id: 'component.global.pleaseEnter',
+ })} ${formatMessage({ id: 'page.route.form.itemLabel.regx' })}`}
+ disabled={disabled}
+ />
+ </Form.Item>
+ );
+ case 1:
+ return (
+ <Form.Item
+ label={formatMessage({ id: 'page.route.form.itemLabel.template' })}
+ name={field.name}
+ key={field.name}
+ rules={[
+ {
+ required: true,
+ message: `${formatMessage({
+ id: 'component.global.pleaseEnter',
+ })} ${formatMessage({ id: 'page.route.form.itemLabel.template' })}`,
+ },
+ ]}
+ >
+ <Input
+ placeholder={`${formatMessage({
+ id: 'component.global.pleaseEnter',
+ })} ${formatMessage({ id: 'page.route.form.itemLabel.template' })}`}
+ disabled={disabled}
+ />
+ </Form.Item>
+ );
+ default:
+ return null;
+ }
+ })
+ }
+ </Form.List>
+ );
+ case URIRewriteType.KEEP:
+ default:
+ return null;
+ }
+ };
+
+ const getHostRewriteItems = () => {
+ switch (form.getFieldValue('hostRewriteType')) {
+ case HostRewriteType.REWRITE:
+ return (
+ <Form.Item
+ label={formatMessage({ id: 'page.route.form.itemLabel.newHost' })}
+ name={['proxyRewrite', 'host']}
+ rules={[
+ {
+ required: true,
+ message: `${formatMessage({ id: 'component.global.pleaseEnter' })} ${formatMessage({
+ id: 'page.route.form.itemLabel.newHost',
+ })}`,
+ },
+ ]}
+ >
+ <Input
+ placeholder={`${formatMessage({
+ id: 'component.global.pleaseEnter',
+ })} ${formatMessage({ id: 'page.route.form.itemLabel.newHost' })}`}
+ disabled={disabled}
+ />
+ </Form.Item>
+ );
+ case HostRewriteType.KEEP:
+ default:
+ return null;
+ }
+ };
+
+ useEffect(() => {}, []);
Review comment:
useless line? 🤔
##########
File path: web/cypress/integration/route/create-route-with-proxy-rewrite-plugin.spec.js
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+import menuLocaleUS from '../../../src/locales/en-US/menu';
+import componentLocaleUS from '../../../src/locales/en-US/component';
+import routeLocaleUS from '../../../src/pages/Route/locales/en-US';
+
+context('create route with proxy-rewrite plugin', () => {
+ const data = {
+ rewriteUri: '/get',
+ rewriteHeaderKey1: 'test1',
+ rewriteHeaderKey2: 'test2',
+ rewriteHeaderValue1: '1',
+ rewriteHeaderValue2: '2',
+ };
+
+ const domSelector = {
+ staticUri: '[data-cy=uri-static]',
+ staticHost: '[data-cy=host-static]',
+ keepHost: '[data-cy=host-keep]',
+ newUri: '#proxyRewrite_uri',
+ uriRewriteReg: '#proxyRewrite_regex_uri_0',
+ uriRewriteTemp: '#proxyRewrite_regex_uri_1',
+ newHost: '#proxyRewrite_host',
+ buttonCreateNewRewriteHeader: '[data-cy=create-new-rewrite-header]',
+ rewriteHeaderKey1: '#proxyRewrite_kvHeaders_0_key',
+ rewriteHeaderValue1: '#proxyRewrite_kvHeaders_0_value',
+ rewriteHeaderKey2: '#proxyRewrite_kvHeaders_1_key',
+ rewriteHeaderValue2: '#proxyRewrite_kvHeaders_1_value',
+ }
+
+ beforeEach(() => {
+ cy.login();
+
+ cy.fixture('selector.json').as('domSelector');
+ cy.fixture('data.json').as('data');
+ });
+
+ it('should create route with proxy-rewrite plugin', function () {
+ cy.visit('/');
+ cy.contains(menuLocaleUS['menu.routes']).click();
+
+ // show create page
+ cy.contains(componentLocaleUS['component.global.create']).click();
+ cy.get(this.domSelector.name).type(this.data.routeName);
+
+ // show requestOverride PanelSection
+ cy.contains(routeLocaleUS['page.route.panelSection.title.requestOverride']).should('be.visible');
+ // should show newPath after the uriRewriteType static clicked
+ cy.get(domSelector.staticUri).click();
+ cy.contains(routeLocaleUS['page.route.form.itemLabel.newPath']).should('be.visible');
+ cy.get(domSelector.newUri).should('be.visible').type(data.rewriteUri);
+ // should show regexp and template after uriRewriteType regexp clicked
+ cy.contains(routeLocaleUS['page.route.radio.regx']).click();
+ cy.contains(routeLocaleUS['page.route.form.itemLabel.regx']).should('be.visible');
+ cy.get(domSelector.uriRewriteReg).should('be.visible');
+ cy.contains(routeLocaleUS['page.route.form.itemLabel.template']).should('be.visible');
+ cy.get(domSelector.uriRewriteTemp).should('be.visible');
+
+ cy.get(domSelector.staticUri).click();
+
+ // should show newhost after static host clicked
+ cy.get(domSelector.staticHost).click();
+ cy.contains(routeLocaleUS['page.route.form.itemLabel.newHost']).should('be.visible');
+ cy.get(domSelector.newHost).should('be.visible');
+ cy.get(domSelector.keepHost).click();
+ cy.get(domSelector.newHost).should('not.exist');
+
+ // new header key value input after createNewRewriteHeader button clicked
+ cy.get(domSelector.buttonCreateNewRewriteHeader).click();
+ cy.get(domSelector.rewriteHeaderKey1).should('be.visible').type(data.rewriteHeaderKey1);
+ cy.get(domSelector.rewriteHeaderValue1).should('be.visible').type(data.rewriteHeaderValue1);
+ cy.get(domSelector.rewriteHeaderKey2).should('be.visible').type(data.rewriteHeaderKey2);
+ cy.get(domSelector.rewriteHeaderValue2).should('be.visible').type(data.rewriteHeaderValue2);
+
+ cy.contains('Next').click();
+ cy.get(this.domSelector.nodes_0_host).type(this.data.host2);
+ cy.contains('Next').click();
+
+ // should not see proxy-rewrite plugin in the step3
+ cy.contains('proxy-rewrite').should('not.exist');
+ cy.contains('Next').click();
+ cy.contains('Submit').click();
+ cy.contains(this.data.submitSuccess).should('be.visible');
+ });
+
+ it('should keep the same proxy-rewrite data in edit route page with the create data', function () {
+ cy.visit('/');
+ cy.contains(menuLocaleUS['menu.routes']).click();
+
+ cy.get(this.domSelector.nameSelector).type(this.data.routeName);
+ cy.contains('Search').click();
+ cy.contains(this.data.routeName).siblings().contains('Edit').click();
+ cy.get(this.domSelector.name).type(this.data.routeName);
+
+ cy.contains(routeLocaleUS['page.route.form.itemLabel.newPath']).should('be.visible');
+ cy.get(domSelector.newUri).should('have.value',data.rewriteUri);
+
+ cy.get(domSelector.newHost).should('not.exist');
+
+ cy.get(domSelector.rewriteHeaderKey1).should('have.value', data.rewriteHeaderKey1);
+ cy.get(domSelector.rewriteHeaderValue1).should('have.value', data.rewriteHeaderValue1);
+ cy.get(domSelector.rewriteHeaderKey2).should('have.value', data.rewriteHeaderKey2);
+ cy.get(domSelector.rewriteHeaderValue2).should('have.value', data.rewriteHeaderValue2);
+
+ cy.contains('Next').click();
+ cy.get(this.domSelector.nodes_0_host).should('have.value', this.data.host2);
+ cy.contains('Next').click();
+
+ // should not see proxy-rewrite plugin in the step3
+ cy.contains('proxy-rewrite').should('not.exist');
+ cy.contains('Next').click();
+ cy.contains('Submit').click();
+ cy.contains(this.data.submitSuccess).should('be.visible');
+ });
+
+ it('should delete the route', function () {
+ cy.visit('/routes/list');
+ cy.get(this.domSelector.nameSelector).type(this.data.routeName);
+ cy.contains('Search').click();
+ cy.contains(this.data.routeName).siblings().contains('Delete').click();
+ cy.contains('button', 'Confirm').click();
+ cy.get(this.domSelector.notification).should('contain', this.data.deleteRouteSuccess);
+ });
+});
Review comment:
Newline, please.😊
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-802617293
@liuxiran just ignored it, Netlify still has some issues to resolve, I'm working on it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran commented on pull request #1576: fix: config proxy-rewrite out of the plugin market in route module
Posted by GitBox <gi...@apache.org>.
liuxiran commented on pull request #1576:
URL: https://github.com/apache/apisix-dashboard/pull/1576#issuecomment-799990641
> CI failed.
errors fixed, PTLA again when you are free, thanks a lot.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org