1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-31 13:47:02 +02:00

feat: count segment changes (#4468)

This commit is contained in:
Mateusz Kwasniewski 2023-08-10 14:40:44 +02:00 committed by GitHub
parent 27c3c2393c
commit 84cbd669eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,14 @@ export const ChangeRequestTitleCell = ({
row: { original }, row: { original },
}: IChangeRequestTitleCellProps) => { }: IChangeRequestTitleCellProps) => {
const projectId = useRequiredPathParam('projectId'); const projectId = useRequiredPathParam('projectId');
const { id, title, features: changes } = original; const {
id,
title,
features: featureChanges,
segments: segmentChanges,
} = original;
const totalChanges =
(featureChanges || []).length + (segmentChanges || []).length;
const path = `/projects/${projectId}/change-requests/${id}`; const path = `/projects/${projectId}/change-requests/${id}`;
if (!value) { if (!value) {
@ -47,8 +54,7 @@ export const ChangeRequestTitleCell = ({
</Typography> </Typography>
</StyledLink> </StyledLink>
<span> <span>
{`${changes?.length}`}{' '} {`${totalChanges}`} {totalChanges <= 1 ? `update` : 'updates'}
{changes.length <= 1 ? `update` : 'updates'}
</span> </span>
</TextCell> </TextCell>
); );