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

[Vue] migrate date-picker and other period-selector related components #18213

Merged
merged 67 commits into from Nov 9, 2021

Conversation

diosmosis
Copy link
Member

@diosmosis diosmosis commented Oct 25, 2021

Description:

This PR is based off of #18193.

Changes:

  • Migrate piwik-date-picker component to Vue.
  • Migrate piwik-date-range-picker component.
  • Migrate piwik-period-date-picker component.
  • Migrate piwik-expand-on-click directive and piwik-expand-on-hover directive.
  • Add event mapping support to createAngularJsAdapter().

Notes:

  • Using the composition API (doing a lot of work in setup()) vs. the options API (properties in defineComponent(...)) moreso here since it's easier when watching multiple properties at the same time (though it's still hard to do w/ Vue). Neither API is preferred over the other by the vue apparently.

image

Review

…se v-model, add event parameters to createAngularAdapter, allow translate to use variadic args or one string array + rebuild
…ndling to just reset back to the previous date since it was easier in vue to do that)
@diosmosis diosmosis added Do not close PRs with this label won't be marked as stale by the Close Stale Issues action and removed Stale The label used by the Close Stale Issues action labels Nov 3, 2021
@diosmosis diosmosis marked this pull request as draft November 3, 2021 01:46
@diosmosis diosmosis marked this pull request as ready for review November 6, 2021 23:27
@diosmosis diosmosis added the Needs Review PRs that need a code review label Nov 6, 2021
@diosmosis
Copy link
Member Author

@sgiehl looks like tests are passing, this one should be ready to review.

@diosmosis
Copy link
Member Author

Actually, there's still one issue here, I'd wait a bit.

@diosmosis
Copy link
Member Author

@sgiehl this is ready for review now.

@peterhashair
Copy link
Contributor

that looks good to me.

Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

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

Left a minor comment. Besides that the code looks fine and the tests seems still to pass. Feel free to merge @diosmosis


if (!(date instanceof Date)) {
try {
date = $.datepicker.parseDate('yy-mm-dd', date);
Copy link
Member

Choose a reason for hiding this comment

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

any reason for not using Periods/utilities/parseDate? I know it's handling some stuff more than needed, but might be good to minimize the direct usage of the datepicker methods, so it's easier to switch it at some point maybe.

Copy link
Member Author

Choose a reason for hiding this comment

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

No reason, I missed this. You're right it should use the typescript method.

@diosmosis diosmosis merged commit bc75f9d into 4.x-dev Nov 9, 2021
@diosmosis diosmosis deleted the vue-date-picker branch November 9, 2021 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Do not close PRs with this label won't be marked as stale by the Close Stale Issues action Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants