Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added family grouping plus family and cycle collapsing #1810

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
dbde144
addded family grouping with subgraphs
markgrahamdawson May 24, 2024
7d32c13
added family group select menu to toolbar
markgrahamdawson May 30, 2024
99b5e2b
added family collapsing logic
markgrahamdawson Jun 24, 2024
b2a481f
added cycle collapsing logic
markgrahamdawson Jun 28, 2024
c98b446
fixed issue with dreating edges
markgrahamdawson Jul 4, 2024
034b3ec
added status to collapsed nodes
markgrahamdawson Jul 8, 2024
6d4b65f
save point
markgrahamdawson Jul 31, 2024
065c39d
grouping with recursion
markgrahamdawson Aug 8, 2024
744abab
Tidy and fixed linting errors
markgrahamdawson Aug 14, 2024
bdbb79d
added VTreeview component for menu
markgrahamdawson Aug 16, 2024
706e295
send dynamic data to toolbar
markgrahamdawson Oct 9, 2024
343b6d3
fixed toolbar checkbox state
markgrahamdawson Oct 11, 2024
853aa20
fix toolbar data format part 1
markgrahamdawson Oct 16, 2024
a01f882
fix current tests
markgrahamdawson Oct 23, 2024
c0a63a8
added E2E tests
markgrahamdawson Oct 24, 2024
3b6bb93
added unit tests
markgrahamdawson Oct 29, 2024
080319f
moved unit test functions into utils
markgrahamdawson Oct 29, 2024
37ab49c
updated unit tests
markgrahamdawson Nov 1, 2024
676466f
fix e2e tests
markgrahamdawson Nov 4, 2024
12852e0
added towncrier entry
markgrahamdawson Nov 5, 2024
d56939f
removed unnecessary gql query parameters
markgrahamdawson Nov 5, 2024
c97cd7e
review amendments to toolbar
markgrahamdawson Nov 5, 2024
e406f53
remove more unnecessary gql query params
markgrahamdawson Nov 5, 2024
47b161e
moved allChilderenLookUp and allParentLookUp outside of initial options
markgrahamdawson Nov 6, 2024
c733592
converted familyArray store to computed property
markgrahamdawson Nov 6, 2024
c15bb00
made use of tokens
markgrahamdawson Nov 6, 2024
d92d2c8
fixed unit tests
markgrahamdawson Nov 7, 2024
d2dc449
removed unnecessary unit tests
markgrahamdawson Nov 7, 2024
db63bd5
refactor edges creation whilst also fixing bug
markgrahamdawson Nov 13, 2024
85a0d67
removed unnecessary functions for creating edges and fixed bug
markgrahamdawson Nov 15, 2024
ff32357
fix issue with nested families showing as disabled in toolbar
markgrahamdawson Nov 15, 2024
9794700
cleaned toolbar and fix broken tests
markgrahamdawson Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes.d/1810.feat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added graph view feature to group by family and collapse by family and cycle point
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sig improvement in comprehendability IMO

Suggested change
Added graph view feature to group by family and collapse by family and cycle point
Added graph view feature to group by family, and collapse by family and cycle point

58 changes: 57 additions & 1 deletion src/components/cylc/ViewToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,31 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class="control"
:data-cy="`control-${iControl.key}`"
>
<v-btn
<v-menu
v-if="iControl.action==='select-tree'"
:close-on-content-click="false">
<template v-slot:activator="{ props }" >
<v-btn
v-bind="{...$attrs, ...props, ...btnProps}"
:disabled="iControl.disabled"
:color="iControl.color">
<v-icon>{{ iControl.icon }}</v-icon>
<v-tooltip>{{ iControl.title }}</v-tooltip>
</v-btn>
</template >
<v-treeview
v-model:selected="selectedItems[iControl.key]"
v-on:update:selected="iControl.callback"
:items="iControl.items"
select-strategy='independent'
item-title="name"
item-value="name"
item-props
selectable
open-all
></v-treeview>
</v-menu>
<v-btn v-else
v-bind="btnProps"
:disabled="iControl.disabled"
:color="iControl.color"
Expand All @@ -46,10 +70,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

