Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk: Parents should be named parent #749

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/AbilityBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AbilityBulk extends Bulk
protected array $fields = [
'name',
'type',
'ability_id',
'parent_ability_id',
'tags',
'private_choice',
];
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/CreatureBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class CreatureBulk extends Bulk
protected array $fields = [
'name',
'type',
'creature_id',
'parent_creature_id',
'tags',
'private_choice',
];
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/EventBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class EventBulk extends Bulk
protected array $fields = [
'name',
'type',
'event_id',
'parent_event_id',
'location_id',
'tags',
'private_choice',
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/FamilyBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class FamilyBulk extends Bulk
protected array $fields = [
'name',
'type',
'family_id',
'parent_family_id',
'location_id',
'tags',
'private_choice',
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/ItemBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ItemBulk extends Bulk
'type',
'price',
'size',
'item_id',
'parent_item_id',
'location_id',
'character_id',
'tags',
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/JournalBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class JournalBulk extends Bulk
protected array $fields = [
'name',
'type',
'journal_id',
'parent_journal_id',
'author_id',
'location_id',
'tags',
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/MapBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class MapBulk extends Bulk
protected array $fields = [
'name',
'type',
'map_id',
'parent_map_id',
'tags',
'private_choice',
];
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/NoteBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class NoteBulk extends Bulk
protected array $fields = [
'name',
'type',
'note_id',
'parent_note_id',
'tags',
'private_choice',
];
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/OrganisationBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OrganisationBulk extends Bulk
'name',
'type',
'location_id',
'organisation_id',
'parent_organisation_id',
'tags',
'private_choice',
'defunct_choice'
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/QuestBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class QuestBulk extends Bulk
protected array $fields = [
'name',
'type',
'quest_id',
'parent_quest_id',
'instigator_id',
'completed_choice',
'tags',
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/RaceBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class RaceBulk extends Bulk
protected array $fields = [
'name',
'type',
'race_id',
'parent_race_id',
'tags',
'private_choice',
];
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/TagBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class TagBulk extends Bulk
'name',
'type',
'colour',
'tag_id',
'parent_tag_id',
'private_choice',
'auto_applied_choice',
'hide_choice',
Expand Down
2 changes: 1 addition & 1 deletion app/Datagrids/Bulks/TimelineBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class TimelineBulk extends Bulk
protected array $fields = [
'name',
'type',
'timeline_id',
'parent_timeline_id',
'tags',
'private_choice',
];
Expand Down
8 changes: 7 additions & 1 deletion resources/views/cruds/datagrids/bulks/modals/batch.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
<x-dialog id="bulk-edit" :title="__('crud.bulk.edit.title')" footer="cruds.datagrids.bulks.modals._batch-footer">
<x-grid>
@foreach ($bulk->fields() as $field)
@php $trimmed = \Illuminate\Support\Str::beforeLast($field, '_id'); @endphp
@php
$trimmed = \Illuminate\Support\Str::between($field,'parent_', '_id');
$isParent = \Illuminate\Support\Str::contains($field, 'parent');
@endphp


{!! $fieldCount % 2 === 0 ? '' : null !!}
@include('cruds.fields.' . $trimmed, [
'trans' => $name,
Expand All @@ -13,6 +18,7 @@
'allowNew' => false,
'dropdownParent' => '#bulk-edit',
'route' => null,
'isParent' => $isParent,
])
@php $fieldCount++; @endphp
@endforeach
Expand Down
1 change: 0 additions & 1 deletion resources/views/cruds/fields/parent_location.blade.php

This file was deleted.

Loading