diff --git a/static_report/src/components/Common/SkipDatasource.tsx b/static_report/src/components/Common/SkipDatasource.tsx index 4058c6706..54664597b 100644 --- a/static_report/src/components/Common/SkipDatasource.tsx +++ b/static_report/src/components/Common/SkipDatasource.tsx @@ -1,14 +1,6 @@ import { Alert, AlertIcon, AlertDescription } from '@chakra-ui/react'; -export function SkipDatasource({ - skipDataSource, -}: { - skipDataSource: boolean | undefined; -}) { - if (!skipDataSource) { - return <>; - } - +export function SkipDataSource() { return ( diff --git a/static_report/src/components/Overview/Overview.tsx b/static_report/src/components/Overview/Overview.tsx index 5fb82bf04..221a9843e 100644 --- a/static_report/src/components/Overview/Overview.tsx +++ b/static_report/src/components/Overview/Overview.tsx @@ -30,7 +30,7 @@ import { LineageGraphData } from '../../utils/dbt'; import { topologySort } from '../../utils/graph'; import { CompDbtNodeEntryItem, useReportStore } from '../../utils/store'; import { SearchTextInput } from '../Common/SearchTextInput'; -import { SkipDatasource } from '../Common/SkipDatasource'; +import { SkipDataSource } from '../Common/SkipDataSource'; import { ModelList } from './ModelList'; import { MetricList } from './MetricList'; import { NodeList } from './NodeList'; @@ -369,7 +369,7 @@ export function Overview({ singleOnly }: Props) { return ( <> - + {skipDataSource && } {singleOnly ? 'Overview' : 'Impact Summary'} diff --git a/static_report/src/components/Reports/ReportContextBar.tsx b/static_report/src/components/Reports/ReportContextBar.tsx index 2f1f8ab12..af5b2ea30 100644 --- a/static_report/src/components/Reports/ReportContextBar.tsx +++ b/static_report/src/components/Reports/ReportContextBar.tsx @@ -1,9 +1,20 @@ -import { Box, Flex, FlexProps, Link, Text } from '@chakra-ui/react'; +import { + Box, + Flex, + FlexProps, + Icon, + Link, + Text, + Tooltip, +} from '@chakra-ui/react'; import { ReactNode } from 'react'; import { BiPlug } from 'react-icons/bi'; import { BsGearWideConnected } from 'react-icons/bs'; +import { FiInfo } from 'react-icons/fi'; import { GoGitBranch } from 'react-icons/go'; +import { TbBuildingWarehouse } from 'react-icons/tb'; import { VscGitPullRequest } from 'react-icons/vsc'; + import { Comparable, ComparisonReportSchema, @@ -31,6 +42,8 @@ export function ReportContextBar({ let gitBranch: string | undefined = undefined; let githubPr: string | undefined = undefined; let githubPrUrl: string | undefined = undefined; + let reportFrom: string | undefined = undefined; + let skipDataSource: boolean | undefined = false; if (data) { if (singleOnly) { @@ -38,6 +51,10 @@ export function ReportContextBar({ datasource = report.datasource?.name; version = report.version; gitBranch = report.datasource?.git_branch; + skipDataSource = report.datasource?.skip_datasource; + reportFrom = report.datasource?.skip_datasource + ? 'Manifest File' + : report.datasource.type; } else { const report = data as ComparisonReportSchema; const fallback = report.input ?? report.base; @@ -60,9 +77,60 @@ export function ReportContextBar({ githubPrUrl = report.metadata?.github_pr_url; } + + skipDataSource = + report.base?.datasource.skip_datasource || + report.input?.datasource.skip_datasource; + + const baseFrom = report.base?.datasource.skip_datasource + ? 'Manifest File' + : report.base?.datasource.type; + const targetFrom = report.input?.datasource.skip_datasource + ? 'Manifest File' + : report.input?.datasource.type; + + if (baseFrom !== targetFrom) { + reportFrom = `${baseFrom} ↔ ${targetFrom}`; + } else { + reportFrom = baseFrom; + } } } + const showIcon = (skipDataSource: boolean | undefined) => { + return skipDataSource ? ( + + + + ) : ( + + ); + }; + + const showReportSource = ( + reportFrom: string | undefined, + skipDataSource: boolean | undefined, + ) => { + return ( + + {showIcon(skipDataSource)} + + source: {reportFrom} + + + ); + }; + return ( )} {gitBranch && ( - + )} + {showReportSource(reportFrom, skipDataSource)} {actionArea && {actionArea}} diff --git a/static_report/src/pages/CRTableDetailPage.tsx b/static_report/src/pages/CRTableDetailPage.tsx index 61f370503..b778a4817 100644 --- a/static_report/src/pages/CRTableDetailPage.tsx +++ b/static_report/src/pages/CRTableDetailPage.tsx @@ -25,7 +25,7 @@ import { useTableRoute } from '../utils/routes'; import { NO_VALUE } from '../components/Columns/constants'; import { TableGeneralStats } from '../components/Tables/TableMetrics/TableGeneralStats'; import { DupedTableRowsWidget } from '../components/Widgets/DupedTableRowsWidget'; -import { SkipDatasource } from '../components/Common/SkipDatasource'; +import { SkipDataSource } from '../components/Common/SkipDataSource'; export default function CRTableDetailPage() { let { tableName, uniqueId } = useTableRoute(); @@ -39,7 +39,7 @@ export default function CRTableDetailPage() { }, }); - const { tableColumnsOnly = [] } = useReportStore.getState(); + const { tableColumnsOnly = [], reportDataSource } = useReportStore.getState(); const nodeKey = uniqueId ? uniqueId : `table.${tableName}`; const currentTableEntry = tableColumnsOnly.find(([key]) => key === nodeKey); @@ -47,6 +47,9 @@ export default function CRTableDetailPage() { return ; } + const skipDataSource = + reportDataSource?.base?.skip_datasource || + reportDataSource?.target?.skip_datasource; const [, { base, target }] = currentTableEntry; const fallback = target || base; @@ -179,7 +182,7 @@ export default function CRTableDetailPage() { return ( - + {skipDataSource && } - + {skipDataSource && }