tienda de plantillas y boton paypal
This commit is contained in:
parent
e3852a7c72
commit
e2fbc4a607
File diff suppressed because it is too large
Load Diff
|
@ -86,6 +86,7 @@
|
|||
"dayjs": "1.10.5",
|
||||
"jquery": "^3.6.0",
|
||||
"ngx-infinite-scroll": "10.0.1",
|
||||
"ngx-paypal": "^8.0.0",
|
||||
"ngx-webstorage": "8.0.0",
|
||||
"rxjs": "6.6.7",
|
||||
"sockjs-client": "1.5.0",
|
||||
|
|
|
@ -33,6 +33,10 @@ 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';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -41,6 +45,7 @@ import { PaginaPrincipalComponent } from './pagina-principal/pagina-principal.co
|
|||
SharedModule,
|
||||
HomeModule,
|
||||
PaginaPrincipalModule,
|
||||
ListarPlantillaTiendaModule,
|
||||
// jhipster-needle-angular-add-module JHipster will add new module here
|
||||
EntityRoutingModule,
|
||||
AppRoutingModule,
|
||||
|
@ -60,6 +65,7 @@ import { PaginaPrincipalComponent } from './pagina-principal/pagina-principal.co
|
|||
useFactory: missingTranslationHandler,
|
||||
},
|
||||
}),
|
||||
NgxPayPalModule,
|
||||
],
|
||||
providers: [
|
||||
Title,
|
||||
|
@ -79,7 +85,15 @@ import { PaginaPrincipalComponent } from './pagina-principal/pagina-principal.co
|
|||
} as SocialAuthServiceConfig,
|
||||
},
|
||||
],
|
||||
declarations: [MainComponent, NavbarComponent, ErrorComponent, PageRibbonComponent, FooterComponent, SidebarComponent],
|
||||
declarations: [
|
||||
MainComponent,
|
||||
NavbarComponent,
|
||||
ErrorComponent,
|
||||
PageRibbonComponent,
|
||||
FooterComponent,
|
||||
SidebarComponent,
|
||||
PaypalDialogComponent,
|
||||
],
|
||||
bootstrap: [MainComponent],
|
||||
})
|
||||
export class AppModule {
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { SharedModule } from 'app/shared/shared.module';
|
||||
import { TIENDA_PLANTILLA_ROUTE } from './listar-tienda-plantilla.route';
|
||||
import { ListarTiendaPlantillaComponent } from './listar-tienda-plantilla.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [SharedModule, RouterModule.forChild([TIENDA_PLANTILLA_ROUTE])],
|
||||
declarations: [ListarTiendaPlantillaComponent],
|
||||
})
|
||||
export class ListarPlantillaTiendaModule {}
|
|
@ -0,0 +1,88 @@
|
|||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="page-header-ui page-header-ui-dark bg-img-cover overlay">
|
||||
<div class="container px-0 text-black">
|
||||
<h1 class="page-header-ui-title">¡Compre y utilice las plantillas!</h1>
|
||||
|
||||
<h2>Puede comprar sus plantillas mediante <b> PayPal </b> <fa-icon [icon]="faCreditCard"></fa-icon></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-light py-10 container-encuestas">
|
||||
<div class="container px-0">
|
||||
<!--filtrado-->
|
||||
|
||||
<div class="input-group">
|
||||
<div class="ds-filter">
|
||||
<div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
|
||||
<input class="form-control" type="text" name="searchString" placeholder="Buscar por nombre..." [(ngModel)]="searchString" />
|
||||
</div>
|
||||
<div class="ds-filter">
|
||||
<select name="searchCategoria" class="form-control" [(ngModel)]="searchCategoria" style="width: 200px">
|
||||
<option value="" selected="selected" disabled="disabled">Filtrar por categoría</option>
|
||||
<option value="">Todas las categorías</option>
|
||||
<option *ngFor="let categoria of categorias" [value]="categoria.nombre">{{ categoria.nombre }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="container" *ngIf="plantillas && plantillas.length == 0">
|
||||
<h1 class="ds-title">Plantillas</h1>
|
||||
|
||||
<hr />
|
||||
<div class="social-box">
|
||||
<h1>
|
||||
<fa-icon [icon]="faFileAlt"></fa-icon>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--Inicio de los cards-->
|
||||
|
||||
<div class="row gx-5" *ngIf="plantillas && plantillas.length > 0">
|
||||
<div
|
||||
class="col-xl-4 col-lg-4 col-md-6 mb-5"
|
||||
*ngFor="
|
||||
let plantilla of plantillas | filter: 'nombre':searchString | filter: 'categoria.nombre':searchCategoria;
|
||||
trackBy: trackId
|
||||
"
|
||||
>
|
||||
<div class="card-encuesta lift h-100" [attr.data-id]="plantilla.id">
|
||||
<!--(dblclick)="openSurvey($event)"
|
||||
(click)="selectSurvey($event)"
|
||||
|
||||
-->
|
||||
<div class="card-body p-3">
|
||||
<div class="card-title mb-0">{{ plantilla.nombre }}</div>
|
||||
<div class="entity-body--row m-2">
|
||||
<span class="tag mt-2" *ngIf="plantilla.precio">Precio: {{ plantilla.precio | currency }}</span>
|
||||
<span class="tag mt-2" *ngIf="plantilla.precio == 0 || plantilla.precio == null">Precio: GRATIS</span>
|
||||
</div>
|
||||
|
||||
<div class="entity-body--row m-2" *ngIf="plantilla.categoria != null">
|
||||
<span class="mt-2">{{ plantilla.categoria.nombre | lowercase }}</span>
|
||||
</div>
|
||||
<div class="entity-body--row m-2" *ngIf="plantilla.descripcion != null">
|
||||
<span class="mt-2">{{ plantilla.descripcion | lowercase }}</span>
|
||||
</div>
|
||||
<div class="text-xs text-gray-500">
|
||||
<div class="entity-body">
|
||||
<div class="entity-body--row m-2">
|
||||
<button class="ds-btn btn-outline-success btn-card" (click)="triggerPaypalDialog(plantilla)">
|
||||
<fa-icon [icon]="faCreditCard"></fa-icon> Comprar con PayPal
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--Inicio de cards-->
|
||||
</div>
|
|
@ -0,0 +1,449 @@
|
|||
/* ==========================================================================
|
||||
Main page styles
|
||||
========================================================================== */
|
||||
|
||||
.hipster {
|
||||
display: inline-block;
|
||||
width: 347px;
|
||||
height: 497px;
|
||||
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
.bg-img-cover {
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
background-color: #192e4d;
|
||||
}
|
||||
/*SPLIT CSS*/
|
||||
.split {
|
||||
height: 90%;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
overflow-x: hidden;
|
||||
padding-top: 20px;
|
||||
}
|
||||
.left {
|
||||
left: 0;
|
||||
background-color: #192e4d;
|
||||
}
|
||||
|
||||
.right {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.centered {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.bg-img-style {
|
||||
padding-top: 2px;
|
||||
margin-left: 50%;
|
||||
margin-top: 0;
|
||||
width: 400px;
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
.overlay {
|
||||
position: relative;
|
||||
}
|
||||
.overlay:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #000;
|
||||
opacity: 0.1;
|
||||
}
|
||||
|
||||
.overlay-10:before {
|
||||
opacity: 0.1;
|
||||
}
|
||||
|
||||
.overlay-20:before {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.overlay-30:before {
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.overlay-40:before {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.overlay-50:before {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.overlay-60:before {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.overlay-70:before {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.overlay-80:before {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.overlay-90:before {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.fixed-top,
|
||||
.page-header-ui.navbar-fixed .navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 1030;
|
||||
}
|
||||
|
||||
.text-white-75,
|
||||
.page-header-ui-dark .page-header-ui-text a {
|
||||
color: rgba(255, 255, 255, 0.75) !important;
|
||||
}
|
||||
.page-header-ui {
|
||||
position: relative;
|
||||
padding-top: 4%;
|
||||
padding-bottom: 4%;
|
||||
}
|
||||
.page-header-ui .page-header-ui-content .page-header-ui-title {
|
||||
font-size: 2.5rem;
|
||||
color: #000000;
|
||||
}
|
||||
.page-header-ui .page-header-ui-content .page-header-ui-text {
|
||||
font-size: 1.15rem;
|
||||
}
|
||||
.page-header-ui .page-header-ui-content .page-header-ui-text.small {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.page-header-ui-dark {
|
||||
color: #fffcf5 !important;
|
||||
background-color: #212832;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
.svg-border-rounded svg {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 1rem;
|
||||
width: 100%;
|
||||
}
|
||||
@media (min-width: 576px) {
|
||||
.svg-border-rounded svg {
|
||||
height: 1.5rem;
|
||||
}
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.svg-border-rounded svg {
|
||||
height: 2rem;
|
||||
}
|
||||
}
|
||||
@media (min-width: 992px) {
|
||||
.svg-border-rounded svg {
|
||||
height: 2.5rem;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
.svg-border-rounded svg {
|
||||
height: 3rem;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Cards
|
||||
**/
|
||||
.lift {
|
||||
box-shadow: 0 0.15rem 1.75rem 0 rgba(33, 40, 50, 0.15);
|
||||
transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
||||
}
|
||||
.lift:hover {
|
||||
transform: translateY(-0.3333333333rem);
|
||||
box-shadow: 0 0.5rem 2rem 0 rgba(33, 40, 50, 0.25);
|
||||
}
|
||||
.lift:active {
|
||||
transform: none;
|
||||
box-shadow: 0 0.15rem 1.75rem 0 rgba(33, 40, 50, 0.15);
|
||||
}
|
||||
|
||||
.lift-sm {
|
||||
box-shadow: 0 0.125rem 0.25rem 0 rgba(33, 40, 50, 0.2);
|
||||
}
|
||||
.lift-sm:hover {
|
||||
transform: translateY(-0.1666666667rem);
|
||||
box-shadow: 0 0.25rem 1rem 0 rgba(33, 40, 50, 0.25);
|
||||
}
|
||||
.lift-sm:active {
|
||||
transform: none;
|
||||
box-shadow: 0 0.125rem 0.25rem 0 rgba(33, 40, 50, 0.2);
|
||||
}
|
||||
|
||||
/*.card.lift {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.card-flag {
|
||||
position: absolute;
|
||||
font-size: 0.7rem;
|
||||
padding: 0.3rem 0.5rem;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.card-flag-dark {
|
||||
background-color: rgba(33, 40, 50, 0.7);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.card-flag-light {
|
||||
background-color: rgba(255, 255, 255, 0.7);
|
||||
color: #69707a;
|
||||
}
|
||||
|
||||
.card-flag-lg {
|
||||
font-size: 0.9rem;
|
||||
padding: 0.5rem 0.65rem;
|
||||
}
|
||||
|
||||
.card-flag-top-right {
|
||||
border-top-left-radius: 0.25rem;
|
||||
border-bottom-left-radius: 0.25rem;
|
||||
top: 0.5rem;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.card-flag-top-left {
|
||||
border-top-right-radius: 0.25rem;
|
||||
border-bottom-right-radius: 0.25rem;
|
||||
top: 0.5rem;
|
||||
left: 0;
|
||||
}*/
|
||||
|
||||
.border-cyan {
|
||||
border-color: #00cfd5 !important;
|
||||
}
|
||||
|
||||
.py-10 {
|
||||
padding-top: 6rem !important;
|
||||
padding-bottom: 6rem !important;
|
||||
}
|
||||
|
||||
/* wait autoprefixer update to allow simple generation of high pixel density media query */
|
||||
@media only screen and (-webkit-min-device-pixel-ratio: 2),
|
||||
only screen and (-moz-min-device-pixel-ratio: 2),
|
||||
only screen and (-o-min-device-pixel-ratio: 2/1),
|
||||
only screen and (min-resolution: 192dpi),
|
||||
only screen and (min-resolution: 2dppx) {
|
||||
.hipster {
|
||||
background-size: contain;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-stack {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 100%;
|
||||
height: 2.5rem;
|
||||
width: 2.5rem;
|
||||
font-size: 1rem;
|
||||
background-color: #f2f6fc;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.icon-stack svg {
|
||||
height: 1rem;
|
||||
width: 1rem;
|
||||
}
|
||||
|
||||
.icon-stack-sm {
|
||||
height: 2rem;
|
||||
width: 2rem;
|
||||
}
|
||||
|
||||
.icon-stack-lg {
|
||||
height: 4rem;
|
||||
width: 4rem;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
.icon-stack-lg svg {
|
||||
height: 1.5rem;
|
||||
width: 1.5rem;
|
||||
}
|
||||
|
||||
.icon-stack-xl {
|
||||
height: 5rem;
|
||||
width: 5rem;
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
.icon-stack-xl svg {
|
||||
height: 1.75rem;
|
||||
width: 1.75rem;
|
||||
}
|
||||
|
||||
.container-encuestas {
|
||||
max-height: 1536px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.bg-gradient-primary-to-secondary {
|
||||
background-color: #1c44b2 !important;
|
||||
background-image: linear-gradient(135deg, #1c44b2 0%, #00b88d 100%) !important;
|
||||
}
|
||||
|
||||
/*.card .entity-icon--star {
|
||||
color: #ffcc47;
|
||||
margin-right: 0.2rem;
|
||||
}
|
||||
|
||||
.card .card-title {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
.card .tag {
|
||||
font-size: 0.8rem;
|
||||
color: #f8f8f8;
|
||||
margin-top: 0.5rem;
|
||||
padding: 0.2rem 1.5rem;
|
||||
background-color: #2962ff94;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.card .subtitle {
|
||||
color: rgba(0, 0, 0, 0.54);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.card .btn-card {
|
||||
padding: 11px 10px !important;
|
||||
}*/
|
||||
|
||||
.accordion-button {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding: 1rem 1.25rem;
|
||||
font-size: 1rem;
|
||||
color: #69707a;
|
||||
text-align: left;
|
||||
background-color: #fff;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
overflow-anchor: none;
|
||||
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out,
|
||||
border-radius 0.15s ease;
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.accordion-button {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
.accordion-button:not(.collapsed) {
|
||||
color: #0057da;
|
||||
background-color: #e6effe;
|
||||
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.125);
|
||||
}
|
||||
.accordion-button:not(.collapsed)::after {
|
||||
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230057da'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
|
||||
transform: rotate(-180deg);
|
||||
}
|
||||
.accordion-button::after {
|
||||
flex-shrink: 0;
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
margin-left: auto;
|
||||
content: '';
|
||||
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2369707a'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
|
||||
background-repeat: no-repeat;
|
||||
background-size: 1.25rem;
|
||||
transition: transform 0.2s ease-in-out;
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.accordion-button::after {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
.accordion-button:hover {
|
||||
z-index: 2;
|
||||
}
|
||||
.accordion-button:focus {
|
||||
z-index: 3;
|
||||
border-color: transparent;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.25rem #00b88d3a;
|
||||
}
|
||||
|
||||
.accordion-header {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.accordion-item {
|
||||
background-color: #fff;
|
||||
border: 1px solid rgba(0, 0, 0, 0.125);
|
||||
}
|
||||
.accordion-item:first-of-type {
|
||||
border-top-left-radius: 0.35rem;
|
||||
border-top-right-radius: 0.35rem;
|
||||
}
|
||||
.accordion-item:first-of-type .accordion-button {
|
||||
border-top-left-radius: calc(0.35rem - 1px);
|
||||
border-top-right-radius: calc(0.35rem - 1px);
|
||||
}
|
||||
.accordion-item:not(:first-of-type) {
|
||||
border-top: 0;
|
||||
}
|
||||
.accordion-item:last-of-type {
|
||||
border-bottom-right-radius: 0.35rem;
|
||||
border-bottom-left-radius: 0.35rem;
|
||||
}
|
||||
.accordion-item:last-of-type .accordion-button.collapsed {
|
||||
border-bottom-right-radius: calc(0.35rem - 1px);
|
||||
border-bottom-left-radius: calc(0.35rem - 1px);
|
||||
}
|
||||
.accordion-item:last-of-type .accordion-collapse {
|
||||
border-bottom-right-radius: 0.35rem;
|
||||
border-bottom-left-radius: 0.35rem;
|
||||
}
|
||||
|
||||
.accordion-body {
|
||||
padding: 1rem 1.25rem;
|
||||
}
|
||||
|
||||
.accordion-flush .accordion-collapse {
|
||||
border-width: 0;
|
||||
}
|
||||
.accordion-flush .accordion-item {
|
||||
border-right: 0;
|
||||
border-left: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
.accordion-flush .accordion-item:first-child {
|
||||
border-top: 0;
|
||||
}
|
||||
.accordion-flush .accordion-item:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
.accordion-flush .accordion-item .accordion-button {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.card-header .collapsed {
|
||||
background-color: #e6effe;
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ListarTiendaPlantillaComponent } from './listar-tienda-plantilla.component';
|
||||
|
||||
describe('ListarTiendaPlantillaComponent', () => {
|
||||
let component: ListarTiendaPlantillaComponent;
|
||||
let fixture: ComponentFixture<ListarTiendaPlantillaComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ListarTiendaPlantillaComponent],
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ListarTiendaPlantillaComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,129 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { ICategoria } from '../../categoria/categoria.model';
|
||||
import { Account } from '../../../core/auth/account.model';
|
||||
import { UsuarioExtra } from '../../usuario-extra/usuario-extra.model';
|
||||
import { IEncuesta } from '../../encuesta/encuesta.model';
|
||||
import { Subject } from 'rxjs';
|
||||
import { EncuestaService } from '../../encuesta/service/encuesta.service';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { CategoriaService } from '../../categoria/service/categoria.service';
|
||||
import { UsuarioExtraService } from '../../usuario-extra/service/usuario-extra.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { AccountService } from '../../../core/auth/account.service';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { HttpResponse } from '@angular/common/http';
|
||||
import { faPollH, faCalendarAlt, faStar, faListAlt, faFileAlt, faCreditCard } from '@fortawesome/free-solid-svg-icons';
|
||||
import { IPlantilla } from '../../plantilla/plantilla.model';
|
||||
import { PlantillaService } from '../../plantilla/service/plantilla.service';
|
||||
import { EncuestaPublishDialogComponent } from '../../encuesta/encuesta-publish-dialog/encuesta-publish-dialog.component';
|
||||
import { PaypalDialogComponent } from '../paypal-dialog/paypal-dialog.component';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-listar-tienda-plantilla',
|
||||
templateUrl: './listar-tienda-plantilla.component.html',
|
||||
styleUrls: ['./listar-tienda-plantilla.component.scss'],
|
||||
})
|
||||
export class ListarTiendaPlantillaComponent implements OnInit {
|
||||
public searchString: string;
|
||||
public searchCategoria: string;
|
||||
categorias?: ICategoria[];
|
||||
account: Account | null = null;
|
||||
public searchEncuestaPublica: string;
|
||||
notAccount: boolean = true;
|
||||
usuarioExtra: UsuarioExtra | null = null;
|
||||
plantillas?: IPlantilla[];
|
||||
successPayment = false;
|
||||
|
||||
isLoading = false;
|
||||
private readonly destroy$ = new Subject<void>();
|
||||
|
||||
faStar = faStar;
|
||||
faCalendarAlt = faCalendarAlt;
|
||||
faPollH = faPollH;
|
||||
faListAlt = faListAlt;
|
||||
faFileAlt = faFileAlt;
|
||||
faCreditCard = faCreditCard;
|
||||
|
||||
constructor(
|
||||
protected plantillaService: PlantillaService,
|
||||
protected modalService: NgbModal,
|
||||
protected categoriaService: CategoriaService,
|
||||
protected usuarioExtraService: UsuarioExtraService,
|
||||
protected activatedRoute: ActivatedRoute,
|
||||
protected fb: FormBuilder,
|
||||
protected accountService: AccountService,
|
||||
protected router: Router
|
||||
) {
|
||||
this.searchEncuestaPublica = '';
|
||||
this.searchString = '';
|
||||
this.searchCategoria = '';
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.searchEncuestaPublica = '';
|
||||
this.accountService
|
||||
.getAuthenticationState()
|
||||
.pipe(takeUntil(this.destroy$))
|
||||
.subscribe(account => {
|
||||
if (account !== null) {
|
||||
this.account = account;
|
||||
this.notAccount = false;
|
||||
} else {
|
||||
this.notAccount = true;
|
||||
}
|
||||
});
|
||||
this.loadAll();
|
||||
this.loadAllCategorias();
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.destroy$.next();
|
||||
this.destroy$.complete();
|
||||
}
|
||||
|
||||
loadAll(): void {
|
||||
this.isLoading = true;
|
||||
|
||||
this.plantillaService.query().subscribe(
|
||||
(res: HttpResponse<IPlantilla[]>) => {
|
||||
this.isLoading = false;
|
||||
const plantillasBody = res.body ?? [];
|
||||
this.plantillas = plantillasBody.filter(e => e.estado === 'ACTIVE');
|
||||
},
|
||||
() => {
|
||||
this.isLoading = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
loadAllCategorias(): void {
|
||||
this.isLoading = true;
|
||||
|
||||
this.categoriaService.query().subscribe(
|
||||
(res: HttpResponse<ICategoria[]>) => {
|
||||
this.isLoading = false;
|
||||
this.categorias = res.body ?? [];
|
||||
},
|
||||
() => {
|
||||
this.isLoading = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
trackId(index: number, item: IEncuesta): number {
|
||||
return item.id!;
|
||||
}
|
||||
|
||||
triggerPaypalDialog(plantilla: IPlantilla): void {
|
||||
const modalRef = this.modalService.open(PaypalDialogComponent, { size: 'lg', backdrop: 'static' });
|
||||
modalRef.componentInstance.plantilla = plantilla;
|
||||
// unsubscribe not needed because closed completes on modal close
|
||||
modalRef.closed.subscribe(reason => {
|
||||
if (reason === 'published') {
|
||||
this.successPayment = true;
|
||||
this.loadAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
import { Route, RouterModule } from '@angular/router';
|
||||
import { ListarTiendaPlantillaComponent } from './listar-tienda-plantilla.component';
|
||||
|
||||
export const TIENDA_PLANTILLA_ROUTE: Route = {
|
||||
path: 'tienda-plantilla',
|
||||
component: ListarTiendaPlantillaComponent,
|
||||
data: {
|
||||
pageTitle: 'tiendaPlantilla.title',
|
||||
},
|
||||
};
|
|
@ -0,0 +1,19 @@
|
|||
<form name="deleteForm">
|
||||
<div class="modal-header">
|
||||
<!-- <h4 class="modal-title" data-cy="encuestaDeleteDialogHeading" jhiTranslate="entity.publish.title">Confirm delete operation</h4>-->
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<ngx-paypal [config]="payPalConfig"></ngx-paypal>
|
||||
</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> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
</button>
|
||||
|
||||
<button id="jhi-confirm-delete-encuesta" data-cy="entityConfirmDeleteButton" type="submit" class="ds-btn ds-btn--primary">
|
||||
<span jhiTranslate="entity.action.publish">Delete</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
|
@ -0,0 +1,24 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PaypalDialogComponent } from './paypal-dialog.component';
|
||||
|
||||
describe('PaypalDialogComponent', () => {
|
||||
let component: PaypalDialogComponent;
|
||||
let fixture: ComponentFixture<PaypalDialogComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [PaypalDialogComponent],
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(PaypalDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,88 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { IPayPalConfig, ICreateOrderRequest } from 'ngx-paypal';
|
||||
import { ParametroAplicacionService } from '../../parametro-aplicacion/service/parametro-aplicacion.service';
|
||||
import { EncuestaService } from '../../encuesta/service/encuesta.service';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-paypal-dialog',
|
||||
templateUrl: './paypal-dialog.component.html',
|
||||
styleUrls: ['./paypal-dialog.component.scss'],
|
||||
})
|
||||
export class PaypalDialogComponent implements OnInit {
|
||||
public payPalConfig?: IPayPalConfig;
|
||||
showSuccess = false;
|
||||
|
||||
constructor(protected activeModal: NgbActiveModal) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.initConfig();
|
||||
}
|
||||
|
||||
private initConfig(): void {
|
||||
this.payPalConfig = {
|
||||
currency: 'USD',
|
||||
clientId: 'sb',
|
||||
createOrderOnClient: data =>
|
||||
<ICreateOrderRequest>{
|
||||
intent: 'CAPTURE',
|
||||
purchase_units: [
|
||||
{
|
||||
amount: {
|
||||
currency_code: 'EUR',
|
||||
value: '9.99',
|
||||
breakdown: {
|
||||
item_total: {
|
||||
currency_code: 'EUR',
|
||||
value: '9.99',
|
||||
},
|
||||
},
|
||||
},
|
||||
items: [
|
||||
{
|
||||
name: 'Enterprise Subscription',
|
||||
quantity: '1',
|
||||
category: 'DIGITAL_GOODS',
|
||||
unit_amount: {
|
||||
currency_code: 'EUR',
|
||||
value: '9.99',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
advanced: {
|
||||
commit: 'true',
|
||||
},
|
||||
style: {
|
||||
label: 'paypal',
|
||||
layout: 'vertical',
|
||||
},
|
||||
onApprove: (data, actions) => {
|
||||
console.log('onApprove - transaction was approved, but not authorized', data, actions);
|
||||
actions.order.get().then((details: any) => {
|
||||
console.log('onApprove - you can get full order details inside onApprove: ', details);
|
||||
});
|
||||
},
|
||||
onClientAuthorization: data => {
|
||||
console.log('onClientAuthorization - you should probably inform your server about completed transaction at this point', data);
|
||||
this.showSuccess = true;
|
||||
},
|
||||
onCancel: (data, actions) => {
|
||||
console.log('OnCancel', data, actions);
|
||||
},
|
||||
onError: err => {
|
||||
console.log('OnError', err);
|
||||
},
|
||||
onClick: (data, actions) => {
|
||||
console.log('onClick', data, actions);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
cancel(): void {
|
||||
this.activeModal.dismiss();
|
||||
}
|
||||
}
|
|
@ -21,6 +21,7 @@
|
|||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div *ngIf="isNotMobileMenu()">
|
||||
<form class="navbar-form navbar-left navbar-search-form" role="search">
|
||||
<div class="input-group">
|
||||
|
|
|
@ -64,6 +64,7 @@ export const USER_ROUTES: RouteInfo[] = [
|
|||
type: 'link',
|
||||
icontype: 'nc-icon nc-paper',
|
||||
},
|
||||
{ path: '/tienda-plantilla', title: 'Tienda', type: 'link', icontype: 'nc-icon nc-shop' },
|
||||
// {
|
||||
// path: '/tienda',
|
||||
// title: 'Tienda',
|
||||
|
@ -80,6 +81,6 @@ export const USER_ROUTES: RouteInfo[] = [
|
|||
path: '/colaboraciones',
|
||||
title: 'Colaboraciones',
|
||||
type: 'link',
|
||||
icontype: 'nc-icon nc-world-2',
|
||||
icontype: 'nc-icon nc-single-02',
|
||||
},
|
||||
];
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { SharedModule } from 'app/shared/shared.module';
|
||||
|
||||
import { PAGINA_PRINCIPAL_ROUTE } from './pagina-princial.route';
|
||||
import { PaginaPrincipalComponent } from './pagina-principal.component';
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
After Width: | Height: | Size: 7.0 KiB |
Loading…
Reference in New Issue