refs #2619. Task mark as success
testing/ogGui-multibranch/pipeline/head There was a failure building this commit
Details
testing/ogGui-multibranch/pipeline/head There was a failure building this commit
Details
parent
cc1a05cf0b
commit
7a110d9d58
|
@ -497,6 +497,12 @@ table {
|
|||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* Ajuste para el botón de éxito en la barra de progreso */
|
||||
.progress-container .success-button {
|
||||
margin-left: 5px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.paginator-container {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
|
@ -549,7 +555,7 @@ table {
|
|||
.status-progress-flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.status-option {
|
||||
|
@ -617,6 +623,26 @@ button.cancel-button {
|
|||
color: #dc3545;
|
||||
}
|
||||
|
||||
.success-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #28a745;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
padding: 0px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.success-button:hover {
|
||||
background-color: rgba(40, 167, 69, 0.1);
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.success-button mat-icon {
|
||||
color: #28a745;
|
||||
}
|
||||
|
||||
.selected-row {
|
||||
background-color: rgba(102, 126, 234, 0.1) !important;
|
||||
}
|
||||
|
|
|
@ -241,6 +241,10 @@
|
|||
(click)="cancelTrace(trace)" class="cancel-button" matTooltip="{{ 'cancelTask' | translate }}">
|
||||
<mat-icon>cancel</mat-icon>
|
||||
</button>
|
||||
<button mat-icon-button
|
||||
(click)="markTraceAsSuccess(trace)" class="success-button" matTooltip="Marcar como exitosa">
|
||||
<mat-icon>flag</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</ng-container>
|
||||
<ng-template #statusChip>
|
||||
|
@ -270,6 +274,10 @@
|
|||
(click)="cancelTrace(trace)" class="cancel-button" matTooltip="{{ 'cancelTask' | translate }}">
|
||||
<mat-icon>cancel</mat-icon>
|
||||
</button>
|
||||
<button *ngIf="trace.status === 'in-progress'" mat-icon-button
|
||||
(click)="markTraceAsSuccess(trace)" class="success-button" matTooltip="Marcar como exitosa">
|
||||
<mat-icon>flag</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</ng-template>
|
||||
</ng-container>
|
||||
|
|
|
@ -321,6 +321,41 @@ export class TaskLogsComponent implements OnInit, OnDestroy {
|
|||
});
|
||||
}
|
||||
|
||||
markTraceAsSuccess(trace: any): void {
|
||||
if (trace.status !== 'in-progress') {
|
||||
this.toastService.warning('Solo se pueden marcar como exitosas las trazas en progreso', 'Advertencia');
|
||||
return;
|
||||
}
|
||||
|
||||
const dialogRef = this.dialog.open(DeleteModalComponent, {
|
||||
width: '400px',
|
||||
data: {
|
||||
title: 'Marcar Traza como Exitosa',
|
||||
message: `¿Estás seguro de que quieres marcar la traza #${trace.id} como exitosa?`,
|
||||
confirmText: 'Marcar como Exitosa',
|
||||
cancelText: 'Cancelar'
|
||||
}
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
if (result) {
|
||||
this.loading = true;
|
||||
this.http.post(`${this.baseUrl}${trace['@id']}/mark-as-success`, {}).subscribe(
|
||||
() => {
|
||||
this.toastService.success('Traza marcada como exitosa correctamente', 'Éxito');
|
||||
this.loadTraces();
|
||||
this.loadTotalStats();
|
||||
},
|
||||
(error) => {
|
||||
console.error('Error marking trace as success:', error);
|
||||
this.toastService.error('Error al marcar la traza como exitosa', 'Error');
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private updateTracesStatus(clientUuid: string, newStatus: string, progress: Number): void {
|
||||
const traceIndex = this.traces.findIndex(trace => trace['@id'] === clientUuid);
|
||||
if (traceIndex !== -1) {
|
||||
|
|
Loading…
Reference in New Issue