Skip to content

Commit ca25d84

Browse files
committed
FE: Add fts to other resources, add logic to show and handle fts button
1 parent fb7faa1 commit ca25d84

File tree

19 files changed

+143
-24
lines changed

19 files changed

+143
-24
lines changed

frontend/src/components/ACLPage/List/List.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,17 @@ import ResourcePageHeading from 'components/common/ResourcePageHeading/ResourceP
2626
import BreakableTextCell from 'components/common/NewTable/BreakableTextCell';
2727
import { useQueryPersister } from 'components/common/NewTable/ColumnFilter';
2828
import { ActionPermissionWrapper } from 'components/common/ActionComponent';
29+
import useFts from 'components/common/Fts/useFts';
30+
import Fts from 'components/common/Fts/Fts';
2931

3032
import * as S from './List.styled';
3133

3234
const ACList: React.FC = () => {
3335
const { clusterName } = useAppParams<{ clusterName: ClusterName }>();
3436
const [searchParams, setSearchParams] = useSearchParams();
3537
const [search, setSearch] = useState(searchParams.get('q') || '');
36-
const { data: aclList } = useAcls({ clusterName, search });
38+
const { isFtsEnabled } = useFts('acl');
39+
const { data: aclList } = useAcls({ clusterName, search, fts: isFtsEnabled });
3740
const { deleteResource } = useDeleteAcl(clusterName);
3841
const modal = useConfirm(true);
3942
const theme = useTheme();
@@ -211,6 +214,7 @@ const ACList: React.FC = () => {
211214
placeholder="Search by Principal Name"
212215
value={search}
213216
onChange={setSearch}
217+
extraActions={<Fts resourceName="acl" />}
214218
/>
215219
</ControlPanelWrapper>
216220
<Table

frontend/src/components/ACLPage/lib/useConsumerGroupsOptions.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
import useFts from 'components/common/Fts/useFts';
12
import { useConsumerGroups } from 'lib/hooks/api/consumers';
23
import { useMemo } from 'react';
34

45
const useConsumerGroupsOptions = (clusterName: string) => {
5-
const { data } = useConsumerGroups({ clusterName, search: '' });
6+
const { isFtsEnabled } = useFts('consumer_groups');
7+
const { data } = useConsumerGroups({
8+
clusterName,
9+
search: '',
10+
fts: isFtsEnabled,
11+
});
612
const consumerGroups = useMemo(() => {
713
return (
814
data?.consumerGroups?.map((cg) => {

frontend/src/components/ClusterPage/ClusterPage.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ const ClusterPage: React.FC = () => {
6161
hasAclViewConfigured:
6262
features.includes(ClusterFeaturesEnum.KAFKA_ACL_VIEW) ||
6363
features.includes(ClusterFeaturesEnum.KAFKA_ACL_EDIT),
64+
ftsEnabled: false,
65+
ftsDefaultEnabled: false,
6466
};
6567
}, [clusterName, data]);
6668

frontend/src/components/Connect/List/List.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { useSearchParams } from 'react-router-dom';
99
import { useQueryPersister } from 'components/common/NewTable/ColumnFilter';
1010
import { useLocalStoragePersister } from 'components/common/NewTable/ColumnResizer/lib';
1111
import BreakableTextCell from 'components/common/NewTable/BreakableTextCell';
12+
import useFts from 'components/common/Fts/useFts';
1213

1314
import ActionsCell from './ActionsCell';
1415
import TopicsCell from './TopicsCell';
@@ -80,9 +81,11 @@ const kafkaConnectColumns: ColumnDef<FullConnectorInfo, string>[] = [
8081
const List: React.FC = () => {
8182
const { clusterName } = useAppParams<ClusterNameRoute>();
8283
const [searchParams] = useSearchParams();
84+
const { isFtsEnabled } = useFts('connects');
8385
const { data: connectors } = useConnectors(
8486
clusterName,
85-
searchParams.get('q') || ''
87+
searchParams.get('q') || '',
88+
isFtsEnabled
8689
);
8790

8891
const filterPersister = useQueryPersister(kafkaConnectColumns);

frontend/src/components/Connect/List/ListPage.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,26 @@ import { ClusterNameRoute } from 'lib/paths';
44
import Search from 'components/common/Search/Search';
55
import PageLoader from 'components/common/PageLoader/PageLoader';
66
import { useConnectors } from 'lib/hooks/api/kafkaConnect';
7+
import Fts from 'components/common/Fts/Fts';
8+
import useFts from 'components/common/Fts/useFts';
79

810
import * as S from './ListPage.styled';
911
import List from './List';
1012
import ConnectorsStatistics from './Statistics/Statistics';
1113

1214
const ListPage: React.FC = () => {
15+
useFts('connects');
1316
const { clusterName } = useAppParams<ClusterNameRoute>();
1417
const { data, isLoading } = useConnectors(clusterName);
1518

1619
return (
1720
<>
1821
<ConnectorsStatistics connectors={data ?? []} isLoading={isLoading} />
1922
<S.Search hasInput>
20-
<Search placeholder="Search by Connect Name, Status or Type" />
23+
<Search
24+
placeholder="Search by Connect Name, Status or Type"
25+
extraActions={<Fts resourceName="connects" />}
26+
/>
2127
</S.Search>
2228
<Suspense fallback={<PageLoader />}>
2329
<List />

frontend/src/components/ConsumerGroups/List.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ import { useConsumerGroups } from 'lib/hooks/api/consumers';
1717
import Tooltip from 'components/common/Tooltip/Tooltip';
1818
import ResourcePageHeading from 'components/common/ResourcePageHeading/ResourcePageHeading';
1919
import { useLocalStoragePersister } from 'components/common/NewTable/ColumnResizer/lib';
20+
import useFts from 'components/common/Fts/useFts';
21+
import Fts from 'components/common/Fts/Fts';
2022

2123
const List = () => {
2224
const { clusterName } = useAppParams<ClusterNameRoute>();
2325
const [searchParams] = useSearchParams();
2426
const navigate = useNavigate();
27+
const { isFtsEnabled } = useFts('consumer_groups');
2528

2629
const consumerGroups = useConsumerGroups({
2730
clusterName,
@@ -32,6 +35,7 @@ const List = () => {
3235
page: Number(searchParams.get('page') || 1),
3336
perPage: Number(searchParams.get('perPage') || PER_PAGE),
3437
search: searchParams.get('q') || '',
38+
fts: isFtsEnabled,
3539
});
3640

3741
const columns = React.useMemo<ColumnDef<ConsumerGroup>[]>(
@@ -104,7 +108,10 @@ const List = () => {
104108
<>
105109
<ResourcePageHeading text="Consumers" />
106110
<ControlPanelWrapper hasInput>
107-
<Search placeholder="Search by Consumer Group ID" />
111+
<Search
112+
placeholder="Search by Consumer Group ID"
113+
extraActions={<Fts resourceName="consumer_groups" />}
114+
/>
108115
</ControlPanelWrapper>
109116
<Table
110117
columns={columns}

frontend/src/components/Schemas/List/List.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import { useNavigate, useSearchParams } from 'react-router-dom';
2424
import { PER_PAGE } from 'lib/constants';
2525
import { useGetSchemas } from 'lib/hooks/api/schemas';
2626
import ResourcePageHeading from 'components/common/ResourcePageHeading/ResourcePageHeading';
27+
import useFts from 'components/common/Fts/useFts';
28+
import Fts from 'components/common/Fts/Fts';
2729

2830
import GlobalSchemaSelector from './GlobalSchemaSelector/GlobalSchemaSelector';
2931

@@ -32,6 +34,7 @@ const List: React.FC = () => {
3234
const { clusterName } = useAppParams<ClusterNameRoute>();
3335
const navigate = useNavigate();
3436
const [searchParams] = useSearchParams();
37+
const { isFtsEnabled } = useFts('schemas');
3538
const {
3639
isInitialLoading,
3740
isError,
@@ -45,6 +48,7 @@ const List: React.FC = () => {
4548
sortOrder:
4649
(searchParams.get('sortDirection')?.toUpperCase() as SortOrder) ||
4750
undefined,
51+
fts: isFtsEnabled,
4852
});
4953

5054
const columns = React.useMemo<ColumnDef<SchemaSubject>[]>(
@@ -111,7 +115,10 @@ const List: React.FC = () => {
111115
)}
112116
</ResourcePageHeading>
113117
<ControlPanelWrapper hasInput>
114-
<Search placeholder="Search by Schema Name" />
118+
<Search
119+
placeholder="Search by Schema Name"
120+
extraActions={<Fts resourceName="schemas" />}
121+
/>
115122
</ControlPanelWrapper>
116123
{isInitialLoading || isError ? (
117124
<PageLoader />

frontend/src/components/Topics/List/__tests__/ListPage.spec.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ describe('ListPage Component', () => {
1919
hasKafkaConnectConfigured: true,
2020
hasSchemaRegistryConfigured: true,
2121
isTopicDeletionAllowed: true,
22+
ftsEnabled: false,
23+
ftsDefaultEnabled: false,
2224
}}
2325
>
2426
<WithRoute path={clusterTopicsPath()}>

frontend/src/components/Topics/List/__tests__/TopicTable.spec.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ describe('TopicTable Components', () => {
5959
hasKafkaConnectConfigured: true,
6060
hasSchemaRegistryConfigured: true,
6161
isTopicDeletionAllowed,
62+
ftsEnabled: false,
63+
ftsDefaultEnabled: false,
6264
}}
6365
>
6466
<WithRoute path={clusterTopicsPath()}>

frontend/src/components/Topics/Topic/Overview/__test__/Overview.spec.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ const defaultContextValues = {
2121
hasKafkaConnectConfigured: true,
2222
hasSchemaRegistryConfigured: true,
2323
isTopicDeletionAllowed: true,
24+
ftsEnabled: false,
25+
ftsDefaultEnabled: false,
2426
};
2527

2628
jest.mock('lib/hooks/api/topics', () => ({

0 commit comments

Comments
 (0)