mirror of
				https://github.com/open-metadata/OpenMetadata.git
				synced 2025-10-31 02:29:03 +00:00 
			
		
		
		
	This commit is contained in:
		
							parent
							
								
									50034400ee
								
							
						
					
					
						commit
						cd251ea387
					
				| @ -977,7 +977,7 @@ public interface CollectionDAO { | |||||||
|     @ConnectionAwareSqlQuery( |     @ConnectionAwareSqlQuery( | ||||||
|         value = |         value = | ||||||
|             "SELECT json FROM thread_entity <condition> AND " |             "SELECT json FROM thread_entity <condition> AND " | ||||||
|                 + "JSON_OVERLAPS(taskAssignees, :userTeamJsonMysql) " |                 + "JSON_OVERLAPS(json_extract(taskAssignees, '$[*].id'), :userTeamJsonMysql) " | ||||||
|                 + "ORDER BY createdAt DESC " |                 + "ORDER BY createdAt DESC " | ||||||
|                 + "LIMIT :limit", |                 + "LIMIT :limit", | ||||||
|         connectionType = MYSQL) |         connectionType = MYSQL) | ||||||
| @ -995,7 +995,7 @@ public interface CollectionDAO { | |||||||
|     @ConnectionAwareSqlQuery( |     @ConnectionAwareSqlQuery( | ||||||
|         value = |         value = | ||||||
|             "SELECT count(id) FROM thread_entity <condition> AND " |             "SELECT count(id) FROM thread_entity <condition> AND " | ||||||
|                 + "JSON_OVERLAPS(taskAssignees, :userTeamJsonMysql) ", |                 + "JSON_OVERLAPS(json_extract(taskAssignees, '$[*].id'), :userTeamJsonMysql) ", | ||||||
|         connectionType = MYSQL) |         connectionType = MYSQL) | ||||||
|     int listCountTasksAssignedTo( |     int listCountTasksAssignedTo( | ||||||
|         @BindList("userTeamJsonPostgres") List<String> userTeamJsonPostgres, |         @BindList("userTeamJsonPostgres") List<String> userTeamJsonPostgres, | ||||||
| @ -1012,7 +1012,7 @@ public interface CollectionDAO { | |||||||
|     @ConnectionAwareSqlQuery( |     @ConnectionAwareSqlQuery( | ||||||
|         value = |         value = | ||||||
|             "SELECT json FROM thread_entity <condition> " |             "SELECT json FROM thread_entity <condition> " | ||||||
|                 + "AND (JSON_OVERLAPS(taskAssignees, :userTeamJsonMysql) OR createdBy = :username) " |                 + "AND (JSON_OVERLAPS(JSON_EXTRACT(taskAssignees, '$[*].id'), :userTeamJsonMysql) OR createdBy = :username) " | ||||||
|                 + "ORDER BY createdAt DESC " |                 + "ORDER BY createdAt DESC " | ||||||
|                 + "LIMIT :limit", |                 + "LIMIT :limit", | ||||||
|         connectionType = MYSQL) |         connectionType = MYSQL) | ||||||
| @ -1031,7 +1031,7 @@ public interface CollectionDAO { | |||||||
|     @ConnectionAwareSqlQuery( |     @ConnectionAwareSqlQuery( | ||||||
|         value = |         value = | ||||||
|             "SELECT count(id) FROM thread_entity <condition> " |             "SELECT count(id) FROM thread_entity <condition> " | ||||||
|                 + "AND (JSON_OVERLAPS(taskAssignees, :userTeamJsonMysql) OR createdBy = :username) ", |                 + "AND (JSON_OVERLAPS(JSON_EXTRACT(taskAssignees, '$[*].id'), :userTeamJsonMysql) OR createdBy = :username) ", | ||||||
|         connectionType = MYSQL) |         connectionType = MYSQL) | ||||||
|     int listCountTasksOfUser( |     int listCountTasksOfUser( | ||||||
|         @BindList("userTeamJsonPostgres") List<String> userTeamJsonPostgres, |         @BindList("userTeamJsonPostgres") List<String> userTeamJsonPostgres, | ||||||
| @ -1210,7 +1210,7 @@ public interface CollectionDAO { | |||||||
|                 + "id in (SELECT toId FROM entity_relationship WHERE (fromEntity='user' AND fromId= :userId AND toEntity='THREAD' AND relation IN (1,2))) " |                 + "id in (SELECT toId FROM entity_relationship WHERE (fromEntity='user' AND fromId= :userId AND toEntity='THREAD' AND relation IN (1,2))) " | ||||||
|                 + " OR id in (SELECT toId FROM entity_relationship WHERE ((fromEntity='user' AND fromId= :userId) OR " |                 + " OR id in (SELECT toId FROM entity_relationship WHERE ((fromEntity='user' AND fromId= :userId) OR " | ||||||
|                 + "(fromEntity='team' AND fromId IN (<teamIds>))) AND relation=11)) OR " |                 + "(fromEntity='team' AND fromId IN (<teamIds>))) AND relation=11)) OR " | ||||||
|                 + "(JSON_OVERLAPS(taskAssignees, :userTeamJsonMysql) OR createdBy = :username)" |                 + "(JSON_OVERLAPS(JSON_EXTRACT(taskAssignees, '$[*].id'), :userTeamJsonMysql) OR createdBy = :username)" | ||||||
|                 + " GROUP BY te.type, te.taskStatus", |                 + " GROUP BY te.type, te.taskStatus", | ||||||
|         connectionType = MYSQL) |         connectionType = MYSQL) | ||||||
|     @RegisterRowMapper(OwnerCountFieldMapper.class) |     @RegisterRowMapper(OwnerCountFieldMapper.class) | ||||||
|  | |||||||
| @ -965,12 +965,9 @@ public class FeedRepository { | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   private String getUserTeamJsonMysql(UUID userId, List<String> teamIds) { |   private String getUserTeamJsonMysql(UUID userId, List<String> teamIds) { | ||||||
|     // Build a string like this for the tasks filter |  | ||||||
|     // [{"id":"9e78b924-b75c-4141-9845-1b3eb81fdc1b","type":"team"},{"id":"fe21e1ba-ce00-49fa-8b62-3c9a6669a11b","type":"user"}] |  | ||||||
|     List<String> result = new ArrayList<>(); |     List<String> result = new ArrayList<>(); | ||||||
|     JSONObject json = getUserTeamJson(userId, "user"); |     result.add("\"" + userId.toString() + "\""); | ||||||
|     result.add(json.toString()); |     teamIds.forEach(id -> result.add("\"" + id + "\"")); | ||||||
|     teamIds.forEach(id -> result.add(getUserTeamJson(id, "team").toString())); |  | ||||||
|     return result.toString(); |     return result.toString(); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Sriharsha Chintalapani
						Sriharsha Chintalapani