Skip to content

Commit

Permalink
Fixing ClinVar export editor timing issues (#667, #668).
Browse files Browse the repository at this point in the history
Related-Issue: #667
Related-Issue: #668
Closes: #667
Closes: #668
Projected-Results-Impact: none
  • Loading branch information
holtgrewe committed Sep 20, 2022
1 parent e863a47 commit c19ae96
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Expand Up @@ -58,6 +58,7 @@ End-User Summary
- Warning in the case of truncated displayed results (#641).
- Improving Clinvar record aggregation (#640).
- Fixing ClinVar submission XML generation (#677).
- Fixing ClinVar export editor timing issues (#667, #668).

Full Change List
================
Expand Down Expand Up @@ -115,6 +116,7 @@ Full Change List
- Fixing Docker builds (#660).
- Fixing ClinVar submission XML generation (#677).
- Adding regular task to sync ClinVar submission ``Individual`` sex from the one from the ``Case``.
- Fixing ClinVar export editor timing issues (#667, #668).

------
v1.2.0
Expand Down
23 changes: 11 additions & 12 deletions varfish/vueapp/src/components/ClinvarExportApp.vue
@@ -1,21 +1,13 @@
<template>
<div id="#app">
<div v-if="appState === 'initializing'">
<div class="text-center">
<i class="iconify spin text-muted mt-5" data-icon="fa-solid:circle-notch"></i>
<br />
<br />
<span class="text-muted font-italic">Loading...</span>
</div>
</div>
<div v-if="appState !== 'initializing'">
<b-overlay :show="showOverlay">
<submission-set-list
v-if="appState === 'list'"
v-if="['list', 'initializing'].includes(appState)"
></submission-set-list>
<submission-set-wizard
v-if="['edit', 'add'].includes(appState)"
></submission-set-wizard>
</div>
</b-overlay>
</div>
</template>

Expand All @@ -28,7 +20,14 @@ export default {
components: { SubmissionSetWizard, SubmissionSetList },
computed: mapState({
appState: state => state.clinvarExport.appState,
notification: state => state.clinvarExport.notification
notification: state => state.clinvarExport.notification,
showOverlay (state) {
if (state.clinvarExport.appState === 'initializing' || state.clinvarExport.serverInteraction) {
return true
} else {
return false
}
}
}),
beforeMount: function () {
const rawAppContext = JSON.parse(
Expand Down
2 changes: 1 addition & 1 deletion varfish/vueapp/src/components/SubmissionList.vue
Expand Up @@ -341,7 +341,6 @@ export default {
clinvarExport
.getUserAnnotations(this.appContext, this.familyUuid)
.then((res) => {
this.loadingVariants = false
this.fetchError = false
const getVariantId = (obj) => {
Expand Down Expand Up @@ -404,6 +403,7 @@ export default {
}
)
Vue.set(this, 'rawModalUserAnnotationsCount', Object.keys(smallVariants).length)
this.loadingVariants = false
})
.catch((error) => {
this.loadingVariants = false
Expand Down
12 changes: 10 additions & 2 deletions varfish/vueapp/src/store/modules/clinvarExport.js
Expand Up @@ -39,6 +39,7 @@ const state = () => ({
// application / client state
appContext: null,
appState: AppState.initializing,
serverInteraction: false,
wizardState: WizardState.submissionSet,
notification: null,
currentSubmissionSet: null,
Expand Down Expand Up @@ -137,6 +138,7 @@ const actions = {
* Save submission set currently open in wizard through API.
*/
async wizardSave ({ state, commit }) {
commit('SET_APP_SERVER_INTERACTION', true)
async function _wizardSaveSubmissionSet ({ state, commit }, submissionSetExists) {
if (submissionSetExists) {
const res = await clinvarExport.updateSubmissionSet(state.currentSubmissionSet, state.appContext)
Expand Down Expand Up @@ -291,8 +293,6 @@ const actions = {
}
}

commit('SET_APP_STATE', AppState.list)

// Save submission set and submitting orgs.
const submissionSetExists = state.currentSubmissionSet.sodar_uuid in state.oldModel.submissionSets
const apiSet = await _wizardSaveSubmissionSet({ state, commit }, submissionSetExists)
Expand Down Expand Up @@ -333,11 +333,14 @@ const actions = {
commit('SET_CURRENT_SUBMISSION', null)

commit('SAVE_OLD_MODEL')
commit('SET_APP_STATE', AppState.list)
commit('SET_APP_SERVER_INTERACTION', false)
},
/**
* Remove submission set currently open in wizard through API.
*/
async wizardRemove ({ state, commit }) {
commit('SET_APP_SERVER_INTERACTION', true)
commit('SET_APP_STATE', AppState.list)

for (const submittingOrgUuid of state.currentSubmissionSet.submitting_orgs) {
Expand Down Expand Up @@ -383,6 +386,7 @@ const actions = {
commit('SET_CURRENT_SUBMISSION', null)

commit('SAVE_OLD_MODEL')
commit('SET_APP_SERVER_INTERACTION', false)
},
/**
* Cancel submission editing currently open in wizard.
Expand Down Expand Up @@ -599,6 +603,10 @@ const mutations = {
Vue.set(state, 'appState', appState)
},

SET_APP_SERVER_INTERACTION (state, serverInteraction) {
Vue.set(state, 'serverInteraction', serverInteraction)
},

SET_CURRENT_SUBMISSION_SET (state, submissionSetUuid) {
console.assert(
(submissionSetUuid === null) || (submissionSetUuid in state.submissionSets),
Expand Down

0 comments on commit c19ae96

Please sign in to comment.