1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00

fix: dot in context fields (#4434)

This commit is contained in:
Mateusz Kwasniewski 2023-08-07 13:53:22 +02:00 committed by GitHub
parent 168b31a353
commit 1fe32e0b96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -40,7 +40,9 @@ export const PlaygroundEnvironmentDiffTable = ({
const contextFieldsHeaders = Object.keys(firstContext).map( const contextFieldsHeaders = Object.keys(firstContext).map(
contextField => ({ contextField => ({
Header: capitalizeFirst(contextField), Header: capitalizeFirst(contextField),
accessor: `${environments[0]}.context.${contextField}`, accessor: (
row: Record<string, { context: Record<string, unknown> }>
) => row[environments[0]]['context'][contextField],
minWidth: 160, minWidth: 160,
Cell: HighlightCell, Cell: HighlightCell,
}) })

View File

@ -33,7 +33,8 @@ export const PlaygroundEnvironmentTable = ({
const dynamicHeaders = Object.keys(features[0].context).map( const dynamicHeaders = Object.keys(features[0].context).map(
contextField => ({ contextField => ({
Header: capitalizeFirst(contextField), Header: capitalizeFirst(contextField),
accessor: `context.${contextField}`, accessor: (row: { context: Record<string, unknown> }) =>
row['context'][contextField],
minWidth: 160, minWidth: 160,
Cell: HighlightCell, Cell: HighlightCell,
}) })