Skip to content

Commit 538c73e

Browse files
authored
Merge pull request #1230 from oliver-sanders/5366
store: fix ancestor order
2 parents 330bea5 + 9c2b813 commit 538c73e

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ cycle point and family in tree & table views.
2323

2424
### Fixes
2525

26+
[#1230](https://github.com/cylc/cylc-ui/pull/1230) -
27+
Fixes an issue where tasks were missing from the GUI in workflows which
28+
use multi-level family inheritance.
29+
2630
[#1182](https://github.com/cylc/cylc-ui/pull/1182) - Fixes bug in filtering
2731
by task name.
2832

src/services/mock/json/App.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@
100100
{"id": "~user/one//20000102T0000Z/succeeded"}
101101
],
102102
"ancestors": [
103-
{"name": "root"},
104-
{"name": "GOOD"}
103+
{"name": "GOOD"},
104+
{"name": "root"}
105105
]
106106
}
107107
],

src/store/workflows.module.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ function getFamilyTree (tokens, node) {
358358
}
359359

360360
// add family levels below the cycle point
361-
for (const ancestor of node.ancestors || []) {
361+
for (const ancestor of node.ancestors.slice().reverse() || []) {
362362
ret.push([
363363
'family',
364364
ancestor.name,

tests/unit/store/workflows.spec.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,8 @@ describe('cylc tree', () => {
493493
id: '~u/w//1/PENGUIN',
494494
name: 'PENGUIN',
495495
ancestors: [
496-
{ name: 'root' },
497-
{ name: 'ANIMAL' }
496+
{ name: 'ANIMAL' },
497+
{ name: 'root' }
498498
],
499499
__typename: 'FamilyProxy'
500500
}
@@ -661,6 +661,7 @@ describe('cylc tree', () => {
661661
'workflows/UPDATE',
662662
{
663663
id: '~u/w//1/root',
664+
ancestors: [],
664665
__typename: 'FamilyProxy'
665666
}
666667
)

0 commit comments

Comments
 (0)