Refactor import statements and update component types in multiple files

This commit is contained in:
Simon Larsen 2024-04-22 20:41:36 +01:00
parent b139d667d2
commit a5fec2560a
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
4 changed files with 14 additions and 7 deletions

View File

@ -219,6 +219,8 @@ export default class CommonModel {
recordValue as Array<CommonModel>,
column.nestedModelType
);
} else {
json[column.key] = recordValue;
}
return;

View File

@ -247,8 +247,6 @@ export default class AnalyticsDatabaseService<
findStatement.columns
);
debugger;
let items: Array<TBaseModel> =
AnalyticsBaseModel.fromJSONArray<TBaseModel>(
jsonItems,

View File

@ -18,6 +18,7 @@ export interface ComponentProps {
rightElement?: ReactElement | undefined;
isLastElement?: boolean | undefined;
isInitiallyExpanded?: boolean | undefined;
titleClassName?: string | undefined;
}
const Accordion: FunctionComponent<ComponentProps> = (
@ -92,7 +93,7 @@ const Accordion: FunctionComponent<ComponentProps> = (
props.onClick ? 'cursor-pointer' : ''
}`}
>
<div className="text-gray-500">
<div className={`text-gray-500 ${props.titleClassName}`}>
{props.title}{' '}
</div>
<div className="mb-2 text-sm">

View File

@ -24,6 +24,8 @@ import SpanStatusElement from './SpanStatusElement';
import CodeEditor from 'CommonUI/src/Components/CodeEditor/CodeEditor';
import CodeType from 'Common/Types/Code/CodeType';
import JSONFunctions from 'Common/Types/JSONFunctions';
import AccordionGroup from 'CommonUI/src/Components/Accordion/AccordionGroup';
import Accordion from 'CommonUI/src/Components/Accordion/Accordion';
export interface ComponentProps {
id: string;
@ -279,16 +281,20 @@ const SpanViewer: FunctionComponent<ComponentProps> = (
return <ErrorMessage error="No events found for this span." />;
}
// remove this. this is just for testing
console.log(span.events);
span.events = [...span.events, ...span.events];
return (
<div>
<AccordionGroup>
{span.events.map((event: SpanEvent, index: number) => {
return (
<div key={index} className="space-y-5">
<Accordion titleClassName='text-sm' title={`Event: ${event.name}`} key={index} >
{getEventContentElement(event)}
</div>
</Accordion>
);
})}
</div>
</AccordionGroup>
);
};