Merge pull request #110 from Quantum-P3/feature/US-28

Feature/us 28
This commit is contained in:
Eduardo Quiros 2021-08-11 18:12:43 +00:00 committed by GitHub
commit a9bee3af53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 160 additions and 53 deletions

38
package-lock.json generated
View File

@ -284,6 +284,23 @@
"@typescript-eslint/experimental-utils": "4.23.0"
}
},
"@angular/cdk": {
"version": "12.1.4",
"resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-12.1.4.tgz",
"integrity": "sha512-so8HP7jRNkGfdTkPmFVqyW4pj1vU0ASG1NaZMDXnin44PVjbJpaKhQsArhQ/yOmRP9XzP6TR3zHzmxszfGiaKg==",
"requires": {
"parse5": "^5.0.0",
"tslib": "^2.2.0"
},
"dependencies": {
"parse5": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz",
"integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==",
"optional": true
}
}
},
"@angular/cli": {
"version": "12.0.4",
"resolved": "https://registry.npmjs.org/@angular/cli/-/cli-12.0.4.tgz",
@ -1848,6 +1865,14 @@
"@fortawesome/fontawesome-common-types": "^0.2.35"
}
},
"@fortawesome/free-brands-svg-icons": {
"version": "5.15.3",
"resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-5.15.3.tgz",
"integrity": "sha512-1hirPcbjj72ZJtFvdnXGPbAbpn3Ox6mH3g5STbANFp3vGSiE5u5ingAKV06mK6ZVqNYxUPlh4DlTnaIvLtF2kw==",
"requires": {
"@fortawesome/fontawesome-common-types": "^0.2.35"
}
},
"@fortawesome/free-solid-svg-icons": {
"version": "5.15.3",
"resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.15.3.tgz",
@ -11967,6 +11992,11 @@
"integrity": "sha512-K2MLc+ZC2DVxX4V61bIKPeMUUfj1YYZ3h0myhchDXOW1cKoPZMnjIoNCqv9bF2n5Oob1PFxuR2gVJxkxz4e58w==",
"dev": true
},
"jw-angular-social-buttons": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/jw-angular-social-buttons/-/jw-angular-social-buttons-1.0.0.tgz",
"integrity": "sha512-E1xxsZBj0+DzJC7iPrwqq08UnfMbYuUHibMt5ijSqrR2LyBKmrZIlRM+8I+4e3m0bNNt1nwBbXcKlY6DsvOCOQ=="
},
"karma-source-map-support": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/karma-source-map-support/-/karma-source-map-support-1.4.0.tgz",
@ -13081,6 +13111,14 @@
"tslib": "^2.2.0"
}
},
"ngx-sharebuttons": {
"version": "8.0.5",
"resolved": "https://registry.npmjs.org/ngx-sharebuttons/-/ngx-sharebuttons-8.0.5.tgz",
"integrity": "sha512-LAaZQk1i/yuYkX+SK72OkJBMNmGJ7SS/yoGEIyuUd7r9F9SwLpWfUAjccmtuM0qDzd48h+1CCnPGIB6WYlKY4g==",
"requires": {
"tslib": "^2.0.0"
}
},
"ngx-webstorage": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/ngx-webstorage/-/ngx-webstorage-8.0.0.tgz",

View File

