This is an automated email from the ASF dual-hosted git repository.
likeguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu-dashboard.git
The following commit(s) were added to refs/heads/master by this push:
new 25ea3dc0 Fix ApiDoc insert update failure (#276)
25ea3dc0 is described below
commit 25ea3dc0aa2d071dc3bf1463fd5a8c94bacd756d
Author: crudboy <[email protected]>
AuthorDate: Fri Apr 14 22:45:13 2023 +0800
Fix ApiDoc insert update failure (#276)
* Fix ApiDoc insertion update failure
* Modify the array traversal method
---------
Co-authored-by: hezc <[email protected]>
---
.../Document/components/AddAndUpdateApiDoc.js | 24 ++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/src/routes/Document/components/AddAndUpdateApiDoc.js
b/src/routes/Document/components/AddAndUpdateApiDoc.js
index 91382322..06083b7b 100644
--- a/src/routes/Document/components/AddAndUpdateApiDoc.js
+++ b/src/routes/Document/components/AddAndUpdateApiDoc.js
@@ -17,7 +17,7 @@
/* eslint-disable no-unused-expressions */
/* eslint-disable radix */
-import { Modal, Form, Input, Select, message } from "antd";
+import { Modal, Form, Input, Select, message,Radio } from "antd";
import React, { Component } from "react";
import PropTypes from "prop-types";
import { Method } from "./globalData";
@@ -42,6 +42,11 @@ const API_SOURCE_TYPE = [
"import swagger",
"import yapi"
];
+const STATE_TYPE = [
+ "unpublished",
+ "published",
+ "offline"
+];
class AddAndUpdateApiDoc extends Component {
static defaultProps = {
@@ -254,7 +259,7 @@ class AddAndUpdateApiDoc extends Component {
initialValue: rpcType
})(
<Select>
- {Object.values(RPCTYPE).map((e, i) => {
+ {RPCTYPE.map((e, i) => {
return (
<Select.Option key={`${e} ${i}`} value={e}>
{e}
@@ -277,9 +282,16 @@ class AddAndUpdateApiDoc extends Component {
],
initialValue: state
})(
- <Input
- placeholder={getIntlContent("SHENYU.DOCUMENT.APIDOC.STATE")}
- />
+ <Radio.Group buttonStyle="solid">
+ {STATE_TYPE.map((e, i) => {
+ return (
+ <Radio.Button key={`${e} ${i}`} value={i}>
+ {e}
+ </Radio.Button>
+ );
+ })}
+
+ </Radio.Group>
)}
</Form.Item>
<Form.Item
@@ -350,7 +362,7 @@ class AddAndUpdateApiDoc extends Component {
initialValue: apiSource
})(
<Select>
- {Object.values(API_SOURCE_TYPE).map((e, i) => {
+ {API_SOURCE_TYPE.map((e, i) => {
return (
<Select.Option key={`${e} ${i}`} value={i}>
{e}