-
Notifications
You must be signed in to change notification settings - Fork 0
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: Migrate widgets that are still using format_structure (ALPHA-4191) #159
Conversation
- rename NoItems component by CenteredBlock - Use CenteredBlock to display 'no results' instead of an inifinite spinner when data is missing or invalid
@@ -1,25 +1,26 @@ | |||
export * from "./agenda"; |
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.
just reorder and added agenda
@@ -174,5 +175,11 @@ export const customDatumAsItem: (datum: TRemoteCustomDatum) => TItem = (d) => { | |||
}, {} as TItem); | |||
}; | |||
|
|||
export const customDataAsItems: (data: TRemoteCustomData) => TItem[] = (d) => | |||
d.map(customDatumAsItem); | |||
export const customDataAsItems: (data: TRemoteCustomData) => TItem[] = (d) => { |
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 needs a proper fix in the validation functions
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 works, I just mentioned one small issue
try { | ||
return d.map(customDatumAsItem); | ||
} catch (error) { | ||
Logger.error("customDataAsItems: unexpected 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.
Let's say this fails I think it will be helpful to know which container this error comes from.
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.
you are right but I don't want to add code that will need to be cleaned up later on. This should never fail (that would mean we could not trust the expected type of the function input) so I'm actually removing the try-catch.
This concerns the following widgets:
https://github.com/AlphadayHQ/backend/pull/740 takes care of the data layer.