Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
spitfire305 authored and github-actions[bot] committed Feb 5, 2025
1 parent 5f916c7 commit bb7b7fb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
3 changes: 0 additions & 3 deletions app/Datagrids/Filters/CharacterFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
namespace App\Datagrids\Filters;

use App\Facades\Module;
use App\Models\Family;
use App\Models\Organisation;
use App\Models\Race;

class CharacterFilter extends DatagridFilter
{
Expand Down
24 changes: 12 additions & 12 deletions app/Models/Concerns/HasFilters.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,18 +499,18 @@ protected function filterRaces(Builder $query, null|string|array $value = null):
$races = DB::select("
WITH RECURSIVE race_tree AS (
-- Select parents
SELECT * FROM races WHERE id IN (".implode(',', $raceIds).")
SELECT * FROM races WHERE id IN (" . implode(',', $raceIds) . ")
UNION ALL
-- Recursively get all descendants
SELECT r.* FROM races r
INNER JOIN race_tree rt ON r.race_id = rt.id
)
SELECT * FROM race_tree
");
$raceIds = collect($races)->pluck('id'); // Extract IDs
$query->whereIn($this->getTable() . '.race_id', $raceIds)->distinct();
return;
}
$raceIds = collect($races)->pluck('id'); // Extract IDs
$query->whereIn($this->getTable() . '.race_id', $raceIds)->distinct();
return;
}

foreach ($value as $v) {
$v = (int) $v;
Expand Down Expand Up @@ -573,10 +573,10 @@ protected function filterMultipleLocations(Builder $query, null|string|array $va
}

if ($this->filterOption('children')) {
$locations = DB::select("
$locations = DB::select("
WITH RECURSIVE location_tree AS (
-- Select parents
SELECT * FROM locations WHERE id IN (".implode(',', $locationIds).")
SELECT * FROM locations WHERE id IN (" . implode(',', $locationIds) . ")
UNION ALL
-- Recursively get all descendants
SELECT l.* FROM locations l
Expand Down Expand Up @@ -624,18 +624,18 @@ protected function filterOrganisations(Builder $query, null|string|array $value
$orgs = DB::select("
WITH RECURSIVE organisation_tree AS (
-- Select parents
SELECT * FROM organisations WHERE id IN (".implode(',', $orgIds).")
SELECT * FROM organisations WHERE id IN (" . implode(',', $orgIds) . ")
UNION ALL
-- Recursively get all descendants
SELECT r.* FROM organisations r
INNER JOIN organisation_tree rt ON r.organisation_id = rt.id
)
SELECT * FROM organisation_tree
");
$orgIds = collect($orgs)->pluck('id'); // Extract IDs
$query->whereIn($this->getTable() . '.organisation_id', $orgIds)->distinct();
return;
}
$orgIds = collect($orgs)->pluck('id'); // Extract IDs
$query->whereIn($this->getTable() . '.organisation_id', $orgIds)->distinct();
return;
}

foreach ($value as $v) {
$v = (int) $v;
Expand Down
2 changes: 1 addition & 1 deletion app/Services/MentionsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ protected function replaceEntityMentions(): void
. '</span>';
} elseif ($field === 'attributes') {
return '<iframe src="' . route('entities.attributes-dashboard', [$this->campaign, $entity]) . '" class="entity-attributes-render w-full h-full"></iframe>';
} elseif (!$entity->isMissingChild() && isset($entity->child->$field)) {
} elseif (!$entity->isMissingChild() && isset($entity->child->$field)) {
$foreign = $entity->child->$field;
if ($foreign instanceof Model) {
if (isset($foreign->name) && !empty($foreign->name)) {
Expand Down

0 comments on commit bb7b7fb

Please sign in to comment.