Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/test footer #27

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
ff4562f
fix: Se agregó la traducción de la cateogria del elemento de ingles a…
JoaquinPamphile Jun 5, 2022
c540dfb
fix: Se cambió lógica del test unitario acorde a los cambios del fron
JoaquinPamphile Jun 5, 2022
31dc9eb
Merge pull request #1 from JoaquinPamphile/bug/traduccion
GCarzolio Jun 5, 2022
d3e1dc2
feat: Se agregó lógica para notificar si el carrito está vacío
JoaquinPamphile Jun 5, 2022
b43085f
feat: creación del footer con los datos de contacto en la página prin…
GCarzolio Jun 5, 2022
f90244c
Merge pull request #2 from JoaquinPamphile/bug/MensajeCarritoVacio
GCarzolio Jun 6, 2022
0784076
fix: se modificó la estructura del footer
GCarzolio Jun 6, 2022
e5aa645
feat: se agregaron estilos para el footer
GCarzolio Jun 6, 2022
9f68793
feat: se agregó el footer en la vista del carrito
GCarzolio Jun 6, 2022
8e48213
build: Se solucíonó conflicto de mergeo entre rama actual y main
JoaquinPamphile Jun 6, 2022
404acfe
Merge pull request #3 from JoaquinPamphile/feature/mostrarDatosDeCont…
JoaquinPamphile Jun 6, 2022
45eb73f
Fix: se eliminó el botón anterior en la primera página
marinazottig Jun 7, 2022
f83e730
Merge pull request #4 from JoaquinPamphile/bug/EliminarBotonAnterior
JoaquinPamphile Jun 7, 2022
b7c9b22
Fix: se eliminó el botón siguiente en la última página
marinazottig Jun 7, 2022
a10ce0b
feat:Se agrego la descripcion de cada producto
macadrago Jun 7, 2022
80a7bf4
fix: Se corrigio error en product.js que daba fallas en test
macadrago Jun 7, 2022
19b51cb
Merge pull request #6 from JoaquinPamphile/feature/DescripcionProducto
JoaquinPamphile Jun 7, 2022
3f61eb3
Merge pull request #5 from JoaquinPamphile/bug/EliminarBotonSiguiente
JoaquinPamphile Jun 7, 2022
da90797
Build: corrección de package.json para poder realizar el deploy
JoaquinPamphile Jun 13, 2022
77bd0e9
Merge pull request #7 from JoaquinPamphile/bug/DeployPackage
macadrago Jun 13, 2022
2a441e3
Build: corrección de parámetro "start" para el deploy
JoaquinPamphile Jun 13, 2022
f02516d
Merge pull request #8 from JoaquinPamphile/bug/DeployPackage
macadrago Jun 13, 2022
64ea432
Build: se cambió el orden de las dependencias
macadrago Jun 13, 2022
7ba60ff
Merge pull request #9 from JoaquinPamphile/bug/ModificacionDeDependen…
JoaquinPamphile Jun 14, 2022
d75c68d
fix: Se ingrementó la performance de la aplicación de un 89% a un 96%…
Jun 17, 2022
f8ca90c
Merge pull request #10 from JoaquinPamphile/fix/PerformanceImageHeight
macadrago Jun 17, 2022
13fa2a9
fix: Se aumento el porcentaje de accesibilidad mejorando el contraste…
macadrago Jun 17, 2022
44316fd
Merge pull request #11 from JoaquinPamphile/fix/MejoraDeContrastes
JoaquinPamphile Jun 17, 2022
06280f5
fix: Se incrementó el porcentaje de Best Practices modificando la res…
GCarzolio Jun 21, 2022
a64fc6b
Merge pull request #12 from JoaquinPamphile/fix/MejorarResolucionDeIm…
JoaquinPamphile Jun 21, 2022
7d8fd8a
fix: Arreglé el problema con los duplicados de ID en la accesibilidad
marinazottig Jun 22, 2022
9953e52
Merge pull request #13 from JoaquinPamphile/fix/ArregloDeDuplicadosID
JoaquinPamphile Jun 22, 2022
cb78bb6
build: Modificación de changelog con nueva versión
Jun 23, 2022
feb335b
Merge pull request #14 from JoaquinPamphile/build/changelogUpdate
JoaquinPamphile Jun 23, 2022
d7a17a5
feat: Se agregó el test para corroborar que el tipo de producto esté …
JoaquinPamphile Jul 3, 2022
057e47a
feat: Se agregó un apartado en test e2e para corroborar que el mensaj…
JoaquinPamphile Jul 3, 2022
d11f52c
Merge pull request #15 from JoaquinPamphile/feat/TestTraduccionEspañol
macadrago Jul 3, 2022
7c67a95
Merge pull request #16 from JoaquinPamphile/feat/TestMensajeCarritoVacio
macadrago Jul 3, 2022
e5475f5
feat: Se creo el test unitario para verificar que cada producto cuent…
macadrago Jul 3, 2022
d9d700f
Feat: se agregó el test unitariopara corroborar que en la primera pan…
marinazottig Jul 3, 2022
3578592
Merge pull request #18 from JoaquinPamphile/feature/TestDescripcionPr…
JoaquinPamphile Jul 3, 2022
1776dbb
Merge pull request #19 from JoaquinPamphile/feature/TestBotonAnterior
JoaquinPamphile Jul 3, 2022
a6dc527
Feat: Se crearon los test para testear la existencia del footer en ho…
GCarzolio Jul 6, 2022
3cb229f
Fix: Se corrigió error en el test de footer en home
GCarzolio Jul 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

[unreleased]: https://github.com/frlp-utn-ingsoft/shopp/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/frlp-utn-ingsoft/shopp/releases/tag/v1.0.0

## [1.2.6] - 2022-06-22

### Added
Footer con datos de contacto
Descripción de todos los producto


### Fixed:
Se añadió la traducción de las categorías
Se anadió el mensaje de carrito vacío
Se eliminó el botón anterior de la primer página
Se eliminó el botón siguiente de la última página
Se corrigió el bug del package de deploy
Se corrigieron las dependencias a utilizar

### Metrics:
Performance inicial: 87% / Performance final: 100%
Accessibility inicial: 91% / Accessibility final: 100%
Best Practices inicial: 83% / Best Practices final: 100%
SEO inicial: 92% / SEO final: 92%
12 changes: 12 additions & 0 deletions fixtures/products.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,84 @@
"discount": 5,
"name": "Placard",
"price": 50000,
"description":"Placard de algarrobo de 1.90 x 0.30 x 2.5",
"type": "home"
},
{
"discount": 10,
"name": "Mesa",
"price": 25000,
"description":"Mesa de pino de 1.60 x 0.80",
"type": "home"
},
{
"discount": 0,
"name": "Silla",
"price": 5000,
"description":"Silla de pino 'confy', ideal para el estudiante",
"type": "home"
},
{
"discount": 0,
"name": "Mesa de Luz",
"price": 8000,
"description":"Mesa de pino de 1.60 x 0.80",
"type": "home"
},
{
"discount": 0,
"name": "Sillon",
"price": 85000,
"description":"Sillon sofa 2 cuerpos",
"type": "home"
},
{
"discount": 0,
"name": "Cama",
"price": 45000,
"description":"Cama dos plazas king",
"type": "home"
},
{
"discount": 0,
"name": "Rack TV",
"price": 25000,
"description":"Rack TV nordico ",
"type": "home"
},
{
"discount": 0,
"name": "TV",
"price": 55000,
"description":"Smart TV 45 pulgadas",
"type": "electronics"
},
{
"discount": 0,
"name": "PS4",
"price": 75000,
"description":"Sony PS4 edición Destiny - Incluye destiny 2 de regalo",
"type": "electronics"
},
{
"discount": 0,
"name": "PS5",
"price": 175000,
"description":"Nueva PS5 con 3 juegos de regalo. Edición física",
"type": "electronics"
},
{
"discount": 0,
"name": "Barra de sonido",
"price": 35000,
"description": "Barra de sonido Skull Candy con bluetoth de última generación",
"type": "electronics"
},
{
"discount": 0,
"name": "Laptop",
"price": 350000,
"description": "Laptop MSI de 15.2 pulgadas, intel core I7, 16 GB de ram y placa de video Nvidia GTX 1660",
"type": "electronics"
}
]
16 changes: 4 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "src/index.js",
"scripts": {
"db:fixture": "node ./fixtures/index.js",
"start": "node ./src/index.js",
"start": "node ./fixtures/index.js && node ./src/index.js",
"dev": "nodemon ./src/index.js -e js,css,html",
"test": "jest",
"test:coverage": "jest --collectCoverage",
Expand Down Expand Up @@ -33,14 +33,14 @@
"morgan": "^1.10.0",
"nunjucks": "^3.2.3",
"sequelize": "^6.19.0",
"sqlite3": "^5.0.8"
"sqlite3": "^5.0.8",
"detect-port": "^1.3.0"
},
"devDependencies": {
"@lhci/cli": "^0.9.0",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/dom": "^8.13.0",
"babel-jest": "^28.1.0",
"detect-port": "^1.3.0",
"eslint": "^8.15.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.1.5",
Expand Down
11 changes: 8 additions & 3 deletions src/models/product.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ const Product = db.define(
allowNull: false,
values: ProductType.types,
},
description : {
type: Sequelize.STRING,
allowNull: false,
},
discount: {
type: Sequelize.NUMBER,
allowNull: false,
Expand Down Expand Up @@ -85,8 +89,9 @@ const createProduct = ({
price = 0.0,
type = ProductType.HOME,
discount = 0.0,
description ='',
} = {}) => {
return Product.create({ name, price, type, discount });
return Product.create({ name, price, type, discount, description });
};

/**
Expand All @@ -97,12 +102,12 @@ const createProduct = ({
*/
const updateProduct = async (
id,
{ name = '', price = 0.0, type = ProductType.HOME, discount = 0.0 } = {}
{ name = '', price = 0.0, type = ProductType.HOME, discount = 0.0, description='' } = {}
) => {
const product = await findById(id);

if (product != null) {
return product.update({ name, price, type, discount });
return product.update({ name, price, type, discount, description });
}
return null;
};
Expand Down
45 changes: 45 additions & 0 deletions src/public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,48 @@ body {
list-style: none;
display: flex;
}

footer{
width: 100%;
padding: 50px 0px;
}

.container_footer{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
max-width: 1200px;
margin: auto;
margin-top: 10px;
}

.box__footer{
display: flex;
flex-direction: column;
padding: 40px;

}

.box__footer h2{
margin-bottom: 30px;
color:black;
font-weight: 700;
}

.box__footer p{
margin-top: 10px;
color: black;
font-weight: 600;
}

.box__footer p:hover{
opacity: 0.8;
}

p {
color: black;
}

.black {
color: black;
}
4 changes: 2 additions & 2 deletions src/views/_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
aria-describedby="search-btn">
<button class="btn btn-light" type="button">
<i class="fa-solid fa-magnifying-glass" aria-hidden="true"></i>
<span class="sr-only" id="search-btn">Buscar</span>
<span class="sr-only" id="search-btn-buscar">Buscar</span>
</button>
</div>
</form>

<a href="/cart" class="btn btn-light">
<i class="fa-solid fa-cart-shopping" aria-hidden="true"></i>
<span class="sr-only" id="search-btn">Carrito</span>
<span class="sr-only" id="search-btn-carrito">Carrito</span>
</a>
</div>
</nav>
8 changes: 6 additions & 2 deletions src/views/_pagination.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<nav class="pagination fs-5">
<ul class="hstack gap-3">
<li class="pagination__prev">
<a href="?page={{ currentPage - 1 }}">< Anterior</a>
{% if currentPage !== 1 %}
<a href="?page={{ currentPage - 1 }}" class="black">< Anterior</a>
{% endif %}
</li>

<li>
Expand All @@ -12,7 +14,9 @@
</li>

<li class="pagination__next">
<a href="?page={{ currentPage + 1 }}">Siguiente ></a>
{% if currentPage !== totalPages %}
<a href="?page={{ currentPage + 1 }}" class="black">Siguiente ></a>
{% endif %}
</li>
</ul>
</nav>
Expand Down
17 changes: 13 additions & 4 deletions src/views/_product-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,30 @@
<div class="product card">
<div class="card-body d-flex flex-row">
<img
srcset="https://via.placeholder.com/300 300w"
src="https://via.placeholder.com/150"
alt="foto de un {{ product.name }}"
width="150px"
width="150w"
height="150w"
class="rounded"
loading="async"
/>
<div class="ms-3">
<h5 class="card-title mb-0">{{ product.name }}</h5>
<p class="card-text">
<small class="text-muted">{{ product.type }}</small>
<small class="text-muted black">
{% if product.type == 'home' %}
Hogar
{% elif product.type == 'electronics'%}
Electrónicos
{% endif %}
</small>
</p>
<p style="font-size: 1.25rem"> {{ product.description }}</p>
<p class="fs-3">$ {{ product.price }}</p>

{% if (product.discount > 0) %}
<p class="small" data-testid="discount">{{ product.discount }} %</p>
<p class="small black" data-testid="discount">{{ product.discount }} %</p>
{% endif %}
</div>

Expand All @@ -25,7 +34,7 @@ <h5 class="card-title mb-0">{{ product.name }}</h5>
{% if (not product.CartProduct ) %}
<form action="/cart" method="POST">
<input type="text" class="d-none" name="productid" value="{{ product.id }}">
<button type="submit" class="btn btn-outline-primary">Agregar a carrito</button>
<button type="submit" class="btn btn-outline-primary black">Agregar a carrito</button>
</form>
{% else %}
<div class="product__quantity fs-4 bold">
Expand Down
Loading