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

Bug fix for published labels #13747

Merged
merged 4 commits into from
May 17, 2024
Merged

Conversation

andersonjeccel
Copy link
Contributor

@andersonjeccel andersonjeccel commented May 14, 2024

Q A
Bug fix? (use the a.b branch) [X]
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/mautic-documentation#...
Related developer documentation PR URL mautic/developer-documentation#...
Issue(s) addressed Fixes #...

Description:

This PR fixes the labels statuses. Opted to remove the text label and use only colors since now we have active/available statuses and Mautic code not always differentiate them

image

image

Steps to test this PR:

  1. Assets > Create new and see
  2. Save & Close and see the other

image

image

@andersonjeccel andersonjeccel added T1 Low difficulty to fix (issue) or test (PR) bug Issues or PR's relating to bugs translations Anything related to translations essential This must be done to close the milestone labels May 14, 2024
@andersonjeccel andersonjeccel added this to the 5.1.0 milestone May 14, 2024
Copy link

codecov bot commented May 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.62%. Comparing base (4883fa0) to head (921ed9a).
Report is 1 commits behind head on 5.x.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##                5.x   #13747   +/-   ##
=========================================
  Coverage     61.62%   61.62%           
  Complexity    34145    34145           
=========================================
  Files          2245     2245           
  Lines        102077   102077           
=========================================
+ Hits          62909    62910    +1     
+ Misses        39168    39167    -1     
Files Coverage Δ
app/bundles/AssetBundle/Form/Type/AssetType.php 100.00% <ø> (ø)
.../bundles/CategoryBundle/Form/Type/CategoryType.php 100.00% <ø> (ø)
.../CoreBundle/Form/Type/AbstractFormStandardType.php 72.41% <100.00%> (ø)
...amicContentBundle/Form/Type/DynamicContentType.php 95.78% <ø> (ø)
app/bundles/EmailBundle/Form/Type/EmailType.php 97.36% <ø> (ø)
app/bundles/FormBundle/Form/Type/FormType.php 100.00% <ø> (ø)
app/bundles/LeadBundle/Form/Type/FieldType.php 80.17% <ø> (ø)
app/bundles/PageBundle/Form/Type/PageType.php 92.10% <ø> (ø)
app/bundles/PointBundle/Form/Type/GroupType.php 93.75% <ø> (ø)
app/bundles/ReportBundle/Form/Type/ReportType.php 97.89% <ø> (ø)
... and 1 more

... and 1 file with indirect coverage changes

escopecz
escopecz previously approved these changes May 14, 2024
Copy link
Sponsor 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.

Fine from the code perspective 👍

{% set status = entity.getPublishStatus() %}
{% set labelText = ('mautic.core.form.' ~ (status == 'published' ? 'active' : 'inactive'))|trans %}
<span title="{{ labelText }}" aria-label="{{ labelText }}" class="pa-10 bg-{{ labelColor }} mt-3 label label-{{ labelColor }}"> </span>
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

I'd prefer to show the text so people would know what this red square means, but a title is good enough I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem is that some entities are generic
So it’ll display “Active”, for example, for something you create to be available

this inconsistency could cause confusion, but the title is there to indicate Active or Inactive if someone gets in doubt about what it means

Not a perfect solution, but I’m technically unable to solve the entities differentiation

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

The label is already in the title and that's important for accessibility. So if it's good for visually impaired users then it should be OK for every one else, right?

Another idea: How about to use some icons here? Something like play/pause icons.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here we go with check/close
They're less specific to fit both campaigns and categories, for example

What do you think?

image

image

@escopecz escopecz added the code-review-passed PRs which have passed code review label May 14, 2024
@andersonjeccel andersonjeccel changed the title UI bug fix for published labels Bug fix for published labels May 16, 2024
Copy link

@PatrickJenkner PatrickJenkner left a comment

Choose a reason for hiding this comment

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

Works as described and looks good to me 👍

@PatrickJenkner PatrickJenkner added the pending-test-confirmation PR's that require one test before they can be merged label May 17, 2024
@escopecz escopecz self-requested a review May 17, 2024 15:03
Copy link
Sponsor 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.

Looks good to me 👍 Thanks!
Screenshot 2024-05-17 at 17 05 18

@escopecz escopecz removed the pending-test-confirmation PR's that require one test before they can be merged label May 17, 2024
@escopecz escopecz merged commit ba1f2c5 into mautic:5.x May 17, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs code-review-passed PRs which have passed code review essential This must be done to close the milestone T1 Low difficulty to fix (issue) or test (PR) translations Anything related to translations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants