-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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(widget-builder): Validate widget before saving #82807
Conversation
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.
Do you know if there's a way to surface the validation errors in the form a bit better? I think the current widget builder can highlight which fields have issues
That might need more UI changes but we should highlight those errored fields eventually
await validateWidget(api, organization.slug, widget); | ||
onSave({index: Number(widgetIndex), widget}); | ||
} catch (error) { | ||
addErrorMessage('Unable to save widget'); |
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.
addErrorMessage('Unable to save widget'); | |
addErrorMessage(t('Unable to save widget')); |
Bundle ReportChanges will increase total bundle size by 159.4kB (0.5%) ⬆️. This is within the configured threshold ✅ Detailed changes
|
We're reusing the
validateWidget
function that is being used in the current widget builder. I've added that validation check to the save button so it will validate before carrying out the saving and closing process. When the widget is not valid it displays the message as such:In future PRs I will implement field highlighting for the fields that are causing validation errors.
Related to #81729