diff --git a/js_modules/dagster-ui/packages/ui-components/src/components/Icon.tsx b/js_modules/dagster-ui/packages/ui-components/src/components/Icon.tsx index e53c65fe3254a..eb281ed39bc46 100644 --- a/js_modules/dagster-ui/packages/ui-components/src/components/Icon.tsx +++ b/js_modules/dagster-ui/packages/ui-components/src/components/Icon.tsx @@ -73,6 +73,7 @@ import code_location from '../icon-svgs/code_location.svg'; import code_location_reload from '../icon-svgs/code_location_reload.svg'; import collapse from '../icon-svgs/collapse.svg'; import collapse_arrows from '../icon-svgs/collapse_arrows.svg'; +import collapse_fullscreen from '../icon-svgs/collapse_fullscreen.svg'; import column_lineage from '../icon-svgs/column_lineage.svg'; import column_schema from '../icon-svgs/column_schema.svg'; import compute_kind from '../icon-svgs/compute_kind.svg'; @@ -143,6 +144,7 @@ import execute from '../icon-svgs/execute.svg'; import executing from '../icon-svgs/executing.svg'; import expand from '../icon-svgs/expand.svg'; import expand_arrows from '../icon-svgs/expand_arrows.svg'; +import expand_fullscreen from '../icon-svgs/expand_fullscreen.svg'; import expand_less from '../icon-svgs/expand_less.svg'; import expand_more from '../icon-svgs/expand_more.svg'; import expectation from '../icon-svgs/expectation.svg'; @@ -488,6 +490,7 @@ export const Icons = { code_location, code_location_reload, collapse, + collapse_fullscreen, collapse_arrows, column_lineage, column_schema, @@ -559,6 +562,7 @@ export const Icons = { executing, expand, expand_arrows, + expand_fullscreen, expand_less, expand_more, expectation, diff --git a/js_modules/dagster-ui/packages/ui-components/src/icon-svgs/collapse_fullscreen.svg b/js_modules/dagster-ui/packages/ui-components/src/icon-svgs/collapse_fullscreen.svg new file mode 100644 index 0000000000000..5618859605d27 --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-components/src/icon-svgs/collapse_fullscreen.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/js_modules/dagster-ui/packages/ui-components/src/icon-svgs/expand_fullscreen.svg b/js_modules/dagster-ui/packages/ui-components/src/icon-svgs/expand_fullscreen.svg new file mode 100644 index 0000000000000..ae7b0dbfe9d1d --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-components/src/icon-svgs/expand_fullscreen.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/js_modules/dagster-ui/packages/ui-core/src/app/App.tsx b/js_modules/dagster-ui/packages/ui-core/src/app/App.tsx index 6f5f6ed8a48c2..a01c542e275c2 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/app/App.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/app/App.tsx @@ -1,8 +1,10 @@ import * as React from 'react'; +import {useRecoilValue} from 'recoil'; import styled from 'styled-components'; import {LayoutContext} from './LayoutProvider'; import {LEFT_NAV_WIDTH, LeftNav} from '../nav/LeftNav'; +import {isFullScreenAtom} from './AppTopNav/AppTopNavContext'; interface Props { banner?: React.ReactNode; @@ -18,8 +20,10 @@ export const App = ({banner, children}: Props) => { } }, [nav]); + const isFullScreen = useRecoilValue(isFullScreenAtom); + return ( - +
{banner}
@@ -50,9 +54,15 @@ const Main = styled.div<{$smallScreen: boolean; $navOpen: boolean}>` }} `; -const Container = styled.div` +const Container = styled.div<{$isFullScreen: boolean}>` display: flex; - height: calc(100% - 64px); + ${({$isFullScreen}) => { + if ($isFullScreen) { + return `height: 100%;`; + } else { + return `height: calc(100% - 64px);`; + } + }} `; const ChildContainer = styled.div` diff --git a/js_modules/dagster-ui/packages/ui-core/src/app/AppTopNav/AppTopNav.tsx b/js_modules/dagster-ui/packages/ui-core/src/app/AppTopNav/AppTopNav.tsx index 3afbb7c18e65e..3039841d689fd 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/app/AppTopNav/AppTopNav.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/app/AppTopNav/AppTopNav.tsx @@ -1,6 +1,7 @@ import {Box, Colors, Icon, IconWrapper} from '@dagster-io/ui-components'; import * as React from 'react'; import {NavLink} from 'react-router-dom'; +import {useRecoilValue} from 'recoil'; import {AppTopNavRightOfLogo} from 'shared/app/AppTopNav/AppTopNavRightOfLogo.oss'; import styled from 'styled-components'; @@ -14,6 +15,7 @@ import { import {SearchDialog} from '../../search/SearchDialog'; import {LayoutContext} from '../LayoutProvider'; import {ShortcutHandler} from '../ShortcutHandler'; +import {isFullScreenAtom} from './AppTopNavContext'; interface Props { children?: React.ReactNode; @@ -22,6 +24,13 @@ interface Props { } export const AppTopNav = ({children, allowGlobalReload = false}: Props) => { + const isFullScreen = useRecoilValue(isFullScreenAtom); + return isFullScreen ? null : ( + {children} + ); +}; + +const AppTopNavImpl = ({children, allowGlobalReload = false}: Props) => { const {flagMarketplace} = useFeatureFlags(); const {reloading, tryReload} = useRepositoryLocationReload({ scope: 'workspace', diff --git a/js_modules/dagster-ui/packages/ui-core/src/app/AppTopNav/AppTopNavContext.tsx b/js_modules/dagster-ui/packages/ui-core/src/app/AppTopNav/AppTopNavContext.tsx new file mode 100644 index 0000000000000..e19b257974b1b --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/app/AppTopNav/AppTopNavContext.tsx @@ -0,0 +1,6 @@ +import {atom} from 'recoil'; + +export const isFullScreenAtom = atom({ + key: 'isFullScreenAtom', + default: false, +}); diff --git a/js_modules/dagster-ui/packages/ui-core/src/app/__tests__/AppTopNav.test.tsx b/js_modules/dagster-ui/packages/ui-core/src/app/__tests__/AppTopNav.test.tsx index 4b91ae8a5ffbb..d290bc9f99e0f 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/app/__tests__/AppTopNav.test.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/app/__tests__/AppTopNav.test.tsx @@ -1,6 +1,7 @@ import {MockedProvider} from '@apollo/client/testing'; import {render, screen} from '@testing-library/react'; import {MemoryRouter} from 'react-router-dom'; +import {RecoilRoot} from 'recoil'; import {WorkspaceProvider} from '../../workspace/WorkspaceContext/WorkspaceContext'; import {AppTopNav} from '../AppTopNav/AppTopNav'; @@ -14,13 +15,15 @@ jest.mock('../../search/SearchDialog', () => ({ describe('AppTopNav', () => { it('renders links and controls', async () => { render( - - - - - - - , + + + + + + + + + , ); await screen.findByRole('link', {name: /runs/i}); diff --git a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorer.tsx b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorer.tsx index a394af768e225..df1fca9b67e5b 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorer.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorer.tsx @@ -93,6 +93,9 @@ type Props = { ) => void; viewType: AssetGraphViewType; setHideEdgesToNodesOutsideQuery?: (hideEdgesToNodesOutsideQuery: boolean) => void; + + isFullScreen?: boolean; + toggleFullScreen?: () => void; }; export const MINIMAL_SCALE = 0.6; @@ -161,6 +164,8 @@ const AssetGraphExplorerWithData = ({ options, setOptions, explorerPath, + isFullScreen, + toggleFullScreen, onChangeExplorerPath, onNavigateToSourceAssetNode: onNavigateToSourceAssetNode, assetGraphData, @@ -684,7 +689,7 @@ const AssetGraphExplorerWithData = ({ )} - + )} - - { - if (errors !== errorState) { - setErrorState(errors); - } - }} - /> - - - + {viewType === AssetGraphViewType.CATALOG ? ( + <> + {toggleFullScreen ? ( + +