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/04/08 08:27:21 UTC

[GitHub] [apisix-dashboard] LiteSun opened a new pull request #1718: feat: add basic-auth UI Form

LiteSun opened a new pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718


   Please answer these questions before submitting a pull request, **or your PR will get closed**.
   
   **Why submit this pull request?**
   
   - [ ] Bugfix
   - [x] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   
   **What changes will this PR take into?**
   
   Please update this section with detailed description.
   
   **Related issues**
   
   fix/resolve #0001
   
   **Checklist:**
   
   - [ ] Did you explain what problem does this PR solve? Or what new features have been added?
   - [ ] Have you added corresponding test cases?
   - [ ] Have you modified the corresponding document?
   - [ ] Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first
   


-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#issuecomment-816335626


   Good to see i18n 


-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#issuecomment-815679491


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=h1) Report
   > Merging [#1718](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=desc) (0755b95) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/2c158a18f31d944fdf7f28727553bbf72f3198ce?el=desc) (2c158a1) will **decrease** coverage by `19.82%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #1718       +/-   ##
   ===========================================
   - Coverage   72.08%   52.25%   -19.83%     
   ===========================================
     Files         130       38       -92     
     Lines        5649     2660     -2989     
     Branches      648        0      -648     
   ===========================================
   - Hits         4072     1390     -2682     
   + Misses       1333     1082      -251     
   + Partials      244      188       -56     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `?` | |
   | backend-e2e-test-ginkgo | `?` | |
   | backend-unit-test | `52.25% <ø> (-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/1718?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/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/1718/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/1718/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/1718/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/1718/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/1718/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/1718/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/1718/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/1718/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/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2NoZW1hL3NjaGVtYS5nbw==) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
   | ... and [115 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?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/1718?src=pr&el=footer). Last update [2c158a1...0755b95](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?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 a change in pull request #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#discussion_r610335840



##########
File path: web/src/components/Plugin/UI/plugin.tsx
##########
@@ -0,0 +1,44 @@
+/*
+ * 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 { FormInstance } from 'antd/es/form';
+import { Empty } from 'antd';
+import { useIntl } from 'umi';
+
+import BasicAuth from './basic-auth'
+
+type Props = {
+  name: string,
+  form: FormInstance,
+  renderForm: boolean
+}
+
+export const PLUGIN_UI_LIST = ['basic-auth',];
+
+export const PluginForm: React.FC<Props> = ({ name, renderForm, form }) => {

Review comment:
       We are passing in objects, the order of the arguments does not affect the function's functionality IMO, any reference about this rule?




-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#issuecomment-815866497


   please update the codes styles.


-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#discussion_r610292467



##########
File path: web/src/components/Plugin/UI/basic-auth.tsx
##########
@@ -0,0 +1,59 @@
+/*
+ * 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 type { FormInstance } from 'antd/es/form';
+import { Form, Input } from 'antd';
+
+type Props = {
+  form: FormInstance;
+  ref?: any;
+};
+
+export const FORM_ITEM_LAYOUT = {
+  labelCol: {
+    span: 4,
+  },
+  wrapperCol: {
+    span: 8
+  },
+};
+
+const BasicAuth: React.FC<Props> = ({ form }) => {
+  return (
+    <Form
+      form={form}
+      {...FORM_ITEM_LAYOUT}
+    >
+      <Form.Item
+        label="username"

Review comment:
       ok, I've added an issue to handle these descriptions in one place, including fields name, field descriptions. Will be processed centrally in other PRs. see: #1724 




-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#discussion_r609734952



##########
File path: web/cypress/integration/plugin/create-delete-in-drawer-plugin.spec.js
##########
@@ -35,6 +35,14 @@ context('Delete Plugin List with the Drawer', () => {
       cy.get('button').click({ force: true });
     });
 
+    cy.get(this.domSelector.codeMirrorMode).invoke('text').then(text => {
+      if (text === 'UIForm') {
+        cy.get(this.domSelector.codeMirrorMode).click();
+        cy.get(this.domSelector.selectDropdown).should('be.visible');
+        cy.get( this.domSelector.selectDropdown + " [label=JSON]" ).click();

Review comment:
       format

##########
File path: web/cypress/integration/pluginTemplate/create-edit-delete-plugin-template.spec.js
##########
@@ -39,13 +39,14 @@ context('Create Configure and Delete PluginTemplate', () => {
       force: true
     });
     cy.focused(this.domSelector.drawer).should('exist');
-    cy.get(this.domSelector.drawer, {
-      timeout
-    }).within(() => {
-      cy.get(this.domSelector.disabledSwitcher).click({
-        force: true,
-      });
+
+    cy.get(this.domSelector.codeMirrorMode).click();
+    cy.get(this.domSelector.selectDropdown).should('be.visible');
+    cy.get( this.domSelector.selectDropdown + " [label=JSON]" ).click();

Review comment:
       ditto
   

##########
File path: web/src/components/Plugin/PluginDetail.tsx
##########
@@ -188,11 +206,28 @@ const PluginDetail: React.FC<Props> = ({
         ref.current.editor.setValue(jsonData);
         break;
       }
+
+      case codeMirrorModeList.UIForm: {
+        if (codeMirrorMode === 'JSON') {

Review comment:
       ```suggestion
           if (codeMirrorMode === codeMirrorModeList.JSON) {
   ```




-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#discussion_r610219314



##########
File path: web/src/components/Plugin/UI/basic-auth.tsx
##########
@@ -0,0 +1,59 @@
+/*
+ * 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 type { FormInstance } from 'antd/es/form';
+import { Form, Input } from 'antd';
+
+type Props = {
+  form: FormInstance;
+  ref?: any;
+};
+
+export const FORM_ITEM_LAYOUT = {
+  labelCol: {
+    span: 4,
+  },
+  wrapperCol: {
+    span: 8
+  },
+};
+
+const BasicAuth: React.FC<Props> = ({ form }) => {

Review comment:
       yep




-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#issuecomment-815679491


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=h1) Report
   > Merging [#1718](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=desc) (23fb278) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/2c158a18f31d944fdf7f28727553bbf72f3198ce?el=desc) (2c158a1) will **decrease** coverage by `0.49%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1718      +/-   ##
   ==========================================
   - Coverage   72.08%   71.59%   -0.50%     
   ==========================================
     Files         130       47      -83     
     Lines        5649     3126    -2523     
     Branches      648        0     -648     
   ==========================================
   - Hits         4072     2238    -1834     
   + Misses       1333      645     -688     
   + Partials      244      243       -1     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `62.34% <ø> (+0.06%)` | :arrow_up: |
   | backend-e2e-test-ginkgo | `48.62% <ø> (+0.12%)` | :arrow_up: |
   | backend-unit-test | `52.29% <ø> (ø)` | |
   | 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/1718?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...pages/Route/components/Step1/MatchingRulesView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAxL01hdGNoaW5nUnVsZXNWaWV3LnRzeA==) | | |
   | [...src/pages/SSL/components/CertificateForm/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9TU0wvY29tcG9uZW50cy9DZXJ0aWZpY2F0ZUZvcm0vaW5kZXgudHN4) | | |
   | [web/src/pages/Route/Create.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9DcmVhdGUudHN4) | | |
   | [web/src/components/RightContent/AvatarDropdown.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1JpZ2h0Q29udGVudC9BdmF0YXJEcm9wZG93bi50c3g=) | | |
   | [web/src/components/PluginOrchestration/service.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbk9yY2hlc3RyYXRpb24vc2VydmljZS50cw==) | | |
   | [...eb/src/components/PluginOrchestration/constants.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbk9yY2hlc3RyYXRpb24vY29uc3RhbnRzLnRz) | | |
   | [web/src/pages/Route/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9MaXN0LnRzeA==) | | |
   | [web/src/pages/Consumer/service.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Db25zdW1lci9zZXJ2aWNlLnRz) | | |
   | [web/src/pages/Route/components/Step3/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAzL2luZGV4LnRzeA==) | | |
   | [web/src/pages/Route/components/Step1/MetaView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAxL01ldGFWaWV3LnRzeA==) | | |
   | ... and [73 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?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/1718?src=pr&el=footer). Last update [2c158a1...23fb278](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#issuecomment-815679491


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=h1) Report
   > Merging [#1718](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=desc) (4f3e9bd) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/2c158a18f31d944fdf7f28727553bbf72f3198ce?el=desc) (2c158a1) will **decrease** coverage by `19.79%`.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 4f3e9bd differs from pull request most recent head ee2dfb7. Consider uploading reports for the commit ee2dfb7 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #1718       +/-   ##
   ===========================================
   - Coverage   72.08%   52.29%   -19.80%     
   ===========================================
     Files         130       38       -92     
     Lines        5649     2660     -2989     
     Branches      648        0      -648     
   ===========================================
   - Hits         4072     1391     -2681     
   + Misses       1333     1081      -252     
   + Partials      244      188       -56     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `?` | |
   | backend-e2e-test-ginkgo | `?` | |
   | backend-unit-test | `52.29% <ø> (ø)` | |
   | 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/1718?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/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/1718/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/1718/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/1718/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/1718/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/1718/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/1718/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/1718/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/1718/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/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2NoZW1hL3NjaGVtYS5nbw==) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
   | ... and [115 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?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/1718?src=pr&el=footer). Last update [2c158a1...ee2dfb7](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
liuxiran commented on a change in pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#discussion_r610269050



##########
File path: web/src/components/Plugin/UI/basic-auth.tsx
##########
@@ -0,0 +1,59 @@
+/*
+ * 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 type { FormInstance } from 'antd/es/form';
+import { Form, Input } from 'antd';
+
+type Props = {
+  form: FormInstance;
+  ref?: any;
+};
+
+export const FORM_ITEM_LAYOUT = {
+  labelCol: {
+    span: 4,
+  },
+  wrapperCol: {
+    span: 8
+  },
+};
+
+const BasicAuth: React.FC<Props> = ({ form }) => {

Review comment:
       LGTM, let's wait for CI. 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] jbampton commented on a change in pull request #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
jbampton commented on a change in pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#discussion_r610318828



##########
File path: web/src/components/Plugin/UI/basic-auth.tsx
##########
@@ -0,0 +1,59 @@
+/*
+ * 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 type { FormInstance } from 'antd/es/form';
+import { Form, Input } from 'antd';
+
+type Props = {
+  form: FormInstance;
+  ref?: any;
+};
+
+export const FORM_ITEM_LAYOUT = {
+  labelCol: {
+    span: 4,
+  },
+  wrapperCol: {
+    span: 8
+  },
+};
+
+const BasicAuth: React.FC<Props> = ({ form }) => {
+  return (
+    <Form
+      form={form}
+      {...FORM_ITEM_LAYOUT}
+    >
+      <Form.Item
+        label="username"

Review comment:
       Small changed needed for ordering attributes and you do have it correct just below in another code block
   
   ```suggestion
          <Form.Item
               label="username"
               name="username"
               required
           >    
   ```




-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#discussion_r610339000



##########
File path: web/cypress/fixtures/selector.json
##########
@@ -82,5 +82,8 @@
   "twentyPerPage": "[title=\"20 / page\"]",
   "pageList": ".ant-table-pagination-right",
   "pageTwo": ".ant-pagination-item-2",
-  "pageTwoActived": ".ant-pagination-item-2.ant-pagination-item-active"
+  "pageTwoActived": ".ant-pagination-item-2.ant-pagination-item-active",
+  "selectDropdown": ".ant-select-dropdown",
+  "codeMirrorMode": "[data-cy='code-mirror-mode']",
+  "selectJSON":".ant-select-dropdown [label=JSON]"

Review comment:
       ok, will be adjusted in another PR.




-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#issuecomment-815679491


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=h1) Report
   > Merging [#1718](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=desc) (23fb278) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/2c158a18f31d944fdf7f28727553bbf72f3198ce?el=desc) (2c158a1) will **decrease** coverage by `19.79%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #1718       +/-   ##
   ===========================================
   - Coverage   72.08%   52.29%   -19.80%     
   ===========================================
     Files         130       38       -92     
     Lines        5649     2660     -2989     
     Branches      648        0      -648     
   ===========================================
   - Hits         4072     1391     -2681     
   + Misses       1333     1081      -252     
   + Partials      244      188       -56     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `?` | |
   | backend-e2e-test-ginkgo | `?` | |
   | backend-unit-test | `52.29% <ø> (ø)` | |
   | 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/1718?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/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/1718/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/1718/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/1718/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/1718/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/1718/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/1718/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/1718/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/1718/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/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2NoZW1hL3NjaGVtYS5nbw==) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
   | ... and [115 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?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/1718?src=pr&el=footer). Last update [2c158a1...23fb278](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#issuecomment-815679491


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=h1) Report
   > Merging [#1718](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=desc) (132dcf4) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/2c158a18f31d944fdf7f28727553bbf72f3198ce?el=desc) (2c158a1) will **decrease** coverage by `19.79%`.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 132dcf4 differs from pull request most recent head 59dba3e. Consider uploading reports for the commit 59dba3e to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #1718       +/-   ##
   ===========================================
   - Coverage   72.08%   52.29%   -19.80%     
   ===========================================
     Files         130       38       -92     
     Lines        5649     2660     -2989     
     Branches      648        0      -648     
   ===========================================
   - Hits         4072     1391     -2681     
   + Misses       1333     1081      -252     
   + Partials      244      188       -56     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `?` | |
   | backend-e2e-test-ginkgo | `?` | |
   | backend-unit-test | `52.29% <ø> (ø)` | |
   | 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/1718?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/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/1718/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/1718/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/1718/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/1718/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/1718/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/1718/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/1718/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/1718/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/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2NoZW1hL3NjaGVtYS5nbw==) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
   | ... and [115 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?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/1718?src=pr&el=footer). Last update [2c158a1...59dba3e](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
liuxiran commented on a change in pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#discussion_r609876700



##########
File path: web/src/components/Plugin/UI/basic-auth.tsx
##########
@@ -0,0 +1,59 @@
+/*
+ * 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 type { FormInstance } from 'antd/es/form';
+import { Form, Input } from 'antd';
+
+type Props = {
+  form: FormInstance;
+  ref?: any;
+};
+
+export const FORM_ITEM_LAYOUT = {
+  labelCol: {
+    span: 4,
+  },
+  wrapperCol: {
+    span: 8
+  },
+};
+
+const BasicAuth: React.FC<Props> = ({ form }) => {

Review comment:
       there is a difference between basic-auth plugin in route and basic-auth plugin in consumer, it would be better to distinguish it according to schematype




-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
LiteSun commented on pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#issuecomment-816352408


   > Is there a preview page?
   
   Currently, each pr does not have a preview address, it needs to be pulled locally to preview.


-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#issuecomment-815679491


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=h1) Report
   > Merging [#1718](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=desc) (23fb278) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/2c158a18f31d944fdf7f28727553bbf72f3198ce?el=desc) (2c158a1) will **decrease** coverage by `4.80%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1718      +/-   ##
   ==========================================
   - Coverage   72.08%   67.27%   -4.81%     
   ==========================================
     Files         130       47      -83     
     Lines        5649     3126    -2523     
     Branches      648        0     -648     
   ==========================================
   - Hits         4072     2103    -1969     
   + Misses       1333      773     -560     
   - Partials      244      250       +6     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `47.66% <ø> (-14.62%)` | :arrow_down: |
   | backend-e2e-test-ginkgo | `?` | |
   | backend-unit-test | `52.29% <ø> (ø)` | |
   | 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/1718?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...l/handler/route\_online\_debug/route\_online\_debug.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGVfb25saW5lX2RlYnVnL3JvdXRlX29ubGluZV9kZWJ1Zy5nbw==) | `5.55% <0.00%> (-70.38%)` | :arrow_down: |
   | [api/internal/handler/healthz/healthz.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvaGVhbHRoei9oZWFsdGh6Lmdv) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `81.25% <0.00%> (-18.75%)` | :arrow_down: |
   | [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `39.49% <0.00%> (-15.97%)` | :arrow_down: |
   | [api/internal/handler/schema/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2NoZW1hL3NjaGVtYS5nbw==) | `90.47% <0.00%> (-9.53%)` | :arrow_down: |
   | [api/internal/handler/handler.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvaGFuZGxlci5nbw==) | `68.51% <0.00%> (-9.26%)` | :arrow_down: |
   | [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `63.55% <0.00%> (-7.48%)` | :arrow_down: |
   | [api/internal/handler/route/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGUvcm91dGUuZ28=) | `71.42% <0.00%> (-7.35%)` | :arrow_down: |
   | [api/internal/handler/ssl/ssl.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc3NsL3NzbC5nbw==) | `67.53% <0.00%> (-5.76%)` | :arrow_down: |
   | [api/internal/filter/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9hdXRoZW50aWNhdGlvbi5nbw==) | `72.22% <0.00%> (-5.56%)` | :arrow_down: |
   | ... and [91 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?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/1718?src=pr&el=footer). Last update [2c158a1...23fb278](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?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] moonming commented on pull request #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
moonming commented on pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#issuecomment-816345602


   Is there a preview page?


-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
LiteSun commented on pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#issuecomment-816379228


   > /lgtm
   > 
   > Noted here that the empty list item reflects `null` instead of `` should be eliminated.
   
   Thanks for the note, will keep this in mind when dealing with plugins that have list item.


-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#discussion_r610262237



##########
File path: web/src/components/Plugin/UI/basic-auth.tsx
##########
@@ -0,0 +1,59 @@
+/*
+ * 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 type { FormInstance } from 'antd/es/form';
+import { Form, Input } from 'antd';
+
+type Props = {
+  form: FormInstance;
+  ref?: any;
+};
+
+export const FORM_ITEM_LAYOUT = {
+  labelCol: {
+    span: 4,
+  },
+  wrapperCol: {
+    span: 8
+  },
+};
+
+const BasicAuth: React.FC<Props> = ({ form }) => {

Review comment:
       I have changed the logic in this section so that UIForm shows empty when no configuration is required, please review again, thank you. @liuxiran  cc @juzhiyuan 
   
   ![image](https://user-images.githubusercontent.com/31329157/114115310-29d32b00-9915-11eb-8692-63047904f55a.png)
   ![image](https://user-images.githubusercontent.com/31329157/114115418-5d15ba00-9915-11eb-80c0-60927d73030a.png)
   




-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#discussion_r610328339



##########
File path: web/cypress/fixtures/selector.json
##########
@@ -82,5 +82,8 @@
   "twentyPerPage": "[title=\"20 / page\"]",
   "pageList": ".ant-table-pagination-right",
   "pageTwo": ".ant-pagination-item-2",
-  "pageTwoActived": ".ant-pagination-item-2.ant-pagination-item-active"
+  "pageTwoActived": ".ant-pagination-item-2.ant-pagination-item-active",
+  "selectDropdown": ".ant-select-dropdown",
+  "codeMirrorMode": "[data-cy='code-mirror-mode']",
+  "selectJSON":".ant-select-dropdown [label=JSON]"

Review comment:
       ```suggestion
     "selectJSON": ".ant-select-dropdown [label=JSON]"
   ```




-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#discussion_r610321633



##########
File path: web/src/components/Plugin/UI/basic-auth.tsx
##########
@@ -0,0 +1,59 @@
+/*
+ * 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 type { FormInstance } from 'antd/es/form';
+import { Form, Input } from 'antd';
+
+type Props = {
+  form: FormInstance;
+  ref?: any;
+};
+
+export const FORM_ITEM_LAYOUT = {
+  labelCol: {
+    span: 4,
+  },
+  wrapperCol: {
+    span: 8
+  },
+};
+
+const BasicAuth: React.FC<Props> = ({ form }) => {
+  return (
+    <Form
+      form={form}
+      {...FORM_ITEM_LAYOUT}
+    >
+      <Form.Item
+        label="username"

Review comment:
       updated, 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] juzhiyuan commented on a change in pull request #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#discussion_r610291998



##########
File path: web/src/components/Plugin/UI/basic-auth.tsx
##########
@@ -0,0 +1,59 @@
+/*
+ * 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 type { FormInstance } from 'antd/es/form';
+import { Form, Input } from 'antd';
+
+type Props = {
+  form: FormInstance;
+  ref?: any;
+};
+
+export const FORM_ITEM_LAYOUT = {
+  labelCol: {
+    span: 4,
+  },
+  wrapperCol: {
+    span: 8
+  },
+};
+
+const BasicAuth: React.FC<Props> = ({ form }) => {
+  return (
+    <Form
+      form={form}
+      {...FORM_ITEM_LAYOUT}
+    >
+      <Form.Item
+        label="username"

Review comment:
       no..




-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
liuxiran commented on a change in pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#discussion_r609873454



##########
File path: web/cypress/integration/plugin/create-delete-in-drawer-plugin.spec.js
##########
@@ -32,7 +32,17 @@ context('Delete Plugin List with the Drawer', () => {
     cy.contains('Create').click();
 
     cy.contains(this.data.basicAuthPlugin).parents(this.domSelector.pluginCardBordered).within(() => {
-      cy.get('button').click({ force: true });
+      cy.get('button').click({
+        force: true
+      });
+    });
+
+    cy.get(this.domSelector.codeMirrorMode).invoke('text').then(text => {
+      if (text === 'UIForm') {
+        cy.get(this.domSelector.codeMirrorMode).click();
+        cy.get(this.domSelector.selectDropdown).should('be.visible');
+        cy.get(this.domSelector.selectDropdown + " [label=JSON]").click();

Review comment:
       it would be better to use string template here.
   ```suggestion
           cy.get(`${this.domSelector.selectDropdown} [label=JSON]`).click();
   ```
   
   or define a new domselector would also be a good choice




-- 
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] membphis commented on a change in pull request #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#discussion_r610282445



##########
File path: web/src/components/Plugin/UI/basic-auth.tsx
##########
@@ -0,0 +1,59 @@
+/*
+ * 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 type { FormInstance } from 'antd/es/form';
+import { Form, Input } from 'antd';
+
+type Props = {
+  form: FormInstance;
+  ref?: any;
+};
+
+export const FORM_ITEM_LAYOUT = {
+  labelCol: {
+    span: 4,
+  },
+  wrapperCol: {
+    span: 8
+  },
+};
+
+const BasicAuth: React.FC<Props> = ({ form }) => {
+  return (
+    <Form
+      form={form}
+      {...FORM_ITEM_LAYOUT}
+    >
+      <Form.Item
+        label="username"

Review comment:
       `User Name`
   `Password`
   
   this style is better for users




-- 
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 merged pull request #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
LiteSun merged pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718


   


-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#issuecomment-815679491


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=h1) Report
   > Merging [#1718](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=desc) (132dcf4) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/2c158a18f31d944fdf7f28727553bbf72f3198ce?el=desc) (2c158a1) will **decrease** coverage by `4.93%`.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 132dcf4 differs from pull request most recent head 59dba3e. Consider uploading reports for the commit 59dba3e to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1718      +/-   ##
   ==========================================
   - Coverage   72.08%   67.14%   -4.94%     
   ==========================================
     Files         130       47      -83     
     Lines        5649     3126    -2523     
     Branches      648        0     -648     
   ==========================================
   - Hits         4072     2099    -1973     
   + Misses       1333      777     -556     
   - Partials      244      250       +6     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `47.53% <ø> (-14.75%)` | :arrow_down: |
   | backend-e2e-test-ginkgo | `?` | |
   | backend-unit-test | `52.29% <ø> (ø)` | |
   | 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/1718?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...l/handler/route\_online\_debug/route\_online\_debug.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGVfb25saW5lX2RlYnVnL3JvdXRlX29ubGluZV9kZWJ1Zy5nbw==) | `5.55% <0.00%> (-70.38%)` | :arrow_down: |
   | [api/internal/handler/healthz/healthz.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvaGVhbHRoei9oZWFsdGh6Lmdv) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `81.25% <0.00%> (-18.75%)` | :arrow_down: |
   | [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `39.49% <0.00%> (-15.97%)` | :arrow_down: |
   | [api/internal/handler/schema/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2NoZW1hL3NjaGVtYS5nbw==) | `90.47% <0.00%> (-9.53%)` | :arrow_down: |
   | [api/internal/handler/handler.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvaGFuZGxlci5nbw==) | `68.51% <0.00%> (-9.26%)` | :arrow_down: |
   | [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `63.55% <0.00%> (-7.48%)` | :arrow_down: |
   | [api/internal/handler/route/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGUvcm91dGUuZ28=) | `71.42% <0.00%> (-7.35%)` | :arrow_down: |
   | [api/internal/handler/ssl/ssl.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc3NsL3NzbC5nbw==) | `67.53% <0.00%> (-5.76%)` | :arrow_down: |
   | [api/internal/filter/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9hdXRoZW50aWNhdGlvbi5nbw==) | `72.22% <0.00%> (-5.56%)` | :arrow_down: |
   | ... and [91 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1718/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?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/1718?src=pr&el=footer). Last update [2c158a1...59dba3e](https://codecov.io/gh/apache/apisix-dashboard/pull/1718?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 a change in pull request #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#discussion_r610295653



##########
File path: web/src/components/Plugin/UI/basic-auth.tsx
##########
@@ -0,0 +1,59 @@
+/*
+ * 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 type { FormInstance } from 'antd/es/form';
+import { Form, Input } from 'antd';
+
+type Props = {
+  form: FormInstance;
+  ref?: any;
+};
+
+export const FORM_ITEM_LAYOUT = {
+  labelCol: {
+    span: 4,
+  },
+  wrapperCol: {
+    span: 8
+  },
+};
+
+const BasicAuth: React.FC<Props> = ({ form }) => {
+  return (
+    <Form
+      form={form}
+      {...FORM_ITEM_LAYOUT}
+    >
+      <Form.Item
+        label="username"

Review comment:
       we can discuss those  in #1724 




-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
liuxiran commented on pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#issuecomment-816361354


   > > Is there a preview page?
   > 
   > Currently, each pr does not have a preview address, it needs to be pulled locally to preview.
   
   may be provide a  video also a good choice, which can explain the changes on the UE more clearly


-- 
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 #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#issuecomment-816396852


   @jbampton Hi, I just noticed your suggestions :) Could you please file a new PR? due to this change will trigger CI many times 🤣


-- 
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] jbampton commented on a change in pull request #1718: feat: add basic-auth UI Form

Posted by GitBox <gi...@apache.org>.
jbampton commented on a change in pull request #1718:
URL: https://github.com/apache/apisix-dashboard/pull/1718#discussion_r610326679



##########
File path: web/src/components/Plugin/UI/plugin.tsx
##########
@@ -0,0 +1,44 @@
+/*
+ * 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 { FormInstance } from 'antd/es/form';
+import { Empty } from 'antd';
+import { useIntl } from 'umi';
+
+import BasicAuth from './basic-auth'
+
+type Props = {

Review comment:
       Does this order work for `.tsx`?
   
   ```suggestion
   type Props = {
     form: FormInstance,
     name: string,
     renderForm: boolean
   }
   ```

##########
File path: web/src/components/Plugin/UI/plugin.tsx
##########
@@ -0,0 +1,44 @@
+/*
+ * 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 { FormInstance } from 'antd/es/form';
+import { Empty } from 'antd';
+import { useIntl } from 'umi';
+
+import BasicAuth from './basic-auth'
+
+type Props = {
+  name: string,
+  form: FormInstance,
+  renderForm: boolean
+}
+
+export const PLUGIN_UI_LIST = ['basic-auth',];
+
+export const PluginForm: React.FC<Props> = ({ name, renderForm, form }) => {

Review comment:
       I started learning `.tsx` today so I still don't know much.  But maybe const line should have ordered arguments ?
   
   ```suggestion
   export const PluginForm: React.FC<Props> = ({  form, name, renderForm }) => {
   ```

##########
File path: web/src/components/Plugin/PluginDetail.tsx
##########
@@ -328,12 +366,13 @@ const PluginDetail: React.FC<Props> = ({
               }}
               data-cy='code-mirror-mode'
             ></Select>,
-            <Button type="primary" onClick={formatCodes} key={3}>
+            <Button type="primary" onClick={formatCodes} key={3} disabled={codeMirrorMode === codeMirrorModeList.UIForm}>
               {formatMessage({ id: 'component.global.format' })}
-            </Button>,
+            </Button>
           ]}
         />
-        <CodeMirror
+        {Boolean(codeMirrorMode === codeMirrorModeList.UIForm) && <PluginForm name={name} form={UIForm} renderForm={!(pluginType === 'auth' && schemaType !== 'consumer')} />}

Review comment:
       Should this be `form, name, renderForm` ?
   
   ```suggestion
           {Boolean(codeMirrorMode === codeMirrorModeList.UIForm) && <PluginForm form={UIForm} name={name} renderForm={!(pluginType === 'auth' && schemaType !== 'consumer')} />}
   ```

##########
File path: web/src/components/Plugin/PluginDetail.tsx
##########
@@ -161,23 +172,30 @@ const PluginDetail: React.FC<Props> = ({
   const handleModeChange = (value: PluginComponent.CodeMirrorMode) => {
     switch (value) {
       case codeMirrorModeList.JSON: {
-        const { data: yamlData, error } = yaml2json(ref.current.editor.getValue(), true);
-
-        if (error) {
-          notification.error({
-            message: 'Invalid Yaml data',
-          });
-          return;
+        if (codeMirrorMode === codeMirrorModeList.YAML) {
+          const { data: yamlData, error } = yaml2json(ref.current.editor.getValue(), true);
+          if (error) {
+            notification.error({
+              message: 'Invalid Yaml data',

Review comment:
       ```suggestion
                 message: 'Invalid YAML data',
   ```




-- 
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