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

Add additional ids to dom elements for analytics #4276

Merged
merged 2 commits into from
Jun 17, 2024

Conversation

kkatusic
Copy link
Collaborator

@kkatusic kkatusic commented Jun 13, 2024

Resolve #4235

@mosaeedi, cc @divine-comedian, this pull request added additional id property to target dom elements that @mosaeedi request.

Thx to @MohammadPCh for publishing newest version of the ui-design-system

Summary by CodeRabbit

  • New Features

    • Added unique id attributes to various Link components across multiple sections of the app for improved tracking and analytics.
  • Dependencies

    • Updated @giveth/ui-design-system to version 1.11.29.

Copy link

vercel bot commented Jun 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
giveth-dapps-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 13, 2024 11:45am

Copy link
Contributor

coderabbitai bot commented Jun 13, 2024

Walkthrough

This update focuses on adding specific id attributes to various Link and MainButton components across multiple files. These changes aim to enhance tracking capabilities for better analytics using PostHog.

Changes

Files Change Summaries
package.json Updated version of @giveth/ui-design-system from 1.11.28 to 1.11.29.
.../project-card/ProjectCard.tsx Added id='Donate_Card' to the Link component within the ProjectCard component.
.../views/donate/CryptoDonation.tsx Added id='Donate_Final' to the MainButton component.
.../views/homepage/ProjectsCampaignBlock.tsx Added id='Explore_Row' to the Link component.
.../views/homepage/introBlock/index.tsx Added id='Explore_Hero' to the Link component.
.../ProjectPublicActions.tsx Added id='Donate_Project' to the Link component.

Assessment against linked issues

Objective Addressed Explanation
Add Explore_Hero ID to Link on the homepage (#4235)
Add Explore_Row ID to Link on the homepage (#4235)
Add Donate_Card ID to Link on the project card (#4235)
Add Donate_Project ID to Link on the project detail page (#4235)
Add Donate_Final ID to MainButton on the donate screen (#4235)

Poem

🎨 The links now have a name so fine,
Click and track, they're right on time.
From Explore_Hero to Donate_Final glow,
Analytics flow, we truly know.
In code updates, delight we find,
With IDs set, insights unwind. 🌟
🐰✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (3)
src/components/views/homepage/ProjectsCampaignBlock.tsx (1)

Line range hint 94-102: Consider refactoring the renderBullet function expression to an arrow function for consistency and potential performance benefits.

- renderBullet: function (index, className) {
+ renderBullet: (index, className) => {
    return (
        '<span class="' +
        className +
        '">' +
        (index + 1) +
        '</span>'
    );
},
src/components/views/donate/CryptoDonation.tsx (2)

Line range hint 248-250: Consider removing the unnecessary else clause to simplify the control flow.

- } else if (!isSignedIn) {
+ } if (!isSignedIn) {

Line range hint 139-139: Use 'number' instead of 'Number' for consistency and to avoid using banned types.

- variables: { projectId: Number(projectId) },
+ variables: { projectId: number(projectId) },
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 04eeca3 and 7aa0f1c.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/*.lock
Files selected for processing (6)
  • package.json (1 hunks)
  • src/components/project-card/ProjectCard.tsx (1 hunks)
  • src/components/views/donate/CryptoDonation.tsx (1 hunks)
  • src/components/views/homepage/ProjectsCampaignBlock.tsx (1 hunks)
  • src/components/views/homepage/introBlock/index.tsx (1 hunks)
  • src/components/views/project/projectActionCard/ProjectPublicActions.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
  • package.json
Additional context used
Biome
src/components/views/homepage/ProjectsCampaignBlock.tsx

[error] 94-102: This function expression can be turned into an arrow function. (lint/complexity/useArrowFunction)

Function expressions that don't use this can be turned into arrow functions.
Safe fix: Use an arrow function instead.

src/components/views/donate/CryptoDonation.tsx

[error] 248-250: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)

Unsafe fix: Omit the else clause.


[error] 139-139: Don't use 'Number' as a type. (lint/complexity/noBannedTypes)

Use lowercase primitives for consistency.
Safe fix: Use 'number' instead

Additional comments not posted (5)
src/components/views/homepage/ProjectsCampaignBlock.tsx (1)

69-72: Added id attribute to Link component to facilitate analytics.

src/components/views/homepage/introBlock/index.tsx (1)

53-56: Added id attribute to Link component to improve analytics tracking.

src/components/views/project/projectActionCard/ProjectPublicActions.tsx (1)

152-152: Added id attribute to Link component for better tracking of user interactions.

src/components/project-card/ProjectCard.tsx (1)

314-314: Added id attribute to Link component to facilitate tracking in analytics.

src/components/views/donate/CryptoDonation.tsx (1)

542-542: The addition of the id attribute to the MainButton component aligns with the PR objectives to enhance tracking and analytics capabilities.

Copy link
Collaborator

@MohammadPCh MohammadPCh left a comment

Choose a reason for hiding this comment

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

Thanks @kkatusic, LGTM

@MohammadPCh MohammadPCh merged commit 20f5967 into develop Jun 17, 2024
3 checks passed
@MohammadPCh MohammadPCh deleted the add_additional_ids branch June 17, 2024 07:58
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.

Request to add #ID
2 participants