-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add semantic models to lineage graph
Signed-off-by: popcorny <[email protected]>
- Loading branch information
1 parent
fb1bbdc
commit 9cfd6bd
Showing
12 changed files
with
1,402 additions
and
373 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { useRoute } from 'wouter'; | ||
import { getIconForResourceType } from '../components/Icons'; | ||
import { | ||
EVENTS, | ||
NoData, | ||
SR_TYPE_LABEL, | ||
TableColumnHeader, | ||
useReportStore, | ||
useTrackOnMount, | ||
} from '../lib'; | ||
import { SEMANTIC_MODEL_DETAILS_ROUTE_PATH } from '../utils/routes'; | ||
|
||
export function CRSemanticModelPage() { | ||
const [match, params] = useRoute(SEMANTIC_MODEL_DETAILS_ROUTE_PATH); | ||
|
||
useTrackOnMount({ | ||
eventName: EVENTS.PAGE_VIEW, | ||
eventProperties: { | ||
type: SR_TYPE_LABEL, | ||
page: 'resource-page', | ||
}, | ||
}); | ||
|
||
if (!match) { | ||
return <>Something wrong.</>; | ||
} | ||
|
||
const { tableColumnsOnly = [] } = useReportStore.getState(); | ||
const entry = tableColumnsOnly.find(([key]) => key === params?.uniqueId); | ||
if (!entry) { | ||
return <NoData text={`No data found for '${params?.uniqueId}'`} />; | ||
} | ||
|
||
const [, { base, target }] = entry; | ||
const fallback = target ?? base; | ||
|
||
const name = fallback?.name; | ||
const description = fallback?.description; | ||
const resourceType = fallback?.resource_type; | ||
const { icon } = getIconForResourceType(resourceType); | ||
|
||
return ( | ||
<> | ||
<TableColumnHeader | ||
subtitle="Semantic Model" | ||
title={name} | ||
icon={icon} | ||
infoTip={description} | ||
/> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { useRoute } from 'wouter'; | ||
import { getIconForResourceType } from '../components/Icons'; | ||
import { | ||
EVENTS, | ||
NoData, | ||
SR_TYPE_LABEL, | ||
TableColumnHeader, | ||
useReportStore, | ||
useTrackOnMount, | ||
} from '../lib'; | ||
import { SEMANTIC_MODEL_DETAILS_ROUTE_PATH } from '../utils/routes'; | ||
|
||
export function SRSemanticModelPage() { | ||
const [match, params] = useRoute(SEMANTIC_MODEL_DETAILS_ROUTE_PATH); | ||
|
||
useTrackOnMount({ | ||
eventName: EVENTS.PAGE_VIEW, | ||
eventProperties: { | ||
type: SR_TYPE_LABEL, | ||
page: 'resource-page', | ||
}, | ||
}); | ||
|
||
if (!match) { | ||
return <>Something wrong.</>; | ||
} | ||
|
||
const { tableColumnsOnly = [] } = useReportStore.getState(); | ||
const entry = tableColumnsOnly.find(([key]) => key === params?.uniqueId); | ||
if (!entry) { | ||
return <NoData text={`No data found for '${params?.uniqueId}'`} />; | ||
} | ||
|
||
const [, { base: data }] = entry; | ||
|
||
const name = data?.name; | ||
const description = data?.description; | ||
const resourceType = data?.resource_type; | ||
const { icon } = getIconForResourceType(resourceType); | ||
|
||
return ( | ||
<> | ||
<TableColumnHeader | ||
subtitle="Semantic Model" | ||
title={name} | ||
icon={icon} | ||
infoTip={description} | ||
/> | ||
</> | ||
); | ||
} |
Oops, something went wrong.