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

Added data-popup attr to a tag #291

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vipulnarang95
Copy link
Contributor

@vipulnarang95 vipulnarang95 commented Nov 23, 2024

Description

Added an attribute from parent a tag to be included in burger menu item.

Attribute name: data-popup

Data popup is needed to open a link in burger menu in another window. this value is present in the original html of the link but not included while creating the burger menu.
for your reference: https://github.com/FidelityInternational/djangocms-content-expiry/blob/main/djangocms_content_expiry/templates/djangocms_content_expiry/calendar_icon.html

Related resources

  • #...
  • #...

Checklist

Summary by Sourcery

New Features:

  • Add support for 'data-popup' attribute in burger menu items.

Copy link

sourcery-ai bot commented Nov 23, 2024

Reviewer's Guide by Sourcery

The PR adds functionality to copy the 'data-popup' attribute from parent anchor tags to burger menu items. This is implemented by retrieving the attribute value using jQuery's attr() method and conditionally setting it on the newly created anchor element if the attribute exists on the parent.

Sequence diagram for adding 'data-popup' attribute to burger menu items

sequenceDiagram
    participant User
    participant ParentAnchor as Parent <a> Tag
    participant BurgerMenu as Burger Menu Item

    User->>ParentAnchor: Clicks on menu
    activate ParentAnchor
    ParentAnchor-->>BurgerMenu: Retrieve 'data-popup' attribute
    deactivate ParentAnchor
    activate BurgerMenu
    BurgerMenu-->>BurgerMenu: Set 'data-popup' attribute if exists
    deactivate BurgerMenu
Loading

File-Level Changes

Change Details Files
Added support for copying data-popup attribute to burger menu items
  • Added retrieval of data-popup attribute from parent element using jQuery
  • Added conditional check to ensure attribute exists before copying
  • Added setAttribute call to copy data-popup attribute to new anchor element
djangocms_moderation/static/djangocms_moderation/js/burger.js

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @vipulnarang95 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Please add a changelog entry following the conventional commits guidelines as mentioned in the checklist.
  • Could you expand the PR description to explain why this data-popup attribute needs to be copied and what functionality it enables?
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

codecov bot commented Nov 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.28%. Comparing base (79aaae4) to head (386e024).
Report is 70 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #291      +/-   ##
==========================================
- Coverage   84.19%   79.28%   -4.92%     
==========================================
  Files          23       40      +17     
  Lines        1740     1868     +128     
  Branches      282      213      -69     
==========================================
+ Hits         1465     1481      +16     
- Misses        245      355     +110     
- Partials       30       32       +2     

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


🚨 Try these New Features:

@vipulnarang95
Copy link
Contributor Author

Hi @fsbraun @Aiky30 ,
Can you please help review this?

Thanks
Vipul

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.

1 participant