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
b45541fd
Unverified
Commit
b45541fd
authored
Sep 16, 2023
by
aiwenmo
Committed by
GitHub
Sep 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fix-2320] [web] Fix expanding all but only the root directory (#2321)
Co-authored-by:
wenmo
<
32723967+wenmo@users.noreply.github.com
>
parent
6b0c6897
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
10 deletions
+26
-10
index.tsx
.../pages/DataStudio/LeftContainer/Project/JobTree/index.tsx
+4
-3
function.tsx
...b/src/pages/DataStudio/LeftContainer/Project/function.tsx
+21
-6
index.tsx
dinky-web/src/pages/DataStudio/index.tsx
+1
-1
No files found.
dinky-web/src/pages/DataStudio/LeftContainer/Project/JobTree/index.tsx
View file @
b45541fd
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
import
{
import
{
buildProjectTree
,
buildProjectTree
,
generateList
,
generateList
,
getLeafKeyList
,
getParentKey
getParentKey
}
from
'@/pages/DataStudio/LeftContainer/Project/function'
;
}
from
'@/pages/DataStudio/LeftContainer/Project/function'
;
import
{
StateType
}
from
'@/pages/DataStudio/model'
;
import
{
StateType
}
from
'@/pages/DataStudio/model'
;
...
@@ -80,10 +80,11 @@ const JobTree: React.FC<TreeProps & connect> = (props) => {
...
@@ -80,10 +80,11 @@ const JobTree: React.FC<TreeProps & connect> = (props) => {
const
onExpand
=
(
expandedKeys
:
Key
[])
=>
{
const
onExpand
=
(
expandedKeys
:
Key
[])
=>
{
setExpandedKeys
(
expandedKeys
);
setExpandedKeys
(
expandedKeys
);
};
};
const
expandAll
=
()
=>
{
const
expandAll
=
()
=>
{
const
map
=
data
.
filter
((
x
:
{
isLeaf
:
any
})
=>
!
x
.
isLeaf
).
map
((
x
:
{
key
:
any
})
=>
x
.
key
);
setExpandedKeys
(
getLeafKeyList
(
projectData
));
setExpandedKeys
(
map
);
};
};
const
btn
=
BtnRoute
[
'menu.datastudio.project'
];
const
btn
=
BtnRoute
[
'menu.datastudio.project'
];
btn
[
1
].
onClick
=
expandAll
;
btn
[
1
].
onClick
=
expandAll
;
...
...
dinky-web/src/pages/DataStudio/LeftContainer/Project/function.tsx
View file @
b45541fd
import
{
getTabIcon
}
from
'@/pages/DataStudio/MiddleContainer/function'
;
import
{
getTabIcon
}
from
'@/pages/DataStudio/MiddleContainer/function'
;
import
{
Catalogue
}
from
'@/types/Studio/data.d'
;
import
{
Catalogue
}
from
'@/types/Studio/data.d'
;
import
{
searchTreeNode
}
from
'@/utils/function'
;
import
{
searchTreeNode
}
from
'@/utils/function'
;
export
const
generateList
=
(
data
:
any
,
list
:
any
[])
=>
{
export
const
generateList
=
(
data
:
any
,
list
:
any
[])
=>
{
for
(
const
element
of
data
)
{
for
(
const
element
of
data
)
{
const
node
=
element
;
const
node
=
element
;
const
{
name
,
id
,
parentId
,
level
}
=
node
;
const
{
name
,
id
,
parentId
,
level
}
=
node
;
list
.
push
({
name
,
id
,
key
:
id
,
title
:
name
,
parentId
,
level
});
list
.
push
({
name
,
id
,
key
:
id
,
title
:
name
,
parentId
,
level
});
if
(
node
.
children
)
{
if
(
node
.
children
)
{
generateList
(
node
.
children
,
list
);
generateList
(
node
.
children
,
list
);
}
}
}
}
return
list
;
return
list
;
};
};
export
const
getParentKey
=
(
key
:
number
|
string
,
tree
:
any
):
any
=>
{
export
const
getParentKey
=
(
key
:
number
|
string
,
tree
:
any
):
any
=>
{
let
parentKey
;
let
parentKey
;
for
(
const
element
of
tree
)
{
for
(
const
element
of
tree
)
{
...
@@ -28,6 +29,19 @@ export const getParentKey = (key: number | string, tree: any): any => {
...
@@ -28,6 +29,19 @@ export const getParentKey = (key: number | string, tree: any): any => {
return
parentKey
;
return
parentKey
;
};
};
export
const
getLeafKeyList
=
(
tree
:
any
):
any
=>
{
let
leafKeyList
=
[];
for
(
const
node
of
tree
)
{
if
(
node
.
isLeaf
)
{
leafKeyList
.
push
(
node
.
id
);
continue
;
}
if
(
node
.
children
)
{
leafKeyList
=
leafKeyList
.
concat
(
getLeafKeyList
(
node
.
children
))
}
}
return
leafKeyList
;
};
/**
/**
* build Catalogue tree
* build Catalogue tree
* @param {Catalogue[]} data
* @param {Catalogue[]} data
...
@@ -68,4 +82,5 @@ export const isUDF = (jobType: string) => {
...
@@ -68,4 +82,5 @@ export const isUDF = (jobType: string) => {
return
jobType
===
'Scala'
||
jobType
===
'Python'
||
jobType
===
'Java'
;
return
jobType
===
'Scala'
||
jobType
===
'Python'
||
jobType
===
'Java'
;
};
};
export
const
buildUDFTree
=
(
data
:
[])
=>
{};
export
const
buildUDFTree
=
(
data
:
[])
=>
{
};
dinky-web/src/pages/DataStudio/index.tsx
View file @
b45541fd
...
@@ -165,7 +165,7 @@ const DataStudio = (props: any) => {
...
@@ -165,7 +165,7 @@ const DataStudio = (props: any) => {
const
info
=
res
as
{
[
key
:
string
]:
any
};
const
info
=
res
as
{
[
key
:
string
]:
any
};
const
changed
=
Object
.
keys
(
params
.
taskData
).
some
((
key
)
=>
{
const
changed
=
Object
.
keys
(
params
.
taskData
).
some
((
key
)
=>
{
// ignore this property
// ignore this property
if
([
'updateTime'
,
'createTime'
,
'jobInstanceId'
].
includes
(
key
))
{
if
([
'updateTime'
,
'createTime'
,
'jobInstanceId'
,
'useResult'
,
'maxRowNum'
,
'useChangeLog'
,
'useAutoCancel'
].
includes
(
key
))
{
return
false
;
return
false
;
}
}
...
...
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