Compare commits
8 commits
bcdfc346d6
...
75382aec22
| Author | SHA1 | Date | |
|---|---|---|---|
| 75382aec22 | |||
| cefb34caa7 | |||
| ea0dee406e | |||
| 626ae51247 | |||
| 1455d81b3b | |||
| f986f91f81 | |||
| 4c4528c770 | |||
| b54a4b64b2 |
|
|
@ -3,7 +3,8 @@
|
||||||
"authors": [],
|
"authors": [],
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"HaikuAtelier\\": "web/app/themes/haiku-atelier-2024/src/inc/"
|
"HaikuAtelier\\": "web/app/themes/haiku-atelier-2024/src/inc/",
|
||||||
|
"WooCommerce\\": "web/app/plugins/woocommerce"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
|
|
|
||||||
|
|
@ -292,12 +292,9 @@ button {
|
||||||
button.bouton-case-pleine {
|
button.bouton-case-pleine {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
font-style: italic;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: var(--espacement-inter-lettres-etendu-m);
|
|
||||||
}
|
}
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
button.bouton-case-pleine:not(:disabled):hover {
|
button.bouton-case-pleine:hover {
|
||||||
color: var(--couleur-noir);
|
color: var(--couleur-noir);
|
||||||
background: var(--arriere-plan-points);
|
background: var(--arriere-plan-points);
|
||||||
}
|
}
|
||||||
|
|
@ -317,7 +314,7 @@ button.bouton-inverse:disabled {
|
||||||
color: var(--couleur-blanc);
|
color: var(--couleur-blanc);
|
||||||
}
|
}
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
button.bouton-inverse:not(:disabled):hover {
|
button.bouton-inverse:hover {
|
||||||
color: var(--couleur-noir);
|
color: var(--couleur-noir);
|
||||||
background: var(--arriere-plan-points);
|
background: var(--arriere-plan-points);
|
||||||
}
|
}
|
||||||
|
|
@ -347,13 +344,13 @@ button.bouton-retour-haut[data-actif] {
|
||||||
opacity: 50%;
|
opacity: 50%;
|
||||||
}
|
}
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
button.bouton-retour-haut[data-actif]:not(:disabled):hover {
|
button.bouton-retour-haut[data-actif]:hover {
|
||||||
opacity: 100%;
|
opacity: 100%;
|
||||||
background: var(--couleur-gris-fond);
|
background: var(--couleur-gris-fond);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
button:not(:disabled):hover {
|
button:hover {
|
||||||
color: var(--couleur-blanc);
|
color: var(--couleur-blanc);
|
||||||
background: var(--couleur-gris-fonce);
|
background: var(--couleur-gris-fonce);
|
||||||
}
|
}
|
||||||
|
|
@ -1477,6 +1474,8 @@ body:has(#menu-mobile:not([aria-hidden="true"])) {
|
||||||
}
|
}
|
||||||
.details-produit__actions button {
|
.details-produit__actions button {
|
||||||
padding: var(--section-marges-internes);
|
padding: var(--section-marges-internes);
|
||||||
|
font-style: italic;
|
||||||
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
.details-produit__actions button:not([disabled]):hover {
|
.details-produit__actions button:not([disabled]):hover {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,12 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
#page-boutique .actions button {
|
#page-boutique .actions button {
|
||||||
|
height: initial;
|
||||||
|
margin: auto;
|
||||||
padding: var(--espace-xl) 0;
|
padding: var(--espace-xl) 0;
|
||||||
|
font-style: italic;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: var(--espacement-inter-lettres-etendu-m);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* # sourceMappingURL=page-boutique.css.map */
|
/* # sourceMappingURL=page-boutique.css.map */
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
{"version":3,"sourceRoot":"","sources":["../../../src/sass/pages/page-boutique.scss"],"names":[],"mappings":"AAGE;EACE;EACA;EACA;;AAEA;EACE","file":"page-boutique.css"}
|
{"version":3,"sourceRoot":"","sources":["../../../src/sass/pages/page-boutique.scss"],"names":[],"mappings":"AAGE;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA","file":"page-boutique.css"}
|
||||||
|
|
@ -1 +1 @@
|
||||||
#page-boutique .actions{text-align:center;align-content:center;width:100%}#page-boutique .actions button{padding:var(--espace-xl) 0}
|
#page-boutique .actions{text-align:center;align-content:center;width:100%}#page-boutique .actions button{height:initial;padding:var(--espace-xl) 0;text-transform:uppercase;letter-spacing:var(--espacement-inter-lettres-etendu-m);margin:auto;font-style:italic}
|
||||||
|
|
@ -385,23 +385,11 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 2px;
|
letter-spacing: 2px;
|
||||||
border-block: 1px solid var(--couleur-noir);
|
background: var(--couleur-noir);
|
||||||
border-block-end: 0;
|
|
||||||
background: var(--arriere-plan-points);
|
|
||||||
}
|
|
||||||
#panneau-informations-client .panneau__pied-de-page:has(button[disabled]) {
|
|
||||||
background: var(--couleur-gris-fond);
|
|
||||||
}
|
}
|
||||||
#panneau-informations-client .panneau__pied-de-page button {
|
#panneau-informations-client .panneau__pied-de-page button {
|
||||||
padding: var(--espace-l) 0;
|
padding: var(--espace-l) 0;
|
||||||
}
|
}
|
||||||
@media (hover: hover) {
|
|
||||||
#panneau-informations-client .panneau__pied-de-page button:not([disabled]):hover {
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--couleur-blanc);
|
|
||||||
background: var(--couleur-gris-fonce-fond);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@media (width <= 500px) {
|
@media (width <= 500px) {
|
||||||
#panneau-informations-client .panneau__formulaires {
|
#panneau-informations-client .panneau__formulaires {
|
||||||
padding: var(--espace-xl) 0;
|
padding: var(--espace-xl) 0;
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
{"version":3,"sourceRoot":"","sources":["../../../src/sass/layouts/_panneau-panier.scss","../../../src/sass/layouts/_panneau-informations-client.scss","../../../src/sass/pages/page-panier.scss"],"names":[],"mappings":";AAEA;EACE;;AAEA;EACE;;AAIF;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAGA;EACE;;AAEA;EACE;EACA;;AAGF;EACE;EACA;;AAMN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAIJ;EACE;EACA;;AAIF;EACE;EACA;EACA;EACA;EACA;AAEA;;AACA;EACE;EACA;EACA;EACA;EACA;;AAbJ;AAgBE;AAAA;AAAA;AAAA;;AAIA;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AA9BN;AAkCE;;AACA;EACE;EACA;EACA;EACA;EACA;;AAxCJ;AA2CE;;AACA;EACE;EACA;EACA;EACA;EACA;;AAOR;EACE;EACA;EACA;EACA;AAEA;AAAA;AAAA;AAAA;;AAIA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;AAEA;AAAA;AAAA;;AAGA;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;;AAKN;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAKA;EACE;;AAEA;EACE;;AAMR;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAMJ;EACE;EACA;EACA;EACA;EACA;;AAKJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAIJ;EACE;IACE;;EAGF;IACE;;EAEA;IACE;;EAIJ;IACE;;EAGE;IACE;;EAKN;IACE;;;;ACpRN;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAIF;EAEE;EACA;EACA;EAGA;EAEA;EACA;;AAEA;EACE;EACA;;AAIF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAGF;EACE;;AAMN;EACE;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAKF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGE;EACE;;AAMR;EACE;EACA;EACA;;AAIJ;EACE;EACA;;AAEA;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAKN;EACE;EACA;EACA;;AAEA;EACE;;AAIJ;EACE;;AAKJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGA;EACE;;AAGF;EACE;;AAGE;EACE;IACE;IACA;IACA;;;AAOV;EACE;IACE;;;;AClLN;AAAA;AAAA;AAAA;AAIA;AACE;EACA;AAEA;EACA;EAEA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAGA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAKN;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;EACA;;AAKF;EACE;;AAGF;EACE","file":"page-panier.css"}
|
{"version":3,"sourceRoot":"","sources":["../../../src/sass/layouts/_panneau-panier.scss","../../../src/sass/layouts/_panneau-informations-client.scss","../../../src/sass/pages/page-panier.scss"],"names":[],"mappings":";AAEA;EACE;;AAEA;EACE;;AAIF;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAGA;EACE;;AAEA;EACE;EACA;;AAGF;EACE;EACA;;AAMN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAIJ;EACE;EACA;;AAIF;EACE;EACA;EACA;EACA;EACA;AAEA;;AACA;EACE;EACA;EACA;EACA;EACA;;AAbJ;AAgBE;AAAA;AAAA;AAAA;;AAIA;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AA9BN;AAkCE;;AACA;EACE;EACA;EACA;EACA;EACA;;AAxCJ;AA2CE;;AACA;EACE;EACA;EACA;EACA;EACA;;AAOR;EACE;EACA;EACA;EACA;AAEA;AAAA;AAAA;AAAA;;AAIA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;AAEA;AAAA;AAAA;;AAGA;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;;AAKN;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAKA;EACE;;AAEA;EACE;;AAMR;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAMJ;EACE;EACA;EACA;EACA;EACA;;AAKJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAIJ;EACE;IACE;;EAGF;IACE;;EAEA;IACE;;EAIJ;IACE;;EAGE;IACE;;EAKN;IACE;;;;ACpRN;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAIF;EAEE;EACA;EACA;EAGA;EAEA;EACA;;AAEA;EACE;EACA;;AAIF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAGF;EACE;;AAMN;EACE;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAKF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGE;EACE;;AAMR;EACE;EACA;EACA;;AAIJ;EACE;EACA;;AAEA;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAKN;EACE;EACA;EACA;;AAEA;EACE;;AAIJ;EACE;;AAKJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAIJ;EACE;IACE;;;;ACjKN;AAAA;AAAA;AAAA;AAIA;AACE;EACA;AAEA;EACA;EAEA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAGA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAKN;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;EACA;;AAKF;EACE;;AAGF;EACE","file":"page-panier.css"}
|
||||||
|
|
@ -32,7 +32,7 @@ final readonly class Attribute {
|
||||||
|
|
||||||
/** @var list<AttributeOption> */
|
/** @var list<AttributeOption> */
|
||||||
$options = Arr::map($terms, AttributeOption::new(...))
|
$options = Arr::map($terms, AttributeOption::new(...))
|
||||||
|> (static fn($options) => Arr::sort($options, static fn($attribute) => $attribute->name))
|
|> (static fn($options) => Arr::sort($options, static fn($attribute) => $attribute->id))
|
||||||
|> array_values(...);
|
|> array_values(...);
|
||||||
|
|
||||||
return new self(name: $name, slug: $slug, options: $options);
|
return new self(name: $name, slug: $slug, options: $options);
|
||||||
|
|
|
||||||
|
|
@ -31,16 +31,13 @@ button {
|
||||||
|
|
||||||
/* Particularismes. */
|
/* Particularismes. */
|
||||||
|
|
||||||
// Bouton occuputant tout l'espace disponible.
|
// Bouton prenant toute l'espace disponible.
|
||||||
&.bouton-case-pleine {
|
&.bouton-case-pleine {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
font-style: italic;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: var(--espacement-inter-lettres-etendu-m);
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
&:not(:disabled):hover {
|
&:hover {
|
||||||
color: var(--couleur-noir);
|
color: var(--couleur-noir);
|
||||||
background: var(--arriere-plan-points);
|
background: var(--arriere-plan-points);
|
||||||
}
|
}
|
||||||
|
|
@ -66,7 +63,7 @@ button {
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
&:not(:disabled):hover {
|
&:hover {
|
||||||
color: var(--couleur-noir);
|
color: var(--couleur-noir);
|
||||||
background: var(--arriere-plan-points);
|
background: var(--arriere-plan-points);
|
||||||
}
|
}
|
||||||
|
|
@ -100,7 +97,7 @@ button {
|
||||||
opacity: 50%;
|
opacity: 50%;
|
||||||
|
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
&:not(:disabled):hover {
|
&:hover {
|
||||||
opacity: 100%;
|
opacity: 100%;
|
||||||
background: var(--couleur-gris-fond);
|
background: var(--couleur-gris-fond);
|
||||||
}
|
}
|
||||||
|
|
@ -109,7 +106,7 @@ button {
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
&:not(:disabled):hover {
|
&:hover {
|
||||||
color: var(--couleur-blanc);
|
color: var(--couleur-blanc);
|
||||||
background: var(--couleur-gris-fonce);
|
background: var(--couleur-gris-fonce);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -216,15 +216,17 @@
|
||||||
background: var(--arriere-plan-points);
|
background: var(--arriere-plan-points);
|
||||||
transition: 0.2s background;
|
transition: 0.2s background;
|
||||||
|
|
||||||
// Indique un Bouton désactivé avec un fond gris en-dessous du fond à motif.
|
// Indique un Bouton désactivé avec un fond gris en-dessous du fond à motif
|
||||||
&:has(button[disabled]) {
|
&:has(button[disabled]) {
|
||||||
background: var(--couleur-gris-fond);
|
background: var(--couleur-gris-fond);
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
padding: var(--section-marges-internes);
|
padding: var(--section-marges-internes);
|
||||||
|
font-style: italic;
|
||||||
|
text-transform: uppercase;
|
||||||
|
|
||||||
// Change la casse de la police au survol quand le Bouton n'est pas désactivé.
|
// Change la casse de la police au survol quand le Bouton n'est pas désactivé
|
||||||
&:not([disabled]) {
|
&:not([disabled]) {
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|
|
||||||
|
|
@ -155,27 +155,10 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 2px;
|
letter-spacing: 2px;
|
||||||
border-block: 1px solid var(--couleur-noir);
|
background: var(--couleur-noir);
|
||||||
border-block-end: 0;
|
|
||||||
background: var(--arriere-plan-points);
|
|
||||||
|
|
||||||
// Indique un Bouton désactivé avec un fond gris en-dessous du fond à motif
|
|
||||||
&:has(button[disabled]) {
|
|
||||||
background: var(--couleur-gris-fond);
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
button {
|
||||||
padding: var(--espace-l) 0;
|
padding: var(--espace-l) 0;
|
||||||
|
|
||||||
&:not([disabled]) {
|
|
||||||
@media (hover: hover) {
|
|
||||||
&:hover {
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--couleur-blanc);
|
|
||||||
background: var(--couleur-gris-fonce-fond);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,12 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
|
height: initial;
|
||||||
|
margin: auto;
|
||||||
padding: var(--espace-xl) 0;
|
padding: var(--espace-xl) 0;
|
||||||
|
font-style: italic;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: var(--espacement-inter-lettres-etendu-m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Console, Context, Effect, Layer, Match, pipe, Schedule, Schema, SchemaIssue } from "effect";
|
import { Console, Context, Effect, Layer, Match, pipe, References, Schedule, Schema, SchemaIssue } from "effect";
|
||||||
import type { SchemaError } from "effect/Schema";
|
import type { SchemaError } from "effect/Schema";
|
||||||
import type {
|
import type {
|
||||||
HttpClientError,
|
HttpClientError,
|
||||||
|
|
@ -13,7 +13,6 @@ import { HttpClientErrorSchema } from "effect/unstable/http/HttpClientError";
|
||||||
import type { CartProduct, GetProducts } from "../schemas/api.ts";
|
import type { CartProduct, GetProducts } from "../schemas/api.ts";
|
||||||
import { Product } from "../schemas/api.ts";
|
import { Product } from "../schemas/api.ts";
|
||||||
import { WooCommerceCart } from "../schemas/cart.ts";
|
import { WooCommerceCart } from "../schemas/cart.ts";
|
||||||
import { AppConfig, Provider } from "./config.ts";
|
|
||||||
|
|
||||||
/** Le nombre maximal d'essais pour une Requête. */
|
/** Le nombre maximal d'essais pour une Requête. */
|
||||||
const MAX_RETRIES = 3;
|
const MAX_RETRIES = 3;
|
||||||
|
|
@ -82,8 +81,6 @@ class APIClient extends Context.Service<APIClient>()("haikuatelier.fr/APIClient"
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
const config = yield* AppConfig.parse(Provider);
|
|
||||||
|
|
||||||
const matchAPIError = (error: HttpClientError.HttpClientError | SchemaError): APIError => {
|
const matchAPIError = (error: HttpClientError.HttpClientError | SchemaError): APIError => {
|
||||||
if (error._tag === "SchemaError") {
|
if (error._tag === "SchemaError") {
|
||||||
return new APIRequestError({
|
return new APIRequestError({
|
||||||
|
|
@ -129,6 +126,9 @@ class APIClient extends Context.Service<APIClient>()("haikuatelier.fr/APIClient"
|
||||||
Effect.flatMap(HttpClientResponse.schemaBodyJson(WooCommerceCart)),
|
Effect.flatMap(HttpClientResponse.schemaBodyJson(WooCommerceCart)),
|
||||||
Effect.mapError(error => matchAPIError(error)),
|
Effect.mapError(error => matchAPIError(error)),
|
||||||
Effect.tapError(error => printErrorAsSuccinctMessage(error)),
|
Effect.tapError(error => printErrorAsSuccinctMessage(error)),
|
||||||
|
// Effect.catchTag("APIResponseError", error => {
|
||||||
|
// if (error.cause.)
|
||||||
|
// }),
|
||||||
);
|
);
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
|
|
@ -142,8 +142,8 @@ class APIClient extends Context.Service<APIClient>()("haikuatelier.fr/APIClient"
|
||||||
HttpClientRequest.setHeader("Nonce", nonce),
|
HttpClientRequest.setHeader("Nonce", nonce),
|
||||||
// TODO: Utiliser l'environnement
|
// TODO: Utiliser l'environnement
|
||||||
HttpClientRequest.basicAuth(
|
HttpClientRequest.basicAuth(
|
||||||
config.WOOCOMMERCE_API_CONSUMER_KEY,
|
"ck_ed966a2265099a6dfe9915db692cbd2450cceed6",
|
||||||
config.WOOCOMMERCE_API_CONSUMER_SECRET,
|
"cs_a046c91647af95188a3e39a736ebe02f2024e430",
|
||||||
),
|
),
|
||||||
// Le corps de la Requête a été validée en amont, on peut utiliser Unsafe.
|
// Le corps de la Requête a été validée en amont, on peut utiliser Unsafe.
|
||||||
HttpClientRequest.setUrlParams(queryParams),
|
HttpClientRequest.setUrlParams(queryParams),
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
/**
|
|
||||||
* `Config<A>` décrit la Configuration nécessaire. `ConfigProvider` est le _backend_ qui la charge. Par défault, la Configuration est lue depuis les variables d'environnement, mais d'autres sources peuvent être utilisées.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { Config, ConfigProvider } from "effect";
|
|
||||||
|
|
||||||
const AppConfig = Config.all({
|
|
||||||
WOOCOMMERCE_API_CONSUMER_KEY: Config.redacted("WOOCOMMERCE_API_CONSUMER_KEY"),
|
|
||||||
WOOCOMMERCE_API_CONSUMER_SECRET: Config.redacted("WOOCOMMERCE_API_CONSUMER_SECRET"),
|
|
||||||
});
|
|
||||||
|
|
||||||
const Provider = ConfigProvider.fromUnknown({
|
|
||||||
WOOCOMMERCE_API_CONSUMER_KEY: "ck_329c944b248aa7cc837c7662d9c6e09d638802df",
|
|
||||||
WOOCOMMERCE_API_CONSUMER_SECRET: "cs_5687d0c694bd519b231145afa7177c0c987f7155",
|
|
||||||
});
|
|
||||||
|
|
||||||
export { AppConfig, Provider };
|
|
||||||
|
|
@ -11,7 +11,7 @@ const ShopPageRuntime = ManagedRuntime.make(
|
||||||
Layer.provideMerge(ShopPageMessages.Live),
|
Layer.provideMerge(ShopPageMessages.Live),
|
||||||
Layer.provideMerge(ShopPageElements.Live),
|
Layer.provideMerge(ShopPageElements.Live),
|
||||||
Layer.provide(APIClient.Live),
|
Layer.provide(APIClient.Live),
|
||||||
Layer.tapError(error => Console.error("ProductPageRuntime", "Impossible de créer le Layer :", error.message)),
|
Layer.tapError(error => Console.error("ProductPageRuntime", "Impossible de créer le Layer :", error)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
export default ShopPageRuntime;
|
export default ShopPageRuntime;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import {
|
import {
|
||||||
Array as FxArray,
|
Array as FxArray,
|
||||||
|
Console,
|
||||||
Context,
|
Context,
|
||||||
Effect,
|
Effect,
|
||||||
Layer,
|
Layer,
|
||||||
|
|
@ -117,6 +118,8 @@ class ShopPageDOM extends Context.Service<ShopPageDOM>()("haikuatelier.fr/Shop/S
|
||||||
};
|
};
|
||||||
|
|
||||||
const onMoreProductsWantedHandler = Effect.fn("onMoreProductsWantedHandler")(function*() {
|
const onMoreProductsWantedHandler = Effect.fn("onMoreProductsWantedHandler")(function*() {
|
||||||
|
yield* Console.debug("onMoreProductsWantedHandler");
|
||||||
|
|
||||||
/** Le numéro de page souhaitée. */
|
/** Le numéro de page souhaitée. */
|
||||||
const newPageNumber = yield* Ref.updateAndGet(PageNumber, pageNumber => pageNumber + 1);
|
const newPageNumber = yield* Ref.updateAndGet(PageNumber, pageNumber => pageNumber + 1);
|
||||||
/** L'ID de la Catégorie de Produits affichée dans la page si elle existe. */
|
/** L'ID de la Catégorie de Produits affichée dans la page si elle existe. */
|
||||||
|
|
@ -134,6 +137,7 @@ class ShopPageDOM extends Context.Service<ShopPageDOM>()("haikuatelier.fr/Shop/S
|
||||||
yield* SubscriptionRef.set(ShowMoreButtonText, "Getting Products...");
|
yield* SubscriptionRef.set(ShowMoreButtonText, "Getting Products...");
|
||||||
|
|
||||||
const newProducts = yield* API.GetProducts(nonce, requestBody);
|
const newProducts = yield* API.GetProducts(nonce, requestBody);
|
||||||
|
yield* Console.debug("onMoreProductsWantedHandler", newProducts);
|
||||||
|
|
||||||
// Rétablis le texte du Bouton et réactive les interactions.
|
// Rétablis le texte du Bouton et réactive les interactions.
|
||||||
yield* SubscriptionRef.set(ShowMoreButtonText, "Show more");
|
yield* SubscriptionRef.set(ShowMoreButtonText, "Show more");
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,17 @@ import ShopPageElements from "./page-boutique/service-elements.ts";
|
||||||
import ShopPageMessages from "./page-boutique/service-messages.ts";
|
import ShopPageMessages from "./page-boutique/service-messages.ts";
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", (): void => {
|
document.addEventListener("DOMContentLoaded", (): void => {
|
||||||
|
console.debug("scripts-page-boutique");
|
||||||
// initialisePageBoutique();
|
// initialisePageBoutique();
|
||||||
ShopPageRuntime.runFork(Effect.gen(function*() {
|
ShopPageRuntime.runFork(Effect.gen(function*() {
|
||||||
const Elements = yield* ShopPageElements;
|
const Elements = yield* ShopPageElements;
|
||||||
const DOM = yield* ShopPageDOM;
|
const DOM = yield* ShopPageDOM;
|
||||||
const Messages = yield* ShopPageMessages;
|
const Messages = yield* ShopPageMessages;
|
||||||
|
|
||||||
yield* Effect.all([DOM.initMoreProductsOnButtonClick(), Messages.initShowMoreButtonUpdates()], {
|
yield* Effect.all([DOM.initLoadMoreProductsOnButtonClick(), Messages.initShowMoreButtonUpdates()], {
|
||||||
concurrency: "unbounded",
|
concurrency: "unbounded",
|
||||||
}).pipe(Effect.tapCause(Console.error));
|
}).pipe(Effect.tapCause(Console.error));
|
||||||
|
|
||||||
|
console.debug(Elements.ProductsGrid);
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@
|
||||||
|
|
||||||
<footer class="panneau__pied-de-page">
|
<footer class="panneau__pied-de-page">
|
||||||
<button
|
<button
|
||||||
class="bouton-case-pleine" form="formulaire-commande"
|
class="bouton-case-pleine bouton-inverse" form="formulaire-commande"
|
||||||
type="submit"
|
type="submit"
|
||||||
>
|
>
|
||||||
Calculate shipping
|
Calculate shipping
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 9 KiB |
|
Before Width: | Height: | Size: 9 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 6 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 7.9 KiB |