New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/fires within settings btn #3997
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/vizzuality1/gfw-docs/6sjozt8pf |
app/javascript/components/widget/components/widget-header/component.jsx
Outdated
Show resolved
Hide resolved
Looks good to me dude 👌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets make that button more configurable
app/javascript/components/widget/components/widget-pie-chart-legend/styles.scss
Show resolved
Hide resolved
className="pie-contextual-settings-btn" | ||
onClick={() => toggleSettingsMenu()} | ||
> | ||
+ Select an intersection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isnt generic, a widget might not have intersections but want this button to exist. It should be configurable.
@@ -23,7 +23,10 @@ class ChartTooltip extends PureComponent { | |||
: values[d.key]; | |||
|
|||
return hideZeros && (!values || !value) ? null : ( | |||
<div key={d.key} className={`data-line ${d.position || ''}`}> | |||
<div | |||
key={d.key ? d.key : `setting-${i}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no use of i in keys please. React gets very upset about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solves an issue where the key is undefined and react complains about it. Not sure what to add then 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't have a key we shouldn't be rendering it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is no unique data to identify what it is then what is it doing there? Check the data and the render to tidy it up.
app/javascript/components/widget/components/widget-composed-chart/component.jsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice abstraction of the button to a function. Thanks for the tidy up.
Overview
Adding a button to the 'fires within' widget to open the settings like we did in the Cumulative Fire Alerts widget. This button should be shown in any pie chart widget when:
showSettingsBtn: true
is in the settings object (in index.js)