This is an automated email from the ASF dual-hosted git repository.
kirs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new d4fd981 [Fix-4734][UI] Fix file update dialog not reset after re-open
the dialog (#4735)
d4fd981 is described below
commit d4fd9811f8a7de7e90a38ea9e86525c522630aee
Author: Shiwen Cheng <[email protected]>
AuthorDate: Thu Feb 18 11:51:55 2021 +0800
[Fix-4734][UI] Fix file update dialog not reset after re-open the dialog
(#4735)
---
.../src/js/module/components/fileUpdate/definitionUpdate.vue | 9 +++++++++
.../src/js/module/components/fileUpdate/fileChildReUpdate.vue | 10 ++++++++++
.../src/js/module/components/fileUpdate/fileChildUpdate.vue | 11 +++++++++++
.../src/js/module/components/fileUpdate/fileReUpload.vue | 10 ++++++++++
.../src/js/module/components/fileUpdate/fileUpdate.vue | 11 +++++++++++
.../js/module/components/fileUpdate/resourceChildUpdate.vue | 11 +++++++++++
.../src/js/module/components/fileUpdate/udfUpdate.vue | 11 +++++++++++
7 files changed, 73 insertions(+)
diff --git
a/dolphinscheduler-ui/src/js/module/components/fileUpdate/definitionUpdate.vue
b/dolphinscheduler-ui/src/js/module/components/fileUpdate/definitionUpdate.vue
index 1d711e4..f1d61bf 100644
---
a/dolphinscheduler-ui/src/js/module/components/fileUpdate/definitionUpdate.vue
+++
b/dolphinscheduler-ui/src/js/module/components/fileUpdate/definitionUpdate.vue
@@ -143,10 +143,12 @@
this.$message.success(res.msg)
resolve()
self.$emit('onUpdateDefinition')
+ this.reset()
}, e => {
reject(e)
self.$emit('closeDefinition')
this.$message.error(e.msg || '')
+ this.reset()
}, {
data: formData,
emulateJSON: false,
@@ -171,6 +173,13 @@
close () {
this.$emit('closeDefinition')
},
+ reset () {
+ this.name = ''
+ this.description = ''
+ this.progress = 0
+ this.file = ''
+ this.dragOver = false
+ },
/**
* Drag and drop upload
*/
diff --git
a/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileChildReUpdate.vue
b/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileChildReUpdate.vue
index 3bf1df1..39e8216 100644
---
a/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileChildReUpdate.vue
+++
b/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileChildReUpdate.vue
@@ -196,10 +196,12 @@
this.$message.success(res.msg)
resolve()
self.$emit('onUpdate')
+ this.reset()
}, e => {
reject(e)
self.$emit('close')
this.$message.error(e.msg || '')
+ this.reset()
}, {
data: formData,
emulateJSON: false,
@@ -221,6 +223,14 @@
$('.update-file-modal').hide()
this.$emit('onArchive')
},
+ reset () {
+ this.name = ''
+ this.description = ''
+ this.progress = 0
+ this.file = null
+ this.currentDir = localStore.getItem('currentDir')
+ this.dragOver = false
+ },
/**
* Drag and drop upload
*/
diff --git
a/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileChildUpdate.vue
b/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileChildUpdate.vue
index a43da69..d6d7fac 100644
---
a/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileChildUpdate.vue
+++
b/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileChildUpdate.vue
@@ -181,10 +181,12 @@
this.$message.success(res.msg)
resolve()
self.$emit('onUpdateFileChildUpdate')
+ this.reset()
}, e => {
reject(e)
self.$emit('close')
this.$message.error(e.msg || '')
+ this.reset()
}, {
data: formData,
emulateJSON: false,
@@ -217,6 +219,15 @@
},
close () {
this.$emit('closeFileChildUpdate')
+ },
+ reset () {
+ this.name = ''
+ this.description = ''
+ this.progress = 0
+ this.file = ''
+ this.currentDir = localStore.getItem('currentDir')
+ this.pid = -1
+ this.dragOver = false
}
},
mounted () {
diff --git
a/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileReUpload.vue
b/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileReUpload.vue
index 4d6a0e2..af58e14 100644
--- a/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileReUpload.vue
+++ b/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileReUpload.vue
@@ -195,10 +195,12 @@
this.$message.success(res.msg)
resolve()
self.$emit('onUpdate')
+ this.reset()
}, e => {
reject(e)
self.$emit('close')
this.$message.error(e.msg || '')
+ this.reset()
}, {
data: formData,
emulateJSON: false,
@@ -220,6 +222,14 @@
$('.update-file-modal').hide()
this.$emit('onArchive')
},
+ reset () {
+ this.name = ''
+ this.description = ''
+ this.progress = 0
+ this.file = null
+ this.currentDir = '/'
+ this.dragOver = false
+ },
/**
* Drag and drop upload
*/
diff --git
a/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileUpdate.vue
b/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileUpdate.vue
index d9780de..6fa9d26 100755
--- a/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileUpdate.vue
+++ b/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileUpdate.vue
@@ -179,10 +179,12 @@
this.$message.success(res.msg)
resolve()
self.$emit('onUpdateFileUpdate')
+ this.reset()
}, e => {
reject(e)
self.$emit('closeFileUpdate')
this.$message.error(e.msg || '')
+ this.reset()
}, {
data: formData,
emulateJSON: false,
@@ -207,6 +209,15 @@
close () {
this.$emit('closeFileUpdate')
},
+ reset () {
+ this.name = ''
+ this.description = ''
+ this.progress = 0
+ this.file = ''
+ this.currentDir = '/'
+ this.pid = -1
+ this.dragOver = false
+ },
/**
* Drag and drop upload
*/
diff --git
a/dolphinscheduler-ui/src/js/module/components/fileUpdate/resourceChildUpdate.vue
b/dolphinscheduler-ui/src/js/module/components/fileUpdate/resourceChildUpdate.vue
index 714954b..5cb0c3c 100755
---
a/dolphinscheduler-ui/src/js/module/components/fileUpdate/resourceChildUpdate.vue
+++
b/dolphinscheduler-ui/src/js/module/components/fileUpdate/resourceChildUpdate.vue
@@ -181,10 +181,12 @@
this.$message.success(res.msg)
resolve()
self.$emit('onUpdateResourceChildUpdate')
+ this.reset()
}, e => {
reject(e)
self.$emit('close')
this.$message.error(e.msg || '')
+ this.reset()
}, {
data: formData,
emulateJSON: false,
@@ -206,6 +208,15 @@
$('.update-file-modal').hide()
this.$emit('onArchiveResourceChildUpdate')
},
+ reset () {
+ this.name = ''
+ this.description = ''
+ this.progress = 0
+ this.file = ''
+ this.currentDir = localStore.getItem('currentDir')
+ this.pid = -1
+ this.dragOver = false
+ },
/**
* Drag and drop upload
*/
diff --git
a/dolphinscheduler-ui/src/js/module/components/fileUpdate/udfUpdate.vue
b/dolphinscheduler-ui/src/js/module/components/fileUpdate/udfUpdate.vue
index d06a6a1..b4e6dfd 100644
--- a/dolphinscheduler-ui/src/js/module/components/fileUpdate/udfUpdate.vue
+++ b/dolphinscheduler-ui/src/js/module/components/fileUpdate/udfUpdate.vue
@@ -124,11 +124,13 @@
this.spinnerLoading = false
this.progress = 0
this.$emit('on-update', res.data)
+ this.reset()
}, e => {
this.spinnerLoading = false
this.progress = 0
this.$message.error(e.msg || '')
this.$emit('on-update', e)
+ this.reset()
}, {
data: formData,
emulateJSON: false,
@@ -148,6 +150,15 @@
this._formDataUpdate()
})
}
+ },
+ reset () {
+ this.udfName = ''
+ this.udfDesc = ''
+ this.file = ''
+ this.progress = 0
+ this.spinnerLoading = false
+ this.pid = null
+ this.currentDir = ''
}
},
watch: {},