diff --git a/api/app/Http/Controllers/Api/V1/PersonTagController.php b/api/app/Http/Controllers/Api/V1/PersonTagController.php index 54d6d9fc..74a34216 100644 --- a/api/app/Http/Controllers/Api/V1/PersonTagController.php +++ b/api/app/Http/Controllers/Api/V1/PersonTagController.php @@ -20,7 +20,7 @@ final class PersonTagController extends Controller { Gate::authorize('viewAny', [PersonTag::class, $organisation]); - $tags = $organisation->personTags()->active()->ordered()->get(); + $tags = $organisation->personTags()->ordered()->get(); return PersonTagResource::collection($tags); } diff --git a/api/app/Services/RegistrationFieldTemplateService.php b/api/app/Services/RegistrationFieldTemplateService.php index d6c16b54..48bc8022 100644 --- a/api/app/Services/RegistrationFieldTemplateService.php +++ b/api/app/Services/RegistrationFieldTemplateService.php @@ -16,7 +16,6 @@ final class RegistrationFieldTemplateService public function listForOrganisation(Organisation $organisation): Collection { return $organisation->registrationFieldTemplates() - ->active() ->ordered() ->get(); } diff --git a/api/tests/Feature/PersonTag/PersonTagTest.php b/api/tests/Feature/PersonTag/PersonTagTest.php index e0e7ee45..e302ba9a 100644 --- a/api/tests/Feature/PersonTag/PersonTagTest.php +++ b/api/tests/Feature/PersonTag/PersonTagTest.php @@ -51,7 +51,7 @@ class PersonTagTest extends TestCase $response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/person-tags"); $response->assertOk(); - $this->assertCount(3, $response->json('data')); + $this->assertCount(4, $response->json('data')); } public function test_store_creates_tag(): void diff --git a/api/tests/Feature/RegistrationFieldTemplate/RegistrationFieldTemplateTest.php b/api/tests/Feature/RegistrationFieldTemplate/RegistrationFieldTemplateTest.php index b0c6bed2..66128d60 100644 --- a/api/tests/Feature/RegistrationFieldTemplate/RegistrationFieldTemplateTest.php +++ b/api/tests/Feature/RegistrationFieldTemplate/RegistrationFieldTemplateTest.php @@ -39,7 +39,7 @@ class RegistrationFieldTemplateTest extends TestCase $this->otherOrganisation->users()->attach($this->outsider, ['role' => 'org_admin']); } - public function test_index_returns_active_templates(): void + public function test_index_returns_all_templates(): void { RegistrationFieldTemplate::factory()->count(3)->create([ 'organisation_id' => $this->organisation->id, @@ -53,7 +53,7 @@ class RegistrationFieldTemplateTest extends TestCase $response = $this->getJson("/api/v1/organisations/{$this->organisation->id}/registration-field-templates"); $response->assertOk(); - $this->assertCount(3, $response->json('data')); + $this->assertCount(4, $response->json('data')); } public function test_store_creates_template(): void diff --git a/apps/app/src/components/organisation/RegistrationFieldTemplatesTab.vue b/apps/app/src/components/organisation/RegistrationFieldTemplatesTab.vue index d991da18..f1e4efc1 100644 --- a/apps/app/src/components/organisation/RegistrationFieldTemplatesTab.vue +++ b/apps/app/src/components/organisation/RegistrationFieldTemplatesTab.vue @@ -25,12 +25,14 @@ const { mutate: deleteTemplate, isPending: isDeleting } = useDeleteRegistrationF const fieldTypeOptions = Object.entries(FIELD_TYPE_LABELS).map(([value, title]) => ({ title, value })) +const activeTemplates = computed(() => templates.value?.filter(t => t.is_active) ?? []) +const inactiveTemplates = computed(() => templates.value?.filter(t => !t.is_active) ?? []) + const headers = [ { title: 'Label', key: 'label' }, { title: 'Type', key: 'field_type' }, { title: 'Sectie', key: 'section' }, { title: 'Systeem', key: 'is_system', sortable: false }, - { title: 'Status', key: 'is_active', sortable: false }, { title: 'Acties', key: 'actions', sortable: false, align: 'end' as const }, ] @@ -199,29 +201,25 @@ function onDeleteExecute() { }) } -function toggleActive(template: RegistrationFieldTemplate) { - if (template.is_system) { - // System templates: toggle via DELETE (deactivate) or UPDATE (activate) - if (template.is_active) { - deleteTemplate(template.id, { - onSuccess: () => { - successMessage.value = `${template.label} gedeactiveerd` - showSuccess.value = true - }, - }) - } - else { - updateTemplate( - { id: template.id, is_active: true }, - { - onSuccess: () => { - successMessage.value = `${template.label} geactiveerd` - showSuccess.value = true - }, - }, - ) - } - } +function deactivate(template: RegistrationFieldTemplate) { + deleteTemplate(template.id, { + onSuccess: () => { + successMessage.value = `${template.label} gedeactiveerd` + showSuccess.value = true + }, + }) +} + +function activate(template: RegistrationFieldTemplate) { + updateTemplate( + { id: template.id, is_active: true }, + { + onSuccess: () => { + successMessage.value = `${template.label} geactiveerd` + showSuccess.value = true + }, + }, + ) } @@ -267,11 +265,11 @@ function toggleActive(template: RegistrationFieldTemplate) {
- -+ Inactief +
++ Definieer de deelnemertypes voor je organisatie +
+Nog geen crowd types aangemaakt. Maak er een aan om personen te categoriseren. -
- Inactief -
-+ Inactief +
+Kleur + +
+ {{ errors.color }} +
+