Skip to content

Commit

Permalink
Merge pull request #320 from alexhsamuel/feature/gh314
Browse files Browse the repository at this point in the history
Store jobs expand state in store.
  • Loading branch information
alexhsamuel authored Dec 27, 2023
2 parents 191a777 + fa40b87 commit f7cd3da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions vue/src/components/JobsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ import PathNav from '@/components/PathNav'
import Program from '@/components/Program'
import { matchKeywords, includesAll } from '@/runs'
import SearchInput from '@/components/SearchInput'
import store from '@/store.js'
import TriangleIcon from '@/components/icons/TriangleIcon'
import WordsInput from '@/components/WordsInput'
Expand Down Expand Up @@ -182,9 +183,9 @@ export default {
data() {
return {
store,
loading: true,
allJobs: [],
expand: {},
}
},
Expand All @@ -206,10 +207,14 @@ export default {
fetch(url)
.then((response) => response.json())
.then((response) => response.forEach((j) => v.allJobs.push(j)))
.then(() => { this.expandAll(false); this.loading = false })
.then(() => { this.loading = false })
},
computed: {
expand() {
return this.store.state.jobsExpand
},
/** Jobs after applying the filter. */
visibleJobs() {
var jobs = filter(this.allJobs, job => !job.ad_hoc)
Expand Down
3 changes: 3 additions & 0 deletions vue/src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class Store {

// User-selected time zone.
timeZone: 'UTC',

// Expand state in the job tree.
jobsExpand: {},
}

setTime(time) {
Expand Down

0 comments on commit f7cd3da

Please sign in to comment.