diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..acbdf28 --- /dev/null +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index 9b6bc4c..6416a86 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/components/ProductList.vue b/components/ProductList.vue index 863c312..478854d 100644 --- a/components/ProductList.vue +++ b/components/ProductList.vue @@ -4,10 +4,7 @@
{this.tooltips = Tooltips.make({type:"parent", parentSelector: "#product-list-component"});}); this.$nextTick(this.applySameHeight); diff --git a/pages/brands/[slug].vue b/pages/brands/[slug].vue index 2411f1c..1df8fec 100644 --- a/pages/brands/[slug].vue +++ b/pages/brands/[slug].vue @@ -5,11 +5,7 @@
; - 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, chunkSize: number):Array> { const out: Array> = []; let row: Array = []; - 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 = {}, localeToUse: string|null = null): string {