Compare commits

..

No commits in common. "011e414848eb020e5fb5a5ec3aea03c65a96c803" and "a456cc1889cfdba15743b83a43708e0e639fb980" have entirely different histories.

9 changed files with 2 additions and 68 deletions

View File

@ -1,13 +1,5 @@
# Letzte Änderungen # Letzte Änderungen
### 1.12.4
- Filter Mitglieder nach Verhaltenskodex
### 1.12.3
- Volltextsuche für Rechnungen
### 1.12.2 ### 1.12.2
- Zuschussliste Gallier - Zuschussliste Gallier

View File

@ -46,8 +46,6 @@ class FilterScope extends ScoutFilter
public array $exclude = [], public array $exclude = [],
public ?bool $hasFullAddress = null, public ?bool $hasFullAddress = null,
public ?bool $hasBirthday = null, public ?bool $hasBirthday = null,
public ?bool $hasSvk = null,
public ?bool $hasVk = null,
) { ) {
} }
@ -87,12 +85,6 @@ class FilterScope extends ScoutFilter
if ($this->hasBirthday === true) { if ($this->hasBirthday === true) {
$filter->push('birthday IS NOT NULL'); $filter->push('birthday IS NOT NULL');
} }
if ($this->hasSvk !== null) {
$filter->push('has_svk = ' . ($this->hasSvk ? 'true' : 'false'));
}
if ($this->hasVk !== null) {
$filter->push('has_vk = ' . ($this->hasVk ? 'true' : 'false'));
}
if ($this->ausstand === true) { if ($this->ausstand === true) {
$filter->push('ausstand > 0'); $filter->push('ausstand > 0');
} }

View File

@ -544,8 +544,6 @@ class Member extends Model implements Geolocatable
'bill_kind' => $this->bill_kind?->value, 'bill_kind' => $this->bill_kind?->value,
'group_id' => $this->group->id, 'group_id' => $this->group->id,
'group_name' => $this->group->inner_name ?: $this->group->name, 'group_name' => $this->group->inner_name ?: $this->group->name,
'has_vk' => $this->has_vk,
'has_svk' => $this->has_svk,
'links' => [ 'links' => [
'show' => route('member.show', ['member' => $this], false), 'show' => route('member.show', ['member' => $this], false),
'edit' => route('member.edit', ['member' => $this], false), 'edit' => route('member.edit', ['member' => $this], false),

View File

@ -163,10 +163,6 @@ class MemberResource extends JsonResource
'activity_ids' => [], 'activity_ids' => [],
'subactivity_ids' => [] 'subactivity_ids' => []
], ],
'boolean_filter' => [
['id' => true, 'name' => 'Ja'],
['id' => false, 'name' => 'Nein'],
],
'default' => [ 'default' => [
'gender_id' => null, 'gender_id' => null,
'salutation' => '', 'salutation' => '',

View File

@ -138,7 +138,7 @@ return [
'key' => env('MEILI_MASTER_KEY', null), 'key' => env('MEILI_MASTER_KEY', null),
'index-settings' => [ 'index-settings' => [
Member::class => [ Member::class => [
'filterableAttributes' => ['address', 'birthday', 'ausstand', 'bill_kind', 'group_id', 'memberships', 'has_vk', 'has_svk', 'id'], 'filterableAttributes' => ['address', 'birthday', 'ausstand', 'bill_kind', 'group_id', 'memberships', 'id'],
'searchableAttributes' => ['fullname', 'address'], 'searchableAttributes' => ['fullname', 'address'],
'sortableAttributes' => ['lastname', 'firstname'], 'sortableAttributes' => ['lastname', 'firstname'],
'displayedAttributes' => ['age_group_icon', 'group_name', 'links', 'is_leader', 'lastname', 'firstname', 'fullname', 'address', 'ausstand', 'birthday', 'id', 'memberships', 'bill_kind', 'group_id'], 'displayedAttributes' => ['age_group_icon', 'group_name', 'links', 'is_leader', 'lastname', 'firstname', 'fullname', 'address', 'ausstand', 'birthday', 'id', 'memberships', 'bill_kind', 'group_id'],

View File

@ -37,8 +37,6 @@ class MemberFactory extends Factory
'email' => $this->faker->safeEmail(), 'email' => $this->faker->safeEmail(),
'recertified_at' => null, 'recertified_at' => null,
'keepdata' => false, 'keepdata' => false,
'has_svk' => $this->faker->boolean(),
'has_vk' => $this->faker->boolean(),
]; ];
} }

View File

@ -48,24 +48,6 @@
size="sm" size="sm"
@update:model-value="setFilter('ausstand', $event)" @update:model-value="setFilter('ausstand', $event)"
></f-switch> ></f-switch>
<f-select
id="has_vk"
name="has_vk"
:model-value="getFilter('has_vk')"
label="Verhaltenskodex unterschrieben"
size="sm"
:options="meta.boolean_filter"
@update:model-value="setFilter('has_vk', $event)"
></f-select>
<f-select
id="has_svk"
name="has_svk"
:model-value="getFilter('has_svk')"
label="SVK unterschrieben"
size="sm"
:options="meta.boolean_filter"
@update:model-value="setFilter('has_svk', $event)"
></f-select>
<f-multipleselect <f-multipleselect
id="group_ids" id="group_ids"
:options="meta.groups" :options="meta.groups"

View File

@ -202,30 +202,6 @@ class MemberIndexTest extends EndToEndTestCase
]])->assertInertiaCount('data.data', 1); ]])->assertInertiaCount('data.data', 1);
} }
public function testItFiltersForSvkPrevention(): void
{
Member::factory()->defaults()->create(['has_svk' => true]);
Member::factory()->defaults()->create(['has_svk' => false]);
Member::factory()->defaults()->create(['has_svk' => false]);
sleep(1);
$this->callFilter('member.index', ['has_svk' => true])->assertInertiaCount('data.data', 1);
$this->callFilter('member.index', ['has_svk' => false])->assertInertiaCount('data.data', 2);
$this->callFilter('member.index', ['has_svk' => null])->assertInertiaCount('data.data', 3);
}
public function testItFiltersForVkPrevention(): void
{
Member::factory()->defaults()->create(['has_vk' => true]);
Member::factory()->defaults()->create(['has_vk' => false]);
Member::factory()->defaults()->create(['has_vk' => false]);
sleep(1);
$this->callFilter('member.index', ['has_vk' => true])->assertInertiaCount('data.data', 1);
$this->callFilter('member.index', ['has_vk' => false])->assertInertiaCount('data.data', 2);
$this->callFilter('member.index', ['has_vk' => null])->assertInertiaCount('data.data', 3);
}
public function testGroupOfMembershipsFilterCanBeEmpty(): void public function testGroupOfMembershipsFilterCanBeEmpty(): void
{ {
$mitglied = Activity::factory()->create(); $mitglied = Activity::factory()->create();

View File

@ -149,7 +149,7 @@ class ShowTest extends TestCase
->for(Group::factory()) ->for(Group::factory())
->for(Nationality::factory()->name('deutsch')) ->for(Nationality::factory()->name('deutsch'))
->for(Subscription::factory()->forFee()) ->for(Subscription::factory()->forFee())
->create(['firstname' => 'Max', 'lastname' => 'Muster', 'has_vk' => false, 'has_svk' => false]); ->create(['firstname' => 'Max', 'lastname' => 'Muster']);
$response = $this->get("/member/{$member->id}"); $response = $this->get("/member/{$member->id}");