Skip to content

Conversation

SaraCRM
Copy link
Contributor

@SaraCRM SaraCRM commented Mar 17, 2025

Q A
Bug fix? (use the a.b branch) ✔️
New feature/enhancement? (use the a.x branch)
Deprecations?
BC breaks? (use the c.x branch)
Automated tests included? ✔️
Related user documentation PR URL mautic/user-documentation#...
Related developer documentation PR URL mautic/developer-documentation-new#...
Issue(s) addressed Fixes #12795

Description

The "Manage Groups" menu item under "Points" didn’t display the expected active state. The visual indicator (dot) before the item was missing, making it unclear which page was selected.

The issue occurred because CSS misinterpreted the group’s ID (mautic_point.group_index), treating the dot as a class separator instead of part of the ID. This was fixed by applying CSS.escape() to ensure proper handling. Tests were also added to verify the fix and prevent regressions.

Before After
Before Image After Image

📋 Steps to test this PR:

  1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs here)
  2. Click on the “Points” side menu
  3. Click on “Manage Groups”
  4. Check the visual indicator (dot)

The issue occurred because CSS misinterpreted the group’s ID
(mautic_point.group_index), treating the dot as a class separator
instead of part of the ID. This was fixed by applying CSS.escape()
to ensure proper handling. Tests were also added to verify the fix
and prevent regressions.
@RCheesley RCheesley added the ready-to-test PR's that are ready to test label Mar 24, 2025
@RCheesley RCheesley moved this to 🦸🏻 Needs 2 tests in Open Source Fridays Mar 24, 2025
@RCheesley RCheesley added user-interface Anything related to appearance, layout, and interactivity points-scoring Anything related to points T1 Low difficulty to fix (issue) or test (PR) labels Mar 24, 2025
@RCheesley RCheesley linked an issue Mar 24, 2025 that may be closed by this pull request
1 task
@RCheesley RCheesley added this to the 5.2.4 milestone Mar 24, 2025
@RCheesley RCheesley requested a review from nox1134 March 24, 2025 13:05
@RCheesley
Copy link
Member

@nox1134 would you take a 👀 at the E2E test here?

@RCheesley RCheesley modified the milestones: 5.2.4, 5.2.5 Mar 24, 2025
@Hugo-Prossaird
Copy link
Contributor

We tested it internally and it works as expected :)

Capture d’écran 2025-03-24 à 14 12 50

@escopecz escopecz requested a review from Copilot March 24, 2025 13:17
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the active state indicator for the "Manage Groups" menu under "Points" by escaping the CSS selector string to prevent misinterpretation of the dot.

  • Updates the JS file to apply CSS.escape() to the link identifier.
  • Ensures the visual indicator (dot) before the menu item displays as expected.
Files not reviewed (3)
  • tests/_support/Page/Acceptance/MenuPage.php: Language not supported
  • tests/_support/Step/Acceptance/MenuStep.php: Language not supported
  • tests/acceptance/MenuNavigationCest.php: Language not supported
Comments suppressed due to low confidence (1)

app/bundles/CoreBundle/Assets/js/1a.content.js:926

  • Ensure that CSS.escape is supported in all target browsers or that a polyfill is provided to avoid potential runtime errors in unsupported environments.
link = "#" + CSS.escape(link);

@npracht npracht added pending-test-confirmation PR's that require one test before they can be merged user-testing-passed PRs which have been successfully tested by the required number of people. and removed ready-to-test PR's that are ready to test labels Mar 24, 2025
@npracht npracht moved this from 🦸🏻 Needs 2 tests to ⏳︎ Needs 1 more test in Open Source Fridays Mar 24, 2025
Copy link
Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

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

The code changes look great! The usage of CSS.escape() is used as they do in the docs:
Screenshot 2025-03-24 at 14 18 08
at https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape_static

I approve the code changes 👍

@escopecz escopecz added code-review-passed PRs which have passed code review and removed pending-test-confirmation PR's that require one test before they can be merged labels Mar 24, 2025
@escopecz escopecz modified the milestones: 5.2.5, 5.2.4 Mar 24, 2025
@escopecz escopecz merged commit 648a8eb into mautic:5.2 Mar 24, 2025
25 checks passed
@github-project-automation github-project-automation bot moved this from ⏳︎ Needs 1 more test to 🥳 Done in Open Source Fridays Mar 24, 2025
@escopecz
Copy link
Member

Regarding Copilot's suggesting to check the supported browsers we are good as well
Screenshot 2025-03-24 at 14 20 33

@matbcvo
Copy link
Contributor

matbcvo commented Mar 24, 2025

@RCheesley @escopecz a first-time contributor's PR - needs to be added via @all-contributors

@RCheesley
Copy link
Member

@all-contributors please add @SaraCRM for code tests

Copy link
Contributor

@RCheesley

I've put up a pull request to add @SaraCRM! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-review-passed PRs which have passed code review points-scoring Anything related to points T1 Low difficulty to fix (issue) or test (PR) user-interface Anything related to appearance, layout, and interactivity user-testing-passed PRs which have been successfully tested by the required number of people.
Projects
Status: 🥳 Done
Development

Successfully merging this pull request may close these issues.

Missing class on Points > Manage Group menu
6 participants