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

View File

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