Skip to content

Commit

Permalink
Improved: runtime to be passed from current time millis (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Oct 20, 2023
1 parent b280ff6 commit fd03327
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
19 changes: 9 additions & 10 deletions src/components/BatchModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</ion-toolbar>
</ion-header>

<ion-content>
<ion-content class="custom-ion-content">
<ion-item>
<ion-label position="fixed">{{ $t('Name') }}</ion-label>
<ion-input :placeholder="currentDateTime = getCurrentDateTime()" v-model="jobName" />
Expand Down Expand Up @@ -244,18 +244,14 @@ export default defineComponent({
if (hasJobDataError(job)) return;
if (this.runTime) {
job['runTime'] = this.runTime
job['runTime'] = DateTime.now().toMillis() + this.runTime
}
job['jobStatus'] = this.jobStatus !== 'SERVICE_DRAFT' ? this.jobStatus : 'HOURLY';
job['jobName'] = this.jobName || this.currentDateTime;
if (job?.status === 'SERVICE_DRAFT') {
const jobCustomParameters = generateJobCustomParameters(this.customRequiredParameters, this.customOptionalParameters, job.runtimeData)
await this.store.dispatch('job/scheduleService', { job, jobCustomParameters })
} else if (job?.status === 'SERVICE_PENDING') {
await this.store.dispatch('job/updateJob', job)
}
const jobCustomParameters = generateJobCustomParameters(this.customRequiredParameters, this.customOptionalParameters, job.runtimeData)
await this.store.dispatch('job/scheduleService', { job, jobCustomParameters })
this.closeModal()
},
async setCustomFrequency() {
Expand Down Expand Up @@ -321,7 +317,10 @@ export default defineComponent({
</script>

<style scoped>
ion-content {
ion-content {
--offset-bottom: 100px;
}
.custom-ion-content {
--offset-bottom: 100px;
}
}
</style>
2 changes: 1 addition & 1 deletion src/components/JobConfiguration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<ion-icon slot="start" :icon="timeOutline" />
<ion-label class="ion-text-wrap">{{ $t("Run time") }}</ion-label>
<ion-select interface="popover" :placeholder="$t('Select')" :value="runTime" @ionChange="updateRunTime($event)">
<ion-select-option v-for="runTime in runTimes" :key="runTime.value" :value="runTime.value">{{ $t(runTime.label) }}</ion-select-option>
<ion-select-option v-for="runTime in runTimes" :key="runTime.value" :value="runTime.value">{{ runTime.label }}</ion-select-option>
</ion-select>
<!-- TODO: display a button when we are not having a runtime and open the datetime component
on click of that button
Expand Down
1 change: 1 addition & 0 deletions src/store/modules/job/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ const actions: ActionTree<JobState, RootState> = {

try {
resp = await JobService.scheduleJob({ ...payload });
console.log(resp)
if (resp.status == 200 && !hasError(resp)) {
showToast(translate('Service has been scheduled'));
const fetchJobsResponses = await dispatch('fetchJobs', {
Expand Down
4 changes: 2 additions & 2 deletions src/views/Brokering.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</ion-item>
</ion-card>

<ion-card :button="isDesktop" v-for="batch in orderBatchJobs" :key="batch?.id" detail v-show="batch?.status === 'SERVICE_PENDING'" @click="hasPermission(Actions.APP_JOB_UPDATE) && viewJobConfiguration({ job: batch })">
<ion-card :button="isDesktop" v-for="batch in orderBatchJobs" :key="batch?.id" detail v-show="batch?.status === 'SERVICE_PENDING'" @click="hasPermission(Actions.APP_JOB_UPDATE) && viewJobConfiguration({ id: batch.enumId, job: batch })">
<ion-card-header>
<div>
<ion-card-subtitle>{{ getBrokerQueue(batch) }}</ion-card-subtitle>
Expand Down Expand Up @@ -58,7 +58,7 @@
</section>

<aside class="desktop-only" v-if="isDesktop" v-show="currentJob">
<JobConfiguration :status="currentJobStatus" :type="freqType" :key="currentJob" isBrokerJob="true"/>
<JobConfiguration :type="freqType" :key="currentJob" isBrokerJob="true"/>
</aside>
</main>
</ion-content>
Expand Down

0 comments on commit fd03327

Please sign in to comment.