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 351ff713 fix issue #306 (#307)
351ff713 is described below
commit 351ff713a5d9a901175fd336a69e6b0dfc5d7a78
Author: Kerwin Bryant <[email protected]>
AuthorDate: Tue Aug 8 23:07:08 2023 +0800
fix issue #306 (#307)
* fix issue #306
fix issue #306
* Unify the type-filed into String
---
src/routes/Plugin/Common/Selector.js | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/routes/Plugin/Common/Selector.js
b/src/routes/Plugin/Common/Selector.js
index efb4c9b8..705658f9 100644
--- a/src/routes/Plugin/Common/Selector.js
+++ b/src/routes/Plugin/Common/Selector.js
@@ -730,6 +730,7 @@ class AddModal extends Component {
enabled,
sort
} = copyData;
+
const formData = {
name,
type: type.toString(),
@@ -739,7 +740,7 @@ class AddModal extends Component {
sort
};
- if (type === 1) {
+ if (formData.type === "1") {
formData.matchMode = matchMode.toString();
this.initSelectorCondition({
selectorConditions: selectorConditions.map(v => {
@@ -755,7 +756,7 @@ class AddModal extends Component {
});
}
form.setFieldsValue(formData);
- this.setState({ visible: false, selectValue: type.toString() });
+ this.setState({ visible: false, selectValue: formData.type });
};
onDealChange = (value, item) => {
@@ -878,7 +879,7 @@ class AddModal extends Component {
visible
} = this.state;
- type = `${type}`;
+ type = `${type.toString()}` || "1";
let { selectorTypeEnums } = platform;
const { getFieldDecorator } = form;
@@ -944,7 +945,7 @@ class AddModal extends Component {
message: getIntlContent("SHENYU.COMMON.INPUTTYPE")
}
],
- initialValue: type || "1"
+ initialValue: type
})(
<Select
placeholder={getIntlContent("SHENYU.COMMON.TYPE")}
@@ -952,7 +953,7 @@ class AddModal extends Component {
>
{selectorTypeEnums.map(item => {
return (
- <Option key={item.code} value={item.code}>
+ <Option key={item.code} value={item.code.toString()}>
{getIntlContent(
`SHENYU.COMMON.SELECTOR.TYPE.${item.name.toUpperCase()}`,
item.name