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
Geomap: Improve location editor #58017
Conversation
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/40251 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/40507 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/40830 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/41069 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/41075 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/41616 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/41632 |
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.
I think this is ready to be promoted from a draft PR 🎉
@@ -122,7 +122,8 @@ export const SetGeometryTransformerEditor: React.FC<TransformerUIProps<SpatialTr | |||
props.onChange({ ...opts, ...props.options }); | |||
console.log('geometry useEffect', opts); | |||
} | |||
}); | |||
// eslint-disable-next-line react-hooks/exhaustive-deps | |||
}, []); |
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.
@ryantxu is useEffect ok to run just once (on initialization of spatial transformer editor)?
if (info) { | ||
if (info.warning) { | ||
return ( | ||
<Alert |
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.
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.
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.
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/42940 |
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.
LGTM
* add custom component for location editor * FC cleanup * Apply filter to add location fields call * Create custom editor for location mode * Apply validation logic and render warning * Improve alert styling * Add help url button to location alert * Add success alert for auto * Remove completed TODOs * Only use alert on error, not success * Change location mode to dropdown * Change alert severity to less severe, info * Prevent auto field selection during manual * Update location testing to be for auto mode * Run geo transformer editor init once * Fix breaking test * Clean up some anys * Update styling for alert * Remove auto success styling Co-authored-by: Ryan McKinley <ryantxu@gmail.com> Co-authored-by: nmarrs <nathanielmarrs@gmail.com> (cherry picked from commit ee8f292)
Geomap: Improve location editor (#58017) * add custom component for location editor * FC cleanup * Apply filter to add location fields call * Create custom editor for location mode * Apply validation logic and render warning * Improve alert styling * Add help url button to location alert * Add success alert for auto * Remove completed TODOs * Only use alert on error, not success * Change location mode to dropdown * Change alert severity to less severe, info * Prevent auto field selection during manual * Update location testing to be for auto mode * Run geo transformer editor init once * Fix breaking test * Clean up some anys * Update styling for alert * Remove auto success styling Co-authored-by: Ryan McKinley <ryantxu@gmail.com> Co-authored-by: nmarrs <nathanielmarrs@gmail.com> (cherry picked from commit ee8f292) Co-authored-by: Drew Slobodnjak <60050885+drew08t@users.noreply.github.com>
Geomap: Improve location editor (grafana#58017) * add custom component for location editor * FC cleanup * Apply filter to add location fields call * Create custom editor for location mode * Apply validation logic and render warning * Improve alert styling * Add help url button to location alert * Add success alert for auto * Remove completed TODOs * Only use alert on error, not success * Change location mode to dropdown * Change alert severity to less severe, info * Prevent auto field selection during manual * Update location testing to be for auto mode * Run geo transformer editor init once * Fix breaking test * Clean up some anys * Update styling for alert * Remove auto success styling Co-authored-by: Ryan McKinley <ryantxu@gmail.com> Co-authored-by: nmarrs <nathanielmarrs@gmail.com> (cherry picked from commit ee8f292) Co-authored-by: Drew Slobodnjak <60050885+drew08t@users.noreply.github.com>
What this PR does / why we need it:
When a user is using the location editor, when data source is malformed or missing (or even working, with auto) it is not obvious what is going on. This takes the first steps to improve transparency for the user when using the location editor.
when selecting fields from another query (B for example), if no filter is applied, don't just look at first datasetto address later Geomap: Apply data filter to location editor field selectors #59159for field selector error (like no numeric found) use alert under locationcurrent error is adequate given new flowadd wktGeomap: Add WKT #58606when auto is NOT selected, but fields are automatically selected, populate placeholder with field nameauto during manual has been disabled for a more intuitive flow (Current alert styling:
Closes #54404