Skip to content

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Nov 9, 2018

Fix #955

re-used the calendar icon. same period will be applied in export dialog. won't work for range dates just like the limit selector.

@tsteur tsteur added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Nov 9, 2018
@tsteur tsteur added this to the 3.8.0 milestone Nov 9, 2018
@@ -515,6 +527,12 @@ public function __construct()
Metrics::getDefaultProcessedMetrics()
);

$periodValidator = new PeriodValidator();
$this->selectable_periods = $periodValidator->getPeriodsAllowedForUI();
$this->selectable_periods = array_diff($this->selectable_periods, array('range'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this filtering also be done before rendering? For example, if someone sets the periods to ['day', 'week', 'garbage', 'range'], should we remove the values that aren't allowed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have said it's not needed maybe cause a plugin might support it but not actually implement it fully in Matomo but that shouldn't be an issue I suppose. I think the feature usually won't be used so wouldn't do too much about it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Development

Successfully merging this pull request may close these issues.

2 participants