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

Miscellaneous GUI enhancement (#167) #168

Merged
merged 6 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,76 +1,17 @@
<template>
<v-row id="participants-panel" class="fill-height">
<data-download-dialog
v-model="dialog.download"
:files="study.files"
:generating="loading.data"
@generate="generateDataFile"
/>
<manage-dialog
v-model="dialog.manage"
:study="study"
@new-assignments="refresh"
/>
<v-col
cols="12"
lg="6"
xl="7"
class="pb-5"
>
<v-card outlined class="fill-height d-flex flex-column">
<v-card-title>
{{ $t('study_participants.stats.title') }}
</v-card-title>
<v-card-text>
<participation-stats :data="stats" />
</v-card-text>
</v-card>
</v-col>
<v-col
cols="12"
lg="6"
xl="5"
class="pb-5"
>
<v-card outlined class="fill-height d-flex flex-column">
<v-card-title>
{{ $t('study_participants.participants.title') }}
<v-spacer />
<div v-if="participants.length">
<span class="caption mr-6">
Priority
</span>
<span class="caption">
{{ $t('study_participants.participants.perc_complete') }}
</span>
</div>
</v-card-title>
<v-card-text class="pa-0 fill-height">
<study-participants-list
:editable="userCanEdit"
:total-jobs="study.jobs_count"
:participants="participants"
:queue="queue"
:loading-queue="loading.queue"
:loading="loading.initial"
:fetching-more="loading.participants"
@changed-priority="fetchQueue"
@scroll-end="loadMore"
/>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
:disabled="study.completed_jobs_count < 1"
color="primary"
:loading="!!loading.data"
@click="dialog.download = true"
>
<v-icon left>
mdi-download
</v-icon>
{{ $t('study_participants.participants.data') }}
</v-btn>
<v-btn
v-if="userCanEdit"
color="primary"
Expand All @@ -82,21 +23,44 @@
{{ $t('study_participants.participants.manage') }}
</v-btn>
</v-card-actions>
</v-card>
<v-card-title>
{{ $t('study_participants.participants.title') }}
<v-spacer />
<div v-if="participants.length">
<span class="caption mr-6">
Priority
</span>
<span class="caption">
{{ $t('study_participants.participants.perc_complete') }}
</span>
</div>
</v-card-title>
<v-card-text class="pa-0 fill-height">
<study-participants-list
:editable="userCanEdit"
:total-jobs="study.jobs_count"
:participants="participants"
:queue="queue"
:loading-queue="loading.queue"
:loading="loading.initial"
:fetching-more="loading.participants"
@changed-priority="fetchQueue"
@scroll-end="loadMore"
/>
</v-card-text>
</v-card>
</v-col>
</v-row>
</template>

<script>
import { mapActions } from 'vuex'
import { processErrors } from '@/assets/js/errorhandling'
import { keyBy } from 'lodash'
import { processErrors } from '@/assets/js/errorhandling'

export default {
components: {
ParticipationStats: () => import('./ParticipationStats'),
StudyParticipantsList: () => import('./StudyParticipantsList'),
DataDownloadDialog: () => import('@/components/Participants/dialogs/DataDownloadDialog'),
ManageDialog: () => import('@/components/Participants/dialogs/ManageDialog')
},
props: {
Expand All @@ -120,7 +84,6 @@ export default {
loading: {
initial: false,
participants: false,
stats: false,
queue: false,
data: null
},
Expand All @@ -131,7 +94,6 @@ export default {
total: 0
},
ptcpListCtrHeight: 0,
stats: {},
queue: {}
}
},
Expand All @@ -153,15 +115,13 @@ export default {
return
}
this.fetchParticipants()
this.fetchStats()
this.fetchQueue()
}
},
async mounted () {
this.setStartpage()
this.loading.initial = true
await this.fetchParticipants()
await this.fetchStats()
await this.fetchQueue()
this.loading.initial = false
},
Expand All @@ -184,17 +144,6 @@ export default {
this.loading.participants = false
}
},
async fetchStats () {
if (!this.study?.id) { return }
this.loading.stats = true
try {
this.stats = await this.study.fetchParticipationStats()
} catch (e) {
processErrors(e, this.notify)
} finally {
this.loading.stats = false
}
},
async fetchQueue (ptcpID = null) {
if (!this.study?.id) { return }
this.loading.queue = ptcpID ?? 'all'
Expand Down Expand Up @@ -227,7 +176,6 @@ export default {
perPage: this.pagination.perPage
}
})
this.fetchStats()
this.fetchQueue()
},
setPtcpListCtrHeight () {
Expand Down

This file was deleted.

Loading