fix conflicts

This commit is contained in:
Mariela Bonilla 2021-07-26 00:00:03 -06:00
parent 54f4e2877c
commit d6e1d32287
2 changed files with 12 additions and 8 deletions

View File

@ -197,7 +197,7 @@
<a>- {{ encuesta.categoria?.nombre }}</a> <a>- {{ encuesta.categoria?.nombre }}</a>
</dd> </dd>
</dl> </dl>
<dl *ngIf="encuesta.acceso === 'PRIVATE'"> <dl>
<dt><span jhiTranslate="dataSurveyApp.encuesta.fechaPublicacion">Fecha Publicacion</span></dt> <dt><span jhiTranslate="dataSurveyApp.encuesta.fechaPublicacion">Fecha Publicacion</span></dt>
<dd> <dd>
<span <span

View File

@ -69,6 +69,7 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
encuestas?: IEncuesta[]; encuestas?: IEncuesta[];
isLoading = false; isLoading = false;
selectedSurvey?: IEncuesta | null = null; selectedSurvey?: IEncuesta | null = null;
idEncuesta: number | null = null;
isSaving = false; isSaving = false;
categoriasSharedCollection: ICategoria[] = []; categoriasSharedCollection: ICategoria[] = [];
@ -99,7 +100,7 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
}); });
createAnother: Boolean = false; createAnother: Boolean = false;
selectedSurveyId: number | null = null; selectedSurveyId: Number | null = null;
constructor( constructor(
protected encuestaService: EncuestaService, protected encuestaService: EncuestaService,
@ -252,8 +253,8 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
} }
deleteSurvey(): void { deleteSurvey(): void {
if (this.selectedSurveyId != null) { if (this.idEncuesta != null) {
this.getEncuesta(this.selectedSurveyId) this.getEncuesta(this.idEncuesta)
.pipe( .pipe(
finalize(() => { finalize(() => {
const modalRef = this.modalService.open(EncuestaDeleteDialogComponent, { size: 'lg', backdrop: 'static' }); const modalRef = this.modalService.open(EncuestaDeleteDialogComponent, { size: 'lg', backdrop: 'static' });
@ -427,6 +428,7 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
} }
selectSurvey(event: any): void { selectSurvey(event: any): void {
this.idEncuesta = event.target.getAttribute('data-id');
document.querySelectorAll('.ds-list--entity').forEach(e => { document.querySelectorAll('.ds-list--entity').forEach(e => {
e.classList.remove('active'); e.classList.remove('active');
}); });
@ -436,7 +438,7 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
} }
openPreview() { openPreview() {
const surveyId = this.selectedIdSurvey; const surveyId = this.idEncuesta;
this.router.navigate(['/encuesta', surveyId, 'preview']); this.router.navigate(['/encuesta', surveyId, 'preview']);
} }
@ -456,9 +458,10 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
e.classList.remove('active'); e.classList.remove('active');
}); });
let res = await this.encuestaService.find(this.selectedSurveyId).toPromise(); let res = await this.encuestaService.find(event.target.id).toPromise();
this.selectedSurvey = res.body; this.selectedSurvey = res.body;
this.isPublished = this.selectedSurvey!.estado === 'DRAFT'; // QUE SE LE MUESTRE CUANDO ESTE EN DRAFT this.isPublished = this.selectedSurvey!.estado === 'DRAFT'; // QUE SE LE MUESTRE CUANDO ESTE EN DRAFT
// }
document.getElementById('contextmenu-create--separator')!.style.display = 'block'; document.getElementById('contextmenu-create--separator')!.style.display = 'block';
document.getElementById('contextmenu-edit--separator')!.style.display = 'block'; document.getElementById('contextmenu-edit--separator')!.style.display = 'block';
@ -468,7 +471,7 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
document.getElementById('contextmenu-publish')!.style.display = 'block'; //cambiar document.getElementById('contextmenu-publish')!.style.display = 'block'; //cambiar
} }
document.getElementById('contextmenu-preview')!.style.display = 'block'; document.getElementById('contextmenu-preview')!.style.display = 'block';
document.getElementById('contextmenu-share')!.style.display = 'block'; //document.getElementById('contextmenu-share')!.style.display = 'block';
if ((event.target as HTMLElement).classList.contains('ds-list')) { if ((event.target as HTMLElement).classList.contains('ds-list')) {
document; document;
@ -477,6 +480,7 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
document.getElementById('contextmenu-delete--separator')!.style.display = 'none'; document.getElementById('contextmenu-delete--separator')!.style.display = 'none';
} else if ((event.target as HTMLElement).classList.contains('ds-list--entity')) { } else if ((event.target as HTMLElement).classList.contains('ds-list--entity')) {
this.selectedSurveyId = Number(event.target.dataset.id); this.selectedSurveyId = Number(event.target.dataset.id);
this.idEncuesta = Number(event.target.dataset.id);
event.target.classList.add('active'); event.target.classList.add('active');
let res = await this.encuestaService.find(this.selectedSurveyId).toPromise(); let res = await this.encuestaService.find(this.selectedSurveyId).toPromise();
@ -487,7 +491,7 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
document.getElementById('contextmenu-edit--separator')!.style.display = 'block'; document.getElementById('contextmenu-edit--separator')!.style.display = 'block';
document.getElementById('contextmenu-delete--separator')!.style.display = 'block'; document.getElementById('contextmenu-delete--separator')!.style.display = 'block';
document.getElementById('contextmenu-edit')!.style.display = 'block'; document.getElementById('contextmenu-edit')!.style.display = 'block';
document.getElementById('contextmenu-duplicate')!.style.display = 'block'; document.getElementById('contextmenu-preview')!.style.display = 'block';
if (!this.isPublished) { if (!this.isPublished) {
document.getElementById('contextmenu-publish')!.style.display = 'block'; document.getElementById('contextmenu-publish')!.style.display = 'block';