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

Allow hide theme for email and page constructors Mautic 5 #13539

Closed
wants to merge 33 commits into from

Conversation

Syrgak-Alan
Copy link
Contributor

@Syrgak-Alan Syrgak-Alan commented Mar 11, 2024

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

Description:

Allow Themes to be hidden in the theme-Selection when creating an email or page

Idea:

  • Have a toggle in the theme’s config.json to hide the theme in the GUI
  • So the Mautic GUI should not offer the hidden themes in https:///s/emails/new

Steps to test this PR:

  • Upload the theme
  • Go to emails/pages
  • Create new email/page
  • Check if theme is visible in the overview
  • Go to CLI and manually change the toggle in the config.json to hide the theme(cd themes/<name_of_theme> && nano config.json after add "hide" and set to it true value)
  • Go to emails/pages
  • Create new email/page or edit already existing
  • Check if theme is now hidden

Manually add

image

grafik

Copy link
Member

@kuzmany kuzmany left a comment

Choose a reason for hiding this comment

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

Thanks! I really like this feature. For me, there's no need for a toggle – this simple trick works perfectly. I would suggest using the parameter hide = 1 or true when we need it, instead of isVisibleInGUI. It's much more common.

I also recommend adding icons with titles to the theme list to clearly indicate which themes are hidden. Similarly, these themes should be hidden, for instance, in the theme selector in forms.

fa-ban
image

or fa-eye-slash

image

Copy link
Contributor

@oltmanns-leuchtfeuer oltmanns-leuchtfeuer left a comment

Choose a reason for hiding this comment

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

Nice little feature - works as described. Also, the little Icon is nice and suited very well.

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 61.04%. Comparing base (55ee880) to head (06c3bd8).
Report is 1 commits behind head on 5.x.

❗ Current head 06c3bd8 differs from pull request most recent head 60e30d1. Consider uploading reports for the commit 60e30d1 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                5.x   #13539      +/-   ##
============================================
- Coverage     61.30%   61.04%   -0.27%     
+ Complexity    34002    33941      -61     
============================================
  Files          2238     2237       -1     
  Lines        101646   101457     -189     
============================================
- Hits          62312    61932     -380     
- Misses        39334    39525     +191     
Files Coverage Δ
app/bundles/CoreBundle/Helper/ThemeHelper.php 70.47% <ø> (-0.48%) ⬇️
app/bundles/CoreBundle/Form/Type/ThemeListType.php 91.66% <75.00%> (-8.34%) ⬇️

... and 62 files with indirect coverage changes

@Syrgak-Alan
Copy link
Contributor Author

Syrgak-Alan commented Mar 21, 2024

@kuzmany issues are resolved and your change requests are done, could you please check it

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.

Worked as described when tested 👍

@PatrickJenkner PatrickJenkner added user-interface Anything related to appearance, layout, and interactivity code-review-needed PR's that require a code review before merging themes Anything related to themes user-testing-passed PRs which have been successfully tested by the required number of people. labels Apr 5, 2024
@RCheesley
Copy link
Sponsor Member

Just adding the UX team for review - please make a PR for the documentation which explains what the icon means and how/why to set it.

@RCheesley RCheesley added the needs-documentation PR's that need documentation before they can be merged label Apr 19, 2024
Copy link
Contributor

@andersonjeccel andersonjeccel left a comment

Choose a reason for hiding this comment

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

Hey, thanks for this improvement!

I’d like to point something to make this enhancement even better:

We could have an option, inside the dropdown, to allow administrators or roles with theme management permission being able to set a theme hidden or not…

Bc the way this functionality is being implemented right now, only technical people will benefit from it

Is there a possibility to add this link for an automatic toggle?

I’d also suggest to use the icon ri-eye-off-line (new icon pack)

Copy link
Contributor

@shinde-rahul shinde-rahul left a comment

Choose a reason for hiding this comment

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

I agree with @andersonjeccel; having an action or toggle button to hide will make more sense than updating the info file.

@shinde-rahul
Copy link
Contributor

Currently, we don't have an entity to hold the theme meta information, just like the plugins table.

@kuzmany
Copy link
Member

kuzmany commented May 6, 2024

Currently, we don't have an entity to hold the theme meta information, just like the plugins table.

@shinde-rahul I recommend not using a toggle in this scenario. Even though it's possible to add one, it would require a significant amount of code and involve saving changes to the config.json file for each theme, among other things.

@escopecz what do you think?

@shinde-rahul
Copy link
Contributor

@kuzmany, I am not suggesting the theme files update. It should mimic how the Campaign/Email/Plugins Published (Enabled) toggle button uses the theme as an entity to hold the data.
The approach will be,

  • Add a new entity named 'Themes` with properties like name, author, features, supportedBuilders, status, dates
  • Then populated the db on the first install and then with the command to reload the themes like plugins
  • Maintain the status for each of the themes we have

That way, administrators can control what themes to list and what not for the editors.

This is good to discuss with others, too, so tagging @RCheesley @escopecz @oltmanns-leuchtfeuer

@kuzmany
Copy link
Member

kuzmany commented May 6, 2024

@shinde-rahul I understand, but that's a lot of work (test coverage), and I bet the original author cannot spend on it, @Syrgak-Alan can it?

Then we should discuss about real options (merge, or not merge it)

@escopecz
Copy link
Sponsor Member

escopecz commented May 6, 2024

Thanks for tagging me. It reminded me a PR that we have in Campaign Studio for the same feature. I quickly pushed it here: #13723

Please review which is better.

@kuzmany
Copy link
Member

kuzmany commented May 8, 2024

Close favor to #13723

@kuzmany kuzmany closed this May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-review-needed PR's that require a code review before merging duplicate needs-documentation PR's that need documentation before they can be merged themes Anything related to themes 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
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants