-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Queries): new progress graph [YTFRONT-4112]
- Loading branch information
1 parent
61231db
commit 5d77908
Showing
48 changed files
with
1,686 additions
and
27 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
packages/ui/src/ui/pages/query-tracker/Plan/GraphEditor/DetailBlock/DetailBlock.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
.yt-detail-block { | ||
display: grid; | ||
grid-template-rows: 52px 1fr; | ||
color: var(--g-color-text-primary); | ||
padding: 10px 12px; | ||
min-height: 70px; | ||
min-width: 240px; | ||
box-sizing: border-box; | ||
background: var(--g-popup-background-color, var(--g-color-base-float)); | ||
border: 1px solid var(--g-popup-border-color, var(--g-color-line-generic-solid)); | ||
border-radius: 8px; | ||
box-shadow: 0 1px 5px 0 #00000026; | ||
|
||
&__header { | ||
display: flex; | ||
align-items: center; | ||
gap: 0 8px; | ||
font-weight: 500; | ||
} | ||
|
||
&__content { | ||
margin-top: 8px; | ||
} | ||
|
||
&__details { | ||
font-size: 11px; | ||
height: auto; | ||
padding-bottom: 0; | ||
overflow-y: auto; | ||
|
||
&_without-padding { | ||
padding-top: 0; | ||
} | ||
|
||
.node-details-info{ | ||
grid-gap: 10px; | ||
} | ||
|
||
.data-table__row { | ||
height: auto; | ||
} | ||
|
||
.g-text_variant_body-1 { | ||
font-size: 11px; | ||
} | ||
} | ||
|
||
.graph-block-wrapper{ | ||
border: none; | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
packages/ui/src/ui/pages/query-tracker/Plan/GraphEditor/DetailBlock/DetailBlock.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React, {CSSProperties, FC, useMemo, useRef} from 'react'; | ||
import './DetailBlock.scss'; | ||
import cn from 'bem-cn-lite'; | ||
import {NodeBlock} from '../canvas/NodeBlock'; | ||
import OperationNodeInfo from '../../OperationNodeInfo'; | ||
import {hasDetailsInfo, hasJobsInfo, hasStagesInfo} from '../../utils'; | ||
import {DetailBlockHeader} from './DetailBlockHeader'; | ||
import {Graph} from '@gravity-ui/graph'; | ||
|
||
const b = cn('yt-detail-block'); | ||
|
||
type Props = { | ||
block: NodeBlock; | ||
graph: Graph; | ||
showHeader?: boolean; | ||
showInfo?: boolean; | ||
className?: string; | ||
style?: CSSProperties; | ||
}; | ||
|
||
export const DetailBlock: FC<Props> = ({block, showHeader, showInfo, className, style}) => { | ||
const detailBlockRef = useRef<HTMLDivElement>(null); | ||
const {state} = block; | ||
const {nodeProgress, details, schemas} = state.meta; | ||
|
||
const showNodeInfo = useMemo(() => { | ||
return ( | ||
showInfo && | ||
(schemas || | ||
hasStagesInfo(nodeProgress) || | ||
hasJobsInfo(nodeProgress) || | ||
hasDetailsInfo(details)) | ||
); | ||
}, [details, nodeProgress, schemas, showInfo]); | ||
|
||
if (!showNodeInfo && !showHeader) return null; | ||
|
||
return ( | ||
<div | ||
ref={detailBlockRef} | ||
className={b(null, className)} | ||
style={style} | ||
onWheel={(e) => { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
}} | ||
> | ||
{showHeader && <DetailBlockHeader block={state} />} | ||
{showNodeInfo && ( | ||
<OperationNodeInfo | ||
progress={nodeProgress || undefined} | ||
schemas={schemas} | ||
details={details} | ||
radioWidth="max" | ||
className={b('details', {'without-padding': !showHeader})} | ||
/> | ||
)} | ||
</div> | ||
); | ||
}; |
40 changes: 40 additions & 0 deletions
40
packages/ui/src/ui/pages/query-tracker/Plan/GraphEditor/DetailBlock/DetailBlockHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React, {FC, useMemo} from 'react'; | ||
import {Flex, Text} from '@gravity-ui/uikit'; | ||
import {OperationContent} from './OperationContent'; | ||
import {NodeTBlock} from '../canvas/NodeBlock'; | ||
import {GraphBlockType} from '../enums'; | ||
import {DetailBlockTitle} from './DetailBlockTitle'; | ||
|
||
type Props = { | ||
block: NodeTBlock; | ||
}; | ||
|
||
export const DetailBlockHeader: FC<Props> = ({ | ||
block: { | ||
meta: {icon, bottomText, nodeProgress}, | ||
name, | ||
is, | ||
}, | ||
}) => { | ||
const isTable = is === GraphBlockType.Table; | ||
|
||
const showContent = useMemo(() => { | ||
if (isTable) return Boolean(bottomText); | ||
return nodeProgress && nodeProgress.total; | ||
}, [bottomText, isTable, nodeProgress]); | ||
|
||
return ( | ||
<Flex gap={2} direction="column"> | ||
<DetailBlockTitle icon={icon} name={name} /> | ||
{showContent && ( | ||
<> | ||
{isTable ? ( | ||
<Text variant="caption-2">{bottomText || ''}</Text> | ||
) : ( | ||
<OperationContent nodeProgress={nodeProgress} /> | ||
)} | ||
</> | ||
)} | ||
</Flex> | ||
); | ||
}; |
16 changes: 16 additions & 0 deletions
16
packages/ui/src/ui/pages/query-tracker/Plan/GraphEditor/DetailBlock/DetailBlockTitle.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.yt-detailed-block-title { | ||
display: flex; | ||
align-items: center; | ||
gap: 0 8px; | ||
|
||
&__icon { | ||
height: 16px; | ||
width: 16px; | ||
color: #657B8F; | ||
} | ||
|
||
&__name { | ||
font-size: 11px; | ||
font-weight: bold; | ||
} | ||
} |
Oops, something went wrong.