import * as React from 'react'; import { useParams } from 'react-router-dom'; import ColumnManagement from '~/components/ColumnManagement/ColumnManagement'; import { BASE_INTEGRATION_TESTS_COLUMNS, INTEGRATION_TESTS_LIST_FILTERS, } from '~/components/IntegrationTests/IntegrationTestsListView/integration-tests-table-config'; import IntegrationTestsEmptyState from '~/components/IntegrationTests/IntegrationTestsListView/IntegrationTestsEmptyState'; import { IfFeature } from '~/feature-flags/hooks'; import { useIntegrationTestScenariosByComponentGroup } from '~/hooks/useIntegrationTestScenarios'; import { RouterParams } from '~/routes/utils'; import FilteredEmptyState from '~/shared/components/empty-state/FilteredEmptyState'; import { useFilterState, useFilteredData, FilterToolbar } from '~/shared/components/Filter'; import ListLayout from '~/shared/components/list-layout/ListLayout'; import { Table, TableContainer } from '~/shared/components/TableV2'; import { useNamespace } from '~/shared/providers/Namespace'; import { getErrorState } from '~/shared/utils/error-utils'; import { IntegrationTestScenarioKind } from '~/types/coreBuildService'; const COMPONENT_GROUP_INTEGRATION_TESTS_LIST_COLUMN_STATE_KEY = 'component-group-integration-tests-list'; export const ComponentGroupIntegrationTestsTab: React.FC = () => { const { groupName } = useParams(); const namespace = useNamespace(); const [integrationTests, integrationTestsLoaded, integrationTestsError] = useIntegrationTestScenariosByComponentGroup(namespace, groupName); const { clientFilterValues, clearAll } = useFilterState(INTEGRATION_TESTS_LIST_FILTERS); const { filteredData } = useFilteredData( INTEGRATION_TESTS_LIST_FILTERS, integrationTests ?? [], clientFilterValues, ); if (integrationTestsError) { return getErrorState(integrationTestsError, integrationTestsLoaded, 'integration tests'); } return ( } noDataState={} toolbar={ columns={BASE_INTEGRATION_TESTS_COLUMNS} columnStateKey={COMPONENT_GROUP_INTEGRATION_TESTS_LIST_COLUMN_STATE_KEY} showColumnManagement /> } > obj.metadata?.uid ?? obj.metadata?.name ?? ''} aria-label="Integration tests" columnStateKey={COMPONENT_GROUP_INTEGRATION_TESTS_LIST_COLUMN_STATE_KEY} /> ); }; export default ComponentGroupIntegrationTestsTab;