From 74f006287e0244607f48a2e44d8bd8892261ed96 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 19 Oct 2023 12:04:36 +0530 Subject: [PATCH 01/14] Implemented: ui for the brokering page (#620) --- src/components/BatchModal.vue | 197 ++++++++++++++++++++++++++++++---- src/views/Brokering.vue | 72 +++++++++++-- 2 files changed, 240 insertions(+), 29 deletions(-) diff --git a/src/components/BatchModal.vue b/src/components/BatchModal.vue index 65f0d1cf..5f017510 100644 --- a/src/components/BatchModal.vue +++ b/src/components/BatchModal.vue @@ -1,5 +1,80 @@ @@ -69,7 +225,7 @@ import { modalController } from '@ionic/vue'; import { defineComponent } from 'vue'; -import { closeOutline, checkmarkDoneOutline } from 'ionicons/icons'; +import { closeOutline, checkmarkDoneOutline, timeOutline, timerOutline, ticketOutline, warningOutline } from 'ionicons/icons'; import { mapGetters, useStore } from 'vuex'; import { DateTime } from 'luxon'; import { handleDateTimeInput, generateJobCustomParameters, getNowTimestamp, isFutureDate, showToast, hasJobDataError } from '@/utils'; @@ -81,16 +237,16 @@ export default defineComponent({ IonButton, IonButtons, IonContent, - IonDatetime, - IonFab, - IonFabButton, + // IonDatetime, + // IonFab, + // IonFabButton, IonHeader, IonIcon, IonInput, IonItem, IonLabel, - IonRadio, - IonRadioGroup, + // IonRadio, + // IonRadioGroup, IonSelect, IonSelectOption, IonTitle, @@ -119,14 +275,9 @@ export default defineComponent({ }), }, mounted() { - this.getCurrentBatch(); + // this.getCurrentBatch(); }, methods: { - getCurrentBatch() { - this.currentBatch = this.getJob(this.enumId)?.find((job: any) => job.id === this.id) - this.jobName = this.currentBatch?.jobName; - this.currentScheduledBatch = (this as any).jobEnums[this.currentBatch?.enumId]; - }, getDateTime(time: any) { return DateTime.fromMillis(time).toISO() }, @@ -143,7 +294,7 @@ export default defineComponent({ } const job = this.currentBatch ? this.currentBatch : this.getJob(batchJobEnum)?.find((job: any) => job.status === 'SERVICE_DRAFT'); - + if (!job) { showToast(translate('Configuration missing')) return; @@ -163,15 +314,21 @@ export default defineComponent({ if (job?.runTime && !isFutureDate(job?.runTime)) { job.runTime = '' } + console.log(this.jobRunTime); + console.log(getNowTimestamp()); + + console.log('end', job); + if (job?.status === 'SERVICE_DRAFT') { const jobCustomParameters = generateJobCustomParameters([], [], job.runtimeData) - await this.store.dispatch('job/scheduleService', { job, jobCustomParameters }) + // await this.store.dispatch('job/scheduleService', { job, jobCustomParameters }) } else if (job?.status === 'SERVICE_PENDING') { - await this.store.dispatch('job/updateJob', job) + // await this.store.dispatch('job/updateJob', job) } this.closeModal() }, updateRunTime(ev: CustomEvent) { + console.log('ev', ev) this.jobRunTime = handleDateTimeInput(ev['detail'].value) }, getCurrentDateTime() { @@ -184,6 +341,10 @@ export default defineComponent({ return { checkmarkDoneOutline, closeOutline, + ticketOutline, + timeOutline, + timerOutline, + warningOutline, store, getNowTimestamp }; diff --git a/src/views/Brokering.vue b/src/views/Brokering.vue index 1f8149b7..f0cfc36a 100644 --- a/src/views/Brokering.vue +++ b/src/views/Brokering.vue @@ -10,6 +10,45 @@
+ {{ 'Create new brokering job' }} + + + +

{{ 'Scheduled Job' }}

+
+
+ + + + + {{'Queue Name'}} +

{{ batch?.jobName }}

+
+ {{ timeFromNow(batch?.runTime) }} +
+ + + + {{ batch?.frequency }} + {{ batch?.runTime ? getTime(batch.runTime) : '' }} + + + + {{ $t("Unfillable Order") }} + + + + + + + {{ 'Custom' }}: {{ 'Parameter' }} + + + + +
+
+