Skip to content

Commit

Permalink
Improved: Added a function to set the ion-badge color based on log st…
Browse files Browse the repository at this point in the history
…atus and updated the 'Failed Records' icon properties (hotwax#680)
  • Loading branch information
R-Sourabh committed Nov 14, 2024
1 parent 08be04e commit 30acf64
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/views/DataManagerLogDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@
<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" />
<ion-icon slot="icon-only" color="medium" :icon="cloudDownloadOutline" />
<ion-label>
<p>{{ translate('Failed records') }}</p>
</ion-label>
Expand Down Expand Up @@ -257,6 +257,19 @@ 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 if (statusId === 'SERVICE_PENDING') {
return 'medium';
} else {
return 'medium';
}
}
},
setup() {
Expand Down

0 comments on commit 30acf64

Please sign in to comment.