From 7cb4604e98d35aeaec25091251e305f9031bf2d0 Mon Sep 17 00:00:00 2001 From: Daman Arora <61474540+Damans227@users.noreply.github.com> Date: Thu, 30 Dec 2021 04:59:25 -0500 Subject: [PATCH] simplify code using object shorthand in multiple files (#5766) --- ui/src/utils/plugins.js | 12 ++++++------ ui/src/views/infra/network/EditTrafficLabel.vue | 4 ++-- ui/src/views/infra/zone/ZoneWizardLaunchZone.vue | 4 ++-- ui/src/views/network/CreateVpc.vue | 4 ++-- ui/src/views/storage/RestoreAttachBackupVolume.vue | 2 +- ui/src/views/storage/TakeSnapshot.vue | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ui/src/utils/plugins.js b/ui/src/utils/plugins.js index 6cf48ad2663..2f7450a6031 100644 --- a/ui/src/utils/plugins.js +++ b/ui/src/utils/plugins.js @@ -62,8 +62,8 @@ export const pollJobPlugin = { store.dispatch('AddHeaderNotice', { key: jobId, - title: title, - description: description, + title, + description, status: 'progress' }) @@ -96,14 +96,14 @@ export const pollJobPlugin = { content = content + ' - ' + name } message.success({ - content: content, + content, key: jobId, duration: 2 }) store.dispatch('AddHeaderNotice', { key: jobId, - title: title, - description: description, + title, + description, status: 'done', duration: 2 }) @@ -141,7 +141,7 @@ export const pollJobPlugin = { } store.dispatch('AddHeaderNotice', { key: jobId, - title: title, + title, description: desc, status: 'failed', duration: 2 diff --git a/ui/src/views/infra/network/EditTrafficLabel.vue b/ui/src/views/infra/network/EditTrafficLabel.vue index a56165ed19e..593bd01f5dc 100644 --- a/ui/src/views/infra/network/EditTrafficLabel.vue +++ b/ui/src/views/infra/network/EditTrafficLabel.vue @@ -164,8 +164,8 @@ export default { api('updateTrafficType', params).then(response => { this.$pollJob({ jobId: response.updatetraffictyperesponse.jobid, - title: title, - description: description, + title, + description, successMessage: `${this.$t('label.update.traffic.label')} ${this.traffictype} ${this.$t('label.success')}`, loadingMessage: `${title} ${this.$t('label.in.progress')}`, catchMessage: this.$t('error.fetching.async.job.result') diff --git a/ui/src/views/infra/zone/ZoneWizardLaunchZone.vue b/ui/src/views/infra/zone/ZoneWizardLaunchZone.vue index eb18181aa88..8ad7d3edc05 100644 --- a/ui/src/views/infra/zone/ZoneWizardLaunchZone.vue +++ b/ui/src/views/infra/zone/ZoneWizardLaunchZone.vue @@ -193,8 +193,8 @@ export default { addStep (title, step) { this.steps.push({ index: this.currentStep, - title: title, - step: step, + title, + step, status: STATUS_PROCESS }) this.setStepStatus(STATUS_PROCESS) diff --git a/ui/src/views/network/CreateVpc.vue b/ui/src/views/network/CreateVpc.vue index 72f202cda83..29d718c1c8d 100644 --- a/ui/src/views/network/CreateVpc.vue +++ b/ui/src/views/network/CreateVpc.vue @@ -193,8 +193,8 @@ export default { if (jobId) { this.$pollJob({ jobId, - title: title, - description: description, + title, + description, loadingMessage: `${title} ${this.$t('label.in.progress')}`, catchMessage: this.$t('error.fetching.async.job.result') }) diff --git a/ui/src/views/storage/RestoreAttachBackupVolume.vue b/ui/src/views/storage/RestoreAttachBackupVolume.vue index 07b18d9ed20..c45ad6b2031 100644 --- a/ui/src/views/storage/RestoreAttachBackupVolume.vue +++ b/ui/src/views/storage/RestoreAttachBackupVolume.vue @@ -153,7 +153,7 @@ export default { if (jobId) { this.$pollJob({ jobId, - title: title, + title, description: values.volumeid, successMethod: result => { this.closeAction() diff --git a/ui/src/views/storage/TakeSnapshot.vue b/ui/src/views/storage/TakeSnapshot.vue index b726e7c0645..6644e1964af 100644 --- a/ui/src/views/storage/TakeSnapshot.vue +++ b/ui/src/views/storage/TakeSnapshot.vue @@ -173,7 +173,7 @@ export default { if (jobId) { this.$pollJob({ jobId, - title: title, + title, description: values.name || this.resource.id, successMethod: result => {}, loadingMessage: `${title} ${this.$t('label.in.progress.for')} ${description}`,