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

crmMailing - Only load Angular settings if they're needed #18749

Merged
merged 2 commits into from
Oct 13, 2020

Conversation

totten
Copy link
Member

@totten totten commented Oct 13, 2020

Overview

This removes extraneous data from Angular-based screens which do not have a CiviMail UI.

This patch was written as an exercise in reviewing #18731.

Before

  • If you navigate to civicrm/a/#/mailing/1 and open a browser console, you can see that CRM.crmMailing is populated. This is good because we're on the mailing page.
  • If you navigate to civicrm/admin/afform and open a browser console, you again see that CRM.crmMailing is populated. This is extraneous because crmMailing is never activated on this screen.

After

  • (Same) If you navigate to civicrm/a/#/mailing/1 and open a browser console, you can see that CRM.crmMailing is populated. This is good because we're on the mailing page.
  • (Changed) If you navigate to civicrm/admin/afform and open a browser console, you can see that CRM.crmMailing is not populated.

Comments

In reading the diff, it looks slightly noisier than it should. What's actually happened is that I used a refactoring (Extract Method) to move several lines from getAngularModules() to a separate function createAngularSettings(). Due to the dependence on the other PR and the quirks in diff format, it makes it appear as if some unrelated functions are removed+readded. 🤷‍♂️

@civibot
Copy link

civibot bot commented Oct 13, 2020

(Standard links)

@colemanw
Copy link
Member

This is good. And I have a followup PR to take care of declaring permissions from Angular modules.

@colemanw colemanw merged commit 9890d3f into civicrm:master Oct 13, 2020
@totten totten deleted the master-crmMailing-factory branch October 13, 2020 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants