Skip to content

Commit

Permalink
#2681 Various smaller issues fixed.
Browse files Browse the repository at this point in the history
✅  minPeriod/maxPeriod issue
✅  redirects using query params (was using the wrong request validator so it didn't recognize the parameters)
✅  Edit heatmap -> View Fullscreen
✅  dataType now being passed through to the Raider.io API
  • Loading branch information
Wotuu committed Jan 31, 2025
1 parent 96832a1 commit 51026c8
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion app/Http/Requests/Heatmap/ExploreEmbedUrlFormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* All options that a user can pass to the explore embed URL to generate a heatmap in an iframe.
*/
class ExploreEmbedUrlFormRequest extends DungeonRouteBaseUrlFormRequest
class ExploreEmbedUrlFormRequest extends ExploreUrlFormRequest
{
/**
* Determine if the user is authorized to make this request.
Expand Down
4 changes: 1 addition & 3 deletions app/Service/RaiderIO/Dtos/HeatmapDataFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,7 @@ public function toArray(Season $mostRecentSeason = null): array
$result = [
'challengeModeId' => $this->dungeon->challenge_mode_id,
'type' => $this->getEventType()->value,
// @TODO Raider.io API does not support this
// 'eventType' => $this->getEventType()->value,
// 'dataType' => $this->getDataType()->value,
'dataType' => $this->getDataType()->value,
];

$result['minMythicLevel'] = $this->getKeyLevelMin();
Expand Down
2 changes: 1 addition & 1 deletion lang/en_US/js.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@
'filter_enemy_forces_header_complete' => 'Enemy forces: complete',
'filter_image_select_affixes_header' => 'Affixes: :number selected',
'filter_image_select_dungeons_header' => 'Dungeons: :number selected',
'filter_image_select_weekly_affix_groups_header' => 'Week: :week (:date)',
'filter_image_select_weekly_affix_groups_header' => 'Week: :week',
'filter_input_affix_group_header' => 'Affix groups: :number selected',
'filter_input_key_level_header' => 'Key level: :value',
'filter_input_item_level_header' => 'Item level: :value',
Expand Down
8 changes: 4 additions & 4 deletions lang/en_US/view_dungeon.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
'heatmap_available' => 'Heatmap available for dungeon',
],
'embed' => [
'title' => ':dungeon',
'any' => 'Any',
'select_floor' => 'Select floor',
'edit_heatmap' => 'Edit heatmap',
'title' => ':dungeon',
'any' => 'Any',
'select_floor' => 'Select floor',
'view_heatmap_fullscreen' => 'View fullscreen',
],
],
],
Expand Down
4 changes: 4 additions & 0 deletions resources/assets/js/custom/inline/base/searchinlinebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ class SearchInlineBase extends InlineCode {
for (let index in this.filters) {
if (this.filters.hasOwnProperty(index)) {
let filter = this.filters[index];
if (!filter.isEnabled()) {
continue;
}

let value = filter.getValue();

if (value !== null &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class SearchFilterWeeklyAffixGroups extends SearchFilterInput {
let self = this;

// Grouped affixes
$(this.selector).off('change').on('change', function() {
$(this.selector).off('change').on('change', function () {
self.onChange();

refreshSelectPickers();
Expand All @@ -18,11 +18,11 @@ class SearchFilterWeeklyAffixGroups extends SearchFilterInput {

getFilterHeaderText() {
let value = this.getValue();
let option = $(`${this.selector} option`).eq(value);

let displayValue = value.length > 0 ? `${value[0]} - ${value[value.length - 1]}` : '';

return lang.get('messages.filter_image_select_weekly_affix_groups_header')
.replace(':week', '' + value)
.replace(':date', option.data('date'));
.replace(':week', '' + displayValue);
}

getParamsOverride() {
Expand All @@ -43,15 +43,14 @@ class SearchFilterWeeklyAffixGroups extends SearchFilterInput {
return;
}

let val = this.getValue();

let seasonStartPeriod = getState().getMapContext().getSeasonStartPeriod();

// New value must be brought down to week indices
value -= seasonStartPeriod;

let min = val.length === 0 ? seasonStartPeriod : (parseInt(val[0]) - seasonStartPeriod);
let max = val.length === 0 ? seasonStartPeriod : (parseInt(val[val.length - 1]) - seasonStartPeriod);
let val = this.getValue();
let min = val.length === 0 ? 0 : (parseInt(val[0]));
let max = val.length === 0 ? 0 : (parseInt(val[val.length - 1]));

if (name === 'minPeriod') {
min = parseInt(value);
Expand All @@ -61,6 +60,9 @@ class SearchFilterWeeklyAffixGroups extends SearchFilterInput {
console.error(`Invalid name ${name} for weekly affix groups filter override`);
}

// Min can't be above max - at least be equal so we can set min, and max afterwards
max = Math.max(min, max);

// http://localhost:8008/explore/retail/the-necrotic-wake/4?type=enemy_killed&dataType=player_position&minMythicLevel=2&maxMythicLevel=13&minPeriod=977&maxPeriod=986&minTimerFraction=0.28125&maxTimerFraction=1.125
let newVal = [];
for (let i = min; i <= max; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
@endif
</div>
<div class="col-auto px-1">
<a class="btn btn btn-success float-right h-100"
<a class="btn btn btn-primary float-right"
href="{{ $editHeatmapUrl }}"
target="_blank">
<i class="fas fa-external-link-alt"></i> {{ __('view_dungeon.explore.gameversion.embed.edit_heatmap') }}
<i class="fas fa-external-link-alt"></i> {{ __('view_dungeon.explore.gameversion.embed.view_heatmap_fullscreen') }}
</a>
</div>
</div>
Expand Down

0 comments on commit 51026c8

Please sign in to comment.