Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented: modal to show failed job reason in history segment on pipeline page(#641) #649

Merged
merged 5 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"Every 6 hours": "Every 6 hours",
"Every day": "Every day",
"Failed": "Failed",
"Failed job reason": "Failed job reason",
"Failed to schedule service(s)": "Failed to schedule {count} service(s)",
"Fetching TimeZones": "Fetching TimeZones",
"File upload status": "File upload status",
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/job/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"shopId_fld1_grp": "2",
"shopId_fld1_op": "empty"
} as any,
"fieldList": [ "systemJobEnumId", "runTime", "tempExprId", "parentJobId", "serviceName", "jobId", "jobName", "statusId", "cancelDateTime", "finishDateTime", "startDateTime" , "enumTypeId", "enumName", "description", "runtimeDataId" ],
"fieldList": [ "systemJobEnumId", "runTime", "tempExprId", "parentJobId", "serviceName", "jobId", "jobName", "jobResult", "statusId", "cancelDateTime", "finishDateTime", "startDateTime" , "enumTypeId", "enumName", "description", "runtimeDataId" ],
"noConditionFind": "Y",
"viewSize": payload.viewSize,
"viewIndex": payload.viewIndex,
Expand Down Expand Up @@ -681,7 +681,7 @@
return resp;
},

async runServiceNow({ dispatch }, params) {

Check warning on line 684 in src/store/modules/job/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'dispatch' is defined but never used

Check warning on line 684 in src/store/modules/job/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'dispatch' is defined but never used
let resp;

const job = params.job
Expand Down
58 changes: 58 additions & 0 deletions src/views/FailedJobReasonModal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<template>
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-button @click="closeModal">
<ion-icon slot="icon-only" :icon="closeOutline" />
</ion-button>
</ion-buttons>
<ion-title>{{ $t("Failed job reason") }}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-item lines="none">
<p>{{ job.jobResult }}</p>
</ion-item>
</ion-content>
</template>

<script lang="ts">
import {
IonButton,
IonButtons,
IonContent,
IonHeader,
IonIcon,
IonItem,
IonTitle,
IonToolbar,
modalController,
} from '@ionic/vue';
import { defineComponent } from 'vue';
import { closeOutline } from 'ionicons/icons';

export default defineComponent({
name: "FailedJobReasonModal",
components: {
IonButton,
IonButtons,
IonContent,
IonHeader,
IonIcon,
IonItem,
IonTitle,
IonToolbar
},
props: ["job"],
methods: {
closeModal() {
modalController.dismiss({ dismissed: true });
}
},
setup() {
return {
closeOutline
};
},
});
</script>
11 changes: 10 additions & 1 deletion src/views/Pipeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
</div>
<div>
<ion-badge v-if="job.cancelDateTime || job.finishDateTime" color="dark">{{ job.statusId == "SERVICE_CANCELLED" || job.statusId == "SERVICE_CRASHED" ? timeFromNow(job.cancelDateTime) : timeFromNow(job.finishDateTime) }}</ion-badge>
<ion-badge v-if="job.statusId" :color="job.statusId === 'SERVICE_FINISHED' ? 'success' : 'danger'">{{ job.statusDesc }}</ion-badge>
<ion-badge v-if="job.statusId" :color="job.statusId === 'SERVICE_FINISHED' ? 'success' : 'danger'" @click="job.statusId === 'SERVICE_FAILED' ? openFailedJobReason(job) : ''">{{ job.statusDesc }}</ion-badge>
</div>
</ion-card-header>

Expand Down Expand Up @@ -299,6 +299,7 @@ import { showToast } from '@/utils'
import JobActionsPopover from '@/components/JobActionsPopover.vue'
import { Actions, hasPermission } from '@/authorization'
import Filters from '@/components/Filters.vue';
import FailedJobReasonModal from '@/views/FailedJobReasonModal.vue'

export default defineComponent({
name: "Pipeline",
Expand Down Expand Up @@ -390,6 +391,14 @@ export default defineComponent({
this.segmentSelected === 'running' ? this.getRunningJobs():
this.getJobHistory();
},
async openFailedJobReason(job: any) {
const jobHistoryModal = await modalController.create({
component: FailedJobReasonModal,
componentProps: { job }
});

return jobHistoryModal.present();
},
getJobExecutionTime(startTime: any, endTime: any){
if (startTime && endTime) {
const timeDiff = DateTime.fromMillis(endTime).diff( DateTime.fromMillis(startTime))
Expand Down
Loading