Skip to content

Commit

Permalink
refactor(ui): Minor improvements & refactoring (#9420)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjoyce0510 authored Dec 14, 2023
1 parent b87f977 commit ff0570e
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Pagination, Typography } from 'antd';
import { Pagination, Spin, Typography } from 'antd';
import { LoadingOutlined } from '@ant-design/icons';
import styled from 'styled-components';
import { FacetFilterInput, FacetMetadata, SearchResults as SearchResultType } from '../../../../../../types.generated';
Expand Down Expand Up @@ -61,7 +61,7 @@ const LoadingContainer = styled.div`
`;

const StyledLoading = styled(LoadingOutlined)`
font-size: 36px;
font-size: 32px;
color: ${ANTD_GRAY[7]};
padding-bottom: 18px;
]`;
Expand Down Expand Up @@ -128,7 +128,7 @@ export const EmbeddedListSearchResults = ({
<ResultContainer>
{loading && (
<LoadingContainer>
<StyledLoading />
<Spin indicator={<StyledLoading />} />
</LoadingContainer>
)}
{!loading && (
Expand Down
5 changes: 3 additions & 2 deletions datahub-web-react/src/app/lineage/LineageLoadingSection.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import styled from 'styled-components';
import { Spin } from 'antd';
import { LoadingOutlined } from '@ant-design/icons';
import { ANTD_GRAY } from '../entity/shared/constants';

Expand All @@ -13,15 +14,15 @@ const Container = styled.div`
`;

const StyledLoading = styled(LoadingOutlined)`
font-size: 36px;
font-size: 32px;
color: ${ANTD_GRAY[7]};
padding-bottom: 18px;
]`;

export default function LineageLoadingSection() {
return (
<Container>
<StyledLoading />
<Spin indicator={<StyledLoading />} />
</Container>
);
}
4 changes: 1 addition & 3 deletions datahub-web-react/src/graphql/domain.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ query getDomain($urn: String!) {
}
}
}
children: relationships(input: { types: ["IsPartOf"], direction: INCOMING, start: 0, count: 0 }) {
total
}
...domainEntitiesFields
}
}

Expand Down
167 changes: 116 additions & 51 deletions datahub-web-react/src/graphql/lineage.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ fragment lineageNodeProperties on EntityWithRelationships {
domain {
...entityDomain
}
parentContainers {
...parentContainersFields
}
...entityDataProduct
status {
removed
Expand All @@ -188,6 +191,9 @@ fragment lineageNodeProperties on EntityWithRelationships {
ownership {
...ownershipFields
}
parentContainers {
...parentContainersFields
}
subTypes {
typeNames
}
Expand Down Expand Up @@ -361,6 +367,60 @@ fragment partialLineageResults on EntityLineageResult {
filtered
}

fragment entityLineage on Entity {
urn
type
...lineageNodeProperties
...canEditLineageFragment
... on Dataset {
schemaMetadata(version: 0) @include(if: $showColumns) {
...schemaMetadataFields
}
siblings {
isPrimary
siblings {
urn
type
... on Dataset {
exists
}
...lineageNodeProperties
}
}
}
... on Chart {
inputFields @include(if: $showColumns) {
...inputFieldsFields
}
}
... on EntityWithRelationships {
upstream: lineage(
input: {
direction: UPSTREAM
start: 0
count: 100
separateSiblings: $separateSiblings
startTimeMillis: $startTimeMillis
endTimeMillis: $endTimeMillis
}
) @skip(if: $excludeUpstream) {
...fullLineageResults
}
downstream: lineage(
input: {
direction: DOWNSTREAM
start: 0
count: 100
separateSiblings: $separateSiblings
startTimeMillis: $startTimeMillis
endTimeMillis: $endTimeMillis
}
) @skip(if: $excludeDownstream) {
...fullLineageResults
}
}
}

query getEntityLineage(
$urn: String!
$separateSiblings: Boolean
Expand All @@ -371,57 +431,21 @@ query getEntityLineage(
$excludeDownstream: Boolean = false
) {
entity(urn: $urn) {
urn
type
...lineageNodeProperties
...canEditLineageFragment
... on Dataset {
schemaMetadata(version: 0) @include(if: $showColumns) {
...schemaMetadataFields
}
siblings {
isPrimary
siblings {
urn
type
... on Dataset {
exists
}
...lineageNodeProperties
}
}
}
... on Chart {
inputFields @include(if: $showColumns) {
...inputFieldsFields
}
}
... on EntityWithRelationships {
upstream: lineage(
input: {
direction: UPSTREAM
start: 0
count: 100
separateSiblings: $separateSiblings
startTimeMillis: $startTimeMillis
endTimeMillis: $endTimeMillis
}
) @skip(if: $excludeUpstream) {
...fullLineageResults
}
downstream: lineage(
input: {
direction: DOWNSTREAM
start: 0
count: 100
separateSiblings: $separateSiblings
startTimeMillis: $startTimeMillis
endTimeMillis: $endTimeMillis
}
) @skip(if: $excludeDownstream) {
...fullLineageResults
}
}
...entityLineage
}
}

query getBulkEntityLineage(
$urns: [String!]!,
$separateSiblings: Boolean
$showColumns: Boolean!
$startTimeMillis: Long
$endTimeMillis: Long
$excludeUpstream: Boolean = false
$excludeDownstream: Boolean = false
) {
entities(urns: $urns) {
...entityLineage
}
}

Expand Down Expand Up @@ -489,3 +513,44 @@ query getLineageCounts(
}
}
}

query getSearchAcrossLineageCounts(
$urn: String!
$excludeUpstream: Boolean = false
$excludeDownstream: Boolean = false
) {
upstreams: searchAcrossLineage(
input: {
urn: $urn
query: "*"
start: 0
count: 10000
filters: [{ field: "degree", value: "1", values: ["1"] }]
direction: UPSTREAM
}
) @skip(if: $excludeUpstream) {
start
count
total
facets {
...facetFields
}
}
downstreams: searchAcrossLineage(
input: {
urn: $urn
query: "*"
start: 0
count: 10000
filters: [{ field: "degree", value: "1", values: ["1"] }]
direction: DOWNSTREAM
}
) @skip(if: $excludeDownstream) {
start
count
total
facets {
...facetFields
}
}
}
10 changes: 10 additions & 0 deletions datahub-web-react/src/graphql/query.graphql
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
query getQuery($urn: String!) {
entity(urn: $urn) {
urn
type
... on QueryEntity {
...query
}
}
}

fragment query on QueryEntity {
urn
properties {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace com.linkedin.query

import com.linkedin.common.AuditStamp
import com.linkedin.common.Urn

/**
* Information about a Query against one or more data assets (e.g. Tables or Views).
Expand All @@ -22,7 +23,11 @@ record QueryProperties {
/**
* The query was entered manually by a user (via the UI).
*/
MANUAL
MANUAL,
/**
* The query was discovered by a crawler.
*/
SYSTEM
}

/**
Expand Down

0 comments on commit ff0570e

Please sign in to comment.