@ -58,7 +58,8 @@
"preci:e2e:server:start": "npm run docker:db:await --if-present && npm run docker:others:await --if-present",
"ci:e2e:server:start": "java -jar target/e2e.$npm_package_config_packaging --spring.profiles.active=$npm_package_config_default_environment -Dlogging.level.ROOT=OFF -Dlogging.level.org.zalando=OFF -Dlogging.level.tech.jhipster=OFF -Dlogging.level.org.datasurvey=OFF -Dlogging.level.org.springframework=OFF -Dlogging.level.org.springframework.web=OFF -Dlogging.level.org.springframework.security=OFF --logging.level.org.springframework.web=ERROR",
"ci:frontend:build": "npm run webapp:build:$npm_package_config_default_environment",
"ci:frontend:test": "npm run ci:frontend:build && npm test"
"ci:frontend:test": "npm run ci:frontend:build && npm test",
"postinstall": "ngcc"
},
"config": {
"backend_port": 8080,
@ -66,6 +67,7 @@
"packaging": "jar"
},
"dependencies": {
"@angular/cdk": "^12.1.4",
"@angular/common": "12.0.5",
"@angular/compiler": "12.0.5",
"@angular/core": "12.0.5",
@ -74,9 +76,10 @@
"@angular/platform-browser": "12.0.5",
"@angular/platform-browser-dynamic": "12.0.5",
"@angular/router": "12.0.5",
"@fortawesome/angular-fontawesome": "0.9.0",
"@fortawesome/fontawesome-svg-core": "1.2.35",
"@fortawesome/free-solid-svg-icons": "5.15.3",
"@fortawesome/angular-fontawesome": "^0.9.0",
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-brands-svg-icons": "^5.15.3",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@ng-bootstrap/ng-bootstrap": "9.1.3",
"@ngx-translate/core": "13.0.0",
"@ngx-translate/http-loader": "6.0.0",
@ -85,8 +88,10 @@
"bootstrap": "4.6.0",
"dayjs": "1.10.5",
"jquery": "^3.6.0",
"jw-angular-social-buttons": "^1.0.0",
"ngx-infinite-scroll": "10.0.1",
"ngx-paypal": "^8.0.0",
"ngx-sharebuttons": "^8.0.5",
"ngx-webstorage": "8.0.0",
"rxjs": "6.6.7",
"sockjs-client": "1.5.0",

View File

@ -32,12 +32,13 @@ 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';
import { ListarTiendaPlantillaComponent } from './entities/tienda/listar-tienda-plantilla/listar-tienda-plantilla.component';
import { ListarPlantillaTiendaModule } from './entities/tienda/listar-tienda-plantilla/listar-plantilla-tienda.module';
import { PaypalDialogComponent } from './entities/tienda/paypal-dialog/paypal-dialog.component';
import { NgxPayPalModule } from 'ngx-paypal';
import { ShareButtonsModule } from 'ngx-sharebuttons/buttons';
import { ShareIconsModule } from 'ngx-sharebuttons/icons';
@NgModule({
imports: [
NgxWebstorageModule.forRoot(),
@ -65,6 +66,8 @@ import { NgxPayPalModule } from 'ngx-paypal';
useFactory: missingTranslationHandler,
},
}),
ShareButtonsModule,
ShareIconsModule,
NgxPayPalModule,
],
providers: [

View File

@ -1 +1,39 @@
<p>encuesta-compartir-dialog works!</p>
<form class="ds-form" name="deleteForm">
<div class="modal-header">
<h2 class="ds-title" data-cy="encuestaDeleteDialogHeading">Compartir encuesta</h2>
</div>
<div class="modal-body">
<p class="ds-subtitle" id="jhi-delete-encuesta-heading">Puede copiar el enlace o compartirlo en redes sociales</p>
<hr />
<input class="compartir" readonly type="url" id="inputCompartir" [value]="baseURL" /> <br /><br />
<share-buttons
[theme]="'material-dark'"
[include]="['facebook', 'twitter', 'email']"
[show]="5"
[showText]="true"
[size]="1"
[url]="baseURL"
[title]="'Encuesta DataSurvey'"
[image]="'../../../content/img_datasurvey/datasurvey-logo-text-white-PNG.png'"
[autoSetMeta]="false"
></share-buttons>
<!-- <share-buttons [theme]="'modern-dark'"
[include]="['facebook','twitter']"
[show]="5"
[showText]="true"
[size]="2"
[url]="baseURL"
[title]="'Encuesta DataSurvey'"
[autoSetMeta]="false"
></share-buttons>-->
</div>
<div class="modal-footer">
<button type="button" class="ds-btn ds-btn--secondary" data-dismiss="modal" (click)="cancel()">
<fa-icon icon="arrow-left"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
</button>
</div>
</form>

View File

@ -0,0 +1,7 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500&display=swap');
@import '~ngx-sharebuttons/themes/default/default-theme';
.compartir {
width: 100% !important;
}

View File

@ -1,24 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { EncuestaCompartirDialogComponent } from './encuesta-compartir-dialog.component';
describe('EncuestaCompartirDialogComponent', () => {
let component: EncuestaCompartirDialogComponent;
let fixture: ComponentFixture<EncuestaCompartirDialogComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [EncuestaCompartirDialogComponent],
}).compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(EncuestaCompartirDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -1,4 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { IEncuesta } from '../encuesta.model';
@Component({
selector: 'jhi-encuesta-compartir-dialog',
@ -6,7 +8,21 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./encuesta-compartir-dialog.component.scss'],
})
export class EncuestaCompartirDialogComponent implements OnInit {
constructor() {}
encuesta?: IEncuesta;
baseURL: string = '';
imagen: string = '';
mensaje: string = 'Encuesta en DatasSurvey';
name = 'ngx sharebuttons';
ngOnInit(): void {}
constructor(protected activeModal: NgbActiveModal) {}
ngOnInit(): void {
this.baseURL = location.origin + '/' + this.encuesta?.id + '/complete';
}
compartir(): void {}
cancel(): void {
this.activeModal.dismiss();
}
}

View File

@ -1,6 +1,6 @@
<form *ngIf="encuesta" name="deleteForm" (ngSubmit)="confirmPublish(encuesta!)">
<div class="modal-header">
<!-- <h4 class="modal-title" data-cy="encuestaDeleteDialogHeading" jhiTranslate="entity.publish.title">Confirm delete operation</h4>-->
<h4 class="modal-title" data-cy="encuestaDeleteDialogHeading">Publique su encuesta</h4>
</div>
<div class="modal-body">
@ -48,13 +48,7 @@
<fa-icon icon="arrow-left"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
</button>
<button
[disabled]="fechaForm.invalid"
id="jhi-confirm-delete-encuesta"
data-cy="entityConfirmDeleteButton"
type="submit"
class="ds-btn ds-btn--primary"
>
<button id="jhi-confirm-delete-encuesta" data-cy="entityConfirmDeleteButton" type="submit" class="ds-btn ds-btn--primary">
&nbsp;<span jhiTranslate="entity.action.publish">Delete</span>
</button>
</div>

View File

@ -10,13 +10,14 @@ import { EncuestaPublishDialogComponent } from './encuesta-publish-dialog/encues
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';
import { ShareButtonsModule } from 'ngx-sharebuttons/buttons';
import { EncuestaCompleteComponent } from './complete/complete.component';
import { EncuestaPasswordDialogComponent } from './encuesta-password-dialog/encuesta-password-dialog.component';
import { EncuestaFinalizarDialogComponent } from './encuesta-finalizar-dialog/encuesta-finalizar-dialog.component';
import { EncuestaDeleteColaboratorDialogComponent } from './encuesta-delete-colaborator-dialog/encuesta-delete-colaborator-dialog.component';
@NgModule({
imports: [SharedModule, EncuestaRoutingModule, FontAwesomeModule],
imports: [SharedModule, EncuestaRoutingModule, FontAwesomeModule, ShareButtonsModule],
declarations: [
EncuestaComponent,
EncuestaDetailComponent,

View File

@ -120,9 +120,11 @@
<fa-icon class="contextmenu__icon" [icon]="faUpload"></fa-icon>Publicar
</button>
</li>
<!-- <li>
<button type="button" id="contextmenu-share"><fa-icon class="contextmenu__icon" [icon]="faShareAlt"></fa-icon>Compartir</button>
</li> -->
<li>
<button type="button" id="contextmenu-share" (click)="compartir()">
<fa-icon class="contextmenu__icon" [icon]="faShareAlt"></fa-icon>Compartir
</button>
</li>
</div>
<div class="ds-contextmenu__divider" id="contextmenu-delete--separator">
<li>
@ -175,9 +177,11 @@
style="animation-delay: 3s"
></div>
</div>
<div class="entity-share">
<span><fa-icon [icon]="faShareAlt"></fa-icon></span>
</div>
<!-- <div class="entity-share" *ngIf="encuesta.estado == 'ACTIVE'">
<button type="button" id="contextmenu-share" (click)="compartir()">
<fa-icon class="contextmenu__icon" [icon]="faShareAlt"></fa-icon>
</button>
</div>-->
</div>
<div class="entity-body">

View File

@ -41,6 +41,7 @@ import {
} from '@fortawesome/free-solid-svg-icons';
import * as $ from 'jquery';
import { EncuestaCompartirDialogComponent } from '../encuesta-compartir-dialog/encuesta-compartir-dialog.component';
@Component({
selector: 'jhi-encuesta',
@ -491,12 +492,18 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
document.getElementById('contextmenu-edit')!.style.display = 'block';
document.getElementById('contextmenu-publish')!.style.display = 'block';
document.getElementById('contextmenu-duplicate')!.style.display = 'block';
document.getElementById('contextmenu-share')!.style.display = 'none';
} else {
document.getElementById('contextmenu-edit')!.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';
if (this.selectedSurvey!.estado === 'FINISHED') {
document.getElementById('contextmenu-share')!.style.display = 'none';
}
document.getElementById('contextmenu-create--separator')!.style.display = 'none';
}
@ -548,4 +555,16 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
categoria: this.selectedSurvey!.categoria,
});
}
compartir(): void {
const modalRef = this.modalService.open(EncuestaCompartirDialogComponent, { size: 'lg', backdrop: 'static' });
modalRef.componentInstance.encuesta = this.selectedSurvey;
// unsubscribe not needed because closed completes on modal close
modalRef.closed.subscribe(reason => {
if (reason === 'published') {
this.successPublished = true;
this.loadAll();
}
});
}
}

View File

@ -3,7 +3,7 @@
<div class="container-fluid navbar navbar-marketing navbar-expand-lg bg-white navbar-light">
<div class="container px-5 py-4">
<a class="text-dark" routerLink="login"
><img src="http://datasurvey.org/content/img_datasurvey/datasurvey-logo-text-black.svg" width="300" alt=""
><img src="src/main/webapp/content/img_datasurvey/datasurvey-logo-text-black.svg" width="300" alt=""
/></a>
<div class="col-6" style="text-align: end">

View File

@ -4,7 +4,7 @@
<div class="container px-5 py-4">
<h1 class="ds-title" [hidden]="notAccount">Inicio</h1>
<a class="text-dark" href=" " [hidden]="!notAccount">
<img src="http://datasurvey.org/content/img_datasurvey/datasurvey-logo-text-black.svg" width="300" alt="" />
<img src="src/main/webapp/content/img_datasurvey/datasurvey-logo-text-black.svg" width="300" alt="" />
</a>
<a href=" ">

View File

@ -2,6 +2,8 @@
@import '~bootstrap/scss/functions';
@import '~bootstrap/scss/variables';
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500&display=swap');
/* ==============================================================
Bootstrap tweaks
===============================================================*/

View File

@ -102,4 +102,8 @@
@import 'paper-dashboard/datasurvey-home';
@import 'paper-dashboard/datasurvey-filter';
@import 'paper-dashboard/datasurvey-survey';
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500&display=swap');
@import '~ngx-sharebuttons/themes/material/material-dark-theme';
@import '~ngx-sharebuttons/themes/modern/modern-light-theme';
@import '~ngx-sharebuttons/themes/circles/circles-dark-theme';
@import 'paper-dashboard/datasurvey-switch';

View File

@ -142,7 +142,7 @@
"status": "Confirmar cambio de estado"
},
"validation": {
"required": "Este campo es obligatorio.",
"required": "Este campo es obligatorio",
"minlength": "Este campo requiere al menos {{min}} caracteres.",
"maxlength": "Este campo no puede superar más de {{max}} caracteres.",
"min": "Este campo debe ser mayor que {{min}}.",
@ -153,7 +153,7 @@
"number": "Este campo debe ser un número.",
"integerNumber": "Este campo debe ser un número entero.",
"datetimelocal": "Este campo debe ser una fecha y hora.",
"minoigual": "Este campo debe ser mayor o igual que 0."
"minoigual": "Este campo debe ser mayor o igual que 0"
},
"publish": {
"title": "Publicar encuesta",