<script>
import { btnProps } from '@/utils/viewToolbar'
import { VTreeview } from 'vuetify/labs/VTreeview'

export default {
name: 'ViewToolbar',

components: {
VTreeview,
},

emits: [
'setOption'
],
Expand Down Expand Up @@ -100,6 +129,22 @@ export default {
}
},

data () {
return {
selectedItems: {}
}
},
mounted () {
if (this.groups[0].title === 'Graph') {
const getControlValue = (groups, controlKey) => {
return groups[0].controls.find(control => control.key === controlKey).value
}
this.selectedItems.groupFamily = getControlValue(this.groups, 'groupFamily')
this.selectedItems.collapseCycle = getControlValue(this.groups, 'collapseCycle')
this.selectedItems.collapseFamily = getControlValue(this.groups, 'collapseFamily')
}
},
markgrahamdawson marked this conversation as resolved.
Show resolved Hide resolved

computed: {
iGroups () {
// wrap the provided props into something we can mutate with derived
Expand Down Expand Up @@ -132,6 +177,12 @@ export default {
case 'callback':
callback = (e) => this.call(control, e)
break
case 'select-tree':
callback = (e) => this.select(control, e)
if (control.value.length) {
color = 'blue'
}
break
}

// set disabled
Expand Down Expand Up @@ -178,6 +229,11 @@ export default {
control.callback()
e.currentTarget.blur()
},
select (control, e) {
// call a control's callback
control.value = this.selectedItems[control.key]
this.$emit('setOption', control.key, control.value)
},
getValues () {
// an object with all defined values
const vars = {}
Expand Down
94 changes: 94 additions & 0 deletions src/services/mock/json/workflows/one.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,100 @@
"ancestors": []
}
],
"families": [
{
"__typename": "Family",
"id": "~user/one//$namespace|root",
"name": "root",
"parents": [],
"childTasks": [
{
"name": "checkpoint",
"_typename": "Task"
},
{
"name": "sleepy",
"_typename": "Task"
},
{
"name": "waiting",
"_typename": "Task"
}
],
"childFamilies": [
{
"name": "BAD",
"_typename": "Family"
},
{
"name": "GOOD",
"_typename": "Family"
}
]
},
{
"__typename": "Family",
"id": "~user/one//$namespace|BAD",
"name": "BAD",
"parents": [
{
"name": "root",
"_typename": "Family"
}
],
"childTasks": [
{
"name": "failed",
"_typename": "Task"
},
{
"name": "retrying",
"_typename": "Task"
}
],
"childFamilies": []
},
{
"__typename": "Family",
"id": "~user/one//$namespace|GOOD",
"name": "GOOD",
"parents": [
{
"name": "root",
"_typename": "family"
}
],
"childTasks": [],
"childFamilies": [
{
"name": "SUCCEEDED",
"_typename": "Family"
}
]
},
{
"__typename": "Family",
"id": "~user/one//$namespace|SUCCEEDED",
"name": "SUCCEEDED",
"parents": [
{
"name": "GOOD",
"_typename": "Family"
}
],
"childTasks": [
{
"name": "eventually_succeeded",
"_typename": "Task"
},
{
"name": "succeeded",
"_typename": "Task"
}
],
"childFamilies": []
}
],
"familyProxies": [
{
"__typename": "FamilyProxy",
Expand Down
4 changes: 2 additions & 2 deletions src/store/workflows.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,10 @@ const mutations = {
// NOTE: deltas are applied in the order listed here
// NOTE: we must create tasks before families (note cycles ARE families
// because of the way we request them)
const KEYS = ['workflow', 'taskProxies', 'cyclePoints', 'familyProxies', 'jobs', 'edges']
const KEYS = ['workflow', 'taskProxies', 'cyclePoints', 'familyProxies', 'jobs', 'edges', 'families']

// Pruned keys which return arrays of pruned IDs
const PRUNED_KEYS_MULT = ['taskProxies', 'familyProxies', 'jobs', 'edges']
const PRUNED_KEYS_MULT = ['taskProxies', 'familyProxies', 'jobs', 'edges', 'families']
// Pruned keys which contain single pruned IDs
const PRUNED_KEYS_SING = ['workflow']

Expand Down
Loading
Loading