@@ -19,6 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19
19
<div
20
20
v-show =" !filteredOutNodesCache.get(node)"
21
21
class =" c-treeitem"
22
+ :data-node-type =" node.type"
23
+ :data-node-name =" node.name"
22
24
>
23
25
<div
24
26
class =" node d-flex align-center"
@@ -30,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
30
32
v-if =" renderExpandCollapseBtn"
31
33
aria-label =" Expand/collapse"
32
34
class =" node-expand-collapse-button flex-shrink-0"
33
- @click =" toggleExpandCollapse"
35
+ @click =" toggleExpandCollapse() "
34
36
:style =" expandCollapseBtnStyle"
35
37
xmlns =" http://www.w3.org/2000/svg"
36
38
viewBox =" 0 0 24 24"
@@ -63,7 +65,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
63
65
/>
64
66
<span class =" mx-1" >{{ node.name }}</span >
65
67
</template >
66
- <template v-else-if =" node .type === ' task' " >
68
+ <div
69
+ v-else-if =" node.type === 'task'"
70
+ class =" d-flex align-center"
71
+ :class =" { 'flow-none': isFlowNone(node.node.flowNums) }"
72
+ >
67
73
<!-- Task summary -->
68
74
<Task
69
75
v-command-menu =" node"
@@ -85,7 +91,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
85
91
/>
86
92
</div >
87
93
<span class =" mx-1" >{{ node.name }}</span >
88
- </template >
94
+ <FlowNumsChip :flowNums =" node.node.flowNums" />
95
+ </div >
89
96
<template v-else-if =" node .type === ' job' " >
90
97
<Job
91
98
v-command-menu =" node"
@@ -134,7 +141,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
134
141
class =" ml-2 bg-grey text-white"
135
142
size =" small"
136
143
link
137
- @click =" toggleExpandCollapse"
144
+ @click =" toggleExpandCollapse() "
138
145
>
139
146
+{{ jobMessageOutputs.length - 5 }}
140
147
</v-chip >
@@ -175,20 +182,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
175
182
</template >
176
183
177
184
<script >
178
- import { mdiChevronRight } from ' @mdi/js'
185
+ import {
186
+ mdiChevronRight ,
187
+ } from ' @mdi/js'
179
188
import Task from ' @/components/cylc/Task.vue'
180
189
import Job from ' @/components/cylc/Job.vue'
181
190
import JobDetails from ' @/components/cylc/tree/JobDetails.vue'
182
191
import {
192
+ jobMessageOutputs ,
183
193
latestJob ,
184
- jobMessageOutputs
194
+ isFlowNone ,
185
195
} from ' @/utils/tasks'
186
196
import { getIndent , getNodeChildren } from ' @/components/cylc/tree/util'
197
+ import { once } from ' @/utils'
198
+ import { useToggle } from ' @vueuse/core'
199
+ import FlowNumsChip from ' @/components/cylc/common/FlowNumsChip.vue'
187
200
188
201
export default {
189
202
name: ' TreeItem' ,
190
203
191
204
components: {
205
+ FlowNumsChip,
192
206
Task,
193
207
Job,
194
208
JobDetails,
@@ -240,27 +254,23 @@ export default {
240
254
},
241
255
},
242
256
243
- data () {
257
+ setup (props ) {
258
+ const [isExpanded , toggleExpandCollapse ] = useToggle (
259
+ props .autoExpandTypes .includes (props .node .type )
260
+ )
261
+ // Toggles to true when this.isExpanded first becomes true and doesn't get recomputed afterwards
262
+ const renderChildren = once (isExpanded)
263
+
244
264
return {
245
- manuallyExpanded: null ,
265
+ isExpanded,
266
+ isFlowNone,
267
+ latestJob,
268
+ renderChildren,
269
+ toggleExpandCollapse,
246
270
}
247
271
},
248
272
249
273
computed: {
250
- isExpanded: {
251
- get () {
252
- return this .manuallyExpanded ?? this .autoExpandTypes .includes (this .node .type )
253
- },
254
- set (value) {
255
- this .manuallyExpanded = value
256
- }
257
- },
258
-
259
- renderChildren () {
260
- // Toggles to true when this.isExpanded first becomes true and doesn't get recomputed afterwards
261
- return this .renderChildren || this .isExpanded
262
- },
263
-
264
274
hasChildren () {
265
275
return (
266
276
// "job" nodes have auto-generated "job-detail" nodes
@@ -310,13 +320,6 @@ export default {
310
320
}
311
321
},
312
322
313
- methods: {
314
- toggleExpandCollapse () {
315
- this .isExpanded = ! this .isExpanded
316
- },
317
- latestJob
318
- },
319
-
320
323
icons: {
321
324
mdiChevronRight,
322
325
},
0 commit comments