From 07654feb80d51dfd587f9bd783b1c05819ca17c2 Mon Sep 17 00:00:00 2001 From: bengotow Date: Tue, 5 Nov 2024 17:16:28 -0600 Subject: [PATCH] fix circular import --- .../packages/ui-core/src/runs/RunsFeedRow.tsx | 63 +------------------ .../src/runs/RunsFeedTableEntryFragment.tsx | 60 ++++++++++++++++++ .../ui-core/src/runs/RunsFeedUtils.tsx | 2 + .../ui-core/src/runs/RunsFilterInput.tsx | 2 +- ...ts => RunsFeedTableEntryFragment.types.ts} | 0 .../ui-core/src/runs/useRunsFeedEntries.tsx | 5 +- 6 files changed, 67 insertions(+), 65 deletions(-) create mode 100644 js_modules/dagster-ui/packages/ui-core/src/runs/RunsFeedTableEntryFragment.tsx rename js_modules/dagster-ui/packages/ui-core/src/runs/types/{RunsFeedRow.types.ts => RunsFeedTableEntryFragment.types.ts} (100%) diff --git a/js_modules/dagster-ui/packages/ui-core/src/runs/RunsFeedRow.tsx b/js_modules/dagster-ui/packages/ui-core/src/runs/RunsFeedRow.tsx index a4391b600bb3b..6064977629578 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/runs/RunsFeedRow.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/runs/RunsFeedRow.tsx @@ -14,7 +14,7 @@ import styled from 'styled-components'; import {CreatedByTagCell, CreatedByTagCellWrapper} from './CreatedByTag'; import {QueuedRunCriteriaDialog} from './QueuedRunCriteriaDialog'; -import {RUN_ACTIONS_MENU_RUN_FRAGMENT, RunActionsMenu} from './RunActionsMenu'; +import {RunActionsMenu} from './RunActionsMenu'; import {RunRowTags} from './RunRowTags'; import {RunStatusTag, RunStatusTagWithStats} from './RunStatusTag'; import {DagsterTag} from './RunTag'; @@ -22,14 +22,11 @@ import {RunTargetLink} from './RunTargetLink'; import {RunStateSummary, RunTime, titleForRun} from './RunUtils'; import {getBackfillPath} from './RunsFeedUtils'; import {RunFilterToken} from './RunsFilterInput'; -import {gql} from '../apollo-client'; import {RunTimeFragment} from './types/RunUtils.types'; -import {RunsFeedTableEntryFragment} from './types/RunsFeedRow.types'; +import {RunsFeedTableEntryFragment} from './types/RunsFeedTableEntryFragment.types'; import {RunStatus} from '../graphql/types'; import {BackfillActionsMenu, backfillCanCancelRuns} from '../instance/backfill/BackfillActionsMenu'; -import {BACKFILL_STEP_STATUS_DIALOG_BACKFILL_FRAGMENT} from '../instance/backfill/BackfillFragments'; import {BackfillTarget} from '../instance/backfill/BackfillRow'; -import {PARTITION_SET_FOR_BACKFILL_TABLE_FRAGMENT} from '../instance/backfill/BackfillTable'; import {HeaderCell, HeaderRow, RowCell} from '../ui/VirtualizedTable'; import {appendCurrentQueryParams} from '../util/appendCurrentQueryParams'; @@ -221,59 +218,3 @@ const RowGrid = styled(Box)` display: block; } `; - -export const RUNS_FEED_TABLE_ENTRY_FRAGMENT = gql` - fragment RunsFeedTableEntryFragment on RunsFeedEntry { - __typename - id - runStatus - creationTime - startTime - endTime - tags { - key - value - } - jobName - assetSelection { - ... on AssetKey { - path - } - } - assetCheckSelection { - name - assetKey { - path - } - } - ... on Run { - repositoryOrigin { - id - repositoryLocationName - repositoryName - } - ...RunActionsMenuRunFragment - } - ... on PartitionBackfill { - backfillStatus: status - partitionSetName - partitionSet { - id - ...PartitionSetForBackfillTableFragment - } - assetSelection { - path - } - - hasCancelPermission - hasResumePermission - isAssetBackfill - numCancelable - ...BackfillStepStatusDialogBackfillFragment - } - } - - ${RUN_ACTIONS_MENU_RUN_FRAGMENT} - ${PARTITION_SET_FOR_BACKFILL_TABLE_FRAGMENT} - ${BACKFILL_STEP_STATUS_DIALOG_BACKFILL_FRAGMENT} -`; diff --git a/js_modules/dagster-ui/packages/ui-core/src/runs/RunsFeedTableEntryFragment.tsx b/js_modules/dagster-ui/packages/ui-core/src/runs/RunsFeedTableEntryFragment.tsx new file mode 100644 index 0000000000000..f3574f6727b6c --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/runs/RunsFeedTableEntryFragment.tsx @@ -0,0 +1,60 @@ +import {RUN_ACTIONS_MENU_RUN_FRAGMENT} from './RunActionsMenu'; +import {gql} from '../apollo-client'; +import {BACKFILL_STEP_STATUS_DIALOG_BACKFILL_FRAGMENT} from '../instance/backfill/BackfillFragments'; +import {PARTITION_SET_FOR_BACKFILL_TABLE_FRAGMENT} from '../instance/backfill/BackfillTable'; + +export const RUNS_FEED_TABLE_ENTRY_FRAGMENT = gql` + fragment RunsFeedTableEntryFragment on RunsFeedEntry { + __typename + id + runStatus + creationTime + startTime + endTime + tags { + key + value + } + jobName + assetSelection { + ... on AssetKey { + path + } + } + assetCheckSelection { + name + assetKey { + path + } + } + ... on Run { + repositoryOrigin { + id + repositoryLocationName + repositoryName + } + ...RunActionsMenuRunFragment + } + ... on PartitionBackfill { + backfillStatus: status + partitionSetName + partitionSet { + id + ...PartitionSetForBackfillTableFragment + } + assetSelection { + path + } + + hasCancelPermission + hasResumePermission + isAssetBackfill + numCancelable + ...BackfillStepStatusDialogBackfillFragment + } + } + + ${RUN_ACTIONS_MENU_RUN_FRAGMENT} + ${PARTITION_SET_FOR_BACKFILL_TABLE_FRAGMENT} + ${BACKFILL_STEP_STATUS_DIALOG_BACKFILL_FRAGMENT} +`; diff --git a/js_modules/dagster-ui/packages/ui-core/src/runs/RunsFeedUtils.tsx b/js_modules/dagster-ui/packages/ui-core/src/runs/RunsFeedUtils.tsx index cd304560c649c..e55fa318e1fcf 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/runs/RunsFeedUtils.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/runs/RunsFeedUtils.tsx @@ -3,6 +3,8 @@ import {FeatureFlag} from 'shared/app/FeatureFlags.oss'; import {runsPathWithFilters} from './RunsFilterInput'; import {featureEnabled} from '../app/Flags'; +export const RUNS_FEED_CURSOR_KEY = `runs_before`; + export function getBackfillPath(id: string, isAssetBackfill: boolean) { if (featureEnabled(FeatureFlag.flagLegacyRunsPage)) { if (isAssetBackfill) { diff --git a/js_modules/dagster-ui/packages/ui-core/src/runs/RunsFilterInput.tsx b/js_modules/dagster-ui/packages/ui-core/src/runs/RunsFilterInput.tsx index 52244e0986fb8..b6a073d4c70b0 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/runs/RunsFilterInput.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/runs/RunsFilterInput.tsx @@ -18,7 +18,6 @@ import { RunTagValuesQuery, RunTagValuesQueryVariables, } from './types/RunsFilterInput.types'; -import {RUNS_FEED_CURSOR_KEY} from './useRunsFeedEntries'; import {COMMON_COLLATOR} from '../app/Util'; import {__ASSET_JOB_PREFIX} from '../asset-graph/Utils'; import {RunStatus, RunsFilter} from '../graphql/types'; @@ -33,6 +32,7 @@ import { } from '../ui/BaseFilters/useSuggestionFilter'; import {TimeRangeState, useTimeRangeFilter} from '../ui/BaseFilters/useTimeRangeFilter'; import {useRepositoryOptions} from '../workspace/WorkspaceContext/util'; +import {RUNS_FEED_CURSOR_KEY} from './RunsFeedUtils'; export interface RunsFilterInputProps { loading?: boolean; diff --git a/js_modules/dagster-ui/packages/ui-core/src/runs/types/RunsFeedRow.types.ts b/js_modules/dagster-ui/packages/ui-core/src/runs/types/RunsFeedTableEntryFragment.types.ts similarity index 100% rename from js_modules/dagster-ui/packages/ui-core/src/runs/types/RunsFeedRow.types.ts rename to js_modules/dagster-ui/packages/ui-core/src/runs/types/RunsFeedTableEntryFragment.types.ts diff --git a/js_modules/dagster-ui/packages/ui-core/src/runs/useRunsFeedEntries.tsx b/js_modules/dagster-ui/packages/ui-core/src/runs/useRunsFeedEntries.tsx index 3b23ceab14bdb..bbda29a08c3a3 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/runs/useRunsFeedEntries.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/runs/useRunsFeedEntries.tsx @@ -1,7 +1,8 @@ import {useMemo} from 'react'; -import {RUNS_FEED_TABLE_ENTRY_FRAGMENT} from './RunsFeedRow'; +import {RUNS_FEED_TABLE_ENTRY_FRAGMENT} from './RunsFeedTableEntryFragment'; import {useSelectedRunsFeedTab} from './RunsFeedTabs'; +import {RUNS_FEED_CURSOR_KEY} from './RunsFeedUtils'; import {SCHEDULED_RUNS_LIST_QUERY} from './ScheduledRunListRoot'; import { ScheduledRunsListQuery, @@ -15,8 +16,6 @@ import {RunsFilter} from '../graphql/types'; const PAGE_SIZE = 30; -export const RUNS_FEED_CURSOR_KEY = `runs_before`; - export function useRunsFeedEntries( filter: RunsFilter, currentTab: ReturnType,