Skip to content

Commit

Permalink
Merge pull request #35 from scottwittenburg/flatten-session-tree
Browse files Browse the repository at this point in the history
Performance improvements and new features
  • Loading branch information
scottwittenburg authored Dec 7, 2020
2 parents 345d3d3 + e1a90af commit d63111d
Show file tree
Hide file tree
Showing 22 changed files with 2,158 additions and 1,430 deletions.
1,737 changes: 813 additions & 924 deletions client/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"@girder/components": "git+https://github.com/girder/girder_web_components.git#v2.2.6",
"bluebird": "^3.5.5",
"itk": "^9.1.1",
"vtk.js": "^8.3.15",
"mousetrap": "~1.6.2",
"vtk.js": "14.16.5",
"vue": "^2.6.10",
"vue-async-computed": "^3.5.1",
"vue-router": "3.4.3",
"vue-utilities": "git+https://github.com/Kitware/vue-utilities.git#fae8978b508ec4dcaea886370ba2a2336abf7bfc",
"vuetify": "^2.3.7",
"vuex": "^3.0.1"
},
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/EmailDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export default {
sending: false
}),
computed: {
...mapState(["currentDataset", "screenshots"]),
...mapGetters(["currentSession", "siteMap"])
...mapState(["screenshots"]),
...mapGetters(["currentDataset", "currentSession", "siteMap"])
},
watch: {
currentDataset(value) {
Expand Down
5 changes: 4 additions & 1 deletion client/src/components/JSONConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ export default {
name="miqa-json-importpath"
:rules="[
v => !!v || 'path is required',
v => v.endsWith('.json') || 'Needs to be a json file'
v =>
v.endsWith('.json') ||
v.endsWith('.csv') ||
'Needs to be a json or csv file'
]"
:error-messages="importpathError"
/></v-flex>
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/NavigationTabs.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { mapGetters, mapMutations } from "vuex";
import { mapState, mapMutations } from "vuex";
import { GIRDER_URL } from "../constants";
Expand All @@ -10,7 +10,7 @@ export default {
GIRDER_URL
}),
computed: {
...mapGetters(["currentDatasetId"])
...mapState(["currentDatasetId"])
},
methods: {
...mapMutations(["setDrawer"]),
Expand Down
48 changes: 39 additions & 9 deletions client/src/components/SessionsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,30 @@ export default {
API_URL
}),
computed: {
...mapState(["sessionTree"]),
...mapGetters(["currentSession"])
...mapState([
"experiments",
"experimentIds",
"experimentSessions",
"sessions",
"sessionDatasets",
"sessionsModifiedTime",
"datasets"
]),
...mapGetters(["currentSession"]),
orderedExperiments() {
const allExperiments = this.experiments;
return this.experimentIds.map(expId => allExperiments[expId]);
}
},
methods: {
sessionsForExperiment(expId) {
const expSessionIds = this.experimentSessions[expId];
const allSessions = this.sessions;
return expSessionIds.map(sessionId => allSessions[sessionId]);
},
getIdOfFirstDatasetInSession(sessionId) {
return this.sessionDatasets[sessionId][0];
},
ratingToLabel(rating) {
switch (rating) {
case "questionable":
Expand All @@ -37,26 +57,32 @@ export default {

<template>
<div class="sessions-view">
<ul class="experiment" v-if="sessionTree && sessionTree.length">
<ul
class="experiment"
v-if="orderedExperiments && orderedExperiments.length"
>
<li
v-for="experiment of sessionTree"
v-for="experiment of orderedExperiments"
class="body-2"
:key="experiment.folderId"
:key="`e.${experiment.id}`"
>
{{ experiment.name }}
<ul class="sessions">
<li
v-for="session of experiment.sessions"
v-for="session of sessionsForExperiment(experiment.id)"
class="body-1"
:key="session.folderId"
:class="{ current: session === currentSession }"
:key="`s.${session.id}-${sessionsModifiedTime}`"
:class="{
current: session === currentSession,
cached: session.cached
}"
>
<v-btn
class="ml-0 px-1 session-name"
href
text
small
:to="session.datasets[0]._id"
:to="getIdOfFirstDatasetInSession(session.id)"
active-class=""
>{{ session.name
}}<span small v-if="session.meta && session.meta.rating"
Expand All @@ -76,6 +102,10 @@ export default {
background: rgb(206, 206, 206);
}
li.cached {
list-style-type: disc;
}
ul.experiment {
list-style: none;
}
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/VtkViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default {
fullscreen: false
}),
computed: {
...mapState(["proxyManager", "currentDataset", "loadingDataset"]),
...mapGetters(["currentSession", "currentSession"]),
...mapState(["proxyManager", "loadingDataset"]),
...mapGetters(["currentDataset", "currentSession"]),
representation() {
return (
// force add dependancy on currentDataset
Expand Down
Loading

0 comments on commit d63111d

Please sign in to comment.