Skip to content

feat(statistics): support for custom date ranges - #3622

Merged
luceos merged 24 commits into
mainfrom
dw/stats-custom-start-end-date
Sep 29, 2022
Merged

feat(statistics): support for custom date ranges#3622
luceos merged 24 commits into
mainfrom
dw/stats-custom-start-end-date

Conversation

@davwheat

@davwheat davwheat commented Aug 30, 2022

Copy link
Copy Markdown
Contributor

Changes proposed in this pull request:

  • add option to choose a custom date range for the statistics widget
  • add integration tests for statistics data api requests

Reviewers should focus on:

Screenshot

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

@davwheat davwheat self-assigned this Aug 30, 2022
@davwheat davwheat added this to the 1.5 milestone Aug 30, 2022
@davwheat
davwheat force-pushed the dw/stats-custom-start-end-date branch from a34c8ec to 82ebf32 Compare September 4, 2022 01:28
@SychO9 SychO9 modified the milestones: 1.5, 1.6 Sep 6, 2022
@davwheat
davwheat marked this pull request as ready for review September 7, 2022 23:38
@davwheat
davwheat requested a review from a team as a code owner September 7, 2022 23:38
@davwheat davwheat changed the title feat: support for custom date ranges in statistics feat(statistics): support for custom date ranges Sep 10, 2022
}

export default class StatisticsWidgetDateSelectionModal extends Modal<IStatisticsWidgetDateSelectionModalAttrs> {
/* @ts-expect-error core typings don't allow us to set the type of the state attr :( */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

noticed this too, I guess like we have to always type a default state/attribute type in any core components to not hinder extensibility going forward?

@davwheat davwheat Sep 20, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we've done it in some components, but not all.

Just a "simple" class MyComponent<CustomAttrs extends BaseAttrs = BaseAttrs, CustomState extends BaseState> extends BaseComponent<CustomAttrs, CustomState> should work.

Comment thread extensions/statistics/src/Api/Controller/ShowStatisticsData.php Outdated
davwheat and others added 3 commits September 20, 2022 14:32
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
@davwheat
davwheat requested a review from SychO9 September 20, 2022 13:35
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
@luceos
luceos merged commit 76788ef into main Sep 29, 2022
@luceos
luceos deleted the dw/stats-custom-start-end-date branch September 29, 2022 11:12
@luceos luceos mentioned this pull request Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants