Skip to content

Commit

Permalink
[ui] Turn on new code location pages (#25508)
Browse files Browse the repository at this point in the history
## Summary & Motivation

Remove the `flagCodeLocationPage` flag, permanently enabling the new
code location pages in OSS.

## How I Tested These Changes

View app with legacy nav turned on and off, navigate to Deployment.
Click on code locations, verify that their new pages render correctly.

## Changelog

[ui] New code location pages with library versions, metadata, and
definitions.
  • Loading branch information
hellendag authored Oct 24, 2024
1 parent 3a02456 commit 13fa46f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ export enum FeatureFlag {
flagSidebarResources = 'flagSidebarResources',
flagDisableAutoLoadDefaults = 'flagDisableAutoLoadDefaults',
flagLegacyNav = 'flagLegacyNav',
flagCodeLocationPage = 'flagCodeLocationPage',
flagLegacyRunsPage = 'flagLegacyRunsPage',
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ export const useVisibleFeatureFlagRows = () => [
),
flagType: FeatureFlag.flagLegacyNav,
},
{
key: 'New code location page',
flagType: FeatureFlag.flagCodeLocationPage,
},
{
key: 'Revert to legacy Runs page',
flagType: FeatureFlag.flagLegacyRunsPage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,23 @@ import {Redirect, Switch, useParams} from 'react-router-dom';

import {CodeLocationNotFound} from './CodeLocationNotFound';
import {GraphRoot} from './GraphRoot';
import {WorkspaceAssetsRoot} from './WorkspaceAssetsRoot';
import {WorkspaceContext} from './WorkspaceContext/WorkspaceContext';
import {WorkspaceGraphsRoot} from './WorkspaceGraphsRoot';
import {WorkspaceJobsRoot} from './WorkspaceJobsRoot';
import {WorkspaceOpsRoot} from './WorkspaceOpsRoot';
import {WorkspaceSchedulesRoot} from './WorkspaceSchedulesRoot';
import {WorkspaceSensorsRoot} from './WorkspaceSensorsRoot';
import {repoAddressAsHumanString} from './repoAddressAsString';
import {repoAddressFromPath} from './repoAddressFromPath';
import {workspacePathFromAddress} from './workspacePath';
import {useFeatureFlags} from '../app/Flags';
import {Route} from '../app/Route';
import {AssetGroupRoot} from '../assets/AssetGroupRoot';
import {CodeLocationDefinitionsRoot} from '../code-location/CodeLocationDefinitionsRoot';
import CodeLocationOverviewRoot from '../code-location/CodeLocationOverviewRoot';
import {PipelineRoot} from '../pipelines/PipelineRoot';
import {ResourceRoot} from '../resources/ResourceRoot';
import {WorkspaceResourcesRoot} from '../resources/WorkspaceResourcesRoot';
import {ScheduleRoot} from '../schedules/ScheduleRoot';
import {SensorRoot} from '../sensors/SensorRoot';

const RepoRouteContainer = () => {
const {repoPath} = useParams<{repoPath: string}>();
const workspaceState = useContext(WorkspaceContext);
const addressForPath = repoAddressFromPath(repoPath);
const {flagCodeLocationPage} = useFeatureFlags();

const {loading} = workspaceState;

Expand Down Expand Up @@ -118,60 +109,29 @@ const RepoRouteContainer = () => {
>
<AssetGroupRoot repoAddress={addressForPath} tab="lineage" />
</Route>
{flagCodeLocationPage ? (
<>
<Route path="/locations/:repoPath" exact>
<CodeLocationOverviewRoot repoAddress={addressForPath} />
</Route>
<Route path="/locations/:repoPath/definitions" exact>
<Redirect to={workspacePathFromAddress(addressForPath, '/assets')} />
</Route>
<Route
path={[
'/locations/:repoPath/assets',
'/locations/:repoPath/jobs',
'/locations/:repoPath/resources',
'/locations/:repoPath/schedules',
'/locations/:repoPath/sensors',
'/locations/:repoPath/graphs',
'/locations/:repoPath/ops/:name?',
]}
exact
>
<CodeLocationDefinitionsRoot
repoAddress={addressForPath}
repository={matchingRepo.repository}
/>
</Route>
</>
) : (
<>
<Route path="/locations/:repoPath" exact>
<Redirect to={workspacePathFromAddress(addressForPath, '/assets')} />
</Route>
<Route path="/locations/:repoPath/resources" exact>
<WorkspaceResourcesRoot repoAddress={addressForPath} />
</Route>
<Route path="/locations/:repoPath/assets" exact>
<WorkspaceAssetsRoot repoAddress={addressForPath} />
</Route>
<Route path="/locations/:repoPath/jobs" exact>
<WorkspaceJobsRoot repoAddress={addressForPath} />
</Route>
<Route path="/locations/:repoPath/schedules" exact>
<WorkspaceSchedulesRoot repoAddress={addressForPath} />
</Route>
<Route path="/locations/:repoPath/sensors" exact>
<WorkspaceSensorsRoot repoAddress={addressForPath} />
</Route>
<Route path="/locations/:repoPath/graphs" exact>
<WorkspaceGraphsRoot repoAddress={addressForPath} />
</Route>
<Route path="/locations/:repoPath/ops/:name?" exact>
<WorkspaceOpsRoot repoAddress={addressForPath} />
</Route>
</>
)}
<Route path="/locations/:repoPath" exact>
<CodeLocationOverviewRoot repoAddress={addressForPath} />
</Route>
<Route path="/locations/:repoPath/definitions" exact>
<Redirect to={workspacePathFromAddress(addressForPath, '/assets')} />
</Route>
<Route
path={[
'/locations/:repoPath/assets',
'/locations/:repoPath/jobs',
'/locations/:repoPath/resources',
'/locations/:repoPath/schedules',
'/locations/:repoPath/sensors',
'/locations/:repoPath/graphs',
'/locations/:repoPath/ops/:name?',
]}
exact
>
<CodeLocationDefinitionsRoot
repoAddress={addressForPath}
repository={matchingRepo.repository}
/>
</Route>
<Route path={['/locations/:repoPath/*', '/locations/:repoPath/']}>
<Redirect to={workspacePathFromAddress(addressForPath, '/assets')} />
</Route>
Expand Down

1 comment on commit 13fa46f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-uadho7qr6-elementl.vercel.app

Built with commit 13fa46f.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.