-
-
Notifications
You must be signed in to change notification settings - Fork 258
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
In-UI error reporting #2312
Comments
I have a couple cases right now where I'm creating fields for non-existent fields, and handling it via the An example: Product.all.each do |product|
field(:"Missing #{product.name} Perms",
as: :text,
readonly: true,
format_using: -> { (product.gsuite_scopes - record.scopes).join("<br/>\n").html_safe }) # rubocop:disable Rails/OutputSafety,Layout/LineLength
end (In this case, I could perhaps push these into accessor methods on the model, but they wouldn't show up as "fields" if querying ActiveRecord metadata. So if you made it allowable to make a read-only field refer to an arbitrary instance method on the model class (and non-read-only fields would have to refer to DB fields), that would cover such use-cases while still allowing robust, proactive error reporting for the developer. |
Ok. I made a mistake in the description (and corrected). Instead of inexistent field names I meant field types. field :name, as: :string # should show a warning that the `string` field does not exist I use that technique of "virtual" fields as well. It's rather powerful! |
This issue has been marked as stale because there was no activity for the past 15 days. |
Closing in favor of #2311 |
Depends on #2352
We need to improve the way we report errors to the developer in the Avo UI in development.
Common errors
undefined method 'tabs_style=' for #<Avo::Configuration
)Ideally we'd use the same error reporting system for both this issue and #2310
Build a UI for it
I'm thinking of having a tiny icon/button somewhere that highlights the number of errors that are present.
When that button is pressed, an overlay slides in, showing a list with all the errors and the next steps on how to correct them or link to the docs.
The text was updated successfully, but these errors were encountered: