fix: dropdown text and overflow fix for CVE Card
Signed-off-by: Raul Kele <raulkeleblk@gmail.com>
This commit is contained in:
parent
cdd1f97c52
commit
847c9d1e6d
@ -456,7 +456,7 @@ describe('Vulnerabilties page', () => {
|
|||||||
jest.spyOn(api, 'get').mockResolvedValue({ status: 200, data: { data: mockCVEList } });
|
jest.spyOn(api, 'get').mockResolvedValue({ status: 200, data: { data: mockCVEList } });
|
||||||
render(<StateVulnerabilitiesWrapper />);
|
render(<StateVulnerabilitiesWrapper />);
|
||||||
await waitFor(() => expect(screen.getAllByText('Vulnerabilities')).toHaveLength(1));
|
await waitFor(() => expect(screen.getAllByText('Vulnerabilities')).toHaveLength(1));
|
||||||
await waitFor(() => expect(screen.getAllByText(/see fix tags/i)).toHaveLength(20));
|
await waitFor(() => expect(screen.getAllByText(/fixed in/i)).toHaveLength(20));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders no vulnerabilities if there are not any', async () => {
|
it('renders no vulnerabilities if there are not any', async () => {
|
||||||
@ -473,11 +473,16 @@ describe('Vulnerabilties page', () => {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
jest.spyOn(api, 'get').mockResolvedValue({ status: 200, data: { data: mockCVEList } });
|
jest.spyOn(api, 'get').mockResolvedValue({ status: 200, data: { data: mockCVEList } });
|
||||||
render(<StateVulnerabilitiesWrapper />);
|
render(<StateVulnerabilitiesWrapper />);
|
||||||
await waitFor(() => expect(screen.getAllByText(/see description/i)).toHaveLength(20));
|
await waitFor(() => expect(screen.getAllByText(/description/i)).toHaveLength(20));
|
||||||
const openText = screen.getAllByText(/see description/i);
|
const openText = screen.getAllByText(/description/i);
|
||||||
fireEvent.click(openText[0]);
|
fireEvent.click(openText[0]);
|
||||||
await waitFor(() => expect(screen.getAllByText(/hide description/i)).toHaveLength(1));
|
await waitFor(() =>
|
||||||
await waitFor(() => expect(screen.getAllByText(/see description/i)).toHaveLength(19));
|
expect(screen.getAllByText(/CPAN 2.28 allows Signature Verification Bypass./i)).toHaveLength(1)
|
||||||
|
);
|
||||||
|
fireEvent.click(openText[0]);
|
||||||
|
await waitFor(() =>
|
||||||
|
expect(screen.queryByText(/CPAN 2.28 allows Signature Verification Bypass./i)).not.toBeInTheDocument()
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should log an error when data can't be fetched", async () => {
|
it("should log an error when data can't be fetched", async () => {
|
||||||
@ -497,7 +502,7 @@ describe('Vulnerabilties page', () => {
|
|||||||
.mockResolvedValue({ status: 200, data: { data: mockCVEFixed } });
|
.mockResolvedValue({ status: 200, data: { data: mockCVEFixed } });
|
||||||
render(<StateVulnerabilitiesWrapper />);
|
render(<StateVulnerabilitiesWrapper />);
|
||||||
await waitFor(() => expect(screen.getAllByText('Vulnerabilities')).toHaveLength(1));
|
await waitFor(() => expect(screen.getAllByText('Vulnerabilities')).toHaveLength(1));
|
||||||
fireEvent.click(screen.getAllByText(/see fix tags/i)[0]);
|
fireEvent.click(screen.getAllByText(/fixed in/i)[0]);
|
||||||
await waitFor(() => expect(screen.getByText('1.0.16')).toBeInTheDocument());
|
await waitFor(() => expect(screen.getByText('1.0.16')).toBeInTheDocument());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -175,7 +175,7 @@ function HistoryLayers(props) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<>
|
||||||
<Typography
|
<Typography
|
||||||
variant="h4"
|
variant="h4"
|
||||||
gutterBottom
|
gutterBottom
|
||||||
@ -214,7 +214,7 @@ function HistoryLayers(props) {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{!isLoaded ? <Loading /> : renderHistoryData()}
|
{!isLoaded ? <Loading /> : renderHistoryData()}
|
||||||
</div>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ import PestControlIcon from '@mui/icons-material/PestControl';
|
|||||||
import { isEmpty } from 'lodash';
|
import { isEmpty } from 'lodash';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import Loading from './Loading';
|
import Loading from './Loading';
|
||||||
|
import { KeyboardArrowDown, KeyboardArrowRight } from '@mui/icons-material';
|
||||||
|
|
||||||
const useStyles = makeStyles(() => ({
|
const useStyles = makeStyles(() => ({
|
||||||
card: {
|
card: {
|
||||||
@ -67,6 +68,18 @@ const useStyles = makeStyles(() => ({
|
|||||||
color: '#52637A',
|
color: '#52637A',
|
||||||
fontSize: '1.4rem',
|
fontSize: '1.4rem',
|
||||||
fontWeight: '600'
|
fontWeight: '600'
|
||||||
|
},
|
||||||
|
dropdown: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center'
|
||||||
|
},
|
||||||
|
dropdownText: {
|
||||||
|
color: '#1479FF',
|
||||||
|
paddingTop: '1rem',
|
||||||
|
fontSize: '1rem',
|
||||||
|
fontWeight: '600',
|
||||||
|
cursor: 'pointer',
|
||||||
|
textAlign: 'center'
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -219,38 +232,30 @@ function VulnerabilitiyCard(props) {
|
|||||||
{cve.Title}
|
{cve.Title}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Typography
|
<Stack className={classes.dropdown} onClick={() => setOpenFixed(!openFixed)}>
|
||||||
sx={{
|
{!openFixed ? (
|
||||||
color: '#1479FF',
|
<KeyboardArrowRight className={classes.dropdownText} />
|
||||||
paddingTop: '1rem',
|
) : (
|
||||||
fontSize: '0.8125rem',
|
<KeyboardArrowDown className={classes.dropdownText} />
|
||||||
fontWeight: '600',
|
)}
|
||||||
cursor: 'pointer'
|
<Typography className={classes.dropdownText}>Fixed in</Typography>
|
||||||
}}
|
</Stack>
|
||||||
onClick={() => setOpenFixed(!openFixed)}
|
|
||||||
>
|
|
||||||
{!openFixed ? 'See fix tags' : 'Hide fix tags'}
|
|
||||||
</Typography>
|
|
||||||
<Collapse in={openFixed} timeout="auto" unmountOnExit>
|
<Collapse in={openFixed} timeout="auto" unmountOnExit>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography variant="body2" align="left" sx={{ color: '#0F2139', fontSize: '1rem' }}>
|
<Typography variant="body2" align="left" sx={{ color: '#0F2139', fontSize: '1rem', width: '100%' }}>
|
||||||
{' '}
|
{' '}
|
||||||
{loadingFixed ? 'Loading...' : renderFixedVer()}{' '}
|
{loadingFixed ? 'Loading...' : renderFixedVer()}{' '}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
<Typography
|
<Stack className={classes.dropdown} onClick={() => setOpenDesc(!openDesc)}>
|
||||||
sx={{
|
{!openDesc ? (
|
||||||
color: '#1479FF',
|
<KeyboardArrowRight className={classes.dropdownText} />
|
||||||
paddingTop: '1rem',
|
) : (
|
||||||
fontSize: '0.8125rem',
|
<KeyboardArrowDown className={classes.dropdownText} />
|
||||||
fontWeight: '600',
|
)}
|
||||||
cursor: 'pointer'
|
<Typography className={classes.dropdownText}>Description</Typography>
|
||||||
}}
|
</Stack>
|
||||||
onClick={() => setOpenDesc(!openDesc)}
|
|
||||||
>
|
|
||||||
{!openDesc ? 'See description' : 'Hide description'}
|
|
||||||
</Typography>
|
|
||||||
<Collapse in={openDesc} timeout="auto" unmountOnExit>
|
<Collapse in={openDesc} timeout="auto" unmountOnExit>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography variant="body2" align="left" sx={{ color: '#0F2139', fontSize: '1rem' }}>
|
<Typography variant="body2" align="left" sx={{ color: '#0F2139', fontSize: '1rem' }}>
|
||||||
@ -312,7 +317,7 @@ function VulnerabilitiesDetails(props) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<>
|
||||||
<Typography
|
<Typography
|
||||||
variant="h4"
|
variant="h4"
|
||||||
gutterBottom
|
gutterBottom
|
||||||
@ -344,7 +349,7 @@ function VulnerabilitiesDetails(props) {
|
|||||||
cveData?.cveList
|
cveData?.cveList
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
</div>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user