diff --git a/console/package.json b/console/package.json index 37ed5c1d13..9ec64f14d1 100644 --- a/console/package.json +++ b/console/package.json @@ -60,7 +60,7 @@ "plyr-react": "^5.1.0", "pretty-bytes": "^5.6.0", "qs": "^6.10.1", - "rc-field-form": "^1.21.1", + "rc-field-form": "^1.27.1", "rc-image": "^5.2.5", "react": "^17.0.2", "react-code-blocks": "^0.0.9-0", diff --git a/console/pnpm-lock.yaml b/console/pnpm-lock.yaml index c07b06860d..b097a225c5 100644 --- a/console/pnpm-lock.yaml +++ b/console/pnpm-lock.yaml @@ -119,7 +119,7 @@ specifiers: prettier: ^2.3.2 pretty-bytes: ^5.6.0 qs: ^6.10.1 - rc-field-form: ^1.21.1 + rc-field-form: ^1.27.1 rc-image: ^5.2.5 react: ^17.0.2 react-code-blocks: ^0.0.9-0 @@ -7646,7 +7646,7 @@ packages: mississippi: 3.0.0 mkdirp: 0.5.6 move-concurrently: 1.0.1 - promise-inflight: 1.0.1_bluebird@3.7.2 + promise-inflight: 1.0.1 rimraf: 2.7.1 ssri: 6.0.2 unique-filename: 1.1.1 @@ -18322,17 +18322,6 @@ packages: optional: true dev: true - /promise-inflight/1.0.1_bluebird@3.7.2: - resolution: {integrity: sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==} - peerDependencies: - bluebird: '*' - peerDependenciesMeta: - bluebird: - optional: true - dependencies: - bluebird: 3.7.2 - dev: true - /promise.allsettled/1.0.5: resolution: {integrity: sha512-tVDqeZPoBC0SlzJHzWGZ2NKAguVq2oiYj7gbggbiTvH2itHohijTp7njOUA0aQ/nl+0lr/r6egmhoYu63UZ/pQ==} engines: {node: '>= 0.4'} diff --git a/console/src/api/WithAuth.tsx b/console/src/api/WithAuth.tsx index a1f6130694..a0a2761e7b 100644 --- a/console/src/api/WithAuth.tsx +++ b/console/src/api/WithAuth.tsx @@ -25,6 +25,7 @@ export default function WithAuth({ children: React.ReactElement | any }) { let isPrivileged = false + // eslint-disable-next-line react-hooks/exhaustive-deps const { currentUser } = useCurrentUser() if (!currentUser) return if (isWrongKey(id)) return diff --git a/console/src/assets/fonts/iconfont.css b/console/src/assets/fonts/iconfont.css index f8ad3c987d..69ed456a92 100644 --- a/console/src/assets/fonts/iconfont.css +++ b/console/src/assets/fonts/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "iconfont"; /* Project id 3410006 */ - src: url('iconfont.woff2?t=1663575449431') format('woff2'), - url('iconfont.woff?t=1663575449431') format('woff'), - url('iconfont.ttf?t=1663575449431') format('truetype'); + src: url('iconfont.woff2?t=1664178541024') format('woff2'), + url('iconfont.woff?t=1664178541024') format('woff'), + url('iconfont.ttf?t=1664178541024') format('truetype'); } .iconfont { @@ -13,6 +13,10 @@ -moz-osx-font-smoothing: grayscale; } +.icon-setting2:before { + content: "\e64e"; +} + .icon-token:before { content: "\e64d"; } diff --git a/console/src/assets/fonts/iconfont.js b/console/src/assets/fonts/iconfont.js index 9848f3efb5..7d1cdc138d 100644 --- a/console/src/assets/fonts/iconfont.js +++ b/console/src/assets/fonts/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_3410006='',function(o){var l=(l=document.getElementsByTagName("script"))[l.length-1],c=l.getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var i,h,v,t,m,s=function(l,c){c.parentNode.insertBefore(l,c)};if(c&&!o.__iconfont__svg__cssinject__){o.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}i=function(){var l,c=document.createElement("div");c.innerHTML=o._iconfont_svg_string_3410006,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(l=document.body).firstChild?s(c,l.firstChild):l.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(i,0):(h=function(){document.removeEventListener("DOMContentLoaded",h,!1),i()},document.addEventListener("DOMContentLoaded",h,!1)):document.attachEvent&&(v=i,t=o.document,m=!1,e(),t.onreadystatechange=function(){"complete"==t.readyState&&(t.onreadystatechange=null,a())})}function a(){m||(m=!0,v())}function e(){try{t.documentElement.doScroll("left")}catch(l){return void setTimeout(e,50)}a()}}(window); \ No newline at end of file +window._iconfont_svg_string_3410006='',function(i){var l=(l=document.getElementsByTagName("script"))[l.length-1],c=l.getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var o,h,v,t,m,s=function(l,c){c.parentNode.insertBefore(l,c)};if(c&&!i.__iconfont__svg__cssinject__){i.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}o=function(){var l,c=document.createElement("div");c.innerHTML=i._iconfont_svg_string_3410006,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(l=document.body).firstChild?s(c,l.firstChild):l.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(o,0):(h=function(){document.removeEventListener("DOMContentLoaded",h,!1),o()},document.addEventListener("DOMContentLoaded",h,!1)):document.attachEvent&&(v=o,t=i.document,m=!1,e(),t.onreadystatechange=function(){"complete"==t.readyState&&(t.onreadystatechange=null,a())})}function a(){m||(m=!0,v())}function e(){try{t.documentElement.doScroll("left")}catch(l){return void setTimeout(e,50)}a()}}(window); \ No newline at end of file diff --git a/console/src/assets/fonts/iconfont.ttf b/console/src/assets/fonts/iconfont.ttf index 3bf53d20ae..1ba10177a1 100644 --- a/console/src/assets/fonts/iconfont.ttf +++ b/console/src/assets/fonts/iconfont.ttf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4161a9c94cdd624463ae229e633b03527a5f45c27ff3d25af1deb72dcf215a28 -size 14520 +oid sha256:26284a0cc6966f438aea0dcd584c34aaa990869ca9e6aa4925f40e56fe61b2d1 +size 14692 diff --git a/console/src/assets/fonts/iconfont.woff b/console/src/assets/fonts/iconfont.woff index 60503a66de..2c0c8f0259 100644 --- a/console/src/assets/fonts/iconfont.woff +++ b/console/src/assets/fonts/iconfont.woff @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:910a49efa68736adfccc10a9941a52ee0fe1121eb0fc9b3712f443475867a75b -size 8584 +oid sha256:a4e1adf4a19844da49ca35298d7ea2c319bf97a960d00fe966263bc4d83d52f7 +size 8672 diff --git a/console/src/assets/fonts/iconfont.woff2 b/console/src/assets/fonts/iconfont.woff2 index 08ad378031..680ac9f8e6 100644 --- a/console/src/assets/fonts/iconfont.woff2 +++ b/console/src/assets/fonts/iconfont.woff2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ee823b2095cabf23f59fecc22644b1ab8286b78a85382c00e02f6e7aa3d65e3a -size 7232 +oid sha256:652240aa701acc28e3066fbbd0a7a942fae0956842904ad97b334230beecc32b +size 7276 diff --git a/console/src/components/DAG/DAG.tsx b/console/src/components/DAG/DAG.tsx index f9e3c1c92f..7803d891c8 100644 --- a/console/src/components/DAG/DAG.tsx +++ b/console/src/components/DAG/DAG.tsx @@ -126,10 +126,11 @@ export default function DAG({ nodes = [], edges = [] }: any) {
@@ -148,9 +149,9 @@ export default function DAG({ nodes = [], edges = [] }: any) {
{/*
-
{data?.type}
-
*/} +
{data?.type}
+ */} ) }} diff --git a/console/src/components/Form/form.tsx b/console/src/components/Form/form.tsx index 6c11f3decb..44c85604ca 100755 --- a/console/src/components/Form/form.tsx +++ b/console/src/components/Form/form.tsx @@ -209,7 +209,7 @@ export function createForm({ return React.createElement( FormControl, { - error: error?.toString(), + error: error ? error.toString() : undefined, label: renderLabel(), caption, children: childNode, diff --git a/console/src/components/data-table/data-custom-table.tsx b/console/src/components/data-table/data-custom-table.tsx index 07196ec8be..f4a864cac5 100644 --- a/console/src/components/data-table/data-custom-table.tsx +++ b/console/src/components/data-table/data-custom-table.tsx @@ -511,10 +511,14 @@ function Headers({ width }: { width: number }) { const ctx = React.useContext(HeaderContext) const [resizeIndex, setResizeIndex] = React.useState(-1) - const $columns = ctx.columns.map((v, index) => ({ - ...v, - index, - })) + const $columns = React.useMemo( + () => + ctx.columns.map((v, index) => ({ + ...v, + index, + })), + [ctx.columns] + ) const store = ctx.useStore() @@ -708,20 +712,15 @@ function LoadingOrEmptyMessage(props) { ) } +const RENDERING = 0 +const LOADING = 1 +const EMPTY = 2 // replaces the content of the virtualized window with contents. in this case, // we are prepending a table header row before the table rows (children to the fn). const InnerTableElement = React.forwardRef<{ children: React.ReactNode; style: Record }, HTMLDivElement>( (props, ref) => { const ctx = React.useContext(HeaderContext) - // no need to render the cells until the columns have been measured - if (!ctx.widths.filter(Boolean).length) { - return null - } - - const RENDERING = 0 - const LOADING = 1 - const EMPTY = 2 let viewState = RENDERING if (ctx.loading) { viewState = LOADING @@ -731,18 +730,29 @@ const InnerTableElement = React.forwardRef<{ children: React.ReactNode; style: R // const highlightedRow = ctx.rows[ctx.rowHighlightIndex] - // @ts-ignore - const $children = props.children.map((o) => { - return { - ...o, - props: { - ...o.props, - pinned: true, - }, - } - }) + const $children = React.useMemo( + () => + // @ts-ignore + props.children.map((o) => { + return { + ...o, + props: { + ...o.props, + pinned: true, + }, + } + }), + [props.children] + ) + + const pinnedWidth = React.useMemo( + () => sum(ctx.columns.map((v, index) => (v.pin === 'LEFT' ? ctx.widths[index] : 0))), + [ctx.columns, ctx.widths] + ) - const pinnedWidth = sum(ctx.columns.map((v, index) => (v.pin === 'LEFT' ? ctx.widths[index] : 0))) + if (!ctx.widths.filter(Boolean).length) { + return null + } return ( <> @@ -1189,7 +1199,6 @@ export function DataTable({ diff --git a/console/src/components/data-table/data-table.tsx b/console/src/components/data-table/data-table.tsx index e66eadcad2..99309afe25 100644 --- a/console/src/components/data-table/data-table.tsx +++ b/console/src/components/data-table/data-table.tsx @@ -996,7 +996,6 @@ export function DataTable({ diff --git a/console/src/components/data-table/header-cell.tsx b/console/src/components/data-table/header-cell.tsx index 3fa6939e9c..d516396019 100644 --- a/console/src/components/data-table/header-cell.tsx +++ b/console/src/components/data-table/header-cell.tsx @@ -54,21 +54,27 @@ const HeaderCell = React.forwardRef((props, re } } - const COLUMN_OPTIONS = [ - { label: props.isPin ? locale.datatable.columnUnPinColumn : locale.datatable.columnPinColumn, type: 'pin' }, - { label: locale.datatable.columnSortAsc, type: 'sortAsc' }, - { label: locale.datatable.columnSortDesc, type: 'sortDesc' }, - ] + const COLUMN_OPTIONS = React.useMemo( + () => [ + { label: props.isPin ? locale.datatable.columnUnPinColumn : locale.datatable.columnPinColumn, type: 'pin' }, + { label: locale.datatable.columnSortAsc, type: 'sortAsc' }, + { label: locale.datatable.columnSortDesc, type: 'sortDesc' }, + ], + [props.isPin, locale] + ) - const handleColumnOptionSelect = (option: any) => { - if (option.type === 'pin') { - props.onPin?.(props.index, !props.isPin) - } else if (option.type === 'sortAsc') { - props.onSort(props.index, SORT_DIRECTIONS.ASC) - } else if (option.type === 'sortDesc') { - props.onSort(props.index, SORT_DIRECTIONS.DESC) - } - } + const handleColumnOptionSelect = React.useCallback( + (option: any) => { + if (option.type === 'pin') { + props.onPin?.(props.index, !props.isPin) + } else if (option.type === 'sortAsc') { + props.onSort(props.index, SORT_DIRECTIONS.ASC) + } else if (option.type === 'sortDesc') { + props.onSort(props.index, SORT_DIRECTIONS.DESC) + } + }, + [props.onPin, props.onSort, props.index, props.isPin] + ) return (
{} -// Measures the column header + sampled data function MeasureColumn({ sampleIndexes, column, columnIndex, rows, isSelectable, onLayout }) { const [css] = useStyletron() @@ -41,11 +36,11 @@ function MeasureColumn({ sampleIndexes, column, columnIndex, rows, isSelectable, isMeasured isSelectedAll={false} isSelectedIndeterminate={false} - onMouseEnter={() => {}} - onMouseLeave={() => {}} - onSelectAll={() => {}} - onSelectNone={() => {}} - onSort={() => {}} + onMouseEnter={emptyFunction} + onMouseLeave={emptyFunction} + onSelectAll={emptyFunction} + onSelectNone={emptyFunction} + onSort={emptyFunction} sortable={column.sortable} sortDirection={null} title={column.title} @@ -74,7 +69,6 @@ type MeasureColumnWidthsPropsT = { isSelectable: boolean onWidthsChange: (nums: number[]) => void rows: RowT[] - widths: number[] } const MAX_SAMPLE_SIZE = 50 @@ -107,32 +101,16 @@ export default function MeasureColumnWidths({ rows, isSelectable, onWidthsChange, - widths, }: MeasureColumnWidthsPropsT) { const [css] = useStyletron() - // const widthMap = React.useMemo(() => { - // return new Map() - // }, []) - const [widthMap, setWidthMap] = React.useState(new Map()) - const sampleSize = rows.length < MAX_SAMPLE_SIZE ? rows.length : MAX_SAMPLE_SIZE - // const finishedMeasurementCount = (sampleSize + 1) * columns.length - const sampleIndexes = React.useMemo(() => { + const sampleSize = rows.length < MAX_SAMPLE_SIZE ? rows.length : MAX_SAMPLE_SIZE + // const finishedMeasurementCount = (sampleSize + 1) * columns.length return generateSampleIndices(0, rows.length - 1, sampleSize) - }, [rows, sampleSize]) - - const oldColumns = usePrevious(columns) - - useEffect(() => { - const changed = columns.filter((c, index) => c.key !== oldColumns?.[index]?.key) - if (changed.length > 0) { - // console.log('changed', oldColumns, columns, changed) - setWidthMap(new Map()) - } - }, [oldColumns, columns, widthMap]) + }, [rows]) const handleDimensionsChange = React.useCallback( (columnIndex, dimensions) => { @@ -143,8 +121,6 @@ export default function MeasureColumnWidths({ const prevWidth = widthMap.get(columnIndex) ?? 0 if (nextWidth !== widthMap.get(columnIndex) && Math.abs(nextWidth - prevWidth) > 2) { - // console.log(columnIndex, dimensions.width, columns[columnIndex].minWidth, columns[columnIndex].maxWidth) - widthMap.set(columnIndex, nextWidth) // 1.Refresh at 100% of done @@ -158,38 +134,35 @@ export default function MeasureColumnWidths({ [columns, onWidthsChange, widthMap] ) - const hiddenStyle = css({ - position: 'absolute', - overflow: 'hidden', - height: 0, - }) - - const isEqual = React.useMemo(() => { - return _.isEqual(Array.from(widthMap.values()), widths) - }, [widthMap, widths]) - - // TODO fixme - // Remove the measurement nodes after we are done updating our column width - if (isEqual && widthMap.size === columns.length) { - // return null - } + const $columns = React.useMemo(() => { + return columns.map((column, i) => { + return ( + + ) + }) + }, [columns, rows, isSelectable, handleDimensionsChange, sampleIndexes]) return ( // eslint-disable-next-line jsx-a11y/role-supports-aria-props -
- {columns.map((column, i) => { - return ( - - ) +
+ {$columns}
) } diff --git a/console/src/components/data-table/stateful-container.tsx b/console/src/components/data-table/stateful-container.tsx index b24173155d..93d5f3d4d5 100644 --- a/console/src/components/data-table/stateful-container.tsx +++ b/console/src/components/data-table/stateful-container.tsx @@ -2,18 +2,14 @@ import * as React from 'react' import type { ColumnT, StatefulContainerPropsT } from './types' -const IS_DEV = true - function useDuplicateColumnTitleWarning(columns: ColumnT[]) { React.useEffect(() => { - if (IS_DEV) { - const titles = columns.reduce((set, column) => set.add(column.title), new Set()) - if (titles.size < columns.length) { - // eslint-disable-next-line - console.warn( - 'BaseWeb DataTable: Column titles must be unique else will result in non-deterministic filtering.' - ) - } + const titles = columns.reduce((set, column) => set.add(column.title), new Set()) + if (titles.size < columns.length) { + // eslint-disable-next-line + console.warn( + 'BaseWeb DataTable: Column titles must be unique else will result in non-deterministic filtering.' + ) } }, [columns]) } diff --git a/console/src/pages/Admin/AdminSidebar.tsx b/console/src/pages/Admin/AdminSidebar.tsx index 2d25ef8a93..a55bcaec15 100644 --- a/console/src/pages/Admin/AdminSidebar.tsx +++ b/console/src/pages/Admin/AdminSidebar.tsx @@ -22,7 +22,7 @@ export default function AdminSidebar({ style }: IComposedSidebarProps) { style={style} title={t('Admin Settings')} titleLink='/admin' - icon={} + icon={} /> ) } diff --git a/console/src/pages/BaseSubLayout.tsx b/console/src/pages/BaseSubLayout.tsx index 51a2945163..9ea46291ac 100644 --- a/console/src/pages/BaseSubLayout.tsx +++ b/console/src/pages/BaseSubLayout.tsx @@ -31,6 +31,9 @@ export default function BaseSubLayout({ style={{ paddingTop: 15, paddingBottom: 15, + flex: '1', + display: 'flex', + flexDirection: 'column', }} > {children} diff --git a/console/src/pages/Evaluation/EvaluationListCard.tsx b/console/src/pages/Evaluation/EvaluationListCard.tsx index 79317710bd..914a1b1315 100644 --- a/console/src/pages/Evaluation/EvaluationListCard.tsx +++ b/console/src/pages/Evaluation/EvaluationListCard.tsx @@ -26,16 +26,18 @@ import { useProject } from '@/domain/project/hooks/useProject' import { TextLink } from '@/components/Link' import { parseDecimal } from '@/utils' import { WithCurrentAuth } from '@/api/WithAuth' +import classNames from 'classnames' import EvaluationListCompare from './EvaluationListCompare' const gridLayout = [ // RIGHT: - '0px 10px 1fr', + '0px 40px 1fr', // MIDDLE: - '1fr 10px 1fr', + '1fr 40px 1fr', // LEFT: - '1fr 10px 0px', + '1fr 40px 0px', ] +const RESIZEBAR_WIDTH = 40 const page = { pageNum: 1, pageSize: 1000 } export default function EvaluationListCard() { const [css] = useStyletron() @@ -251,7 +253,7 @@ export default function EvaluationListCard() { gridRef.current!.style.gridTemplateColumns = `${Math.max( newWidth, 440 - )}px 10px minmax(400px, 1fr)` + )}px ${RESIZEBAR_WIDTH}px minmax(400px, 1fr)` } } }) @@ -339,125 +341,135 @@ export default function EvaluationListCard() { }, [evaluationViewConfig.isSuccess, evaluationViewConfig.data]) return ( -
+ + + } > - { - leftRef.current = ref - }} - title={t('Evaluations')} +
- - - } > - - - - setIsCreateJobOpen(false)} closeable animate autoFocus> - {t('create sth', [t('Job')])} - - - - - - {compareRows.length > 0 && ( - <> - {/* eslint-disable-next-line jsx-a11y/role-has-required-aria-props */} -
- handleResize(1)} - > - - - + +
+ + + {compareRows.length > 0 && ( + <> + {/* eslint-disable-next-line jsx-a11y/role-has-required-aria-props */} +
handleResize(-1)} + onMouseDown={handleResizeStart} > - handleResize(1)} + > + + + handleResize(-1)} + > + + +
+ + - - - - - - - )} - + + + )} + + setIsCreateJobOpen(false)} closeable animate autoFocus> + {t('create sth', [t('Job')])} + + + + + ) } diff --git a/console/src/pages/Evaluation/EvaluationListCompare.tsx b/console/src/pages/Evaluation/EvaluationListCompare.tsx index cf0371dea8..8721f13922 100644 --- a/console/src/pages/Evaluation/EvaluationListCompare.tsx +++ b/console/src/pages/Evaluation/EvaluationListCompare.tsx @@ -11,7 +11,8 @@ import IconFont from '@/components/IconFont' import { useEvaluationCompareStore } from '@/components/data-table/store' import { Checkbox } from 'baseui/checkbox' import { longestCommonSubstring } from '@/utils' -import { RecordListVO } from '../../domain/datastore/schemas/datastore' +import { RecordListVO } from '@/domain/datastore/schemas/datastore' +import { LabelSmall } from 'baseui/typography' type RowT = { key: string @@ -74,7 +75,9 @@ const StringCompareCell = ({ value, comparedValue, renderedValue, data }: CellT< export default function EvaluationListCompare({ rows = [], attrs, + title = '', }: { + title?: string rows: any[] attrs: RecordListVO['columnTypes'] }) { @@ -214,7 +217,7 @@ export default function EvaluationListCompare({ const rowLength = $rowsWithDiffOnly.length const data = props.value || {} // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { key, title, value, renderValue, renderCompare } = data + const { value, renderValue, renderCompare } = data const renderedValue = renderValue ? renderValue(value) : value const newProps = { value, @@ -224,7 +227,6 @@ export default function EvaluationListCompare({ } if (comparePinnedKey && conmparePinnedRowIndex === index) { - // console.log(props.y, rows.length, value) return (
+ + {title}{' '} + + {$columns.length} + + { diff --git a/console/src/pages/Evaluation/EvaluationOverviewLayout.tsx b/console/src/pages/Evaluation/EvaluationOverviewLayout.tsx index a4e52de4b5..e624897011 100644 --- a/console/src/pages/Evaluation/EvaluationOverviewLayout.tsx +++ b/console/src/pages/Evaluation/EvaluationOverviewLayout.tsx @@ -204,7 +204,7 @@ function EvaluationOverviewLayout({ children }: IJobLayoutProps) { return ( -
{children}
+
{children}
) } diff --git a/console/src/pages/Evaluation/EvaluationResults.tsx b/console/src/pages/Evaluation/EvaluationResults.tsx index 70e87538b0..ffbd2a59dc 100644 --- a/console/src/pages/Evaluation/EvaluationResults.tsx +++ b/console/src/pages/Evaluation/EvaluationResults.tsx @@ -49,6 +49,11 @@ function RocAuc({ fetch, name }: { fetch: any; name: string }) { function Summary({ fetch }: any) { const [t] = useTranslation() const record: Record = fetch?.data?.records?.[0] ?? {} + + if (fetch?.data?.records.length === 0) { + return + } + return (
diff --git a/console/src/pages/Job/JobDAG.tsx b/console/src/pages/Job/JobDAG.tsx index 2b617da8a5..99b365363a 100644 --- a/console/src/pages/Job/JobDAG.tsx +++ b/console/src/pages/Job/JobDAG.tsx @@ -45,7 +45,7 @@ function JobDAG() { } return ( - + ) diff --git a/console/src/pages/Project/ProjectListCard.tsx b/console/src/pages/Project/ProjectListCard.tsx index 836c81cb2c..73b791fe2d 100644 --- a/console/src/pages/Project/ProjectListCard.tsx +++ b/console/src/pages/Project/ProjectListCard.tsx @@ -45,7 +45,10 @@ const useCardStyles = createUseStyles({ 'textDecoration': 'none', 'color': ' rgba(2,16,43,0.60)', '&:hover': { - boxShadow: '0 2px 8px 0 rgba(0,0,0,0.20)', + 'boxShadow': '0 2px 8px 0 rgba(0,0,0,0.20)', + '& $actions': { + display: 'flex', + }, }, }, row: { @@ -122,6 +125,10 @@ const useCardStyles = createUseStyles({ color: '#1C4CAD ', }, }, + actions: { + display: 'none', + gap: '12px', + }, }) const ProjectCard = ({ project, onEdit, query }: IProjectCardProps) => { @@ -240,12 +247,7 @@ const ProjectCard = ({ project, onEdit, query }: IProjectCardProps) => {
-
+