Skip to content

Commit 09ae763

Browse files
authored
Merge branch 'main' into fe/hadnle_connectors_statistics
2 parents f5e0dbb + 3e80923 commit 09ae763

File tree

6 files changed

+27
-43
lines changed

6 files changed

+27
-43
lines changed

api/src/main/java/io/kafbat/ui/controller/ConsumerGroupsController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ public Mono<ResponseEntity<ConsumerGroupsPageResponseDTO>> getConsumerGroupsPage
143143
Optional.ofNullable(page).filter(i -> i > 0).orElse(1),
144144
Optional.ofNullable(perPage).filter(i -> i > 0).orElse(defaultConsumerGroupsPageSize),
145145
search,
146+
fts,
146147
Optional.ofNullable(orderBy).orElse(ConsumerGroupOrderingDTO.NAME),
147148
Optional.ofNullable(sortOrderDto).orElse(SortOrderDTO.ASC)
148149
)

api/src/main/java/io/kafbat/ui/service/ConsumerGroupService.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,12 @@ public Mono<ConsumerGroupsPage> getConsumerGroupsPage(
152152
int pageNum,
153153
int perPage,
154154
@Nullable String search,
155+
Boolean fts,
155156
ConsumerGroupOrderingDTO orderBy,
156157
SortOrderDTO sortOrderDto) {
157158
return adminClientService.get(cluster).flatMap(ac ->
158159
ac.listConsumerGroups()
159-
.map(listing -> filterGroups(listing, search)
160+
.map(listing -> filterGroups(listing, search, fts)
160161
)
161162
.flatMapIterable(lst -> lst)
162163
.filterWhen(cg -> accessControlService.isConsumerGroupAccessible(cg.groupId(), cluster.getName()))
@@ -169,9 +170,11 @@ public Mono<ConsumerGroupsPage> getConsumerGroupsPage(
169170
(allGroups.size() / perPage) + (allGroups.size() % perPage == 0 ? 0 : 1))))));
170171
}
171172

172-
private Collection<ConsumerGroupListing> filterGroups(Collection<ConsumerGroupListing> groups, String search) {
173-
ClustersProperties.ClusterFtsProperties fts = clustersProperties.getFts();
174-
ConsumerGroupFilter filter = new ConsumerGroupFilter(groups, fts.isEnabled(), fts.getConsumers());
173+
private Collection<ConsumerGroupListing> filterGroups(Collection<ConsumerGroupListing> groups, String search,
174+
Boolean useFts) {
175+
ClustersProperties.ClusterFtsProperties ftsProperties = clustersProperties.getFts();
176+
boolean fts = ftsProperties.use(useFts);
177+
ConsumerGroupFilter filter = new ConsumerGroupFilter(groups, fts, ftsProperties.getConsumers());
175178
return filter.find(search);
176179
}
177180

api/src/main/resources/logback-spring.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

frontend/src/components/Connect/List/ConnectorsTable/connectorsColumns/cells/TopicsCell.tsx

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22
import { FullConnectorInfo } from 'generated-sources';
33
import { CellContext } from '@tanstack/react-table';
4-
import { useNavigate } from 'react-router-dom';
54
import { MultiLineTag } from 'components/common/Tag/Tag.styled';
65
import { ClusterNameRoute, clusterTopicPath } from 'lib/paths';
76
import useAppParams from 'lib/hooks/useAppParams';
@@ -13,31 +12,18 @@ const TopicsCell: React.FC<CellContext<FullConnectorInfo, unknown>> = ({
1312
}) => {
1413
const { topics } = row.original;
1514
const { clusterName } = useAppParams<ClusterNameRoute>();
16-
const navigate = useNavigate();
17-
18-
const navigateToTopic = (
19-
e: React.KeyboardEvent | React.MouseEvent,
20-
topic: string
21-
) => {
22-
e.preventDefault();
23-
e.stopPropagation();
24-
navigate(clusterTopicPath(clusterName, topic));
25-
};
2615

2716
return (
2817
<S.TagsWrapper>
29-
{topics?.map((t) => (
30-
<MultiLineTag key={t} color="green">
31-
<span
32-
role="link"
33-
onClick={(e) => navigateToTopic(e, t)}
34-
onKeyDown={(e) => navigateToTopic(e, t)}
35-
tabIndex={0}
36-
>
37-
{t}
38-
</span>
39-
</MultiLineTag>
40-
))}
18+
{topics?.map((t) => {
19+
const href = clusterTopicPath(clusterName, t);
20+
21+
return (
22+
<MultiLineTag key={t} color="green">
23+
<a href={href}>{t}</a>
24+
</MultiLineTag>
25+
);
26+
})}
4127
</S.TagsWrapper>
4228
);
4329
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ const TopicTable: React.FC = () => {
7272
},
7373
},
7474
{
75+
id: TopicColumnsToSort.REPLICATION_FACTOR,
7576
header: 'Replication Factor',
7677
accessorKey: 'replicationFactor',
77-
enableSorting: false,
7878
size: 148,
7979
maxSize: 148,
8080
},

frontend/src/components/Topics/Topic/Messages/PreviewModal.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { InputLabel } from 'components/common/Input/InputLabel.styled';
66
import IconButtonWrapper from 'components/common/Icons/IconButtonWrapper';
77
import EditIcon from 'components/common/Icons/EditIcon';
88
import CancelIcon from 'components/common/Icons/CancelIcon';
9+
import { JSONPath } from 'jsonpath-plus';
910

1011
import * as S from './PreviewModal.styled';
1112
import { PreviewFilter } from './Message';
@@ -33,8 +34,14 @@ const PreviewModal: React.FC<InfoModalProps> = ({
3334
newErrors.push('field');
3435
}
3536

36-
if (path === '') {
37+
if (path.trim() === '') {
3738
newErrors.push('path');
39+
} else {
40+
try {
41+
JSONPath({ path, json: {} });
42+
} catch {
43+
newErrors.push('invalidPath');
44+
}
3845
}
3946

4047
if (newErrors?.length) {
@@ -111,6 +118,7 @@ const PreviewModal: React.FC<InfoModalProps> = ({
111118
/>
112119
<FormError>
113120
{errors.includes('path') && 'Json path is required'}
121+
{errors.includes('invalidPath') && 'Invalid JSONPath syntax'}
114122
</FormError>
115123
</div>
116124
<S.ButtonWrapper>

0 commit comments

Comments
 (0)