Skip to content

Commit

Permalink
fix: Set column label in feature grid through customizeAttribute (#10638
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jdugh authored Jan 17, 2025
1 parent 1219910 commit 4e4dabc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions web/client/reducers/__tests__/featuregrid-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ describe('Test the featuregrid reducer', () => {
expect(state.attributes.attrA.test).toBe(false);
state = featuregrid( state, customizeAttribute("attrA", "test", "value"));
expect(state.attributes.attrA.test).toBe("value");
state = featuregrid( state, customizeAttribute("attrA", 'label', "label title"));
expect(state.attributes.attrA.label).toBe("label title");
});
it('startDrawingFeature', () => {
let state = featuregrid( {drawing: true}, startDrawingFeature());
Expand Down
4 changes: 2 additions & 2 deletions web/client/utils/FeatureGridUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ export const featureTypeToGridColumns = (
sortable,
key: desc.name,
width: columnSettings[desc.name] && columnSettings[desc.name].width || (defaultSize ? defaultSize : undefined),
name: columnSettings[desc.name] && columnSettings[desc.name].label || desc.name,
name: desc.name,
description: option?.description || '',
title: applyDefaultToLocalizedString(option?.title || field?.alias, desc.name),
title: applyDefaultToLocalizedString(option?.title || field?.alias, columnSettings[desc.name] && columnSettings[desc.name].label || desc.name),
headerRenderer: getHeaderRenderer(),
showTitleTooltip: !!option?.description,
resizable,
Expand Down

0 comments on commit 4e4dabc

Please sign in to comment.