diff --git a/backoffice/resources/views/welcome.blade.php b/backoffice/resources/views/welcome.blade.php deleted file mode 100644 index 26e294a..0000000 --- a/backoffice/resources/views/welcome.blade.php +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - {{ config('app.name', 'Laravel') }} - - @fonts - - - @if (file_exists(public_path('build/manifest.json')) || file_exists(public_path('hot'))) - @vite(['resources/css/app.css', 'resources/js/app.js']) - @else - - @endif - - -
- @if (Route::has('login')) - - @endif -
-
-
-
-

Let's get started

-

With so many options available to you,
we suggest you start with the following:

- - - -

- v{{ app()->version() }} - - View changelog - - - - -

-
-
- {{-- Laravel Logo --}} - - - - - - - - - - - {{-- 13 --}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- - @if (Route::has('login')) - - @endif - - diff --git a/backoffice/routes/web.php b/backoffice/routes/web.php index 4e951f8..da505fd 100644 --- a/backoffice/routes/web.php +++ b/backoffice/routes/web.php @@ -6,8 +6,11 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Storage; -Route::get('/', function () { - return view('welcome'); +// La home porta al configuratore, conservando eventuali parametri (?sistema=…&type=…). +Route::get('/', function (Request $request) { + $query = $request->getQueryString(); + + return redirect('/configuratore/'.($query ? '?'.$query : '')); }); Route::get('/admin/preventivi/{preventivo}/pdf', function (Preventivo $preventivo) { diff --git a/backoffice/tests/Feature/ExampleTest.php b/backoffice/tests/Feature/ExampleTest.php index 8364a84..4dc9541 100644 --- a/backoffice/tests/Feature/ExampleTest.php +++ b/backoffice/tests/Feature/ExampleTest.php @@ -7,13 +7,14 @@ use Tests\TestCase; class ExampleTest extends TestCase { - /** - * A basic test example. - */ - public function test_the_application_returns_a_successful_response(): void + public function test_la_home_reindirizza_al_configuratore(): void { - $response = $this->get('/'); + $this->get('/')->assertRedirect('/configuratore/'); + } - $response->assertStatus(200); + public function test_la_home_conserva_i_parametri_del_configuratore(): void + { + $this->get('/?sistema=pvc&type=finestra_2_ante') + ->assertRedirect('/configuratore/?sistema=pvc&type=finestra_2_ante'); } } diff --git a/docs/PREVENTIVI_BACKOFFICE.md b/docs/PREVENTIVI_BACKOFFICE.md index 2330e10..1dd5b1d 100644 --- a/docs/PREVENTIVI_BACKOFFICE.md +++ b/docs/PREVENTIVI_BACKOFFICE.md @@ -36,6 +36,8 @@ il collegamento tra i due è il `token` passato in query string nel link "Vai al - L'`index.html` di ciascun frontend è servito dalle route `configuratore` e `preventivo` in [`backoffice/routes/web.php`](../backoffice/routes/web.php) (`Cache-Control: no-cache`, così una nuova build è visibile subito; gli asset hanno nomi con hash). Se la build manca rispondono 404. +- La home `/` reindirizza a `/configuratore/`, conservando eventuali parametri (`/?sistema=pvc` → + `/configuratore/?sistema=pvc`). Senza parametri il configuratore apre il primo sistema e modello attivi. - Il configuratore usa path runtime relativi (`./assets/…`), quindi l'URL deve finire con `/`: Apache/nginx reindirizzano `/configuratore` → `/configuratore/`, e uno script inline in `src/index.html` aggiunge lo slash anche quando il server non lo fa (es. `php artisan serve`). @@ -97,7 +99,7 @@ sono in git: le genera `./build.sh` sul server dopo ogni pull. ```bash export PATH=/opt/plesk/node/22/bin:$PATH PHP=/opt/plesk/php/8.3/bin/php - (cd backoffice && $PHP /usr/lib/plesk-9.0/composer.phar install --no-dev --optimize-autoloader --no-interaction) + (cd backoffice && composer install --no-dev --optimize-autoloader --no-interaction) # svuota tutte le cache di Laravel (config, route, view, eventi, cache applicativa, compilati) (cd backoffice && $PHP artisan optimize:clear) # esegue solo le migrazioni non ancora applicate (--force: richiesto in produzione)