From 2c9dd31c3c1948ebecd3a0628d10fdbac42c34cc Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Mon, 11 Nov 2024 20:12:40 +0530 Subject: [PATCH] Improved: removed timeFromNow and used existing timeTillJob function, added isDesktop property for history segment(#680) --- src/components/JobConfiguration.vue | 6 +----- src/components/JobParameterModal.vue | 6 +----- src/views/Pipeline.vue | 4 ++-- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/components/JobConfiguration.vue b/src/components/JobConfiguration.vue index 835f2abe..ec43e91e 100644 --- a/src/components/JobConfiguration.vue +++ b/src/components/JobConfiguration.vue @@ -6,7 +6,7 @@ - {{ currentJob.statusId == "SERVICE_CANCELLED" || currentJob.statusId == "SERVICE_CRASHED" ? timeFromNow(currentJob.cancelDateTime) : timeFromNow(currentJob.finishDateTime) }} + {{ currentJob.statusId == "SERVICE_CANCELLED" || currentJob.statusId == "SERVICE_CRASHED" ? timeTillJob(currentJob.cancelDateTime) : timeTillJob(currentJob.finishDateTime) }} {{ translate("running") }} {{ timeTillJob(currentJob.runTime) }} @@ -484,10 +484,6 @@ export default defineComponent({ const timeDiff = DateTime.fromMillis(time).diff(DateTime.local()); return DateTime.local().plus(timeDiff).toRelative(); }, - timeFromNow (time: any) { - const timeDiff = DateTime.fromMillis(time).diff(DateTime.local()); - return DateTime.local().plus(timeDiff).toRelative(); - }, async viewJobHistory(job: any) { const jobHistoryModal = await modalController.create({ component: JobHistoryModal, diff --git a/src/components/JobParameterModal.vue b/src/components/JobParameterModal.vue index 7a7b8826..d53320f4 100644 --- a/src/components/JobParameterModal.vue +++ b/src/components/JobParameterModal.vue @@ -8,7 +8,7 @@ {{ translate('Custom Parameters') }} - {{ translate('Save') }} + {{ translate('Save') }} @@ -119,10 +119,6 @@ export default defineComponent({ return JSON.stringify(res); }, - isSaveDisabledByStatus(statusId: any) { - const invalidStatuses = ["SERVICE_PENDING", "SERVICE_CANCELLED", "SERVICE_CRASHED", "SERVICE_FAILED", "SERVICE_FINISHED"]; - return invalidStatuses.includes(statusId); - }, save() { modalController.dismiss({ dismissed: true, customOptionalParameters: this.customOptionalParametersValue, customRequiredParameters: this.customRequiredParametersValue }) } diff --git a/src/views/Pipeline.vue b/src/views/Pipeline.vue index 91697354..fa9f8f55 100644 --- a/src/views/Pipeline.vue +++ b/src/views/Pipeline.vue @@ -180,7 +180,7 @@
- +
{{ job.parentJobId }} @@ -608,7 +608,7 @@ export default defineComponent({ this.freqType = appFreqType ? appFreqType[1] : "default" await this.store.dispatch('job/updateCurrentJob', { job }); - if (this.segmentSelected === 'history' && job.runtimeData?.configId) { + if (!this.isDesktop && this.segmentSelected === 'history' && job.runtimeData?.configId) { await this.store.dispatch('job/fetchDataManagerLogs', job.jobId) } if(!this.isDesktop && job?.jobId) {