feat(ui): Refactor DataObservabilityTab and SummaryCardV1 for improved styling and layout

This commit is contained in:
Shailesh Parmar 2025-09-22 16:07:23 +05:30
parent 9c5489fcb8
commit bb1f19cf84
6 changed files with 40 additions and 31 deletions

View File

@ -77,6 +77,7 @@ const DataObservabilityTab = (props: TableProfilerProps) => {
width: 'auto', width: 'auto',
display: 'inline-flex', display: 'inline-flex',
'.MuiTab-root': { '.MuiTab-root': {
color: theme.palette.grey['700'],
transition: 'background-color 0.2s ease-in, color 0.2s ease-in', transition: 'background-color 0.2s ease-in, color 0.2s ease-in',
borderRadius: '6px', borderRadius: '6px',
}, },
@ -88,11 +89,15 @@ const DataObservabilityTab = (props: TableProfilerProps) => {
backgroundColor: `${theme.palette.primary.main} !important`, backgroundColor: `${theme.palette.primary.main} !important`,
color: `${theme.palette.primary.contrastText} !important`, color: `${theme.palette.primary.contrastText} !important`,
}, },
'MuiTabs-root': {
minHeight: 'none',
},
'.MuiTabs-indicator': { '.MuiTabs-indicator': {
display: 'none', display: 'none',
}, },
'.MuiTabs-scroller': { '.MuiTabs-scroller': {
padding: '0 8px', padding: '4px',
height: '100%',
}, },
'.MuiTab-root:not(:first-of-type)': { '.MuiTab-root:not(:first-of-type)': {
marginLeft: '4px', marginLeft: '4px',

View File

@ -1,14 +0,0 @@
import Tab from '@mui/material/Tab';
import Tabs from '@mui/material/Tabs';
const TabComponent = ({ value, items, ...rest }) => {
return (
<Tabs value={value} variant="standard" {...rest}>
{items.map(({ label, key }) => (
<Tab key={key} label={label} value={key} />
))}
</Tabs>
);
};
export default TabComponent;

View File

@ -10,6 +10,6 @@
background-color: @white; background-color: @white;
.data-observability-content-panel { .data-observability-content-panel {
margin-top: @margin-mlg; margin-top: 30px;
} }
} }

View File

@ -1,19 +1,21 @@
@import (reference) url('../../../../../styles/variables.less');
.no-profiler-banner-container { .no-profiler-banner-container {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 16px; gap: 16px;
border-radius: 10px; border-radius: 10px;
background: #fafafc; background: @grey-50;
padding: 16px; padding: 16px;
.profiler-description { .profiler-description {
color: #364254; color: @grey-700;
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
} }
.profiler-title { .profiler-title {
color: #21263c; color: @grey-900;
font-size: 14px; font-size: 14px;
font-weight: 600; font-weight: 600;
} }

View File

@ -11,8 +11,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { Grid } from '@mui/material'; import { Grid, Stack } from '@mui/material';
import { Col, Row } from 'antd'; import { Col } from 'antd';
import { AxiosError } from 'axios'; import { AxiosError } from 'axios';
import { pick } from 'lodash'; import { pick } from 'lodash';
import { DateRangeObject } from 'Models'; import { DateRangeObject } from 'Models';
@ -216,7 +216,7 @@ const TableProfilerChart = ({
} }
return ( return (
<Row data-testid="table-profiler-chart-container" gutter={[16, 16]}> <Stack data-testid="table-profiler-chart-container" spacing="30px">
{showHeader && ( {showHeader && (
<> <>
{!isSummaryLoading && !isProfilingEnabled && ( {!isSummaryLoading && !isProfilingEnabled && (
@ -277,7 +277,7 @@ const TableProfilerChart = ({
isLoading={isTableProfilerLoading || isSummaryLoading} isLoading={isTableProfilerLoading || isSummaryLoading}
/> />
</Col> </Col>
</Row> </Stack>
); );
}; };

View File

@ -1,4 +1,4 @@
import { Box, Card, Skeleton, Typography } from '@mui/material'; import { Box, Card, Skeleton, Typography, useTheme } from '@mui/material';
import { ReactNode } from 'react'; import { ReactNode } from 'react';
import { ReactComponent as AddItemIcon } from '../../../assets/svg/add-item-icon.svg'; import { ReactComponent as AddItemIcon } from '../../../assets/svg/add-item-icon.svg';
@ -15,8 +15,10 @@ const SummaryCardV1 = ({
icon?: SvgComponent; icon?: SvgComponent;
extra?: ReactNode; extra?: ReactNode;
}) => { }) => {
const theme = useTheme();
if (isLoading) { if (isLoading) {
return <Skeleton height={120} variant="rounded" width={210} />; return <Skeleton height={100} variant="rounded" width={210} />;
} }
const Icon = icon ?? AddItemIcon; const Icon = icon ?? AddItemIcon;
@ -32,18 +34,27 @@ const SummaryCardV1 = ({
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
gap: 3, gap: 3,
p: '20px', p: '16px 20px',
width: '100%', width: '100%',
}} }}
variant="outlined"> variant="outlined">
<Icon height={40} width={40} /> <Icon height={40} width={40} />
<Box> <Box>
<Typography sx={{ fontSize: '18px', fontWeight: 600 }} variant="h6"> <Typography
sx={{
color: theme.palette.grey[900],
fontSize: '18px',
fontWeight: 600,
}}
variant="h6">
{value} {value}
</Typography> </Typography>
<Typography <Typography
color="text.secondary" sx={{
sx={{ fontSize: '14px', fontWeight: 500 }}> fontSize: '14px',
fontWeight: 500,
color: theme.palette.grey[700],
}}>
{title} {title}
</Typography> </Typography>
</Box> </Box>
@ -55,12 +66,17 @@ const SummaryCardV1 = ({
mx: 2, mx: 2,
px: 2, px: 2,
py: 1, py: 1,
background: '#F8F9FC', background: theme.palette.allShades.blueGray[50],
borderRadius: '0 0 12px 12px', borderRadius: '0 0 12px 12px',
boxShadow: '0 4px 3px 0 rgba(235, 239, 250, 0.10)', boxShadow: '0 4px 3px 0 rgba(235, 239, 250, 0.10)',
border: 'none', border: 'none',
}}> }}>
<Typography sx={{ fontSize: 10, fontWeight: 500 }}> <Typography
sx={{
fontSize: 10,
color: theme.palette.grey[900],
fontWeight: theme.typography.fontWeightMedium,
}}>
{extra} {extra}
</Typography> </Typography>
</Box> </Box>