Skip to content

Commit

Permalink
feat: count segment changes (#4468)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Aug 10, 2023
1 parent 27c3c23 commit 84cbd66
Showing 1 changed file with 9 additions and 3 deletions.
Expand Up @@ -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) {
Expand Down Expand Up @@ -47,8 +54,7 @@ export const ChangeRequestTitleCell = ({
</Typography>
</StyledLink>
<span>
{`${changes?.length}`}{' '}
{changes.length <= 1 ? `update` : 'updates'}
{`${totalChanges}`} {totalChanges <= 1 ? `update` : 'updates'}
</span>
</TextCell>
);
Expand Down

0 comments on commit 84cbd66

Please sign in to comment.