diff --git a/frontend/src/components/BugTemplateSelector.vue b/frontend/src/components/BugTemplateSelector.vue index ce8a333..3c73dac 100644 --- a/frontend/src/components/BugTemplateSelector.vue +++ b/frontend/src/components/BugTemplateSelector.vue @@ -8,7 +8,7 @@ filterable size="small" placeholder="Select template" - not-found-text="No saved draft" + not-found-text="No Template" > @@ -22,18 +22,18 @@ clearable size="small" placeholder="Select a saved draft" - not-found-text="No Template" + not-found-text="No saved draft" > @@ -115,4 +115,13 @@ export default { margin-bottom: 0px; padding-bottom: 5px; } +.draft-option { + white-space: normal; + position: relative; +} +.delete-icon { + position: absolute; + bottom: 10px; + margin: auto; +} diff --git a/frontend/src/components/form/CompoundTextAreaFormItem.vue b/frontend/src/components/form/CompoundTextAreaFormItem.vue index 43cc9ac..c20bd37 100644 --- a/frontend/src/components/form/CompoundTextAreaFormItem.vue +++ b/frontend/src/components/form/CompoundTextAreaFormItem.vue @@ -30,6 +30,9 @@ export default { created () { this.$bus.$on('addMessage', this.addDesc) }, + beforeDestroy () { + this.$bus.$off('addMessage') + }, methods: { addDesc (desc) { this.$store.commit('addExtraMsg', { index: this.index, value: desc }) diff --git a/frontend/src/store/form.js b/frontend/src/store/form.js index a61c488..51d762c 100644 --- a/frontend/src/store/form.js +++ b/frontend/src/store/form.js @@ -208,15 +208,17 @@ export default { api.createIssue(state.templates[state.selectedTemplateIndex], state.templateDetail, state.attachmentsList, state.exportAttachmentList) .then(response => { - for (let failAttach of response.data.export_fail_attachments) { - let extensionName = String(failAttach.split('.').slice(-1)) - bus.$emit('msg.error', `Add ${failAttach} to attachment error: cannot convert data to a ${extensionName} file.`) + if (response.data.code === 1000) { + for (let failAttach of response.data.export_fail_attachments) { + let extensionName = String(failAttach.split('.').slice(-1)) + bus.$emit('msg.error', `Add ${failAttach} to attachment error: cannot convert data to a ${extensionName} file.`) + } } - bus.$emit('message', response.data.message) - commit('setSubmitLock', false) - }).catch(response => { bus.$emit('message', response.data) commit('setSubmitLock', false) + }).catch(error => { + bus.$emit('msg.error', 'Submit failed error: ' + error.message) + commit('setSubmitLock', false) }) }, loadAttachment ({ state, commit }) { @@ -363,8 +365,9 @@ export default { .then(response => { if (response.data.code === 1000) { bus.$emit('msg.success', 'Delete success!') - commit('setSelectedCache', state.selectedCache) + commit('setSelectedCache', null) dispatch('loadCacheList') + dispatch('loadTemplate') } else { bus.$emit('msg.error', 'Delete failed error: ' + response.data.message) } diff --git a/lyrebird_bugit/template_loader.py b/lyrebird_bugit/template_loader.py index 82a743f..8ce6875 100644 --- a/lyrebird_bugit/template_loader.py +++ b/lyrebird_bugit/template_loader.py @@ -15,7 +15,7 @@ def get_workspace(): if bugit_workspace and Path(bugit_workspace).exists(): return Path(bugit_workspace) - ROOT = application._cm.root + ROOT = application._cm.ROOT metadata_dir = ROOT/'downloads'/'lyrebird_bugit' metadata_dir.mkdir(parents=True, exist_ok=True) logger.warning( diff --git a/setup.py b/setup.py index ae72f03..cfdc5e4 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name='lyrebird-bugit', - version='1.12.2', + version='1.12.3', packages=['lyrebird_bugit'], url='https://github.com/Meituan-Dianping/lyrebird-bugit', author='HBQA',