Merge branch 'develop'

This commit is contained in:
Vincent BRIDIER 2025-09-30 15:15:24 +02:00
commit 1303e35981
No known key found for this signature in database
GPG key ID: 8571BFA20420D512
4 changed files with 39 additions and 31 deletions

5
Makefile Normal file
View file

@ -0,0 +1,5 @@
install:
docker run --rm -v ${PWD}:/project electronuserland/builder:wine npm install
build:
docker run --rm -v ${PWD}:/project electronuserland/builder:wine npm run build

View file

@ -65,6 +65,15 @@ showroom-bo-export_25-09-2025_10-15-05.zip
## Production
### Docker way
```bash
make install
make build
```
### Host way
```bash
npm run build
```

View file

@ -4,10 +4,7 @@
<div
v-for="(productPair, productIndex) of chunkInefficient(range.products, 2)"
:key="productIndex"
:class="{
'row justify-content-center': true,
'shelf': displayShelves
}"
:class="{'row justify-content-center': true}"
>
<div
v-for="(product, productPairIndex) of productPair"
@ -96,20 +93,13 @@ export default defineComponent({
},
data(): {
route: RouteLocationNormalizedLoaded;
displayShelves: boolean;
tooltips: Tooltips|null;
} {
return {
route: useRoute(),
displayShelves: this.range.shelf,
tooltips: null
};
},
watch: {
range() {
this.displayShelves = this.range.shelf;
}
},
mounted() {
this.$nextTick(() => {this.tooltips = Tooltips.make({type:"parent", parentSelector: "#product-list-component"});});
this.$nextTick(this.applySameHeight);

View file

@ -5,11 +5,7 @@
<div
v-for="(rangePair, rangePairIndex) of chunkInefficientCustom(brand.ranges, 2)"
:key="rangePairIndex"
:class="{
'row justify-content-center mt-5 pt-5': true,
'mb-5 pb-5': !displayShelves,
'shelf': displayShelves
}"
:class="{'row justify-content-center mt-5 pt-5 mb-5 pb-5': true}"
>
<div
v-for="(range, rangeIndex) of rangePair"
@ -81,7 +77,6 @@ export default defineComponent({
animateTimeout: NodeJS.Timeout|undefined;
animateIndex: number|null;
animations: Array<string>;
displayShelves: boolean;
tooltips: Tooltips|null;
} {
return {
@ -91,7 +86,6 @@ export default defineComponent({
animateTimeout: undefined,
animateIndex: null,
animations: ["heartBeat", "tada", "shakeX", "rubberBand"],
displayShelves: false,
tooltips: null
};
},
@ -105,7 +99,6 @@ export default defineComponent({
return ;
}
this.brand = brand;
this.displayShelves = this.brand.shelf;
const firstRange = this.brand.ranges.at(0);
@ -139,21 +132,32 @@ export default defineComponent({
chunkInefficientCustom(ranges: Array<TypeRange>, chunkSize: number):Array<Array<TypeRange>> {
const out: Array<Array<TypeRange>> = [];
let row: Array<TypeRange> = [];
ranges.forEach((range: TypeRange, i: number) => {
if (range.width === 2) {
if(row.length) {
ranges
.sort((a, b) => a.order - b.order)
.forEach((range, _i) => {
// Handle special width=2 case immediately
if (range.width === 2) {
if (row.length > 0) {
out.push(row);
row = [];
}
out.push([range]);
return;
}
// Add to current row
row.push(range);
// Push row if it reaches chunk size
if (row.length === chunkSize) {
out.push(row);
row = [];
}
out.push([range]);
return;
}
row.push(range);
if (i % chunkSize) {
out.push(row);
row = [];
}
});
});
// Push any remaining elements
if (row.length > 0) {
out.push(row);
}
return out;
},
t(text: string, params: Record<string,string> = {}, localeToUse: string|null = null): string {