Skip to content

Commit

Permalink
#2660 Specialization filter no longer resets when passing more than o…
Browse files Browse the repository at this point in the history
…ne value (csv).
  • Loading branch information
Wotuu committed Jan 31, 2025
1 parent 7e21ce8 commit f9dc203
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/Dungeon/DungeonExploreController.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ public function embed(
$mapBackgroundColor = $request->get('mapBackgroundColor');
$showEnemyInfo = $request->get('showEnemyInfo', false);
$showTitle = $request->get('showTitle', true);
$defaultZoom = $request->get('defaultZoom', 1);

$parameters = [
'type' => $request->get('type'),
Expand Down Expand Up @@ -217,6 +218,7 @@ public function embed(
$seasonService->getWeeklyAffixGroupsSinceStart($mostRecentSeason, GameServerRegion::getUserOrDefaultRegion()) :
collect(),
'parameters' => $parameters,
'defaultZoom' => $defaultZoom,
'embedOptions' => [
'style' => $style,
'headerBackgroundColor' => $headerBackgroundColor,
Expand Down
1 change: 1 addition & 0 deletions app/Http/Requests/Heatmap/ExploreEmbedUrlFormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function rules(): array
'mapBackgroundColor' => ['nullable', 'regex:/^#([a-f0-9]{6}|[a-f0-9]{3})$/i'],
'showEnemyInfo' => 'nullable|bool',
'showTitle' => 'nullable|bool',
'defaultZoom' => 'nullable|numeric',
]);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class SearchFilterSelect extends SearchFilter {
/**
*
* @returns {Array}
*/
getValue() {
return $(`${this.selector}`).val();
}

/**
*
* @param value {string}
*/
setValue(value) {
let split = value.split(',');

$(`${this.selector}`).val(split);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class SearchFilterSpecializations extends SearchFilterInput {
class SearchFilterSpecializations extends SearchFilterSelect {
constructor(selector, onChange) {
super(selector, onChange);
}
Expand All @@ -16,10 +16,6 @@ class SearchFilterSpecializations extends SearchFilterInput {
});
}

getDefaultValue() {
return [];
}

getFilterHeaderText() {
let value = this.getValue();

Expand Down
3 changes: 2 additions & 1 deletion resources/views/dungeon/explore/gameversion/embed.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @var Collection<WeeklyAffixGroup> $seasonWeeklyAffixGroups
* @var array $embedOptions
* @var array $parameters
* @var float $defaultZoom
*/
?>
@extends('layouts.map', [
Expand Down Expand Up @@ -64,7 +65,7 @@
// 'embedStyle' => $embedOptions['style'],
'edit' => false,
'echo' => false,
'defaultZoom' => 1,
'defaultZoom' => $defaultZoom,
'floor' => $floor,
'showAttribution' => false,
'parameters' => $parameters,
Expand Down

0 comments on commit f9dc203

Please sign in to comment.