-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix: Move "invalid graph" warning to MapFieldInput
#3689
fix: Move "invalid graph" warning to MapFieldInput
#3689
Conversation
d31b940
to
a53711e
Compare
MapFieldInput
MapFieldInput
Removed vultr server and associated DNS entries |
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.
Working exactly as expected for List, just one question below about how much visibility we actually need here if mostly intended for editor feedback !
I think you've also missed removing the existing ErrorSummaryContainer
from Map & Label, therefore still falling back to component first rather than field-level throw
here ??
throw Error( | ||
'Edit this flow so that this component is positioned after "FindProperty"; an address is required for schemas that include a "map" field.', | ||
{ cause: "Invalid graph" }, | ||
); |
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.
nit: I'm not sure I'm sold on throwing an error here rather than rendering a component as before - do we want this noise coming through Airbrake?
Understand we can't easily render the whole component any longer from this shared position, but just wondering if there's a mechanism to exclude from Airbrake here etc?
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.
edcb87b
to
b39f801
Compare
@RODO94 @jessicamcinchak Thanks both for the feedback, please see recent commits which make the following changes -
|
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's some basic tests here currently missing, I'll see if I can set this up in a follow up PR.
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.
function ErrorFallback(props: { error: Error }) { | ||
logger.notify(props.error); | ||
const ErrorFallback: React.FC<{ error: Error }> = ({ error }) => { | ||
if (isGraphError(error)) return <GraphErrorComponent error={error} />; |
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 is a neat solution & I think we'll appreciate not having extra noise from these, thanks!
What?
Moves the "invalid graph" warning from a high level component, to the lower level
MapFieldInput
Why?
I noticed when working on 11aa28a that I also needed to handle this error in the
Page
component. The actual component responsible for this dependency is theMapFieldInput
, so it makes sense to do the error handling here once as opposed to remembering to do it in each parent which renders this component.