World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
Java ai-catalogdata-catalogdatalakefederated-querylakehousemetadatametalakemodel-catalogopendatacatalogskycomputingstratosphere
[#1709] fix(web): fix long text displays (#1778)
CHEYNE60c02ebdd5b8
diff --git a/web/app/ui/MetalakeList.js b/web/app/ui/MetalakeList.jsindex d8b571de5d..532a86ff6f 100644--- a/web/app/ui/MetalakeList.js+++ b/web/app/ui/MetalakeList.js@@ -17,7 +17,7 @@ import { fetchMetalakes, setFilteredMetalakes, deleteMetalake, updateMetalake }import { formatToDateTime } from '@/lib/utils/date'import TableHeader from './TableHeader'-import DetailsDrawer from './DetailsDrawer'+import DetailsDrawer from '@/components/DetailsDrawer'import CreateMetalakeDialog from './CreateMetalakeDialog'import ConfirmDeleteDialog from '@/components/ConfirmDeleteDialog'diff --git a/web/app/ui/metalakes/DetailsDrawer.js b/web/app/ui/metalakes/DetailsDrawer.jsdeleted file mode 100644index e6f006f2f3..0000000000--- a/web/app/ui/metalakes/DetailsDrawer.js+++ /dev/null@@ -1,176 +0,0 @@-/*- * Copyright 2024 Datastrato Pvt Ltd.- * This software is licensed under the Apache License version 2.- */--import { useEffect, useState } from 'react'--import {- Box,- Grid,- Drawer,- IconButton,- Typography,- Table,- TableHead,- TableBody,- TableRow,- TableCell,- TableContainer-} from '@mui/material'--import Icon from '@/components/Icon'--import EmptyText from '@/components/EmptyText'--import { formatToDateTime, isValidDate } from '@/lib/utils/date'--const DetailsDrawer = props => {- const { openDrawer, setOpenDrawer, drawerData = {} } = props-- const { audit = {} } = drawerData-- const [properties, setProperties] = useState([])-- const handleClose = () => {- setOpenDrawer(false)- }-- const renderFieldText = (value, linkBreak = false) => {- if (!value) {- return <EmptyText />- }-- return (- <Typography sx={{ fontWeight: 500, whiteSpace: linkBreak ? 'pre-wrap' : 'normal' }}>- {isValidDate(value) ? formatToDateTime(value) : value}- </Typography>- )- }-- useEffect(() => {- if (drawerData.properties) {- const propsData = Object.keys(drawerData.properties).map(item => {- return {- key: item,- value: drawerData.properties[item]- }- })-- setProperties(propsData)- }- }, [drawerData])-- return (- <Drawer- open={openDrawer}- anchor='right'- variant='temporary'- onClose={handleClose}- ModalProps={{ keepMounted: true }}- PaperProps={{- sx: {- width: {- xs: 300,- sm: 400- }- }- }}- >- <Box- className={'drawer-header twc-flex twc-items-center twc-justify-between'}- sx={{- p: theme => theme.spacing(3, 4),- borderBottom: theme => `1px solid ${theme.palette.divider}`,- backgroundColor: theme => theme.palette.background.default- }}- >- <Typography variant='h6'>Details</Typography>- <IconButton size='small' onClick={handleClose} sx={{ color: 'text.primary' }}>- <Icon icon='bx:x' fontSize={20} />- </IconButton>- </Box>- <Box sx={{ p: 4 }}>- <Grid item xs={12} sx={{ mb: [0, 5] }}>- <Typography- variant='subtitle1'- className={'twc-py-2 twc-font-semibold twc-text-[1.2rem]'}- sx={{- borderBottom: theme => `1px solid ${theme.palette.divider}`- }}- >- {drawerData.name}- </Typography>- </Grid>-- <Grid item xs={12} sx={{ mb: [0, 5] }}>- <Typography variant='body2' sx={{ mb: 2 }}>- Comment- </Typography>- {renderFieldText(drawerData.comment, true)}- </Grid>-- <Grid item xs={12} sx={{ mb: [0, 5] }}>- <Typography variant='body2' sx={{ mb: 2 }}>- Created by- </Typography>- {renderFieldText(audit.creator)}- </Grid>-- <Grid item xs={12} sx={{ mb: [0, 5] }}>- <Typography variant='body2' sx={{ mb: 2 }}>- Created at- </Typography>- {renderFieldText(audit.createTime)}- </Grid>-- <Grid item xs={12} sx={{ mb: [0, 5] }}>- <Typography variant='body2' sx={{ mb: 2 }}>- Last modified by- </Typography>- {renderFieldText(audit.lastModifier)}- </Grid>-- <Grid item xs={12} sx={{ mb: [0, 5] }}>- <Typography variant='body2' sx={{ mb: 2 }}>- Last modified at- </Typography>- {renderFieldText(audit.lastModifiedTime)}- </Grid>-- <Grid item xs={12} sx={{ mb: [0, 5] }}>- <Typography variant='body2' sx={{ mb: 2 }}>- Properties- </Typography>-- <TableContainer>- <Table>- <TableHead- sx={{- backgroundColor: theme => theme.palette.action.hover- }}- >- <TableRow>- <TableCell sx={{ py: 2 }}>Key</TableCell>- <TableCell sx={{ py: 2 }}>Value</TableCell>- </TableRow>- </TableHead>- <TableBody>- {properties.map((item, index) => {- return (- <TableRow key={index}>- <TableCell className={'twc-py-[0.7rem]'}>{item.key}</TableCell>- <TableCell className={'twc-py-[0.7rem]'}>{item.value}</TableCell>- </TableRow>- )- })}- </TableBody>- </Table>- </TableContainer>- </Grid>- </Box>- </Drawer>- )-}--export default DetailsDrawerdiff --git a/web/app/ui/metalakes/DetailsView.js b/web/app/ui/metalakes/DetailsView.jsindex 3c9f764ca5..92e8085023 100644--- a/web/app/ui/metalakes/DetailsView.js+++ b/web/app/ui/metalakes/DetailsView.js@@ -29,7 +29,7 @@ const DetailsView = props => {}return (- <Typography sx={{ fontWeight: 500, whiteSpace: linkBreak ? 'pre-wrap' : 'normal' }}>+ <Typography sx={{ fontWeight: 500, wordBreak: 'break-all', whiteSpace: linkBreak ? 'pre-wrap' : 'normal' }}>{isValidDate(value) ? formatToDateTime(value) : value}</Typography>)diff --git a/web/app/ui/metalakes/TableView.js b/web/app/ui/metalakes/TableView.jsindex f87aa59ef8..a8b0e3c2be 100644--- a/web/app/ui/metalakes/TableView.js+++ b/web/app/ui/metalakes/TableView.js@@ -12,7 +12,7 @@ import { DataGrid } from '@mui/x-data-grid'import Icon from '@/components/Icon'import ColumnTypeChip from '@/components/ColumnTypeChip'-import DetailsDrawer from '../DetailsDrawer'+import DetailsDrawer from '@/components/DetailsDrawer'import ConfirmDeleteDialog from '@/components/ConfirmDeleteDialog'import CreateCatalogDialog from './CreateCatalogDialog'@@ -336,7 +336,7 @@ const TableView = props => {paginationModel={paginationModel}onPaginationModelChange={setPaginationModel}/>- <DetailsDrawer openDrawer={openDrawer} setOpenDrawer={setOpenDrawer} drawerData={drawerData} />+ <DetailsDrawer openDrawer={openDrawer} setOpenDrawer={setOpenDrawer} drawerData={drawerData} page={page} /><ConfirmDeleteDialogopen={openConfirmDelete}setOpen={setOpenConfirmDelete}diff --git a/web/app/ui/DetailsDrawer.js b/web/components/DetailsDrawer.jssimilarity index 71%rename from web/app/ui/DetailsDrawer.jsrename to web/components/DetailsDrawer.jsindex 9f68e1e79b..4606b19071 100644--- a/web/app/ui/DetailsDrawer.js+++ b/web/components/DetailsDrawer.js@@ -16,7 +16,8 @@ import {TableBody,TableRow,TableCell,- TableContainer+ TableContainer,+ Tooltip} from '@mui/material'import Icon from '@/components/Icon'@@ -26,7 +27,7 @@ import EmptyText from '@/components/EmptyText'import { formatToDateTime, isValidDate } from '@/lib/utils/date'const DetailsDrawer = props => {- const { openDrawer, setOpenDrawer, drawerData = {} } = props+ const { openDrawer, setOpenDrawer, drawerData = {}, page } = propsconst { audit = {} } = drawerData@@ -42,22 +43,26 @@ const DetailsDrawer = props => {}return (- <Typography sx={{ fontWeight: 500, whiteSpace: linkBreak ? 'pre-wrap' : 'normal' }}>+ <Typography sx={{ fontWeight: 500, wordBreak: 'break-all', whiteSpace: linkBreak ? 'pre-wrap' : 'normal' }}>{isValidDate(value) ? formatToDateTime(value) : value}</Typography>)}useEffect(() => {- if (drawerData.properties) {- const propsData = Object.keys(drawerData.properties).map(item => {- return {- key: item,- value: drawerData.properties[item]- }- })+ if (JSON.stringify(drawerData) !== '{}') {+ if (drawerData.properties) {+ const propsData = Object.keys(drawerData.properties).map(item => {+ return {+ key: item,+ value: drawerData.properties[item]+ }+ })- setProperties(propsData)+ setProperties(propsData)+ } else {+ setProperties([])+ }}}, [drawerData])@@ -92,17 +97,38 @@ const DetailsDrawer = props => {</Box><Box sx={{ p: 4 }}><Grid item xs={12} sx={{ mb: [0, 5] }}>- <Typography- variant='subtitle1'- className={'twc-py-2 twc-font-semibold twc-text-[1.2rem]'}- sx={{- borderBottom: theme => `1px solid ${theme.palette.divider}`- }}- >- {drawerData.name}- </Typography>+ <Tooltip title={drawerData.name} placement='bottom-start'>+ <Typography+ variant='subtitle1'+ className={+ 'twc-py-2 twc-font-semibold twc-text-[1.2rem] twc-w-full twc-overflow-hidden twc-text-ellipsis'+ }+ sx={{+ borderBottom: theme => `1px solid ${theme.palette.divider}`+ }}+ >+ {drawerData.name}+ </Typography>+ </Tooltip></Grid>+ {page && page === 'metalakes' ? (+ <>+ <Grid item xs={12} md={6} sx={{ mb: [0, 5] }}>+ <Typography variant='body2' sx={{ mb: 2 }}>+ Type+ </Typography>+ {renderFieldText(drawerData.type)}+ </Grid>+ <Grid item xs={12} md={6} sx={{ mb: [0, 5] }}>+ <Typography variant='body2' sx={{ mb: 2 }}>+ Provider+ </Typography>+ {renderFieldText(drawerData.provider)}+ </Grid>+ </>+ ) : null}+<Grid item xs={12} sx={{ mb: [0, 5] }}><Typography variant='body2' sx={{ mb: 2 }}>Comment