instance_id
stringlengths 17
39
| repo
stringclasses 8
values | issue_id
stringlengths 14
34
| pr_id
stringlengths 14
34
| linking_methods
sequencelengths 1
3
| base_commit
stringlengths 40
40
| merge_commit
stringlengths 0
40
β | hints_text
sequencelengths 0
106
| resolved_comments
sequencelengths 0
119
| created_at
unknown | labeled_as
sequencelengths 0
7
| problem_title
stringlengths 7
174
| problem_statement
stringlengths 0
55.4k
| gold_files
sequencelengths 0
10
| gold_files_postpatch
sequencelengths 1
10
| test_files
sequencelengths 0
60
| gold_patch
stringlengths 220
5.83M
| test_patch
stringlengths 386
194k
β | split_random
stringclasses 3
values | split_time
stringclasses 3
values | issue_start_time
timestamp[ns] | issue_created_at
unknown | issue_by_user
stringlengths 3
21
| split_repo
stringclasses 3
values |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
provectus/kafka-ui/1469_1474 | provectus/kafka-ui | provectus/kafka-ui/1469 | provectus/kafka-ui/1474 | [
"connected",
"timestamp(timedelta=0.0, similarity=0.9499271318842601)"
] | f2272bd6b35c8e4326a1a7595d339278a0223b82 | 471e84d0f92065d155911ebd7f3cd67be0ad4e14 | [] | [] | "2022-01-25T08:58:48Z" | [
"type/bug",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Schema type is not updated when history push | **Describe the bug**
(A clear and concise description of what the bug is.)
There's a problem while page history changes after update schema type. A new value appears to late and the one is rendered
**Set up**
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Click schema edit, change its type, submit.
**Expected behavior**
(A clear and concise description of what you expected to happen)
A new schema type should appear. Hovewer in response it is new, but on page its not. The same behaviour is with reset offsets
**Screenshots**
(If applicable, add screenshots to help explain your problem)
**Additional context**
(Add any other context about the problem here)
| [
"kafka-ui-react-app/src/components/ConsumerGroups/Details/ResetOffsets/ResetOffsets.tsx",
"kafka-ui-react-app/src/components/Schemas/Edit/Edit.tsx",
"kafka-ui-react-app/src/redux/reducers/schemas/schemasSlice.ts"
] | [
"kafka-ui-react-app/src/components/ConsumerGroups/Details/ResetOffsets/ResetOffsets.tsx",
"kafka-ui-react-app/src/components/Schemas/Edit/Edit.tsx",
"kafka-ui-react-app/src/redux/reducers/schemas/schemasSlice.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/ConsumerGroups/Details/ResetOffsets/ResetOffsets.tsx b/kafka-ui-react-app/src/components/ConsumerGroups/Details/ResetOffsets/ResetOffsets.tsx
index ce574325f69..66377f8bce0 100644
--- a/kafka-ui-react-app/src/components/ConsumerGroups/Details/ResetOffsets/ResetOffsets.tsx
+++ b/kafka-ui-react-app/src/components/ConsumerGroups/Details/ResetOffsets/ResetOffsets.tsx
@@ -194,6 +194,7 @@ const ResetOffsets: React.FC = () => {
minWidth="100%"
name={name}
onChange={onChange}
+ defaultValue={value}
value={value}
options={uniqueTopics.map((topic) => ({
value: topic,
diff --git a/kafka-ui-react-app/src/components/Schemas/Edit/Edit.tsx b/kafka-ui-react-app/src/components/Schemas/Edit/Edit.tsx
index 59a0b75ba8a..0507652be45 100644
--- a/kafka-ui-react-app/src/components/Schemas/Edit/Edit.tsx
+++ b/kafka-ui-react-app/src/components/Schemas/Edit/Edit.tsx
@@ -14,7 +14,9 @@ import { InputLabel } from 'components/common/Input/InputLabel.styled';
import PageHeading from 'components/common/PageHeading/PageHeading';
import { useAppDispatch, useAppSelector } from 'lib/hooks/redux';
import {
+ schemaAdded,
schemasApiClient,
+ schemaUpdated,
selectSchemaById,
} from 'redux/reducers/schemas/schemasSlice';
import { serverErrorAlertAdded } from 'redux/reducers/alerts/alertsSlice';
@@ -48,7 +50,7 @@ const Edit: React.FC = () => {
try {
if (dirtyFields.newSchema || dirtyFields.schemaType) {
- await schemasApiClient.createNewSchema({
+ const resp = await schemasApiClient.createNewSchema({
clusterName,
newSchemaSubject: {
...schema,
@@ -56,6 +58,7 @@ const Edit: React.FC = () => {
schemaType: props.schemaType || schema.schemaType,
},
});
+ dispatch(schemaAdded(resp));
}
if (dirtyFields.compatibilityLevel) {
@@ -66,6 +69,12 @@ const Edit: React.FC = () => {
compatibility: props.compatibilityLevel,
},
});
+ dispatch(
+ schemaUpdated({
+ ...schema,
+ compatibilityLevel: props.compatibilityLevel,
+ })
+ );
}
history.push(clusterSchemaPath(clusterName, subject));
diff --git a/kafka-ui-react-app/src/redux/reducers/schemas/schemasSlice.ts b/kafka-ui-react-app/src/redux/reducers/schemas/schemasSlice.ts
index 69b38ed0128..cfc358815f3 100644
--- a/kafka-ui-react-app/src/redux/reducers/schemas/schemasSlice.ts
+++ b/kafka-ui-react-app/src/redux/reducers/schemas/schemasSlice.ts
@@ -55,6 +55,7 @@ const schemasSlice = createSlice({
}),
reducers: {
schemaAdded: schemasAdapter.addOne,
+ schemaUpdated: schemasAdapter.upsertOne,
},
extraReducers: (builder) => {
builder.addCase(fetchSchemas.fulfilled, (state, { payload }) => {
@@ -74,7 +75,7 @@ export const { selectAll: selectAllSchemaVersions } =
(state) => state.schemas.versions
);
-export const { schemaAdded } = schemasSlice.actions;
+export const { schemaAdded, schemaUpdated } = schemasSlice.actions;
export const getAreSchemasFulfilled = createSelector(
createFetchingSelector('schemas/fetch'),
| null | test | train | 2022-01-25T11:53:27 | "2022-01-24T19:17:27Z" | Hurenka | train |
provectus/kafka-ui/1425_1475 | provectus/kafka-ui | provectus/kafka-ui/1425 | provectus/kafka-ui/1475 | [
"timestamp(timedelta=1.0, similarity=0.9570725892626001)",
"connected"
] | d5f83b09f4a6a12c1ee33a2fc5517eed4d9ad276 | f2272bd6b35c8e4326a1a7595d339278a0223b82 | [] | [] | "2022-01-25T09:24:33Z" | [
"scope/frontend",
"status/accepted",
"type/chore"
] | Replacing enzyme to react testing library for topics overview | ### Is your proposal related to a problem?
<!--
Provide a clear and concise description of what the problem is.
For example, "I'm always frustrated when..."
-->
(Write your answer here.)
### Describe the solution you'd like
<!--
Provide a clear and concise description of what you want to happen.
-->
(Describe your proposed solution here.)
### Describe alternatives you've considered
<!--
Let us know about other solutions you've tried or researched.
-->
(Write your answer here.)
### Additional context
<!--
Is there anything else you can add about the proposal?
You might want to link to related issues here, if you haven't already.
-->
(Write your answer here.)
| [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx
index f0b8f58303b..1373e4880fb 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx
@@ -1,8 +1,9 @@
import React from 'react';
-import { shallow } from 'enzyme';
import { screen } from '@testing-library/react';
import { render } from 'lib/testHelpers';
-import Overview from 'components/Topics/Topic/Details/Overview/Overview';
+import Overview, {
+ Props as OverviewProps,
+} from 'components/Topics/Topic/Details/Overview/Overview';
import theme from 'theme/theme';
describe('Overview', () => {
@@ -25,66 +26,70 @@ describe('Overview', () => {
},
];
- const renderComponent = ({
- underReplicatedPartitions = 1,
- inSyncReplicas = 1,
- replicas = 1,
- } = {}) =>
+ const setupComponent = (
+ props: OverviewProps,
+ underReplicatedPartitions?: number,
+ inSyncReplicas?: number,
+ replicas?: number
+ ) =>
render(
<Overview
- name={mockTopicName}
- partitions={mockPartitions}
- internal={undefined}
- clusterName={mockClusterName}
- topicName={mockTopicName}
- clearTopicMessages={mockClearTopicMessages}
underReplicatedPartitions={underReplicatedPartitions}
inSyncReplicas={inSyncReplicas}
replicas={replicas}
+ {...props}
/>
);
describe('when it has internal flag', () => {
it('does not render the Action button a Topic', () => {
- const component = shallow(
- <Overview
- name={mockTopicName}
- partitions={mockPartitions}
- internal={false}
- clusterName={mockClusterName}
- topicName={mockTopicName}
- clearTopicMessages={mockClearTopicMessages}
- />
- );
-
- expect(component.exists('Dropdown')).toBeTruthy();
+ setupComponent({
+ name: mockTopicName,
+ partitions: mockPartitions,
+ internal: false,
+ clusterName: mockClusterName,
+ topicName: mockTopicName,
+ clearTopicMessages: mockClearTopicMessages,
+ });
+ expect(screen.getByRole('menu')).toBeInTheDocument();
});
it('does not render Partitions', () => {
- const componentEmpty = shallow(
- <Overview
- name={mockTopicName}
- partitions={[]}
- internal
- clusterName={mockClusterName}
- topicName={mockTopicName}
- clearTopicMessages={mockClearTopicMessages}
- />
- );
+ setupComponent({
+ name: mockTopicName,
+ partitions: [],
+ internal: true,
+ clusterName: mockClusterName,
+ topicName: mockTopicName,
+ clearTopicMessages: mockClearTopicMessages,
+ });
- expect(componentEmpty.find('td').text()).toEqual('No Partitions found');
+ expect(screen.getByText('No Partitions found')).toBeInTheDocument();
});
});
describe('should render circular alert', () => {
it('should be in document', () => {
- renderComponent();
+ setupComponent({
+ name: mockTopicName,
+ partitions: [],
+ internal: true,
+ clusterName: mockClusterName,
+ topicName: mockTopicName,
+ clearTopicMessages: mockClearTopicMessages,
+ });
const circles = screen.getAllByRole('circle');
expect(circles.length).toEqual(2);
});
it('should be the appropriate color', () => {
- renderComponent({
+ setupComponent({
+ name: mockTopicName,
+ partitions: [],
+ internal: true,
+ clusterName: mockClusterName,
+ topicName: mockTopicName,
+ clearTopicMessages: mockClearTopicMessages,
underReplicatedPartitions: 0,
inSyncReplicas: 1,
replicas: 2,
| null | train | train | 2022-01-25T11:30:48 | "2022-01-19T13:45:28Z" | NelyDavtyan | train |
provectus/kafka-ui/1482_1495 | provectus/kafka-ui | provectus/kafka-ui/1482 | provectus/kafka-ui/1495 | [
"timestamp(timedelta=1.0, similarity=0.9449612894678788)",
"connected"
] | c9e7aac8988ef04731ee843f4edc2ef63bd7deb8 | 2f3aae028ecf993cd56ca98a9a43a612d2c5082b | [
"k8s versions:\r\n1.17.0\r\n1.18.0\r\n1.19.0\r\n1.20.0\r\n1.21.0\r\n1.22.0+"
] | [] | "2022-01-26T17:02:27Z" | [
"type/enhancement",
"status/accepted",
"scope/infrastructure",
"scope/k8s"
] | add workflow that tests helm chart | Subj. | [] | [
".github/workflows/helm.yaml"
] | [] | diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml
new file mode 100644
index 00000000000..69d25985e5b
--- /dev/null
+++ b/.github/workflows/helm.yaml
@@ -0,0 +1,27 @@
+name: Helm
+on:
+ pull_request:
+ types: [ 'opened', 'edited', 'reopened', 'synchronize' ]
+ paths:
+ - "charts/**"
+jobs:
+ build-and-test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Helm tool installer
+ uses: Azure/setup-helm@v1
+ - name: Setup Kubeval
+ uses: lra/[email protected]
+ - name: Run kubeval
+ shell: bash
+ run: |
+ sed -i "s@enabled: false@enabled: true@g" charts/kafka-ui/values.yaml
+ K8S_VERSIONS=$(git ls-remote --refs --tags https://github.com/kubernetes/kubernetes.git | cut -d/ -f3 | grep -e '^v1\.[0-9]\{2\}\.[0]\{1,2\}$' | grep -v -e '^v1\.1[0-8]\{1\}' | cut -c2-)
+ echo "NEXT K8S VERSIONS ARE GOING TO BE TESTED: $K8S_VERSIONS"
+ echo ""
+ for version in $K8S_VERSIONS
+ do
+ echo $version;
+ helm template charts/kafka-ui -f charts/kafka-ui/values.yaml | kubeval --additional-schema-locations https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master --strict -v $version;
+ done
| null | train | train | 2022-01-26T20:04:16 | "2022-01-25T14:59:11Z" | 5hin0bi | train |
provectus/kafka-ui/1383_1498 | provectus/kafka-ui | provectus/kafka-ui/1383 | provectus/kafka-ui/1498 | [
"connected"
] | 540b8eb79b2d38d2b5dab8e6d04cf1ff16847e46 | 7cdcacf5d5327e3f4a7ac26876f58795d135bd2b | [
"Hello there NelyDavtyan! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"TopicsService#getComparatorForTopic implement sorting order (ASC/DESC)"
] | [] | "2022-01-27T00:03:41Z" | [
"type/enhancement",
"good first issue",
"scope/backend",
"scope/frontend",
"status/accepted",
"status/confirmed",
"status/pending-frontend"
] | Create parameters of request for sorting topics | **Describe the bug**
We can't get sorted names of topics
**Steps to Reproduce**
Steps to reproduce the behavior:
1.
**Expected behavior**
On clicking sorting button we should be able to have soretd list of names from A-Z and from Z-A. Now we get only A-Z

**Additional context**
It will be better to send additional params in request
| [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/TopicsController.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java",
"kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/TopicsController.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java",
"kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml"
] | [
"kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/TopicsServicePaginationTest.java"
] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/TopicsController.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/TopicsController.java
index fcbbb520538..893c23474e2 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/TopicsController.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/TopicsController.java
@@ -5,6 +5,7 @@
import com.provectus.kafka.ui.model.PartitionsIncreaseResponseDTO;
import com.provectus.kafka.ui.model.ReplicationFactorChangeDTO;
import com.provectus.kafka.ui.model.ReplicationFactorChangeResponseDTO;
+import com.provectus.kafka.ui.model.SortOrderDTO;
import com.provectus.kafka.ui.model.TopicColumnsToSortDTO;
import com.provectus.kafka.ui.model.TopicConfigDTO;
import com.provectus.kafka.ui.model.TopicCreationDTO;
@@ -66,6 +67,7 @@ public Mono<ResponseEntity<TopicsResponseDTO>> getTopics(String clusterName, @Va
@Valid Boolean showInternal,
@Valid String search,
@Valid TopicColumnsToSortDTO orderBy,
+ @Valid SortOrderDTO sortOrder,
ServerWebExchange exchange) {
return topicsService
.getTopics(
@@ -74,7 +76,8 @@ public Mono<ResponseEntity<TopicsResponseDTO>> getTopics(String clusterName, @Va
Optional.ofNullable(perPage),
Optional.ofNullable(showInternal),
Optional.ofNullable(search),
- Optional.ofNullable(orderBy)
+ Optional.ofNullable(orderBy),
+ Optional.ofNullable(sortOrder)
).map(ResponseEntity::ok);
}
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java
index 2a505cd00e3..d115f99c318 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java
@@ -20,6 +20,7 @@
import com.provectus.kafka.ui.model.PartitionsIncreaseResponseDTO;
import com.provectus.kafka.ui.model.ReplicationFactorChangeDTO;
import com.provectus.kafka.ui.model.ReplicationFactorChangeResponseDTO;
+import com.provectus.kafka.ui.model.SortOrderDTO;
import com.provectus.kafka.ui.model.TopicColumnsToSortDTO;
import com.provectus.kafka.ui.model.TopicConfigDTO;
import com.provectus.kafka.ui.model.TopicCreationDTO;
@@ -67,10 +68,11 @@ public Mono<TopicsResponseDTO> getTopics(KafkaCluster cluster,
Optional<Integer> nullablePerPage,
Optional<Boolean> showInternal,
Optional<String> search,
- Optional<TopicColumnsToSortDTO> sortBy) {
+ Optional<TopicColumnsToSortDTO> sortBy,
+ Optional<SortOrderDTO> sortOrder) {
return adminClientService.get(cluster).flatMap(ac ->
new Pagination(ac, metricsCache.get(cluster))
- .getPage(pageNum, nullablePerPage, showInternal, search, sortBy)
+ .getPage(pageNum, nullablePerPage, showInternal, search, sortBy, sortOrder)
.flatMap(page ->
loadTopics(cluster, page.getTopics())
.map(topics ->
@@ -409,12 +411,15 @@ Mono<Page> getPage(
Optional<Integer> nullablePerPage,
Optional<Boolean> showInternal,
Optional<String> search,
- Optional<TopicColumnsToSortDTO> sortBy) {
+ Optional<TopicColumnsToSortDTO> sortBy,
+ Optional<SortOrderDTO> sortOrder) {
return geTopicsForPagination()
.map(paginatingTopics -> {
Predicate<Integer> positiveInt = i -> i > 0;
int perPage = nullablePerPage.filter(positiveInt).orElse(DEFAULT_PAGE_SIZE);
var topicsToSkip = (pageNum.filter(positiveInt).orElse(1) - 1) * perPage;
+ var comparator = sortOrder.isEmpty() || !sortOrder.get().equals(SortOrderDTO.DESC)
+ ? getComparatorForTopic(sortBy) : getComparatorForTopic(sortBy).reversed();
List<InternalTopic> topics = paginatingTopics.stream()
.filter(topic -> !topic.isInternal()
|| showInternal.map(i -> topic.isInternal() == i).orElse(true))
@@ -422,7 +427,7 @@ Mono<Page> getPage(
search
.map(s -> StringUtils.containsIgnoreCase(topic.getName(), s))
.orElse(true))
- .sorted(getComparatorForTopic(sortBy))
+ .sorted(comparator)
.collect(toList());
var totalPages = (topics.size() / perPage)
+ (topics.size() % perPage == 0 ? 0 : 1);
diff --git a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
index 0f024a3c503..befb7894a9c 100644
--- a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
+++ b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
@@ -295,6 +295,11 @@ paths:
required: false
schema:
$ref: '#/components/schemas/TopicColumnsToSort'
+ - name: sortOrder
+ in: query
+ required: false
+ schema:
+ $ref: '#/components/schemas/SortOrder'
responses:
200:
description: OK
@@ -1729,6 +1734,12 @@ components:
- TOTAL_PARTITIONS
- REPLICATION_FACTOR
+ SortOrder:
+ type: string
+ enum:
+ - ASC
+ - DESC
+
Topic:
type: object
properties:
| diff --git a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/TopicsServicePaginationTest.java b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/TopicsServicePaginationTest.java
index 1b107bd622b..455d04cc037 100644
--- a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/TopicsServicePaginationTest.java
+++ b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/TopicsServicePaginationTest.java
@@ -4,8 +4,10 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import com.provectus.kafka.ui.model.SortOrderDTO;
import com.provectus.kafka.ui.model.TopicColumnsToSortDTO;
import java.util.Collection;
+import java.util.Comparator;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
@@ -46,12 +48,35 @@ public void shouldListFirst25Topics() {
var topics = pagination.getPage(
Optional.empty(), Optional.empty(), Optional.empty(),
- Optional.empty(), Optional.empty()).block();
+ Optional.empty(), Optional.empty(), Optional.empty()).block();
assertThat(topics.getTotalPages()).isEqualTo(4);
assertThat(topics.getTopics()).hasSize(25);
assertThat(topics.getTopics()).isSorted();
}
+ @Test
+ public void shouldListFirst25TopicsSortedByNameDescendingOrder() {
+ var topicDescriptions = IntStream.rangeClosed(1, 100).boxed()
+ .map(Objects::toString)
+ .map(name -> new TopicDescription(name, false, List.of()))
+ .collect(Collectors.toList());
+ init(topicDescriptions);
+
+ var topics = pagination.getPage(
+ Optional.empty(), Optional.empty(), Optional.empty(),
+ Optional.empty(), Optional.of(TopicColumnsToSortDTO.NAME), Optional.of(SortOrderDTO.DESC)).block();
+ assertThat(topics.getTotalPages()).isEqualTo(4);
+ assertThat(topics.getTopics()).hasSize(25);
+ assertThat(topics.getTopics()).isSortedAccordingTo(Comparator.reverseOrder());
+ assertThat(topics.getTopics()).containsExactlyElementsOf(
+ topicDescriptions.stream()
+ .map(TopicDescription::name)
+ .sorted(Comparator.reverseOrder())
+ .limit(25)
+ .collect(Collectors.toList())
+ );
+ }
+
@Test
public void shouldCalculateCorrectPageCountForNonDivisiblePageSize() {
init(
@@ -62,7 +87,7 @@ public void shouldCalculateCorrectPageCountForNonDivisiblePageSize() {
);
var topics = pagination.getPage(Optional.of(4), Optional.of(33),
- Optional.empty(), Optional.empty(), Optional.empty()).block();
+ Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()).block();
assertThat(topics.getTotalPages()).isEqualTo(4);
assertThat(topics.getTopics()).hasSize(1)
.first().isEqualTo("99");
@@ -78,7 +103,7 @@ public void shouldCorrectlyHandleNonPositivePageNumberAndPageSize() {
);
var topics = pagination.getPage(Optional.of(0), Optional.of(-1),
- Optional.empty(), Optional.empty(), Optional.empty()).block();
+ Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()).block();
assertThat(topics.getTotalPages()).isEqualTo(4);
assertThat(topics.getTopics()).hasSize(25);
assertThat(topics.getTopics()).isSorted();
@@ -95,7 +120,7 @@ public void shouldListBotInternalAndNonInternalTopics() {
var topics = pagination.getPage(
Optional.empty(), Optional.empty(), Optional.of(true),
- Optional.empty(), Optional.empty()).block();
+ Optional.empty(), Optional.empty(), Optional.empty()).block();
assertThat(topics.getTotalPages()).isEqualTo(4);
assertThat(topics.getTopics()).hasSize(25);
assertThat(topics.getTopics()).isSorted();
@@ -113,7 +138,7 @@ public void shouldListOnlyNonInternalTopics() {
var topics = pagination.getPage(
Optional.empty(), Optional.empty(), Optional.of(true),
- Optional.empty(), Optional.empty()).block();
+ Optional.empty(), Optional.empty(), Optional.empty()).block();
assertThat(topics.getTotalPages()).isEqualTo(4);
assertThat(topics.getTopics()).hasSize(25);
assertThat(topics.getTopics()).isSorted();
@@ -131,7 +156,7 @@ public void shouldListOnlyTopicsContainingOne() {
var topics = pagination.getPage(
Optional.empty(), Optional.empty(), Optional.empty(),
- Optional.of("1"), Optional.empty()).block();
+ Optional.of("1"), Optional.empty(), Optional.empty()).block();
assertThat(topics.getTotalPages()).isEqualTo(1);
assertThat(topics.getTopics()).hasSize(20);
assertThat(topics.getTopics()).isSorted();
@@ -151,7 +176,7 @@ public void shouldListTopicsOrderedByPartitionsCount() {
var topics = pagination.getPage(
Optional.empty(), Optional.empty(), Optional.empty(),
- Optional.empty(), Optional.of(TopicColumnsToSortDTO.TOTAL_PARTITIONS)).block();
+ Optional.empty(), Optional.of(TopicColumnsToSortDTO.TOTAL_PARTITIONS), Optional.empty()).block();
assertThat(topics.getTotalPages()).isEqualTo(4);
assertThat(topics.getTopics()).hasSize(25);
assertThat(topics.getTopics()).containsExactlyElementsOf(
@@ -159,6 +184,18 @@ public void shouldListTopicsOrderedByPartitionsCount() {
.map(TopicDescription::name)
.limit(25)
.collect(Collectors.toList()));
+
+ var topicsSortedDesc = pagination.getPage(
+ Optional.empty(), Optional.empty(), Optional.empty(),
+ Optional.empty(), Optional.of(TopicColumnsToSortDTO.TOTAL_PARTITIONS), Optional.of(SortOrderDTO.DESC)).block();
+ assertThat(topicsSortedDesc.getTotalPages()).isEqualTo(4);
+ assertThat(topicsSortedDesc.getTopics()).hasSize(25);
+ assertThat(topicsSortedDesc.getTopics()).containsExactlyElementsOf(
+ topicDescriptions.stream()
+ .sorted((a, b) -> b.partitions().size() - a.partitions().size())
+ .map(TopicDescription::name)
+ .limit(25)
+ .collect(Collectors.toList()));
}
}
| train | train | 2022-01-31T11:24:39 | "2022-01-13T14:15:42Z" | NelyDavtyan | train |
provectus/kafka-ui/1501_1506 | provectus/kafka-ui | provectus/kafka-ui/1501 | provectus/kafka-ui/1506 | [
"connected"
] | 1ae0d4d8aa05570632ccfbabdeaf893d74fb7240 | afca54d3743ae77bbc24e1b0e451e480220bcba5 | [
"@giom-l thanks for the feedback, glad you like the update :)\r\nAs I mentioned in a discussion, this seems to be a regression indeed. We'll take a look!",
"@giom-l the fix is available in `master`-labeled image",
"Sorry for the delay, I just tested it and it's OK :)",
"> Sorry for the delay, I just tested it and it's OK :)\r\n\r\nglad it works! so you're on 0.3 now?"
] | [] | "2022-01-28T10:24:56Z" | [
"type/bug",
"scope/backend",
"status/accepted",
"type/regression"
] | Readonly mode regression | ### Discussed in https://github.com/provectus/kafka-ui/discussions/1497
<div type='discussions-op-text'>
<sup>Originally posted by **giom-l** January 26, 2022</sup>
Hi,
Long time no see. I just realized I had missed some releases since last time.
So I just tried to update our UI from 0.2.1 to 0.3.3.
What a change ^^.
However, I have some concerns about one of the most useful feature to me : the read-only mode.
This was working perfectly in 0.2.1 and I'm little lost in 0.3.3 (
- no more "read only" label anywhere (I saw it was brought back in 0.3.2, but didn't find it)
- Also, all creation/deletion options are still visible but are just not working :
- sometimes with an error on the UI
- sometimes without anything (I only get HTTP405 error)
From a user experience perspective, it is a huge regression (IMO, obviously)
As a user, I really prefer not to see unavailable options than having obscure error messages, like the following we have when trying to create a topic :

Is this behavior intended or the "UI_hide_all_readonly_incompatible_components" behavior could be back anytime soon ?
For now, I can't make the switch without having lots of questions like "wait, whaaaaat, we can modify clusters now ?" or "wait, whaaat, I'm trying to create topics but can't understand why it is not working" and I'll stick with 0.2.1 :-/</div> | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/InternalClusterState.java"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/InternalClusterState.java"
] | [] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/InternalClusterState.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/InternalClusterState.java
index 53196708042..8626047c4c5 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/InternalClusterState.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/InternalClusterState.java
@@ -28,6 +28,7 @@ public class InternalClusterState {
private List<Feature> features;
private BigDecimal bytesInPerSec;
private BigDecimal bytesOutPerSec;
+ private Boolean readOnly;
public InternalClusterState(KafkaCluster cluster, MetricsCache.Metrics metrics) {
name = cluster.getName();
@@ -66,6 +67,7 @@ public InternalClusterState(KafkaCluster cluster, MetricsCache.Metrics metrics)
inSyncReplicasCount = partitionsStats.getInSyncReplicasCount();
outOfSyncReplicasCount = partitionsStats.getOutOfSyncReplicasCount();
underReplicatedPartitionCount = partitionsStats.getUnderReplicatedPartitionCount();
+ readOnly = cluster.getReadOnly();
}
}
| null | train | train | 2022-01-28T09:13:25 | "2022-01-27T07:55:30Z" | Haarolean | train |
provectus/kafka-ui/1482_1522 | provectus/kafka-ui | provectus/kafka-ui/1482 | provectus/kafka-ui/1522 | [
"connected"
] | 9bd881a97bde4506d2e37657b32d90cbd7fa050c | a24696cc30e1f8ff0793579f4d834b3f557eb337 | [
"k8s versions:\r\n1.17.0\r\n1.18.0\r\n1.19.0\r\n1.20.0\r\n1.21.0\r\n1.22.0+"
] | [] | "2022-01-31T10:02:44Z" | [
"type/enhancement",
"status/accepted",
"scope/infrastructure",
"scope/k8s"
] | add workflow that tests helm chart | Subj. | [
".github/workflows/helm.yaml"
] | [
".github/workflows/helm.yaml"
] | [] | diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml
index 69d25985e5b..18abec82f01 100644
--- a/.github/workflows/helm.yaml
+++ b/.github/workflows/helm.yaml
@@ -4,6 +4,11 @@ on:
types: [ 'opened', 'edited', 'reopened', 'synchronize' ]
paths:
- "charts/**"
+
+ schedule:
+ # * is a special character in YAML so you have to quote this string
+ - cron: '0 8 * * 3'
+
jobs:
build-and-test:
runs-on: ubuntu-latest
| null | train | train | 2022-01-31T10:56:15 | "2022-01-25T14:59:11Z" | 5hin0bi | train |
provectus/kafka-ui/1525_1526 | provectus/kafka-ui | provectus/kafka-ui/1525 | provectus/kafka-ui/1526 | [
"connected"
] | 10e6160eaf97c27ccd1c0937763feadac9fcdce5 | 42a004af1c46e10c1c127472edcb02f78f601675 | [
"Hello there ValentinPrischepa! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π"
] | [] | "2022-01-31T22:46:57Z" | [
"type/enhancement",
"good first issue",
"scope/backend",
"scope/frontend",
"status/accepted",
"status/pending-frontend"
] | Add sorting order to the consumer groups page. | ### Is your proposal related to a problem?
We can sort consumer groups by groupId, number of members, or state, but can't set order direction(ASC/DESC)
<!--
-->
### Describe the solution you'd like
We need to pass an additional parameter from UI, to define sort order direction, similar functionality to Topic page sorting.
<!--
-->
<!--
-->
### Additional context
<!--
-->
| [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/ConsumerGroupsController.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ConsumerGroupService.java",
"kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/ConsumerGroupsController.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ConsumerGroupService.java",
"kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml"
] | [
"kafka-ui-api/src/test/java/com/provectus/kafka/ui/KafkaConsumerGroupTests.java"
] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/ConsumerGroupsController.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/ConsumerGroupsController.java
index bca15d22032..28ce1bbadad 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/ConsumerGroupsController.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/ConsumerGroupsController.java
@@ -11,6 +11,7 @@
import com.provectus.kafka.ui.model.ConsumerGroupOrderingDTO;
import com.provectus.kafka.ui.model.ConsumerGroupsPageResponseDTO;
import com.provectus.kafka.ui.model.PartitionOffsetDTO;
+import com.provectus.kafka.ui.model.SortOrderDTO;
import com.provectus.kafka.ui.service.ConsumerGroupService;
import com.provectus.kafka.ui.service.OffsetsResetService;
import java.util.Map;
@@ -80,13 +81,15 @@ public Mono<ResponseEntity<ConsumerGroupsPageResponseDTO>> getConsumerGroupsPage
Integer perPage,
String search,
ConsumerGroupOrderingDTO orderBy,
+ SortOrderDTO sortOrderDto,
ServerWebExchange exchange) {
return consumerGroupService.getConsumerGroupsPage(
getCluster(clusterName),
Optional.ofNullable(page).filter(i -> i > 0).orElse(1),
Optional.ofNullable(perPage).filter(i -> i > 0).orElse(defaultConsumerGroupsPageSize),
search,
- Optional.ofNullable(orderBy).orElse(ConsumerGroupOrderingDTO.NAME)
+ Optional.ofNullable(orderBy).orElse(ConsumerGroupOrderingDTO.NAME),
+ Optional.ofNullable(sortOrderDto).orElse(SortOrderDTO.ASC)
)
.map(this::convertPage)
.map(ResponseEntity::ok);
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ConsumerGroupService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ConsumerGroupService.java
index a0e67950a21..e49d728adf9 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ConsumerGroupService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ConsumerGroupService.java
@@ -3,6 +3,7 @@
import com.provectus.kafka.ui.model.ConsumerGroupOrderingDTO;
import com.provectus.kafka.ui.model.InternalConsumerGroup;
import com.provectus.kafka.ui.model.KafkaCluster;
+import com.provectus.kafka.ui.model.SortOrderDTO;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
@@ -113,13 +114,18 @@ public Mono<ConsumerGroupsPage> getConsumerGroupsPage(
int page,
int perPage,
@Nullable String search,
- ConsumerGroupOrderingDTO orderBy) {
+ ConsumerGroupOrderingDTO orderBy,
+ SortOrderDTO sortOrderDto
+ ) {
+ var comparator = sortOrderDto.equals(SortOrderDTO.ASC)
+ ? getPaginationComparator(orderBy)
+ : getPaginationComparator(orderBy).reversed();
return adminClientService.get(cluster).flatMap(ac ->
describeConsumerGroups(ac, search).flatMap(descriptions ->
getConsumerGroups(
ac,
descriptions.stream()
- .sorted(getPaginationComparator(orderBy))
+ .sorted(comparator)
.skip((long) (page - 1) * perPage)
.limit(perPage)
.collect(Collectors.toList())
diff --git a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
index befb7894a9c..6fd9c4efa64 100644
--- a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
+++ b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
@@ -652,6 +652,11 @@ paths:
required: false
schema:
$ref: '#/components/schemas/ConsumerGroupOrdering'
+ - name: sortOrder
+ in: query
+ required: false
+ schema:
+ $ref: '#/components/schemas/SortOrder'
responses:
200:
description: OK
| diff --git a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/KafkaConsumerGroupTests.java b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/KafkaConsumerGroupTests.java
index 16b2a14036e..f98ea2cb092 100644
--- a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/KafkaConsumerGroupTests.java
+++ b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/KafkaConsumerGroupTests.java
@@ -86,7 +86,6 @@ void shouldBeBadRequestWhenConsumerGroupIsActive() {
.isBadRequest();
}
-
@Test
void shouldReturnConsumerGroupsWithPagination() throws Exception {
try (var groups1 = startConsumerGroups(3, "cgPageTest1");
@@ -116,6 +115,21 @@ void shouldReturnConsumerGroupsWithPagination() throws Exception {
assertThat(page.getConsumerGroups())
.isSortedAccordingTo(Comparator.comparing(ConsumerGroupDTO::getGroupId));
});
+
+ webTestClient
+ .get()
+ .uri("/api/clusters/{clusterName}/consumer-groups/paged?perPage=10&&search"
+ + "=cgPageTest&orderBy=NAME&sortOrder=DESC", LOCAL)
+ .exchange()
+ .expectStatus()
+ .isOk()
+ .expectBody(ConsumerGroupsPageResponseDTO.class)
+ .value(page -> {
+ assertThat(page.getPageCount()).isEqualTo(1);
+ assertThat(page.getConsumerGroups().size()).isEqualTo(5);
+ assertThat(page.getConsumerGroups())
+ .isSortedAccordingTo(Comparator.comparing(ConsumerGroupDTO::getGroupId).reversed());
+ });
}
}
| val | train | 2022-01-31T13:20:59 | "2022-01-31T22:26:58Z" | ValentinPrischepa | train |
provectus/kafka-ui/1508_1527 | provectus/kafka-ui | provectus/kafka-ui/1508 | provectus/kafka-ui/1527 | [
"timestamp(timedelta=0.0, similarity=1.0)",
"connected"
] | dd0f7038e35242ca7a3c2eebd63bb681fceeb701 | 8a7399b093a16c2dbe4b3bfd1d5e7d442098b585 | [] | [
"```suggestion\r\n it('returns parsed partition from params when partition list includes selected partition', () => {\r\n```",
"update description",
"returns what?",
"π ",
"I'm ok with it",
"returns what?",
"pls check all the cases",
"\r\n```suggestion\r\n it('returns partitions when searchParams not defined', () => {\r\n```"
] | "2022-02-01T09:41:40Z" | [
"good first issue",
"scope/frontend",
"type/chore"
] | Improve test coverage | **Describe the bug**
Files are not completely covered with tests
src/components/Topics/Topic/Details/Messages/Filters/utils.ts
src/components/Topics/Topic/Topic.tsx
src/components/Topics/Topic/Details/Settings/ConfigListItem.tsx
**Expected behavior**
100% covered | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/utils.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/utils.spec.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/ConfigListItem.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/Settings.styled.ts"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/utils.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/utils.spec.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/ConfigListItem.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/Settings.styled.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/__test__/ConfigListItem.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/__tests__/Topic.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/utils.ts b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/utils.ts
index 6328d96ac9b..8b29b5b820f 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/utils.ts
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/utils.ts
@@ -31,7 +31,6 @@ export const getTimestampFromSeekToParam = (params: URLSearchParams) => {
.get('seekTo')
?.split(',')
.map((item) => Number(item.split('::')[1]));
-
return new Date(Math.max(...(offsets || []), 0));
}
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/utils.spec.ts b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/utils.spec.ts
index 526682ae56a..c58bc09b0ea 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/utils.spec.ts
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/utils.spec.ts
@@ -1,5 +1,11 @@
import { Option } from 'react-multi-select-component/dist/lib/interfaces';
-import { filterOptions } from 'components/Topics/Topic/Details/Messages/Filters/utils';
+import {
+ filterOptions,
+ getOffsetFromSeekToParam,
+ getTimestampFromSeekToParam,
+ getSelectedPartitionsFromSeekToParam,
+} from 'components/Topics/Topic/Details/Messages/Filters/utils';
+import { SeekType, Partition } from 'generated-sources';
const options: Option[] = [
{
@@ -20,6 +26,9 @@ const options: Option[] = [
},
];
+let paramsString;
+let searchParams = new URLSearchParams(paramsString);
+
describe('utils', () => {
describe('filterOptions', () => {
it('returns options if no filter is defined', () => {
@@ -30,4 +39,82 @@ describe('utils', () => {
expect(filterOptions(options, '11')).toEqual([options[2]]);
});
});
+
+ describe('getOffsetFromSeekToParam', () => {
+ beforeEach(() => {
+ paramsString = 'seekTo=0::123,1::123,2::0';
+ searchParams = new URLSearchParams(paramsString);
+ });
+
+ it('returns nothing when param "seekType" is equal BEGGINING', () => {
+ searchParams.set('seekType', SeekType.BEGINNING);
+ expect(getOffsetFromSeekToParam(searchParams)).toEqual('');
+ });
+
+ it('returns nothing when param "seekType" is equal TIMESTAMP', () => {
+ searchParams.set('seekType', SeekType.TIMESTAMP);
+ expect(getOffsetFromSeekToParam(searchParams)).toEqual('');
+ });
+
+ it('returns correct messages list when param "seekType" is equal OFFSET', () => {
+ searchParams.set('seekType', SeekType.OFFSET);
+ expect(getOffsetFromSeekToParam(searchParams)).toEqual('123');
+ });
+
+ it('returns 0 when param "seekTo" is not defined and param "seekType" is equal OFFSET', () => {
+ searchParams.set('seekType', SeekType.OFFSET);
+ searchParams.delete('seekTo');
+ expect(getOffsetFromSeekToParam(searchParams)).toEqual('0');
+ });
+ });
+
+ describe('getTimestampFromSeekToParam', () => {
+ beforeEach(() => {
+ paramsString = `seekTo=0::1627333200000,1::1627333200000`;
+ searchParams = new URLSearchParams(paramsString);
+ });
+
+ it('returns null when param "seekType" is equal BEGGINING', () => {
+ searchParams.set('seekType', SeekType.BEGINNING);
+ expect(getTimestampFromSeekToParam(searchParams)).toEqual(null);
+ });
+ it('returns null when param "seekType" is equal OFFSET', () => {
+ searchParams.set('seekType', SeekType.OFFSET);
+ expect(getTimestampFromSeekToParam(searchParams)).toEqual(null);
+ });
+ it('returns correct messages list when param "seekType" is equal TIMESTAMP', () => {
+ searchParams.set('seekType', SeekType.TIMESTAMP);
+ expect(getTimestampFromSeekToParam(searchParams)).toEqual(
+ new Date(1627333200000)
+ );
+ });
+ it('returns default timestamp when param "seekTo" is empty and param "seekType" is equal TIMESTAMP', () => {
+ searchParams.set('seekType', SeekType.TIMESTAMP);
+ searchParams.delete('seekTo');
+ expect(getTimestampFromSeekToParam(searchParams)).toEqual(new Date(0));
+ });
+ });
+
+ describe('getSelectedPartitionsFromSeekToParam', () => {
+ const part: Partition[] = [{ partition: 42, offsetMin: 0, offsetMax: 100 }];
+
+ it('returns parsed partition from params when partition list includes selected partition', () => {
+ searchParams.set('seekTo', '42::0');
+ expect(getSelectedPartitionsFromSeekToParam(searchParams, part)).toEqual([
+ { label: '42', value: 42 },
+ ]);
+ });
+ it('returns parsed partition from params when partition list NOT includes selected partition', () => {
+ searchParams.set('seekTo', '24::0');
+ expect(getSelectedPartitionsFromSeekToParam(searchParams, part)).toEqual(
+ []
+ );
+ });
+ it('returns partitions when param "seekTo" is not defined', () => {
+ searchParams.delete('seekTo');
+ expect(getSelectedPartitionsFromSeekToParam(searchParams, part)).toEqual([
+ { label: '42', value: 42 },
+ ]);
+ });
+ });
});
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/ConfigListItem.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/ConfigListItem.tsx
index 087db1716da..121ab456848 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/ConfigListItem.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/ConfigListItem.tsx
@@ -3,19 +3,23 @@ import React from 'react';
import * as S from './Settings.styled';
-interface ListItemProps {
+export interface ListItemProps {
config: TopicConfig;
}
const ConfigListItem: React.FC<ListItemProps> = ({
config: { name, value, defaultValue },
}) => {
- const hasCustomValue = value !== defaultValue;
+ const hasCustomValue = !!defaultValue && value !== defaultValue;
return (
<S.ConfigList>
- <S.ConfigItemCell $hasCustomValue>{name}</S.ConfigItemCell>
- <S.ConfigItemCell $hasCustomValue>{value}</S.ConfigItemCell>
+ <S.ConfigItemCell $hasCustomValue={hasCustomValue}>
+ {name}
+ </S.ConfigItemCell>
+ <S.ConfigItemCell $hasCustomValue={hasCustomValue}>
+ {value}
+ </S.ConfigItemCell>
<td className="has-text-grey" title="Default Value">
{hasCustomValue && defaultValue}
</td>
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/Settings.styled.ts b/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/Settings.styled.ts
index 7fad7166096..bc15ab49a9d 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/Settings.styled.ts
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/Settings.styled.ts
@@ -6,5 +6,5 @@ export const ConfigList = styled.tr`
}
`;
export const ConfigItemCell = styled.td<{ $hasCustomValue: boolean }>`
- font-weight: ${(props) => (props.$hasCustomValue ? 500 : 400)};
+ font-weight: ${(props) => (props.$hasCustomValue ? 500 : 400)} !important;
`;
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/__test__/ConfigListItem.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/__test__/ConfigListItem.spec.tsx
new file mode 100644
index 00000000000..5aa8794fa35
--- /dev/null
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/__test__/ConfigListItem.spec.tsx
@@ -0,0 +1,42 @@
+import React from 'react';
+import { render } from 'lib/testHelpers';
+import { screen } from '@testing-library/react';
+import ConfigListItem, {
+ ListItemProps,
+} from 'components/Topics/Topic/Details/Settings/ConfigListItem';
+
+const setupComponent = (props: ListItemProps) => {
+ render(
+ <table>
+ <tbody>
+ <ConfigListItem {...props} />
+ </tbody>
+ </table>
+ );
+};
+
+it('renders with CustomValue', () => {
+ setupComponent({
+ config: {
+ name: 'someName',
+ value: 'someValue',
+ defaultValue: 'someDefaultValue',
+ },
+ });
+ expect(screen.getByText('someName')).toBeInTheDocument();
+ expect(screen.getByText('someName')).toHaveStyle('font-weight: 500');
+ expect(screen.getByText('someValue')).toBeInTheDocument();
+ expect(screen.getByText('someValue')).toHaveStyle('font-weight: 500');
+ expect(screen.getByText('someDefaultValue')).toBeInTheDocument();
+});
+
+it('renders without CustomValue', () => {
+ setupComponent({
+ config: { name: 'someName', value: 'someValue', defaultValue: 'someValue' },
+ });
+ expect(screen.getByText('someName')).toBeInTheDocument();
+ expect(screen.getByText('someName')).toHaveStyle('font-weight: 400');
+ expect(screen.getByText('someValue')).toBeInTheDocument();
+ expect(screen.getByText('someValue')).toHaveStyle('font-weight: 400');
+ expect(screen.getByTitle('Default Value')).toHaveTextContent('');
+});
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/__tests__/Topic.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/__tests__/Topic.spec.tsx
new file mode 100644
index 00000000000..d5ee996f749
--- /dev/null
+++ b/kafka-ui-react-app/src/components/Topics/Topic/__tests__/Topic.spec.tsx
@@ -0,0 +1,61 @@
+import React from 'react';
+import { Route } from 'react-router-dom';
+import { render } from 'lib/testHelpers';
+import { screen } from '@testing-library/react';
+import Topic from 'components/Topics/Topic/Topic';
+import {
+ clusterTopicPath,
+ clusterTopicEditPath,
+ clusterTopicSendMessagePath,
+} from 'lib/paths';
+
+jest.mock('components/Topics/Topic/Edit/EditContainer', () => () => (
+ <div>Edit Container</div>
+));
+jest.mock('components/Topics/Topic/SendMessage/SendMessage', () => () => (
+ <div>Send Message</div>
+));
+jest.mock('components/Topics/Topic/Details/DetailsContainer', () => () => (
+ <div>Details Container</div>
+));
+jest.mock('components/common/PageLoader/PageLoader', () => () => (
+ <div>Loading</div>
+));
+
+const fetchTopicDetailsMock = jest.fn();
+
+const renderComponent = (pathname: string, topicFetching: boolean) =>
+ render(
+ <Route path={clusterTopicPath(':clusterName', ':topicName')}>
+ <Topic
+ isTopicFetching={topicFetching}
+ fetchTopicDetails={fetchTopicDetailsMock}
+ />
+ </Route>,
+ { pathname }
+ );
+
+it('renders Edit page', () => {
+ renderComponent(clusterTopicEditPath('local', 'myTopicName'), false);
+ expect(screen.getByText('Edit Container')).toBeInTheDocument();
+});
+
+it('renders Send Message page', () => {
+ renderComponent(clusterTopicSendMessagePath('local', 'myTopicName'), false);
+ expect(screen.getByText('Send Message')).toBeInTheDocument();
+});
+
+it('renders Details Container page', () => {
+ renderComponent(clusterTopicPath('local', 'myTopicName'), false);
+ expect(screen.getByText('Details Container')).toBeInTheDocument();
+});
+
+it('renders Page loader', () => {
+ renderComponent(clusterTopicPath('local', 'myTopicName'), true);
+ expect(screen.getByText('Loading')).toBeInTheDocument();
+});
+
+it('fetches topicDetails', () => {
+ renderComponent(clusterTopicPath('local', 'myTopicName'), false);
+ expect(fetchTopicDetailsMock).toHaveBeenCalledTimes(1);
+});
| null | train | train | 2022-02-03T11:33:29 | "2022-01-28T10:52:46Z" | workshur | train |
provectus/kafka-ui/1512_1539 | provectus/kafka-ui | provectus/kafka-ui/1512 | provectus/kafka-ui/1539 | [
"connected",
"timestamp(timedelta=638.0, similarity=0.9024398401144011)"
] | 136f12d76ac8d65233d13cbf7301ac5cb9873ad4 | 529cd0bd6e4a6f057fa5e28f733ca5ef508a883b | [
"Hello there Tri0L! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"Hi, thanks for the suggestion! We'll take this into consideration :)",
"Related: #1383",
"@Tri0L thank you for suggestion. Unfortunately Number of message sorting is not likely to be done, since to calculate number of messages we need to do several heavy API calls. Currently we do it after sorting applied. \r\nAs for size - it is doable, since this data is cached (updated every 30 sec by default).",
"@ValentinPrischepa please take it to account ^"
] | [] | "2022-02-03T00:22:09Z" | [
"type/enhancement",
"good first issue",
"scope/backend",
"scope/frontend",
"status/accepted"
] | Sort topics by size | ### Is your proposal related to a problem?
Sometimes I need to find biggest topic in cluster. It will be great if I can sort list topics by `Size`/`Number of messages` in UI by click on table header like this is working for `Total partitions` or `Out of sync replicas`
| [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java",
"kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java",
"kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml"
] | [] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java
index d115f99c318..5a14e8c9aff 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java
@@ -455,6 +455,8 @@ private Comparator<InternalTopic> getComparatorForTopic(
return Comparator.comparing(t -> t.getReplicas() - t.getInSyncReplicas());
case REPLICATION_FACTOR:
return Comparator.comparing(InternalTopic::getReplicationFactor);
+ case SIZE:
+ return Comparator.comparing(InternalTopic::getSegmentSize);
case NAME:
default:
return defaultComparator;
diff --git a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
index 6fd9c4efa64..ae5e4c85c1d 100644
--- a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
+++ b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
@@ -1738,6 +1738,7 @@ components:
- OUT_OF_SYNC_REPLICAS
- TOTAL_PARTITIONS
- REPLICATION_FACTOR
+ - SIZE
SortOrder:
type: string
| null | train | train | 2022-02-09T10:22:51 | "2022-01-28T19:58:31Z" | Tri0L | train |
provectus/kafka-ui/1533_1540 | provectus/kafka-ui | provectus/kafka-ui/1533 | provectus/kafka-ui/1540 | [
"connected"
] | 8a7399b093a16c2dbe4b3bfd1d5e7d442098b585 | 00bac4eded5b4010e7ea57369afa686db945dc46 | [] | [
"I'm not sure about hiding it \r\nI think we either just have to add our styles or add `-webkit-appearance: auto;` (it will show only when user scrolls and it has scroll)\r\n\r\n",
"I have to add - that i don't think select has to scroll horizontally but i think i will be great indicator that we done something wrong",
"<img width=\"813\" alt=\"Screenshot 2022-02-04 at 12 28 02\" src=\"https://user-images.githubusercontent.com/83412197/152505105-122b02ba-a012-44ca-a8cb-c84d6fc470c0.png\">\r\n\r\nMaybe I just lower the height?"
] | "2022-02-03T09:58:28Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Too short dropdown field | Topic params:

Related to #1520. Please check the rest of dropdowns for this issue.
| [
"kafka-ui-react-app/src/components/common/Select/Select.styled.ts"
] | [
"kafka-ui-react-app/src/components/common/Select/Select.styled.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/common/Select/Select.styled.ts b/kafka-ui-react-app/src/components/common/Select/Select.styled.ts
index dd5f730d72b..e730f0528f5 100644
--- a/kafka-ui-react-app/src/components/common/Select/Select.styled.ts
+++ b/kafka-ui-react-app/src/components/common/Select/Select.styled.ts
@@ -59,17 +59,18 @@ export const OptionList = styled.ul`
position: absolute;
top: 100%;
left: 0;
- max-height: 114px;
+ max-height: 228px;
margin-top: 4px;
background-color: ${(props) => props.theme.select.backgroundColor.normal};
border: 1px ${(props) => props.theme.select.borderColor.normal} solid;
border-radius: 4px;
font-size: 14px;
line-height: 18px;
- width: 100%;
color: ${(props) => props.theme.select.color.normal};
overflow-y: scroll;
z-index: 10;
+ max-width: 300px;
+ min-width: 100%;
&::-webkit-scrollbar {
-webkit-appearance: none;
@@ -81,6 +82,10 @@ export const OptionList = styled.ul`
background-color: ${(props) =>
props.theme.select.optionList.scrollbar.backgroundColor};
}
+
+ &::-webkit-scrollbar:horizontal {
+ height: 7px;
+ }
`;
export const Option = styled.li<OptionProps>`
| null | train | train | 2022-02-03T12:06:13 | "2022-02-02T10:21:24Z" | Haarolean | train |
provectus/kafka-ui/1535_1542 | provectus/kafka-ui | provectus/kafka-ui/1535 | provectus/kafka-ui/1542 | [
"timestamp(timedelta=0.0, similarity=0.8801309823947957)",
"connected"
] | 00bac4eded5b4010e7ea57369afa686db945dc46 | 6d7817ffa73fce3110a7ed90baef4462672b7ff5 | [] | [
"It's just styling thing - i prefer this\r\n```suggestion\r\n {cleanUpPolicy === CleanUpPolicy.DELETE && (\r\n```",
"Same thing, if we have enums - i prefer to use them\r\n",
"I don't really like to use booleans like this\r\nJust exposing `cleanUpPolicy` seems fine \r\nIf we need something with other policies - we have to rewrite this or add new `isSomethingPolicy`\r\n\r\nAgain, it's just a stylistic thing "
] | "2022-02-03T16:34:41Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed",
"type/regression"
] | Button "clear all messages" shouldn't be present for some cleanup policies | **Describe the bug**
(A clear and concise description of what the bug is.)
https://github.com/provectus/kafka-ui/issues/992
**Set up**
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
https://www.kafka-ui.provectus.io/ui
**Steps to Reproduce**
Steps to reproduce the behavior:
as in the original issue
**Expected behavior**
(A clear and concise description of what you expected to happen)
**Screenshots**
(If applicable, add screenshots to help explain your problem)
**Additional context**
(Add any other context about the problem here)
| [
"kafka-ui-react-app/src/components/Topics/List/ListItem.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Details.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/Details.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/__snapshots__/Details.spec.tsx.snap"
] | [
"kafka-ui-react-app/src/components/Topics/List/ListItem.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Details.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/Details.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/__snapshots__/Details.spec.tsx.snap"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/List/ListItem.tsx b/kafka-ui-react-app/src/components/Topics/List/ListItem.tsx
index fa59db34050..7b065401a09 100644
--- a/kafka-ui-react-app/src/components/Topics/List/ListItem.tsx
+++ b/kafka-ui-react-app/src/components/Topics/List/ListItem.tsx
@@ -25,7 +25,14 @@ export interface ListItemProps {
}
const ListItem: React.FC<ListItemProps> = ({
- topic: { name, internal, partitions, segmentSize, replicationFactor },
+ topic: {
+ name,
+ internal,
+ partitions,
+ segmentSize,
+ replicationFactor,
+ cleanUpPolicy,
+ },
selected,
toggleTopicSelected,
deleteTopic,
@@ -105,9 +112,11 @@ const ListItem: React.FC<ListItemProps> = ({
{!internal && !isReadOnly && vElipsisVisble ? (
<div className="has-text-right">
<Dropdown label={<VerticalElipsisIcon />} right>
- <DropdownItem onClick={clearTopicMessagesHandler} danger>
- Clear Messages
- </DropdownItem>
+ {cleanUpPolicy === 'DELETE' && (
+ <DropdownItem onClick={clearTopicMessagesHandler} danger>
+ Clear Messages
+ </DropdownItem>
+ )}
{isTopicDeletionAllowed && (
<DropdownItem
onClick={() => setDeleteTopicConfirmationVisible(true)}
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Details.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Details.tsx
index fe98bcf0003..f83c6627624 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Details.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Details.tsx
@@ -33,6 +33,7 @@ interface Props extends Topic, TopicDetails {
topicName: TopicName;
isInternal: boolean;
isDeleted: boolean;
+ isDeletePolicy: boolean;
deleteTopic: (clusterName: ClusterName, topicName: TopicName) => void;
clearTopicMessages(clusterName: ClusterName, topicName: TopicName): void;
}
@@ -49,6 +50,7 @@ const Details: React.FC<Props> = ({
topicName,
isInternal,
isDeleted,
+ isDeletePolicy,
deleteTopic,
clearTopicMessages,
}) => {
@@ -103,12 +105,14 @@ const Details: React.FC<Props> = ({
>
Edit settings
</DropdownItem>
- <DropdownItem
- onClick={() => setClearTopicConfirmationVisible(true)}
- danger
- >
- Clear messages
- </DropdownItem>
+ {isDeletePolicy && (
+ <DropdownItem
+ onClick={() => setClearTopicConfirmationVisible(true)}
+ danger
+ >
+ Clear messages
+ </DropdownItem>
+ )}
{isTopicDeletionAllowed && (
<DropdownItem
onClick={() => setDeleteTopicConfirmationVisible(true)}
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx
index 7a967cc4878..e6d11e30f0a 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx
@@ -102,7 +102,7 @@ const Overview: React.FC<Props> = ({
<td>{offsetMin}</td>
<td>{offsetMax}</td>
<td style={{ width: '5%' }}>
- {!internal && !isReadOnly ? (
+ {!internal && !isReadOnly && cleanUpPolicy === 'DELETE' ? (
<Dropdown label={<VerticalElipsisIcon />} right>
<DropdownItem
onClick={() =>
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx
index 1373e4880fb..226f59b0ccc 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx
@@ -5,6 +5,7 @@ import Overview, {
Props as OverviewProps,
} from 'components/Topics/Topic/Details/Overview/Overview';
import theme from 'theme/theme';
+import { CleanUpPolicy } from 'generated-sources';
describe('Overview', () => {
const mockClusterName = 'local';
@@ -49,6 +50,7 @@ describe('Overview', () => {
internal: false,
clusterName: mockClusterName,
topicName: mockTopicName,
+ cleanUpPolicy: CleanUpPolicy.DELETE,
clearTopicMessages: mockClearTopicMessages,
});
expect(screen.getByRole('menu')).toBeInTheDocument();
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/Details.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/Details.spec.tsx
index 11fa6ab30dc..a175b5c0b3c 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/Details.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/Details.spec.tsx
@@ -37,6 +37,7 @@ describe('Details', () => {
deleteTopic={mockDelete}
clearTopicMessages={mockClearTopicMessages}
isDeleted={false}
+ isDeletePolicy
/>
</ClusterContext.Provider>,
{ pathname }
@@ -64,6 +65,7 @@ describe('Details', () => {
deleteTopic={mockDelete}
clearTopicMessages={mockClearTopicMessages}
isDeleted={false}
+ isDeletePolicy
/>
</ClusterContext.Provider>
</StaticRouter>
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/__snapshots__/Details.spec.tsx.snap b/kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/__snapshots__/Details.spec.tsx.snap
index 84e17d8d92c..386777843e9 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/__snapshots__/Details.spec.tsx.snap
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/__snapshots__/Details.spec.tsx.snap
@@ -482,6 +482,7 @@ exports[`Details when it has readonly flag does not render the Action button a T
clearTopicMessages={[MockFunction]}
clusterName="local"
deleteTopic={[MockFunction]}
+ isDeletePolicy={true}
isDeleted={false}
isInternal={true}
name="__internal.topic"
| null | train | train | 2022-02-04T13:22:52 | "2022-02-02T10:52:54Z" | Khakha-A | train |
provectus/kafka-ui/127_1547 | provectus/kafka-ui | provectus/kafka-ui/127 | provectus/kafka-ui/1547 | [
"connected"
] | 136f12d76ac8d65233d13cbf7301ac5cb9873ad4 | 1699663bacb25c2e8dca7b3b778ce1d683ce41cf | [
"#1741 "
] | [] | "2022-02-04T11:59:54Z" | [
"scope/backend",
"scope/frontend",
"status/accepted",
"type/feature"
] | Topic messages: Smart filters | 1. Add query parameter js-filter with java script predicate function
2. Add Nashorn dependency
3. Filter messages before string inclusion using this function and record
4. Pass variables to function:
4.1 key (key object)
4.2 value (content object)
4.3 headers
4.4 offset
4.5 partition
UPD: design for the frontend part is already done on figma
+ Support message preview (partial selection of json fields)
+ Support searching by message headers (requested in #780) | [
"kafka-ui-api/pom.xml",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/MessagesController.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/MessagesService.java",
"kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml",
"pom.xml"
] | [
"kafka-ui-api/pom.xml",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/MessagesController.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/MessageFilters.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/MessagesService.java",
"kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml",
"pom.xml"
] | [
"kafka-ui-api/src/test/java/com/provectus/kafka/ui/emitter/MessageFiltersTest.java",
"kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/SendAndReadTests.java"
] | diff --git a/kafka-ui-api/pom.xml b/kafka-ui-api/pom.xml
index a6092e84474..0a07d322568 100644
--- a/kafka-ui-api/pom.xml
+++ b/kafka-ui-api/pom.xml
@@ -202,6 +202,18 @@
<artifactId>spring-security-ldap</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-jsr223</artifactId>
+ <version>${groovy.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-json</artifactId>
+ <version>${groovy.version}</version>
+ </dependency>
+
</dependencies>
<build>
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/MessagesController.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/MessagesController.java
index a7abe364b82..de626778d9d 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/MessagesController.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/MessagesController.java
@@ -3,6 +3,7 @@
import com.provectus.kafka.ui.api.MessagesApi;
import com.provectus.kafka.ui.model.ConsumerPosition;
import com.provectus.kafka.ui.model.CreateTopicMessageDTO;
+import com.provectus.kafka.ui.model.MessageFilterTypeDTO;
import com.provectus.kafka.ui.model.SeekDirectionDTO;
import com.provectus.kafka.ui.model.SeekTypeDTO;
import com.provectus.kafka.ui.model.TopicMessageEventDTO;
@@ -44,14 +45,14 @@ public Mono<ResponseEntity<Void>> deleteTopicMessages(
@Override
public Mono<ResponseEntity<Flux<TopicMessageEventDTO>>> getTopicMessages(
- String clusterName, String topicName, @Valid SeekTypeDTO seekType, @Valid List<String> seekTo,
- @Valid Integer limit, @Valid String q, @Valid SeekDirectionDTO seekDirection,
- ServerWebExchange exchange) {
+ String clusterName, String topicName, SeekTypeDTO seekType, List<String> seekTo,
+ Integer limit, String q, MessageFilterTypeDTO filterQueryType,
+ SeekDirectionDTO seekDirection, ServerWebExchange exchange) {
return parseConsumerPosition(topicName, seekType, seekTo, seekDirection)
.map(position ->
ResponseEntity.ok(
messagesService.loadMessages(
- getCluster(clusterName), topicName, position, q, limit)
+ getCluster(clusterName), topicName, position, q, filterQueryType, limit)
)
);
}
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/MessageFilters.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/MessageFilters.java
new file mode 100644
index 00000000000..ee14f1b66dc
--- /dev/null
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/MessageFilters.java
@@ -0,0 +1,91 @@
+package com.provectus.kafka.ui.emitter;
+
+import com.provectus.kafka.ui.exception.ValidationException;
+import com.provectus.kafka.ui.model.MessageFilterTypeDTO;
+import com.provectus.kafka.ui.model.TopicMessageDTO;
+import groovy.json.JsonSlurper;
+import java.util.function.Predicate;
+import javax.annotation.Nullable;
+import javax.script.CompiledScript;
+import javax.script.ScriptEngineManager;
+import javax.script.ScriptException;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.codehaus.groovy.jsr223.GroovyScriptEngineImpl;
+
+@Slf4j
+public class MessageFilters {
+
+ private static GroovyScriptEngineImpl GROOVY_ENGINE;
+
+ public static Predicate<TopicMessageDTO> createMsgFilter(String query, MessageFilterTypeDTO type) {
+ switch (type) {
+ case STRING_CONTAINS:
+ return containsStringFilter(query);
+ case GROOVY_SCRIPT:
+ return groovyScriptFilter(query);
+ default:
+ throw new IllegalStateException("Unknown query type: " + type);
+ }
+ }
+
+ static Predicate<TopicMessageDTO> containsStringFilter(String string) {
+ return msg -> StringUtils.contains(msg.getKey(), string)
+ || StringUtils.contains(msg.getContent(), string);
+ }
+
+ static Predicate<TopicMessageDTO> groovyScriptFilter(String script) {
+ var compiledScript = compileScript(script);
+ var jsonSlurper = new JsonSlurper();
+ return msg -> {
+ var bindings = getGroovyEngine().createBindings();
+ bindings.put("partition", msg.getPartition());
+ bindings.put("timestampMs", msg.getTimestamp().toInstant().toEpochMilli());
+ bindings.put("keyAsText", msg.getKey());
+ bindings.put("valueAsText", msg.getContent());
+ bindings.put("headers", msg.getHeaders());
+ bindings.put("key", parseToJsonOrReturnNull(jsonSlurper, msg.getKey()));
+ bindings.put("value", parseToJsonOrReturnNull(jsonSlurper, msg.getContent()));
+ try {
+ var result = compiledScript.eval(bindings);
+ if (result instanceof Boolean) {
+ return (Boolean) result;
+ }
+ return false;
+ } catch (Exception e) {
+ log.trace("Error executing filter script '{}' on message '{}' ", script, msg, e);
+ return false;
+ }
+ };
+ }
+
+ @Nullable
+ private static Object parseToJsonOrReturnNull(JsonSlurper parser, @Nullable String str) {
+ if (str == null) {
+ return null;
+ }
+ try {
+ return parser.parseText(str);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ private static synchronized GroovyScriptEngineImpl getGroovyEngine() {
+ // it is pretty heavy object, so initializing it on-demand
+ if (GROOVY_ENGINE == null) {
+ GROOVY_ENGINE = (GroovyScriptEngineImpl)
+ new ScriptEngineManager().getEngineByName("groovy");
+ }
+ return GROOVY_ENGINE;
+ }
+
+ private static CompiledScript compileScript(String script) {
+ try {
+ return getGroovyEngine().compile(script);
+ } catch (ScriptException e) {
+ throw new ValidationException("Script syntax error: " + e.getMessage());
+ }
+ }
+
+}
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/MessagesService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/MessagesService.java
index 04998d4bb5a..504f088ab99 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/MessagesService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/MessagesService.java
@@ -2,13 +2,14 @@
import com.provectus.kafka.ui.emitter.BackwardRecordEmitter;
import com.provectus.kafka.ui.emitter.ForwardRecordEmitter;
+import com.provectus.kafka.ui.emitter.MessageFilters;
import com.provectus.kafka.ui.exception.TopicNotFoundException;
import com.provectus.kafka.ui.exception.ValidationException;
import com.provectus.kafka.ui.model.ConsumerPosition;
import com.provectus.kafka.ui.model.CreateTopicMessageDTO;
import com.provectus.kafka.ui.model.KafkaCluster;
+import com.provectus.kafka.ui.model.MessageFilterTypeDTO;
import com.provectus.kafka.ui.model.SeekDirectionDTO;
-import com.provectus.kafka.ui.model.TopicMessageDTO;
import com.provectus.kafka.ui.model.TopicMessageEventDTO;
import com.provectus.kafka.ui.serde.DeserializationService;
import com.provectus.kafka.ui.serde.RecordSerDe;
@@ -20,10 +21,12 @@
import java.util.Optional;
import java.util.Properties;
import java.util.concurrent.CompletableFuture;
+import java.util.function.Predicate;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
import org.apache.kafka.clients.admin.OffsetSpec;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerConfig;
@@ -35,7 +38,6 @@
import org.apache.kafka.common.header.internals.RecordHeaders;
import org.apache.kafka.common.serialization.ByteArraySerializer;
import org.springframework.stereotype.Service;
-import org.springframework.util.StringUtils;
import reactor.core.publisher.Flux;
import reactor.core.publisher.FluxSink;
import reactor.core.publisher.Mono;
@@ -131,6 +133,7 @@ private Iterable<Header> createHeaders(@Nullable Map<String, String> clientHeade
public Flux<TopicMessageEventDTO> loadMessages(KafkaCluster cluster, String topic,
ConsumerPosition consumerPosition, String query,
+ MessageFilterTypeDTO filterQueryType,
Integer limit) {
int recordsLimit = Optional.ofNullable(limit)
.map(s -> Math.min(s, MAX_LOAD_RECORD_LIMIT))
@@ -153,21 +156,26 @@ public Flux<TopicMessageEventDTO> loadMessages(KafkaCluster cluster, String topi
);
}
return Flux.create(emitter)
- .filter(m -> filterTopicMessage(m, query))
+ .filter(getMsgFilter(query, filterQueryType))
.takeWhile(new FilterTopicMessageEvents(recordsLimit))
.subscribeOn(Schedulers.elastic())
.share();
}
- private boolean filterTopicMessage(TopicMessageEventDTO message, String query) {
- if (StringUtils.isEmpty(query)
- || !message.getType().equals(TopicMessageEventDTO.TypeEnum.MESSAGE)) {
- return true;
+ private Predicate<TopicMessageEventDTO> getMsgFilter(String query, MessageFilterTypeDTO filterQueryType) {
+ if (StringUtils.isEmpty(query)) {
+ return evt -> true;
}
-
- final TopicMessageDTO msg = message.getMessage();
- return (!StringUtils.isEmpty(msg.getKey()) && msg.getKey().contains(query))
- || (!StringUtils.isEmpty(msg.getContent()) && msg.getContent().contains(query));
+ filterQueryType = Optional.ofNullable(filterQueryType)
+ .orElse(MessageFilterTypeDTO.STRING_CONTAINS);
+ var messageFilter = MessageFilters.createMsgFilter(query, filterQueryType);
+ return evt -> {
+ // we only apply filter for message events
+ if (evt.getType() == TopicMessageEventDTO.TypeEnum.MESSAGE) {
+ return messageFilter.test(evt.getMessage());
+ }
+ return true;
+ };
}
}
diff --git a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
index 6fd9c4efa64..9436dc8c9e7 100644
--- a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
+++ b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
@@ -500,6 +500,10 @@ paths:
in: query
schema:
type: string
+ - name: filterQueryType
+ in: query
+ schema:
+ $ref: "#/components/schemas/MessageFilterType"
- name: seekDirection
in: query
schema:
@@ -2088,6 +2092,12 @@ components:
- OFFSET
- TIMESTAMP
+ MessageFilterType:
+ type: string
+ enum:
+ - STRING_CONTAINS
+ - GROOVY_SCRIPT
+
SeekDirection:
type: string
enum:
diff --git a/pom.xml b/pom.xml
index 77f9345a899..b08a67743a4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,6 +40,7 @@
<mockito.version>2.21.0</mockito.version>
<assertj.version>3.19.0</assertj.version>
<antlr4-maven-plugin.version>4.7.1</antlr4-maven-plugin.version>
+ <groovy.version>3.0.9</groovy.version>
<frontend-generated-sources-directory>..//kafka-ui-react-app/src/generated-sources
</frontend-generated-sources-directory>
| diff --git a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/emitter/MessageFiltersTest.java b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/emitter/MessageFiltersTest.java
new file mode 100644
index 00000000000..ded921bfcd9
--- /dev/null
+++ b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/emitter/MessageFiltersTest.java
@@ -0,0 +1,173 @@
+package com.provectus.kafka.ui.emitter;
+
+import static com.provectus.kafka.ui.emitter.MessageFilters.containsStringFilter;
+import static com.provectus.kafka.ui.emitter.MessageFilters.groovyScriptFilter;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import com.provectus.kafka.ui.exception.ValidationException;
+import com.provectus.kafka.ui.model.TopicMessageDTO;
+import java.time.OffsetDateTime;
+import java.time.temporal.ChronoUnit;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.function.Predicate;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.junit.jupiter.api.Nested;
+import org.junit.jupiter.api.Test;
+
+class MessageFiltersTest {
+
+ @Nested
+ class StringContainsFilter {
+
+ Predicate<TopicMessageDTO> filter = containsStringFilter("abC");
+
+ @Test
+ void returnsTrueWhenStringContainedInKeyOrContentOrInBoth() {
+ assertTrue(
+ filter.test(msg().key("contains abCd").content("some str"))
+ );
+
+ assertTrue(
+ filter.test(msg().key("some str").content("contains abCd"))
+ );
+
+ assertTrue(
+ filter.test(msg().key("contains abCd").content("contains abCd"))
+ );
+ }
+
+ @Test
+ void returnsFalseOtherwise() {
+ assertFalse(
+ filter.test(msg().key("some str").content("some str"))
+ );
+
+ assertFalse(
+ filter.test(msg().key(null).content(null))
+ );
+
+ assertFalse(
+ filter.test(msg().key("aBc").content("AbC"))
+ );
+ }
+
+ }
+
+ @Nested
+ class GroovyScriptFilter {
+
+ @Test
+ void throwsExceptionOnInvalidGroovySyntax() {
+ assertThrows(ValidationException.class,
+ () -> groovyScriptFilter("this is invalid groovy syntax = 1"));
+ }
+
+ @Test
+ void canCheckPartition() {
+ var f = groovyScriptFilter("partition == 1");
+ assertTrue(f.test(msg().partition(1)));
+ assertFalse(f.test(msg().partition(0)));
+ }
+
+ @Test
+ void canCheckTimestampMs() {
+ var ts = OffsetDateTime.now();
+ var f = groovyScriptFilter("timestampMs == " + ts.toInstant().toEpochMilli());
+ assertTrue(f.test(msg().timestamp(ts)));
+ assertFalse(f.test(msg().timestamp(ts.plus(1L, ChronoUnit.SECONDS))));
+ }
+
+ @Test
+ void canCheckValueAsText() {
+ var f = groovyScriptFilter("valueAsText == 'some text'");
+ assertTrue(f.test(msg().content("some text")));
+ assertFalse(f.test(msg().content("some other text")));
+ }
+
+ @Test
+ void canCheckKeyAsText() {
+ var f = groovyScriptFilter("keyAsText == 'some text'");
+ assertTrue(f.test(msg().key("some text")));
+ assertFalse(f.test(msg().key("some other text")));
+ }
+
+ @Test
+ void canCheckKeyAsJsonObjectIfItCanBeParsedToJson() {
+ var f = groovyScriptFilter("key.name.first == 'user1'");
+ assertTrue(f.test(msg().key("{ \"name\" : { \"first\" : \"user1\" } }")));
+ assertFalse(f.test(msg().key("{ \"name\" : { \"first\" : \"user2\" } }")));
+ }
+
+ @Test
+ void keySetToNullIfKeyCantBeParsedToJson() {
+ var f = groovyScriptFilter("key == null");
+ assertTrue(f.test(msg().key("not json")));
+ assertFalse(f.test(msg().key("{ \"k\" : \"v\" }")));
+ }
+
+ @Test
+ void canCheckValueAsJsonObjectIfItCanBeParsedToJson() {
+ var f = groovyScriptFilter("value.name.first == 'user1'");
+ assertTrue(f.test(msg().content("{ \"name\" : { \"first\" : \"user1\" } }")));
+ assertFalse(f.test(msg().content("{ \"name\" : { \"first\" : \"user2\" } }")));
+ }
+
+ @Test
+ void valueSetToNullIfKeyCantBeParsedToJson() {
+ var f = groovyScriptFilter("value == null");
+ assertTrue(f.test(msg().content("not json")));
+ assertFalse(f.test(msg().content("{ \"k\" : \"v\" }")));
+ }
+
+ @Test
+ void canRunMultiStatementScripts() {
+ var f = groovyScriptFilter("def name = value.name.first \n return name == 'user1' ");
+ assertTrue(f.test(msg().content("{ \"name\" : { \"first\" : \"user1\" } }")));
+ assertFalse(f.test(msg().content("{ \"name\" : { \"first\" : \"user2\" } }")));
+
+ f = groovyScriptFilter("def name = value.name.first; return name == 'user1' ");
+ assertTrue(f.test(msg().content("{ \"name\" : { \"first\" : \"user1\" } }")));
+ assertFalse(f.test(msg().content("{ \"name\" : { \"first\" : \"user2\" } }")));
+
+ f = groovyScriptFilter("def name = value.name.first; name == 'user1' ");
+ assertTrue(f.test(msg().content("{ \"name\" : { \"first\" : \"user1\" } }")));
+ assertFalse(f.test(msg().content("{ \"name\" : { \"first\" : \"user2\" } }")));
+ }
+
+
+ @Test
+ void filterSpeedIsAtLeast10kPerSec() {
+ var f = groovyScriptFilter("value.name.first == 'user1' && keyAsText.startsWith('a') ");
+
+ List<TopicMessageDTO> toFilter = new ArrayList<>();
+ for (int i = 0; i < 5_000; i++) {
+ String name = i % 2 == 0 ? "user1" : RandomStringUtils.randomAlphabetic(10);
+ String randString = RandomStringUtils.randomAlphabetic(30);
+ String jsonContent = String.format(
+ "{ \"name\" : { \"randomStr\": \"%s\", \"first\" : \"%s\"} }",
+ randString, name);
+ toFilter.add(msg().content(jsonContent).key(randString));
+ }
+ // first iteration for warmup
+ toFilter.stream().filter(f).count();
+
+ long before = System.currentTimeMillis();
+ long matched = toFilter.stream().filter(f).count();
+ long took = System.currentTimeMillis() - before;
+
+ assertThat(took).isLessThan(500);
+ assertThat(matched).isGreaterThan(0);
+ }
+ }
+
+ private TopicMessageDTO msg() {
+ return new TopicMessageDTO()
+ .timestamp(OffsetDateTime.now())
+ .partition(1);
+ }
+
+}
\ No newline at end of file
diff --git a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/SendAndReadTests.java b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/SendAndReadTests.java
index 864c1912487..84edb4518eb 100644
--- a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/SendAndReadTests.java
+++ b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/SendAndReadTests.java
@@ -547,6 +547,7 @@ public void doAssert(Consumer<TopicMessageDTO> msgAssert) {
SeekDirectionDTO.FORWARD
),
null,
+ null,
1
).filter(e -> e.getType().equals(TopicMessageEventDTO.TypeEnum.MESSAGE))
.map(TopicMessageEventDTO::getMessage)
| train | train | 2022-02-09T10:22:51 | "2020-11-24T12:18:11Z" | soffest | train |
provectus/kafka-ui/1521_1553 | provectus/kafka-ui | provectus/kafka-ui/1521 | provectus/kafka-ui/1553 | [
"keyword_pr_to_issue",
"connected"
] | 6428cbef4a2948748fd58eec3dbc764aa713d527 | e2a3b7b2631163f9c3f60b618e2c71851dbfed40 | [
"Hello there Alepacox! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"Hey, thanks for the suggestion. This seems like a good feature, we'll get this implemented :)",
"I'm glad to hear that, thank you so much!"
] | [] | "2022-02-04T13:54:49Z" | [
"type/enhancement",
"good first issue",
"scope/backend",
"scope/frontend",
"status/accepted",
"status/pending-frontend"
] | Show IP and port of brokers in UI/API | Good morning, thank you very much for the great work you are doing.
I just wanted to know if there is a possibility to also show the port of the brokers on the /clusters/clusterName/brokers endpoint.
It would be so useful for scenarios where brokers are added to the cluster with random port mappings, so that you can connect to the brokers by querying the Kafka-UI API first.
Morover, those same data could be displayed in the UI (/ui/clusters/Local/brokers) along with each broker ID.
Thank you so much.
| [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/mapper/ConsumerGroupMapper.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/BrokerService.java",
"kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/mapper/ConsumerGroupMapper.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/BrokerService.java",
"kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml"
] | [
"kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/BrokerServiceTest.java"
] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/mapper/ConsumerGroupMapper.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/mapper/ConsumerGroupMapper.java
index b821d920cf7..192058449f6 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/mapper/ConsumerGroupMapper.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/mapper/ConsumerGroupMapper.java
@@ -93,7 +93,7 @@ private static <T extends ConsumerGroupDTO> T convertToConsumerGroup(
}
private static BrokerDTO mapCoordinator(Node node) {
- return new BrokerDTO().host(node.host()).id(node.id());
+ return new BrokerDTO().host(node.host()).id(node.id()).port(node.port());
}
private static ConsumerGroupStateDTO mapConsumerGroupState(
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/BrokerService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/BrokerService.java
index e51d60e2b61..0f5085eb334 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/BrokerService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/BrokerService.java
@@ -78,6 +78,7 @@ public Flux<BrokerDTO> getBrokers(KafkaCluster cluster) {
BrokerDTO broker = new BrokerDTO();
broker.setId(node.id());
broker.setHost(node.host());
+ broker.setPort(node.port());
return broker;
}).collect(Collectors.toList()))
.flatMapMany(Flux::fromIterable);
diff --git a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
index 277c6d71520..b2d5a685891 100644
--- a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
+++ b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
@@ -1910,6 +1910,8 @@ components:
type: integer
host:
type: string
+ port:
+ type: integer
required:
- id
| diff --git a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/BrokerServiceTest.java b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/BrokerServiceTest.java
new file mode 100644
index 00000000000..816ec61eee3
--- /dev/null
+++ b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/BrokerServiceTest.java
@@ -0,0 +1,59 @@
+package com.provectus.kafka.ui.service;
+
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+import com.provectus.kafka.ui.AbstractBaseTest;
+import com.provectus.kafka.ui.mapper.ClusterMapperImpl;
+import com.provectus.kafka.ui.mapper.DescribeLogDirsMapper;
+import com.provectus.kafka.ui.model.BrokerDTO;
+import com.provectus.kafka.ui.model.KafkaCluster;
+import java.util.Properties;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.springframework.test.context.ContextConfiguration;
+import reactor.test.StepVerifier;
+
+@ContextConfiguration(initializers = {AbstractBaseTest.Initializer.class})
+class BrokerServiceTest extends AbstractBaseTest {
+ private final KafkaCluster kafkaCluster =
+ KafkaCluster.builder()
+ .name(LOCAL)
+ .bootstrapServers(kafka.getBootstrapServers())
+ .properties(new Properties())
+ .build();
+
+ private BrokerService brokerService;
+
+ @BeforeEach
+ void init() {
+ AdminClientServiceImpl adminClientService = new AdminClientServiceImpl();
+ adminClientService.setClientTimeout(5_000);
+ brokerService =
+ new BrokerService(new MetricsCache(), adminClientService, new DescribeLogDirsMapper(), new ClusterMapperImpl());
+ }
+
+ @Test
+ void getBrokersNominal() {
+ BrokerDTO brokerdto = new BrokerDTO();
+ brokerdto.setId(1);
+ brokerdto.setHost("localhost");
+ String port = kafka.getBootstrapServers().substring(kafka.getBootstrapServers().lastIndexOf(":") + 1);
+ brokerdto.setPort(Integer.parseInt(port));
+
+ StepVerifier.create(brokerService.getBrokers(kafkaCluster))
+ .expectNext(brokerdto)
+ .verifyComplete();
+ }
+
+ @Test
+ void getBrokersNull() {
+ assertThatThrownBy(() -> brokerService.getBrokers(null)).isInstanceOf(NullPointerException.class);
+ }
+
+ @Test
+ void getBrokersEmpty() {
+ assertThatThrownBy(() -> brokerService.getBrokers(KafkaCluster.builder().build())).isInstanceOf(
+ NullPointerException.class);
+ }
+
+}
\ No newline at end of file
| val | train | 2022-02-16T16:25:41 | "2022-01-31T09:07:38Z" | Alepacox | train |
provectus/kafka-ui/1554_1565 | provectus/kafka-ui | provectus/kafka-ui/1554 | provectus/kafka-ui/1565 | [
"connected"
] | fbbc6537c8cc533901451003dcb7ff453b5d6b1c | 58fdb85fb89ae18a5bf9d6a0299666a90a399b7d | [
"#1268 ?"
] | [] | "2022-02-07T12:49:06Z" | [
"type/bug",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Inconsistency in stats of Topics and Brokers [Bug] | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
Stats of Brokers and Topics look different for similar parameters (URP and ISR).
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
https://www.kafka-ui.provectus.io/ui
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Go to Brokers page, look at stats of Partitions
2. URP has no dot; neither In Sync Replicas, also it written in full name (see attachment)
3. Go to Topics -> Click some topic name, look at topic`s overview stats
4. URP has red dot (although it should have a green one for 0), ISR is written in abbreviation and has a green dot for 1 of 1.
**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
URP and ISR look same for Brokers partitions and Topics overview
**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->
<img width="1087" alt="Screenshot 2022-02-04 at 19 46 38" src="https://user-images.githubusercontent.com/92585878/152577563-9c4fbbfc-e68d-4820-a982-e182f4fd6e81.png">
<img width="626" alt="Screenshot 2022-02-04 at 19 46 03" src="https://user-images.githubusercontent.com/92585878/152577549-d585d930-b387-4df4-b6b1-49e06e2c6048.png">
**Additional context**
<!--
(Add any other context about the problem here)
-->
| [
"kafka-ui-react-app/src/components/Brokers/Brokers.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx"
] | [
"kafka-ui-react-app/src/components/Brokers/Brokers.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Brokers/Brokers.tsx b/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
index 99f0454fc12..411f7cf414d 100644
--- a/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
+++ b/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
@@ -30,6 +30,9 @@ const Brokers: React.FC = () => {
version,
} = useAppSelector(selectStats);
+ let replicas = inSyncReplicasCount ?? 0;
+ replicas += outOfSyncReplicasCount ?? 0;
+
React.useEffect(() => {
dispatch(fetchClusterStats(clusterName));
}, [fetchClusterStats, clusterName]);
@@ -78,11 +81,35 @@ const Brokers: React.FC = () => {
of {(onlinePartitionCount || 0) + (offlinePartitionCount || 0)}
</Metrics.LightText>
</Metrics.Indicator>
- <Metrics.Indicator label="URP" title="Under replicated partitions">
- {underReplicatedPartitionCount}
+ <Metrics.Indicator
+ label="URP"
+ title="Under replicated partitions"
+ isAlert
+ alertType={
+ underReplicatedPartitionCount === 0 ? 'success' : 'error'
+ }
+ >
+ {underReplicatedPartitionCount === 0 ? (
+ <Metrics.LightText>
+ {underReplicatedPartitionCount}
+ </Metrics.LightText>
+ ) : (
+ <Metrics.RedText>{underReplicatedPartitionCount}</Metrics.RedText>
+ )}
</Metrics.Indicator>
- <Metrics.Indicator label="In Sync Replicas">
- {inSyncReplicasCount}
+ <Metrics.Indicator
+ label="In Sync Replicas"
+ isAlert
+ alertType={inSyncReplicasCount === replicas ? 'success' : 'error'}
+ >
+ {inSyncReplicasCount &&
+ replicas &&
+ inSyncReplicasCount < replicas ? (
+ <Metrics.RedText>{inSyncReplicasCount}</Metrics.RedText>
+ ) : (
+ inSyncReplicasCount
+ )}
+ <Metrics.LightText> of {replicas}</Metrics.LightText>
</Metrics.Indicator>
<Metrics.Indicator label="Out Of Sync Replicas">
{outOfSyncReplicasCount}
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx
index e6d11e30f0a..458d2dff6a3 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx
@@ -52,13 +52,16 @@ const Overview: React.FC<Props> = ({
label="URP"
title="Under replicated partitions"
isAlert
- alertType={underReplicatedPartitions === 0 ? 'error' : 'success'}
+ alertType={underReplicatedPartitions === 0 ? 'success' : 'error'}
>
- <Metrics.RedText>{underReplicatedPartitions}</Metrics.RedText>
+ {underReplicatedPartitions === 0 ? (
+ <Metrics.LightText>{underReplicatedPartitions}</Metrics.LightText>
+ ) : (
+ <Metrics.RedText>{underReplicatedPartitions}</Metrics.RedText>
+ )}
</Metrics.Indicator>
<Metrics.Indicator
- label="ISR"
- title="In Sync Replicas"
+ label="In Sync Replicas"
isAlert
alertType={inSyncReplicas === replicas ? 'success' : 'error'}
>
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx
index 226f59b0ccc..392cab08ca9 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx
@@ -98,7 +98,7 @@ describe('Overview', () => {
});
const circles = screen.getAllByRole('circle');
expect(circles[0]).toHaveStyle(
- `fill: ${theme.circularAlert.color.error}`
+ `fill: ${theme.circularAlert.color.success}`
);
expect(circles[1]).toHaveStyle(
`fill: ${theme.circularAlert.color.error}`
| null | test | train | 2022-02-14T11:27:42 | "2022-02-04T17:48:06Z" | agolosen | train |
provectus/kafka-ui/1545_1570 | provectus/kafka-ui | provectus/kafka-ui/1545 | provectus/kafka-ui/1570 | [
"timestamp(timedelta=0.0, similarity=0.9341314773691368)",
"connected"
] | a040a66f09cf18d6242c8819cba3d423e1d69695 | 164d33b7070000db5c9a075f3d355c6d14e701bd | [
"Hey, thanks for the suggestion. Definitely will do :)"
] | [
"Put this outside of hook, you need to define this constant only once",
"Also, correct the spelling of word DISSMISS",
"it's not a good idea to name a variable 'test',change the name please",
"Typo\r\n```suggestion\r\nconst AUTO_DISMISS_TIME = 2000;\r\n```",
"Cool \r\nI will use this in my PR",
"Move dispatch outside copyToClipboard, the hooks should be called only in other hook/component 1st level scope"
] | "2022-02-07T17:11:44Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted"
] | [Feature] Feedback to the user when a message content is copied to clipboard | When I copy a message to my clipboard, there is no clear indications that it is done.
Obviously, I can paste it wherever I want.
But I'd find nice to have some notifications anywhere that would say me "message copied to clipboard" then disappears some seconds later.
Version tested : ([8a7399b](https://github.com/provectus/kafka-ui/commit/8a7399b)) | [
"kafka-ui-react-app/src/lib/hooks/__tests__/useDataSaver.spec.tsx",
"kafka-ui-react-app/src/lib/hooks/useDataSaver.ts"
] | [
"kafka-ui-react-app/src/lib/hooks/__tests__/useDataSaver.spec.tsx",
"kafka-ui-react-app/src/lib/hooks/useDataSaver.ts"
] | [] | diff --git a/kafka-ui-react-app/src/lib/hooks/__tests__/useDataSaver.spec.tsx b/kafka-ui-react-app/src/lib/hooks/__tests__/useDataSaver.spec.tsx
index 85a06d3ca5e..bc2cc9b66ce 100644
--- a/kafka-ui-react-app/src/lib/hooks/__tests__/useDataSaver.spec.tsx
+++ b/kafka-ui-react-app/src/lib/hooks/__tests__/useDataSaver.spec.tsx
@@ -1,9 +1,12 @@
+import React, { useEffect } from 'react';
+import { render } from 'lib/testHelpers';
import useDataSaver from 'lib/hooks/useDataSaver';
describe('useDataSaver hook', () => {
const content = {
title: 'title',
};
+
describe('Save as file', () => {
beforeAll(() => {
jest.useFakeTimers('modern');
@@ -20,10 +23,14 @@ describe('useDataSaver hook', () => {
.spyOn(document, 'createElement')
.mockImplementation(() => link);
- const { saveFile } = useDataSaver('message', content);
- saveFile();
+ const HookWrapper: React.FC = () => {
+ const { saveFile } = useDataSaver('message', content);
+ useEffect(() => saveFile(), []);
+ return null;
+ };
- expect(mockCreate).toHaveBeenCalledTimes(1);
+ render(<HookWrapper />);
+ expect(mockCreate).toHaveBeenCalledTimes(2);
expect(link.download).toEqual('message_1616581196000.json');
expect(link.href).toEqual(
`data:text/json;charset=utf-8,${encodeURIComponent(
@@ -43,10 +50,14 @@ describe('useDataSaver hook', () => {
.spyOn(document, 'createElement')
.mockImplementation(() => link);
- const { saveFile } = useDataSaver('message', 'content');
- saveFile();
+ const HookWrapper: React.FC = () => {
+ const { saveFile } = useDataSaver('message', 'content');
+ useEffect(() => saveFile(), []);
+ return null;
+ };
- expect(mockCreate).toHaveBeenCalledTimes(1);
+ render(<HookWrapper />);
+ expect(mockCreate).toHaveBeenCalledTimes(2);
expect(link.download).toEqual('message_1616581196000.txt');
expect(link.href).toEqual(
`data:text/json;charset=utf-8,${encodeURIComponent(
@@ -66,9 +77,14 @@ describe('useDataSaver hook', () => {
},
});
jest.spyOn(navigator.clipboard, 'writeText');
- const { copyToClipboard } = useDataSaver('topic', content);
- copyToClipboard();
+ const HookWrapper: React.FC = () => {
+ const { copyToClipboard } = useDataSaver('topic', content);
+ useEffect(() => copyToClipboard(), []);
+ return null;
+ };
+
+ render(<HookWrapper />);
expect(navigator.clipboard.writeText).toHaveBeenCalledWith(
JSON.stringify(content)
);
diff --git a/kafka-ui-react-app/src/lib/hooks/useDataSaver.ts b/kafka-ui-react-app/src/lib/hooks/useDataSaver.ts
index b2c57ea7703..25c42602f12 100644
--- a/kafka-ui-react-app/src/lib/hooks/useDataSaver.ts
+++ b/kafka-ui-react-app/src/lib/hooks/useDataSaver.ts
@@ -1,13 +1,28 @@
import { isObject } from 'lodash';
+import { alertAdded, alertDissmissed } from 'redux/reducers/alerts/alertsSlice';
+import { useAppDispatch } from 'lib/hooks/redux';
+
+const AUTO_DISMISS_TIME = 2000;
const useDataSaver = (
subject: string,
data: Record<string, string> | string
) => {
+ const dispatch = useAppDispatch();
const copyToClipboard = () => {
if (navigator.clipboard) {
const str = JSON.stringify(data);
navigator.clipboard.writeText(str);
+ dispatch(
+ alertAdded({
+ id: subject,
+ type: 'success',
+ title: '',
+ message: 'Copied successfully!',
+ createdAt: Date.now(),
+ })
+ );
+ setTimeout(() => dispatch(alertDissmissed(subject)), AUTO_DISMISS_TIME);
}
};
| null | test | train | 2022-02-09T15:59:22 | "2022-02-03T20:20:35Z" | giom-l | train |
provectus/kafka-ui/1472_1574 | provectus/kafka-ui | provectus/kafka-ui/1472 | provectus/kafka-ui/1574 | [
"connected"
] | d13d4dc327cef08d7b61956b7e84cd57af781bf2 | f3c07b15e55970960b0273828bf0968506989e8f | [
"Hello there cleboo! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"Hey, thanks for reaching out.\r\n\r\nThis is for sure because of the zookeeper. We'll take a look.",
"You have a wrong port set up:\r\n` - KAFKA_CLUSTERS_0_ZOOKEEPER=zookeeper:2183`\r\nThe default one is 2181.\r\nTried your setup (a close one, since the one you provided wasn't valid enough), works fine for me.\r\n\r\n```\r\nversion: \"3.7\"\r\n\r\nservices:\r\n zookeeper:\r\n image: bitnami/zookeeper:3.7.0\r\n restart: unless-stopped\r\n volumes:\r\n - \"./zookeeper_data:/bitnami\"\r\n environment:\r\n - ALLOW_ANONYMOUS_LOGIN=yes\r\n\r\n kafka:\r\n image: bitnami/kafka:2.8.1\r\n restart: unless-stopped\r\n volumes:\r\n - \"./kafka_data:/bitnami\"\r\n environment:\r\n - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181\r\n - ALLOW_PLAINTEXT_LISTENER=yes\r\n - KAFKA_CFG_LISTENERS=PLAINTEXT://:9092\r\n - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092\r\n - JMX_PORT=9001\r\n depends_on:\r\n - zookeeper\r\n\r\n kafkaui:\r\n image: provectuslabs/kafka-ui:latest\r\n environment:\r\n - KAFKA_CLUSTERS_0_NAME=cluster-name\r\n - KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=kafka:9092\r\n - KAFKA_CLUSTERS_0_ZOOKEEPER=zookeeper:2181\r\n - KAFKA_CLUSTERS_0_JMXPORT=9001\r\n - LOGGING_LEVEL_ROOT=error\r\n - LOGGING_LEVEL_COM_PROVECTUS=error\r\n depends_on:\r\n - zookeeper\r\n - kafka\r\n ports:\r\n - 8080:8080\r\n```\r\n\r\n",
"Ahh, thanks @Haarolean for the fix!\r\n\r\nStill, might be worth fixing the PID Issue as it can crash the host if you accidentally misconfigure the zookeeper connection.",
"Sure, we'll take a look."
] | [] | "2022-02-08T14:57:07Z" | [
"type/bug",
"good first issue",
"scope/backend",
"status/accepted",
"status/confirmed"
] | Zookeeper thread leaking | Hi!
Thanks in advance for your help! kafka-ui is a super helpful tool!
**Describe the bug**
After running for a day the kafka-ui docker container (image: provectuslabs/kafka-ui:0.3.1) is using over 5000 Threads leading to high CPU and Memory Usage and evntually a crash of the host machine if nothing is done.
kafka-ui throws a `zookeeper exception` at regular intervals, which may be related (see the log below).
**Set up**
+ debian buster
+ docker
+ provectuslabs/kafka-ui:0.3.1 Image
+ orchestration by docker-compose with kafka in the same project:
```yaml
version: "3.7"
services:
zookeeper:
image: bitnami/zookeeper:3.7.0
restart: unless-stopped
networks:
- kafka
volumes:
- "zookeeper_data:/bitnami"
kafka:
image: bitnami/kafka:2.8.1
restart: unless-stopped
networks:
- kafka
volumes:
- "kafka_data:/bitnami"
environment:
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092
- JMX_PORT=9001
depends_on:
- zookeeper
kafkaui:
image: provectuslabs/kafka-ui:0.3.1
networks:
- kafka
environment:
- KAFKA_CLUSTERS_0_NAME=cluster-name
- KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=kafka:9092
- KAFKA_CLUSTERS_0_ZOOKEEPER=zookeeper:2183
- KAFKA_CLUSTERS_0_JMXPORT=9001
- LOGGING_LEVEL_ROOT=error
- LOGGING_LEVEL_COM_PROVECTUS=error
depends_on:
- zookeeper
- kafka
...
```
This problem also occurs with older versions (0.2.*). The load of the kafka instance is low.
**Steps to Reproduce**
See above.
**Expected behavior**
The resource usage should be stable over time.
**Screenshots**
`docker stats` output after the container has been running for a day:
<img width="772" alt="Screenshot 2022-01-25 085956" src="https://user-images.githubusercontent.com/6784851/150935803-9ef6956d-7b43-42ad-8442-fae981c742ba.png">
Second column is the CPU Usage, last column is the PIDS column.
**Additional context**
Log output:
```
Jan 25 08:07:55: #033[30m2022-01-25 08:07:55,596#033[0;39m #033[1;31mERROR#033[0;39m [#033[34mkafka-admin-client-thread | adminclient-1#033[0;39m] #033[33mc.p.k.u.s.ZookeeperService#033[0;39m: A zookeeper exception has occurred
Jan 25 08:07:55: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /brokers/ids
Jan 25 08:07:55: #011at org.apache.zookeeper.KeeperException.create(KeeperException.java:102)
Jan 25 08:07:55: #011at org.apache.zookeeper.KeeperException.create(KeeperException.java:54)
Jan 25 08:07:55: #011at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
Jan 25 08:07:55: #011at com.provectus.kafka.ui.service.ZookeeperService.isZkClientConnected(ZookeeperService.java:57)
Jan 25 08:07:55: #011at com.provectus.kafka.ui.service.ZookeeperService.isZookeeperOnline(ZookeeperService.java:49)
Jan 25 08:07:55: #011at com.provectus.kafka.ui.service.ZookeeperService.lambda$getZkStatus$0(ZookeeperService.java:37)
Jan 25 08:07:55: #011at reactor.core.publisher.MonoSupplier.subscribe(MonoSupplier.java:57)
Jan 25 08:07:55: #011at reactor.core.publisher.Mono.subscribe(Mono.java:4399)
Jan 25 08:07:55: #011at reactor.core.publisher.MonoZip.subscribe(MonoZip.java:128)
Jan 25 08:07:55: #011at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157)
Jan 25 08:07:55: #011at reactor.core.publisher.MonoCreate$DefaultMonoSink.success(MonoCreate.java:165)
Jan 25 08:07:55: #011at com.provectus.kafka.ui.service.ReactiveAdminClient.lambda$describeCluster$18(ReactiveAdminClient.java:223)
Jan 25 08:07:55: #011at org.apache.kafka.common.internals.KafkaFutureImpl$WhenCompleteBiConsumer.accept(KafkaFutureImpl.java:177)
Jan 25 08:07:55: #011at org.apache.kafka.common.internals.KafkaFutureImpl$WhenCompleteBiConsumer.accept(KafkaFutureImpl.java:162)
Jan 25 08:07:55: #011at org.apache.kafka.common.internals.KafkaFutureImpl.complete(KafkaFutureImpl.java:221)
Jan 25 08:07:55: #011at org.apache.kafka.common.KafkaFuture$AllOfAdapter.maybeComplete(KafkaFuture.java:82)
Jan 25 08:07:55: #011at org.apache.kafka.common.KafkaFuture$AllOfAdapter.accept(KafkaFuture.java:76)
Jan 25 08:07:55: #011at org.apache.kafka.common.KafkaFuture$AllOfAdapter.accept(KafkaFuture.java:57)
Jan 25 08:07:55: #011at org.apache.kafka.common.internals.KafkaFutureImpl.complete(KafkaFutureImpl.java:221)
Jan 25 08:07:55: #011at org.apache.kafka.clients.admin.KafkaAdminClient$5.handleResponse(KafkaAdminClient.java:1875)
Jan 25 08:07:55: #011at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.handleResponses(KafkaAdminClient.java:1189)
Jan 25 08:07:55: #011at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.processRequests(KafkaAdminClient.java:1341)
Jan 25 08:07:55: #011at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1264)
Jan 25 08:07:55: #011at java.base/java.lang.Thread.run(Thread.java:830)
Jan 25 08:08:25: #033[30m2022-01-25 08:08:25,516#033[0;39m #033[1;31mERROR#033[0;39m [#033[34mkafka-admin-client-thread | adminclient-1#033[0;39m] #033[33mc.p.k.u.s.ZookeeperService#033[0;39m: A zookeeper exception has occurred
Jan 25 08:08:25: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /brokers/ids
Jan 25 08:08:25: #011at org.apache.zookeeper.KeeperException.create(KeeperException.java:102)
Jan 25 08:08:25: #011at org.apache.zookeeper.KeeperException.create(KeeperException.java:54)
Jan 25 08:08:25: #011at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
Jan 25 08:08:25: #011at com.provectus.kafka.ui.service.ZookeeperService.isZkClientConnected(ZookeeperService.java:57)
Jan 25 08:08:25: #011at com.provectus.kafka.ui.service.ZookeeperService.isZookeeperOnline(ZookeeperService.java:49)
Jan 25 08:08:25: #011at com.provectus.kafka.ui.service.ZookeeperService.lambda$getZkStatus$0(ZookeeperService.java:37)
Jan 25 08:08:25: #011at reactor.core.publisher.MonoSupplier.subscribe(MonoSupplier.java:57)
Jan 25 08:08:25: #011at reactor.core.publisher.Mono.subscribe(Mono.java:4399)
Jan 25 08:08:25: #011at reactor.core.publisher.MonoZip.subscribe(MonoZip.java:128)
Jan 25 08:08:25: #011at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157)
Jan 25 08:08:25: #011at reactor.core.publisher.MonoCreate$DefaultMonoSink.success(MonoCreate.java:165)
Jan 25 08:08:25: #011at com.provectus.kafka.ui.service.ReactiveAdminClient.lambda$describeCluster$18(ReactiveAdminClient.java:223)
Jan 25 08:08:25: #011at org.apache.kafka.common.internals.KafkaFutureImpl$WhenCompleteBiConsumer.accept(KafkaFutureImpl.java:177)
Jan 25 08:08:25: #011at org.apache.kafka.common.internals.KafkaFutureImpl$WhenCompleteBiConsumer.accept(KafkaFutureImpl.java:162)
Jan 25 08:08:25: #011at org.apache.kafka.common.internals.KafkaFutureImpl.complete(KafkaFutureImpl.java:221)
Jan 25 08:08:25: #011at org.apache.kafka.common.KafkaFuture$AllOfAdapter.maybeComplete(KafkaFuture.java:82)
Jan 25 08:08:25: #011at org.apache.kafka.common.KafkaFuture$AllOfAdapter.accept(KafkaFuture.java:76)
Jan 25 08:08:25: #011at org.apache.kafka.common.KafkaFuture$AllOfAdapter.accept(KafkaFuture.java:57)
Jan 25 08:08:25: #011at org.apache.kafka.common.internals.KafkaFutureImpl.complete(KafkaFutureImpl.java:221)
Jan 25 08:08:25: #011at org.apache.kafka.clients.admin.KafkaAdminClient$5.handleResponse(KafkaAdminClient.java:1875)
Jan 25 08:08:25: #011at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.handleResponses(KafkaAdminClient.java:1189)
Jan 25 08:08:25: #011at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.processRequests(KafkaAdminClient.java:1341)
Jan 25 08:08:25: #011at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1264)
Jan 25 08:08:25: #011at java.base/java.lang.Thread.run(Thread.java:830)
Jan 25 08:08:55: #033[30m2022-01-25 08:08:55,645#033[0;39m #033[1;31mERROR#033[0;39m [#033[34mkafka-admin-client-thread | adminclient-1#033[0;39m] #033[33mc.p.k.u.s.ZookeeperService#033[0;39m: A zookeeper exception has occurred
Jan 25 08:08:55: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /brokers/ids
Jan 25 08:08:55: #011at org.apache.zookeeper.KeeperException.create(KeeperException.java:102)
Jan 25 08:08:55: #011at org.apache.zookeeper.KeeperException.create(KeeperException.java:54)
Jan 25 08:08:55: #011at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:2366)
Jan 25 08:08:55: #011at com.provectus.kafka.ui.service.ZookeeperService.isZkClientConnected(ZookeeperService.java:57)
Jan 25 08:08:55: #011at com.provectus.kafka.ui.service.ZookeeperService.isZookeeperOnline(ZookeeperService.java:49)
Jan 25 08:08:55: #011at com.provectus.kafka.ui.service.ZookeeperService.lambda$getZkStatus$0(ZookeeperService.java:37)
Jan 25 08:08:55: #011at reactor.core.publisher.MonoSupplier.subscribe(MonoSupplier.java:57)
Jan 25 08:08:55: #011at reactor.core.publisher.Mono.subscribe(Mono.java:4399)
Jan 25 08:08:55: #011at reactor.core.publisher.MonoZip.subscribe(MonoZip.java:128)
Jan 25 08:08:55: #011at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157)
Jan 25 08:08:55: #011at reactor.core.publisher.MonoCreate$DefaultMonoSink.success(MonoCreate.java:165)
Jan 25 08:08:55: #011at com.provectus.kafka.ui.service.ReactiveAdminClient.lambda$describeCluster$18(ReactiveAdminClient.java:223)
Jan 25 08:08:55: #011at org.apache.kafka.common.internals.KafkaFutureImpl$WhenCompleteBiConsumer.accept(KafkaFutureImpl.java:177)
Jan 25 08:08:55: #011at org.apache.kafka.common.internals.KafkaFutureImpl$WhenCompleteBiConsumer.accept(KafkaFutureImpl.java:162)
Jan 25 08:08:55: #011at org.apache.kafka.common.internals.KafkaFutureImpl.complete(KafkaFutureImpl.java:221)
Jan 25 08:08:55: #011at org.apache.kafka.common.KafkaFuture$AllOfAdapter.maybeComplete(KafkaFuture.java:82)
Jan 25 08:08:55: #011at org.apache.kafka.common.KafkaFuture$AllOfAdapter.accept(KafkaFuture.java:76)
Jan 25 08:08:55: #011at org.apache.kafka.common.KafkaFuture$AllOfAdapter.accept(KafkaFuture.java:57)
Jan 25 08:08:55: #011at org.apache.kafka.common.internals.KafkaFutureImpl.complete(KafkaFutureImpl.java:221)
Jan 25 08:08:55: #011at org.apache.kafka.clients.admin.KafkaAdminClient$5.handleResponse(KafkaAdminClient.java:1875)
Jan 25 08:08:55: #011at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.handleResponses(KafkaAdminClient.java:1189)
Jan 25 08:08:55: #011at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.processRequests(KafkaAdminClient.java:1341)
Jan 25 08:08:55: #011at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1264)
Jan 25 08:08:55: #011at java.base/java.lang.Thread.run(Thread.java:830)
```
| [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ZookeeperService.java"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ZookeeperService.java"
] | [
"kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/ZookeeperServiceTest.java"
] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ZookeeperService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ZookeeperService.java
index 03638afc7f6..6e8f1a5f516 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ZookeeperService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ZookeeperService.java
@@ -56,6 +56,7 @@ private boolean isZkClientConnected(ZooKeeper zkClient) {
zkClient.getChildren("/brokers/ids", null);
} catch (KeeperException e) {
log.error("A zookeeper exception has occurred", e);
+ closeZkClientSession(zkClient, e);
return false;
} catch (InterruptedException e) {
log.error("Interrupted: ", e);
@@ -64,6 +65,15 @@ private boolean isZkClientConnected(ZooKeeper zkClient) {
return true;
}
+ private void closeZkClientSession(ZooKeeper zkClient, KeeperException e) {
+ try {
+ zkClient.close();
+ } catch (InterruptedException ex) {
+ log.error("Unable to close zkClient session: ", e);
+ Thread.currentThread().interrupt();
+ }
+ }
+
@Nullable
private ZooKeeper getOrCreateZkClient(KafkaCluster cluster) {
final var clusterName = cluster.getName();
| diff --git a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/ZookeeperServiceTest.java b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/ZookeeperServiceTest.java
new file mode 100644
index 00000000000..92da37f27a8
--- /dev/null
+++ b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/ZookeeperServiceTest.java
@@ -0,0 +1,52 @@
+package com.provectus.kafka.ui.service;
+
+import com.provectus.kafka.ui.AbstractIntegrationTest;
+import com.provectus.kafka.ui.model.KafkaCluster;
+import com.provectus.kafka.ui.model.ServerStatusDTO;
+import java.util.Properties;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import reactor.test.StepVerifier;
+
+class ZookeeperServiceTest extends AbstractIntegrationTest {
+ private ZookeeperService zookeeperService;
+
+ @BeforeEach
+ void init() {
+ AdminClientServiceImpl adminClientService = new AdminClientServiceImpl();
+ adminClientService.setClientTimeout(5_000);
+ zookeeperService = new ZookeeperService();
+ }
+
+ @Test
+ void getZkStatusEmptyConfig() {
+ KafkaCluster kafkaCluster =
+ KafkaCluster.builder()
+ .name(LOCAL)
+ .bootstrapServers(kafka.getBootstrapServers())
+ .properties(new Properties())
+ .build();
+
+ ZookeeperService.ZkStatus zkStatus = new ZookeeperService.ZkStatus(ServerStatusDTO.OFFLINE, null);
+ StepVerifier.create(zookeeperService.getZkStatus(kafkaCluster))
+ .expectNext(zkStatus)
+ .verifyComplete();
+ }
+
+ @Test
+ void getZkStatusWrongConfig() {
+ KafkaCluster kafkaCluster =
+ KafkaCluster.builder()
+ .name(LOCAL)
+ .bootstrapServers(kafka.getBootstrapServers())
+ .zookeeper("localhost:1000")
+ .properties(new Properties())
+ .build();
+
+ ZookeeperService.ZkStatus zkStatus = new ZookeeperService.ZkStatus(ServerStatusDTO.OFFLINE, null);
+ StepVerifier.create(zookeeperService.getZkStatus(kafkaCluster))
+ .expectNext(zkStatus)
+ .verifyComplete();
+ }
+
+}
| train | train | 2022-03-10T09:17:02 | "2022-01-25T08:19:47Z" | cleboo | train |
provectus/kafka-ui/1555_1575 | provectus/kafka-ui | provectus/kafka-ui/1555 | provectus/kafka-ui/1575 | [
"connected"
] | edabfca9660ae6769b7849e62ffa5cef006d23d6 | a040a66f09cf18d6242c8819cba3d423e1d69695 | [
"Hello there sandrospadaro! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"Hey, thanks for the suggestion. I've considered this but got lost in other stuff :)"
] | [] | "2022-02-08T18:34:46Z" | [
"type/enhancement",
"scope/backend",
"status/accepted"
] | [Feature]Use an unprivileged user in the dockerfile | ### Is your proposal related to a problem?
<!--
Provide a clear and concise description of what the problem is.
For example, "I'm always frustrated when..."
-->
Use an unprivileged user in the dockerfile
### Describe the solution you'd like
<!--
Provide a clear and concise description of what you want to happen.
-->
Change the [Dockerfile](https://github.com/provectus/kafka-ui/blob/master/kafka-ui-api/Dockerfile) as follows:
```Dockerfile
FROM alpine:3.15.0
RUN apk add --no-cache openjdk13-jre libc6-compat gcompat
RUN addgroup -S kafkaui && adduser -S kafkaui -G kafkaui
USER kafkaui
ARG JAR_FILE
COPY "/target/${JAR_FILE}" "/kafka-ui-api.jar"
ENV JAVA_OPTS=
EXPOSE 8080
CMD java $JAVA_OPTS -jar kafka-ui-api.jar
```
### Describe alternatives you've considered
<!--
Let us know about other solutions you've tried or researched.
-->
### Additional context
<!--
Is there anything else you can add about the proposal?
You might want to link to related issues here, if you haven't already.
-->
| [
"kafka-ui-api/Dockerfile"
] | [
"kafka-ui-api/Dockerfile"
] | [] | diff --git a/kafka-ui-api/Dockerfile b/kafka-ui-api/Dockerfile
index ba8569b100d..5488a771810 100644
--- a/kafka-ui-api/Dockerfile
+++ b/kafka-ui-api/Dockerfile
@@ -1,5 +1,9 @@
FROM alpine:3.15.0
-RUN apk add --no-cache openjdk13-jre libc6-compat gcompat
+
+RUN apk add --no-cache openjdk13-jre libc6-compat gcompat \
+&& addgroup -S kafkaui && adduser -S kafkaui -G kafkaui
+
+USER kafkaui
ARG JAR_FILE
COPY "/target/${JAR_FILE}" "/kafka-ui-api.jar"
| null | train | train | 2022-02-09T14:05:08 | "2022-02-05T15:36:10Z" | sandrospadaro | train |
provectus/kafka-ui/1490_1583 | provectus/kafka-ui | provectus/kafka-ui/1490 | provectus/kafka-ui/1583 | [
"connected"
] | 164d33b7070000db5c9a075f3d355c6d14e701bd | 445dc3e2709faa9d3933b6f6b811c355f5c1916b | [] | [] | "2022-02-10T11:59:54Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Expand scrollable pane in connectors->config | Scrollable space is too short while the rest of the screen is empty

| [
"kafka-ui-react-app/src/components/Connect/Details/Config/Config.tsx",
"kafka-ui-react-app/src/components/Connect/Details/Config/__test__/__snapshots__/Config.spec.tsx.snap",
"kafka-ui-react-app/src/components/common/Editor/Editor.tsx"
] | [
"kafka-ui-react-app/src/components/Connect/Details/Config/Config.tsx",
"kafka-ui-react-app/src/components/Connect/Details/Config/__test__/__snapshots__/Config.spec.tsx.snap",
"kafka-ui-react-app/src/components/common/Editor/Editor.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Connect/Details/Config/Config.tsx b/kafka-ui-react-app/src/components/Connect/Details/Config/Config.tsx
index 253ca0b691a..4e200aae475 100644
--- a/kafka-ui-react-app/src/components/Connect/Details/Config/Config.tsx
+++ b/kafka-ui-react-app/src/components/Connect/Details/Config/Config.tsx
@@ -28,10 +28,7 @@ export interface ConfigProps {
}
const ConnectConfigWrapper = styled.div`
- padding: 16px;
margin: 16px;
- border: 1px solid ${({ theme }) => theme.layout.stuffColor};
- border-radius: 8px;
`;
const Config: React.FC<ConfigProps> = ({
@@ -50,7 +47,6 @@ const Config: React.FC<ConfigProps> = ({
}
if (!config) return null;
-
return (
<ConnectConfigWrapper>
<Editor
diff --git a/kafka-ui-react-app/src/components/Connect/Details/Config/__test__/__snapshots__/Config.spec.tsx.snap b/kafka-ui-react-app/src/components/Connect/Details/Config/__test__/__snapshots__/Config.spec.tsx.snap
index a7f774409ba..f9ac501bedd 100644
--- a/kafka-ui-react-app/src/components/Connect/Details/Config/__test__/__snapshots__/Config.spec.tsx.snap
+++ b/kafka-ui-react-app/src/components/Connect/Details/Config/__test__/__snapshots__/Config.spec.tsx.snap
@@ -2,10 +2,7 @@
exports[`Config view matches snapshot 1`] = `
.c0 {
- padding: 16px;
margin: 16px;
- border: 1px solid #F1F2F3;
- border-radius: 8px;
}
<div
diff --git a/kafka-ui-react-app/src/components/common/Editor/Editor.tsx b/kafka-ui-react-app/src/components/common/Editor/Editor.tsx
index dddc8c43c12..76a63771865 100644
--- a/kafka-ui-react-app/src/components/common/Editor/Editor.tsx
+++ b/kafka-ui-react-app/src/components/common/Editor/Editor.tsx
@@ -29,7 +29,7 @@ const Editor = React.forwardRef<ReactAce | null, EditorProps>((props, ref) => {
fontSize={14}
height={
isFixedHeight
- ? `${(props.value?.split('\n').length || 32) * 16}px`
+ ? `${(props.value?.split('\n').length || 32) * 19}px`
: '372px'
}
wrapEnabled
| null | test | train | 2022-02-10T07:58:12 | "2022-01-26T11:12:24Z" | Haarolean | train |
provectus/kafka-ui/1302_1586 | provectus/kafka-ui | provectus/kafka-ui/1302 | provectus/kafka-ui/1586 | [
"connected"
] | d40af6d38605d43d31bca5a24c5e0061c1d193ca | 77706ce670e9fc88aa13d320bfa7980315ef0761 | [] | [
"Is there a point in `useMemo` in `defaultValues`?\r\n\r\nI'm not sure if it's needed ",
"bcs we should memo changes of keyDefaultValue, contentDefaultValue to prevent rerender of it ",
"> The defaultValues for inputs are used as the initial value when a component is first rendered, before a user interacts with it. It is encouraged that you set defaultValues for all inputs to non-undefined values such as the empty string or null.\r\n\r\n> defaultValues are cached on the first render within the custom hook. If you want to [reset](https://react-hook-form.com/api/useform/reset) the defaultValues, you should use the reset api.\r\n\r\nI see no need in useMemo here"
] | "2022-02-11T10:08:26Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Generated messages (key & content) are being sent as nulls if not changed | **Describe the bug**
"Lorem ipsum"-ish messages generated by default are being sent as null if corresponding fields are not changed (e.g. headers are being changed). This behaviour is not clear.
**Set up**
docker-compose -f kafka-ui.yaml
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Press produce message button
2. Change headers (add "1" to the end and backspace it)
3. Press send message
**Expected behavior**
Generated content is being sent | [
"kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx b/kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx
index ee1ba03de4a..d6f987d9ffc 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx
@@ -1,6 +1,6 @@
import Editor from 'components/common/Editor/Editor';
import PageLoader from 'components/common/PageLoader/PageLoader';
-import React from 'react';
+import React, { useEffect } from 'react';
import { useForm, Controller } from 'react-hook-form';
import { useHistory, useParams } from 'react-router';
import { clusterTopicMessagesPath } from 'lib/paths';
@@ -28,12 +28,6 @@ interface RouterParams {
const SendMessage: React.FC = () => {
const dispatch = useAppDispatch();
const { clusterName, topicName } = useParams<RouterParams>();
- const {
- register,
- handleSubmit,
- formState: { isSubmitting, isDirty },
- control,
- } = useForm({ mode: 'onChange' });
const history = useHistory();
jsf.option('fillProperties', false);
@@ -73,6 +67,29 @@ const SendMessage: React.FC = () => {
);
}, [messageSchema, schemaIsFetched]);
+ const {
+ register,
+ handleSubmit,
+ formState: { isSubmitting, isDirty },
+ control,
+ reset,
+ } = useForm({
+ mode: 'onChange',
+ defaultValues: {
+ key: keyDefaultValue,
+ content: contentDefaultValue,
+ headers: undefined,
+ partition: undefined,
+ },
+ });
+
+ useEffect(() => {
+ reset({
+ key: keyDefaultValue,
+ content: contentDefaultValue,
+ });
+ }, [keyDefaultValue, contentDefaultValue]);
+
const onSubmit = async (data: {
key: string;
content: string;
@@ -162,12 +179,12 @@ const SendMessage: React.FC = () => {
<Controller
control={control}
name="key"
- render={({ field: { name, onChange } }) => (
+ render={({ field: { name, onChange, value } }) => (
<Editor
readOnly={isSubmitting}
- defaultValue={keyDefaultValue}
name={name}
onChange={onChange}
+ value={value}
/>
)}
/>
@@ -177,12 +194,12 @@ const SendMessage: React.FC = () => {
<Controller
control={control}
name="content"
- render={({ field: { name, onChange } }) => (
+ render={({ field: { name, onChange, value } }) => (
<Editor
readOnly={isSubmitting}
- defaultValue={contentDefaultValue}
name={name}
onChange={onChange}
+ value={value}
/>
)}
/>
| null | train | train | 2022-02-21T14:56:23 | "2021-12-21T10:04:34Z" | Haarolean | train |
provectus/kafka-ui/1491_1590 | provectus/kafka-ui | provectus/kafka-ui/1491 | provectus/kafka-ui/1590 | [
"timestamp(timedelta=1.0, similarity=0.8684755829468429)",
"connected"
] | 638815325953625d93882e7afa523be463a9518c | 217f0ead0d871205f7a05062cdf56649b8eecc79 | [
"It should be consistent if Test running here in Connectors would be green if it > 0\r\n<img width=\"348\" alt=\"Screenshot 2022-02-01 at 23 08 56\" src=\"https://user-images.githubusercontent.com/92585878/152051769-dd88ec72-3657-46c1-9ec9-7e6b4b1b6067.png\">\r\n"
] | [] | "2022-02-11T13:23:30Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Invalid color of "tasks failed" badge | connectors-> select connector
"tasks failed" color is red even when it equals to zero

| [
"kafka-ui-react-app/src/components/Connect/Details/Overview/Overview.tsx"
] | [
"kafka-ui-react-app/src/components/Connect/Details/Overview/Overview.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Connect/Details/Overview/Overview.tsx b/kafka-ui-react-app/src/components/Connect/Details/Overview/Overview.tsx
index 94148f10d27..28bbfbc3041 100644
--- a/kafka-ui-react-app/src/components/Connect/Details/Overview/Overview.tsx
+++ b/kafka-ui-react-app/src/components/Connect/Details/Overview/Overview.tsx
@@ -36,7 +36,11 @@ const Overview: React.FC<OverviewProps> = ({
<Metrics.Indicator label="Tasks Running">
{runningTasksCount}
</Metrics.Indicator>
- <Metrics.Indicator label="Tasks Failed" isAlert>
+ <Metrics.Indicator
+ label="Tasks Failed"
+ isAlert
+ alertType={failedTasksCount > 0 ? 'error' : 'success'}
+ >
{failedTasksCount}
</Metrics.Indicator>
</Metrics.Section>
| null | train | train | 2022-02-11T16:31:26 | "2022-01-26T11:14:06Z" | Haarolean | train |
provectus/kafka-ui/1544_1592 | provectus/kafka-ui | provectus/kafka-ui/1544 | provectus/kafka-ui/1592 | [
"connected",
"timestamp(timedelta=1.0, similarity=0.9097465276626683)"
] | c2a31bdce0fa42ed111df723599f06979500d59d | f084dc36a1a5809a6b83f73c7797739af932c13f | [
"That seems like a bug, we previously had something close in a preview as well."
] | [] | "2022-02-12T10:52:13Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | [Bug] Export of JSON message to clipboard/file does not provide proper JSON | Whenever I want to copy an event to my clipboard (JSON format) (eg. to use it in my IDE for analyzis), I expect to get a proper json content.
However, it is currently having escape backslashes and surroundings double quotes, which makes it not parseable by my IDE (also less readable from my POV)
Using https://jsonformatter.curiousconcept.com/#,
I checked that this JSON is compliant with RFC-8259 & RFC-7129 but not with others (especially with RFC-4627 which is the one for `The application/json Media Type for JavaScript Object Notation (JSON)`
I'm not sure this is _really_ a bug, maybe a feature request :)
Would it be possible to make the json without backslashes / surroundings double quotes ?
Version : ([8a7399b](https://github.com/provectus/kafka-ui/commit/8a7399b))
| [
"kafka-ui-react-app/src/lib/hooks/__tests__/useDataSaver.spec.tsx",
"kafka-ui-react-app/src/lib/hooks/useDataSaver.ts"
] | [
"kafka-ui-react-app/src/lib/hooks/__tests__/useDataSaver.spec.tsx",
"kafka-ui-react-app/src/lib/hooks/useDataSaver.ts"
] | [] | diff --git a/kafka-ui-react-app/src/lib/hooks/__tests__/useDataSaver.spec.tsx b/kafka-ui-react-app/src/lib/hooks/__tests__/useDataSaver.spec.tsx
index bc2cc9b66ce..937095bcb11 100644
--- a/kafka-ui-react-app/src/lib/hooks/__tests__/useDataSaver.spec.tsx
+++ b/kafka-ui-react-app/src/lib/hooks/__tests__/useDataSaver.spec.tsx
@@ -70,7 +70,7 @@ describe('useDataSaver hook', () => {
});
});
- it('copies the data to the clipboard', () => {
+ describe('copies the data to the clipboard', () => {
Object.assign(navigator, {
clipboard: {
writeText: jest.fn(),
@@ -78,15 +78,31 @@ describe('useDataSaver hook', () => {
});
jest.spyOn(navigator.clipboard, 'writeText');
- const HookWrapper: React.FC = () => {
- const { copyToClipboard } = useDataSaver('topic', content);
- useEffect(() => copyToClipboard(), []);
- return null;
- };
+ it('data with type Object', () => {
+ const HookWrapper: React.FC = () => {
+ const { copyToClipboard } = useDataSaver('topic', content);
+ useEffect(() => copyToClipboard(), []);
+ return null;
+ };
+ render(<HookWrapper />);
+ expect(navigator.clipboard.writeText).toHaveBeenCalledWith(
+ JSON.stringify(content)
+ );
+ });
- render(<HookWrapper />);
- expect(navigator.clipboard.writeText).toHaveBeenCalledWith(
- JSON.stringify(content)
- );
+ it('data with type String', () => {
+ const HookWrapper: React.FC = () => {
+ const { copyToClipboard } = useDataSaver(
+ 'topic',
+ '{ title: "title", }'
+ );
+ useEffect(() => copyToClipboard(), []);
+ return null;
+ };
+ render(<HookWrapper />);
+ expect(navigator.clipboard.writeText).toHaveBeenCalledWith(
+ String('{ title: "title", }')
+ );
+ });
});
});
diff --git a/kafka-ui-react-app/src/lib/hooks/useDataSaver.ts b/kafka-ui-react-app/src/lib/hooks/useDataSaver.ts
index 25c42602f12..f39bac32058 100644
--- a/kafka-ui-react-app/src/lib/hooks/useDataSaver.ts
+++ b/kafka-ui-react-app/src/lib/hooks/useDataSaver.ts
@@ -11,7 +11,8 @@ const useDataSaver = (
const dispatch = useAppDispatch();
const copyToClipboard = () => {
if (navigator.clipboard) {
- const str = JSON.stringify(data);
+ const str =
+ typeof data === 'string' ? String(data) : JSON.stringify(data);
navigator.clipboard.writeText(str);
dispatch(
alertAdded({
| null | train | train | 2022-02-15T13:47:26 | "2022-02-03T20:17:56Z" | giom-l | train |
provectus/kafka-ui/1492_1594 | provectus/kafka-ui | provectus/kafka-ui/1492 | provectus/kafka-ui/1594 | [
"timestamp(timedelta=0.0, similarity=0.8467273820053423)",
"connected"
] | 95a9047114b499c61e478c584ea14c66d7d8ef3e | fbbc6537c8cc533901451003dcb7ff453b5d6b1c | [
"The same for the Consumers.\r\n<img width=\"1499\" alt=\"Screenshot 2022-01-28 at 19 51 47\" src=\"https://user-images.githubusercontent.com/92585878/151597061-857d3891-4038-4f5f-bc00-34f9241612e9.png\">\r\n<img width=\"1499\" alt=\"Screenshot 2022-01-28 at 19 51 56\" src=\"https://user-images.githubusercontent.com/92585878/151597074-38e8ef97-fe37-44d3-896d-99b67f538723.png\">\r\n"
] | [] | "2022-02-12T18:12:16Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Inconsistent task status badges colors | Connectors list: statuses can have different background badge colors, including read, yellow and green. On the connector's page it's always yellow. | [
"kafka-ui-react-app/src/components/Connect/Details/Overview/Overview.tsx",
"kafka-ui-react-app/src/components/Connect/Details/Overview/__tests__/__snapshots__/Overview.spec.tsx.snap",
"kafka-ui-react-app/src/components/Connect/Details/Tasks/ListItem/ListItem.tsx",
"kafka-ui-react-app/src/components/Connect/List/ListItem.tsx",
"kafka-ui-react-app/src/components/ConsumerGroups/Details/Details.tsx",
"kafka-ui-react-app/src/components/ConsumerGroups/List/ListItem.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroups.tsx"
] | [
"kafka-ui-react-app/src/components/Connect/Details/Overview/Overview.tsx",
"kafka-ui-react-app/src/components/Connect/Details/Overview/__tests__/__snapshots__/Overview.spec.tsx.snap",
"kafka-ui-react-app/src/components/Connect/Details/Tasks/ListItem/ListItem.tsx",
"kafka-ui-react-app/src/components/Connect/List/ListItem.tsx",
"kafka-ui-react-app/src/components/Connect/Utils/TagColor.ts",
"kafka-ui-react-app/src/components/ConsumerGroups/Details/Details.tsx",
"kafka-ui-react-app/src/components/ConsumerGroups/List/ListItem.tsx",
"kafka-ui-react-app/src/components/ConsumerGroups/Utils/TagColor.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroups.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Connect/Details/Overview/Overview.tsx b/kafka-ui-react-app/src/components/Connect/Details/Overview/Overview.tsx
index 28bbfbc3041..f98c49a127c 100644
--- a/kafka-ui-react-app/src/components/Connect/Details/Overview/Overview.tsx
+++ b/kafka-ui-react-app/src/components/Connect/Details/Overview/Overview.tsx
@@ -2,6 +2,7 @@ import React from 'react';
import { Connector } from 'generated-sources';
import * as C from 'components/common/Tag/Tag.styled';
import * as Metrics from 'components/common/Metrics';
+import getTagColor from 'components/Connect/Utils/TagColor';
export interface OverviewProps {
connector: Connector | null;
@@ -31,7 +32,9 @@ const Overview: React.FC<OverviewProps> = ({
</Metrics.Indicator>
)}
<Metrics.Indicator label="State">
- <C.Tag color="yellow">{connector.status.state}</C.Tag>
+ <C.Tag color={getTagColor(connector.status)}>
+ {connector.status.state}
+ </C.Tag>
</Metrics.Indicator>
<Metrics.Indicator label="Tasks Running">
{runningTasksCount}
diff --git a/kafka-ui-react-app/src/components/Connect/Details/Overview/__tests__/__snapshots__/Overview.spec.tsx.snap b/kafka-ui-react-app/src/components/Connect/Details/Overview/__tests__/__snapshots__/Overview.spec.tsx.snap
index 57e39c5e7b0..18930410a51 100644
--- a/kafka-ui-react-app/src/components/Connect/Details/Overview/__tests__/__snapshots__/Overview.spec.tsx.snap
+++ b/kafka-ui-react-app/src/components/Connect/Details/Overview/__tests__/__snapshots__/Overview.spec.tsx.snap
@@ -6,7 +6,7 @@ exports[`Overview view matches snapshot 1`] = `
border-radius: 16px;
height: 20px;
line-height: 20px;
- background-color: #FFEECC;
+ background-color: #D6F5E0;
color: #171A1C;
font-size: 12px;
display: inline-block;
@@ -179,7 +179,7 @@ exports[`Overview view matches snapshot 1`] = `
<span>
<p
className="c5"
- color="yellow"
+ color="green"
>
RUNNING
</p>
diff --git a/kafka-ui-react-app/src/components/Connect/Details/Tasks/ListItem/ListItem.tsx b/kafka-ui-react-app/src/components/Connect/Details/Tasks/ListItem/ListItem.tsx
index 1c48d16a0d9..64a1b1032b4 100644
--- a/kafka-ui-react-app/src/components/Connect/Details/Tasks/ListItem/ListItem.tsx
+++ b/kafka-ui-react-app/src/components/Connect/Details/Tasks/ListItem/ListItem.tsx
@@ -6,6 +6,7 @@ import Dropdown from 'components/common/Dropdown/Dropdown';
import DropdownItem from 'components/common/Dropdown/DropdownItem';
import VerticalElipsisIcon from 'components/common/Icons/VerticalElipsisIcon';
import * as C from 'components/common/Tag/Tag.styled';
+import getTagColor from 'components/Connect/Utils/TagColor';
interface RouterParams {
clusterName: ClusterName;
@@ -35,7 +36,7 @@ const ListItem: React.FC<ListItemProps> = ({ task, restartTask }) => {
<td>{task.status?.id}</td>
<td>{task.status?.workerId}</td>
<td>
- <C.Tag color="yellow">{task.status.state}</C.Tag>
+ <C.Tag color={getTagColor(task.status)}>{task.status.state}</C.Tag>
</td>
<td>{task.status.trace || 'null'}</td>
<td style={{ width: '5%' }}>
diff --git a/kafka-ui-react-app/src/components/Connect/List/ListItem.tsx b/kafka-ui-react-app/src/components/Connect/List/ListItem.tsx
index 7d6bb983bbb..231f8ecc768 100644
--- a/kafka-ui-react-app/src/components/Connect/List/ListItem.tsx
+++ b/kafka-ui-react-app/src/components/Connect/List/ListItem.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { ConnectorState, FullConnectorInfo } from 'generated-sources';
+import { FullConnectorInfo } from 'generated-sources';
import { clusterConnectConnectorPath, clusterTopicPath } from 'lib/paths';
import { ClusterName } from 'redux/interfaces';
import { Link, NavLink } from 'react-router-dom';
@@ -12,6 +12,7 @@ import ConfirmationModal from 'components/common/ConfirmationModal/ConfirmationM
import { Tag } from 'components/common/Tag/Tag.styled';
import { TableKeyLink } from 'components/common/table/Table/TableKeyLink.styled';
import VerticalElipsisIcon from 'components/common/Icons/VerticalElipsisIcon';
+import getTagColor from 'components/Connect/Utils/TagColor';
import * as S from './List.styled';
@@ -51,20 +52,6 @@ const ListItem: React.FC<ListItemProps> = ({
return tasksCount - (failedTasksCount || 0);
}, [tasksCount, failedTasksCount]);
- const stateColor = React.useMemo(() => {
- const { state = '' } = status;
-
- switch (state) {
- case ConnectorState.RUNNING:
- return 'green';
- case ConnectorState.FAILED:
- case ConnectorState.TASK_FAILED:
- return 'red';
- default:
- return 'yellow';
- }
- }, [status]);
-
return (
<tr>
<TableKeyLink>
@@ -87,7 +74,7 @@ const ListItem: React.FC<ListItemProps> = ({
))}
</S.TagsWrapper>
</td>
- <td>{status && <Tag color={stateColor}>{status.state}</Tag>}</td>
+ <td>{status && <Tag color={getTagColor(status)}>{status.state}</Tag>}</td>
<td>
{runningTasks && (
<span>
diff --git a/kafka-ui-react-app/src/components/Connect/Utils/TagColor.ts b/kafka-ui-react-app/src/components/Connect/Utils/TagColor.ts
new file mode 100644
index 00000000000..86a521d4f26
--- /dev/null
+++ b/kafka-ui-react-app/src/components/Connect/Utils/TagColor.ts
@@ -0,0 +1,17 @@
+import { ConnectorState, ConnectorStatus, TaskStatus } from 'generated-sources';
+
+const getTagColor = (status: ConnectorStatus | TaskStatus) => {
+ const { state = '' } = status;
+
+ switch (state) {
+ case ConnectorState.RUNNING:
+ return 'green';
+ case ConnectorState.FAILED:
+ case ConnectorState.TASK_FAILED:
+ return 'red';
+ default:
+ return 'yellow';
+ }
+};
+
+export default getTagColor;
diff --git a/kafka-ui-react-app/src/components/ConsumerGroups/Details/Details.tsx b/kafka-ui-react-app/src/components/ConsumerGroups/Details/Details.tsx
index cc7dccca186..bd268f208c3 100644
--- a/kafka-ui-react-app/src/components/ConsumerGroups/Details/Details.tsx
+++ b/kafka-ui-react-app/src/components/ConsumerGroups/Details/Details.tsx
@@ -26,6 +26,7 @@ import {
getIsConsumerGroupDeleted,
getAreConsumerGroupDetailsFulfilled,
} from 'redux/reducers/consumerGroups/consumerGroupsSlice';
+import getTagColor from 'components/ConsumerGroups/Utils/TagColor';
import ListItem from './ListItem';
@@ -90,7 +91,7 @@ const Details: React.FC = () => {
<Metrics.Wrapper>
<Metrics.Section>
<Metrics.Indicator label="State">
- <Tag color="yellow">{consumerGroup.state}</Tag>
+ <Tag color={getTagColor(consumerGroup)}>{consumerGroup.state}</Tag>
</Metrics.Indicator>
<Metrics.Indicator label="Members">
{consumerGroup.members}
diff --git a/kafka-ui-react-app/src/components/ConsumerGroups/List/ListItem.tsx b/kafka-ui-react-app/src/components/ConsumerGroups/List/ListItem.tsx
index 1e63a1d8840..ede7a54e0ae 100644
--- a/kafka-ui-react-app/src/components/ConsumerGroups/List/ListItem.tsx
+++ b/kafka-ui-react-app/src/components/ConsumerGroups/List/ListItem.tsx
@@ -1,27 +1,13 @@
import React from 'react';
import { Link } from 'react-router-dom';
-import { ConsumerGroup, ConsumerGroupState } from 'generated-sources';
+import { ConsumerGroup } from 'generated-sources';
import { Tag } from 'components/common/Tag/Tag.styled';
import { TableKeyLink } from 'components/common/table/Table/TableKeyLink.styled';
+import getTagColor from 'components/ConsumerGroups/Utils/TagColor';
const ListItem: React.FC<{ consumerGroup: ConsumerGroup }> = ({
consumerGroup,
}) => {
- const stateColor = React.useMemo(() => {
- const { state = '' } = consumerGroup;
-
- switch (state) {
- case ConsumerGroupState.STABLE:
- return 'green';
- case ConsumerGroupState.DEAD:
- return 'red';
- case ConsumerGroupState.EMPTY:
- return 'white';
- default:
- return 'yellow';
- }
- }, [consumerGroup]);
-
return (
<tr>
<TableKeyLink>
@@ -34,7 +20,7 @@ const ListItem: React.FC<{ consumerGroup: ConsumerGroup }> = ({
<td>{consumerGroup.messagesBehind}</td>
<td>{consumerGroup.coordinator?.id}</td>
<td>
- <Tag color={stateColor}>{consumerGroup.state}</Tag>
+ <Tag color={getTagColor(consumerGroup)}>{consumerGroup.state}</Tag>
</td>
</tr>
);
diff --git a/kafka-ui-react-app/src/components/ConsumerGroups/Utils/TagColor.ts b/kafka-ui-react-app/src/components/ConsumerGroups/Utils/TagColor.ts
new file mode 100644
index 00000000000..b72d94daaee
--- /dev/null
+++ b/kafka-ui-react-app/src/components/ConsumerGroups/Utils/TagColor.ts
@@ -0,0 +1,16 @@
+import { ConsumerGroupState, ConsumerGroup } from 'generated-sources';
+
+const getTagColor = (consumerGroup: ConsumerGroup) => {
+ const { state = '' } = consumerGroup;
+ switch (state) {
+ case ConsumerGroupState.STABLE:
+ return 'green';
+ case ConsumerGroupState.DEAD:
+ return 'red';
+ case ConsumerGroupState.EMPTY:
+ return 'white';
+ default:
+ return 'yellow';
+ }
+};
+export default getTagColor;
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroups.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroups.tsx
index a67905147d6..d35fd934acc 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroups.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroups.tsx
@@ -7,6 +7,7 @@ import TableHeaderCell from 'components/common/table/TableHeaderCell/TableHeader
import { Tag } from 'components/common/Tag/Tag.styled';
import { TableKeyLink } from 'components/common/table/Table/TableKeyLink.styled';
import { Link } from 'react-router-dom';
+import getTagColor from 'components/ConsumerGroups/Utils/TagColor';
interface Props extends Topic, TopicDetails {
clusterName: ClusterName;
@@ -57,7 +58,7 @@ const TopicConsumerGroups: React.FC<Props> = ({
<td>{consumer.coordinator?.id}</td>
<td>
{consumer.state && (
- <Tag color="yellow">{`${consumer.state
+ <Tag color={getTagColor(consumer)}>{`${consumer.state
.charAt(0)
.toUpperCase()}${consumer.state
.slice(1)
| null | val | train | 2022-02-13T12:24:18 | "2022-01-26T12:56:46Z" | Haarolean | train |
provectus/kafka-ui/1444_1601 | provectus/kafka-ui | provectus/kafka-ui/1444 | provectus/kafka-ui/1601 | [
"connected"
] | b3ef8da44670d78bde8eef9668f1b12cb317eec3 | b8c43f069e630a7ace4ed1d541cbe82f3a22924a | [
"@5hin0bi we currently only restart **connector instance**, not tasks on this button click. I will change this to restart both connector and all its tasks. I think we will also need to rename this button to smth like \"Restart connector\". \r\ncc @Haarolean ",
"@5hin0bi can you please verify it works, and reopen issue if not",
"Checked on our dev environment. The button is now called \"Restart Connector\", but failed tasks themselves are not restarted.",
"To do: create 3 buttons",
"Need to implement frontend",
"I'm seeing a similar error with KafkaConnect where it's trying to hit an api endpoint:\r\n```500 Server Error for HTTP GET \"/api/clusters/local/connectors?search=\"```\r\nthat also doesn't seem to exist, per Confluent's API. ",
"> I'm seeing a similar error with KafkaConnect where it's trying to hit an api endpoint: `500 Server Error for HTTP GET \"/api/clusters/local/connectors?search=\"` that also doesn't seem to exist, per Confluent's API.\r\n\r\nThat's our backend with our API, not confluent's. Please raise a new issue."
] | [] | "2022-02-14T16:03:00Z" | [
"type/enhancement",
"scope/backend",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Connector "Restart All Tasks" button has no effect | When choosing a specific connector there are several options you can choose:
<img width="1083" alt="image" src="https://user-images.githubusercontent.com/94184844/150494050-67a4692f-2133-4c78-94e3-c74857b65057.png">
Restart all tasks sends the next POST request that actually does do nothing.
https://xxx/api/clusters/local/connects/local/connectors/reddit-source-json/action/RESTART
According to the REST API documentation https://docs.confluent.io/platform/current/connect/references/restapi.html there is no such request available. And the correct one is this:
<img width="904" alt="image" src="https://user-images.githubusercontent.com/94184844/150494299-2cffab5d-abb7-4e05-af35-f3af1a57a050.png">
Restarting the specific task using the triple dot context menu works great tho. | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/KafkaConnectService.java",
"kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/KafkaConnectService.java",
"kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml"
] | [] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/KafkaConnectService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/KafkaConnectService.java
index 2d82a54217b..1c3d2474924 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/KafkaConnectService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/KafkaConnectService.java
@@ -3,6 +3,7 @@
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.provectus.kafka.ui.client.KafkaConnectClients;
+import com.provectus.kafka.ui.connect.api.KafkaConnectClientApi;
import com.provectus.kafka.ui.connect.model.ConnectorStatus;
import com.provectus.kafka.ui.connect.model.ConnectorStatusConnector;
import com.provectus.kafka.ui.connect.model.ConnectorTopics;
@@ -17,6 +18,7 @@
import com.provectus.kafka.ui.model.ConnectorPluginConfigValidationResponseDTO;
import com.provectus.kafka.ui.model.ConnectorPluginDTO;
import com.provectus.kafka.ui.model.ConnectorStateDTO;
+import com.provectus.kafka.ui.model.ConnectorTaskStatusDTO;
import com.provectus.kafka.ui.model.FullConnectorInfoDTO;
import com.provectus.kafka.ui.model.KafkaCluster;
import com.provectus.kafka.ui.model.KafkaConnectCluster;
@@ -119,12 +121,11 @@ private Stream<String> getSearchValues(FullConnectorInfoDTO fullConnectorInfo) {
private Mono<ConnectorTopics> getConnectorTopics(KafkaCluster cluster, String connectClusterName,
String connectorName) {
- return getConnectAddress(cluster, connectClusterName)
- .flatMap(connectUrl -> KafkaConnectClients
- .withBaseUrl(connectUrl)
- .getConnectorTopics(connectorName)
- .map(result -> result.get(connectorName))
- );
+ return withConnectClient(cluster, connectClusterName)
+ .flatMap(c -> c.getConnectorTopics(connectorName).map(result -> result.get(connectorName)))
+ // old connectors don't have this api, setting empty list for
+ // backward-compatibility
+ .onErrorResume(Exception.class, e -> Mono.just(new ConnectorTopics().topics(List.of())));
}
private Flux<Tuple2<String, String>> getConnectorNames(KafkaCluster cluster, String connectName) {
@@ -143,17 +144,17 @@ private List<String> parseToList(String json) {
}
public Flux<String> getConnectors(KafkaCluster cluster, String connectName) {
- return getConnectAddress(cluster, connectName)
- .flatMapMany(connect ->
- KafkaConnectClients.withBaseUrl(connect).getConnectors(null)
+ return withConnectClient(cluster, connectName)
+ .flatMapMany(client ->
+ client.getConnectors(null)
.doOnError(e -> log.error("Unexpected error upon getting connectors", e))
);
}
public Mono<ConnectorDTO> createConnector(KafkaCluster cluster, String connectName,
Mono<NewConnectorDTO> connector) {
- return getConnectAddress(cluster, connectName)
- .flatMap(connectUrl ->
+ return withConnectClient(cluster, connectName)
+ .flatMap(client ->
connector
.flatMap(c -> connectorExists(cluster, connectName, c.getName())
.map(exists -> {
@@ -164,7 +165,7 @@ public Mono<ConnectorDTO> createConnector(KafkaCluster cluster, String connectNa
return c;
}))
.map(kafkaConnectMapper::toClient)
- .flatMap(c -> KafkaConnectClients.withBaseUrl(connectUrl).createConnector(c))
+ .flatMap(client::createConnector)
.flatMap(c -> getConnector(cluster, connectName, c.getName()))
);
}
@@ -179,11 +180,11 @@ private Mono<Boolean> connectorExists(KafkaCluster cluster, String connectName,
public Mono<ConnectorDTO> getConnector(KafkaCluster cluster, String connectName,
String connectorName) {
- return getConnectAddress(cluster, connectName)
- .flatMap(connect -> KafkaConnectClients.withBaseUrl(connect).getConnector(connectorName)
+ return withConnectClient(cluster, connectName)
+ .flatMap(client -> client.getConnector(connectorName)
.map(kafkaConnectMapper::fromClient)
.flatMap(connector ->
- KafkaConnectClients.withBaseUrl(connect).getConnectorStatus(connector.getName())
+ client.getConnectorStatus(connector.getName())
// status request can return 404 if tasks not assigned yet
.onErrorResume(WebClientResponseException.NotFound.class,
e -> emptyStatus(connectorName))
@@ -228,10 +229,8 @@ private Mono<ConnectorStatus> emptyStatus(String connectorName) {
public Mono<Map<String, Object>> getConnectorConfig(KafkaCluster cluster, String connectName,
String connectorName) {
- return getConnectAddress(cluster, connectName)
- .flatMap(connect ->
- KafkaConnectClients.withBaseUrl(connect).getConnectorConfig(connectorName)
- )
+ return withConnectClient(cluster, connectName)
+ .flatMap(c -> c.getConnectorConfig(connectorName))
.map(connectorConfig -> {
final Map<String, Object> obfuscatedMap = new HashMap<>();
connectorConfig.forEach((key, value) ->
@@ -242,99 +241,94 @@ public Mono<Map<String, Object>> getConnectorConfig(KafkaCluster cluster, String
public Mono<ConnectorDTO> setConnectorConfig(KafkaCluster cluster, String connectName,
String connectorName, Mono<Object> requestBody) {
- return getConnectAddress(cluster, connectName)
- .flatMap(connect ->
- requestBody.flatMap(body ->
- KafkaConnectClients.withBaseUrl(connect)
- .setConnectorConfig(connectorName, (Map<String, Object>) body)
- )
- .map(kafkaConnectMapper::fromClient)
- );
+ return withConnectClient(cluster, connectName)
+ .flatMap(c ->
+ requestBody
+ .flatMap(body -> c.setConnectorConfig(connectorName, (Map<String, Object>) body))
+ .map(kafkaConnectMapper::fromClient));
}
public Mono<Void> deleteConnector(
KafkaCluster cluster, String connectName, String connectorName) {
- return getConnectAddress(cluster, connectName)
- .flatMap(connect ->
- KafkaConnectClients.withBaseUrl(connect).deleteConnector(connectorName)
- );
+ return withConnectClient(cluster, connectName)
+ .flatMap(c -> c.deleteConnector(connectorName));
}
public Mono<Void> updateConnectorState(KafkaCluster cluster, String connectName,
String connectorName, ConnectorActionDTO action) {
- Function<String, Mono<Void>> kafkaClientCall;
- switch (action) {
- case RESTART:
- kafkaClientCall =
- connect -> KafkaConnectClients.withBaseUrl(connect)
- .restartConnector(connectorName, true, false);
- break;
- case PAUSE:
- kafkaClientCall =
- connect -> KafkaConnectClients.withBaseUrl(connect).pauseConnector(connectorName);
- break;
- case RESUME:
- kafkaClientCall =
- connect -> KafkaConnectClients.withBaseUrl(connect).resumeConnector(connectorName);
- break;
- default:
- throw new IllegalStateException("Unexpected value: " + action);
- }
- return getConnectAddress(cluster, connectName)
- .flatMap(kafkaClientCall);
+ return withConnectClient(cluster, connectName)
+ .flatMap(client -> {
+ switch (action) {
+ case RESTART:
+ return client.restartConnector(connectorName, false, false);
+ case RESTART_ALL_TASKS:
+ return restartTasks(cluster, connectName, connectorName, task -> true);
+ case RESTART_FAILED_TASKS:
+ return restartTasks(cluster, connectName, connectorName,
+ t -> t.getStatus().getState() == ConnectorTaskStatusDTO.FAILED);
+ case PAUSE:
+ return client.pauseConnector(connectorName);
+ case RESUME:
+ return client.resumeConnector(connectorName);
+ default:
+ throw new IllegalStateException("Unexpected value: " + action);
+ }
+ });
}
- public Flux<TaskDTO> getConnectorTasks(KafkaCluster cluster, String connectName,
- String connectorName) {
- return getConnectAddress(cluster, connectName)
- .flatMapMany(connect ->
- KafkaConnectClients.withBaseUrl(connect).getConnectorTasks(connectorName)
+ private Mono<Void> restartTasks(KafkaCluster cluster, String connectName,
+ String connectorName, Predicate<TaskDTO> taskFilter) {
+ return getConnectorTasks(cluster, connectName, connectorName)
+ .filter(taskFilter)
+ .flatMap(t ->
+ restartConnectorTask(cluster, connectName, connectorName, t.getId().getTask()))
+ .then();
+ }
+
+ public Flux<TaskDTO> getConnectorTasks(KafkaCluster cluster, String connectName, String connectorName) {
+ return withConnectClient(cluster, connectName)
+ .flatMapMany(client ->
+ client.getConnectorTasks(connectorName)
.onErrorResume(WebClientResponseException.NotFound.class, e -> Flux.empty())
.map(kafkaConnectMapper::fromClient)
.flatMap(task ->
- KafkaConnectClients.withBaseUrl(connect)
+ client
.getConnectorTaskStatus(connectorName, task.getId().getTask())
.onErrorResume(WebClientResponseException.NotFound.class, e -> Mono.empty())
.map(kafkaConnectMapper::fromClient)
.map(task::status)
- )
- );
+ ));
}
public Mono<Void> restartConnectorTask(KafkaCluster cluster, String connectName,
String connectorName, Integer taskId) {
- return getConnectAddress(cluster, connectName)
- .flatMap(connect ->
- KafkaConnectClients.withBaseUrl(connect).restartConnectorTask(connectorName, taskId)
- );
+ return withConnectClient(cluster, connectName)
+ .flatMap(client -> client.restartConnectorTask(connectorName, taskId));
}
public Mono<Flux<ConnectorPluginDTO>> getConnectorPlugins(KafkaCluster cluster,
String connectName) {
- return Mono.just(getConnectAddress(cluster, connectName)
- .flatMapMany(connect ->
- KafkaConnectClients.withBaseUrl(connect).getConnectorPlugins()
- .map(kafkaConnectMapper::fromClient)
- ));
+ return withConnectClient(cluster, connectName)
+ .map(client -> client.getConnectorPlugins().map(kafkaConnectMapper::fromClient));
}
public Mono<ConnectorPluginConfigValidationResponseDTO> validateConnectorPluginConfig(
KafkaCluster cluster, String connectName, String pluginName, Mono<Object> requestBody) {
- return getConnectAddress(cluster, connectName)
- .flatMap(connect ->
- requestBody.flatMap(body ->
- KafkaConnectClients.withBaseUrl(connect)
- .validateConnectorPluginConfig(pluginName, (Map<String, Object>) body)
- )
+ return withConnectClient(cluster, connectName)
+ .flatMap(client ->
+ requestBody
+ .flatMap(body ->
+ client.validateConnectorPluginConfig(pluginName, (Map<String, Object>) body))
.map(kafkaConnectMapper::fromClient)
);
}
- private Mono<String> getConnectAddress(KafkaCluster cluster, String connectName) {
+ private Mono<KafkaConnectClientApi> withConnectClient(KafkaCluster cluster, String connectName) {
return Mono.justOrEmpty(cluster.getKafkaConnect().stream()
.filter(connect -> connect.getName().equals(connectName))
.findFirst()
.map(KafkaConnectCluster::getAddress))
- .switchIfEmpty(Mono.error(ConnectNotFoundException::new));
+ .switchIfEmpty(Mono.error(ConnectNotFoundException::new))
+ .map(KafkaConnectClients::withBaseUrl);
}
}
diff --git a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
index 277c6d71520..318366ed44f 100644
--- a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
+++ b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
@@ -2492,6 +2492,8 @@ components:
type: string
enum:
- RESTART
+ - RESTART_ALL_TASKS
+ - RESTART_FAILED_TASKS
- PAUSE
- RESUME
| null | train | train | 2022-02-17T11:15:27 | "2022-01-21T08:39:54Z" | 5hin0bi | train |
provectus/kafka-ui/1602_1603 | provectus/kafka-ui | provectus/kafka-ui/1602 | provectus/kafka-ui/1603 | [
"keyword_pr_to_issue",
"timestamp(timedelta=0.0, similarity=0.9511055445501736)"
] | 0e227bc0b067036780720c0240018400c28b5c31 | efb8410bd631dbd3f3ffab4f532c8e0d5445660e | [
"Hello there omh1280! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"Claim",
"@omh1280 Hey,\r\n\r\n sure, would be nice to get it updated.\r\n\r\nThanks",
"I also saw some documentation linking errors, this one for example:\r\n\r\nhttps://github.com/provectus/kafka-ui/blob/ce8627ea59be60367c3d824375dd3feca6f8479a/README.md?plain=1#L72\r\n\r\nAre you gonna fix those too? If not I could also contribute via PR\r\n",
"Yeah I'll fix that one and others in that PR ^. Just link or comment where else needs fixing"
] | [
"Question for maintainers",
"Question for maintainers",
"Is there a way to pass a configuration to this command?\r\n\r\nI tried this:\r\n```bash\r\n./mvnw clean spring-boot:run -Pprod -Dexec.args=\"src/main/resources/application-local.yml\"\r\n```",
"Hmm I thought I fixed this one",
"Yea, `local` and `generate-spring-webflux-api` are \"non-prod\" profiles :)",
"It should be possible indeed, but I'm not quite sure that we have required dependencies included to make that happen. Need to investigate in a separate issue.",
"Yes:\r\n`spring.config.additional-location` to keep the default config in place and override values if required.\r\n`spring.config.location` to use it as a default one.\r\n\r\nExamples:\r\n`--spring.config.location=file:///tmp/kafka-ui-conf.yml`",
"Ok, I see `local` but only for the e2e project. For developing on `kafka-ui-api` there is only prod, so maybe I'll clarify that in the docs",
"Oops. Yea, indeed, it's just for this module. So it's just `prod` for api module and openapi profile for contract module.",
"This would be really nice to have docs on!",
"Thanks for the review @Haarolean!\r\n\r\nI tried this, to no luck. Any ideas?\r\n```\r\n ./mvnw clean spring-boot:run -Pprod -Dexec.args=\"--spring.config.location=file:///path/to/conf.yaml\" \r\n```",
"Any ideas @Haarolean or anyone else? Would be nice to have this in the docs.",
"Sorry for the delay.\r\nThis should work:\r\n` ./mvnw clean spring-boot:run -Pprod -Dspring.config.location=file:///path/to/conf.yaml`",
"I'll create an issue to get this improved",
"Thanks! Updated",
"We've added a linter for links in .MD files, but it was misconfigured, that's why these got in."
] | "2022-02-14T20:24:13Z" | [
"type/documentation",
"status/accepted"
] | [docs] Update/fix documentation where needed | **Describe the bug**
After setting up my local dev environment, I've noticed some errors in the documentation. I'll go through and fix them in a PR; this issue is to track these errors. | [
"README.md",
"documentation/project/contributing/building.md",
"documentation/project/contributing/running.md",
"documentation/project/contributing/software-required.md",
"kafka-ui-react-app/README.md"
] | [
"README.md",
"documentation/project/contributing/building.md",
"documentation/project/contributing/running.md",
"documentation/project/contributing/software-required.md",
"kafka-ui-react-app/README.md"
] | [] | diff --git a/README.md b/README.md
index 7a0f30e7731..fbf9eacdd8d 100644
--- a/README.md
+++ b/README.md
@@ -69,7 +69,7 @@ We have plenty of [docker-compose files](documentation/compose/DOCKER_COMPOSE.md
- [SSO configuration](documentation/guides/SSO.md)
- [AWS IAM configuration](documentation/guides/AWS_IAM.md)
-- [Docker-compose files](documentation/guides/yaml-description.md)
+- [Docker-compose files](documentation/compose/DOCKER_COMPOSE.md)
- [Connection to a secure broker]()
## Connecting to a Secure Broker
diff --git a/documentation/project/contributing/building.md b/documentation/project/contributing/building.md
index 37596be38fc..21562426e5e 100644
--- a/documentation/project/contributing/building.md
+++ b/documentation/project/contributing/building.md
@@ -8,15 +8,16 @@ Build a docker container with the app:
```
Start the app with Kafka clusters:
```sh
-docker-compose -f ./docker/kafka-ui.yaml up -d
+docker-compose -f ./documentation/compose/kafka-ui.yaml up -d
```
To see the app, navigate to http://localhost:8080.
-If you want to start only kafka clusters (to run the app via `boot:run`):
+If you want to start only kafka clusters (to run the app via `spring-boot:run`):
```sh
-docker-compose -f ./docker/kafka-clusters-only.yaml up -d
+docker-compose -f ./documentation/compose/kafka-clusters-only.yaml up -d
```
-Then start the app with a **local** profile.
+
+Then, start the app.
## Where to go next
diff --git a/documentation/project/contributing/running.md b/documentation/project/contributing/running.md
index aec09804d86..a74f198f0c1 100644
--- a/documentation/project/contributing/running.md
+++ b/documentation/project/contributing/running.md
@@ -3,14 +3,18 @@
### Running locally via docker
If you have built a container locally or wish to run a public one you could bring everything up like this:
```shell
-docker-compose -f docker/kafka-ui.yaml up -d
+docker-compose -f documentation/compose/kafka-ui.yaml up -d
```
### Running locally without docker
-Once you built the app, run the following:
+Once you built the app, run the following in `kafka-ui-api/`:
```sh
./mvnw spring-boot:run -Pprod
+
+# or
+
+./mvnw spring-boot:run -Pprod -Dspring.config.location=file:///path/to/conf.yaml
```
### Running in kubernetes
diff --git a/documentation/project/contributing/software-required.md b/documentation/project/contributing/software-required.md
index dd3fa656c36..8d3b86c7311 100644
--- a/documentation/project/contributing/software-required.md
+++ b/documentation/project/contributing/software-required.md
@@ -29,4 +29,3 @@ Otherwise, some apps within a stack (e.g. `kafka-ui.yaml`) might crash.
## Where to go next
In the next section, you'll [learn how to build the application](building.md).
-### GIT SETUP
\ No newline at end of file
diff --git a/kafka-ui-react-app/README.md b/kafka-ui-react-app/README.md
index 3eabe899264..43af77d4f5a 100644
--- a/kafka-ui-react-app/README.md
+++ b/kafka-ui-react-app/README.md
@@ -54,7 +54,7 @@ Have to be run from root directory.
Start UI for Apache Kafka with your Kafka clusters:
```sh
-docker-compose -f ./docker/kafka-ui.yaml up
+docker-compose -f ./documentation/compose/kafka-ui.yaml up
```
Make sure that none of the `.env*` files contain `DEV_PROXY` variable
| null | val | train | 2022-02-17T16:46:52 | "2022-02-14T19:56:03Z" | ottaviohartman | train |
provectus/kafka-ui/1316_1609 | provectus/kafka-ui | provectus/kafka-ui/1316 | provectus/kafka-ui/1609 | [
"connected"
] | b8c43f069e630a7ace4ed1d541cbe82f3a22924a | 0e227bc0b067036780720c0240018400c28b5c31 | [
"fixed within https://github.com/provectus/kafka-ui/pull/1360",
"It's not"
] | [
"There's already one with this code :)",
"[Get](https://docs.confluent.io/platform/current/schema-registry/develop/using.html#show-compatibility-requirements-in-effect-for-a-subject) global compatibility level if nothing is specified for the subject",
"The rest is refactoring required for passing uri variables / query params.",
"There's no need for this. Moreover, this caused SR cache to save schema id which triggered 404 on delete in the future.",
"can you also fix 4015 ?)",
"we need this reformatting?",
"Yea, next method call starts one symbol after the previous statement, not a symbol after `return`, that's weird. Also no clue why checkstyle hasn't failed before.",
"Yea, done"
] | "2022-02-15T11:32:36Z" | [
"type/bug",
"scope/backend",
"status/accepted",
"status/confirmed"
] | Schema registry: delete request doesn't return a response | **Describe the bug**
Schema registry: delete request doesn't return a response
**Set up**
docker-compose -f kafka-ui.yaml up
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Create a schema
2. Delete a schema
**Expected behavior**
Backend returns a response. In fact, it's pending until timeout happens. | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/SchemasController.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/ErrorCode.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/SchemasController.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/ErrorCode.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java"
] | [
"kafka-ui-api/src/test/java/com/provectus/kafka/ui/SchemaRegistryServiceTests.java"
] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/SchemasController.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/SchemasController.java
index e738216b49a..0526ee8b1ff 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/SchemasController.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/SchemasController.java
@@ -11,8 +11,6 @@
import com.provectus.kafka.ui.service.SchemaRegistryService;
import java.util.Arrays;
import java.util.List;
-import java.util.Optional;
-import java.util.function.Predicate;
import java.util.stream.Collectors;
import javax.validation.Valid;
import lombok.RequiredArgsConstructor;
@@ -63,21 +61,22 @@ public Mono<ResponseEntity<SchemaSubjectDTO>> createNewSchema(
@Override
public Mono<ResponseEntity<Void>> deleteLatestSchema(
String clusterName, String subject, ServerWebExchange exchange) {
- return schemaRegistryService.deleteLatestSchemaSubject(getCluster(clusterName), subject);
+ return schemaRegistryService.deleteLatestSchemaSubject(getCluster(clusterName), subject)
+ .thenReturn(ResponseEntity.ok().build());
}
@Override
public Mono<ResponseEntity<Void>> deleteSchema(
String clusterName, String subjectName, ServerWebExchange exchange) {
return schemaRegistryService.deleteSchemaSubjectEntirely(getCluster(clusterName), subjectName)
- .thenReturn(ResponseEntity.ok().build());
+ .thenReturn(ResponseEntity.ok().build());
}
@Override
public Mono<ResponseEntity<Void>> deleteSchemaByVersion(
String clusterName, String subjectName, Integer version, ServerWebExchange exchange) {
- return schemaRegistryService.deleteSchemaSubjectByVersion(
- getCluster(clusterName), subjectName, version);
+ return schemaRegistryService.deleteSchemaSubjectByVersion(getCluster(clusterName), subjectName, version)
+ .thenReturn(ResponseEntity.ok().build());
}
@Override
@@ -98,7 +97,7 @@ public Mono<ResponseEntity<CompatibilityLevelDTO>> getGlobalSchemaCompatibilityL
@Override
public Mono<ResponseEntity<SchemaSubjectDTO>> getLatestSchema(String clusterName, String subject,
- ServerWebExchange exchange) {
+ ServerWebExchange exchange) {
return schemaRegistryService.getLatestSchemaVersionBySubject(getCluster(clusterName), subject)
.map(ResponseEntity::ok);
}
@@ -107,7 +106,7 @@ public Mono<ResponseEntity<SchemaSubjectDTO>> getLatestSchema(String clusterName
public Mono<ResponseEntity<SchemaSubjectDTO>> getSchemaByVersion(
String clusterName, String subject, Integer version, ServerWebExchange exchange) {
return schemaRegistryService.getSchemaSubjectByVersion(
- getCluster(clusterName), subject, version)
+ getCluster(clusterName), subject, version)
.map(ResponseEntity::ok);
}
@@ -118,23 +117,23 @@ public Mono<ResponseEntity<SchemaSubjectsResponseDTO>> getSchemas(String cluster
@Valid String search,
ServerWebExchange serverWebExchange) {
return schemaRegistryService
- .getAllSubjectNames(getCluster(clusterName))
- .flatMap(subjects -> {
- int pageSize = perPage != null && perPage > 0 ? perPage : DEFAULT_PAGE_SIZE;
- int subjectToSkip = ((pageNum != null && pageNum > 0 ? pageNum : 1) - 1) * pageSize;
- List<String> filteredSubjects = Arrays.stream(subjects)
- .filter(subj -> search == null || StringUtils.containsIgnoreCase(subj, search))
- .sorted()
- .collect(Collectors.toList());
- var totalPages = (filteredSubjects.size() / pageSize)
- + (filteredSubjects.size() % pageSize == 0 ? 0 : 1);
- List<String> subjectsToRender = filteredSubjects.stream()
- .skip(subjectToSkip)
- .limit(pageSize)
- .collect(Collectors.toList());
- return schemaRegistryService.getAllLatestVersionSchemas(getCluster(clusterName), subjectsToRender)
- .map(a -> new SchemaSubjectsResponseDTO().pageCount(totalPages).schemas(a));
- }).map(ResponseEntity::ok);
+ .getAllSubjectNames(getCluster(clusterName))
+ .flatMap(subjects -> {
+ int pageSize = perPage != null && perPage > 0 ? perPage : DEFAULT_PAGE_SIZE;
+ int subjectToSkip = ((pageNum != null && pageNum > 0 ? pageNum : 1) - 1) * pageSize;
+ List<String> filteredSubjects = Arrays.stream(subjects)
+ .filter(subj -> search == null || StringUtils.containsIgnoreCase(subj, search))
+ .sorted()
+ .collect(Collectors.toList());
+ var totalPages = (filteredSubjects.size() / pageSize)
+ + (filteredSubjects.size() % pageSize == 0 ? 0 : 1);
+ List<String> subjectsToRender = filteredSubjects.stream()
+ .skip(subjectToSkip)
+ .limit(pageSize)
+ .collect(Collectors.toList());
+ return schemaRegistryService.getAllLatestVersionSchemas(getCluster(clusterName), subjectsToRender)
+ .map(a -> new SchemaSubjectsResponseDTO().pageCount(totalPages).schemas(a));
+ }).map(ResponseEntity::ok);
}
@Override
@@ -143,7 +142,7 @@ public Mono<ResponseEntity<Void>> updateGlobalSchemaCompatibilityLevel(
ServerWebExchange exchange) {
log.info("Updating schema compatibility globally");
return schemaRegistryService.updateSchemaCompatibility(
- getCluster(clusterName), compatibilityLevel)
+ getCluster(clusterName), compatibilityLevel)
.map(ResponseEntity::ok);
}
@@ -153,7 +152,7 @@ public Mono<ResponseEntity<Void>> updateSchemaCompatibilityLevel(
ServerWebExchange exchange) {
log.info("Updating schema compatibility for subject: {}", subject);
return schemaRegistryService.updateSchemaCompatibility(
- getCluster(clusterName), subject, compatibilityLevel)
+ getCluster(clusterName), subject, compatibilityLevel)
.map(ResponseEntity::ok);
}
}
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/ErrorCode.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/ErrorCode.java
index 38ab56e8920..d6ed8b8a933 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/ErrorCode.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/ErrorCode.java
@@ -11,7 +11,6 @@ public enum ErrorCode {
KSQL_API_ERROR(5001, HttpStatus.INTERNAL_SERVER_ERROR),
BINDING_FAIL(4001, HttpStatus.BAD_REQUEST),
NOT_FOUND(404, HttpStatus.NOT_FOUND),
- INVALID_ENTITY_STATE(4001, HttpStatus.BAD_REQUEST),
VALIDATION_FAIL(4002, HttpStatus.BAD_REQUEST),
READ_ONLY_MODE_ENABLE(4003, HttpStatus.METHOD_NOT_ALLOWED),
CONNECT_CONFLICT_RESPONSE(4004, HttpStatus.CONFLICT),
@@ -26,7 +25,8 @@ public enum ErrorCode {
TOPIC_OR_PARTITION_NOT_FOUND(4013, HttpStatus.BAD_REQUEST),
INVALID_REQUEST(4014, HttpStatus.BAD_REQUEST),
RECREATE_TOPIC_TIMEOUT(4015, HttpStatus.REQUEST_TIMEOUT),
- SCHEMA_NOT_DELETED(4015, HttpStatus.INTERNAL_SERVER_ERROR);
+ INVALID_ENTITY_STATE(4016, HttpStatus.BAD_REQUEST),
+ SCHEMA_NOT_DELETED(4017, HttpStatus.INTERNAL_SERVER_ERROR);
static {
// codes uniqueness check
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java
index 10e0a0a147c..eda4a4dc367 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java
@@ -3,7 +3,6 @@
import static org.springframework.http.HttpStatus.NOT_FOUND;
import static org.springframework.http.HttpStatus.UNPROCESSABLE_ENTITY;
-import com.provectus.kafka.ui.exception.DuplicateEntityException;
import com.provectus.kafka.ui.exception.SchemaFailedToDeleteException;
import com.provectus.kafka.ui.exception.SchemaNotFoundException;
import com.provectus.kafka.ui.exception.SchemaTypeIsNotSupportedException;
@@ -22,6 +21,8 @@
import com.provectus.kafka.ui.model.schemaregistry.InternalCompatibilityLevel;
import com.provectus.kafka.ui.model.schemaregistry.InternalNewSchema;
import com.provectus.kafka.ui.model.schemaregistry.SubjectIdResponse;
+import java.net.URI;
+import java.util.Collections;
import java.util.Formatter;
import java.util.List;
import java.util.Objects;
@@ -35,11 +36,13 @@
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
import org.springframework.web.reactive.function.BodyInserters;
import org.springframework.web.reactive.function.client.ClientResponse;
import org.springframework.web.reactive.function.client.WebClient;
+import org.springframework.web.util.UriComponentsBuilder;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@@ -65,8 +68,8 @@ public class SchemaRegistryService {
public Mono<List<SchemaSubjectDTO>> getAllLatestVersionSchemas(KafkaCluster cluster,
List<String> subjects) {
return Flux.fromIterable(subjects)
- .concatMap(subject -> getLatestSchemaVersionBySubject(cluster, subject))
- .collect(Collectors.toList());
+ .concatMap(subject -> getLatestSchemaVersionBySubject(cluster, subject))
+ .collect(Collectors.toList());
}
public Mono<String[]> getAllSubjectNames(KafkaCluster cluster) {
@@ -88,7 +91,8 @@ private Flux<Integer> getSubjectVersions(KafkaCluster cluster, String schemaName
return configuredWebClient(
cluster,
HttpMethod.GET,
- URL_SUBJECT_VERSIONS, schemaName)
+ URL_SUBJECT_VERSIONS,
+ schemaName)
.retrieve()
.onStatus(NOT_FOUND::equals,
throwIfNotFoundStatus(formatted(NO_SUCH_SCHEMA, schemaName)))
@@ -101,7 +105,7 @@ public Mono<SchemaSubjectDTO> getSchemaSubjectByVersion(KafkaCluster cluster, St
}
public Mono<SchemaSubjectDTO> getLatestSchemaVersionBySubject(KafkaCluster cluster,
- String schemaName) {
+ String schemaName) {
return this.getSchemaSubject(cluster, schemaName, LATEST);
}
@@ -110,7 +114,8 @@ private Mono<SchemaSubjectDTO> getSchemaSubject(KafkaCluster cluster, String sch
return configuredWebClient(
cluster,
HttpMethod.GET,
- URL_SUBJECT_BY_VERSION, schemaName, version)
+ URL_SUBJECT_BY_VERSION,
+ List.of(schemaName, version))
.retrieve()
.onStatus(NOT_FOUND::equals,
throwIfNotFoundStatus(formatted(NO_SUCH_SCHEMA_VERSION, schemaName, version))
@@ -135,35 +140,39 @@ private SchemaSubjectDTO withSchemaType(SchemaSubjectDTO s) {
return s.schemaType(Optional.ofNullable(s.getSchemaType()).orElse(SchemaTypeDTO.AVRO));
}
- public Mono<ResponseEntity<Void>> deleteSchemaSubjectByVersion(KafkaCluster cluster,
- String schemaName,
- Integer version) {
+ public Mono<Void> deleteSchemaSubjectByVersion(KafkaCluster cluster,
+ String schemaName,
+ Integer version) {
return this.deleteSchemaSubject(cluster, schemaName, String.valueOf(version));
}
- public Mono<ResponseEntity<Void>> deleteLatestSchemaSubject(KafkaCluster cluster,
- String schemaName) {
+ public Mono<Void> deleteLatestSchemaSubject(KafkaCluster cluster,
+ String schemaName) {
return this.deleteSchemaSubject(cluster, schemaName, LATEST);
}
- private Mono<ResponseEntity<Void>> deleteSchemaSubject(KafkaCluster cluster, String schemaName,
- String version) {
+ private Mono<Void> deleteSchemaSubject(KafkaCluster cluster, String schemaName,
+ String version) {
return configuredWebClient(
cluster,
HttpMethod.DELETE,
- URL_SUBJECT_BY_VERSION, schemaName, version)
+ URL_SUBJECT_BY_VERSION,
+ List.of(schemaName, version))
.retrieve()
.onStatus(NOT_FOUND::equals,
throwIfNotFoundStatus(formatted(NO_SUCH_SCHEMA_VERSION, schemaName, version))
- ).toBodilessEntity();
+ )
+ .toBodilessEntity()
+ .then();
}
public Mono<Void> deleteSchemaSubjectEntirely(KafkaCluster cluster,
- String schemaName) {
+ String schemaName) {
return configuredWebClient(
cluster,
HttpMethod.DELETE,
- URL_SUBJECT, schemaName)
+ URL_SUBJECT,
+ schemaName)
.retrieve()
.onStatus(HttpStatus::isError, errorOnSchemaDeleteFailure(schemaName))
.toBodilessEntity()
@@ -183,9 +192,7 @@ public Mono<SchemaSubjectDTO> registerNewSchema(KafkaCluster cluster,
Mono<InternalNewSchema> newSchema =
Mono.just(new InternalNewSchema(schema.getSchema(), schemaType));
String subject = schema.getSubject();
- var schemaRegistry = cluster.getSchemaRegistry();
- return checkSchemaOnDuplicate(subject, newSchema, schemaRegistry)
- .flatMap(s -> submitNewSchema(subject, newSchema, schemaRegistry))
+ return submitNewSchema(subject, newSchema, cluster)
.flatMap(resp -> getLatestSchemaVersionBySubject(cluster, subject));
});
}
@@ -193,44 +200,23 @@ public Mono<SchemaSubjectDTO> registerNewSchema(KafkaCluster cluster,
@NotNull
private Mono<SubjectIdResponse> submitNewSchema(String subject,
Mono<InternalNewSchema> newSchemaSubject,
- InternalSchemaRegistry schemaRegistry) {
+ KafkaCluster cluster) {
return configuredWebClient(
- schemaRegistry,
+ cluster,
HttpMethod.POST,
- URL_SUBJECT_VERSIONS, subject)
+ URL_SUBJECT_VERSIONS,
+ subject)
.contentType(MediaType.APPLICATION_JSON)
.body(BodyInserters.fromPublisher(newSchemaSubject, InternalNewSchema.class))
.retrieve()
.onStatus(UNPROCESSABLE_ENTITY::equals,
r -> r.bodyToMono(ErrorResponse.class)
.flatMap(x -> Mono.error(isUnrecognizedFieldSchemaTypeMessage(x.getMessage())
- ? new SchemaTypeIsNotSupportedException()
- : new UnprocessableEntityException(x.getMessage()))))
+ ? new SchemaTypeIsNotSupportedException()
+ : new UnprocessableEntityException(x.getMessage()))))
.bodyToMono(SubjectIdResponse.class);
}
- @NotNull
- private Mono<SchemaSubjectDTO> checkSchemaOnDuplicate(String subject,
- Mono<InternalNewSchema> newSchemaSubject,
- InternalSchemaRegistry schemaRegistry) {
- return configuredWebClient(
- schemaRegistry,
- HttpMethod.POST,
- URL_SUBJECT, subject)
- .contentType(MediaType.APPLICATION_JSON)
- .body(BodyInserters.fromPublisher(newSchemaSubject, InternalNewSchema.class))
- .retrieve()
- .onStatus(NOT_FOUND::equals, res -> Mono.empty())
- .onStatus(UNPROCESSABLE_ENTITY::equals,
- r -> r.bodyToMono(ErrorResponse.class)
- .flatMap(x -> Mono.error(isUnrecognizedFieldSchemaTypeMessage(x.getMessage())
- ? new SchemaTypeIsNotSupportedException()
- : new UnprocessableEntityException(x.getMessage()))))
- .bodyToMono(SchemaSubjectDTO.class)
- .filter(s -> Objects.isNull(s.getId()))
- .switchIfEmpty(Mono.error(new DuplicateEntityException("Such schema already exists")));
- }
-
@NotNull
private Function<ClientResponse, Mono<? extends Throwable>> throwIfNotFoundStatus(
String formatted) {
@@ -249,7 +235,8 @@ public Mono<Void> updateSchemaCompatibility(KafkaCluster cluster, String schemaN
return configuredWebClient(
cluster,
HttpMethod.PUT,
- configEndpoint, schemaName)
+ configEndpoint,
+ schemaName)
.contentType(MediaType.APPLICATION_JSON)
.body(BodyInserters.fromPublisher(compatibilityLevel, CompatibilityLevelDTO.class))
.retrieve()
@@ -265,11 +252,15 @@ public Mono<Void> updateSchemaCompatibility(KafkaCluster cluster,
public Mono<CompatibilityLevelDTO> getSchemaCompatibilityLevel(KafkaCluster cluster,
String schemaName) {
- String configEndpoint = Objects.isNull(schemaName) ? "/config" : "/config/{schemaName}";
+ String globalConfig = Objects.isNull(schemaName) ? "/config" : "/config/{schemaName}";
+ final var values = new LinkedMultiValueMap<String, String>();
+ values.add("defaultToGlobal", "true");
return configuredWebClient(
cluster,
HttpMethod.GET,
- configEndpoint, schemaName)
+ globalConfig,
+ (schemaName == null ? Collections.emptyList() : List.of(schemaName)),
+ values)
.retrieve()
.bodyToMono(InternalCompatibilityLevel.class)
.map(mapper::toCompatibilityLevel)
@@ -281,7 +272,7 @@ public Mono<CompatibilityLevelDTO> getGlobalSchemaCompatibilityLevel(KafkaCluste
}
private Mono<CompatibilityLevelDTO> getSchemaCompatibilityInfoOrGlobal(KafkaCluster cluster,
- String schemaName) {
+ String schemaName) {
return this.getSchemaCompatibilityLevel(cluster, schemaName)
.switchIfEmpty(this.getGlobalSchemaCompatibilityLevel(cluster));
}
@@ -291,7 +282,8 @@ public Mono<CompatibilityCheckResponseDTO> checksSchemaCompatibility(
return configuredWebClient(
cluster,
HttpMethod.POST,
- "/compatibility/subjects/{schemaName}/versions/latest", schemaName)
+ "/compatibility/subjects/{schemaName}/versions/latest",
+ schemaName)
.contentType(MediaType.APPLICATION_JSON)
.body(BodyInserters.fromPublisher(newSchemaSubject, NewSchemaSubjectDTO.class))
.retrieve()
@@ -313,29 +305,50 @@ private void setBasicAuthIfEnabled(InternalSchemaRegistry schemaRegistry, HttpHe
);
} else if (schemaRegistry.getUsername() != null) {
throw new ValidationException(
- "You specified username but do not specified password");
+ "You specified username but did not specify password");
} else if (schemaRegistry.getPassword() != null) {
throw new ValidationException(
- "You specified password but do not specified username");
+ "You specified password but did not specify username");
}
}
+ private boolean isUnrecognizedFieldSchemaTypeMessage(String errorMessage) {
+ return errorMessage.contains(UNRECOGNIZED_FIELD_SCHEMA_TYPE);
+ }
+
+ private WebClient.RequestBodySpec configuredWebClient(KafkaCluster cluster, HttpMethod method, String uri) {
+ return configuredWebClient(cluster, method, uri, Collections.emptyList(),
+ new LinkedMultiValueMap<>());
+ }
+
private WebClient.RequestBodySpec configuredWebClient(KafkaCluster cluster, HttpMethod method,
- String uri, Object... params) {
- return configuredWebClient(cluster.getSchemaRegistry(), method, uri, params);
+ String uri, List<String> uriVariables) {
+ return configuredWebClient(cluster, method, uri, uriVariables, new LinkedMultiValueMap<>());
}
- private WebClient.RequestBodySpec configuredWebClient(InternalSchemaRegistry schemaRegistry,
+ private WebClient.RequestBodySpec configuredWebClient(KafkaCluster cluster, HttpMethod method,
+ String uri, String uriVariable) {
+ return configuredWebClient(cluster, method, uri, List.of(uriVariable),
+ new LinkedMultiValueMap<>());
+ }
+
+ private WebClient.RequestBodySpec configuredWebClient(KafkaCluster cluster,
HttpMethod method, String uri,
- Object... params) {
+ List<String> uriVariables,
+ MultiValueMap<String, String> queryParams) {
+ final var schemaRegistry = cluster.getSchemaRegistry();
return webClient
.method(method)
- .uri(schemaRegistry.getFirstUrl() + uri, params)
+ .uri(buildUri(schemaRegistry, uri, uriVariables, queryParams))
.headers(headers -> setBasicAuthIfEnabled(schemaRegistry, headers));
}
- private boolean isUnrecognizedFieldSchemaTypeMessage(String errorMessage) {
- return errorMessage.contains(UNRECOGNIZED_FIELD_SCHEMA_TYPE);
+ private URI buildUri(InternalSchemaRegistry schemaRegistry, String uri, List<String> uriVariables,
+ MultiValueMap<String, String> queryParams) {
+ final var builder = UriComponentsBuilder
+ .fromHttpUrl(schemaRegistry.getFirstUrl() + uri);
+ builder.queryParams(queryParams);
+ return builder.buildAndExpand(uriVariables.toArray()).toUri();
}
private Function<ClientResponse, Mono<? extends Throwable>> errorOnSchemaDeleteFailure(String schemaName) {
| diff --git a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/SchemaRegistryServiceTests.java b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/SchemaRegistryServiceTests.java
index 1712c000c73..2bf5e2e82c2 100644
--- a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/SchemaRegistryServiceTests.java
+++ b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/SchemaRegistryServiceTests.java
@@ -14,7 +14,6 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient;
-import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.web.reactive.server.EntityExchangeResult;
@@ -71,26 +70,40 @@ void shouldBeBadRequestIfNoSchemaType() {
}
@Test
- void shouldReturn409WhenSchemaDuplicatesThePreviousVersion() {
+ void shouldNotDoAnythingIfSchemaNotChanged() {
String schema =
"{\"subject\":\"%s\",\"schemaType\":\"AVRO\",\"schema\":"
+ "\"{\\\"type\\\": \\\"string\\\"}\"}";
- webTestClient
+ SchemaSubjectDTO dto = webTestClient
.post()
.uri("/api/clusters/{clusterName}/schemas", LOCAL)
.contentType(MediaType.APPLICATION_JSON)
.body(BodyInserters.fromValue(String.format(schema, subject)))
.exchange()
- .expectStatus().isEqualTo(HttpStatus.OK);
+ .expectStatus()
+ .isOk()
+ .expectBody(SchemaSubjectDTO.class)
+ .returnResult()
+ .getResponseBody();
- webTestClient
+ Assertions.assertNotNull(dto);
+ Assertions.assertEquals("1", dto.getVersion());
+
+ dto = webTestClient
.post()
.uri("/api/clusters/{clusterName}/schemas", LOCAL)
.contentType(MediaType.APPLICATION_JSON)
.body(BodyInserters.fromValue(String.format(schema, subject)))
.exchange()
- .expectStatus().isEqualTo(HttpStatus.CONFLICT);
+ .expectStatus()
+ .isOk()
+ .expectBody(SchemaSubjectDTO.class)
+ .returnResult()
+ .getResponseBody();
+
+ Assertions.assertNotNull(dto);
+ Assertions.assertEquals("1", dto.getVersion());
}
@Test
| train | train | 2022-02-17T11:25:46 | "2021-12-23T11:10:39Z" | Haarolean | train |
provectus/kafka-ui/1509_1614 | provectus/kafka-ui | provectus/kafka-ui/1509 | provectus/kafka-ui/1614 | [
"keyword_pr_to_issue",
"timestamp(timedelta=0.0, similarity=0.9811725331437327)"
] | f084dc36a1a5809a6b83f73c7797739af932c13f | c3d44c95c27826a7cc6275cf6ae58411097efb8f | [] | [
"I think it's not necessary to create a var if u use it only once.\r\nIt's better to either remove it or use it in `cd kafka-ui-react-app && npm run pre-commit`",
"`if git diff --cached --name-only | grep --quiet \"kafka-ui-react-app\"`\r\nSomething like that?"
] | "2022-02-16T11:23:12Z" | [
"type/enhancement",
"scope/frontend",
"status/accepted",
"type/chore",
"scope/infrastructure"
] | Do not run frontend tests upon git hooks | [
"kafka-ui-react-app/.husky/pre-commit"
] | [
"kafka-ui-react-app/.husky/pre-commit"
] | [] | diff --git a/kafka-ui-react-app/.husky/pre-commit b/kafka-ui-react-app/.husky/pre-commit
index 0664e92c6fa..b10cf37b9c2 100755
--- a/kafka-ui-react-app/.husky/pre-commit
+++ b/kafka-ui-react-app/.husky/pre-commit
@@ -1,4 +1,11 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
-cd kafka-ui-react-app && npm run pre-commit
+
+if git diff --cached --name-only | grep --quiet "kafka-ui-react-app"
+then
+ cd kafka-ui-react-app && npm run pre-commit
+else
+ echo "Skipping frontend tests"
+ exit 0
+fi
| null | train | train | 2022-02-16T08:10:36 | "2022-01-28T14:19:48Z" | Haarolean | train |
|
provectus/kafka-ui/1013_1631 | provectus/kafka-ui | provectus/kafka-ui/1013 | provectus/kafka-ui/1631 | [
"connected"
] | ea9a145583a0cf4f02afa3b1ecdc1c76b2905de9 | ed1e2bd4055971dab797b957500d295a1ce3da25 | [
"Very similar to #998. ",
"It is somewhat similar indeed, but #998 is about re-creating single topic to clear out all data and \"reset\" all offsets to 0-state. This request is more about making a \"clone\" of one topic in a simple way. Just clarifying this point to avoid confusion.",
"Yeah I get it :) That's a note for us about implementation"
] | [
"I am not sure whether we need to restrict the number of cloned messages for a particular topic. \r\nFor now, the limit Integer.MAX_VALUE(about 10^9 messages). Maybe it is worth removing it or making it customized?",
"looks like loadTopic will return TopicNotFoundException not empty mono in case of non-existing topic, and we have GlobalErrorWebExceptionHandler that should catch and map exception to proper status. So, no need to handle it here.",
"Let's clone just the topic with its configuration without messages."
] | "2022-02-17T22:27:32Z" | [
"scope/backend",
"scope/frontend",
"status/accepted",
"type/feature"
] | Clone topic functionality | ### Is your proposal related to a problem?
I often find myself creating a topic that has exactly same configuration as existing one. In which case I need to have 2 windows open side-by-side to see source configuration and replicate it in new topic. That is a bit troublesome.
### Describe the solution you'd like
1. In topic list view a button to clone selected topic (when single topic selected)
2. (optional) clone with data (i.e. spawn consumer reading from beginning of the source topic to the end and writing messages to destination topic)
### Describe alternatives you've considered
N/A. Currently copying existing topic configuration needs to be done manually
### Additional context
N/A
| [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/TopicsController.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java",
"kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/TopicsController.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java",
"kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml"
] | [
"kafka-ui-api/src/test/java/com/provectus/kafka/ui/KafkaTopicCreateTests.java"
] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/TopicsController.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/TopicsController.java
index b05d19d8537..3ebe2b03a70 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/TopicsController.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/TopicsController.java
@@ -46,6 +46,13 @@ public Mono<ResponseEntity<TopicDTO>> recreateTopic(String clusterName,
.map(s -> new ResponseEntity<>(s, HttpStatus.CREATED));
}
+ @Override
+ public Mono<ResponseEntity<TopicDTO>> cloneTopic(
+ String clusterName, String topicName, String newTopicName, ServerWebExchange exchange) {
+ return topicsService.cloneTopic(getCluster(clusterName), topicName, newTopicName)
+ .map(s -> new ResponseEntity<>(s, HttpStatus.CREATED));
+ }
+
@Override
public Mono<ResponseEntity<Void>> deleteTopic(
String clusterName, String topicName, ServerWebExchange exchange) {
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java
index 184a10e4823..b4629cf39c6 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java
@@ -428,6 +428,18 @@ public TopicMessageSchemaDTO getTopicSchema(KafkaCluster cluster, String topicNa
.getTopicSchema(topicName);
}
+ public Mono<TopicDTO> cloneTopic(
+ KafkaCluster cluster, String topicName, String newTopicName) {
+ return loadTopic(cluster, topicName).flatMap(topic ->
+ adminClientService.get(cluster).flatMap(ac -> ac.createTopic(newTopicName,
+ topic.getPartitionCount(),
+ (short) topic.getReplicationFactor(),
+ topic.getTopicConfigs()
+ .stream()
+ .collect(Collectors.toMap(InternalTopicConfig::getName, InternalTopicConfig::getValue)))
+ ).thenReturn(newTopicName).flatMap(a -> loadTopic(cluster, newTopicName)).map(clusterMapper::toTopic));
+ }
+
@VisibleForTesting
@lombok.Value
static class Pagination {
diff --git a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
index 8133a810d40..d4a5d3b36e3 100644
--- a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
+++ b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
@@ -331,6 +331,38 @@ paths:
schema:
$ref: '#/components/schemas/Topic'
+ /api/clusters/{clusterName}/topics/{topicName}/clone:
+ post:
+ tags:
+ - Topics
+ summary: cloneTopic
+ operationId: cloneTopic
+ parameters:
+ - name: clusterName
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: topicName
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: newTopicName
+ in: query
+ required: true
+ schema:
+ type: string
+ responses:
+ 201:
+ description: Created
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Topic'
+ 404:
+ description: Not found
+
/api/clusters/{clusterName}/topics/{topicName}:
get:
tags:
| diff --git a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/KafkaTopicCreateTests.java b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/KafkaTopicCreateTests.java
index 558695556a8..3c47d7e9b51 100644
--- a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/KafkaTopicCreateTests.java
+++ b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/KafkaTopicCreateTests.java
@@ -76,4 +76,32 @@ void shouldRecreateExistingTopicSuccessfully() {
.jsonPath("replicationFactor").isEqualTo(topicCreation.getReplicationFactor().toString())
.jsonPath("name").isEqualTo(topicCreation.getName());
}
+
+ @Test
+ void shouldCloneExistingTopicSuccessfully() {
+ TopicCreationDTO topicCreation = new TopicCreationDTO()
+ .replicationFactor(1)
+ .partitions(3)
+ .name(UUID.randomUUID().toString());
+ String clonedTopicName = UUID.randomUUID().toString();
+
+ webTestClient.post()
+ .uri("/api/clusters/{clusterName}/topics", LOCAL)
+ .bodyValue(topicCreation)
+ .exchange()
+ .expectStatus()
+ .isOk();
+
+ webTestClient.post()
+ .uri("/api/clusters/{clusterName}/topics/{topicName}/clone?newTopicName=" + clonedTopicName,
+ LOCAL, topicCreation.getName())
+ .exchange()
+ .expectStatus()
+ .isCreated()
+ .expectBody()
+ .jsonPath("partitionCount").isEqualTo(topicCreation.getPartitions().toString())
+ .jsonPath("replicationFactor").isEqualTo(topicCreation.getReplicationFactor().toString())
+ .jsonPath("name").isEqualTo(clonedTopicName);
+ }
+
}
| train | train | 2022-03-12T11:26:32 | "2021-10-25T16:05:54Z" | akamensky | train |
provectus/kafka-ui/1620_1635 | provectus/kafka-ui | provectus/kafka-ui/1620 | provectus/kafka-ui/1635 | [
"connected"
] | b8761b500de0609a2e1fe94f6f47151a6f4b7722 | 3f0693bad62ae53cae3cd74c19996bb08a4bf171 | [] | [] | "2022-02-18T11:55:08Z" | [
"type/bug",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Hyphens in dashboards names should not be treated as carriage return | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
In the menu to the left side the dashboards names containing an hyphen are split in two lines.
```
UI for Apache UI Version: v0.3.3 (38c4cf7)
Dashboard
silos-
kafka
Brokers
```
We should see here `silos-kafka` in a single row
```
UI for Apache UI Version: v0.3.3 (38c4cf7)
Dashboard
silos-kafka
Brokers
```
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Set in the helm values `KAFKA_CLUSTERS_0_NAME` as shown in the following code snippet:
```
kafka-ui:
envs:
config:
KAFKA_CLUSTERS_0_NAME: silos-kafka
```
2. Look at the UI
**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
The name should not be split in two lines
**Additional context**
<!--
(Add any other context about the problem here)
-->
Version: v0.3.3 (38c4cf7) | [
"kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts",
"kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.tsx"
] | [
"kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts",
"kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts b/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts
index 1989d5040a4..082cca51233 100644
--- a/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts
+++ b/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts
@@ -28,8 +28,12 @@ export const Wrapper = styled.li.attrs({ role: 'menuitem' })(
`
);
-export const Title = styled.span`
+export const Title = styled.div`
grid-area: title;
+ white-space: nowrap;
+ max-width: 110px;
+ overflow: hidden;
+ text-overflow: ellipsis;
`;
export const StatusIconWrapper = styled.svg.attrs({
diff --git a/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.tsx b/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.tsx
index b01e357a87a..98cded2ae65 100644
--- a/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.tsx
+++ b/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.tsx
@@ -17,7 +17,7 @@ const ClusterTab: React.FC<ClusterTabProps> = ({
toggleClusterMenu,
}) => (
<S.Wrapper onClick={toggleClusterMenu}>
- <S.Title>{title}</S.Title>
+ <S.Title title={title}>{title}</S.Title>
<S.StatusIconWrapper>
<S.StatusIcon status={status} aria-label="status">
| null | test | train | 2022-02-21T11:55:53 | "2022-02-17T10:19:21Z" | madrisan | train |
provectus/kafka-ui/1390_1639 | provectus/kafka-ui | provectus/kafka-ui/1390 | provectus/kafka-ui/1639 | [
"connected"
] | 48d3c3828ec5cf868e85b3c84f25d2cd0450cc5f | 8b07a332e6a2631c6eab942dbd3a34553f224527 | [
"Hello there cmanzur! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"Hey, thanks for reaching out.\r\nWe'll take this for the consideration for release 0.4.",
"Hi @Haarolean we are also facing issue in the environment with no external internet connectivity. Kafka-ui UI is only not coming up for us with proper data. we we have done inspect element and debug it is showing ccs/js files not loaded \r\nThere is no way we can build jar from the source code with css/js as no option is available. can you please tell when can we expect this issue to be fixed?",
"@devsinghnaini hey, thanks for the feedback. Yes, this is planned and will be implemented for sure. I suppose 1-2 weeks.",
"Partially fixed. All the bootstrap stuff is local for now. There's still some stuff on frontend part which will load externally (like, fonts from google) and it's a tricky thing. But they might just replaced to fallback fonts. Please check it out.",
"Hi @Haarolean , can you please tell when this will be fixed? we just wanted to use this feature in azure env and trying some POC. If this is working thn we need to integrate this with other components.",
"@devsinghnaini you can already try it out with `master`-labeled docker image. It *might* work, if it does not, let me know which resources are failing.",
"Hi @Haarolean i am using this image repository: provectuslabs/kafka-ui:latest, from the helm charts. Can you please tell if this is the correct image ?",
"@devsinghnaini `latest` is latest release. You have to try `master` instead.",
"@Haarolean still facing same issue , UI not able to load properly... below error in UI console.\r\n\r\nxxx.xxx.xx-xx.xx/:1 Refused to execute script from 'https://xxx.xx.xx-xx.xx/static/js/main.193f72c2.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.\r\nxxx.xx.xx-xx.xx/:1 Refused to apply style from 'https://xxx.xx.xx-xx.xx/static/css/main.bf915e18.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.\r\nxxx.xx.xx-xx.xx/:1 Refused to apply style from 'https://xxx.xx.xx-xx.xx/static/css/main.bf915e18.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.",
"@devsinghnaini this looks unrelated, these are not external resources. Please raise a new issue.",
"It's working perfect in air gapped environment. Thanks!",
"@cmanzur great to hear!"
] | [] | "2022-02-18T17:26:40Z" | [
"scope/backend",
"scope/frontend",
"status/accepted",
"type/feature"
] | Support Air Gap environments without internet access | ### Is your proposal related to a problem?
<!--
Provide a clear and concise description of what the problem is.
For example, "I'm always frustrated when..."
-->
Running on kubernetes (helm) in a **air gap** environment (without internet access) results on a long timeout on **Sign In** page trying to fetch resources like:
- maxcdn.bootstrapcdn.com
- getbootstrap.com
And of course, you don't get any CSS so the login UI is ugly.
### Describe the solution you'd like
<!--
Provide a clear and concise description of what you want to happen.
-->
You can store the required CSS in the repository.
You can also add an environment variable to switch this beahvior in case you need.
| [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/auth/AbstractAuthSecurityConfig.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/AuthController.java"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/auth/AbstractAuthSecurityConfig.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/AuthController.java",
"kafka-ui-api/src/main/resources/static/static/css/bootstrap.min.css",
"kafka-ui-api/src/main/resources/static/static/css/signin.css"
] | [] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/auth/AbstractAuthSecurityConfig.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/auth/AbstractAuthSecurityConfig.java
index 3d8757cada9..14dfc05fd18 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/auth/AbstractAuthSecurityConfig.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/auth/AbstractAuthSecurityConfig.java
@@ -16,7 +16,8 @@ protected AbstractAuthSecurityConfig() {
"/auth",
"/login",
"/logout",
- "/oauth2/**"
+ "/oauth2/**",
+ "/static/**"
};
}
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/AuthController.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/AuthController.java
index 2dbe3593b9d..acc30c59658 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/AuthController.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/AuthController.java
@@ -30,25 +30,24 @@ private byte[] createPage(ServerWebExchange exchange, String csrfTokenHtmlInput)
String contextPath = exchange.getRequest().getPath().contextPath().value();
String page =
"<!DOCTYPE html>\n" + "<html lang=\"en\">\n" + " <head>\n"
- + " <meta charset=\"utf-8\">\n"
- + " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, "
- + "shrink-to-fit=no\">\n"
- + " <meta name=\"description\" content=\"\">\n"
- + " <meta name=\"author\" content=\"\">\n"
- + " <title>Please sign in</title>\n"
- + " <link href=\"https://maxcdn.bootstrapcdn.com/bootstrap/"
- + "4.0.0-beta/css/bootstrap.min.css\" rel=\"stylesheet\" "
- + "integrity=\"sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M\" "
- + "crossorigin=\"anonymous\">\n"
- + " <link href=\"https://getbootstrap.com/docs/4.0/examples/signin/signin.css\" "
- + "rel=\"stylesheet\" crossorigin=\"anonymous\"/>\n"
- + " </head>\n"
- + " <body>\n"
- + " <div class=\"container\">\n"
- + formLogin(queryParams, contextPath, csrfTokenHtmlInput)
- + " </div>\n"
- + " </body>\n"
- + "</html>";
+ + " <meta charset=\"utf-8\">\n"
+ + " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, "
+ + "shrink-to-fit=no\">\n"
+ + " <meta name=\"description\" content=\"\">\n"
+ + " <meta name=\"author\" content=\"\">\n"
+ + " <title>Please sign in</title>\n"
+ + " <link href=\"/static/css/bootstrap.min.css\" rel=\"stylesheet\" "
+ + "integrity=\"sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M\" "
+ + "crossorigin=\"anonymous\">\n"
+ + " <link href=\"/static/css/signin.css\" "
+ + "rel=\"stylesheet\" crossorigin=\"anonymous\"/>\n"
+ + " </head>\n"
+ + " <body>\n"
+ + " <div class=\"container\">\n"
+ + formLogin(queryParams, contextPath, csrfTokenHtmlInput)
+ + " </div>\n"
+ + " </body>\n"
+ + "</html>";
return page.getBytes(Charset.defaultCharset());
}
@@ -61,21 +60,21 @@ private String formLogin(
boolean isLogoutSuccess = queryParams.containsKey("logout");
return
" <form class=\"form-signin\" method=\"post\" action=\"" + contextPath + "/auth\">\n"
- + " <h2 class=\"form-signin-heading\">Please sign in</h2>\n"
- + createError(isError)
- + createLogoutSuccess(isLogoutSuccess)
- + " <p>\n"
- + " <label for=\"username\" class=\"sr-only\">Username</label>\n"
- + " <input type=\"text\" id=\"username\" name=\"username\" class=\"form-control\" "
- + "placeholder=\"Username\" required autofocus>\n"
- + " </p>\n" + " <p>\n"
- + " <label for=\"password\" class=\"sr-only\">Password</label>\n"
- + " <input type=\"password\" id=\"password\" name=\"password\" "
- + "class=\"form-control\" placeholder=\"Password\" required>\n"
- + " </p>\n" + csrfTokenHtmlInput
- + " <button class=\"btn btn-lg btn-primary btn-block\" "
- + "type=\"submit\">Sign in</button>\n"
- + " </form>\n";
+ + " <h2 class=\"form-signin-heading\">Please sign in</h2>\n"
+ + createError(isError)
+ + createLogoutSuccess(isLogoutSuccess)
+ + " <p>\n"
+ + " <label for=\"username\" class=\"sr-only\">Username</label>\n"
+ + " <input type=\"text\" id=\"username\" name=\"username\" class=\"form-control\" "
+ + "placeholder=\"Username\" required autofocus>\n"
+ + " </p>\n" + " <p>\n"
+ + " <label for=\"password\" class=\"sr-only\">Password</label>\n"
+ + " <input type=\"password\" id=\"password\" name=\"password\" "
+ + "class=\"form-control\" placeholder=\"Password\" required>\n"
+ + " </p>\n" + csrfTokenHtmlInput
+ + " <button class=\"btn btn-lg btn-primary btn-block\" "
+ + "type=\"submit\">Sign in</button>\n"
+ + " </form>\n";
}
private static String csrfToken(CsrfToken token) {
diff --git a/kafka-ui-api/src/main/resources/static/static/css/bootstrap.min.css b/kafka-ui-api/src/main/resources/static/static/css/bootstrap.min.css
new file mode 100644
index 00000000000..622b5a94dc9
--- /dev/null
+++ b/kafka-ui-api/src/main/resources/static/static/css/bootstrap.min.css
@@ -0,0 +1,7 @@
+/*!
+ * Bootstrap v4.0.0-beta (https://getbootstrap.com)
+ * Copyright 2011-2017 The Bootstrap Authors
+ * Copyright 2011-2017 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */@media print{*,::after,::before{text-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}html{box-sizing:border-box;font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}*,::after,::before{box-sizing:inherit}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}[role=button],a,area,button,input,label,select,summary,textarea{-ms-touch-action:manipulation;touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#868e96;text-align:left;caption-side:bottom}th{text-align:left}label{display:inline-block;margin-bottom:.5rem}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.1}.display-2{font-size:5.5rem;font-weight:300;line-height:1.1}.display-3{font-size:4.5rem;font-weight:300;line-height:1.1}.display-4{font-size:3.5rem;font-weight:300;line-height:1.1}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:5px}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#868e96}.blockquote-footer::before{content:"\2014 \00A0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #ddd;border-radius:.25rem;transition:all .2s ease-in-out;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#868e96}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}code{padding:.2rem .4rem;font-size:90%;color:#bd4147;background-color:#f8f9fa;border-radius:.25rem}a>code{padding:0;color:inherit;background-color:inherit}kbd{padding:.2rem .4rem;font-size:90%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;margin-top:0;margin-bottom:1rem;font-size:90%;color:#212529}pre code{padding:0;font-size:inherit;color:inherit;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-right:15px;padding-left:15px;width:100%}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid{width:100%;margin-right:auto;margin-left:auto;padding-right:15px;padding-left:15px;width:100%}.row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;min-height:1px;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-1{-ms-flex-order:1;order:1}.order-2{-ms-flex-order:2;order:2}.order-3{-ms-flex-order:3;order:3}.order-4{-ms-flex-order:4;order:4}.order-5{-ms-flex-order:5;order:5}.order-6{-ms-flex-order:6;order:6}.order-7{-ms-flex-order:7;order:7}.order-8{-ms-flex-order:8;order:8}.order-9{-ms-flex-order:9;order:9}.order-10{-ms-flex-order:10;order:10}.order-11{-ms-flex-order:11;order:11}.order-12{-ms-flex-order:12;order:12}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-sm-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-1{-ms-flex-order:1;order:1}.order-sm-2{-ms-flex-order:2;order:2}.order-sm-3{-ms-flex-order:3;order:3}.order-sm-4{-ms-flex-order:4;order:4}.order-sm-5{-ms-flex-order:5;order:5}.order-sm-6{-ms-flex-order:6;order:6}.order-sm-7{-ms-flex-order:7;order:7}.order-sm-8{-ms-flex-order:8;order:8}.order-sm-9{-ms-flex-order:9;order:9}.order-sm-10{-ms-flex-order:10;order:10}.order-sm-11{-ms-flex-order:11;order:11}.order-sm-12{-ms-flex-order:12;order:12}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-md-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-md-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-md-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-md-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-md-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-md-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-md-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-1{-ms-flex-order:1;order:1}.order-md-2{-ms-flex-order:2;order:2}.order-md-3{-ms-flex-order:3;order:3}.order-md-4{-ms-flex-order:4;order:4}.order-md-5{-ms-flex-order:5;order:5}.order-md-6{-ms-flex-order:6;order:6}.order-md-7{-ms-flex-order:7;order:7}.order-md-8{-ms-flex-order:8;order:8}.order-md-9{-ms-flex-order:9;order:9}.order-md-10{-ms-flex-order:10;order:10}.order-md-11{-ms-flex-order:11;order:11}.order-md-12{-ms-flex-order:12;order:12}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-lg-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-lg-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-lg-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-lg-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-lg-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-lg-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-lg-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-lg-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-1{-ms-flex-order:1;order:1}.order-lg-2{-ms-flex-order:2;order:2}.order-lg-3{-ms-flex-order:3;order:3}.order-lg-4{-ms-flex-order:4;order:4}.order-lg-5{-ms-flex-order:5;order:5}.order-lg-6{-ms-flex-order:6;order:6}.order-lg-7{-ms-flex-order:7;order:7}.order-lg-8{-ms-flex-order:8;order:8}.order-lg-9{-ms-flex-order:9;order:9}.order-lg-10{-ms-flex-order:10;order:10}.order-lg-11{-ms-flex-order:11;order:11}.order-lg-12{-ms-flex-order:12;order:12}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-xl-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-xl-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-xl-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-xl-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-xl-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-xl-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-xl-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-xl-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-1{-ms-flex-order:1;order:1}.order-xl-2{-ms-flex-order:2;order:2}.order-xl-3{-ms-flex-order:3;order:3}.order-xl-4{-ms-flex-order:4;order:4}.order-xl-5{-ms-flex-order:5;order:5}.order-xl-6{-ms-flex-order:6;order:6}.order-xl-7{-ms-flex-order:7;order:7}.order-xl-8{-ms-flex-order:8;order:8}.order-xl-9{-ms-flex-order:9;order:9}.order-xl-10{-ms-flex-order:10;order:10}.order-xl-11{-ms-flex-order:11;order:11}.order-xl-12{-ms-flex-order:12;order:12}}.table{width:100%;max-width:100%;margin-bottom:1rem;background-color:transparent}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #e9ecef}.table thead th{vertical-align:bottom;border-bottom:2px solid #e9ecef}.table tbody+tbody{border-top:2px solid #e9ecef}.table .table{background-color:#fff}.table-sm td,.table-sm th{padding:.3rem}.table-bordered{border:1px solid #e9ecef}.table-bordered td,.table-bordered th{border:1px solid #e9ecef}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-hover .table-primary:hover{background-color:#9fcdff}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#dddfe2}.table-hover .table-secondary:hover{background-color:#cfd2d6}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#cfd2d6}.table-success,.table-success>td,.table-success>th{background-color:#c3e6cb}.table-hover .table-success:hover{background-color:#b1dfbb}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#b1dfbb}.table-info,.table-info>td,.table-info>th{background-color:#bee5eb}.table-hover .table-info:hover{background-color:#abdde5}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#abdde5}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeba}.table-hover .table-warning:hover{background-color:#ffe8a1}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe8a1}.table-danger,.table-danger>td,.table-danger>th{background-color:#f5c6cb}.table-hover .table-danger:hover{background-color:#f1b0b7}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f1b0b7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-hover .table-light:hover{background-color:#ececf6}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#c6c8ca}.table-hover .table-dark:hover{background-color:#b9bbbe}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>td,.table-active>th{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.thead-inverse th{color:#fff;background-color:#212529}.thead-default th{color:#495057;background-color:#e9ecef}.table-inverse{color:#fff;background-color:#212529}.table-inverse td,.table-inverse th,.table-inverse thead th{border-color:#32383e}.table-inverse.table-bordered{border:0}.table-inverse.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,.05)}.table-inverse.table-hover tbody tr:hover{background-color:rgba(255,255,255,.075)}@media (max-width:991px){.table-responsive{display:block;width:100%;overflow-x:auto;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive.table-bordered{border:0}}.form-control{display:block;width:100%;padding:.5rem .75rem;font-size:1rem;line-height:1.25;color:#495057;background-color:#fff;background-image:none;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0}.form-control::-webkit-input-placeholder{color:#868e96;opacity:1}.form-control:-ms-input-placeholder{color:#868e96;opacity:1}.form-control::placeholder{color:#868e96;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}select.form-control:not([size]):not([multiple]){height:calc(2.25rem + 2px)}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block}.col-form-label{padding-top:calc(.5rem - 1px * 2);padding-bottom:calc(.5rem - 1px * 2);margin-bottom:0}.col-form-label-lg{padding-top:calc(.5rem - 1px * 2);padding-bottom:calc(.5rem - 1px * 2);font-size:1.25rem}.col-form-label-sm{padding-top:calc(.25rem - 1px * 2);padding-bottom:calc(.25rem - 1px * 2);font-size:.875rem}.col-form-legend{padding-top:.5rem;padding-bottom:.5rem;margin-bottom:0;font-size:1rem}.form-control-plaintext{padding-top:.5rem;padding-bottom:.5rem;margin-bottom:0;line-height:1.25;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm,.input-group-lg>.form-control-plaintext.form-control,.input-group-lg>.form-control-plaintext.input-group-addon,.input-group-lg>.input-group-btn>.form-control-plaintext.btn,.input-group-sm>.form-control-plaintext.form-control,.input-group-sm>.form-control-plaintext.input-group-addon,.input-group-sm>.input-group-btn>.form-control-plaintext.btn{padding-right:0;padding-left:0}.form-control-sm,.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.input-group-sm>.input-group-btn>select.btn:not([size]):not([multiple]),.input-group-sm>select.form-control:not([size]):not([multiple]),.input-group-sm>select.input-group-addon:not([size]):not([multiple]),select.form-control-sm:not([size]):not([multiple]){height:calc(1.8125rem + 2px)}.form-control-lg,.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.input-group-lg>.input-group-btn>select.btn:not([size]):not([multiple]),.input-group-lg>select.form-control:not([size]):not([multiple]),.input-group-lg>select.input-group-addon:not([size]):not([multiple]),select.form-control-lg:not([size]):not([multiple]){height:calc(2.3125rem + 2px)}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;margin-bottom:.5rem}.form-check.disabled .form-check-label{color:#868e96}.form-check-label{padding-left:1.25rem;margin-bottom:0}.form-check-input{position:absolute;margin-top:.25rem;margin-left:-1.25rem}.form-check-input:only-child{position:static}.form-check-inline{display:inline-block}.form-check-inline .form-check-label{vertical-align:middle}.form-check-inline+.form-check-inline{margin-left:.75rem}.invalid-feedback{display:none;margin-top:.25rem;font-size:.875rem;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;width:250px;padding:.5rem;margin-top:.1rem;font-size:.875rem;line-height:1;color:#fff;background-color:rgba(220,53,69,.8);border-radius:.2rem}.custom-select.is-valid,.form-control.is-valid,.was-validated .custom-select:valid,.was-validated .form-control:valid{border-color:#28a745}.custom-select.is-valid:focus,.form-control.is-valid:focus,.was-validated .custom-select:valid:focus,.was-validated .form-control:valid:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-select.is-valid~.invalid-feedback,.custom-select.is-valid~.invalid-tooltip,.form-control.is-valid~.invalid-feedback,.form-control.is-valid~.invalid-tooltip,.was-validated .custom-select:valid~.invalid-feedback,.was-validated .custom-select:valid~.invalid-tooltip,.was-validated .form-control:valid~.invalid-feedback,.was-validated .form-control:valid~.invalid-tooltip{display:block}.form-check-input.is-valid+.form-check-label,.was-validated .form-check-input:valid+.form-check-label{color:#28a745}.custom-control-input.is-valid~.custom-control-indicator,.was-validated .custom-control-input:valid~.custom-control-indicator{background-color:rgba(40,167,69,.25)}.custom-control-input.is-valid~.custom-control-description,.was-validated .custom-control-input:valid~.custom-control-description{color:#28a745}.custom-file-input.is-valid~.custom-file-control,.was-validated .custom-file-input:valid~.custom-file-control{border-color:#28a745}.custom-file-input.is-valid~.custom-file-control::before,.was-validated .custom-file-input:valid~.custom-file-control::before{border-color:inherit}.custom-file-input.is-valid:focus,.was-validated .custom-file-input:valid:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-select.is-invalid,.form-control.is-invalid,.was-validated .custom-select:invalid,.was-validated .form-control:invalid{border-color:#dc3545}.custom-select.is-invalid:focus,.form-control.is-invalid:focus,.was-validated .custom-select:invalid:focus,.was-validated .form-control:invalid:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-select.is-invalid~.invalid-feedback,.custom-select.is-invalid~.invalid-tooltip,.form-control.is-invalid~.invalid-feedback,.form-control.is-invalid~.invalid-tooltip,.was-validated .custom-select:invalid~.invalid-feedback,.was-validated .custom-select:invalid~.invalid-tooltip,.was-validated .form-control:invalid~.invalid-feedback,.was-validated .form-control:invalid~.invalid-tooltip{display:block}.form-check-input.is-invalid+.form-check-label,.was-validated .form-check-input:invalid+.form-check-label{color:#dc3545}.custom-control-input.is-invalid~.custom-control-indicator,.was-validated .custom-control-input:invalid~.custom-control-indicator{background-color:rgba(220,53,69,.25)}.custom-control-input.is-invalid~.custom-control-description,.was-validated .custom-control-input:invalid~.custom-control-description{color:#dc3545}.custom-file-input.is-invalid~.custom-file-control,.was-validated .custom-file-input:invalid~.custom-file-control{border-color:#dc3545}.custom-file-input.is-invalid~.custom-file-control::before,.was-validated .custom-file-input:invalid~.custom-file-control::before{border-color:inherit}.custom-file-input.is-invalid:focus,.was-validated .custom-file-input:invalid:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-inline{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin-bottom:0}.form-inline .form-group{display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center;margin-bottom:0}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .input-group{width:auto}.form-inline .form-control-label{margin-bottom:0;vertical-align:middle}.form-inline .form-check{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:auto;margin-top:0;margin-bottom:0}.form-inline .form-check-label{padding-left:0}.form-inline .form-check-input{position:relative;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding-left:0}.form-inline .custom-control-indicator{position:static;display:inline-block;margin-right:.25rem;vertical-align:text-bottom}.form-inline .has-feedback .form-control-feedback{top:0}}.btn{display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.5rem .75rem;font-size:1rem;line-height:1.25;border-radius:.25rem;transition:all .15s ease-in-out}.btn:focus,.btn:hover{text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 3px rgba(0,123,255,.25)}.btn.disabled,.btn:disabled{opacity:.65}.btn.active,.btn:active{background-image:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}.btn-primary.focus,.btn-primary:focus{box-shadow:0 0 0 3px rgba(0,123,255,.5)}.btn-primary.disabled,.btn-primary:disabled{background-color:#007bff;border-color:#007bff}.btn-primary.active,.btn-primary:active,.show>.btn-primary.dropdown-toggle{background-color:#0069d9;background-image:none;border-color:#0062cc}.btn-secondary{color:#fff;background-color:#868e96;border-color:#868e96}.btn-secondary:hover{color:#fff;background-color:#727b84;border-color:#6c757d}.btn-secondary.focus,.btn-secondary:focus{box-shadow:0 0 0 3px rgba(134,142,150,.5)}.btn-secondary.disabled,.btn-secondary:disabled{background-color:#868e96;border-color:#868e96}.btn-secondary.active,.btn-secondary:active,.show>.btn-secondary.dropdown-toggle{background-color:#727b84;background-image:none;border-color:#6c757d}.btn-success{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:hover{color:#fff;background-color:#218838;border-color:#1e7e34}.btn-success.focus,.btn-success:focus{box-shadow:0 0 0 3px rgba(40,167,69,.5)}.btn-success.disabled,.btn-success:disabled{background-color:#28a745;border-color:#28a745}.btn-success.active,.btn-success:active,.show>.btn-success.dropdown-toggle{background-color:#218838;background-image:none;border-color:#1e7e34}.btn-info{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:hover{color:#fff;background-color:#138496;border-color:#117a8b}.btn-info.focus,.btn-info:focus{box-shadow:0 0 0 3px rgba(23,162,184,.5)}.btn-info.disabled,.btn-info:disabled{background-color:#17a2b8;border-color:#17a2b8}.btn-info.active,.btn-info:active,.show>.btn-info.dropdown-toggle{background-color:#138496;background-image:none;border-color:#117a8b}.btn-warning{color:#111;background-color:#ffc107;border-color:#ffc107}.btn-warning:hover{color:#111;background-color:#e0a800;border-color:#d39e00}.btn-warning.focus,.btn-warning:focus{box-shadow:0 0 0 3px rgba(255,193,7,.5)}.btn-warning.disabled,.btn-warning:disabled{background-color:#ffc107;border-color:#ffc107}.btn-warning.active,.btn-warning:active,.show>.btn-warning.dropdown-toggle{background-color:#e0a800;background-image:none;border-color:#d39e00}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:hover{color:#fff;background-color:#c82333;border-color:#bd2130}.btn-danger.focus,.btn-danger:focus{box-shadow:0 0 0 3px rgba(220,53,69,.5)}.btn-danger.disabled,.btn-danger:disabled{background-color:#dc3545;border-color:#dc3545}.btn-danger.active,.btn-danger:active,.show>.btn-danger.dropdown-toggle{background-color:#c82333;background-image:none;border-color:#bd2130}.btn-light{color:#111;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:hover{color:#111;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{box-shadow:0 0 0 3px rgba(248,249,250,.5)}.btn-light.disabled,.btn-light:disabled{background-color:#f8f9fa;border-color:#f8f9fa}.btn-light.active,.btn-light:active,.show>.btn-light.dropdown-toggle{background-color:#e2e6ea;background-image:none;border-color:#dae0e5}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark.focus,.btn-dark:focus{box-shadow:0 0 0 3px rgba(52,58,64,.5)}.btn-dark.disabled,.btn-dark:disabled{background-color:#343a40;border-color:#343a40}.btn-dark.active,.btn-dark:active,.show>.btn-dark.dropdown-toggle{background-color:#23272b;background-image:none;border-color:#1d2124}.btn-outline-primary{color:#007bff;background-color:transparent;background-image:none;border-color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 3px rgba(0,123,255,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent}.btn-outline-primary.active,.btn-outline-primary:active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-secondary{color:#868e96;background-color:transparent;background-image:none;border-color:#868e96}.btn-outline-secondary:hover{color:#fff;background-color:#868e96;border-color:#868e96}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 3px rgba(134,142,150,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#868e96;background-color:transparent}.btn-outline-secondary.active,.btn-outline-secondary:active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#868e96;border-color:#868e96}.btn-outline-success{color:#28a745;background-color:transparent;background-image:none;border-color:#28a745}.btn-outline-success:hover{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 3px rgba(40,167,69,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#28a745;background-color:transparent}.btn-outline-success.active,.btn-outline-success:active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-info{color:#17a2b8;background-color:transparent;background-image:none;border-color:#17a2b8}.btn-outline-info:hover{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 3px rgba(23,162,184,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#17a2b8;background-color:transparent}.btn-outline-info.active,.btn-outline-info:active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-warning{color:#ffc107;background-color:transparent;background-image:none;border-color:#ffc107}.btn-outline-warning:hover{color:#fff;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 3px rgba(255,193,7,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-warning.active,.btn-outline-warning:active,.show>.btn-outline-warning.dropdown-toggle{color:#fff;background-color:#ffc107;border-color:#ffc107}.btn-outline-danger{color:#dc3545;background-color:transparent;background-image:none;border-color:#dc3545}.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 3px rgba(220,53,69,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-danger.active,.btn-outline-danger:active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-light{color:#f8f9fa;background-color:transparent;background-image:none;border-color:#f8f9fa}.btn-outline-light:hover{color:#fff;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 3px rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light.active,.btn-outline-light:active,.show>.btn-outline-light.dropdown-toggle{color:#fff;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-dark{color:#343a40;background-color:transparent;background-image:none;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 3px rgba(52,58,64,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark.active,.btn-outline-dark:active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40}.btn-link{font-weight:400;color:#007bff;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link:disabled{background-color:transparent}.btn-link,.btn-link:active,.btn-link:focus{border-color:transparent;box-shadow:none}.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#0056b3;text-decoration:underline;background-color:transparent}.btn-link:disabled{color:#868e96}.btn-link:disabled:focus,.btn-link:disabled:hover{text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;transition:opacity .15s linear}.fade.show{opacity:1}.collapse{display:none}.collapse.show{display:block}tr.collapse.show{display:table-row}tbody.collapse.show{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;transition:height .35s ease}.dropdown,.dropup{position:relative}.dropdown-toggle::after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-left:.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropup .dropdown-menu{margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle::after{border-top:0;border-bottom:.3em solid}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background:0 0;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled,.dropdown-item:disabled{color:#868e96;background-color:transparent}.show>a{outline:0}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#868e96;white-space:nowrap}.btn-group,.btn-group-vertical{position:relative;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;-ms-flex:0 1 auto;flex:0 1 auto;margin-bottom:0}.btn-group-vertical>.btn:hover,.btn-group>.btn:hover{z-index:2}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group,.btn-group-vertical .btn+.btn,.btn-group-vertical .btn+.btn-group,.btn-group-vertical .btn-group+.btn,.btn-group-vertical .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:start;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn+.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.btn+.dropdown-toggle-split::after{margin-left:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}.btn-group-vertical .btn,.btn-group-vertical .btn-group{width:100%}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:-ms-flexbox;display:flex;width:100%}.input-group .form-control{position:relative;z-index:2;-ms-flex:1 1 auto;flex:1 1 auto;width:1%;margin-bottom:0}.input-group .form-control:active,.input-group .form-control:focus,.input-group .form-control:hover{z-index:3}.input-group .form-control,.input-group-addon,.input-group-btn{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{white-space:nowrap;vertical-align:middle}.input-group-addon{padding:.5rem .75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.25;color:#495057;text-align:center;background-color:#e9ecef;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.input-group-addon.form-control-sm,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.input-group-addon.btn{padding:.25rem .5rem;font-size:.875rem;border-radius:.2rem}.input-group-addon.form-control-lg,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.input-group-addon.btn{padding:.5rem 1rem;font-size:1.25rem;border-radius:.3rem}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:not(:last-child),.input-group-addon:not(:last-child),.input-group-btn:not(:first-child)>.btn-group:not(:last-child)>.btn,.input-group-btn:not(:first-child)>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:not(:last-child)>.btn,.input-group-btn:not(:last-child)>.btn-group>.btn,.input-group-btn:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:not(:last-child){border-right:0}.input-group .form-control:not(:first-child),.input-group-addon:not(:first-child),.input-group-btn:not(:first-child)>.btn,.input-group-btn:not(:first-child)>.btn-group>.btn,.input-group-btn:not(:first-child)>.dropdown-toggle,.input-group-btn:not(:last-child)>.btn-group:not(:first-child)>.btn,.input-group-btn:not(:last-child)>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.form-control+.input-group-addon:not(:first-child){border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:3}.input-group-btn:not(:last-child)>.btn,.input-group-btn:not(:last-child)>.btn-group{margin-right:-1px}.input-group-btn:not(:first-child)>.btn,.input-group-btn:not(:first-child)>.btn-group{z-index:2;margin-left:-1px}.input-group-btn:not(:first-child)>.btn-group:active,.input-group-btn:not(:first-child)>.btn-group:focus,.input-group-btn:not(:first-child)>.btn-group:hover,.input-group-btn:not(:first-child)>.btn:active,.input-group-btn:not(:first-child)>.btn:focus,.input-group-btn:not(:first-child)>.btn:hover{z-index:3}.custom-control{position:relative;display:-ms-inline-flexbox;display:inline-flex;min-height:1.5rem;padding-left:1.5rem;margin-right:1rem}.custom-control-input{position:absolute;z-index:-1;opacity:0}.custom-control-input:checked~.custom-control-indicator{color:#fff;background-color:#007bff}.custom-control-input:focus~.custom-control-indicator{box-shadow:0 0 0 1px #fff,0 0 0 3px #007bff}.custom-control-input:active~.custom-control-indicator{color:#fff;background-color:#b3d7ff}.custom-control-input:disabled~.custom-control-indicator{background-color:#e9ecef}.custom-control-input:disabled~.custom-control-description{color:#868e96}.custom-control-indicator{position:absolute;top:.25rem;left:0;display:block;width:1rem;height:1rem;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#ddd;background-repeat:no-repeat;background-position:center center;background-size:50% 50%}.custom-checkbox .custom-control-indicator{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-indicator{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-indicator{background-color:#007bff;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='%23fff' d='M0 2h4'/%3E%3C/svg%3E")}.custom-radio .custom-control-indicator{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-indicator{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E")}.custom-controls-stacked{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.custom-controls-stacked .custom-control{margin-bottom:.25rem}.custom-controls-stacked .custom-control+.custom-control{margin-left:0}.custom-select{display:inline-block;max-width:100%;height:calc(2.25rem + 2px);padding:.375rem 1.75rem .375rem .75rem;line-height:1.25;color:#495057;vertical-align:middle;background:#fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23333' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right .75rem center;background-size:8px 10px;border:1px solid rgba(0,0,0,.15);border-radius:.25rem;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#80bdff;outline:0}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select:disabled{color:#868e96;background-color:#e9ecef}.custom-select::-ms-expand{opacity:0}.custom-select-sm{height:calc(1.8125rem + 2px);padding-top:.375rem;padding-bottom:.375rem;font-size:75%}.custom-file{position:relative;display:inline-block;max-width:100%;height:2.5rem;margin-bottom:0}.custom-file-input{min-width:14rem;max-width:100%;height:2.5rem;margin:0;opacity:0}.custom-file-control{position:absolute;top:0;right:0;left:0;z-index:5;height:2.5rem;padding:.5rem 1rem;line-height:1.5;color:#495057;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.custom-file-control:lang(en):empty::after{content:"Choose file..."}.custom-file-control::before{position:absolute;top:-1px;right:-1px;bottom:-1px;z-index:6;display:block;height:2.5rem;padding:.5rem 1rem;line-height:1.5;color:#495057;background-color:#e9ecef;border:1px solid rgba(0,0,0,.15);border-radius:0 .25rem .25rem 0}.custom-file-control:lang(en)::before{content:"Browse"}.nav{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#868e96}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #ddd}.nav-tabs .nav-link.disabled{color:#868e96;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#ddd #ddd #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.show>.nav-pills .nav-link{color:#fff;background-color:#007bff}.nav-fill .nav-item{-ms-flex:1 1 auto;flex:1 1 auto;text-align:center}.nav-justified .nav-item{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:.5rem 1rem}.navbar>.container,.navbar>.container-fluid{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{-ms-flex-preferred-size:100%;flex-basis:100%;-ms-flex-align:center;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background:0 0;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat center center;background-size:100% 100%}@media (max-width:575px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-sm .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:-ms-flexbox!important;display:flex!important}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width:767px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-md .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:-ms-flexbox!important;display:flex!important}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width:991px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-lg .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:-ms-flexbox!important;display:flex!important}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width:1199px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-xl .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:-ms-flexbox!important;display:flex!important}.navbar-expand-xl .navbar-toggler{display:none}}.navbar-expand{-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:-ms-flexbox!important;display:flex!important}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand{color:rgba(0,0,0,.9)}.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-dark .navbar-text{color:rgba(255,255,255,.5)}.card{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card-body{-ms-flex:1 1 auto;flex:1 1 auto;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem;margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card>.list-group:first-child .list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card>.list-group:last-child .list-group-item:last-child{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-footer{padding:.75rem 1.25rem;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-right:-.625rem;margin-bottom:-.75rem;margin-left:-.625rem;border-bottom:0}.card-header-pills{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.card-img{width:100%;border-radius:calc(.25rem - 1px)}.card-img-top{width:100%;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img-bottom{width:100%;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}@media (min-width:576px){.card-deck{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{display:-ms-flexbox;display:flex;-ms-flex:1 0 0%;flex:1 0 0%;-ms-flex-direction:column;flex-direction:column;margin-right:15px;margin-left:15px}}@media (min-width:576px){.card-group{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap}.card-group .card{-ms-flex:1 0 0%;flex:1 0 0%}.card-group .card+.card{margin-left:0;border-left:0}.card-group .card:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.card-group .card:first-child .card-img-top{border-top-right-radius:0}.card-group .card:first-child .card-img-bottom{border-bottom-right-radius:0}.card-group .card:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.card-group .card:last-child .card-img-top{border-top-left-radius:0}.card-group .card:last-child .card-img-bottom{border-bottom-left-radius:0}.card-group .card:not(:first-child):not(:last-child){border-radius:0}.card-group .card:not(:first-child):not(:last-child) .card-img-bottom,.card-group .card:not(:first-child):not(:last-child) .card-img-top{border-radius:0}}.card-columns .card{margin-bottom:.75rem}@media (min-width:576px){.card-columns{-webkit-column-count:3;column-count:3;-webkit-column-gap:1.25rem;column-gap:1.25rem}.card-columns .card{display:inline-block;width:100%}}.breadcrumb{padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb::after{display:block;clear:both;content:""}.breadcrumb-item{float:left}.breadcrumb-item+.breadcrumb-item::before{display:inline-block;padding-right:.5rem;padding-left:.5rem;color:#868e96;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:underline}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#868e96}.pagination{display:-ms-flexbox;display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#868e96;pointer-events:none;background-color:#fff;border-color:#ddd}.page-link{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#007bff;background-color:#fff;border:1px solid #ddd}.page-link:focus,.page-link:hover{color:#0056b3;text-decoration:none;background-color:#e9ecef;border-color:#ddd}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#007bff}.badge-primary[href]:focus,.badge-primary[href]:hover{color:#fff;text-decoration:none;background-color:#0062cc}.badge-secondary{color:#fff;background-color:#868e96}.badge-secondary[href]:focus,.badge-secondary[href]:hover{color:#fff;text-decoration:none;background-color:#6c757d}.badge-success{color:#fff;background-color:#28a745}.badge-success[href]:focus,.badge-success[href]:hover{color:#fff;text-decoration:none;background-color:#1e7e34}.badge-info{color:#fff;background-color:#17a2b8}.badge-info[href]:focus,.badge-info[href]:hover{color:#fff;text-decoration:none;background-color:#117a8b}.badge-warning{color:#111;background-color:#ffc107}.badge-warning[href]:focus,.badge-warning[href]:hover{color:#111;text-decoration:none;background-color:#d39e00}.badge-danger{color:#fff;background-color:#dc3545}.badge-danger[href]:focus,.badge-danger[href]:hover{color:#fff;text-decoration:none;background-color:#bd2130}.badge-light{color:#111;background-color:#f8f9fa}.badge-light[href]:focus,.badge-light[href]:hover{color:#111;text-decoration:none;background-color:#dae0e5}.badge-dark{color:#fff;background-color:#343a40}.badge-dark[href]:focus,.badge-dark[href]:hover{color:#fff;text-decoration:none;background-color:#1d2124}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible .close{position:relative;top:-.75rem;right:-1.25rem;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#004085;background-color:#cce5ff;border-color:#b8daff}.alert-primary hr{border-top-color:#9fcdff}.alert-primary .alert-link{color:#002752}.alert-secondary{color:#464a4e;background-color:#e7e8ea;border-color:#dddfe2}.alert-secondary hr{border-top-color:#cfd2d6}.alert-secondary .alert-link{color:#2e3133}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@-webkit-keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}.progress{display:-ms-flexbox;display:flex;overflow:hidden;font-size:.75rem;line-height:1rem;text-align:center;background-color:#e9ecef;border-radius:.25rem}.progress-bar{height:1rem;line-height:1rem;color:#fff;background-color:#007bff;transition:width .6s ease}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}.media{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.media-body{-ms-flex:1;flex:1}.list-group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;margin-bottom:-1px;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.list-group-item:focus,.list-group-item:hover{text-decoration:none}.list-group-item.disabled,.list-group-item:disabled{color:#868e96;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.list-group-flush .list-group-item{border-right:0;border-left:0;border-radius:0}.list-group-flush:first-child .list-group-item:first-child{border-top:0}.list-group-flush:last-child .list-group-item:last-child{border-bottom:0}.list-group-item-primary{color:#004085;background-color:#b8daff}a.list-group-item-primary,button.list-group-item-primary{color:#004085}a.list-group-item-primary:focus,a.list-group-item-primary:hover,button.list-group-item-primary:focus,button.list-group-item-primary:hover{color:#004085;background-color:#9fcdff}a.list-group-item-primary.active,button.list-group-item-primary.active{color:#fff;background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#464a4e;background-color:#dddfe2}a.list-group-item-secondary,button.list-group-item-secondary{color:#464a4e}a.list-group-item-secondary:focus,a.list-group-item-secondary:hover,button.list-group-item-secondary:focus,button.list-group-item-secondary:hover{color:#464a4e;background-color:#cfd2d6}a.list-group-item-secondary.active,button.list-group-item-secondary.active{color:#fff;background-color:#464a4e;border-color:#464a4e}.list-group-item-success{color:#155724;background-color:#c3e6cb}a.list-group-item-success,button.list-group-item-success{color:#155724}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#155724;background-color:#b1dfbb}a.list-group-item-success.active,button.list-group-item-success.active{color:#fff;background-color:#155724;border-color:#155724}.list-group-item-info{color:#0c5460;background-color:#bee5eb}a.list-group-item-info,button.list-group-item-info{color:#0c5460}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#0c5460;background-color:#abdde5}a.list-group-item-info.active,button.list-group-item-info.active{color:#fff;background-color:#0c5460;border-color:#0c5460}.list-group-item-warning{color:#856404;background-color:#ffeeba}a.list-group-item-warning,button.list-group-item-warning{color:#856404}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#856404;background-color:#ffe8a1}a.list-group-item-warning.active,button.list-group-item-warning.active{color:#fff;background-color:#856404;border-color:#856404}.list-group-item-danger{color:#721c24;background-color:#f5c6cb}a.list-group-item-danger,button.list-group-item-danger{color:#721c24}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#721c24;background-color:#f1b0b7}a.list-group-item-danger.active,button.list-group-item-danger.active{color:#fff;background-color:#721c24;border-color:#721c24}.list-group-item-light{color:#818182;background-color:#fdfdfe}a.list-group-item-light,button.list-group-item-light{color:#818182}a.list-group-item-light:focus,a.list-group-item-light:hover,button.list-group-item-light:focus,button.list-group-item-light:hover{color:#818182;background-color:#ececf6}a.list-group-item-light.active,button.list-group-item-light.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}a.list-group-item-dark,button.list-group-item-dark{color:#1b1e21}a.list-group-item-dark:focus,a.list-group-item-dark:hover,button.list-group-item-dark:focus,button.list-group-item-dark:hover{color:#1b1e21;background-color:#b9bbbe}a.list-group-item-dark.active,button.list-group-item-dark.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:focus,.close:hover{color:#000;text-decoration:none;opacity:.75}button.close{padding:0;background:0 0;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;outline:0}.modal.fade .modal-dialog{transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;-webkit-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.show .modal-dialog{-webkit-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:15px;border-bottom:1px solid #e9ecef}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:15px}.modal-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding:15px;border-top:1px solid #e9ecef}.modal-footer>:not(:first-child){margin-left:.25rem}.modal-footer>:not(:last-child){margin-right:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:30px auto}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg{max-width:800px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:5px;height:5px}.tooltip.bs-tooltip-auto[x-placement^=top],.tooltip.bs-tooltip-top{padding:5px 0}.tooltip.bs-tooltip-auto[x-placement^=top] .arrow,.tooltip.bs-tooltip-top .arrow{bottom:0}.tooltip.bs-tooltip-auto[x-placement^=top] .arrow::before,.tooltip.bs-tooltip-top .arrow::before{margin-left:-3px;content:"";border-width:5px 5px 0;border-top-color:#000}.tooltip.bs-tooltip-auto[x-placement^=right],.tooltip.bs-tooltip-right{padding:0 5px}.tooltip.bs-tooltip-auto[x-placement^=right] .arrow,.tooltip.bs-tooltip-right .arrow{left:0}.tooltip.bs-tooltip-auto[x-placement^=right] .arrow::before,.tooltip.bs-tooltip-right .arrow::before{margin-top:-3px;content:"";border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.bs-tooltip-auto[x-placement^=bottom],.tooltip.bs-tooltip-bottom{padding:5px 0}.tooltip.bs-tooltip-auto[x-placement^=bottom] .arrow,.tooltip.bs-tooltip-bottom .arrow{top:0}.tooltip.bs-tooltip-auto[x-placement^=bottom] .arrow::before,.tooltip.bs-tooltip-bottom .arrow::before{margin-left:-3px;content:"";border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bs-tooltip-auto[x-placement^=left],.tooltip.bs-tooltip-left{padding:0 5px}.tooltip.bs-tooltip-auto[x-placement^=left] .arrow,.tooltip.bs-tooltip-left .arrow{right:0}.tooltip.bs-tooltip-auto[x-placement^=left] .arrow::before,.tooltip.bs-tooltip-left .arrow::before{right:0;margin-top:-3px;content:"";border-width:5px 0 5px 5px;border-left-color:#000}.tooltip .arrow::before{position:absolute;border-color:transparent;border-style:solid}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;padding:1px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover .arrow{position:absolute;display:block;width:10px;height:5px}.popover .arrow::after,.popover .arrow::before{position:absolute;display:block;border-color:transparent;border-style:solid}.popover .arrow::before{content:"";border-width:11px}.popover .arrow::after{content:"";border-width:11px}.popover.bs-popover-auto[x-placement^=top],.popover.bs-popover-top{margin-bottom:10px}.popover.bs-popover-auto[x-placement^=top] .arrow,.popover.bs-popover-top .arrow{bottom:0}.popover.bs-popover-auto[x-placement^=top] .arrow::after,.popover.bs-popover-auto[x-placement^=top] .arrow::before,.popover.bs-popover-top .arrow::after,.popover.bs-popover-top .arrow::before{border-bottom-width:0}.popover.bs-popover-auto[x-placement^=top] .arrow::before,.popover.bs-popover-top .arrow::before{bottom:-11px;margin-left:-6px;border-top-color:rgba(0,0,0,.25)}.popover.bs-popover-auto[x-placement^=top] .arrow::after,.popover.bs-popover-top .arrow::after{bottom:-10px;margin-left:-6px;border-top-color:#fff}.popover.bs-popover-auto[x-placement^=right],.popover.bs-popover-right{margin-left:10px}.popover.bs-popover-auto[x-placement^=right] .arrow,.popover.bs-popover-right .arrow{left:0}.popover.bs-popover-auto[x-placement^=right] .arrow::after,.popover.bs-popover-auto[x-placement^=right] .arrow::before,.popover.bs-popover-right .arrow::after,.popover.bs-popover-right .arrow::before{margin-top:-8px;border-left-width:0}.popover.bs-popover-auto[x-placement^=right] .arrow::before,.popover.bs-popover-right .arrow::before{left:-11px;border-right-color:rgba(0,0,0,.25)}.popover.bs-popover-auto[x-placement^=right] .arrow::after,.popover.bs-popover-right .arrow::after{left:-10px;border-right-color:#fff}.popover.bs-popover-auto[x-placement^=bottom],.popover.bs-popover-bottom{margin-top:10px}.popover.bs-popover-auto[x-placement^=bottom] .arrow,.popover.bs-popover-bottom .arrow{top:0}.popover.bs-popover-auto[x-placement^=bottom] .arrow::after,.popover.bs-popover-auto[x-placement^=bottom] .arrow::before,.popover.bs-popover-bottom .arrow::after,.popover.bs-popover-bottom .arrow::before{margin-left:-7px;border-top-width:0}.popover.bs-popover-auto[x-placement^=bottom] .arrow::before,.popover.bs-popover-bottom .arrow::before{top:-11px;border-bottom-color:rgba(0,0,0,.25)}.popover.bs-popover-auto[x-placement^=bottom] .arrow::after,.popover.bs-popover-bottom .arrow::after{top:-10px;border-bottom-color:#fff}.popover.bs-popover-auto[x-placement^=bottom] .popover-header::before,.popover.bs-popover-bottom .popover-header::before{position:absolute;top:0;left:50%;display:block;width:20px;margin-left:-10px;content:"";border-bottom:1px solid #f7f7f7}.popover.bs-popover-auto[x-placement^=left],.popover.bs-popover-left{margin-right:10px}.popover.bs-popover-auto[x-placement^=left] .arrow,.popover.bs-popover-left .arrow{right:0}.popover.bs-popover-auto[x-placement^=left] .arrow::after,.popover.bs-popover-auto[x-placement^=left] .arrow::before,.popover.bs-popover-left .arrow::after,.popover.bs-popover-left .arrow::before{margin-top:-8px;border-right-width:0}.popover.bs-popover-auto[x-placement^=left] .arrow::before,.popover.bs-popover-left .arrow::before{right:-11px;border-left-color:rgba(0,0,0,.25)}.popover.bs-popover-auto[x-placement^=left] .arrow::after,.popover.bs-popover-left .arrow::after{right:-10px;border-left-color:#fff}.popover-header{padding:8px 14px;margin-bottom:0;font-size:1rem;color:inherit;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:9px 14px;color:#212529}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-item{position:relative;display:none;-ms-flex-align:center;align-items:center;width:100%;transition:-webkit-transform .6s ease;transition:transform .6s ease;transition:transform .6s ease,-webkit-transform .6s ease;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.carousel-item-next,.carousel-item-prev{position:absolute;top:0}.carousel-item-next.carousel-item-left,.carousel-item-prev.carousel-item-right{-webkit-transform:translateX(0);transform:translateX(0)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.carousel-item-next.carousel-item-left,.carousel-item-prev.carousel-item-right{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.active.carousel-item-right,.carousel-item-next{-webkit-transform:translateX(100%);transform:translateX(100%)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.active.carousel-item-right,.carousel-item-next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}.active.carousel-item-left,.carousel-item-prev{-webkit-transform:translateX(-100%);transform:translateX(-100%)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.active.carousel-item-left,.carousel-item-prev{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:transparent no-repeat center center;background-size:100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M4 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E")}.carousel-control-next-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E")}.carousel-indicators{position:absolute;right:0;bottom:10px;left:0;z-index:15;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{position:relative;-ms-flex:0 1 auto;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;background-color:rgba(255,255,255,.5)}.carousel-indicators li::before{position:absolute;top:-10px;left:0;display:inline-block;width:100%;height:10px;content:""}.carousel-indicators li::after{position:absolute;bottom:-10px;left:0;display:inline-block;width:100%;height:10px;content:""}.carousel-indicators .active{background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#007bff!important}a.bg-primary:focus,a.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#868e96!important}a.bg-secondary:focus,a.bg-secondary:hover{background-color:#6c757d!important}.bg-success{background-color:#28a745!important}a.bg-success:focus,a.bg-success:hover{background-color:#1e7e34!important}.bg-info{background-color:#17a2b8!important}a.bg-info:focus,a.bg-info:hover{background-color:#117a8b!important}.bg-warning{background-color:#ffc107!important}a.bg-warning:focus,a.bg-warning:hover{background-color:#d39e00!important}.bg-danger{background-color:#dc3545!important}a.bg-danger:focus,a.bg-danger:hover{background-color:#bd2130!important}.bg-light{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#343a40!important}a.bg-dark:focus,a.bg-dark:hover{background-color:#1d2124!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #e9ecef!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#868e96!important}.border-success{border-color:#28a745!important}.border-info{border-color:#17a2b8!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#343a40!important}.border-white{border-color:#fff!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important;border-top-right-radius:.25rem!important}.rounded-right{border-top-right-radius:.25rem!important;border-bottom-right-radius:.25rem!important}.rounded-bottom{border-bottom-right-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-circle{border-radius:50%}.rounded-0{border-radius:0}.clearfix::after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-cell{display:table-cell!important}.d-flex{display:-ms-flexbox!important;display:flex!important}.d-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:-ms-flexbox!important;display:flex!important}.d-sm-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:-ms-flexbox!important;display:flex!important}.d-md-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:-ms-flexbox!important;display:flex!important}.d-lg-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:-ms-flexbox!important;display:flex!important}.d-xl-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}.d-print-block{display:none!important}@media print{.d-print-block{display:block!important}}.d-print-inline{display:none!important}@media print{.d-print-inline{display:inline!important}}.d-print-inline-block{display:none!important}@media print{.d-print-inline-block{display:inline-block!important}}@media print{.d-print-none{display:none!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9::before{padding-top:42.857143%}.embed-responsive-16by9::before{padding-top:56.25%}.embed-responsive-4by3::before{padding-top:75%}.embed-responsive-1by1::before{padding-top:100%}.flex-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-center{-ms-flex-align:center!important;align-items:center!important}.align-items-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}@media (min-width:576px){.flex-sm-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-sm-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-sm-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-sm-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-sm-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-sm-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-sm-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-sm-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-sm-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-sm-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-sm-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-sm-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-sm-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-sm-center{-ms-flex-align:center!important;align-items:center!important}.align-items-sm-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-sm-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-sm-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-sm-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-sm-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-sm-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-sm-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-sm-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-sm-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-sm-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-sm-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-sm-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-sm-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-sm-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:768px){.flex-md-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-md-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-md-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-md-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-md-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-md-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-md-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-md-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-md-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-md-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-md-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-md-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-md-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-md-center{-ms-flex-align:center!important;align-items:center!important}.align-items-md-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-md-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-md-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-md-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-md-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-md-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-md-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-md-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-md-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-md-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-md-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-md-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-md-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-md-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-lg-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-lg-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-lg-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-lg-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-lg-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-lg-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-lg-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-lg-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-lg-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-lg-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-lg-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-lg-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-lg-center{-ms-flex-align:center!important;align-items:center!important}.align-items-lg-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-lg-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-lg-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-lg-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-lg-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-lg-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-lg-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-lg-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-lg-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-lg-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-lg-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-lg-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-lg-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-lg-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-xl-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-xl-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-xl-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-xl-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-xl-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-xl-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-xl-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-xl-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-xl-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-xl-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-xl-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-xl-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-xl-center{-ms-flex-align:center!important;align-items:center!important}.align-items-xl-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-xl-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-xl-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-xl-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-xl-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-xl-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-xl-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-xl-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-xl-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-xl-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-xl-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-xl-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-xl-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-xl-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}@supports ((position:-webkit-sticky) or (position:sticky)){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;-webkit-clip-path:inset(50%);clip-path:inset(50%);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal;-webkit-clip-path:none;clip-path:none}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.m-0{margin:0!important}.mt-0{margin-top:0!important}.mr-0{margin-right:0!important}.mb-0{margin-bottom:0!important}.ml-0{margin-left:0!important}.mx-0{margin-right:0!important;margin-left:0!important}.my-0{margin-top:0!important;margin-bottom:0!important}.m-1{margin:.25rem!important}.mt-1{margin-top:.25rem!important}.mr-1{margin-right:.25rem!important}.mb-1{margin-bottom:.25rem!important}.ml-1{margin-left:.25rem!important}.mx-1{margin-right:.25rem!important;margin-left:.25rem!important}.my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.m-2{margin:.5rem!important}.mt-2{margin-top:.5rem!important}.mr-2{margin-right:.5rem!important}.mb-2{margin-bottom:.5rem!important}.ml-2{margin-left:.5rem!important}.mx-2{margin-right:.5rem!important;margin-left:.5rem!important}.my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.m-3{margin:1rem!important}.mt-3{margin-top:1rem!important}.mr-3{margin-right:1rem!important}.mb-3{margin-bottom:1rem!important}.ml-3{margin-left:1rem!important}.mx-3{margin-right:1rem!important;margin-left:1rem!important}.my-3{margin-top:1rem!important;margin-bottom:1rem!important}.m-4{margin:1.5rem!important}.mt-4{margin-top:1.5rem!important}.mr-4{margin-right:1.5rem!important}.mb-4{margin-bottom:1.5rem!important}.ml-4{margin-left:1.5rem!important}.mx-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.my-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.m-5{margin:3rem!important}.mt-5{margin-top:3rem!important}.mr-5{margin-right:3rem!important}.mb-5{margin-bottom:3rem!important}.ml-5{margin-left:3rem!important}.mx-5{margin-right:3rem!important;margin-left:3rem!important}.my-5{margin-top:3rem!important;margin-bottom:3rem!important}.p-0{padding:0!important}.pt-0{padding-top:0!important}.pr-0{padding-right:0!important}.pb-0{padding-bottom:0!important}.pl-0{padding-left:0!important}.px-0{padding-right:0!important;padding-left:0!important}.py-0{padding-top:0!important;padding-bottom:0!important}.p-1{padding:.25rem!important}.pt-1{padding-top:.25rem!important}.pr-1{padding-right:.25rem!important}.pb-1{padding-bottom:.25rem!important}.pl-1{padding-left:.25rem!important}.px-1{padding-right:.25rem!important;padding-left:.25rem!important}.py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.p-2{padding:.5rem!important}.pt-2{padding-top:.5rem!important}.pr-2{padding-right:.5rem!important}.pb-2{padding-bottom:.5rem!important}.pl-2{padding-left:.5rem!important}.px-2{padding-right:.5rem!important;padding-left:.5rem!important}.py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.p-3{padding:1rem!important}.pt-3{padding-top:1rem!important}.pr-3{padding-right:1rem!important}.pb-3{padding-bottom:1rem!important}.pl-3{padding-left:1rem!important}.px-3{padding-right:1rem!important;padding-left:1rem!important}.py-3{padding-top:1rem!important;padding-bottom:1rem!important}.p-4{padding:1.5rem!important}.pt-4{padding-top:1.5rem!important}.pr-4{padding-right:1.5rem!important}.pb-4{padding-bottom:1.5rem!important}.pl-4{padding-left:1.5rem!important}.px-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.py-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.p-5{padding:3rem!important}.pt-5{padding-top:3rem!important}.pr-5{padding-right:3rem!important}.pb-5{padding-bottom:3rem!important}.pl-5{padding-left:3rem!important}.px-5{padding-right:3rem!important;padding-left:3rem!important}.py-5{padding-top:3rem!important;padding-bottom:3rem!important}.m-auto{margin:auto!important}.mt-auto{margin-top:auto!important}.mr-auto{margin-right:auto!important}.mb-auto{margin-bottom:auto!important}.ml-auto{margin-left:auto!important}.mx-auto{margin-right:auto!important;margin-left:auto!important}.my-auto{margin-top:auto!important;margin-bottom:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0{margin-top:0!important}.mr-sm-0{margin-right:0!important}.mb-sm-0{margin-bottom:0!important}.ml-sm-0{margin-left:0!important}.mx-sm-0{margin-right:0!important;margin-left:0!important}.my-sm-0{margin-top:0!important;margin-bottom:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1{margin-top:.25rem!important}.mr-sm-1{margin-right:.25rem!important}.mb-sm-1{margin-bottom:.25rem!important}.ml-sm-1{margin-left:.25rem!important}.mx-sm-1{margin-right:.25rem!important;margin-left:.25rem!important}.my-sm-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2{margin-top:.5rem!important}.mr-sm-2{margin-right:.5rem!important}.mb-sm-2{margin-bottom:.5rem!important}.ml-sm-2{margin-left:.5rem!important}.mx-sm-2{margin-right:.5rem!important;margin-left:.5rem!important}.my-sm-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3{margin-top:1rem!important}.mr-sm-3{margin-right:1rem!important}.mb-sm-3{margin-bottom:1rem!important}.ml-sm-3{margin-left:1rem!important}.mx-sm-3{margin-right:1rem!important;margin-left:1rem!important}.my-sm-3{margin-top:1rem!important;margin-bottom:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4{margin-top:1.5rem!important}.mr-sm-4{margin-right:1.5rem!important}.mb-sm-4{margin-bottom:1.5rem!important}.ml-sm-4{margin-left:1.5rem!important}.mx-sm-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.my-sm-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5{margin-top:3rem!important}.mr-sm-5{margin-right:3rem!important}.mb-sm-5{margin-bottom:3rem!important}.ml-sm-5{margin-left:3rem!important}.mx-sm-5{margin-right:3rem!important;margin-left:3rem!important}.my-sm-5{margin-top:3rem!important;margin-bottom:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0{padding-top:0!important}.pr-sm-0{padding-right:0!important}.pb-sm-0{padding-bottom:0!important}.pl-sm-0{padding-left:0!important}.px-sm-0{padding-right:0!important;padding-left:0!important}.py-sm-0{padding-top:0!important;padding-bottom:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1{padding-top:.25rem!important}.pr-sm-1{padding-right:.25rem!important}.pb-sm-1{padding-bottom:.25rem!important}.pl-sm-1{padding-left:.25rem!important}.px-sm-1{padding-right:.25rem!important;padding-left:.25rem!important}.py-sm-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2{padding-top:.5rem!important}.pr-sm-2{padding-right:.5rem!important}.pb-sm-2{padding-bottom:.5rem!important}.pl-sm-2{padding-left:.5rem!important}.px-sm-2{padding-right:.5rem!important;padding-left:.5rem!important}.py-sm-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3{padding-top:1rem!important}.pr-sm-3{padding-right:1rem!important}.pb-sm-3{padding-bottom:1rem!important}.pl-sm-3{padding-left:1rem!important}.px-sm-3{padding-right:1rem!important;padding-left:1rem!important}.py-sm-3{padding-top:1rem!important;padding-bottom:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4{padding-top:1.5rem!important}.pr-sm-4{padding-right:1.5rem!important}.pb-sm-4{padding-bottom:1.5rem!important}.pl-sm-4{padding-left:1.5rem!important}.px-sm-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.py-sm-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5{padding-top:3rem!important}.pr-sm-5{padding-right:3rem!important}.pb-sm-5{padding-bottom:3rem!important}.pl-sm-5{padding-left:3rem!important}.px-sm-5{padding-right:3rem!important;padding-left:3rem!important}.py-sm-5{padding-top:3rem!important;padding-bottom:3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto{margin-top:auto!important}.mr-sm-auto{margin-right:auto!important}.mb-sm-auto{margin-bottom:auto!important}.ml-sm-auto{margin-left:auto!important}.mx-sm-auto{margin-right:auto!important;margin-left:auto!important}.my-sm-auto{margin-top:auto!important;margin-bottom:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0{margin-top:0!important}.mr-md-0{margin-right:0!important}.mb-md-0{margin-bottom:0!important}.ml-md-0{margin-left:0!important}.mx-md-0{margin-right:0!important;margin-left:0!important}.my-md-0{margin-top:0!important;margin-bottom:0!important}.m-md-1{margin:.25rem!important}.mt-md-1{margin-top:.25rem!important}.mr-md-1{margin-right:.25rem!important}.mb-md-1{margin-bottom:.25rem!important}.ml-md-1{margin-left:.25rem!important}.mx-md-1{margin-right:.25rem!important;margin-left:.25rem!important}.my-md-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2{margin-top:.5rem!important}.mr-md-2{margin-right:.5rem!important}.mb-md-2{margin-bottom:.5rem!important}.ml-md-2{margin-left:.5rem!important}.mx-md-2{margin-right:.5rem!important;margin-left:.5rem!important}.my-md-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3{margin-top:1rem!important}.mr-md-3{margin-right:1rem!important}.mb-md-3{margin-bottom:1rem!important}.ml-md-3{margin-left:1rem!important}.mx-md-3{margin-right:1rem!important;margin-left:1rem!important}.my-md-3{margin-top:1rem!important;margin-bottom:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4{margin-top:1.5rem!important}.mr-md-4{margin-right:1.5rem!important}.mb-md-4{margin-bottom:1.5rem!important}.ml-md-4{margin-left:1.5rem!important}.mx-md-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.my-md-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5{margin-top:3rem!important}.mr-md-5{margin-right:3rem!important}.mb-md-5{margin-bottom:3rem!important}.ml-md-5{margin-left:3rem!important}.mx-md-5{margin-right:3rem!important;margin-left:3rem!important}.my-md-5{margin-top:3rem!important;margin-bottom:3rem!important}.p-md-0{padding:0!important}.pt-md-0{padding-top:0!important}.pr-md-0{padding-right:0!important}.pb-md-0{padding-bottom:0!important}.pl-md-0{padding-left:0!important}.px-md-0{padding-right:0!important;padding-left:0!important}.py-md-0{padding-top:0!important;padding-bottom:0!important}.p-md-1{padding:.25rem!important}.pt-md-1{padding-top:.25rem!important}.pr-md-1{padding-right:.25rem!important}.pb-md-1{padding-bottom:.25rem!important}.pl-md-1{padding-left:.25rem!important}.px-md-1{padding-right:.25rem!important;padding-left:.25rem!important}.py-md-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2{padding-top:.5rem!important}.pr-md-2{padding-right:.5rem!important}.pb-md-2{padding-bottom:.5rem!important}.pl-md-2{padding-left:.5rem!important}.px-md-2{padding-right:.5rem!important;padding-left:.5rem!important}.py-md-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3{padding-top:1rem!important}.pr-md-3{padding-right:1rem!important}.pb-md-3{padding-bottom:1rem!important}.pl-md-3{padding-left:1rem!important}.px-md-3{padding-right:1rem!important;padding-left:1rem!important}.py-md-3{padding-top:1rem!important;padding-bottom:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4{padding-top:1.5rem!important}.pr-md-4{padding-right:1.5rem!important}.pb-md-4{padding-bottom:1.5rem!important}.pl-md-4{padding-left:1.5rem!important}.px-md-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.py-md-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5{padding-top:3rem!important}.pr-md-5{padding-right:3rem!important}.pb-md-5{padding-bottom:3rem!important}.pl-md-5{padding-left:3rem!important}.px-md-5{padding-right:3rem!important;padding-left:3rem!important}.py-md-5{padding-top:3rem!important;padding-bottom:3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto{margin-top:auto!important}.mr-md-auto{margin-right:auto!important}.mb-md-auto{margin-bottom:auto!important}.ml-md-auto{margin-left:auto!important}.mx-md-auto{margin-right:auto!important;margin-left:auto!important}.my-md-auto{margin-top:auto!important;margin-bottom:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0{margin-top:0!important}.mr-lg-0{margin-right:0!important}.mb-lg-0{margin-bottom:0!important}.ml-lg-0{margin-left:0!important}.mx-lg-0{margin-right:0!important;margin-left:0!important}.my-lg-0{margin-top:0!important;margin-bottom:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1{margin-top:.25rem!important}.mr-lg-1{margin-right:.25rem!important}.mb-lg-1{margin-bottom:.25rem!important}.ml-lg-1{margin-left:.25rem!important}.mx-lg-1{margin-right:.25rem!important;margin-left:.25rem!important}.my-lg-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2{margin-top:.5rem!important}.mr-lg-2{margin-right:.5rem!important}.mb-lg-2{margin-bottom:.5rem!important}.ml-lg-2{margin-left:.5rem!important}.mx-lg-2{margin-right:.5rem!important;margin-left:.5rem!important}.my-lg-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3{margin-top:1rem!important}.mr-lg-3{margin-right:1rem!important}.mb-lg-3{margin-bottom:1rem!important}.ml-lg-3{margin-left:1rem!important}.mx-lg-3{margin-right:1rem!important;margin-left:1rem!important}.my-lg-3{margin-top:1rem!important;margin-bottom:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4{margin-top:1.5rem!important}.mr-lg-4{margin-right:1.5rem!important}.mb-lg-4{margin-bottom:1.5rem!important}.ml-lg-4{margin-left:1.5rem!important}.mx-lg-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.my-lg-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5{margin-top:3rem!important}.mr-lg-5{margin-right:3rem!important}.mb-lg-5{margin-bottom:3rem!important}.ml-lg-5{margin-left:3rem!important}.mx-lg-5{margin-right:3rem!important;margin-left:3rem!important}.my-lg-5{margin-top:3rem!important;margin-bottom:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0{padding-top:0!important}.pr-lg-0{padding-right:0!important}.pb-lg-0{padding-bottom:0!important}.pl-lg-0{padding-left:0!important}.px-lg-0{padding-right:0!important;padding-left:0!important}.py-lg-0{padding-top:0!important;padding-bottom:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1{padding-top:.25rem!important}.pr-lg-1{padding-right:.25rem!important}.pb-lg-1{padding-bottom:.25rem!important}.pl-lg-1{padding-left:.25rem!important}.px-lg-1{padding-right:.25rem!important;padding-left:.25rem!important}.py-lg-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2{padding-top:.5rem!important}.pr-lg-2{padding-right:.5rem!important}.pb-lg-2{padding-bottom:.5rem!important}.pl-lg-2{padding-left:.5rem!important}.px-lg-2{padding-right:.5rem!important;padding-left:.5rem!important}.py-lg-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3{padding-top:1rem!important}.pr-lg-3{padding-right:1rem!important}.pb-lg-3{padding-bottom:1rem!important}.pl-lg-3{padding-left:1rem!important}.px-lg-3{padding-right:1rem!important;padding-left:1rem!important}.py-lg-3{padding-top:1rem!important;padding-bottom:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4{padding-top:1.5rem!important}.pr-lg-4{padding-right:1.5rem!important}.pb-lg-4{padding-bottom:1.5rem!important}.pl-lg-4{padding-left:1.5rem!important}.px-lg-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.py-lg-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5{padding-top:3rem!important}.pr-lg-5{padding-right:3rem!important}.pb-lg-5{padding-bottom:3rem!important}.pl-lg-5{padding-left:3rem!important}.px-lg-5{padding-right:3rem!important;padding-left:3rem!important}.py-lg-5{padding-top:3rem!important;padding-bottom:3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto{margin-top:auto!important}.mr-lg-auto{margin-right:auto!important}.mb-lg-auto{margin-bottom:auto!important}.ml-lg-auto{margin-left:auto!important}.mx-lg-auto{margin-right:auto!important;margin-left:auto!important}.my-lg-auto{margin-top:auto!important;margin-bottom:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0{margin-top:0!important}.mr-xl-0{margin-right:0!important}.mb-xl-0{margin-bottom:0!important}.ml-xl-0{margin-left:0!important}.mx-xl-0{margin-right:0!important;margin-left:0!important}.my-xl-0{margin-top:0!important;margin-bottom:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1{margin-top:.25rem!important}.mr-xl-1{margin-right:.25rem!important}.mb-xl-1{margin-bottom:.25rem!important}.ml-xl-1{margin-left:.25rem!important}.mx-xl-1{margin-right:.25rem!important;margin-left:.25rem!important}.my-xl-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2{margin-top:.5rem!important}.mr-xl-2{margin-right:.5rem!important}.mb-xl-2{margin-bottom:.5rem!important}.ml-xl-2{margin-left:.5rem!important}.mx-xl-2{margin-right:.5rem!important;margin-left:.5rem!important}.my-xl-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3{margin-top:1rem!important}.mr-xl-3{margin-right:1rem!important}.mb-xl-3{margin-bottom:1rem!important}.ml-xl-3{margin-left:1rem!important}.mx-xl-3{margin-right:1rem!important;margin-left:1rem!important}.my-xl-3{margin-top:1rem!important;margin-bottom:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4{margin-top:1.5rem!important}.mr-xl-4{margin-right:1.5rem!important}.mb-xl-4{margin-bottom:1.5rem!important}.ml-xl-4{margin-left:1.5rem!important}.mx-xl-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.my-xl-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5{margin-top:3rem!important}.mr-xl-5{margin-right:3rem!important}.mb-xl-5{margin-bottom:3rem!important}.ml-xl-5{margin-left:3rem!important}.mx-xl-5{margin-right:3rem!important;margin-left:3rem!important}.my-xl-5{margin-top:3rem!important;margin-bottom:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0{padding-top:0!important}.pr-xl-0{padding-right:0!important}.pb-xl-0{padding-bottom:0!important}.pl-xl-0{padding-left:0!important}.px-xl-0{padding-right:0!important;padding-left:0!important}.py-xl-0{padding-top:0!important;padding-bottom:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1{padding-top:.25rem!important}.pr-xl-1{padding-right:.25rem!important}.pb-xl-1{padding-bottom:.25rem!important}.pl-xl-1{padding-left:.25rem!important}.px-xl-1{padding-right:.25rem!important;padding-left:.25rem!important}.py-xl-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2{padding-top:.5rem!important}.pr-xl-2{padding-right:.5rem!important}.pb-xl-2{padding-bottom:.5rem!important}.pl-xl-2{padding-left:.5rem!important}.px-xl-2{padding-right:.5rem!important;padding-left:.5rem!important}.py-xl-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3{padding-top:1rem!important}.pr-xl-3{padding-right:1rem!important}.pb-xl-3{padding-bottom:1rem!important}.pl-xl-3{padding-left:1rem!important}.px-xl-3{padding-right:1rem!important;padding-left:1rem!important}.py-xl-3{padding-top:1rem!important;padding-bottom:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4{padding-top:1.5rem!important}.pr-xl-4{padding-right:1.5rem!important}.pb-xl-4{padding-bottom:1.5rem!important}.pl-xl-4{padding-left:1.5rem!important}.px-xl-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.py-xl-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5{padding-top:3rem!important}.pr-xl-5{padding-right:3rem!important}.pb-xl-5{padding-bottom:3rem!important}.pl-xl-5{padding-left:3rem!important}.px-xl-5{padding-right:3rem!important;padding-left:3rem!important}.py-xl-5{padding-top:3rem!important;padding-bottom:3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto{margin-top:auto!important}.mr-xl-auto{margin-right:auto!important}.mb-xl-auto{margin-bottom:auto!important}.ml-xl-auto{margin-left:auto!important}.mx-xl-auto{margin-right:auto!important;margin-left:auto!important}.my-xl-auto{margin-top:auto!important;margin-bottom:auto!important}}.text-justify{text-align:justify!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-normal{font-weight:400}.font-weight-bold{font-weight:700}.font-italic{font-style:italic}.text-white{color:#fff!important}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0062cc!important}.text-secondary{color:#868e96!important}a.text-secondary:focus,a.text-secondary:hover{color:#6c757d!important}.text-success{color:#28a745!important}a.text-success:focus,a.text-success:hover{color:#1e7e34!important}.text-info{color:#17a2b8!important}a.text-info:focus,a.text-info:hover{color:#117a8b!important}.text-warning{color:#ffc107!important}a.text-warning:focus,a.text-warning:hover{color:#d39e00!important}.text-danger{color:#dc3545!important}a.text-danger:focus,a.text-danger:hover{color:#bd2130!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#dae0e5!important}.text-dark{color:#343a40!important}a.text-dark:focus,a.text-dark:hover{color:#1d2124!important}.text-muted{color:#868e96!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.visible{visibility:visible!important}.invisible{visibility:hidden!important}
+/*# sourceMappingURL=bootstrap.min.css.map */
\ No newline at end of file
diff --git a/kafka-ui-api/src/main/resources/static/static/css/signin.css b/kafka-ui-api/src/main/resources/static/static/css/signin.css
new file mode 100644
index 00000000000..516aeb126ab
--- /dev/null
+++ b/kafka-ui-api/src/main/resources/static/static/css/signin.css
@@ -0,0 +1,38 @@
+body {
+ padding-top: 40px;
+ padding-bottom: 40px;
+ background-color: #eee;
+}
+
+.form-signin {
+ max-width: 330px;
+ padding: 15px;
+ margin: 0 auto;
+}
+.form-signin .form-signin-heading,
+.form-signin .checkbox {
+ margin-bottom: 10px;
+}
+.form-signin .checkbox {
+ font-weight: 400;
+}
+.form-signin .form-control {
+ position: relative;
+ box-sizing: border-box;
+ height: auto;
+ padding: 10px;
+ font-size: 16px;
+}
+.form-signin .form-control:focus {
+ z-index: 2;
+}
+.form-signin input[type="email"] {
+ margin-bottom: -1px;
+ border-bottom-right-radius: 0;
+ border-bottom-left-radius: 0;
+}
+.form-signin input[type="password"] {
+ margin-bottom: 10px;
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+}
| null | train | train | 2022-03-08T12:26:32 | "2022-01-14T12:10:37Z" | cmanzur | train |
provectus/kafka-ui/1640_1641 | provectus/kafka-ui | provectus/kafka-ui/1640 | provectus/kafka-ui/1641 | [
"timestamp(timedelta=0.0, similarity=0.9477167372982529)",
"connected"
] | a67305a28e67f9568fd09188928c4c13207f2647 | 8125814eed049c2f91f53c140b5f9221d8a45bd4 | [
"Hello there keeperUA! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"@keeperUA hey, thanks for reporting!",
"Unfortunatly i dont have right to make PR\r\nSo there is a proposed ingress template\r\n\r\n\r\n```\r\n{{- if .Values.ingress.enabled -}}\r\n{{- $fullName := include \"kafka-ui.fullname\" . -}}\r\n{{- $svcPort := .Values.service.port -}}\r\n{{- if $.Capabilities.APIVersions.Has \"networking.k8s.io/v1\" }}\r\napiVersion: networking.k8s.io/v1\r\n{{- else if $.Capabilities.APIVersions.Has \"networking.k8s.io/v1beta1\" }}\r\napiVersion: networking.k8s.io/v1beta1\r\n{{- else }}\r\napiVersion: extensions/v1beta1\r\n{{- end }}\r\nkind: Ingress\r\nmetadata:\r\n name: {{ $fullName }}\r\n labels:\r\n {{- include \"kafka-ui.labels\" . | nindent 4 }}\r\n {{- with .Values.ingress.annotations }}\r\n annotations:\r\n {{- toYaml . | nindent 4 }}\r\n {{- end }}\r\nspec:\r\n {{- if .Values.ingress.tls.enabled }}\r\n tls:\r\n - hosts:\r\n - {{ .Values.ingress.host }}\r\n secretName: {{ .Values.ingress.tls.secretName }}\r\n {{- end }}\r\n {{- if .Values.ingress.ingressClassName }}\r\n ingressClassName: {{ .Values.ingress.ingressClassName }}\r\n {{- end }}\r\n rules:\r\n - http:\r\n paths:\r\n{{- if $.Capabilities.APIVersions.Has \"networking.k8s.io/v1\" -}}\r\n {{- range .Values.ingress.precedingPaths }}\r\n - path: {{ .path }}\r\n pathType: Prefix\r\n backend:\r\n service:\r\n name: {{ .serviceName }}\r\n port:\r\n number: {{ .servicePort }}\r\n {{- end }}\r\n - backend:\r\n service:\r\n name: {{ $fullName }}\r\n port:\r\n number: {{ $svcPort }}\r\n pathType: Prefix\r\n{{- if .Values.ingress.path }}\r\n path: {{ .Values.ingress.path }}\r\n{{- end }}\r\n {{- range .Values.ingress.succeedingPaths }}\r\n - path: {{ .path }}\r\n pathType: Prefix\r\n backend:\r\n service:\r\n name: {{ .serviceName }}\r\n port:\r\n number: {{ .servicePort }}\r\n {{- end }}\r\n{{- if .Values.ingress.host }}\r\n host: {{ .Values.ingress.host }}\r\n{{- end }}\r\n{{- else -}}\r\n {{- range .Values.ingress.precedingPaths }}\r\n - path: {{ .path }}\r\n backend:\r\n serviceName: {{ .serviceName }}\r\n servicePort: {{ .servicePort }}\r\n {{- end }}\r\n - backend:\r\n serviceName: {{ $fullName }}\r\n servicePort: {{ $svcPort }}\r\n{{- if .Values.ingress.path }}\r\n path: {{ .Values.ingress.path }}\r\n{{- end }}\r\n {{- range .Values.ingress.succeedingPaths }}\r\n - path: {{ .path }}\r\n backend:\r\n serviceName: {{ .serviceName }}\r\n servicePort: {{ .servicePort }}\r\n {{- end }}\r\n{{- if .Values.ingress.host }}\r\n host: {{ .Values.ingress.host }}\r\n{{- end }}\r\n{{- end }}\r\n{{- end }}\r\n\r\n```",
"@keeperUA you def can open a PR, you just have to fork a repo first, make a branch there and propose the changes to the base repo. Or you can even do it via github UI (editing a specific file will fork a repo for you).",
"ok, i will try"
] | [] | "2022-02-18T20:38:27Z" | [
"type/bug",
"status/accepted",
"scope/k8s"
] | Ingress resource will not survive k8s upgrade from 1.21 to 1.22 | **Describe the bug**
Ingres template has wrong version logic
networking.k8s.io/v1beta1 - this api version is [depricated since 1.19 and totaly removed since 1.22](https://kubernetes.io/docs/reference/using-api/deprecation-guide/#ingress-v122)
Current logic will work fine for new setup on kubernetes v1.22, but it completely broken when you try upgrade kubernetes from v1.21 to v1.22. Because setup on 1.21 has api version that will be removed in 1.22. So on kubernetes upgrade ingress resorce will be removed and you must install helm chart again.
Steps to reproduce the behavior:
1. Install helm chart on kubernetes v 1.21
2. Upgrade kubernetes to v 1.22
3. Ingress will be broken
**Expected behavior**
Ingress resource must survive the kubernetes upgrade
**Additional context**
Related to this [issue](https://github.com/provectus/kafka-ui/issues/1337)
| [
"charts/kafka-ui/templates/ingress.yaml"
] | [
"charts/kafka-ui/templates/ingress.yaml"
] | [] | diff --git a/charts/kafka-ui/templates/ingress.yaml b/charts/kafka-ui/templates/ingress.yaml
index 7c1c046a0eb..06f70e990cb 100644
--- a/charts/kafka-ui/templates/ingress.yaml
+++ b/charts/kafka-ui/templates/ingress.yaml
@@ -1,11 +1,11 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "kafka-ui.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
-{{- if semverCompare ">=1.22-0" .Capabilities.KubeVersion.GitVersion -}}
+{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
apiVersion: networking.k8s.io/v1
-{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
+{{- else if $.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
apiVersion: networking.k8s.io/v1beta1
-{{- else -}}
+{{- else }}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
@@ -30,7 +30,7 @@ spec:
rules:
- http:
paths:
-{{- if semverCompare ">=1.22-0" .Capabilities.KubeVersion.GitVersion -}}
+{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" -}}
{{- range .Values.ingress.precedingPaths }}
- path: {{ .path }}
pathType: Prefix
@@ -84,4 +84,4 @@ spec:
host: {{ .Values.ingress.host }}
{{- end }}
{{- end }}
-{{- end }}
\ No newline at end of file
+{{- end }}
| null | val | train | 2022-02-18T16:15:59 | "2022-02-18T20:28:06Z" | keeperUA | train |
provectus/kafka-ui/1521_1642 | provectus/kafka-ui | provectus/kafka-ui/1521 | provectus/kafka-ui/1642 | [
"timestamp(timedelta=0.0, similarity=0.8504744551839614)",
"connected"
] | dd42dbe0cd6c571ad0de2479d13fe7511e9f1296 | d40af6d38605d43d31bca5a24c5e0061c1d193ca | [
"Hello there Alepacox! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"Hey, thanks for the suggestion. This seems like a good feature, we'll get this implemented :)",
"I'm glad to hear that, thank you so much!"
] | [
"```suggestion\r\n <td>{items && items[brokerId]?.port}</td>\r\n```",
"Fixed"
] | "2022-02-19T19:35:28Z" | [
"type/enhancement",
"good first issue",
"scope/backend",
"scope/frontend",
"status/accepted",
"status/pending-frontend"
] | Show IP and port of brokers in UI/API | Good morning, thank you very much for the great work you are doing.
I just wanted to know if there is a possibility to also show the port of the brokers on the /clusters/clusterName/brokers endpoint.
It would be so useful for scenarios where brokers are added to the cluster with random port mappings, so that you can connect to the brokers by querying the Kafka-UI API first.
Morover, those same data could be displayed in the UI (/ui/clusters/Local/brokers) along with each broker ID.
Thank you so much.
| [
"kafka-ui-react-app/src/components/Brokers/Brokers.tsx"
] | [
"kafka-ui-react-app/src/components/Brokers/Brokers.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Brokers/Brokers.tsx b/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
index 3a6466f0b58..44490774046 100644
--- a/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
+++ b/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
@@ -10,6 +10,7 @@ import PageHeading from 'components/common/PageHeading/PageHeading';
import * as Metrics from 'components/common/Metrics';
import { useAppDispatch, useAppSelector } from 'lib/hooks/redux';
import {
+ fetchBrokers,
fetchClusterStats,
selectStats,
} from 'redux/reducers/brokers/brokersSlice';
@@ -28,6 +29,7 @@ const Brokers: React.FC = () => {
underReplicatedPartitionCount,
diskUsage,
version,
+ items,
} = useAppSelector(selectStats);
let replicas = inSyncReplicasCount ?? 0;
@@ -35,14 +37,15 @@ const Brokers: React.FC = () => {
React.useEffect(() => {
dispatch(fetchClusterStats(clusterName));
- }, [clusterName, dispatch]);
+ dispatch(fetchBrokers(clusterName));
+ }, [fetchClusterStats, fetchBrokers, clusterName, dispatch]);
useInterval(() => {
fetchClusterStats(clusterName);
+ fetchBrokers(clusterName);
}, 5000);
const zkOnline = zooKeeperStatus === ZooKeeperStatus.online;
-
return (
<>
<PageHeading text="Brokers" />
@@ -122,6 +125,8 @@ const Brokers: React.FC = () => {
<TableHeaderCell title="Broker" />
<TableHeaderCell title="Segment Size (Mb)" />
<TableHeaderCell title="Segment Count" />
+ <TableHeaderCell title="Port" />
+ <TableHeaderCell title="Host" />
</tr>
</thead>
<tbody>
@@ -133,6 +138,8 @@ const Brokers: React.FC = () => {
<BytesFormatted value={segmentSize} />
</td>
<td>{segmentCount}</td>
+ <td>{items && items[brokerId]?.port}</td>
+ <td>{items && items[brokerId]?.host}</td>
</tr>
))
) : (
| null | train | train | 2022-02-21T14:12:27 | "2022-01-31T09:07:38Z" | Alepacox | train |
provectus/kafka-ui/1015_1651 | provectus/kafka-ui | provectus/kafka-ui/1015 | provectus/kafka-ui/1651 | [
"timestamp(timedelta=2393.0, similarity=0.8795723966704371)",
"connected"
] | 627f1391bc9ebe57adf82c799e6370251a976790 | cc926b2fc930adff3558a633a6be3fd1791bfb85 | [] | [] | "2022-02-21T18:31:19Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted"
] | Rename offsets columns | To make offsets indication more clear we have to:
Topic details page:
1) Rename min/max offset to first/next (earliest/latest?) offset
2) Add a column "message count"
CC @iliax @GneyHabub | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx
index 458d2dff6a3..f947eaf01df 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx
@@ -38,6 +38,12 @@ const Overview: React.FC<Props> = ({
}) => {
const { isReadOnly } = React.useContext(ClusterContext);
+ const messageCount = React.useMemo(() => {
+ return (partitions || []).reduce((memo, partition) => {
+ return memo + partition.offsetMax - partition.offsetMin;
+ }, 0);
+ }, [partitions]);
+
return (
<>
<Metrics.Wrapper>
@@ -84,6 +90,9 @@ const Overview: React.FC<Props> = ({
<Metrics.Indicator label="Clean Up Policy">
<Tag color="gray">{cleanUpPolicy || 'Unknown'}</Tag>
</Metrics.Indicator>
+ <Metrics.Indicator label="Message Count">
+ {messageCount}
+ </Metrics.Indicator>
</Metrics.Section>
</Metrics.Wrapper>
<div>
@@ -92,8 +101,9 @@ const Overview: React.FC<Props> = ({
<tr>
<TableHeaderCell title="Partition ID" />
<TableHeaderCell title="Broker Leader" />
- <TableHeaderCell title="Min Offset" />
- <TableHeaderCell title="Max Offset" />
+ <TableHeaderCell title="First Offset" />
+ <TableHeaderCell title="Next Offset" />
+ <TableHeaderCell title="Message Count" />
<TableHeaderCell title=" " />
</tr>
</thead>
@@ -104,6 +114,7 @@ const Overview: React.FC<Props> = ({
<td>{leader}</td>
<td>{offsetMin}</td>
<td>{offsetMax}</td>
+ <td>{offsetMax - offsetMin}</td>
<td style={{ width: '5%' }}>
{!internal && !isReadOnly && cleanUpPolicy === 'DELETE' ? (
<Dropdown label={<VerticalElipsisIcon />} right>
| null | train | train | 2022-02-21T17:31:22 | "2021-10-26T10:27:47Z" | Haarolean | train |
provectus/kafka-ui/1656_1664 | provectus/kafka-ui | provectus/kafka-ui/1656 | provectus/kafka-ui/1664 | [
"connected"
] | 825588dab22e516028c4629674633d38dfb1bfe4 | ea9a145583a0cf4f02afa3b1ecdc1c76b2905de9 | [
"Hello there David-hod! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"Hi, thanks for reaching out.\r\n\r\nWill take a look.",
"Still have to get rid of ZK to get a clean scan #1663"
] | [] | "2022-02-22T17:04:36Z" | [
"scope/backend",
"type/security",
"status/accepted"
] | A number of CVEs is present | it seems like the latest release 0.3.3 is very vulnerable
https://artifacthub.io/packages/helm/kafka-ui/kafka-ui?modal=security-report
when can we get a version with those issues fixed?
| [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/GlobalErrorWebExceptionHandler.java",
"pom.xml"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/GlobalErrorWebExceptionHandler.java",
"pom.xml"
] | [
"kafka-ui-api/src/test/java/com/provectus/kafka/ui/serde/schemaregistry/SchemaRegistryAwareRecordSerDeTest.java"
] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/GlobalErrorWebExceptionHandler.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/GlobalErrorWebExceptionHandler.java
index d96432ffdce..394e2aa730b 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/GlobalErrorWebExceptionHandler.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/GlobalErrorWebExceptionHandler.java
@@ -10,7 +10,7 @@
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import org.springframework.boot.autoconfigure.web.ResourceProperties;
+import org.springframework.boot.autoconfigure.web.WebProperties;
import org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler;
import org.springframework.boot.web.reactive.error.ErrorAttributes;
import org.springframework.context.ApplicationContext;
@@ -36,10 +36,9 @@
public class GlobalErrorWebExceptionHandler extends AbstractErrorWebExceptionHandler {
public GlobalErrorWebExceptionHandler(ErrorAttributes errorAttributes,
- ResourceProperties resourceProperties,
ApplicationContext applicationContext,
ServerCodecConfigurer codecConfigurer) {
- super(errorAttributes, resourceProperties, applicationContext);
+ super(errorAttributes, new WebProperties.Resources(), applicationContext);
this.setMessageWriters(codecConfigurer.getWriters());
}
diff --git a/pom.xml b/pom.xml
index b08a67743a4..2a599a5ad24 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,7 +14,7 @@
<maven.compiler.target>13</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <spring-boot.version>2.5.6</spring-boot.version>
+ <spring-boot.version>2.6.3</spring-boot.version>
<jackson-databind-nullable.version>0.2.2</jackson-databind-nullable.version>
<org.mapstruct.version>1.4.2.Final</org.mapstruct.version>
<org.projectlombok.version>1.18.20</org.projectlombok.version>
@@ -33,7 +33,7 @@
<swagger-annotations.version>1.6.0</swagger-annotations.version>
<springdoc-openapi-webflux-ui.version>1.2.32</springdoc-openapi-webflux-ui.version>
<avro.version>1.11.0</avro.version>
- <confluent.version>5.5.1</confluent.version>
+ <confluent.version>7.0.1</confluent.version>
<apache.commons.version>2.2</apache.commons.version>
<test.containers.version>1.16.2</test.containers.version>
<junit-jupiter-engine.version>5.7.2</junit-jupiter-engine.version>
| diff --git a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/serde/schemaregistry/SchemaRegistryAwareRecordSerDeTest.java b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/serde/schemaregistry/SchemaRegistryAwareRecordSerDeTest.java
index af4b8351d73..65929e6be2b 100644
--- a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/serde/schemaregistry/SchemaRegistryAwareRecordSerDeTest.java
+++ b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/serde/schemaregistry/SchemaRegistryAwareRecordSerDeTest.java
@@ -60,6 +60,7 @@ void callsSchemaFormatterWhenValueHasMagicByteAndValidSchemaId() throws Exceptio
int schemaId = 1234;
when(registryClient.getSchemaById(schemaId)).thenReturn(schema);
+ when(registryClient.getSchemaBySubjectAndId(null, schemaId)).thenReturn(schema);
var result = serde.deserialize(
new ConsumerRecord<>(
@@ -71,8 +72,10 @@ void callsSchemaFormatterWhenValueHasMagicByteAndValidSchemaId() throws Exceptio
)
);
- // called twice: once by serde code, once by formatter (will be cached)
- verify(registryClient, times(2)).getSchemaById(schemaId);
+ // called once by serde code
+ verify(registryClient, times(1)).getSchemaById(schemaId);
+ //called once by formatter (will be cached)
+ verify(registryClient, times(1)).getSchemaBySubjectAndId(null, schemaId);
assertThat(result.getKeySchemaId()).isNull();
assertThat(result.getKeyFormat()).isEqualTo(MessageFormat.UNKNOWN);
@@ -115,23 +118,29 @@ void fallsBackToStringFormatterIfValueContainsMagicByteButSchemaNotFound() throw
@Test
void fallsBackToStringFormatterIfMagicByteAndSchemaIdFoundButFormatterFailed() throws Exception {
int schemaId = 1234;
+
+ final var schema = new AvroSchema("{ \"type\": \"string\" }");
+
when(registryClient.getSchemaById(schemaId))
- .thenReturn(new AvroSchema("{ \"type\": \"string\" }"));
+ .thenReturn(schema);
+ when(registryClient.getSchemaBySubjectAndId(null, schemaId)).thenReturn(schema);
// will cause exception in avro deserializer
- Bytes nonAvroValue = bytesWithMagicByteAndSchemaId(schemaId, "123".getBytes());
+ Bytes nonAvroValue = bytesWithMagicByteAndSchemaId(schemaId, "123".getBytes());
var result = serde.deserialize(
new ConsumerRecord<>(
"test-topic",
1,
100,
Bytes.wrap("key".getBytes()),
- nonAvroValue
+ nonAvroValue
)
);
- // called twice: once by serde code, once by formatter (will be cached)
- verify(registryClient, times(2)).getSchemaById(schemaId);
+ // called once by serde code
+ verify(registryClient, times(1)).getSchemaById(schemaId);
+ //called once by formatter (will be cached)
+ verify(registryClient, times(1)).getSchemaBySubjectAndId(null, schemaId);
assertThat(result.getKeySchemaId()).isNull();
assertThat(result.getKeyFormat()).isEqualTo(MessageFormat.UNKNOWN);
| train | train | 2022-03-11T13:40:59 | "2022-02-22T10:29:44Z" | David-hod | train |
provectus/kafka-ui/1667_1668 | provectus/kafka-ui | provectus/kafka-ui/1667 | provectus/kafka-ui/1668 | [
"connected"
] | 4651c5e30850f4f2b78fc747e297cc306db06c4f | fd7ba5e1958966423e0966fcf1ac25f66ce61429 | [
"Hi @mattia-crypto thank you for opening the issue.\r\n\r\nHave you tried referencing these env variables like: \r\n`KAFKA_CLUSTERS_0_PROPERTIES_SASL_JAAS_CONFIG: \"org.apache.kafka.common.security.plain.PlainLoginModule required username=\"admin\" password=\"$PASSWORD\";\" ?`\r\n\r\nWhere `$PASSWORD` is the name of env var provided by the existing secret.",
"Have not tried this yet, no! Good advice which by the looks of it should work. I will test it out :-) ",
"Hey @5hin0bi ! \r\n\r\nThat solved this Issue indeed, many thanks. However, it only fixes the problem when `SASL_PLAINTEXT` is used.\r\n\r\nIn my case I do use `SASL_SSL`, and the above solution gave me the idea to use the `existingSecret` parameter as a way to inject the certs. However, these are not in `.jks` format by default...\r\n\r\nAre you working on converting Kubernetes secrets to `.jks` with `kube-ui`, or are you expecting end-users to manage this in adance?\r\n\r\n\r\nFor your information I also tried this:\r\n```\r\nvalues:\r\n - existingSecret: \"kafka-ui-user\" \r\n - existingSecret: \"kafka-client-cert\"\r\n```\r\nBut that only stored the latter `Secret` as environment variables, leaving the `KAFKA_CLUSTERS_0_PROPERTIES_SASL_JAAS_CONFIG:` environment variable undefined which crashed my `Pod`.\r\nIs there a way to inject multiple existing secrets? \r\n\r\nThanks.\r\n",
"Hi @mattia-crypto glad it helped at least with the simple case.\r\n\r\nIf you wish to store certificates as files in the container, I believe the best option will be to use volumeMounts: https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-files-from-a-pod\r\n\r\nIt's not yet supported by the existing state of the helm chart we maintain but I see it's a required thing to have. We will implement the support for mounting secrets in future. **The work will be done within this issue.**\r\n\r\nMeanwhile, you can make required changes basing on the link I've provided to store certificates as files in the container and reference them in the kafka-ui config.\r\nSetting multiple existing secrets is not supported either, but you can include cert to the same kafka-ui-user secret and reference it as env variable. So that you will need to specify only one existing secret.",
"Thank you @5hin0bi. I would like to add that the Strimzi Kafka operator generates the following content for the secret related to a particular KafkaUser CRD:\r\n- `ca.crt`\r\n- `user.crt`\r\n- `user.key`\r\n- `user.p12`\r\n- `user.password`\r\n\r\nThis is one of the most highly used Kafka operators so I would recommend a solution that can integrate neatly with this `Secret` generated for the CRD. ",
"OK @mattia-crypto , we will consider these when implementing the feature.",
"@mattia-crypto, @5hin0bi ,\r\n\r\nI just follow the above answer but no luck\r\n```\r\n22-05-20 11:21:24,265 WARN [kafka-admin-client-thread | adminclient-3] o.a.k.c.a.i.AdminMetadataManager: [AdminClient clientId=adminclient-3] Metadata update failed due to authentication error\r\norg.apache.kafka.common.errors.SaslAuthenticationException: Authentication failed during authentication due to invalid credentials with SASL mechanism SCRAM-SHA-512\r\n```\r\nCan you guys help me check? What is wrong\r\n\r\n```\r\n replicaCount: 1\r\n fullnameOverride: \"kafka-ui\"\r\n\r\n existingConfigMap: \"\"\r\n existingSecret: \"\"\r\n envs:\r\n secret:\r\n PASSWORD: cGFzc3dvcmQ=\r\n config:\r\n KAFKA_CLUSTERS_0_NAME: test-msk\r\n KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: b-1.my-msk.xxxxxx.c5.kafka.ap-southeast-1.amazonaws.com:9096\r\n KAFKA_CLUSTERS_0_PROPERTIES_SECURITY_PROTOCOL: SASL_SSL\r\n KAFKA_CLUSTERS_0_PROPERTIES_SASL_MECHANISM: SCRAM-SHA-512\r\n KAFKA_CLUSTERS_0_PROPERTIES_SASL_JAAS_CONFIG: 'org.apache.kafka.common.security.scram.ScramLoginModule required username=\"mskadm\" password=\"$(PASSWORD)\";'\r\n\r\n```\r\n\r\nBut when I specify my password in envs.config it works perfectly",
"> @mattia-crypto, @5hin0bi ,\r\n> \r\n> I just follow the above answer but no luck\r\n> \r\n> ```\r\n> 22-05-20 11:21:24,265 WARN [kafka-admin-client-thread | adminclient-3] o.a.k.c.a.i.AdminMetadataManager: [AdminClient clientId=adminclient-3] Metadata update failed due to authentication error\r\n> org.apache.kafka.common.errors.SaslAuthenticationException: Authentication failed during authentication due to invalid credentials with SASL mechanism SCRAM-SHA-512\r\n> ```\r\n> \r\n> Can you guys help me check? What is wrong\r\n> \r\n> ```\r\n> replicaCount: 1\r\n> fullnameOverride: \"kafka-ui\"\r\n> \r\n> existingConfigMap: \"\"\r\n> existingSecret: \"\"\r\n> envs:\r\n> secret:\r\n> PASSWORD: cGFzc3dvcmQ=\r\n> config:\r\n> KAFKA_CLUSTERS_0_NAME: test-msk\r\n> KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: b-1.my-msk.xxxxxx.c5.kafka.ap-southeast-1.amazonaws.com:9096\r\n> KAFKA_CLUSTERS_0_PROPERTIES_SECURITY_PROTOCOL: SASL_SSL\r\n> KAFKA_CLUSTERS_0_PROPERTIES_SASL_MECHANISM: SCRAM-SHA-512\r\n> KAFKA_CLUSTERS_0_PROPERTIES_SASL_JAAS_CONFIG: 'org.apache.kafka.common.security.scram.ScramLoginModule required username=\"mskadm\" password=\"$(PASSWORD)\";'\r\n> ```\r\n> \r\n> But when I specify my password in envs.config it works perfectly\r\n\r\n@azatsafin any ideas?",
"> @mattia-crypto, @5hin0bi ,\r\n> \r\n> I just follow the above answer but no luck\r\n> \r\n> ```\r\n> 22-05-20 11:21:24,265 WARN [kafka-admin-client-thread | adminclient-3] o.a.k.c.a.i.AdminMetadataManager: [AdminClient clientId=adminclient-3] Metadata update failed due to authentication error\r\n> org.apache.kafka.common.errors.SaslAuthenticationException: Authentication failed during authentication due to invalid credentials with SASL mechanism SCRAM-SHA-512\r\n> ```\r\n> \r\n> Can you guys help me check? What is wrong\r\n> \r\n> ```\r\n> replicaCount: 1\r\n> fullnameOverride: \"kafka-ui\"\r\n> \r\n> existingConfigMap: \"\"\r\n> existingSecret: \"\"\r\n> envs:\r\n> secret:\r\n> PASSWORD: cGFzc3dvcmQ=\r\n> config:\r\n> KAFKA_CLUSTERS_0_NAME: test-msk\r\n> KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: b-1.my-msk.xxxxxx.c5.kafka.ap-southeast-1.amazonaws.com:9096\r\n> KAFKA_CLUSTERS_0_PROPERTIES_SECURITY_PROTOCOL: SASL_SSL\r\n> KAFKA_CLUSTERS_0_PROPERTIES_SASL_MECHANISM: SCRAM-SHA-512\r\n> KAFKA_CLUSTERS_0_PROPERTIES_SASL_JAAS_CONFIG: 'org.apache.kafka.common.security.scram.ScramLoginModule required username=\"mskadm\" password=\"$(PASSWORD)\";'\r\n> ```\r\n> \r\n> But when I specify my password in envs.config it works perfectly\r\n\r\n@lllsJllsJ do you have any special characters in a password by any chance? if yes, please comment on #2116",
"was there ever a solution to this?",
"@SuitableProduce please follow #3142",
"Thank you!\r\n",
"I know that this issue is closed, but I am having an issue being able to reference environment variables in environment yamlApplicationConfig or envs config.\r\n\r\nThe configuration provided below does not work. It throws a Java stack trace with `Caused by: java.lang.IllegalArgumentException: Login module control flag not specified in JAAS config` seeming to be the root cause. \r\n Where the `user-auth-jaas` secret contains the JAAS config. If I replace `$JAAS` with the contents of the secret it works fine. Additionally if I shell into the pod `echo $JAAS` provides the expected value.\r\n\r\n```yaml\r\nexistingSecret: \"user-auth-jaas\"\r\nenvs:\r\n secret: {}\r\n config:\r\n KAFKA_CLUSTERS_0_NAME: cluster\r\n KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka.confluent.svc.cluster.local:9071\r\n KAFKA_CLUSTERS_0_PROPERTIES_SECURITY_PROTOCOL: SASL_PLAINTEXT\r\n KAFKA_CLUSTERS_0_PROPERTIES_SASL_MECHANISM: PLAIN\r\n KAFKA_CLUSTERS_0_PROPERTIES_SASL_JAAS_CONFIG: \"$JAAS\"\r\n```",
"@blacklobo Hey. Were you able to solve it? Have the same problem, passing the variable from the env variable seems not working.",
"@mattia-crypto Hey. Do you remember how you did that? Probably you still have it in your configuration.",
"Had the same problem but was able to work around it as follows:\r\n\r\nBase64 encode your `sasl_jaas_config` or what ever config-value you want to set:\r\n```sh\r\necho 'org.apache.kafka.common.security.scram.ScramLoginModule required username=\"<user>\" password=\"<password>' | base64\r\n```\r\n\r\nCreate a Kubernetes-Secret:\r\n```yaml\r\napiVersion: v1\r\ndata:\r\n KAFKA_CLUSTERS_0_PROPERTIES_SASL_JAAS_CONFIG: >-\r\n <base64-string>\r\nkind: Secret\r\nmetadata:\r\n name: kafka-ui-sasl-config\r\n namespace: <namespace>\r\n```\r\n\r\nIn your values.yaml reference the secret:\r\n```yaml\r\nexistingSecret: \"kafka-ui-sasl-config\"\r\n```\r\nAll values set in the Secret get set as env-vars in the container.\r\n\r\nHelm-chart-version: `kafka-ui:0.7.5`"
] | [] | "2022-02-23T10:43:47Z" | [
"type/enhancement",
"status/accepted",
"scope/k8s"
] | Let environment variable values be injected from Secrets | ### Is your proposal related to a problem?
The issue is that the `KAFKA_CLUSTERS_0_PROPERTIES_SASL_JAAS_CONFIG` environment variable needs to be populated in plaintext.
### Describe the solution you'd like
I would like to see the Helm chart support referencing values for the environment variables from a Kubernetes `Secret`.
For example:
```
values:
- envs:
config:
KAFKA_CLUSTERS_0_PROPERTIES_SASL_JAAS_CONFIG:
valueFrom:
secretKeyRef:
name: "kafka-ui-user"
key: "sasl.jaas.config"
```
However, my `helmfile diff` complains since the parameter `KAFKA_CLUSTERS_X_...` only supports values of type string, implying that these type of injections are not supported by the Chart yet.
### Describe alternatives you've considered
In this case, my `kafka-ui-user` Kubernetes `Secret` is created with a `CRD` of kind `KafkaUser`. I do not want to change how I create a `KafkaUser` (ie maintaining Kafka configuration as CRDs) since the current setup works well from a CI/CD perspective, and since the `KafkaUser` allows me to manage ACLs to Kafka resources.
Still, this `KafkaUser` and its associated `Secret` autogenerates the `.sasl.jaas.config`, including the `password` (referenced from the `Secret` with `kafka-ui-user.password`) for me. I would like to be able to inject the values associated with those two keys to the `kafka-ui` Chart's environment variables as a consequence.
I have tried with the following:
```
values:
- existingSecret: "kafka-ui-user"`
```
But this simply gives me two environment variables:
- `password`
- `sasl.jaas.config`
with the values of the environment variables coming from the data parameter of the `Secret`. There is therefore no way to inject these into the `KAFKA_CLUSTERS_0_PROPERTIES_SASL_JAAS_CONFIG` AFAIK, which is what is required for the `kube-ui` `Pod` to authenticate to my Kafka environment. | [
"charts/kafka-ui/templates/deployment.yaml",
"charts/kafka-ui/values.yaml"
] | [
"charts/kafka-ui/templates/deployment.yaml",
"charts/kafka-ui/values.yaml"
] | [] | diff --git a/charts/kafka-ui/templates/deployment.yaml b/charts/kafka-ui/templates/deployment.yaml
index 0f995b837d8..630d93c8329 100644
--- a/charts/kafka-ui/templates/deployment.yaml
+++ b/charts/kafka-ui/templates/deployment.yaml
@@ -29,6 +29,10 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
+ {{- with .Values.initContainers }}
+ initContainers:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
serviceAccountName: {{ include "kafka-ui.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
@@ -38,6 +42,10 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
+ {{- with .Values.env }}
+ env:
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
envFrom:
{{- if .Values.existingConfigMap }}
- configMapRef:
@@ -73,6 +81,14 @@ spec:
timeoutSeconds: 10
resources:
{{- toYaml .Values.resources | nindent 12 }}
+ {{- with .Values.volumeMounts }}
+ volumeMounts:
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
+ {{- with .Values.volumes }}
+ volumes:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
diff --git a/charts/kafka-ui/values.yaml b/charts/kafka-ui/values.yaml
index 43cbf869f6b..33dcfb0b300 100644
--- a/charts/kafka-ui/values.yaml
+++ b/charts/kafka-ui/values.yaml
@@ -117,3 +117,11 @@ nodeSelector: {}
tolerations: []
affinity: {}
+
+env: {}
+
+initContainers: {}
+
+volumeMounts: {}
+
+volumes: {}
| null | train | train | 2022-02-24T12:18:24 | "2022-02-23T08:41:57Z" | mattia-crypto | train |
provectus/kafka-ui/1650_1677 | provectus/kafka-ui | provectus/kafka-ui/1650 | provectus/kafka-ui/1677 | [
"timestamp(timedelta=0.0, similarity=0.8891260347545157)",
"connected"
] | e7f1a3920958d0db36dbebfb137bbfd8d87cef7e | 825588dab22e516028c4629674633d38dfb1bfe4 | [] | [
"why are you using async here?",
"delete 'async' please, I don't see reason of having it ",
"Why we have async here?\r\nI guess you can delete it",
"I think if we expect something to be in the DOM definitely like this case , a better approach is to use `getBy` syntax to pinpoint exact point of failure on that function if something goes wrong.",
"Same here as well",
"Replacing queryBy with getBy since it exist in Dom to pin point the point of failure."
] | "2022-02-24T21:25:55Z" | [
"scope/frontend",
"status/accepted",
"type/chore"
] | Improve test coverage for ConsumerGroups folder | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
Improve test coverage for [src/components/ConsumerGroups](https://sonarcloud.io/component_measures?metric=new_coverage&selected=com.provectus%3Akafka-ui_frontend%3Asrc%2Fcomponents%2FConsumerGroups&view=list&id=com.provectus%3Akafka-ui_frontend)
**Expected**
Coverage is close to 100%
| [
"kafka-ui-react-app/src/components/ConsumerGroups/Details/ListItem.tsx",
"kafka-ui-react-app/src/components/ConsumerGroups/List/__test__/List.spec.tsx"
] | [
"kafka-ui-react-app/src/components/ConsumerGroups/Details/ListItem.tsx",
"kafka-ui-react-app/src/components/ConsumerGroups/Details/TopicContents/__test__/TopicContents.spec.tsx",
"kafka-ui-react-app/src/components/ConsumerGroups/Details/__tests__/ListItem.spec.tsx",
"kafka-ui-react-app/src/components/ConsumerGroups/List/__test__/List.spec.tsx",
"kafka-ui-react-app/src/components/ConsumerGroups/__test__/ConsumerGroups.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/ConsumerGroups/Details/ListItem.tsx b/kafka-ui-react-app/src/components/ConsumerGroups/Details/ListItem.tsx
index 7fab2e8b736..4d440d46a56 100644
--- a/kafka-ui-react-app/src/components/ConsumerGroups/Details/ListItem.tsx
+++ b/kafka-ui-react-app/src/components/ConsumerGroups/Details/ListItem.tsx
@@ -22,7 +22,11 @@ const ListItem: React.FC<Props> = ({ clusterName, name, consumers }) => {
<>
<tr>
<ToggleButton>
- <IconButtonWrapper onClick={() => setIsOpen(!isOpen)} aria-hidden>
+ <IconButtonWrapper
+ onClick={() => setIsOpen(!isOpen)}
+ aria-hidden
+ data-testid="consumer-group-list-item-toggle"
+ >
<MessageToggleIcon isOpen={isOpen} />
</IconButtonWrapper>
</ToggleButton>
diff --git a/kafka-ui-react-app/src/components/ConsumerGroups/Details/TopicContents/__test__/TopicContents.spec.tsx b/kafka-ui-react-app/src/components/ConsumerGroups/Details/TopicContents/__test__/TopicContents.spec.tsx
new file mode 100644
index 00000000000..1c36aceda5f
--- /dev/null
+++ b/kafka-ui-react-app/src/components/ConsumerGroups/Details/TopicContents/__test__/TopicContents.spec.tsx
@@ -0,0 +1,45 @@
+import React from 'react';
+import { clusterConsumerGroupDetailsPath } from 'lib/paths';
+import { screen } from '@testing-library/react';
+import TopicContents from 'components/ConsumerGroups/Details/TopicContents/TopicContents';
+import { consumerGroupPayload } from 'redux/reducers/consumerGroups/__test__/fixtures';
+import { render } from 'lib/testHelpers';
+import { Route } from 'react-router';
+import { ConsumerGroupTopicPartition } from 'generated-sources';
+
+const clusterName = 'cluster1';
+
+const renderComponent = (consumers: ConsumerGroupTopicPartition[] = []) =>
+ render(
+ <Route
+ path={clusterConsumerGroupDetailsPath(':clusterName', ':consumerGroupID')}
+ >
+ <table>
+ <tbody>
+ <TopicContents consumers={consumers} />
+ </tbody>
+ </table>
+ </Route>,
+ {
+ pathname: clusterConsumerGroupDetailsPath(
+ clusterName,
+ consumerGroupPayload.groupId
+ ),
+ }
+ );
+
+describe('TopicContent', () => {
+ it('renders empty table', () => {
+ renderComponent();
+ const table = screen.getAllByRole('table')[1];
+ expect(table.getElementsByTagName('td').length).toBe(0);
+ });
+
+ it('renders table with content', () => {
+ renderComponent(consumerGroupPayload.partitions);
+ const table = screen.getAllByRole('table')[1];
+ expect(table.getElementsByTagName('td').length).toBe(
+ consumerGroupPayload.partitions.length * 6
+ );
+ });
+});
diff --git a/kafka-ui-react-app/src/components/ConsumerGroups/Details/__tests__/ListItem.spec.tsx b/kafka-ui-react-app/src/components/ConsumerGroups/Details/__tests__/ListItem.spec.tsx
new file mode 100644
index 00000000000..7b3f9440661
--- /dev/null
+++ b/kafka-ui-react-app/src/components/ConsumerGroups/Details/__tests__/ListItem.spec.tsx
@@ -0,0 +1,48 @@
+import React from 'react';
+import { clusterConsumerGroupDetailsPath } from 'lib/paths';
+import { screen } from '@testing-library/react';
+import userEvent from '@testing-library/user-event';
+import ListItem from 'components/ConsumerGroups/Details/ListItem';
+import { consumerGroupPayload } from 'redux/reducers/consumerGroups/__test__/fixtures';
+import { render } from 'lib/testHelpers';
+import { Route } from 'react-router';
+import { ConsumerGroupTopicPartition } from 'generated-sources';
+
+const clusterName = 'cluster1';
+
+const renderComponent = (consumers: ConsumerGroupTopicPartition[] = []) =>
+ render(
+ <Route
+ path={clusterConsumerGroupDetailsPath(':clusterName', ':consumerGroupID')}
+ >
+ <table>
+ <tbody>
+ <ListItem
+ clusterName={clusterName}
+ name={clusterName}
+ consumers={consumers}
+ />
+ </tbody>
+ </table>
+ </Route>,
+ {
+ pathname: clusterConsumerGroupDetailsPath(
+ clusterName,
+ consumerGroupPayload.groupId
+ ),
+ }
+ );
+
+describe('ListItem', () => {
+ beforeEach(() => renderComponent(consumerGroupPayload.partitions));
+
+ it('should renders list item with topic content closed and check if element exists', () => {
+ expect(screen.getByRole('row')).toBeInTheDocument();
+ });
+
+ it('should renders list item with topic content open', () => {
+ userEvent.click(screen.getByTestId('consumer-group-list-item-toggle'));
+
+ expect(screen.getByText('Consumer ID')).toBeInTheDocument();
+ });
+});
diff --git a/kafka-ui-react-app/src/components/ConsumerGroups/List/__test__/List.spec.tsx b/kafka-ui-react-app/src/components/ConsumerGroups/List/__test__/List.spec.tsx
index 0ac9c0ceedf..d0e4ea8f21c 100644
--- a/kafka-ui-react-app/src/components/ConsumerGroups/List/__test__/List.spec.tsx
+++ b/kafka-ui-react-app/src/components/ConsumerGroups/List/__test__/List.spec.tsx
@@ -1,6 +1,6 @@
import React from 'react';
import List from 'components/ConsumerGroups/List/List';
-import { screen } from '@testing-library/react';
+import { screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { render } from 'lib/testHelpers';
import { store } from 'redux/store';
@@ -15,7 +15,7 @@ describe('List', () => {
expect(screen.getByText('No active consumer groups')).toBeInTheDocument();
});
- describe('consumerGroups are fecthed', () => {
+ describe('consumerGroups are fetched', () => {
beforeEach(() => {
store.dispatch({
type: fetchConsumerGroups.fulfilled.type,
@@ -29,11 +29,14 @@ describe('List', () => {
});
describe('when searched', () => {
- it('renders only searched consumers', () => {
- userEvent.type(
- screen.getByPlaceholderText('Search by Consumer Group ID'),
- 'groupId1'
- );
+ it('renders only searched consumers', async () => {
+ await waitFor(() => {
+ userEvent.type(
+ screen.getByPlaceholderText('Search by Consumer Group ID'),
+ 'groupId1'
+ );
+ });
+
expect(screen.getByText('groupId1')).toBeInTheDocument();
expect(screen.getByText('groupId2')).toBeInTheDocument();
});
diff --git a/kafka-ui-react-app/src/components/ConsumerGroups/__test__/ConsumerGroups.spec.tsx b/kafka-ui-react-app/src/components/ConsumerGroups/__test__/ConsumerGroups.spec.tsx
new file mode 100644
index 00000000000..cbb90a7a2f4
--- /dev/null
+++ b/kafka-ui-react-app/src/components/ConsumerGroups/__test__/ConsumerGroups.spec.tsx
@@ -0,0 +1,65 @@
+import React from 'react';
+import { clusterConsumerGroupsPath } from 'lib/paths';
+import {
+ screen,
+ waitFor,
+ waitForElementToBeRemoved,
+} from '@testing-library/react';
+import ConsumerGroups from 'components/ConsumerGroups/ConsumerGroups';
+import { consumerGroups } from 'redux/reducers/consumerGroups/__test__/fixtures';
+import { render } from 'lib/testHelpers';
+import fetchMock from 'fetch-mock';
+import { Route } from 'react-router';
+
+const clusterName = 'cluster1';
+
+const renderComponent = () =>
+ render(
+ <Route path={clusterConsumerGroupsPath(':clusterName')}>
+ <ConsumerGroups />
+ </Route>,
+ {
+ pathname: clusterConsumerGroupsPath(clusterName),
+ }
+ );
+
+describe('ConsumerGroup', () => {
+ afterEach(() => {
+ fetchMock.reset();
+ });
+
+ it('renders with initial state', async () => {
+ renderComponent();
+
+ expect(screen.getByRole('progressbar')).toBeInTheDocument();
+ });
+
+ it('renders with 404 from consumer groups', async () => {
+ const consumerGroupsMock = fetchMock.getOnce(
+ `/api/clusters/${clusterName}/consumer-groups`,
+ 404
+ );
+
+ renderComponent();
+
+ await waitFor(() => expect(consumerGroupsMock.called()).toBeTruthy());
+
+ expect(screen.queryByText('Consumers')).not.toBeInTheDocument();
+ expect(screen.queryByRole('table')).not.toBeInTheDocument();
+ });
+
+ it('renders with 200 from consumer groups', async () => {
+ const consumerGroupsMock = fetchMock.getOnce(
+ `/api/clusters/${clusterName}/consumer-groups`,
+ consumerGroups
+ );
+
+ renderComponent();
+
+ await waitForElementToBeRemoved(() => screen.getByRole('progressbar'));
+ await waitFor(() => expect(consumerGroupsMock.called()).toBeTruthy());
+
+ expect(screen.getByText('Consumers')).toBeInTheDocument();
+ expect(screen.getByRole('table')).toBeInTheDocument();
+ });
+});
| null | train | train | 2022-03-10T21:12:11 | "2022-02-21T17:36:22Z" | workshur | train |
provectus/kafka-ui/1702_1703 | provectus/kafka-ui | provectus/kafka-ui/1702 | provectus/kafka-ui/1703 | [
"timestamp(timedelta=1.0, similarity=1.0000000000000002)",
"connected"
] | 5ce24cb8fd5e2108dde21105af7e2490d0b23d74 | 97b6e2593a306ddfa8f3cb9260850a444fe8a596 | [
"Hello there sasunprov! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π"
] | [
"@sasunprov should we remove ListItem component?",
"pls use `SmartTable` instead of `smart-table`",
"Yes ",
"Why is this a function rather than a variable that gets returned in the function ? just Curios , if it was variable we can just return it renamed without applying useCallback on it",
"because this logic is moved to TableColumn components and custom components for cells\r\n",
"one liner function which is not heavy do we have to wrap it with useCallback ? ",
"I think here we have extra addition sign , and why do we have to show the placeholders if no data is found ?",
"Here also during every re-render it have to check to variable in order no to run a minimal small function , can we ignore it , if not why ?",
"good catch",
"This will help us later when we memoize child components",
"There is no extra addition operator, it will increment the colspan if table is selectable and there will be added one more column for selection",
"The same justification as in previous comment",
"okay got it.",
"okay got it.",
"okay it makes sense now."
] | "2022-03-04T21:46:13Z" | [
"scope/frontend",
"type/refactoring",
"status/accepted"
] | Reusable tables | ### Is your proposal related to a problem?
<!--
Provide a clear and concise description of what the problem is.
For example, "I'm always frustrated when..."
-->
The purpose of this feature request is to have a **Table** component more reusable and handle _select row, pagination, emty state_ inside it.
### Describe the solution you'd like
<!--
Provide a clear and concise description of what you want to happen.
-->
With the current implementation we must handle rendering rows, selecting rows, empty state, pagination in each page where we have a table. With this Feature Request we will have **Table** and **TableColumn** components and describe table structure with them. Also there is possibility for providing custom component for particular column cell and header cell. With that we can define which column is sortable etc. for example:
```
<Table selectable tableState={tableState}>
<TableColumn sortable title="Topic Name" field="name" />
<TableColumn title="Total Partitions" field="partitions.length" />
<TableColumn
title="Out of sync replicas"
cell={OutOfSyncReplicasCell}
/>
<TableColumn title="Replication Factor" field="replicationFactor" />
<TableColumn
title="Number of messages"
cell={NumberOfMessagesCell}
/>
<TableColumn title="Size" cell={TopicSizeCell} />
</Table>
```
### Describe alternatives you've considered
<!--
Let us know about other solutions you've tried or researched.
-->
### Additional context
Also in this feature request I have added **TableState** and **DataSource** features. **TableState** will handle row selection, pagination and will provide table state, and the **DataSource** will have responsibility to handle data manipulations, later we can have also **AsyncDataSource** which will handle requesting to API and handle incoming data.
<!--
Is there anything else you can add about the proposal?
You might want to link to related issues here, if you haven't already.
-->
| [
"kafka-ui-react-app/src/components/Topics/List/List.tsx",
"kafka-ui-react-app/src/components/Topics/List/__tests__/List.spec.tsx",
"kafka-ui-react-app/src/custom.d.ts"
] | [
"kafka-ui-react-app/src/components/Topics/List/List.tsx",
"kafka-ui-react-app/src/components/Topics/List/TopicsTableCells.tsx",
"kafka-ui-react-app/src/components/Topics/List/__tests__/List.spec.tsx",
"kafka-ui-react-app/src/components/common/SmartTable/SmartTable.tsx",
"kafka-ui-react-app/src/components/common/SmartTable/TableColumn.tsx",
"kafka-ui-react-app/src/components/common/SmartTable/TableRow.tsx",
"kafka-ui-react-app/src/custom.d.ts",
"kafka-ui-react-app/src/lib/__test__/propertyLookup.spec.ts",
"kafka-ui-react-app/src/lib/hooks/useTableState.ts",
"kafka-ui-react-app/src/lib/propertyLookup.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/List/List.tsx b/kafka-ui-react-app/src/components/Topics/List/List.tsx
index fd75c87a919..4458761f7e4 100644
--- a/kafka-ui-react-app/src/components/Topics/List/List.tsx
+++ b/kafka-ui-react-app/src/components/Topics/List/List.tsx
@@ -10,23 +10,35 @@ import { clusterTopicNewPath } from 'lib/paths';
import usePagination from 'lib/hooks/usePagination';
import ClusterContext from 'components/contexts/ClusterContext';
import PageLoader from 'components/common/PageLoader/PageLoader';
-import Pagination from 'components/common/Pagination/Pagination';
import ConfirmationModal from 'components/common/ConfirmationModal/ConfirmationModal';
import {
+ CleanUpPolicy,
GetTopicsRequest,
SortOrder,
TopicColumnsToSort,
} from 'generated-sources';
-import TableHeaderCell from 'components/common/table/TableHeaderCell/TableHeaderCell';
import Search from 'components/common/Search/Search';
import { PER_PAGE } from 'lib/constants';
-import { Table } from 'components/common/table/Table/Table.styled';
import { Button } from 'components/common/Button/Button';
import PageHeading from 'components/common/PageHeading/PageHeading';
import { ControlPanelWrapper } from 'components/common/ControlPanel/ControlPanel.styled';
import Switch from 'components/common/Switch/Switch';
+import { SmartTable } from 'components/common/SmartTable/SmartTable';
+import {
+ TableCellProps,
+ TableColumn,
+} from 'components/common/SmartTable/TableColumn';
+import { useTableState } from 'lib/hooks/useTableState';
+import Dropdown from 'components/common/Dropdown/Dropdown';
+import VerticalElipsisIcon from 'components/common/Icons/VerticalElipsisIcon';
+import DropdownItem from 'components/common/Dropdown/DropdownItem';
-import ListItem from './ListItem';
+import {
+ MessagesCell,
+ OutOfSyncReplicasCell,
+ TitleCell,
+ TopicSizeCell,
+} from './TopicsTableCells';
export interface TopicsListProps {
areTopicsFetching: boolean;
@@ -63,7 +75,8 @@ const List: React.FC<TopicsListProps> = ({
setTopicsSearch,
setTopicsOrderBy,
}) => {
- const { isReadOnly } = React.useContext(ClusterContext);
+ const { isReadOnly, isTopicDeletionAllowed } =
+ React.useContext(ClusterContext);
const { clusterName } = useParams<{ clusterName: ClusterName }>();
const { page, perPage, pathname } = usePagination();
const [showInternal, setShowInternal] = React.useState<boolean>(true);
@@ -90,6 +103,24 @@ const List: React.FC<TopicsListProps> = ({
showInternal,
]);
+ const tableState = useTableState<
+ TopicWithDetailedInfo,
+ string,
+ TopicColumnsToSort
+ >(
+ topics,
+ {
+ idSelector: (topic) => topic.name,
+ totalPages,
+ isRowSelectable: (topic) => !topic.internal,
+ },
+ {
+ handleOrderBy: setTopicsOrderBy,
+ orderBy,
+ sortOrder,
+ }
+ );
+
const handleSwitch = React.useCallback(() => {
setShowInternal(!showInternal);
history.push(`${pathname}?page=1&perPage=${perPage || PER_PAGE}`);
@@ -103,36 +134,26 @@ const List: React.FC<TopicsListProps> = ({
setConfirmationModal('');
};
- const [selectedTopics, setSelectedTopics] = React.useState<Set<string>>(
- new Set()
- );
-
- const clearSelectedTopics = () => {
- setSelectedTopics(new Set());
- };
-
- const toggleTopicSelected = (topicName: string) => {
- setSelectedTopics((prevState) => {
- const newState = new Set(prevState);
- if (newState.has(topicName)) {
- newState.delete(topicName);
- } else {
- newState.add(topicName);
- }
- return newState;
- });
- };
+ const clearSelectedTopics = React.useCallback(() => {
+ tableState.toggleSelection(false);
+ }, [tableState]);
const deleteTopicsHandler = React.useCallback(() => {
- deleteTopics(clusterName, Array.from(selectedTopics));
+ deleteTopics(clusterName, Array.from(tableState.selectedIds));
closeConfirmationModal();
clearSelectedTopics();
- }, [clusterName, deleteTopics, selectedTopics]);
+ }, [clearSelectedTopics, clusterName, deleteTopics, tableState.selectedIds]);
const purgeMessagesHandler = React.useCallback(() => {
- clearTopicsMessages(clusterName, Array.from(selectedTopics));
+ clearTopicsMessages(clusterName, Array.from(tableState.selectedIds));
closeConfirmationModal();
clearSelectedTopics();
- }, [clearTopicsMessages, clusterName, selectedTopics]);
+ }, [
+ clearSelectedTopics,
+ clearTopicsMessages,
+ clusterName,
+ tableState.selectedIds,
+ ]);
+
const searchHandler = React.useCallback(
(searchString: string) => {
setTopicsSearch(searchString);
@@ -141,6 +162,53 @@ const List: React.FC<TopicsListProps> = ({
[setTopicsSearch, history, pathname, perPage]
);
+ const ActionsCell = React.memo<TableCellProps<TopicWithDetailedInfo, string>>(
+ ({ hovered, dataItem: { internal, cleanUpPolicy, name } }) => {
+ const [
+ isDeleteTopicConfirmationVisible,
+ setDeleteTopicConfirmationVisible,
+ ] = React.useState(false);
+
+ const deleteTopicHandler = React.useCallback(() => {
+ deleteTopic(clusterName, name);
+ }, [name]);
+
+ const clearTopicMessagesHandler = React.useCallback(() => {
+ clearTopicMessages(clusterName, name);
+ }, [name]);
+ return (
+ <>
+ {!internal && !isReadOnly && hovered ? (
+ <div className="has-text-right">
+ <Dropdown label={<VerticalElipsisIcon />} right>
+ {cleanUpPolicy === CleanUpPolicy.DELETE && (
+ <DropdownItem onClick={clearTopicMessagesHandler} danger>
+ Clear Messages
+ </DropdownItem>
+ )}
+ {isTopicDeletionAllowed && (
+ <DropdownItem
+ onClick={() => setDeleteTopicConfirmationVisible(true)}
+ danger
+ >
+ Remove Topic
+ </DropdownItem>
+ )}
+ </Dropdown>
+ </div>
+ ) : null}
+ <ConfirmationModal
+ isOpen={isDeleteTopicConfirmationVisible}
+ onCancel={() => setDeleteTopicConfirmationVisible(false)}
+ onConfirm={deleteTopicHandler}
+ >
+ Are you sure want to remove <b>{name}</b> topic?
+ </ConfirmationModal>
+ </>
+ );
+ }
+ );
+
return (
<div>
<div>
@@ -178,7 +246,7 @@ const List: React.FC<TopicsListProps> = ({
<PageLoader />
) : (
<div>
- {selectedTopics.size > 0 && (
+ {tableState.selectedCount > 0 && (
<>
<ControlPanelWrapper data-testid="delete-buttons">
<Button
@@ -215,62 +283,43 @@ const List: React.FC<TopicsListProps> = ({
</ConfirmationModal>
</>
)}
- <Table isFullwidth>
- <thead>
- <tr>
- {!isReadOnly && <TableHeaderCell />}
- <TableHeaderCell
- title="Topic Name"
- orderValue={TopicColumnsToSort.NAME}
- orderBy={orderBy}
- sortOrder={sortOrder}
- handleOrderBy={setTopicsOrderBy}
- />
- <TableHeaderCell
- title="Total Partitions"
- orderValue={TopicColumnsToSort.TOTAL_PARTITIONS}
- orderBy={orderBy}
- sortOrder={sortOrder}
- handleOrderBy={setTopicsOrderBy}
- />
- <TableHeaderCell
- title="Out of sync replicas"
- orderValue={TopicColumnsToSort.OUT_OF_SYNC_REPLICAS}
- orderBy={orderBy}
- sortOrder={sortOrder}
- handleOrderBy={setTopicsOrderBy}
- />
- <TableHeaderCell title="Replication Factor" />
- <TableHeaderCell title="Number of messages" />
- <TableHeaderCell
- title="Size"
- orderValue={TopicColumnsToSort.SIZE}
- orderBy={orderBy}
- sortOrder={sortOrder}
- handleOrderBy={setTopicsOrderBy}
- />
- </tr>
- </thead>
- <tbody>
- {topics.map((topic) => (
- <ListItem
- clusterName={clusterName}
- key={topic.name}
- topic={topic}
- selected={selectedTopics.has(topic.name)}
- toggleTopicSelected={toggleTopicSelected}
- deleteTopic={deleteTopic}
- clearTopicMessages={clearTopicMessages}
- />
- ))}
- {topics.length === 0 && (
- <tr>
- <td colSpan={10}>No topics found</td>
- </tr>
- )}
- </tbody>
- </Table>
- <Pagination totalPages={totalPages} />
+ <SmartTable
+ selectable={!isReadOnly}
+ tableState={tableState}
+ placeholder="No topics found"
+ isFullwidth
+ paginated
+ hoverable
+ >
+ <TableColumn
+ width="44%"
+ title="Topic Name"
+ cell={TitleCell}
+ orderValue={TopicColumnsToSort.NAME}
+ />
+ <TableColumn
+ title="Total Partitions"
+ field="partitions.length"
+ orderValue={TopicColumnsToSort.TOTAL_PARTITIONS}
+ />
+ <TableColumn
+ title="Out of sync replicas"
+ cell={OutOfSyncReplicasCell}
+ orderValue={TopicColumnsToSort.OUT_OF_SYNC_REPLICAS}
+ />
+ <TableColumn title="Replication Factor" field="replicationFactor" />
+ <TableColumn title="Number of messages" cell={MessagesCell} />
+ <TableColumn
+ title="Size"
+ cell={TopicSizeCell}
+ orderValue={TopicColumnsToSort.SIZE}
+ />
+ <TableColumn
+ width="4%"
+ className="topic-action-block"
+ cell={ActionsCell}
+ />
+ </SmartTable>
</div>
)}
</div>
diff --git a/kafka-ui-react-app/src/components/Topics/List/TopicsTableCells.tsx b/kafka-ui-react-app/src/components/Topics/List/TopicsTableCells.tsx
new file mode 100644
index 00000000000..024bf45d735
--- /dev/null
+++ b/kafka-ui-react-app/src/components/Topics/List/TopicsTableCells.tsx
@@ -0,0 +1,59 @@
+import React from 'react';
+import { TopicWithDetailedInfo } from 'redux/interfaces';
+import { TableCellProps } from 'components/common/SmartTable/TableColumn';
+import { Tag } from 'components/common/Tag/Tag.styled';
+import BytesFormatted from 'components/common/BytesFormatted/BytesFormatted';
+
+import * as S from './List.styled';
+
+export const TitleCell: React.FC<
+ TableCellProps<TopicWithDetailedInfo, string>
+> = ({ dataItem: { internal, name } }) => {
+ return (
+ <>
+ {internal && <Tag color="gray">IN</Tag>}
+ <S.Link exact to={`topics/${name}`} $isInternal={internal}>
+ {name}
+ </S.Link>
+ </>
+ );
+};
+
+export const TopicSizeCell: React.FC<
+ TableCellProps<TopicWithDetailedInfo, string>
+> = ({ dataItem: { segmentSize } }) => {
+ return <BytesFormatted value={segmentSize} />;
+};
+
+export const OutOfSyncReplicasCell: React.FC<
+ TableCellProps<TopicWithDetailedInfo, string>
+> = ({ dataItem: { partitions } }) => {
+ const data = React.useMemo(() => {
+ if (partitions === undefined || partitions.length === 0) {
+ return 0;
+ }
+
+ return partitions.reduce((memo, { replicas }) => {
+ const outOfSync = replicas?.filter(({ inSync }) => !inSync);
+ return memo + (outOfSync?.length || 0);
+ }, 0);
+ }, [partitions]);
+
+ return <span>{data}</span>;
+};
+
+export const MessagesCell: React.FC<
+ TableCellProps<TopicWithDetailedInfo, string>
+> = ({ dataItem: { partitions } }) => {
+ const data = React.useMemo(() => {
+ if (partitions === undefined || partitions.length === 0) {
+ return 0;
+ }
+
+ return partitions.reduce((memo, { offsetMax, offsetMin }) => {
+ return memo + (offsetMax - offsetMin);
+ }, 0);
+ }, [partitions]);
+
+ return <span>{data}</span>;
+};
diff --git a/kafka-ui-react-app/src/components/Topics/List/__tests__/List.spec.tsx b/kafka-ui-react-app/src/components/Topics/List/__tests__/List.spec.tsx
index d11b08fa26d..5aacb2543eb 100644
--- a/kafka-ui-react-app/src/components/Topics/List/__tests__/List.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/List/__tests__/List.spec.tsx
@@ -155,7 +155,7 @@ describe('List', () => {
</StaticRouter>
);
const getCheckboxInput = (at: number) =>
- component.find('ListItem').at(at).find('input[type="checkbox"]').at(0);
+ component.find('TableRow').at(at).find('input[type="checkbox"]').at(0);
const getConfirmationModal = () =>
component.find('mock-ConfirmationModal').at(0);
@@ -166,12 +166,12 @@ describe('List', () => {
expect(component.find('.buttons').length).toEqual(0);
// check first item
- getCheckboxInput(0).simulate('change');
+ getCheckboxInput(0).simulate('change', { target: { checked: true } });
expect(getCheckboxInput(0).props().checked).toBeTruthy();
expect(getCheckboxInput(1).props().checked).toBeFalsy();
// check second item
- getCheckboxInput(1).simulate('change');
+ getCheckboxInput(1).simulate('change', { target: { checked: true } });
expect(getCheckboxInput(0).props().checked).toBeTruthy();
expect(getCheckboxInput(1).props().checked).toBeTruthy();
expect(
@@ -179,7 +179,7 @@ describe('List', () => {
).toEqual(1);
// uncheck second item
- getCheckboxInput(1).simulate('change');
+ getCheckboxInput(1).simulate('change', { target: { checked: false } });
expect(getCheckboxInput(0).props().checked).toBeTruthy();
expect(getCheckboxInput(1).props().checked).toBeFalsy();
expect(
@@ -187,7 +187,7 @@ describe('List', () => {
).toEqual(1);
// uncheck first item
- getCheckboxInput(0).simulate('change');
+ getCheckboxInput(0).simulate('change', { target: { checked: false } });
expect(getCheckboxInput(0).props().checked).toBeFalsy();
expect(getCheckboxInput(1).props().checked).toBeFalsy();
expect(
@@ -203,8 +203,8 @@ describe('List', () => {
: 'Are you sure you want to purge messages of selected topics?';
const mockFn =
action === 'deleteTopics' ? mockDeleteTopics : mockClearTopicsMessages;
- getCheckboxInput(0).simulate('change');
- getCheckboxInput(1).simulate('change');
+ getCheckboxInput(0).simulate('change', { target: { checked: true } });
+ getCheckboxInput(1).simulate('change', { target: { checked: true } });
let modal = getConfirmationModal();
expect(modal.prop('isOpen')).toBeFalsy();
component
@@ -240,8 +240,8 @@ describe('List', () => {
});
it('closes ConfirmationModal when clicked on the cancel button', async () => {
- getCheckboxInput(0).simulate('change');
- getCheckboxInput(1).simulate('change');
+ getCheckboxInput(0).simulate('change', { target: { checked: true } });
+ getCheckboxInput(1).simulate('change', { target: { checked: true } });
let modal = getConfirmationModal();
expect(modal.prop('isOpen')).toBeFalsy();
component
diff --git a/kafka-ui-react-app/src/components/common/SmartTable/SmartTable.tsx b/kafka-ui-react-app/src/components/common/SmartTable/SmartTable.tsx
new file mode 100644
index 00000000000..301ee671a36
--- /dev/null
+++ b/kafka-ui-react-app/src/components/common/SmartTable/SmartTable.tsx
@@ -0,0 +1,134 @@
+import React from 'react';
+import Pagination from 'components/common/Pagination/Pagination';
+import { Table } from 'components/common/table/Table/Table.styled';
+import * as S from 'components/common/table/TableHeaderCell/TableHeaderCell.styled';
+import TableHeaderCell from 'components/common/table/TableHeaderCell/TableHeaderCell';
+import { TableState } from 'lib/hooks/useTableState';
+
+import {
+ isColumnElement,
+ SelectCell,
+ TableHeaderCellProps,
+} from './TableColumn';
+import { TableRow } from './TableRow';
+
+interface SmartTableProps<T, TId extends IdType, OT = never> {
+ tableState: TableState<T, TId, OT>;
+ allSelectable?: boolean;
+ selectable?: boolean;
+ className?: string;
+ placeholder?: string;
+ isFullwidth?: boolean;
+ paginated?: boolean;
+ hoverable?: boolean;
+}
+
+export const SmartTable = <T, TId extends IdType, OT = never>({
+ children,
+ tableState,
+ selectable = false,
+ allSelectable = false,
+ placeholder = 'No Data Found',
+ isFullwidth = false,
+ paginated = false,
+ hoverable = false,
+}: React.PropsWithChildren<SmartTableProps<T, TId, OT>>) => {
+ const handleRowSelection = React.useCallback(
+ (row: T, checked: boolean) => {
+ tableState.setRowsSelection([row], checked);
+ },
+ [tableState]
+ );
+
+ const headerRow = React.useMemo(() => {
+ const headerCells = React.Children.map(children, (child) => {
+ if (!isColumnElement<T, TId, OT>(child)) {
+ return child;
+ }
+
+ const { headerCell, title, orderValue } = child.props;
+
+ const HeaderCell = headerCell as
+ | React.FC<TableHeaderCellProps<T, TId, OT>>
+ | undefined;
+
+ return HeaderCell ? (
+ <S.TableHeaderCell>
+ <HeaderCell
+ orderValue={orderValue}
+ orderable={tableState.orderable}
+ tableState={tableState}
+ />
+ </S.TableHeaderCell>
+ ) : (
+ // TODO types will be changed after fixing TableHeaderCell
+ <TableHeaderCell
+ {...(tableState.orderable as never)}
+ orderValue={orderValue as never}
+ title={title}
+ />
+ );
+ });
+ return (
+ <tr>
+ {allSelectable ? (
+ <SelectCell
+ rowIndex={-1}
+ el="th"
+ selectable
+ selected={tableState.selectedCount === tableState.data.length}
+ onChange={tableState.toggleSelection}
+ />
+ ) : (
+ <S.TableHeaderCell />
+ )}
+ {headerCells}
+ </tr>
+ );
+ }, [children, allSelectable, tableState]);
+
+ const bodyRows = React.useMemo(() => {
+ if (tableState.data.length === 0) {
+ const colspan = React.Children.count(children) + +selectable;
+ return (
+ <tr>
+ <td colSpan={colspan}>{placeholder}</td>
+ </tr>
+ );
+ }
+ return tableState.data.map((dataItem, index) => {
+ return (
+ <TableRow
+ key={tableState.idSelector(dataItem)}
+ index={index}
+ hoverable={hoverable}
+ dataItem={dataItem}
+ tableState={tableState}
+ selectable={selectable}
+ onSelectChange={handleRowSelection}
+ >
+ {children}
+ </TableRow>
+ );
+ });
+ }, [
+ children,
+ handleRowSelection,
+ hoverable,
+ placeholder,
+ selectable,
+ tableState,
+ ]);
+
+ return (
+ <>
+ <Table isFullwidth={isFullwidth}>
+ <thead>{headerRow}</thead>
+ <tbody>{bodyRows}</tbody>
+ </Table>
+ {paginated && tableState.totalPages !== undefined && (
+ <Pagination totalPages={tableState.totalPages} />
+ )}
+ </>
+ );
+};
diff --git a/kafka-ui-react-app/src/components/common/SmartTable/TableColumn.tsx b/kafka-ui-react-app/src/components/common/SmartTable/TableColumn.tsx
new file mode 100644
index 00000000000..971aacf7bde
--- /dev/null
+++ b/kafka-ui-react-app/src/components/common/SmartTable/TableColumn.tsx
@@ -0,0 +1,94 @@
+import React from 'react';
+import { TableState } from 'lib/hooks/useTableState';
+import { SortOrder } from 'generated-sources';
+
+export interface OrderableProps<OT> {
+ orderBy: OT | null;
+ sortOrder: SortOrder;
+ handleOrderBy: (orderBy: OT | null) => void;
+}
+
+interface TableCellPropsBase<T, TId extends IdType, OT = never> {
+ tableState: TableState<T, TId, OT>;
+}
+
+export interface TableHeaderCellProps<T, TId extends IdType, OT = never>
+ extends TableCellPropsBase<T, TId, OT> {
+ orderable?: OrderableProps<OT>;
+ orderValue?: OT;
+}
+
+export interface TableCellProps<T, TId extends IdType, OT = never>
+ extends TableCellPropsBase<T, TId, OT> {
+ rowIndex: number;
+ dataItem: T;
+ hovered?: boolean;
+}
+
+interface TableColumnProps<T, TId extends IdType, OT = never> {
+ cell?: React.FC<TableCellProps<T, TId>>;
+ children?: React.ReactElement;
+ headerCell?: React.FC<TableHeaderCellProps<T, TId, OT>>;
+ field?: string;
+ title?: string;
+ width?: string;
+ className?: string;
+ orderValue?: OT;
+}
+
+export const TableColumn = <T, TId extends IdType, OT = never>(
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
+ props: React.PropsWithChildren<TableColumnProps<T, TId, OT>>
+): React.ReactElement => {
+ return <td />;
+};
+
+export function isColumnElement<T, TId extends IdType, OT = never>(
+ element: React.ReactNode
+): element is React.ReactElement<TableColumnProps<T, TId, OT>> {
+ if (!React.isValidElement(element)) {
+ return false;
+ }
+
+ const elementType = (element as React.ReactElement).type;
+ return (
+ elementType === TableColumn ||
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ (elementType as any).originalType === TableColumn
+ );
+}
+
+interface SelectCellProps {
+ selected: boolean;
+ selectable: boolean;
+ el: 'td' | 'th';
+ rowIndex: number;
+ onChange: (checked: boolean) => void;
+}
+
+export const SelectCell: React.FC<SelectCellProps> = ({
+ selected,
+ selectable,
+ rowIndex,
+ onChange,
+ el,
+}) => {
+ const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
+ onChange(e.target.checked);
+ };
+
+ const El = el;
+
+ return (
+ <El>
+ {selectable && (
+ <input
+ data-row={rowIndex}
+ onChange={handleChange}
+ type="checkbox"
+ checked={selected}
+ />
+ )}
+ </El>
+ );
+};
diff --git a/kafka-ui-react-app/src/components/common/SmartTable/TableRow.tsx b/kafka-ui-react-app/src/components/common/SmartTable/TableRow.tsx
new file mode 100644
index 00000000000..14a89797278
--- /dev/null
+++ b/kafka-ui-react-app/src/components/common/SmartTable/TableRow.tsx
@@ -0,0 +1,85 @@
+import React from 'react';
+import { propertyLookup } from 'lib/propertyLookup';
+import { TableState } from 'lib/hooks/useTableState';
+
+import { isColumnElement, SelectCell, TableCellProps } from './TableColumn';
+
+interface TableRowProps<T, TId extends IdType = never, OT = never> {
+ index: number;
+ id?: TId;
+ hoverable?: boolean;
+ tableState: TableState<T, TId, OT>;
+ dataItem: T;
+ selectable: boolean;
+ onSelectChange?: (row: T, checked: boolean) => void;
+}
+
+export const TableRow = <T, TId extends IdType, OT = never>({
+ children,
+ hoverable = false,
+ id,
+ index,
+ dataItem,
+ selectable,
+ tableState,
+ onSelectChange,
+}: React.PropsWithChildren<TableRowProps<T, TId, OT>>): React.ReactElement => {
+ const [hovered, setHovered] = React.useState(false);
+
+ const handleMouseEnter = React.useCallback(() => {
+ setHovered(true);
+ }, []);
+
+ const handleMouseLeave = React.useCallback(() => {
+ setHovered(false);
+ }, []);
+
+ const handleSelectChange = React.useCallback(
+ (checked: boolean) => {
+ onSelectChange?.(dataItem, checked);
+ },
+ [dataItem, onSelectChange]
+ );
+
+ return (
+ <tr
+ tabIndex={index}
+ id={id as string}
+ onMouseEnter={hoverable ? handleMouseEnter : undefined}
+ onMouseLeave={hoverable ? handleMouseLeave : undefined}
+ >
+ {selectable && (
+ <SelectCell
+ rowIndex={index}
+ el="td"
+ selectable={tableState.isRowSelectable(dataItem)}
+ selected={tableState.selectedIds.has(tableState.idSelector(dataItem))}
+ onChange={handleSelectChange}
+ />
+ )}
+ {React.Children.map(children, (child) => {
+ if (!isColumnElement<T, TId>(child)) {
+ return child;
+ }
+ const { cell, field, width, className } = child.props;
+
+ const Cell = cell as React.FC<TableCellProps<T, TId, OT>> | undefined;
+
+ return Cell ? (
+ <td className={className} style={{ width }}>
+ <Cell
+ tableState={tableState}
+ hovered={hovered}
+ rowIndex={index}
+ dataItem={dataItem}
+ />
+ </td>
+ ) : (
+ <td className={className} style={{ width }}>
+ {field && propertyLookup(field, dataItem)}
+ </td>
+ );
+ })}
+ </tr>
+ );
+};
diff --git a/kafka-ui-react-app/src/custom.d.ts b/kafka-ui-react-app/src/custom.d.ts
index 990f04c63a8..9c2d0f2d6ea 100644
--- a/kafka-ui-react-app/src/custom.d.ts
+++ b/kafka-ui-react-app/src/custom.d.ts
@@ -1,1 +1,2 @@
type Dictionary<T> = Record<string, T>;
+type IdType = string | number;
diff --git a/kafka-ui-react-app/src/lib/__test__/propertyLookup.spec.ts b/kafka-ui-react-app/src/lib/__test__/propertyLookup.spec.ts
new file mode 100644
index 00000000000..45f89b0a08f
--- /dev/null
+++ b/kafka-ui-react-app/src/lib/__test__/propertyLookup.spec.ts
@@ -0,0 +1,18 @@
+import { propertyLookup } from 'lib/propertyLookup';
+
+describe('Property Lookup', () => {
+ const entityObject = {
+ prop: {
+ nestedProp: 1,
+ },
+ };
+ it('returns undefined if property not found', () => {
+ expect(
+ propertyLookup('prop.nonExistingProp', entityObject)
+ ).toBeUndefined();
+ });
+
+ it('returns value of nested property if it exists', () => {
+ expect(propertyLookup('prop.nestedProp', entityObject)).toBe(1);
+ });
+});
diff --git a/kafka-ui-react-app/src/lib/hooks/useTableState.ts b/kafka-ui-react-app/src/lib/hooks/useTableState.ts
new file mode 100644
index 00000000000..b5fa6ed79c1
--- /dev/null
+++ b/kafka-ui-react-app/src/lib/hooks/useTableState.ts
@@ -0,0 +1,78 @@
+import React, { useCallback } from 'react';
+import { OrderableProps } from 'components/common/SmartTable/TableColumn';
+
+export interface TableState<T, TId extends IdType, OT = never> {
+ data: T[];
+ selectedIds: Set<TId>;
+ totalPages?: number;
+ idSelector: (row: T) => TId;
+ isRowSelectable: (row: T) => boolean;
+ selectedCount: number;
+ setRowsSelection: (rows: T[], selected: boolean) => void;
+ toggleSelection: (selected: boolean) => void;
+ orderable?: OrderableProps<OT>;
+}
+
+export const useTableState = <T, TId extends IdType, OT = never>(
+ data: T[],
+ options: {
+ totalPages: number;
+ isRowSelectable?: (row: T) => boolean;
+ idSelector: (row: T) => TId;
+ },
+ orderable?: OrderableProps<OT>
+): TableState<T, TId, OT> => {
+ const [selectedIds, setSelectedIds] = React.useState(new Set<TId>());
+
+ const { idSelector, totalPages, isRowSelectable = () => true } = options;
+
+ const selectedCount = selectedIds.size;
+
+ const setRowsSelection = useCallback(
+ (rows: T[], selected: boolean) => {
+ rows.forEach((row) => {
+ const id = idSelector(row);
+ const newSet = new Set(selectedIds);
+ if (selected) {
+ newSet.add(id);
+ } else {
+ newSet.delete(id);
+ }
+ setSelectedIds(newSet);
+ });
+ },
+ [idSelector, selectedIds]
+ );
+
+ const toggleSelection = useCallback(
+ (selected: boolean) => {
+ const newSet = new Set(selected ? data.map((r) => idSelector(r)) : []);
+ setSelectedIds(newSet);
+ },
+ [data, idSelector]
+ );
+
+ return React.useMemo<TableState<T, TId, OT>>(() => {
+ return {
+ data,
+ totalPages,
+ selectedIds,
+ orderable,
+ selectedCount,
+ idSelector,
+ isRowSelectable,
+ setRowsSelection,
+ toggleSelection,
+ };
+ }, [
+ data,
+ orderable,
+ selectedIds,
+ totalPages,
+ selectedCount,
+ idSelector,
+ isRowSelectable,
+ setRowsSelection,
+ toggleSelection,
+ ]);
+};
diff --git a/kafka-ui-react-app/src/lib/propertyLookup.ts b/kafka-ui-react-app/src/lib/propertyLookup.ts
new file mode 100644
index 00000000000..6a563ca623d
--- /dev/null
+++ b/kafka-ui-react-app/src/lib/propertyLookup.ts
@@ -0,0 +1,9 @@
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+export function propertyLookup<T extends { [key: string]: any }>(
+ path: string,
+ obj: T
+) {
+ return path.split('.').reduce((prev, curr) => {
+ return prev ? prev[curr] : null;
+ }, obj);
+}
| null | train | train | 2022-03-16T10:17:18 | "2022-03-04T21:32:43Z" | sasunprov | train |
provectus/kafka-ui/1674_1708 | provectus/kafka-ui | provectus/kafka-ui/1674 | provectus/kafka-ui/1708 | [
"connected",
"timestamp(timedelta=0.0, similarity=0.9999999999999998)"
] | 11c6ce25ffcb72f9d34be8ee7f7e516411da4cce | f7e7bc0e38271c8cd21ac0d6108686ed6535be70 | [] | [] | "2022-03-07T09:20:23Z" | [
"type/enhancement",
"scope/frontend",
"type/chore"
] | Update frontend to reflect design changes | - color palette
- elements colors | [
"kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/__snapshots__/Actions.spec.tsx.snap",
"kafka-ui-react-app/src/components/Connect/Details/__tests__/__snapshots__/Details.spec.tsx.snap",
"kafka-ui-react-app/src/components/Connect/List/__tests__/__snapshots__/ListItem.spec.tsx.snap",
"kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts",
"kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/__snapshots__/Details.spec.tsx.snap",
"kafka-ui-react-app/src/components/common/Icons/MessageToggleIcon.tsx",
"kafka-ui-react-app/src/theme/theme.ts"
] | [
"kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/__snapshots__/Actions.spec.tsx.snap",
"kafka-ui-react-app/src/components/Connect/Details/__tests__/__snapshots__/Details.spec.tsx.snap",
"kafka-ui-react-app/src/components/Connect/List/__tests__/__snapshots__/ListItem.spec.tsx.snap",
"kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts",
"kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/__snapshots__/Details.spec.tsx.snap",
"kafka-ui-react-app/src/components/common/Icons/MessageToggleIcon.styled.ts",
"kafka-ui-react-app/src/components/common/Icons/MessageToggleIcon.tsx",
"kafka-ui-react-app/src/theme/theme.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/__snapshots__/Actions.spec.tsx.snap b/kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/__snapshots__/Actions.spec.tsx.snap
index 14b0ba8d8c3..fa7c98dc990 100644
--- a/kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/__snapshots__/Actions.spec.tsx.snap
+++ b/kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/__snapshots__/Actions.spec.tsx.snap
@@ -21,22 +21,22 @@ exports[`Actions view matches snapshot 1`] = `
border: none;
border-radius: 4px;
white-space: nowrap;
- background: #4F4FFF;
- color: #FFFFFF;
+ background: #E8E8FC;
+ color: #171A1C;
font-size: 14px;
font-weight: 500;
height: 32px;
}
.c1:hover:enabled {
- background: #1717CF;
- color: #FFFFFF;
+ background: #D1D1FA;
+ color: #171A1C;
cursor: pointer;
}
.c1:active:enabled {
- background: #1414B8;
- color: #FFFFFF;
+ background: #A3A3F5;
+ color: #171A1C;
}
.c1:disabled {
@@ -45,7 +45,7 @@ exports[`Actions view matches snapshot 1`] = `
}
.c1 a {
- color: #FFFFFF;
+ color: #171A1C;
}
.c1 i {
@@ -96,7 +96,7 @@ exports[`Actions view matches snapshot 1`] = `
}
.c2 a {
- color: #FFFFFF;
+ color: #171A1C;
}
.c2 i {
@@ -214,22 +214,22 @@ exports[`Actions view matches snapshot when deleting connector 1`] = `
border: none;
border-radius: 4px;
white-space: nowrap;
- background: #4F4FFF;
- color: #FFFFFF;
+ background: #E8E8FC;
+ color: #171A1C;
font-size: 14px;
font-weight: 500;
height: 32px;
}
.c1:hover:enabled {
- background: #1717CF;
- color: #FFFFFF;
+ background: #D1D1FA;
+ color: #171A1C;
cursor: pointer;
}
.c1:active:enabled {
- background: #1414B8;
- color: #FFFFFF;
+ background: #A3A3F5;
+ color: #171A1C;
}
.c1:disabled {
@@ -238,7 +238,7 @@ exports[`Actions view matches snapshot when deleting connector 1`] = `
}
.c1 a {
- color: #FFFFFF;
+ color: #171A1C;
}
.c1 i {
@@ -289,7 +289,7 @@ exports[`Actions view matches snapshot when deleting connector 1`] = `
}
.c2 a {
- color: #FFFFFF;
+ color: #171A1C;
}
.c2 i {
@@ -407,22 +407,22 @@ exports[`Actions view matches snapshot when failed 1`] = `
border: none;
border-radius: 4px;
white-space: nowrap;
- background: #4F4FFF;
- color: #FFFFFF;
+ background: #E8E8FC;
+ color: #171A1C;
font-size: 14px;
font-weight: 500;
height: 32px;
}
.c1:hover:enabled {
- background: #1717CF;
- color: #FFFFFF;
+ background: #D1D1FA;
+ color: #171A1C;
cursor: pointer;
}
.c1:active:enabled {
- background: #1414B8;
- color: #FFFFFF;
+ background: #A3A3F5;
+ color: #171A1C;
}
.c1:disabled {
@@ -431,7 +431,7 @@ exports[`Actions view matches snapshot when failed 1`] = `
}
.c1 a {
- color: #FFFFFF;
+ color: #171A1C;
}
.c1 i {
@@ -482,7 +482,7 @@ exports[`Actions view matches snapshot when failed 1`] = `
}
.c2 a {
- color: #FFFFFF;
+ color: #171A1C;
}
.c2 i {
@@ -585,22 +585,22 @@ exports[`Actions view matches snapshot when paused 1`] = `
border: none;
border-radius: 4px;
white-space: nowrap;
- background: #4F4FFF;
- color: #FFFFFF;
+ background: #E8E8FC;
+ color: #171A1C;
font-size: 14px;
font-weight: 500;
height: 32px;
}
.c1:hover:enabled {
- background: #1717CF;
- color: #FFFFFF;
+ background: #D1D1FA;
+ color: #171A1C;
cursor: pointer;
}
.c1:active:enabled {
- background: #1414B8;
- color: #FFFFFF;
+ background: #A3A3F5;
+ color: #171A1C;
}
.c1:disabled {
@@ -609,7 +609,7 @@ exports[`Actions view matches snapshot when paused 1`] = `
}
.c1 a {
- color: #FFFFFF;
+ color: #171A1C;
}
.c1 i {
@@ -660,7 +660,7 @@ exports[`Actions view matches snapshot when paused 1`] = `
}
.c2 a {
- color: #FFFFFF;
+ color: #171A1C;
}
.c2 i {
@@ -778,22 +778,22 @@ exports[`Actions view matches snapshot when running connector action 1`] = `
border: none;
border-radius: 4px;
white-space: nowrap;
- background: #4F4FFF;
- color: #FFFFFF;
+ background: #E8E8FC;
+ color: #171A1C;
font-size: 14px;
font-weight: 500;
height: 32px;
}
.c1:hover:enabled {
- background: #1717CF;
- color: #FFFFFF;
+ background: #D1D1FA;
+ color: #171A1C;
cursor: pointer;
}
.c1:active:enabled {
- background: #1414B8;
- color: #FFFFFF;
+ background: #A3A3F5;
+ color: #171A1C;
}
.c1:disabled {
@@ -802,7 +802,7 @@ exports[`Actions view matches snapshot when running connector action 1`] = `
}
.c1 a {
- color: #FFFFFF;
+ color: #171A1C;
}
.c1 i {
@@ -853,7 +853,7 @@ exports[`Actions view matches snapshot when running connector action 1`] = `
}
.c2 a {
- color: #FFFFFF;
+ color: #171A1C;
}
.c2 i {
@@ -971,22 +971,22 @@ exports[`Actions view matches snapshot when unassigned 1`] = `
border: none;
border-radius: 4px;
white-space: nowrap;
- background: #4F4FFF;
- color: #FFFFFF;
+ background: #E8E8FC;
+ color: #171A1C;
font-size: 14px;
font-weight: 500;
height: 32px;
}
.c1:hover:enabled {
- background: #1717CF;
- color: #FFFFFF;
+ background: #D1D1FA;
+ color: #171A1C;
cursor: pointer;
}
.c1:active:enabled {
- background: #1414B8;
- color: #FFFFFF;
+ background: #A3A3F5;
+ color: #171A1C;
}
.c1:disabled {
@@ -995,7 +995,7 @@ exports[`Actions view matches snapshot when unassigned 1`] = `
}
.c1 a {
- color: #FFFFFF;
+ color: #171A1C;
}
.c1 i {
@@ -1046,7 +1046,7 @@ exports[`Actions view matches snapshot when unassigned 1`] = `
}
.c2 a {
- color: #FFFFFF;
+ color: #171A1C;
}
.c2 i {
diff --git a/kafka-ui-react-app/src/components/Connect/Details/__tests__/__snapshots__/Details.spec.tsx.snap b/kafka-ui-react-app/src/components/Connect/Details/__tests__/__snapshots__/Details.spec.tsx.snap
index b073bf54ac4..4787b68be34 100644
--- a/kafka-ui-react-app/src/components/Connect/Details/__tests__/__snapshots__/Details.spec.tsx.snap
+++ b/kafka-ui-react-app/src/components/Connect/Details/__tests__/__snapshots__/Details.spec.tsx.snap
@@ -31,7 +31,7 @@ exports[`Details view matches snapshot 1`] = `
}
.c1 a.is-active {
- border-bottom: 1px #4F4FFF solid;
+ border-bottom: 1px #4C4CFF solid;
color: #171A1C;
}
diff --git a/kafka-ui-react-app/src/components/Connect/List/__tests__/__snapshots__/ListItem.spec.tsx.snap b/kafka-ui-react-app/src/components/Connect/List/__tests__/__snapshots__/ListItem.spec.tsx.snap
index 683f1e9cc1d..f6a89e6bab5 100644
--- a/kafka-ui-react-app/src/components/Connect/List/__tests__/__snapshots__/ListItem.spec.tsx.snap
+++ b/kafka-ui-react-app/src/components/Connect/List/__tests__/__snapshots__/ListItem.spec.tsx.snap
@@ -99,6 +99,20 @@ exports[`Connectors ListItem matches snapshot 1`] = `
"hover": "#454F54",
"normal": "#73848C",
},
+ "danger": Object {
+ "backgroundColor": Object {
+ "active": "#B81414",
+ "disabled": "#F5A3A3",
+ "hover": "#CF1717",
+ "normal": "#E51A1A",
+ },
+ "color": "#171A1C",
+ "invertedColors": Object {
+ "active": "#1717CF",
+ "hover": "#1717CF",
+ "normal": "#4C4CFF",
+ },
+ },
"fontSize": Object {
"L": "16px",
"M": "14px",
@@ -111,15 +125,16 @@ exports[`Connectors ListItem matches snapshot 1`] = `
},
"primary": Object {
"backgroundColor": Object {
- "active": "#1414B8",
- "hover": "#1717CF",
- "normal": "#4F4FFF",
+ "active": "#A3A3F5",
+ "disabled": "#F1F2F3",
+ "hover": "#D1D1FA",
+ "normal": "#E8E8FC",
},
- "color": "#FFFFFF",
+ "color": "#171A1C",
"invertedColors": Object {
- "active": "#1414B8",
+ "active": "#1717CF",
"hover": "#1717CF",
- "normal": "#4F4FFF",
+ "normal": "#4C4CFF",
},
},
"secondary": Object {
@@ -173,8 +188,11 @@ exports[`Connectors ListItem matches snapshot 1`] = `
"circleBig": "#FAD1D1",
"circleSmall": "#E51A1A",
},
- "messageToggleIconClosed": "#ABB5BA",
- "messageToggleIconOpened": "#171A1C",
+ "messageToggleIcon": Object {
+ "active": "#1717CF",
+ "hover": "#A3A3F5",
+ "normal": "#4C4CFF",
+ },
"verticalElipsisIcon": "#73848C",
"warningIcon": "#FFDD57",
},
@@ -216,14 +234,15 @@ exports[`Connectors ListItem matches snapshot 1`] = `
},
"menu": Object {
"backgroundColor": Object {
- "active": "#E3E6E8",
- "hover": "#F1F2F3",
+ "active": "#F1F2F3",
+ "hover": "#F9FAFA",
"normal": "#FFFFFF",
},
"chevronIconColor": "#73848C",
"color": Object {
- "active": "#171A1C",
- "hover": "#73848C",
+ "active": "#1414B8",
+ "hover": "#454F54",
+ "isOpen": "#171A1C",
"normal": "#73848C",
},
"statusIconColor": Object {
@@ -257,7 +276,7 @@ exports[`Connectors ListItem matches snapshot 1`] = `
},
"pageLoader": Object {
"borderBottomColor": "#FFFFFF",
- "borderColor": "#4F4FFF",
+ "borderColor": "#4C4CFF",
},
"pagination": Object {
"backgroundColor": "#FFFFFF",
@@ -278,7 +297,7 @@ exports[`Connectors ListItem matches snapshot 1`] = `
"panelColor": "#FFFFFF",
"primaryTab": Object {
"borderColor": Object {
- "active": "#4F4FFF",
+ "active": "#4C4CFF",
"hover": "transparent",
"nav": "#E3E6E8",
"normal": "transparent",
@@ -342,9 +361,10 @@ exports[`Connectors ListItem matches snapshot 1`] = `
},
},
"switch": Object {
- "checked": "#29A352",
+ "checked": "#4C4CFF",
"circle": "#FFFFFF",
- "unchecked": "#ABB5BA",
+ "disabled": "#E3E6E8",
+ "unchecked": "#A3A3F5",
},
"table": Object {
"link": Object {
@@ -362,12 +382,12 @@ exports[`Connectors ListItem matches snapshot 1`] = `
"normal": "#FFFFFF",
},
"color": Object {
- "active": "#4F4FFF",
- "hover": "#4F4FFF",
+ "active": "#4C4CFF",
+ "hover": "#4C4CFF",
"normal": "#73848C",
},
"previewColor": Object {
- "normal": "#4F4FFF",
+ "normal": "#4C4CFF",
},
},
"tr": Object {
@@ -440,7 +460,7 @@ exports[`Connectors ListItem matches snapshot 1`] = `
},
},
"viewer": Object {
- "wrapper": "#f9fafa",
+ "wrapper": "#F9FAFA",
},
}
}
diff --git a/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts b/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts
index 082cca51233..a01434b91aa 100644
--- a/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts
+++ b/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts
@@ -1,8 +1,10 @@
import styled, { css } from 'styled-components';
import { ServerStatus } from 'generated-sources';
-export const Wrapper = styled.li.attrs({ role: 'menuitem' })(
- ({ theme }) => css`
+export const Wrapper = styled.li.attrs({ role: 'menuitem' })<{
+ isOpen: boolean;
+}>(
+ ({ theme, isOpen }) => css`
font-size: 14px;
font-weight: 500;
user-select: none;
@@ -18,7 +20,7 @@ export const Wrapper = styled.li.attrs({ role: 'menuitem' })(
margin: 0;
line-height: 20px;
align-items: center;
- color: ${theme.menu.color.normal};
+ color: ${isOpen ? theme.menu.color.isOpen : theme.menu.color.normal};
background-color: ${theme.menu.backgroundColor.normal};
&:hover {
diff --git a/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.tsx b/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.tsx
index 98cded2ae65..2e6309d4eaf 100644
--- a/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.tsx
+++ b/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.tsx
@@ -16,7 +16,7 @@ const ClusterTab: React.FC<ClusterTabProps> = ({
isOpen,
toggleClusterMenu,
}) => (
- <S.Wrapper onClick={toggleClusterMenu}>
+ <S.Wrapper onClick={toggleClusterMenu} isOpen>
<S.Title title={title}>{title}</S.Title>
<S.StatusIconWrapper>
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/__snapshots__/Details.spec.tsx.snap b/kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/__snapshots__/Details.spec.tsx.snap
index 96cc3d9faee..7a17d87086e 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/__snapshots__/Details.spec.tsx.snap
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/__snapshots__/Details.spec.tsx.snap
@@ -63,7 +63,7 @@ exports[`Details when it has readonly flag does not render the Action button a T
}
.c2 a.is-active {
- border-bottom: 1px #4F4FFF solid;
+ border-bottom: 1px #4C4CFF solid;
color: #171A1C;
}
diff --git a/kafka-ui-react-app/src/components/common/Icons/MessageToggleIcon.styled.ts b/kafka-ui-react-app/src/components/common/Icons/MessageToggleIcon.styled.ts
new file mode 100644
index 00000000000..d779c86fd78
--- /dev/null
+++ b/kafka-ui-react-app/src/components/common/Icons/MessageToggleIcon.styled.ts
@@ -0,0 +1,10 @@
+import styled from 'styled-components';
+
+export const Svg = styled.svg`
+ & > path {
+ fill: ${({ theme }) => theme.icons.messageToggleIcon.normal};
+ &:hover {
+ fill: ${({ theme }) => theme.icons.messageToggleIcon.hover};
+ }
+ }
+`;
diff --git a/kafka-ui-react-app/src/components/common/Icons/MessageToggleIcon.tsx b/kafka-ui-react-app/src/components/common/Icons/MessageToggleIcon.tsx
index e49f6dbfc78..a71d868719b 100644
--- a/kafka-ui-react-app/src/components/common/Icons/MessageToggleIcon.tsx
+++ b/kafka-ui-react-app/src/components/common/Icons/MessageToggleIcon.tsx
@@ -1,14 +1,14 @@
import React from 'react';
-import { useTheme } from 'styled-components';
+import * as S from 'components/common/Icons/MessageToggleIcon.styled';
interface Props {
isOpen: boolean;
}
+
const MessageToggleIcon: React.FC<Props> = ({ isOpen }) => {
- const theme = useTheme();
if (isOpen) {
return (
- <svg
+ <S.Svg
width="16"
height="16"
viewBox="0 0 16 16"
@@ -19,13 +19,12 @@ const MessageToggleIcon: React.FC<Props> = ({ isOpen }) => {
fillRule="evenodd"
clipRule="evenodd"
d="M14 16C15.1046 16 16 15.1046 16 14L16 2C16 0.895431 15.1046 -7.8281e-08 14 -1.74846e-07L2 -1.22392e-06C0.895432 -1.32048e-06 1.32048e-06 0.895429 1.22392e-06 2L1.74846e-07 14C7.8281e-08 15.1046 0.895431 16 2 16L14 16ZM5 7C4.44772 7 4 7.44771 4 8C4 8.55228 4.44772 9 5 9L11 9C11.5523 9 12 8.55228 12 8C12 7.44772 11.5523 7 11 7L5 7Z"
- fill={theme.icons.messageToggleIconOpened}
/>
- </svg>
+ </S.Svg>
);
}
return (
- <svg
+ <S.Svg
width="16"
height="16"
viewBox="0 0 16 16"
@@ -36,9 +35,8 @@ const MessageToggleIcon: React.FC<Props> = ({ isOpen }) => {
fillRule="evenodd"
clipRule="evenodd"
d="M0 2C0 0.895431 0.895431 0 2 0H14C15.1046 0 16 0.895431 16 2V14C16 15.1046 15.1046 16 14 16H2C0.895431 16 0 15.1046 0 14V2ZM8 4C8.55229 4 9 4.44772 9 5V7H11C11.5523 7 12 7.44772 12 8C12 8.55229 11.5523 9 11 9H9V11C9 11.5523 8.55229 12 8 12C7.44772 12 7 11.5523 7 11V9H5C4.44772 9 4 8.55228 4 8C4 7.44771 4.44772 7 5 7H7V5C7 4.44772 7.44772 4 8 4Z"
- fill={theme.icons.messageToggleIconClosed}
/>
- </svg>
+ </S.Svg>
);
};
diff --git a/kafka-ui-react-app/src/theme/theme.ts b/kafka-ui-react-app/src/theme/theme.ts
index 8d690a11233..eaf76ec9530 100644
--- a/kafka-ui-react-app/src/theme/theme.ts
+++ b/kafka-ui-react-app/src/theme/theme.ts
@@ -2,7 +2,7 @@
export const Colors = {
neutral: {
'0': '#FFFFFF',
- '3': '#f9fafa',
+ '3': '#F9FAFA',
'5': '#F1F2F3',
'10': '#E3E6E8',
'15': '#D5DADD',
@@ -28,14 +28,19 @@ export const Colors = {
'60': '#29A352',
},
brand: {
+ '5': '#E8E8FC',
+ '10': '#D1D1FA',
'20': '#A3A3F5',
- '50': '#4F4FFF',
- '55': '#1717CF',
- '60': '#1414B8',
+ '50': '#4C4CFF',
+ '60': '#1717CF',
+ '70': '#1414B8',
},
red: {
'10': '#FAD1D1',
+ '20': '#F5A3A3',
'50': '#E51A1A',
+ '55': '#CF1717',
+ '60': '#B81414',
},
yellow: {
'10': '#FFEECC',
@@ -95,14 +100,15 @@ const theme = {
button: {
primary: {
backgroundColor: {
- normal: Colors.brand[50],
- hover: Colors.brand[55],
- active: Colors.brand[60],
+ normal: Colors.brand[5],
+ hover: Colors.brand[10],
+ active: Colors.brand[20],
+ disabled: Colors.neutral[5],
},
- color: Colors.neutral[0],
+ color: Colors.neutral[90],
invertedColors: {
normal: Colors.brand[50],
- hover: Colors.brand[55],
+ hover: Colors.brand[60],
active: Colors.brand[60],
},
},
@@ -119,6 +125,20 @@ const theme = {
active: Colors.neutral[90],
},
},
+ danger: {
+ backgroundColor: {
+ normal: Colors.red[50],
+ hover: Colors.red[55],
+ active: Colors.red[60],
+ disabled: Colors.red[20],
+ },
+ color: Colors.neutral[90],
+ invertedColors: {
+ normal: Colors.brand[50],
+ hover: Colors.brand[60],
+ active: Colors.brand[60],
+ },
+ },
height: {
S: '24px',
M: '32px',
@@ -138,13 +158,14 @@ const theme = {
menu: {
backgroundColor: {
normal: Colors.neutral[0],
- hover: Colors.neutral[5],
- active: Colors.neutral[10],
+ hover: Colors.neutral[3],
+ active: Colors.neutral[5],
},
color: {
normal: Colors.neutral[50],
- hover: Colors.neutral[50],
- active: Colors.neutral[90],
+ hover: Colors.neutral[70],
+ active: Colors.brand[70],
+ isOpen: Colors.neutral[90],
},
statusIconColor: {
online: Colors.green[40],
@@ -330,9 +351,10 @@ const theme = {
},
},
switch: {
- unchecked: Colors.neutral[30],
- checked: Colors.green[60],
+ unchecked: Colors.brand[20],
+ checked: Colors.brand[50],
circle: Colors.neutral[0],
+ disabled: Colors.neutral[10],
},
pageLoader: {
borderColor: Colors.brand[50],
@@ -398,8 +420,11 @@ const theme = {
icons: {
closeIcon: Colors.neutral[30],
warningIcon: Colors.yellow[20],
- messageToggleIconOpened: Colors.neutral[90],
- messageToggleIconClosed: Colors.neutral[30],
+ messageToggleIcon: {
+ normal: Colors.brand[50],
+ hover: Colors.brand[20],
+ active: Colors.brand[60],
+ },
verticalElipsisIcon: Colors.neutral[50],
liveIcon: {
circleBig: Colors.red[10],
| null | val | train | 2022-03-08T18:23:12 | "2022-02-24T13:48:01Z" | Haarolean | train |
provectus/kafka-ui/1444_1717 | provectus/kafka-ui | provectus/kafka-ui/1444 | provectus/kafka-ui/1717 | [
"timestamp(timedelta=0.0, similarity=0.8643925267685788)",
"connected"
] | 23292a85208efc71ef81b16b05cfac5e5abe0d47 | 09b29ded048505d83c1f650fbdf3aff056bce97d | [
"@5hin0bi we currently only restart **connector instance**, not tasks on this button click. I will change this to restart both connector and all its tasks. I think we will also need to rename this button to smth like \"Restart connector\". \r\ncc @Haarolean ",
"@5hin0bi can you please verify it works, and reopen issue if not",
"Checked on our dev environment. The button is now called \"Restart Connector\", but failed tasks themselves are not restarted.",
"To do: create 3 buttons",
"Need to implement frontend",
"I'm seeing a similar error with KafkaConnect where it's trying to hit an api endpoint:\r\n```500 Server Error for HTTP GET \"/api/clusters/local/connectors?search=\"```\r\nthat also doesn't seem to exist, per Confluent's API. ",
"> I'm seeing a similar error with KafkaConnect where it's trying to hit an api endpoint: `500 Server Error for HTTP GET \"/api/clusters/local/connectors?search=\"` that also doesn't seem to exist, per Confluent's API.\r\n\r\nThat's our backend with our API, not confluent's. Please raise a new issue."
] | [
"I think since we have multiple dispatches here we can batch those , with the new redux Api we actually have this feature to decrease re-rendering",
"π "
] | "2022-03-10T13:13:31Z" | [
"type/enhancement",
"scope/backend",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Connector "Restart All Tasks" button has no effect | When choosing a specific connector there are several options you can choose:
<img width="1083" alt="image" src="https://user-images.githubusercontent.com/94184844/150494050-67a4692f-2133-4c78-94e3-c74857b65057.png">
Restart all tasks sends the next POST request that actually does do nothing.
https://xxx/api/clusters/local/connects/local/connectors/reddit-source-json/action/RESTART
According to the REST API documentation https://docs.confluent.io/platform/current/connect/references/restapi.html there is no such request available. And the correct one is this:
<img width="904" alt="image" src="https://user-images.githubusercontent.com/94184844/150494299-2cffab5d-abb7-4e05-af35-f3af1a57a050.png">
Restarting the specific task using the triple dot context menu works great tho. | [
"kafka-ui-react-app/src/components/Connect/Details/Actions/Actions.tsx",
"kafka-ui-react-app/src/components/Connect/Details/Actions/ActionsContainer.ts",
"kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/Actions.spec.tsx",
"kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/__snapshots__/Actions.spec.tsx.snap",
"kafka-ui-react-app/src/redux/actions/__test__/thunks/connectors.spec.ts",
"kafka-ui-react-app/src/redux/actions/actions.ts",
"kafka-ui-react-app/src/redux/actions/thunks/connectors.ts"
] | [
"kafka-ui-react-app/src/components/Connect/Details/Actions/Actions.tsx",
"kafka-ui-react-app/src/components/Connect/Details/Actions/ActionsContainer.ts",
"kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/Actions.spec.tsx",
"kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/__snapshots__/Actions.spec.tsx.snap",
"kafka-ui-react-app/src/redux/actions/__test__/thunks/connectors.spec.ts",
"kafka-ui-react-app/src/redux/actions/actions.ts",
"kafka-ui-react-app/src/redux/actions/thunks/connectors.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/Connect/Details/Actions/Actions.tsx b/kafka-ui-react-app/src/components/Connect/Details/Actions/Actions.tsx
index ab19d773ae0..9fe477ca134 100644
--- a/kafka-ui-react-app/src/components/Connect/Details/Actions/Actions.tsx
+++ b/kafka-ui-react-app/src/components/Connect/Details/Actions/Actions.tsx
@@ -1,6 +1,6 @@
import React from 'react';
import { useHistory, useParams } from 'react-router-dom';
-import { ConnectorState } from 'generated-sources';
+import { ConnectorState, ConnectorAction } from 'generated-sources';
import { ClusterName, ConnectName, ConnectorName } from 'redux/interfaces';
import {
clusterConnectConnectorEditPath,
@@ -34,6 +34,12 @@ export interface ActionsProps {
connectName: ConnectName,
connectorName: ConnectorName
): void;
+ restartTasks(
+ clusterName: ClusterName,
+ connectName: ConnectName,
+ connectorName: ConnectorName,
+ action: ConnectorAction
+ ): void;
pauseConnector(
clusterName: ClusterName,
connectName: ConnectName,
@@ -52,11 +58,13 @@ const Actions: React.FC<ActionsProps> = ({
isConnectorDeleting,
connectorStatus,
restartConnector,
+ restartTasks,
pauseConnector,
resumeConnector,
isConnectorActionRunning,
}) => {
const { clusterName, connectName, connectorName } = useParams<RouterParams>();
+
const history = useHistory();
const [
isDeleteConnectorConfirmationVisible,
@@ -76,6 +84,13 @@ const Actions: React.FC<ActionsProps> = ({
restartConnector(clusterName, connectName, connectorName);
}, [restartConnector, clusterName, connectName, connectorName]);
+ const restartTasksHandler = React.useCallback(
+ (actionType) => {
+ restartTasks(clusterName, connectName, connectorName, actionType);
+ },
+ [restartTasks, clusterName, connectName, connectorName]
+ );
+
const pauseConnectorHandler = React.useCallback(() => {
pauseConnector(clusterName, connectName, connectorName);
}, [pauseConnector, clusterName, connectName, connectorName]);
@@ -128,6 +143,32 @@ const Actions: React.FC<ActionsProps> = ({
</span>
<span>Restart Connector</span>
</Button>
+ <Button
+ buttonSize="M"
+ buttonType="primary"
+ type="button"
+ onClick={() => restartTasksHandler(ConnectorAction.RESTART_ALL_TASKS)}
+ disabled={isConnectorActionRunning}
+ >
+ <span>
+ <i className="fas fa-sync-alt" />
+ </span>
+ <span>Restart All Tasks</span>
+ </Button>
+ <Button
+ buttonSize="M"
+ buttonType="primary"
+ type="button"
+ onClick={() =>
+ restartTasksHandler(ConnectorAction.RESTART_FAILED_TASKS)
+ }
+ disabled={isConnectorActionRunning}
+ >
+ <span>
+ <i className="fas fa-sync-alt" />
+ </span>
+ <span>Restart Failed Tasks</span>
+ </Button>
<Button
buttonSize="M"
buttonType="primary"
diff --git a/kafka-ui-react-app/src/components/Connect/Details/Actions/ActionsContainer.ts b/kafka-ui-react-app/src/components/Connect/Details/Actions/ActionsContainer.ts
index d69de08642b..059a0c32215 100644
--- a/kafka-ui-react-app/src/components/Connect/Details/Actions/ActionsContainer.ts
+++ b/kafka-ui-react-app/src/components/Connect/Details/Actions/ActionsContainer.ts
@@ -4,6 +4,7 @@ import { RootState } from 'redux/interfaces';
import {
deleteConnector,
restartConnector,
+ restartTasks,
pauseConnector,
resumeConnector,
} from 'redux/actions';
@@ -24,6 +25,7 @@ const mapStateToProps = (state: RootState) => ({
const mapDispatchToProps = {
deleteConnector,
restartConnector,
+ restartTasks,
pauseConnector,
resumeConnector,
};
diff --git a/kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/Actions.spec.tsx b/kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/Actions.spec.tsx
index 509bc5606c3..d1aec604d4a 100644
--- a/kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/Actions.spec.tsx
+++ b/kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/Actions.spec.tsx
@@ -50,6 +50,7 @@ describe('Actions', () => {
isConnectorDeleting={false}
connectorStatus={ConnectorState.RUNNING}
restartConnector={jest.fn()}
+ restartTasks={jest.fn()}
pauseConnector={jest.fn()}
resumeConnector={jest.fn()}
isConnectorActionRunning={false}
diff --git a/kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/__snapshots__/Actions.spec.tsx.snap b/kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/__snapshots__/Actions.spec.tsx.snap
index 2d1cd9580c4..ca3f1d6b2b2 100644
--- a/kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/__snapshots__/Actions.spec.tsx.snap
+++ b/kafka-ui-react-app/src/components/Connect/Details/Actions/__tests__/__snapshots__/Actions.spec.tsx.snap
@@ -144,6 +144,36 @@ exports[`Actions view matches snapshot 1`] = `
Restart Connector
</span>
</button>
+ <button
+ className="c1"
+ disabled={false}
+ onClick={[Function]}
+ type="button"
+ >
+ <span>
+ <i
+ className="fas fa-sync-alt"
+ />
+ </span>
+ <span>
+ Restart All Tasks
+ </span>
+ </button>
+ <button
+ className="c1"
+ disabled={false}
+ onClick={[Function]}
+ type="button"
+ >
+ <span>
+ <i
+ className="fas fa-sync-alt"
+ />
+ </span>
+ <span>
+ Restart Failed Tasks
+ </span>
+ </button>
<a
href="/ui/clusters/my-cluster/connects/my-connect/connectors/my-connector/edit"
onClick={[Function]}
@@ -337,6 +367,36 @@ exports[`Actions view matches snapshot when deleting connector 1`] = `
Restart Connector
</span>
</button>
+ <button
+ className="c1"
+ disabled={false}
+ onClick={[Function]}
+ type="button"
+ >
+ <span>
+ <i
+ className="fas fa-sync-alt"
+ />
+ </span>
+ <span>
+ Restart All Tasks
+ </span>
+ </button>
+ <button
+ className="c1"
+ disabled={false}
+ onClick={[Function]}
+ type="button"
+ >
+ <span>
+ <i
+ className="fas fa-sync-alt"
+ />
+ </span>
+ <span>
+ Restart Failed Tasks
+ </span>
+ </button>
<a
href="/ui/clusters/my-cluster/connects/my-connect/connectors/my-connector/edit"
onClick={[Function]}
@@ -515,6 +575,36 @@ exports[`Actions view matches snapshot when failed 1`] = `
Restart Connector
</span>
</button>
+ <button
+ className="c1"
+ disabled={false}
+ onClick={[Function]}
+ type="button"
+ >
+ <span>
+ <i
+ className="fas fa-sync-alt"
+ />
+ </span>
+ <span>
+ Restart All Tasks
+ </span>
+ </button>
+ <button
+ className="c1"
+ disabled={false}
+ onClick={[Function]}
+ type="button"
+ >
+ <span>
+ <i
+ className="fas fa-sync-alt"
+ />
+ </span>
+ <span>
+ Restart Failed Tasks
+ </span>
+ </button>
<a
href="/ui/clusters/my-cluster/connects/my-connect/connectors/my-connector/edit"
onClick={[Function]}
@@ -708,6 +798,36 @@ exports[`Actions view matches snapshot when paused 1`] = `
Restart Connector
</span>
</button>
+ <button
+ className="c1"
+ disabled={false}
+ onClick={[Function]}
+ type="button"
+ >
+ <span>
+ <i
+ className="fas fa-sync-alt"
+ />
+ </span>
+ <span>
+ Restart All Tasks
+ </span>
+ </button>
+ <button
+ className="c1"
+ disabled={false}
+ onClick={[Function]}
+ type="button"
+ >
+ <span>
+ <i
+ className="fas fa-sync-alt"
+ />
+ </span>
+ <span>
+ Restart Failed Tasks
+ </span>
+ </button>
<a
href="/ui/clusters/my-cluster/connects/my-connect/connectors/my-connector/edit"
onClick={[Function]}
@@ -901,6 +1021,36 @@ exports[`Actions view matches snapshot when running connector action 1`] = `
Restart Connector
</span>
</button>
+ <button
+ className="c1"
+ disabled={true}
+ onClick={[Function]}
+ type="button"
+ >
+ <span>
+ <i
+ className="fas fa-sync-alt"
+ />
+ </span>
+ <span>
+ Restart All Tasks
+ </span>
+ </button>
+ <button
+ className="c1"
+ disabled={true}
+ onClick={[Function]}
+ type="button"
+ >
+ <span>
+ <i
+ className="fas fa-sync-alt"
+ />
+ </span>
+ <span>
+ Restart Failed Tasks
+ </span>
+ </button>
<a
href="/ui/clusters/my-cluster/connects/my-connect/connectors/my-connector/edit"
onClick={[Function]}
@@ -1079,6 +1229,36 @@ exports[`Actions view matches snapshot when unassigned 1`] = `
Restart Connector
</span>
</button>
+ <button
+ className="c1"
+ disabled={false}
+ onClick={[Function]}
+ type="button"
+ >
+ <span>
+ <i
+ className="fas fa-sync-alt"
+ />
+ </span>
+ <span>
+ Restart All Tasks
+ </span>
+ </button>
+ <button
+ className="c1"
+ disabled={false}
+ onClick={[Function]}
+ type="button"
+ >
+ <span>
+ <i
+ className="fas fa-sync-alt"
+ />
+ </span>
+ <span>
+ Restart Failed Tasks
+ </span>
+ </button>
<a
href="/ui/clusters/my-cluster/connects/my-connect/connectors/my-connector/edit"
onClick={[Function]}
diff --git a/kafka-ui-react-app/src/redux/actions/__test__/thunks/connectors.spec.ts b/kafka-ui-react-app/src/redux/actions/__test__/thunks/connectors.spec.ts
index bca43b69e0b..c72e15653ad 100644
--- a/kafka-ui-react-app/src/redux/actions/__test__/thunks/connectors.spec.ts
+++ b/kafka-ui-react-app/src/redux/actions/__test__/thunks/connectors.spec.ts
@@ -323,7 +323,7 @@ describe('Thunks', () => {
actions.restartConnectorAction.failure({
alert: {
subject: 'local-first-hdfs-source-connector',
- title: 'Kafka Connect Connector Tasks Restart',
+ title: 'Kafka Connect Connector Restart',
response: {
status: 404,
statusText: 'Not Found',
diff --git a/kafka-ui-react-app/src/redux/actions/actions.ts b/kafka-ui-react-app/src/redux/actions/actions.ts
index 464d9185204..dd72f87a8a4 100644
--- a/kafka-ui-react-app/src/redux/actions/actions.ts
+++ b/kafka-ui-react-app/src/redux/actions/actions.ts
@@ -106,6 +106,12 @@ export const restartConnectorAction = createAsyncAction(
'RESTART_CONNECTOR__FAILURE'
)<undefined, undefined, { alert?: FailurePayload }>();
+export const restartTasksAction = createAsyncAction(
+ 'RESTART_TASKS__REQUEST',
+ 'RESTART_TASKS__SUCCESS',
+ 'RESTART_TASKS__FAILURE'
+)<undefined, undefined, { alert?: FailurePayload }>();
+
export const pauseConnectorAction = createAsyncAction(
'PAUSE_CONNECTOR__REQUEST',
'PAUSE_CONNECTOR__SUCCESS',
diff --git a/kafka-ui-react-app/src/redux/actions/thunks/connectors.ts b/kafka-ui-react-app/src/redux/actions/thunks/connectors.ts
index 57514b03f6f..35124e7ceb5 100644
--- a/kafka-ui-react-app/src/redux/actions/thunks/connectors.ts
+++ b/kafka-ui-react-app/src/redux/actions/thunks/connectors.ts
@@ -18,6 +18,7 @@ import {
} from 'redux/interfaces';
import * as actions from 'redux/actions';
import { getResponse } from 'lib/errorHandling';
+import { batch } from 'react-redux';
const apiClientConf = new Configuration(BASE_PARAMS);
export const kafkaConnectApiClient = new KafkaConnectApi(apiClientConf);
@@ -196,13 +197,46 @@ export const restartConnector =
const response = await getResponse(error);
const alert: FailurePayload = {
subject: [clusterName, connectName, connectorName].join('-'),
- title: `Kafka Connect Connector Tasks Restart`,
+ title: `Kafka Connect Connector Restart`,
response,
};
dispatch(actions.restartConnectorAction.failure({ alert }));
}
};
+export const restartTasks =
+ (
+ clusterName: ClusterName,
+ connectName: ConnectName,
+ connectorName: ConnectorName,
+ action: ConnectorAction
+ ): PromiseThunkResult<void> =>
+ async (dispatch) => {
+ dispatch(actions.restartTasksAction.request());
+ try {
+ await kafkaConnectApiClient.updateConnectorState({
+ clusterName,
+ connectName,
+ connectorName,
+ action,
+ });
+ batch(() => {
+ dispatch(actions.restartTasksAction.success());
+ dispatch(
+ fetchConnectorTasks(clusterName, connectName, connectorName, true)
+ );
+ });
+ } catch (error) {
+ const response = await getResponse(error);
+ const alert: FailurePayload = {
+ subject: [clusterName, connectName, connectorName].join('-'),
+ title: `Kafka Connect Connector Tasks Restart`,
+ response,
+ };
+ dispatch(actions.restartTasksAction.failure({ alert }));
+ }
+ };
+
export const pauseConnector =
(
clusterName: ClusterName,
| null | test | train | 2022-04-05T15:08:11 | "2022-01-21T08:39:54Z" | 5hin0bi | train |
provectus/kafka-ui/1699_1729 | provectus/kafka-ui | provectus/kafka-ui/1699 | provectus/kafka-ui/1729 | [
"keyword_pr_to_issue",
"timestamp(timedelta=0.0, similarity=0.85300358341941)"
] | 68f8eed8f84fc94ca01840805a5c3b8902fbfb96 | 1796fd519b814e0564f4178c8cfaa4bae069cad8 | [
"Hello there jdechicchis! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"Hey, thanks for reaching out! Glad you like it.\r\n\r\nLet's discuss and we'll see about the PR.\r\n\r\n@iliax, what do you think?",
"I am ok with this. Will be happy to review PR, @jdechicchis ",
"@iliax @Haarolean Made a PR #1729. Would appreciate a review. I noticed that there didn't seem to be much documentation on how to use protobuf files with Kafka UI (maybe I missed it). I'm happy to document this change better if desired",
"@jdechicchis hey, yeah, unfortunately there's not much documentation for this. Would appreciate any documentation improvements.",
"@Haarolean Happy to add some docs in this PR (or a separate one if you prefer). I was thinking of adding a `documentation/guides/Protobuf.md`. Does that sound good to you?",
"@jdechicchis would be cool! The same PR is fine, the path is okay as well.",
"Updated the PR with some docs"
] | [
"Lets implement logic like it is currently implemented in [SchemaAwareSD](https://github.com/provectus/kafka-ui/blob/master/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/schemaregistry/SchemaRegistryAwareRecordSerDe.java#L115). \r\n\r\n1. if descriptor not found -> use FALLBACK_FORMATTER (StringMessageFormatter)\r\n2. if descriptor found, but there was an error in deserialization -> trace error and use FALLBACK_FORMATTER.\r\n\r\n",
"lets use debug level here - otherwise logs can appear on every msg",
"debug level here too",
"pls add `@Nullable` on method annotation here to highlight that result can be null",
"pls add `@Nullable` to defaultKeyMessageName arg, since it is expected that it can be null"
] | "2022-03-14T15:57:33Z" | [
"type/enhancement",
"scope/backend",
"status/accepted"
] | Support deserializing binary protobuf encoded message keys | First off, Kafka UI is great, thanks for maintaining it!
I noticed [this TODO](https://github.com/provectus/kafka-ui/blob/master/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/ProtobufFileRecordSerDe.java#L30) in `ProtobufFileRecordSerDe`:
```
//TODO: currently we assume that keys for this serde are always string - need to discuss if it is ok
```
I think it would be nice to provide the ability to deserialize binary protobuf encoded message keys in addition to message values. To support this, I think a new configuration value such as `Map<String, String> protobufMessageNameByTopicForKey` could be added (open to suggestions here). In terms of how a message key is deserialized when using `ProtobufFileRecordSerDe` I feel this precedence order would make sense:
- If the protobuf message name is found in `protobufMessageNameByTopicForKey` deserialize the message key using a descriptor.
- Else, deserialize the message key as a string.
Happy to make a PR for this (I've been playing around with the code and doesn't seem like it would be terribly difficult to add), but wanted to discuss if adding such a configuration makes sense
| [
".github/workflows/documentation.yaml",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/ClustersProperties.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/KafkaCluster.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/DeserializationService.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/ProtobufFileRecordSerDe.java"
] | [
".github/workflows/documentation.yaml",
"documentation/guides/Protobuf.md",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/ClustersProperties.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/KafkaCluster.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/DeserializationService.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/ProtobufFileRecordSerDe.java"
] | [
"kafka-ui-api/src/test/java/com/provectus/kafka/ui/serde/ProtobufFileRecordSerDeTest.java"
] | diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml
index 8b354ba5adc..45c9475f748 100644
--- a/.github/workflows/documentation.yaml
+++ b/.github/workflows/documentation.yaml
@@ -18,6 +18,6 @@ jobs:
uses: urlstechie/[email protected]
with:
exclude_patterns: localhost,127.0.,192.168.
- exclude_urls: https://api.server,https://graph.microsoft.com/User.Read,https://dev-a63ggcut.auth0.com
+ exclude_urls: https://api.server,https://graph.microsoft.com/User.Read,https://dev-a63ggcut.auth0.com/
print_all: false
file_types: .md
diff --git a/documentation/guides/Protobuf.md b/documentation/guides/Protobuf.md
new file mode 100644
index 00000000000..d7c50ffb65e
--- /dev/null
+++ b/documentation/guides/Protobuf.md
@@ -0,0 +1,33 @@
+# Kafkaui Protobuf Support
+
+Kafkaui supports deserializing protobuf messages in two ways:
+1. Using Confluent Schema Registry's [protobuf support](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/serdes-protobuf.html).
+2. Supplying a protobuf file as well as a configuration that maps topic names to protobuf types.
+
+## Configuring Kafkaui with a Protobuf File
+
+To configure Kafkaui to deserialize protobuf messages using a supplied protobuf schema add the following to the config:
+```yaml
+kafka:
+ clusters:
+ - # Cluster configuration omitted.
+ # protobufFile is the path to the protobuf schema.
+ protobufFile: path/to/my.proto
+ # protobufMessageName is the default protobuf type that is used to deserilize
+ # the message's value if the topic is not found in protobufMessageNameByTopic.
+ protobufMessageName: my.Type1
+ # protobufMessageNameByTopic is a mapping of topic names to protobuf types.
+ # This mapping is required and is used to deserialize the Kafka message's value.
+ protobufMessageNameByTopic:
+ topic1: my.Type1
+ topic2: my.Type2
+ # protobufMessageNameForKey is the default protobuf type that is used to deserilize
+ # the message's key if the topic is not found in protobufMessageNameForKeyByTopic.
+ protobufMessageNameForKey: my.Type1
+ # protobufMessageNameForKeyByTopic is a mapping of topic names to protobuf types.
+ # This mapping is optional and is used to deserialize the Kafka message's key.
+ # If a protobuf type is not found for a topic's key, the key is deserialized as a string,
+ # unless protobufMessageNameForKey is specified.
+ protobufMessageNameForKeyByTopic:
+ topic1: my.KeyType1
+```
\ No newline at end of file
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/ClustersProperties.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/ClustersProperties.java
index 1b5d4bbe8ca..e1016696662 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/ClustersProperties.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/ClustersProperties.java
@@ -31,6 +31,8 @@ public static class Cluster {
String protobufFile;
String protobufMessageName;
Map<String, String> protobufMessageNameByTopic;
+ String protobufMessageNameForKey;
+ Map<String, String> protobufMessageNameForKeyByTopic;
List<ConnectCluster> kafkaConnect;
int jmxPort;
boolean jmxSsl;
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/KafkaCluster.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/KafkaCluster.java
index c0ad99819e7..b9f1ea96768 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/KafkaCluster.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/KafkaCluster.java
@@ -28,6 +28,8 @@ public class KafkaCluster {
private final Path protobufFile;
private final String protobufMessageName;
private final Map<String, String> protobufMessageNameByTopic;
+ private final String protobufMessageNameForKey;
+ private final Map<String, String> protobufMessageNameForKeyByTopic;
private final Properties properties;
private final boolean readOnly;
private final boolean disableLogDirsCollection;
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/DeserializationService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/DeserializationService.java
index 3bfd5e9d8d2..b7df25c8e90 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/DeserializationService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/DeserializationService.java
@@ -32,7 +32,8 @@ private RecordSerDe createRecordDeserializerForCluster(KafkaCluster cluster) {
if (cluster.getProtobufFile() != null) {
log.info("Using ProtobufFileRecordSerDe for cluster '{}'", cluster.getName());
return new ProtobufFileRecordSerDe(cluster.getProtobufFile(),
- cluster.getProtobufMessageNameByTopic(), cluster.getProtobufMessageName());
+ cluster.getProtobufMessageNameByTopic(), cluster.getProtobufMessageNameForKeyByTopic(),
+ cluster.getProtobufMessageName(), cluster.getProtobufMessageNameForKey());
} else if (cluster.getSchemaRegistry() != null) {
log.info("Using SchemaRegistryAwareRecordSerDe for cluster '{}'", cluster.getName());
return new SchemaRegistryAwareRecordSerDe(cluster);
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/ProtobufFileRecordSerDe.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/ProtobufFileRecordSerDe.java
index 7553535999c..597461e51bc 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/ProtobufFileRecordSerDe.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/ProtobufFileRecordSerDe.java
@@ -6,6 +6,7 @@
import com.provectus.kafka.ui.model.MessageSchemaDTO;
import com.provectus.kafka.ui.model.TopicMessageSchemaDTO;
import com.provectus.kafka.ui.serde.schemaregistry.MessageFormat;
+import com.provectus.kafka.ui.serde.schemaregistry.StringMessageFormatter;
import com.provectus.kafka.ui.util.jsonschema.JsonSchema;
import com.provectus.kafka.ui.util.jsonschema.ProtobufSchemaConverter;
import io.confluent.kafka.schemaregistry.protobuf.ProtobufSchema;
@@ -22,20 +23,26 @@
import java.util.stream.Stream;
import javax.annotation.Nullable;
import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.common.utils.Bytes;
-//TODO: currently we assume that keys for this serde are always string - need to discuss if it is ok
+@Slf4j
public class ProtobufFileRecordSerDe implements RecordSerDe {
+ private static final StringMessageFormatter FALLBACK_FORMATTER = new StringMessageFormatter();
+
private final ProtobufSchema protobufSchema;
private final Path protobufSchemaPath;
private final ProtobufSchemaConverter schemaConverter = new ProtobufSchemaConverter();
private final Map<String, Descriptor> messageDescriptorMap;
+ private final Map<String, Descriptor> keyMessageDescriptorMap;
private final Descriptor defaultMessageDescriptor;
+ private final Descriptor defaultKeyMessageDescriptor;
public ProtobufFileRecordSerDe(Path protobufSchemaPath, Map<String, String> messageNameMap,
- String defaultMessageName)
+ Map<String, String> keyMessageNameMap, String defaultMessageName,
+ @Nullable String defaultKeyMessageName)
throws IOException {
this.protobufSchemaPath = protobufSchemaPath;
try (final Stream<String> lines = Files.lines(protobufSchemaPath)) {
@@ -49,35 +56,70 @@ public ProtobufFileRecordSerDe(Path protobufSchemaPath, Map<String, String> mess
}
this.messageDescriptorMap = new HashMap<>();
if (messageNameMap != null) {
- for (Map.Entry<String, String> entry : messageNameMap.entrySet()) {
- var descriptor = Objects.requireNonNull(protobufSchema.toDescriptor(entry.getValue()),
- "The given message type is not found in protobuf definition: "
- + entry.getValue());
- messageDescriptorMap.put(entry.getKey(), descriptor);
- }
+ populateDescriptors(messageNameMap, messageDescriptorMap);
+ }
+ this.keyMessageDescriptorMap = new HashMap<>();
+ if (keyMessageNameMap != null) {
+ populateDescriptors(keyMessageNameMap, keyMessageDescriptorMap);
}
defaultMessageDescriptor = Objects.requireNonNull(protobufSchema.toDescriptor(),
"The given message type is not found in protobuf definition: "
+ defaultMessageName);
+ if (defaultKeyMessageName != null) {
+ defaultKeyMessageDescriptor = schema.copy(defaultKeyMessageName).toDescriptor();
+ } else {
+ defaultKeyMessageDescriptor = null;
+ }
+ }
+ }
+
+ private void populateDescriptors(Map<String, String> messageNameMap, Map<String, Descriptor> messageDescriptorMap) {
+ for (Map.Entry<String, String> entry : messageNameMap.entrySet()) {
+ var descriptor = Objects.requireNonNull(protobufSchema.toDescriptor(entry.getValue()),
+ "The given message type is not found in protobuf definition: "
+ + entry.getValue());
+ messageDescriptorMap.put(entry.getKey(), descriptor);
}
}
@Override
public DeserializedKeyValue deserialize(ConsumerRecord<Bytes, Bytes> msg) {
- try {
- var builder = DeserializedKeyValue.builder();
- if (msg.key() != null) {
- builder.key(new String(msg.key().get()));
- builder.keyFormat(MessageFormat.UNKNOWN);
+ var builder = DeserializedKeyValue.builder();
+
+ if (msg.key() != null) {
+ Descriptor descriptor = getKeyDescriptor(msg.topic());
+ if (descriptor == null) {
+ builder.key(FALLBACK_FORMATTER.format(msg.topic(), msg.key().get()));
+ builder.keyFormat(FALLBACK_FORMATTER.getFormat());
+ } else {
+ try {
+ builder.key(parse(msg.key().get(), descriptor));
+ builder.keyFormat(MessageFormat.PROTOBUF);
+ } catch (Throwable e) {
+ log.debug("Failed to deserialize key as protobuf, falling back to string formatter", e);
+ builder.key(FALLBACK_FORMATTER.format(msg.topic(), msg.key().get()));
+ builder.keyFormat(FALLBACK_FORMATTER.getFormat());
+ }
}
- if (msg.value() != null) {
+ }
+
+ if (msg.value() != null) {
+ try {
builder.value(parse(msg.value().get(), getDescriptor(msg.topic())));
builder.valueFormat(MessageFormat.PROTOBUF);
+ } catch (Throwable e) {
+ log.debug("Failed to deserialize value as protobuf, falling back to string formatter", e);
+ builder.key(FALLBACK_FORMATTER.format(msg.topic(), msg.value().get()));
+ builder.keyFormat(FALLBACK_FORMATTER.getFormat());
}
- return builder.build();
- } catch (Throwable e) {
- throw new RuntimeException("Failed to parse record from topic " + msg.topic(), e);
}
+
+ return builder.build();
+ }
+
+ @Nullable
+ private Descriptor getKeyDescriptor(String topic) {
+ return keyMessageDescriptorMap.getOrDefault(topic, defaultKeyMessageDescriptor);
}
private Descriptor getDescriptor(String topic) {
@@ -99,40 +141,67 @@ public ProducerRecord<byte[], byte[]> serialize(String topic,
@Nullable String key,
@Nullable String data,
@Nullable Integer partition) {
- if (data == null) {
- return new ProducerRecord<>(topic, partition, Objects.requireNonNull(key).getBytes(), null);
+ byte[] keyPayload = null;
+ byte[] valuePayload = null;
+
+ if (key != null) {
+ Descriptor keyDescriptor = getKeyDescriptor(topic);
+ if (keyDescriptor == null) {
+ keyPayload = key.getBytes();
+ } else {
+ DynamicMessage.Builder builder = DynamicMessage.newBuilder(keyDescriptor);
+ try {
+ JsonFormat.parser().merge(key, builder);
+ keyPayload = builder.build().toByteArray();
+ } catch (Throwable e) {
+ throw new RuntimeException("Failed to merge record key for topic " + topic, e);
+ }
+ }
}
- DynamicMessage.Builder builder = DynamicMessage.newBuilder(getDescriptor(topic));
- try {
- JsonFormat.parser().merge(data, builder);
- final DynamicMessage message = builder.build();
- return new ProducerRecord<>(
- topic,
- partition,
- Optional.ofNullable(key).map(String::getBytes).orElse(null),
- message.toByteArray()
- );
- } catch (Throwable e) {
- throw new RuntimeException("Failed to merge record for topic " + topic, e);
+
+ if (data != null) {
+ DynamicMessage.Builder builder = DynamicMessage.newBuilder(getDescriptor(topic));
+ try {
+ JsonFormat.parser().merge(data, builder);
+ valuePayload = builder.build().toByteArray();
+ } catch (Throwable e) {
+ throw new RuntimeException("Failed to merge record value for topic " + topic, e);
+ }
}
+
+ return new ProducerRecord<>(
+ topic,
+ partition,
+ keyPayload,
+ valuePayload);
}
@Override
public TopicMessageSchemaDTO getTopicSchema(String topic) {
+ JsonSchema keyJsonSchema;
+
+ Descriptor keyDescriptor = getKeyDescriptor(topic);
+ if (keyDescriptor == null) {
+ keyJsonSchema = JsonSchema.stringSchema();
+ } else {
+ keyJsonSchema = schemaConverter.convert(
+ protobufSchemaPath.toUri(),
+ keyDescriptor);
+ }
- final JsonSchema jsonSchema = schemaConverter.convert(
- protobufSchemaPath.toUri(),
- getDescriptor(topic)
- );
final MessageSchemaDTO keySchema = new MessageSchemaDTO()
.name(protobufSchema.fullName())
.source(MessageSchemaDTO.SourceEnum.PROTO_FILE)
- .schema(JsonSchema.stringSchema().toJson());
+ .schema(keyJsonSchema.toJson());
+
+ final JsonSchema valueJsonSchema = schemaConverter.convert(
+ protobufSchemaPath.toUri(),
+ getDescriptor(topic));
final MessageSchemaDTO valueSchema = new MessageSchemaDTO()
.name(protobufSchema.fullName())
.source(MessageSchemaDTO.SourceEnum.PROTO_FILE)
- .schema(jsonSchema.toJson());
+ .schema(valueJsonSchema.toJson());
return new TopicMessageSchemaDTO()
.key(keySchema)
| diff --git a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/serde/ProtobufFileRecordSerDeTest.java b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/serde/ProtobufFileRecordSerDeTest.java
index 269b65872a0..ce74b25c201 100644
--- a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/serde/ProtobufFileRecordSerDeTest.java
+++ b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/serde/ProtobufFileRecordSerDeTest.java
@@ -51,8 +51,10 @@ void testDeserialize() throws IOException {
var messageNameMap = Map.of(
"topic1", "test.Person",
"topic2", "test.AddressBook");
+ var keyMessageNameMap = Map.of(
+ "topic2", "test.Person");
var deserializer =
- new ProtobufFileRecordSerDe(protobufSchemaPath, messageNameMap, null);
+ new ProtobufFileRecordSerDe(protobufSchemaPath, messageNameMap, keyMessageNameMap, null, null);
var msg1 = deserializer
.deserialize(new ConsumerRecord<>("topic1", 1, 0, Bytes.wrap("key".getBytes()),
Bytes.wrap(personMessage)));
@@ -60,8 +62,10 @@ void testDeserialize() throws IOException {
assertTrue(msg1.getValue().contains("[email protected]"));
var msg2 = deserializer
- .deserialize(new ConsumerRecord<>("topic2", 1, 1, Bytes.wrap("key".getBytes()),
+ .deserialize(new ConsumerRecord<>("topic2", 1, 1, Bytes.wrap(personMessage),
Bytes.wrap(addressBookMessage)));
+ assertEquals(MessageFormat.PROTOBUF, msg2.getKeyFormat());
+ assertTrue(msg2.getKey().contains("[email protected]"));
assertTrue(msg2.getValue().contains("[email protected]"));
}
@@ -69,7 +73,7 @@ void testDeserialize() throws IOException {
void testNoDefaultMessageName() throws IOException {
// by default the first message type defined in proto definition is used
var deserializer =
- new ProtobufFileRecordSerDe(protobufSchemaPath, Collections.emptyMap(), null);
+ new ProtobufFileRecordSerDe(protobufSchemaPath, Collections.emptyMap(), null, null, null);
var msg = deserializer
.deserialize(new ConsumerRecord<>("topic", 1, 0, Bytes.wrap("key".getBytes()),
Bytes.wrap(personMessage)));
@@ -80,19 +84,42 @@ void testNoDefaultMessageName() throws IOException {
void testDefaultMessageName() throws IOException {
var messageNameMap = Map.of("topic1", "test.Person");
var deserializer =
- new ProtobufFileRecordSerDe(protobufSchemaPath, messageNameMap, "test.AddressBook");
+ new ProtobufFileRecordSerDe(protobufSchemaPath, messageNameMap, null, "test.AddressBook", null);
var msg = deserializer
- .deserialize(new ConsumerRecord<>("a_random_topic", 1, 0, Bytes.wrap("key".getBytes()),
+ .deserialize(new ConsumerRecord<>("a_random_topic", 1, 0, Bytes.wrap(addressBookMessage),
Bytes.wrap(addressBookMessage)));
assertTrue(msg.getValue().contains("[email protected]"));
}
+ @Test
+ void testDefaultKeyMessageName() throws IOException {
+ var messageNameMap = Map.of("topic1", "test.Person");
+ var deserializer =
+ new ProtobufFileRecordSerDe(protobufSchemaPath, messageNameMap, messageNameMap, "test.AddressBook",
+ "test.AddressBook");
+ var msg = deserializer
+ .deserialize(new ConsumerRecord<>("a_random_topic", 1, 0, Bytes.wrap(addressBookMessage),
+ Bytes.wrap(addressBookMessage)));
+ assertTrue(msg.getKey().contains("[email protected]"));
+ }
+
@Test
void testSerialize() throws IOException {
var messageNameMap = Map.of("topic1", "test.Person");
var serializer =
- new ProtobufFileRecordSerDe(protobufSchemaPath, messageNameMap, "test.AddressBook");
+ new ProtobufFileRecordSerDe(protobufSchemaPath, messageNameMap, null, "test.AddressBook", null);
var serialized = serializer.serialize("topic1", "key1", "{\"name\":\"MyName\"}", 0);
assertNotNull(serialized.value());
}
+
+ @Test
+ void testSerializeKeyAndValue() throws IOException {
+ var messageNameMap = Map.of("topic1", "test.Person");
+ var serializer =
+ new ProtobufFileRecordSerDe(protobufSchemaPath, messageNameMap, messageNameMap, "test.AddressBook",
+ "test.AddressBook");
+ var serialized = serializer.serialize("topic1", "{\"name\":\"MyName\"}", "{\"name\":\"MyName\"}", 0);
+ assertNotNull(serialized.key());
+ assertNotNull(serialized.value());
+ }
}
| train | train | 2022-04-05T14:04:41 | "2022-03-04T14:51:05Z" | jdechicchis | train |
provectus/kafka-ui/1032_1734 | provectus/kafka-ui | provectus/kafka-ui/1032 | provectus/kafka-ui/1734 | [
"connected"
] | 50889e6ac334c7dae26c3f176cc6e4233f7a2543 | ad628ed7ae0bd5f5648eefdaad67b9352705f50f | [] | [
"why we export this interface?",
"To use it in the test file."
] | "2022-03-16T11:59:34Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted"
] | Show "Loading" when waiting for consumers list | ### Is your proposal related to a problem?
Go to Topics -> select topic -> go to Consumers tab.
When Consumers tab is rendering the table is empty, when consumers request executed table is updated with responded values.
### Describe the solution you'd like
I think we should show 'loading..' when waiting for consumers response. Since this request can be pretty long table ca stay empty for some time, which is can confuse users.
### Describe alternatives you've considered
<!--
Let us know about other solutions you've tried or researched.
-->
### Additional context
<!--
Is there anything else you can add about the proposal?
You might want to link to related issues here, if you haven't already.
-->
| [
"kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroups.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroupsContainer.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/__test__/TopicConsumerGroups.spec.tsx",
"kafka-ui-react-app/src/redux/reducers/topics/selectors.ts"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroups.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroupsContainer.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/__test__/TopicConsumerGroups.spec.tsx",
"kafka-ui-react-app/src/redux/reducers/topics/selectors.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroups.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroups.tsx
index 5c67e23007f..7877dcd19ab 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroups.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroups.tsx
@@ -8,11 +8,13 @@ import { Tag } from 'components/common/Tag/Tag.styled';
import { TableKeyLink } from 'components/common/table/Table/TableKeyLink.styled';
import { Link } from 'react-router-dom';
import getTagColor from 'components/ConsumerGroups/Utils/TagColor';
+import PageLoader from 'components/common/PageLoader/PageLoader';
-interface Props extends Topic, TopicDetails {
+export interface Props extends Topic, TopicDetails {
clusterName: ClusterName;
topicName: TopicName;
consumerGroups: ConsumerGroup[];
+ isFetched: boolean;
fetchTopicConsumerGroups(
clusterName: ClusterName,
topicName: TopicName
@@ -24,11 +26,16 @@ const TopicConsumerGroups: React.FC<Props> = ({
fetchTopicConsumerGroups,
clusterName,
topicName,
+ isFetched,
}) => {
React.useEffect(() => {
fetchTopicConsumerGroups(clusterName, topicName);
}, [clusterName, fetchTopicConsumerGroups, topicName]);
+ if (!isFetched) {
+ return <PageLoader />;
+ }
+
return (
<div>
<Table isFullwidth>
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroupsContainer.ts b/kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroupsContainer.ts
index e0f8d3d0be1..23922bb2e75 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroupsContainer.ts
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroupsContainer.ts
@@ -3,7 +3,10 @@ import { RootState, TopicName, ClusterName } from 'redux/interfaces';
import { withRouter, RouteComponentProps } from 'react-router-dom';
import { fetchTopicConsumerGroups } from 'redux/actions';
import TopicConsumerGroups from 'components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroups';
-import { getTopicConsumerGroups } from 'redux/reducers/topics/selectors';
+import {
+ getTopicConsumerGroups,
+ getTopicsConsumerGroupsFetched,
+} from 'redux/reducers/topics/selectors';
interface RouteProps {
clusterName: ClusterName;
@@ -23,6 +26,7 @@ const mapStateToProps = (
consumerGroups: getTopicConsumerGroups(state, topicName),
topicName,
clusterName,
+ isFetched: getTopicsConsumerGroupsFetched(state),
});
const mapDispatchToProps = {
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/__test__/TopicConsumerGroups.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/__test__/TopicConsumerGroups.spec.tsx
index 32ba5a22b84..a4675785db1 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/__test__/TopicConsumerGroups.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/ConsumerGroups/__test__/TopicConsumerGroups.spec.tsx
@@ -1,12 +1,14 @@
import React from 'react';
-import { shallow } from 'enzyme';
-import ConsumerGroups from 'components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroups';
+import { render } from 'lib/testHelpers';
+import { screen } from '@testing-library/react';
+import ConsumerGroups, {
+ Props,
+} from 'components/Topics/Topic/Details/ConsumerGroups/TopicConsumerGroups';
import { ConsumerGroupState } from 'generated-sources';
-describe('Details', () => {
- const mockFn = jest.fn();
- const mockClusterName = 'local';
- const mockTopicName = 'local';
+describe('TopicConsumerGroups', () => {
+ const mockClusterName = 'localClusterName';
+ const mockTopicName = 'localTopicName';
const mockWithConsumerGroup = [
{
groupId: 'amazon.msk.canary.group.broker-7',
@@ -30,29 +32,40 @@ describe('Details', () => {
},
];
- it("don't render ConsumerGroups in Topic", () => {
- const component = shallow(
+ const setUpComponent = (props: Partial<Props> = {}) => {
+ const { name, topicName, consumerGroups, isFetched } = props;
+
+ return render(
<ConsumerGroups
clusterName={mockClusterName}
- consumerGroups={[]}
- name={mockTopicName}
- fetchTopicConsumerGroups={mockFn}
- topicName={mockTopicName}
+ consumerGroups={consumerGroups?.length ? consumerGroups : []}
+ name={name || mockTopicName}
+ fetchTopicConsumerGroups={jest.fn()}
+ topicName={topicName || mockTopicName}
+ isFetched={'isFetched' in props ? !!isFetched : false}
/>
);
- expect(component.find('td').text()).toEqual('No active consumer groups');
+ };
+
+ describe('Default Setup', () => {
+ beforeEach(() => {
+ setUpComponent();
+ });
+ it('should view the Page loader when it is fetching state', () => {
+ expect(screen.getByRole('progressbar')).toBeInTheDocument();
+ });
+ });
+
+ it("don't render ConsumerGroups in Topic", () => {
+ setUpComponent({ isFetched: true });
+ expect(screen.getByText(/No active consumer groups/i)).toBeInTheDocument();
});
it('render ConsumerGroups in Topic', () => {
- const component = shallow(
- <ConsumerGroups
- clusterName={mockClusterName}
- consumerGroups={mockWithConsumerGroup}
- name={mockTopicName}
- fetchTopicConsumerGroups={mockFn}
- topicName={mockTopicName}
- />
- );
- expect(component.exists('tbody')).toBeTruthy();
+ setUpComponent({
+ consumerGroups: mockWithConsumerGroup,
+ isFetched: true,
+ });
+ expect(screen.getAllByRole('rowgroup')).toHaveLength(2);
});
});
diff --git a/kafka-ui-react-app/src/redux/reducers/topics/selectors.ts b/kafka-ui-react-app/src/redux/reducers/topics/selectors.ts
index ee59bc97352..aac3c856a0b 100644
--- a/kafka-ui-react-app/src/redux/reducers/topics/selectors.ts
+++ b/kafka-ui-react-app/src/redux/reducers/topics/selectors.ts
@@ -33,6 +33,10 @@ const getReplicationFactorUpdateStatus = createLeagcyFetchingSelector(
);
const getTopicDeletingStatus = createLeagcyFetchingSelector('DELETE_TOPIC');
+const getTopicConsumerGroupsStatus = createLeagcyFetchingSelector(
+ 'GET_TOPIC_CONSUMER_GROUPS'
+);
+
export const getIsTopicDeleted = createSelector(
getTopicDeletingStatus,
(status) => status === 'fetched'
@@ -88,6 +92,11 @@ export const getTopicReplicationFactorUpdated = createSelector(
(status) => status === 'fetched'
);
+export const getTopicsConsumerGroupsFetched = createSelector(
+ getTopicConsumerGroupsStatus,
+ (status) => status === 'fetched'
+);
+
export const getTopicList = createSelector(
getAreTopicsFetched,
getAllNames,
| null | val | train | 2022-03-17T14:09:48 | "2021-10-30T10:34:52Z" | iliax | train |
provectus/kafka-ui/1735_1746 | provectus/kafka-ui | provectus/kafka-ui/1735 | provectus/kafka-ui/1746 | [
"connected",
"timestamp(timedelta=0.0, similarity=0.9173820841918987)"
] | e1f31d27c6659be419c5547c94bfbc828409a446 | 4907e187f870c7e1e7dd366c2244491f0fee9506 | [
"Hello there Mgrdich! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"First timer here - is it ok to work on this issue? @Haarolean @Mgrdich ",
"It should be Done like to https://github.com/provectus/kafka-ui/commit/ad628ed7ae0bd5f5648eefdaad67b9352705f50f",
"@Anifahb hey, unfortunately you can't do that yourself, I've assigned it to you. Please check our [contributing](https://github.com/provectus/kafka-ui/blob/master/CONTRIBUTING.md) guide.",
"> @Anifahb hey, unfortunately you can't do that yourself, I've assigned it to you. Please check our [contributing](https://github.com/provectus/kafka-ui/blob/master/CONTRIBUTING.md) guide.\r\n\r\nThank you for assigning this to me - will get started on it today.",
"@Anifahb thanks much!"
] | [] | "2022-03-22T22:38:04Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted"
] | Show "Loading" when waiting for Topics Settings Tab | ### Is your proposal related to a problem?
Go to Topics -> select topic -> go to **Settings** tab.
When **Settings** tab is rendering the page is empty, when Topics Settings request executed table is updated with responded values.
### Describe the solution you'd like
I think we should show 'loading..' when waiting for Settings response. so that from a UX perspective the users will not be confused.
### Describe alternatives you've considered
<!--
Let us know about other solutions you've tried or researched.
-->
### Additional context
<!--
Is there anything else you can add about the proposal?
You might want to link to related issues here, if you haven't already.
-->
| [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/Settings.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/__test__/Settings.spec.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/Settings.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/__test__/Settings.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/Settings.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/Settings.tsx
index 8d9264ec96a..acbe176bc50 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/Settings.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/Settings.tsx
@@ -1,3 +1,4 @@
+import PageLoader from 'components/common/PageLoader/PageLoader';
import { Table } from 'components/common/table/Table/Table.styled';
import TableHeaderCell from 'components/common/table/TableHeaderCell/TableHeaderCell';
import { TopicConfig } from 'generated-sources';
@@ -25,7 +26,11 @@ const Settings: React.FC<Props> = ({
fetchTopicConfig(clusterName, topicName);
}, [fetchTopicConfig, clusterName, topicName]);
- if (!isFetched || !config) {
+ if (!isFetched) {
+ return <PageLoader />;
+ }
+
+ if (!config) {
return null;
}
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/__test__/Settings.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/__test__/Settings.spec.tsx
index 5b3b37f0996..23a39b50c65 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/__test__/Settings.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Settings/__test__/Settings.spec.tsx
@@ -33,7 +33,7 @@ describe('Settings', () => {
expect(screen.queryByRole('table')).not.toBeInTheDocument();
});
- it('should check and return null if it is not fetched and config is given', () => {
+ it('should show Page loader when it is in fetching state and config is given', () => {
render(
<Settings
clusterName={mockClusterName}
@@ -45,6 +45,7 @@ describe('Settings', () => {
);
expect(screen.queryByRole('table')).not.toBeInTheDocument();
+ expect(screen.getByRole('progressbar')).toBeInTheDocument();
});
it('should check and return null if it is not fetched and config is not given', () => {
| null | test | train | 2022-03-28T08:10:06 | "2022-03-17T08:10:26Z" | Mgrdich | train |
provectus/kafka-ui/1752_1758 | provectus/kafka-ui | provectus/kafka-ui/1752 | provectus/kafka-ui/1758 | [
"keyword_pr_to_issue",
"connected"
] | b44fd8490b99660f3a5dd8701e1ca4523604aacc | aab1f5cea44abe30202fc5209161e14d7d915f4e | [
"Hello there lucasprograms! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"Hey, thanks for bringing attention at this.\r\n\r\nThis link should actually lead to [this](https://github.com/provectus/kafka-ui/blob/master/documentation/compose/kafka-ssl.yml) compose file. We haven't done a separate page for it yet but there's a broken link already :)"
] | [] | "2022-03-24T22:05:49Z" | [
"type/documentation",
"good first issue"
] | "Connection to a secure broker" link is broken | **Describe the bug**
1. Visit https://github.com/provectus/kafka-ui#guides
2. Click "Connection to a secure broker" link
Expected:
Guide, no octocat
Actual:
Octocat | [
"README.md"
] | [
"README.md",
"documentation/guides/SECURE_BROKER.md"
] | [] | diff --git a/README.md b/README.md
index 33795ed2bc5..05da6db6751 100644
--- a/README.md
+++ b/README.md
@@ -70,12 +70,7 @@ We have plenty of [docker-compose files](documentation/compose/DOCKER_COMPOSE.md
- [SSO configuration](documentation/guides/SSO.md)
- [AWS IAM configuration](documentation/guides/AWS_IAM.md)
- [Docker-compose files](documentation/compose/DOCKER_COMPOSE.md)
-- [Connection to a secure broker]()
-
-## Connecting to a Secure Broker
-
-The app supports TLS (SSL) and SASL connections for [encryption and authentication](http://kafka.apache.org/090/documentation.html#security). <br/>
-An example is located [here](documentation/compose/kafka-ssl.yml).
+- [Connection to a secure broker](documentation/compose/SECURE_BROKER.md)
### Configuration File
Example of how to configure clusters in the [application-local.yml](https://github.com/provectus/kafka-ui/blob/master/kafka-ui-api/src/main/resources/application-local.yml) configuration file:
diff --git a/documentation/guides/SECURE_BROKER.md b/documentation/guides/SECURE_BROKER.md
new file mode 100644
index 00000000000..ab15bb63ab3
--- /dev/null
+++ b/documentation/guides/SECURE_BROKER.md
@@ -0,0 +1,7 @@
+## Connecting to a Secure Broker
+
+The app supports TLS (SSL) and SASL connections for [encryption and authentication](http://kafka.apache.org/090/documentation.html#security). <br/>
+
+### Running From Docker-compose file
+
+See [this](/documentation/compose/kafka-ssl.yml) docker-compose file reference for ssl-enabled kafka
| null | val | train | 2022-04-07T17:30:32 | "2022-03-23T21:17:39Z" | lucasprograms | train |
provectus/kafka-ui/1613_1759 | provectus/kafka-ui | provectus/kafka-ui/1613 | provectus/kafka-ui/1759 | [
"timestamp(timedelta=1.0, similarity=0.8732269688726874)",
"connected"
] | 3a84d1003407c646238147b453aae168fe3d03d0 | e1f31d27c6659be419c5547c94bfbc828409a446 | [
"Hello there pikhovkin! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"Hey, thanks for raising the issue.\r\n\r\nCould you share the details of a red (failed) request in network tab of browser's developer console?",
"@Haarolean \r\n\r\n\r\n"
] | [] | "2022-03-25T07:12:49Z" | [
"type/bug",
"scope/backend",
"status/accepted",
"status/confirmed"
] | TopicNotFound upon creating a topic | **Describe the bug**
A topic is not created from the first time in KRaft mode. Most of the time. Sometimes a topic is created immediately.
**Set up**

**Steps to Reproduce**
Steps to reproduce the behavior:

**Expected behavior**
A topic is created immediately without errors
**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->
**Additional context**
<!--
(Add any other context about the problem here)
-->
| [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ConsumerGroupService.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ConsumerGroupService.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java"
] | [] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ConsumerGroupService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ConsumerGroupService.java
index cba51a921af..beb9f849798 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ConsumerGroupService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ConsumerGroupService.java
@@ -210,6 +210,7 @@ public KafkaConsumer<Bytes, Bytes> createConsumer(KafkaCluster cluster,
props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, BytesDeserializer.class);
props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "false");
+ props.put(ConsumerConfig.ALLOW_AUTO_CREATE_TOPICS_CONFIG, "false");
props.putAll(properties);
return new KafkaConsumer<>(props);
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java
index b4629cf39c6..265103a7cb1 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/TopicsService.java
@@ -71,6 +71,10 @@ public class TopicsService {
private int recreateMaxRetries;
@Value("${topic.recreate.delay.seconds:1}")
private int recreateDelayInSeconds;
+ @Value("${topic.load.after.create.maxRetries:10}")
+ private int loadTopicAfterCreateRetries;
+ @Value("${topic.load.after.create.delay.ms:500}")
+ private int loadTopicAfterCreateDelayInMs;
public Mono<TopicsResponseDTO> getTopics(KafkaCluster cluster,
Optional<Integer> pageNum,
@@ -115,7 +119,32 @@ private Mono<List<InternalTopic>> loadTopics(KafkaCluster c, List<String> topics
private Mono<InternalTopic> loadTopic(KafkaCluster c, String topicName) {
return loadTopics(c, List.of(topicName))
- .map(lst -> lst.stream().findFirst().orElseThrow(TopicNotFoundException::new));
+ .flatMap(lst -> lst.stream().findFirst()
+ .map(Mono::just)
+ .orElse(Mono.error(TopicNotFoundException::new)));
+ }
+
+ /**
+ * After creation topic can be invisible via API for some time.
+ * To workaround this, we retyring topic loading until it becomes visible.
+ */
+ private Mono<InternalTopic> loadTopicAfterCreation(KafkaCluster c, String topicName) {
+ return loadTopic(c, topicName)
+ .retryWhen(
+ Retry
+ .fixedDelay(
+ loadTopicAfterCreateRetries,
+ Duration.ofMillis(loadTopicAfterCreateDelayInMs)
+ )
+ .filter(TopicNotFoundException.class::isInstance)
+ .onRetryExhaustedThrow((spec, sig) ->
+ new TopicMetadataException(
+ String.format(
+ "Error while loading created topic '%s' - topic is not visible via API "
+ + "after waiting for %d ms.",
+ topicName,
+ loadTopicAfterCreateDelayInMs * loadTopicAfterCreateRetries)))
+ );
}
private List<InternalTopic> createList(List<String> orderedNames,
@@ -182,7 +211,7 @@ private Mono<InternalTopic> createTopic(KafkaCluster c, ReactiveAdminClient admi
).thenReturn(topicData)
)
.onErrorResume(t -> Mono.error(new TopicMetadataException(t.getMessage())))
- .flatMap(topicData -> loadTopic(c, topicData.getName()));
+ .flatMap(topicData -> loadTopicAfterCreation(c, topicData.getName()));
}
public Mono<TopicDTO> createTopic(KafkaCluster cluster, Mono<TopicCreationDTO> topicCreation) {
@@ -194,23 +223,30 @@ public Mono<TopicDTO> createTopic(KafkaCluster cluster, Mono<TopicCreationDTO> t
public Mono<TopicDTO> recreateTopic(KafkaCluster cluster, String topicName) {
return loadTopic(cluster, topicName)
.flatMap(t -> deleteTopic(cluster, topicName)
- .thenReturn(t).delayElement(Duration.ofSeconds(recreateDelayInSeconds))
- .flatMap(topic -> adminClientService.get(cluster).flatMap(ac -> ac.createTopic(topic.getName(),
- topic.getPartitionCount(),
- (short) topic.getReplicationFactor(),
- topic.getTopicConfigs()
- .stream()
- .collect(Collectors
- .toMap(InternalTopicConfig::getName,
- InternalTopicConfig::getValue)))
- .thenReturn(topicName))
- .retryWhen(Retry.fixedDelay(recreateMaxRetries,
- Duration.ofSeconds(recreateDelayInSeconds))
- .filter(TopicExistsException.class::isInstance)
- .onRetryExhaustedThrow((a, b) ->
- new TopicRecreationException(topicName,
- recreateMaxRetries * recreateDelayInSeconds)))
- .flatMap(a -> loadTopic(cluster, topicName)).map(clusterMapper::toTopic)
+ .thenReturn(t)
+ .delayElement(Duration.ofSeconds(recreateDelayInSeconds))
+ .flatMap(topic ->
+ adminClientService.get(cluster)
+ .flatMap(ac ->
+ ac.createTopic(
+ topic.getName(),
+ topic.getPartitionCount(),
+ (short) topic.getReplicationFactor(),
+ topic.getTopicConfigs()
+ .stream()
+ .collect(Collectors.toMap(InternalTopicConfig::getName,
+ InternalTopicConfig::getValue))
+ )
+ .thenReturn(topicName)
+ )
+ .retryWhen(
+ Retry.fixedDelay(recreateMaxRetries, Duration.ofSeconds(recreateDelayInSeconds))
+ .filter(TopicExistsException.class::isInstance)
+ .onRetryExhaustedThrow((a, b) ->
+ new TopicRecreationException(topicName,
+ recreateMaxRetries * recreateDelayInSeconds))
+ )
+ .flatMap(a -> loadTopicAfterCreation(cluster, topicName)).map(clusterMapper::toTopic)
)
);
}
@@ -431,13 +467,21 @@ public TopicMessageSchemaDTO getTopicSchema(KafkaCluster cluster, String topicNa
public Mono<TopicDTO> cloneTopic(
KafkaCluster cluster, String topicName, String newTopicName) {
return loadTopic(cluster, topicName).flatMap(topic ->
- adminClientService.get(cluster).flatMap(ac -> ac.createTopic(newTopicName,
- topic.getPartitionCount(),
- (short) topic.getReplicationFactor(),
- topic.getTopicConfigs()
- .stream()
- .collect(Collectors.toMap(InternalTopicConfig::getName, InternalTopicConfig::getValue)))
- ).thenReturn(newTopicName).flatMap(a -> loadTopic(cluster, newTopicName)).map(clusterMapper::toTopic));
+ adminClientService.get(cluster)
+ .flatMap(ac ->
+ ac.createTopic(
+ newTopicName,
+ topic.getPartitionCount(),
+ (short) topic.getReplicationFactor(),
+ topic.getTopicConfigs()
+ .stream()
+ .collect(Collectors
+ .toMap(InternalTopicConfig::getName, InternalTopicConfig::getValue))
+ )
+ ).thenReturn(newTopicName)
+ .flatMap(a -> loadTopicAfterCreation(cluster, newTopicName))
+ .map(clusterMapper::toTopic)
+ );
}
@VisibleForTesting
| null | train | train | 2022-03-25T11:39:16 | "2022-02-16T09:25:37Z" | pikhovkin | train |
provectus/kafka-ui/1740_1774 | provectus/kafka-ui | provectus/kafka-ui/1740 | provectus/kafka-ui/1774 | [
"connected"
] | c79905ce32339634b2435a60e4b0f6892e076565 | 68f8eed8f84fc94ca01840805a5c3b8902fbfb96 | [
"1. While live mode is on (active loading) all the controls (search, offset, partitions select) should be disabled. \r\n2. Once \"stop loading\" is pressed, fetched messages should NOT disappear. And controls (p. 1) should be enabled back again."
] | [
"`toggle` usually implies only two possible states **on** || **off** (true || false);\r\n\r\nLet's try to fine more suitable name for this method. Eg: `setSeekDirection` ",
"Pls describe)",
"from my point of view, it is better when the name of test case describes the behavior of the component, and not the actions inside the test case",
"> it reacts to a change of seekDirection in the url ....",
"okay will do.",
"yeah it makes total sense , i will fix it."
] | "2022-03-28T19:43:53Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted"
] | Live tailing improvements | 1. New messages should appear on top
2. Pagination buttons (e.g. "Next") shouldn't be visible.
3.
wrong parameters passed for live tailing:
`https://www.kafka-ui.provectus.io/api/clusters/local/topics/7890/messages?filterQueryType=STRING_CONTAINS&attempt=1&limit=100&seekDirection=TAILING&seekType=OFFSET&seekTo=0::0`
this should be `https://www.kafka-ui.provectus.io/api/clusters/local/topics/7890/messages&seekDirection=TAILING&seekType=LATEST&seekTo=0::0`
`seekType` should be `LATEST`
`attempt` has no effect (can be removed from all endpoints)
`limit` has no effect in TAILING mode
(not critical) `filterQueryType` make sense only when `q` param passed
`seekTo` should be 0::0,1::0,... where first number is partition
#943 | [
"kafka-ui-react-app/src/components/KsqlDb/Query/__test__/Query.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/Filters.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Messages.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx",
"kafka-ui-react-app/src/redux/reducers/topicMessages/reducer.ts"
] | [
"kafka-ui-react-app/src/components/KsqlDb/Query/__test__/Query.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/Filters.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Messages.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/Messages.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/MessagesTable.spec.tsx",
"kafka-ui-react-app/src/components/contexts/TopicMessagesContext.ts",
"kafka-ui-react-app/src/redux/reducers/topicMessages/reducer.ts"
] | [
"kafka-ui-react-app/src/lib/testHelpers.tsx"
] | diff --git a/kafka-ui-react-app/src/components/KsqlDb/Query/__test__/Query.spec.tsx b/kafka-ui-react-app/src/components/KsqlDb/Query/__test__/Query.spec.tsx
index 0e4884ce1c3..7b6f133f2a5 100644
--- a/kafka-ui-react-app/src/components/KsqlDb/Query/__test__/Query.spec.tsx
+++ b/kafka-ui-react-app/src/components/KsqlDb/Query/__test__/Query.spec.tsx
@@ -1,4 +1,4 @@
-import { render } from 'lib/testHelpers';
+import { render, EventSourceMock } from 'lib/testHelpers';
import React from 'react';
import Query, {
getFormattedErrorFromTableData,
@@ -20,27 +20,6 @@ const renderComponent = () =>
}
);
-// Small mock to get rid of reference error
-class EventSourceMock {
- url: string;
-
- close: () => void;
-
- open: () => void;
-
- error: () => void;
-
- onmessage: () => void;
-
- constructor(url: string) {
- this.url = url;
- this.open = jest.fn();
- this.error = jest.fn();
- this.onmessage = jest.fn();
- this.close = jest.fn();
- }
-}
-
describe('Query', () => {
it('renders', () => {
renderComponent();
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
index 84aaa0c7629..379a48f68e6 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
@@ -10,7 +10,7 @@ import {
TopicMessageEventTypeEnum,
MessageFilterType,
} from 'generated-sources';
-import React from 'react';
+import React, { useContext } from 'react';
import { omitBy } from 'lodash';
import { useHistory, useLocation } from 'react-router';
import DatePicker from 'react-datepicker';
@@ -25,6 +25,8 @@ import { Button } from 'components/common/Button/Button';
import FilterModal, {
FilterEdit,
} from 'components/Topics/Topic/Details/Messages/Filters/FilterModal';
+import { SeekDirectionOptions } from 'components/Topics/Topic/Details/Messages/Messages';
+import TopicMessagesContext from 'components/contexts/TopicMessagesContext';
import * as S from './Filters.styled';
import {
@@ -66,11 +68,6 @@ export const SeekTypeOptions = [
{ value: SeekType.OFFSET, label: 'Offset' },
{ value: SeekType.TIMESTAMP, label: 'Timestamp' },
];
-export const SeekDirectionOptions = [
- { value: SeekDirection.FORWARD, label: 'Oldest First', isLive: false },
- { value: SeekDirection.BACKWARD, label: 'Newest First', isLive: false },
- { value: SeekDirection.TAILING, label: 'Live Mode', isLive: true },
-];
const Filters: React.FC<FiltersProps> = ({
clusterName,
@@ -88,16 +85,14 @@ const Filters: React.FC<FiltersProps> = ({
const location = useLocation();
const history = useHistory();
+ const { searchParams, seekDirection, isLive, changeSeekDirection } =
+ useContext(TopicMessagesContext);
+
const [isOpen, setIsOpen] = React.useState(false);
const toggleIsOpen = () => setIsOpen(!isOpen);
const source = React.useRef<EventSource | null>(null);
- const searchParams = React.useMemo(
- () => new URLSearchParams(location.search),
- [location]
- );
-
const [selectedPartitions, setSelectedPartitions] = React.useState<Option[]>(
getSelectedPartitionsFromSeekToParam(searchParams, partitions)
);
@@ -132,10 +127,6 @@ const Filters: React.FC<FiltersProps> = ({
: MessageFilterType.STRING_CONTAINS
);
const [query, setQuery] = React.useState<string>(searchParams.get('q') || '');
- const [seekDirection, setSeekDirection] = React.useState<SeekDirection>(
- (searchParams.get('seekDirection') as SeekDirection) ||
- SeekDirection.FORWARD
- );
const isSeekTypeControlVisible = React.useMemo(
() => selectedPartitions.length > 0,
[selectedPartitions]
@@ -178,7 +169,7 @@ const Filters: React.FC<FiltersProps> = ({
setAttempt(attempt + 1);
if (isSeekTypeControlVisible) {
- props.seekType = currentSeekType;
+ props.seekType = isLive ? SeekType.LATEST : currentSeekType;
props.seekTo = selectedPartitions.map(({ value }) => {
let seekToOffset;
@@ -217,21 +208,6 @@ const Filters: React.FC<FiltersProps> = ({
query,
]);
- const toggleSeekDirection = (val: string) => {
- switch (val) {
- case SeekDirection.FORWARD:
- setSeekDirection(SeekDirection.FORWARD);
- break;
- case SeekDirection.BACKWARD:
- setSeekDirection(SeekDirection.BACKWARD);
- break;
- case SeekDirection.TAILING:
- setSeekDirection(SeekDirection.TAILING);
- break;
- default:
- }
- };
-
const handleSSECancel = () => {
if (!source.current) return;
@@ -295,7 +271,7 @@ const Filters: React.FC<FiltersProps> = ({
};
// eslint-disable-next-line consistent-return
React.useEffect(() => {
- if (location.search.length !== 0) {
+ if (location.search?.length !== 0) {
const url = `${BASE_PARAMS.basePath}/api/clusters/${clusterName}/topics/${topicName}/messages${location.search}`;
const sse = new EventSource(url);
@@ -346,7 +322,7 @@ const Filters: React.FC<FiltersProps> = ({
updatePhase,
]);
React.useEffect(() => {
- if (location.search.length === 0) {
+ if (location.search?.length === 0) {
handleFiltersSubmit();
}
}, [handleFiltersSubmit, location]);
@@ -376,7 +352,7 @@ const Filters: React.FC<FiltersProps> = ({
selectSize="M"
minWidth="100px"
options={SeekTypeOptions}
- disabled={seekDirection === SeekDirection.TAILING}
+ disabled={isLive}
/>
{currentSeekType === SeekType.OFFSET ? (
<Input
@@ -387,7 +363,7 @@ const Filters: React.FC<FiltersProps> = ({
className="offset-selector"
placeholder="Offset"
onChange={({ target: { value } }) => setOffset(value)}
- disabled={seekDirection === SeekDirection.TAILING}
+ disabled={isLive}
/>
) : (
<DatePicker
@@ -398,7 +374,7 @@ const Filters: React.FC<FiltersProps> = ({
dateFormat="MMMM d, yyyy HH:mm"
className="date-picker"
placeholderText="Select timestamp"
- disabled={seekDirection === SeekDirection.TAILING}
+ disabled={isLive}
/>
)}
</S.SeekTypeSelectorWrapper>
@@ -440,11 +416,11 @@ const Filters: React.FC<FiltersProps> = ({
</S.FilterInputs>
<Select
selectSize="M"
- onChange={(option) => toggleSeekDirection(option as string)}
+ onChange={(option) => changeSeekDirection(option as string)}
value={seekDirection}
minWidth="120px"
options={SeekDirectionOptions}
- isLive={seekDirection === SeekDirection.TAILING}
+ isLive={isLive}
/>
</div>
<S.ActiveSmartFilterWrapper>
@@ -479,12 +455,12 @@ const Filters: React.FC<FiltersProps> = ({
isFetching &&
phaseMessage}
</p>
- <S.MessageLoading isLive={seekDirection === SeekDirection.TAILING}>
+ <S.MessageLoading isLive={isLive}>
<S.MessageLoadingSpinner isFetching={isFetching} />
Loading messages.
<S.StopLoading
onClick={() => {
- setSeekDirection(SeekDirection.FORWARD);
+ changeSeekDirection(SeekDirection.FORWARD);
setIsFetching(false);
}}
>
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/Filters.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/Filters.spec.tsx
index 09418a5346a..4e453782026 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/Filters.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/Filters.spec.tsx
@@ -1,29 +1,46 @@
import React from 'react';
+import { SeekDirectionOptions } from 'components/Topics/Topic/Details/Messages/Messages';
import Filters, {
FiltersProps,
- SeekDirectionOptions,
SeekTypeOptions,
} from 'components/Topics/Topic/Details/Messages/Filters/Filters';
import { render } from 'lib/testHelpers';
import { screen, waitFor, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
+import TopicMessagesContext, {
+ ContextProps,
+} from 'components/contexts/TopicMessagesContext';
+import { SeekDirection } from 'generated-sources';
-const setupWrapper = (props?: Partial<FiltersProps>) =>
+const defaultContextValue: ContextProps = {
+ isLive: false,
+ seekDirection: SeekDirection.FORWARD,
+ searchParams: new URLSearchParams(''),
+ changeSeekDirection: jest.fn(),
+};
+
+const setupWrapper = (
+ props: Partial<FiltersProps> = {},
+ ctx: ContextProps = defaultContextValue
+) => {
render(
- <Filters
- clusterName="test-cluster"
- topicName="test-topic"
- partitions={[{ partition: 0, offsetMin: 0, offsetMax: 100 }]}
- meta={{}}
- isFetching={false}
- addMessage={jest.fn()}
- resetMessages={jest.fn()}
- updatePhase={jest.fn()}
- updateMeta={jest.fn()}
- setIsFetching={jest.fn()}
- {...props}
- />
+ <TopicMessagesContext.Provider value={ctx}>
+ <Filters
+ clusterName="test-cluster"
+ topicName="test-topic"
+ partitions={[{ partition: 0, offsetMin: 0, offsetMax: 100 }]}
+ meta={{}}
+ isFetching={false}
+ addMessage={jest.fn()}
+ resetMessages={jest.fn()}
+ updatePhase={jest.fn()}
+ updateMeta={jest.fn()}
+ setIsFetching={jest.fn()}
+ {...props}
+ />
+ </TopicMessagesContext.Provider>
);
+};
describe('Filters component', () => {
it('renders component', () => {
setupWrapper();
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Messages.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Messages.tsx
index e685720f5f9..dde0eaa7ff1 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Messages.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Messages.tsx
@@ -1,13 +1,84 @@
-import React from 'react';
+import React, { useCallback, useMemo, useState } from 'react';
+import TopicMessagesContext from 'components/contexts/TopicMessagesContext';
+import { SeekDirection } from 'generated-sources';
+import { useLocation } from 'react-router';
import FiltersContainer from './Filters/FiltersContainer';
import MessagesTable from './MessagesTable';
-const Messages: React.FC = () => (
- <div>
- <FiltersContainer />
- <MessagesTable />
- </div>
-);
+export const SeekDirectionOptionsObj = {
+ [SeekDirection.FORWARD]: {
+ value: SeekDirection.FORWARD,
+ label: 'Oldest First',
+ isLive: false,
+ },
+ [SeekDirection.BACKWARD]: {
+ value: SeekDirection.BACKWARD,
+ label: 'Newest First',
+ isLive: false,
+ },
+ [SeekDirection.TAILING]: {
+ value: SeekDirection.TAILING,
+ label: 'Live Mode',
+ isLive: true,
+ },
+};
+
+export const SeekDirectionOptions = Object.values(SeekDirectionOptionsObj);
+
+const Messages: React.FC = () => {
+ const location = useLocation();
+
+ const searchParams = React.useMemo(
+ () => new URLSearchParams(location.search),
+ [location.search]
+ );
+
+ const defaultSeekValue = SeekDirectionOptions[0];
+
+ const [seekDirection, setSeekDirection] = React.useState<SeekDirection>(
+ (searchParams.get('seekDirection') as SeekDirection) ||
+ defaultSeekValue.value
+ );
+
+ const [isLive, setIsLive] = useState<boolean>(
+ SeekDirectionOptionsObj[seekDirection].isLive
+ );
+
+ const changeSeekDirection = useCallback((val: string) => {
+ switch (val) {
+ case SeekDirection.FORWARD:
+ setSeekDirection(SeekDirection.FORWARD);
+ setIsLive(SeekDirectionOptionsObj[SeekDirection.FORWARD].isLive);
+ break;
+ case SeekDirection.BACKWARD:
+ setSeekDirection(SeekDirection.BACKWARD);
+ setIsLive(SeekDirectionOptionsObj[SeekDirection.BACKWARD].isLive);
+ break;
+ case SeekDirection.TAILING:
+ setSeekDirection(SeekDirection.TAILING);
+ setIsLive(SeekDirectionOptionsObj[SeekDirection.TAILING].isLive);
+ break;
+ default:
+ }
+ }, []);
+
+ const contextValue = useMemo(
+ () => ({
+ seekDirection,
+ searchParams,
+ changeSeekDirection,
+ isLive,
+ }),
+ [seekDirection, searchParams, changeSeekDirection]
+ );
+
+ return (
+ <TopicMessagesContext.Provider value={contextValue}>
+ <FiltersContainer />
+ <MessagesTable />
+ </TopicMessagesContext.Provider>
+ );
+};
export default Messages;
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx
index f1fc9c14bfd..c3174403556 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx
@@ -4,13 +4,14 @@ import TableHeaderCell from 'components/common/table/TableHeaderCell/TableHeader
import { SeekDirection, TopicMessage } from 'generated-sources';
import styled from 'styled-components';
import { compact, concat, groupBy, map, maxBy, minBy } from 'lodash';
-import React from 'react';
+import React, { useContext } from 'react';
import { useSelector } from 'react-redux';
-import { useHistory, useLocation } from 'react-router';
+import { useHistory } from 'react-router';
import {
getTopicMessges,
getIsTopicMessagesFetching,
} from 'redux/reducers/topicMessages/selectors';
+import TopicMessagesContext from 'components/contexts/TopicMessagesContext';
import Message from './Message';
import * as S from './MessageContent/MessageContent.styled';
@@ -22,13 +23,9 @@ const MessagesPaginationWrapperStyled = styled.div`
`;
const MessagesTable: React.FC = () => {
- const location = useLocation();
const history = useHistory();
- const searchParams = React.useMemo(
- () => new URLSearchParams(location.search),
- [location]
- );
+ const { searchParams, isLive } = useContext(TopicMessagesContext);
const messages = useSelector(getTopicMessges);
const isFetching = useSelector(getIsTopicMessagesFetching);
@@ -94,7 +91,7 @@ const MessagesTable: React.FC = () => {
message={message}
/>
))}
- {isFetching && (
+ {(isFetching || isLive) && !messages.length && (
<tr>
<td colSpan={10}>
<PageLoader />
@@ -108,9 +105,13 @@ const MessagesTable: React.FC = () => {
)}
</tbody>
</Table>
- <MessagesPaginationWrapperStyled>
- <S.PaginationButton onClick={handleNextClick}>Next</S.PaginationButton>
- </MessagesPaginationWrapperStyled>
+ {!isLive && (
+ <MessagesPaginationWrapperStyled>
+ <S.PaginationButton onClick={handleNextClick}>
+ Next
+ </S.PaginationButton>
+ </MessagesPaginationWrapperStyled>
+ )}
</>
);
};
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/Messages.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/Messages.spec.tsx
new file mode 100644
index 00000000000..05d9eb0a461
--- /dev/null
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/Messages.spec.tsx
@@ -0,0 +1,77 @@
+import React from 'react';
+import { screen } from '@testing-library/react';
+import { render, EventSourceMock } from 'lib/testHelpers';
+import Messages, {
+ SeekDirectionOptions,
+ SeekDirectionOptionsObj,
+} from 'components/Topics/Topic/Details/Messages/Messages';
+import { Router } from 'react-router-dom';
+import { createMemoryHistory } from 'history';
+import { SeekDirection, SeekType } from 'generated-sources';
+import userEvent from '@testing-library/user-event';
+
+describe('Messages', () => {
+ const searchParams = `?filterQueryType=STRING_CONTAINS&attempt=0&limit=100&seekDirection=${SeekDirection.FORWARD}&seekType=${SeekType.OFFSET}&seekTo=0::9`;
+
+ const setUpComponent = (param: string = searchParams) => {
+ const history = createMemoryHistory();
+ history.push({
+ search: new URLSearchParams(param).toString(),
+ });
+ return render(
+ <Router history={history}>
+ <Messages />
+ </Router>
+ );
+ };
+
+ beforeEach(() => {
+ Object.defineProperty(window, 'EventSource', {
+ value: EventSourceMock,
+ });
+ });
+ describe('component rendering default behavior with the search params', () => {
+ beforeEach(() => {
+ setUpComponent();
+ });
+ it('should check default seekDirection if it actually take the value from the url', () => {
+ expect(screen.getByRole('listbox')).toHaveTextContent(
+ SeekDirectionOptionsObj[SeekDirection.FORWARD].label
+ );
+ });
+
+ it('should check the SeekDirection select changes', () => {
+ const seekDirectionSelect = screen.getByRole('listbox');
+ const seekDirectionOption = screen.getByRole('option');
+
+ expect(seekDirectionOption).toHaveTextContent(
+ SeekDirectionOptionsObj[SeekDirection.FORWARD].label
+ );
+
+ const labelValue1 = SeekDirectionOptions[1].label;
+ userEvent.click(seekDirectionSelect);
+ userEvent.selectOptions(seekDirectionSelect, [
+ SeekDirectionOptions[1].label,
+ ]);
+ expect(seekDirectionOption).toHaveTextContent(labelValue1);
+
+ const labelValue0 = SeekDirectionOptions[0].label;
+ userEvent.click(seekDirectionSelect);
+ userEvent.selectOptions(seekDirectionSelect, [
+ SeekDirectionOptions[0].label,
+ ]);
+ expect(seekDirectionOption).toHaveTextContent(labelValue0);
+ });
+ });
+
+ describe('Component rendering with custom Url search params', () => {
+ it('reacts to a change of seekDirection in the url which make the select pick up different value', () => {
+ setUpComponent(
+ searchParams.replace(SeekDirection.FORWARD, SeekDirection.BACKWARD)
+ );
+ expect(screen.getByRole('listbox')).toHaveTextContent(
+ SeekDirectionOptionsObj[SeekDirection.BACKWARD].label
+ );
+ });
+ });
+});
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/MessagesTable.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/MessagesTable.spec.tsx
new file mode 100644
index 00000000000..3994e1e1e4a
--- /dev/null
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/MessagesTable.spec.tsx
@@ -0,0 +1,73 @@
+import React from 'react';
+import { screen } from '@testing-library/react';
+import { render } from 'lib/testHelpers';
+import MessagesTable from 'components/Topics/Topic/Details/Messages/MessagesTable';
+import { Router } from 'react-router';
+import { createMemoryHistory } from 'history';
+import { SeekDirection, SeekType } from 'generated-sources';
+import userEvent from '@testing-library/user-event';
+import TopicMessagesContext, {
+ ContextProps,
+} from 'components/contexts/TopicMessagesContext';
+
+describe('MessagesTable', () => {
+ const searchParams = new URLSearchParams(
+ `?filterQueryType=STRING_CONTAINS&attempt=0&limit=100&seekDirection=${SeekDirection.FORWARD}&seekType=${SeekType.OFFSET}&seekTo=0::9`
+ );
+ const contextValue: ContextProps = {
+ isLive: false,
+ seekDirection: SeekDirection.FORWARD,
+ searchParams,
+ changeSeekDirection: jest.fn(),
+ };
+
+ const setUpComponent = (
+ params: URLSearchParams = searchParams,
+ ctx: ContextProps = contextValue
+ ) => {
+ const history = createMemoryHistory();
+ history.push({
+ search: params.toString(),
+ });
+ return render(
+ <Router history={history}>
+ <TopicMessagesContext.Provider value={ctx}>
+ <MessagesTable />
+ </TopicMessagesContext.Provider>
+ </Router>
+ );
+ };
+
+ describe('Default props Setup for MessagesTable component', () => {
+ beforeEach(() => {
+ setUpComponent();
+ });
+
+ it('should check the render', () => {
+ expect(screen.getByRole('table')).toBeInTheDocument();
+ });
+
+ it('should check the if no elements is rendered in the table', () => {
+ expect(screen.getByText(/No messages found/i)).toBeInTheDocument();
+ });
+
+ it('should check if next button exist and check the click after next click', () => {
+ const nextBtnElement = screen.getByText(/next/i);
+ expect(nextBtnElement).toBeInTheDocument();
+ userEvent.click(nextBtnElement);
+ expect(screen.getByText(/No messages found/i)).toBeInTheDocument();
+ });
+ });
+
+ describe('Custom Setup with different props value', () => {
+ it('should check if next click is gone during isLive Param', () => {
+ setUpComponent(searchParams, { ...contextValue, isLive: true });
+ expect(screen.queryByText(/next/i)).not.toBeInTheDocument();
+ });
+
+ it('should check the display of the loader element', () => {
+ setUpComponent(searchParams, { ...contextValue, isLive: true });
+ expect(screen.getByRole('progressbar')).toBeInTheDocument();
+ });
+ });
+});
diff --git a/kafka-ui-react-app/src/components/contexts/TopicMessagesContext.ts b/kafka-ui-react-app/src/components/contexts/TopicMessagesContext.ts
new file mode 100644
index 00000000000..642052b27e8
--- /dev/null
+++ b/kafka-ui-react-app/src/components/contexts/TopicMessagesContext.ts
@@ -0,0 +1,15 @@
+import React from 'react';
+import { SeekDirection } from 'generated-sources';
+
+export interface ContextProps {
+ seekDirection: SeekDirection;
+ searchParams: URLSearchParams;
+ changeSeekDirection(val: string): void;
+ isLive: boolean;
+}
+
+const TopicMessagesContext = React.createContext<ContextProps>(
+ {} as ContextProps
+);
+
+export default TopicMessagesContext;
diff --git a/kafka-ui-react-app/src/redux/reducers/topicMessages/reducer.ts b/kafka-ui-react-app/src/redux/reducers/topicMessages/reducer.ts
index 8f85d46fb60..ecab598063d 100644
--- a/kafka-ui-react-app/src/redux/reducers/topicMessages/reducer.ts
+++ b/kafka-ui-react-app/src/redux/reducers/topicMessages/reducer.ts
@@ -19,7 +19,7 @@ const reducer = (state = initialState, action: Action): TopicMessagesState => {
case getType(actions.addTopicMessage): {
return {
...state,
- messages: [...state.messages, action.payload],
+ messages: [action.payload, ...state.messages],
};
}
case getType(actions.resetTopicMessages):
| diff --git a/kafka-ui-react-app/src/lib/testHelpers.tsx b/kafka-ui-react-app/src/lib/testHelpers.tsx
index f5f5640f629..2a0a75cc549 100644
--- a/kafka-ui-react-app/src/lib/testHelpers.tsx
+++ b/kafka-ui-react-app/src/lib/testHelpers.tsx
@@ -101,3 +101,23 @@ const customRender = (
};
export { customRender as render };
+
+export class EventSourceMock {
+ url: string;
+
+ close: () => void;
+
+ open: () => void;
+
+ error: () => void;
+
+ onmessage: () => void;
+
+ constructor(url: string) {
+ this.url = url;
+ this.open = jest.fn();
+ this.error = jest.fn();
+ this.onmessage = jest.fn();
+ this.close = jest.fn();
+ }
+}
| train | train | 2022-04-05T13:48:22 | "2022-03-20T18:33:58Z" | Haarolean | train |
provectus/kafka-ui/1738_1780 | provectus/kafka-ui | provectus/kafka-ui/1738 | provectus/kafka-ui/1780 | [
"timestamp(timedelta=19672.0, similarity=0.8567710303103238)",
"connected"
] | 4907e187f870c7e1e7dd366c2244491f0fee9506 | 913b8921b435b59bdfedf75446ad31b56eb8ae23 | [] | [] | "2022-03-30T10:20:45Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | UI: Topic creation "Time to retain data" rendenring looks strange | **Describe the bug**
"Time to retain data" section options are black.
Setup: max os, chrome, light theme.
**Streenshot:**
<img width="511" alt="Screenshot 2022-03-20 at 20 58 16" src="https://user-images.githubusercontent.com/702205/159175981-af428619-1a3a-48c9-a275-109967179ddf.png">
| [
"kafka-ui-react-app/src/components/Topics/shared/Form/TimeToRetainBtn.tsx",
"kafka-ui-react-app/src/components/Topics/shared/Form/TimeToRetainBtns.tsx",
"kafka-ui-react-app/src/components/Topics/shared/Form/TopicForm.styled.ts"
] | [
"kafka-ui-react-app/src/components/Topics/shared/Form/TimeToRetainBtn.tsx",
"kafka-ui-react-app/src/components/Topics/shared/Form/TimeToRetainBtns.tsx",
"kafka-ui-react-app/src/components/Topics/shared/Form/TopicForm.styled.ts",
"kafka-ui-react-app/src/components/Topics/shared/Form/__tests__/TimeToRetainBtn.spec.tsx",
"kafka-ui-react-app/src/components/Topics/shared/Form/__tests__/TimeToRetainBtns.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/shared/Form/TimeToRetainBtn.tsx b/kafka-ui-react-app/src/components/Topics/shared/Form/TimeToRetainBtn.tsx
index f6b745f98f0..2364d90516a 100644
--- a/kafka-ui-react-app/src/components/Topics/shared/Form/TimeToRetainBtn.tsx
+++ b/kafka-ui-react-app/src/components/Topics/shared/Form/TimeToRetainBtn.tsx
@@ -4,7 +4,7 @@ import { MILLISECONDS_IN_WEEK } from 'lib/constants';
import * as S from './TopicForm.styled';
-interface Props {
+export interface Props {
inputName: string;
text: string;
value: number;
@@ -16,7 +16,7 @@ const TimeToRetainBtn: React.FC<Props> = ({ inputName, text, value }) => {
return (
<S.Button
- isActive={watchedValue === value}
+ isActive={parseFloat(watchedValue) === value}
type="button"
onClick={() => setValue(inputName, value)}
>
diff --git a/kafka-ui-react-app/src/components/Topics/shared/Form/TimeToRetainBtns.tsx b/kafka-ui-react-app/src/components/Topics/shared/Form/TimeToRetainBtns.tsx
index e48392d6e4b..53376876e4b 100644
--- a/kafka-ui-react-app/src/components/Topics/shared/Form/TimeToRetainBtns.tsx
+++ b/kafka-ui-react-app/src/components/Topics/shared/Form/TimeToRetainBtns.tsx
@@ -4,7 +4,7 @@ import styled from 'styled-components';
import TimeToRetainBtn from './TimeToRetainBtn';
-interface Props {
+export interface Props {
name: string;
value: string;
}
diff --git a/kafka-ui-react-app/src/components/Topics/shared/Form/TopicForm.styled.ts b/kafka-ui-react-app/src/components/Topics/shared/Form/TopicForm.styled.ts
index 8d17bdc7cc2..fc46d8d9397 100644
--- a/kafka-ui-react-app/src/components/Topics/shared/Form/TopicForm.styled.ts
+++ b/kafka-ui-react-app/src/components/Topics/shared/Form/TopicForm.styled.ts
@@ -30,7 +30,7 @@ export const Button = styled.button<{ isActive: boolean }>`
background-color: ${({ theme, ...props }) =>
props.isActive
? theme.button.primary.backgroundColor.active
- : theme.button.primary.color};
+ : theme.button.primary.backgroundColor.normal};
height: 32px;
width: 46px;
border: 1px solid
diff --git a/kafka-ui-react-app/src/components/Topics/shared/Form/__tests__/TimeToRetainBtn.spec.tsx b/kafka-ui-react-app/src/components/Topics/shared/Form/__tests__/TimeToRetainBtn.spec.tsx
new file mode 100644
index 00000000000..dcc991b5075
--- /dev/null
+++ b/kafka-ui-react-app/src/components/Topics/shared/Form/__tests__/TimeToRetainBtn.spec.tsx
@@ -0,0 +1,75 @@
+import React from 'react';
+import { render } from 'lib/testHelpers';
+import { screen } from '@testing-library/react';
+import TimeToRetainBtn, {
+ Props,
+} from 'components/Topics/shared/Form/TimeToRetainBtn';
+import { useForm, FormProvider } from 'react-hook-form';
+import theme from 'theme/theme';
+import userEvent from '@testing-library/user-event';
+
+describe('TimeToRetainBtn', () => {
+ const defaultProps: Props = {
+ inputName: 'defaultPropsInputName',
+ text: 'defaultPropsText',
+ value: 0,
+ };
+ const Wrapper: React.FC = ({ children }) => {
+ const methods = useForm();
+ return <FormProvider {...methods}>{children}</FormProvider>;
+ };
+ const SetUpComponent = (props: Partial<Props> = {}) => {
+ const { inputName, text, value } = props;
+ render(
+ <Wrapper>
+ <TimeToRetainBtn
+ inputName={inputName || defaultProps.inputName}
+ text={text || defaultProps.text}
+ value={value || defaultProps.value}
+ />
+ </Wrapper>
+ );
+ };
+
+ describe('Component rendering with its Default Props Setups', () => {
+ beforeEach(() => {
+ SetUpComponent();
+ });
+ it('should test the component rendering on the screen', () => {
+ expect(screen.getByRole('button')).toBeInTheDocument();
+ expect(screen.getByText(defaultProps.text)).toBeInTheDocument();
+ });
+ it('should test the non active state of the button and its styling', () => {
+ const buttonElement = screen.getByRole('button');
+ expect(buttonElement).toHaveStyle(
+ `background-color:${theme.button.primary.backgroundColor.normal}`
+ );
+ expect(buttonElement).toHaveStyle(
+ `border:1px solid ${theme.button.primary.color}`
+ );
+ });
+ it('should test the non active state with click becoming active', () => {
+ const buttonElement = screen.getByRole('button');
+ userEvent.click(buttonElement);
+ expect(buttonElement).toHaveStyle(
+ `background-color:${theme.button.primary.backgroundColor.active}`
+ );
+ expect(buttonElement).toHaveStyle(
+ `border:1px solid ${theme.button.border.active}`
+ );
+ });
+ });
+
+ describe('Component rendering with its Default Props Setups', () => {
+ it('should test the active state of the button and its styling', () => {
+ SetUpComponent({ value: 604800000 });
+ const buttonElement = screen.getByRole('button');
+ expect(buttonElement).toHaveStyle(
+ `background-color:${theme.button.primary.backgroundColor.active}`
+ );
+ expect(buttonElement).toHaveStyle(
+ `border:1px solid ${theme.button.border.active}`
+ );
+ });
+ });
+});
diff --git a/kafka-ui-react-app/src/components/Topics/shared/Form/__tests__/TimeToRetainBtns.spec.tsx b/kafka-ui-react-app/src/components/Topics/shared/Form/__tests__/TimeToRetainBtns.spec.tsx
new file mode 100644
index 00000000000..b41793f6e41
--- /dev/null
+++ b/kafka-ui-react-app/src/components/Topics/shared/Form/__tests__/TimeToRetainBtns.spec.tsx
@@ -0,0 +1,32 @@
+import React from 'react';
+import { render } from 'lib/testHelpers';
+import { screen } from '@testing-library/react';
+import TimeToRetainBtns, {
+ Props,
+} from 'components/Topics/shared/Form/TimeToRetainBtns';
+import { FormProvider, useForm } from 'react-hook-form';
+
+describe('TimeToRetainBtns', () => {
+ const defaultProps: Props = {
+ name: 'defaultPropsTestingName',
+ value: 'defaultPropsValue',
+ };
+ const Wrapper: React.FC = ({ children }) => {
+ const methods = useForm();
+ return <FormProvider {...methods}>{children}</FormProvider>;
+ };
+ const SetUpComponent = (props: Props = defaultProps) => {
+ const { name, value } = props;
+
+ render(
+ <Wrapper>
+ <TimeToRetainBtns name={name} value={value} />
+ </Wrapper>
+ );
+ };
+
+ it('should test the normal view rendering of the component', () => {
+ SetUpComponent();
+ expect(screen.getAllByRole('button')).toHaveLength(5);
+ });
+});
| null | train | train | 2022-03-28T12:48:07 | "2022-03-20T18:00:47Z" | iliax | train |
provectus/kafka-ui/1744_1781 | provectus/kafka-ui | provectus/kafka-ui/1744 | provectus/kafka-ui/1781 | [
"connected"
] | 4b517c83a06d4df9a7c7e348e21852fffd592ac4 | f8b4b17ac3b80b877b2bfbf4ab11ceebfbe0aaba | [
"Hello there prajaktar1! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"Hey, thanks for reaching out. We'll take a look.",
"@Haarolean Is it ok if i look into this issue ?",
"@gaddam1987 yep, would be nice!",
"The issue is in react app, the callback on submit of the filter (this function https://github.com/provectus/kafka-ui/blob/master/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx#L181) is not able to use the fields set in the search criteria. The search always contains default search params irrespective of what we choose.\r\n\r\nI don't know why this happens i am not React guy but just going through react to fix this. Will try my best to fix this in this week :)",
"@prajaktar1 I fixed the issue, you can checkit out from this pull request https://github.com/provectus/kafka-ui/pull/1781 and see if that works, i have tested from my side and it worked."
] | [] | "2022-03-30T12:12:32Z" | [
"type/bug",
"scope/frontend",
"status/accepted"
] | Timestamp filtering is broken | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
On trying to search for logs for a specific date, or using a keyword(some text relevant to a log). The search results in incorrect result set.
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
Version: e85e1aafa1250573a8056bf14ee4003d3179cbae
App is run : Pod inside EKS cluster
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Open the Kafka-UI
2. Navigate to a Kafka topic
3. Within the selected Kafka topic, navigate to Messages tab
4. Try to search using a timestamp, for example current date
5. Try searching with some text you wish to fetch the log result containing it
6. In both the above selections, incorrect result is rendered
7. Refer screenshot attached
**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
1. If I enter search parameter as timestamp=17th march, 2022, I should be able to fetch message logs only for 17th March
Currently, result rendered contains logs from feb, refer screenshot
2. If I enter search parameter as some keyword(text), it does not filter and render the result logs containing just the searched
keyword, it renders all the data by default
**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->

**Additional context**
<!--
(Add any other context about the problem here)
-->
| [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
index 69d1159aaef..84aaa0c7629 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
@@ -208,7 +208,14 @@ const Filters: React.FC<FiltersProps> = ({
search: `?${qs}`,
});
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [seekDirection, queryType, activeFilter]);
+ }, [
+ seekDirection,
+ queryType,
+ activeFilter,
+ currentSeekType,
+ timestamp,
+ query,
+ ]);
const toggleSeekDirection = (val: string) => {
switch (val) {
| null | test | train | 2022-04-04T10:59:51 | "2022-03-21T15:54:20Z" | prajaktar1 | train |
provectus/kafka-ui/1146_1787 | provectus/kafka-ui | provectus/kafka-ui/1146 | provectus/kafka-ui/1787 | [
"connected"
] | e113e363489482cfec1a478504d0a2076104e32c | 15ef0364cae7e4c6b6b2a27fff4ff2f8ef3b09f7 | [
"@Zorii4 I feel like this has been done already, please check\r\n\r\n"
] | [] | "2022-03-31T11:38:21Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted"
] | UI: Mark initializing clusters with yellow icon | ### Is your proposal related to a problem?
Currently after application startup we asynchronously start cluster metrics collection. Before collection finished cluster status is shown as offline (red). It can be confusing since offline (by some error) clusters are also marked as red.
(Write your answer here.)
### Describe the solution you'd like
I propose to mark 'initializing' clusters as yellow to highlight that it was not initialized yet. To distinguish this situations we need to check Cluster's lastError field. If it is **not** filled and status is offline cluster should be marked yellow.
### Describe alternatives you've considered
<!--
Let us know about other solutions you've tried or researched.
-->
(Write your answer here.)
### Additional context
<!--
Is there anything else you can add about the proposal?
You might want to link to related issues here, if you haven't already.
-->
(Write your answer here.)
| [
"kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts",
"kafka-ui-react-app/src/theme/theme.ts"
] | [
"kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts",
"kafka-ui-react-app/src/components/Nav/ClusterTab/__tests__/ClusterTab.styled.spec.tsx",
"kafka-ui-react-app/src/theme/theme.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts b/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts
index a01434b91aa..9b61878bba1 100644
--- a/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts
+++ b/kafka-ui-react-app/src/components/Nav/ClusterTab/ClusterTab.styled.ts
@@ -12,7 +12,7 @@ export const Wrapper = styled.li.attrs({ role: 'menuitem' })<{
display: grid;
grid-template-columns: min-content min-content auto min-content;
grid-template-areas: 'title status . chevron';
- gap: 0px 5px;
+ gap: 0 5px;
padding: 0.5em 0.75em;
cursor: pointer;
@@ -52,13 +52,20 @@ export const StatusIcon = styled.circle.attrs({
cx: 2,
cy: 2,
r: 2,
-})<{ status: ServerStatus }>(
- ({ theme, status }) => css`
- fill: ${status === ServerStatus.ONLINE
- ? theme.menu.statusIconColor.online
- : theme.menu.statusIconColor.offline};
- `
-);
+ role: 'status-circle',
+})<{ status: ServerStatus }>(({ theme, status }) => {
+ const statusColor: {
+ [k in ServerStatus]: string;
+ } = {
+ [ServerStatus.ONLINE]: theme.menu.statusIconColor.online,
+ [ServerStatus.OFFLINE]: theme.menu.statusIconColor.offline,
+ [ServerStatus.INITIALIZING]: theme.menu.statusIconColor.initializing,
+ };
+
+ return css`
+ fill: ${statusColor[status]};
+ `;
+});
export const ChevronWrapper = styled.svg.attrs({
viewBox: '0 0 10 6',
diff --git a/kafka-ui-react-app/src/components/Nav/ClusterTab/__tests__/ClusterTab.styled.spec.tsx b/kafka-ui-react-app/src/components/Nav/ClusterTab/__tests__/ClusterTab.styled.spec.tsx
new file mode 100644
index 00000000000..76b69ebd59b
--- /dev/null
+++ b/kafka-ui-react-app/src/components/Nav/ClusterTab/__tests__/ClusterTab.styled.spec.tsx
@@ -0,0 +1,47 @@
+import React from 'react';
+import { render } from 'lib/testHelpers';
+import theme from 'theme/theme';
+import { screen } from '@testing-library/react';
+import * as S from 'components/Nav/ClusterTab/ClusterTab.styled';
+import { ServerStatus } from 'generated-sources';
+
+describe('Cluster Styled Components', () => {
+ describe('Wrapper Component', () => {
+ it('should check the rendering and correct Styling when it is open', () => {
+ render(<S.Wrapper isOpen />);
+ expect(screen.getByRole('menuitem')).toHaveStyle(
+ `color:${theme.menu.color.isOpen}`
+ );
+ });
+ it('should check the rendering and correct Styling when it is Not open', () => {
+ render(<S.Wrapper isOpen={false} />);
+ expect(screen.getByRole('menuitem')).toHaveStyle(
+ `color:${theme.menu.color.normal}`
+ );
+ });
+ });
+
+ describe('StatusIcon Component', () => {
+ it('should check the rendering and correct Styling when it is online', () => {
+ render(<S.StatusIcon status={ServerStatus.ONLINE} />);
+
+ expect(screen.getByRole('status-circle')).toHaveStyle(
+ `fill:${theme.menu.statusIconColor.online}`
+ );
+ });
+
+ it('should check the rendering and correct Styling when it is offline', () => {
+ render(<S.StatusIcon status={ServerStatus.OFFLINE} />);
+ expect(screen.getByRole('status-circle')).toHaveStyle(
+ `fill:${theme.menu.statusIconColor.offline}`
+ );
+ });
+
+ it('should check the rendering and correct Styling when it is Initializing', () => {
+ render(<S.StatusIcon status={ServerStatus.INITIALIZING} />);
+ expect(screen.getByRole('status-circle')).toHaveStyle(
+ `fill:${theme.menu.statusIconColor.initializing}`
+ );
+ });
+ });
+});
diff --git a/kafka-ui-react-app/src/theme/theme.ts b/kafka-ui-react-app/src/theme/theme.ts
index e30cacfb209..e2b337a3ce5 100644
--- a/kafka-ui-react-app/src/theme/theme.ts
+++ b/kafka-ui-react-app/src/theme/theme.ts
@@ -225,6 +225,7 @@ const theme = {
statusIconColor: {
online: Colors.green[40],
offline: Colors.red[50],
+ initializing: Colors.yellow[20],
},
chevronIconColor: Colors.neutral[50],
},
| null | train | train | 2022-03-31T17:53:25 | "2021-11-30T11:09:37Z" | iliax | train |
provectus/kafka-ui/1663_1789 | provectus/kafka-ui | provectus/kafka-ui/1663 | provectus/kafka-ui/1789 | [
"timestamp(timedelta=1.0, similarity=0.9837510664044428)",
"connected"
] | 15ef0364cae7e4c6b6b2a27fff4ff2f8ef3b09f7 | 688b86a557a44a112ebd682a17f6db670cdadc39 | [
"@Mgrdich need to get rid of zk status badge in UI"
] | [] | "2022-04-01T08:55:07Z" | [
"type/enhancement",
"good first issue",
"scope/backend",
"scope/frontend",
"status/accepted",
"type/chore"
] | Get rid of zookeeper | [
"kafka-ui-react-app/src/components/Brokers/Brokers.tsx",
"kafka-ui-react-app/src/redux/actions/__test__/fixtures.ts",
"kafka-ui-react-app/src/redux/interfaces/broker.ts",
"kafka-ui-react-app/src/redux/reducers/brokers/__test__/fixtures.ts",
"kafka-ui-react-app/src/redux/reducers/brokers/__test__/selectors.spec.ts",
"kafka-ui-react-app/src/redux/reducers/brokers/brokersSlice.ts",
"kafka-ui-react-app/src/redux/reducers/brokers/selectors.ts"
] | [
"kafka-ui-react-app/src/components/Brokers/Brokers.tsx",
"kafka-ui-react-app/src/redux/actions/__test__/fixtures.ts",
"kafka-ui-react-app/src/redux/interfaces/broker.ts",
"kafka-ui-react-app/src/redux/reducers/brokers/__test__/fixtures.ts",
"kafka-ui-react-app/src/redux/reducers/brokers/__test__/selectors.spec.ts",
"kafka-ui-react-app/src/redux/reducers/brokers/brokersSlice.ts",
"kafka-ui-react-app/src/redux/reducers/brokers/selectors.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/Brokers/Brokers.tsx b/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
index fb2087d3213..506856d14af 100644
--- a/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
+++ b/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
@@ -1,9 +1,8 @@
import React from 'react';
-import { ClusterName, ZooKeeperStatus } from 'redux/interfaces';
+import { ClusterName } from 'redux/interfaces';
import useInterval from 'lib/hooks/useInterval';
import BytesFormatted from 'components/common/BytesFormatted/BytesFormatted';
import { useParams } from 'react-router';
-import { Tag } from 'components/common/Tag/Tag.styled';
import TableHeaderCell from 'components/common/table/TableHeaderCell/TableHeaderCell';
import { Table } from 'components/common/table/Table/Table.styled';
import PageHeading from 'components/common/PageHeading/PageHeading';
@@ -21,7 +20,6 @@ const Brokers: React.FC = () => {
const {
brokerCount,
activeControllers,
- zooKeeperStatus,
onlinePartitionCount,
offlinePartitionCount,
inSyncReplicasCount,
@@ -45,7 +43,6 @@ const Brokers: React.FC = () => {
fetchBrokers(clusterName);
}, 5000);
- const zkOnline = zooKeeperStatus === ZooKeeperStatus.online;
return (
<>
<PageHeading text="Brokers" />
@@ -57,11 +54,6 @@ const Brokers: React.FC = () => {
<Metrics.Indicator label="Active Controllers">
{activeControllers}
</Metrics.Indicator>
- <Metrics.Indicator label="Zookeeper Status">
- <Tag color={zkOnline ? 'green' : 'gray'}>
- {zkOnline ? 'online' : 'offline'}
- </Tag>
- </Metrics.Indicator>
<Metrics.Indicator label="Version">{version}</Metrics.Indicator>
</Metrics.Section>
<Metrics.Section title="Partitions">
diff --git a/kafka-ui-react-app/src/redux/actions/__test__/fixtures.ts b/kafka-ui-react-app/src/redux/actions/__test__/fixtures.ts
index d4a007aaaa9..c7aaff49682 100644
--- a/kafka-ui-react-app/src/redux/actions/__test__/fixtures.ts
+++ b/kafka-ui-react-app/src/redux/actions/__test__/fixtures.ts
@@ -9,7 +9,6 @@ import {
export const clusterStats: ClusterStats = {
brokerCount: 1,
- zooKeeperStatus: 1,
activeControllers: 1,
onlinePartitionCount: 6,
offlinePartitionCount: 0,
diff --git a/kafka-ui-react-app/src/redux/interfaces/broker.ts b/kafka-ui-react-app/src/redux/interfaces/broker.ts
index a0bf9ceae6d..b9dfa7d30d8 100644
--- a/kafka-ui-react-app/src/redux/interfaces/broker.ts
+++ b/kafka-ui-react-app/src/redux/interfaces/broker.ts
@@ -2,11 +2,6 @@ import { ClusterStats, Broker } from 'generated-sources';
export type BrokerId = Broker['id'];
-export enum ZooKeeperStatus {
- offline,
- online,
-}
-
export interface BrokersState extends ClusterStats {
items: Broker[];
}
diff --git a/kafka-ui-react-app/src/redux/reducers/brokers/__test__/fixtures.ts b/kafka-ui-react-app/src/redux/reducers/brokers/__test__/fixtures.ts
index b3ddb147ad4..b5b953e6696 100644
--- a/kafka-ui-react-app/src/redux/reducers/brokers/__test__/fixtures.ts
+++ b/kafka-ui-react-app/src/redux/reducers/brokers/__test__/fixtures.ts
@@ -5,7 +5,6 @@ export const brokersPayload = [
export const clusterStatsPayload = {
brokerCount: 2,
- zooKeeperStatus: 1,
activeControllers: 1,
onlinePartitionCount: 138,
offlinePartitionCount: 0,
@@ -22,7 +21,6 @@ export const clusterStatsPayload = {
export const initialBrokersReducerState = {
items: brokersPayload,
brokerCount: 2,
- zooKeeperStatus: 1,
activeControllers: 1,
onlinePartitionCount: 138,
offlinePartitionCount: 0,
@@ -39,7 +37,6 @@ export const initialBrokersReducerState = {
export const updatedBrokersReducerState = {
items: brokersPayload,
brokerCount: 2,
- zooKeeperStatus: 1,
activeControllers: 1,
onlinePartitionCount: 138,
offlinePartitionCount: 0,
diff --git a/kafka-ui-react-app/src/redux/reducers/brokers/__test__/selectors.spec.ts b/kafka-ui-react-app/src/redux/reducers/brokers/__test__/selectors.spec.ts
index ec652138b58..119d984cf6a 100644
--- a/kafka-ui-react-app/src/redux/reducers/brokers/__test__/selectors.spec.ts
+++ b/kafka-ui-react-app/src/redux/reducers/brokers/__test__/selectors.spec.ts
@@ -14,9 +14,6 @@ describe('Brokers selectors', () => {
it('returns broker count', () => {
expect(selectors.getBrokerCount(getState())).toEqual(0);
});
- it('returns zooKeeper status', () => {
- expect(selectors.getZooKeeperStatus(getState())).toEqual(0);
- });
it('returns active controllers', () => {
expect(selectors.getActiveControllers(getState())).toEqual(0);
});
@@ -55,9 +52,6 @@ describe('Brokers selectors', () => {
it('returns broker count', () => {
expect(selectors.getBrokerCount(getState())).toEqual(2);
});
- it('returns zooKeeper status', () => {
- expect(selectors.getZooKeeperStatus(getState())).toEqual(1);
- });
it('returns active controllers', () => {
expect(selectors.getActiveControllers(getState())).toEqual(1);
});
diff --git a/kafka-ui-react-app/src/redux/reducers/brokers/brokersSlice.ts b/kafka-ui-react-app/src/redux/reducers/brokers/brokersSlice.ts
index c6d353cc520..d7c762e4a62 100644
--- a/kafka-ui-react-app/src/redux/reducers/brokers/brokersSlice.ts
+++ b/kafka-ui-react-app/src/redux/reducers/brokers/brokersSlice.ts
@@ -1,10 +1,5 @@
import { BrokersApi, ClustersApi, Configuration } from 'generated-sources';
-import {
- BrokersState,
- ClusterName,
- RootState,
- ZooKeeperStatus,
-} from 'redux/interfaces';
+import { BrokersState, ClusterName, RootState } from 'redux/interfaces';
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
import { BASE_PARAMS } from 'lib/constants';
@@ -26,7 +21,6 @@ export const fetchClusterStats = createAsyncThunk(
export const initialState: BrokersState = {
items: [],
brokerCount: 0,
- zooKeeperStatus: ZooKeeperStatus.offline,
activeControllers: 0,
onlinePartitionCount: 0,
offlinePartitionCount: 0,
diff --git a/kafka-ui-react-app/src/redux/reducers/brokers/selectors.ts b/kafka-ui-react-app/src/redux/reducers/brokers/selectors.ts
index c6038a09b3f..31654a70d83 100644
--- a/kafka-ui-react-app/src/redux/reducers/brokers/selectors.ts
+++ b/kafka-ui-react-app/src/redux/reducers/brokers/selectors.ts
@@ -7,10 +7,6 @@ export const getBrokerCount = createSelector(
brokersState,
({ brokerCount }) => brokerCount
);
-export const getZooKeeperStatus = createSelector(
- brokersState,
- ({ zooKeeperStatus }) => zooKeeperStatus
-);
export const getActiveControllers = createSelector(
brokersState,
({ activeControllers }) => activeControllers
| null | test | train | 2022-03-31T22:30:19 | "2022-02-22T15:50:33Z" | Haarolean | train |
|
provectus/kafka-ui/1773_1791 | provectus/kafka-ui | provectus/kafka-ui/1773 | provectus/kafka-ui/1791 | [
"connected"
] | f8b4b17ac3b80b877b2bfbf4ab11ceebfbe0aaba | b4df8a73c8360200ab74e00adde72da904074547 | [
"Hello @raphaelauv ,\r\ncan you please share your setup: what version of kafka & ksqldb and kafka-ui you use?",
"kafka `3.1.0`\r\nksqldb `0.24`\r\nkafka-ui: `provectuslabs/kafka-ui:73266f86af4c3cf093afdedcd9880b5f92d4c328`",
"thanks @iliax :+1: ",
"\r\nwith `b4df8a73c8360200ab74e00adde72da904074547`\r\n",
"@raphaelauv you are welcome, thank you for creating issue π \r\n"
] | [
"not connected with issues, just small fix",
"can we extract these magic numbers as a constants please?"
] | "2022-04-03T11:20:47Z" | [
"type/bug",
"scope/backend",
"status/accepted",
"status/confirmed"
] | KSQLDB pull query fail | **Describe the bug**
I could execute all the previous query of the confluent doc -> https://ksqldb.io/quickstart.html but not a `Pull query`
<!--(A clear and concise description of what the bug is.)-->

**Expected behavior**
If I try with a ksqldb-cli it work

| [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/schemaregistry/SchemaRegistryAwareRecordSerDe.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ksql/KsqlApiClient.java"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/schemaregistry/SchemaRegistryAwareRecordSerDe.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ksql/KsqlApiClient.java"
] | [
"kafka-ui-api/src/test/java/com/provectus/kafka/ui/container/KsqlDbContainer.java",
"kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/ksql/KsqlApiClientTest.java"
] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/schemaregistry/SchemaRegistryAwareRecordSerDe.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/schemaregistry/SchemaRegistryAwareRecordSerDe.java
index 8f1bf5d35cd..ad15821607f 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/schemaregistry/SchemaRegistryAwareRecordSerDe.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serde/schemaregistry/SchemaRegistryAwareRecordSerDe.java
@@ -43,6 +43,9 @@
@Slf4j
public class SchemaRegistryAwareRecordSerDe implements RecordSerDe {
+ private static final byte SR_RECORD_MAGIC_BYTE = (byte) 0;
+ private static final int SR_RECORD_PREFIX_LENGTH = 5;
+
private static final StringMessageFormatter FALLBACK_FORMATTER = new StringMessageFormatter();
private static final ProtobufSchemaConverter protoSchemaConverter = new ProtobufSchemaConverter();
@@ -260,7 +263,7 @@ private Optional<MessageFormat> getMessageFormatBySchemaId(int schemaId) {
private Optional<Integer> extractSchemaIdFromMsg(ConsumerRecord<Bytes, Bytes> msg, boolean isKey) {
Bytes bytes = isKey ? msg.key() : msg.value();
ByteBuffer buffer = ByteBuffer.wrap(bytes.get());
- if (buffer.get() == 0 && buffer.remaining() > 4) {
+ if (buffer.remaining() > SR_RECORD_PREFIX_LENGTH && buffer.get() == SR_RECORD_MAGIC_BYTE) {
int id = buffer.getInt();
return Optional.of(id);
}
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ksql/KsqlApiClient.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ksql/KsqlApiClient.java
index 5414fcf325f..339431b295e 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ksql/KsqlApiClient.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ksql/KsqlApiClient.java
@@ -6,6 +6,7 @@
import static ksql.KsqlGrammarParser.UndefineVariableContext;
import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.TextNode;
import com.provectus.kafka.ui.model.KafkaCluster;
import com.provectus.kafka.ui.service.ksql.response.ResponseParser;
@@ -16,10 +17,15 @@
import lombok.Builder;
import lombok.Value;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.core.codec.DecodingException;
import org.springframework.http.MediaType;
+import org.springframework.http.codec.json.Jackson2JsonDecoder;
+import org.springframework.util.MimeTypeUtils;
+import org.springframework.web.reactive.function.client.ExchangeStrategies;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
@Slf4j
public class KsqlApiClient {
@@ -53,7 +59,20 @@ public KsqlApiClient(KafkaCluster cluster) {
}
private WebClient webClient() {
- return WebClient.create();
+ var exchangeStrategies = ExchangeStrategies.builder()
+ .codecs(configurer -> {
+ configurer.customCodecs()
+ .register(
+ new Jackson2JsonDecoder(
+ new ObjectMapper(),
+ // some ksqldb versions do not set content-type header in response,
+ // but we still need to use JsonDecoder for it
+ MimeTypeUtils.APPLICATION_OCTET_STREAM));
+ })
+ .build();
+ return WebClient.builder()
+ .exchangeStrategies(exchangeStrategies)
+ .build();
}
private String baseKsqlDbUri() {
@@ -69,10 +88,11 @@ private Flux<KsqlResponseTable> executeSelect(String ksql, Map<String, String> s
.post()
.uri(baseKsqlDbUri() + "/query")
.accept(MediaType.parseMediaType("application/vnd.ksql.v1+json"))
- .contentType(MediaType.parseMediaType("application/json"))
+ .contentType(MediaType.parseMediaType("application/vnd.ksql.v1+json"))
.bodyValue(ksqlRequest(ksql, streamProperties))
.retrieve()
.bodyToFlux(JsonNode.class)
+ .onErrorResume(this::isUnexpectedJsonArrayEndCharException, th -> Mono.empty())
.map(ResponseParser::parseSelectResponse)
.filter(Optional::isPresent)
.map(Optional::get)
@@ -80,6 +100,18 @@ private Flux<KsqlResponseTable> executeSelect(String ksql, Map<String, String> s
e -> Flux.just(ResponseParser.parseErrorResponse(e)));
}
+ /**
+ * Some version of ksqldb (?..0.24) can cut off json streaming without respect proper array ending like <p/>
+ * <code>[{"header":{"queryId":"...","schema":"..."}}, ]</code>
+ * which will cause json parsing error and will be propagated to UI.
+ * This is a know issue(https://github.com/confluentinc/ksql/issues/8746), but we don't know when it will be fixed.
+ * To workaround this we need to check DecodingException err msg.
+ */
+ private boolean isUnexpectedJsonArrayEndCharException(Throwable th) {
+ return th instanceof DecodingException
+ && th.getMessage().contains("Unexpected character (']'");
+ }
+
private Flux<KsqlResponseTable> executeStatement(String ksql,
Map<String, String> streamProperties) {
return webClient()
@@ -126,7 +158,7 @@ public Flux<KsqlResponseTable> execute(String ksql, Map<String, String> streamPr
}
Flux<KsqlResponseTable> outputFlux;
if (KsqlGrammar.isSelect(statements.get(0))) {
- outputFlux = executeSelect(ksql, streamProperties);
+ outputFlux = executeSelect(ksql, streamProperties);
} else {
outputFlux = executeStatement(ksql, streamProperties);
}
@@ -137,7 +169,7 @@ public Flux<KsqlResponseTable> execute(String ksql, Map<String, String> streamPr
});
}
- private Flux<KsqlResponseTable> errorTableFlux(String errorText) {
+ private Flux<KsqlResponseTable> errorTableFlux(String errorText) {
return Flux.just(ResponseParser.errorTableWithTextMsg(errorText));
}
| diff --git a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/container/KsqlDbContainer.java b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/container/KsqlDbContainer.java
new file mode 100644
index 00000000000..de38115e2c2
--- /dev/null
+++ b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/container/KsqlDbContainer.java
@@ -0,0 +1,39 @@
+package com.provectus.kafka.ui.container;
+
+import java.time.Duration;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.KafkaContainer;
+import org.testcontainers.containers.Network;
+import org.testcontainers.containers.wait.strategy.Wait;
+import org.testcontainers.utility.DockerImageName;
+
+public class KsqlDbContainer extends GenericContainer<KsqlDbContainer> {
+
+ private static final int PORT = 8088;
+
+ public KsqlDbContainer(DockerImageName imageName) {
+ super(imageName);
+ addExposedPort(PORT);
+ waitStrategy = Wait
+ .forHttp("/info")
+ .forStatusCode(200)
+ .withStartupTimeout(Duration.ofMinutes(5));
+ }
+
+ public KsqlDbContainer withKafka(KafkaContainer kafka) {
+ dependsOn(kafka);
+ String bootstrapServers = kafka.getNetworkAliases().get(0) + ":9092";
+ return withKafka(kafka.getNetwork(), bootstrapServers);
+ }
+
+ private KsqlDbContainer withKafka(Network network, String bootstrapServers) {
+ withNetwork(network);
+ withEnv("KSQL_LISTENERS", "http://0.0.0.0:" + PORT);
+ withEnv("KSQL_BOOTSTRAP_SERVERS", bootstrapServers);
+ return self();
+ }
+
+ public String url() {
+ return "http://" + getContainerIpAddress() + ":" + getMappedPort(PORT);
+ }
+}
diff --git a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/ksql/KsqlApiClientTest.java b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/ksql/KsqlApiClientTest.java
new file mode 100644
index 00000000000..d09e32f948c
--- /dev/null
+++ b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/service/ksql/KsqlApiClientTest.java
@@ -0,0 +1,129 @@
+package com.provectus.kafka.ui.service.ksql;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.DoubleNode;
+import com.fasterxml.jackson.databind.node.IntNode;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import com.fasterxml.jackson.databind.node.TextNode;
+import com.provectus.kafka.ui.AbstractIntegrationTest;
+import com.provectus.kafka.ui.container.KsqlDbContainer;
+import com.provectus.kafka.ui.model.KafkaCluster;
+import java.time.Duration;
+import java.util.List;
+import java.util.Map;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.testcontainers.shaded.org.awaitility.Awaitility;
+import org.testcontainers.utility.DockerImageName;
+import reactor.test.StepVerifier;
+
+class KsqlApiClientTest extends AbstractIntegrationTest {
+
+ private static final KsqlDbContainer KSQL_DB = new KsqlDbContainer(
+ DockerImageName.parse("confluentinc/ksqldb-server").withTag("0.24.0"))
+ .withKafka(kafka);
+
+ @BeforeAll
+ static void startContainer() {
+ KSQL_DB.start();
+ }
+
+ @AfterAll
+ static void stopContainer() {
+ KSQL_DB.stop();
+ }
+
+ // Tutorial is here: https://ksqldb.io/quickstart.html
+ @Test
+ void ksqTutorialQueriesWork() {
+ var client = new KsqlApiClient(KafkaCluster.builder().ksqldbServer(KSQL_DB.url()).build());
+ execCommandSync(client,
+ "CREATE STREAM riderLocations (profileId VARCHAR, latitude DOUBLE, longitude DOUBLE) "
+ + "WITH (kafka_topic='locations', value_format='json', partitions=1);",
+ "CREATE TABLE currentLocation AS "
+ + " SELECT profileId, "
+ + " LATEST_BY_OFFSET(latitude) AS la, "
+ + " LATEST_BY_OFFSET(longitude) AS lo "
+ + " FROM riderlocations "
+ + " GROUP BY profileId "
+ + " EMIT CHANGES;",
+ "CREATE TABLE ridersNearMountainView AS "
+ + " SELECT ROUND(GEO_DISTANCE(la, lo, 37.4133, -122.1162), -1) AS distanceInMiles, "
+ + " COLLECT_LIST(profileId) AS riders, "
+ + " COUNT(*) AS count "
+ + " FROM currentLocation "
+ + " GROUP BY ROUND(GEO_DISTANCE(la, lo, 37.4133, -122.1162), -1);",
+ "INSERT INTO riderLocations (profileId, latitude, longitude) VALUES ('c2309eec', 37.7877, -122.4205); ",
+ "INSERT INTO riderLocations (profileId, latitude, longitude) VALUES ('18f4ea86', 37.3903, -122.0643); ",
+ "INSERT INTO riderLocations (profileId, latitude, longitude) VALUES ('4ab5cbad', 37.3952, -122.0813); ",
+ "INSERT INTO riderLocations (profileId, latitude, longitude) VALUES ('8b6eae59', 37.3944, -122.0813); ",
+ "INSERT INTO riderLocations (profileId, latitude, longitude) VALUES ('4a7c7b41', 37.4049, -122.0822); ",
+ "INSERT INTO riderLocations (profileId, latitude, longitude) VALUES ('4ddad000', 37.7857, -122.4011);"
+ );
+
+ Awaitility.await()
+ .pollDelay(Duration.ofSeconds(1))
+ .atMost(Duration.ofSeconds(20))
+ .untilAsserted(() -> assertLastKsqTutorialQueryResult(client));
+ }
+
+ private void assertLastKsqTutorialQueryResult(KsqlApiClient client) {
+ // expected results:
+ //{"header":"Schema","columnNames":[...],"values":null}
+ //{"header":"Row","columnNames":null,"values":[[0.0,["4ab5cbad","8b6eae59","4a7c7b41"],3]]}
+ //{"header":"Row","columnNames":null,"values":[[10.0,["18f4ea86"],1]]}
+ StepVerifier.create(
+ client.execute(
+ "SELECT * from ridersNearMountainView WHERE distanceInMiles <= 10;",
+ Map.of()
+ )
+ )
+ .assertNext(header -> {
+ assertThat(header.getHeader()).isEqualTo("Schema");
+ assertThat(header.getColumnNames()).hasSize(3);
+ assertThat(header.getValues()).isNull();
+ })
+ .assertNext(row -> {
+ assertThat(row).isEqualTo(
+ KsqlApiClient.KsqlResponseTable.builder()
+ .header("Row")
+ .columnNames(null)
+ .values(List.of(List.of(
+ new DoubleNode(0.0),
+ new ArrayNode(JsonNodeFactory.instance)
+ .add(new TextNode("4ab5cbad"))
+ .add(new TextNode("8b6eae59"))
+ .add(new TextNode("4a7c7b41")),
+ new IntNode(3)
+ )))
+ .build()
+ );
+ })
+ .assertNext(row -> {
+ assertThat(row).isEqualTo(
+ KsqlApiClient.KsqlResponseTable.builder()
+ .header("Row")
+ .columnNames(null)
+ .values(List.of(List.of(
+ new DoubleNode(10.0),
+ new ArrayNode(JsonNodeFactory.instance)
+ .add(new TextNode("18f4ea86")),
+ new IntNode(1)
+ )))
+ .build()
+ );
+ })
+ .verifyComplete();
+ }
+
+ private void execCommandSync(KsqlApiClient client, String... ksqls) {
+ for (String ksql : ksqls) {
+ client.execute(ksql, Map.of()).collectList().block();
+ }
+ }
+
+
+}
\ No newline at end of file
| train | train | 2022-04-04T12:07:01 | "2022-03-28T16:40:03Z" | raphaelauv | train |
provectus/kafka-ui/1796_1798 | provectus/kafka-ui | provectus/kafka-ui/1796 | provectus/kafka-ui/1798 | [
"timestamp(timedelta=0.0, similarity=0.9437354908555003)",
"connected"
] | 688b86a557a44a112ebd682a17f6db670cdadc39 | 4b517c83a06d4df9a7c7e348e21852fffd592ac4 | [] | [] | "2022-04-04T07:42:15Z" | [
"scope/frontend",
"status/accepted",
"type/chore"
] | Remove rimraf from dependencies and add in dev dependencies | ### Is your proposal related to a problem?
<!--
Provide a clear and concise description of what the problem is.
For example, "I'm always frustrated when..."
-->
### Describe the solution you'd like
Package is unnecessarily in the dependencies package remove it and add it in the dev dependencies so the bundle size in production will not be affected
<!--
Provide a clear and concise description of what you want to happen.
-->
### Describe alternatives you've considered
<!--
Let us know about other solutions you've tried or researched.
-->
### Additional context
<!--
Is there anything else you can add about the proposal?
You might want to link to related issues here, if you haven't already.
-->
| [
"kafka-ui-react-app/package-lock.json",
"kafka-ui-react-app/package.json"
] | [
"kafka-ui-react-app/package-lock.json",
"kafka-ui-react-app/package.json"
] | [] | diff --git a/kafka-ui-react-app/package-lock.json b/kafka-ui-react-app/package-lock.json
index 87b78c8d1fb..2b4612881cb 100644
--- a/kafka-ui-react-app/package-lock.json
+++ b/kafka-ui-react-app/package-lock.json
@@ -18398,6 +18398,7 @@
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dev": true,
"requires": {
"glob": "^7.1.3"
}
diff --git a/kafka-ui-react-app/package.json b/kafka-ui-react-app/package.json
index c4e237f1870..71dca68a700 100644
--- a/kafka-ui-react-app/package.json
+++ b/kafka-ui-react-app/package.json
@@ -35,7 +35,6 @@
"react-router-dom": "^5.2.0",
"redux": "^4.1.1",
"redux-thunk": "^2.3.0",
- "rimraf": "^3.0.2",
"sass": "^1.43.4",
"styled-components": "^5.3.1",
"typesafe-actions": "^5.1.0",
@@ -127,6 +126,7 @@
"react-scripts": "5.0.0",
"react-test-renderer": "^17.0.2",
"redux-mock-store": "^1.5.4",
+ "rimraf": "^3.0.2",
"ts-jest": "^26.5.4",
"ts-node": "^10.2.0",
"typescript": "^4.3.5"
| null | val | train | 2022-04-01T12:54:10 | "2022-04-04T07:25:42Z" | Mgrdich | train |
provectus/kafka-ui/1033_1810 | provectus/kafka-ui | provectus/kafka-ui/1033 | provectus/kafka-ui/1810 | [
"connected"
] | 8d10eb69e8b91cf6b807cdba3f68f038efa931fc | 161b8a723803173b6a5ba5dfbabd58cd19e72b0d | [] | [
"overflow: 'hidden', textOverflow: 'ellipsis' maybe those properties can be added by class rather than inline styling \r\n\r\n",
"there is lower to this if another td without the cell if i am not mistaken we have to apply the max width thing to it as well.",
"This place is a general component importing something from a custom component can be wrong , for the overflow thing just create a class name put the styling in it and put in the <td>\r\nas well as the classname passed with props. this way the component will be general without custom imports.",
"put the browser td with additional class here instead of a component from a custom Class.",
"Please move it to `components/common/table/TableHeaderCell/TableHeaderCell.styled`"
] | "2022-04-07T07:18:40Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted"
] | Topic with long name makes table looks ugly | ### Is your proposal related to a problem?
see screenshots
### Describe the solution you'd like
I think we should keep columns widths ratio stable and blur name ending if it doesnt fit column width
### Describe alternatives you've considered
### Additional context
<img width="1680" alt="Screenshot 2021-10-30 at 13 42 54" src="https://user-images.githubusercontent.com/702205/139529668-314fd955-2e80-4479-b394-c9701be8cc6d.png">
<!--
Is there anything else you can add about the proposal?
You might want to link to related issues here, if you haven't already.
-->
(Write your answer here.)
| [
"kafka-ui-react-app/src/components/Topics/List/List.tsx",
"kafka-ui-react-app/src/components/common/SmartTable/TableColumn.tsx",
"kafka-ui-react-app/src/components/common/SmartTable/TableRow.tsx",
"kafka-ui-react-app/src/components/common/table/TableHeaderCell/TableHeaderCell.styled.ts"
] | [
"kafka-ui-react-app/src/components/Topics/List/List.tsx",
"kafka-ui-react-app/src/components/common/SmartTable/TableColumn.tsx",
"kafka-ui-react-app/src/components/common/SmartTable/TableRow.tsx",
"kafka-ui-react-app/src/components/common/table/TableHeaderCell/TableHeaderCell.styled.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/List/List.tsx b/kafka-ui-react-app/src/components/Topics/List/List.tsx
index f3f42cdc805..4858da2d2af 100644
--- a/kafka-ui-react-app/src/components/Topics/List/List.tsx
+++ b/kafka-ui-react-app/src/components/Topics/List/List.tsx
@@ -318,7 +318,7 @@ const List: React.FC<TopicsListProps> = ({
hoverable
>
<TableColumn
- width="44%"
+ maxWidth="350px"
title="Topic Name"
cell={TitleCell}
orderValue={TopicColumnsToSort.NAME}
@@ -341,7 +341,7 @@ const List: React.FC<TopicsListProps> = ({
orderValue={TopicColumnsToSort.SIZE}
/>
<TableColumn
- width="4%"
+ maxWidth="4%"
className="topic-action-block"
cell={ActionsCell}
/>
diff --git a/kafka-ui-react-app/src/components/common/SmartTable/TableColumn.tsx b/kafka-ui-react-app/src/components/common/SmartTable/TableColumn.tsx
index 96d72805470..c58c7d67b06 100644
--- a/kafka-ui-react-app/src/components/common/SmartTable/TableColumn.tsx
+++ b/kafka-ui-react-app/src/components/common/SmartTable/TableColumn.tsx
@@ -33,7 +33,7 @@ interface TableColumnProps<T, TId extends IdType, OT = never> {
headerCell?: React.FC<TableHeaderCellProps<T, TId, OT>>;
field?: string;
title?: string;
- width?: string;
+ maxWidth?: string;
className?: string;
orderValue?: OT;
}
diff --git a/kafka-ui-react-app/src/components/common/SmartTable/TableRow.tsx b/kafka-ui-react-app/src/components/common/SmartTable/TableRow.tsx
index 14a89797278..1a2785b1708 100644
--- a/kafka-ui-react-app/src/components/common/SmartTable/TableRow.tsx
+++ b/kafka-ui-react-app/src/components/common/SmartTable/TableRow.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import { propertyLookup } from 'lib/propertyLookup';
import { TableState } from 'lib/hooks/useTableState';
+import { Td } from 'components/common/table/TableHeaderCell/TableHeaderCell.styled';
import { isColumnElement, SelectCell, TableCellProps } from './TableColumn';
@@ -61,23 +62,23 @@ export const TableRow = <T, TId extends IdType, OT = never>({
if (!isColumnElement<T, TId>(child)) {
return child;
}
- const { cell, field, width, className } = child.props;
+ const { cell, field, maxWidth, className } = child.props;
const Cell = cell as React.FC<TableCellProps<T, TId, OT>> | undefined;
return Cell ? (
- <td className={className} style={{ width }}>
+ <Td className={className} maxWidth={maxWidth}>
<Cell
tableState={tableState}
hovered={hovered}
rowIndex={index}
dataItem={dataItem}
/>
- </td>
+ </Td>
) : (
- <td className={className} style={{ width }}>
+ <Td className={className} maxWidth={maxWidth}>
{field && propertyLookup(field, dataItem)}
- </td>
+ </Td>
);
})}
</tr>
diff --git a/kafka-ui-react-app/src/components/common/table/TableHeaderCell/TableHeaderCell.styled.ts b/kafka-ui-react-app/src/components/common/table/TableHeaderCell/TableHeaderCell.styled.ts
index 44ad5284570..1e35e7d1a57 100644
--- a/kafka-ui-react-app/src/components/common/table/TableHeaderCell/TableHeaderCell.styled.ts
+++ b/kafka-ui-react-app/src/components/common/table/TableHeaderCell/TableHeaderCell.styled.ts
@@ -67,6 +67,12 @@ const DESCMixin = css(
`
);
+export const Td = styled.td<{ maxWidth?: string }>`
+ overflow: hidden;
+ text-overflow: ellipsis;
+ max-width: ${(props) => props.maxWidth};
+`;
+
export const Title = styled.span<TitleProps>(
({ isOrderable, isOrdered, sortOrder, theme: { table } }) => css`
font-family: Inter, sans-serif;
| null | train | train | 2022-04-06T13:56:43 | "2021-10-30T10:46:06Z" | iliax | train |
provectus/kafka-ui/1811_1812 | provectus/kafka-ui | provectus/kafka-ui/1811 | provectus/kafka-ui/1812 | [
"connected"
] | b0552e4a6f6fd62e6d1a57f06d8cd3bc4a6d4d0d | db217e16053a9e96808af6b21e0318985b5c79ee | [
"Hello there lazzy-panda! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π"
] | [
"here you should pass up true in this case instead of hardcoding it into the component which is used several places , you just go to this table page and pass the up prop to the dropdown",
"this should be dependent on the props as mentioned in the upper comment",
"the list should open downwards",
"Pls remove this unused DropdownDivider",
"Are you sure it will not break any other tables?",
"I have checked the rest of the tables, it does not have a negative effect on them",
"done",
"Should this up option be removed?",
"I think it should be there. Because we can't see the last item dropdown in other case."
] | "2022-04-08T09:44:36Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Topic names do not fit in a table cell | **Describe the bug**
The names of topics do not fit in a table cell when the screen resolution is 1440 x 900, Macbook Air, 13,3 inch
**Screenshots**


| [
"kafka-ui-react-app/src/components/Connect/Details/Overview/__tests__/__snapshots__/Overview.spec.tsx.snap",
"kafka-ui-react-app/src/components/Connect/Details/Tasks/__tests__/__snapshots__/Tasks.spec.tsx.snap",
"kafka-ui-react-app/src/components/Connect/List/ListItem.tsx",
"kafka-ui-react-app/src/components/common/Tag/Tag.styled.tsx",
"kafka-ui-react-app/src/components/common/table/Table/Table.styled.ts"
] | [
"kafka-ui-react-app/src/components/Connect/Details/Overview/__tests__/__snapshots__/Overview.spec.tsx.snap",
"kafka-ui-react-app/src/components/Connect/Details/Tasks/__tests__/__snapshots__/Tasks.spec.tsx.snap",
"kafka-ui-react-app/src/components/Connect/List/ListItem.tsx",
"kafka-ui-react-app/src/components/common/Tag/Tag.styled.tsx",
"kafka-ui-react-app/src/components/common/table/Table/Table.styled.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/Connect/Details/Overview/__tests__/__snapshots__/Overview.spec.tsx.snap b/kafka-ui-react-app/src/components/Connect/Details/Overview/__tests__/__snapshots__/Overview.spec.tsx.snap
index 18930410a51..6b0e4e52c64 100644
--- a/kafka-ui-react-app/src/components/Connect/Details/Overview/__tests__/__snapshots__/Overview.spec.tsx.snap
+++ b/kafka-ui-react-app/src/components/Connect/Details/Overview/__tests__/__snapshots__/Overview.spec.tsx.snap
@@ -13,6 +13,9 @@ exports[`Overview view matches snapshot 1`] = `
padding-left: 0.75em;
padding-right: 0.75em;
text-align: center;
+ width: -webkit-max-content;
+ width: -moz-max-content;
+ width: max-content;
}
.c0 {
diff --git a/kafka-ui-react-app/src/components/Connect/Details/Tasks/__tests__/__snapshots__/Tasks.spec.tsx.snap b/kafka-ui-react-app/src/components/Connect/Details/Tasks/__tests__/__snapshots__/Tasks.spec.tsx.snap
index 322c1449385..40b29e23fe1 100644
--- a/kafka-ui-react-app/src/components/Connect/Details/Tasks/__tests__/__snapshots__/Tasks.spec.tsx.snap
+++ b/kafka-ui-react-app/src/components/Connect/Details/Tasks/__tests__/__snapshots__/Tasks.spec.tsx.snap
@@ -12,6 +12,8 @@ exports[`Tasks view matches snapshot 1`] = `
padding: 8px 8px 8px 24px;
color: #171A1C;
vertical-align: middle;
+ max-width: 350px;
+ word-wrap: break-word;
}
.c0 tbody > tr:hover {
@@ -182,6 +184,8 @@ exports[`Tasks view matches snapshot when no tasks 1`] = `
padding: 8px 8px 8px 24px;
color: #171A1C;
vertical-align: middle;
+ max-width: 350px;
+ word-wrap: break-word;
}
.c0 tbody > tr:hover {
@@ -279,4 +283,4 @@ exports[`Tasks view matches snapshot when no tasks 1`] = `
</tr>
</tbody>
</table>
-`;
\ No newline at end of file
+`;
diff --git a/kafka-ui-react-app/src/components/Connect/List/ListItem.tsx b/kafka-ui-react-app/src/components/Connect/List/ListItem.tsx
index e8f3c34533d..8f95699a2a0 100644
--- a/kafka-ui-react-app/src/components/Connect/List/ListItem.tsx
+++ b/kafka-ui-react-app/src/components/Connect/List/ListItem.tsx
@@ -6,7 +6,6 @@ import { Link, NavLink } from 'react-router-dom';
import { useDispatch } from 'react-redux';
import { deleteConnector } from 'redux/actions';
import Dropdown from 'components/common/Dropdown/Dropdown';
-import DropdownDivider from 'components/common/Dropdown/DropdownDivider';
import DropdownItem from 'components/common/Dropdown/DropdownItem';
import ConfirmationModal from 'components/common/ConfirmationModal/ConfirmationModal';
import { Tag } from 'components/common/Tag/Tag.styled';
@@ -84,8 +83,7 @@ const ListItem: React.FC<ListItemProps> = ({
</td>
<td>
<div>
- <Dropdown label={<VerticalElipsisIcon />} right>
- <DropdownDivider />
+ <Dropdown label={<VerticalElipsisIcon />} right up>
<DropdownItem
onClick={() => setDeleteConnectorConfirmationVisible(true)}
danger
diff --git a/kafka-ui-react-app/src/components/common/Tag/Tag.styled.tsx b/kafka-ui-react-app/src/components/common/Tag/Tag.styled.tsx
index 95ad6b8ba53..7884dc24089 100644
--- a/kafka-ui-react-app/src/components/common/Tag/Tag.styled.tsx
+++ b/kafka-ui-react-app/src/components/common/Tag/Tag.styled.tsx
@@ -16,4 +16,5 @@ export const Tag = styled.p<Props>`
padding-left: 0.75em;
padding-right: 0.75em;
text-align: center;
+ width: max-content;
`;
diff --git a/kafka-ui-react-app/src/components/common/table/Table/Table.styled.ts b/kafka-ui-react-app/src/components/common/table/Table/Table.styled.ts
index f7dc5b1fd1b..994e1b1fb76 100644
--- a/kafka-ui-react-app/src/components/common/table/Table/Table.styled.ts
+++ b/kafka-ui-react-app/src/components/common/table/Table/Table.styled.ts
@@ -14,6 +14,8 @@ export const Table = styled.table<Props>`
padding: 8px 8px 8px 24px;
color: ${({ theme }) => theme.table.td.color.normal};
vertical-align: middle;
+ max-width: 350px;
+ word-wrap: break-word;
}
& tbody > tr {
| null | val | train | 2022-04-22T15:00:12 | "2022-04-07T10:04:07Z" | lazzy-panda | train |
provectus/kafka-ui/1808_1813 | provectus/kafka-ui | provectus/kafka-ui/1808 | provectus/kafka-ui/1813 | [
"timestamp(timedelta=1.0, similarity=0.872462945017689)",
"connected"
] | 30e0238bd10e17fe5758fe4d91f29a50b1cbad6b | a38077d9d7fb0936f828ae3cc5ecc97d4d6102c9 | [
"@Haarolean maybe we should just remove this button, since it looks overkill for current page structure"
] | [
"should we update url as well?",
"done",
"should we reset the seekDirection as well ?",
"done",
"What's going on here? Please follow the existing code style of the project"
] | "2022-04-08T12:41:57Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | UI: "Clear all" button not working | **Steps to Reproduce**
Steps to reproduce the behavior:
Go to Topics -> select topic -> Messages -> choose some filter (offset/timestamp) -> click on clear all button
**Actual behavior**
nothing happen
**Expected behavior**
all filters are cleared
**Screenshots**
<img width="1045" alt="Screenshot 2022-04-06 at 20 07 12" src="https://user-images.githubusercontent.com/702205/162029857-564215b8-2add-426c-9eef-dae3b8475d1f.png">
| [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
index 379a48f68e6..d840fc80c3d 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
@@ -51,6 +51,7 @@ export interface FiltersProps {
updateMeta(meta: TopicMessageConsuming): void;
setIsFetching(status: boolean): void;
}
+
export interface MessageFilters {
name: string;
code: string;
@@ -165,6 +166,21 @@ const Filters: React.FC<FiltersProps> = ({
};
}, [attempt, query, queryType, seekDirection, activeFilter]);
+ const handleClearAllFilters = () => {
+ setCurrentSeekType(SeekType.OFFSET);
+ setQuery('');
+ changeSeekDirection(SeekDirection.FORWARD);
+ getSelectedPartitionsFromSeekToParam(searchParams, partitions);
+ setSelectedPartitions(
+ partitions.map((partition: Partition) => {
+ return {
+ value: partition.partition,
+ label: String(partition.partition),
+ };
+ })
+ );
+ };
+
const handleFiltersSubmit = React.useCallback(() => {
setAttempt(attempt + 1);
@@ -389,7 +405,7 @@ const Filters: React.FC<FiltersProps> = ({
onChange={setSelectedPartitions}
labelledBy="Select partitions"
/>
- <S.ClearAll>Clear all</S.ClearAll>
+ <S.ClearAll onClick={handleClearAllFilters}>Clear all</S.ClearAll>
{isFetching ? (
<Button
type="button"
| null | train | train | 2022-04-12T10:49:51 | "2022-04-06T17:10:13Z" | iliax | train |
provectus/kafka-ui/1739_1821 | provectus/kafka-ui | provectus/kafka-ui/1739 | provectus/kafka-ui/1821 | [
"connected",
"timestamp(timedelta=2.0, similarity=0.862321600796554)"
] | e9260cf9cb62c9558d61e3b86fe117128467b21d | b0552e4a6f6fd62e6d1a57f06d8cd3bc4a6d4d0d | [
"let's do MM.DD.YYYY (like on the left side of the screenshot)"
] | [
"i think here more detailed message would be more clear what is the block actually going to test.",
"Is there any way to avoid using of `TestId`?"
] | "2022-04-12T08:52:06Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted"
] | Inconsistent timestamps format in topic messages | 
| [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/__tests__/MessageContent.spec.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/__tests__/MessageContent.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.tsx
index 39b713d7ea6..5d226b11159 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.tsx
@@ -3,6 +3,7 @@ import React from 'react';
import EditorViewer from 'components/common/EditorViewer/EditorViewer';
import { SecondaryTabs } from 'components/common/Tabs/SecondaryTabs.styled';
import BytesFormatted from 'components/common/BytesFormatted/BytesFormatted';
+import dayjs from 'dayjs';
import * as S from './MessageContent.styled';
@@ -94,7 +95,9 @@ const MessageContent: React.FC<MessageContentProps> = ({
<S.Metadata>
<S.MetadataLabel>Timestamp</S.MetadataLabel>
<span>
- <S.MetadataValue>{timestamp?.toLocaleString()}</S.MetadataValue>
+ <S.MetadataValue>
+ {dayjs(timestamp).format('MM.DD.YYYY HH:mm:ss')}
+ </S.MetadataValue>
<S.MetadataMeta>Timestamp type: {timestampType}</S.MetadataMeta>
</span>
</S.Metadata>
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/__tests__/MessageContent.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/__tests__/MessageContent.spec.tsx
index 29c9aadea3b..325f7381989 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/__tests__/MessageContent.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/__tests__/MessageContent.spec.tsx
@@ -28,6 +28,9 @@ const setupWrapper = (props?: Partial<MessageContentProps>) => {
);
};
+const proto =
+ 'syntax = "proto3";\npackage com.provectus;\n\nmessage TestProtoRecord {\n string f1 = 1;\n int32 f2 = 2;\n}\n';
+
global.TextEncoder = TextEncoder;
describe('MessageContent screen', () => {
@@ -78,3 +81,42 @@ describe('MessageContent screen', () => {
});
});
});
+
+describe('checking content type depend on message type', () => {
+ it('renders component with message having JSON type', () => {
+ render(
+ setupWrapper({
+ messageContentFormat: 'JSON',
+ messageContent: '{"data": "test"}',
+ })
+ );
+ expect(screen.getAllByText('JSON')[1]).toBeInTheDocument();
+ });
+ it('renders component with message having AVRO type', () => {
+ render(
+ setupWrapper({
+ messageContentFormat: 'AVRO',
+ messageContent: '{"data": "test"}',
+ })
+ );
+ expect(screen.getByText('AVRO')).toBeInTheDocument();
+ });
+ it('renders component with message having PROTOBUF type', () => {
+ render(
+ setupWrapper({
+ messageContentFormat: 'PROTOBUF',
+ messageContent: proto,
+ })
+ );
+ expect(screen.getByText('PROTOBUF')).toBeInTheDocument();
+ });
+ it('renders component with message having no type which is equal to having PROTOBUF type', () => {
+ render(
+ setupWrapper({
+ messageContentFormat: 'PROTOBUF',
+ messageContent: '',
+ })
+ );
+ expect(screen.getByText('PROTOBUF')).toBeInTheDocument();
+ });
+});
| null | val | train | 2022-04-22T11:38:17 | "2022-03-20T18:32:02Z" | Haarolean | train |
provectus/kafka-ui/1523_1823 | provectus/kafka-ui | provectus/kafka-ui/1523 | provectus/kafka-ui/1823 | [
"connected"
] | a38077d9d7fb0936f828ae3cc5ecc97d4d6102c9 | d79412fe26fb71e651c447697dd5619c061ed576 | [
"Always returns to the first page after viewing/editing a topic or schema from the page 2, 3 etc.\r\n Steps to Reproduce:\r\n1. Go to Topics (Schemas) - Page 2\r\n2. Click a topic(schema) for viewing it (editing)\r\n3. Return to the Topics(Schemas) overview page\r\n4. Page 1 is displayed, not Page 2\r\n\r\nExpected behaviour:\r\nPage 2 is still displayed when you returned to the list."
] | [] | "2022-04-12T12:39:11Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Inconsistency in pagination for topics | **Describe the bug**
(A clear and concise description of what the bug is.)
Pagination automatically jumps to Page 1 even if search was initiated on Page 2 or any other page; makes to navigate to the required page multiple times
**Set up**
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
https://www.kafka-ui.provectus.io/ui
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Go to Topics - Page 2
2. Start search for any of the topics (e.g. asd123)
3. Clear the search field
4. Page 1 is displayed, not Page 2
**Expected behavior**
(A clear and concise description of what you expected to happen)
Page 2 is still displayed when search field info is cleaned.
**Screenshots**
(If applicable, add screenshots to help explain your problem)
**Additional context**
(Add any other context about the problem here)
| [
"kafka-ui-react-app/src/components/Topics/List/List.tsx",
"kafka-ui-react-app/src/components/Topics/List/__tests__/List.spec.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/List/List.tsx",
"kafka-ui-react-app/src/components/Topics/List/__tests__/List.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/List/List.tsx b/kafka-ui-react-app/src/components/Topics/List/List.tsx
index 4858da2d2af..dc22ac81042 100644
--- a/kafka-ui-react-app/src/components/Topics/List/List.tsx
+++ b/kafka-ui-react-app/src/components/Topics/List/List.tsx
@@ -82,6 +82,7 @@ const List: React.FC<TopicsListProps> = ({
const { clusterName } = useParams<{ clusterName: ClusterName }>();
const { page, perPage, pathname } = usePagination();
const [showInternal, setShowInternal] = React.useState<boolean>(true);
+ const [cachedPage, setCachedPage] = React.useState<number | null>(null);
const history = useHistory();
React.useEffect(() => {
@@ -159,9 +160,16 @@ const List: React.FC<TopicsListProps> = ({
const searchHandler = React.useCallback(
(searchString: string) => {
setTopicsSearch(searchString);
- history.push(`${pathname}?page=1&perPage=${perPage || PER_PAGE}`);
+
+ setCachedPage(page || null);
+
+ const newPageQuery = !searchString && cachedPage ? cachedPage : 1;
+
+ history.push(
+ `${pathname}?page=${newPageQuery}&perPage=${perPage || PER_PAGE}`
+ );
},
- [setTopicsSearch, history, pathname, perPage]
+ [setTopicsSearch, history, pathname, perPage, page]
);
const ActionsCell = React.memo<TableCellProps<TopicWithDetailedInfo, string>>(
diff --git a/kafka-ui-react-app/src/components/Topics/List/__tests__/List.spec.tsx b/kafka-ui-react-app/src/components/Topics/List/__tests__/List.spec.tsx
index 4b07c5f2d0f..0bdf6e16cc2 100644
--- a/kafka-ui-react-app/src/components/Topics/List/__tests__/List.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/List/__tests__/List.spec.tsx
@@ -125,6 +125,31 @@ describe('List', () => {
expect(mockedHistory.push).toHaveBeenCalledWith('/?page=1&perPage=25');
});
+
+ it('should set cached page query param on show internal toggle change', async () => {
+ const mockedHistory = createMemoryHistory();
+ jest.spyOn(mockedHistory, 'push');
+ component = mountComponentWithProviders(
+ { isReadOnly: false },
+ { fetchTopicsList, totalPages: 10 },
+ mockedHistory
+ );
+
+ const cachedPage = 5;
+
+ mockedHistory.push(`/?page=${cachedPage}&perPage=25`);
+
+ const input = component.find(Search);
+ input.props().handleSearch('nonEmptyString');
+
+ expect(mockedHistory.push).toHaveBeenCalledWith('/?page=1&perPage=25');
+
+ input.props().handleSearch('');
+
+ expect(mockedHistory.push).toHaveBeenCalledWith(
+ `/?page=${cachedPage}&perPage=25`
+ );
+ });
});
describe('when some list items are selected', () => {
| null | train | train | 2022-04-12T19:09:46 | "2022-01-31T11:36:53Z" | Khakha-A | train |
provectus/kafka-ui/1740_1824 | provectus/kafka-ui | provectus/kafka-ui/1740 | provectus/kafka-ui/1824 | [
"connected"
] | ee09fc73b604877d96b29faff4b68e7a5770c642 | b4e52afbdb383c378404905d54fd32f8b2b58617 | [
"1. While live mode is on (active loading) all the controls (search, offset, partitions select) should be disabled. \r\n2. Once \"stop loading\" is pressed, fetched messages should NOT disappear. And controls (p. 1) should be enabled back again."
] | [
"As I can see, the above 7 lines are the exact same thing that appear in topicMessagePayload declared above. Can we reduce code duplication by storing the repeated information in a separate variable and using it by spreading at the end?",
"Sure."
] | "2022-04-12T14:15:16Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted"
] | Live tailing improvements | 1. New messages should appear on top
2. Pagination buttons (e.g. "Next") shouldn't be visible.
3.
wrong parameters passed for live tailing:
`https://www.kafka-ui.provectus.io/api/clusters/local/topics/7890/messages?filterQueryType=STRING_CONTAINS&attempt=1&limit=100&seekDirection=TAILING&seekType=OFFSET&seekTo=0::0`
this should be `https://www.kafka-ui.provectus.io/api/clusters/local/topics/7890/messages&seekDirection=TAILING&seekType=LATEST&seekTo=0::0`
`seekType` should be `LATEST`
`attempt` has no effect (can be removed from all endpoints)
`limit` has no effect in TAILING mode
(not critical) `filterQueryType` make sense only when `q` param passed
`seekTo` should be 0::0,1::0,... where first number is partition
#943 | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx",
"kafka-ui-react-app/src/redux/actions/__test__/actions.spec.ts",
"kafka-ui-react-app/src/redux/actions/actions.ts",
"kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/fixtures.ts",
"kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/reducer.spec.ts",
"kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/selectors.spec.ts",
"kafka-ui-react-app/src/redux/reducers/topicMessages/reducer.ts"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx",
"kafka-ui-react-app/src/redux/actions/__test__/actions.spec.ts",
"kafka-ui-react-app/src/redux/actions/actions.ts",
"kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/fixtures.ts",
"kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/reducer.spec.ts",
"kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/selectors.spec.ts",
"kafka-ui-react-app/src/redux/reducers/topicMessages/reducer.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
index d840fc80c3d..e5dad2dafca 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
@@ -1,6 +1,7 @@
import 'react-datepicker/dist/react-datepicker.css';
import {
+ MessageFilterType,
Partition,
SeekDirection,
SeekType,
@@ -8,7 +9,6 @@ import {
TopicMessageConsuming,
TopicMessageEvent,
TopicMessageEventTypeEnum,
- MessageFilterType,
} from 'generated-sources';
import React, { useContext } from 'react';
import { omitBy } from 'lodash';
@@ -17,7 +17,7 @@ import DatePicker from 'react-datepicker';
import MultiSelect from 'components/common/MultiSelect/MultiSelect.styled';
import { Option } from 'react-multi-select-component/dist/lib/interfaces';
import BytesFormatted from 'components/common/BytesFormatted/BytesFormatted';
-import { TopicName, ClusterName } from 'redux/interfaces';
+import { ClusterName, TopicName } from 'redux/interfaces';
import { BASE_PARAMS } from 'lib/constants';
import Input from 'components/common/Input/Input';
import Select from 'components/common/Select/Select';
@@ -45,7 +45,7 @@ export interface FiltersProps {
partitions: Partition[];
meta: TopicMessageConsuming;
isFetching: boolean;
- addMessage(message: TopicMessage): void;
+ addMessage(content: { message: TopicMessage; prepend: boolean }): void;
resetMessages(): void;
updatePhase(phase: string): void;
updateMeta(meta: TopicMessageConsuming): void;
@@ -304,7 +304,12 @@ const Filters: React.FC<FiltersProps> = ({
switch (type) {
case TopicMessageEventTypeEnum.MESSAGE:
- if (message) addMessage(message);
+ if (message) {
+ addMessage({
+ message,
+ prepend: isLive,
+ });
+ }
break;
case TopicMessageEventTypeEnum.PHASE:
if (phase?.name) updatePhase(phase.name);
diff --git a/kafka-ui-react-app/src/redux/actions/__test__/actions.spec.ts b/kafka-ui-react-app/src/redux/actions/__test__/actions.spec.ts
index 5058d5c6e14..6cd6550f8c6 100644
--- a/kafka-ui-react-app/src/redux/actions/__test__/actions.spec.ts
+++ b/kafka-ui-react-app/src/redux/actions/__test__/actions.spec.ts
@@ -68,7 +68,7 @@ describe('Actions', () => {
});
describe('setTopicsSearchAction', () => {
- it('creartes SET_TOPICS_SEARCH', () => {
+ it('creates SET_TOPICS_SEARCH', () => {
expect(actions.setTopicsSearchAction('test')).toEqual({
type: 'SET_TOPICS_SEARCH',
payload: 'test',
@@ -77,7 +77,7 @@ describe('Actions', () => {
});
describe('setTopicsOrderByAction', () => {
- it('creartes SET_TOPICS_ORDER_BY', () => {
+ it('creates SET_TOPICS_ORDER_BY', () => {
expect(actions.setTopicsOrderByAction(TopicColumnsToSort.NAME)).toEqual({
type: 'SET_TOPICS_ORDER_BY',
payload: TopicColumnsToSort.NAME,
@@ -87,10 +87,12 @@ describe('Actions', () => {
describe('topic messages', () => {
it('creates ADD_TOPIC_MESSAGE', () => {
- expect(actions.addTopicMessage(topicMessagePayload)).toEqual({
- type: 'ADD_TOPIC_MESSAGE',
- payload: topicMessagePayload,
- });
+ expect(actions.addTopicMessage({ message: topicMessagePayload })).toEqual(
+ {
+ type: 'ADD_TOPIC_MESSAGE',
+ payload: { message: topicMessagePayload },
+ }
+ );
});
it('creates RESET_TOPIC_MESSAGES', () => {
diff --git a/kafka-ui-react-app/src/redux/actions/actions.ts b/kafka-ui-react-app/src/redux/actions/actions.ts
index dd72f87a8a4..849941b2369 100644
--- a/kafka-ui-react-app/src/redux/actions/actions.ts
+++ b/kafka-ui-react-app/src/redux/actions/actions.ts
@@ -161,8 +161,10 @@ export const fetchTopicConsumerGroupsAction = createAsyncAction(
'GET_TOPIC_CONSUMER_GROUPS__FAILURE'
)<undefined, TopicsState, undefined>();
-export const addTopicMessage =
- createAction('ADD_TOPIC_MESSAGE')<TopicMessage>();
+export const addTopicMessage = createAction('ADD_TOPIC_MESSAGE')<{
+ message: TopicMessage;
+ prepend?: boolean;
+}>();
export const resetTopicMessages = createAction('RESET_TOPIC_MESSAGES')();
diff --git a/kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/fixtures.ts b/kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/fixtures.ts
index 05c6959c63e..8f8bce2c281 100644
--- a/kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/fixtures.ts
+++ b/kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/fixtures.ts
@@ -15,6 +15,12 @@ export const topicMessagePayload: TopicMessage = {
'{"host":"schemaregistry1","port":8085,"master_eligibility":true,"scheme":"http","version":1}',
};
+export const topicMessagePayloadV2: TopicMessage = {
+ ...topicMessagePayload,
+ partition: 28,
+ offset: 88,
+};
+
export const topicMessagesMetaPayload: TopicMessageConsuming = {
bytesConsumed: 1830,
elapsedMs: 440,
diff --git a/kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/reducer.spec.ts b/kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/reducer.spec.ts
index 7d18e3284c8..c0e2ab283cd 100644
--- a/kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/reducer.spec.ts
+++ b/kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/reducer.spec.ts
@@ -6,16 +6,59 @@ import {
} from 'redux/actions';
import reducer from 'redux/reducers/topicMessages/reducer';
-import { topicMessagePayload, topicMessagesMetaPayload } from './fixtures';
+import {
+ topicMessagePayload,
+ topicMessagePayloadV2,
+ topicMessagesMetaPayload,
+} from './fixtures';
describe('TopicMessages reducer', () => {
it('Adds new message', () => {
- const state = reducer(undefined, addTopicMessage(topicMessagePayload));
+ const state = reducer(
+ undefined,
+ addTopicMessage({ message: topicMessagePayload })
+ );
expect(state.messages.length).toEqual(1);
expect(state).toMatchSnapshot();
});
+
+ it('Adds new message with live tailing one', () => {
+ const state = reducer(
+ undefined,
+ addTopicMessage({ message: topicMessagePayload })
+ );
+ const modifiedState = reducer(
+ state,
+ addTopicMessage({ message: topicMessagePayloadV2, prepend: true })
+ );
+ expect(modifiedState.messages.length).toEqual(2);
+ expect(modifiedState.messages).toEqual([
+ topicMessagePayloadV2,
+ topicMessagePayload,
+ ]);
+ });
+
+ it('Adds new message with live tailing off', () => {
+ const state = reducer(
+ undefined,
+ addTopicMessage({ message: topicMessagePayload })
+ );
+ const modifiedState = reducer(
+ state,
+ addTopicMessage({ message: topicMessagePayloadV2 })
+ );
+ expect(modifiedState.messages.length).toEqual(2);
+ expect(modifiedState.messages).toEqual([
+ topicMessagePayload,
+ topicMessagePayloadV2,
+ ]);
+ });
+
it('Clears messages', () => {
- const state = reducer(undefined, addTopicMessage(topicMessagePayload));
+ const state = reducer(
+ undefined,
+ addTopicMessage({ message: topicMessagePayload })
+ );
expect(state.messages.length).toEqual(1);
const newState = reducer(state, resetTopicMessages());
diff --git a/kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/selectors.spec.ts b/kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/selectors.spec.ts
index 86fdc186946..f42e03d4c1a 100644
--- a/kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/selectors.spec.ts
+++ b/kafka-ui-react-app/src/redux/reducers/topicMessages/__test__/selectors.spec.ts
@@ -28,7 +28,7 @@ describe('TopicMessages selectors', () => {
describe('state', () => {
beforeAll(() => {
- store.dispatch(addTopicMessage(topicMessagePayload));
+ store.dispatch(addTopicMessage({ message: topicMessagePayload }));
store.dispatch(updateTopicMessagesPhase('consuming'));
store.dispatch(updateTopicMessagesMeta(topicMessagesMetaPayload));
});
diff --git a/kafka-ui-react-app/src/redux/reducers/topicMessages/reducer.ts b/kafka-ui-react-app/src/redux/reducers/topicMessages/reducer.ts
index ecab598063d..1d4ee836a15 100644
--- a/kafka-ui-react-app/src/redux/reducers/topicMessages/reducer.ts
+++ b/kafka-ui-react-app/src/redux/reducers/topicMessages/reducer.ts
@@ -1,6 +1,7 @@
import { Action, TopicMessagesState } from 'redux/interfaces';
import { getType } from 'typesafe-actions';
import * as actions from 'redux/actions';
+import { TopicMessage } from 'generated-sources';
export const initialState: TopicMessagesState = {
messages: [],
@@ -17,9 +18,13 @@ export const initialState: TopicMessagesState = {
const reducer = (state = initialState, action: Action): TopicMessagesState => {
switch (action.type) {
case getType(actions.addTopicMessage): {
+ const messages: TopicMessage[] = action.payload.prepend
+ ? [action.payload.message, ...state.messages]
+ : [...state.messages, action.payload.message];
+
return {
...state,
- messages: [action.payload, ...state.messages],
+ messages,
};
}
case getType(actions.resetTopicMessages):
| null | train | train | 2022-04-14T15:43:50 | "2022-03-20T18:33:58Z" | Haarolean | train |
provectus/kafka-ui/1013_1825 | provectus/kafka-ui | provectus/kafka-ui/1013 | provectus/kafka-ui/1825 | [
"timestamp(timedelta=0.0, similarity=0.8976390220047269)",
"connected"
] | 29ee6b15172336817ff34bbf94fdcc80b238870a | deddf09ed4ef35fa6a150f79ebb10049a0ede662 | [
"Very similar to #998. ",
"It is somewhat similar indeed, but #998 is about re-creating single topic to clear out all data and \"reset\" all offsets to 0-state. This request is more about making a \"clone\" of one topic in a simple way. Just clarifying this point to avoid confusion.",
"Yeah I get it :) That's a note for us about implementation"
] | [
"a question if Copy and New Components are the same thing with or without the data we should create a component to use in both page and write test suites in that component. ?\r\n\r\nLike in New -> pass empty props and test the filling it.\r\nLike in Copy -> check the already existing data in it and test the submit.",
"why is there extra line additions here if the code did not change , in all of this file.",
"why should new Page tests suites change if we just added Route for copy , maybe the switch gets redirected to the wrong thing.",
"is it correct behaviour?",
"Fixed",
"I think that is a good idea. So there are two ways of doing it: \r\n-\tone shared component for Create and Copy topic, which checks if there are some query params (but this logic could become more complicated with components and project grow)\r\n-\tanother way to split the functionality of Create and Copy to appropriate pages or components, so they could expand without expanding the complexity\r\n\r\nWhich way we prefer?\r\n",
"I removed extra string wrapper, if that's what you mean",
"I think because the shared component or some shared stuff was changed. Without this changes there is no possibility to pass the tests and commit the changes",
"You have changed `toBeCalledTimes` from 1 to 0\r\n`expect(createTopicAPIPathMock.called())` was `true` now it is `false`",
"I can see the same thing above. You can declare a variable on a higher level and use it twice instead of repeating the code. If createMemoryHistory has to be called inside the 'it' callbacks in the two places to function properly, you can isolate the parameter only instead of the whole.",
"Can we use `tableState.selectedCount === 1 && (...` instead of using ternary and returning null?",
"done",
"Don't we need to update the tests for this line after adding this condition?",
"Can we store `new URLSearchParams(search)` in a variable and reuse it? Please, check if we can, that way we'll prevent duplication.",
"done",
"@lazzy-panda shouldn't be a enum used here?",
"done"
] | "2022-04-12T14:20:55Z" | [
"scope/backend",
"scope/frontend",
"status/accepted",
"type/feature"
] | Clone topic functionality | ### Is your proposal related to a problem?
I often find myself creating a topic that has exactly same configuration as existing one. In which case I need to have 2 windows open side-by-side to see source configuration and replicate it in new topic. That is a bit troublesome.
### Describe the solution you'd like
1. In topic list view a button to clone selected topic (when single topic selected)
2. (optional) clone with data (i.e. spawn consumer reading from beginning of the source topic to the end and writing messages to destination topic)
### Describe alternatives you've considered
N/A. Currently copying existing topic configuration needs to be done manually
### Additional context
N/A
| [
"kafka-ui-react-app/src/components/Topics/List/List.tsx",
"kafka-ui-react-app/src/components/Topics/New/New.tsx",
"kafka-ui-react-app/src/components/Topics/New/__test__/New.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topics.tsx",
"kafka-ui-react-app/src/components/Topics/shared/Form/TopicForm.tsx",
"kafka-ui-react-app/src/lib/paths.ts"
] | [
"kafka-ui-react-app/src/components/Topics/List/List.tsx",
"kafka-ui-react-app/src/components/Topics/New/New.tsx",
"kafka-ui-react-app/src/components/Topics/New/__test__/New.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topics.tsx",
"kafka-ui-react-app/src/components/Topics/shared/Form/TopicForm.tsx",
"kafka-ui-react-app/src/lib/paths.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/List/List.tsx b/kafka-ui-react-app/src/components/Topics/List/List.tsx
index 334ff6a917d..362010d1fc7 100644
--- a/kafka-ui-react-app/src/components/Topics/List/List.tsx
+++ b/kafka-ui-react-app/src/components/Topics/List/List.tsx
@@ -6,7 +6,7 @@ import {
TopicName,
} from 'redux/interfaces';
import { useParams } from 'react-router-dom';
-import { clusterTopicNewPath } from 'lib/paths';
+import { clusterTopicCopyPath, clusterTopicNewPath } from 'lib/paths';
import usePagination from 'lib/hooks/usePagination';
import ClusterContext from 'components/contexts/ClusterContext';
import PageLoader from 'components/common/PageLoader/PageLoader';
@@ -125,6 +125,21 @@ const List: React.FC<TopicsListProps> = ({
}
);
+ const getSelectedTopic = (): string => {
+ const name = Array.from(tableState.selectedIds)[0];
+ const selectedTopic =
+ tableState.data.find(
+ (topic: TopicWithDetailedInfo) => topic.name === name
+ ) || {};
+
+ return Object.keys(selectedTopic)
+ .map((x: string) => {
+ const value = selectedTopic[x as keyof typeof selectedTopic];
+ return value && x !== 'partitions' ? `${x}=${value}` : null;
+ })
+ .join('&');
+ };
+
const handleSwitch = React.useCallback(() => {
setShowInternal(!showInternal);
history.push(`${pathname}?page=1&perPage=${perPage || PER_PAGE}`);
@@ -295,6 +310,20 @@ const List: React.FC<TopicsListProps> = ({
>
Delete selected topics
</Button>
+ {tableState.selectedCount === 1 && (
+ <Button
+ buttonSize="M"
+ buttonType="secondary"
+ isLink
+ to={{
+ pathname: clusterTopicCopyPath(clusterName),
+ search: `?${getSelectedTopic()}`,
+ }}
+ >
+ Copy selected topic
+ </Button>
+ )}
+
<Button
buttonSize="M"
buttonType="secondary"
diff --git a/kafka-ui-react-app/src/components/Topics/New/New.tsx b/kafka-ui-react-app/src/components/Topics/New/New.tsx
index 05faeabcca3..f2195751ae7 100644
--- a/kafka-ui-react-app/src/components/Topics/New/New.tsx
+++ b/kafka-ui-react-app/src/components/Topics/New/New.tsx
@@ -10,7 +10,7 @@ import {
} from 'redux/actions';
import { useDispatch } from 'react-redux';
import { getResponse } from 'lib/errorHandling';
-import { useHistory, useParams } from 'react-router';
+import { useHistory, useLocation, useParams } from 'react-router';
import { yupResolver } from '@hookform/resolvers/yup';
import { topicFormValidationSchema } from 'lib/yupExtended';
import PageHeading from 'components/common/PageHeading/PageHeading';
@@ -19,6 +19,14 @@ interface RouterParams {
clusterName: ClusterName;
}
+enum Filters {
+ NAME = 'name',
+ PARTITION_COUNT = 'partitionCount',
+ REPLICATION_FACTOR = 'replicationFactor',
+ INSYNC_REPLICAS = 'inSyncReplicas',
+ CLEANUP_POLICY = 'Delete',
+}
+
const New: React.FC = () => {
const methods = useForm<TopicFormData>({
mode: 'all',
@@ -29,6 +37,15 @@ const New: React.FC = () => {
const history = useHistory();
const dispatch = useDispatch();
+ const { search } = useLocation();
+ const params = new URLSearchParams(search);
+
+ const name = params.get(Filters.NAME) || '';
+ const partitionCount = params.get(Filters.PARTITION_COUNT) || 1;
+ const replicationFactor = params.get(Filters.REPLICATION_FACTOR) || 1;
+ const inSyncReplicas = params.get(Filters.INSYNC_REPLICAS) || 1;
+ const cleanUpPolicy = params.get(Filters.CLEANUP_POLICY) || 'Delete';
+
const onSubmit = async (data: TopicFormData) => {
try {
await topicsApiClient.createTopic({
@@ -50,9 +67,14 @@ const New: React.FC = () => {
return (
<>
- <PageHeading text="Create new Topic" />
+ <PageHeading text={search ? 'Copy Topic' : 'Create new Topic'} />
<FormProvider {...methods}>
<TopicForm
+ topicName={name}
+ cleanUpPolicy={cleanUpPolicy}
+ partitionCount={Number(partitionCount)}
+ replicationFactor={Number(replicationFactor)}
+ inSyncReplicas={Number(inSyncReplicas)}
isSubmitting={methods.formState.isSubmitting}
onSubmit={methods.handleSubmit(onSubmit)}
/>
diff --git a/kafka-ui-react-app/src/components/Topics/New/__test__/New.spec.tsx b/kafka-ui-react-app/src/components/Topics/New/__test__/New.spec.tsx
index d980b33d38a..aad0120d024 100644
--- a/kafka-ui-react-app/src/components/Topics/New/__test__/New.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/New/__test__/New.spec.tsx
@@ -7,7 +7,11 @@ import { Provider } from 'react-redux';
import { screen, waitFor } from '@testing-library/react';
import { createMemoryHistory } from 'history';
import fetchMock from 'fetch-mock-jest';
-import { clusterTopicNewPath, clusterTopicPath } from 'lib/paths';
+import {
+ clusterTopicCopyPath,
+ clusterTopicNewPath,
+ clusterTopicPath,
+} from 'lib/paths';
import userEvent from '@testing-library/user-event';
import { render } from 'lib/testHelpers';
@@ -31,6 +35,11 @@ const renderComponent = (history = historyMock, store = storeMock) =>
<New />
</Provider>
</Route>
+ <Route path={clusterTopicCopyPath(':clusterName')}>
+ <Provider store={store}>
+ <New />
+ </Provider>
+ </Route>
<Route path={clusterTopicPath(':clusterName', ':topicName')}>
New topic path
</Route>
@@ -42,6 +51,32 @@ describe('New', () => {
fetchMock.reset();
});
+ it('checks header for create new', async () => {
+ const mockedHistory = createMemoryHistory({
+ initialEntries: [clusterTopicNewPath(clusterName)],
+ });
+ renderComponent(mockedHistory);
+ expect(
+ screen.getByRole('heading', { name: 'Create new Topic' })
+ ).toHaveTextContent('Create new Topic');
+ });
+
+ it('checks header for copy', async () => {
+ const mockedHistory = createMemoryHistory({
+ initialEntries: [
+ {
+ pathname: clusterTopicCopyPath(clusterName),
+ search: `?name=test`,
+ },
+ ],
+ });
+
+ renderComponent(mockedHistory);
+ expect(
+ screen.getByRole('heading', { name: 'Copy Topic' })
+ ).toHaveTextContent('Copy Topic');
+ });
+
it('validates form', async () => {
const mockedHistory = createMemoryHistory({
initialEntries: [clusterTopicNewPath(clusterName)],
diff --git a/kafka-ui-react-app/src/components/Topics/Topics.tsx b/kafka-ui-react-app/src/components/Topics/Topics.tsx
index ce04d3341bc..391645a32b8 100644
--- a/kafka-ui-react-app/src/components/Topics/Topics.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topics.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import { Switch } from 'react-router-dom';
import {
+ clusterTopicCopyPath,
clusterTopicNewPath,
clusterTopicPath,
clusterTopicsPath,
@@ -23,6 +24,11 @@ const Topics: React.FC = () => (
path={clusterTopicNewPath(':clusterName')}
component={New}
/>
+ <BreadcrumbRoute
+ exact
+ path={clusterTopicCopyPath(':clusterName')}
+ component={New}
+ />
<BreadcrumbRoute
path={clusterTopicPath(':clusterName', ':topicName')}
component={TopicContainer}
diff --git a/kafka-ui-react-app/src/components/Topics/shared/Form/TopicForm.tsx b/kafka-ui-react-app/src/components/Topics/shared/Form/TopicForm.tsx
index d5cc7ea08e3..9c747491089 100644
--- a/kafka-ui-react-app/src/components/Topics/shared/Form/TopicForm.tsx
+++ b/kafka-ui-react-app/src/components/Topics/shared/Form/TopicForm.tsx
@@ -16,6 +16,10 @@ import * as S from './TopicForm.styled';
export interface Props {
topicName?: TopicName;
+ partitionCount?: number;
+ replicationFactor?: number;
+ inSyncReplicas?: number;
+ cleanUpPolicy?: string;
isEditing?: boolean;
isSubmitting: boolean;
onSubmit: (e: React.BaseSyntheticEvent) => Promise<void>;
@@ -40,11 +44,19 @@ const TopicForm: React.FC<Props> = ({
isEditing,
isSubmitting,
onSubmit,
+ partitionCount,
+ replicationFactor,
+ inSyncReplicas,
+ cleanUpPolicy,
}) => {
const {
control,
formState: { errors },
} = useFormContext();
+ const getCleanUpPolicy =
+ CleanupPolicyOptions.find((option: SelectOption) => {
+ return option.value === cleanUpPolicy?.toLowerCase();
+ })?.value || CleanupPolicyOptions[0].value;
return (
<StyledForm onSubmit={onSubmit}>
<fieldset disabled={isSubmitting}>
@@ -75,7 +87,7 @@ const TopicForm: React.FC<Props> = ({
type="number"
placeholder="Number of partitions"
min="1"
- defaultValue="1"
+ defaultValue={partitionCount}
name="partitions"
/>
<FormError>
@@ -91,7 +103,7 @@ const TopicForm: React.FC<Props> = ({
type="number"
placeholder="Replication Factor"
min="1"
- defaultValue="1"
+ defaultValue={replicationFactor}
name="replicationFactor"
/>
<FormError>
@@ -112,7 +124,7 @@ const TopicForm: React.FC<Props> = ({
type="number"
placeholder="Min In Sync Replicas"
min="1"
- defaultValue="1"
+ defaultValue={inSyncReplicas}
name="minInsyncReplicas"
/>
<FormError>
@@ -135,7 +147,7 @@ const TopicForm: React.FC<Props> = ({
id="topicFormCleanupPolicy"
aria-labelledby="topicFormCleanupPolicyLabel"
name={name}
- value={CleanupPolicyOptions[0].value}
+ value={getCleanUpPolicy}
onChange={onChange}
minWidth="250px"
options={CleanupPolicyOptions}
diff --git a/kafka-ui-react-app/src/lib/paths.ts b/kafka-ui-react-app/src/lib/paths.ts
index ee3152d6ed0..78a587d086a 100644
--- a/kafka-ui-react-app/src/lib/paths.ts
+++ b/kafka-ui-react-app/src/lib/paths.ts
@@ -53,6 +53,8 @@ export const clusterTopicsPath = (clusterName: ClusterName) =>
`${clusterPath(clusterName)}/topics`;
export const clusterTopicNewPath = (clusterName: ClusterName) =>
`${clusterPath(clusterName)}/topics/create-new`;
+export const clusterTopicCopyPath = (clusterName: ClusterName) =>
+ `${clusterPath(clusterName)}/topics/copy`;
export const clusterTopicPath = (
clusterName: ClusterName,
topicName: TopicName
| null | test | train | 2022-04-22T15:40:01 | "2021-10-25T16:05:54Z" | akamensky | train |
provectus/kafka-ui/1644_1826 | provectus/kafka-ui | provectus/kafka-ui/1644 | provectus/kafka-ui/1826 | [
"timestamp(timedelta=0.0, similarity=0.8578161168596542)",
"connected"
] | 9acef94234bec54f50ebcd9fdc2968353a2935a3 | a55068d1229bb90e94f97d16423a49a39554ff50 | [] | [
"I'm not sure we should touch this file. Pls skip it",
"sonar suggested to change it ilke this,\r\nok will bring this changes back\r\n",
"we can mark/skip some sonar suggestions btw",
"one Question why did we put the undefined in the older version",
"@Mgrdich I'm not sure why but that caused problem for sonar and there was suggestion from sonar to remove that part as it's not changing the type\r\n<img width=\"676\" alt=\"Screen Shot 2022-04-14 at 13 57 44\" src=\"https://user-images.githubusercontent.com/103438454/163361965-6faf9756-8eb7-4fae-adee-c7b91389c8f8.png\">\r\n",
"I think it would be better to store `Array.from(tableState.selectedIds)` in a variable above the conditions and use it inside the condition blocks. That way we'll prevent code duplication.\r\n\r\n```\r\nconst selectedIds = Array.from(tableState.selectedIds);\r\n\r\nif (confirmationModal === 'deleteTopics') {\r\n deleteTopics(clusterName, selectedIds);\r\n} else {\r\n clearTopicsMessages(clusterName, selectedIds);\r\n}\r\n```\r\n\r\nLooks cleaner to me.",
"I've added it to the excluded files list"
] | "2022-04-12T16:15:16Z" | [
"good first issue",
"scope/frontend",
"status/accepted",
"type/chore"
] | Improve SonarCloud metrics | **Describe the bug**
Sonar shows 14 code smells. Try to improve this metric
[Sonar](https://sonarcloud.io/project/issues?resolved=false&types=CODE_SMELL&id=com.provectus%3Akafka-ui_frontend)
**Expected behavior**
Some smells are fixed
| [
"kafka-ui-react-app/src/components/Brokers/Brokers.tsx",
"kafka-ui-react-app/src/components/Connect/Details/Tasks/ListItem/ListItemContainer.ts",
"kafka-ui-react-app/src/components/Topics/List/List.tsx",
"kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamsContainer.tsx",
"kafka-ui-react-app/src/components/common/SmartTable/SmartTable.tsx"
] | [
"kafka-ui-react-app/src/components/Brokers/Brokers.tsx",
"kafka-ui-react-app/src/components/Connect/Details/Tasks/ListItem/ListItemContainer.ts",
"kafka-ui-react-app/src/components/Topics/List/List.tsx",
"kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamsContainer.tsx",
"kafka-ui-react-app/src/components/common/SmartTable/SmartTable.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Brokers/Brokers.tsx b/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
index 6d20911714f..bb8f40f290f 100644
--- a/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
+++ b/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
@@ -32,7 +32,7 @@ const Brokers: React.FC = () => {
const replicas = inSyncReplicasCount ?? 0 + (outOfSyncReplicasCount ?? 0);
const areAllInSync = inSyncReplicasCount && replicas === inSyncReplicasCount;
-
+ const partitionIsOffline = offlinePartitionCount && offlinePartitionCount > 0;
React.useEffect(() => {
dispatch(fetchClusterStats(clusterName));
dispatch(fetchBrokers(clusterName));
@@ -60,13 +60,9 @@ const Brokers: React.FC = () => {
<Metrics.Indicator
label="Online"
isAlert
- alertType={
- offlinePartitionCount && offlinePartitionCount > 0
- ? 'error'
- : 'success'
- }
+ alertType={partitionIsOffline ? 'error' : 'success'}
>
- {offlinePartitionCount && offlinePartitionCount > 0 ? (
+ {partitionIsOffline ? (
<Metrics.RedText>{onlinePartitionCount}</Metrics.RedText>
) : (
onlinePartitionCount
@@ -80,11 +76,9 @@ const Brokers: React.FC = () => {
label="URP"
title="Under replicated partitions"
isAlert
- alertType={
- underReplicatedPartitionCount === 0 ? 'success' : 'error'
- }
+ alertType={!underReplicatedPartitionCount ? 'success' : 'error'}
>
- {underReplicatedPartitionCount === 0 ? (
+ {!underReplicatedPartitionCount ? (
<Metrics.LightText>
{underReplicatedPartitionCount}
</Metrics.LightText>
diff --git a/kafka-ui-react-app/src/components/Connect/Details/Tasks/ListItem/ListItemContainer.ts b/kafka-ui-react-app/src/components/Connect/Details/Tasks/ListItem/ListItemContainer.ts
index c09054e63d0..b7107500b72 100644
--- a/kafka-ui-react-app/src/components/Connect/Details/Tasks/ListItem/ListItemContainer.ts
+++ b/kafka-ui-react-app/src/components/Connect/Details/Tasks/ListItem/ListItemContainer.ts
@@ -10,7 +10,7 @@ interface OwnProps extends RouteComponentProps {
task: Task;
}
-const mapStateToProps = (state: RootState, { task }: OwnProps) => ({
+const mapStateToProps = (_state: RootState, { task }: OwnProps) => ({
task,
});
diff --git a/kafka-ui-react-app/src/components/Topics/List/List.tsx b/kafka-ui-react-app/src/components/Topics/List/List.tsx
index 362010d1fc7..7431dabf633 100644
--- a/kafka-ui-react-app/src/components/Topics/List/List.tsx
+++ b/kafka-ui-react-app/src/components/Topics/List/List.tsx
@@ -149,6 +149,8 @@ const List: React.FC<TopicsListProps> = ({
'' | 'deleteTopics' | 'purgeMessages'
>('');
+ const [confirmationModalText, setConfirmationModalText] =
+ React.useState<string>('');
const closeConfirmationModal = () => {
setConfirmationModal('');
};
@@ -157,22 +159,6 @@ const List: React.FC<TopicsListProps> = ({
tableState.toggleSelection(false);
}, [tableState]);
- const deleteTopicsHandler = React.useCallback(() => {
- deleteTopics(clusterName, Array.from(tableState.selectedIds));
- closeConfirmationModal();
- clearSelectedTopics();
- }, [clearSelectedTopics, clusterName, deleteTopics, tableState.selectedIds]);
- const purgeMessagesHandler = React.useCallback(() => {
- clearTopicsMessages(clusterName, Array.from(tableState.selectedIds));
- closeConfirmationModal();
- clearSelectedTopics();
- }, [
- clearSelectedTopics,
- clearTopicsMessages,
- clusterName,
- tableState.selectedIds,
- ]);
-
const searchHandler = React.useCallback(
(searchString: string) => {
setTopicsSearch(searchString);
@@ -187,6 +173,23 @@ const List: React.FC<TopicsListProps> = ({
},
[setTopicsSearch, history, pathname, perPage, page]
);
+ const deleteOrPurgeConfirmationHandler = React.useCallback(() => {
+ const selectedIds = Array.from(tableState.selectedIds);
+ if (confirmationModal === 'deleteTopics') {
+ deleteTopics(clusterName, selectedIds);
+ } else {
+ clearTopicsMessages(clusterName, selectedIds);
+ }
+ closeConfirmationModal();
+ clearSelectedTopics();
+ }, [
+ confirmationModal,
+ clearSelectedTopics,
+ clusterName,
+ deleteTopics,
+ clearTopicsMessages,
+ tableState.selectedIds,
+ ]);
const ActionsCell = React.memo<TableCellProps<TopicWithDetailedInfo, string>>(
({ hovered, dataItem: { internal, cleanUpPolicy, name } }) => {
@@ -306,6 +309,9 @@ const List: React.FC<TopicsListProps> = ({
buttonType="secondary"
onClick={() => {
setConfirmationModal('deleteTopics');
+ setConfirmationModalText(
+ 'Are you sure you want to remove selected topics?'
+ );
}}
>
Delete selected topics
@@ -329,6 +335,9 @@ const List: React.FC<TopicsListProps> = ({
buttonType="secondary"
onClick={() => {
setConfirmationModal('purgeMessages');
+ setConfirmationModalText(
+ 'Are you sure you want to purge messages of selected topics?'
+ );
}}
>
Purge messages of selected topics
@@ -337,15 +346,9 @@ const List: React.FC<TopicsListProps> = ({
<ConfirmationModal
isOpen={confirmationModal !== ''}
onCancel={closeConfirmationModal}
- onConfirm={
- confirmationModal === 'deleteTopics'
- ? deleteTopicsHandler
- : purgeMessagesHandler
- }
+ onConfirm={deleteOrPurgeConfirmationHandler}
>
- {confirmationModal === 'deleteTopics'
- ? 'Are you sure you want to remove selected topics?'
- : 'Are you sure you want to purge messages of selected topics?'}
+ {confirmationModalText}
</ConfirmationModal>
</>
)}
diff --git a/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamsContainer.tsx b/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamsContainer.tsx
index 4d5065e6731..5806d11e928 100644
--- a/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamsContainer.tsx
+++ b/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamsContainer.tsx
@@ -10,7 +10,7 @@ interface OwnProps extends RouteComponentProps {
}
const mapStateToProps = (
- state: RootState,
+ _state: RootState,
{ isSubmitting, config }: OwnProps
) => ({
isSubmitting,
diff --git a/kafka-ui-react-app/src/components/common/SmartTable/SmartTable.tsx b/kafka-ui-react-app/src/components/common/SmartTable/SmartTable.tsx
index 0b04279dbf8..575db21b9cc 100644
--- a/kafka-ui-react-app/src/components/common/SmartTable/SmartTable.tsx
+++ b/kafka-ui-react-app/src/components/common/SmartTable/SmartTable.tsx
@@ -48,10 +48,9 @@ export const SmartTable = <T, TId extends IdType, OT = never>({
const { headerCell, title, orderValue } = child.props;
- const HeaderCell = headerCell as
- | React.FC<TableHeaderCellProps<T, TId, OT>>
- | undefined;
-
+ const HeaderCell = headerCell as React.FC<
+ TableHeaderCellProps<T, TId, OT>
+ >;
return HeaderCell ? (
<S.TableHeaderCell>
<HeaderCell
| null | train | train | 2022-04-27T08:14:56 | "2022-02-21T09:27:41Z" | workshur | train |
provectus/kafka-ui/1827_1829 | provectus/kafka-ui | provectus/kafka-ui/1827 | provectus/kafka-ui/1829 | [
"connected"
] | c5234ce47071e0ae0f2a2c0e94f0acc44123c8e5 | b406d1bba38ee002474df981002d0d2657f108cf | [] | [
"should we add this style by default? ",
"can we maybe pass action prop instead of style tag -> where it would insert a td created by styled component which have overflow thingy on it , so we would not have specificity issues in the future. \r\n\r\nOR \r\n\r\nthis API actually allows you to pass a custom Cell you can create your own cell with those properties and put it here and it will work like a charm.",
"I passed a styled component with props as a custom td component."
] | "2022-04-13T11:11:14Z" | [
"type/bug",
"scope/frontend",
"status/accepted",
"status/confirmed",
"type/regression"
] | Topics' sandwich menu is broken | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
The sandwich menu isn`t showing on the page Topics
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
http://master.internal.kafka-ui.provectus.io/
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Navigate to local->Topics
2. Go to the end of a topic`s string
3. Click the sandwich menu
4. Observe: menu is not showing
**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->
**Additional context**
<!--
(Add any other context about the problem here)
-->
| [
"kafka-ui-react-app/src/components/Topics/List/List.styled.ts",
"kafka-ui-react-app/src/components/Topics/List/List.tsx",
"kafka-ui-react-app/src/components/common/SmartTable/TableColumn.tsx",
"kafka-ui-react-app/src/components/common/SmartTable/TableRow.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/List/List.styled.ts",
"kafka-ui-react-app/src/components/Topics/List/List.tsx",
"kafka-ui-react-app/src/components/common/SmartTable/TableColumn.tsx",
"kafka-ui-react-app/src/components/common/SmartTable/TableRow.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/List/List.styled.ts b/kafka-ui-react-app/src/components/Topics/List/List.styled.ts
index a7c5bb328a4..c8d4a14533d 100644
--- a/kafka-ui-react-app/src/components/Topics/List/List.styled.ts
+++ b/kafka-ui-react-app/src/components/Topics/List/List.styled.ts
@@ -1,3 +1,4 @@
+import { Td } from 'components/common/table/TableHeaderCell/TableHeaderCell.styled';
import { NavLink } from 'react-router-dom';
import styled, { css } from 'styled-components';
@@ -20,3 +21,7 @@ export const Link = styled(NavLink).attrs({ activeClassName: 'is-active' })<{
}
`
);
+
+export const ActionsTd = styled(Td)`
+ overflow: visible;
+`;
diff --git a/kafka-ui-react-app/src/components/Topics/List/List.tsx b/kafka-ui-react-app/src/components/Topics/List/List.tsx
index dc22ac81042..6c4ec05b57f 100644
--- a/kafka-ui-react-app/src/components/Topics/List/List.tsx
+++ b/kafka-ui-react-app/src/components/Topics/List/List.tsx
@@ -39,6 +39,7 @@ import {
TitleCell,
TopicSizeCell,
} from './TopicsTableCells';
+import { ActionsTd } from './List.styled';
export interface TopicsListProps {
areTopicsFetching: boolean;
@@ -350,8 +351,8 @@ const List: React.FC<TopicsListProps> = ({
/>
<TableColumn
maxWidth="4%"
- className="topic-action-block"
cell={ActionsCell}
+ customTd={ActionsTd}
/>
</SmartTable>
</div>
diff --git a/kafka-ui-react-app/src/components/common/SmartTable/TableColumn.tsx b/kafka-ui-react-app/src/components/common/SmartTable/TableColumn.tsx
index c58c7d67b06..27f03398607 100644
--- a/kafka-ui-react-app/src/components/common/SmartTable/TableColumn.tsx
+++ b/kafka-ui-react-app/src/components/common/SmartTable/TableColumn.tsx
@@ -36,11 +36,12 @@ interface TableColumnProps<T, TId extends IdType, OT = never> {
maxWidth?: string;
className?: string;
orderValue?: OT;
+ customTd?: typeof S.Td;
}
export const TableColumn = <T, TId extends IdType, OT = never>(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
- props: React.PropsWithChildren<TableColumnProps<T, TId, OT>>
+ _props: React.PropsWithChildren<TableColumnProps<T, TId, OT>>
): React.ReactElement => {
return <td />;
};
diff --git a/kafka-ui-react-app/src/components/common/SmartTable/TableRow.tsx b/kafka-ui-react-app/src/components/common/SmartTable/TableRow.tsx
index 1a2785b1708..446d52e46c7 100644
--- a/kafka-ui-react-app/src/components/common/SmartTable/TableRow.tsx
+++ b/kafka-ui-react-app/src/components/common/SmartTable/TableRow.tsx
@@ -62,23 +62,24 @@ export const TableRow = <T, TId extends IdType, OT = never>({
if (!isColumnElement<T, TId>(child)) {
return child;
}
- const { cell, field, maxWidth, className } = child.props;
+ const { cell, field, maxWidth, customTd } = child.props;
const Cell = cell as React.FC<TableCellProps<T, TId, OT>> | undefined;
+ const TdComponent = customTd || Td;
- return Cell ? (
- <Td className={className} maxWidth={maxWidth}>
- <Cell
- tableState={tableState}
- hovered={hovered}
- rowIndex={index}
- dataItem={dataItem}
- />
- </Td>
- ) : (
- <Td className={className} maxWidth={maxWidth}>
- {field && propertyLookup(field, dataItem)}
- </Td>
+ return (
+ <TdComponent maxWidth={maxWidth}>
+ {Cell ? (
+ <Cell
+ tableState={tableState}
+ hovered={hovered}
+ rowIndex={index}
+ dataItem={dataItem}
+ />
+ ) : (
+ field && propertyLookup(field, dataItem)
+ )}
+ </TdComponent>
);
})}
</tr>
| null | test | train | 2022-04-20T23:59:11 | "2022-04-12T16:30:04Z" | agolosen | train |
provectus/kafka-ui/1334_1831 | provectus/kafka-ui | provectus/kafka-ui/1334 | provectus/kafka-ui/1831 | [
"connected"
] | 20300f327d7a9cf3d616d2bfd01cec8300278001 | 7eab325ac3bd1fdbde96639a6d337521c56d4318 | [
"@lazzy-panda let's rename \"failed\" to \"failed connectors\" and add a \"failed tasks\" pane as well\r\n\r\n"
] | [
"I would suggest to move this logic to redux. Just create a new selector",
"Getting failed connectors moved to redux selector and .spec file updated",
"we can actually pass failed parameter to the , setUpComponent and test the failed rendering view. so we can make it here conditional.",
"Connectors or connects?",
"```suggestion\r\n failedConnectors: getFailedConnectors(state),\r\n```",
"```suggestion\r\n failedConnectors: FullConnectorInfo[];\r\n```",
"The kafka component is called Kafka Connect and consists of connectors :)",
"```suggestion\r\n title=\"Failed Connectors\"\r\n```",
"```suggestion\r\n (connector) => connector.status.state === ConnectorState.FAILED\r\n```",
"done"
] | "2022-04-14T09:30:27Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted"
] | Please add a counters of all connectors, tasks and failed connectors, tasks | ### Is your proposal related to a problem?
KC can have a very large number of connectors. It can be very tedious and error prone to scroll through the list in search of any failed tasks/connectors. It would be easy to miss any failed connector/task as well.
### Describe the solution you'd like
Ideally -- a filter for the list to only show connectors that have failed tasks. But good starting point would be at least to show a counter of total connectors/tasks and counter of failed connectors/tasks.
### Describe alternatives you've considered
N/A
### Additional context
N/A
| [
"kafka-ui-react-app/src/components/Connect/List/List.tsx",
"kafka-ui-react-app/src/components/Connect/List/ListContainer.ts",
"kafka-ui-react-app/src/components/Connect/List/__tests__/List.spec.tsx",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts",
"kafka-ui-react-app/src/redux/reducers/connect/selectors.ts"
] | [
"kafka-ui-react-app/src/components/Connect/List/List.tsx",
"kafka-ui-react-app/src/components/Connect/List/ListContainer.ts",
"kafka-ui-react-app/src/components/Connect/List/__tests__/List.spec.tsx",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts",
"kafka-ui-react-app/src/redux/reducers/connect/selectors.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/Connect/List/List.tsx b/kafka-ui-react-app/src/components/Connect/List/List.tsx
index 55f93d1c478..1958ac200a2 100644
--- a/kafka-ui-react-app/src/components/Connect/List/List.tsx
+++ b/kafka-ui-react-app/src/components/Connect/List/List.tsx
@@ -20,6 +20,7 @@ export interface ListProps {
areConnectorsFetching: boolean;
connectors: FullConnectorInfo[];
connects: Connect[];
+ failedConnectors: FullConnectorInfo[];
fetchConnects(clusterName: ClusterName): void;
fetchConnectors({ clusterName }: { clusterName: ClusterName }): void;
search: string;
@@ -30,6 +31,7 @@ const List: React.FC<ListProps> = ({
connectors,
areConnectsFetching,
areConnectorsFetching,
+ failedConnectors,
fetchConnects,
fetchConnectors,
search,
@@ -72,6 +74,13 @@ const List: React.FC<ListProps> = ({
>
{connectors.length}
</Metrics.Indicator>
+ <Metrics.Indicator
+ label="Failed"
+ title="Failed Connectors"
+ fetching={areConnectsFetching}
+ >
+ {failedConnectors?.length}
+ </Metrics.Indicator>
</Metrics.Section>
</Metrics.Wrapper>
<ControlPanelWrapper hasInput>
diff --git a/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts b/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts
index 15fb02ad13c..b1180738b48 100644
--- a/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts
+++ b/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts
@@ -11,6 +11,7 @@ import {
getAreConnectsFetching,
getAreConnectorsFetching,
getConnectorSearch,
+ getFailedConnectors,
} from 'redux/reducers/connect/selectors';
import List from 'components/Connect/List/List';
@@ -18,6 +19,7 @@ const mapStateToProps = (state: RootState) => ({
areConnectsFetching: getAreConnectsFetching(state),
areConnectorsFetching: getAreConnectorsFetching(state),
connects: getConnects(state),
+ failedConnectors: getFailedConnectors(state),
connectors: getConnectors(state),
search: getConnectorSearch(state),
});
diff --git a/kafka-ui-react-app/src/components/Connect/List/__tests__/List.spec.tsx b/kafka-ui-react-app/src/components/Connect/List/__tests__/List.spec.tsx
index 68d59cefd02..a1edf8ce47b 100644
--- a/kafka-ui-react-app/src/components/Connect/List/__tests__/List.spec.tsx
+++ b/kafka-ui-react-app/src/components/Connect/List/__tests__/List.spec.tsx
@@ -1,5 +1,8 @@
import React from 'react';
-import { connectors } from 'redux/reducers/connect/__test__/fixtures';
+import {
+ connectors,
+ failedConnectors,
+} from 'redux/reducers/connect/__test__/fixtures';
import ClusterContext, {
ContextProps,
initialValue,
@@ -33,6 +36,7 @@ describe('Connectors List', () => {
areConnectorsFetching
areConnectsFetching
connectors={[]}
+ failedConnectors={[]}
connects={[]}
fetchConnects={fetchConnects}
fetchConnectors={fetchConnectors}
@@ -66,6 +70,15 @@ describe('Connectors List', () => {
expect(screen.getAllByRole('row').length).toEqual(3);
});
+ it('renders failed connectors list', () => {
+ renderComponent({
+ areConnectorsFetching: false,
+ failedConnectors,
+ });
+ expect(screen.queryByRole('PageLoader')).not.toBeInTheDocument();
+ expect(screen.getByTitle('Failed Connectors')).toBeInTheDocument();
+ });
+
it('handles fetchConnects and fetchConnectors', () => {
renderComponent();
expect(fetchConnects).toHaveBeenCalledTimes(1);
diff --git a/kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts b/kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts
index 9d8ecff3217..2ef1248acfe 100644
--- a/kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts
+++ b/kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts
@@ -69,6 +69,33 @@ export const connectors: FullConnectorInfo[] = [
},
];
+export const failedConnectors: FullConnectorInfo[] = [
+ {
+ connect: 'first',
+ name: 'hdfs-source-connector',
+ connectorClass: 'FileStreamSource',
+ type: ConnectorType.SOURCE,
+ topics: ['test-topic'],
+ status: {
+ state: ConnectorState.FAILED,
+ },
+ tasksCount: 2,
+ failedTasksCount: 0,
+ },
+ {
+ connect: 'second',
+ name: 'hdfs2-source-connector',
+ connectorClass: 'FileStreamSource',
+ type: ConnectorType.SINK,
+ topics: ['test-topic'],
+ status: {
+ state: ConnectorState.FAILED,
+ },
+ tasksCount: 3,
+ failedTasksCount: 1,
+ },
+];
+
export const connectorServerPayload = {
connect: 'first',
name: 'hdfs-source-connector',
diff --git a/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts b/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts
index a5becc22a1c..bf1d5e946f9 100644
--- a/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts
+++ b/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts
@@ -19,6 +19,7 @@ describe('Connect selectors', () => {
false
);
expect(selectors.getConnectors(store.getState())).toEqual([]);
+ expect(selectors.getFailedConnectors(store.getState())).toEqual([]);
expect(selectors.getIsConnectorFetching(store.getState())).toEqual(false);
expect(selectors.getConnector(store.getState())).toEqual(null);
expect(selectors.getConnectorStatus(store.getState())).toEqual(undefined);
@@ -65,6 +66,14 @@ describe('Connect selectors', () => {
expect(selectors.getConnectors(store.getState())).toEqual(connectors);
});
+ it('returns failed connectors', () => {
+ store.dispatch({
+ type: fetchConnectors.fulfilled.type,
+ payload: { connectors },
+ });
+ expect(selectors.getFailedConnectors(store.getState()).length).toEqual(1);
+ });
+
it('returns connector', () => {
store.dispatch({
type: fetchConnector.fulfilled.type,
diff --git a/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts b/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts
index 9e859492d29..107bc843ab5 100644
--- a/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts
+++ b/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts
@@ -1,7 +1,7 @@
import { createSelector } from '@reduxjs/toolkit';
import { ConnectState, RootState } from 'redux/interfaces';
import { createFetchingSelector } from 'redux/reducers/loader/selectors';
-import { ConnectorTaskStatus } from 'generated-sources';
+import { ConnectorTaskStatus, ConnectorState } from 'generated-sources';
import {
deleteConnector,
@@ -43,6 +43,15 @@ export const getConnectors = createSelector(
({ connectors }) => connectors
);
+export const getFailedConnectors = createSelector(
+ connectState,
+ ({ connectors }) => {
+ return connectors.filter(
+ (connector) => connector.status.state === ConnectorState.FAILED
+ );
+ }
+);
+
const getConnectorFetchingStatus = createFetchingSelector(
fetchConnector.typePrefix
);
| null | test | train | 2022-05-17T11:53:38 | "2021-12-29T02:38:32Z" | akamensky | train |
provectus/kafka-ui/1653_1838 | provectus/kafka-ui | provectus/kafka-ui/1653 | provectus/kafka-ui/1838 | [
"connected"
] | f6e98ec5f554946b3c513c01c755d0e222c4829f | efe135342e3eec7148c4f0cdb451faec3db5267c | [] | [] | "2022-04-15T09:25:34Z" | [
"type/bug",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Frontend: Messages view is showing old data | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
When switching to Messages view it is showing previous rendered table for couples moments
**Steps to Reproduce**
Steps to reproduce the behavior:
1. go to non-empty topic -> Messages
2. go to empty topic -> Messages
3. table will show first topic's messages and then cleared
**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
we don't see invalid table render
**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->
https://user-images.githubusercontent.com/702205/155094088-bae58230-296b-42a9-b07a-ddb04f303d84.mov
**Additional context**
<!--
(Add any other context about the problem here)
-->
| [
"kafka-ui-react-app/src/components/Topics/Topic/Topic.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/TopicContainer.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/__tests__/Topic.spec.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Topic.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/TopicContainer.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/__tests__/Topic.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Topic.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Topic.tsx
index 3b821658d2f..941eaa251e2 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Topic.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Topic.tsx
@@ -14,12 +14,14 @@ interface RouterParams {
interface TopicProps {
isTopicFetching: boolean;
+ resetTopicMessages: () => void;
fetchTopicDetails: (clusterName: ClusterName, topicName: TopicName) => void;
}
const Topic: React.FC<TopicProps> = ({
isTopicFetching,
fetchTopicDetails,
+ resetTopicMessages,
}) => {
const { clusterName, topicName } = useParams<RouterParams>();
@@ -27,6 +29,12 @@ const Topic: React.FC<TopicProps> = ({
fetchTopicDetails(clusterName, topicName);
}, [fetchTopicDetails, clusterName, topicName]);
+ React.useEffect(() => {
+ return () => {
+ resetTopicMessages();
+ };
+ }, []);
+
if (isTopicFetching) {
return <PageLoader />;
}
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/TopicContainer.tsx b/kafka-ui-react-app/src/components/Topics/Topic/TopicContainer.tsx
index d0a33cab032..713a3693478 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/TopicContainer.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/TopicContainer.tsx
@@ -1,6 +1,6 @@
import { connect } from 'react-redux';
import { RootState } from 'redux/interfaces';
-import { fetchTopicDetails } from 'redux/actions';
+import { fetchTopicDetails, resetTopicMessages } from 'redux/actions';
import { getIsTopicDetailsFetching } from 'redux/reducers/topics/selectors';
import Topic from './Topic';
@@ -11,6 +11,7 @@ const mapStateToProps = (state: RootState) => ({
const mapDispatchToProps = {
fetchTopicDetails,
+ resetTopicMessages,
};
export default connect(mapStateToProps, mapDispatchToProps)(Topic);
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/__tests__/Topic.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/__tests__/Topic.spec.tsx
index d5ee996f749..eaea0421560 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/__tests__/Topic.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/__tests__/Topic.spec.tsx
@@ -22,6 +22,7 @@ jest.mock('components/common/PageLoader/PageLoader', () => () => (
<div>Loading</div>
));
+const resetTopicMessages = jest.fn();
const fetchTopicDetailsMock = jest.fn();
const renderComponent = (pathname: string, topicFetching: boolean) =>
@@ -29,6 +30,7 @@ const renderComponent = (pathname: string, topicFetching: boolean) =>
<Route path={clusterTopicPath(':clusterName', ':topicName')}>
<Topic
isTopicFetching={topicFetching}
+ resetTopicMessages={resetTopicMessages}
fetchTopicDetails={fetchTopicDetailsMock}
/>
</Route>,
@@ -59,3 +61,12 @@ it('fetches topicDetails', () => {
renderComponent(clusterTopicPath('local', 'myTopicName'), false);
expect(fetchTopicDetailsMock).toHaveBeenCalledTimes(1);
});
+
+it('resets topic messages after unmount', () => {
+ const component = renderComponent(
+ clusterTopicPath('local', 'myTopicName'),
+ false
+ );
+ component.unmount();
+ expect(resetTopicMessages).toHaveBeenCalledTimes(1);
+});
| null | val | train | 2022-04-22T08:41:40 | "2022-02-22T08:39:29Z" | iliax | train |
provectus/kafka-ui/1386_1839 | provectus/kafka-ui | provectus/kafka-ui/1386 | provectus/kafka-ui/1839 | [
"connected"
] | b406d1bba38ee002474df981002d0d2657f108cf | 25266991df91a645a2ae046c196735d522413cda | [
"Related #1387. ",
"Connectors error messages are broken as well\r\n\r\n",
"Topic creation:\r\n<img width=\"541\" alt=\"image\" src=\"https://user-images.githubusercontent.com/1494347/153438290-dfc64d0e-8cd6-4235-8ec5-4d16f2df39a3.png\">\r\n"
] | [] | "2022-04-15T14:29:48Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted"
] | SR: Display a clear warning message if a schema already exists | ### Is your proposal related to a problem?
<!--
Provide a clear and concise description of what the problem is.
For example, "I'm always frustrated when..."
-->
(Write your answer here.)
If you try to create a schema with a name that already exists now is displaying an unclear message (the same for already existing name, invalid syntax, incorrect schema`s type).
### Describe the solution you'd like
<!--
Provide a clear and concise description of what you want to happen.
-->
(Describe your proposed solution here.)
Display a clear warning message what the problem is, i.e. for this case, 'There is already a schema with the name XXX'.
### Describe alternatives you've considered
<!--
Let us know about other solutions you've tried or researched.
-->
(Write your answer here.)
### Additional context
<!--
Is there anything else you can add about the proposal?
You might want to link to related issues here, if you haven't already.
-->
(Write your answer here.)
| [
"kafka-ui-react-app/src/redux/actions/__test__/thunks/connectors.spec.ts",
"kafka-ui-react-app/src/redux/actions/thunks/connectors.ts"
] | [
"kafka-ui-react-app/src/redux/actions/__test__/thunks/connectors.spec.ts",
"kafka-ui-react-app/src/redux/actions/thunks/connectors.ts"
] | [] | diff --git a/kafka-ui-react-app/src/redux/actions/__test__/thunks/connectors.spec.ts b/kafka-ui-react-app/src/redux/actions/__test__/thunks/connectors.spec.ts
index c72e15653ad..aa20ed6313c 100644
--- a/kafka-ui-react-app/src/redux/actions/__test__/thunks/connectors.spec.ts
+++ b/kafka-ui-react-app/src/redux/actions/__test__/thunks/connectors.spec.ts
@@ -192,7 +192,7 @@ describe('Thunks', () => {
actions.createConnectorAction.failure({
alert: {
subject: 'local-first',
- title: 'Kafka Connect Connector Create',
+ title: `Connector with name ${connectorName} already exists`,
response: {
status: 404,
statusText: 'Not Found',
diff --git a/kafka-ui-react-app/src/redux/actions/thunks/connectors.ts b/kafka-ui-react-app/src/redux/actions/thunks/connectors.ts
index 35124e7ceb5..76aec393cec 100644
--- a/kafka-ui-react-app/src/redux/actions/thunks/connectors.ts
+++ b/kafka-ui-react-app/src/redux/actions/thunks/connectors.ts
@@ -111,7 +111,7 @@ export const createConnector =
const response = await getResponse(error);
const alert: FailurePayload = {
subject: [clusterName, connectName].join('-'),
- title: `Kafka Connect Connector Create`,
+ title: `Connector with name ${newConnector.name} already exists`,
response,
};
dispatch(actions.createConnectorAction.failure({ alert }));
| null | train | train | 2022-04-21T00:09:40 | "2022-01-13T19:53:15Z" | agolosen | train |
provectus/kafka-ui/1695_1843 | provectus/kafka-ui | provectus/kafka-ui/1695 | provectus/kafka-ui/1843 | [
"timestamp(timedelta=0.0, similarity=1.0)",
"connected"
] | 4b907e1005d1d087e0dad207b9e4d7e7b1ec7e7e | 2a0c8176ab67bd01d73d9affcb7ba2026abbaaee | [] | [] | "2022-04-18T09:26:15Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted"
] | Change spelling of ksqlDB at bread crumbs | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
There is weird spelling Ksql Db of ksqlDB at the bread crumbs.
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
http://issues-1109.internal.kafka-ui.provectus.io/ui/clusters/local/ksql-db
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Navigate to KSQL DB
2. Push the button Execute KSQL Request
3. Observe bread crumbs: Ksql Db / Query
**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
ksqlDB as it`s writing on the https://ksqldb.io/
**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->
**Additional context**
<!--
(Add any other context about the problem here)
-->
| [
"kafka-ui-react-app/src/components/common/Breadcrumb/Breadcrumb.tsx",
"kafka-ui-react-app/src/lib/__test__/paths.spec.ts",
"kafka-ui-react-app/src/lib/constants.ts",
"kafka-ui-react-app/src/lib/paths.ts"
] | [
"kafka-ui-react-app/src/components/common/Breadcrumb/Breadcrumb.tsx",
"kafka-ui-react-app/src/lib/__test__/paths.spec.ts",
"kafka-ui-react-app/src/lib/constants.ts",
"kafka-ui-react-app/src/lib/paths.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/common/Breadcrumb/Breadcrumb.tsx b/kafka-ui-react-app/src/components/common/Breadcrumb/Breadcrumb.tsx
index 5196d776006..e957dbb797b 100644
--- a/kafka-ui-react-app/src/components/common/Breadcrumb/Breadcrumb.tsx
+++ b/kafka-ui-react-app/src/components/common/Breadcrumb/Breadcrumb.tsx
@@ -2,12 +2,17 @@ import React, { useContext } from 'react';
import { Link } from 'react-router-dom';
import cn from 'classnames';
import { clusterPath } from 'lib/paths';
+import { BREADCRUMB_DEFINITIONS } from 'lib/constants';
import { BreadcrumbWrapper } from './Breadcrumb.styled';
import { BreadcrumbContext } from './Breadcrumb.context';
const basePathEntriesLength = clusterPath(':clusterName').split('/').length;
+export interface BreadcrumbDefinitions {
+ [key: string]: string;
+}
+
const Breadcrumb: React.FC = () => {
const breadcrumbContext = useContext(BreadcrumbContext);
@@ -33,7 +38,9 @@ const Breadcrumb: React.FC = () => {
<BreadcrumbWrapper role="list">
{links.slice(0, links.length - 1).map((link, index) => (
<li key={link}>
- <Link to={getPathPredicate(index)}>{link}</Link>
+ <Link to={getPathPredicate(index)}>
+ {BREADCRUMB_DEFINITIONS[link] || link}
+ </Link>
</li>
))}
<li
diff --git a/kafka-ui-react-app/src/lib/__test__/paths.spec.ts b/kafka-ui-react-app/src/lib/__test__/paths.spec.ts
index 3103114233b..abb136b331b 100644
--- a/kafka-ui-react-app/src/lib/__test__/paths.spec.ts
+++ b/kafka-ui-react-app/src/lib/__test__/paths.spec.ts
@@ -179,12 +179,12 @@ describe('Paths', () => {
it('clusterKsqlDbPath', () => {
expect(paths.clusterKsqlDbPath(clusterName)).toEqual(
- `${paths.clusterPath(clusterName)}/ksql-db`
+ `${paths.clusterPath(clusterName)}/ksqldb`
);
});
it('clusterKsqlDbPath with default value', () => {
expect(paths.clusterKsqlDbPath()).toEqual(
- `${paths.clusterPath(':clusterName')}/ksql-db`
+ `${paths.clusterPath(':clusterName')}/ksqldb`
);
});
it('clusterKsqlDbQueryPath', () => {
diff --git a/kafka-ui-react-app/src/lib/constants.ts b/kafka-ui-react-app/src/lib/constants.ts
index 189bdc71974..1366db367a2 100644
--- a/kafka-ui-react-app/src/lib/constants.ts
+++ b/kafka-ui-react-app/src/lib/constants.ts
@@ -1,4 +1,5 @@
import { ConfigurationParameters } from 'generated-sources';
+import { BreadcrumbDefinitions } from 'components/common/Breadcrumb/Breadcrumb';
declare global {
interface Window {
@@ -57,3 +58,7 @@ export const GIT_REPO_LATEST_RELEASE_LINK =
'https://api.github.com/repos/provectus/kafka-ui/releases/latest';
export const GIT_TAG = process.env.REACT_APP_TAG;
export const GIT_COMMIT = process.env.REACT_APP_COMMIT;
+
+export const BREADCRUMB_DEFINITIONS: BreadcrumbDefinitions = {
+ Ksqldb: 'ksqlDB',
+};
diff --git a/kafka-ui-react-app/src/lib/paths.ts b/kafka-ui-react-app/src/lib/paths.ts
index efa8fda48ae..ee3152d6ed0 100644
--- a/kafka-ui-react-app/src/lib/paths.ts
+++ b/kafka-ui-react-app/src/lib/paths.ts
@@ -127,8 +127,8 @@ export const clusterConnectConnectorConfigPath = (
// KsqlDb
export const clusterKsqlDbPath = (clusterName: ClusterName = ':clusterName') =>
- `${clusterPath(clusterName)}/ksql-db`;
+ `${clusterPath(clusterName)}/ksqldb`;
export const clusterKsqlDbQueryPath = (
clusterName: ClusterName = ':clusterName'
-) => `${clusterPath(clusterName)}/ksql-db/query`;
+) => `${clusterPath(clusterName)}/ksqldb/query`;
| null | train | train | 2022-04-22T01:57:30 | "2022-03-02T13:49:54Z" | agolosen | train |
provectus/kafka-ui/1847_1848 | provectus/kafka-ui | provectus/kafka-ui/1847 | provectus/kafka-ui/1848 | [
"connected"
] | db217e16053a9e96808af6b21e0318985b5c79ee | 29ee6b15172336817ff34bbf94fdcc80b238870a | [] | [] | "2022-04-18T11:07:40Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted"
] | Implement a debounce timeout on message text search | We shouldn't instantly send a new request for each symbol typed. | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
index b0679486cef..d753f33cfb5 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
@@ -22,6 +22,7 @@ import { BASE_PARAMS } from 'lib/constants';
import Input from 'components/common/Input/Input';
import Select from 'components/common/Select/Select';
import { Button } from 'components/common/Button/Button';
+import Search from 'components/common/Search/Search';
import FilterModal, {
FilterEdit,
} from 'components/Topics/Topic/Details/Messages/Filters/FilterModal';
@@ -348,14 +349,10 @@ const Filters: React.FC<FiltersProps> = ({
<S.FiltersWrapper>
<div>
<S.FilterInputs>
- <Input
- inputSize="M"
- id="searchText"
- type="text"
- leftIcon="fas fa-search"
+ <Search
placeholder="Search"
value={query}
- onChange={({ target: { value } }) => setQuery(value)}
+ handleSearch={(value: string) => setQuery(value)}
/>
<S.SeekTypeSelectorWrapper>
<Select
| null | val | train | 2022-04-22T15:33:00 | "2022-04-18T10:30:23Z" | Haarolean | train |
provectus/kafka-ui/1844_1849 | provectus/kafka-ui | provectus/kafka-ui/1844 | provectus/kafka-ui/1849 | [
"connected"
] | 3a9e1d12f4e003b52b694e1feac3187e523dbdbd | f6e98ec5f554946b3c513c01c755d0e222c4829f | [] | [
"shouldn't offset be in the dependency array otherwise it will get some outdated variable ?",
"No. Offset is an input value state. If I added offset to the dependencies, the form would be submitted every time the input changed. That's the reason why offset wasn't given as a dependency of useCallback (of handleFiltersSubmit)."
] | "2022-04-18T11:13:26Z" | [
"type/bug",
"scope/frontend",
"status/accepted",
"status/confirmed",
"type/regression"
] | Message search offset is not being set unless rendered first | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
Message search offset is not being set until a few actions are performed.
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
master version
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Go to Topic->Messages
2. Set "1" in filter offset, `seekTo` in request will be `0::0`. This is not a valid behavior.
3. Change "offset" to "timestamp" and back, set offset to "1" and submit a request again. This time the `seekTo` param will be `0::1` as it should. | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
index a38e5e8a27a..b6e6cf3e653 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
@@ -182,48 +182,37 @@ const Filters: React.FC<FiltersProps> = ({
);
};
- const handleFiltersSubmit = React.useCallback(() => {
- setAttempt(attempt + 1);
-
- if (isSeekTypeControlVisible) {
- props.seekType = isLive ? SeekType.LATEST : currentSeekType;
- props.seekTo = selectedPartitions.map(({ value }) => {
- let seekToOffset;
-
- if (currentSeekType === SeekType.OFFSET) {
- if (offset) {
- seekToOffset = offset;
- } else {
- seekToOffset =
- seekDirection === SeekDirection.FORWARD
- ? partitionMap[value].offsetMin
- : partitionMap[value].offsetMax;
- }
- } else if (timestamp) {
- seekToOffset = timestamp.getTime();
- }
-
- return `${value}::${seekToOffset || '0'}`;
+ const handleFiltersSubmit = React.useCallback(
+ (currentOffset: string) => {
+ setAttempt(attempt + 1);
+
+ if (isSeekTypeControlVisible) {
+ props.seekType = isLive ? SeekType.LATEST : currentSeekType;
+ props.seekTo = selectedPartitions.map(({ value }) => {
+ const offsetProperty =
+ seekDirection === SeekDirection.FORWARD ? 'offsetMin' : 'offsetMax';
+ const offsetBasedSeekTo =
+ currentOffset || partitionMap[value][offsetProperty];
+ const seekToOffset =
+ currentSeekType === SeekType.OFFSET
+ ? offsetBasedSeekTo
+ : timestamp?.getTime();
+
+ return `${value}::${seekToOffset || '0'}`;
+ });
+ }
+
+ const newProps = omitBy(props, (v) => v === undefined || v === '');
+ const qs = Object.keys(newProps)
+ .map((key) => `${key}=${newProps[key]}`)
+ .join('&');
+
+ history.push({
+ search: `?${qs}`,
});
- }
-
- const newProps = omitBy(props, (v) => v === undefined || v === '');
- const qs = Object.keys(newProps)
- .map((key) => `${key}=${newProps[key]}`)
- .join('&');
-
- history.push({
- search: `?${qs}`,
- });
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [
- seekDirection,
- queryType,
- activeFilter,
- currentSeekType,
- timestamp,
- query,
- ]);
+ },
+ [seekDirection, queryType, activeFilter, currentSeekType, timestamp, query]
+ );
const handleSSECancel = () => {
if (!source.current) return;
@@ -313,7 +302,10 @@ const Filters: React.FC<FiltersProps> = ({
}
break;
case TopicMessageEventTypeEnum.PHASE:
- if (phase?.name) updatePhase(phase.name);
+ if (phase?.name) {
+ updatePhase(phase.name);
+ setIsFetching(false);
+ }
break;
case TopicMessageEventTypeEnum.CONSUMING:
if (consuming) updateMeta(consuming);
@@ -345,11 +337,11 @@ const Filters: React.FC<FiltersProps> = ({
]);
React.useEffect(() => {
if (location.search?.length === 0) {
- handleFiltersSubmit();
+ handleFiltersSubmit(offset);
}
}, [handleFiltersSubmit, location]);
React.useEffect(() => {
- handleFiltersSubmit();
+ handleFiltersSubmit(offset);
}, [handleFiltersSubmit, seekDirection]);
return (
@@ -429,7 +421,7 @@ const Filters: React.FC<FiltersProps> = ({
buttonType="secondary"
buttonSize="M"
disabled={isSubmitDisabled}
- onClick={handleFiltersSubmit}
+ onClick={() => handleFiltersSubmit(offset)}
style={{ fontWeight: 500 }}
>
Submit
| null | val | train | 2022-04-22T06:58:41 | "2022-04-18T09:47:00Z" | Haarolean | train |
provectus/kafka-ui/1850_1851 | provectus/kafka-ui | provectus/kafka-ui/1850 | provectus/kafka-ui/1851 | [
"connected"
] | d8e507523552c90ee43a597902ead0c2df96d14b | a038762409af4021e2db4af293241c8c64da7bd4 | [
"Also, if click on a collapsed plus of a message on the right panel there are 2 links [SchemaLink](https://www.kafka-ui.provectus.io/) they both go to the Dashboard for all type of topics. The purpose of these links are not clear, but obviously it`s not a Schema link. "
] | [] | "2022-04-18T11:58:13Z" | [
"type/bug",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Preview is not clickable but look like a link in Messages | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
Word Preview near column names Key and Content of Message table look clickable but it`s not a link.
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
https://www.kafka-ui.provectus.io/
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Navigate to local/Topics
2. Choose and click some Topic
3. Click the tab Messages
4. Observe: word Preview near Key and Content looks like a link but it`s not a link.
**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
Following a link if it`s a link or Preview should look like a normal word.
**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->
**Additional context**
<!--
(Add any other context about the problem here)
-->
| [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Message.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.styled.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Message.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.styled.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Message.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Message.tsx
index 3ea5a9a1bc5..a8ab3ae91c8 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Message.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Message.tsx
@@ -62,13 +62,8 @@ const Message: React.FC<{ message: TopicMessage }> = ({
<StyledDataCell title={key}>{key}</StyledDataCell>
<StyledDataCell>
<S.Metadata>
- <S.MetadataLabel>Range:</S.MetadataLabel>
<S.MetadataValue>{content}</S.MetadataValue>
</S.Metadata>
- <S.Metadata>
- <S.MetadataLabel>Version:</S.MetadataLabel>
- <S.MetadataValue>3</S.MetadataValue>
- </S.Metadata>
</StyledDataCell>
<td style={{ width: '5%' }}>
{vEllipsisOpen && (
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.styled.ts b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.styled.ts
index ca5aec70120..092bf6803b8 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.styled.ts
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.styled.ts
@@ -1,5 +1,4 @@
import styled from 'styled-components';
-import { Link } from 'react-router-dom';
export const Wrapper = styled.tr`
background-color: ${({ theme }) => theme.topicMetaData.backgroundColor};
@@ -78,5 +77,3 @@ export const PaginationButton = styled.button`
cursor: pointer;
font-size: 14px;
`;
-
-export const SchemaLink = styled(Link)``;
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.tsx
index 4b37876202f..39b713d7ea6 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessageContent/MessageContent.tsx
@@ -106,7 +106,6 @@ const MessageContent: React.FC<MessageContentProps> = ({
<S.MetadataMeta>
Size: <BytesFormatted value={contentSize} />
</S.MetadataMeta>
- <S.SchemaLink to="/">SchemaLink</S.SchemaLink>
</span>
</S.Metadata>
@@ -117,7 +116,6 @@ const MessageContent: React.FC<MessageContentProps> = ({
<S.MetadataMeta>
Size: <BytesFormatted value={keySize} />
</S.MetadataMeta>
- <S.SchemaLink to="/">SchemaLink</S.SchemaLink>
</span>
</S.Metadata>
</S.MetadataWrapper>
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx
index c3174403556..81268bdeb69 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx
@@ -74,8 +74,8 @@ const MessagesTable: React.FC = () => {
<TableHeaderCell title="Offset" />
<TableHeaderCell title="Partition" />
<TableHeaderCell title="Timestamp" />
- <TableHeaderCell title="Key" previewText="Preview" />
- <TableHeaderCell title="Content" previewText="Preview" />
+ <TableHeaderCell title="Key" />
+ <TableHeaderCell title="Content" />
<TableHeaderCell> </TableHeaderCell>
</tr>
</thead>
| null | train | train | 2022-04-19T02:03:32 | "2022-04-18T11:24:50Z" | agolosen | train |
provectus/kafka-ui/1784_1854 | provectus/kafka-ui | provectus/kafka-ui/1784 | provectus/kafka-ui/1854 | [
"connected"
] | 3c984fc4514ef20edf10a5cfffead494ed7a1ffe | 45dc7f616c7fe192a5e7ca2899f3a6126e2ad06e | [
"Hey, thanks for reaching out. We were planning on implementing this within #1021, but I guess we can do it quicker.",
"duplicate of #1175"
] | [
"so this is a button without any functionality ?",
"Yes, I've talked with Roma, he said only the UI is required. The backend is not ready yet for the logout action.",
"I've mentioned in the PR that this is a UI addition."
] | "2022-04-18T14:00:11Z" | [
"status/duplicate",
"type/enhancement",
"scope/backend",
"scope/frontend"
] | Log out button | ### Is your proposal related to a problem?
<!--
Provide a clear and concise description of what the problem is.
For example, "I'm always frustrated when..."
-->
logout button after LDAP/SSO login
### Describe the solution you'd like
Right corner a small button with logout
<!--
Provide a clear and concise description of what you want to happen.
-->
### Describe alternatives you've considered
Session timeout after N seconds
<!--
Let us know about other solutions you've tried or researched.
-->
### Additional context
<!--
Is there anything else you can add about the proposal?
You might want to link to related issues here, if you haven't already.
-->
| [
"kafka-ui-react-app/src/components/App.styled.ts",
"kafka-ui-react-app/src/components/App.tsx",
"kafka-ui-react-app/src/components/__tests__/App.spec.tsx"
] | [
"kafka-ui-react-app/src/components/App.styled.ts",
"kafka-ui-react-app/src/components/App.tsx",
"kafka-ui-react-app/src/components/__tests__/App.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/App.styled.ts b/kafka-ui-react-app/src/components/App.styled.ts
index b35b324828c..64f3296861d 100644
--- a/kafka-ui-react-app/src/components/App.styled.ts
+++ b/kafka-ui-react-app/src/components/App.styled.ts
@@ -1,6 +1,8 @@
import styled, { css } from 'styled-components';
import { Link } from 'react-router-dom';
+import { Button } from './common/Button/Button';
+
export const Layout = styled.div`
min-width: 1200px;
@@ -108,6 +110,8 @@ export const Navbar = styled.nav(
export const NavbarBrand = styled.div`
display: flex;
+ justify-content: space-between;
+ align-items: center !important;
flex-shrink: 0;
align-items: stretch;
min-height: 3.25rem;
@@ -205,3 +209,17 @@ export const AlertsContainer = styled.div`
max-width: initial;
}
`;
+
+export const LogoutButton = styled(Button)(
+ ({ theme }) => css`
+ color: ${theme.button.primary.invertedColors.normal};
+ background: none !important;
+ padding: 0 8px;
+ `
+);
+
+export const LogoutLink = styled(Link)(
+ () => css`
+ margin-right: 16px;
+ `
+);
diff --git a/kafka-ui-react-app/src/components/App.tsx b/kafka-ui-react-app/src/components/App.tsx
index 5f4824f125d..c0740f79417 100644
--- a/kafka-ui-react-app/src/components/App.tsx
+++ b/kafka-ui-react-app/src/components/App.tsx
@@ -44,25 +44,33 @@ const App: React.FC = () => {
<S.Layout>
<S.Navbar role="navigation" aria-label="Page Header">
<S.NavbarBrand>
- <S.NavbarBurger
- onClick={onBurgerClick}
- onKeyDown={onBurgerClick}
- role="button"
- tabIndex={0}
- >
- <S.Span role="separator" />
- <S.Span role="separator" />
- <S.Span role="separator" />
- </S.NavbarBurger>
+ <S.NavbarBrand>
+ <S.NavbarBurger
+ onClick={onBurgerClick}
+ onKeyDown={onBurgerClick}
+ role="button"
+ tabIndex={0}
+ aria-label="burger"
+ >
+ <S.Span role="separator" />
+ <S.Span role="separator" />
+ <S.Span role="separator" />
+ </S.NavbarBurger>
- <S.Hyperlink to="/">
- <Logo />
- UI for Apache Kafka
- </S.Hyperlink>
+ <S.Hyperlink to="/">
+ <Logo />
+ UI for Apache Kafka
+ </S.Hyperlink>
- <S.NavbarItem>
- {GIT_TAG && <Version tag={GIT_TAG} commit={GIT_COMMIT} />}
- </S.NavbarItem>
+ <S.NavbarItem>
+ {GIT_TAG && <Version tag={GIT_TAG} commit={GIT_COMMIT} />}
+ </S.NavbarItem>
+ </S.NavbarBrand>
+ <S.LogoutLink to="/logout">
+ <S.LogoutButton buttonType="primary" buttonSize="M">
+ Log out
+ </S.LogoutButton>
+ </S.LogoutLink>
</S.NavbarBrand>
</S.Navbar>
diff --git a/kafka-ui-react-app/src/components/__tests__/App.spec.tsx b/kafka-ui-react-app/src/components/__tests__/App.spec.tsx
index c7cf41ecd8d..9f48fb25ada 100644
--- a/kafka-ui-react-app/src/components/__tests__/App.spec.tsx
+++ b/kafka-ui-react-app/src/components/__tests__/App.spec.tsx
@@ -6,6 +6,9 @@ import { clustersPayload } from 'redux/reducers/clusters/__test__/fixtures';
import userEvent from '@testing-library/user-event';
import fetchMock from 'fetch-mock';
+const burgerButtonOptions = { name: 'burger' };
+const logoutButtonOptions = { name: 'Log out' };
+
describe('App', () => {
describe('initial state', () => {
beforeEach(() => {
@@ -24,11 +27,16 @@ describe('App', () => {
within(header).getByText('UI for Apache Kafka')
).toBeInTheDocument();
expect(within(header).getAllByRole('separator').length).toEqual(3);
- expect(within(header).getByRole('button')).toBeInTheDocument();
+ expect(
+ within(header).getByRole('button', burgerButtonOptions)
+ ).toBeInTheDocument();
+ expect(
+ within(header).getByRole('button', logoutButtonOptions)
+ ).toBeInTheDocument();
});
it('handle burger click correctly', () => {
const header = screen.getByLabelText('Page Header');
- const burger = within(header).getByRole('button');
+ const burger = within(header).getByRole('button', burgerButtonOptions);
const sidebar = screen.getByLabelText('Sidebar');
const overlay = screen.getByLabelText('Overlay');
expect(sidebar).toBeInTheDocument();
| null | train | train | 2022-06-07T13:22:05 | "2022-03-30T14:10:07Z" | djakupovic | train |
provectus/kafka-ui/1175_1854 | provectus/kafka-ui | provectus/kafka-ui/1175 | provectus/kafka-ui/1854 | [
"connected"
] | 3c984fc4514ef20edf10a5cfffead494ed7a1ffe | 45dc7f616c7fe192a5e7ca2899f3a6126e2ad06e | [] | [
"so this is a button without any functionality ?",
"Yes, I've talked with Roma, he said only the UI is required. The backend is not ready yet for the logout action.",
"I've mentioned in the PR that this is a UI addition."
] | "2022-04-18T14:00:11Z" | [
"type/enhancement",
"good first issue",
"scope/backend",
"scope/frontend",
"status/accepted"
] | Implement logout button | [
"kafka-ui-react-app/src/components/App.styled.ts",
"kafka-ui-react-app/src/components/App.tsx",
"kafka-ui-react-app/src/components/__tests__/App.spec.tsx"
] | [
"kafka-ui-react-app/src/components/App.styled.ts",
"kafka-ui-react-app/src/components/App.tsx",
"kafka-ui-react-app/src/components/__tests__/App.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/App.styled.ts b/kafka-ui-react-app/src/components/App.styled.ts
index b35b324828c..64f3296861d 100644
--- a/kafka-ui-react-app/src/components/App.styled.ts
+++ b/kafka-ui-react-app/src/components/App.styled.ts
@@ -1,6 +1,8 @@
import styled, { css } from 'styled-components';
import { Link } from 'react-router-dom';
+import { Button } from './common/Button/Button';
+
export const Layout = styled.div`
min-width: 1200px;
@@ -108,6 +110,8 @@ export const Navbar = styled.nav(
export const NavbarBrand = styled.div`
display: flex;
+ justify-content: space-between;
+ align-items: center !important;
flex-shrink: 0;
align-items: stretch;
min-height: 3.25rem;
@@ -205,3 +209,17 @@ export const AlertsContainer = styled.div`
max-width: initial;
}
`;
+
+export const LogoutButton = styled(Button)(
+ ({ theme }) => css`
+ color: ${theme.button.primary.invertedColors.normal};
+ background: none !important;
+ padding: 0 8px;
+ `
+);
+
+export const LogoutLink = styled(Link)(
+ () => css`
+ margin-right: 16px;
+ `
+);
diff --git a/kafka-ui-react-app/src/components/App.tsx b/kafka-ui-react-app/src/components/App.tsx
index 5f4824f125d..c0740f79417 100644
--- a/kafka-ui-react-app/src/components/App.tsx
+++ b/kafka-ui-react-app/src/components/App.tsx
@@ -44,25 +44,33 @@ const App: React.FC = () => {
<S.Layout>
<S.Navbar role="navigation" aria-label="Page Header">
<S.NavbarBrand>
- <S.NavbarBurger
- onClick={onBurgerClick}
- onKeyDown={onBurgerClick}
- role="button"
- tabIndex={0}
- >
- <S.Span role="separator" />
- <S.Span role="separator" />
- <S.Span role="separator" />
- </S.NavbarBurger>
+ <S.NavbarBrand>
+ <S.NavbarBurger
+ onClick={onBurgerClick}
+ onKeyDown={onBurgerClick}
+ role="button"
+ tabIndex={0}
+ aria-label="burger"
+ >
+ <S.Span role="separator" />
+ <S.Span role="separator" />
+ <S.Span role="separator" />
+ </S.NavbarBurger>
- <S.Hyperlink to="/">
- <Logo />
- UI for Apache Kafka
- </S.Hyperlink>
+ <S.Hyperlink to="/">
+ <Logo />
+ UI for Apache Kafka
+ </S.Hyperlink>
- <S.NavbarItem>
- {GIT_TAG && <Version tag={GIT_TAG} commit={GIT_COMMIT} />}
- </S.NavbarItem>
+ <S.NavbarItem>
+ {GIT_TAG && <Version tag={GIT_TAG} commit={GIT_COMMIT} />}
+ </S.NavbarItem>
+ </S.NavbarBrand>
+ <S.LogoutLink to="/logout">
+ <S.LogoutButton buttonType="primary" buttonSize="M">
+ Log out
+ </S.LogoutButton>
+ </S.LogoutLink>
</S.NavbarBrand>
</S.Navbar>
diff --git a/kafka-ui-react-app/src/components/__tests__/App.spec.tsx b/kafka-ui-react-app/src/components/__tests__/App.spec.tsx
index c7cf41ecd8d..9f48fb25ada 100644
--- a/kafka-ui-react-app/src/components/__tests__/App.spec.tsx
+++ b/kafka-ui-react-app/src/components/__tests__/App.spec.tsx
@@ -6,6 +6,9 @@ import { clustersPayload } from 'redux/reducers/clusters/__test__/fixtures';
import userEvent from '@testing-library/user-event';
import fetchMock from 'fetch-mock';
+const burgerButtonOptions = { name: 'burger' };
+const logoutButtonOptions = { name: 'Log out' };
+
describe('App', () => {
describe('initial state', () => {
beforeEach(() => {
@@ -24,11 +27,16 @@ describe('App', () => {
within(header).getByText('UI for Apache Kafka')
).toBeInTheDocument();
expect(within(header).getAllByRole('separator').length).toEqual(3);
- expect(within(header).getByRole('button')).toBeInTheDocument();
+ expect(
+ within(header).getByRole('button', burgerButtonOptions)
+ ).toBeInTheDocument();
+ expect(
+ within(header).getByRole('button', logoutButtonOptions)
+ ).toBeInTheDocument();
});
it('handle burger click correctly', () => {
const header = screen.getByLabelText('Page Header');
- const burger = within(header).getByRole('button');
+ const burger = within(header).getByRole('button', burgerButtonOptions);
const sidebar = screen.getByLabelText('Sidebar');
const overlay = screen.getByLabelText('Overlay');
expect(sidebar).toBeInTheDocument();
| null | train | train | 2022-06-07T13:22:05 | "2021-12-06T18:58:53Z" | Haarolean | train |
|
provectus/kafka-ui/1845_1859 | provectus/kafka-ui | provectus/kafka-ui/1845 | provectus/kafka-ui/1859 | [
"connected",
"timestamp(timedelta=0.0, similarity=0.8459732609117911)"
] | efe135342e3eec7148c4f0cdb451faec3db5267c | 85f095657cbb93f61e4f4745ae9dcce0aa0847b4 | [] | [
"Can we move this condition inside updateSelectedOption method?",
"Oops, I missed it. Definitely. Fixed it π."
] | "2022-04-19T09:00:36Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Entering the same parameter multiple times during Topic's creation | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
You can enter different value for the same parameter of a topic.
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
https://www.kafka-ui.provectus.io/
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Navigate to local->Topics
2. Push the button Create Topic
3. Push the button Add custom parameter
4. Choose 1 of parameters, input it`s value
5. Choose the same parameter again, enter another value
6. Input the Topic name
7. Push the button Submit
8. Navigate to the created topic-> Settings
9. Observe: the last value of parameter has saved
**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
Warning message that this parameter exists for the topic or unavailable parameter in the dropdown selector
**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->
**Additional context**
<!--
(Add any other context about the problem here)
-->
| [
"kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamField.tsx",
"kafka-ui-react-app/src/components/common/Select/Select.styled.ts",
"kafka-ui-react-app/src/components/common/Select/Select.tsx",
"kafka-ui-react-app/src/components/common/Select/__tests__/Select.spec.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamField.tsx",
"kafka-ui-react-app/src/components/common/Select/Select.styled.ts",
"kafka-ui-react-app/src/components/common/Select/Select.tsx",
"kafka-ui-react-app/src/components/common/Select/__tests__/Select.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamField.tsx b/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamField.tsx
index 5984247a753..d56bd50d54e 100644
--- a/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamField.tsx
+++ b/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamField.tsx
@@ -39,6 +39,14 @@ const CustomParamField: React.FC<Props> = ({
const nameValue = watch(`customParams.${index}.name`);
const prevName = useRef(nameValue);
+ const options = Object.keys(TOPIC_CUSTOM_PARAMS)
+ .sort()
+ .map((option) => ({
+ value: option,
+ label: option,
+ disabled: existingFields.includes(option),
+ }));
+
React.useEffect(() => {
if (nameValue !== prevName.current) {
let newExistingFields = [...existingFields];
@@ -72,13 +80,7 @@ const CustomParamField: React.FC<Props> = ({
minWidth="270px"
onChange={onChange}
value={value}
- options={Object.keys(TOPIC_CUSTOM_PARAMS)
- .sort()
- .map((opt) => ({
- value: opt,
- label: opt,
- disabled: existingFields.includes(opt),
- }))}
+ options={options}
/>
)}
/>
diff --git a/kafka-ui-react-app/src/components/common/Select/Select.styled.ts b/kafka-ui-react-app/src/components/common/Select/Select.styled.ts
index 936a4786e38..cf70423295c 100644
--- a/kafka-ui-react-app/src/components/common/Select/Select.styled.ts
+++ b/kafka-ui-react-app/src/components/common/Select/Select.styled.ts
@@ -94,9 +94,12 @@ export const Option = styled.li<OptionProps>`
transition: all 0.2s ease-in-out;
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
gap: 5px;
+ color: ${(props) =>
+ props.theme.select.color[props.disabled ? 'disabled' : 'normal']};
&:hover {
- background-color: ${(props) => props.theme.select.backgroundColor.hover};
+ background-color: ${(props) =>
+ props.theme.select.backgroundColor[props.disabled ? 'normal' : 'hover']};
}
&:active {
diff --git a/kafka-ui-react-app/src/components/common/Select/Select.tsx b/kafka-ui-react-app/src/components/common/Select/Select.tsx
index ae9824e2914..d9c56ebdab2 100644
--- a/kafka-ui-react-app/src/components/common/Select/Select.tsx
+++ b/kafka-ui-react-app/src/components/common/Select/Select.tsx
@@ -48,12 +48,17 @@ const Select: React.FC<SelectProps> = ({
useClickOutside(selectContainerRef, clickOutsideHandler);
const updateSelectedOption = (option: SelectOption) => {
- if (disabled) return;
+ if (!option.disabled) {
+ setSelectedOption(option.value);
- setSelectedOption(option.value);
- if (onChange) onChange(option.value);
- setShowOptions(false);
+ if (onChange) {
+ onChange(option.value);
+ }
+
+ setShowOptions(false);
+ }
};
+
React.useEffect(() => {
setSelectedOption(value);
}, [isLive, value]);
diff --git a/kafka-ui-react-app/src/components/common/Select/__tests__/Select.spec.tsx b/kafka-ui-react-app/src/components/common/Select/__tests__/Select.spec.tsx
index 5ace7a28460..dd433b991c8 100644
--- a/kafka-ui-react-app/src/components/common/Select/__tests__/Select.spec.tsx
+++ b/kafka-ui-react-app/src/components/common/Select/__tests__/Select.spec.tsx
@@ -1,4 +1,7 @@
-import Select, { SelectProps } from 'components/common/Select/Select';
+import Select, {
+ SelectOption,
+ SelectProps,
+} from 'components/common/Select/Select';
import React from 'react';
import { render } from 'lib/testHelpers';
import { screen } from '@testing-library/react';
@@ -10,34 +13,54 @@ jest.mock('react-hook-form', () => ({
}),
}));
-const options = [
- { label: 'test-label1', value: 'test-value1' },
- { label: 'test-label2', value: 'test-value2' },
+const options: Array<SelectOption> = [
+ { label: 'test-label1', value: 'test-value1', disabled: false },
+ { label: 'test-label2', value: 'test-value2', disabled: true },
];
const renderComponent = (props?: Partial<SelectProps>) =>
render(<Select name="test" {...props} />);
describe('Custom Select', () => {
- it('renders component', () => {
- renderComponent();
- expect(screen.getByRole('listbox')).toBeInTheDocument();
- });
- it('show select options when select is being clicked', () => {
- renderComponent({
- options,
+ describe('when isLive is not specified', () => {
+ beforeEach(() => {
+ renderComponent({
+ options,
+ });
});
- expect(screen.getByRole('option')).toBeInTheDocument();
- userEvent.click(screen.getByRole('listbox'));
- expect(screen.getAllByRole('option')).toHaveLength(3);
- });
- it('checking select option change', () => {
- renderComponent({
- options,
+
+ it('renders component', () => {
+ expect(screen.getByRole('listbox')).toBeInTheDocument();
+ });
+
+ it('show select options when select is being clicked', () => {
+ expect(screen.getByRole('option')).toBeInTheDocument();
+ userEvent.click(screen.getByRole('listbox'));
+ expect(screen.getAllByRole('option')).toHaveLength(3);
+ });
+
+ it('checking select option change', () => {
+ const listbox = screen.getByRole('listbox');
+ const optionLabel = 'test-label1';
+
+ userEvent.click(listbox);
+ userEvent.selectOptions(listbox, [optionLabel]);
+
+ expect(screen.getByRole('option')).toHaveTextContent(optionLabel);
+ });
+
+ it('trying to select disabled option does not trigger change', () => {
+ const listbox = screen.getByRole('listbox');
+ const normalOptionLabel = 'test-label1';
+ const disabledOptionLabel = 'test-label2';
+
+ userEvent.click(listbox);
+ userEvent.selectOptions(listbox, [normalOptionLabel]);
+ userEvent.click(listbox);
+ userEvent.selectOptions(listbox, [disabledOptionLabel]);
+
+ expect(screen.getByRole('option')).toHaveTextContent(normalOptionLabel);
});
- userEvent.click(screen.getByRole('listbox'));
- userEvent.selectOptions(screen.getByRole('listbox'), ['test-label1']);
- expect(screen.getByRole('option')).toHaveTextContent('test-label1');
});
describe('when non-live', () => {
| null | train | train | 2022-04-22T09:13:01 | "2022-04-18T09:52:02Z" | agolosen | train |
provectus/kafka-ui/1552_1864 | provectus/kafka-ui | provectus/kafka-ui/1552 | provectus/kafka-ui/1864 | [
"timestamp(timedelta=1.0, similarity=0.9830447207176466)",
"connected"
] | deddf09ed4ef35fa6a150f79ebb10049a0ede662 | b2a04a202ea49d9d94b7685c836a620f511e8e75 | [
"Hello there Zorii4! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"And [this](https://github.com/provectus/kafka-ui/pull/1849#issuecomment-1102725089)",
"#215"
] | [] | "2022-04-20T08:25:24Z" | [
"good first issue",
"scope/frontend",
"status/accepted",
"type/chore"
] | Improve test coverage | **Describe the bug**
Files are not completely covered with tests
src/components/Topics/Topic/Details/Details.tsx
src/components/Topics/Topic/Details/Overview/Overview.tsx
After refactored this components need update some test coverage.
**Expected behavior**
100% covered
| [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/Details.spec.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/Details.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx
index 392cab08ca9..b81b5209f02 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/__test__/Overview.spec.tsx
@@ -6,6 +6,8 @@ import Overview, {
} from 'components/Topics/Topic/Details/Overview/Overview';
import theme from 'theme/theme';
import { CleanUpPolicy } from 'generated-sources';
+import ClusterContext from 'components/contexts/ClusterContext';
+import userEvent from '@testing-library/user-event';
describe('Overview', () => {
const mockClusterName = 'local';
@@ -26,45 +28,52 @@ describe('Overview', () => {
offsetMin: 0,
},
];
+ const defaultContextValues = {
+ isReadOnly: false,
+ hasKafkaConnectConfigured: true,
+ hasSchemaRegistryConfigured: true,
+ isTopicDeletionAllowed: true,
+ };
+ const defaultProps: OverviewProps = {
+ name: mockTopicName,
+ partitions: [],
+ internal: true,
+ clusterName: mockClusterName,
+ topicName: mockTopicName,
+ clearTopicMessages: mockClearTopicMessages,
+ };
const setupComponent = (
- props: OverviewProps,
+ props = defaultProps,
+ contextValues = defaultContextValues,
underReplicatedPartitions?: number,
inSyncReplicas?: number,
replicas?: number
) =>
render(
- <Overview
- underReplicatedPartitions={underReplicatedPartitions}
- inSyncReplicas={inSyncReplicas}
- replicas={replicas}
- {...props}
- />
+ <ClusterContext.Provider value={contextValues}>
+ <Overview
+ underReplicatedPartitions={underReplicatedPartitions}
+ inSyncReplicas={inSyncReplicas}
+ replicas={replicas}
+ {...props}
+ />
+ </ClusterContext.Provider>
);
describe('when it has internal flag', () => {
it('does not render the Action button a Topic', () => {
setupComponent({
- name: mockTopicName,
+ ...defaultProps,
partitions: mockPartitions,
internal: false,
- clusterName: mockClusterName,
- topicName: mockTopicName,
cleanUpPolicy: CleanUpPolicy.DELETE,
- clearTopicMessages: mockClearTopicMessages,
});
- expect(screen.getByRole('menu')).toBeInTheDocument();
+ expect(screen.getAllByRole('menu')[0]).toBeInTheDocument();
});
it('does not render Partitions', () => {
- setupComponent({
- name: mockTopicName,
- partitions: [],
- internal: true,
- clusterName: mockClusterName,
- topicName: mockTopicName,
- clearTopicMessages: mockClearTopicMessages,
- });
+ setupComponent();
expect(screen.getByText('No Partitions found')).toBeInTheDocument();
});
@@ -72,26 +81,14 @@ describe('Overview', () => {
describe('should render circular alert', () => {
it('should be in document', () => {
- setupComponent({
- name: mockTopicName,
- partitions: [],
- internal: true,
- clusterName: mockClusterName,
- topicName: mockTopicName,
- clearTopicMessages: mockClearTopicMessages,
- });
+ setupComponent();
const circles = screen.getAllByRole('circle');
expect(circles.length).toEqual(2);
});
it('should be the appropriate color', () => {
setupComponent({
- name: mockTopicName,
- partitions: [],
- internal: true,
- clusterName: mockClusterName,
- topicName: mockTopicName,
- clearTopicMessages: mockClearTopicMessages,
+ ...defaultProps,
underReplicatedPartitions: 0,
inSyncReplicas: 1,
replicas: 2,
@@ -105,4 +102,18 @@ describe('Overview', () => {
);
});
});
+
+ describe('when Clear Messages is clicked', () => {
+ setupComponent({
+ ...defaultProps,
+ partitions: mockPartitions,
+ internal: false,
+ cleanUpPolicy: CleanUpPolicy.DELETE,
+ });
+
+ const clearMessagesButton = screen.getByText('Clear Messages');
+ userEvent.click(clearMessagesButton);
+
+ expect(mockClearTopicMessages).toHaveBeenCalledTimes(1);
+ });
});
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/Details.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/Details.spec.tsx
index 6cae7eecffc..4b901d93146 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/Details.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/__test__/Details.spec.tsx
@@ -5,7 +5,13 @@ import ClusterContext from 'components/contexts/ClusterContext';
import Details from 'components/Topics/Topic/Details/Details';
import { internalTopicPayload } from 'redux/reducers/topics/__test__/fixtures';
import { render } from 'lib/testHelpers';
-import { clusterTopicPath } from 'lib/paths';
+import {
+ clusterTopicEditPath,
+ clusterTopicPath,
+ clusterTopicsPath,
+} from 'lib/paths';
+import { Router } from 'react-router-dom';
+import { createMemoryHistory } from 'history';
describe('Details', () => {
const mockDelete = jest.fn();
@@ -13,8 +19,20 @@ describe('Details', () => {
const mockClearTopicMessages = jest.fn();
const mockInternalTopicPayload = internalTopicPayload.internal;
const mockRecreateTopic = jest.fn();
+ const defaultPathname = clusterTopicPath(
+ mockClusterName,
+ internalTopicPayload.name
+ );
+ const mockHistory = createMemoryHistory({
+ initialEntries: [defaultPathname],
+ });
+ jest.spyOn(mockHistory, 'push');
- const setupComponent = (pathname: string) =>
+ const setupComponent = (
+ pathname = defaultPathname,
+ history = mockHistory,
+ props = {}
+ ) =>
render(
<ClusterContext.Provider
value={{
@@ -24,17 +42,20 @@ describe('Details', () => {
isTopicDeletionAllowed: true,
}}
>
- <Details
- clusterName={mockClusterName}
- topicName={internalTopicPayload.name}
- name={internalTopicPayload.name}
- isInternal={false}
- deleteTopic={mockDelete}
- recreateTopic={mockRecreateTopic}
- clearTopicMessages={mockClearTopicMessages}
- isDeleted={false}
- isDeletePolicy
- />
+ <Router history={history}>
+ <Details
+ clusterName={mockClusterName}
+ topicName={internalTopicPayload.name}
+ name={internalTopicPayload.name}
+ isInternal={false}
+ deleteTopic={mockDelete}
+ recreateTopic={mockRecreateTopic}
+ clearTopicMessages={mockClearTopicMessages}
+ isDeleted={false}
+ isDeletePolicy
+ {...props}
+ />
+ </Router>
</ClusterContext.Provider>,
{ pathname }
);
@@ -68,10 +89,83 @@ describe('Details', () => {
});
});
+ describe('when remove topic modal is open', () => {
+ beforeEach(() => {
+ setupComponent();
+
+ const openModalButton = screen.getAllByText('Remove topic')[0];
+ userEvent.click(openModalButton);
+ });
+
+ it('calls deleteTopic on confirm', () => {
+ const submitButton = screen.getAllByText('Submit')[0];
+ userEvent.click(submitButton);
+
+ expect(mockDelete).toHaveBeenCalledWith(
+ mockClusterName,
+ internalTopicPayload.name
+ );
+ });
+
+ it('closes the modal when cancel button is clicked', () => {
+ const cancelButton = screen.getAllByText('Cancel')[0];
+ userEvent.click(cancelButton);
+
+ expect(cancelButton).not.toBeInTheDocument();
+ });
+ });
+
+ describe('when clear messages modal is open', () => {
+ beforeEach(() => {
+ setupComponent();
+
+ const confirmButton = screen.getAllByText('Clear messages')[0];
+ userEvent.click(confirmButton);
+ });
+
+ it('it calls clearTopicMessages on confirm', () => {
+ const submitButton = screen.getAllByText('Submit')[0];
+ userEvent.click(submitButton);
+
+ expect(mockClearTopicMessages).toHaveBeenCalledWith(
+ mockClusterName,
+ internalTopicPayload.name
+ );
+ });
+
+ it('closes the modal when cancel button is clicked', () => {
+ const cancelButton = screen.getAllByText('Cancel')[0];
+ userEvent.click(cancelButton);
+
+ expect(cancelButton).not.toBeInTheDocument();
+ });
+ });
+
+ describe('when edit settings is clicked', () => {
+ it('redirects to the edit page', () => {
+ setupComponent();
+
+ const button = screen.getAllByText('Edit settings')[0];
+ userEvent.click(button);
+
+ const redirectRoute = clusterTopicEditPath(
+ mockClusterName,
+ internalTopicPayload.name
+ );
+
+ expect(mockHistory.push).toHaveBeenCalledWith(redirectRoute);
+ });
+ });
+
+ it('redirects to the correct route if topic is deleted', () => {
+ setupComponent(defaultPathname, mockHistory, { isDeleted: true });
+ const redirectRoute = clusterTopicsPath(mockClusterName);
+
+ expect(mockHistory.push).toHaveBeenCalledWith(redirectRoute);
+ });
+
it('shows a confirmation popup on deleting topic messages', () => {
- setupComponent(
- clusterTopicPath(mockClusterName, internalTopicPayload.name)
- );
+ setupComponent();
const { getByText } = screen;
const clearMessagesButton = getByText(/Clear messages/i);
userEvent.click(clearMessagesButton);
@@ -82,9 +176,7 @@ describe('Details', () => {
});
it('shows a confirmation popup on recreating topic', () => {
- setupComponent(
- clusterTopicPath(mockClusterName, internalTopicPayload.name)
- );
+ setupComponent();
const recreateTopicButton = screen.getByText(/Recreate topic/i);
userEvent.click(recreateTopicButton);
@@ -94,9 +186,7 @@ describe('Details', () => {
});
it('calling recreation function after click on Submit button', () => {
- setupComponent(
- clusterTopicPath(mockClusterName, internalTopicPayload.name)
- );
+ setupComponent();
const recreateTopicButton = screen.getByText(/Recreate topic/i);
userEvent.click(recreateTopicButton);
const confirmBtn = screen.getByRole('button', { name: /submit/i });
@@ -105,9 +195,7 @@ describe('Details', () => {
});
it('close popup confirmation window after click on Cancel button', () => {
- setupComponent(
- clusterTopicPath(mockClusterName, internalTopicPayload.name)
- );
+ setupComponent();
const recreateTopicButton = screen.getByText(/Recreate topic/i);
userEvent.click(recreateTopicButton);
const cancelBtn = screen.getByRole('button', { name: /cancel/i });
| null | val | train | 2022-04-22T15:51:00 | "2022-02-04T13:20:46Z" | Zorii4 | train |
provectus/kafka-ui/1855_1866 | provectus/kafka-ui | provectus/kafka-ui/1855 | provectus/kafka-ui/1866 | [
"timestamp(timedelta=0.0, similarity=0.85952521629332)",
"connected"
] | a038762409af4021e2db4af293241c8c64da7bd4 | c5234ce47071e0ae0f2a2c0e94f0acc44123c8e5 | [
"#1808",
"@lazzy-panda please take a look"
] | [] | "2022-04-20T09:33:54Z" | [
"type/bug",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Clear all doesn't work for Offset in Messages | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
Clear all in Search line on Messages tab of Topics works for everything except Offset.
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
https://www.kafka-ui.provectus.io/
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Navigate local - > Topics-> Messages
2. Input some value for offset in Search line and push the button Submit
3. Click Clear all
4. Observe: the inputed value is still in the Search line.
5. Even if put another value into Search line e.g. for Timestamp, Submit and after click Clear all - the value of previous Offset search appears.
**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
Clear all fields of Search line including Offset one.
**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->
**Additional context**
<!--
(Add any other context about the problem here)
-->
| [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
index 939444d69fe..a38e5e8a27a 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
@@ -168,6 +168,7 @@ const Filters: React.FC<FiltersProps> = ({
const handleClearAllFilters = () => {
setCurrentSeekType(SeekType.OFFSET);
+ setOffset('');
setQuery('');
changeSeekDirection(SeekDirection.FORWARD);
getSelectedPartitionsFromSeekToParam(searchParams, partitions);
| null | train | train | 2022-04-19T17:51:24 | "2022-04-18T19:05:21Z" | agolosen | train |
provectus/kafka-ui/1861_1867 | provectus/kafka-ui | provectus/kafka-ui/1861 | provectus/kafka-ui/1867 | [
"connected"
] | 2a0c8176ab67bd01d73d9affcb7ba2026abbaaee | fde88d003440da9dc0c2e45b20534e721dccc6ba | [] | [] | "2022-04-20T10:44:41Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | KSQL table info is empty in overview | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
There is no info about a table in KSQL tables overview.
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
https://www.kafka-ui.provectus.io/
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Navigate to local/KSQL DB
2. Click on + of a stream or table
3. Observe: phrease Expanded content instead of the details of stream/table
**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
Details of stream/config (configuration)
**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->
<img width="1201" alt="Screenshot 2022-04-19 at 20 44 08" src="https://user-images.githubusercontent.com/92585878/164085491-c90b7e1f-4360-4ee5-9900-503f58b61baf.png">
**Additional context**
<!--
(Add any other context about the problem here)
-->
| [
"kafka-ui-react-app/src/components/KsqlDb/List/ListItem.tsx"
] | [
"kafka-ui-react-app/src/components/KsqlDb/List/ListItem.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/KsqlDb/List/ListItem.tsx b/kafka-ui-react-app/src/components/KsqlDb/List/ListItem.tsx
index 105051abd1f..65390caa2cc 100644
--- a/kafka-ui-react-app/src/components/KsqlDb/List/ListItem.tsx
+++ b/kafka-ui-react-app/src/components/KsqlDb/List/ListItem.tsx
@@ -1,5 +1,3 @@
-import IconButtonWrapper from 'components/common/Icons/IconButtonWrapper';
-import MessageToggleIcon from 'components/common/Icons/MessageToggleIcon';
import React from 'react';
interface Props {
@@ -8,30 +6,12 @@ interface Props {
}
const ListItem: React.FC<Props> = ({ accessors, data }) => {
- const [isOpen, setIsOpen] = React.useState(false);
-
- const toggleIsOpen = React.useCallback(() => {
- setIsOpen((prevState) => !prevState);
- }, []);
-
return (
- <>
- <tr>
- <td>
- <IconButtonWrapper onClick={toggleIsOpen}>
- <MessageToggleIcon isOpen={isOpen} />
- </IconButtonWrapper>
- </td>
- {accessors.map((accessor) => (
- <td key={accessor}>{data[accessor]}</td>
- ))}
- </tr>
- {isOpen && (
- <tr>
- <td colSpan={accessors.length + 1}>Expanding content</td>
- </tr>
- )}
- </>
+ <tr>
+ {accessors.map((accessor: string) => (
+ <td key={accessor}>{data[accessor]}</td>
+ ))}
+ </tr>
);
};
| null | train | train | 2022-04-22T02:38:06 | "2022-04-19T19:57:45Z" | agolosen | train |
provectus/kafka-ui/1862_1869 | provectus/kafka-ui | provectus/kafka-ui/1862 | provectus/kafka-ui/1869 | [
"connected"
] | fde88d003440da9dc0c2e45b20534e721dccc6ba | 3a9e1d12f4e003b52b694e1feac3187e523dbdbd | [] | [] | "2022-04-20T11:47:24Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Inconsistency in Warning message for KSQL DB | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
The error/warning message disappears in several minutes but on other pages it stays until you close it.
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
https://www.kafka-ui.provectus.io/
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Navigate to local/KSQL DB
2. Push the button Execute KSQL Request
3. Input some request e.g. SELECT * from ridersNearMountainView WHERE distanceInMiles <= 10;
4. Observe: the warning message appears and disappear in several seconds.
1) It`s inconvenient because it`s big and you can`t read it all and correct your request;
2) on other pages of the application a warning message appears and you have to click x to close it, it doesn't disappear by itself.
**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
The warning message stays until you close it by clicking x
**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->
**Additional context**
<!--
(Add any other context about the problem here)
-->
| [
"kafka-ui-react-app/src/components/KsqlDb/Query/Query.tsx"
] | [
"kafka-ui-react-app/src/components/KsqlDb/Query/Query.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/KsqlDb/Query/Query.tsx b/kafka-ui-react-app/src/components/KsqlDb/Query/Query.tsx
index 4e00ed97b94..ce344508f31 100644
--- a/kafka-ui-react-app/src/components/KsqlDb/Query/Query.tsx
+++ b/kafka-ui-react-app/src/components/KsqlDb/Query/Query.tsx
@@ -124,10 +124,6 @@ const Query: FC = () => {
createdAt: now(),
})
);
-
- setTimeout(() => {
- dispatch(alertDissmissed(id));
- }, AUTO_DISMISS_TIME);
break;
}
case 'Schema': {
| null | train | train | 2022-04-22T06:50:28 | "2022-04-19T20:18:26Z" | agolosen | train |
provectus/kafka-ui/1059_1870 | provectus/kafka-ui | provectus/kafka-ui/1059 | provectus/kafka-ui/1870 | [
"timestamp(timedelta=0.0, similarity=0.8747782820777007)",
"connected"
] | 85f095657cbb93f61e4f4745ae9dcce0aa0847b4 | f70809128b77b3c4563b0b0215a0fec22a331edd | [
"@GneyHabub I guess we have to adjust (off by one) `seekTo` param value when clicking on `next` button",
"We have to adjust the offset off by one: +1 in case of \"oldest first\" and -1 in case of \"newest first\"."
] | [] | "2022-04-20T14:13:34Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Double topic message display on consequent pages | **Describe the bug**
(A clear and concise description of what the bug is.)
The last message on page 1 of topic messages gets displayed on page 2
**Set up**
(How do you run the app?)
Windows build
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Topics
2. Select a Topic
3. Messages
4. See message 99
5. Click "Next"
6. See message 99 on Page 2
**Expected behavior**
(A clear and concise description of what you expected to happen)
The last message from Page 1 (99) should not be displayed on Page 2
**Screenshots**
(If applicable, add screenshots to help explain your problem)
**Additional context**
(Add any other context about the problem here)
Maybe a feature, not a bug designed to let users see the last message on previous page | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx
index 81268bdeb69..cf6aaf07eca 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx
@@ -39,10 +39,11 @@ const MessagesTable: React.FC = () => {
return { offset: 0, partition: parseInt(partition, 10) };
});
+ const seekDirection = searchParams.get('seekDirection');
+ const isBackward = seekDirection === SeekDirection.BACKWARD;
+
const messageUniqs = map(groupBy(messages, 'partition'), (v) =>
- searchParams.get('seekDirection') === SeekDirection.BACKWARD
- ? minBy(v, 'offset')
- : maxBy(v, 'offset')
+ isBackward ? minBy(v, 'offset') : maxBy(v, 'offset')
).map((message) => ({
offset: message?.offset || 0,
partition: message?.partition || 0,
@@ -54,7 +55,11 @@ const MessagesTable: React.FC = () => {
(v) => maxBy(v, 'offset')
)
)
- .map(({ offset, partition }) => `${partition}::${offset}`)
+ .map(({ offset, partition }) => {
+ const offsetQuery = isBackward ? offset : offset + 1;
+
+ return `${partition}::${offsetQuery}`;
+ })
.join(',');
searchParams.set('seekTo', nextSeekTo);
| null | val | train | 2022-04-22T09:39:07 | "2021-11-08T15:45:47Z" | Khakha-A | train |
provectus/kafka-ui/1860_1872 | provectus/kafka-ui | provectus/kafka-ui/1860 | provectus/kafka-ui/1872 | [
"connected"
] | a038762409af4021e2db4af293241c8c64da7bd4 | 4b907e1005d1d087e0dad207b9e4d7e7b1ec7e7e | [] | [
"I would also add `@nullable` annotation here",
"sure"
] | "2022-04-20T21:20:52Z" | [
"type/bug",
"good first issue",
"scope/backend",
"status/accepted",
"status/confirmed",
"type/regression"
] | HTTP 500 on Global Compatibility Level change | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
If you try to change Global Compatibility Level you receive the error message '500 Internal Server Error
Unexpected internal error' and level doesn`t change.
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
https://www.kafka-ui.provectus.io/
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Navigate to local/Schema Registry
2. Choose a different Global Compatibility Level in dropdown menu
3. Observe: error message '500 Internal Server Error
Unexpected internal error' and level doesn`t change.
**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
The level has changed.
**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->
**Additional context**
<!--
(Add any other context about the problem here)
-->
| [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java"
] | [] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java
index 6669d9d2b27..085e6c39be8 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java
@@ -34,6 +34,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
@@ -243,7 +244,7 @@ private Function<ClientResponse, Mono<? extends Throwable>> throwIfNotFoundStatu
* @param schemaName is a schema subject name
* @see com.provectus.kafka.ui.model.CompatibilityLevelDTO.CompatibilityEnum
*/
- public Mono<Void> updateSchemaCompatibility(KafkaCluster cluster, String schemaName,
+ public Mono<Void> updateSchemaCompatibility(KafkaCluster cluster, @Nullable String schemaName,
Mono<CompatibilityLevelDTO> compatibilityLevel) {
String configEndpoint = Objects.isNull(schemaName) ? "/config" : "/config/{schemaName}";
return configuredWebClient(
@@ -348,9 +349,9 @@ private WebClient.RequestBodySpec configuredWebClient(KafkaCluster cluster, Http
}
private WebClient.RequestBodySpec configuredWebClient(KafkaCluster cluster, HttpMethod method,
- String uri, String uriVariable) {
- return configuredWebClient(cluster, method, uri, List.of(uriVariable),
- new LinkedMultiValueMap<>());
+ String uri, @Nullable String uriVariable) {
+ List<String> uriVariables = uriVariable == null ? Collections.emptyList() : List.of(uriVariable);
+ return configuredWebClient(cluster, method, uri, uriVariables, new LinkedMultiValueMap<>());
}
private WebClient.RequestBodySpec configuredWebClient(KafkaCluster cluster,
| null | test | train | 2022-04-19T17:51:24 | "2022-04-19T19:38:28Z" | agolosen | train |
provectus/kafka-ui/1768_1874 | provectus/kafka-ui | provectus/kafka-ui/1768 | provectus/kafka-ui/1874 | [
"keyword_pr_to_issue",
"keyword_issue_to_pr"
] | aab1f5cea44abe30202fc5209161e14d7d915f4e | dbc5d0445c5469b14bee73f657dc35e9cec5339b | [
"Hello there anthares! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"Hey, thanks for reaching out. I'll investigate.",
"Any updates on this? I'm encountering a similar problem. \r\n\r\nHere's my nginx config for kafka-ui:\r\n\r\n```\r\n location /kafka-ui/ {\r\n proxy_set_header X-Script-Name /kafka-ui;\r\n\r\n proxy_pass http://kafka-ui:8081;\r\n }\r\n```\r\n\r\nHere's the error:\r\n\r\n",
"Will be fixed within #1874 and will be a part of 0.4 release (or you can always pull the `master`-labeled image).",
"A bit late, but thank you @Haarolean for fixing this :)",
"> A bit late, but thank you @Haarolean for fixing this :)\r\n\r\nYou're welcome :)",
"I'm still running into this issue - which nginx configuration(s) are you using @Haarolean @anthares ?",
"I have not tested with nginx, since I'm using traefik as reverse proxy.\r\nIt do works with 0.4.0 with standard configuration, nothing fancy.\r\n\r\nMaybe make sure you pulled the latest image, or check examples as they provide working configurations."
] | [] | "2022-04-20T23:56:27Z" | [
"type/bug",
"scope/backend",
"status/accepted",
"status/confirmed"
] | Error when running behind a reverse proxy with a path prefix | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
When using kafka-ui behind a reverse proxy (both nginx and trafik), trying to configure it on a sub-path (/kafka-ui) doesn't work without a trailing `/`.
Any attempt to reach kafka-ui ends up in a 404 through reverse proxy.
Reaching through direct port (8082) result in a json response with 404 message.
```json
{
"code": 5000,
"message": "404 NOT_FOUND",
"timestamp": 1648462573453,
"requestId": "936e888d-1",
"fieldsErrors": null,
"stackTrace": "org.springframework.web.server.ResponseStatusException: 404 NOT_FOUND\n\tat org.springframework.web.reactive.resource.ResourceWebHandler.lambda$handle$1(ResourceWebHandler.java:379)\n\tSuppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: \nError has been observed at the following site(s):\n\t*__checkpoint β’ com.provectus.kafka.ui.config.CustomWebFilter [DefaultWebFilterChain]\n\t*__checkpoint β’ com.provectus.kafka.ui.config.ReadOnlyModeFilter [DefaultWebFilterChain] (...)"
}
```
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
Docker for Windows with image `provectuslabs/kafka-ui:latest` (f1e30cd9d423)
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Clone kafka-ui repo
2. Remove trailing `/` in `PathPrefix` in `documentation/compose/traefik/kafkaui.yaml`
3. Run `cd documentation/compose && docker compose --file kafka-ui-traefik-proxy.yaml up -d` in terminal
4. Browsing to `http://localhost/kafka-ui` results in 404
(Same issue with `kafka-ui-reverse-proxy.yaml`; its not a traefik config issue)
**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
We should be able to run kafka-ui on a sub-path behind a reverse proxy with or without trailing `/`.
It's quite dumb, but I searched several hours to figure out my 404 was due to missing forward slash.
I'm pretty sure I'm not the first to shoot himself with this :)
**Additional context**
<!--
(Add any other context about the problem here)
-->
My use case is a development docker compose, with multiple UI's (our webapp, pgadmin, kafka-ui, ...) on different path prefix behind traefik.
I found this because my traefik rule is ``PathPrefix(`/kafka-ui`)``.
Looking at the stacktrace and current code on master branch, I think [`CustomWebFilter`](https://github.com/provectus/kafka-ui/blob/master/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/CustomWebFilter.java#L19) does not handle request properly when path is empty.
Thank you for your time :)
Best regards | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/CustomWebFilter.java"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/CustomWebFilter.java"
] | [] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/CustomWebFilter.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/CustomWebFilter.java
index a74a3fa6a16..204fdfad7e2 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/CustomWebFilter.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/CustomWebFilter.java
@@ -16,7 +16,7 @@ public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
final String path = exchange.getRequest().getPath().pathWithinApplication().value();
- if (path.startsWith("/ui") || path.equals("/")) {
+ if (path.startsWith("/ui") || path.equals("") || path.equals("/")) {
return chain.filter(
exchange.mutate().request(
exchange.getRequest().mutate()
| null | train | train | 2022-04-22T01:25:47 | "2022-03-28T10:54:30Z" | anthares | train |
provectus/kafka-ui/1473_1875 | provectus/kafka-ui | provectus/kafka-ui/1473 | provectus/kafka-ui/1875 | [
"timestamp(timedelta=0.0, similarity=0.8533600279111503)",
"connected"
] | 4c76d07f044ee6fc387c1fa463f3668bdf6b0cd0 | 62f47788039de1941d346afca275412e6e1c34a8 | [
"@workshur I can't reproduce, could you please tell in which exact table this happens?\r\n",
"Tables with action button in a row. It jumps on row hover/mouse out "
] | [] | "2022-04-21T07:24:25Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted"
] | Table Row with dropdown is jumping on mouse over action | **Describe the bug**
Table Row with dropdown is jumping on mouse over action
**Expected behavior**
Check all the tables and fix. Use visibility hidden instead of removing dropdown | [
"kafka-ui-react-app/src/components/Topics/List/List.styled.ts",
"kafka-ui-react-app/src/components/Topics/List/List.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/List/List.styled.ts",
"kafka-ui-react-app/src/components/Topics/List/List.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/List/List.styled.ts b/kafka-ui-react-app/src/components/Topics/List/List.styled.ts
index c8d4a14533d..95214624d3b 100644
--- a/kafka-ui-react-app/src/components/Topics/List/List.styled.ts
+++ b/kafka-ui-react-app/src/components/Topics/List/List.styled.ts
@@ -24,4 +24,5 @@ export const Link = styled(NavLink).attrs({ activeClassName: 'is-active' })<{
export const ActionsTd = styled(Td)`
overflow: visible;
+ width: 50px;
`;
diff --git a/kafka-ui-react-app/src/components/Topics/List/List.tsx b/kafka-ui-react-app/src/components/Topics/List/List.tsx
index 6c4ec05b57f..334ff6a917d 100644
--- a/kafka-ui-react-app/src/components/Topics/List/List.tsx
+++ b/kafka-ui-react-app/src/components/Topics/List/List.tsx
@@ -185,6 +185,8 @@ const List: React.FC<TopicsListProps> = ({
setRecreateTopicConfirmationVisible,
] = React.useState(false);
+ const isHidden = internal || isReadOnly || !hovered;
+
const deleteTopicHandler = React.useCallback(() => {
deleteTopic(clusterName, name);
}, [name]);
@@ -200,8 +202,8 @@ const List: React.FC<TopicsListProps> = ({
return (
<>
- {!internal && !isReadOnly && hovered ? (
- <div className="has-text-right">
+ <div className="has-text-right">
+ {!isHidden && (
<Dropdown label={<VerticalElipsisIcon />} right>
{cleanUpPolicy === CleanUpPolicy.DELETE && (
<DropdownItem onClick={clearTopicMessagesHandler} danger>
@@ -223,8 +225,8 @@ const List: React.FC<TopicsListProps> = ({
Recreate Topic
</DropdownItem>
</Dropdown>
- </div>
- ) : null}
+ )}
+ </div>
<ConfirmationModal
isOpen={isDeleteTopicConfirmationVisible}
onCancel={() => setDeleteTopicConfirmationVisible(false)}
| null | train | train | 2022-04-22T10:33:03 | "2022-01-25T08:20:57Z" | workshur | train |
provectus/kafka-ui/1873_1876 | provectus/kafka-ui | provectus/kafka-ui/1873 | provectus/kafka-ui/1876 | [
"connected"
] | f70809128b77b3c4563b0b0215a0fec22a331edd | 4c76d07f044ee6fc387c1fa463f3668bdf6b0cd0 | [] | [] | "2022-04-21T08:08:37Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Offset input disappears when the only partition is unselected | **Describe the bug**
Topic messages offset input disappears when the only partition is unselected
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
latest master
**Steps to Reproduce**
Steps to reproduce the behavior:
1. open up messages view
2. deselect the only partition
3. ???
4. profit
**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->
<img width="711" alt="image" src="https://user-images.githubusercontent.com/1494347/164330994-94995b9e-aef3-43d7-81fe-fd90b88c60db.png">
<img width="566" alt="image" src="https://user-images.githubusercontent.com/1494347/164331356-7a291ad9-6d6a-4b9c-a8b5-525ced0eac0b.png">
**Additional context**
<!--
(Add any other context about the problem here)
-->
| [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/Messages.spec.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/Messages.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
index b6e6cf3e653..b0679486cef 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
@@ -357,42 +357,40 @@ const Filters: React.FC<FiltersProps> = ({
value={query}
onChange={({ target: { value } }) => setQuery(value)}
/>
- {isSeekTypeControlVisible && (
- <S.SeekTypeSelectorWrapper>
- <Select
- id="selectSeekType"
- onChange={(option) => setCurrentSeekType(option as SeekType)}
- value={currentSeekType}
- selectSize="M"
- minWidth="100px"
- options={SeekTypeOptions}
+ <S.SeekTypeSelectorWrapper>
+ <Select
+ id="selectSeekType"
+ onChange={(option) => setCurrentSeekType(option as SeekType)}
+ value={currentSeekType}
+ selectSize="M"
+ minWidth="100px"
+ options={SeekTypeOptions}
+ disabled={isLive}
+ />
+ {currentSeekType === SeekType.OFFSET ? (
+ <Input
+ id="offset"
+ type="text"
+ inputSize="M"
+ value={offset}
+ className="offset-selector"
+ placeholder="Offset"
+ onChange={({ target: { value } }) => setOffset(value)}
disabled={isLive}
/>
- {currentSeekType === SeekType.OFFSET ? (
- <Input
- id="offset"
- type="text"
- inputSize="M"
- value={offset}
- className="offset-selector"
- placeholder="Offset"
- onChange={({ target: { value } }) => setOffset(value)}
- disabled={isLive}
- />
- ) : (
- <DatePicker
- selected={timestamp}
- onChange={(date: Date | null) => setTimestamp(date)}
- showTimeInput
- timeInputLabel="Time:"
- dateFormat="MMMM d, yyyy HH:mm"
- className="date-picker"
- placeholderText="Select timestamp"
- disabled={isLive}
- />
- )}
- </S.SeekTypeSelectorWrapper>
- )}
+ ) : (
+ <DatePicker
+ selected={timestamp}
+ onChange={(date: Date | null) => setTimestamp(date)}
+ showTimeInput
+ timeInputLabel="Time:"
+ dateFormat="MMMM d, yyyy HH:mm"
+ className="date-picker"
+ placeholderText="Select timestamp"
+ disabled={isLive}
+ />
+ )}
+ </S.SeekTypeSelectorWrapper>
<MultiSelect
options={partitions.map((p) => ({
label: `Partition #${p.partition.toString()}`,
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/Messages.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/Messages.spec.tsx
index 05d9eb0a461..d2a92c09e38 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/Messages.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/Messages.spec.tsx
@@ -35,14 +35,14 @@ describe('Messages', () => {
setUpComponent();
});
it('should check default seekDirection if it actually take the value from the url', () => {
- expect(screen.getByRole('listbox')).toHaveTextContent(
+ expect(screen.getAllByRole('listbox')[1]).toHaveTextContent(
SeekDirectionOptionsObj[SeekDirection.FORWARD].label
);
});
it('should check the SeekDirection select changes', () => {
- const seekDirectionSelect = screen.getByRole('listbox');
- const seekDirectionOption = screen.getByRole('option');
+ const seekDirectionSelect = screen.getAllByRole('listbox')[1];
+ const seekDirectionOption = screen.getAllByRole('option')[1];
expect(seekDirectionOption).toHaveTextContent(
SeekDirectionOptionsObj[SeekDirection.FORWARD].label
@@ -69,7 +69,7 @@ describe('Messages', () => {
setUpComponent(
searchParams.replace(SeekDirection.FORWARD, SeekDirection.BACKWARD)
);
- expect(screen.getByRole('listbox')).toHaveTextContent(
+ expect(screen.getAllByRole('listbox')[1]).toHaveTextContent(
SeekDirectionOptionsObj[SeekDirection.BACKWARD].label
);
});
| null | train | train | 2022-04-22T10:25:23 | "2022-04-20T21:57:24Z" | Haarolean | train |
provectus/kafka-ui/1737_1881 | provectus/kafka-ui | provectus/kafka-ui/1737 | provectus/kafka-ui/1881 | [
"timestamp(timedelta=0.0, similarity=0.8481879755176955)",
"connected"
] | 62f47788039de1941d346afca275412e6e1c34a8 | e9260cf9cb62c9558d61e3b86fe117128467b21d | [
"Hello there felix-roo! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"@felix-roo hey, thanks for reaching out! We'll take a look.",
"Can't find the bug, everything seems to work normally.",
"@simonyandev I could reproduce it, one of the brokers should be offline.\r\n<img width=\"1439\" alt=\"image\" src=\"https://user-images.githubusercontent.com/1494347/164317650-3f41cc4f-532f-4d8c-a792-90ea72c53ba4.png\">\r\n"
] | [] | "2022-04-21T11:56:10Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Hosts mismatched on the brokers page | **Describe the bug**
On the brokers page we have 6 brokers specified but only 6 hosts are returned. broker 1 (b-1.xxx) is missing.
**Set up**
Docker image is on the latest using very basic config with only broker links specified with READ_ONLY = true.
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Specify 6 brokers in the configuration
2. Start the app
3. See that the brokers are not mapped correctly in the table
**Expected behavior**
I expect to see 6 brokers mapped correctly in the table
**Screenshots**

**Additional context**
A quick inspect element shows me that the API does in fact respond with all 6 brokers intact. This makes me think it is likely an issue in the frontend where the brokers are filtered/modified in some way.
| [
"kafka-ui-react-app/src/components/Brokers/Brokers.tsx"
] | [
"kafka-ui-react-app/src/components/Brokers/Brokers.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Brokers/Brokers.tsx b/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
index 506856d14af..6d20911714f 100644
--- a/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
+++ b/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
@@ -128,17 +128,21 @@ const Brokers: React.FC = () => {
{diskUsage &&
diskUsage.length !== 0 &&
- diskUsage.map(({ brokerId, segmentSize, segmentCount }) => (
- <tr key={brokerId}>
- <td>{brokerId}</td>
- <td>
- <BytesFormatted value={segmentSize} />
- </td>
- <td>{segmentCount}</td>
- <td>{items && items[brokerId]?.port}</td>
- <td>{items && items[brokerId]?.host}</td>
- </tr>
- ))}
+ diskUsage.map(({ brokerId, segmentSize, segmentCount }) => {
+ const brokerItem = items?.find((item) => item.id === brokerId);
+
+ return (
+ <tr key={brokerId}>
+ <td>{brokerId}</td>
+ <td>
+ <BytesFormatted value={segmentSize} />
+ </td>
+ <td>{segmentCount}</td>
+ <td>{brokerItem?.port}</td>
+ <td>{brokerItem?.host}</td>
+ </tr>
+ );
+ })}
</tbody>
</Table>
</>
| null | test | train | 2022-04-22T11:01:08 | "2022-03-17T17:39:48Z" | felix-roo | train |
provectus/kafka-ui/1740_1898 | provectus/kafka-ui | provectus/kafka-ui/1740 | provectus/kafka-ui/1898 | [
"timestamp(timedelta=0.0, similarity=0.9421453391368015)",
"connected"
] | 247fd23bc0e3a79d12a8cfda291a0bd890b6172d | 521ba0cb2f63110eb2ed13a7054a4d70238a862a | [
"1. While live mode is on (active loading) all the controls (search, offset, partitions select) should be disabled. \r\n2. Once \"stop loading\" is pressed, fetched messages should NOT disappear. And controls (p. 1) should be enabled back again."
] | [] | "2022-04-25T11:07:33Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted"
] | Live tailing improvements | 1. New messages should appear on top
2. Pagination buttons (e.g. "Next") shouldn't be visible.
3.
wrong parameters passed for live tailing:
`https://www.kafka-ui.provectus.io/api/clusters/local/topics/7890/messages?filterQueryType=STRING_CONTAINS&attempt=1&limit=100&seekDirection=TAILING&seekType=OFFSET&seekTo=0::0`
this should be `https://www.kafka-ui.provectus.io/api/clusters/local/topics/7890/messages&seekDirection=TAILING&seekType=LATEST&seekTo=0::0`
`seekType` should be `LATEST`
`attempt` has no effect (can be removed from all endpoints)
`limit` has no effect in TAILING mode
(not critical) `filterQueryType` make sense only when `q` param passed
`seekTo` should be 0::0,1::0,... where first number is partition
#943 | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx",
"kafka-ui-react-app/src/components/common/MultiSelect/MultiSelect.styled.ts",
"kafka-ui-react-app/src/components/common/Search/Search.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx",
"kafka-ui-react-app/src/components/common/MultiSelect/MultiSelect.styled.ts",
"kafka-ui-react-app/src/components/common/MultiSelect/__test__/MultiSelect.styled.spec.tsx",
"kafka-ui-react-app/src/components/common/Search/Search.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
index d753f33cfb5..57e7fc23b2b 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
@@ -129,6 +129,8 @@ const Filters: React.FC<FiltersProps> = ({
: MessageFilterType.STRING_CONTAINS
);
const [query, setQuery] = React.useState<string>(searchParams.get('q') || '');
+ const [isTailing, setIsTailing] = React.useState<boolean>(isLive);
+
const isSeekTypeControlVisible = React.useMemo(
() => selectedPartitions.length > 0,
[selectedPartitions]
@@ -136,11 +138,13 @@ const Filters: React.FC<FiltersProps> = ({
const isSubmitDisabled = React.useMemo(() => {
if (isSeekTypeControlVisible) {
- return currentSeekType === SeekType.TIMESTAMP && !timestamp;
+ return (
+ (currentSeekType === SeekType.TIMESTAMP && !timestamp) || isTailing
+ );
}
return false;
- }, [isSeekTypeControlVisible, currentSeekType, timestamp]);
+ }, [isSeekTypeControlVisible, currentSeekType, timestamp, isTailing]);
const partitionMap = React.useMemo(
() =>
@@ -345,6 +349,10 @@ const Filters: React.FC<FiltersProps> = ({
handleFiltersSubmit(offset);
}, [handleFiltersSubmit, seekDirection]);
+ React.useEffect(() => {
+ setIsTailing(isLive);
+ }, [isLive]);
+
return (
<S.FiltersWrapper>
<div>
@@ -352,6 +360,7 @@ const Filters: React.FC<FiltersProps> = ({
<Search
placeholder="Search"
value={query}
+ disabled={isTailing}
handleSearch={(value: string) => setQuery(value)}
/>
<S.SeekTypeSelectorWrapper>
@@ -362,7 +371,7 @@ const Filters: React.FC<FiltersProps> = ({
selectSize="M"
minWidth="100px"
options={SeekTypeOptions}
- disabled={isLive}
+ disabled={isTailing}
/>
{currentSeekType === SeekType.OFFSET ? (
<Input
@@ -373,7 +382,7 @@ const Filters: React.FC<FiltersProps> = ({
className="offset-selector"
placeholder="Offset"
onChange={({ target: { value } }) => setOffset(value)}
- disabled={isLive}
+ disabled={isTailing}
/>
) : (
<DatePicker
@@ -384,7 +393,7 @@ const Filters: React.FC<FiltersProps> = ({
dateFormat="MMMM d, yyyy HH:mm"
className="date-picker"
placeholderText="Select timestamp"
- disabled={isLive}
+ disabled={isTailing}
/>
)}
</S.SeekTypeSelectorWrapper>
@@ -397,6 +406,7 @@ const Filters: React.FC<FiltersProps> = ({
value={selectedPartitions}
onChange={setSelectedPartitions}
labelledBy="Select partitions"
+ disabled={isTailing}
/>
<S.ClearAll onClick={handleClearAllFilters}>Clear all</S.ClearAll>
{isFetching ? (
@@ -465,13 +475,13 @@ const Filters: React.FC<FiltersProps> = ({
isFetching &&
phaseMessage}
</p>
- <S.MessageLoading isLive={isLive}>
+ <S.MessageLoading isLive={isTailing}>
<S.MessageLoadingSpinner isFetching={isFetching} />
Loading messages.
<S.StopLoading
onClick={() => {
- changeSeekDirection(SeekDirection.FORWARD);
- setIsFetching(false);
+ handleSSECancel();
+ setIsTailing(false);
}}
>
Stop loading
diff --git a/kafka-ui-react-app/src/components/common/MultiSelect/MultiSelect.styled.ts b/kafka-ui-react-app/src/components/common/MultiSelect/MultiSelect.styled.ts
index ea596585b0a..f4767bd76df 100644
--- a/kafka-ui-react-app/src/components/common/MultiSelect/MultiSelect.styled.ts
+++ b/kafka-ui-react-app/src/components/common/MultiSelect/MultiSelect.styled.ts
@@ -9,8 +9,14 @@ const MultiSelect = styled(ReactMultiSelect)<{ minWidth?: string }>`
& > .dropdown-container {
height: 32px;
+ * {
+ cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
+ }
+
& > .dropdown-heading {
height: 32px;
+ color: ${({ disabled, theme }) =>
+ disabled ? theme.select.color.disabled : theme.select.color.active};
}
}
`;
diff --git a/kafka-ui-react-app/src/components/common/MultiSelect/__test__/MultiSelect.styled.spec.tsx b/kafka-ui-react-app/src/components/common/MultiSelect/__test__/MultiSelect.styled.spec.tsx
new file mode 100644
index 00000000000..16b30e042d3
--- /dev/null
+++ b/kafka-ui-react-app/src/components/common/MultiSelect/__test__/MultiSelect.styled.spec.tsx
@@ -0,0 +1,61 @@
+import React from 'react';
+import { render } from 'lib/testHelpers';
+import MultiSelect from 'components/common/MultiSelect/MultiSelect.styled';
+import { ISelectProps } from 'react-multi-select-component/dist/lib/interfaces';
+
+const Option1 = { value: 1, label: 'option 1' };
+const Option2 = { value: 2, label: 'option 2' };
+
+interface IMultiSelectProps extends ISelectProps {
+ minWidth?: string;
+}
+
+const DefaultProps: IMultiSelectProps = {
+ options: [Option1, Option2],
+ labelledBy: 'multi-select',
+ value: [Option1, Option2],
+};
+
+describe('MultiSelect.Styled', () => {
+ const setUpComponent = (props: IMultiSelectProps = DefaultProps) => {
+ const { container } = render(<MultiSelect {...props} />);
+ const multiSelect = container.firstChild;
+ const dropdownContainer = multiSelect?.firstChild?.firstChild;
+
+ return { container, multiSelect, dropdownContainer };
+ };
+
+ it('should have 200px minWidth by default', () => {
+ const { container } = setUpComponent();
+ const multiSelect = container.firstChild;
+
+ expect(multiSelect).toHaveStyle('min-width: 200px');
+ });
+
+ it('should have the provided minWidth in styles', () => {
+ const minWidth = '400px';
+ const { container } = setUpComponent({ ...DefaultProps, minWidth });
+ const multiSelect = container.firstChild;
+
+ expect(multiSelect).toHaveStyle(`min-width: ${minWidth}`);
+ });
+
+ describe('when not disabled', () => {
+ it('should have cursor pointer', () => {
+ const { dropdownContainer } = setUpComponent();
+
+ expect(dropdownContainer).toHaveStyle(`cursor: pointer`);
+ });
+ });
+
+ describe('when disabled', () => {
+ it('should have cursor not-allowed', () => {
+ const { dropdownContainer } = setUpComponent({
+ ...DefaultProps,
+ disabled: true,
+ });
+
+ expect(dropdownContainer).toHaveStyle(`cursor: not-allowed`);
+ });
+ });
+});
diff --git a/kafka-ui-react-app/src/components/common/Search/Search.tsx b/kafka-ui-react-app/src/components/common/Search/Search.tsx
index 1369ea9f41c..81f513950d8 100644
--- a/kafka-ui-react-app/src/components/common/Search/Search.tsx
+++ b/kafka-ui-react-app/src/components/common/Search/Search.tsx
@@ -6,12 +6,14 @@ interface SearchProps {
handleSearch: (value: string) => void;
placeholder?: string;
value: string;
+ disabled?: boolean;
}
const Search: React.FC<SearchProps> = ({
handleSearch,
placeholder = 'Search',
value,
+ disabled = false,
}) => {
const onChange = useDebouncedCallback(
(e) => handleSearch(e.target.value),
@@ -26,6 +28,7 @@ const Search: React.FC<SearchProps> = ({
defaultValue={value}
leftIcon="fas fa-search"
inputSize="M"
+ disabled={disabled}
/>
);
};
| null | val | train | 2022-04-27T13:28:35 | "2022-03-20T18:33:58Z" | Haarolean | train |
provectus/kafka-ui/1741_1903 | provectus/kafka-ui | provectus/kafka-ui/1741 | provectus/kafka-ui/1903 | [
"timestamp(timedelta=0.0, similarity=0.9921880503493956)",
"connected"
] | 112083200f4a543a3b6845b23dd94baebc9a16e5 | 9acef94234bec54f50ebcd9fdc2968353a2935a3 | [
"1. Filter name pane looks ugly (broken padding or there's none even)\r\n<img width=\"318\" alt=\"image\" src=\"https://user-images.githubusercontent.com/1494347/165113010-a055ec11-4f05-4b3c-8b6b-e63ee291a8bd.png\">\r\n2. Can we assign some name for the filters which are saved without a name? Like, using first symbols/line of the filter itself?"
] | [] | "2022-04-26T07:12:58Z" | [
"type/enhancement",
"scope/frontend",
"status/accepted"
] | Smart filters improvements | 1. Creating and instantly applying filters is currently not possible -- you have to create a filter, choose a name and save it.
2. Plus sign is in a weird place and it's not obvious that it's about filters. | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/AddFilter.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/AddFilter.spec.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/AddFilter.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/AddFilter.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/AddFilter.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/AddFilter.tsx
index 3fcb61d7cec..995e3d7666f 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/AddFilter.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/AddFilter.tsx
@@ -40,7 +40,10 @@ const AddFilter: React.FC<FilterModalProps> = ({
addFilter(data);
} else {
// other case is not applying the filter
- data.name = data.name ? data.name : 'Unsaved filter';
+ const dataCodeLabel =
+ data.code.length > 16 ? `${data.code.slice(0, 16)}...` : data.code;
+ data.name = data.name || dataCodeLabel;
+
activeFilterHandler(data, -1);
toggleIsOpen();
}
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts
index 04f10efb91d..e3462333f50 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts
@@ -235,7 +235,7 @@ export const ActiveSmartFilter = styled.div`
align-items: center;
justify-content: space-between;
color: ${({ theme }) => theme.input.label.color};
- padding: 10px 2px;
+ padding: 16px 8px;
`;
export const DeleteSavedFilterIcon = styled.div`
@@ -243,9 +243,10 @@ export const DeleteSavedFilterIcon = styled.div`
border-left: 1px solid ${({ theme }) => theme.savedFilterDivider.color};
display: flex;
align-items: center;
- padding-left: 5px;
+ padding-left: 6px;
height: 24px;
cursor: pointer;
+ margin-left: 4px;
`;
export const ConfirmDeletionText = styled.h3`
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/AddFilter.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/AddFilter.spec.tsx
index 567fe42f014..8ed5eb8efe0 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/AddFilter.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/AddFilter.spec.tsx
@@ -12,6 +12,8 @@ const filters: MessageFilters[] = [
{ name: 'name2', code: 'code2' },
];
+const editFilterMock = jest.fn();
+
const setupComponent = (props: Partial<FilterModalProps> = {}) =>
render(
<AddFilter
@@ -20,7 +22,7 @@ const setupComponent = (props: Partial<FilterModalProps> = {}) =>
deleteFilter={jest.fn()}
activeFilterHandler={jest.fn()}
toggleEditModal={jest.fn()}
- editFilter={jest.fn()}
+ editFilter={editFilterMock}
filters={props.filters || filters}
{...props}
/>
@@ -83,6 +85,26 @@ describe('AddFilter component', () => {
expect(addFilterBtn).toBeEnabled();
expect(codeTextBox).toHaveValue(code);
});
+
+ it('calls editFilter when edit button is clicked in saved filters', () => {
+ const savedFiltersButton = screen.getByText('Saved Filters');
+ expect(savedFiltersButton).toBeInTheDocument();
+
+ userEvent.click(savedFiltersButton);
+
+ const index = 0;
+
+ const editButton = screen.getAllByText('Edit')[index];
+ userEvent.click(editButton);
+
+ const { code, name } = filters[index];
+
+ expect(editFilterMock).toHaveBeenCalledTimes(1);
+ expect(editFilterMock).toHaveBeenCalledWith({
+ index,
+ filter: { code, name },
+ });
+ });
});
describe('onSubmit with Filter being saved', () => {
@@ -91,6 +113,7 @@ describe('AddFilter component', () => {
const toggleModelMock = jest.fn();
const codeValue = 'filter code';
+ const longCodeValue = 'a long filter code';
const nameValue = 'filter name';
beforeEach(async () => {
@@ -149,7 +172,7 @@ describe('AddFilter component', () => {
expect(activeFilterHandlerMock).toHaveBeenCalledTimes(1);
expect(activeFilterHandlerMock).toHaveBeenCalledWith(
{
- name: 'Unsaved filter',
+ name: codeValue,
code: codeValue,
saveFilter: false,
},
@@ -184,5 +207,36 @@ describe('AddFilter component', () => {
});
});
});
+
+ it('should use sliced code as the filter name if filter name is empty', async () => {
+ const codeTextBox = screen.getAllByRole('textbox')[0];
+ const nameTextBox = screen.getAllByRole('textbox')[1];
+ const addFilterBtn = screen.getByRole('button', { name: /Add filter/i });
+
+ userEvent.clear(nameTextBox);
+ userEvent.clear(codeTextBox);
+ userEvent.paste(codeTextBox, longCodeValue);
+
+ expect(nameTextBox).toHaveValue('');
+ expect(codeTextBox).toHaveValue(longCodeValue);
+
+ userEvent.click(addFilterBtn);
+
+ const filterName = `${longCodeValue.slice(0, 16)}...`;
+
+ await waitFor(() => {
+ expect(activeFilterHandlerMock).toHaveBeenCalledTimes(1);
+ expect(activeFilterHandlerMock).toHaveBeenCalledWith(
+ {
+ name: filterName,
+ code: longCodeValue,
+ saveFilter: false,
+ },
+ -1
+ );
+ expect(codeTextBox).toHaveValue('');
+ expect(toggleModelMock).toHaveBeenCalled();
+ });
+ });
});
});
| null | val | train | 2022-04-22T16:07:01 | "2022-03-20T18:38:32Z" | Haarolean | train |
provectus/kafka-ui/1402_1919 | provectus/kafka-ui | provectus/kafka-ui/1402 | provectus/kafka-ui/1919 | [
"connected"
] | 53584610402d9b029f7df3ecff1d085e193112f3 | 51438d4d5394e024a07a4154746ae0a4ce1f3e15 | [
"@vdanylenko hey! Any updates here? What's the status on this issue? ",
"Can't reproduce this one on the master.",
"same problem here, docker compose in attachment\r\n[kafka-ui.yaml.txt](https://github.com/provectus/kafka-ui/files/8169716/kafka-ui.yaml.txt)\r\n ",
"@moravcik94 hey, can you provide steps to reproduce this? Are they the same described in the first message?"
] | [
"```suggestion\r\n private static final String INCOMPATIBLE_WITH_AN_EARLIER_SCHEMA = \"incompatible with an earlier schema version\";\r\n```"
] | "2022-05-02T15:47:03Z" | [
"type/bug",
"good first issue",
"scope/backend",
"status/accepted",
"status/confirmed"
] | Edit Schema is throwing error from backend for JSON and AVRO types | **Describe the bug**
(A clear and concise description of what the bug is.)
While working on https://github.com/provectus/kafka-ui/issues/1388 I noticed that after submitting changes for both JSON and AVRO types in edit schema page it throws backend error and changes aren't being saved.
For Protobuf type backend works fine.
**Set up**
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
**Steps to Reproduce**
Steps to reproduce the behavior:
1.Go to Schema registry
2.Select schema with JSON or AVRO schemaType
3.press Edit Schema button
4.make changes and press Submit button
**Expected behavior**
(A clear and concise description of what you expected to happen)
**Screenshots**
(If applicable, add screenshots to help explain your problem)


**Additional context**
(Add any other context about the problem here)
| [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/SchemaCompatibilityException.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java"
] | [
"kafka-ui-api/src/test/java/com/provectus/kafka/ui/SchemaRegistryServiceTests.java"
] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/SchemaCompatibilityException.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/SchemaCompatibilityException.java
new file mode 100644
index 00000000000..6ea5d12d81b
--- /dev/null
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/exception/SchemaCompatibilityException.java
@@ -0,0 +1,12 @@
+package com.provectus.kafka.ui.exception;
+
+public class SchemaCompatibilityException extends CustomBaseException {
+ public SchemaCompatibilityException(String message) {
+ super(message);
+ }
+
+ @Override
+ public ErrorCode getErrorCode() {
+ return ErrorCode.UNPROCESSABLE_ENTITY;
+ }
+}
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java
index 085e6c39be8..5207c0cdd18 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/SchemaRegistryService.java
@@ -1,8 +1,10 @@
package com.provectus.kafka.ui.service;
+import static org.springframework.http.HttpStatus.CONFLICT;
import static org.springframework.http.HttpStatus.NOT_FOUND;
import static org.springframework.http.HttpStatus.UNPROCESSABLE_ENTITY;
+import com.provectus.kafka.ui.exception.SchemaCompatibilityException;
import com.provectus.kafka.ui.exception.SchemaFailedToDeleteException;
import com.provectus.kafka.ui.exception.SchemaNotFoundException;
import com.provectus.kafka.ui.exception.SchemaTypeNotSupportedException;
@@ -65,6 +67,7 @@ public class SchemaRegistryService {
private static final String LATEST = "latest";
private static final String UNRECOGNIZED_FIELD_SCHEMA_TYPE = "Unrecognized field: schemaType";
+ private static final String INCOMPATIBLE_WITH_AN_EARLIER_SCHEMA = "incompatible with an earlier schema";
private final ClusterMapper mapper;
private final WebClient webClient;
@@ -164,18 +167,18 @@ public Mono<Void> deleteLatestSchemaSubject(KafkaCluster cluster,
private Mono<Void> deleteSchemaSubject(KafkaCluster cluster, String schemaName,
String version) {
return configuredWebClient(
- cluster,
- HttpMethod.DELETE,
- SchemaRegistryService.URL_SUBJECT_BY_VERSION,
- List.of(schemaName, version))
- .retrieve()
- .onStatus(NOT_FOUND::equals,
- throwIfNotFoundStatus(formatted(NO_SUCH_SCHEMA_VERSION, schemaName, version))
- )
- .toBodilessEntity()
- .then()
- .as(m -> failoverAble(m, new FailoverMono<>(cluster.getSchemaRegistry(),
- () -> this.deleteSchemaSubject(cluster, schemaName, version))));
+ cluster,
+ HttpMethod.DELETE,
+ SchemaRegistryService.URL_SUBJECT_BY_VERSION,
+ List.of(schemaName, version))
+ .retrieve()
+ .onStatus(NOT_FOUND::equals,
+ throwIfNotFoundStatus(formatted(NO_SUCH_SCHEMA_VERSION, schemaName, version))
+ )
+ .toBodilessEntity()
+ .then()
+ .as(m -> failoverAble(m, new FailoverMono<>(cluster.getSchemaRegistry(),
+ () -> this.deleteSchemaSubject(cluster, schemaName, version))));
}
public Mono<Void> deleteSchemaSubjectEntirely(KafkaCluster cluster,
@@ -216,20 +219,29 @@ private Mono<SubjectIdResponse> submitNewSchema(String subject,
Mono<InternalNewSchema> newSchemaSubject,
KafkaCluster cluster) {
return configuredWebClient(
- cluster,
- HttpMethod.POST,
- URL_SUBJECT_VERSIONS, subject)
- .contentType(MediaType.APPLICATION_JSON)
- .body(BodyInserters.fromPublisher(newSchemaSubject, InternalNewSchema.class))
- .retrieve()
- .onStatus(UNPROCESSABLE_ENTITY::equals,
- r -> r.bodyToMono(ErrorResponse.class)
- .flatMap(x -> Mono.error(isUnrecognizedFieldSchemaTypeMessage(x.getMessage())
- ? new SchemaTypeNotSupportedException()
- : new UnprocessableEntityException(x.getMessage()))))
- .bodyToMono(SubjectIdResponse.class)
- .as(m -> failoverAble(m, new FailoverMono<>(cluster.getSchemaRegistry(),
- () -> submitNewSchema(subject, newSchemaSubject, cluster))));
+ cluster,
+ HttpMethod.POST,
+ URL_SUBJECT_VERSIONS, subject)
+ .contentType(MediaType.APPLICATION_JSON)
+ .body(BodyInserters.fromPublisher(newSchemaSubject, InternalNewSchema.class))
+ .retrieve()
+ .onStatus(status -> UNPROCESSABLE_ENTITY.equals(status) || CONFLICT.equals(status),
+ r -> r.bodyToMono(ErrorResponse.class)
+ .flatMap(this::getMonoError))
+ .bodyToMono(SubjectIdResponse.class)
+ .as(m -> failoverAble(m, new FailoverMono<>(cluster.getSchemaRegistry(),
+ () -> submitNewSchema(subject, newSchemaSubject, cluster))));
+ }
+
+ @NotNull
+ private Mono<Throwable> getMonoError(ErrorResponse x) {
+ if (isUnrecognizedFieldSchemaTypeMessage(x.getMessage())) {
+ return Mono.error(new SchemaTypeNotSupportedException());
+ } else if (isIncompatibleSchemaMessage(x.getMessage())) {
+ return Mono.error(new SchemaCompatibilityException(x.getMessage()));
+ } else {
+ return Mono.error(new UnprocessableEntityException(x.getMessage()));
+ }
}
@NotNull
@@ -337,6 +349,10 @@ private boolean isUnrecognizedFieldSchemaTypeMessage(String errorMessage) {
return errorMessage.contains(UNRECOGNIZED_FIELD_SCHEMA_TYPE);
}
+ private boolean isIncompatibleSchemaMessage(String message) {
+ return message.contains(INCOMPATIBLE_WITH_AN_EARLIER_SCHEMA);
+ }
+
private WebClient.RequestBodySpec configuredWebClient(KafkaCluster cluster, HttpMethod method,
String uri) {
return configuredWebClient(cluster, method, uri, Collections.emptyList(),
| diff --git a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/SchemaRegistryServiceTests.java b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/SchemaRegistryServiceTests.java
index 354b5eb4a51..190831da98b 100644
--- a/kafka-ui-api/src/test/java/com/provectus/kafka/ui/SchemaRegistryServiceTests.java
+++ b/kafka-ui-api/src/test/java/com/provectus/kafka/ui/SchemaRegistryServiceTests.java
@@ -5,7 +5,9 @@
import com.provectus.kafka.ui.model.SchemaSubjectDTO;
import com.provectus.kafka.ui.model.SchemaSubjectsResponseDTO;
import com.provectus.kafka.ui.model.SchemaTypeDTO;
+import java.nio.charset.StandardCharsets;
import java.util.List;
+import java.util.Objects;
import java.util.UUID;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
@@ -13,10 +15,13 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.test.web.reactive.server.EntityExchangeResult;
import org.springframework.test.web.reactive.server.WebTestClient;
import org.springframework.web.reactive.function.BodyInserters;
+import org.testcontainers.shaded.org.hamcrest.MatcherAssert;
+import org.testcontainers.shaded.org.hamcrest.Matchers;
import reactor.core.publisher.Mono;
@Slf4j
@@ -102,6 +107,61 @@ void shouldNotDoAnythingIfSchemaNotChanged() {
Assertions.assertEquals("1", dto.getVersion());
}
+ @Test
+ void shouldReturnCorrectMessageWhenIncompatibleSchema() {
+ String schema = "{\"subject\":\"%s\",\"schemaType\":\"JSON\",\"schema\":"
+ + "\"{\\\"type\\\": \\\"string\\\"," + "\\\"properties\\\": "
+ + "{\\\"f1\\\": {\\\"type\\\": \\\"integer\\\"}}}"
+ + "\"}";
+ String schema2 = "{\"subject\":\"%s\"," + "\"schemaType\":\"JSON\",\"schema\":"
+ + "\"{\\\"type\\\": \\\"string\\\"," + "\\\"properties\\\": "
+ + "{\\\"f1\\\": {\\\"type\\\": \\\"string\\\"},"
+ + "\\\"f2\\\": {" + "\\\"type\\\": \\\"string\\\"}}}"
+ + "\"}";
+
+ SchemaSubjectDTO dto =
+ webTestClient
+ .post()
+ .uri("/api/clusters/{clusterName}/schemas", LOCAL)
+ .contentType(MediaType.APPLICATION_JSON)
+ .body(BodyInserters.fromValue(String.format(schema, subject)))
+ .exchange()
+ .expectStatus()
+ .isOk()
+ .expectBody(SchemaSubjectDTO.class)
+ .returnResult()
+ .getResponseBody();
+
+ Assertions.assertNotNull(dto);
+ Assertions.assertEquals("1", dto.getVersion());
+
+ webTestClient
+ .post()
+ .uri("/api/clusters/{clusterName}/schemas", LOCAL)
+ .contentType(MediaType.APPLICATION_JSON)
+ .body(BodyInserters.fromValue(String.format(schema2, subject)))
+ .exchange()
+ .expectStatus().isEqualTo(HttpStatus.UNPROCESSABLE_ENTITY)
+ .expectBody().consumeWith(body -> {
+ String responseBody = new String(Objects.requireNonNull(body.getResponseBody()), StandardCharsets.UTF_8);
+ MatcherAssert.assertThat("Must return correct message incompatible schema",
+ responseBody,
+ Matchers.containsString("Schema being registered is incompatible with an earlier schema"));
+ });
+
+ dto = webTestClient
+ .get()
+ .uri("/api/clusters/{clusterName}/schemas/{subject}/latest", LOCAL, subject)
+ .exchange()
+ .expectStatus().isOk()
+ .expectBody(SchemaSubjectDTO.class)
+ .returnResult()
+ .getResponseBody();
+
+ Assertions.assertNotNull(dto);
+ Assertions.assertEquals("1", dto.getVersion());
+ }
+
@Test
void shouldCreateNewProtobufSchema() {
String schema =
| test | train | 2022-05-04T08:47:51 | "2022-01-18T09:12:51Z" | NelyDavtyan | train |
provectus/kafka-ui/1907_1920 | provectus/kafka-ui | provectus/kafka-ui/1907 | provectus/kafka-ui/1920 | [
"connected",
"timestamp(timedelta=0.0, similarity=0.8682618159183508)"
] | e597f14b8dfa46ac3dca48645cc92506ab8cf583 | ee102aa87ef93081a9b44e091b4ad150f0f29a2b | [] | [
"must be removed",
"pls revome unused code",
"I see no need in creation of extra constants here. Pls use \r\n```js\r\nexpect(screen.getByText('798')).toBeInTheDocument();\r\nexpect(screen.getByText('of 799')).toBeInTheDocument();\r\n```",
"same here",
"and here",
"Must be removed"
] | "2022-05-03T09:18:38Z" | [
"type/bug",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Invalid "in sync replicas" value is displayed | <img width="370" alt="image" src="https://user-images.githubusercontent.com/1494347/165547338-b440a5d1-113a-451a-89e3-f1dd08b5586f.png">
```
const replicas = inSyncReplicasCount ?? 0 + (outOfSyncReplicasCount ?? 0);
const areAllInSync = inSyncReplicasCount && replicas === inSyncReplicasCount;
```
Doesn't seem to be a valid approach.
outOfSyncReplicasCount: 1
inSyncReplicasCount: 798
| [
"kafka-ui-react-app/src/components/Brokers/Brokers.tsx",
"kafka-ui-react-app/src/components/Brokers/__test__/Brokers.spec.tsx"
] | [
"kafka-ui-react-app/src/components/Brokers/Brokers.tsx",
"kafka-ui-react-app/src/components/Brokers/__test__/Brokers.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Brokers/Brokers.tsx b/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
index bb8f40f290f..39176ab0c6f 100644
--- a/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
+++ b/kafka-ui-react-app/src/components/Brokers/Brokers.tsx
@@ -30,7 +30,7 @@ const Brokers: React.FC = () => {
items,
} = useAppSelector(selectStats);
- const replicas = inSyncReplicasCount ?? 0 + (outOfSyncReplicasCount ?? 0);
+ const replicas = (inSyncReplicasCount ?? 0) + (outOfSyncReplicasCount ?? 0);
const areAllInSync = inSyncReplicasCount && replicas === inSyncReplicasCount;
const partitionIsOffline = offlinePartitionCount && offlinePartitionCount > 0;
React.useEffect(() => {
diff --git a/kafka-ui-react-app/src/components/Brokers/__test__/Brokers.spec.tsx b/kafka-ui-react-app/src/components/Brokers/__test__/Brokers.spec.tsx
index f2408f19939..e81468c3a8c 100644
--- a/kafka-ui-react-app/src/components/Brokers/__test__/Brokers.spec.tsx
+++ b/kafka-ui-react-app/src/components/Brokers/__test__/Brokers.spec.tsx
@@ -11,6 +11,10 @@ describe('Brokers Component', () => {
afterEach(() => fetchMock.reset());
const clusterName = 'local';
+
+ const testInSyncReplicasCount = 798;
+ const testOutOfSyncReplicasCount = 1;
+
const renderComponent = () =>
render(
<Route path={clusterBrokersPath(':clusterName')}>
@@ -48,7 +52,6 @@ describe('Brokers Component', () => {
const rows = screen.getAllByRole('row');
expect(rows.length).toEqual(3);
});
-
it('shows warning when offlinePartitionCount > 0', async () => {
const fetchStatsMock = fetchMock.getOnce(fetchStatsUrl, {
...clusterStatsPayload,
@@ -67,5 +70,52 @@ describe('Brokers Component', () => {
expect(onlineWidget).toBeInTheDocument();
expect(onlineWidget).toHaveStyle({ color: '#E51A1A' });
});
+ it('shows right count when offlinePartitionCount > 0', async () => {
+ const fetchStatsMock = fetchMock.getOnce(fetchStatsUrl, {
+ ...clusterStatsPayload,
+ inSyncReplicasCount: testInSyncReplicasCount,
+ outOfSyncReplicasCount: testOutOfSyncReplicasCount,
+ });
+ renderComponent();
+ await waitFor(() => {
+ expect(fetchStatsMock.called()).toBeTruthy();
+ });
+
+ const onlineWidgetDef = screen.getByText(testInSyncReplicasCount);
+ const onlineWidget = screen.getByText(
+ `of ${testInSyncReplicasCount + testOutOfSyncReplicasCount}`
+ );
+ expect(onlineWidgetDef).toBeInTheDocument();
+ expect(onlineWidget).toBeInTheDocument();
+ });
+ it('shows right count when inSyncReplicasCount: undefined outOfSyncReplicasCount: 1', async () => {
+ const fetchStatsMock = fetchMock.getOnce(fetchStatsUrl, {
+ ...clusterStatsPayload,
+ inSyncReplicasCount: undefined,
+ outOfSyncReplicasCount: testOutOfSyncReplicasCount,
+ });
+ renderComponent();
+ await waitFor(() => {
+ expect(fetchStatsMock.called()).toBeTruthy();
+ });
+
+ const onlineWidget = screen.getByText(`of ${testOutOfSyncReplicasCount}`);
+ expect(onlineWidget).toBeInTheDocument();
+ });
+ it(`shows right count when inSyncReplicasCount: ${testInSyncReplicasCount} outOfSyncReplicasCount: undefined`, async () => {
+ const fetchStatsMock = fetchMock.getOnce(fetchStatsUrl, {
+ ...clusterStatsPayload,
+ inSyncReplicasCount: testInSyncReplicasCount,
+ outOfSyncReplicasCount: undefined,
+ });
+ renderComponent();
+ await waitFor(() => {
+ expect(fetchStatsMock.called()).toBeTruthy();
+ });
+ const onlineWidgetDef = screen.getByText(testInSyncReplicasCount);
+ const onlineWidget = screen.getByText(`of ${testInSyncReplicasCount}`);
+ expect(onlineWidgetDef).toBeInTheDocument();
+ expect(onlineWidget).toBeInTheDocument();
+ });
});
});
| null | val | train | 2022-05-11T10:27:22 | "2022-04-27T14:54:58Z" | Haarolean | train |
provectus/kafka-ui/1537_1925 | provectus/kafka-ui | provectus/kafka-ui/1537 | provectus/kafka-ui/1925 | [
"connected"
] | 068b1cbf6267727d77902b82ed5cfb8727f347c7 | eb32b2eb2b50883c5cb1a7d6286e1058cbeb24a2 | [] | [] | "2022-05-04T15:19:57Z" | [
"scope/backend",
"status/accepted",
"scope/infrastructure"
] | Configure backend test coverage for sonar via jacoco | [
"kafka-ui-api/pom.xml"
] | [
"kafka-ui-api/pom.xml"
] | [] | diff --git a/kafka-ui-api/pom.xml b/kafka-ui-api/pom.xml
index 4011d234570..e2b6ceddb98 100644
--- a/kafka-ui-api/pom.xml
+++ b/kafka-ui-api/pom.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>kafka-ui</artifactId>
<groupId>com.provectus</groupId>
@@ -10,6 +11,15 @@
<artifactId>kafka-ui-api</artifactId>
+ <properties>
+ <jacoco.version>0.8.8</jacoco.version>
+ <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
+ <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
+ <sonar.jacoco.reportPath>${project.basedir}/target/jacoco.exec</sonar.jacoco.reportPath>
+ <sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/target/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
+ <sonar.language>java</sonar.language>
+ </properties>
+
<dependencyManagement>
<dependencies>
<dependency>
@@ -37,7 +47,7 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-oauth2-client</artifactId>
+ <artifactId>spring-boot-starter-oauth2-client</artifactId>
</dependency>
<dependency>
<groupId>com.provectus</groupId>
@@ -255,8 +265,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
- <argLine> --illegal-access=permit
- </argLine>
+ <argLine>@{argLine} --illegal-access=permit</argLine>
</configuration>
</plugin>
<plugin>
@@ -304,6 +313,30 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>${jacoco.version}</version>
+ <executions>
+ <execution>
+ <id>prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>report</id>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ <configuration>
+ <formats>
+ <format>XML</format>
+ </formats>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
| null | val | train | 2022-05-05T03:56:15 | "2022-02-02T13:40:28Z" | Haarolean | train |
|
provectus/kafka-ui/1024_1934 | provectus/kafka-ui | provectus/kafka-ui/1024 | provectus/kafka-ui/1934 | [
"connected"
] | d1c59dd74bb8b41c4b7d95c5fa7e7db8f53292fb | 6891138f15e4b27c094f0c57eace3537e9dc6cd2 | [
"1. When \"newest first\" is selected or \"submit\" button is pressed while \"newest first\" is selected we should use `seekType` as `LATEST` instead of `OFFSET`.\r\n2. The same for \"oldest first\": `seekType` should be `BEGINNING`.\r\n",
"@Haarolean When we submit a message, it redirects to the topic messages page with the default params, so the seekDirection is reset to FORWARD (Oldest first). I can set the seekType to BEGINNING, but the results are the same. What about the newest first option, seekType=LATEST doesn't help, the new messages still don't appear. I think the problem comes from the back end.",
"@simonyandev the first part is okay, results should be the same, adjusting the seekDirection to make it clear.\r\n\r\n@iliax any ideas about the second part?",
"@simonyandev We fixed issue with wrong backend behaviour in Newest first mode, so I think you can continue work on UI",
"@ssiradeghyan PTAL"
] | [] | "2022-05-08T09:01:07Z" | [
"type/bug",
"good first issue",
"scope/backend",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | New incoming messages not visible when "Newest first" enabled | **Describe the bug**
(A clear and concise description of what the bug is.)
When "Newest first" is enabled on Submit we should send request with latest partitions offsets.
**Steps to Reproduce**
Steps to reproduce the behavior:
1. write messages to topic
2. open Messages tab
3. enable "Newest first" mode
4. write new messages
5. click Submit
6. nothing happened
**Expected behavior**
(A clear and concise description of what you expected to happen)
New submitted messages should be visible.
To Fix it we should get latest partitions offsets and send as params
**Screenshots**
(If applicable, add screenshots to help explain your problem)
**Additional context**
(Add any other context about the problem here)
| [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/AbstractEmitter.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/BackwardRecordEmitter.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/OffsetsSeek.java"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/AbstractEmitter.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/BackwardRecordEmitter.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/OffsetsSeek.java"
] | [] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/AbstractEmitter.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/AbstractEmitter.java
index 30a5f566d35..84228c41342 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/AbstractEmitter.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/AbstractEmitter.java
@@ -14,7 +14,7 @@
import reactor.core.publisher.FluxSink;
public abstract class AbstractEmitter {
- private static final Duration POLL_TIMEOUT_MS = Duration.ofMillis(1000L);
+ private static final Duration DEFAULT_POLL_TIMEOUT_MS = Duration.ofMillis(1000L);
private final RecordSerDe recordDeserializer;
private final ConsumingStats consumingStats = new ConsumingStats();
@@ -25,8 +25,13 @@ protected AbstractEmitter(RecordSerDe recordDeserializer) {
protected ConsumerRecords<Bytes, Bytes> poll(
FluxSink<TopicMessageEventDTO> sink, Consumer<Bytes, Bytes> consumer) {
+ return poll(sink, consumer, DEFAULT_POLL_TIMEOUT_MS);
+ }
+
+ protected ConsumerRecords<Bytes, Bytes> poll(
+ FluxSink<TopicMessageEventDTO> sink, Consumer<Bytes, Bytes> consumer, Duration timeout) {
Instant start = Instant.now();
- ConsumerRecords<Bytes, Bytes> records = consumer.poll(POLL_TIMEOUT_MS);
+ ConsumerRecords<Bytes, Bytes> records = consumer.poll(timeout);
Instant finish = Instant.now();
sendConsuming(sink, records, Duration.between(start, finish).toMillis());
return records;
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/BackwardRecordEmitter.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/BackwardRecordEmitter.java
index 302cb9879b9..ff29110c973 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/BackwardRecordEmitter.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/BackwardRecordEmitter.java
@@ -3,6 +3,8 @@
import com.provectus.kafka.ui.model.TopicMessageEventDTO;
import com.provectus.kafka.ui.serde.RecordSerDe;
import com.provectus.kafka.ui.util.OffsetsSeekBackward;
+import java.time.Duration;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
@@ -12,9 +14,9 @@
import java.util.function.Function;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
+import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecord;
-import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.common.utils.Bytes;
@@ -25,6 +27,8 @@ public class BackwardRecordEmitter
extends AbstractEmitter
implements java.util.function.Consumer<FluxSink<TopicMessageEventDTO>> {
+ private static final Duration POLL_TIMEOUT = Duration.ofMillis(200);
+
private final Function<Map<String, Object>, KafkaConsumer<Bytes, Bytes>> consumerSupplier;
private final OffsetsSeekBackward offsetsSeek;
@@ -51,73 +55,88 @@ public void accept(FluxSink<TopicMessageEventDTO> sink) {
) {
sendPhase(sink, "Created consumer");
- SortedMap<TopicPartition, Long> partitionsOffsets =
+ SortedMap<TopicPartition, Long> readUntilOffsets =
new TreeMap<>(Comparator.comparingInt(TopicPartition::partition));
- partitionsOffsets.putAll(offsetsSeek.getPartitionsOffsets(consumer));
+ readUntilOffsets.putAll(offsetsSeek.getPartitionsOffsets(consumer));
sendPhase(sink, "Requested partitions offsets");
- log.debug("partition offsets: {}", partitionsOffsets);
+ log.debug("partition offsets: {}", readUntilOffsets);
var waitingOffsets =
- offsetsSeek.waitingOffsets(consumer, partitionsOffsets.keySet());
+ offsetsSeek.waitingOffsets(consumer, readUntilOffsets.keySet());
log.debug("waiting offsets {} {}",
waitingOffsets.getBeginOffsets(),
waitingOffsets.getEndOffsets()
);
while (!sink.isCancelled() && !waitingOffsets.beginReached()) {
- for (Map.Entry<TopicPartition, Long> entry : partitionsOffsets.entrySet()) {
- final Long lowest = waitingOffsets.getBeginOffsets().get(entry.getKey().partition());
- if (lowest != null) {
- consumer.assign(Collections.singleton(entry.getKey()));
- final long offset = Math.max(lowest, entry.getValue() - msgsPerPartition);
- log.debug("Polling {} from {}", entry.getKey(), offset);
- consumer.seek(entry.getKey(), offset);
- sendPhase(sink,
- String.format("Consuming partition: %s from %s", entry.getKey(), offset)
- );
- final ConsumerRecords<Bytes, Bytes> records = poll(sink, consumer);
- final List<ConsumerRecord<Bytes, Bytes>> partitionRecords =
- records.records(entry.getKey()).stream()
- .filter(r -> r.offset() < partitionsOffsets.get(entry.getKey()))
- .collect(Collectors.toList());
- Collections.reverse(partitionRecords);
-
- log.debug("{} records polled", records.count());
- log.debug("{} records sent", partitionRecords.size());
-
- // This is workaround for case when partition begin offset is less than
- // real minimal offset, usually appear in compcated topics
- if (records.count() > 0 && partitionRecords.isEmpty()) {
- waitingOffsets.markPolled(entry.getKey().partition());
- }
-
- for (ConsumerRecord<Bytes, Bytes> msg : partitionRecords) {
- if (!sink.isCancelled() && !waitingOffsets.beginReached()) {
- sendMessage(sink, msg);
- waitingOffsets.markPolled(msg);
- } else {
- log.info("Begin reached");
- break;
- }
- }
- partitionsOffsets.put(
- entry.getKey(),
- Math.max(offset, entry.getValue() - msgsPerPartition)
- );
+ new TreeMap<>(readUntilOffsets).forEach((tp, readToOffset) -> {
+ long lowestOffset = waitingOffsets.getBeginOffsets().get(tp.partition());
+ long readFromOffset = Math.max(lowestOffset, readToOffset - msgsPerPartition);
+
+ partitionPollIteration(tp, readFromOffset, readToOffset, consumer, sink)
+ .stream()
+ .filter(r -> !sink.isCancelled())
+ .forEach(r -> sendMessage(sink, r));
+
+ waitingOffsets.markPolled(tp.partition(), readFromOffset);
+ if (waitingOffsets.getBeginOffsets().get(tp.partition()) == null) {
+ // we fully read this partition -> removing it from polling iterations
+ readUntilOffsets.remove(tp);
+ } else {
+ readUntilOffsets.put(tp, readFromOffset);
}
- }
+ });
+
if (waitingOffsets.beginReached()) {
- log.info("begin reached after partitions");
+ log.debug("begin reached after partitions poll iteration");
} else if (sink.isCancelled()) {
- log.info("sink is cancelled after partitions");
+ log.debug("sink is cancelled after partitions poll iteration");
}
}
sink.complete();
- log.info("Polling finished");
+ log.debug("Polling finished");
}
} catch (Exception e) {
log.error("Error occurred while consuming records", e);
sink.error(e);
}
}
+
+
+ private List<ConsumerRecord<Bytes, Bytes>> partitionPollIteration(
+ TopicPartition tp,
+ long fromOffset,
+ long toOffset,
+ Consumer<Bytes, Bytes> consumer,
+ FluxSink<TopicMessageEventDTO> sink
+ ) {
+ consumer.assign(Collections.singleton(tp));
+ consumer.seek(tp, fromOffset);
+ sendPhase(sink, String.format("Polling partition: %s from offset %s", tp, fromOffset));
+ int desiredMsgsToPoll = (int) (toOffset - fromOffset);
+
+ var recordsToSend = new ArrayList<ConsumerRecord<Bytes, Bytes>>();
+
+ // we use empty polls counting to verify that partition was fully read
+ for (int emptyPolls = 0; recordsToSend.size() < desiredMsgsToPoll && emptyPolls < 3; ) {
+ var polledRecords = poll(sink, consumer, POLL_TIMEOUT);
+ log.debug("{} records polled from {}", polledRecords.count(), tp);
+
+ // counting sequential empty polls
+ emptyPolls = polledRecords.isEmpty() ? emptyPolls + 1 : 0;
+
+ var filteredRecords = polledRecords.records(tp).stream()
+ .filter(r -> r.offset() < toOffset)
+ .collect(Collectors.toList());
+
+ if (!polledRecords.isEmpty() && filteredRecords.isEmpty()) {
+ // we already read all messages in target offsets interval
+ break;
+ }
+ recordsToSend.addAll(filteredRecords);
+ }
+ log.debug("{} records to send", recordsToSend.size());
+ Collections.reverse(recordsToSend);
+ return recordsToSend;
+ }
}
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/OffsetsSeek.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/OffsetsSeek.java
index fa3ff78e028..0fd830b323d 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/OffsetsSeek.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/OffsetsSeek.java
@@ -111,27 +111,19 @@ public WaitingOffsets(String topic, Consumer<?, ?> consumer,
.collect(Collectors.toMap(Tuple2::getT1, Tuple2::getT2));
}
- public List<TopicPartition> topicPartitions() {
- return this.endOffsets.keySet().stream()
- .map(p -> new TopicPartition(topic, p))
- .collect(Collectors.toList());
- }
-
- public void markPolled(int partition) {
- endOffsets.remove(partition);
- beginOffsets.remove(partition);
+ public void markPolled(ConsumerRecord<?, ?> rec) {
+ markPolled(rec.partition(), rec.offset());
}
- public void markPolled(ConsumerRecord<?, ?> rec) {
- Long endWaiting = endOffsets.get(rec.partition());
- if (endWaiting != null && endWaiting <= rec.offset()) {
- endOffsets.remove(rec.partition());
+ public void markPolled(int partition, long offset) {
+ Long endWaiting = endOffsets.get(partition);
+ if (endWaiting != null && endWaiting <= offset) {
+ endOffsets.remove(partition);
}
- Long beginWaiting = beginOffsets.get(rec.partition());
- if (beginWaiting != null && beginWaiting >= rec.offset()) {
- beginOffsets.remove(rec.partition());
+ Long beginWaiting = beginOffsets.get(partition);
+ if (beginWaiting != null && beginWaiting >= offset) {
+ beginOffsets.remove(partition);
}
-
}
public boolean endReached() {
| null | train | train | 2022-05-19T13:44:26 | "2021-10-27T12:16:03Z" | iliax | train |
provectus/kafka-ui/1840_1934 | provectus/kafka-ui | provectus/kafka-ui/1840 | provectus/kafka-ui/1934 | [
"connected"
] | d1c59dd74bb8b41c4b7d95c5fa7e7db8f53292fb | 6891138f15e4b27c094f0c57eace3537e9dc6cd2 | [] | [] | "2022-05-08T09:01:07Z" | [
"type/bug",
"scope/backend",
"status/accepted",
"status/confirmed"
] | "Newest first" message scan is broken | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
"Newest first" message scan is broken. Some of the messages are not shown.
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
master version
**Steps to Reproduce**
Steps to reproduce the behavior:
1. get a topic with defined little amount of messages
2. enable newest first
3. paginate to the next page
4. some of the messages are not fetched
| [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/AbstractEmitter.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/BackwardRecordEmitter.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/OffsetsSeek.java"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/AbstractEmitter.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/BackwardRecordEmitter.java",
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/OffsetsSeek.java"
] | [] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/AbstractEmitter.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/AbstractEmitter.java
index 30a5f566d35..84228c41342 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/AbstractEmitter.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/AbstractEmitter.java
@@ -14,7 +14,7 @@
import reactor.core.publisher.FluxSink;
public abstract class AbstractEmitter {
- private static final Duration POLL_TIMEOUT_MS = Duration.ofMillis(1000L);
+ private static final Duration DEFAULT_POLL_TIMEOUT_MS = Duration.ofMillis(1000L);
private final RecordSerDe recordDeserializer;
private final ConsumingStats consumingStats = new ConsumingStats();
@@ -25,8 +25,13 @@ protected AbstractEmitter(RecordSerDe recordDeserializer) {
protected ConsumerRecords<Bytes, Bytes> poll(
FluxSink<TopicMessageEventDTO> sink, Consumer<Bytes, Bytes> consumer) {
+ return poll(sink, consumer, DEFAULT_POLL_TIMEOUT_MS);
+ }
+
+ protected ConsumerRecords<Bytes, Bytes> poll(
+ FluxSink<TopicMessageEventDTO> sink, Consumer<Bytes, Bytes> consumer, Duration timeout) {
Instant start = Instant.now();
- ConsumerRecords<Bytes, Bytes> records = consumer.poll(POLL_TIMEOUT_MS);
+ ConsumerRecords<Bytes, Bytes> records = consumer.poll(timeout);
Instant finish = Instant.now();
sendConsuming(sink, records, Duration.between(start, finish).toMillis());
return records;
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/BackwardRecordEmitter.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/BackwardRecordEmitter.java
index 302cb9879b9..ff29110c973 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/BackwardRecordEmitter.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/emitter/BackwardRecordEmitter.java
@@ -3,6 +3,8 @@
import com.provectus.kafka.ui.model.TopicMessageEventDTO;
import com.provectus.kafka.ui.serde.RecordSerDe;
import com.provectus.kafka.ui.util.OffsetsSeekBackward;
+import java.time.Duration;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
@@ -12,9 +14,9 @@
import java.util.function.Function;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
+import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecord;
-import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.common.utils.Bytes;
@@ -25,6 +27,8 @@ public class BackwardRecordEmitter
extends AbstractEmitter
implements java.util.function.Consumer<FluxSink<TopicMessageEventDTO>> {
+ private static final Duration POLL_TIMEOUT = Duration.ofMillis(200);
+
private final Function<Map<String, Object>, KafkaConsumer<Bytes, Bytes>> consumerSupplier;
private final OffsetsSeekBackward offsetsSeek;
@@ -51,73 +55,88 @@ public void accept(FluxSink<TopicMessageEventDTO> sink) {
) {
sendPhase(sink, "Created consumer");
- SortedMap<TopicPartition, Long> partitionsOffsets =
+ SortedMap<TopicPartition, Long> readUntilOffsets =
new TreeMap<>(Comparator.comparingInt(TopicPartition::partition));
- partitionsOffsets.putAll(offsetsSeek.getPartitionsOffsets(consumer));
+ readUntilOffsets.putAll(offsetsSeek.getPartitionsOffsets(consumer));
sendPhase(sink, "Requested partitions offsets");
- log.debug("partition offsets: {}", partitionsOffsets);
+ log.debug("partition offsets: {}", readUntilOffsets);
var waitingOffsets =
- offsetsSeek.waitingOffsets(consumer, partitionsOffsets.keySet());
+ offsetsSeek.waitingOffsets(consumer, readUntilOffsets.keySet());
log.debug("waiting offsets {} {}",
waitingOffsets.getBeginOffsets(),
waitingOffsets.getEndOffsets()
);
while (!sink.isCancelled() && !waitingOffsets.beginReached()) {
- for (Map.Entry<TopicPartition, Long> entry : partitionsOffsets.entrySet()) {
- final Long lowest = waitingOffsets.getBeginOffsets().get(entry.getKey().partition());
- if (lowest != null) {
- consumer.assign(Collections.singleton(entry.getKey()));
- final long offset = Math.max(lowest, entry.getValue() - msgsPerPartition);
- log.debug("Polling {} from {}", entry.getKey(), offset);
- consumer.seek(entry.getKey(), offset);
- sendPhase(sink,
- String.format("Consuming partition: %s from %s", entry.getKey(), offset)
- );
- final ConsumerRecords<Bytes, Bytes> records = poll(sink, consumer);
- final List<ConsumerRecord<Bytes, Bytes>> partitionRecords =
- records.records(entry.getKey()).stream()
- .filter(r -> r.offset() < partitionsOffsets.get(entry.getKey()))
- .collect(Collectors.toList());
- Collections.reverse(partitionRecords);
-
- log.debug("{} records polled", records.count());
- log.debug("{} records sent", partitionRecords.size());
-
- // This is workaround for case when partition begin offset is less than
- // real minimal offset, usually appear in compcated topics
- if (records.count() > 0 && partitionRecords.isEmpty()) {
- waitingOffsets.markPolled(entry.getKey().partition());
- }
-
- for (ConsumerRecord<Bytes, Bytes> msg : partitionRecords) {
- if (!sink.isCancelled() && !waitingOffsets.beginReached()) {
- sendMessage(sink, msg);
- waitingOffsets.markPolled(msg);
- } else {
- log.info("Begin reached");
- break;
- }
- }
- partitionsOffsets.put(
- entry.getKey(),
- Math.max(offset, entry.getValue() - msgsPerPartition)
- );
+ new TreeMap<>(readUntilOffsets).forEach((tp, readToOffset) -> {
+ long lowestOffset = waitingOffsets.getBeginOffsets().get(tp.partition());
+ long readFromOffset = Math.max(lowestOffset, readToOffset - msgsPerPartition);
+
+ partitionPollIteration(tp, readFromOffset, readToOffset, consumer, sink)
+ .stream()
+ .filter(r -> !sink.isCancelled())
+ .forEach(r -> sendMessage(sink, r));
+
+ waitingOffsets.markPolled(tp.partition(), readFromOffset);
+ if (waitingOffsets.getBeginOffsets().get(tp.partition()) == null) {
+ // we fully read this partition -> removing it from polling iterations
+ readUntilOffsets.remove(tp);
+ } else {
+ readUntilOffsets.put(tp, readFromOffset);
}
- }
+ });
+
if (waitingOffsets.beginReached()) {
- log.info("begin reached after partitions");
+ log.debug("begin reached after partitions poll iteration");
} else if (sink.isCancelled()) {
- log.info("sink is cancelled after partitions");
+ log.debug("sink is cancelled after partitions poll iteration");
}
}
sink.complete();
- log.info("Polling finished");
+ log.debug("Polling finished");
}
} catch (Exception e) {
log.error("Error occurred while consuming records", e);
sink.error(e);
}
}
+
+
+ private List<ConsumerRecord<Bytes, Bytes>> partitionPollIteration(
+ TopicPartition tp,
+ long fromOffset,
+ long toOffset,
+ Consumer<Bytes, Bytes> consumer,
+ FluxSink<TopicMessageEventDTO> sink
+ ) {
+ consumer.assign(Collections.singleton(tp));
+ consumer.seek(tp, fromOffset);
+ sendPhase(sink, String.format("Polling partition: %s from offset %s", tp, fromOffset));
+ int desiredMsgsToPoll = (int) (toOffset - fromOffset);
+
+ var recordsToSend = new ArrayList<ConsumerRecord<Bytes, Bytes>>();
+
+ // we use empty polls counting to verify that partition was fully read
+ for (int emptyPolls = 0; recordsToSend.size() < desiredMsgsToPoll && emptyPolls < 3; ) {
+ var polledRecords = poll(sink, consumer, POLL_TIMEOUT);
+ log.debug("{} records polled from {}", polledRecords.count(), tp);
+
+ // counting sequential empty polls
+ emptyPolls = polledRecords.isEmpty() ? emptyPolls + 1 : 0;
+
+ var filteredRecords = polledRecords.records(tp).stream()
+ .filter(r -> r.offset() < toOffset)
+ .collect(Collectors.toList());
+
+ if (!polledRecords.isEmpty() && filteredRecords.isEmpty()) {
+ // we already read all messages in target offsets interval
+ break;
+ }
+ recordsToSend.addAll(filteredRecords);
+ }
+ log.debug("{} records to send", recordsToSend.size());
+ Collections.reverse(recordsToSend);
+ return recordsToSend;
+ }
}
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/OffsetsSeek.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/OffsetsSeek.java
index fa3ff78e028..0fd830b323d 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/OffsetsSeek.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/OffsetsSeek.java
@@ -111,27 +111,19 @@ public WaitingOffsets(String topic, Consumer<?, ?> consumer,
.collect(Collectors.toMap(Tuple2::getT1, Tuple2::getT2));
}
- public List<TopicPartition> topicPartitions() {
- return this.endOffsets.keySet().stream()
- .map(p -> new TopicPartition(topic, p))
- .collect(Collectors.toList());
- }
-
- public void markPolled(int partition) {
- endOffsets.remove(partition);
- beginOffsets.remove(partition);
+ public void markPolled(ConsumerRecord<?, ?> rec) {
+ markPolled(rec.partition(), rec.offset());
}
- public void markPolled(ConsumerRecord<?, ?> rec) {
- Long endWaiting = endOffsets.get(rec.partition());
- if (endWaiting != null && endWaiting <= rec.offset()) {
- endOffsets.remove(rec.partition());
+ public void markPolled(int partition, long offset) {
+ Long endWaiting = endOffsets.get(partition);
+ if (endWaiting != null && endWaiting <= offset) {
+ endOffsets.remove(partition);
}
- Long beginWaiting = beginOffsets.get(rec.partition());
- if (beginWaiting != null && beginWaiting >= rec.offset()) {
- beginOffsets.remove(rec.partition());
+ Long beginWaiting = beginOffsets.get(partition);
+ if (beginWaiting != null && beginWaiting >= offset) {
+ beginOffsets.remove(partition);
}
-
}
public boolean endReached() {
| null | test | train | 2022-05-19T13:44:26 | "2022-04-15T16:20:16Z" | Haarolean | train |
provectus/kafka-ui/1865_1952 | provectus/kafka-ui | provectus/kafka-ui/1865 | provectus/kafka-ui/1952 | [
"connected"
] | 7eab325ac3bd1fdbde96639a6d337521c56d4318 | 18eadfca287f3a8004aedfa449f63a5d7e57fd27 | [
"\r\n\r\n\r\n5. multiline filters are also allowed:\r\n```\r\ndef name = value.name \r\ndef age = value.age\r\nname == 'iliax' && age == 30\r\n```\r\n"
] | [
"why are we rendering AddFilter in InfoModal spec instead of infoModal ?",
"Because I need to check the button works in AddFilter modal",
"fixed",
"you can write onClick={toggle}",
"this should have a more descriptive name",
"fixed",
"fixed"
] | "2022-05-11T11:22:27Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted"
] | Implement a tooltip with smart filters documentation | filter examples, etc. | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/AddFilter.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/AddFilter.spec.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/AddFilter.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/AddFilter.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/InfoModal.spec.tsx",
"kafka-ui-react-app/src/components/common/Icons/QuestionIcon.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/AddFilter.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/AddFilter.tsx
index 995e3d7666f..d877654e591 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/AddFilter.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/AddFilter.tsx
@@ -4,8 +4,11 @@ import { MessageFilters } from 'components/Topics/Topic/Details/Messages/Filters
import { FilterEdit } from 'components/Topics/Topic/Details/Messages/Filters/FilterModal';
import SavedFilters from 'components/Topics/Topic/Details/Messages/Filters/SavedFilters';
import SavedIcon from 'components/common/Icons/SavedIcon';
+import QuestionIcon from 'components/common/Icons/QuestionIcon';
+import useModal from 'lib/hooks/useModal';
import AddEditFilterContainer from './AddEditFilterContainer';
+import InfoModal from './InfoModal';
export interface FilterModalProps {
toggleIsOpen(): void;
@@ -32,6 +35,7 @@ const AddFilter: React.FC<FilterModalProps> = ({
}) => {
const [savedFilterState, setSavedFilterState] =
React.useState<boolean>(false);
+ const { isOpen, toggle } = useModal();
const onSubmit = React.useCallback(
async (values: AddMessageFilters) => {
@@ -52,7 +56,19 @@ const AddFilter: React.FC<FilterModalProps> = ({
);
return (
<>
- <S.FilterTitle>Add filter</S.FilterTitle>
+ <S.FilterTitle>
+ Add filter
+ <div>
+ <S.QuestionIconContainer
+ type="button"
+ aria-label="info"
+ onClick={toggle}
+ >
+ <QuestionIcon />
+ </S.QuestionIconContainer>
+ {isOpen && <InfoModal toggleIsOpen={toggle} />}
+ </div>
+ </S.FilterTitle>
{savedFilterState ? (
<SavedFilters
deleteFilter={deleteFilter}
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts
index 9977612a954..7bb48b37686 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts
@@ -102,6 +102,29 @@ export const ClearAll = styled.span`
cursor: pointer;
`;
+export const ButtonContainer = styled.div`
+ width: 100%;
+ display: flex;
+ justify-content: center;
+ margin-top: 20px;
+`;
+
+export const ListItem = styled.li`
+ font-size: 12px;
+ font-weight: 400;
+ margin-left: 20px;
+ line-height: 1.5;
+ color: ${({ theme }) => theme.table.td.color.normal};
+`;
+
+export const InfoParagraph = styled.p`
+ font-size: 12px;
+ font-weight: 400;
+ line-height: 1.5;
+ margin-bottom: 10px;
+ color: ${({ theme }) => theme.table.td.color.normal};
+`;
+
export const MessageFilterModal = styled.div`
height: auto;
width: 560px;
@@ -115,11 +138,34 @@ export const MessageFilterModal = styled.div`
z-index: 1;
`;
+export const InfoModal = styled.div`
+ height: auto;
+ width: 560px;
+ border-radius: 8px;
+ background: ${({ theme }) => theme.modal.backgroundColor};
+ position: absolute;
+ left: 25%;
+ border: 1px solid ${({ theme }) => theme.breadcrumb};
+ box-shadow: ${({ theme }) => theme.modal.shadow};
+ padding: 32px;
+ z-index: 1;
+`;
+
+export const QuestionIconContainer = styled.button`
+ cursor: pointer;
+ padding: 0;
+ background: none;
+ border: none;
+`;
+
export const FilterTitle = styled.h3`
line-height: 32px;
font-size: 20px;
margin-bottom: 40px;
position: relative;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
&:after {
content: '';
width: calc(100% + 32px);
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx
new file mode 100644
index 00000000000..d3036cd1372
--- /dev/null
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx
@@ -0,0 +1,60 @@
+import React from 'react';
+import * as S from 'components/Topics/Topic/Details/Messages/Filters/Filters.styled';
+import { Button } from 'components/common/Button/Button';
+
+export interface InfoModalProps {
+ toggleIsOpen(): void;
+}
+
+const InfoModal: React.FC<InfoModalProps> = ({ toggleIsOpen }) => {
+ return (
+ <S.InfoModal>
+ <S.InfoParagraph>
+ <b>Variables bound to groovy context:</b> partition, timestampMs,
+ keyAsText, valueAsText, header, key (json if possible), value (json if
+ possible).
+ </S.InfoParagraph>
+ <S.InfoParagraph>
+ <b>JSON parsing logic:</b>
+ </S.InfoParagraph>
+ <S.InfoParagraph>
+ Key and Value (if they can be parsed to JSON) they are bound as JSON
+ objects, otherwise bound as nulls.
+ </S.InfoParagraph>
+ <S.InfoParagraph>
+ <b>Sample filters:</b>
+ </S.InfoParagraph>
+ <ol aria-label="info-list">
+ <S.ListItem>
+ `keyAsText != null && keyAsText ~"([Gg])roovy"` - regex for
+ key as a string
+ </S.ListItem>
+ <S.ListItem>
+ `value.name == "iS.ListItemax" && value.age > 30` - in
+ case value is json
+ </S.ListItem>
+ <S.ListItem>
+ `value == null && valueAsText != null` - search for values that are
+ not nulls and are not json
+ </S.ListItem>
+ <S.ListItem>
+ `headers.sentBy == "some system" &&
+ headers["sentAt"] == "2020-01-01"`
+ </S.ListItem>
+ <S.ListItem>multiS.ListItemne filters are also allowed:</S.ListItem>
+ </ol>
+ <S.ButtonContainer>
+ <Button
+ buttonSize="M"
+ buttonType="secondary"
+ type="button"
+ onClick={toggleIsOpen}
+ >
+ Ok
+ </Button>
+ </S.ButtonContainer>
+ </S.InfoModal>
+ );
+};
+
+export default InfoModal;
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/AddFilter.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/AddFilter.spec.tsx
index 6e659de446b..4569c81e649 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/AddFilter.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/AddFilter.spec.tsx
@@ -36,6 +36,18 @@ describe('AddFilter component', () => {
expect(screen.getAllByRole('savedFilter')).toHaveLength(2);
});
+ it('info button to be in the document', () => {
+ renderComponent();
+ expect(screen.getByRole('button', { name: 'info' })).toBeInTheDocument();
+ });
+
+ it('renders InfoModal', () => {
+ renderComponent();
+ userEvent.click(screen.getByRole('button', { name: 'info' }));
+ expect(screen.getByRole('button', { name: 'Ok' })).toBeInTheDocument();
+ expect(screen.getByRole('list', { name: 'info-list' })).toBeInTheDocument();
+ });
+
it('should test click on return to custom filter redirects to Add filters', async () => {
renderComponent();
userEvent.click(screen.getByRole('savedFilterText'));
@@ -159,7 +171,7 @@ describe('AddFilter component', () => {
it('OnSubmit condition with checkbox on functionality', async () => {
await act(() => {
userEvent.click(screen.getByRole('checkbox'));
- userEvent.click(screen.getAllByRole('button')[1]);
+ userEvent.click(screen.getAllByRole('button')[2]);
});
expect(activeFilterHandlerMock).not.toHaveBeenCalled();
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/InfoModal.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/InfoModal.spec.tsx
new file mode 100644
index 00000000000..1721c489151
--- /dev/null
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/__tests__/InfoModal.spec.tsx
@@ -0,0 +1,14 @@
+import userEvent from '@testing-library/user-event';
+import { screen } from '@testing-library/react';
+import { render } from 'lib/testHelpers';
+import React from 'react';
+import InfoModal from 'components/Topics/Topic/Details/Messages/Filters/InfoModal';
+
+describe('InfoModal component', () => {
+ it('closes InfoModal', () => {
+ const toggleInfoModal = jest.fn();
+ render(<InfoModal toggleIsOpen={toggleInfoModal} />);
+ userEvent.click(screen.getByRole('button', { name: 'Ok' }));
+ expect(toggleInfoModal).toHaveBeenCalledTimes(1);
+ });
+});
diff --git a/kafka-ui-react-app/src/components/common/Icons/QuestionIcon.tsx b/kafka-ui-react-app/src/components/common/Icons/QuestionIcon.tsx
new file mode 100644
index 00000000000..11490b100df
--- /dev/null
+++ b/kafka-ui-react-app/src/components/common/Icons/QuestionIcon.tsx
@@ -0,0 +1,23 @@
+import React from 'react';
+import { useTheme } from 'styled-components';
+
+const QuestionIcon: React.FC = () => {
+ const theme = useTheme();
+ return (
+ <svg
+ width="19"
+ height="19"
+ viewBox="0 0 19 19"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <circle cx="9.5" cy="9.5" r="8.5" stroke="#5C5CF6" strokeWidth="2" />
+ <path
+ d="M8.31818 11.2727V11.0682C8.31818 10.5994 8.35511 10.2259 8.42898 9.94744C8.50284 9.66903 8.61222 9.44602 8.7571 9.27841C8.90199 9.10795 9.07955 8.95455 9.28977 8.81818C9.47159 8.69886 9.63352 8.58381 9.77557 8.47301C9.92045 8.36222 10.0341 8.24432 10.1165 8.11932C10.2017 7.99432 10.2443 7.85227 10.2443 7.69318C10.2443 7.55114 10.2102 7.42614 10.142 7.31818C10.0739 7.21023 9.98153 7.12642 9.86506 7.06676C9.74858 7.0071 9.61932 6.97727 9.47727 6.97727C9.32386 6.97727 9.18182 7.01278 9.05114 7.08381C8.9233 7.15483 8.8196 7.25284 8.74006 7.37784C8.66335 7.50284 8.625 7.64773 8.625 7.8125H6.44318C6.44886 7.1875 6.59091 6.6804 6.86932 6.29119C7.14773 5.89915 7.51705 5.61222 7.97727 5.4304C8.4375 5.24574 8.94318 5.15341 9.49432 5.15341C10.1023 5.15341 10.6449 5.2429 11.1222 5.42188C11.5994 5.59801 11.9759 5.86506 12.2514 6.22301C12.527 6.57812 12.6648 7.02273 12.6648 7.55682C12.6648 7.90057 12.6051 8.20312 12.4858 8.46449C12.3693 8.72301 12.206 8.9517 11.9957 9.15057C11.7884 9.34659 11.5455 9.52557 11.267 9.6875C11.0625 9.80682 10.8906 9.9304 10.7514 10.0582C10.6122 10.1832 10.5071 10.3267 10.4361 10.4886C10.3651 10.6477 10.3295 10.8409 10.3295 11.0682V11.2727H8.31818ZM9.35795 14.1364C9.02841 14.1364 8.74574 14.0213 8.50994 13.7912C8.27699 13.5582 8.16193 13.2756 8.16477 12.9432C8.16193 12.6193 8.27699 12.3423 8.50994 12.1122C8.74574 11.8821 9.02841 11.767 9.35795 11.767C9.67045 11.767 9.94602 11.8821 10.1847 12.1122C10.4261 12.3423 10.5483 12.6193 10.5511 12.9432C10.5483 13.1648 10.4901 13.3665 10.3764 13.5483C10.2656 13.7273 10.1207 13.8707 9.94176 13.9787C9.76278 14.0838 9.56818 14.1364 9.35795 14.1364Z"
+ fill={theme.icons.savedIcon}
+ />
+ </svg>
+ );
+};
+
+export default QuestionIcon;
| null | train | train | 2022-05-17T12:04:59 | "2022-04-20T09:22:45Z" | Haarolean | train |
provectus/kafka-ui/1938_1959 | provectus/kafka-ui | provectus/kafka-ui/1938 | provectus/kafka-ui/1959 | [
"connected"
] | 527df864bb8b6d016b787f0472834a76f848c833 | 7958e2a9b54c4c41cce64334bcc76d673277eac7 | [
"PS: thanks for working on this project, it is the best UI for looking at Kafka cluster data I've seen so far.",
"Hey Alex, thanks for the feedback, glad you like the new release :)\r\n\r\nWe'll take a look into the problem. We've done a lot of frontend refactoring recently, so this might be the reason."
] | [] | "2022-05-12T10:04:41Z" | [
"type/bug",
"scope/frontend",
"status/accepted"
] | Dashboard table is messed up | **Describe the bug**
When many clusters are defined in configuration, the dashboard looks messed up:
- multiple tables instead of 1
- cluster ordering is out-of-order (that was fixed earlier for left side list)
- columns are not aligned
**Set up**
- Docker-compose with configuration set via environment variables (v0.4.0 tag from Docker Hub)
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Add 10+ clusters to the list
2. Look at the dashboard
**Expected behavior**
Dashboard looks clean (single table, columns aligned, clusters ordered same as in configuration)
**Screenshots**

**Additional context**
- Screenshot cannot show ordering issue due to needing to mask cluster names for privacy
| [
"kafka-ui-react-app/src/components/Dashboard/ClustersWidget/ClustersWidget.tsx"
] | [
"kafka-ui-react-app/src/components/Dashboard/ClustersWidget/ClustersWidget.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Dashboard/ClustersWidget/ClustersWidget.tsx b/kafka-ui-react-app/src/components/Dashboard/ClustersWidget/ClustersWidget.tsx
index f33e9c4746e..e921609c1a4 100644
--- a/kafka-ui-react-app/src/components/Dashboard/ClustersWidget/ClustersWidget.tsx
+++ b/kafka-ui-react-app/src/components/Dashboard/ClustersWidget/ClustersWidget.tsx
@@ -84,7 +84,7 @@ const ClustersWidget: React.FC<Props> = ({
<tbody>
{chunkItem.data.map((cluster) => (
<tr key={cluster.name}>
- <S.TableCell maxWidth="99px">
+ <S.TableCell maxWidth="99px" width="350">
{cluster.readOnly && <Tag color="blue">readonly</Tag>}{' '}
{cluster.name}
</S.TableCell>
| null | val | train | 2022-05-16T16:03:32 | "2022-05-10T04:05:59Z" | akamensky | train |
provectus/kafka-ui/1960_1964 | provectus/kafka-ui | provectus/kafka-ui/1960 | provectus/kafka-ui/1964 | [
"connected"
] | 06864984a1bb68674b4c73e2bb3346a8bd9e547d | 20300f327d7a9cf3d616d2bfd01cec8300278001 | [] | [
"you can write isFetching: !!isFetching",
"fixed"
] | "2022-05-13T08:32:39Z" | [
"type/bug",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | Loading icon is still being displayed once the live mode is stopped | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/MessagesTable.spec.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/MessagesTable.spec.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
index a4128acd8d7..7a0cb748f30 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
@@ -229,7 +229,6 @@ const Filters: React.FC<FiltersProps> = ({
const handleSSECancel = () => {
if (!source.current) return;
-
setIsFetching(false);
source.current.close();
};
@@ -304,7 +303,6 @@ const Filters: React.FC<FiltersProps> = ({
sse.onmessage = ({ data }) => {
const { type, message, phase, consuming }: TopicMessageEvent =
JSON.parse(data);
-
switch (type) {
case TopicMessageEventTypeEnum.MESSAGE:
if (message) {
@@ -317,7 +315,6 @@ const Filters: React.FC<FiltersProps> = ({
case TopicMessageEventTypeEnum.PHASE:
if (phase?.name) {
updatePhase(phase.name);
- setIsFetching(false);
}
break;
case TopicMessageEventTypeEnum.CONSUMING:
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx
index cca9e1e85ae..6a3d1d5e45d 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/MessagesTable.tsx
@@ -96,7 +96,7 @@ const MessagesTable: React.FC = () => {
message={message}
/>
))}
- {(isFetching || isLive) && !messages.length && (
+ {isFetching && isLive && !messages.length && (
<tr>
<td colSpan={10}>
<PageLoader />
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/MessagesTable.spec.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/MessagesTable.spec.tsx
index e176e8e7b5e..351a55f5f03 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/MessagesTable.spec.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/__test__/MessagesTable.spec.tsx
@@ -31,6 +31,7 @@ describe('MessagesTable', () => {
params: URLSearchParams = searchParams,
ctx: ContextProps = contextValue,
messages: TopicMessage[] = [],
+ isFetching?: boolean,
customHistory?: MemoryHistory
) => {
const history =
@@ -51,7 +52,7 @@ describe('MessagesTable', () => {
meta: {
...topicMessagesMetaPayload,
},
- isFetching: false,
+ isFetching: !!isFetching,
},
},
}
@@ -86,7 +87,7 @@ describe('MessagesTable', () => {
});
it('should check the display of the loader element', () => {
- setUpComponent(searchParams, { ...contextValue, isLive: true });
+ setUpComponent(searchParams, { ...contextValue, isLive: true }, [], true);
expect(screen.getByRole('progressbar')).toBeInTheDocument();
});
@@ -98,7 +99,7 @@ describe('MessagesTable', () => {
});
jest.spyOn(mockedHistory, 'push');
- setUpComponent(customSearchParam, contextValue, [], mockedHistory);
+ setUpComponent(customSearchParam, contextValue, [], false, mockedHistory);
userEvent.click(screen.getByRole('button', { name: 'Next' }));
expect(mockedHistory.push).toHaveBeenCalledWith({
@@ -120,6 +121,7 @@ describe('MessagesTable', () => {
customSearchParam,
{ ...contextValue, searchParams: customSearchParam },
[],
+ false,
mockedHistory
);
| null | val | train | 2022-05-17T11:04:01 | "2022-05-12T10:23:52Z" | Haarolean | train |
|
provectus/kafka-ui/1980_1985 | provectus/kafka-ui | provectus/kafka-ui/1980 | provectus/kafka-ui/1985 | [
"connected"
] | 26e84ff185f9346cf3a61d5a6295e5409abe6e32 | 06864984a1bb68674b4c73e2bb3346a8bd9e547d | [
"\r\nLower one looks weird"
] | [] | "2022-05-16T15:40:11Z" | [
"good first issue",
"scope/frontend",
"status/accepted",
"type/chore"
] | Indicators CSS adjustments | Wrapped panes should inherit first & last child css (border-radius)
<img width="1242" alt="bruh" src="https://user-images.githubusercontent.com/1494347/168567644-39c32c0a-5acf-4e1e-9d70-2a535bf60ad9.png">
| [
"kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx"
] | [
"kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx b/kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx
index 33e8265526e..7a3bb44dbe2 100644
--- a/kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx
+++ b/kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx
@@ -38,27 +38,8 @@ export const IndicatorsWrapper = styled.div`
display: flex;
gap: 1px;
flex-wrap: wrap;
-
- > ${IndicatorWrapper} {
- &:first-child {
- border-top-left-radius: 8px;
- border-bottom-left-radius: 8px;
- }
-
- &:last-child {
- border-top-right-radius: 8px;
- border-bottom-right-radius: 8px;
- }
- }
-
- @media screen and (max-width: 1023px) {
- > ${IndicatorWrapper} {
- &:first-child,
- &:last-child {
- border-radius: 0;
- }
- }
- }
+ border-radius: 8px;
+ overflow: auto;
`;
export const SectionTitle = styled.h5`
| null | train | train | 2022-05-16T22:49:57 | "2022-05-16T09:57:24Z" | Haarolean | train |
provectus/kafka-ui/1865_1989 | provectus/kafka-ui | provectus/kafka-ui/1865 | provectus/kafka-ui/1989 | [
"connected"
] | 3321460185c863f010ceffb1c38fa6084cba0290 | ca545ddf36e056d8a549a9056a0879ae84f8f4ef | [
"\r\n\r\n\r\n5. multiline filters are also allowed:\r\n```\r\ndef name = value.name \r\ndef age = value.age\r\nname == 'iliax' && age == 30\r\n```\r\n"
] | [] | "2022-05-17T14:00:35Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted"
] | Implement a tooltip with smart filters documentation | filter examples, etc. | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx
index d3036cd1372..b86b8776063 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx
@@ -41,7 +41,18 @@ const InfoModal: React.FC<InfoModalProps> = ({ toggleIsOpen }) => {
`headers.sentBy == "some system" &&
headers["sentAt"] == "2020-01-01"`
</S.ListItem>
- <S.ListItem>multiS.ListItemne filters are also allowed:</S.ListItem>
+ <S.ListItem>multiline filters are also allowed:</S.ListItem>
+ <S.InfoParagraph>
+ ```
+ <br />
+ def name = value.name
+ <br />
+ def age = value.age
+ <br />
+ name == "iliax" && age == 30
+ <br />
+ ```
+ </S.InfoParagraph>
</ol>
<S.ButtonContainer>
<Button
| null | test | train | 2022-05-18T09:35:16 | "2022-04-20T09:22:45Z" | Haarolean | train |
provectus/kafka-ui/1809_1999 | provectus/kafka-ui | provectus/kafka-ui/1809 | provectus/kafka-ui/1999 | [
"connected"
] | 6d8c6cace09f98bd9b386634390500f233b38a37 | ad2966f31b5acf04ee485902bb01980a946ddadc | [
"Hey, thanks for the suggestion!"
] | [
"It is a work of selector",
"sortedTopics is array. no need to use `?`",
"and here we can put it in a variable and reuse it for array , in order not to call it everytime",
"moved to redux",
"fixed",
"```return connector.topics?.sort((a, b) => a.localeCompare(b))```",
"As far as I remember, localeCompare is a very slow operation and should only be used for strings containing non-latin characters. ",
"why we need typing here?",
"fixed",
"```diff\r\n- return connector.topics?.length\r\n- ? [...connector.topics].sort()\r\n- : connector.topics;\r\n+ return connector.topics?.sort((a, b) => a.localeCompare(b))\r\n```",
"removed",
"fixed"
] | "2022-05-19T11:03:37Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted"
] | UI: connectors , order topics |

### Is your proposal related to a problem?
the current UI of connectors show the topics that consume or produce the connectors , but they are not ordered by name , that mean if I it refresh the order of the topics change
and also two connectors with the same topics can show the topics in a different order
### Describe the solution you'd like
topics by each connector sort by name in the UI
### Describe alternatives you've considered
### Additional context
Thanks :+1:
| [
"kafka-ui-react-app/src/components/Connect/List/ListContainer.ts",
"kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx",
"kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts",
"kafka-ui-react-app/src/redux/reducers/connect/selectors.ts"
] | [
"kafka-ui-react-app/src/components/Connect/List/ListContainer.ts",
"kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx",
"kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts",
"kafka-ui-react-app/src/redux/reducers/connect/selectors.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts b/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts
index c3e939a2db2..dbd7a717716 100644
--- a/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts
+++ b/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts
@@ -12,6 +12,7 @@ import {
getAreConnectorsFetching,
getConnectorSearch,
getFailedConnectors,
+ getSortedTopics,
getFailedTasks,
} from 'redux/reducers/connect/selectors';
import List from 'components/Connect/List/List';
@@ -21,6 +22,7 @@ const mapStateToProps = (state: RootState) => ({
areConnectorsFetching: getAreConnectorsFetching(state),
connects: getConnects(state),
failedConnectors: getFailedConnectors(state),
+ sortedTopics: getSortedTopics(state),
failedTasks: getFailedTasks(state),
connectors: getConnectors(state),
search: getConnectorSearch(state),
diff --git a/kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx b/kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx
index 0956b9ff697..6ecc8a5f186 100644
--- a/kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx
+++ b/kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx
@@ -52,6 +52,14 @@ describe('Connectors ListItem', () => {
expect(screen.getAllByRole('cell')[6]).toHaveTextContent('2 of 2');
});
+ it('topics tags are sorted', () => {
+ render(setupWrapper());
+ const getLink = screen.getAllByRole('link');
+ expect(getLink[1]).toHaveTextContent('a');
+ expect(getLink[2]).toHaveTextContent('b');
+ expect(getLink[3]).toHaveTextContent('c');
+ });
+
it('renders item with failed tasks', () => {
render(
setupWrapper({
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts
index 7bb48b37686..8ca07c71a34 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts
@@ -125,6 +125,16 @@ export const InfoParagraph = styled.p`
color: ${({ theme }) => theme.table.td.color.normal};
`;
+export const InfoCodeSample = styled.pre`
+ background: #f5f5f5;
+ padding: 5px;
+ border: 1px solid #e1e1e1;
+ border-radius: 5px;
+ width: fit-content;
+ margin: 5px 20px;
+ color: #cc0f35;
+`;
+
export const MessageFilterModal = styled.div`
height: auto;
width: 560px;
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx
index b86b8776063..91a4e5a4637 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx
@@ -26,32 +26,37 @@ const InfoModal: React.FC<InfoModalProps> = ({ toggleIsOpen }) => {
</S.InfoParagraph>
<ol aria-label="info-list">
<S.ListItem>
- `keyAsText != null && keyAsText ~"([Gg])roovy"` - regex for
- key as a string
+ <code>keyAsText != null && keyAsText ~"([Gg])roovy"</code> -
+ regex for key as a string
</S.ListItem>
<S.ListItem>
- `value.name == "iS.ListItemax" && value.age > 30` - in
- case value is json
+ <code>
+ value.name == "iS.ListItemax" && value.age > 30
+ </code>{' '}
+ - in case value is json
</S.ListItem>
<S.ListItem>
- `value == null && valueAsText != null` - search for values that are
- not nulls and are not json
+ <code>value == null && valueAsText != null</code> - search for values
+ that are not nulls and are not json
</S.ListItem>
<S.ListItem>
- `headers.sentBy == "some system" &&
- headers["sentAt"] == "2020-01-01"`
+ <code>
+ headers.sentBy == "some system" &&
+ headers["sentAt"] == "2020-01-01"
+ </code>
</S.ListItem>
<S.ListItem>multiline filters are also allowed:</S.ListItem>
<S.InfoParagraph>
- ```
- <br />
- def name = value.name
- <br />
- def age = value.age
- <br />
- name == "iliax" && age == 30
- <br />
- ```
+ <S.InfoCodeSample>
+ <code>
+ def name = value.name
+ <br />
+ def age = value.age
+ <br />
+ name == "iliax" && age == 30
+ <br />
+ </code>
+ </S.InfoCodeSample>
</S.InfoParagraph>
</ol>
<S.ButtonContainer>
diff --git a/kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx b/kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx
index 7a3bb44dbe2..9924c5ba13c 100644
--- a/kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx
+++ b/kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx
@@ -21,7 +21,6 @@ export const IndicatorWrapper = styled.div`
align-items: flex-start;
padding: 12px 16px;
box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.08);
- margin: 0 0 3px 0;
flex-grow: 1;
`;
@@ -36,10 +35,11 @@ export const IndicatorTitle = styled.div`
export const IndicatorsWrapper = styled.div`
display: flex;
- gap: 1px;
+ gap: 2px;
flex-wrap: wrap;
border-radius: 8px;
overflow: auto;
+ box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.08);
`;
export const SectionTitle = styled.h5`
diff --git a/kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts b/kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts
index 2ef1248acfe..5fc7cad55df 100644
--- a/kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts
+++ b/kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts
@@ -19,7 +19,7 @@ export const connectorsServerPayload = [
name: 'hdfs-source-connector',
connector_class: 'FileStreamSource',
type: ConnectorType.SOURCE,
- topics: ['test-topic'],
+ topics: ['a', 'b', 'c'],
status: {
state: ConnectorTaskStatus.RUNNING,
workerId: 1,
@@ -48,7 +48,7 @@ export const connectors: FullConnectorInfo[] = [
name: 'hdfs-source-connector',
connectorClass: 'FileStreamSource',
type: ConnectorType.SOURCE,
- topics: ['test-topic'],
+ topics: ['a', 'b', 'c'],
status: {
state: ConnectorState.RUNNING,
},
@@ -75,7 +75,7 @@ export const failedConnectors: FullConnectorInfo[] = [
name: 'hdfs-source-connector',
connectorClass: 'FileStreamSource',
type: ConnectorType.SOURCE,
- topics: ['test-topic'],
+ topics: ['a', 'b', 'c'],
status: {
state: ConnectorState.FAILED,
},
@@ -87,7 +87,7 @@ export const failedConnectors: FullConnectorInfo[] = [
name: 'hdfs2-source-connector',
connectorClass: 'FileStreamSource',
type: ConnectorType.SINK,
- topics: ['test-topic'],
+ topics: ['a', 'b', 'c'],
status: {
state: ConnectorState.FAILED,
},
diff --git a/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts b/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts
index 0ca9e2fdd0b..a1f71626856 100644
--- a/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts
+++ b/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts
@@ -83,6 +83,17 @@ describe('Connect selectors', () => {
expect(selectors.getFailedTasks(store.getState())).toEqual(1);
});
+ it('returns sorted topics', () => {
+ store.dispatch({
+ type: fetchConnectors.fulfilled.type,
+ payload: { connectors },
+ });
+ const sortedTopics = selectors.getSortedTopics(store.getState());
+ if (sortedTopics[0] && sortedTopics[0].length > 1) {
+ expect(sortedTopics[0]).toEqual(['a', 'b', 'c']);
+ }
+ });
+
it('returns connector', () => {
store.dispatch({
type: fetchConnector.fulfilled.type,
diff --git a/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts b/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts
index 2e029a7f9e9..c11f7ac2e80 100644
--- a/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts
+++ b/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts
@@ -6,6 +6,7 @@ import {
ConnectorState,
FullConnectorInfo,
} from 'generated-sources';
+import { sortBy } from 'lodash';
import {
deleteConnector,
@@ -63,6 +64,10 @@ export const getFailedTasks = createSelector(connectState, ({ connectors }) => {
.reduce((acc: number, value: number) => acc + value, 0);
});
+export const getSortedTopics = createSelector(connectState, ({ connectors }) =>
+ connectors.map(({ topics }) => sortBy(topics || []))
+);
+
const getConnectorFetchingStatus = createFetchingSelector(
fetchConnector.typePrefix
);
| null | train | train | 2022-05-25T12:54:33 | "2022-04-06T17:17:51Z" | raphaelauv | train |
provectus/kafka-ui/1980_1999 | provectus/kafka-ui | provectus/kafka-ui/1980 | provectus/kafka-ui/1999 | [
"connected"
] | 6d8c6cace09f98bd9b386634390500f233b38a37 | ad2966f31b5acf04ee485902bb01980a946ddadc | [
"\r\nLower one looks weird"
] | [
"It is a work of selector",
"sortedTopics is array. no need to use `?`",
"and here we can put it in a variable and reuse it for array , in order not to call it everytime",
"moved to redux",
"fixed",
"```return connector.topics?.sort((a, b) => a.localeCompare(b))```",
"As far as I remember, localeCompare is a very slow operation and should only be used for strings containing non-latin characters. ",
"why we need typing here?",
"fixed",
"```diff\r\n- return connector.topics?.length\r\n- ? [...connector.topics].sort()\r\n- : connector.topics;\r\n+ return connector.topics?.sort((a, b) => a.localeCompare(b))\r\n```",
"removed",
"fixed"
] | "2022-05-19T11:03:37Z" | [
"good first issue",
"scope/frontend",
"status/accepted",
"type/chore"
] | Indicators CSS adjustments | Wrapped panes should inherit first & last child css (border-radius)
<img width="1242" alt="bruh" src="https://user-images.githubusercontent.com/1494347/168567644-39c32c0a-5acf-4e1e-9d70-2a535bf60ad9.png">
| [
"kafka-ui-react-app/src/components/Connect/List/ListContainer.ts",
"kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx",
"kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts",
"kafka-ui-react-app/src/redux/reducers/connect/selectors.ts"
] | [
"kafka-ui-react-app/src/components/Connect/List/ListContainer.ts",
"kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx",
"kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts",
"kafka-ui-react-app/src/redux/reducers/connect/selectors.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts b/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts
index c3e939a2db2..dbd7a717716 100644
--- a/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts
+++ b/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts
@@ -12,6 +12,7 @@ import {
getAreConnectorsFetching,
getConnectorSearch,
getFailedConnectors,
+ getSortedTopics,
getFailedTasks,
} from 'redux/reducers/connect/selectors';
import List from 'components/Connect/List/List';
@@ -21,6 +22,7 @@ const mapStateToProps = (state: RootState) => ({
areConnectorsFetching: getAreConnectorsFetching(state),
connects: getConnects(state),
failedConnectors: getFailedConnectors(state),
+ sortedTopics: getSortedTopics(state),
failedTasks: getFailedTasks(state),
connectors: getConnectors(state),
search: getConnectorSearch(state),
diff --git a/kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx b/kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx
index 0956b9ff697..6ecc8a5f186 100644
--- a/kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx
+++ b/kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx
@@ -52,6 +52,14 @@ describe('Connectors ListItem', () => {
expect(screen.getAllByRole('cell')[6]).toHaveTextContent('2 of 2');
});
+ it('topics tags are sorted', () => {
+ render(setupWrapper());
+ const getLink = screen.getAllByRole('link');
+ expect(getLink[1]).toHaveTextContent('a');
+ expect(getLink[2]).toHaveTextContent('b');
+ expect(getLink[3]).toHaveTextContent('c');
+ });
+
it('renders item with failed tasks', () => {
render(
setupWrapper({
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts
index 7bb48b37686..8ca07c71a34 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts
@@ -125,6 +125,16 @@ export const InfoParagraph = styled.p`
color: ${({ theme }) => theme.table.td.color.normal};
`;
+export const InfoCodeSample = styled.pre`
+ background: #f5f5f5;
+ padding: 5px;
+ border: 1px solid #e1e1e1;
+ border-radius: 5px;
+ width: fit-content;
+ margin: 5px 20px;
+ color: #cc0f35;
+`;
+
export const MessageFilterModal = styled.div`
height: auto;
width: 560px;
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx
index b86b8776063..91a4e5a4637 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx
@@ -26,32 +26,37 @@ const InfoModal: React.FC<InfoModalProps> = ({ toggleIsOpen }) => {
</S.InfoParagraph>
<ol aria-label="info-list">
<S.ListItem>
- `keyAsText != null && keyAsText ~"([Gg])roovy"` - regex for
- key as a string
+ <code>keyAsText != null && keyAsText ~"([Gg])roovy"</code> -
+ regex for key as a string
</S.ListItem>
<S.ListItem>
- `value.name == "iS.ListItemax" && value.age > 30` - in
- case value is json
+ <code>
+ value.name == "iS.ListItemax" && value.age > 30
+ </code>{' '}
+ - in case value is json
</S.ListItem>
<S.ListItem>
- `value == null && valueAsText != null` - search for values that are
- not nulls and are not json
+ <code>value == null && valueAsText != null</code> - search for values
+ that are not nulls and are not json
</S.ListItem>
<S.ListItem>
- `headers.sentBy == "some system" &&
- headers["sentAt"] == "2020-01-01"`
+ <code>
+ headers.sentBy == "some system" &&
+ headers["sentAt"] == "2020-01-01"
+ </code>
</S.ListItem>
<S.ListItem>multiline filters are also allowed:</S.ListItem>
<S.InfoParagraph>
- ```
- <br />
- def name = value.name
- <br />
- def age = value.age
- <br />
- name == "iliax" && age == 30
- <br />
- ```
+ <S.InfoCodeSample>
+ <code>
+ def name = value.name
+ <br />
+ def age = value.age
+ <br />
+ name == "iliax" && age == 30
+ <br />
+ </code>
+ </S.InfoCodeSample>
</S.InfoParagraph>
</ol>
<S.ButtonContainer>
diff --git a/kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx b/kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx
index 7a3bb44dbe2..9924c5ba13c 100644
--- a/kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx
+++ b/kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx
@@ -21,7 +21,6 @@ export const IndicatorWrapper = styled.div`
align-items: flex-start;
padding: 12px 16px;
box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.08);
- margin: 0 0 3px 0;
flex-grow: 1;
`;
@@ -36,10 +35,11 @@ export const IndicatorTitle = styled.div`
export const IndicatorsWrapper = styled.div`
display: flex;
- gap: 1px;
+ gap: 2px;
flex-wrap: wrap;
border-radius: 8px;
overflow: auto;
+ box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.08);
`;
export const SectionTitle = styled.h5`
diff --git a/kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts b/kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts
index 2ef1248acfe..5fc7cad55df 100644
--- a/kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts
+++ b/kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts
@@ -19,7 +19,7 @@ export const connectorsServerPayload = [
name: 'hdfs-source-connector',
connector_class: 'FileStreamSource',
type: ConnectorType.SOURCE,
- topics: ['test-topic'],
+ topics: ['a', 'b', 'c'],
status: {
state: ConnectorTaskStatus.RUNNING,
workerId: 1,
@@ -48,7 +48,7 @@ export const connectors: FullConnectorInfo[] = [
name: 'hdfs-source-connector',
connectorClass: 'FileStreamSource',
type: ConnectorType.SOURCE,
- topics: ['test-topic'],
+ topics: ['a', 'b', 'c'],
status: {
state: ConnectorState.RUNNING,
},
@@ -75,7 +75,7 @@ export const failedConnectors: FullConnectorInfo[] = [
name: 'hdfs-source-connector',
connectorClass: 'FileStreamSource',
type: ConnectorType.SOURCE,
- topics: ['test-topic'],
+ topics: ['a', 'b', 'c'],
status: {
state: ConnectorState.FAILED,
},
@@ -87,7 +87,7 @@ export const failedConnectors: FullConnectorInfo[] = [
name: 'hdfs2-source-connector',
connectorClass: 'FileStreamSource',
type: ConnectorType.SINK,
- topics: ['test-topic'],
+ topics: ['a', 'b', 'c'],
status: {
state: ConnectorState.FAILED,
},
diff --git a/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts b/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts
index 0ca9e2fdd0b..a1f71626856 100644
--- a/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts
+++ b/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts
@@ -83,6 +83,17 @@ describe('Connect selectors', () => {
expect(selectors.getFailedTasks(store.getState())).toEqual(1);
});
+ it('returns sorted topics', () => {
+ store.dispatch({
+ type: fetchConnectors.fulfilled.type,
+ payload: { connectors },
+ });
+ const sortedTopics = selectors.getSortedTopics(store.getState());
+ if (sortedTopics[0] && sortedTopics[0].length > 1) {
+ expect(sortedTopics[0]).toEqual(['a', 'b', 'c']);
+ }
+ });
+
it('returns connector', () => {
store.dispatch({
type: fetchConnector.fulfilled.type,
diff --git a/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts b/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts
index 2e029a7f9e9..c11f7ac2e80 100644
--- a/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts
+++ b/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts
@@ -6,6 +6,7 @@ import {
ConnectorState,
FullConnectorInfo,
} from 'generated-sources';
+import { sortBy } from 'lodash';
import {
deleteConnector,
@@ -63,6 +64,10 @@ export const getFailedTasks = createSelector(connectState, ({ connectors }) => {
.reduce((acc: number, value: number) => acc + value, 0);
});
+export const getSortedTopics = createSelector(connectState, ({ connectors }) =>
+ connectors.map(({ topics }) => sortBy(topics || []))
+);
+
const getConnectorFetchingStatus = createFetchingSelector(
fetchConnector.typePrefix
);
| null | test | train | 2022-05-25T12:54:33 | "2022-05-16T09:57:24Z" | Haarolean | train |
provectus/kafka-ui/1865_1999 | provectus/kafka-ui | provectus/kafka-ui/1865 | provectus/kafka-ui/1999 | [
"connected"
] | 6d8c6cace09f98bd9b386634390500f233b38a37 | ad2966f31b5acf04ee485902bb01980a946ddadc | [
"\r\n\r\n\r\n5. multiline filters are also allowed:\r\n```\r\ndef name = value.name \r\ndef age = value.age\r\nname == 'iliax' && age == 30\r\n```\r\n"
] | [
"It is a work of selector",
"sortedTopics is array. no need to use `?`",
"and here we can put it in a variable and reuse it for array , in order not to call it everytime",
"moved to redux",
"fixed",
"```return connector.topics?.sort((a, b) => a.localeCompare(b))```",
"As far as I remember, localeCompare is a very slow operation and should only be used for strings containing non-latin characters. ",
"why we need typing here?",
"fixed",
"```diff\r\n- return connector.topics?.length\r\n- ? [...connector.topics].sort()\r\n- : connector.topics;\r\n+ return connector.topics?.sort((a, b) => a.localeCompare(b))\r\n```",
"removed",
"fixed"
] | "2022-05-19T11:03:37Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted"
] | Implement a tooltip with smart filters documentation | filter examples, etc. | [
"kafka-ui-react-app/src/components/Connect/List/ListContainer.ts",
"kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx",
"kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts",
"kafka-ui-react-app/src/redux/reducers/connect/selectors.ts"
] | [
"kafka-ui-react-app/src/components/Connect/List/ListContainer.ts",
"kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts",
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx",
"kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts",
"kafka-ui-react-app/src/redux/reducers/connect/selectors.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts b/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts
index c3e939a2db2..dbd7a717716 100644
--- a/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts
+++ b/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts
@@ -12,6 +12,7 @@ import {
getAreConnectorsFetching,
getConnectorSearch,
getFailedConnectors,
+ getSortedTopics,
getFailedTasks,
} from 'redux/reducers/connect/selectors';
import List from 'components/Connect/List/List';
@@ -21,6 +22,7 @@ const mapStateToProps = (state: RootState) => ({
areConnectorsFetching: getAreConnectorsFetching(state),
connects: getConnects(state),
failedConnectors: getFailedConnectors(state),
+ sortedTopics: getSortedTopics(state),
failedTasks: getFailedTasks(state),
connectors: getConnectors(state),
search: getConnectorSearch(state),
diff --git a/kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx b/kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx
index 0956b9ff697..6ecc8a5f186 100644
--- a/kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx
+++ b/kafka-ui-react-app/src/components/Connect/List/__tests__/ListItem.spec.tsx
@@ -52,6 +52,14 @@ describe('Connectors ListItem', () => {
expect(screen.getAllByRole('cell')[6]).toHaveTextContent('2 of 2');
});
+ it('topics tags are sorted', () => {
+ render(setupWrapper());
+ const getLink = screen.getAllByRole('link');
+ expect(getLink[1]).toHaveTextContent('a');
+ expect(getLink[2]).toHaveTextContent('b');
+ expect(getLink[3]).toHaveTextContent('c');
+ });
+
it('renders item with failed tasks', () => {
render(
setupWrapper({
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts
index 7bb48b37686..8ca07c71a34 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.styled.ts
@@ -125,6 +125,16 @@ export const InfoParagraph = styled.p`
color: ${({ theme }) => theme.table.td.color.normal};
`;
+export const InfoCodeSample = styled.pre`
+ background: #f5f5f5;
+ padding: 5px;
+ border: 1px solid #e1e1e1;
+ border-radius: 5px;
+ width: fit-content;
+ margin: 5px 20px;
+ color: #cc0f35;
+`;
+
export const MessageFilterModal = styled.div`
height: auto;
width: 560px;
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx
index b86b8776063..91a4e5a4637 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/InfoModal.tsx
@@ -26,32 +26,37 @@ const InfoModal: React.FC<InfoModalProps> = ({ toggleIsOpen }) => {
</S.InfoParagraph>
<ol aria-label="info-list">
<S.ListItem>
- `keyAsText != null && keyAsText ~"([Gg])roovy"` - regex for
- key as a string
+ <code>keyAsText != null && keyAsText ~"([Gg])roovy"</code> -
+ regex for key as a string
</S.ListItem>
<S.ListItem>
- `value.name == "iS.ListItemax" && value.age > 30` - in
- case value is json
+ <code>
+ value.name == "iS.ListItemax" && value.age > 30
+ </code>{' '}
+ - in case value is json
</S.ListItem>
<S.ListItem>
- `value == null && valueAsText != null` - search for values that are
- not nulls and are not json
+ <code>value == null && valueAsText != null</code> - search for values
+ that are not nulls and are not json
</S.ListItem>
<S.ListItem>
- `headers.sentBy == "some system" &&
- headers["sentAt"] == "2020-01-01"`
+ <code>
+ headers.sentBy == "some system" &&
+ headers["sentAt"] == "2020-01-01"
+ </code>
</S.ListItem>
<S.ListItem>multiline filters are also allowed:</S.ListItem>
<S.InfoParagraph>
- ```
- <br />
- def name = value.name
- <br />
- def age = value.age
- <br />
- name == "iliax" && age == 30
- <br />
- ```
+ <S.InfoCodeSample>
+ <code>
+ def name = value.name
+ <br />
+ def age = value.age
+ <br />
+ name == "iliax" && age == 30
+ <br />
+ </code>
+ </S.InfoCodeSample>
</S.InfoParagraph>
</ol>
<S.ButtonContainer>
diff --git a/kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx b/kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx
index 7a3bb44dbe2..9924c5ba13c 100644
--- a/kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx
+++ b/kafka-ui-react-app/src/components/common/Metrics/Metrics.styled.tsx
@@ -21,7 +21,6 @@ export const IndicatorWrapper = styled.div`
align-items: flex-start;
padding: 12px 16px;
box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.08);
- margin: 0 0 3px 0;
flex-grow: 1;
`;
@@ -36,10 +35,11 @@ export const IndicatorTitle = styled.div`
export const IndicatorsWrapper = styled.div`
display: flex;
- gap: 1px;
+ gap: 2px;
flex-wrap: wrap;
border-radius: 8px;
overflow: auto;
+ box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.08);
`;
export const SectionTitle = styled.h5`
diff --git a/kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts b/kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts
index 2ef1248acfe..5fc7cad55df 100644
--- a/kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts
+++ b/kafka-ui-react-app/src/redux/reducers/connect/__test__/fixtures.ts
@@ -19,7 +19,7 @@ export const connectorsServerPayload = [
name: 'hdfs-source-connector',
connector_class: 'FileStreamSource',
type: ConnectorType.SOURCE,
- topics: ['test-topic'],
+ topics: ['a', 'b', 'c'],
status: {
state: ConnectorTaskStatus.RUNNING,
workerId: 1,
@@ -48,7 +48,7 @@ export const connectors: FullConnectorInfo[] = [
name: 'hdfs-source-connector',
connectorClass: 'FileStreamSource',
type: ConnectorType.SOURCE,
- topics: ['test-topic'],
+ topics: ['a', 'b', 'c'],
status: {
state: ConnectorState.RUNNING,
},
@@ -75,7 +75,7 @@ export const failedConnectors: FullConnectorInfo[] = [
name: 'hdfs-source-connector',
connectorClass: 'FileStreamSource',
type: ConnectorType.SOURCE,
- topics: ['test-topic'],
+ topics: ['a', 'b', 'c'],
status: {
state: ConnectorState.FAILED,
},
@@ -87,7 +87,7 @@ export const failedConnectors: FullConnectorInfo[] = [
name: 'hdfs2-source-connector',
connectorClass: 'FileStreamSource',
type: ConnectorType.SINK,
- topics: ['test-topic'],
+ topics: ['a', 'b', 'c'],
status: {
state: ConnectorState.FAILED,
},
diff --git a/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts b/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts
index 0ca9e2fdd0b..a1f71626856 100644
--- a/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts
+++ b/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts
@@ -83,6 +83,17 @@ describe('Connect selectors', () => {
expect(selectors.getFailedTasks(store.getState())).toEqual(1);
});
+ it('returns sorted topics', () => {
+ store.dispatch({
+ type: fetchConnectors.fulfilled.type,
+ payload: { connectors },
+ });
+ const sortedTopics = selectors.getSortedTopics(store.getState());
+ if (sortedTopics[0] && sortedTopics[0].length > 1) {
+ expect(sortedTopics[0]).toEqual(['a', 'b', 'c']);
+ }
+ });
+
it('returns connector', () => {
store.dispatch({
type: fetchConnector.fulfilled.type,
diff --git a/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts b/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts
index 2e029a7f9e9..c11f7ac2e80 100644
--- a/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts
+++ b/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts
@@ -6,6 +6,7 @@ import {
ConnectorState,
FullConnectorInfo,
} from 'generated-sources';
+import { sortBy } from 'lodash';
import {
deleteConnector,
@@ -63,6 +64,10 @@ export const getFailedTasks = createSelector(connectState, ({ connectors }) => {
.reduce((acc: number, value: number) => acc + value, 0);
});
+export const getSortedTopics = createSelector(connectState, ({ connectors }) =>
+ connectors.map(({ topics }) => sortBy(topics || []))
+);
+
const getConnectorFetchingStatus = createFetchingSelector(
fetchConnector.typePrefix
);
| null | val | train | 2022-05-25T12:54:33 | "2022-04-20T09:22:45Z" | Haarolean | train |
provectus/kafka-ui/1334_2002 | provectus/kafka-ui | provectus/kafka-ui/1334 | provectus/kafka-ui/2002 | [
"connected"
] | 6891138f15e4b27c094f0c57eace3537e9dc6cd2 | 3ee2f87255d2a4beacfb177c4a6bdd9f52fd6a09 | [
"@lazzy-panda let's rename \"failed\" to \"failed connectors\" and add a \"failed tasks\" pane as well\r\n\r\n"
] | [
"```suggestion\r\n .reduce(acc, value) => {\r\n```"
] | "2022-05-20T15:13:59Z" | [
"type/enhancement",
"good first issue",
"scope/frontend",
"status/accepted"
] | Please add a counters of all connectors, tasks and failed connectors, tasks | ### Is your proposal related to a problem?
KC can have a very large number of connectors. It can be very tedious and error prone to scroll through the list in search of any failed tasks/connectors. It would be easy to miss any failed connector/task as well.
### Describe the solution you'd like
Ideally -- a filter for the list to only show connectors that have failed tasks. But good starting point would be at least to show a counter of total connectors/tasks and counter of failed connectors/tasks.
### Describe alternatives you've considered
N/A
### Additional context
N/A
| [
"kafka-ui-react-app/src/components/Connect/List/List.tsx",
"kafka-ui-react-app/src/components/Connect/List/ListContainer.ts",
"kafka-ui-react-app/src/components/Connect/List/__tests__/List.spec.tsx",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts",
"kafka-ui-react-app/src/redux/reducers/connect/selectors.ts"
] | [
"kafka-ui-react-app/src/components/Connect/List/List.tsx",
"kafka-ui-react-app/src/components/Connect/List/ListContainer.ts",
"kafka-ui-react-app/src/components/Connect/List/__tests__/List.spec.tsx",
"kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts",
"kafka-ui-react-app/src/redux/reducers/connect/selectors.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/Connect/List/List.tsx b/kafka-ui-react-app/src/components/Connect/List/List.tsx
index 1958ac200a2..0f1ab074b0c 100644
--- a/kafka-ui-react-app/src/components/Connect/List/List.tsx
+++ b/kafka-ui-react-app/src/components/Connect/List/List.tsx
@@ -21,6 +21,7 @@ export interface ListProps {
connectors: FullConnectorInfo[];
connects: Connect[];
failedConnectors: FullConnectorInfo[];
+ failedTasks: number | undefined;
fetchConnects(clusterName: ClusterName): void;
fetchConnectors({ clusterName }: { clusterName: ClusterName }): void;
search: string;
@@ -32,6 +33,7 @@ const List: React.FC<ListProps> = ({
areConnectsFetching,
areConnectorsFetching,
failedConnectors,
+ failedTasks,
fetchConnects,
fetchConnectors,
search,
@@ -75,12 +77,19 @@ const List: React.FC<ListProps> = ({
{connectors.length}
</Metrics.Indicator>
<Metrics.Indicator
- label="Failed"
+ label="Failed Connectors"
title="Failed Connectors"
fetching={areConnectsFetching}
>
{failedConnectors?.length}
</Metrics.Indicator>
+ <Metrics.Indicator
+ label="Failed Tasks"
+ title="Failed Tasks"
+ fetching={areConnectsFetching}
+ >
+ {failedTasks}
+ </Metrics.Indicator>
</Metrics.Section>
</Metrics.Wrapper>
<ControlPanelWrapper hasInput>
diff --git a/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts b/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts
index b1180738b48..c3e939a2db2 100644
--- a/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts
+++ b/kafka-ui-react-app/src/components/Connect/List/ListContainer.ts
@@ -12,6 +12,7 @@ import {
getAreConnectorsFetching,
getConnectorSearch,
getFailedConnectors,
+ getFailedTasks,
} from 'redux/reducers/connect/selectors';
import List from 'components/Connect/List/List';
@@ -20,6 +21,7 @@ const mapStateToProps = (state: RootState) => ({
areConnectorsFetching: getAreConnectorsFetching(state),
connects: getConnects(state),
failedConnectors: getFailedConnectors(state),
+ failedTasks: getFailedTasks(state),
connectors: getConnectors(state),
search: getConnectorSearch(state),
});
diff --git a/kafka-ui-react-app/src/components/Connect/List/__tests__/List.spec.tsx b/kafka-ui-react-app/src/components/Connect/List/__tests__/List.spec.tsx
index a1edf8ce47b..bb8fb3cfa67 100644
--- a/kafka-ui-react-app/src/components/Connect/List/__tests__/List.spec.tsx
+++ b/kafka-ui-react-app/src/components/Connect/List/__tests__/List.spec.tsx
@@ -37,6 +37,7 @@ describe('Connectors List', () => {
areConnectsFetching
connectors={[]}
failedConnectors={[]}
+ failedTasks={0}
connects={[]}
fetchConnects={fetchConnects}
fetchConnectors={fetchConnectors}
diff --git a/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts b/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts
index bf1d5e946f9..0ca9e2fdd0b 100644
--- a/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts
+++ b/kafka-ui-react-app/src/redux/reducers/connect/__test__/selectors.spec.ts
@@ -20,6 +20,7 @@ describe('Connect selectors', () => {
);
expect(selectors.getConnectors(store.getState())).toEqual([]);
expect(selectors.getFailedConnectors(store.getState())).toEqual([]);
+ expect(selectors.getFailedTasks(store.getState())).toEqual(0);
expect(selectors.getIsConnectorFetching(store.getState())).toEqual(false);
expect(selectors.getConnector(store.getState())).toEqual(null);
expect(selectors.getConnectorStatus(store.getState())).toEqual(undefined);
@@ -74,6 +75,14 @@ describe('Connect selectors', () => {
expect(selectors.getFailedConnectors(store.getState()).length).toEqual(1);
});
+ it('returns failed tasks', () => {
+ store.dispatch({
+ type: fetchConnectors.fulfilled.type,
+ payload: { connectors },
+ });
+ expect(selectors.getFailedTasks(store.getState())).toEqual(1);
+ });
+
it('returns connector', () => {
store.dispatch({
type: fetchConnector.fulfilled.type,
diff --git a/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts b/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts
index 107bc843ab5..2e029a7f9e9 100644
--- a/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts
+++ b/kafka-ui-react-app/src/redux/reducers/connect/selectors.ts
@@ -1,7 +1,11 @@
import { createSelector } from '@reduxjs/toolkit';
import { ConnectState, RootState } from 'redux/interfaces';
import { createFetchingSelector } from 'redux/reducers/loader/selectors';
-import { ConnectorTaskStatus, ConnectorState } from 'generated-sources';
+import {
+ ConnectorTaskStatus,
+ ConnectorState,
+ FullConnectorInfo,
+} from 'generated-sources';
import {
deleteConnector,
@@ -47,11 +51,18 @@ export const getFailedConnectors = createSelector(
connectState,
({ connectors }) => {
return connectors.filter(
- (connector) => connector.status.state === ConnectorState.FAILED
+ (connector: FullConnectorInfo) =>
+ connector.status.state === ConnectorState.FAILED
);
}
);
+export const getFailedTasks = createSelector(connectState, ({ connectors }) => {
+ return connectors
+ .map((connector: FullConnectorInfo) => connector.failedTasksCount || 0)
+ .reduce((acc: number, value: number) => acc + value, 0);
+});
+
const getConnectorFetchingStatus = createFetchingSelector(
fetchConnector.typePrefix
);
| null | train | train | 2022-05-19T17:34:04 | "2021-12-29T02:38:32Z" | akamensky | train |
provectus/kafka-ui/1764_2017 | provectus/kafka-ui | provectus/kafka-ui/1764 | provectus/kafka-ui/2017 | [
"timestamp(timedelta=0.0, similarity=0.8630186139426761)",
"connected"
] | ad2966f31b5acf04ee485902bb01980a946ddadc | ab805c39c5ff29b337384e1d280c474913362195 | [
"Hey, thanks for the kind words. Glad you like it :)\r\n\r\nAs for the tables, we've considered that (#1414), but there are some possible issues with that (like behaviour for sandwich buttons). I agree that it would be more convenient, but it's not a priority for now. But we'll consider it, thanks."
] | [
"cursor: pointer ?",
"fixed"
] | "2022-05-23T11:57:41Z" | [
"type/enhancement",
"scope/frontend",
"status/accepted"
] | Expand message view on row click | Hi,
At first I would like to admit your app is so far the best Kafka's UI I've tried!
I'd like to kindly ask you to improve message view, where click on any place on a message's row would open extended view of that message. Currently, only left plus button could expand message's details.
Please consider and let me know what you're thinking about such improvement.
Best regards! | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Message.tsx",
"kafka-ui-react-app/src/components/common/Dropdown/Dropdown.tsx",
"kafka-ui-react-app/src/components/common/Dropdown/DropdownItem.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Message.tsx",
"kafka-ui-react-app/src/components/common/Dropdown/Dropdown.tsx",
"kafka-ui-react-app/src/components/common/Dropdown/DropdownItem.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Message.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Message.tsx
index 265b1f4a729..a111ed14524 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Message.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Message.tsx
@@ -20,6 +20,10 @@ const StyledDataCell = styled.td`
min-width: 350px;
`;
+const ClickableRow = styled.tr`
+ cursor: pointer;
+`;
+
export interface Props {
message: TopicMessage;
}
@@ -49,12 +53,13 @@ const Message: React.FC<Props> = ({
return (
<>
- <tr
+ <ClickableRow
onMouseEnter={() => setVEllipsisOpen(true)}
onMouseLeave={() => setVEllipsisOpen(false)}
+ onClick={toggleIsOpen}
>
<td>
- <IconButtonWrapper onClick={toggleIsOpen} aria-hidden>
+ <IconButtonWrapper aria-hidden>
<MessageToggleIcon isOpen={isOpen} />
</IconButtonWrapper>
</td>
@@ -79,7 +84,7 @@ const Message: React.FC<Props> = ({
</Dropdown>
)}
</td>
- </tr>
+ </ClickableRow>
{isOpen && (
<MessageContent
messageKey={key}
diff --git a/kafka-ui-react-app/src/components/common/Dropdown/Dropdown.tsx b/kafka-ui-react-app/src/components/common/Dropdown/Dropdown.tsx
index e9523b5acfc..e8a51499b4d 100644
--- a/kafka-ui-react-app/src/components/common/Dropdown/Dropdown.tsx
+++ b/kafka-ui-react-app/src/components/common/Dropdown/Dropdown.tsx
@@ -23,7 +23,13 @@ const Dropdown: React.FC<PropsWithChildren<DropdownProps>> = ({
}) => {
const [active, setActive] = useState<boolean>(false);
const [wrapperRef] = useOutsideClickRef(() => setActive(false));
- const onClick = useCallback(() => setActive(!active), [active]);
+ const onClick = useCallback(
+ (e: React.MouseEvent) => {
+ e.stopPropagation();
+ setActive(!active);
+ },
+ [active]
+ );
const classNames = useMemo(
() =>
diff --git a/kafka-ui-react-app/src/components/common/Dropdown/DropdownItem.tsx b/kafka-ui-react-app/src/components/common/Dropdown/DropdownItem.tsx
index 04a5fe2cc6d..ccfa5222668 100644
--- a/kafka-ui-react-app/src/components/common/Dropdown/DropdownItem.tsx
+++ b/kafka-ui-react-app/src/components/common/Dropdown/DropdownItem.tsx
@@ -14,6 +14,7 @@ const DropdownItem: React.FC<PropsWithChildren<DropdownItemProps>> = ({
}) => {
const onClickHandler = (e: React.MouseEvent) => {
e.preventDefault();
+ e.stopPropagation();
onClick();
};
| null | test | train | 2022-05-25T13:33:05 | "2022-03-25T12:46:12Z" | mario45211 | train |
provectus/kafka-ui/1998_2019 | provectus/kafka-ui | provectus/kafka-ui/1998 | provectus/kafka-ui/2019 | [
"connected",
"timestamp(timedelta=0.0, similarity=0.9999999999999998)"
] | f294b1bbad4cc93f07a685f63cad9e71f02eb8a3 | 2fcb0d1abef83189fbd1cf26167baad3074f1ac4 | [
"Hello there keremcankabadayi! π\n\nThank you and congratulations π for opening your very first issue in this project! π\n\nIn case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. π",
"Hi, it's not an issue with the app, but a docker-network related one.\r\nif you're planning to run it on your local machine, you can try docker's `host` network mode.\r\nhttps://docs.docker.com/compose/compose-file/compose-file-v3/#network_mode\r\nFeel free to leave a reply if the problem persists, either here or on discord.\r\n",
"I think thats not the problem cause i also tried with `jar` without docker. results and logs were same.\r\n\r\n```\r\nexport KAFKA_CLUSTERS_0_NAME= Stage\r\nexport KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS= 10.2.20.143:9092\r\njava -jar kafka-ui-api-v0.4.0.jar\r\n```\r\n\r\nIts kind of connection problem.",
"Okay then, you should've mentioned it beforehand :)\r\n\r\nPlease share the full log when you run it as a jar file. The one you provided is just a little bit of it.",
"**Set up**\r\n```\r\nexport KAFKA_CLUSTERS_0_NAME=Stage\r\nexport KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=10.2.20.143:9092\r\njava -jar kafka-ui-api-v0.4.0.jar\r\n```\r\n\r\n**Steps to Reproduce**\r\n1. Run with above commands.\r\n2. Check logs\r\n\r\n\r\n```\r\n _ _ ___ __ _ _ _ __ __ _\r\n| | | |_ _| / _|___ _ _ /_\\ _ __ __ _ __| |_ ___ | |/ /__ _ / _| |_____\r\n| |_| || | | _/ _ | '_| / _ \\| '_ / _` / _| ' \\/ -_) | ' </ _` | _| / / _`|\r\n \\___/|___| |_| \\___|_| /_/ \\_| .__\\__,_\\__|_||_\\___| |_|\\_\\__,_|_| |_\\_\\__,|\r\n |_| \r\n2022-05-20 13:11:01,833 INFO [background-preinit] o.h.v.i.u.Version: HV000001: Hibernate Validator 6.2.0.Final\r\n2022-05-20 13:11:01,857 INFO [main] c.p.k.u.KafkaUiApplication: Starting KafkaUiApplication using Java 13.0.11 on C02FV4V3MD6R with PID 21758 (/Users/keremcan.kabadayi/Downloads/kafka-ui-api-v0.4.0.jar started by keremcan.kabadayi in /Users/keremcan.kabadayi/Downloads)\r\n2022-05-20 13:11:01,858 DEBUG [main] c.p.k.u.KafkaUiApplication: Running with Spring Boot v2.6.3, Spring v5.3.15\r\n2022-05-20 13:11:01,858 INFO [main] c.p.k.u.KafkaUiApplication: No active profile set, falling back to default profiles: default\r\n2022-05-20 13:11:03,165 INFO [main] o.s.d.r.c.RepositoryConfigurationDelegate: Bootstrapping Spring Data LDAP repositories in DEFAULT mode.\r\n2022-05-20 13:11:03,211 INFO [main] o.s.d.r.c.RepositoryConfigurationDelegate: Finished Spring Data repository scanning in 37 ms. Found 0 LDAP repository interfaces.\r\n2022-05-20 13:11:03,843 INFO [main] c.p.k.u.s.DeserializationService: Using SimpleRecordSerDe for cluster 'Stage'\r\n2022-05-20 13:11:04,547 INFO [main] o.s.b.a.e.w.EndpointLinksResolver: Exposing 2 endpoint(s) beneath base path '/actuator'\r\n2022-05-20 13:11:04,716 INFO [main] o.s.b.a.s.r.ReactiveUserDetailsServiceAutoConfiguration: \r\n\r\nUsing generated security password: bda90694-ace1-4553-ad51-6ffc9dc66db5\r\n\r\n2022-05-20 13:11:04,817 WARN [main] c.p.k.u.c.a.DisabledAuthSecurityConfig: Authentication is disabled. Access will be unrestricted.\r\n2022-05-20 13:11:05,009 INFO [main] o.s.l.c.s.AbstractContextSource: Property 'userDn' not set - anonymous context will be used for read-write operations\r\n2022-05-20 13:11:05,310 INFO [main] o.s.b.w.e.n.NettyWebServer: Netty started on port 8080\r\n2022-05-20 13:11:05,326 INFO [main] c.p.k.u.KafkaUiApplication: Started KafkaUiApplication in 4.326 seconds (JVM running for 5.173)\r\n2022-05-20 13:11:05,350 DEBUG [parallel-1] c.p.k.u.s.ClustersMetricsScheduler: Start getting metrics for kafkaCluster: Stage\r\n2022-05-20 13:11:05,362 INFO [parallel-1] o.a.k.c.a.AdminClientConfig: AdminClientConfig values: \r\n bootstrap.servers = [10.2.20.143:9092]\r\n client.dns.lookup = use_all_dns_ips\r\n client.id = \r\n connections.max.idle.ms = 300000\r\n default.api.timeout.ms = 60000\r\n metadata.max.age.ms = 300000\r\n metric.reporters = []\r\n metrics.num.samples = 2\r\n metrics.recording.level = INFO\r\n metrics.sample.window.ms = 30000\r\n receive.buffer.bytes = 65536\r\n reconnect.backoff.max.ms = 1000\r\n reconnect.backoff.ms = 50\r\n request.timeout.ms = 30000\r\n retries = 2147483647\r\n retry.backoff.ms = 100\r\n sasl.client.callback.handler.class = null\r\n sasl.jaas.config = null\r\n sasl.kerberos.kinit.cmd = /usr/bin/kinit\r\n sasl.kerberos.min.time.before.relogin = 60000\r\n sasl.kerberos.service.name = null\r\n sasl.kerberos.ticket.renew.jitter = 0.05\r\n sasl.kerberos.ticket.renew.window.factor = 0.8\r\n sasl.login.callback.handler.class = null\r\n sasl.login.class = null\r\n sasl.login.refresh.buffer.seconds = 300\r\n sasl.login.refresh.min.period.seconds = 60\r\n sasl.login.refresh.window.factor = 0.8\r\n sasl.login.refresh.window.jitter = 0.05\r\n sasl.mechanism = GSSAPI\r\n security.protocol = PLAINTEXT\r\n security.providers = null\r\n send.buffer.bytes = 131072\r\n socket.connection.setup.timeout.max.ms = 30000\r\n socket.connection.setup.timeout.ms = 10000\r\n ssl.cipher.suites = null\r\n ssl.enabled.protocols = [TLSv1.2, TLSv1.3]\r\n ssl.endpoint.identification.algorithm = https\r\n ssl.engine.factory.class = null\r\n ssl.key.password = null\r\n ssl.keymanager.algorithm = SunX509\r\n ssl.keystore.certificate.chain = null\r\n ssl.keystore.key = null\r\n ssl.keystore.location = null\r\n ssl.keystore.password = null\r\n ssl.keystore.type = JKS\r\n ssl.protocol = TLSv1.3\r\n ssl.provider = null\r\n ssl.secure.random.implementation = null\r\n ssl.trustmanager.algorithm = PKIX\r\n ssl.truststore.certificates = null\r\n ssl.truststore.location = null\r\n ssl.truststore.password = null\r\n ssl.truststore.type = JKS\r\n\r\n2022-05-20 13:11:05,433 INFO [parallel-1] o.a.k.c.u.AppInfoParser: Kafka version: 2.8.0\r\n2022-05-20 13:11:05,433 INFO [parallel-1] o.a.k.c.u.AppInfoParser: Kafka commitId: ebb1d6e21cc92130\r\n2022-05-20 13:11:05,433 INFO [parallel-1] o.a.k.c.u.AppInfoParser: Kafka startTimeMs: 1653041465431\r\n2022-05-20 13:12:08,873 ERROR [parallel-1] c.p.k.u.s.MetricsService: Failed to collect cluster Stage info\r\norg.apache.kafka.common.errors.TimeoutException: Call(callName=describeConfigs, deadlineMs=1653041528867, tries=2, nextAllowedTryMs=1653041528968) timed out at 1653041528868 after 2 attempt(s)\r\nCaused by: org.apache.kafka.common.errors.DisconnectException: Cancelled describeConfigs request with correlation id 31 due to node 6 being disconnected\r\n2022-05-20 13:12:08,873 DEBUG [parallel-1] c.p.k.u.s.ClustersMetricsScheduler: Metrics updated for cluster: Stage\r\n2022-05-20 13:12:08,883 DEBUG [parallel-14] c.p.k.u.s.ClustersMetricsScheduler: Start getting metrics for kafkaCluster: Stage\r\n2022-05-20 13:13:11,933 ERROR [parallel-14] c.p.k.u.s.MetricsService: Failed to collect cluster Stage info\r\norg.apache.kafka.common.errors.TimeoutException: Call(callName=describeConfigs, deadlineMs=1653041591780, tries=1, nextAllowedTryMs=1653041592031) timed out at 1653041591931 after 1 attempt(s)\r\nCaused by: org.apache.kafka.common.errors.DisconnectException: Cancelled describeConfigs request with correlation id 51 due to node 4 being disconnected\r\n2022-05-20 13:13:11,934 DEBUG [parallel-14] c.p.k.u.s.ClustersMetricsScheduler: Metrics updated for cluster: Stage\r\n2022-05-20 13:13:11,938 DEBUG [parallel-9] c.p.k.u.s.ClustersMetricsScheduler: Start getting metrics for kafkaCluster: Stage\r\n```\r\n\r\n**Additional context**\r\n\r\n- I need to connect VPN for this Stage Kafka. I can connect with 3rd party apps i mentioned above `Conduktor`, `Kafka CLI` and [Kouncil](https://github.com/Consdata/kouncil)\r\n- I can ping ip `10.2.20.143`\r\n\r\nThanks for your attention. ",
"@keremcankabadayi thanks. Do you run this kouncil tool as a docker container as well?",
"Yes, running docker container now.\r\n\r\n```\r\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES\r\n7080f97d3117 consdata/kouncil:latest \"java -Djava.securitβ¦\" 39 hours ago Up 39 hours 0.0.0.0:8099->8080/tcp kouncil\r\n```\r\n\r\n\r\n",
"@keremcankabadayi can you ping/traceroute kafka's IP from within kafka-ui container? via `docker exec -it kafka-ui sh`",
"@Haarolean here logs\r\n```\r\nβ apps docker exec -it kafka-ui sh\r\n/ $ ping 10.2.20.143\r\nPING 10.2.20.143 (10.2.20.143): 56 data bytes\r\n64 bytes from 10.2.20.143: seq=0 ttl=42 time=57.378 ms\r\n64 bytes from 10.2.20.143: seq=1 ttl=42 time=58.189 ms\r\n64 bytes from 10.2.20.143: seq=2 ttl=42 time=66.688 ms\r\n64 bytes from 10.2.20.143: seq=3 ttl=42 time=54.729 ms\r\n64 bytes from 10.2.20.143: seq=4 ttl=42 time=54.852 ms\r\n64 bytes from 10.2.20.143: seq=5 ttl=42 time=104.845 ms\r\n64 bytes from 10.2.20.143: seq=6 ttl=42 time=154.781 ms\r\n64 bytes from 10.2.20.143: seq=7 ttl=42 time=100.420 ms\r\n64 bytes from 10.2.20.143: seq=8 ttl=42 time=105.424 ms\r\n64 bytes from 10.2.20.143: seq=9 ttl=42 time=107.621 ms\r\n64 bytes from 10.2.20.143: seq=10 ttl=42 time=63.469 ms\r\n64 bytes from 10.2.20.143: seq=11 ttl=42 time=95.412 ms\r\n64 bytes from 10.2.20.143: seq=12 ttl=42 time=95.873 ms\r\n64 bytes from 10.2.20.143: seq=13 ttl=42 time=56.913 ms\r\n64 bytes from 10.2.20.143: seq=14 ttl=42 time=49.255 ms\r\n64 bytes from 10.2.20.143: seq=15 ttl=42 time=73.346 ms\r\n64 bytes from 10.2.20.143: seq=16 ttl=42 time=53.972 ms\r\n^C\r\n--- 10.2.20.143 ping statistics ---\r\n17 packets transmitted, 17 packets received, 0% packet loss\r\nround-trip min/avg/max = 49.255/79.598/154.781 ms\r\n```",
"@keremcankabadayi wanna discuss this [on discord](https://discord.gg/4DWzD7pGE5) to make it quicker? or somewhere else if you don't have one. ",
"The problem seems to be about having a huge amount of topics present in kafka.",
"workaround for this issue, `http://localhost:8098/ui/clusters/<cluster_name>/topics/<topic_name>` you can visit directly topic without all topics loads.",
"@keremcankabadayi hey, can we talk on discord once again? I have a beta build to test it out"
] | [] | "2022-05-23T14:44:53Z" | [
"type/bug",
"scope/backend",
"status/accepted",
"status/confirmed"
] | Timeouts with large amount of topics | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
Can't connect my Stage Environment Kafka.
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
docker-compose installation
> version: "3.7"
> services:
> kafka-ui:
> container_name: kafka-ui
> image: "provectuslabs/kafka-ui:latest"
> restart: always
> privileged: true
> ports:
> - "8099:8080"
> environment:
> KAFKA_CLUSTERS_0_NAME: Stage
> KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: 10.2.20.143:9092
* version: vv0.4.0 [521ba0c](https://github.com/provectus/kafka-ui/commit/521ba0c)
**Steps to Reproduce**
Steps to reproduce the behavior:
1. create container with `docker-compose up -d`
2. check container logs
<details>
_ _ ___ __ _ _ _ __ __ _
| | | |_ _| / _|___ _ _ /_\ _ __ __ _ __| |_ ___ | |/ /__ _ / _| |_____
| |_| || | | _/ _ | '_| / _ \| '_ / _` / _| ' \/ -_) | ' </ _` | _| / / _`|
\___/|___| |_| \___|_| /_/ \_| .__\__,_\__|_||_\___| |_|\_\__,_|_| |_\_\__,|
|_|
2022-05-18 20:50:35,957 INFO [background-preinit] o.h.v.i.u.Version: HV000001: Hibernate Validator 6.2.0.Final
2022-05-18 20:50:35,982 INFO [main] c.p.k.u.KafkaUiApplication: Starting KafkaUiApplication using Java 13.0.9 on 373c8e33779a with PID 1 (/kafka-ui-api.jar started by kafkaui in /)
2022-05-18 20:50:35,983 DEBUG [main] c.p.k.u.KafkaUiApplication: Running with Spring Boot v2.6.3, Spring v5.3.15
2022-05-18 20:50:35,983 INFO [main] c.p.k.u.KafkaUiApplication: No active profile set, falling back to default profiles: default
2022-05-18 20:50:38,790 INFO [main] o.s.d.r.c.RepositoryConfigurationDelegate: Bootstrapping Spring Data LDAP repositories in DEFAULT mode.
2022-05-18 20:50:38,891 INFO [main] o.s.d.r.c.RepositoryConfigurationDelegate: Finished Spring Data repository scanning in 91 ms. Found 0 LDAP repository interfaces.
2022-05-18 20:50:40,168 INFO [main] c.p.k.u.s.DeserializationService: Using SimpleRecordSerDe for cluster 'Stage'
2022-05-18 20:50:42,407 INFO [main] o.s.b.a.e.w.EndpointLinksResolver: Exposing 2 endpoint(s) beneath base path '/actuator'
2022-05-18 20:50:42,630 INFO [main] o.s.b.a.s.r.ReactiveUserDetailsServiceAutoConfiguration:
Using generated security password: 35b6dd3f-87da-4515-bf27-74f9979869ad
2022-05-18 20:50:42,824 WARN [main] c.p.k.u.c.a.DisabledAuthSecurityConfig: Authentication is disabled. Access will be unrestricted.
2022-05-18 20:50:43,120 INFO [main] o.s.l.c.s.AbstractContextSource: Property 'userDn' not set - anonymous context will be used for read-write operations
2022-05-18 20:50:44,149 INFO [main] o.s.b.w.e.n.NettyWebServer: Netty started on port 8080
2022-05-18 20:50:44,195 INFO [main] c.p.k.u.KafkaUiApplication: Started KafkaUiApplication in 9.109 seconds (JVM running for 10.11)
2022-05-18 20:50:44,250 DEBUG [parallel-1] c.p.k.u.s.ClustersMetricsScheduler: Start getting metrics for kafkaCluster: Stage
2022-05-18 20:50:44,278 INFO [parallel-1] o.a.k.c.a.AdminClientConfig: AdminClientConfig values:
bootstrap.servers = [10.2.20.143:9092]
client.dns.lookup = use_all_dns_ips
client.id =
connections.max.idle.ms = 300000
default.api.timeout.ms = 60000
metadata.max.age.ms = 300000
metric.reporters = []
metrics.num.samples = 2
metrics.recording.level = INFO
metrics.sample.window.ms = 30000
receive.buffer.bytes = 65536
reconnect.backoff.max.ms = 1000
reconnect.backoff.ms = 50
request.timeout.ms = 30000
retries = 2147483647
retry.backoff.ms = 100
sasl.client.callback.handler.class = null
sasl.jaas.config = null
sasl.kerberos.kinit.cmd = /usr/bin/kinit
sasl.kerberos.min.time.before.relogin = 60000
sasl.kerberos.service.name = null
sasl.kerberos.ticket.renew.jitter = 0.05
sasl.kerberos.ticket.renew.window.factor = 0.8
sasl.login.callback.handler.class = null
sasl.login.class = null
sasl.login.refresh.buffer.seconds = 300
sasl.login.refresh.min.period.seconds = 60
sasl.login.refresh.window.factor = 0.8
sasl.login.refresh.window.jitter = 0.05
sasl.mechanism = GSSAPI
security.protocol = PLAINTEXT
security.providers = null
send.buffer.bytes = 131072
socket.connection.setup.timeout.max.ms = 30000
socket.connection.setup.timeout.ms = 10000
ssl.cipher.suites = null
ssl.enabled.protocols = [TLSv1.2, TLSv1.3]
ssl.endpoint.identification.algorithm = https
ssl.engine.factory.class = null
ssl.key.password = null
ssl.keymanager.algorithm = SunX509
ssl.keystore.certificate.chain = null
ssl.keystore.key = null
ssl.keystore.location = null
ssl.keystore.password = null
ssl.keystore.type = JKS
ssl.protocol = TLSv1.3
ssl.provider = null
ssl.secure.random.implementation = null
ssl.trustmanager.algorithm = PKIX
ssl.truststore.certificates = null
ssl.truststore.location = null
ssl.truststore.password = null
ssl.truststore.type = JKS
2022-05-18 20:50:44,403 INFO [parallel-1] o.a.k.c.u.AppInfoParser: Kafka version: 2.8.0
2022-05-18 20:50:44,403 INFO [parallel-1] o.a.k.c.u.AppInfoParser: Kafka commitId: ebb1d6e21cc92130
2022-05-18 20:50:44,403 INFO [parallel-1] o.a.k.c.u.AppInfoParser: Kafka startTimeMs: 1652907044401
</details>
3. here is the dasboard

4. topics

Connection via Conduktor

Connection via CLI
`bin/kafka-console-producer.sh --broker-list 10.2.20.143:9092 --topic my_topic`

**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
Successfully connected kafka-ui app.
**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->
**Additional context**
<!--
(Add any other context about the problem here)
-->
| [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ReactiveAdminClient.java"
] | [
"kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ReactiveAdminClient.java"
] | [] | diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ReactiveAdminClient.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ReactiveAdminClient.java
index dedd609743c..731824cdf08 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ReactiveAdminClient.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ReactiveAdminClient.java
@@ -4,6 +4,8 @@
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toMap;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterators;
import com.provectus.kafka.ui.exception.IllegalEntityStateException;
import com.provectus.kafka.ui.exception.NotFoundException;
import com.provectus.kafka.ui.util.MapUtil;
@@ -11,6 +13,7 @@
import java.io.Closeable;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@@ -18,6 +21,8 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.BiFunction;
+import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.Nullable;
@@ -131,6 +136,16 @@ public Mono<Map<String, List<ConfigEntry>>> getTopicsConfig() {
}
public Mono<Map<String, List<ConfigEntry>>> getTopicsConfig(Collection<String> topicNames) {
+ // we need to partition calls, because it can lead to AdminClient timeouts in case of large topics count
+ return partitionCalls(
+ topicNames,
+ 200,
+ this::getTopicsConfigImpl,
+ (m1, m2) -> ImmutableMap.<String, List<ConfigEntry>>builder().putAll(m1).putAll(m2).build()
+ );
+ }
+
+ private Mono<Map<String, List<ConfigEntry>>> getTopicsConfigImpl(Collection<String> topicNames) {
List<ConfigResource> resources = topicNames.stream()
.map(topicName -> new ConfigResource(ConfigResource.Type.TOPIC, topicName))
.collect(toList());
@@ -162,6 +177,16 @@ public Mono<Map<String, TopicDescription>> describeTopics() {
}
public Mono<Map<String, TopicDescription>> describeTopics(Collection<String> topics) {
+ // we need to partition calls, because it can lead to AdminClient timeouts in case of large topics count
+ return partitionCalls(
+ topics,
+ 200,
+ this::describeTopicsImpl,
+ (m1, m2) -> ImmutableMap.<String, TopicDescription>builder().putAll(m1).putAll(m2).build()
+ );
+ }
+
+ private Mono<Map<String, TopicDescription>> describeTopicsImpl(Collection<String> topics) {
return toMonoWithExceptionFilter(
client.describeTopics(topics).values(),
UnknownTopicOrPartitionException.class
@@ -402,6 +427,27 @@ private Mono<Void> alterConfig(String topicName, Map<String, String> configs) {
return toMono(client.alterConfigs(Map.of(topicResource, config)).all());
}
+ /**
+ * Splits input collection into batches, applies each batch sequentially to function
+ * and merges output Monos into one Mono.
+ */
+ private static <R, I> Mono<R> partitionCalls(Collection<I> items,
+ int partitionSize,
+ Function<Collection<I>, Mono<R>> call,
+ BiFunction<R, R, R> merger) {
+ if (items.isEmpty()) {
+ return call.apply(items);
+ }
+ Iterator<List<I>> parts = Iterators.partition(items.iterator(), partitionSize);
+ Mono<R> mono = call.apply(parts.next());
+ while (parts.hasNext()) {
+ var nextPart = parts.next();
+ // calls will be executed sequentially
+ mono = mono.flatMap(res1 -> call.apply(nextPart).map(res2 -> merger.apply(res1, res2)));
+ }
+ return mono;
+ }
+
@Override
public void close() {
client.close();
| null | val | train | 2022-06-07T17:28:38 | "2022-05-18T21:00:01Z" | keremcankabadayi | train |
provectus/kafka-ui/2009_2027 | provectus/kafka-ui | provectus/kafka-ui/2009 | provectus/kafka-ui/2027 | [
"connected"
] | ab805c39c5ff29b337384e1d280c474913362195 | 0c881b2df52e116669f68f66d4435055685008e2 | [
"#1438 #1230"
] | [] | "2022-05-25T12:26:41Z" | [
"scope/frontend",
"status/accepted",
"type/chore"
] | Messages count is not updated after filtering Topic/Messages | **Describe the bug**
After submitting the filter, if one message is shown, the count of Messages should also be one.
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Login to system
2. Open the Topic profile
3. Turn to Messages tab
4. Press Add filters
5. Submit f.ex. 'value == null && valueAsText != null' filter
**Expected behavior**
Messages count should be changed according to filtered messages count in case of added filter as it works for Offset filtering
**Screenshots**
<img width="1715" alt="filtered messages count" src="https://user-images.githubusercontent.com/104780608/169747893-c6f3eceb-244a-4252-8fb6-b3e18a9e9aa9.png">
| [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
index 7a0cb748f30..9eb7884b761 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
@@ -524,7 +524,7 @@ const Filters: React.FC<FiltersProps> = ({
<S.MetricsIcon>
<i className="far fa-file-alt" />
</S.MetricsIcon>
- <span>{messagesConsumed} messages</span>
+ <span>{messagesConsumed} messages consumed</span>
</S.Metric>
</S.FiltersMetrics>
</S.FiltersWrapper>
| null | test | train | 2022-05-25T13:52:57 | "2022-05-23T05:16:30Z" | armenuikafka | train |
provectus/kafka-ui/2013_2028 | provectus/kafka-ui | provectus/kafka-ui/2013 | provectus/kafka-ui/2028 | [
"connected"
] | cf6454c9873027bd0befc34f8e2c17da06bb6f20 | b32ff9ca8b22409f5eea36ea08372e502770c6e2 | [] | [] | "2022-05-25T13:29:16Z" | [
"type/bug",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | UI improvement for dropdown fields in a system | **Describe the bug**
With opening the dropdown, the arrow should be turned up for all dropdown fields
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Login to system
2. Navigate to Topic/Messages
3. Check the dropdown fields in filtering part
**Expected behavior**
In case of opening the dropdown, the arrow should be turned up
**Screenshots**
https://user-images.githubusercontent.com/104780608/169799863-7cbc87a5-39cd-4542-9b55-78a109d8c227.mov
**Additional context**
Please make sure that all dropdown fields are working in the same way over the system
| [
"kafka-ui-react-app/src/components/common/Select/Select.styled.ts",
"kafka-ui-react-app/src/components/common/Select/Select.tsx",
"kafka-ui-react-app/src/theme/theme.ts"
] | [
"kafka-ui-react-app/src/components/common/Icons/DropdownArrowIcon.tsx",
"kafka-ui-react-app/src/components/common/Select/Select.styled.ts",
"kafka-ui-react-app/src/components/common/Select/Select.tsx",
"kafka-ui-react-app/src/theme/theme.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/common/Icons/DropdownArrowIcon.tsx b/kafka-ui-react-app/src/components/common/Icons/DropdownArrowIcon.tsx
new file mode 100644
index 00000000000..22c783ac55a
--- /dev/null
+++ b/kafka-ui-react-app/src/components/common/Icons/DropdownArrowIcon.tsx
@@ -0,0 +1,26 @@
+import React from 'react';
+import { useTheme } from 'styled-components';
+
+interface Props {
+ isOpen: boolean;
+}
+
+const DropdownArrowIcon: React.FC<Props> = ({ isOpen }) => {
+ const theme = useTheme();
+
+ return (
+ <svg
+ width="24"
+ height="24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ color={theme.icons.dropdownArrowIcon}
+ transform={isOpen ? 'rotate(180)' : ''}
+ >
+ <path d="M6 9L12 15 18 9" />
+ </svg>
+ );
+};
+
+export default DropdownArrowIcon;
diff --git a/kafka-ui-react-app/src/components/common/Select/Select.styled.ts b/kafka-ui-react-app/src/components/common/Select/Select.styled.ts
index cf70423295c..428cbcc89c6 100644
--- a/kafka-ui-react-app/src/components/common/Select/Select.styled.ts
+++ b/kafka-ui-react-app/src/components/common/Select/Select.styled.ts
@@ -32,13 +32,6 @@ export const Select = styled.ul<Props>`
color: ${({ theme, disabled }) =>
disabled ? theme.select.color.disabled : theme.select.color.normal};
min-width: ${({ minWidth }) => minWidth || 'auto'};
- background-image: ${({ disabled }) =>
- `url('data:image/svg+xml,%3Csvg width="10" height="6" viewBox="0 0 10 6" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M1 1L5 5L9 1" stroke="${
- disabled ? '%23ABB5BA' : '%23454F54'
- }"/%3E%3C/svg%3E%0A') !important`};
- background-repeat: no-repeat !important;
- background-position-x: calc(100% - 8px) !important;
- background-position-y: 55% !important;
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
&:hover:enabled {
color: ${(props) => props.theme.select.color.hover};
diff --git a/kafka-ui-react-app/src/components/common/Select/Select.tsx b/kafka-ui-react-app/src/components/common/Select/Select.tsx
index d9c56ebdab2..3e0e57465f0 100644
--- a/kafka-ui-react-app/src/components/common/Select/Select.tsx
+++ b/kafka-ui-react-app/src/components/common/Select/Select.tsx
@@ -1,5 +1,6 @@
import React, { useState, useRef } from 'react';
import useClickOutside from 'lib/hooks/useClickOutside';
+import DropdownArrowIcon from 'components/common/Icons/DropdownArrowIcon';
import * as S from './Select.styled';
import LiveIcon from './LiveIcon.styled';
@@ -97,6 +98,7 @@ const Select: React.FC<SelectProps> = ({
))}
</S.OptionList>
)}
+ <DropdownArrowIcon isOpen={showOptions} />
</S.Select>
</div>
);
diff --git a/kafka-ui-react-app/src/theme/theme.ts b/kafka-ui-react-app/src/theme/theme.ts
index eaaae9812be..fba48c6c85d 100644
--- a/kafka-ui-react-app/src/theme/theme.ts
+++ b/kafka-ui-react-app/src/theme/theme.ts
@@ -490,6 +490,7 @@ const theme = {
newFilterIcon: Colors.brand[50],
closeModalIcon: Colors.neutral[25],
savedIcon: Colors.brand[50],
+ dropdownArrowIcon: Colors.neutral[30],
},
viewer: {
wrapper: Colors.neutral[3],
| null | train | train | 2022-05-30T09:38:46 | "2022-05-23T10:29:35Z" | armenuikafka | train |
provectus/kafka-ui/1884_2029 | provectus/kafka-ui | provectus/kafka-ui/1884 | provectus/kafka-ui/2029 | [
"timestamp(timedelta=1.0, similarity=1.0000000000000002)",
"connected"
] | cc109a712553ed41a98a3887958a885590886563 | cf6454c9873027bd0befc34f8e2c17da06bb6f20 | [
"Update with Clear Messages available in Topic's Overview tab only after refreshing, please check the attached video:\r\n\r\nhttps://user-images.githubusercontent.com/104780608/170261514-df248abf-dc73-4e64-9eeb-236ecf9f402a.mov\r\n\r\n_**Note**: Works correctly with Clearing messages from all Topics page_"
] | [] | "2022-05-25T15:35:41Z" | [
"type/bug",
"good first issue",
"scope/frontend",
"status/accepted",
"status/confirmed"
] | The result of Clear Messages is not displayed in Topic overview | **Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
When you click Clear Messages on the Topic overview page you still see the topic`s messages like nothing happened but if you refresh the page or go to the topic you see that messages are cleared.
**Set up**
<!--
(How do you run the app?
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
https://www.kafka-ui.provectus.io/
**Steps to Reproduce**
Steps to reproduce the behavior:
1. Navigate to local/Topics
2. Choose some topic
3. Click on the sandwich menu and choose Clear Messages
4. Observe: 1) there is no Warning message to Confirm clearing
2) Messages are still in the topic
3) However, if you refresh the page or click on the topic - messages are cleared.
**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
-->
1) Display the Warning message to Confirm the action
2) Clear messages of the topic in the table Topic overview.
**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->
**Additional context**
<!--
(Add any other context about the problem here)
-->
| [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx",
"kafka-ui-react-app/src/redux/reducers/topicMessages/topicMessagesSlice.ts"
] | [
"kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx",
"kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx",
"kafka-ui-react-app/src/redux/reducers/topicMessages/topicMessagesSlice.ts"
] | [] | diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx
index 12434e6224a..6e497b017e8 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx
@@ -39,11 +39,13 @@ const Overview: React.FC<Props> = ({
}) => {
const { isReadOnly } = React.useContext(ClusterContext);
- const messageCount = React.useMemo(() => {
- return (partitions || []).reduce((memo, partition) => {
- return memo + partition.offsetMax - partition.offsetMin;
- }, 0);
- }, [partitions]);
+ const messageCount = React.useMemo(
+ () =>
+ (partitions || []).reduce((memo, partition) => {
+ return memo + partition.offsetMax - partition.offsetMin;
+ }, 0),
+ [partitions]
+ );
return (
<>
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx b/kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx
index 5b641385a69..a4087a36cf5 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx
@@ -6,7 +6,10 @@ import { useHistory, useParams } from 'react-router-dom';
import { clusterTopicMessagesPath } from 'lib/paths';
import jsf from 'json-schema-faker';
import { messagesApiClient } from 'redux/reducers/topicMessages/topicMessagesSlice';
-import { fetchTopicMessageSchema } from 'redux/reducers/topics/topicsSlice';
+import {
+ fetchTopicMessageSchema,
+ fetchTopicDetails,
+} from 'redux/reducers/topics/topicsSlice';
import { useAppDispatch, useAppSelector } from 'lib/hooks/redux';
import { alertAdded } from 'redux/reducers/alerts/alertsSlice';
import { now } from 'lodash';
@@ -126,6 +129,7 @@ const SendMessage: React.FC = () => {
partition,
},
});
+ dispatch(fetchTopicDetails({ clusterName, topicName }));
} catch (e) {
dispatch(
alertAdded({
diff --git a/kafka-ui-react-app/src/redux/reducers/topicMessages/topicMessagesSlice.ts b/kafka-ui-react-app/src/redux/reducers/topicMessages/topicMessagesSlice.ts
index a5790776e37..8760c954943 100644
--- a/kafka-ui-react-app/src/redux/reducers/topicMessages/topicMessagesSlice.ts
+++ b/kafka-ui-react-app/src/redux/reducers/topicMessages/topicMessagesSlice.ts
@@ -4,6 +4,7 @@ import { TopicMessage, Configuration, MessagesApi } from 'generated-sources';
import { BASE_PARAMS } from 'lib/constants';
import { getResponse } from 'lib/errorHandling';
import { showSuccessAlert } from 'redux/reducers/alerts/alertsSlice';
+import { fetchTopicDetails } from 'redux/reducers/topics/topicsSlice';
const apiClientConf = new Configuration(BASE_PARAMS);
export const messagesApiClient = new MessagesApi(apiClientConf);
@@ -23,7 +24,7 @@ export const clearTopicMessages = createAsyncThunk<
topicName,
partitions,
});
-
+ dispatch(fetchTopicDetails({ clusterName, topicName }));
dispatch(
showSuccessAlert({
id: `message-${topicName}-${clusterName}-${partitions}`,
| null | train | train | 2022-05-30T09:24:06 | "2022-04-22T16:07:06Z" | agolosen | train |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.