Skip to content

Commit

Permalink
Merge pull request #144 from rpuigm/feature/DevcontainerChanges
Browse files Browse the repository at this point in the history
Feature/devcontainer changes
  • Loading branch information
rpuigm authored Feb 10, 2024
2 parents 7d161c5 + 4cd35f7 commit 0167641
Show file tree
Hide file tree
Showing 20 changed files with 129 additions and 83 deletions.
12 changes: 11 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"forwardPorts": [4200, 8090 ,5432],
"features": {
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers-contrib/features/angular-cli:2": {}

},
//"customizations": {
//"vscode": {
//"extensions": [
//"vscjava.vscode-java-pack"
// Puedes añadir más extensiones si es necesario, separándolas por comas
// ]
//}
//}

}

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -54,7 +54,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -68,4 +68,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
28 changes: 28 additions & 0 deletions clientes-app/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,28 @@
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
},
"codespace": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.codespace.ts"
}
]
},
"staging": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
Expand All @@ -75,6 +97,12 @@
},
"development": {
"browserTarget": "clientes-app:build:development"
},
"codespace": {
"browserTarget": "clientes-app:build:codespace"
},
"staging": {
"browserTarget": "clientes-app:build:staging"
}
},
"defaultConfiguration": "development"
Expand Down
4 changes: 2 additions & 2 deletions clientes-app/src/app/altapersona/altapersona.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AltaPersona } from './altapersona.model';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable, OnInit } from "@angular/core";
import { Observable } from "rxjs";
import { Usuario } from "../login/usuario.model";
import { AltaPersona } from './altapersona.model';

@Injectable({
providedIn: "root"
Expand All @@ -11,7 +11,7 @@ export class AltaPersonaService implements OnInit{

private altaPersona: AltaPersona;
private httpHeaders = new HttpHeaders({ 'Content-Type': 'application/json' });
private urlAltaCliente="http://localhost:8090/api/personas/crea-cliente"
private urlAltaCliente="http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/personas/crea-cliente"

constructor(private httpClient: HttpClient){}
ngOnInit(): void {
Expand Down
8 changes: 7 additions & 1 deletion clientes-app/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import { Component } from '@angular/core';
import { environment } from './../environments/environment';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
constructor() {
console.log(environment.production);
console.log(environment.backEndURL);

}

title = 'EN CONSTRUCCIÓN';

nombre_tienda: string = 'CHRISTMASZOM'
autor: string = 'Rubén Puig Moreno'
}
18 changes: 9 additions & 9 deletions clientes-app/src/app/cesta/cesta.component.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { ProductoCantidad } from './productoCantidad.model';
import { ProductosPedido } from './../pedido/ProductosPedido';
import { ProductoService } from './../producto/producto.service';
import { PersonaServices } from './../persona/persona.service';
import { CestaService } from './cesta.service';
import { ActivatedRoute, Router } from '@angular/router';
import { Component, OnInit } from '@angular/core';
import { Cesta } from './cesta.model';
import { Producto } from '../producto/producto.model';
import { ActivatedRoute, Router } from '@angular/router';
import { Pedido } from '../pedido/pedido.model';
import { PedidoService } from '../pedido/pedido.service';
import { Producto } from '../producto/producto.model';
import { ProductosPedido } from './../pedido/ProductosPedido';
import { PersonaServices } from './../persona/persona.service';
import { ProductoService } from './../producto/producto.service';
import { Cesta } from './cesta.model';
import { CestaService } from './cesta.service';
import { ProductoCantidad } from './productoCantidad.model';

@Component({
selector: 'app-cesta',
Expand Down Expand Up @@ -58,7 +58,7 @@ export class CestaComponent implements OnInit {
this.total +
producto.precio * this.cesta.productoCantidad[index].cantidad;
producto.productoCaracteristicas.imagenesProducto[0].imagen =
'http://localhost:8090/api/productos/producto/imagen/' +
'http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/productos/producto/imagen/' +
item.productoCaracteristicas?.imagenesProducto[0]?.imagen;
this.productos.push(item);
console.log('itemnombre ' + item.nombre);
Expand Down
18 changes: 9 additions & 9 deletions clientes-app/src/app/cesta/cesta.service.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { ProductoCantidad } from './productoCantidad.model';
import { ProductoService } from './../producto/producto.service';
import { PersonaServices } from './../persona/persona.service';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable, throwError } from 'rxjs';
import { Injectable, OnInit } from '@angular/core';
import { Cesta } from './cesta.model';
import { catchError, map } from 'rxjs/operators';
import { Observable, throwError } from 'rxjs';
import { catchError } from 'rxjs/operators';
import swal from 'sweetalert2';
import { PersonaServices } from './../persona/persona.service';
import { ProductoService } from './../producto/producto.service';
import { Cesta } from './cesta.model';
import { ProductoCantidad } from './productoCantidad.model';

@Injectable({
providedIn: 'root',
})
export class CestaService implements OnInit {
private httpHeaders = new HttpHeaders({ 'Content-Type': 'application/json' });
private urlRecuperaCesta: string =
'http://localhost:8090/api/productos/cesta/recupera-cesta';
'http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/productos/cesta/recupera-cesta';
private urlIncluye: string =
'http://localhost:8090/api/productos/cesta/actualiza-cesta';
'http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/productos/cesta/actualiza-cesta';
private urlElimina: string =
'http://localhost:8090/api/productos/cesta/elimina-cesta';
'http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/productos/cesta/elimina-cesta';

constructor(
private httpClient: HttpClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
>
<img
(click)="cambiarImagen($event)"
src="http://localhost:8090/api/productos/producto/imagen/{{
src="http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/productos/producto/imagen/{{
imagen.imagen
}}"
class="img-fluid img-thumbnail"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { CestaService } from './../cesta/cesta.service';
import { PersonaServices } from './../persona/persona.service';
import { ProductoCaracteristicas } from './../producto/productoCaracteristicas.model';
import { ActivatedRoute, Router } from '@angular/router';
import { ProductoService } from './../producto/producto.service';
import { Component, OnInit } from '@angular/core';
import { Producto } from '../producto/producto.model';
import { ActivatedRoute, Router } from '@angular/router';
import { Cesta } from '../cesta/cesta.model';
import { ProductoCantidad } from '../cesta/productoCantidad.model';
import { Producto } from '../producto/producto.model';
import { CestaService } from './../cesta/cesta.service';
import { PersonaServices } from './../persona/persona.service';
import { ProductoService } from './../producto/producto.service';

@Component({
selector: 'app-detalleproducto',
Expand Down Expand Up @@ -35,7 +34,7 @@ export class DetalleproductoComponent implements OnInit {
this.productoService.getProductoById(id).subscribe((producto) => {
this.producto = producto;
this.imagenPrincipal =
'http://localhost:8090/api/productos/producto/imagen/' +
'http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/productos/producto/imagen/' +
this.producto?.productoCaracteristicas.imagenesProducto[0].imagen;
});
}
Expand Down
12 changes: 5 additions & 7 deletions clientes-app/src/app/empleados/empleado.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { catchError } from 'rxjs/operators';
import { PersonaServices } from './../persona/persona.service';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable, throwError } from 'rxjs';
import { Injectable, Input } from '@angular/core';
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import { Observable } from 'rxjs';
import { Usuario } from '../login/usuario.model';
import { ProductoService } from '../producto/producto.service';
import swal from 'sweetalert2';
import { PersonaServices } from './../persona/persona.service';

@Injectable({
providedIn: 'root'
Expand All @@ -16,8 +14,8 @@ export class EmpleadoService{

private httpHeaders = new HttpHeaders({ 'Content-Type': 'application/json' });

private urlUsuarioActualizar="http://localhost:8090/api/personas/actualiza-usuario"
private urlUsuarioPorUsername="http://localhost:8090/api/personas/usuarios/search/buscar-username?username="
private urlUsuarioActualizar="http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/personas/actualiza-usuario"
private urlUsuarioPorUsername="http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/personas/usuarios/search/buscar-username?username="

constructor(private httpClient:HttpClient, private router: Router, private productoService: ProductoService, private personaServices: PersonaServices){}

Expand Down
12 changes: 6 additions & 6 deletions clientes-app/src/app/pedido/pedido.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ import { Pedido } from './pedido.model';
})
export class PedidoService {
private urlProductosLista: string =
'http://localhost:8090/api/productos/lista';
'http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/productos/lista';
private urlActualizaPedido: string =
'http://localhost:8090/api/productos/pedidos/actualiza-pedido';
'http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/productos/pedidos/actualiza-pedido';
private urlRecuperaPedido: string =
'http://localhost:8090/api/productos/pedidos/recupera-pedido';
'http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/productos/pedidos/recupera-pedido';
private urlRecuperaPedidoIdUsuario: string =
'http://localhost:8090/api/productos/pedidos/recupera-pedidos-usuario';
'http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/productos/pedidos/recupera-pedidos-usuario';
private urlRecuperaPedidos: string =
'http://localhost:8090/api/productos/pedidos/lista';
'http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/productos/pedidos/lista';
private urlEliminaPedido: string =
'http://localhost:8090/api/productos/pedidos/borra-pedido';
'http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/productos/pedidos/borra-pedido';

private httpHeaders = new HttpHeaders({ 'Content-Type': 'application/json' });

Expand Down
9 changes: 4 additions & 5 deletions clientes-app/src/app/persona/persona.service.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { Usuario } from './../login/usuario.model';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { Persona } from './persona.model';
import { Usuario } from './../login/usuario.model';

@Injectable({
providedIn: 'root',
})
export class PersonaServices implements OnInit {
private _usuario: Usuario;
private _token: any;
urlToken: string = 'http://localhost:8090/api/security/oauth/token';
private httpHeaders = new HttpHeaders({ 'Content-Type': 'application/json' });
urlToken: string = 'http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/security/oauth/token';
private httpHeaders = new HttpHeaders({ 'Content-Type': 'application/json', 'X-Github-Token':'ghu_CPMN4vJ3Tl4E6OlhqVXd3cSOwvvQWW4HIwib' });

constructor(private httpClient: HttpClient) {}

Expand All @@ -20,7 +19,7 @@ export class PersonaServices implements OnInit {
}

login(usuario: Usuario): Observable<any> {
const urlEndpoint = 'http://localhost:8090/api/security/oauth/token';
const urlEndpoint = 'http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/security/oauth/token';

const credenciales = btoa('frontendapp' + ':' + '12345');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class ProductoCestaComponent implements OnInit {
getImagenEscaparate(): void {
if (this.producto?.productoCaracteristicas?.imagenesProducto?.length > 0)
this.imagenEscaparate =
'http://localhost:8090/api/productos/producto/imagen/' +
'http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/productos/producto/imagen/' +
this.producto.productoCaracteristicas.imagenesProducto[0].imagen;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
>
<div >
<img
src="http://localhost:8090/api/productos/producto/imagen/{{
src="http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/productos/producto/imagen/{{
imagen.imagen
}}"
class="img-thumbnail rounded"
Expand Down
12 changes: 5 additions & 7 deletions clientes-app/src/app/producto/producto.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { Component, Input, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Cesta } from '../cesta/cesta.model';
import { CestaService } from './../cesta/cesta.service';
import { ProductoCantidad } from './../cesta/productoCantidad.model';
import { PersonaServices } from './../persona/persona.service';
import { CestaService } from './../cesta/cesta.service';
import { Component, OnInit, Input } from '@angular/core';
import { Router } from '@angular/router';
import { Producto } from './producto.model';
import { Usuario } from '../login/usuario.model';
import { Observable } from 'rxjs';
import { Cesta } from '../cesta/cesta.model';

@Component({
selector: 'app-producto',
Expand Down Expand Up @@ -38,7 +36,7 @@ export class ProductoComponent implements OnInit {
getImagenEscaparate(): void {
if (this.producto?.productoCaracteristicas?.imagenesProducto?.length > 0)
this.imagenEscaparate =
'http://localhost:8090/api/productos/producto/imagen/' +
'http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/productos/producto/imagen/' +
this.producto.productoCaracteristicas.imagenesProducto[0].imagen;
}

Expand Down
Loading

0 comments on commit 0167641

Please sign in to comment.