Skip to content

Commit

Permalink
Use WorkflowsTable in basic visibility (#774)
Browse files Browse the repository at this point in the history
* Use WorkflowsTable in basic vis

* misc fixes to docstring

* Fix typo
  • Loading branch information
adhityamamallan authored Jan 3, 2025
1 parent 91dfe18 commit 1fe78ed
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import {
* Combines results from multiple infinite queries in sorted order.
*
* To ensure the order of the combined results remains consistent even after fetching additional data,
* this hook requests extra data (page size * number of queries) from all queries. This ensures no higher-priority items are missed
* when sorting, even if they appear in later pages of data.
* this hook requests extra data (page size * number of queries) from all queries. This ensures
* no higher-priority items are missed when sorting, even if they appear in later pages of data.
*
* For instance, to show 5 items across 3 queries, it fetches 15 items.
*
* @param queries - Array of react-query Infinite Query configurations.
* @param pageSize - Number of items to add to the result array when requesting new data.
* @param flattenResult - A function that takes the expected query result and flattens it into an array of items
* @param flattenResponse - A function that takes the expected query response and flattens it into an array of items
* @param compare - A comparison function used to sort and merge results.
* The function should accept two arguments and return:
* - A number > 0 if the second argument comes first.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import React from 'react';

import ErrorPanel from '@/components/error-panel/error-panel';
import SectionLoadingIndicator from '@/components/section-loading-indicator/section-loading-indicator';
import Table from '@/components/table/table';
import usePageQueryParams from '@/hooks/use-page-query-params/use-page-query-params';
import domainPageQueryParamsConfig from '@/views/domain-page/config/domain-page-query-params.config';
import WorkflowsTable from '@/views/shared/workflows-table/workflows-table';

import domainWorkflowsBasicTableConfig from '../config/domain-workflows-basic-table.config';
import useListWorkflowsBasic from '../hooks/use-list-workflows-basic';

import { styled } from './domain-workflows-basic-table.styles';
Expand Down Expand Up @@ -55,19 +54,15 @@ export default function DomainWorkflowsBasicTable({ domain, cluster }: Props) {
}

return (
<Table
data={data}
columns={domainWorkflowsBasicTableConfig}
shouldShowResults={!isLoading && data.length > 0}
endMessageProps={{
kind: 'infinite-scroll',
hasData: data.length > 0,
error:
status === 'error' ? new Error('One or more queries failed') : null,
fetchNextPage,
hasNextPage,
isFetchingNextPage,
}}
<WorkflowsTable
workflows={data}
isLoading={isLoading}
error={
status === 'error' ? new Error('One or more queries failed') : null
}
hasNextPage={hasNextPage}
fetchNextPage={fetchNextPage}
isFetchingNextPage={isFetchingNextPage}
/>
);
}

0 comments on commit 1fe78ed

Please sign in to comment.