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( const columns = useMemo(
() => [ () => [
{ columnHelper.accessor('id', {
id: 'Title', id: 'Title',
header: 'Title', header: 'Title',
meta: { width: '300px' }, meta: { width: '300px' },
cell: ({ row }) => ( cell: GlobalChangeRequestTitleCell,
<GlobalChangeRequestTitleCell {...row.original} /> }),
),
},
columnHelper.accessor('features', { columnHelper.accessor('features', {
id: 'Updated feature flags', id: 'Updated feature flags',
header: '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 { useProjectOverviewNameOrId } from 'hooks/api/getters/useProjectOverview/useProjectOverview';
import { Truncator } from 'component/common/Truncator/Truncator'; import { Truncator } from 'component/common/Truncator/Truncator';
import type { ChangeRequestSearchItemSchema } from 'openapi'; import type { ChangeRequestSearchItemSchema } from 'openapi';
import type { Row } from '@tanstack/react-table';
const LinkContainer = styled('div')(({ theme }) => ({ const LinkContainer = styled('div')(({ theme }) => ({
color: theme.palette.text.secondary, color: theme.palette.text.secondary,
@ -34,13 +35,21 @@ const UpdateText = styled(Typography)(({ theme }) => ({
fontSize: theme.typography.body2.fontSize, fontSize: theme.typography.body2.fontSize,
})); }));
type GlobalChangeRequestTitleCellProps = {
row: Row<ChangeRequestSearchItemSchema>;
};
export const GlobalChangeRequestTitleCell = ({ export const GlobalChangeRequestTitleCell = ({
id, row: {
title, original: {
project, id,
features: featureChanges, title,
segments: segmentChanges, project,
}: ChangeRequestSearchItemSchema) => { features: featureChanges,
segments: segmentChanges,
},
},
}: GlobalChangeRequestTitleCellProps) => {
const projectName = useProjectOverviewNameOrId(project); const projectName = useProjectOverviewNameOrId(project);
const totalChanges = const totalChanges =
featureChanges?.length ?? 0 + segmentChanges?.length ?? 0; featureChanges?.length ?? 0 + segmentChanges?.length ?? 0;