mirror of https://github.com/buster-so/buster.git
pass selected keys on through
This commit is contained in:
parent
e6ab103f52
commit
e432afb92e
|
@ -34,7 +34,13 @@ const BusterListRowComponentSelectorInner = React.forwardRef(
|
|||
|
||||
if (row.rowSection) {
|
||||
return (
|
||||
<BusterListSectionComponent rowSection={row.rowSection} ref={ref} key={row.id} {...rest} />
|
||||
<BusterListSectionComponent
|
||||
rowSection={row.rowSection}
|
||||
ref={ref}
|
||||
key={row.id}
|
||||
selectedRowKeys={selectedRowKeys}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ export const BusterListSectionComponent = React.memo(
|
|||
rowSection: NonNullable<BusterListRowItem['rowSection']>;
|
||||
onSelectSectionChange?: (v: boolean, id: string) => void;
|
||||
id: string;
|
||||
selectedRowKeys?: string[];
|
||||
selectedRowKeys: string[] | undefined;
|
||||
rows: BusterListRowItem[];
|
||||
style?: React.CSSProperties;
|
||||
rowClassName?: string;
|
||||
|
|
|
@ -138,6 +138,7 @@ export const ChatItemsContainer: React.FC<{
|
|||
onSelectChange={onSelectChange}
|
||||
selectedRowKeys={selectedRowKeys}
|
||||
emptyState={useMemo(() => <EmptyState loading={loading} type={type} />, [loading, type])}
|
||||
showSelectAll={false}
|
||||
/>
|
||||
|
||||
<ChatSelectedOptionPopup
|
||||
|
|
|
@ -99,9 +99,9 @@ const CollectionList: React.FC<{
|
|||
}> = React.memo(({ collectionsList, setOpenNewCollectionModal, loadedCollections }) => {
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState<string[]>([]);
|
||||
|
||||
const createCollectionLinkItem = createListItem<BusterCollectionListItem>();
|
||||
|
||||
const collections: BusterListRowItem<BusterCollectionListItem>[] = useMemo(() => {
|
||||
const createCollectionLinkItem = createListItem<BusterCollectionListItem>();
|
||||
|
||||
return collectionsList.map((collection) => {
|
||||
return createCollectionLinkItem({
|
||||
id: collection.id,
|
||||
|
|
|
@ -34,36 +34,18 @@ export const MetricItemsContainer: React.FC<{
|
|||
|
||||
const metricsByDate: BusterListRowItem<BusterMetricListItem>[] = useMemo(() => {
|
||||
const createMetricLinkItem = createListItem<BusterMetricListItem>();
|
||||
return Object.entries(logsRecord).flatMap<BusterListRowItem<BusterMetricListItem>>(
|
||||
([key, metrics]) => {
|
||||
const records = metrics.map((metric) =>
|
||||
createMetricLinkItem({
|
||||
id: metric.id,
|
||||
data: metric,
|
||||
link: {
|
||||
to: '/app/metrics/$metricId',
|
||||
params: {
|
||||
metricId: metric.id,
|
||||
},
|
||||
},
|
||||
})
|
||||
) as BusterListRowItem<BusterMetricListItem>[];
|
||||
const hasRecords = records.length > 0;
|
||||
if (!hasRecords) {
|
||||
return [];
|
||||
}
|
||||
return [
|
||||
createMetricLinkItem({
|
||||
id: key,
|
||||
data: null,
|
||||
rowSection: {
|
||||
title: makeHumanReadble(key),
|
||||
secondaryTitle: String(records.length),
|
||||
},
|
||||
}),
|
||||
...records,
|
||||
];
|
||||
}
|
||||
|
||||
return metrics.map((metric) =>
|
||||
createMetricLinkItem({
|
||||
id: metric.id,
|
||||
data: metric,
|
||||
link: {
|
||||
to: '/app/metrics/$metricId',
|
||||
params: {
|
||||
metricId: metric.id,
|
||||
},
|
||||
},
|
||||
})
|
||||
);
|
||||
}, [logsRecord]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue