Skip to content

Commit

Permalink
Merge pull request #13032 from SORMAS-Foundation/feature-11406_show_o…
Browse files Browse the repository at this point in the history
…nly_active_entities_in_Person_info_cards

#11406 - Show only active entities in Person Info Cards
  • Loading branch information
leventegal-she authored Mar 6, 2024
2 parents faa186f + 11a4ef1 commit 93d6439
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1473,15 +1473,15 @@ public Predicate createUserFilter(CaseQueryContext caseQueryContext, CaseUserFil
default:
}

filter = CriteriaBuilderHelper.or(cb, filter, specialCaseAccessService.createSpecialCaseAccessFilter(cb, joins.getSpecialCaseAccesses()));
filter =
CriteriaBuilderHelper.or(cb, filter, specialCaseAccessService.createSpecialCaseAccessFilter(cb, joins.getSpecialCaseAccesses()));
}

// get all cases based on the user's contact association
if (userFilterCriteria == null
|| (!userFilterCriteria.isExcludeCasesFromContacts()
&& Boolean.TRUE.equals(userFilterCriteria.getIncludeCasesFromOtherJurisdictions()))) {
ContactQueryContext contactQueryContext =
new ContactQueryContext(cb, cq, new ContactJoins(joins.getContacts()));
ContactQueryContext contactQueryContext = new ContactQueryContext(cb, cq, new ContactJoins(joins.getContacts()));
filter = CriteriaBuilderHelper.or(cb, filter, contactService.createUserFilterWithoutCase(contactQueryContext));
}

Expand Down Expand Up @@ -1862,7 +1862,7 @@ public List<CaseListEntryDto> getEntriesList(Long personId, Integer first, Integ
caze.get(Case.CHANGE_DATE));

Predicate filter = cb.equal(caze.get(Case.PERSON_ID), personId);
filter = CriteriaBuilderHelper.and(cb, filter, cb.isFalse(caze.get(Case.DELETED)));
filter = CriteriaBuilderHelper.and(cb, filter, cb.isFalse(caze.get(Case.DELETED)), cb.isFalse(caze.get(Case.ARCHIVED)));
cq.where(filter);

cq.orderBy(cb.desc(caze.get(Case.CHANGE_DATE)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1964,7 +1964,7 @@ public List<ContactListEntryDto> getEntriesList(Long personId, Integer first, In
contact.get(Contact.CHANGE_DATE));

Predicate filter = cb.equal(contact.get(Contact.PERSON_ID), personId);
filter = CriteriaBuilderHelper.and(cb, filter, cb.isFalse(contact.get(Contact.DELETED)));
filter = CriteriaBuilderHelper.and(cb, filter, cb.isFalse(contact.get(Contact.DELETED)), cb.isFalse(contact.get(Contact.ARCHIVED)));
cq.where(filter);

cq.orderBy(cb.desc(contact.get(Contact.CHANGE_DATE)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,11 @@ public List<EventParticipantListEntryDto> getListEntries(EventParticipantCriteri
event.get(Event.END_DATE),
JurisdictionHelper.booleanSelector(cb, service.inJurisdictionOrOwned(queryContext)));

Predicate filter =
CriteriaBuilderHelper.and(cb, service.buildCriteriaFilter(eventParticipantCriteria, queryContext), cb.isFalse(event.get(Event.DELETED)));
Predicate filter = CriteriaBuilderHelper.and(
cb,
service.buildCriteriaFilter(eventParticipantCriteria, queryContext),
cb.isFalse(event.get(Event.DELETED)),
cb.isFalse(event.get(Event.ARCHIVED)));

cq.where(filter);
cq.orderBy(cb.desc(eventParticipant.get(EventParticipant.CREATION_DATE)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ public void navigateToView(String viewName, String contactUuid, boolean openTab)

public void navigateTo(ContactCriteria contactCriteria) {
ViewModelProviders.of(ContactsView.class).remove(ContactCriteria.class);
ViewModelProviders.of(ContactsView.class).get(ContactCriteria.class, contactCriteria);

String navigationState = AbstractView.buildNavigationState(ContactsView.VIEW_NAME, contactCriteria);
SormasUI.get().getNavigator().navigateTo(navigationState);
Expand Down

0 comments on commit 93d6439

Please sign in to comment.