Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_22812535
incubator-superset
提交
dc203c17
I
incubator-superset
项目概览
qq_22812535
/
incubator-superset
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-superset
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
dc203c17
编写于
1月 11, 2021
作者:
G
Geido
提交者:
Ville Brofeldt
1月 12, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: Show datasets when search input is empty (#12391)
上级
6d593514
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
10 deletion
+17
-10
superset-frontend/spec/javascripts/datasource/ChangeDatasourceModal_spec.jsx
...pec/javascripts/datasource/ChangeDatasourceModal_spec.jsx
+6
-1
superset-frontend/src/common/components/Modal/Modal.tsx
superset-frontend/src/common/components/Modal/Modal.tsx
+3
-0
superset-frontend/src/datasource/ChangeDatasourceModal.tsx
superset-frontend/src/datasource/ChangeDatasourceModal.tsx
+8
-9
未找到文件。
superset-frontend/spec/javascripts/datasource/ChangeDatasourceModal_spec.jsx
浏览文件 @
dc203c17
...
...
@@ -81,19 +81,24 @@ describe('ChangeDatasourceModal', () => {
});
it
(
'
fetches datasources
'
,
async
()
=>
{
expect
(
fetchMock
.
calls
(
/api
\/
v1
\/
dataset/
)).
toHaveLength
(
6
);
expect
(
fetchMock
.
calls
(
/api
\/
v1
\/
dataset/
)).
toHaveLength
(
3
);
});
it
(
'
renders confirmation message
'
,
async
()
=>
{
await
waitForComponentToPaint
(
wrapper
,
1000
);
act
(()
=>
{
wrapper
.
find
(
'
[data-test="datasource-link"]
'
).
at
(
0
).
props
().
onClick
();
});
await
waitForComponentToPaint
(
wrapper
);
expect
(
wrapper
.
find
(
'
.proceed-btn
'
)).
toExist
();
});
it
(
'
changes the datasource
'
,
async
()
=>
{
await
waitForComponentToPaint
(
wrapper
,
1000
);
act
(()
=>
{
wrapper
.
find
(
'
[data-test="datasource-link"]
'
).
at
(
0
).
props
().
onClick
();
});
...
...
superset-frontend/src/common/components/Modal/Modal.tsx
浏览文件 @
dc203c17
...
...
@@ -41,11 +41,13 @@ interface ModalProps {
centered
?:
boolean
;
footer
?:
React
.
ReactNode
;
wrapProps
?:
object
;
height
?:
string
;
}
interface
StyledModalProps
extends
SupersetThemeProps
{
maxWidth
?:
string
;
responsive
?:
boolean
;
height
?:
string
;
}
export
const
StyledModal
=
styled
(
BaseModal
)
<
StyledModalProps
>
`
...
...
@@ -87,6 +89,7 @@ export const StyledModal = styled(BaseModal)<StyledModalProps>`
.ant-modal-body {
padding:
${({
theme
})
=>
theme
.
gridUnit
*
4
}
px;
overflow: auto;
${({
height
})
=>
height
&&
`height:
${
height
}
;`
}
}
.ant-modal-footer {
...
...
superset-frontend/src/datasource/ChangeDatasourceModal.tsx
浏览文件 @
dc203c17
...
...
@@ -25,7 +25,7 @@ import React, {
}
from
'
react
'
;
import
{
Alert
,
FormControl
,
FormControlProps
}
from
'
react-bootstrap
'
;
import
{
SupersetClient
,
t
,
styled
}
from
'
@superset-ui/core
'
;
import
TableView
from
'
src/components/TableView
'
;
import
TableView
,
{
EmptyWrapperType
}
from
'
src/components/TableView
'
;
import
StyledModal
from
'
src/common/components/Modal
'
;
import
Button
from
'
src/components/Button
'
;
import
{
useListViewResource
}
from
'
src/views/CRUD/hooks
'
;
...
...
@@ -120,9 +120,9 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
useDebouncedEffect
(
()
=>
{
if
(
filter
)
{
fetchData
({
...
emptyRequest
,
fetchData
(
{
...
emptyRequest
,
...(
filter
&&
{
filters
:
[
{
id
:
'
table_name
'
,
...
...
@@ -130,8 +130,8 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
value
:
filter
,
},
],
})
;
}
})
,
}
);
},
1000
,
[
filter
],
...
...
@@ -142,9 +142,6 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
if
(
searchRef
&&
searchRef
.
current
)
{
searchRef
.
current
.
focus
();
}
// Fetch initial datasets for tableview
await
fetchData
(
emptyRequest
);
};
if
(
show
)
{
...
...
@@ -224,6 +221,7 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
onHide
=
{
onHide
}
responsive
title
=
{
t
(
'
Change Dataset
'
)
}
height
=
"350px"
footer
=
{
<>
{
confirmChange
&&
(
...
...
@@ -268,6 +266,7 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
data
=
{
renderTableView
()
}
pageSize
=
{
20
}
className
=
"table-condensed"
emptyWrapperType
=
{
EmptyWrapperType
.
Small
}
/>
)
}
</>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录