diff --git a/src/main/java/org/datasurvey/service/MailService.java b/src/main/java/org/datasurvey/service/MailService.java index 23ee9fe..cc47a7b 100644 --- a/src/main/java/org/datasurvey/service/MailService.java +++ b/src/main/java/org/datasurvey/service/MailService.java @@ -159,6 +159,7 @@ public class MailService { sendEmailFromTemplate(user.getUser(), "mail/encuestaPublicaEmail", "email.public.title"); } + @Async public void sendEncuestaDeleted(UsuarioExtra user) { log.debug("Sending encuesta deletion notification mail to '{}'", user.getUser().getEmail()); sendEmailFromTemplate(user.getUser(), "mail/encuestaDeletedEmail", "email.encuestaDeleted.title"); diff --git a/src/main/java/org/datasurvey/web/rest/EncuestaResource.java b/src/main/java/org/datasurvey/web/rest/EncuestaResource.java index cf7e272..992ae8f 100644 --- a/src/main/java/org/datasurvey/web/rest/EncuestaResource.java +++ b/src/main/java/org/datasurvey/web/rest/EncuestaResource.java @@ -126,6 +126,35 @@ public class EncuestaResource { Encuesta result = encuestaService.save(encuesta); + if (encuesta.getUsuarioExtra().getUser() != null) { + mailService.sendEncuestaDeleted(encuesta.getUsuarioExtra()); + } + + return ResponseEntity + .ok() + .headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, encuesta.getId().toString())) + .body(result); + } + + @PutMapping("/encuestas/update/{id}") + public ResponseEntity updateEncuestaReal( + @PathVariable(value = "id", required = false) final Long id, + @Valid @RequestBody Encuesta encuesta + ) throws URISyntaxException { + log.debug("REST request to update Encuesta : {}, {}", id, encuesta); + if (encuesta.getId() == null) { + throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull"); + } + if (!Objects.equals(id, encuesta.getId())) { + throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid"); + } + + if (!encuestaRepository.existsById(id)) { + throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound"); + } + + Encuesta result = encuestaService.save(encuesta); + return ResponseEntity .ok() .headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, encuesta.getId().toString())) diff --git a/src/main/java/org/datasurvey/web/rest/UsuarioEncuestaResource.java b/src/main/java/org/datasurvey/web/rest/UsuarioEncuestaResource.java index 814577d..4707ba0 100644 --- a/src/main/java/org/datasurvey/web/rest/UsuarioEncuestaResource.java +++ b/src/main/java/org/datasurvey/web/rest/UsuarioEncuestaResource.java @@ -2,15 +2,20 @@ package org.datasurvey.web.rest; import java.net.URI; import java.net.URISyntaxException; +import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.Optional; +import java.util.stream.Collectors; import javax.validation.Valid; import javax.validation.constraints.NotNull; import org.datasurvey.domain.UsuarioEncuesta; +import org.datasurvey.domain.UsuarioExtra; import org.datasurvey.repository.UsuarioEncuestaRepository; +import org.datasurvey.service.EncuestaService; import org.datasurvey.service.UsuarioEncuestaQueryService; import org.datasurvey.service.UsuarioEncuestaService; +import org.datasurvey.service.UsuarioExtraService; import org.datasurvey.service.criteria.UsuarioEncuestaCriteria; import org.datasurvey.web.rest.errors.BadRequestAlertException; import org.slf4j.Logger; @@ -36,6 +41,8 @@ public class UsuarioEncuestaResource { private String applicationName; private final UsuarioEncuestaService usuarioEncuestaService; + private final UsuarioExtraService usuarioExtraService; + private final EncuestaService encuestaService; private final UsuarioEncuestaRepository usuarioEncuestaRepository; @@ -44,11 +51,15 @@ public class UsuarioEncuestaResource { public UsuarioEncuestaResource( UsuarioEncuestaService usuarioEncuestaService, UsuarioEncuestaRepository usuarioEncuestaRepository, - UsuarioEncuestaQueryService usuarioEncuestaQueryService + UsuarioEncuestaQueryService usuarioEncuestaQueryService, + UsuarioExtraService usuarioExtraService, + EncuestaService encuestaService ) { this.usuarioEncuestaService = usuarioEncuestaService; this.usuarioEncuestaRepository = usuarioEncuestaRepository; this.usuarioEncuestaQueryService = usuarioEncuestaQueryService; + this.usuarioExtraService = usuarioExtraService; + this.encuestaService = encuestaService; } /** @@ -195,4 +206,23 @@ public class UsuarioEncuestaResource { .headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString())) .build(); } + + @GetMapping("/usuario-encuestas/encuesta/{id}") + public ResponseEntity> getColaboradores(@PathVariable Long id) { + List usuariosExtras = usuarioExtraService.findAll(); + List usuariosEncuestas = usuarioEncuestaService + .findAll() + .stream() + .filter(uE -> Objects.nonNull(uE.getEncuesta())) + .filter(uE -> uE.getEncuesta().getId().equals(id)) + .collect(Collectors.toList()); + + for (UsuarioEncuesta usuarioEncuesta : usuariosEncuestas) { + long usuarioExtraId = usuarioEncuesta.getUsuarioExtra().getId(); + UsuarioExtra usuarioExtra = usuariosExtras.stream().filter(u -> u.getId() == usuarioExtraId).findFirst().get(); + usuarioEncuesta.getUsuarioExtra().setNombre(usuarioExtra.getNombre()); + usuarioEncuesta.getUsuarioExtra().setIconoPerfil(usuarioExtra.getIconoPerfil()); + } + return ResponseEntity.ok().body(usuariosEncuestas); + } } diff --git a/src/main/resources/i18n/messages_es.properties b/src/main/resources/i18n/messages_es.properties index dafa1db..b9c87f1 100644 --- a/src/main/resources/i18n/messages_es.properties +++ b/src/main/resources/i18n/messages_es.properties @@ -56,5 +56,5 @@ email.private.text2=Saludos, #DeletedEncuesta email.encuestaDeleted.title=Su encuesta ha sido eliminada email.encuestaDeleted.greeting=Estimado {0} -email.encuestaDeleted.text1=Su encuesta ha sido eliminada por un administrador +email.encuestaDeleted.text1=Lamentamos informarle que su encuesta ha sido eliminada por un administrador email.encuestaDeleted.text2=Saludos, diff --git a/src/main/webapp/app/account/activate/activate.component.html b/src/main/webapp/app/account/activate/activate.component.html index bc17317..f82d848 100644 --- a/src/main/webapp/app/account/activate/activate.component.html +++ b/src/main/webapp/app/account/activate/activate.component.html @@ -24,16 +24,16 @@
. + sign in +
. + create account +
diff --git a/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.html b/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.html index 9971405..bbce28c 100644 --- a/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.html +++ b/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.html @@ -38,8 +38,8 @@
. + sign in +
diff --git a/src/main/webapp/app/app.module.ts b/src/main/webapp/app/app.module.ts index 695bffe..7c6db5a 100644 --- a/src/main/webapp/app/app.module.ts +++ b/src/main/webapp/app/app.module.ts @@ -18,7 +18,7 @@ import { AppRoutingModule } from './app-routing.module'; import { HomeModule } from './home/home.module'; import { EntityRoutingModule } from './entities/entity-routing.module'; import { ReactiveFormsModule } from '@angular/forms'; - +import { PaginaPrincipalModule } from './pagina-principal/pagina-principal.module'; import { SocialLoginModule, SocialAuthServiceConfig } from 'angularx-social-login'; import { GoogleLoginProvider } from 'angularx-social-login'; // jhipster-needle-angular-add-module-import JHipster will add new module here @@ -32,6 +32,7 @@ import { FooterComponent } from './layouts/footer/footer.component'; import { PageRibbonComponent } from './layouts/profiles/page-ribbon.component'; import { ErrorComponent } from './layouts/error/error.component'; import { SidebarComponent } from './layouts/sidebar/sidebar.component'; +import { PaginaPrincipalComponent } from './pagina-principal/pagina-principal.component'; @NgModule({ imports: [ @@ -39,6 +40,7 @@ import { SidebarComponent } from './layouts/sidebar/sidebar.component'; BrowserModule, SharedModule, HomeModule, + PaginaPrincipalModule, // jhipster-needle-angular-add-module JHipster will add new module here EntityRoutingModule, AppRoutingModule, diff --git a/src/main/webapp/app/entities/encuesta/delete/encuesta-delete-dialog.component.ts b/src/main/webapp/app/entities/encuesta/delete/encuesta-delete-dialog.component.ts index 1476438..2a86796 100644 --- a/src/main/webapp/app/entities/encuesta/delete/encuesta-delete-dialog.component.ts +++ b/src/main/webapp/app/entities/encuesta/delete/encuesta-delete-dialog.component.ts @@ -23,6 +23,6 @@ export class EncuestaDeleteDialogComponent { this.encuestaService.deleteEncuesta(encuesta).subscribe(() => { this.activeModal.close('deleted'); }); - this.encuestaService.deletedNotification(encuesta); + //this.encuestaService.deletedNotification(encuesta); } } diff --git a/src/main/webapp/app/entities/encuesta/detail/encuesta-detail.component.html b/src/main/webapp/app/entities/encuesta/detail/encuesta-detail.component.html index afb9c2c..db1881b 100644 --- a/src/main/webapp/app/entities/encuesta/detail/encuesta-detail.component.html +++ b/src/main/webapp/app/entities/encuesta/detail/encuesta-detail.component.html @@ -1,88 +1,11 @@ - -

-

Vista previa de {{ encuesta!.nombre }}

+
+

Vista previa de {{ encuesta!.nombre }}

+    +
+

Creada el día {{ encuesta!.fechaCreacion | formatShortDatetime | lowercase }}

-
-

Cantidad de preguntas: {{ ePreguntas?.length }}

- -
-
Acceso
-
- - - {{ encuesta.acceso }} -
-
-
-
Contrasenna
-
- - {{ encuesta.contrasenna }} -
-
-
-
Estado
-
- - {{ encuesta.estado }} -
-
-
-
Categoria
-
- - {{ encuesta.categoria?.nombre }} -
-
-
-
Fecha Publicacion
-
- - - {{ - encuesta.fechaPublicacion === undefined ? 'Sin publicar' : (encuesta.fechaPublicacion | formatShortDatetime | lowercase) - }} -
-
-
-
Fecha Finalizar
-
- - - - {{ - encuesta.fechaFinalizar === undefined - ? 'Sin fecha de finalización' - : (encuesta.fechaFinalizar | formatShortDatetime | lowercase) - }} -
-
-
-
Fecha Finalizada
-
- - - - {{ - encuesta.fechaFinalizada === undefined ? 'Sin finalizar' : (encuesta.fechaFinalizada | formatShortDatetime | lowercase) - }} -
-
-
-
Calificacion
-
- -
+
diff --git a/src/main/webapp/app/entities/encuesta/detail/encuesta-detail.component.ts b/src/main/webapp/app/entities/encuesta/detail/encuesta-detail.component.ts index 7696f76..8344581 100644 --- a/src/main/webapp/app/entities/encuesta/detail/encuesta-detail.component.ts +++ b/src/main/webapp/app/entities/encuesta/detail/encuesta-detail.component.ts @@ -28,7 +28,7 @@ import { EPreguntaAbiertaService } from '../../e-pregunta-abierta/service/e-preg import { EPreguntaCerradaOpcionService } from '../../e-pregunta-cerrada-opcion/service/e-pregunta-cerrada-opcion.service'; import { PreguntaCerradaTipo } from 'app/entities/enumerations/pregunta-cerrada-tipo.model'; -import { faTimes, faPlus, faStar } from '@fortawesome/free-solid-svg-icons'; +import { faTimes, faPlus, faStar, faQuestion } from '@fortawesome/free-solid-svg-icons'; import { EncuestaPublishDialogComponent } from '../encuesta-publish-dialog/encuesta-publish-dialog.component'; @Component({ @@ -41,6 +41,7 @@ export class EncuestaDetailComponent implements OnInit { faTimes = faTimes; faPlus = faPlus; faStar = faStar; + faQuestion = faQuestion; encuesta: IEncuesta | null = null; isLoading = false; successPublished = false; diff --git a/src/main/webapp/app/entities/encuesta/encuesta-compartir-dialog/encuesta-compartir-dialog.component.html b/src/main/webapp/app/entities/encuesta/encuesta-compartir-dialog/encuesta-compartir-dialog.component.html new file mode 100644 index 0000000..fdebcc2 --- /dev/null +++ b/src/main/webapp/app/entities/encuesta/encuesta-compartir-dialog/encuesta-compartir-dialog.component.html @@ -0,0 +1 @@ +

encuesta-compartir-dialog works!

diff --git a/src/main/webapp/app/entities/encuesta/encuesta-compartir-dialog/encuesta-compartir-dialog.component.scss b/src/main/webapp/app/entities/encuesta/encuesta-compartir-dialog/encuesta-compartir-dialog.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/main/webapp/app/entities/encuesta/encuesta-compartir-dialog/encuesta-compartir-dialog.component.spec.ts b/src/main/webapp/app/entities/encuesta/encuesta-compartir-dialog/encuesta-compartir-dialog.component.spec.ts new file mode 100644 index 0000000..7dd0e6b --- /dev/null +++ b/src/main/webapp/app/entities/encuesta/encuesta-compartir-dialog/encuesta-compartir-dialog.component.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EncuestaCompartirDialogComponent } from './encuesta-compartir-dialog.component'; + +describe('EncuestaCompartirDialogComponent', () => { + let component: EncuestaCompartirDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [EncuestaCompartirDialogComponent], + }).compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(EncuestaCompartirDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/main/webapp/app/entities/encuesta/encuesta-compartir-dialog/encuesta-compartir-dialog.component.ts b/src/main/webapp/app/entities/encuesta/encuesta-compartir-dialog/encuesta-compartir-dialog.component.ts new file mode 100644 index 0000000..bc1ad54 --- /dev/null +++ b/src/main/webapp/app/entities/encuesta/encuesta-compartir-dialog/encuesta-compartir-dialog.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'jhi-encuesta-compartir-dialog', + templateUrl: './encuesta-compartir-dialog.component.html', + styleUrls: ['./encuesta-compartir-dialog.component.scss'], +}) +export class EncuestaCompartirDialogComponent implements OnInit { + constructor() {} + + ngOnInit(): void {} +} diff --git a/src/main/webapp/app/entities/encuesta/encuesta.module.ts b/src/main/webapp/app/entities/encuesta/encuesta.module.ts index 86a1c11..c6740f1 100644 --- a/src/main/webapp/app/entities/encuesta/encuesta.module.ts +++ b/src/main/webapp/app/entities/encuesta/encuesta.module.ts @@ -9,6 +9,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { EncuestaPublishDialogComponent } from './encuesta-publish-dialog/encuesta-publish-dialog.component'; import { EncuestaDeleteQuestionDialogComponent } from './encuesta-delete-question-dialog/encuesta-delete-question-dialog.component'; import { EncuestaDeleteOptionDialogComponent } from './encuesta-delete-option-dialog/encuesta-delete-option-dialog.component'; +import { EncuestaCompartirDialogComponent } from './encuesta-compartir-dialog/encuesta-compartir-dialog.component'; @NgModule({ imports: [SharedModule, EncuestaRoutingModule, FontAwesomeModule], @@ -20,6 +21,7 @@ import { EncuestaDeleteOptionDialogComponent } from './encuesta-delete-option-di EncuestaPublishDialogComponent, EncuestaDeleteQuestionDialogComponent, EncuestaDeleteOptionDialogComponent, + EncuestaCompartirDialogComponent, ], entryComponents: [EncuestaDeleteDialogComponent], }) diff --git a/src/main/webapp/app/entities/encuesta/list/encuesta.component.html b/src/main/webapp/app/entities/encuesta/list/encuesta.component.html index b639e55..249c71d 100644 --- a/src/main/webapp/app/entities/encuesta/list/encuesta.component.html +++ b/src/main/webapp/app/entities/encuesta/list/encuesta.component.html @@ -97,7 +97,9 @@
  • - +
  • + +
  • + + + + diff --git a/src/main/webapp/app/entities/encuesta/list/encuesta.component.ts b/src/main/webapp/app/entities/encuesta/list/encuesta.component.ts index afb3beb..f22fa92 100644 --- a/src/main/webapp/app/entities/encuesta/list/encuesta.component.ts +++ b/src/main/webapp/app/entities/encuesta/list/encuesta.component.ts @@ -99,6 +99,14 @@ export class EncuestaComponent implements OnInit, AfterViewInit { // usuarioExtra: [], }); + surveyEditForm = this.fb.group({ + id: [], + nombre: [null, [Validators.required, Validators.minLength(1), Validators.maxLength(50)]], + descripcion: [], + acceso: [null, [Validators.required]], + categoria: [null, [Validators.required]], + }); + createAnother: Boolean = false; selectedSurveyId: number | null = null; @@ -124,12 +132,16 @@ export class EncuestaComponent implements OnInit, AfterViewInit { loadAll(): void { this.isLoading = true; - this.usuarioExtraService - .retrieveAllPublicUsers() - .pipe(finalize(() => this.loadPublicUser())) - .subscribe(res => { - this.userSharedCollection = res; - }); + if (this.isAdmin()) { + this.usuarioExtraService + .retrieveAllPublicUsers() + .pipe(finalize(() => this.loadPublicUser())) + .subscribe(res => { + this.userSharedCollection = res; + }); + } else { + this.loadEncuestas(); + } } loadPublicUser(): void { @@ -144,30 +156,7 @@ export class EncuestaComponent implements OnInit, AfterViewInit { loadUserExtras() { this.usuarioExtraService .query() - .pipe( - finalize(() => - this.encuestaService.query().subscribe( - (res: HttpResponse) => { - this.isLoading = false; - const tmpEncuestas = res.body ?? []; - if (this.isAdmin()) { - this.encuestas = tmpEncuestas.filter(e => e.estado !== EstadoEncuesta.DELETED); - - this.encuestas.forEach(e => { - e.usuarioExtra = this.usuarioExtrasSharedCollection?.find(pU => pU.id == e.usuarioExtra?.id); - }); - } else { - this.encuestas = tmpEncuestas - .filter(e => e.usuarioExtra?.id === this.usuarioExtra?.id) - .filter(e => e.estado !== EstadoEncuesta.DELETED); - } - }, - () => { - this.isLoading = false; - } - ) - ) - ) + .pipe(finalize(() => this.loadEncuestas())) .subscribe( (res: HttpResponse) => { this.isLoading = false; @@ -182,6 +171,29 @@ export class EncuestaComponent implements OnInit, AfterViewInit { ); } + loadEncuestas() { + this.encuestaService.query().subscribe( + (res: HttpResponse) => { + this.isLoading = false; + const tmpEncuestas = res.body ?? []; + if (this.isAdmin()) { + this.encuestas = tmpEncuestas.filter(e => e.estado !== EstadoEncuesta.DELETED); + + this.encuestas.forEach(e => { + e.usuarioExtra = this.usuarioExtrasSharedCollection?.find(pU => pU.id == e.usuarioExtra?.id); + }); + } else { + this.encuestas = tmpEncuestas + .filter(e => e.usuarioExtra?.id === this.usuarioExtra?.id) + .filter(e => e.estado !== EstadoEncuesta.DELETED); + } + }, + () => { + this.isLoading = false; + } + ); + } + ngOnInit(): void { this.searchString = ''; this.accesoEncuesta = ''; @@ -465,18 +477,22 @@ export class EncuestaComponent implements OnInit, AfterViewInit { let res = await this.encuestaService.find(this.selectedSurveyId).toPromise(); this.selectedSurvey = res.body; + // Fill in the edit survey + this.fillSurveyEditForm(); this.isPublished = this.selectedSurvey!.estado === 'ACTIVE' || this.selectedSurvey!.estado === 'FINISHED'; // QUE SE LE MUESTRE CUANDO ESTE EN DRAFT document.getElementById('contextmenu-create--separator')!.style.display = 'none'; - document.getElementById('contextmenu-edit--separator')!.style.display = 'block'; document.getElementById('contextmenu-delete--separator')!.style.display = 'block'; - document.getElementById('contextmenu-edit')!.style.display = 'block'; + document.getElementById('contextmenu-edit--separator')!.style.display = 'block'; document.getElementById('contextmenu-preview')!.style.display = 'block'; if (!this.isPublished) { + document.getElementById('contextmenu-edit--separator')!.style.display = 'block'; + document.getElementById('contextmenu-edit')!.style.display = 'block'; document.getElementById('contextmenu-publish')!.style.display = 'block'; document.getElementById('contextmenu-duplicate')!.style.display = 'block'; } else { + document.getElementById('contextmenu-edit')!.style.display = 'none'; document.getElementById('contextmenu-publish')!.style.display = 'none'; document.getElementById('contextmenu-duplicate')!.style.display = 'none'; } @@ -508,4 +524,28 @@ export class EncuestaComponent implements OnInit, AfterViewInit { const res = await this.encuestaService.duplicate(this.selectedSurveyId!).toPromise(); this.loadAll(); } + + editSurvey(): void { + const survey = { ...this.selectedSurvey }; + survey.nombre = this.surveyEditForm.get(['nombre'])!.value; + survey.descripcion = this.surveyEditForm.get(['descripcion'])!.value; + survey.acceso = this.surveyEditForm.get(['acceso'])!.value; + survey.categoria = this.surveyEditForm.get(['categoria'])!.value; + // Prevent user update by setting to null + survey.usuarioExtra!.user = null; + + this.encuestaService.updateSurvey(survey).subscribe(res => { + this.loadAll(); + $('#cancelEditSurveyBtn').click(); + }); + } + + fillSurveyEditForm(): void { + this.surveyEditForm.patchValue({ + nombre: this.selectedSurvey!.nombre, + descripcion: this.selectedSurvey!.descripcion, + acceso: this.selectedSurvey!.acceso, + categoria: this.selectedSurvey!.categoria, + }); + } } diff --git a/src/main/webapp/app/entities/encuesta/service/encuesta.service.ts b/src/main/webapp/app/entities/encuesta/service/encuesta.service.ts index f2e2369..35bdf0b 100644 --- a/src/main/webapp/app/entities/encuesta/service/encuesta.service.ts +++ b/src/main/webapp/app/entities/encuesta/service/encuesta.service.ts @@ -15,6 +15,7 @@ export type EntityArrayResponseType = HttpResponse; @Injectable({ providedIn: 'root' }) export class EncuestaService { protected resourceUrl = this.applicationConfigService.getEndpointFor('api/encuestas'); + protected resourceUrlPublish = this.applicationConfigService.getEndpointFor('api/encuestas/publish'); constructor(protected http: HttpClient, protected applicationConfigService: ApplicationConfigService) {} @@ -28,7 +29,14 @@ export class EncuestaService { update(encuesta: IEncuesta): Observable { const copy = this.convertDateFromClient(encuesta); return this.http - .put(`${this.resourceUrl}/${getEncuestaIdentifier(encuesta) as number}`, copy, { observe: 'response' }) + .put(`${this.resourceUrlPublish}/${getEncuestaIdentifier(encuesta) as number}`, copy, { observe: 'response' }) + .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res))); + } + + updateSurvey(encuesta: IEncuesta): Observable { + const copy = this.convertDateFromClient(encuesta); + return this.http + .put(`${this.resourceUrl}/update/${getEncuestaIdentifier(encuesta) as number}`, copy, { observe: 'response' }) .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res))); } diff --git a/src/main/webapp/app/entities/encuesta/update/encuesta-update.component.html b/src/main/webapp/app/entities/encuesta/update/encuesta-update.component.html index bc0f16b..2858a9a 100644 --- a/src/main/webapp/app/entities/encuesta/update/encuesta-update.component.html +++ b/src/main/webapp/app/entities/encuesta/update/encuesta-update.component.html @@ -1,7 +1,9 @@

    -

    {{ encuesta!.nombre }}

    +

    + {{ encuesta!.nombre }} +

          +
    +
    +
    +
    +
    + +
    +
    +
    + {{ colaborador.usuarioExtra.nombre }} +
    +
    +
    +

    Creada el día {{ encuesta!.fechaCreacion | formatShortDatetime | lowercase }}

    @@ -66,7 +93,18 @@ class="ds-survey--question" >
    - {{ i + 1 }}. {{ ePregunta.nombre }} + + {{ i + 1 }}.  + {{ ePregunta.nombre }} +

    @@ -25,14 +25,13 @@
    - No plantillas found + No templates found
    - @@ -45,9 +44,6 @@ - @@ -64,7 +60,7 @@ - diff --git a/src/main/webapp/app/entities/plantilla/list/plantilla.component.ts b/src/main/webapp/app/entities/plantilla/list/plantilla.component.ts index 21ab70f..1c1e111 100644 --- a/src/main/webapp/app/entities/plantilla/list/plantilla.component.ts +++ b/src/main/webapp/app/entities/plantilla/list/plantilla.component.ts @@ -34,7 +34,7 @@ export class PlantillaComponent implements OnInit { this.loadAll(); } - trackId(index: number, item: IPlantilla): number { + trackId(_index: number, item: IPlantilla): number { return item.id!; } diff --git a/src/main/webapp/app/entities/usuario-encuesta/service/usuario-encuesta.service.ts b/src/main/webapp/app/entities/usuario-encuesta/service/usuario-encuesta.service.ts index aefe0b9..dd7aee7 100644 --- a/src/main/webapp/app/entities/usuario-encuesta/service/usuario-encuesta.service.ts +++ b/src/main/webapp/app/entities/usuario-encuesta/service/usuario-encuesta.service.ts @@ -27,8 +27,9 @@ export class UsuarioEncuestaService { update(usuarioEncuesta: IUsuarioEncuesta): Observable { const copy = this.convertDateFromClient(usuarioEncuesta); + const url = `${this.resourceUrl}/${getUsuarioEncuestaIdentifier(usuarioEncuesta) as number}`; return this.http - .put(`${this.resourceUrl}/${getUsuarioEncuestaIdentifier(usuarioEncuesta) as number}`, copy, { + .put(url, copy, { observe: 'response', }) .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res))); @@ -36,8 +37,9 @@ export class UsuarioEncuestaService { partialUpdate(usuarioEncuesta: IUsuarioEncuesta): Observable { const copy = this.convertDateFromClient(usuarioEncuesta); + const url = `${this.resourceUrl}/${getUsuarioEncuestaIdentifier(usuarioEncuesta) as number}`; return this.http - .patch(`${this.resourceUrl}/${getUsuarioEncuestaIdentifier(usuarioEncuesta) as number}`, copy, { + .patch(url, copy, { observe: 'response', }) .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res))); @@ -49,6 +51,12 @@ export class UsuarioEncuestaService { .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res))); } + findCollaborators(id: number): Observable { + return this.http + .get(`${this.resourceUrl}/encuesta/${id}`, { observe: 'response' }) + .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res))); + } + query(req?: any): Observable { const options = createRequestOption(req); return this.http diff --git a/src/main/webapp/app/entities/usuario-extra/list/usuario-extra.component.html b/src/main/webapp/app/entities/usuario-extra/list/usuario-extra.component.html index a5894cb..313c27a 100644 --- a/src/main/webapp/app/entities/usuario-extra/list/usuario-extra.component.html +++ b/src/main/webapp/app/entities/usuario-extra/list/usuario-extra.component.html @@ -87,14 +87,14 @@ -->
    ID Nombre Descripcion Fecha Creacion
    - {{ plantilla.id }} - {{ plantilla.nombre }} {{ plantilla.descripcion }} {{ plantilla.fechaCreacion | formatMediumDatetime }}
    - + --> - +
    @@ -36,7 +36,7 @@
    @@ -98,12 +98,10 @@

    Encuestas

    -
    +
    + +
    {{ encuesta.nombre }}
    @@ -116,14 +114,14 @@
    Fecha Publicada    {{ + >Fecha de inicio    {{ encuesta.fechaPublicacion | formatShortDatetime | titlecase }}
    Fecha de Finalización   Fecha de finalización     {{ encuesta.fechaFinalizar | formatShortDatetime | titlecase }}
    diff --git a/src/main/webapp/app/layouts/footer/footer.component.html b/src/main/webapp/app/layouts/footer/footer.component.html index f5fbd22..3e9b625 100644 --- a/src/main/webapp/app/layouts/footer/footer.component.html +++ b/src/main/webapp/app/layouts/footer/footer.component.html @@ -1,4 +1,4 @@ -