Skip to content

Commit

Permalink
Merge branch 'main' into 427-login-signup-safari
Browse files Browse the repository at this point in the history
  • Loading branch information
k-allagbe committed Feb 13, 2025
2 parents 1baf863 + 8d18cf5 commit 3265a96
Show file tree
Hide file tree
Showing 50 changed files with 2,711 additions and 1,680 deletions.
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"singleQuote": false,
"trailingComma": "all",
"printWidth": 80,
"endOfLine": "lf"
"endOfLine": "lf",
"plugins": ["prettier-plugin-tailwindcss"]
}
1,981 changes: 902 additions & 1,079 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,27 @@
"@mui/icons-material": "^6.4.1",
"@mui/material": "^6.4.1",
"@mui/material-nextjs": "^6.3.1",
"@tailwindcss/postcss": "^4.0.6",
"axios": "^1.7.9",
"dotenv": "^16.4.7",
"i18next": "^24.2.1",
"i18next": "^24.2.2",
"i18next-browser-languagedetector": "^8.0.2",
"i18next-chained-backend": "^4.6.2",
"i18next-http-backend": "^3.0.2",
"i18next-resources-to-backend": "^1.2.1",
"identity-obj-proxy": "^3.0.0",
"jest-environment-jsdom": "^29.7.0",
"js-cookie": "^3.0.5",
"libphonenumber-js": "^1.11.19",
"next": "15.1.6",
"postcss": "^8.5.2",
"react": "^19",
"react-dom": "^19",
"react-hook-form": "^7.54.2",
"react-i18next": "^15.4.0",
"react-zoom-pan-pinch": "^3.6.1",
"swiper": "^11.2.1",
"tailwindcss": "^4.0.6",
"ts-node": "^10.9.2",
"uuid": "^11.0.5",
"zustand": "^5.0.3"
Expand All @@ -61,9 +65,8 @@
"eslint": "^9",
"eslint-config-next": "15.1.6",
"jest": "^29.7.0",
"postcss": "^8",
"prettier": "^3.4.2",
"tailwindcss": "^3.4.1",
"prettier": "^3.5.0",
"prettier-plugin-tailwindcss": "^0.6.11",
"ts-jest": "^29.2.5",
"typescript": "^5.7.3",
"whatwg-fetch": "^3.6.20"
Expand Down
2 changes: 1 addition & 1 deletion postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
"@tailwindcss/postcss": {},
},
};

