Add has_nami to participant api index
This commit is contained in:
parent
0526b52b6b
commit
646b292249
|
@ -57,6 +57,7 @@ class ParticipantResource extends JsonResource
|
||||||
'default_filter_value' => ParticipantFilterScope::$nan,
|
'default_filter_value' => ParticipantFilterScope::$nan,
|
||||||
'filters' => $filterData,
|
'filters' => $filterData,
|
||||||
'form_meta' => $form->meta,
|
'form_meta' => $form->meta,
|
||||||
|
'has_nami_field' => $form->getFields()->hasNamiField(),
|
||||||
'links' => [
|
'links' => [
|
||||||
'update_form_meta' => route('form.update-meta', ['form' => $form]),
|
'update_form_meta' => route('form.update-meta', ['form' => $form]),
|
||||||
],
|
],
|
||||||
|
|
|
@ -51,6 +51,7 @@ class ParticipantIndexActionTest extends FormTestCase
|
||||||
->assertJsonPath('meta.columns.6.display_attribute', 'birthday_display')
|
->assertJsonPath('meta.columns.6.display_attribute', 'birthday_display')
|
||||||
->assertJsonPath('meta.columns.0.display_attribute', 'vorname_display')
|
->assertJsonPath('meta.columns.0.display_attribute', 'vorname_display')
|
||||||
->assertJsonPath('meta.form_meta.active_columns', ['vorname', 'select', 'stufe', 'test1'])
|
->assertJsonPath('meta.form_meta.active_columns', ['vorname', 'select', 'stufe', 'test1'])
|
||||||
|
->assertJsonPath('meta.has_nami_field', false)
|
||||||
->assertJsonPath('meta.links.update_form_meta', route('form.update-meta', ['form' => $form]))
|
->assertJsonPath('meta.links.update_form_meta', route('form.update-meta', ['form' => $form]))
|
||||||
->assertJsonPath('meta.form_meta.sorting', ['vorname', 'asc']);
|
->assertJsonPath('meta.form_meta.sorting', ['vorname', 'asc']);
|
||||||
}
|
}
|
||||||
|
@ -72,6 +73,13 @@ class ParticipantIndexActionTest extends FormTestCase
|
||||||
$this->callFilter('form.participant.index', ['data' => []], ['form' => $form])->assertJsonPath('meta.filter.data.check', ParticipantFilterScope::$nan);
|
$this->callFilter('form.participant.index', ['data' => []], ['form' => $form])->assertJsonPath('meta.filter.data.check', ParticipantFilterScope::$nan);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testItDisplaysHasNamiField(): void
|
||||||
|
{
|
||||||
|
$this->login()->loginNami()->withoutExceptionHandling();
|
||||||
|
$form = Form::factory()->fields([$this->namiField('mitglieder')])->create();
|
||||||
|
$this->callFilter('form.participant.index', [], ['form' => $form])->assertJsonPath('meta.has_nami_field', true);
|
||||||
|
}
|
||||||
|
|
||||||
public function testItFiltersParticipantsByCheckboxValue(): void
|
public function testItFiltersParticipantsByCheckboxValue(): void
|
||||||
{
|
{
|
||||||
$this->login()->loginNami()->withoutExceptionHandling();
|
$this->login()->loginNami()->withoutExceptionHandling();
|
||||||
|
|
Loading…
Reference in New Issue