new functionality: Add project coding configuration feature for projects
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled

This commit is contained in:
2025-12-09 23:02:35 +01:00
parent 7b00887372
commit e42ce8b092
13 changed files with 1169 additions and 28 deletions

View File

@@ -1,20 +1,42 @@
<div class="max-w-full mx-auto p-6">
<div class="max-w-full">
<!-- Header con contador y botón de agregar -->
<div class="flex justify-between items-center mb-4">
<h2 class="text-2xl font-bold text-gray-800">
Codificación de los documentos del proyecto
</h2>
<div class="flex content-start justify-between mb-6">
<div class="flex space-x-6 content-start">
<h2 class="text-2xl font-bold text-gray-800">
Codificación de los documentos del proyecto
</h2>
</div>
<button
type="button"
wire:click="addComponent"
class="px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition-colors flex items-center space-x-2"
>
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path>
</svg>
<span>Agregar Componente</span>
</button>
<div class="flex flex-col items-end space-y-4">
<div class="flex space-x-2">
<button
type="button"
wire:click="addComponent"
class="px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition-colors flex items-center space-x-2"
>
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path>
</svg>
<span>Agregar Componente</span>
</button>
<button
type="button"
wire:click="saveConfiguration"
wire:loading.attr="disabled"
class="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors flex items-center space-x-2"
>
<svg class="w-4 h-4" wire:loading.remove wire:target="saveConfiguration" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
</svg>
<svg class="w-4 h-4 animate-spin" wire:loading wire:target="saveConfiguration" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
</svg>
<span wire:loading.remove wire:target="saveConfiguration">Guardar</span>
<span wire:loading wire:target="saveConfiguration">Guardando...</span>
</button>
</div>
</div>
</div>
<!-- Label con nombres de componentes -->
@@ -22,9 +44,9 @@
<div class="flex items-center space-x-2">
<span class="text-sm font-medium text-blue-800">Código:</span>
<div class="flex flex-wrap items-center gap-2">
<span ><flux:badge color="green">SOGOS0001</flux:badge>-</span>
<span ><flux:badge color="green">{{ $project->reference}}</flux:badge>-</span>
@foreach($components as $index => $component)
<span class="inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-white text-blue-700 border border-blue-200">
<span class="inline-flex items-center px-3 py-1 rounded-md text-xs font-medium bg-white text-blue-700 border border-blue-200">
{{ $component['headerLabel'] }}
@if(isset($component['data']['documentTypes']) && count($component['data']['documentTypes']) > 0)
<span class="ml-1 bg-blue-100 text-blue-800 px-1.5 py-0.5 rounded-full">
@@ -36,6 +58,7 @@
<span class="text-blue-400">-</span>
@endif
@endforeach
<span>- <flux:badge color="green">Document Name</flux:badge></span>
</div>
</div>
</div>
@@ -157,6 +180,8 @@
:key="'document-manager-' . $component['id']"
:component-id="$component['id']"
:initial-name="$component['headerLabel']"
:initial-max-length="$component['data']['maxLength'] ?? 3"
:initial-document-types="$component['data']['documentTypes'] ?? []"
/>
</div>
</div>