Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
c65427cb
Unverified
Commit
c65427cb
authored
Jun 21, 2023
by
zhu-mingye
Committed by
GitHub
Jun 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fix] fix when DataSource type is doris the password is not required (#2098)
* fix datasource type doris bug * fix pom
parent
be80e7ac
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
pom.xml
dinky-web-flink/pom.xml
+1
-1
index.tsx
...ce/components/DataSourceModal/DataSourceProForm/index.tsx
+9
-6
No files found.
dinky-web-flink/pom.xml
View file @
c65427cb
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<groupId>
org.dinky
</groupId>
<groupId>
org.dinky
</groupId>
<artifactId>
dinky
</artifactId>
<artifactId>
dinky
</artifactId>
<version>
0.8.0
</version>
<version>
1.0.0-SNAPSHOT
</version>
</parent>
</parent>
<artifactId>
dinky-web-flink
</artifactId>
<artifactId>
dinky-web-flink
</artifactId>
...
...
dinky-web/src/pages/RegCenter/DataSource/components/DataSourceModal/DataSourceProForm/index.tsx
View file @
c65427cb
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
React
from
'react'
;
import
React
,
{
useState
}
from
'react'
;
import
{
FormInstance
}
from
'antd/es/form/hooks/useForm'
;
import
{
FormInstance
}
from
'antd/es/form/hooks/useForm'
;
import
{
Values
}
from
'async-validator'
;
import
{
Values
}
from
'async-validator'
;
import
{
ProForm
,
ProFormGroup
,
ProFormSelect
,
ProFormText
}
from
'@ant-design/pro-components'
;
import
{
ProForm
,
ProFormGroup
,
ProFormSelect
,
ProFormText
}
from
'@ant-design/pro-components'
;
...
@@ -44,11 +44,14 @@ const CodeEditProps = {
...
@@ -44,11 +44,14 @@ const CodeEditProps = {
const
DataSourceProForm
:
React
.
FC
<
DataSourceProFormProps
>
=
(
props
)
=>
{
const
DataSourceProForm
:
React
.
FC
<
DataSourceProFormProps
>
=
(
props
)
=>
{
const
{
values
,
form
,
flinkTemplateChange
,
flinkConfigChange
}
=
props
;
const
{
values
,
form
,
flinkTemplateChange
,
flinkConfigChange
}
=
props
;
const
[
excludeFormItem
,
setExcludeFormItem
]
=
React
.
useState
<
boolean
>
(
false
);
const
[
excludeFormItem
,
setExcludeFormItem
]
=
useState
<
boolean
>
(
false
);
const
[
dbType
,
setDbType
]
=
useState
<
string
>
(
values
.
type
??
'MySQL'
);
const
handleTypeChange
=
(
type
:
string
)
=>
{
if
(
type
===
'Hive'
||
type
===
'Presto'
)
{
const
handleTypeChange
=
(
value
:
any
)
=>
{
if
(
value
.
type
)
setDbType
(
value
.
type
);
if
(
value
.
type
===
'Hive'
||
value
.
type
===
'Presto'
)
{
setExcludeFormItem
(
true
);
setExcludeFormItem
(
true
);
}
else
{
}
else
{
setExcludeFormItem
(
false
);
setExcludeFormItem
(
false
);
...
@@ -94,7 +97,7 @@ const DataSourceProForm: React.FC<DataSourceProFormProps> = (props) => {
...
@@ -94,7 +97,7 @@ const DataSourceProForm: React.FC<DataSourceProFormProps> = (props) => {
name=
"password"
name=
"password"
width=
{
'sm'
}
width=
{
'sm'
}
label=
{
l
(
'rc.ds.password'
)
}
label=
{
l
(
'rc.ds.password'
)
}
rules=
{
[{
required
:
true
,
message
:
l
(
'rc.ds.passwordPlaceholder'
)}]
}
rules=
{
[{
required
:
dbType
!==
'Doris'
,
message
:
l
(
'rc.ds.passwordPlaceholder'
)}]
}
placeholder=
{
l
(
'rc.ds.passwordPlaceholder'
)
}
placeholder=
{
l
(
'rc.ds.passwordPlaceholder'
)
}
/>
/>
<
ProFormText
<
ProFormText
...
@@ -147,7 +150,7 @@ const DataSourceProForm: React.FC<DataSourceProFormProps> = (props) => {
...
@@ -147,7 +150,7 @@ const DataSourceProForm: React.FC<DataSourceProFormProps> = (props) => {
<
ProForm
<
ProForm
initialValues=
{
values
}
initialValues=
{
values
}
form=
{
form
}
form=
{
form
}
onValuesChange=
{
(
changedValues
)
=>
handleTypeChange
(
changedValues
.
type
)
}
onValuesChange=
{
(
changedValues
,
values
)
=>
handleTypeChange
(
values
)
}
submitter=
{
false
}
submitter=
{
false
}
>
>
{
renderDataSourceForm
()
}
{
renderDataSourceForm
()
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment