From 35addb355672bf5980bfe807f04ad9ae8f931269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Mart=C3=ADnez=20Bajo?= Date: Wed, 6 Apr 2022 21:20:23 +0200 Subject: [PATCH 001/120] =?UTF-8?q?Correcci=C3=B3n=20para=20el=20funcionam?= =?UTF-8?q?iento=20npm=20run=20prod?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/server.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/webapp/server.ts b/webapp/server.ts index b49cf27..2b1cc52 100644 --- a/webapp/server.ts +++ b/webapp/server.ts @@ -1,4 +1,6 @@ import express,{Application} from 'express'; +const path = require('path'); +const publicPath = path.join(__dirname, '.', 'build'); //for using an import here we need to configure the tsconfig.json //setting the option module to commonjs @@ -7,6 +9,14 @@ const port: number = 3000; app.use(express.static('build')) +app.get('*', (req, res) => { + res.sendFile(path.join(publicPath, 'index.html')), function(err: any) { + if (err) { + res.status(500).send(err) + } + }; +}); + app.listen(port, ():void => { console.log('Webapp started on port '+ port); }).on("error",(error:Error)=>{ From 36ce52e0b38a5abf6ce86a7a6b5471b047cadfb2 Mon Sep 17 00:00:00 2001 From: AnaOstio Date: Thu, 7 Apr 2022 17:05:14 +0200 Subject: [PATCH 002/120] Cambio de etiquetas + inicio footer --- README.md | 6 ++-- README_es.md | 6 ++-- webapp/src/App.test.tsx | 33 +++++++++++++------ webapp/src/App.tsx | 3 ++ webapp/src/components/Footer/Footer.tsx | 37 ++++++++++++++++++++++ webapp/src/components/NavBar.tsx | 10 +++--- webapp/src/pages/Home.tsx | 11 ++++--- webapp/src/pages/LogIn.tsx | 4 +-- webapp/src/pages/Signup.tsx | 4 +-- webapp/src/pages/admin/AddProdcutAdmin.tsx | 5 +-- 10 files changed, 89 insertions(+), 30 deletions(-) create mode 100644 webapp/src/components/Footer/Footer.tsx diff --git a/README.md b/README.md index 4f504b6..4e9276a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # dede_es2c -[![Actions Status](https://github.com/arquisoft/dede_0/workflows/CI%20for%20ASW2122/badge.svg)](https://github.com/arquisoft/dede_0/actions) -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_dede_0&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Arquisoft_dede_0) -[![codecov](https://codecov.io/gh/arquisoft/dede_0/branch/master/graph/badge.svg?token=VN4XG9NTRO)](https://codecov.io/gh/pglez82/asw2122_0) +[![Actions Status](https://github.com/arquisoft/dede_0/workflows/CI%20for%20ASW2122/badge.svg)](https://github.com/Arquisoft/dede_es2c/actions/workflows/asw2122.yml) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_dede_0&metric=alert_status)](https://sonarcloud.io/summary/overall?id=Arquisoft_dede_es2c) +[![codecov](https://codecov.io/gh/arquisoft/dede_0/branch/master/graph/badge.svg?token=VN4XG9NTRO)](https://app.codecov.io/gh/Arquisoft/dede_es2c)

diff --git a/README_es.md b/README_es.md index 9ff3b0c..8149f3a 100644 --- a/README_es.md +++ b/README_es.md @@ -1,8 +1,8 @@ # asw2122_0 -[![Actions Status](https://github.com/pglez82/asw2122_0/workflows/CI%20for%20ASW2122/badge.svg)](https://github.com/pglez82/asw2122_0/actions) -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=pglez82_asw2122_0&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=pglez82_asw2122_0) -[![codecov](https://codecov.io/gh/pglez82/asw2122_0/branch/master/graph/badge.svg?token=VN4XG9NTRO)](https://codecov.io/gh/pglez82/asw2122_0) +[![Actions Status](https://github.com/arquisoft/dede_0/workflows/CI%20for%20ASW2122/badge.svg)](https://github.com/Arquisoft/dede_es2c/actions/workflows/asw2122.yml) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_dede_0&metric=alert_status)](https://sonarcloud.io/summary/overall?id=Arquisoft_dede_es2c) +[![codecov](https://codecov.io/gh/arquisoft/dede_0/branch/master/graph/badge.svg?token=VN4XG9NTRO)](https://app.codecov.io/gh/Arquisoft/dede_es2c)

diff --git a/webapp/src/App.test.tsx b/webapp/src/App.test.tsx index 814f092..ffa3fed 100644 --- a/webapp/src/App.test.tsx +++ b/webapp/src/App.test.tsx @@ -13,11 +13,12 @@ import OrderAdmin from './pages/admin/OrderAdmin'; import Profile from './pages/user/Profile'; import OrderHistory from './pages/user/OrderHistory' import Pago from './pages/Pago'; +import { Table, TableBody } from '@mui/material'; /* test('renders learn react link', () => { render(); const linkElement = screen.getByText(/Source code/i); expect(linkElement).toBeInTheDocument(); -}); */ +}); */ test('Home Page de la aplicacion', async () => { const productList:Product[] = [{codigo: "TE01", categoria: "teclado", nombre: "PruebaTecado", precio: 20, stock: '4', url: "aa", descripcion: "", cantidad: 0}]; @@ -39,14 +40,19 @@ test('Ventana Productos', async () => { }); -test('Admin -> Administrar Productos Base', async () => { +/* test('Admin -> Administrar Productos Base', async () => { render(); expect(screen.getByText(/Código/i)).toBeInTheDocument(); -}); +}); */ test('Admin -> Administrar Productos Base Datos', async () => { const productList:Product[] = [{codigo: "TE01", categoria: "teclado", nombre: "PruebaTecado", precio: 20, stock: '4', url: "aa", descripcion: "", cantidad: 0}]; - render(); + render( + + + + +
); expect(screen.getByText(/PruebaTecado/i)).toBeInTheDocument(); expect(screen.getByText(/Administrar/i)).toBeInTheDocument(); }); @@ -60,17 +66,17 @@ test('Admin -> Administrar Productos Base Datos', async () => { test('Admin -> Administrar Usuarios', async () => { render() expect(screen.getByText(/Ver pedidos de usuarios/i)).toBeInTheDocument(); -}); +}); - test('Admin -> Añadir Productos', async () => { - render() - expect(screen.getByText(/Añadir un nuevo producto/i)).toBeInTheDocument(); +test('Admin -> Añadir Productos', async () => { + render() + expect(screen.getByText(/Añadir un nuevo producto/i)).toBeInTheDocument(); }); test('Admin -> Administrar Pedidos', async () => { render() expect(screen.getByText(/Correo del comprador/i)).toBeInTheDocument(); -}); +}); test('Ventana Pago', async () => { render() @@ -82,7 +88,14 @@ test('Admin -> Administrar Pedidos Inside', async () => { const productList:Object[] = [{codigo: "TE01", categoria: "teclado", nombre: "PruebaTecado", precio: 20, stock: '4', url: "aa", descripcion: "", cantidad: 0}]; const pedido: Order[] = [{codigo: "A", correo: "a@uniovi", fecha: new Date(), precioTotal: 140.23, products: productList}, {codigo: "B", correo: "b@uniovi", fecha: new Date(), precioTotal: 140.23, products: productList}] - render() + + + render( + + + + +
) expect(screen.getByText(/a@uniovi/i)).toBeInTheDocument(); }); diff --git a/webapp/src/App.tsx b/webapp/src/App.tsx index 63dc653..108d510 100644 --- a/webapp/src/App.tsx +++ b/webapp/src/App.tsx @@ -17,6 +17,7 @@ import PrivateRoute from './components/routes/PrivateRoute'; import UserAdmin from './pages/admin/UsersAdmin'; import jwt_decode from "jwt-decode"; import Swal from 'sweetalert2'; +import Footer from './components/Footer/Footer'; const App: FC = () => { @@ -87,7 +88,9 @@ const App: FC = () => { } /> +