Skip to content

Commit

Permalink
Get feed and count data of soft deleted user (#17135)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonika-shah authored Jul 23, 2024
1 parent b125ba7 commit 8f5ca55
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ public List<ThreadCount> getThreadsCount(String link) {
if (reference.getType().equals(USER) || reference.getType().equals(Entity.TEAM)) {
if (reference.getType().equals(USER)) {
UUID userId = reference.getId();
User user = Entity.getEntity(USER, userId, TEAMS_FIELD, NON_DELETED);
User user = Entity.getEntity(USER, userId, TEAMS_FIELD, ALL);
List<String> teamIds = getTeamIds(user);
List<String> teamNames = getTeamNames(user);
String userTeamJsonMysql = getUserTeamJsonMysql(userId, teamIds);
Expand Down Expand Up @@ -688,8 +688,7 @@ public ResultList<Thread> list(
total = filteredThreads.totalCount();
} else {
// Only data assets are added as about
User user =
userId != null ? Entity.getEntity(USER, userId, TEAMS_FIELD, NON_DELETED) : null;
User user = userId != null ? Entity.getEntity(USER, userId, TEAMS_FIELD, ALL) : null;
List<String> teamNameHash = getTeamNames(user);
String userName = user == null ? null : user.getFullyQualifiedName();
List<String> jsons =
Expand Down Expand Up @@ -1150,7 +1149,7 @@ private Thread populateAssignees(Thread thread) {

/** Return the tasks created by or assigned to the user. */
private FilteredThreads getTasksOfUser(FeedFilter filter, UUID userId, int limit) {
String username = Entity.getEntityReferenceById(Entity.USER, userId, NON_DELETED).getName();
String username = Entity.getEntityReferenceById(Entity.USER, userId, ALL).getName();
List<String> teamIds = getTeamIds(userId);
List<String> userTeamJsonPostgres = getUserTeamJsonPostgres(userId, teamIds);
String userTeamJsonMysql = getUserTeamJsonMysql(userId, teamIds);
Expand All @@ -1168,7 +1167,7 @@ private FilteredThreads getTasksOfUser(FeedFilter filter, UUID userId, int limit

/** Return the tasks created by the user. */
private FilteredThreads getTasksAssignedBy(FeedFilter filter, UUID userId, int limit) {
String username = Entity.getEntityReferenceById(Entity.USER, userId, NON_DELETED).getName();
String username = Entity.getEntityReferenceById(Entity.USER, userId, ALL).getName();
List<String> jsons = dao.feedDAO().listTasksAssigned(username, limit, filter.getCondition());
List<Thread> threads = JsonUtils.readObjects(jsons, Thread.class);
int totalCount = dao.feedDAO().listCountTasksAssignedBy(username, filter.getCondition(false));
Expand All @@ -1194,7 +1193,7 @@ private FilteredThreads getThreadsByOwner(FeedFilter filter, UUID userId, int li
private FilteredThreads getThreadsForGlossary(
FeedFilter filter, UUID userId, int limit, EntityLink entityLink) {

User user = userId != null ? Entity.getEntity(USER, userId, TEAMS_FIELD, NON_DELETED) : null;
User user = userId != null ? Entity.getEntity(USER, userId, TEAMS_FIELD, ALL) : null;
List<String> teamNameHash = getTeamNames(user);
String userName = user == null ? null : user.getFullyQualifiedName();
int filterRelation = -1;
Expand Down Expand Up @@ -1227,7 +1226,7 @@ private FilteredThreads getThreadsForGlossary(
* with @mention.
*/
private FilteredThreads getThreadsByMentions(FeedFilter filter, UUID userId, int limit) {
User user = Entity.getEntity(Entity.USER, userId, TEAMS_FIELD, NON_DELETED);
User user = Entity.getEntity(Entity.USER, userId, TEAMS_FIELD, ALL);
String userNameHash = getUserNameHash(user);
// Return the threads where the user or team was mentioned
List<String> teamNamesHash = getTeamNames(user);
Expand Down Expand Up @@ -1256,7 +1255,7 @@ private FilteredThreads getThreadsByMentions(FeedFilter filter, UUID userId, int
private List<String> getTeamIds(UUID userId) {
List<String> teamIds = null;
if (userId != null) {
User user = Entity.getEntity(Entity.USER, userId, TEAMS_FIELD, NON_DELETED);
User user = Entity.getEntity(Entity.USER, userId, TEAMS_FIELD, ALL);
teamIds = getTeamIds(user);
}
return nullOrEmpty(teamIds) ? List.of(StringUtils.EMPTY) : teamIds;
Expand Down

0 comments on commit 8f5ca55

Please sign in to comment.