Skip to content

Commit

Permalink
Update view after importing a record, namespace, module or chart
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinDY committed Dec 20, 2022
1 parent 508b638 commit f2f9032
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/web/compose/src/components/Admin/Import.vue
Expand Up @@ -137,7 +137,7 @@ export default {
break
}
}
this.toastSuccess(this.$t('notification:general.import.successful'))
this.$emit('importSuccessful')
} catch (e) {
this.toastErrorHandler(this.$t('notification:general.import.failed'))(e)
}
Expand Down
Expand Up @@ -72,6 +72,7 @@
:module="recordListModule"
:namespace="namespace"
class="mr-1 float-left"
@importSuccessful="onImportSuccessful"
/>
</template>
</template>
Expand Down Expand Up @@ -1370,6 +1371,10 @@ export default {
console.warning(this.$t('notification:record-list.corrupted-filter'))
}
},
onImportSuccessful () {
this.refresh(true)
},
},
}
</script>
Expand Down
Expand Up @@ -63,17 +63,16 @@ export default {
watch: {
progress: {
handler: function ({ finishedAt, failed }) {
handler ({ finishedAt, failed }) {
if (finishedAt && failed) {
this.clearTimeout()
this.$emit('importFailed', this.progress)
} else if (finishedAt) {
this.clearTimeout()
this.$root.$emit('recordList.refresh', this.session)
this.$emit('importSuccessful')
}
},
deep: true,
immediate: true,
},
},
Expand Down
Expand Up @@ -23,6 +23,7 @@
:session="session"
@fileUploaded="onFileUploaded"
@fieldsMatched="onFieldsMatched"
@importSuccessful="onImportSuccessful"
@importFailed="onImportFailed"
@back="onBack"
@reset="onReset"
Expand Down Expand Up @@ -110,6 +111,10 @@ export default {
this.$ComposeAPI.recordImportRun(this.session)
},
onImportSuccessful () {
this.$emit('importSuccessful')
},
onImportFailed (e) {
this.session.progress = e
this.step = 3
Expand Down
6 changes: 6 additions & 0 deletions client/web/compose/src/views/Admin/Charts/List.vue
Expand Up @@ -64,6 +64,7 @@
:namespace="namespace"
type="chart"
class="float-left mr-1"
@importSuccessful="onImportSuccessful"
/>

<export
Expand Down Expand Up @@ -234,6 +235,11 @@ export default {
query: null,
})
},
onImportSuccessful () {
this.filterList()
this.toastSuccess(this.$t('notification:general.import.successful'))
},
},
}
</script>
Expand Down
6 changes: 6 additions & 0 deletions client/web/compose/src/views/Admin/Modules/List.vue
Expand Up @@ -50,6 +50,7 @@
:namespace="namespace"
type="module"
class="mr-1 float-left"
@importSuccessful="onImportSuccessful"
/>

<export
Expand Down Expand Up @@ -276,6 +277,11 @@ export default {
items () {
return this.procListResults(this.$ComposeAPI.moduleList(this.encodeListParams()))
},
onImportSuccessful () {
this.filterList()
this.toastSuccess(this.$t('notification:general.import.successful'))
},
},
}
</script>
Expand Down
5 changes: 4 additions & 1 deletion client/web/compose/src/views/Namespace/Manage.vue
Expand Up @@ -199,7 +199,10 @@ export default {
methods: {
onImported () {
this.$store.dispatch('namespace/load', { force: true })
.then(() => this.toastSuccess(this.$t('notification:namespace.imported')))
.then(() => {
this.filterList()
this.toastSuccess(this.$t('notification:namespace.imported'))
})
.catch(this.toastErrorHandler(this.$t('notification:namespace.importFailed')))
},
Expand Down

0 comments on commit f2f9032

Please sign in to comment.