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

[agenda] dispatch eventClicked when event is clicked #372

Merged

Conversation

krisgardiner
Copy link
Contributor

@krisgardiner krisgardiner commented Feb 1, 2022

Code changes

Context

While waiting for a PR that allows cancelable custom events to get merged, we need to dispatching an eventClicked event on top of click_action since some users may want the event fired without overriding our set behaviour.

  • dispatch custom eventClicked event when event is clicked
  • adds custom cypress command addListener to add event listeners from chaining a getter.

Before:

cy.get("@agenda").then((element) => {
      const agenda = element[0];
      agenda.addEventListener('event', () => {
        // logic goes here
      });
    });

After:

cy.get("@agenda").addListener("dateChange", () => {
   // logic goes here
});
  • adds test for dateChange dispatch events

Readiness checklist

  • Added changes to component CHANGELOG.md

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #79813: [Agenda] custom event for when a specific event is clicked.

@vercel
Copy link

vercel bot commented Feb 1, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nylas/components/FTz89qp8MNvChKK7LMW118JSEBwY
✅ Preview: https://components-git-kg-sc-79813agenda-custom-event-when-34e521-nylas.vercel.app

@krisgardiner krisgardiner merged commit 3b1b301 into main Feb 1, 2022
@krisgardiner krisgardiner deleted the kg/sc-79813/agenda-custom-event-when-event-clicked branch February 1, 2022 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants