1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-10-27 11:02:16 +01:00

comments from PR review

This commit is contained in:
Thomas Heartman 2025-10-23 09:51:26 +02:00
parent 6becea2842
commit 7505c3cde1
No known key found for this signature in database
GPG Key ID: BD1F880DAED1EE78
2 changed files with 18 additions and 11 deletions

View File

@ -102,14 +102,12 @@ const ChangeRequestsInner = () => {
const columns = useMemo(
() => [
{
columnHelper.accessor('id', {
id: 'Title',
header: 'Title',
meta: { width: '300px' },
cell: ({ row }) => (
<GlobalChangeRequestTitleCell {...row.original} />
),
},
cell: GlobalChangeRequestTitleCell,
}),
columnHelper.accessor('features', {
id: 'Updated feature flags',
header: 'Updated feature flags',

View File

@ -4,6 +4,7 @@ import { Link as RouterLink, type LinkProps } from 'react-router-dom';
import { useProjectOverviewNameOrId } from 'hooks/api/getters/useProjectOverview/useProjectOverview';
import { Truncator } from 'component/common/Truncator/Truncator';
import type { ChangeRequestSearchItemSchema } from 'openapi';
import type { Row } from '@tanstack/react-table';
const LinkContainer = styled('div')(({ theme }) => ({
color: theme.palette.text.secondary,
@ -34,13 +35,21 @@ const UpdateText = styled(Typography)(({ theme }) => ({
fontSize: theme.typography.body2.fontSize,
}));
type GlobalChangeRequestTitleCellProps = {
row: Row<ChangeRequestSearchItemSchema>;
};
export const GlobalChangeRequestTitleCell = ({
id,
title,
project,
features: featureChanges,
segments: segmentChanges,
}: ChangeRequestSearchItemSchema) => {
row: {
original: {
id,
title,
project,
features: featureChanges,
segments: segmentChanges,
},
},
}: GlobalChangeRequestTitleCellProps) => {
const projectName = useProjectOverviewNameOrId(project);
const totalChanges =
featureChanges?.length ?? 0 + segmentChanges?.length ?? 0;