-
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
Changes from 5 commits
c61dbc9
8bdad72
495500a
5953c1b
2cc4b9d
ec1d5f4
ef66e31
c2735b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
export type TAgendaItem = { | ||
tags: string[]; | ||
id: string; | ||
name: string; | ||
category: string; | ||
date: string; | ||
description: string; | ||
location?: string; | ||
name?: string; | ||
category?: string; | ||
date?: string; | ||
description?: string; | ||
author?: string; | ||
source_name?: string; | ||
tags?: string[]; | ||
location?: string; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
export * from "./agenda"; | ||
export * from "./blog"; | ||
export * from "./chat"; | ||
export * from "./custom"; | ||
export * from "./dao"; | ||
export * from "./discord"; | ||
export * from "./event"; | ||
export * from "./features"; | ||
export * from "./forum"; | ||
export * from "./gas"; | ||
export * from "./lens"; | ||
export * from "./market"; | ||
export * from "./news"; | ||
export * from "./notifications"; | ||
export * from "./podcast"; | ||
export * from "./portfolio"; | ||
export * from "./primitives"; | ||
export * from "./polls"; | ||
export * from "./qna"; | ||
export * from "./reddit"; | ||
export * from "./tvl"; | ||
export * from "./user"; | ||
export * from "./views"; | ||
export * from "./tweets"; | ||
export * from "./chat"; | ||
export * from "./tutorial"; | ||
export * from "./podcast"; | ||
export * from "./user"; | ||
export * from "./views"; | ||
export * from "./video"; | ||
export * from "./notifications"; | ||
export * from "./blog"; | ||
export * from "./forum"; | ||
export * from "./reddit"; | ||
export * from "./portfolio"; | ||
export * from "./lens"; | ||
export * from "./features"; | ||
export * from "./discord"; | ||
export * from "./qna"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { TItem } from "src/types"; | ||
import { TRemoteCustomData, TRemoteCustomDatum } from "../services"; | ||
import { Logger } from "./logging"; | ||
|
||
/** | ||
* This type is used to define the root type of items which include news, daos, tweets etc | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. this needs a proper fix in the validation functions |
||
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 commentThe 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 commentThe 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. |
||
return []; | ||
} | ||
}; |
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