Skip to content

Commit

Permalink
feat: Distinguish Objects from Veli. (#813)
Browse files Browse the repository at this point in the history
Add a Veli menu entry and add scope information to Veli examples to help
distinguish them from other Objects.

---------

Co-authored-by: paulboosz <paulboosz@gmail.com>
  • Loading branch information
n1k0 and paulboosz authored Oct 31, 2024
1 parent f46347c commit 8709b01
Show file tree
Hide file tree
Showing 26 changed files with 416 additions and 126 deletions.
3 changes: 2 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENCRYPTION_KEY=please-change-this-with-32-chars
EMAIL_HOST_PASSWORD=please-change-this
EMAIL_HOST_USER=please-change-this
ENABLE_FOOD_SECTION=True
ENABLE_OBJECT_SECTION=True
ENABLE_OBJECTS_SECTION=True
ENABLE_VELI_SECTION=True
MATOMO_HOST=stats.beta.gouv.fr
MATOMO_SITE_ID=57
MATOMO_TOKEN=xxx
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ Les variables d'environnement suivantes doivent être définies :
- `EMAIL_HOST_USER`: l'utilisateur du compte SMTP
- `EMAIL_HOST_PASSWORD` : le mot de passe du compte SMTP pour envoyer les mail liés à l'authentification
- `ENABLE_FOOD_SECTION` : affichage ou non de la section expérimentale dédiée à l'alimentaire (valeur `True` ou `False`, par défault `False`)
- `ENABLE_OBJECT_SECTION` : affichage ou non de la section expérimentale dédiée aux objets génériques (valeur `True` ou `False`, par défault `False`)
- `ENABLE_OBJECTS_SECTION` : affichage ou non de la section expérimentale dédiée aux objets génériques (valeur `True` ou `False`, par défault `False`)
- `ENABLE_VELI_SECTION` : affichage ou non de la section expérimentale dédiée aux véhicules intermédiaires (valeur `True` ou `False`, par défault `False`)
- `MATOMO_HOST`: le domaine de l'instance Matomo permettant le suivi d'audience du produit (typiquement `stats.beta.gouv.fr`).
- `MATOMO_SITE_ID`: l'identifiant du site Ecobalyse sur l'instance Matomo permettant le suivi d'audience du produit.
- `MATOMO_TOKEN`: le token Matomo permettant le suivi d'audience du produit.
Expand Down
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ const storeKey = "store";
const app = Elm.Main.init({
flags: {
clientUrl: location.origin + location.pathname,
enableFoodSection: process.env.ENABLE_FOOD_SECTION === "True",
enableObjectSection: process.env.ENABLE_OBJECT_SECTION === "True",
enabledSections: {
food: process.env.ENABLE_FOOD_SECTION === "True",
objects: process.env.ENABLE_OBJECTS_SECTION === "True",
textile: true, // always enabled
veli: process.env.ENABLE_VELI_SECTION === "True",
},
rawStore: localStorage[storeKey] || "null",
matomo: {
host: process.env.MATOMO_HOST || "",
Expand Down
16 changes: 16 additions & 0 deletions public/data/food/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"id": "1d04242a-6312-4d92-9233-8b485d128e65",
"name": "Produit vide",
"scope": "food",
"category": "",
"query": {
"ingredients": []
Expand All @@ -10,6 +11,7 @@
{
"id": "b2b9f235-e7c4-4727-aa7a-1f7c8b5a9812",
"name": "Farine de blé bio FR (1kg) - 20",
"scope": "food",
"category": "Produits céréaliers",
"query": {
"ingredients": [
Expand All @@ -31,6 +33,7 @@
{
"id": "3c7d4110-6064-45a2-a7de-6649fa72ca1a",
"name": "Farine de blé FR (1kg) - 22",
"scope": "food",
"category": "Produits céréaliers",
"query": {
"ingredients": [
Expand All @@ -52,6 +55,7 @@
{
"id": "e2de4127-69e0-4436-b814-efb648ac9ff7",
"name": "Farine de blé origine Ukraine (1kg) - 22",
"scope": "food",
"category": "Produits céréaliers",
"query": {
"ingredients": [
Expand All @@ -72,6 +76,7 @@
{
"id": "55539367-a21b-4da1-8009-e2620c18404f",
"name": "Filets de poulet FR (250g) - 96",
"scope": "food",
"category": "Volaille",
"query": {
"ingredients": [
Expand All @@ -94,6 +99,7 @@
{
"id": "af215046-d6af-470c-975f-643ad0be35e5",
"name": "Filets de poulet origine Brésil (250g) - 100",
"scope": "food",
"category": "Volaille",
"query": {
"ingredients": [
Expand All @@ -116,6 +122,7 @@
{
"id": "b9966def-463f-4ad0-b225-5da94f80de73",
"name": "Pizza bolognese (375g) - 21",
"scope": "food",
"category": "Produit surgelé",
"query": {
"ingredients": [
Expand Down Expand Up @@ -181,6 +188,7 @@
{
"id": "6fb777d4-eae2-4594-9f0c-7fc4e2853b97",
"name": "Pizza bolognese FR (375g) - 21",
"scope": "food",
"category": "Produit surgelé",
"query": {
"ingredients": [
Expand Down Expand Up @@ -257,6 +265,7 @@
{
"id": "786839bf-f348-4609-b2d4-75d3f35c692d",
"name": "Pizza bolognese FR bio (375g) - 21",
"scope": "food",
"category": "Produit surgelé",
"query": {
"ingredients": [
Expand Down Expand Up @@ -333,6 +342,7 @@
{
"id": "4ce49252-07c4-4e2a-a451-dc26f1550889",
"name": "Pizza royale (350g) - 6",
"scope": "food",
"category": "Produit surgelé",
"query": {
"ingredients": [
Expand Down Expand Up @@ -390,6 +400,7 @@
{
"id": "d97ee8a2-1e8b-425c-9ea4-c1d67d2640f9",
"name": "Pizza royale FR (350g) - 6",
"scope": "food",
"category": "Produit surgelé",
"query": {
"ingredients": [
Expand Down Expand Up @@ -455,6 +466,7 @@
{
"id": "1a2911dd-d32b-4e4e-9c31-a5eceaea66bb",
"name": "Pizza végétale (385g) - 19",
"scope": "food",
"category": "Produit surgelé",
"query": {
"ingredients": [
Expand Down Expand Up @@ -520,6 +532,7 @@
{
"id": "dafff308-db3f-4c3d-aa9c-b626c1b4ae17",
"name": "Pizza végétale FR (385g) - 19",
"scope": "food",
"category": "Produit surgelé",
"query": {
"ingredients": [
Expand Down Expand Up @@ -595,6 +608,7 @@
{
"id": "b375f93b-b8c2-4849-ab32-8a731a8212ca",
"name": "Steak haché surgelé origine Brésil (200g) - 82",
"scope": "food",
"category": "Viande bovine",
"query": {
"ingredients": [
Expand All @@ -617,6 +631,7 @@
{
"id": "f5872248-3fa2-49cd-928e-df1adb9c7094",
"name": "Steak haché surgelé FR (250g) - 95",
"scope": "food",
"category": "Viande bovine",
"query": {
"ingredients": [
Expand All @@ -639,6 +654,7 @@
{
"id": "2fd25fd5-48fa-49b5-b5f2-e9b1fc5db166",
"name": "Steak haché surgelé bio FR (200g) - 78",
"scope": "food",
"category": "Viande bovine",
"query": {
"ingredients": [
Expand Down
28 changes: 27 additions & 1 deletion public/data/object/examples.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
[
{
"id": "0d08a9ff-5683-4d3d-a7b8-dce74f37cd3b",
"name": "Produit vide",
"name": "Objet par défaut",
"scope": "object",
"category": "",
"query": {
"processes": []
}
},
{
"id": "cefc2585-7125-4610-aadc-69970a3d67d1",
"name": "Véhicule intermédiaire par défaut",
"scope": "veli",
"category": "",
"query": {
"processes": []
Expand All @@ -10,6 +20,7 @@
{
"id": "7d78d30e-7c35-451f-b8ab-e590f39ed0e8",
"name": "Chaise",
"scope": "object",
"category": "",
"query": {
"processes": [
Expand All @@ -27,6 +38,7 @@
{
"id": "4d14194a-8c62-4c23-8799-745c498d1f6b",
"name": "Table",
"scope": "object",
"category": "",
"query": {
"processes": [
Expand All @@ -36,5 +48,19 @@
}
]
}
},
{
"id": "b5aeadf6-95f2-4ee2-b528-899b54f62a20",
"name": "VAE",
"scope": "veli",
"category": "",
"query": {
"processes": [
{
"process_id": "3295b2a5-328a-4c00-b046-e2ddeb0da823",
"amount": 35
}
]
}
}
]
Loading

0 comments on commit 8709b01

Please sign in to comment.