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

dev/core#500 Fix user-specific Case filtering on dashboard and searches to exclude cases from inactive relationships #13134

Merged
merged 6 commits into from
Jan 11, 2019

Conversation

agileware-fj
Copy link
Contributor

@agileware-fj agileware-fj commented Nov 20, 2018

Relevant to https://lab.civicrm.org/dev/core/issues/500

Overview

Re-assigning a Case makes the old relationship inactive.

These are not filtered out for "My Cases" in the Case dashboard or search areas.

Before

Cases the current user is no longer but has been previously assigned to are shown when filtering by "My Cases":

  • In the totals on the Case dashboard
  • In the listing on the Case dashboard
  • In Case searches
  • And when searching on cases using Advanced search

After

The areas listed above now filter out cases the user is no longer assigned to.

Technical Details

Adds filters to various SQL queries to ensure that case_relationship.is_active

Comments

Agileware ref CIVICRM-1006

@civibot
Copy link

civibot bot commented Nov 20, 2018

(Standard links)

@civibot civibot bot added the master label Nov 20, 2018
@jusfreeman
Copy link
Contributor

Just adding that this builds further on the work already merged, #12711

Also related #13052

@eileenmcnaughton
Copy link
Contributor

@colemanw can you look at this?

Also - is there a point where we can stop maintaining this stuff in favour of civicase 5.0?

@colemanw
Copy link
Member

@agileware-fj @jusfreeman if there are unit test for these functions, they should be updated to also test for inactive relationships.

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@jusfreeman
Copy link
Contributor

@colemanw there are no existing unit tests for these functions.

@eileenmcnaughton
Copy link
Contributor

@jusfreeman the compromise I would hit there then is to add a unit test for one of them - I don't think it's reasonable to ask you to create the first unit test for all the functions you are touching here but you should progress tests in the area in some way

@jusfreeman
Copy link
Contributor

thanks @eileenmcnaughton, I'll see what we can do :)

Happy Christmas btw too!

@eileenmcnaughton
Copy link
Contributor

Yes - Merry Christmas

@mlutfy mlutfy changed the title Fix user-specific Case filtering on dashboard and searches to exclude cases from inactive relationships dev/core#500 Fix user-specific Case filtering on dashboard and searches to exclude cases from inactive relationships Dec 20, 2018
@jusfreeman
Copy link
Contributor

@eileenmcnaughton a late Christmas present, unit tests!

@colemanw
Copy link
Member

  • General standards
    • (r-explain) Pass
    • (r-user) Pass: UI behavior now better matches user expectations
    • (r-doc) Pass
    • (r-run) Pass: Tested this by performing a case search, then reassigning a case, noting the faulty behavior (reassigned case present in search results still showing me as manager), then applying patch and noting correct behavior.
  • Developer standards

@colemanw colemanw merged commit d7e0c6a into civicrm:master Jan 11, 2019
@eileenmcnaughton
Copy link
Contributor

@jusfreeman & look - it got merged :-)

@jusfreeman
Copy link
Contributor

@eileenmcnaughton that's a great start to 2019! 👍

@michael-chaplin-gmcvo
Copy link

The problem with this is that Case Managers can no longer see their old (closed) cases. When the case is closed, that relationship goes inactive. They cannot view closed cases from either the dashboard (flitered to My Cases)

https://xxxxxxxx/civicrm/case?reset=1

or the closed cases listing (filtered to My Cases)

https://xxxxxxxx/civicrm/case/search?reset=1&force=1&status=2&type=7&case_owner=2

If you view the individual (closed) case, the case manager doesn't show in the Roles section.

@eileenmcnaughton
Copy link
Contributor

@mikantchap without really understanding this issues around this I feel like it has been a 'bouncy' issue with changes to address things but perhaps not overall clarity. I think if you search gitlab & github there are more related PRs & issues (some possibly closed). Perhaps create a new gilab & pull together as much info as possible. @agh & @demeritcowboy have recently been active in analysis in this area & are likely to have good input

@demeritcowboy
Copy link
Contributor

@mikantchap Regarding the last part about the Manage Case screen there are two open PRs that are attempting to address it. See https://lab.civicrm.org/dev/core/issues/542 and #13510 and #13831.

@jusfreeman
Copy link
Contributor

jusfreeman commented May 30, 2019

@mikantchap I would be happy if there was a "My past cases" option to allow users to see cases where the relationship is inactive. This can be achieved via the Case Report now as you can query the relationship status, active or disabled.

@demeritcowboy thanks for those other links, good to reading and relevant.

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.

10 participants