feat: HEADING field type for registration forms — replace section property with structural field
Replace the per-field `section` text property with a dedicated HEADING field type that organizers add as a separate block for visual grouping. Also fixes duplicate heading bug on portal radio fields, replaces cramped VBtnToggle with VSelect for field width, and adds grouped field type dropdown with structure/input categories. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,6 @@ final class RegistrationFieldTemplateFactory extends Factory
|
||||
'is_filterable' => false,
|
||||
'is_portal_visible' => true,
|
||||
'is_admin_only' => false,
|
||||
'section' => null,
|
||||
'help_text' => null,
|
||||
'sort_order' => fake()->numberBetween(0, 20),
|
||||
'display_width' => FieldDisplayWidth::FULL,
|
||||
@@ -84,4 +83,15 @@ final class RegistrationFieldTemplateFactory extends Factory
|
||||
'display_width' => FieldDisplayWidth::FULL,
|
||||
]);
|
||||
}
|
||||
|
||||
public function headingField(): static
|
||||
{
|
||||
return $this->state(fn () => [
|
||||
'label' => 'Persoonlijke voorkeuren',
|
||||
'slug' => 'persoonlijke-voorkeuren',
|
||||
'field_type' => RegistrationFieldType::HEADING,
|
||||
'help_text' => 'Vertel ons wat we over jou moeten weten',
|
||||
'display_width' => FieldDisplayWidth::FULL,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ final class RegistrationFormFieldFactory extends Factory
|
||||
'is_portal_visible' => true,
|
||||
'is_admin_only' => false,
|
||||
'is_filterable' => false,
|
||||
'section' => null,
|
||||
'help_text' => null,
|
||||
'sort_order' => fake()->numberBetween(0, 20),
|
||||
'display_width' => FieldDisplayWidth::FULL,
|
||||
@@ -45,7 +44,6 @@ final class RegistrationFormFieldFactory extends Factory
|
||||
'label' => 'Noodcontact naam',
|
||||
'slug' => 'noodcontact-naam',
|
||||
'field_type' => RegistrationFieldType::TEXT,
|
||||
'section' => 'Noodcontact',
|
||||
'display_width' => FieldDisplayWidth::HALF,
|
||||
]);
|
||||
}
|
||||
@@ -81,7 +79,6 @@ final class RegistrationFormFieldFactory extends Factory
|
||||
'slug' => 'toestemming-gegevensverwerking',
|
||||
'field_type' => RegistrationFieldType::BOOLEAN,
|
||||
'is_required' => true,
|
||||
'section' => 'Toestemming',
|
||||
'help_text' => 'Ik geef toestemming voor de verwerking van mijn persoonsgegevens conform de AVG.',
|
||||
'display_width' => FieldDisplayWidth::FULL,
|
||||
]);
|
||||
@@ -109,7 +106,6 @@ final class RegistrationFormFieldFactory extends Factory
|
||||
['label' => 'Entreeticket', 'description' => 'Je ontvangt een gratis festivalticket als dank voor je inzet'],
|
||||
['label' => 'Vrijwilligersvergoeding', 'description' => 'Je ontvangt een vergoeding conform de vrijwilligersregeling'],
|
||||
],
|
||||
'section' => 'Vergoeding',
|
||||
'display_width' => FieldDisplayWidth::FULL,
|
||||
]);
|
||||
}
|
||||
@@ -123,4 +119,15 @@ final class RegistrationFormFieldFactory extends Factory
|
||||
'display_width' => FieldDisplayWidth::FULL,
|
||||
]);
|
||||
}
|
||||
|
||||
public function headingField(): static
|
||||
{
|
||||
return $this->state(fn () => [
|
||||
'label' => 'Persoonlijke voorkeuren',
|
||||
'slug' => 'persoonlijke-voorkeuren',
|
||||
'field_type' => RegistrationFieldType::HEADING,
|
||||
'help_text' => 'Vertel ons wat we over jou moeten weten',
|
||||
'display_width' => FieldDisplayWidth::FULL,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('registration_field_templates', function (Blueprint $table) {
|
||||
$table->dropColumn('section');
|
||||
});
|
||||
|
||||
Schema::table('registration_form_fields', function (Blueprint $table) {
|
||||
$table->dropColumn('section');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('registration_field_templates', function (Blueprint $table) {
|
||||
$table->string('section', 100)->nullable()->after('is_admin_only');
|
||||
});
|
||||
|
||||
Schema::table('registration_form_fields', function (Blueprint $table) {
|
||||
$table->string('section', 100)->nullable()->after('is_filterable');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -156,7 +156,7 @@ class DevSeeder extends Seeder
|
||||
|
||||
\App\Services\RegistrationFieldTemplateService::seedSystemTemplates($this->org);
|
||||
|
||||
$this->command->info(' Organisation, 8 users, 6 companies, 7 crowd types, 10 person tags, 11 registration templates created');
|
||||
$this->command->info(' Organisation, 8 users, 6 companies, 7 crowd types, 10 person tags, 16 registration templates created');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user