From 372954170ca0108c11bf26349b871876e4432bab Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Mon, 20 Feb 2023 21:13:11 +0800 Subject: [PATCH] feat: prompt to upgrade plugin when installing existing plugin --- src/components/upload/UppyUpload.vue | 5 +++ .../plugins/components/PluginUploadModal.vue | 40 ++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/components/upload/UppyUpload.vue b/src/components/upload/UppyUpload.vue index 756dadb9b..8fb1d1567 100644 --- a/src/components/upload/UppyUpload.vue +++ b/src/components/upload/UppyUpload.vue @@ -36,6 +36,7 @@ const props = withDefaults( const emit = defineEmits<{ (event: "uploaded", response: SuccessResponse): void; + (event: "error", file, response): void; }>(); const uppy = computed(() => { @@ -72,6 +73,10 @@ uppy.value.on("upload-success", (_, response: SuccessResponse) => { emit("uploaded", response); }); +uppy.value.on("upload-error", (file, _, response) => { + emit("error", file, response); +}); + onUnmounted(() => { uppy.value.close({ reason: "unmount" }); }); diff --git a/src/modules/system/plugins/components/PluginUploadModal.vue b/src/modules/system/plugins/components/PluginUploadModal.vue index 63fe9794e..f8ef69d41 100644 --- a/src/modules/system/plugins/components/PluginUploadModal.vue +++ b/src/modules/system/plugins/components/PluginUploadModal.vue @@ -1,10 +1,11 @@