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(store-sdk): custom events, tests and docs #937

Merged
merged 14 commits into from
Sep 9, 2021

Conversation

icazevedo
Copy link
Contributor

What's the purpose of this pull request?

This PR adds tests and docs to analytics and changes the types so users are able to send and receive custom events as well.

How it works?

This PR adds a type called UnknownEvent. It's the minimal event that can be sent via sendAnalyticsEvent. The suggestions for the AnalyticsEvent still happen, but users can override it with their own events by overriding the generic type on the sendAnalyticsEvent function.

@icazevedo icazevedo self-assigned this Sep 6, 2021
@icazevedo icazevedo requested a review from a team as a code owner September 6, 2021 18:29
@netlify
Copy link

netlify bot commented Sep 6, 2021

✔️ Deploy Preview for storeui ready!

🔨 Explore the source changes: 500dfec

🔍 Inspect the deploy log: https://app.netlify.com/sites/storeui/deploys/613a41d19850d00007545cfc

😎 Browse the preview: https://deploy-preview-937--storeui.netlify.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 6, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 500dfec:

Sandbox Source
Store UI Typescript Configuration

@icazevedo icazevedo changed the title Feat/custom events and tests docs feat(store-sdk): custom events and tests docs Sep 6, 2021
@icazevedo icazevedo changed the title feat(store-sdk): custom events and tests docs feat(store-sdk): custom events, tests and docs Sep 6, 2021
Copy link
Contributor

@tlgimenes tlgimenes left a comment

Choose a reason for hiding this comment

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

Nice! some small nits

Co-authored-by: Emerson Laurentino <emersonlaurentino@hotmail.com>
Ícaro Azevedo and others added 2 commits September 8, 2021 11:55
Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>
Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>
@icazevedo icazevedo merged commit c268542 into master Sep 9, 2021
@icazevedo icazevedo deleted the feat/custom-events-and-tests-docs branch September 9, 2021 17:23
Gmantiqueira pushed a commit that referenced this pull request Sep 14, 2021
* fix: general wrapper types for analytics and removed unecessary code from unwrap function

* chore: renaming analytics index file to wrap

* chore: adding wrap and unwrap functions tests

* chore: adding tests to analytics layer

* feat: allows sending custom analytics events

* feat: add docs to analytics

* chore: add test for custom event

* docs: adding link to GA4 spec

* chore: removing tsdx incompatible code

* fix: change title name to analytics

* docs: correct grammar

Co-authored-by: Emerson Laurentino <emersonlaurentino@hotmail.com>

* docs: improve readability and fix erros on code

Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>

* chore: improve error message from useAnalyticsEvent

Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>

* chore: moving event samples to fixture file

Co-authored-by: Emerson Laurentino <emersonlaurentino@hotmail.com>
Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>
rrbambokian pushed a commit that referenced this pull request Sep 30, 2021
* fix: general wrapper types for analytics and removed unecessary code from unwrap function

* chore: renaming analytics index file to wrap

* chore: adding wrap and unwrap functions tests

* chore: adding tests to analytics layer

* feat: allows sending custom analytics events

* feat: add docs to analytics

* chore: add test for custom event

* docs: adding link to GA4 spec

* chore: removing tsdx incompatible code

* fix: change title name to analytics

* docs: correct grammar

Co-authored-by: Emerson Laurentino <emersonlaurentino@hotmail.com>

* docs: improve readability and fix erros on code

Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>

* chore: improve error message from useAnalyticsEvent

Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>

* chore: moving event samples to fixture file

Co-authored-by: Emerson Laurentino <emersonlaurentino@hotmail.com>
Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>
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.

4 participants