-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(autorender): Auto render aspects that don't have frontend components in the UI #3597
Conversation
@@ -238,6 +242,7 @@ public GmsGraphQLEngine( | |||
this.mlPrimaryKeyType = new MLPrimaryKeyType(entityClient); | |||
this.dataFlowType = new DataFlowType(entityClient); | |||
this.dataJobType = new DataJobType(entityClient); | |||
this.entityRegistry = entityRegistry; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: seems odd to place this here. Can we put it below all of the types? Or above?
@@ -213,6 +216,7 @@ public GmsGraphQLEngine( | |||
final AnalyticsService analyticsService, | |||
final EntityService entityService, | |||
final RecommendationsService recommendationsService, | |||
final EntityRegistry entityRegistry, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put this at the end, instead of between 2 services?
@AllArgsConstructor | ||
public class WeaklyTypedAspectsResolver implements DataFetcher<CompletableFuture<List<RawAspect>>> { | ||
|
||
EntityClient _aspectClient; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: shouldn't these be private finals?
private static final JacksonDataCodec CODEC = new JacksonDataCodec(); | ||
|
||
private boolean shouldReturnAspect(AspectSpec aspectSpec, AspectParams params) { | ||
return !params.getAutoRender() || aspectSpec.isAutoRender(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is confusing on first read --
I only return an aspect if there is no "auto render" params OR if the aspect is auto-render enabled? (Not clear what the difference is, yet)
Params to configure what list of aspects should be fetched by the aspects property | ||
""" | ||
input AspectParams { | ||
autoRender: Boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be for fetching ONLY those aspects which are defined as autorender?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no comment on autoRender field
entityData?.autoRenderAspects?.map((aspect) => ({ | ||
name: aspect.renderSpec?.displayName || aspect.aspectName, | ||
component: () => ( | ||
<DynamicTab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty cool!
} | ||
|
||
export default function TableValueElement({ value }: { value: any }) { | ||
if (typeof value === 'boolean') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very interesting!
@@ -60,6 +62,10 @@ | |||
@Qualifier("dataHubTokenService") | |||
private TokenService _tokenService; | |||
|
|||
@Autowired | |||
@Qualifier("entityRegistry") | |||
private EntityRegistry _entityRegistry; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bit sad to see another storage layer dependency ending up in GraphQL land!
return null; | ||
} | ||
|
||
if (entity.hasAspect()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff! Is there ever a reason we'll want an "Enveloped Aspect" hre? That is the raw aspect PLUS information about when / by who it was created, the version, the system metadata, etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah- i agree that endpoint would be useful! i left space in the graphql response to add that in later 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few minor things. Otherwise looks good. Interested to see how we can continue to push ourselves in a more dynamic direction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs needed
entity-registry/src/main/java/com/linkedin/metadata/models/annotation/AspectAnnotation.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Introduced a few templates for auto rendering aspects. This allows users of Datahub to see extensions of their metadata model in the UI without updating Java or React code.
Coming soon: extend the metadata model without forking datahub!
Checklist