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

refactor: update modal handling and improve CMS detection #210

Merged
merged 4 commits into from
Sep 30, 2024

Conversation

psyray
Copy link
Contributor

@psyray psyray commented Sep 30, 2024

Summary by Sourcery

Refactor modal handling and improve CMS detection by standardizing modal content updates, enhancing CMS detection with new event listeners, updating modal dismissal for Bootstrap 5, removing redundant IDs, and improving project-specific data handling.

Enhancements:

  • Refactor modal handling by standardizing the use of '#modal_dialog' and '.modal-text' for content updates across various JavaScript files.
  • Improve CMS detection functionality by introducing a new event listener for detecting CMS on subdomains, utilizing data attributes for passing necessary information.
  • Update modal dismissal buttons to use 'data-bs-dismiss' for Bootstrap 5 compatibility.
  • Remove redundant IDs from modal elements in HTML templates to streamline the code and prevent potential conflicts.
  • Enhance handling of project-specific data by passing the current project slug to relevant functions.

- Refactored modal handling by standardizing the use of #modal_dialog and .modal-text for content updates across various JavaScript files.
- Enhanced the CMS detection functionality by introducing a new event listener for detecting CMS on subdomains, utilizing data attributes for passing necessary information.
- Updated modal dismissal buttons to use data-bs-dismiss for Bootstrap 5 compatibility.
- Removed redundant IDs from modal elements in HTML templates to streamline the code and prevent potential conflicts.
- Improved the handling of project-specific data by passing the current project slug to relevant functions.
Copy link
Contributor

sourcery-ai bot commented Sep 30, 2024

Reviewer's Guide by Sourcery

This pull request refactors modal handling, improves CMS detection, and updates Bootstrap compatibility across multiple JavaScript and HTML files. The changes standardize modal content updates, introduce a new CMS detection event listener, and update modal dismissal buttons for Bootstrap 5.

No sequence diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Standardized modal content updates
  • Updated selectors to use '#modal_dialog' and '.modal-text' consistently
  • Replaced '#modal-content' with '.modal-text' for content updates
  • Updated '#modal-footer' to '#modal_dialog .modal-footer'
web/startScan/static/startScan/js/detail_scan.js
web/static/custom/custom.js
web/scanEngine/static/scanEngine/js/custom_tools.js
web/static/custom/todo.js
web/targetApp/templates/organization/list.html
web/scanEngine/templates/scanEngine/settings/llm_toolkit.html
web/static/custom/toolbox.js
Enhanced CMS detection functionality
  • Introduced a new event listener for detecting CMS on subdomains
  • Updated the CMS detection function to use data attributes
  • Modified the CMS detection button to include necessary data attributes
web/startScan/static/startScan/js/detail_scan.js
web/startScan/templates/startScan/detail_scan.html
web/startScan/templates/startScan/subdomains.html
web/targetApp/templates/target/summary.html
Updated modal dismissal buttons for Bootstrap 5 compatibility
  • Changed 'data-dismiss' to 'data-bs-dismiss' on modal close buttons
  • Updated CSS selectors to match the new 'data-bs-dismiss' attribute
web/templates/base/_items/top_bar.html
web/static/plugins/todo/todolist.css
web/recon_note/templates/note/index.html
web/static/plugins/datatable/datatables.js
Improved project-specific data handling
  • Updated functions to pass the current project slug as a parameter
  • Modified function calls to include the project slug
web/startScan/static/startScan/js/detail_scan.js
web/startScan/templates/startScan/detail_scan.html
web/startScan/templates/startScan/subdomains.html
web/targetApp/templates/target/summary.html
Refactored modal structure in HTML templates
  • Removed redundant IDs from modal elements
  • Simplified modal HTML structure
web/templates/base/_items/modal.html

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.

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

@psyray psyray added bug Something isn't working refactor labels Sep 30, 2024
@psyray psyray self-assigned this Sep 30, 2024
@psyray psyray requested review from 0b3ud and AnonymousWP September 30, 2024 12:40
web/static/custom/toolbox.js Fixed Show fixed Hide fixed
web/templates/base/_items/top_bar.html Fixed Show fixed Hide fixed
web/templates/base/_items/top_bar.html Fixed Show fixed Hide fixed
web/templates/base/_items/top_bar.html Fixed Show fixed Hide fixed
web/templates/base/_items/top_bar.html Fixed Show fixed Hide fixed
web/templates/base/_items/top_bar.html Fixed Show fixed Hide fixed
web/templates/base/_items/top_bar.html Fixed Show fixed Hide fixed
web/templates/base/_items/top_bar.html Fixed Show fixed Hide fixed
Copy link
Contributor

@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 @psyray - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 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.

- The changes involve removing duplicate data-bs-dismiss="modal" attributes from the close buttons in multiple modal headers within the top_bar.html template. This ensures that each button has a single data-bs-dismiss attribute, improving code clarity and potentially preventing unexpected behavior.
- Changed the method for setting the modal title from html() to text() to ensure proper handling of text content.
- Updated the jQuery selectors for modal elements in the get_dork_details function to ensure they specifically target elements within the #modal_dialog container. This change enhances the specificity and reliability of the modal rendering process.
@psyray
Copy link
Contributor Author

psyray commented Sep 30, 2024

Tests are good for me

@psyray psyray linked an issue Sep 30, 2024 that may be closed by this pull request
3 tasks
@AnonymousWP AnonymousWP merged commit 9518579 into release/2.1.0 Sep 30, 2024
5 checks passed
@AnonymousWP AnonymousWP deleted the modal-fix branch September 30, 2024 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(release): 2.1.0 hotfixes
2 participants