fix: DockerSecretsResolver - don't normalize absolute paths like /var/www/html/...
Some checks failed
Deploy Application / deploy (push) Has been cancelled

This commit is contained in:
2025-11-24 21:28:25 +01:00
parent 4eb7134853
commit 77abc65cd7
1327 changed files with 91915 additions and 9909 deletions

View File

@@ -37,7 +37,7 @@ final readonly class CheckboxField implements FormField
): self {
return new self(
metadata: new FieldMetadata($name, $label, $help),
attributes: new FieldAttributes(
attributes: FieldAttributes::create(
name: $name,
id: $name,
class: 'form-check-input',

View File

@@ -38,7 +38,7 @@ final readonly class DateTimeField implements FormField
): self {
return new self(
metadata: new FieldMetadata($name, $label, $help),
attributes: new FieldAttributes(
attributes: FieldAttributes::create(
name: $name,
id: $name,
required: $required
@@ -59,9 +59,9 @@ final readonly class DateTimeField implements FormField
}
$input = FormElement::create('input', $attrArray);
$wrapped = $this->wrapper->wrap($input, $this->metadata);
$wrapped = $this->wrapper->wrap((string) $input, $this->metadata);
return $form->addElement($wrapped);
return $form->addRawHtml($wrapped);
}
public function getName(): string

View File

@@ -36,7 +36,7 @@ final readonly class EmailField implements FormField
): self {
return new self(
metadata: new FieldMetadata($name, $label, $help),
attributes: new FieldAttributes(
attributes: FieldAttributes::create(
name: $name,
id: $name,
required: $required,
@@ -57,9 +57,9 @@ final readonly class EmailField implements FormField
}
$input = FormElement::create('input', $attrArray);
$wrapped = $this->wrapper->wrap($input, $this->metadata);
$wrapped = $this->wrapper->wrap((string) $input, $this->metadata);
return $form->addElement($wrapped);
return $form->addRawHtml($wrapped);
}
public function getName(): string

View File

@@ -0,0 +1,100 @@
<?php
declare(strict_types=1);
namespace App\Framework\Admin\FormFields\Fields;
use App\Framework\Admin\FormFields\Components\FieldWrapper;
use App\Framework\Admin\FormFields\FormField;
use App\Framework\Admin\FormFields\ValueObjects\FieldAttributes;
use App\Framework\Admin\FormFields\ValueObjects\FieldMetadata;
use App\Framework\View\FormBuilder;
use App\Framework\View\ValueObjects\FormElement;
/**
* File Input Field
*
* File upload field using composition
*/
final readonly class FileField implements FormField
{
public function __construct(
private FieldMetadata $metadata,
private FieldAttributes $attributes,
private FieldWrapper $wrapper,
private mixed $value = null,
private ?string $accept = null
) {
}
public static function create(
string $name,
string $label,
mixed $value = null,
bool $required = false,
?string $help = null,
?string $accept = null
): self {
$attributes = FieldAttributes::create(
name: $name,
id: $name,
required: $required
);
if ($accept !== null) {
$attributes = $attributes->withAdditional(['accept' => $accept]);
}
return new self(
metadata: new FieldMetadata($name, $label, $help),
attributes: $attributes,
wrapper: new FieldWrapper(),
value: $value,
accept: $accept
);
}
public function render(FormBuilder $form): FormBuilder
{
$input = FormElement::fileInput($this->attributes->name())
->withId($this->attributes->id())
->withClass($this->attributes->class());
if ($this->attributes->required()) {
$input = $input->withRequired();
}
if ($this->accept !== null) {
$input = $input->withAttribute('accept', $this->accept);
}
// Add any additional attributes (skip standard ones already set)
$allAttrs = $this->attributes->toHtmlAttributes();
$standardAttrs = ['name', 'id', 'class', 'required'];
foreach ($allAttrs->toArray() as $name => $value) {
if (!in_array($name, $standardAttrs, true) && $value !== null) {
$input = $input->withAttribute($name, $value);
}
}
$wrapped = $this->wrapper->wrap((string) $input, $this->metadata);
return $form->addRawHtml($wrapped);
}
public function getName(): string
{
return $this->metadata->name;
}
public function getValue(): mixed
{
return $this->value;
}
public function getLabel(): string
{
return $this->metadata->label;
}
}

View File

@@ -30,7 +30,7 @@ final readonly class HiddenField implements FormField
): self {
return new self(
metadata: new FieldMetadata($name, ''),
attributes: new FieldAttributes(
attributes: FieldAttributes::create(
name: $name,
id: $name,
class: ''

View File

@@ -42,7 +42,7 @@ final readonly class NumberField implements FormField
): self {
return new self(
metadata: new FieldMetadata($name, $label, $help),
attributes: new FieldAttributes(
attributes: FieldAttributes::create(
name: $name,
id: $name,
required: $required,
@@ -80,9 +80,9 @@ final readonly class NumberField implements FormField
}
$input = FormElement::create('input', $attrArray);
$wrapped = $this->wrapper->wrap($input, $this->metadata);
$wrapped = $this->wrapper->wrap((string) $input, $this->metadata);
return $form->addElement($wrapped);
return $form->addRawHtml($wrapped);
}
public function getName(): string

View File

@@ -39,7 +39,7 @@ final readonly class SelectField implements FormField
): self {
return new self(
metadata: new FieldMetadata($name, $label, $help),
attributes: new FieldAttributes(
attributes: FieldAttributes::create(
name: $name,
id: $name,
required: $required
@@ -52,14 +52,13 @@ final readonly class SelectField implements FormField
public function render(FormBuilder $form): FormBuilder
{
$attrArray = $this->attributes->toArray();
$optionsHtml = $this->options->toHtml((string) $this->value);
$select = FormElement::create('select', $attrArray, $optionsHtml);
$wrapped = $this->wrapper->wrap($select, $this->metadata);
// Create select element using FormElement::create
$select = FormElement::create('select', $this->attributes->toArray(), $optionsHtml);
$wrapped = $this->wrapper->wrap((string) $select, $this->metadata);
return $form->addElement($wrapped);
return $form->addRawHtml($wrapped);
}
public function getName(): string

View File

@@ -36,7 +36,7 @@ final readonly class TextField implements FormField
): self {
return new self(
metadata: new FieldMetadata($name, $label, $help),
attributes: new FieldAttributes(
attributes: FieldAttributes::create(
name: $name,
id: $name,
required: $required,
@@ -57,10 +57,21 @@ final readonly class TextField implements FormField
$attrArray['value'] = (string) $this->value;
}
$input = FormElement::create('input', $attrArray);
$wrapped = $this->wrapper->wrap($input, $this->metadata);
$input = FormElement::textInput($this->attributes->name(), $this->value !== null ? (string) $this->value : '')
->withId($this->attributes->id())
->withClass($this->attributes->class());
return $form->addElement($wrapped);
if ($this->attributes->required()) {
$input = $input->withRequired();
}
if ($this->attributes->placeholder() !== null) {
$input = $input->withAttribute('placeholder', $this->attributes->placeholder());
}
$wrapped = $this->wrapper->wrap((string) $input, $this->metadata);
return $form->addRawHtml($wrapped);
}
public function getName(): string

View File

@@ -38,7 +38,7 @@ final readonly class TextareaField implements FormField
): self {
return new self(
metadata: new FieldMetadata($name, $label, $help),
attributes: new FieldAttributes(
attributes: FieldAttributes::create(
name: $name,
id: $name,
required: $required,
@@ -58,9 +58,9 @@ final readonly class TextareaField implements FormField
$content = $this->value !== null ? htmlspecialchars((string) $this->value) : '';
$textarea = FormElement::create('textarea', $attrArray, $content);
$wrapped = $this->wrapper->wrap($textarea, $this->metadata);
$wrapped = $this->wrapper->wrap((string) $textarea, $this->metadata);
return $form->addElement($wrapped);
return $form->addRawHtml($wrapped);
}
public function getName(): string