You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ju...@apache.org on 2021/01/05 11:37:58 UTC

[apisix-dashboard] 02/02: style: codes format

This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a commit to branch test-plugins
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git

commit 04d3f807780f6ac364715882349868f9b9063641
Author: juzhiyuan <ju...@apache.org>
AuthorDate: Tue Jan 5 19:37:31 2021 +0800

    style: codes format
---
 web/cypress/integration/route/search-route.spec.js           |  5 +----
 .../integration/service/create-and-delete-service.spec.js    | 10 +++-------
 .../integration/upstream/create_and_delete_upstream.spec.js  |  2 +-
 web/src/components/Plugin/PluginPage.tsx                     |  4 +++-
 web/src/pages/Plugin/PluginMarket.tsx                        |  2 +-
 web/src/pages/Plugin/service.ts                              | 12 +++++++-----
 web/src/pages/Route/List.tsx                                 |  8 ++++++--
 web/src/pages/Route/service.ts                               |  2 +-
 web/src/pages/Service/Create.tsx                             |  9 ++++++++-
 web/src/pages/Service/List.tsx                               |  2 +-
 10 files changed, 32 insertions(+), 24 deletions(-)

diff --git a/web/cypress/integration/route/search-route.spec.js b/web/cypress/integration/route/search-route.spec.js
index 287b248..89a635d 100644
--- a/web/cypress/integration/route/search-route.spec.js
+++ b/web/cypress/integration/route/search-route.spec.js
@@ -104,10 +104,7 @@ context('Create and Search Route', () => {
   it('should delete the route', function () {
     cy.visit('/routes/list');
     for (let i = 0; i < 3; i += 1) {
-      cy.contains(`test${i}`)
-        .siblings()
-        .contains('Delete')
-        .click();
+      cy.contains(`test${i}`).siblings().contains('Delete').click();
       cy.contains('button', 'Confirm').click();
       cy.get(this.domSelector.notification).should('contain', 'Delete Route Successfully');
       cy.wait(300);
diff --git a/web/cypress/integration/service/create-and-delete-service.spec.js b/web/cypress/integration/service/create-and-delete-service.spec.js
index 1536951..9ee46a6 100644
--- a/web/cypress/integration/service/create-and-delete-service.spec.js
+++ b/web/cypress/integration/service/create-and-delete-service.spec.js
@@ -17,14 +17,12 @@
 /* eslint-disable no-undef */
 
 context('create and delete service ', () => {
-
   beforeEach(() => {
     // init login
     cy.login();
   });
 
   it('should create service', () => {
-
     // go to create service page
     cy.visit('/');
     cy.contains('Service').click();
@@ -38,7 +36,7 @@ context('create and delete service ', () => {
     cy.contains('Next').click();
     cy.contains('Next').click();
     cy.contains('Submit').click();
-  })
+  });
 
   it('should delete the service', () => {
     cy.visit('/');
@@ -46,12 +44,10 @@ context('create and delete service ', () => {
 
     cy.get('[title=Name]').type('service');
     cy.contains('Search').click();
-    
+
     cy.contains('service').siblings().contains('Delete').click();
     cy.contains('button', 'Confirm').click();
-    cy.fixture('selector.json').then(({
-      notification
-    }) => {
+    cy.fixture('selector.json').then(({ notification }) => {
       cy.get(notification).should('contain', 'Delete Service Successfully');
     });
   });
diff --git a/web/cypress/integration/upstream/create_and_delete_upstream.spec.js b/web/cypress/integration/upstream/create_and_delete_upstream.spec.js
index f220677..b445f0c 100644
--- a/web/cypress/integration/upstream/create_and_delete_upstream.spec.js
+++ b/web/cypress/integration/upstream/create_and_delete_upstream.spec.js
@@ -21,7 +21,7 @@ context('Create and Delete Upstream', () => {
   const sleepTime = 100; // the unit is milliseconds
   const domSelectors = {
     notification: '.ant-notification-notice-message',
-    selectItem: '.ant-select-item-option-content'
+    selectItem: '.ant-select-item-option-content',
   };
 
   beforeEach(() => {
diff --git a/web/src/components/Plugin/PluginPage.tsx b/web/src/components/Plugin/PluginPage.tsx
index 3a06e79..7f2a2fd 100644
--- a/web/src/components/Plugin/PluginPage.tsx
+++ b/web/src/components/Plugin/PluginPage.tsx
@@ -118,7 +118,9 @@ const PluginPage: React.FC<Props> = ({
                   }}
                   title={[
                     <div style={{ width: '100%', textAlign: 'center' }}>
-                      <span key={2} data-cy-plugin-name={item.name}>{item.name}</span>
+                      <span key={2} data-cy-plugin-name={item.name}>
+                        {item.name}
+                      </span>
                     </div>,
                   ]}
                   style={{ height: 258, width: 200 }}
diff --git a/web/src/pages/Plugin/PluginMarket.tsx b/web/src/pages/Plugin/PluginMarket.tsx
index ac3a4e1..dadbdcf 100644
--- a/web/src/pages/Plugin/PluginMarket.tsx
+++ b/web/src/pages/Plugin/PluginMarket.tsx
@@ -32,7 +32,7 @@ const PluginMarket: React.FC = () => {
       });
       setInitialData(plugins);
     });
-  }
+  };
 
   useEffect(() => {
     initPageData();
diff --git a/web/src/pages/Plugin/service.ts b/web/src/pages/Plugin/service.ts
index a11e2ad..7c51d03 100644
--- a/web/src/pages/Plugin/service.ts
+++ b/web/src/pages/Plugin/service.ts
@@ -27,11 +27,13 @@ export const fetchList = (): Promise<{
       plugins: Record<string, any>;
     };
   }>(`/global_rules/${DEFAULT_GLOBAL_RULE_ID}`).then(({ data }) => {
-    const plugins = Object.entries(data.plugins || {}).filter(([, value]) => !value.disable).map(([name, value]) => ({
-      id: name,
-      name,
-      value,
-    }));
+    const plugins = Object.entries(data.plugins || {})
+      .filter(([, value]) => !value.disable)
+      .map(([name, value]) => ({
+        id: name,
+        name,
+        value,
+      }));
 
     return {
       data: plugins,
diff --git a/web/src/pages/Route/List.tsx b/web/src/pages/Route/List.tsx
index 466fdd6..43983aa 100644
--- a/web/src/pages/Route/List.tsx
+++ b/web/src/pages/Route/List.tsx
@@ -199,8 +199,12 @@ const Page: React.FC = () => {
 
         return (
           <Select style={{ width: '100%' }} allowClear>
-            <option key={RouteStatus.Offline} value={RouteStatus.Offline}>{formatMessage({ id: 'page.route.unpublished' })}</option>
-            <option key={RouteStatus.Publish} value={RouteStatus.Publish}>{formatMessage({ id: 'page.route.published' })}</option>
+            <option key={RouteStatus.Offline} value={RouteStatus.Offline}>
+              {formatMessage({ id: 'page.route.unpublished' })}
+            </option>
+            <option key={RouteStatus.Publish} value={RouteStatus.Publish}>
+              {formatMessage({ id: 'page.route.published' })}
+            </option>
           </Select>
         );
       },
diff --git a/web/src/pages/Route/service.ts b/web/src/pages/Route/service.ts
index 7ae96d0..95b7392 100644
--- a/web/src/pages/Route/service.ts
+++ b/web/src/pages/Route/service.ts
@@ -49,7 +49,7 @@ export const fetchList = ({ current = 1, pageSize = 10, ...res }) => {
       label: labels.concat(API_VERSION).join(','),
       page: current,
       page_size: pageSize,
-      status
+      status,
     },
   }).then(({ data }) => {
     return {
diff --git a/web/src/pages/Service/Create.tsx b/web/src/pages/Service/Create.tsx
index 15dc252..c85849d 100644
--- a/web/src/pages/Service/Create.tsx
+++ b/web/src/pages/Service/Create.tsx
@@ -133,7 +133,14 @@ const Page: React.FC = (props) => {
           {step === 2 && (
             <PluginPage initialData={plugins} onChange={setPlugins} schemaType="route" />
           )}
-          {step === 3 && <Preview upstreamForm={upstreamForm} upstreamRef={upstreamRef} form={form} plugins={plugins} />}
+          {step === 3 && (
+            <Preview
+              upstreamForm={upstreamForm}
+              upstreamRef={upstreamRef}
+              form={form}
+              plugins={plugins}
+            />
+          )}
         </Card>
       </PageHeaderWrapper>
       <ActionBar step={step} lastStep={3} onChange={onStepChange} withResultView />
diff --git a/web/src/pages/Service/List.tsx b/web/src/pages/Service/List.tsx
index 6fd28fc..ed17347 100644
--- a/web/src/pages/Service/List.tsx
+++ b/web/src/pages/Service/List.tsx
@@ -40,7 +40,7 @@ const Page: React.FC = () => {
     {
       title: formatMessage({ id: 'component.global.description' }),
       dataIndex: 'desc',
-      hideInSearch: true
+      hideInSearch: true,
     },
     {
       title: formatMessage({ id: 'component.global.operation' }),