...
 
Commits (2)
......@@ -19,6 +19,22 @@ abstract class AbstractFilter
/** @var string */
protected $selectedOption;
/**
* Set the selected option and toggle if selected
* @param string $selectedOptionId
* @return self
*/
public function setSelectedOption(string $selectedOptionId): self
{
$this->selectedOption = $selectedOptionId;
foreach ($this->options->getOptions() as $k => $option) {
if ($option->getId() === $selectedOptionId) {
$option->setSelected(true);
}
}
return $this;
}
/**
* Export
* @param array $extras
......
......@@ -7,7 +7,7 @@ class PlatformFilter extends AbstractFilter
protected $id = "platform";
/** @var string */
protected $label = "Platform types";
protected $label = "Platform";
public function __construct()
{
......
......@@ -92,7 +92,7 @@ class TrafficDashboard implements DashboardInterface
'category' => 'traffic',
'timespan' => $this->timespansCollection->getSelected()->getId(),
'timespans' => $this->timespansCollection->export(),
'metric' => $this->metricsCollection->getSelected()->getId(),
'metric' => $this->metricsCollection->getSelected()->export(),
'metrics' => $this->metricsCollection->export(),
'filter' => $this->filtersCollection->getSelectedIds(),
'filters' => $this->filtersCollection->export(),
......