File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed
Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -226,19 +226,22 @@ def to_components(self) -> list[dict[str, Any]]:
226226 def key (item : Item ) -> int :
227227 return item ._rendered_row or 0
228228
229- children = sorted (self .children , key = key )
230- components : list [dict [str , Any ]] = []
231- for _ , group in groupby (children , key = key ):
232- children = [item .to_component_dict () for item in group ]
233- if not children :
234- continue
235-
236- components .append (
237- {
238- "type" : 1 ,
239- "components" : children ,
240- }
241- )
229+ if self .is_v2 ():
230+ components = [item .to_component_dict () for item in self .children ]
231+ else :
232+ children = sorted (self .children , key = key )
233+ components : list [dict [str , Any ]] = []
234+ for _ , group in groupby (children , key = key ):
235+ children = [item .to_component_dict () for item in group ]
236+ if not children :
237+ continue
238+
239+ components .append (
240+ {
241+ "type" : 1 ,
242+ "components" : children ,
243+ }
244+ )
242245
243246 return components
244247
You can’t perform that action at this time.
0 commit comments