Expand Down
7 changes: 6 additions & 1 deletion public/locales/en/confirmationPage.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
"weight": "Weight",
"density": "Density",
"volume": "Volume"
},
"regType": {
"fertilizer": "Fertilizer",
"ingredient": "Ingredient"
}
},
"organizations": {
Expand All @@ -18,7 +22,8 @@
"name": "Name",
"address": "Address",
"website": "Website",
"phoneNumber": "Phone Number"
"phoneNumber": "Phone Number",
"mainContact": "Main Contact"
}
},
"cautions": {
Expand Down
44 changes: 31 additions & 13 deletions public/locales/en/labelDataValidator.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
"label": "Name",
"placeholder": "Enter name"
},
"registrationNumber": {
"label": "Registration Number",
"placeholder": "Enter registration number"
"reg": {
"label": "Registration Numbers"
},
"lotNumber": {
"label": "Lot Number",
Expand All @@ -31,9 +30,10 @@
},
"organizations": {
"stepTitle": "Organizations",
"mainContact": "Main Contact",
"markAllUnverified": "Mark all as Unverified",
"markAllVerified": "Mark all as Verified",
"removeOrganisation": "Remove Organisation",
"removeOrganisation": "Remove Organization",
"addOrganization": "Add Organization",
"fields": {
"name": {
Expand Down Expand Up @@ -81,11 +81,10 @@
"nutrients": "Nutrients"
},
"verifiedInput": {
"verify": "Mark {{label}} as Verified",
"unverify": "Mark {{label}} as Unverified",
"verify": "Mark as Verified",
"unverify": "Mark as Unverified",
"accessibility": {
"input": "Input field for {{label}}",
"checkbox": "Checkbox for {{label}}"
"input": "Input field"
},
"options": {
"yes": "Yes",
Expand All @@ -102,9 +101,27 @@
"unitDropdown": "Dropdown to select a unit of measurement"
}
},
"verifiedQuantityMultiInput": {
"registrationInput": {
"placeholder": "Enter registration number",
"type": {
"fertilizer": "Fertilizer",
"ingredient": "Ingredient"
},
"accessibility": {
"identifier": "Input field for registration number",
"unit": "Dropdown to select a type of registration number"
}
},
"verifiedListRow": {
"accessibility": {
"deleteRowButton": "Button to delete this row"
}
},
"listContainer": {
"addRow": "Add Row"
},
"verifiedQuantityList": {
"deleteRow": "Delete this row",
"addRow": "Add Row",
"removeRow": "Remove",
"verify": "Mark as Verified",
"unverify": "Mark as Unverified",
Expand All @@ -123,7 +140,6 @@
"lb/gal": "lb/gal"
},
"accessibility": {
"deleteRowButton": "Button to delete this row",
"addRowButton": "Button to add a new row",
"valueInput": "Input field for numeric value",
"unitDropdown": "Dropdown to select a unit of measurement",
Expand Down Expand Up @@ -163,7 +179,7 @@
"unverifyAllButton": "Button to mark all rows as Unverified"
}
},
"iconInput":{
"iconInput": {
"hidePassword": "hide the password",
"displayPassword": "display the password"
},
Expand All @@ -179,5 +195,7 @@
"initialSaveFailed": "Initial label data saving failed",
"labelExtractionFailed": "Label data extraction failed"
},
"stepper": { "next": "Next", "back": "Back", "submit": "Submit" }
"stepper": { "next": "Next", "back": "Back", "submit": "Submit" },
"fertilizer_product": "Fertilizer",
"ingredient_component": "Ingredient"
}
7 changes: 6 additions & 1 deletion public/locales/fr/confirmationPage.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
"weight": "Poids",
"density": "Densité",
"volume": "Volume"
},
"regType": {
"fertilizer": "Engrais",
"ingredient": "Ingrédient"
}
},
"organizations": {
Expand All @@ -18,7 +22,8 @@
"name": "Nom",
"address": "Adresse",
"website": "Site Web",
"phoneNumber": "Numéro de téléphone"
"phoneNumber": "Numéro de téléphone",
"mainContact": "Contact principal"
}
},
"cautions": {
Expand Down
41 changes: 29 additions & 12 deletions public/locales/fr/labelDataValidator.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
"label": "Nom",
"placeholder": "Entrez le nom"
},
"registrationNumber": {
"label": "Numéro d'enregistrement",
"placeholder": "Entrez le numéro d'enregistrement"
"reg": {
"label": "Numéros d'enregistrement"
},
"lotNumber": {
"label": "Numéro de lot",
Expand All @@ -30,7 +29,8 @@
}
},
"organizations": {
"stepTitle": "Organisations",
"stepTitle": "Organizations",
"mainContact": "Contact Principal",
"markAllUnverified": "Marquer tout comme non vérifié",
"markAllVerified": "Marquer tout comme vérifié",
"removeOrganisation": "Supprimer Organisation",
Expand Down Expand Up @@ -81,11 +81,10 @@
"nutrients": "Nutriments"
},
"verifiedInput": {
"verify": "Marquer {{label}} comme vérifié",
"unverify": "Marquer {{label}} comme non vérifié",
"verify": "Marquer comme vérifié",
"unverify": "Marquer comme non vérifié",
"accessibility": {
"input": "Champ de saisie pour {{label}}",
"checkbox": "Case à cocher pour {{label}}"
"input": "Champ de saisie"
},
"options": {
"yes": "Oui",
Expand All @@ -102,7 +101,26 @@
"unitDropdown": "Champ de saisie pour une unité de mesure"
}
},
"verifiedQuantityMultiInput": {
"registrationInput": {
"placeholder": "Entrez le numéro d'enregistrement",
"type": {
"fertilizer": "Engrais",
"ingredient": "Ingrédient"
},
"accessibility": {
"identifier": "Champ de saisie pour le numéro d'enregistrement",
"unit": "Menu déroulant pour sélectionner un type de numéro d'enregistrement"
}
},
"verifiedListRow": {
"accessibility": {
"deleteRowButton": "Bouton pour supprimer cette ligne"
}
},
"listContainer": {
"addRow": "Ajouter une ligne"
},
"verifiedQuantityList": {
"deleteRow": "Supprimer cette ligne",
"addRow": "Ajouter une ligne",
"removeRow": "Supprimer",
Expand All @@ -123,7 +141,6 @@
"lb/gal": "lb/gal"
},
"accessibility": {
"deleteRowButton": "Bouton pour supprimer cette ligne",
"addRowButton": "Bouton pour ajouter une nouvelle ligne",
"valueInput": "Champ de saisie pour une valeur numérique",
"unitDropdown": "Menu déroulant pour sélectionner une unité de mesure",
Expand Down Expand Up @@ -163,7 +180,7 @@
"unverifyAllButton": "Bouton pour tout marquer comme non vérifié"
}
},
"iconInput":{
"iconInput": {
"hidePassword": "cacher le mot de passe",
"displayPassword": "afficher le mot de passe"
},
Expand All @@ -172,7 +189,7 @@
"minValue": "La valeur minimale est 0",
"duplicateUnit": "Unité dupliquée",
"invalidId": "ID invalide",
"fetchAborted": "Fetch annulé",
"fetchAborted": "Fetch annulé",
"failedFetchInspection": "Échec de la récupération de l'inspection.",
"noFileUploaded": "Aucun fichier téléchargé",
"requestCancelled": "Requête annulée",
Expand Down
19 changes: 16 additions & 3 deletions src/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss";

:root {
--background: #ffffff;
Expand Down Expand Up @@ -33,3 +31,18 @@ body {
.swiper-pagination-bullet-active {
opacity: 1 !important;
}

@theme {
/* Colors */
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-fertiscan-blue: #05486c;

/* Breakpoints */
--breakpoint-xs: 0px;
--breakpoint-sm: 600px;
--breakpoint-md: 900px;
--breakpoint-lg: 1200px;
--breakpoint-xl: 1500px;
--breakpoint-xxl: 1800px;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import FileUploaded from "@/classe/File";
import { QuantityChips } from "@/components/QuantityChip";
import { QuantityChips } from "@/components/QuantityChips";
import useUploadedFilesStore from "@/stores/fileStore";
import useLabelDataStore from "@/stores/labelDataStore";
import { Quantity } from "@/types/types";
Expand Down
31 changes: 20 additions & 11 deletions src/app/label-data-confirmation/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
"use client";
import ImageViewer from "@/components/ImageViewer";
import LoadingButton from "@/components/LoadingButton";
import { QuantityChips } from "@/components/QuantityChip";
import { QuantityChips } from "@/components/QuantityChips";
import { RegistrationChips } from "@/components/RegistrationChips";
import useAlertStore from "@/stores/alertStore";
import useUploadedFilesStore from "@/stores/fileStore";
import useLabelDataStore from "@/stores/labelDataStore";
import { BilingualField, LabelData } from "@/types/types";
import { processAxiosError } from "@/utils/client/apiErrors";
import { isAllVerified } from "@/utils/client/fieldValidation";
import { updateLabelData } from "@/utils/client/modelTransformation";
import useBreakpoints from "@/utils/client/useBreakpoints";
import CheckIcon from "@mui/icons-material/Check";
import {
Box,
Checkbox,
Expand Down Expand Up @@ -94,11 +97,7 @@ const LabelDataConfirmationPage = () => {
if (!response.data.inspectionId) {
throw new Error(t("error.idMissing"));
}
const _labelData: LabelData = {
...labelData,
inspectionId: response.data.inspectionId,
pictureSetId: response.data.pictureSetId,
};
const _labelData = updateLabelData(labelData, response.data);
setLabelData(_labelData);
putLabelData(_labelData, signal);
})
Expand Down Expand Up @@ -300,12 +299,12 @@ const LabelDataConfirmationPage = () => {
</Typography>
</TableCell>
<TableCell data-testid="base-information-registration-number">
<Typography>
{
labelData?.baseInformation.registrationNumber
.value
<RegistrationChips
registrations={
labelData?.baseInformation.registrationNumbers
.values
}
</Typography>
/>
</TableCell>
<TableCell data-testid="base-information-lot-number">
<Typography>
Expand Down Expand Up @@ -357,6 +356,11 @@ const LabelDataConfirmationPage = () => {
<Table size="small" data-testid="organizations-table">
<TableHead>
<TableRow className="bg-gray-100">
<TableCell className="min-w-44">
<Typography className="!font-bold">
{t("organizations.tableHeaders.mainContact")}
</Typography>
</TableCell>
<TableCell className="min-w-60">
<Typography className="!font-bold">
{t("organizations.tableHeaders.name")}
Expand Down Expand Up @@ -385,6 +389,11 @@ const LabelDataConfirmationPage = () => {
key={index}
data-testid={`organizations-row-${index}`}
>
<TableCell
data-testid={`organizations-row-${index}-name`}
>
{org.mainContact && <CheckIcon />}
</TableCell>
<TableCell
data-testid={`organizations-row-${index}-name`}
>
Expand Down
Loading

0 comments on commit 3265a96

Please sign in to comment.