Skip to content

Commit

Permalink
Merge pull request #745 from R-Sourabh/#680-data-manager-log
Browse files Browse the repository at this point in the history
Improved: Added a function to set the ion-badge color based on log status and updated the 'Failed Records' icon properties (#680)
  • Loading branch information
ymaheshwari1 authored Nov 29, 2024
2 parents ae4de84 + 8f1a97e commit 5ddd6ab
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/views/DataManagerLogDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@
<p>{{ translate('Finished') }}</p>
</ion-label>

<ion-badge v-if="log.statusId" :color="log.statusId === 'SERVICE_FAILED' ? 'danger' : 'success'">{{ translate(getStatusDesc(log.statusId)) }}</ion-badge>
<ion-badge v-if="log.statusId" :color="getLogStatusColor(log.statusId)">{{ translate(getStatusDesc(log.statusId)) }}</ion-badge>

<div class="ion-text-center" lines="none" v-if="log.errorRecordContentId" button @click="downloadErrorRecordFile(log)">
<ion-icon slot="start" :icon="cloudDownloadOutline" />
<div class="ion-text-center" lines="none" v-if="log.errorRecordContentId">
<ion-button fill="clear" color="medium" @click="downloadErrorRecordFile(log)">
<ion-icon slot="icon-only" :icon="cloudDownloadOutline" />
</ion-button>
<ion-label>
<p>{{ translate('Failed records') }}</p>
</ion-label>
Expand Down Expand Up @@ -257,6 +259,17 @@ export default defineComponent ({
} catch (error) {
logger.error(error);
}
},
getLogStatusColor(statusId) {
if (statusId === 'SERVICE_FINISHED') {
return 'success';
} else if (statusId === 'SERVICE_RUNNING') {
return 'dark';
} else if (statusId === 'SERVICE_FAILED') {
return 'danger';
} else {
return 'medium';
}
}
},
setup() {
Expand Down

0 comments on commit 5ddd6ab

Please sign in to comment.