Skip to content
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

Show only the source on the consumer DAG page and only triggered DAG run in the producer DAG page #41300

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 27 additions & 17 deletions airflow/www/static/js/components/DatasetEventCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,17 @@ import TriggeredDagRuns from "./TriggeredDagRuns";

type CardProps = {
datasetEvent: DatasetEvent;
showSource?: boolean;
showTriggeredDagRuns?: boolean;
};

const datasetsUrl = getMetaValue("datasets_url");

const DatasetEventCard = ({ datasetEvent }: CardProps) => {
const DatasetEventCard = ({
datasetEvent,
showSource = true,
showTriggeredDagRuns = true,
}: CardProps) => {
const [searchParams] = useSearchParams();

const selectedUri = decodeURIComponent(searchParams.get("uri") || "");
Expand Down Expand Up @@ -92,25 +98,29 @@ const DatasetEventCard = ({ datasetEvent }: CardProps) => {
</Flex>
</GridItem>
<GridItem>
Source:
{fromRestApi && (
<Tooltip
portalProps={{ containerRef }}
hasArrow
placement="top"
label="Manually created from REST API"
>
<Box width="20px">
<TbApi size="20px" />
</Box>
</Tooltip>
)}
{!!datasetEvent.sourceTaskId && (
<SourceTaskInstance datasetEvent={datasetEvent} />
{showSource && (
<>
Source:
{fromRestApi && (
<Tooltip
portalProps={{ containerRef }}
hasArrow
placement="top"
label="Manually created from REST API"
>
<Box width="20px">
<TbApi size="20px" />
</Box>
</Tooltip>
)}
{!!datasetEvent.sourceTaskId && (
<SourceTaskInstance datasetEvent={datasetEvent} />
)}
</>
)}
</GridItem>
<GridItem>
{!!datasetEvent?.createdDagruns?.length && (
{showTriggeredDagRuns && !!datasetEvent?.createdDagruns?.length && (
<>
Triggered Dag Runs:
<TriggeredDagRuns createdDagRuns={datasetEvent?.createdDagruns} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ interface Props {
const dagId = getMetaValue("dag_id");

const cardDef: CardDef<DatasetEvent> = {
card: ({ row }) => <DatasetEventCard datasetEvent={row} />,
card: ({ row }) => (
<DatasetEventCard datasetEvent={row} showTriggeredDagRuns={false} />
),
};

const DatasetTriggerEvents = ({ runId }: Props) => {
Expand All @@ -56,10 +58,6 @@ const DatasetTriggerEvents = ({ runId }: Props) => {
Header: "Source Task Instance",
accessor: "sourceTaskId",
},
{
Header: "Triggered Runs",
accessor: "createdDagruns",
},
{
Header: "Extra",
accessor: "extra",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface Props {
}

const cardDef: CardDef<DatasetEvent> = {
card: ({ row }) => <DatasetEventCard datasetEvent={row} />,
card: ({ row }) => <DatasetEventCard datasetEvent={row} showSource={false} />,
};

const dagId = getMetaValue("dag_id") || undefined;
Expand All @@ -57,10 +57,6 @@ const DatasetUpdateEvents = ({ runId, taskId }: Props) => {
Header: "Dataset",
accessor: "datasetUri",
},
{
Header: "Source Task Instance",
accessor: "sourceTaskId",
},
{
Header: "Triggered Runs",
accessor: "createdDagruns",
Expand Down