ui: Adding success message for DomainActionForm (#4987)

This commit is contained in:
davidjumani 2021-05-04 19:34:11 +05:30 committed by GitHub
parent eb2e5f73d3
commit 1cb8ca69d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -249,6 +249,7 @@ export default {
} }
} }
const resourceName = params.displayname || params.displaytext || params.name || this.resource.name
let hasJobId = false let hasJobId = false
api(this.action.api, params).then(json => { api(this.action.api, params).then(json => {
for (const obj in json) { for (const obj in json) {
@ -270,6 +271,18 @@ export default {
} }
} }
if (!hasJobId) { if (!hasJobId) {
var message = this.action.successMessage ? this.$t(this.action.successMessage) : this.$t(this.action.label) +
(resourceName ? ' - ' + resourceName : '')
var duration = 2
if (this.action.additionalMessage) {
message = message + ' - ' + this.$t(this.action.successMessage)
duration = 5
}
this.$message.success({
content: message,
key: this.action.label + resourceName,
duration: duration
})
this.parentUpdActionData(json) this.parentUpdActionData(json)
this.parentFetchData() this.parentFetchData()
} }