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: Add analytics metadata to Flashbar #2687

Merged
merged 1 commit into from
Sep 12, 2024
Merged

Conversation

fralongo
Copy link
Member

Description

Similar to 9c17527

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@fralongo fralongo requested a review from a team as a code owner September 10, 2024 09:22
@fralongo fralongo requested review from orangevolon and removed request for a team September 10, 2024 09:22
@fralongo fralongo force-pushed the flongo-autocapture-flashbar branch from 8e26524 to 8ef8dd8 Compare September 10, 2024 09:37
Copy link

codecov bot commented Sep 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.84%. Comparing base (9c17527) to head (d4a7dcf).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2687      +/-   ##
==========================================
- Coverage   95.85%   95.84%   -0.01%     
==========================================
  Files         744      745       +1     
  Lines       20581    20596      +15     
  Branches     7015     6649     -366     
==========================================
+ Hits        19727    19741      +14     
- Misses        846      847       +1     
  Partials        8        8              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

className={styles['dismiss-button-wrapper']}
{...getAnalyticsMetadataAttribute({
action: 'dismiss',
} as Partial<GeneratedAnalyticsMetadataFlashbarDismiss>)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Two questions about this line:

  1. We defined GeneratedAnalyticsMetadataFlashbarDismiss interface but its only use case is in this line with Partial<...>. Why we don't just mark the label as optional?
  2. Why we don't use a creator functions like the other cases? something like getDismissButtonAnalyticsMetadata which returns this type like others?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for the comments:

  1. The output the function that collects the metadata will have a label. We use this attribute here to override the action part of it, which would be a generic click. I prefer to keep the type aligned with the outcome of the processing, so that I can automatically generate documentation in the future.
  2. More than 15 components are already instrumented, and I normally didn't need to create specific functions to collect the metadata. The Flashbar was an exception because of the double implementation (collapsible and non-collapsible. However, if you prefer I can create a function. Let me know.

@fralongo fralongo added this pull request to the merge queue Sep 12, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 12, 2024
@fralongo fralongo added this pull request to the merge queue Sep 12, 2024
Merged via the queue into main with commit 2e32ba3 Sep 12, 2024
33 checks passed
@fralongo fralongo deleted the flongo-autocapture-flashbar branch September 12, 2024 15:47
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.

2 participants