Add duplicate button and fix delete button in survey list

This commit is contained in:
Pablo Bonilla 2021-07-26 02:37:14 -06:00
parent 306a2a0aaf
commit 72c07e2bbf
No known key found for this signature in database
GPG Key ID: 46877262B8DE47E2
2 changed files with 17 additions and 17 deletions

View File

@ -96,25 +96,19 @@
</li>
</div>
<div class="ds-contextmenu__divider ds-contextmenu__divider--separator-bottom" id="contextmenu-edit--separator">
<li class="d-justify justify-content-start">
<button type="button" (click)="openSurvey(null)" id="contextmenu-edit">
<fa-icon class="contextmenu__icon" [icon]="faEdit"></fa-icon>Editar
</button>
<li class="d-justify justify-content-start" id="contextmenu-edit">
<button type="button" (click)="openSurvey(null)"><fa-icon class="contextmenu__icon" [icon]="faEdit"></fa-icon>Editar</button>
</li>
<li>
<button type="button" (click)="openPreview()" id="contextmenu-preview">
<li id="contextmenu-preview">
<button type="button" (click)="openPreview()">
<fa-icon class="contextmenu__icon" [icon]="faPollH"></fa-icon>Ver vista previa
</button>
</li>
<li>
<button
type="button"
id="contextmenu-publish"
type="button"
(click)="publish()"
data-toggle="modal"
data-target="#publicarEncuesta"
>
<li id="contextmenu-duplicate">
<button type="button" (click)="duplicateSurvey()"><fa-icon class="contextmenu__icon" [icon]="faCopy"></fa-icon>Duplicar</button>
</li>
<li id="contextmenu-publish">
<button type="button" (click)="publish()" data-toggle="modal" data-target="#publicarEncuesta">
<!--Agarrar el id de la encuesta -->
<fa-icon class="contextmenu__icon" [icon]="faUpload"></fa-icon>Publicar
</button>

View File

@ -253,8 +253,8 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
}
deleteSurvey(): void {
if (this.idEncuesta != null) {
this.getEncuesta(this.idEncuesta)
if (this.selectedSurveyId != null) {
this.getEncuesta(this.selectedSurveyId)
.pipe(
finalize(() => {
const modalRef = this.modalService.open(EncuestaDeleteDialogComponent, { size: 'lg', backdrop: 'static' });
@ -475,8 +475,10 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
if (!this.isPublished) {
document.getElementById('contextmenu-publish')!.style.display = 'block';
document.getElementById('contextmenu-duplicate')!.style.display = 'block';
} else {
document.getElementById('contextmenu-publish')!.style.display = 'none';
document.getElementById('contextmenu-duplicate')!.style.display = 'none';
}
// document.getElementById('contextmenu-share')!.style.display = 'block';
document.getElementById('contextmenu-create--separator')!.style.display = 'none';
@ -501,4 +503,8 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
}
});
}
duplicateSurvey(): void {
console.log(this.selectedSurveyId);
}
}