-
Notifications
You must be signed in to change notification settings - Fork 16
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
CPS-427: Civicase alignment with CiviCRM 5.35 #717
Conversation
The delegated hook has been added in civicase.civix.php
8211d2c
to
bc5bd5c
Compare
@reneolivo Great job.
|
@deb1990 thanks a lot. Regarding your comments: 1 - added why the Dashboard was removed. |
58a3bfd
to
50e6a3a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…ase-upgrader COMCL-101: Regenerate civix file and Base upgrader class
CPS-479: Fix Create Activity Form URL
CPS-480: Change button markup
Overview
This PR fixes a number of bugs that are currently present on Civicase in order to properly run it in CiviCRM version 5.35.
Note: This PR also includes:
Bug fixes
Note, it's important to understand that apart from core changes, AngularJS has also been upgraded to version 1.8 and this contributes to some of the issues we see.
CiviCRM Dashboard
The CiviCRM Dashboard was breaking because it has been completely redone in AngularJS. Our current implementation that added an activity tab to the dashboard is no longer valid.
We decided to remove the Dashboard for now and implement it at a later ticket since this requires more planning.
Previous Dashboard
Current Dashboard
Technical details
All files related to the CRM Dashboard we implemented have been removed.
Unknown path error
When navigating to any Civicase page we get a "unknown path" message and no actual case management content.
Before
After
Technical details
This issue is because the CiviCRM Angular modules could not find the Civicase JS files.
There have been many recent changes to the asset manager:
civicrm/civicrm-core#18247 (as an example, not a specific problem). One of these changes have made it so that full paths to a file are not longer found by core.
ie:
To fix this issue we updated the
GlobRecursive
class so it returns files relatively to the extension's path. We updated all relevant angular modules so they use thegetRelativeToExtension
method.Manage cases errors
When visiting the manage cases page, we get AngularJS infinite digest loop errors.
Before
After
Technical details
The problem happens because the AngularJS Strict Contextual Escaping service's methods now return a new reference each time they are called. We were using
getActivityFeedUrl
(which uses$sce.trustAsResourceUrl
under the hood) directly on templates and since this would return a new reference the digest would not stop.To stop this we removed the
$sce.trustAsResourceUrl
fromgetActivityFeedUrl
. We have done a quick smock test and this has not broken any major area. The reason for using$sce.trustAsResourceUrl
was also never documented.Broken Activities tab
The Activities tab is missing the archive list on the right sidebar.
Before
After
Technical details
The problem was that the
Activity.Getmonthswithactivities
endpoint was breaking because the_civicrm_api3_get_BAO(__FUNCTION__)
call was not returning theCRM_Activity_BAO_Activity
BAO class. This is probably related to the refactoring that was done to splitcivicrm_api3_activity_Getmonthswithactivities
into multiple functions to make them more readable, but now_civicrm_api3_get_BAO(__FUNCTION__)
was not able to determine the BAO class we needed using the name of the function. We tried renaming the function but this did not work.Instead of relying on the function name to determine the BAO file we are 100% sure that we need the
CRM_Activity_BAO_Activity
BAO class we pass it directly instead of using_civicrm_api3_get_BAO
. This makes the function more clear.Failing unit tests
Some of the unit tests failed after upgrading to the new Angular version.
$broadcast
events needed to have acallThrough
appended. Here is a good explanation for the fix: https://stackoverflow.com/questions/22721657/typeerror-cannot-read-property-defaultprevented-of-undefined$sce.trustAsResourceUrl
method fromgetActivityFeedUrl
we should have removed the test with the expectation. As a note, there was a PR that added this test, but again, no explanation why$sce.trustAsResourceUrl
was needed since the solution works without it just fine./caseType/:id
route, but this route was never defined so all workflow tests were failing. We created a mock route and updated the karma configuration file so it include mocks and mock modules before unit tests run.$broadcast
events were triggered at all. Now that$broadcast
events are triggering it started failing so we defined the specific$broadcast
event that we are not expecting.$qProvider.errorOnUnhandledRejections(false);
on the spec file, but we need to confirm if we are properly handling rejections on the implementation.CRM_Civicase_APIHelpers_CaseDetails
class was calling an internal private method statically from a static function, but the private method was not static. We changed the method so it's static.