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 2020/06/01 08:25:45 UTC

[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in pull request #223: feat: handle Modal close event

juzhiyuan commented on a change in pull request #223:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/223#discussion_r433100657



##########
File path: src/pages/Routes/Create.tsx
##########
@@ -55,6 +55,36 @@ const Create: React.FC = () => {
     }
   };
 
+  const renderPageSkip = () => {
+    // TODO: form validation
+    const preStep = () => {

Review comment:
       onPrev

##########
File path: src/pages/Routes/Create.tsx
##########
@@ -55,6 +55,36 @@ const Create: React.FC = () => {
     }
   };
 
+  const renderPageSkip = () => {
+    // TODO: form validation
+    const preStep = () => {

Review comment:
       ,

##########
File path: src/pages/Routes/components/Step1/index.tsx
##########
@@ -172,79 +172,77 @@ const Step1: React.FC<RoutesModule.StepProps> = ({ data, onChange }) => {
   const renderBaseRequestConfig = () => {
     const onProtocolChange = (e: CheckboxValueType[]) => {
       if (!e.includes('HTTP') && !e.includes('HTTPS')) return;
-      setProtocolValueList(e as HttpType[]);
+      setProtocolValueList(e as RequestProtocol[]);
     };
     const onMethodsChange = (checkedList: CheckboxValueType[]) => {
-      setHttpMethodsList({
-        checkedList: checkedList as HttpMethodsListType[],
-        indeterminate: !!checkedList.length && checkedList.length < httpMethodsOptionList.length,
-        checkAll: checkedList.length === httpMethodsOptionList.length,
+      setHttpMethodList({
+        checkedList: checkedList as HttpMethod[],
+        indeterminate: !!checkedList.length && checkedList.length < httpMethodOptionList.length,
+        checkAll: checkedList.length === httpMethodOptionList.length,
       });
     };
     const onCheckAllChange = (e: CheckboxChangeEvent) => {
-      setHttpMethodsList({
-        checkedList: e.target.checked ? httpMethodsOptionList : [],
+      setHttpMethodList({
+        checkedList: e.target.checked ? httpMethodOptionList : [],
         indeterminate: false,
         checkAll: e.target.checked,
       });
     };
     return (
-      <>
-        <PanelSection title="请求基础定义">
-          <Form {...formItemLayout} form={form} layout="horizontal" className={styles.stepForm}>
-            <Form.Item
-              label="协议"
-              name="protocol"
-              rules={[{ required: true, message: '请勾选协议' }]}
-            >
-              <Row>
-                <Checkbox.Group
-                  options={protocolList}
-                  value={protocolValueList}
-                  onChange={onProtocolChange}
-                />
-              </Row>
-            </Form.Item>
-            {/* TODO: name */}
-            <Form.Item label="HOST" rules={[{ required: true, message: '请输入 HOST' }]}>
-              {renderHosts()}
-              <Button
-                type="primary"
-                onClick={() => {
-                  addHost();
-                }}
-              >
-                增加
-              </Button>
-            </Form.Item>
-            {/* TODO: name */}
-            <Form.Item label="PATH">
-              {renderPaths()}
-              <Button onClick={addPath} type="primary">
-                增加
-              </Button>
-            </Form.Item>
-            <Form.Item
-              label="HTTP Methods"
-              name="httpMethods"
-              rules={[{ required: true, message: '请勾选 HTTP Methods' }]}
-            >
-              <Checkbox
-                indeterminate={httpMethodsList.indeterminate}
-                onChange={onCheckAllChange}
-                checked={httpMethodsList.checkAll}
-              >
-                ANY
-              </Checkbox>
+      <PanelSection title="请求基础定义">
+        <Form {...formItemLayout} form={form} layout="horizontal" className={styles.stepForm}>
+          <Form.Item
+            label="协议"
+            name="protocol"
+            rules={[{ required: true, message: '请勾选协议' }]}
+          >
+            <Row>
               <Checkbox.Group
-                options={httpMethodsOptionList}
-                value={httpMethodsList.checkedList}
-                onChange={onMethodsChange}
+                options={protocolList}
+                value={protocolValueList}
+                onChange={onProtocolChange}
               />
-            </Form.Item>
-          </Form>
-        </PanelSection>
-      </>
+            </Row>
+          </Form.Item>
+          {/* TODO: name */}
+          <Form.Item label="HOST" rules={[{ required: true, message: '请输入 HOST' }]}>
+            {renderHosts()}
+            <Button
+              type="primary"
+              onClick={() => {

Review comment:
       ,

##########
File path: src/pages/Routes/Create.tsx
##########
@@ -55,6 +55,36 @@ const Create: React.FC = () => {
     }
   };
 
+  const renderPageSkip = () => {
+    // TODO: form validation
+    const preStep = () => {
+      setCurrentStep(currentStep - 1);
+    };
+    const nextStep = () => {
+      if (currentStep === 3) {
+        message.success('创建成功');
+        return;
+      }
+      setCurrentStep(currentStep + 1);
+    };
+    return (
+      <div>

Review comment:
       fixed 

##########
File path: src/pages/Routes/Create.tsx
##########
@@ -55,6 +55,36 @@ const Create: React.FC = () => {
     }
   };
 
+  const renderPageSkip = () => {

Review comment:
       renderActionBar

##########
File path: src/pages/Routes/Create.tsx
##########
@@ -55,6 +55,36 @@ const Create: React.FC = () => {
     }
   };
 
+  const renderPageSkip = () => {
+    // TODO: form validation
+    const preStep = () => {
+      setCurrentStep(currentStep - 1);
+    };
+    const nextStep = () => {

Review comment:
       onNext
   




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