-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
chore: Pass errors to widgets #24760
Conversation
/ok-to-test sha=7619207 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/5346851783. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/5346851783.
|
/ok-to-test sha=ddcee7d |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/5374720480. |
ddcee7d
to
c17d840
Compare
/ok-to-test sha=c17d840 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/5375314933. |
c17d840
to
873a843
Compare
/ok-to-test sha=873a843 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/5420532019. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/5420532019.
|
873a843
to
f63b833
Compare
/ok-to-test sha=f63b833 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/5452516398. |
f63b833
to
f68f7b6
Compare
/ok-to-test sha=f68f7b6 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/5452665772. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/5452665772. |
@@ -863,6 +863,12 @@ export const WIDGET_DISPLAY_PROPS = { | |||
isDisabled: true, | |||
backgroundColor: true, | |||
}; | |||
export interface WidgetError extends 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.
There are changes coming to the BaseWidget
and I was hoping that we can move these type definitions to a separate file in the widgets
directory. Thoughts?
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.
We can have a folder called BaseWidgets
and have two files in it, index.ts
and constants.ts
. index.ts
can have the definition of BaseWidget
and constants.ts
can have the types and interfaces declarations.
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.
@riodeuno
I can make this change if this suggestion seems reasonable.
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.
We are looking at changing what goes into the BaseWidget. The general idea is that we'll have "pluggable" and modular layout mechanisms (Fixed mode, Auto Layout mode and the new Auto Layout mode). This will change how we organise the components in the editor. The mobile pod will share the engg tech spec for your review. In the meantime, I will recommend targeting the fact that we've the types mixed up with the BaseWidget definition, making it difficult to restructure. As far as the way we do it, please do it as you see fit.
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.
@rajatagrawal Thanks for heeding my suggestions. I've taken a look at the code. Looks good to me.
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.
The code looks fine to me. A few areas have a concerned comment. Please look into them.
54c6ace
to
8e854f6
Compare
/ok-to-test sha=8e854f6 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/5473115047. |
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.
Please update the PR description. This description is going to be useful for the following scenarios:
- During git blame, we asynchronously know exactly why these changes were made
- During release promotion, the PR description gives the team an idea on how to describe these changes to our users.
Finally, I would also ask that we create an issue to update the widget development API, letting developers know about the errors
API now available in widgets.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/5473115047. |
Issue for adding widgetErrors to Widget Development API is here Also updated the PR description. QQ : Can the details of the PR be picked from the issue instead ? The detailed summary is described in the issue first and these details are simply duplicated in the PR description. |
Fixes #24663
Summary
Widget should have access to evaluation errors because that allows it to make a decision on how to handle errors in property pane and give users a more visual cue to take a corrective action for fixing errors in the property pane.
The current pop up isn't too conspicuous to notice and also doesn't appear when the user deselects the property pane and reselects it.
Why should this be worked on?
This aligns with Widget Development API. Accessing the evaluation errors from evaluations isn't recommended because it is an internal property. An internal property is not advisable to be used given our roadmap for community widgets.
Showing default data instead may not be the right way to handle errors in every use case.
Loom Video describing the requirement : https://www.loom.com/share/04c228b06bb34b97894e345b46cf0abe?sid=f855ac90-74fa-4ee3-b882-ec70b1b2d9bf