Skip to content

Commit

Permalink
fix: add externalurl
Browse files Browse the repository at this point in the history
  • Loading branch information
FYLSunghwan committed Dec 13, 2021
1 parent 28aa4c3 commit 0943f0d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ public MLExperiment apply(@Nonnull final MLExperimentSnapshot mlExperiment) {
if (experimentProperties.getDescription() != null) {
result.setDescription(experimentProperties.getDescription());
}
if (experimentProperties.hasExternalUrl()) {
result.setExternalUrl(experimentProperties.getExternalUrl());
}
} else if (aspect instanceof GlobalTags) {
result.setGlobalTags(GlobalTagsMapper.map((GlobalTags) aspect));
result.setTags(GlobalTagsMapper.map((GlobalTags) aspect));
Expand Down
4 changes: 4 additions & 0 deletions datahub-graphql-core/src/main/resources/entity.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4559,6 +4559,8 @@ type MLExperiment implements EntityWithRelationships & Entity {
Edges extending from this entity
"""
relationships(input: RelationshipsInput!): EntityRelationshipsResult

externalUrl: String
}

"""
Expand Down Expand Up @@ -4758,6 +4760,8 @@ type MLExperimentProperties {
tags: [String!]

customProperties: [StringMapEntry!]

externalUrl: String
}

type MLFeatureProperties {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Image, Row, Space, Typography } from 'antd';
import { Image, Row, Space, Typography, Button } from 'antd';
import React from 'react';
import styled from 'styled-components';
import { MlExperiment } from '../../../../types.generated';
Expand Down Expand Up @@ -31,6 +31,8 @@ export type Props = {
export default function MLExperimentHeader({ mlExperiment: { ownership, platform, properties } }: Props) {
const entityRegistry = useEntityRegistry();
const isCompact = React.useContext(CompactContext);
const externalUrl = properties?.externalUrl || undefined;
const hasExternalUrl = !!externalUrl;

return (
<>
Expand All @@ -54,6 +56,7 @@ export default function MLExperimentHeader({ mlExperiment: { ownership, platform
) : null}
<PlatformName>{platform.name}</PlatformName>
</Space>
{hasExternalUrl && <Button href={externalUrl}>View in {platform.name}</Button>}
</HeaderInfoItem>
) : null}
</Row>
Expand Down
1 change: 1 addition & 0 deletions datahub-web-react/src/graphql/fragments.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ fragment nonRecursiveMLExperiment on MLExperiment {
date
version
type
externalUrl
metrics {
name
description
Expand Down

0 comments on commit 0943f0d

Please sign in to comment.