Skip to content

Commit b34ed7d

Browse files
committed
ALDASH-454 Enhance D3 Map tooltip help text
1 parent 538ca6b commit b34ed7d

1 file changed

Lines changed: 9 additions & 20 deletions

File tree

  • plugins/wp-react-blocks-plugin/blocks/d3Map/layers

plugins/wp-react-blocks-plugin/blocks/d3Map/layers/Data.jsx

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ export class DataLayerSetting extends Component {
266266
let selectedMeasureLabel = ""
267267
let selectedMeasureValue = ""
268268

269-
269+
const jsonFields = features.length > 0 ? Object.keys(features[0].properties) : []
270+
270271

271272
if (app != 'csv') {
272273
const theMeasure = measures ? measures[0] : null
@@ -348,25 +349,13 @@ export class DataLayerSetting extends Component {
348349
/>
349350

350351
</PanelRow>
351-
<PanelRow>
352-
<div style={{display: "flex", flexDirection: "column"}}>
353-
<strong>{__("You can use the following variables", "dg")}</strong>
354-
{app != 'csv' && allMeasures && allMeasures.map(m =><div style={{
355-
"margin-top": "calc(8px)",
356-
"font-size": "12px",
357-
"font-style": "normal",
358-
"color": "rgb(117, 117, 117)"
359-
}}>
360-
{"{" + m.value + "}"}</div>)}
361-
362-
{jsonFields.map(m => <div style={{
363-
"margin-top": "calc(8px)",
364-
"font-size": "12px",
365-
"font-style": "normal",
366-
"color": "rgb(117, 117, 117)"
367-
}}>{"{" + m + "}"}</div>)}
368-
</div>
369-
</PanelRow>
352+
{app != 'csv' && allMeasures && allMeasures.map(m => <PanelRow><p
353+
style={{
354+
"margin-top": "calc(8px)",
355+
"font-size": "12px",
356+
"font-style": "normal",
357+
"color": "rgb(117, 117, 117)"
358+
}}>{"{" + m.value + "}"}</p></PanelRow>)}
370359
</PanelBody>,
371360
<React.Fragment>
372361
{app != 'csv' && <Measures

0 commit comments

Comments
 (0)