Fix #7619: Teams hierarchy is not working as expected in Signup and Add User pages (#7621)

This commit is contained in:
Sriharsha Chintalapani 2022-09-20 22:53:03 -07:00 committed by GitHub
parent 254b0b64d1
commit 0dd177ac2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 85 additions and 2 deletions

View File

@ -235,6 +235,7 @@ class TeamESDocument(BaseModel):
fullyQualifiedName: str
displayName: str
description: str
teamType: str
version: float
updatedAt: Optional[int]
updatedBy: Optional[str]

View File

@ -684,6 +684,7 @@ class ElasticsearchSink(Sink[Entity]):
name=team.name.__root__,
displayName=team.displayName if team.displayName else team.name.__root__,
description=team.description.__root__ if team.description else "",
teamType=team.teamType.name,
fullyQualifiedName=team.fullyQualifiedName.__root__,
version=team.version.__root__,
updatedAt=team.updatedAt.__root__,
@ -693,6 +694,7 @@ class ElasticsearchSink(Sink[Entity]):
suggest=suggest,
users=team.users if team.users else [],
defaultRoles=team.defaultRoles if team.defaultRoles else [],
parents=team.parents if team.parents else [],
isJoinable=team.isJoinable,
)

View File

@ -29,6 +29,9 @@ TEAM_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
}
}
},
"teamType": {
"type": "text"
},
"description": {
"type": "text"
},
@ -82,6 +85,43 @@ TEAM_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
}
}
},
"parents": {
"properties": {
"id": {
"type": "keyword",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 36
}
}
},
"type": {
"type": "keyword"
},
"name": {
"type": "keyword",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"fullyQualifiedName": {
"type": "text"
},
"description": {
"type": "text"
},
"deleted": {
"type": "text"
},
"href": {
"type": "text"
}
}
},
"defaultRoles": {
"properties": {
"id": {

View File

@ -134,7 +134,7 @@ class MetadataSource(Source[Entity]):
if self.service_connection.includeTeams:
yield from self.fetch_entities(
entity_class=Team,
fields=["users", "owns"],
fields=["users", "owns", "parents"],
)
if self.service_connection.includeGlossaryTerms:

View File

@ -9,7 +9,7 @@ import org.openmetadata.service.util.JsonUtils;
public class TeamIndex implements ElasticSearchIndex {
Team team;
final List<String> excludeFields = List.of("owns", "changeDescription");
final List<String> excludeFields = List.of("owns", "changeDescription", "roles", "inheritedRoles");
public TeamIndex(Team team) {
this.team = team;

View File

@ -22,6 +22,9 @@
"description": {
"type": "text"
},
"teamType": {
"type": "text"
},
"version": {
"type": "float"
},
@ -72,6 +75,43 @@
}
}
},
"parents": {
"properties": {
"id": {
"type": "keyword",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 36
}
}
},
"type": {
"type": "keyword"
},
"name": {
"type": "keyword",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"fullyQualifiedName": {
"type": "text"
},
"description": {
"type": "text"
},
"deleted": {
"type": "text"
},
"href": {
"type": "text"
}
}
},
"defaultRoles": {
"properties": {
"id": {