Skip to content

Commit

Permalink
Merge pull request #2701 from RaiderIO/development
Browse files Browse the repository at this point in the history
Release v11.9.8 - Region filter for heatmaps
  • Loading branch information
Wotuu authored Jan 31, 2025
2 parents 59476eb + d67bada commit 173f576
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/Service/RaiderIO/Dtos/HeatmapDataFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public function toArray(Season $mostRecentSeason = null): array
];

if ($this->getRegion() !== GameServerRegion::WORLD) {
$result['regionId'] = $this->getRegion();
$result['region'] = $this->getRegion();
}
$result['minMythicLevel'] = $this->getKeyLevelMin();
$result['maxMythicLevel'] = $this->getKeyLevelMax();
Expand Down
25 changes: 25 additions & 0 deletions database/seeders/releases/v11.9.8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"id": 274,
"release_changelog_id": 281,
"version": "v11.9.8",
"title": "Region filter for heatmaps",
"backup_db": 1,
"silent": 1,
"spotlight": 0,
"released": 0,
"created_at": "2025-01-31T18:29:41+00:00",
"updated_at": "2025-01-31T18:29:41+00:00",
"changelog": {
"id": 281,
"release_id": 274,
"description": null,
"changes": [
{
"release_changelog_id": 281,
"release_changelog_category_id": 13,
"ticket_id": 2690,
"change": "Added region filter."
}
]
}
}
25 changes: 18 additions & 7 deletions resources/views/common/maps/controls/heatmapsearch.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@
$affixGroups = $allAffixGroupsByActiveExpansion->get($season->expansion->shortname);
/** @var Collection<Affix> $featuredAffixes */
$featuredAffixes = $featuredAffixesByActiveExpansion->get($season->expansion->shortname);
$allRegions = $allRegions->sort(function (GameServerRegion $a, GameServerRegion $b) {
// If one of them is "World", it comes first
if ($a->short === GameServerRegion::WORLD) return -1;
if ($b->short === GameServerRegion::WORLD) return 1;
// Otherwise, sort by ID ascending
return $a->id <=> $b->id;
});
?>
@include('common.general.inline', ['path' => 'common/maps/heatmapsearchsidebar', 'options' => [
'stateCookie' => 'heatmap_search_sidebar_state',
Expand Down Expand Up @@ -201,19 +211,19 @@ class="filter_event_type_icon">
])
<div class="btn-group btn-group-toggle w-100 mb-1"
data-toggle="buttons">
<label class="btn btn-secondary">
<input type="radio" name="data_type"
class="{{ CombatLogEventDataType::EnemyPosition->value }}"
value="{{ CombatLogEventDataType::EnemyPosition->value }}">
<i class="fas fa-map-marked-alt"></i> {{ __('combatlogdatatypes.enemy_position') }}
</label>
<label class="btn btn-secondary active">
<input type="radio" name="data_type"
class="{{ CombatLogEventDataType::PlayerPosition->value }}"
value="{{ CombatLogEventDataType::PlayerPosition->value }}"
checked>
<i class="fas fa-map"></i> {{ __('combatlogdatatypes.player_position') }}
</label>
<label class="btn btn-secondary">
<input type="radio" name="data_type"
class="{{ CombatLogEventDataType::EnemyPosition->value }}"
value="{{ CombatLogEventDataType::EnemyPosition->value }}">
<i class="fas fa-map-marked-alt"></i> {{ __('combatlogdatatypes.enemy_position') }}
</label>
</div>
@endcomponent

Expand All @@ -222,10 +232,11 @@ class="{{ CombatLogEventDataType::PlayerPosition->value }}"
<div id="filter_region_container" class="btn-group btn-group-toggle w-100"
data-toggle="buttons">
@foreach($allRegions as $region)
<label class="btn btn-secondary">
<label class="btn btn-secondary {{ $region->short === 'world' ? 'active' : '' }}">
<input type="radio" name="region"
class="{{ $region->short }}"
value="{{ $region->short }}"
{{ $region->short === 'world' ? 'checked' : '' }}
>
<img src="{{ url(sprintf('images/flags/%s.png', $region->short)) }}"
alt="{{ __($region->name) }}"
Expand Down

0 comments on commit 173f576

Please sign in to comment.