From d868b7ec974bd5909bf56bbf0a747932a5df125a Mon Sep 17 00:00:00 2001 From: Mgrdich <46796009+Mgrdich@users.noreply.github.com> Date: Wed, 27 Mar 2024 22:12:29 +0400 Subject: [PATCH 1/3] FE: Fix ModeOptions value mapping (#250) --- frontend/src/lib/hooks/filterUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/hooks/filterUtils.ts b/frontend/src/lib/hooks/filterUtils.ts index 87482992e..9e9d23fc6 100644 --- a/frontend/src/lib/hooks/filterUtils.ts +++ b/frontend/src/lib/hooks/filterUtils.ts @@ -1,8 +1,8 @@ import { PollingMode } from 'generated-sources'; export const ModeOptions = [ - { value: PollingMode.LATEST, label: 'Oldest' }, - { value: PollingMode.EARLIEST, label: 'Newest' }, + { value: PollingMode.EARLIEST, label: 'Oldest' }, + { value: PollingMode.LATEST, label: 'Newest' }, { value: PollingMode.TAILING, label: 'Live' }, { value: PollingMode.FROM_OFFSET, label: 'From offset' }, { value: PollingMode.TO_OFFSET, label: 'To offset' }, From 78d308a62baff0e94a00fcab509d9e523ac8d6a5 Mon Sep 17 00:00:00 2001 From: Renat Kalimulin <103274228+Nilumilak@users.noreply.github.com> Date: Sat, 30 Mar 2024 16:16:28 +0300 Subject: [PATCH 2/3] FE: Split big chunks (#210) Co-authored-by: Roman Zabaluev --- frontend/src/components/App.tsx | 11 ++++-- frontend/src/components/Topics/Topics.tsx | 37 ++++++++++--------- .../Topics/__tests__/Topics.spec.tsx | 12 +++--- .../src/components/__tests__/App.spec.tsx | 2 +- 4 files changed, 34 insertions(+), 28 deletions(-) diff --git a/frontend/src/components/App.tsx b/frontend/src/components/App.tsx index f3d6d88cd..07804f792 100644 --- a/frontend/src/components/App.tsx +++ b/frontend/src/components/App.tsx @@ -8,8 +8,6 @@ import { clusterNewConfigPath, } from 'lib/paths'; import PageLoader from 'components/common/PageLoader/PageLoader'; -import Dashboard from 'components/Dashboard/Dashboard'; -import ClusterPage from 'components/ClusterPage/ClusterPage'; import { ThemeProvider } from 'styled-components'; import { theme, darkTheme } from 'theme/theme'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; @@ -17,16 +15,21 @@ import { showServerError } from 'lib/errorHandling'; import { Toaster } from 'react-hot-toast'; import GlobalCSS from 'components/globalCss'; import * as S from 'components/App.styled'; -import ClusterConfigForm from 'widgets/ClusterConfigForm'; import { ThemeModeContext } from 'components/contexts/ThemeModeContext'; import ConfirmationModal from './common/ConfirmationModal/ConfirmationModal'; import { ConfirmContextProvider } from './contexts/ConfirmContext'; import { GlobalSettingsProvider } from './contexts/GlobalSettingsContext'; -import ErrorPage from './ErrorPage/ErrorPage'; import { UserInfoRolesAccessProvider } from './contexts/UserInfoRolesAccessContext'; import PageContainer from './PageContainer/PageContainer'; +const Dashboard = React.lazy(() => import('components/Dashboard/Dashboard')); +const ClusterPage = React.lazy( + () => import('components/ClusterPage/ClusterPage') +); +const ClusterConfigForm = React.lazy(() => import('widgets/ClusterConfigForm')); +const ErrorPage = React.lazy(() => import('components/ErrorPage/ErrorPage')); + const queryClient = new QueryClient({ defaultOptions: { queries: { diff --git a/frontend/src/components/Topics/Topics.tsx b/frontend/src/components/Topics/Topics.tsx index d6557a858..81e7869c8 100644 --- a/frontend/src/components/Topics/Topics.tsx +++ b/frontend/src/components/Topics/Topics.tsx @@ -1,5 +1,6 @@ -import React from 'react'; +import React, { Suspense } from 'react'; import { Route, Routes } from 'react-router-dom'; +import PageLoader from 'components/common/PageLoader/PageLoader'; import { clusterTopicCopyRelativePath, clusterTopicNewRelativePath, @@ -8,24 +9,26 @@ import { } from 'lib/paths'; import SuspenseQueryComponent from 'components/common/SuspenseQueryComponent/SuspenseQueryComponent'; -import New from './New/New'; -import ListPage from './List/ListPage'; -import Topic from './Topic/Topic'; +const New = React.lazy(() => import('./New/New')); +const ListPage = React.lazy(() => import('./List/ListPage')); +const Topic = React.lazy(() => import('./Topic/Topic')); const Topics: React.FC = () => ( - - } /> - } /> - } /> - - - - } - /> - + }> + + } /> + } /> + } /> + + + + } + /> + + ); export default Topics; diff --git a/frontend/src/components/Topics/__tests__/Topics.spec.tsx b/frontend/src/components/Topics/__tests__/Topics.spec.tsx index 0e077445f..e4bc71942 100644 --- a/frontend/src/components/Topics/__tests__/Topics.spec.tsx +++ b/frontend/src/components/Topics/__tests__/Topics.spec.tsx @@ -35,14 +35,14 @@ describe('Topics Component', () => { { initialEntries: [path] } ); - it('should check if the page is Topics List rendered', () => { + it('should check if the page is Topics List rendered', async () => { setUpComponent(clusterTopicsPath(clusterName)); - expect(screen.getByText(listContainer)).toBeInTheDocument(); + expect(await screen.findByText(listContainer)).toBeInTheDocument(); }); - it('should check if the page is New Topic rendered', () => { + it('should check if the page is New Topic rendered', async () => { setUpComponent(clusterTopicNewPath(clusterName)); - expect(screen.getByText(newCopyContainer)).toBeInTheDocument(); + expect(await screen.findByText(newCopyContainer)).toBeInTheDocument(); }); it('should check if the page is Copy Topic rendered', () => { @@ -50,8 +50,8 @@ describe('Topics Component', () => { expect(screen.getByText(newCopyContainer)).toBeInTheDocument(); }); - it('should check if the page is Topic page rendered', () => { + it('should check if the page is Topic page rendered', async () => { setUpComponent(clusterTopicPath(clusterName, topicName)); - expect(screen.getByText(topicContainer)).toBeInTheDocument(); + expect(await screen.findByText(topicContainer)).toBeInTheDocument(); }); }); diff --git a/frontend/src/components/__tests__/App.spec.tsx b/frontend/src/components/__tests__/App.spec.tsx index feb41e6a8..9a1213dcf 100644 --- a/frontend/src/components/__tests__/App.spec.tsx +++ b/frontend/src/components/__tests__/App.spec.tsx @@ -33,7 +33,7 @@ describe('App', () => { }); it('Renders navigation', async () => { - expect(screen.getByText('Navigation')).toBeInTheDocument(); + expect(await screen.findByText('Navigation')).toBeInTheDocument(); }); it('Renders NavBar', async () => { From 1d318cb488778f25ef7980b049daa957e2dda72c Mon Sep 17 00:00:00 2001 From: Roman Zabaluev Date: Sat, 30 Mar 2024 20:17:26 +0700 Subject: [PATCH 3/3] BE: Fix cyrillic in AD property name (#252) --- api/src/main/java/io/kafbat/ui/config/auth/LdapProperties.java | 2 +- api/src/main/resources/application-local.yml | 2 +- documentation/compose/ui-ldap.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/main/java/io/kafbat/ui/config/auth/LdapProperties.java b/api/src/main/java/io/kafbat/ui/config/auth/LdapProperties.java index 138dc0c30..3478d3fbc 100644 --- a/api/src/main/java/io/kafbat/ui/config/auth/LdapProperties.java +++ b/api/src/main/java/io/kafbat/ui/config/auth/LdapProperties.java @@ -20,7 +20,7 @@ public class LdapProperties { @Value("${oauth2.ldap.activeDirectory:false}") private boolean isActiveDirectory; - @Value("${oauth2.ldap.aсtiveDirectory.domain:@null}") + @Value("${oauth2.ldap.activeDirectory.domain:@null}") private String activeDirectoryDomain; } diff --git a/api/src/main/resources/application-local.yml b/api/src/main/resources/application-local.yml index b87349807..0c40ff079 100644 --- a/api/src/main/resources/application-local.yml +++ b/api/src/main/resources/application-local.yml @@ -40,7 +40,7 @@ dynamic.config.enabled: true oauth2: ldap: activeDirectory: false - aсtiveDirectory.domain: domain.com + activeDirectory.domain: domain.com auth: type: DISABLED diff --git a/documentation/compose/ui-ldap.yaml b/documentation/compose/ui-ldap.yaml index bf8a8efd8..b7855dfdb 100644 --- a/documentation/compose/ui-ldap.yaml +++ b/documentation/compose/ui-ldap.yaml @@ -25,7 +25,7 @@ services: SPRING_LDAP_USER_FILTER_SEARCH_FILTER: "(&(uid={0})(objectClass=inetOrgPerson))" SPRING_LDAP_GROUP_FILTER_SEARCH_BASE: "ou=people,dc=planetexpress,dc=com" # OAUTH2.LDAP.ACTIVEDIRECTORY: true -# OAUTH2.LDAP.AСTIVEDIRECTORY.DOMAIN: "memelord.lol" +# OAUTH2.LDAP.ACTIVEDIRECTORY.DOMAIN: "memelord.lol" ldap: image: rroemhild/test-openldap:latest