1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01: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 },
}: IChangeRequestTitleCellProps) => {
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}`;
if (!value) {
@ -47,8 +54,7 @@ export const ChangeRequestTitleCell = ({
</Typography>
</StyledLink>
<span>
{`${changes?.length}`}{' '}
{changes.length <= 1 ? `update` : 'updates'}
{`${totalChanges}`} {totalChanges <= 1 ? `update` : 'updates'}
</span>
</TextCell>
);