compucorp / uk.co.compucorp.civicase

CiviCase Extension
Other
8 stars 16 forks source link

Fix deprecated 'settings' in `.ang.php` files #985

Open colemanw opened 11 months ago

colemanw commented 11 months ago

Since 2020, 'settings' are deprecated in favor of 'settingsFactory' and will soon stop being supported altogether.

This is a straightforward fix. For each .ang.php file, simply by move the settings array into a function.

colemanw commented 11 months ago

Both of those examples are a little noisy with unrelated changes but the first two files from example 1 is the relevant part and shows how simple this refactor is (it's really just moving an array from one place to another): image

agileware-fj commented 7 months ago

@colemanw one of the things the angular module does at the time of building the settings is to load affix.js from the shoreditch theme extension, which isn't an angular module. I tried to migrate this into the settingsFactory callback, but it seems resources added during this callback are not. It's also probably something that should be resolved at the time the module is cached.

Do you have any insights into including javascript from another extension into the js key for the angular module declaration?

colemanw commented 7 months ago

@agileware-fj I believe it is possible to include javascript files outside of the angular directory. This one does it:

https://github.com/civicrm/civicrm-core/blob/da9f6ba54f6f940cec53db9bc7fce4aba8bb6353/ang/angularFileUpload.ang.php#L2-L6