-
Notifications
You must be signed in to change notification settings - Fork 314
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
feat(metadata-sidebar): Use error code prop in MetadataInstanceEditor #3921
Conversation
@@ -58,6 +65,7 @@ const MetadataInstanceEditor: React.FC<MetadataInstanceEditorProps> = ({ | |||
selectedTemplateInstance={template} | |||
setIsUnsavedChangesModalOpen={setIsUnsavedChangesModalOpen} | |||
taxonomyOptionsFetcher={taxonomyOptionsFetcher} | |||
errorCode={errorCode} |
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.
🔤
@@ -290,6 +291,7 @@ function MetadataSidebarRedesign({ | |||
setIsUnsavedChangesModalOpen={setIsUnsavedChangesModalOpen} | |||
taxonomyOptionsFetcher={taxonomyOptionsFetcher} | |||
template={editingTemplate} | |||
errorCode={extractErrorCode} |
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.
🔤
@@ -214,15 +224,24 @@ function useSidebarMetadataFetcher( | |||
metadata_template: { template_key: templateKey, scope, type: 'metadata_template' }, | |||
})) as Record<string, MetadataFieldValue>; | |||
} catch (error) { | |||
if (isUserCorrectableError(error.status)) { | |||
if (error.status === 408) { |
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 (error.status === 408) { | |
if (error.response.status === 408) { |
Can you also add clear error handler and trigger it for |
d32663c
to
f2e1b8a
Compare
Passes down the error code into MetadataInstanceEditor if there's an error extracting suggestions.