1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-23 00:22:19 +01:00

fix: bad segment edit link (#6390)

## About the changes
Fixes a bad link which leads to editing a global segment from project
settings mimicking
67928209ef/frontend/src/component/segments/EditSegmentButton/EditSegmentButton.tsx (L22-L28)
This commit is contained in:
Gastón Fournier 2024-02-29 13:54:31 +01:00 committed by GitHub
parent b4a8b0f780
commit 4f638a1c8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -57,7 +57,7 @@ export const SegmentTable = () => {
return segments;
}, [segments, projectId]);
const columns = useMemo(() => getColumns(), []);
const columns = useMemo(() => getColumns(projectId), [projectId]);
const {
getTableProps,
getTableBodyProps,
@ -172,7 +172,7 @@ export const SegmentTable = () => {
);
};
const getColumns = () => [
const getColumns = (projectId?: string) => [
{
id: 'Icon',
width: '1%',
@ -191,7 +191,11 @@ const getColumns = () => [
}: any) => (
<LinkCell
title={name}
to={`/segments/edit/${id}`}
to={
projectId
? `/projects/${projectId}/settings/segments/edit/${id}`
: `/segments/edit/${id}`
}
subtitle={description}
/>
),