Bladeren bron

refactor(ui): improve table dropdown z-index handling and trim whitespace

- Move z-index from individual dropdown items to parent container
- Add overflow:visible when dropdown is active to prevent clipping
- Auto-trim whitespace in import service for all string values
- Add migration to clean existing whitespace in order-related fields
Alexander Musikhin 1 week geleden
bovenliggende
commit
6ebecceec3

+ 3 - 0
app/Services/Import/ImportYearDataService.php

@@ -319,6 +319,9 @@ class ImportYearDataService
             return $default;
         }
         $value = $row[$headerMap[$key]] ?? null;
+        if (is_string($value)) {
+            $value = trim($value);
+        }
         if ($value === null || $value === '') {
             return $default;
         }

+ 32 - 0
database/migrations/2026_02_26_120000_trim_whitespace_in_order_related_fields.php

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Support\Facades\DB;
+
+return new class extends Migration
+{
+    public function up(): void
+    {
+        $columnsByTable = [
+            'orders' => ['name', 'object_address', 'tg_group_name', 'tg_group_link'],
+            'users' => ['name'],
+            'districts' => ['shortname', 'name'],
+            'areas' => ['name'],
+            'object_types' => ['name'],
+            'order_statuses' => ['name'],
+        ];
+
+        foreach ($columnsByTable as $table => $columns) {
+            foreach ($columns as $column) {
+                DB::statement(
+                    "UPDATE {$table} SET {$column} = TRIM({$column}) WHERE {$column} IS NOT NULL AND {$column} <> TRIM({$column})"
+                );
+            }
+        }
+    }
+
+    public function down(): void
+    {
+        // Irreversible: trimmed whitespace cannot be restored.
+    }
+};

+ 9 - 1
resources/sass/app.scss

@@ -45,6 +45,12 @@
 
 .js-main-table-scroll {
   overflow: auto;
+  position: relative;
+  z-index: 20;
+}
+
+.js-main-table-scroll:has(.dropdown-menu.show) {
+  overflow: visible;
 }
 
 .js-main-table-scroll .table {
@@ -67,7 +73,7 @@
 }
 
 .js-main-table-scroll thead th .dropdown-menu {
-  z-index: 11;
+  z-index: 1080;
 }
 
 .js-subtable-scroll {
@@ -136,6 +142,8 @@
   padding-bottom: 0.25rem !important;
   background-color: var(--bs-body-bg);
   box-shadow: 0 -8px 14px -10px rgba(0, 0, 0, 0.35);
+  position: relative;
+  z-index: 1;
 }
 
 .table-pagination-row .pagination {