File tree 3 files changed +20
-4
lines changed
map/src/components/EditorPanel/components
3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export type DataTableProps = {
34
34
defaultSortBy ?: string
35
35
displayGeoName ?: ( row : string ) => string
36
36
expandDataTable : boolean
37
- formatLegendLocation ?: ( row : string ) => string
37
+ formatLegendLocation ?: ( row : string , runtimeLookup : string ) => string
38
38
groupBy ?: string
39
39
headerColor ?: string
40
40
imageRef ?: string
@@ -247,9 +247,14 @@ const DataTable = (props: DataTableProps) => {
247
247
const csvData = config . table ?. downloadVisibleDataOnly ? visibleData : rawData
248
248
249
249
// only use fullGeoName on County maps and no other
250
- if ( config . general ?. geoType === 'us-county' ) {
250
+ if ( config . general ?. geoType === 'us-county' || config . table . showFullGeoNameInCSV ) {
251
251
// Add column for full Geo name along with State
252
- return csvData . map ( row => ( { FullGeoName : formatLegendLocation ( row [ config . columns . geo . name ] ) , ...row } ) )
252
+ return csvData . map ( row => {
253
+ return {
254
+ FullGeoName : formatLegendLocation ( row [ config . columns . geo . name ] ) ,
255
+ ...row
256
+ }
257
+ } )
253
258
} else {
254
259
return csvData
255
260
}
Original file line number Diff line number Diff line change @@ -19,10 +19,21 @@ export const makeChartLegendsUnified = config => {
19
19
}
20
20
}
21
21
22
+ const migrateTableGeneralSettings = config => {
23
+ if ( config . type === 'map' ) {
24
+ if ( config . general . showFullGeoNameInCSV ) {
25
+ config . table . showFullGeoNameInCSV = config . general . showFullGeoNameInCSV
26
+ }
27
+ delete config . general . showFullGeoNameInCSV
28
+ return config
29
+ }
30
+ }
31
+
22
32
const update_4_25_4 = config => {
23
33
const ver = '4.25.4'
24
34
const newConfig = _ . cloneDeep ( config )
25
35
makeChartLegendsUnified ( newConfig )
36
+ migrateTableGeneralSettings ( newConfig )
26
37
newConfig . version = ver
27
38
return newConfig
28
39
}
Original file line number Diff line number Diff line change @@ -2854,7 +2854,7 @@ const EditorPanel = () => {
2854
2854
< label className = 'checkbox' >
2855
2855
< input
2856
2856
type = 'checkbox'
2857
- checked = { state . general . showFullGeoNameInCSV }
2857
+ checked = { state . table . showFullGeoNameInCSV }
2858
2858
onChange = { event => {
2859
2859
handleEditorChanges ( 'toggleShowFullGeoNameInCSV' , event . target . checked )
2860
2860
} }
You can’t perform that action at this time.
0 commit comments