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: exposes gotoPeriod method to top level, removes unused event parameter #212

Merged
merged 3 commits into from
Nov 30, 2023
Merged

Conversation

MarcelR1998
Copy link
Contributor

@MarcelR1998 MarcelR1998 commented Nov 30, 2023

Checklist

Please put "X" in the below checkboxes that apply::

  • If committing a bugfix, I have tested it in different browsers (Chrome, Firefox, Safari).
  • If committing a new feature, I have first submitted an issue (Please note: you are free to open PRs for non-issued features, but opening an issue increases your chance of a successful PR).
  • If committing a new feature, I have also written an appropriate test suite for it.

I have tested the following:

  • Qalendar component in month mode.
  • Qalendar component in week mode.
  • Qalendar component in day mode.
  • All of the above modes on emulated mobile view.
  • Dragging and dropping events.
  • Resizing events in day/week modes.
  • Clicking events to open event dialog.

This PR solves the following problem**.

Allows for more customization of the calendar. A fully custom header can be achieved by hiding the default one, calling for example @click="$refs.calendar.mode = 'month' to change mode, and with my pull request, utilize the existing goToPeriod method to change period rather than having to create a method that modifies selected-date.

I have run the existing Vitest suite, and I guess an improvement could be to create a test along with buttons in the same file as the Qalendar element, with the test running the method through the ref by clicking

How to test this PR**.

For example:

  1. Add a template ref to wherever Qalendar is used
  2. Create new buttons, with a click event that fires $refs.<refname>.goToPeriod('next') and $refs.<refname>.goToPeriod('previous')

@tomosterlund tomosterlund self-requested a review November 30, 2023 11:11
@tomosterlund
Copy link
Owner

Hi @MarcelR1998. Thanks for opening this PR 👍 I'll have a look at it after work tonight

@coveralls
Copy link

coveralls commented Nov 30, 2023

Coverage Status

coverage: 97.607% (+0.3%) from 97.262%
when pulling 8b0c3ed on MarcelR1998:master
into 170d759 on tomosterlund:master.

Copy link
Owner

@tomosterlund tomosterlund left a comment

Choose a reason for hiding this comment

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

Just added a unit test, but otherwise everything looks good to me!

Tack för ditt bidrag :)

src/components/header/Header.vue Show resolved Hide resolved
@tomosterlund tomosterlund merged commit 18b091c into tomosterlund:master Nov 30, 2023
7 checks passed
@felix-berlin
Copy link
Collaborator

🎉 This PR is included in version 3.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@MarcelR1998
Copy link
Contributor Author

🥳 🥳 <3<3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants