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 2022/03/24 10:57:46 UTC

[GitHub] [apisix-dashboard] Si-ege opened a new pull request #2393: feat: Adding view buttons to the plugin-template page

Si-ege opened a new pull request #2393:
URL: https://github.com/apache/apisix-dashboard/pull/2393


   Please answer these questions before submitting a pull request, **or your PR will get closed**.
   
   **Why submit this pull request?**
   
   - [ ] Bugfix
   - [ ] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   
   **What changes will this PR take into?**
   
   Please update this section with detailed description.
   
   **Related issues**
   
   fix/resolve #2342 
   1. Adding view buttons to the plugin-template page
   
   
   **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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] Si-ege commented on pull request #2393: feat: Adding view buttons to the plugin-template page

Posted by GitBox <gi...@apache.org>.
Si-ege commented on pull request #2393:
URL: https://github.com/apache/apisix-dashboard/pull/2393#issuecomment-1077499427


   ![image](https://user-images.githubusercontent.com/92985804/159902106-e3619e0c-1e72-4f3d-bc75-c37c32bb2932.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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] guoqqqi commented on a change in pull request #2393: feat: Adding view buttons to the plugin-template page

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



##########
File path: web/src/pages/PluginTemplate/List.tsx
##########
@@ -182,13 +182,18 @@ const Page: React.FC = () => {
       />
       <RawDataEditor
         visible={visible}
-        type="service"
-        readonly={true}
+        type="PluginTemplate"
+        readonly={false}
         data={rawData}
         onClose={() => {
           setVisible(false);
         }}
         onSubmit={(data: any) => {
+          handleTableActionSuccessResponse(
+            `${formatMessage({ id: 'component.global.submit' })} ${formatMessage({
+              id: 'component.status.success',
+            })}`,
+          );

Review comment:
       we can use the notification, refer to `notification` https://ant.design/components/notification-cn/
   

##########
File path: web/src/pages/PluginTemplate/List.tsx
##########
@@ -182,13 +182,18 @@ const Page: React.FC = () => {
       />
       <RawDataEditor
         visible={visible}
-        type="service"
-        readonly={true}
+        type="PluginTemplate"
+        readonly={false}
         data={rawData}
         onClose={() => {
           setVisible(false);
         }}
         onSubmit={(data: any) => {
+          handleTableActionSuccessResponse(
+            `${formatMessage({ id: 'component.global.submit' })} ${formatMessage({
+              id: 'component.status.success',

Review comment:
       Use one key, not two




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

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] Baoyuantop commented on a change in pull request #2393: feat: Adding view buttons to the plugin-template page

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



##########
File path: web/src/pages/PluginTemplate/List.tsx
##########
@@ -162,6 +180,21 @@ const Page: React.FC = () => {
           </Button>,
         ]}
       />
+      <RawDataEditor
+        visible={visible}
+        type="service"
+        readonly={true}
+        data={rawData}
+        onClose={() => {
+          setVisible(false);
+        }}
+        onSubmit={(data: any) => {
+          (editorMode === 'create' ? create(data) : update(id, data)).then(() => {
+            setVisible(false);

Review comment:
       Do we need a message alert?

##########
File path: web/cypress/integration/pluginTemplate/create-edit-delete-plugin-template.spec.js
##########
@@ -77,6 +78,19 @@ context('Create Configure and Delete PluginTemplate', () => {
     cy.contains('Submit').click();
     cy.get(selector.notification).should('contain', data.createPluginTemplateSuccess);
   });
+  it('should view the service', function () {
+    cy.visit('plugin-template/list');
+    cy.get(selector.refresh).click();
+    cy.get(selector.descriptionSelector).type(data.pluginTemplateName);
+    cy.contains('button', 'Search').click();
+    cy.contains(data.pluginTemplateName).siblings().contains('View').click();
+    cy.get(selector.drawer).should('be.visible');
+
+    cy.get(selector.monacoScroll).within(() => {
+      cy.contains('plugins').should('exist');
+      cy.contains(data.pluginTemplateName).should('exist');
+    });
+  });

Review comment:
       Since see that RawDataEditor has the ability to modify data, should we add tests to cover 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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #2393: feat: Adding view buttons to the plugin-template page

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


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2393?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2393](https://codecov.io/gh/apache/apisix-dashboard/pull/2393?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ffc2fdf) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/2f1ebac19d74264a2bb13f9741b89a2a07e00d46?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2f1ebac) will **increase** coverage by `0.08%`.
   > The diff coverage is `87.50%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #2393      +/-   ##
   ==========================================
   + Coverage   68.57%   68.66%   +0.08%     
   ==========================================
     Files         131      131              
     Lines        3421     3437      +16     
     Branches      828      829       +1     
   ==========================================
   + Hits         2346     2360      +14     
   - Misses       1075     1077       +2     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | frontend-e2e-test | `68.66% <87.50%> (+0.08%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2393?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [web/src/components/RawDataEditor/RawDataEditor.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2393/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Jhd0RhdGFFZGl0b3IvUmF3RGF0YUVkaXRvci50c3g=) | `38.96% <ø> (ø)` | |
   | [web/src/pages/PluginTemplate/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2393/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9QbHVnaW5UZW1wbGF0ZS9MaXN0LnRzeA==) | `76.47% <87.50%> (+5.04%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2393?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2393?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [162c5d7...ffc2fdf](https://codecov.io/gh/apache/apisix-dashboard/pull/2393?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-commenter commented on pull request #2393: feat: Adding view buttons to the plugin-template page

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


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2393?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2393](https://codecov.io/gh/apache/apisix-dashboard/pull/2393?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4ab51f8) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/a7e700a7baabd9bd5f7250e9f102dd94109f202d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a7e700a) will **decrease** coverage by `1.40%`.
   > The diff coverage is `87.50%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #2393      +/-   ##
   ==========================================
   - Coverage   70.07%   68.66%   -1.41%     
   ==========================================
     Files         189      131      -58     
     Lines        7441     3437    -4004     
     Branches      828      829       +1     
   ==========================================
   - Hits         5214     2360    -2854     
   + Misses       1921     1077     -844     
   + Partials      306        0     -306     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `?` | |
   | backend-e2e-test-ginkgo | `?` | |
   | backend-unit-test | `?` | |
   | frontend-e2e-test | `68.66% <87.50%> (+0.08%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2393?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [web/src/components/RawDataEditor/RawDataEditor.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2393/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Jhd0RhdGFFZGl0b3IvUmF3RGF0YUVkaXRvci50c3g=) | `38.96% <ø> (ø)` | |
   | [web/src/pages/PluginTemplate/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2393/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9QbHVnaW5UZW1wbGF0ZS9MaXN0LnRzeA==) | `76.47% <87.50%> (+5.04%)` | :arrow_up: |
   | [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2393/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | | |
   | [api/internal/handler/consumer/consumer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2393/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvY29uc3VtZXIvY29uc3VtZXIuZ28=) | | |
   | [api/internal/log/log.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2393/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2xvZy9sb2cuZ28=) | | |
   | [api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2393/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=) | | |
   | [api/cmd/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2393/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2NtZC92ZXJzaW9uLmdv) | | |
   | [api/internal/core/storage/etcd.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2393/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmFnZS9ldGNkLmdv) | | |
   | [api/internal/utils/closer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2393/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2Nsb3Nlci5nbw==) | | |
   | [...pi/internal/handler/plugin\_config/plugin\_config.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2393/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcGx1Z2luX2NvbmZpZy9wbHVnaW5fY29uZmlnLmdv) | | |
   | ... and [50 more](https://codecov.io/gh/apache/apisix-dashboard/pull/2393/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2393?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2393?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a7e700a...4ab51f8](https://codecov.io/gh/apache/apisix-dashboard/pull/2393?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] guoqqqi commented on a change in pull request #2393: feat: Adding view buttons to the plugin-template page

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



##########
File path: web/cypress/integration/pluginTemplate/create-edit-delete-plugin-template.spec.js
##########
@@ -77,6 +78,19 @@ context('Create Configure and Delete PluginTemplate', () => {
     cy.contains('Submit').click();
     cy.get(selector.notification).should('contain', data.createPluginTemplateSuccess);
   });
+  it('should view the service', function () {

Review comment:
       ```suggestion
     it('should view the plugin template', function () {
   ```

##########
File path: web/src/pages/PluginTemplate/List.tsx
##########
@@ -22,13 +22,19 @@ import type { ActionType, ProColumns } from '@ant-design/pro-table';
 import { Button, notification, Popconfirm, Select, Space, Tag } from 'antd';
 import { PlusOutlined } from '@ant-design/icons';
 import usePagination from '@/hooks/usePagination';
-import { fetchList, remove, fetchLabelList } from './service';
+import { fetchList, remove, create, fetchLabelList, update } from './service';
+import { RawDataEditor } from '@/components/RawDataEditor';
+import { omit } from 'lodash';

Review comment:
       Move this line to line 25




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

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org