Refactor PVC models and update tests

- Updated the PVC models in the database and adjusted the tests accordingly to reflect the new model counts and codes.
- Removed deprecated models from the JSON data for PVC systems.
- Added new GLB models for "scorrevole_sf_3_ante" and "scorrevole_sf_4_ante".
- Enhanced the development scripts to streamline the build process for both frontends.
- Updated documentation to reflect changes in the development environment and deployment process.
- Improved the styling of texture radio options for better visibility.
- Fixed URL handling in the configurator to ensure proper routing and API calls.
This commit is contained in:
2026-10-20 18:40:59 +02:00
parent b6a32edfe6
commit 0dfda3a338
33 changed files with 339 additions and 366 deletions
-32
View File
@@ -236,22 +236,6 @@
"vetro"
]
},
{
"id": "scorrevole_sf_1_anta",
"nome": "Scorrevole SF 1 Anta",
"cartella": "scorrevole_sf_1_anta",
"modello": "scorrevole_sf_1_anta.glb",
"categoria": "scorrevoli",
"enabled": true,
"cartella_texture": "finestra_2_ante",
"moduli": [
"cerniere",
"listino",
"maniglia",
"modello",
"vetro"
]
},
{
"id": "scorrevole_sf_2_ante",
"nome": "Scorrevole SF 2 Ante",
@@ -284,22 +268,6 @@
"vetro"
]
},
{
"id": "scorrevole_parallelo_1_anta",
"nome": "Scorrevole Parallelo 1 Anta",
"cartella": "scorrevole_parallelo_1_anta",
"modello": "scorrevole_parallelo_1_anta.glb",
"categoria": "scorrevoli",
"enabled": true,
"cartella_texture": "finestra_2_ante",
"moduli": [
"cerniere",
"listino",
"maniglia",
"modello",
"vetro"
]
},
{
"id": "bilico",
"nome": "Bilico Orizzontale",
Binary file not shown.
Binary file not shown.
+6
View File
@@ -383,6 +383,12 @@ body {
width: 21%;
}
/* Contorno leggero: altrimenti le finiture chiare (es. bianco) non si distinguono dallo sfondo */
.texture-radio .option-content img {
box-sizing: border-box;
border: 1px solid #d0d0d0;
}
.option-label {
margin-top: 0px;
font-size: 11px;
+5
View File
@@ -2,6 +2,11 @@
<html lang="en">
<head>
<script>
// I path runtime sono relativi (./assets/...): servono l'URL con lo slash finale. Apache/nginx
// reindirizzano /configuratore -> /configuratore/, il server PHP di sviluppo no.
if (!location.pathname.endsWith('/')) history.replaceState(null, '', location.pathname + '/' + location.search + location.hash);
</script>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
+4 -4
View File
@@ -1,7 +1,7 @@
// Base URL dell'API Laravel: impostata in build (import.meta.env.VITE_PREVENTIVI_API_BASE, da
// .env/.env.production — vedi root del repo), sovrascrivibile a runtime con window.PREVENTIVI_API_BASE
// senza dover rebuildare (es. per un hotfix). Nessuna delle due impostata → fallback dev locale.
// Base URL dell'API Laravel. Il configuratore è servito dallo stesso backend (/configuratore/),
// quindi di default l'API è sulla stessa origine. Sovrascrivibile a build time con
// import.meta.env.VITE_PREVENTIVI_API_BASE o a runtime con window.PREVENTIVI_API_BASE.
export const API_BASE =
(typeof window.PREVENTIVI_API_BASE === 'string' && window.PREVENTIVI_API_BASE) ||
import.meta.env.VITE_PREVENTIVI_API_BASE ||
'http://localhost:8000/api';
`${window.location.origin}/api`;
+15
View File
@@ -257,6 +257,21 @@ const buildListaModelli = (modelli, modello, categoria, sistema) => {
});
$('.lista-modelli').html(html);
// Porta in vista il modello selezionato: le icone si caricano in modo asincrono e ne cambiano la
// larghezza, quindi si ricalcola anche a ogni load (solo scroll orizzontale, niente scrollIntoView
// che scorrerebbe anche la pagina/iframe).
const scrollToSelected = () => {
document.querySelectorAll('.lista-modelli').forEach(lista => {
const sel = lista.querySelector('img.selected');
if (!sel) return;
const item = sel.closest('.btn-categoria');
const delta = item.getBoundingClientRect().left - lista.getBoundingClientRect().left;
lista.scrollLeft += delta - (lista.clientWidth - item.offsetWidth) / 2;
});
};
scrollToSelected();
$('.lista-modelli img').one('load', scrollToSelected);
}
const buildSelect = (options, parent) => {
+4 -5
View File
@@ -25,12 +25,11 @@ window.GLTFLoader = GLTFLoader; // Used by APP Scripts.
// --- Integrazione backend preventivi ---
const CART_TOKEN_KEY = 'kreios_cart_token';
// URL dell'app cliente (checkout): richiesto all'API invece di essere indovinato, perché la
// porta Vite dell'app cliente può cambiare (es. se 5199 è già occupata). Fallback locale se
// il backend non è raggiungibile.
// URL dell'app cliente (checkout): richiesto all'API (APP_FRONTEND_CLIENTE_URL). Fallback: la pagina
// /preventivo servita dallo stesso backend del configuratore.
let appClienteUrl =
(typeof window.APP_CLIENTE_URL === 'string' && window.APP_CLIENTE_URL) ||
'http://localhost:5199';
`${window.location.origin}/preventivo`;
const configReady = (async () => {
try {
@@ -66,7 +65,7 @@ window.mostraLinkPreventivo = (token, count) => {
// diverse in dev/prod): lo passiamo qui come parametro, così il link "torna al configuratore"
// nella pagina di conferma può essere generato dinamicamente invece di essere hardcoded.
const ritorno = encodeURIComponent(window.location.href);
let href = `${appClienteUrl}/?token=${encodeURIComponent(token)}&ritorno=${ritorno}`;
let href = `${appClienteUrl.replace(/\/+$/, '')}/?token=${encodeURIComponent(token)}&ritorno=${ritorno}`;
// Se il cliente è loggato nel configuratore, passiamo il suo token anche al checkout
// così può precompilare l'anagrafica già salvata (vedi AuthGate.getToken()).
const clienteToken = AuthGate.getToken();