From ea5f76f0a0f8d35a62f2b4956c28654ee5ef3953 Mon Sep 17 00:00:00 2001 From: Joshua Pearson Date: Wed, 13 Sep 2023 19:16:28 -0600 Subject: [PATCH 1/5] fixed linting issues, setup prettier --- .eslintrc.json | 2 +- .prettierrc | 4 +- package.json | 1 - src/checkout/index.html | 23 +-------- src/index.html | 96 ++++++++++++++++++++----------------- src/json/sleeping-bags.json | 60 ++++++----------------- src/json/tents.json | 2 +- 7 files changed, 74 insertions(+), 114 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index dd5dbdc7a..17f92484f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -25,7 +25,7 @@ } ], "no-console": 1, - "quotes": ["error", "single", { "allowTemplateLiterals": true }], + "quotes": ["error", "double", { "allowTemplateLiterals": true }], "func-names": 0, "space-unary-ops": 2, "space-in-parens": "error", diff --git a/.prettierrc b/.prettierrc index 0967ef424..1ca87ab7d 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1 +1,3 @@ -{} +{ + "singleQuote": false +} diff --git a/package.json b/package.json index 089bfb443..d3e118b60 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "lint": "eslint *.js src/**/*.js", "format": "prettier --ignore-path ./.gitignore --write \"./**/*.{html,json,js,ts,css}\"", "test": "jest" - }, "author": "Shane Thompson", "license": "ISC", diff --git a/src/checkout/index.html b/src/checkout/index.html index 876458650..60615e730 100644 --- a/src/checkout/index.html +++ b/src/checkout/index.html @@ -1,9 +1,7 @@ - - @@ -11,30 +9,22 @@ Sleep Outside | Checkout - -
- -
-
-

Review & Place your Order

-
-
- - - diff --git a/src/index.html b/src/index.html index 35ac63ce6..1b84b061c 100644 --- a/src/index.html +++ b/src/index.html @@ -9,20 +9,31 @@
@@ -55,48 +66,47 @@

Top Products

diff --git a/src/json/sleeping-bags.json b/src/json/sleeping-bags.json index 6bf7a1243..5d015123c 100644 --- a/src/json/sleeping-bags.json +++ b/src/json/sleeping-bags.json @@ -35,9 +35,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -93,9 +91,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "LH" - ] + "ZIPPER": ["LH"] }, "Colors": [ { @@ -196,12 +192,8 @@ ] }, "SizesAvailable": { - "LENGTH": [ - "REG" - ], - "ZIPPER": [ - "R" - ] + "LENGTH": ["REG"], + "ZIPPER": ["R"] }, "Colors": [ { @@ -323,9 +315,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -370,9 +360,7 @@ "ExtraImages": null }, "SizesAvailable": { - "HAND": [ - "LH" - ] + "HAND": ["LH"] }, "Colors": [ { @@ -422,9 +410,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -474,9 +460,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -526,9 +510,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -578,9 +560,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -630,9 +610,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -730,9 +708,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -1018,9 +994,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -1070,9 +1044,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "R" - ] + "ZIPPER": ["R"] }, "Colors": [ { @@ -1122,9 +1094,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "RH" - ] + "ZIPPER": ["RH"] }, "Colors": [ { diff --git a/src/json/tents.json b/src/json/tents.json index 98029223e..d24bd8bcb 100644 --- a/src/json/tents.json +++ b/src/json/tents.json @@ -99,7 +99,7 @@ { "ColorCode": "01", "ColorName": "Pale Pumpkin/Terracotta" - } + } ], "DescriptionHtmlSimple": "Excess. Get out and enjoy nature with Marmot's Ajax tent, featuring a smart design with durable, waterproof construction and two doors for easy access.", "SuggestedRetailPrice": 275.0, From 1369b212b524dc6c6cb2b8f8af8842751716b3fa Mon Sep 17 00:00:00 2001 From: Joshua Pearson Date: Thu, 14 Sep 2023 06:47:30 -0600 Subject: [PATCH 2/5] added deploy production link to readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 81c6072d1..74488408b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # sleepoutside +Deployed to + ## Description Use this as a starting point to complete the WDD 330 team activity: the SleepOutside web application. It scaffolds out a simple web app with Vite support to bundle up our assets. From 2ebc3691fd49d4540c324dea221e3f09c2772a07 Mon Sep 17 00:00:00 2001 From: Joshua Pearson Date: Thu, 14 Sep 2023 06:55:31 -0600 Subject: [PATCH 3/5] added team.txt --- team.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 team.txt diff --git a/team.txt b/team.txt new file mode 100644 index 000000000..c660dbfaa --- /dev/null +++ b/team.txt @@ -0,0 +1,11 @@ +Team 16, Wednesday 3pm MT. + +Joshua Pearson +Jill Rasmussen +Promise Okoroji +Breanna Russell +Cameron Crook +Armando Kamisaki + +Trello Board: +https://trello.com/invite/b/z7Lotyy2/ATTIf1cda1ba895f3989f061f141fc17b2deDD1B7ECB/sleep-outside \ No newline at end of file From 570e9335cac7176c756c82b2a389d4961d1c886f Mon Sep 17 00:00:00 2001 From: cameroncrook Date: Thu, 14 Sep 2023 11:37:21 -0600 Subject: [PATCH 4/5] Fixed 'Add To Cart' issue --- src/js/product.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/js/product.js b/src/js/product.js index 0b8d0aa67..d31160ca9 100644 --- a/src/js/product.js +++ b/src/js/product.js @@ -1,10 +1,18 @@ -import { setLocalStorage } from "./utils.mjs"; +import { setLocalStorage, getLocalStorage } from "./utils.mjs"; import ProductData from "./ProductData.mjs"; const dataSource = new ProductData("tents"); function addProductToCart(product) { - setLocalStorage("so-cart", product); + const soCart = getLocalStorage("so-cart"); + + if (soCart === null) { + let productStorage = [product]; + setLocalStorage("so-cart", productStorage); + } else { + soCart.push(product); + setLocalStorage("so-cart", soCart); + } } // add to cart button event handler async function addToCartHandler(e) { From c62aaaf70936f9ca80ef8d081dd1f7506112210a Mon Sep 17 00:00:00 2001 From: cameroncrook Date: Thu, 14 Sep 2023 11:49:18 -0600 Subject: [PATCH 5/5] Changes 'Add to Cart' text when clicked --- src/js/product.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/js/product.js b/src/js/product.js index d31160ca9..e4ca0176f 100644 --- a/src/js/product.js +++ b/src/js/product.js @@ -18,6 +18,9 @@ function addProductToCart(product) { async function addToCartHandler(e) { const product = await dataSource.findProductById(e.target.dataset.id); addProductToCart(product); + + // window.location.href = "../"; + document.getElementById("addToCart").textContent = "Product Added"; } // add listener to Add to Cart button