Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 24 commits into from
Sep 29, 2022

Conversation

davwheat
Copy link
Member

@davwheat davwheat commented Aug 30, 2022

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
Member

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?

Copy link
Member Author

@davwheat davwheat Sep 20, 2022

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.

@davwheat davwheat requested a review from SychO9 September 20, 2022 13:35
Signed-off-by: Sami Mazouz <[email protected]>
@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