Skip to content

Commit

Permalink
Merge branch 'Botón-de-cierre-de-informe-EDA'
Browse files Browse the repository at this point in the history
  • Loading branch information
jortilles committed May 27, 2024
2 parents 2915119 + 11f75ff commit 6ba7157
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ <h3 *ngIf="!titleClick" class="eda-title"> {{title}} </h3>
<span i18n="@@opcionGuardarComo" class="ml-2">GUARDAR COMO</span>
</div>
</div>
<div *ngIf="display_v.edit_mode && canIedit()" class="right-sidebar-blocks-options block-options-bg pointer mt-1" (click)="deleteReport()">
<div>
<i class="fa fa-trash"></i>
<span i18n="@@eliminarInforme" class="ml-2">ELIMINAR INFORME</span>
</div>
</div>

<div *ngIf="display_v.edit_mode">
<form [formGroup]="form" *ngIf="canIedit()" >
Expand Down
48 changes: 44 additions & 4 deletions eda/eda_app/src/app/module/pages/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@ import { EdaDialogController, EdaDialogCloseEvent, EdaDatePickerComponent } from
import { DashboardService, AlertService, FileUtiles, QueryBuilderService, GroupService, IGroup, SpinnerService, UserService, StyleProviderService, DashboardStyles, GlobalFiltersService } from '@eda/services/service.index';
import { EdaBlankPanelComponent, IPanelAction } from '@eda/components/eda-panels/eda-blank-panel/eda-blank-panel.component';
import { EdaDatePickerConfig } from '@eda/shared/components/eda-date-picker/datePickerConfig';
import { environment } from 'environments/environment';
import { SelectItem } from 'primeng/api';
import { Subscription } from 'rxjs';
import domtoimage from 'dom-to-image';
import Swal from 'sweetalert2';
import jspdf from 'jspdf';
import * as _ from 'lodash';
import { ValueListSource } from '@eda/models/data-source-model/data-source-models';
import { DashboardFilterDialogComponent } from './filter-dialog/dashboard-filter-dialog.component';
import { filter } from 'rxjs/operators';


@Component({
selector: 'app-dashboard',
Expand Down Expand Up @@ -956,6 +953,49 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy {
});
}

public deleteReport() {
this.display_v.rightSidebar = false;

// Referencia al componente dashboard
const me = this;

me.route.paramMap.subscribe(
params => {
me.id = params.get('id')
},
err => me.alertService.addError(err)
);

// id del presente dashboard
const dashboardId = me.id

let text = $localize`:@@deleteDashboardWarning: Estás a punto de borrar el informe`;
Swal.fire({
title: $localize`:@@Sure:¿Estás seguro?`,
text: `${text}`,
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: $localize`:@@ConfirmDeleteModel:Si, ¡Eliminalo!`,
cancelButtonText: $localize`:@@DeleteGroupCancel:Cancelar`
}).then(async (borrado) => {
if (borrado.value) {
try {
await this.dashboardService.deleteDashboard(dashboardId).toPromise();

// La app se direcciona al home EDA
this.router.navigate(['/home/']).then(() => {
window.location.reload();
});
} catch (err) {
this.alertService.addError(err);
throw err;
}
}
});
}

public editStyles() {
this.display_v.rightSidebar = false;
const params = this.styles;
Expand Down
5 changes: 5 additions & 0 deletions eda/eda_app/src/locale/messages.ca.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -3884,6 +3884,11 @@ Entrar<x id="CLOSE_BOLD_TEXT" ctype="x-b" equiv-text="&lt;/b&gt;"/>
<target>GUARDAR COM</target>
</trans-unit>

<trans-unit id="eliminarInforme">
<source>ELIMINAR INFORME</source>
<target>ELIMINAR INFORME</target>
</trans-unit>




Expand Down
5 changes: 5 additions & 0 deletions eda/eda_app/src/locale/messages.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -3857,6 +3857,11 @@ Login<x id="CLOSE_BOLD_TEXT" ctype="x-b" equiv-text="&lt;/b&gt;"/>
<target>SAVE AS</target>
</trans-unit>

<trans-unit id="eliminarInforme">
<source>ELIMINAR INFORME</source>
<target>DELETE REPORT</target>
</trans-unit>


<trans-unit id="editStylesTitle">
<source>EDITAR ESTILOS DEL INFORME</source>
Expand Down
5 changes: 5 additions & 0 deletions eda/eda_app/src/locale/messages.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -3843,6 +3843,11 @@ Login<x id="CLOSE_BOLD_TEXT" ctype="x-b" equiv-text="&lt;/b&gt;"/>
<target>ZAPISZ JAKO</target>
</trans-unit>

<trans-unit id="eliminarInforme">
<source>ELIMINAR INFORME</source>
<target>USUŃ RAPORT</target>
</trans-unit>


<trans-unit id="editStylesTitle">
<source>EDITAR ESTILOS DEL INFORME</source>
Expand Down

0 comments on commit 6ba7157

Please sign in to comment.