M3 Integration fixes pass 20

This commit is contained in:
Mark Gregory
2026-09-22 15:29:01 +01:00
parent 819d4eab78
commit adf2a45553
8 changed files with 95 additions and 52 deletions
@@ -23,7 +23,7 @@ class StoreDocumentationDocumentRequest extends FormRequest
*/
public function rules(): array
{
$maxUploadKb = min(max((int) config('documentation.max_upload_kb', 10240), 1), 10240);
$maxUploadKb = 4096;
return [
'documentation_category_id' => ['nullable', 'integer', 'exists:documentation_categories,id'],
@@ -23,7 +23,7 @@ class UpdateDocumentationDocumentRequest extends FormRequest
*/
public function rules(): array
{
$maxUploadKb = min(max((int) config('documentation.max_upload_kb', 10240), 1), 10240);
$maxUploadKb = 4096;
/** @var DocumentationDocument|null $document */
$document = $this->route('document');
@@ -4,8 +4,8 @@
@endsection
{{-- Flat Picker CSS --}}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/plugins/monthSelect/style.css">
<link rel="stylesheet" href="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/flatpickr-4.6.13.min.css']) }}">
<link rel="stylesheet" href="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/flatpickr-monthSelect-4.6.13.css']) }}">
@section('content')
<div class="container-fluid px-4">
@@ -152,12 +152,12 @@
@section('scripts')
{{-- Chart JS --}}
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.8/dist/chart.umd.min.js"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/chart-4.4.8.umd.min.js']) }}"></script>
<!-- Flatpickr JS -->
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/flatpickr-4.6.13.min.js']) }}"></script>
<!-- Month Select Plugin -->
<script src="https://cdn.jsdelivr.net/npm/flatpickr/dist/plugins/monthSelect/index.js"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/flatpickr-monthSelect-4.6.13.js']) }}"></script>
<script>
$(document).ready(function() {
@@ -4,8 +4,8 @@
@endsection
{{-- Flat Picker CSS --}}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/plugins/monthSelect/style.css">
<link rel="stylesheet" href="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/flatpickr-4.6.13.min.css']) }}">
<link rel="stylesheet" href="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/flatpickr-monthSelect-4.6.13.css']) }}">
@section('content')
<div class="container-fluid px-4">
@@ -146,12 +146,12 @@
@section('scripts')
{{-- Chart JS --}}
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.8/dist/chart.umd.min.js"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/chart-4.4.8.umd.min.js']) }}"></script>
<!-- Flatpickr JS -->
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/flatpickr-4.6.13.min.js']) }}"></script>
<!-- Month Select Plugin -->
<script src="https://cdn.jsdelivr.net/npm/flatpickr/dist/plugins/monthSelect/index.js"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/flatpickr-monthSelect-4.6.13.js']) }}"></script>
<script>
$(document).ready(function() {
@@ -2,8 +2,8 @@
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/js/jquery.min.js']) }}"></script>
<!-- SB Admin -->
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity= "sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/popper-1.16.0.min.js']) }}"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/bootstrap.bundle.min.js']) }}"></script>
@php
// ReplenishSettingsController
@@ -18,22 +18,22 @@
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/js/scripts.js']) }}"></script>
@endif
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js" crossorigin="anonymous"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/chart-2.8.0.min.js']) }}"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/assets/demo/chart-area-demo.js']) }}"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/assets/demo/chart-bar-demo.js']) }}"></script>
<script src="https://cdn.jsdelivr.net/npm/simple-datatables@latest" crossorigin="anonymous"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/simple-datatables-10.2.0.js']) }}"></script>
<!-- Datatable -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs5/jszip-2.5.0/dt-1.11.3/af-2.3.7/b-2.0.1/b-colvis-2.0.1/b-html5-2.0.1/b-print-2.0.1/cr-1.5.4/date-1.1.1/fc-4.0.0/fh-3.2.0/kt-2.6.4/r-2.2.9/rg-1.1.3/rr-1.2.8/sc-2.0.5/sb-1.2.2/sp-1.4.0/sl-1.3.3/datatables.min.js"></script>
<script type="text/javascript" src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/pdfmake-0.1.36.min.js']) }}"></script>
<script type="text/javascript" src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/pdfmake-0.1.36-vfs_fonts.js']) }}"></script>
<script type="text/javascript" src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/datatables-bundle.min.js']) }}"></script>
<script type="text/javascript" src="{{ route('m3.assets', ['path' => 'liberty-theme/js/datatables-simple-demo.js']) }}"></script>
{{-- Data Bootstrap Responsive --}}
<script type="text/javascript" src="https://cdn.datatables.net/responsive/2.4.1/js/dataTables.responsive.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/responsive/2.4.1/js/responsive.bootstrap.min.js"></script>
<script type="text/javascript" src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/datatables-responsive-2.4.1.min.js']) }}"></script>
<script type="text/javascript" src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/datatables-responsive-bootstrap-2.4.1.min.js']) }}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.20/jquery.datetimepicker.full.js"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/jquery-datetimepicker-2.5.20.js']) }}"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/js/dataTables.altEditor.free.js']) }}"></script>
<!-- Morris Charts -->
@@ -41,20 +41,20 @@
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/js/raphael.min.js']) }}"></script>
<!-- Date range picker -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<script type="text/javascript" src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/moment-2.30.1.min.js']) }}"></script>
<script type="text/javascript" src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/daterangepicker-3.1.0.min.js']) }}"></script>
<!-- highcharts -->
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/sunburst.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/highcharts.js']) }}"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/highcharts-sunburst.js']) }}"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/highcharts-exporting.js']) }}"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/highcharts-export-data.js']) }}"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/highcharts-accessibility.js']) }}"></script>
<!-- Fontawesome -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js" crossorigin="anonymous"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/fontawesome-5.15.3-all.min.js']) }}"></script>
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/sweetalert2-11.js']) }}"></script>
<script>
@@ -1,17 +1,17 @@
<link href="https://cdn.jsdelivr.net/npm/simple-datatables@latest/dist/style.css" rel="stylesheet" />
<link href="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/simple-datatables-10.2.0.css']) }}" rel="stylesheet" />
<link href="{{ route('m3.assets', ['path' => 'liberty-theme/css/styles.css']) }}" rel="stylesheet" />
<link href="{{ route('m3.assets', ['path' => 'liberty-theme/css/morris.css']) }}" rel="stylesheet" />
<!-- Date range picker -->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
<link rel="stylesheet" type="text/css" href="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/daterangepicker-3.1.0.css']) }}" />
<!-- Datatable -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs5/jszip-2.5.0/dt-1.11.3/af-2.3.7/b-2.0.1/b-colvis-2.0.1/b-html5-2.0.1/b-print-2.0.1/cr-1.5.4/date-1.1.1/fc-4.0.0/fh-3.2.0/kt-2.6.4/r-2.2.9/rg-1.1.3/rr-1.2.8/sc-2.0.5/sb-1.2.2/sp-1.4.0/sl-1.3.3/datatables.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.20/jquery.datetimepicker.css">
<link rel="stylesheet" type="text/css" href="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/datatables-bundle.min.css']) }}"/>
<link rel="stylesheet" href="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/jquery-datetimepicker-2.5.20.css']) }}">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.0/css/dataTables.bootstrap5.min.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/responsive/2.4.1/css/responsive.bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/2.0.0/css/buttons.bootstrap5.min.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/select/1.3.3/css/select.bootstrap5.min.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/datetime/1.1.1/css/dataTables.dateTime.min.css" />
<link rel="stylesheet" type="text/css" href="https://editor.datatables.net/extensions/Editor/css/editor.bootstrap5.min.css" />
<link rel="stylesheet" type="text/css" href="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/datatables-bootstrap5-1.11.0.css']) }}" />
<link rel="stylesheet" type="text/css" href="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/datatables-responsive-bootstrap-2.4.1.css']) }}" />
<link rel="stylesheet" type="text/css" href="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/datatables-buttons-bootstrap5-2.0.0.css']) }}" />
<link rel="stylesheet" type="text/css" href="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/datatables-select-bootstrap5-1.3.3.css']) }}" />
<link rel="stylesheet" type="text/css" href="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/datatables-datetime-1.1.1.css']) }}" />
<link rel="stylesheet" type="text/css" href="{{ route('m3.assets', ['path' => 'liberty-theme/vendor/datatables-editor-bootstrap5.css']) }}" />
+41
View File
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
DEST="$ROOT/Modules/M3/Resources/public/liberty-theme/vendor"
mkdir -p "$DEST"
fetch() { local name="$1" url="$2"; echo "Fetching $name"; curl --fail --location --silent --show-error --retry 3 --proto '=https' --tlsv1.2 "$url" -o "$DEST/$name"; }
fetch bootstrap.bundle.min.js 'https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js'
fetch chart-2.8.0.min.js 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js'
fetch simple-datatables-10.2.0.js 'https://cdn.jsdelivr.net/npm/simple-datatables@10.2.0/dist/umd/simple-datatables.js'
fetch simple-datatables-10.2.0.css 'https://cdn.jsdelivr.net/npm/simple-datatables@10.2.0/dist/style.css'
fetch pdfmake-0.1.36.min.js 'https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js'
fetch pdfmake-0.1.36-vfs_fonts.js 'https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js'
fetch datatables-bundle.min.js 'https://cdn.datatables.net/v/bs5/jszip-2.5.0/dt-1.11.3/af-2.3.7/b-2.0.1/b-colvis-2.0.1/b-html5-2.0.1/b-print-2.0.1/cr-1.5.4/date-1.1.1/fc-4.0.0/fh-3.2.0/kt-2.6.4/r-2.2.9/rg-1.1.3/rr-1.2.8/sc-2.0.5/sb-1.2.2/sp-1.4.0/sl-1.3.3/datatables.min.js'
fetch datatables-bundle.min.css 'https://cdn.datatables.net/v/bs5/jszip-2.5.0/dt-1.11.3/af-2.3.7/b-2.0.1/b-colvis-2.0.1/b-html5-2.0.1/b-print-2.0.1/cr-1.5.4/date-1.1.1/fc-4.0.0/fh-3.2.0/kt-2.6.4/r-2.2.9/rg-1.1.3/rr-1.2.8/sc-2.0.5/sb-1.2.2/sp-1.4.0/sl-1.3.3/datatables.min.css'
fetch datatables-responsive-2.4.1.min.js 'https://cdn.datatables.net/responsive/2.4.1/js/dataTables.responsive.min.js'
fetch datatables-responsive-bootstrap-2.4.1.min.js 'https://cdn.datatables.net/responsive/2.4.1/js/responsive.bootstrap.min.js'
fetch jquery-datetimepicker-2.5.20.js 'https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.20/jquery.datetimepicker.full.min.js'
fetch jquery-datetimepicker-2.5.20.css 'https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.20/jquery.datetimepicker.min.css'
fetch moment-2.30.1.min.js 'https://cdn.jsdelivr.net/npm/moment@2.30.1/min/moment.min.js'
fetch daterangepicker-3.1.0.min.js 'https://cdn.jsdelivr.net/npm/daterangepicker@3.1.0/daterangepicker.min.js'
fetch daterangepicker-3.1.0.css 'https://cdn.jsdelivr.net/npm/daterangepicker@3.1.0/daterangepicker.css'
fetch fontawesome-5.15.3-all.min.js 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js'
fetch chart-4.4.8.umd.min.js 'https://cdn.jsdelivr.net/npm/chart.js@4.4.8/dist/chart.umd.min.js'
fetch flatpickr-4.6.13.min.js 'https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/flatpickr.min.js'
fetch flatpickr-4.6.13.min.css 'https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/flatpickr.min.css'
fetch flatpickr-monthSelect-4.6.13.js 'https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/plugins/monthSelect/index.js'
fetch flatpickr-monthSelect-4.6.13.css 'https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/plugins/monthSelect/style.css'
fetch popper-1.16.0.min.js 'https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js'
fetch datatables-bootstrap5-1.11.0.css 'https://cdn.datatables.net/1.11.0/css/dataTables.bootstrap5.min.css'
fetch datatables-responsive-bootstrap-2.4.1.css 'https://cdn.datatables.net/responsive/2.4.1/css/responsive.bootstrap.min.css'
fetch datatables-buttons-bootstrap5-2.0.0.css 'https://cdn.datatables.net/buttons/2.0.0/css/buttons.bootstrap5.min.css'
fetch datatables-select-bootstrap5-1.3.3.css 'https://cdn.datatables.net/select/1.3.3/css/select.bootstrap5.min.css'
fetch datatables-datetime-1.1.1.css 'https://cdn.datatables.net/datetime/1.1.1/css/dataTables.dateTime.min.css'
fetch datatables-editor-bootstrap5.css 'https://editor.datatables.net/extensions/Editor/css/editor.bootstrap5.min.css'
fetch highcharts.js 'https://code.highcharts.com/highcharts.js'
fetch highcharts-sunburst.js 'https://code.highcharts.com/modules/sunburst.js'
fetch highcharts-exporting.js 'https://code.highcharts.com/modules/exporting.js'
fetch highcharts-export-data.js 'https://code.highcharts.com/modules/export-data.js'
fetch highcharts-accessibility.js 'https://code.highcharts.com/modules/accessibility.js'
fetch sweetalert2-11.js 'https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.all.min.js'
echo "M3 vendor assets written to $DEST"
+13 -11
View File
@@ -4,6 +4,7 @@ namespace Tests\Feature\Auth;
use App\Models\User;
use Illuminate\Auth\Events\Verified;
use Illuminate\Auth\Notifications\VerifyEmail;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\URL;
@@ -36,11 +37,7 @@ class EmailVerificationTest extends TestCase
Event::fake();
$verificationUrl = URL::temporarySignedRoute(
'verification.verify',
now()->addMinutes(60),
['id' => $user->id, 'hash' => sha1($user->email)],
);
$verificationUrl = (new TestVerifyEmail)->urlFor($user);
$response = $this->actingAs($user)->get($verificationUrl);
@@ -57,7 +54,7 @@ class EmailVerificationTest extends TestCase
$verificationUrl = URL::temporarySignedRoute(
'verification.verify',
now()->addMinutes(60),
['id' => $user->id, 'hash' => sha1('wrong-email')],
['id' => $user->id, 'hash' => hash('sha256', 'wrong-email')],
);
$this->actingAs($user)->get($verificationUrl);
@@ -73,11 +70,7 @@ class EmailVerificationTest extends TestCase
Event::fake();
$verificationUrl = URL::temporarySignedRoute(
'verification.verify',
now()->addMinutes(60),
['id' => $user->id, 'hash' => sha1($user->email)],
);
$verificationUrl = (new TestVerifyEmail)->urlFor($user);
$this->actingAs($user)->get($verificationUrl)
->assertRedirect(route('dashboard', absolute: false) . '?verified=1');
@@ -86,3 +79,12 @@ class EmailVerificationTest extends TestCase
Event::assertNotDispatched(Verified::class);
}
}
final class TestVerifyEmail extends VerifyEmail
{
public function urlFor(User $user): string
{
return $this->verificationUrl($user);
}
}