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

Divi compatibility: show admin notice to clear the used CSS when a template is updated #6074

Merged
merged 33 commits into from Aug 11, 2023

Conversation

engahmeds3ed
Copy link
Contributor

Description

Show admin notice to clear the used CSS when a template is updated only when this template is used in any (page, post, tag, ...etc.)

Also added a new filter `` to enable/disable this functionality.

Fixes #5837

Type of change

  • Enhancement (non-breaking change which improves an existing functionality)

Is the solution different from the one proposed during the grooming?

Yes it's changed a bit, you can check the discussion in the issue itself for more details.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Tested on mega site

Checklist:

Please delete the options that are not relevant.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@engahmeds3ed engahmeds3ed self-assigned this Jul 31, 2023
@engahmeds3ed engahmeds3ed marked this pull request as ready for review July 31, 2023 13:43
Copy link
Contributor

@Tabrisrp Tabrisrp left a comment

Choose a reason for hiding this comment

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

No unit/integration tests?

inc/ThirdParty/Themes/Divi.php Outdated Show resolved Hide resolved
inc/ThirdParty/Themes/Divi.php Show resolved Hide resolved
@engahmeds3ed
Copy link
Contributor Author

I forgot the tests, we have two public methods, going to add the tests for them now.

@Mai-Saad Mai-Saad self-requested a review August 2, 2023 05:08
@Mai-Saad
Copy link

Mai-Saad commented Aug 4, 2023

@engahmeds3ed Thanks for the PR.
Please notice the exploratory test notes below.
1- The transient rocket_divi_notice shall be deleted when deleting WPR
2- When we save on the layout level still not displaying a notice. (only displayed when we edit inside the header itself)

@engahmeds3ed
Copy link
Contributor Author

@Mai-Saad

All done now

@vmanthos
Copy link
Contributor

vmanthos commented Aug 8, 2023

@engahmeds3ed Thank you for the PR.

There are a couple of scenarios that are failing.

With Remove Unused CSS enabled and used CSS existing in the database:

  1. Disable Remove Unused CSS.
  2. Edit the global header in Divi's Theme Builder for any existing template.
  3. Enable Remove Unused CSS -> the notice is displayed. ✔️
  4. Disable Remove Unused CSS -> the notice isn't displayed. ✔️
  5. Enable Remove Unused CSS -> the notice is NOT displayed. ❌

For the second scenario, with Remove Unused CSS enabled and used CSS existing in the database:

  1. Disable Remove Unused CSS.
  2. Delete a template using the Divi Theme Builder -> the notice is not displayed. ✔️
  3. Enable Remove Unused CSS -> the notice is NOT displayed. ❌

Can you please look into these?

@MathieuLamiot
Copy link
Contributor

MathieuLamiot commented Aug 9, 2023

As discussed here, I created a dedicated follow-up issue #6095. I move back this PR to Ready for QA @vmanthos

@vmanthos vmanthos self-requested a review August 9, 2023 12:39
Copy link
Contributor

@vmanthos vmanthos left a comment

Choose a reason for hiding this comment

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

Working as expected. 👍

TestRail report: testrail-report-514.pdf

@vmanthos vmanthos added this pull request to the merge queue Aug 11, 2023
Merged via the queue into develop with commit ce175a3 Aug 11, 2023
8 checks passed
@vmanthos vmanthos deleted the enhancement/5837-divi_save_templates_clear_rucss branch August 11, 2023 05:49
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.

Clear Used CSS when Divi saves template item
5 participants