From ba7a31fd077349c8364d3de130d424ddfbb01d1b Mon Sep 17 00:00:00 2001 From: Philip <4144601+philipbrembeck@users.noreply.github.com> Date: Tue, 30 Jan 2024 22:04:59 +0100 Subject: [PATCH 1/6] feat: Added OLED mode as standard --- src/components/elements/container.tsx | 2 +- src/components/ingredientscheck.tsx | 4 ++-- src/styles/_globals/_roots.scss | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/elements/container.tsx b/src/components/elements/container.tsx index 967b187d..6fef3e18 100644 --- a/src/components/elements/container.tsx +++ b/src/components/elements/container.tsx @@ -11,7 +11,7 @@ interface ContainerProps { children: React.ReactNode; } -export default function Container(props: ContainerProps) { +export default function Container(props: Readonly) { const hasHeading = props.heading ? "true" : "false"; const headingStyle = props.headingstyle ?? undefined; diff --git a/src/components/ingredientscheck.tsx b/src/components/ingredientscheck.tsx index 8b43860a..af7d0524 100644 --- a/src/components/ingredientscheck.tsx +++ b/src/components/ingredientscheck.tsx @@ -182,9 +182,9 @@ const IngredientsCheck = () => { - {flagged.map((item, index) => ( + {flagged.map((item) => (
-
+
{item.charAt(0).toUpperCase() + item.slice(1)}
diff --git a/src/styles/_globals/_roots.scss b/src/styles/_globals/_roots.scss index 08bcd485..e7f0ae0e 100644 --- a/src/styles/_globals/_roots.scss +++ b/src/styles/_globals/_roots.scss @@ -2,7 +2,7 @@ :root { font-size: 16px; - --bg-color: #141414; + --bg-color: #000; --fg-color: #ccc; --body-font: "MonaSans", Fallback, sans-serif; --body-fontweight: 400; From af8eddfc866057ff499ae9c15d8c8536b3f4bbaf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 02:04:10 +0000 Subject: [PATCH 2/6] build(deps): bump docker/metadata-action from 5.5.0 to 5.5.1 Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.5.0 to 5.5.1. - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/dbef88086f6cef02e264edb7dbf63250c17cef6c...8e5442c4ef9f78752691e2d8f8d19755c6f78e81) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e3c2d1d..32136024 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@dbef88086f6cef02e264edb7dbf63250c17cef6c + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} @@ -97,7 +97,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@dbef88086f6cef02e264edb7dbf63250c17cef6c + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} From cec4bb1198122016f4391d0012da9257368122f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Feb 2024 02:39:43 +0000 Subject: [PATCH 3/6] build(deps): bump @types/node from 20.11.0 to 20.11.16 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.11.0 to 20.11.16. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 569b0d54..a2ccda01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@ducanh2912/next-pwa": "^9.7.2", "@ericblade/quagga2": "^1.8.4", "@frontendnetwork/veganify": "^1.1.49", - "@types/node": "20.11.0", + "@types/node": "20.11.16", "@types/react-dom": "18.2.18", "eslint-config-sznm": "^2.0.2", "jest-worker": "^29.7.0", @@ -2949,9 +2949,9 @@ "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==" }, "node_modules/@types/node": { - "version": "20.11.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.0.tgz", - "integrity": "sha512-o9bjXmDNcF7GbM4CNQpmi+TutCgap/K3w1JyKgxAjqx41zp9qlIAVFi0IhCNsJcXolEqLWhbFbEeL0PvYm4pcQ==", + "version": "20.11.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.16.tgz", + "integrity": "sha512-gKb0enTmRCzXSSUJDq6/sPcqrfCv2mkkG6Jt/clpn5eiCbKTY+SgZUxo+p8ZKMof5dCp9vHQUAB7wOUTod22wQ==", "dependencies": { "undici-types": "~5.26.4" } diff --git a/package.json b/package.json index b8897e42..2eaf58d4 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "@ducanh2912/next-pwa": "^9.7.2", "@ericblade/quagga2": "^1.8.4", "@frontendnetwork/veganify": "^1.1.49", - "@types/node": "20.11.0", + "@types/node": "20.11.16", "@types/react-dom": "18.2.18", "eslint-config-sznm": "^2.0.2", "jest-worker": "^29.7.0", From 70edbfae7747a78e2dcfaa6d1a98a2f46ecb212f Mon Sep 17 00:00:00 2001 From: Philip <4144601+philipbrembeck@users.noreply.github.com> Date: Mon, 5 Feb 2024 22:32:45 +0100 Subject: [PATCH 4/6] fix: Show 404 warning on not found product --- package-lock.json | 47 +++++++++++++++++++++++++++++++++++----- package.json | 5 +++-- src/components/check.tsx | 12 +++++----- 3 files changed, 52 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index a2ccda01..ddf035f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@ducanh2912/next-pwa": "^9.7.2", "@ericblade/quagga2": "^1.8.4", - "@frontendnetwork/veganify": "^1.1.49", + "@frontendnetwork/veganify": "file:../vegancheck-api-wrapper", "@types/node": "20.11.16", "@types/react-dom": "18.2.18", "eslint-config-sznm": "^2.0.2", @@ -23,7 +23,8 @@ "react-dom": "18.2.0", "sass": "^1.69.7", "sharp": "^0.33.1", - "typescript": "5.3.3" + "typescript": "5.3.3", + "veganify": "github:frontendnetwork/veganify" }, "devDependencies": { "@playwright/test": "^1.41.1", @@ -36,6 +37,21 @@ "eslint-plugin-import": "^2.29.0" } }, + "../vegancheck-api-wrapper": { + "name": "@frontendnetwork/veganify", + "version": "1.1.54", + "license": "MIT", + "devDependencies": { + "@types/jest": "^29.5.1", + "@types/node": "^20.1.0", + "@typescript-eslint/eslint-plugin": "^5.59.5", + "@typescript-eslint/parser": "^5.59.5", + "eslint": "^8.40.0", + "jest": "^29.5.0", + "ts-jest": "^29.1.0", + "typescript": "^5.0.4" + } + }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", @@ -2009,9 +2025,8 @@ } }, "node_modules/@frontendnetwork/veganify": { - "version": "1.1.49", - "resolved": "https://registry.npmjs.org/@frontendnetwork/veganify/-/veganify-1.1.49.tgz", - "integrity": "sha512-vqIM5g5SKPDuFPgSzSz6JWChbgZHMh1JuGtmI5rwGxqdzUy/sLfki541CaW3mabVNVJZFs76T76EaiQ0lOiu3Q==" + "resolved": "../vegancheck-api-wrapper", + "link": true }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.13", @@ -9190,6 +9205,28 @@ "uuid": "bin/uuid" } }, + "node_modules/veganify": { + "version": "0.1.0", + "resolved": "git+ssh://git@github.com/frontendnetwork/veganify.git#5f2f27e81ce82666e86d53b048e8334640481430", + "dependencies": { + "@ducanh2912/next-pwa": "^9.7.2", + "@ericblade/quagga2": "^1.8.4", + "@frontendnetwork/veganify": "^1.1.49", + "@types/node": "20.11.16", + "@types/react-dom": "18.2.18", + "eslint-config-sznm": "^2.0.2", + "jest-worker": "^29.7.0", + "million": "^2.6.4", + "next": "13.4.16", + "next-intl": "^2.21.0", + "nookies": "^2.5.2", + "react": "18.2.0", + "react-dom": "18.2.0", + "sass": "^1.69.7", + "sharp": "^0.33.1", + "typescript": "5.3.3" + } + }, "node_modules/verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", diff --git a/package.json b/package.json index 2eaf58d4..a775099f 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "dependencies": { "@ducanh2912/next-pwa": "^9.7.2", "@ericblade/quagga2": "^1.8.4", - "@frontendnetwork/veganify": "^1.1.49", + "@frontendnetwork/veganify": "file:../vegancheck-api-wrapper", "@types/node": "20.11.16", "@types/react-dom": "18.2.18", "eslint-config-sznm": "^2.0.2", @@ -26,7 +26,8 @@ "react-dom": "18.2.0", "sass": "^1.69.7", "sharp": "^0.33.1", - "typescript": "5.3.3" + "typescript": "5.3.3", + "veganify": "github:frontendnetwork/veganify" }, "devDependencies": { "@playwright/test": "^1.41.1", diff --git a/src/components/check.tsx b/src/components/check.tsx index afc0201c..59c2dd7b 100644 --- a/src/components/check.tsx +++ b/src/components/check.tsx @@ -1,7 +1,7 @@ import Veganify from "@frontendnetwork/veganify"; import Image from "next/image"; import { useTranslations } from "next-intl"; -import React, { useState, useEffect, useRef } from "react"; +import React, { useState, useEffect, useRef, FormEvent } from "react"; import ModalWrapper from "@/components/elements/modalwrapper"; import ShareButton from "@/components/elements/share"; @@ -43,7 +43,7 @@ const ProductSearch = () => { }, []); /* Submitting */ - const handleSubmit = async (barcode: string, event?: React.FormEvent) => { + const handleSubmit = async (barcode: string, event?: FormEvent) => { event?.preventDefault(); setShowTimeoutFinal(false); setShowTimeout(false); @@ -183,7 +183,9 @@ const ProductSearch = () => { onDetected={(barcode) => setBarcode(barcode)} handleSubmit={(barcode) => handleSubmit(barcode)} /> - + { GNU FDL .
- © Veganify Contributors and Hamed Montazeri, - licensed under{" "} + © Veganify Contributors and Hamed Montazeri, licensed + under{" "} MIT License From 4a338ef3918e88e220af0cc3e064cebf17aa434f Mon Sep 17 00:00:00 2001 From: Philip <4144601+philipbrembeck@users.noreply.github.com> Date: Mon, 5 Feb 2024 22:38:03 +0100 Subject: [PATCH 5/6] fix: Exchanged local package --- package-lock.json | 47 +++++------------------------------------------ package.json | 5 ++--- 2 files changed, 7 insertions(+), 45 deletions(-) diff --git a/package-lock.json b/package-lock.json index ddf035f6..0957b5f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@ducanh2912/next-pwa": "^9.7.2", "@ericblade/quagga2": "^1.8.4", - "@frontendnetwork/veganify": "file:../vegancheck-api-wrapper", + "@frontendnetwork/veganify": "^1.1.53", "@types/node": "20.11.16", "@types/react-dom": "18.2.18", "eslint-config-sznm": "^2.0.2", @@ -23,8 +23,7 @@ "react-dom": "18.2.0", "sass": "^1.69.7", "sharp": "^0.33.1", - "typescript": "5.3.3", - "veganify": "github:frontendnetwork/veganify" + "typescript": "5.3.3" }, "devDependencies": { "@playwright/test": "^1.41.1", @@ -37,21 +36,6 @@ "eslint-plugin-import": "^2.29.0" } }, - "../vegancheck-api-wrapper": { - "name": "@frontendnetwork/veganify", - "version": "1.1.54", - "license": "MIT", - "devDependencies": { - "@types/jest": "^29.5.1", - "@types/node": "^20.1.0", - "@typescript-eslint/eslint-plugin": "^5.59.5", - "@typescript-eslint/parser": "^5.59.5", - "eslint": "^8.40.0", - "jest": "^29.5.0", - "ts-jest": "^29.1.0", - "typescript": "^5.0.4" - } - }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", @@ -2025,8 +2009,9 @@ } }, "node_modules/@frontendnetwork/veganify": { - "resolved": "../vegancheck-api-wrapper", - "link": true + "version": "1.1.53", + "resolved": "https://registry.npmjs.org/@frontendnetwork/veganify/-/veganify-1.1.53.tgz", + "integrity": "sha512-UIb8HVSctqeqbKsJugj7r/V11/HADg9DyOSv935BEZ5TTKVkRriswmgh7ccK144TIfRrawflAs2LdPCJhSxcZQ==" }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.13", @@ -9205,28 +9190,6 @@ "uuid": "bin/uuid" } }, - "node_modules/veganify": { - "version": "0.1.0", - "resolved": "git+ssh://git@github.com/frontendnetwork/veganify.git#5f2f27e81ce82666e86d53b048e8334640481430", - "dependencies": { - "@ducanh2912/next-pwa": "^9.7.2", - "@ericblade/quagga2": "^1.8.4", - "@frontendnetwork/veganify": "^1.1.49", - "@types/node": "20.11.16", - "@types/react-dom": "18.2.18", - "eslint-config-sznm": "^2.0.2", - "jest-worker": "^29.7.0", - "million": "^2.6.4", - "next": "13.4.16", - "next-intl": "^2.21.0", - "nookies": "^2.5.2", - "react": "18.2.0", - "react-dom": "18.2.0", - "sass": "^1.69.7", - "sharp": "^0.33.1", - "typescript": "5.3.3" - } - }, "node_modules/verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", diff --git a/package.json b/package.json index a775099f..8a34ed13 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "dependencies": { "@ducanh2912/next-pwa": "^9.7.2", "@ericblade/quagga2": "^1.8.4", - "@frontendnetwork/veganify": "file:../vegancheck-api-wrapper", + "@frontendnetwork/veganify": "^1.1.53", "@types/node": "20.11.16", "@types/react-dom": "18.2.18", "eslint-config-sznm": "^2.0.2", @@ -26,8 +26,7 @@ "react-dom": "18.2.0", "sass": "^1.69.7", "sharp": "^0.33.1", - "typescript": "5.3.3", - "veganify": "github:frontendnetwork/veganify" + "typescript": "5.3.3" }, "devDependencies": { "@playwright/test": "^1.41.1", From 1de9a959164c8e5478ea4ff5e287415ada7618cc Mon Sep 17 00:00:00 2001 From: Philip <4144601+philipbrembeck@users.noreply.github.com> Date: Mon, 5 Feb 2024 22:40:52 +0100 Subject: [PATCH 6/6] fix: Type fix --- src/components/check.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/check.tsx b/src/components/check.tsx index 59c2dd7b..b020c7a9 100644 --- a/src/components/check.tsx +++ b/src/components/check.tsx @@ -60,8 +60,13 @@ const ProductSearch = () => { ); setLoading(false); if (data.status === 200) { - setResult(data.product); - setSources(data.sources); + + if ("product" in data) { + setResult(data.product); + } + if ("sources" in data) { + setSources(data.sources); + } setShowFound(true); setShowTimeout(false); } else if (data.status === 404) {