From c19ae96cfbae6354b8e391e4ba370b52cc740064 Mon Sep 17 00:00:00 2001 From: Manuel Holtgrewe Date: Tue, 20 Sep 2022 13:20:32 +0200 Subject: [PATCH] Fixing ClinVar export editor timing issues (#667, #668). Related-Issue: #667 Related-Issue: #668 Closes: #667 Closes: #668 Projected-Results-Impact: none --- HISTORY.rst | 2 ++ .../src/components/ClinvarExportApp.vue | 23 +++++++++---------- .../vueapp/src/components/SubmissionList.vue | 2 +- .../vueapp/src/store/modules/clinvarExport.js | 12 ++++++++-- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 7b818fc80..8e13a67b2 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -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 ================ @@ -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 diff --git a/varfish/vueapp/src/components/ClinvarExportApp.vue b/varfish/vueapp/src/components/ClinvarExportApp.vue index ee31672c1..f50882f9f 100644 --- a/varfish/vueapp/src/components/ClinvarExportApp.vue +++ b/varfish/vueapp/src/components/ClinvarExportApp.vue @@ -1,21 +1,13 @@ @@ -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( diff --git a/varfish/vueapp/src/components/SubmissionList.vue b/varfish/vueapp/src/components/SubmissionList.vue index 9c39fcab1..6923e8ebc 100644 --- a/varfish/vueapp/src/components/SubmissionList.vue +++ b/varfish/vueapp/src/components/SubmissionList.vue @@ -341,7 +341,6 @@ export default { clinvarExport .getUserAnnotations(this.appContext, this.familyUuid) .then((res) => { - this.loadingVariants = false this.fetchError = false const getVariantId = (obj) => { @@ -404,6 +403,7 @@ export default { } ) Vue.set(this, 'rawModalUserAnnotationsCount', Object.keys(smallVariants).length) + this.loadingVariants = false }) .catch((error) => { this.loadingVariants = false diff --git a/varfish/vueapp/src/store/modules/clinvarExport.js b/varfish/vueapp/src/store/modules/clinvarExport.js index 06589466f..291d7532e 100644 --- a/varfish/vueapp/src/store/modules/clinvarExport.js +++ b/varfish/vueapp/src/store/modules/clinvarExport.js @@ -39,6 +39,7 @@ const state = () => ({ // application / client state appContext: null, appState: AppState.initializing, + serverInteraction: false, wizardState: WizardState.submissionSet, notification: null, currentSubmissionSet: null, @@ -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) @@ -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) @@ -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) { @@ -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. @@ -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),