From 87ca9b8836bec540bb58664245c1f7953a536f45 Mon Sep 17 00:00:00 2001 From: maxiadlovskii Date: Tue, 20 Aug 2024 10:08:51 +0200 Subject: [PATCH 01/13] Add size prop to IconButton (#20219) --- graylog2-web-interface/src/components/common/IconButton.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/graylog2-web-interface/src/components/common/IconButton.tsx b/graylog2-web-interface/src/components/common/IconButton.tsx index a9b2a0918b0fd..76b5e0b265cbe 100644 --- a/graylog2-web-interface/src/components/common/IconButton.tsx +++ b/graylog2-web-interface/src/components/common/IconButton.tsx @@ -19,7 +19,7 @@ import PropTypes from 'prop-types'; import styled, { css } from 'styled-components'; import Icon from 'components/common/Icon'; -import type { IconName, RotateProp, IconType } from 'components/common/Icon'; +import type { IconName, RotateProp, IconType, SizeProp } from 'components/common/Icon'; const Wrapper = styled.button<{ disabled: boolean }>(({ theme, disabled }) => css` display: inline-flex; @@ -51,7 +51,8 @@ type Props = { iconType?: IconType, disabled?: boolean, rotation?: RotateProp, - 'data-testid'?: string + 'data-testid'?: string, + size?: SizeProp, }; const handleClick = (onClick: () => void | undefined) => { @@ -98,6 +99,7 @@ IconButton.defaultProps = { rotation: undefined, iconType: undefined, 'data-testid': undefined, + size: undefined, }; export default IconButton; From b3503328c9d6a9f4a8cdbe8accd66d41110b3802 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:30:10 +0200 Subject: [PATCH 02/13] Bump core-js from 3.37.1 to 3.38.0 in /graylog2-web-interface (#20218) Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.37.1 to 3.38.0. - [Release notes](https://github.com/zloirock/core-js/releases) - [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/zloirock/core-js/commits/v3.38.0/packages/core-js) --- updated-dependencies: - dependency-name: core-js dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- graylog2-web-interface/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/graylog2-web-interface/yarn.lock b/graylog2-web-interface/yarn.lock index 523caeae6ae11..ee1c47fc31de7 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -5702,9 +5702,9 @@ core-js-compat@^3.37.1: browserslist "^4.23.0" core-js@3: - version "3.37.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.37.1.tgz#d21751ddb756518ac5a00e4d66499df981a62db9" - integrity sha512-Xn6qmxrQZyB0FFY8E3bgRXei3lWDJHhvI+u0q9TKIYM49G8pAr0FgnnrFRAmsbptZL1yxRADVXn+x5AGsbBfyw== + version "3.38.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.38.0.tgz#8acb7c050bf2ccbb35f938c0d040132f6110f636" + integrity sha512-XPpwqEodRljce9KswjZShh95qJ1URisBeKCjUdq27YdenkslVe7OO0ZJhlYXAChW7OhXaRLl8AAba7IBfoIHug== core-js@^2.6.5: version "2.6.11" From e83ec3df951b16e472012d82538993dbc617961b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:32:05 +0200 Subject: [PATCH 03/13] Bump embla-carousel-react from 8.1.5 to 8.1.8 in /graylog2-web-interface (#20216) Bumps [embla-carousel-react](https://github.com/davidjerleke/embla-carousel) from 8.1.5 to 8.1.8. - [Release notes](https://github.com/davidjerleke/embla-carousel/releases) - [Commits](https://github.com/davidjerleke/embla-carousel/compare/v8.1.5...v8.1.8) --- updated-dependencies: - dependency-name: embla-carousel-react dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- graylog2-web-interface/yarn.lock | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/graylog2-web-interface/yarn.lock b/graylog2-web-interface/yarn.lock index ee1c47fc31de7..e69b76b45c067 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -6715,22 +6715,22 @@ elementary-circuits-directed-graph@^1.0.4: strongly-connected-components "^1.0.1" embla-carousel-react@^8.0.0-rc11: - version "8.1.5" - resolved "https://registry.yarnpkg.com/embla-carousel-react/-/embla-carousel-react-8.1.5.tgz#64867a2812c0c5beb7fe215651ce1f8d9f4855d5" - integrity sha512-xFmfxgJd7mpWDHQ4iyK1Qs+5BTTwu4bkn+mSROKiUH9nKpPHTeilQ+rpeQDCHRrAPeshD67aBk0/p6FxWxXsng== - dependencies: - embla-carousel "8.1.5" - embla-carousel-reactive-utils "8.1.5" - -embla-carousel-reactive-utils@8.1.5: - version "8.1.5" - resolved "https://registry.yarnpkg.com/embla-carousel-reactive-utils/-/embla-carousel-reactive-utils-8.1.5.tgz#87475b9478a60c92be883bccecebbf4f180796f9" - integrity sha512-76uZTrSaEGGta+qpiGkMFlLK0I7N04TdjZ2obrBhyggYIFDWlxk1CriIEmt2lisLNsa1IYXM85kr863JoCMSyg== - -embla-carousel@8.1.5: - version "8.1.5" - resolved "https://registry.yarnpkg.com/embla-carousel/-/embla-carousel-8.1.5.tgz#d958083cb16f19e7412bf8f93fa125b21311ac93" - integrity sha512-R6xTf7cNdR2UTNM6/yUPZlJFRmZSogMiRjJ5vXHO65II5MoUlrVYUAP0fHQei/py82Vf15lj+WI+QdhnzBxA2g== + version "8.1.8" + resolved "https://registry.yarnpkg.com/embla-carousel-react/-/embla-carousel-react-8.1.8.tgz#ccca22c12d97407f12c3dd8f6fafae6e82e4c578" + integrity sha512-b8DcmC+j1vqVWSM6rU/GYGyY6Kp9LX8OoikZPBKmV6qL8s94sSPGl6jtDLLUtV8TTIQGMYOlOKUgoMAt/0TwOQ== + dependencies: + embla-carousel "8.1.8" + embla-carousel-reactive-utils "8.1.8" + +embla-carousel-reactive-utils@8.1.8: + version "8.1.8" + resolved "https://registry.yarnpkg.com/embla-carousel-reactive-utils/-/embla-carousel-reactive-utils-8.1.8.tgz#8c2577516216c16cfe24b345fda0fa53d8072f40" + integrity sha512-bwV/23WD3Ecm0YuQ4I6Syzs3tdVJw0Oj3VCZlEODv1kH8LZ5kNDLgX2Uvx5brvoe2hpifBHPBQ8gYlxNL5kMPA== + +embla-carousel@8.1.8: + version "8.1.8" + resolved "https://registry.yarnpkg.com/embla-carousel/-/embla-carousel-8.1.8.tgz#cb4e02a1467909d8d59aba2063ab8e2e6262b68c" + integrity sha512-KuHPA8qcAts6YE6ELtt38XYAb26hnKw8Ga0lSXmrhm1oI97t6oACFkqSsy33dfeZQEhaZB6VwWvaWQJRJVgSgA== emittery@^0.13.1: version "0.13.1" From 1f6a5a9da840bb227cfc1ea2373b88ee8853c90e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:56:47 +0200 Subject: [PATCH 04/13] Bump org.apache.maven.plugins:maven-install-plugin from 3.1.2 to 3.1.3 (#20214) Bumps [org.apache.maven.plugins:maven-install-plugin](https://github.com/apache/maven-install-plugin) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/apache/maven-install-plugin/releases) - [Commits](https://github.com/apache/maven-install-plugin/compare/maven-install-plugin-3.1.2...maven-install-plugin-3.1.3) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-install-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9f205a7b3e624..1eb04c79a53d1 100644 --- a/pom.xml +++ b/pom.xml @@ -539,7 +539,7 @@ org.apache.maven.plugins maven-install-plugin - 3.1.2 + 3.1.3 org.apache.maven.plugins From 8712b6e3590ea3830869915005adf8ac9d053ecf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:57:01 +0200 Subject: [PATCH 05/13] Bump org.apache.maven.plugins:maven-deploy-plugin from 3.1.2 to 3.1.3 (#20213) Bumps [org.apache.maven.plugins:maven-deploy-plugin](https://github.com/apache/maven-deploy-plugin) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/apache/maven-deploy-plugin/releases) - [Commits](https://github.com/apache/maven-deploy-plugin/compare/maven-deploy-plugin-3.1.2...maven-deploy-plugin-3.1.3) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-deploy-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1eb04c79a53d1..e77dd2634208b 100644 --- a/pom.xml +++ b/pom.xml @@ -579,7 +579,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.2 + 3.1.3 org.apache.maven.plugins From 8b0164b89c655c3506815a4bc84edd789c5a79a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Aug 2024 09:39:28 +0200 Subject: [PATCH 06/13] Bump core-js from 3.38.0 to 3.38.1 in /graylog2-web-interface (#20231) Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.38.0 to 3.38.1. - [Release notes](https://github.com/zloirock/core-js/releases) - [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/zloirock/core-js/commits/v3.38.1/packages/core-js) --- updated-dependencies: - dependency-name: core-js dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- graylog2-web-interface/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/graylog2-web-interface/yarn.lock b/graylog2-web-interface/yarn.lock index e69b76b45c067..9b37fc4944ac1 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -5702,9 +5702,9 @@ core-js-compat@^3.37.1: browserslist "^4.23.0" core-js@3: - version "3.38.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.38.0.tgz#8acb7c050bf2ccbb35f938c0d040132f6110f636" - integrity sha512-XPpwqEodRljce9KswjZShh95qJ1URisBeKCjUdq27YdenkslVe7OO0ZJhlYXAChW7OhXaRLl8AAba7IBfoIHug== + version "3.38.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.38.1.tgz#aa375b79a286a670388a1a363363d53677c0383e" + integrity sha512-OP35aUorbU3Zvlx7pjsFdu1rGNnD4pgw/CWoYzRY3t2EzoVT7shKHY1dlAy3f41cGIO7ZDPQimhGFTlEYkG/Hw== core-js@^2.6.5: version "2.6.11" From ded93ffea9c914933990b7f7d51c654813fb8b32 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Aug 2024 09:40:40 +0200 Subject: [PATCH 07/13] Bump @types/react in /graylog2-web-interface/packages/graylog-web-plugin (#20227) Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.3.3 to 18.3.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react) --- updated-dependencies: - dependency-name: "@types/react" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- graylog2-web-interface/packages/graylog-web-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graylog2-web-interface/packages/graylog-web-plugin/package.json b/graylog2-web-interface/packages/graylog-web-plugin/package.json index a8b545c07f305..3136387d4ac87 100644 --- a/graylog2-web-interface/packages/graylog-web-plugin/package.json +++ b/graylog2-web-interface/packages/graylog-web-plugin/package.json @@ -33,7 +33,7 @@ "@tanstack/react-query": "4.36.1", "@types/create-react-class": "15.6.8", "@types/jquery": "3.5.30", - "@types/react": "18.3.3", + "@types/react": "18.3.4", "babel-preset-graylog": "file:../babel-preset-graylog", "create-react-class": "15.7.0", "eslint-config-graylog": "file:../eslint-config-graylog", From 8ed623e34afc491a05a50d5967e6a2e632c29fac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Aug 2024 11:18:35 +0200 Subject: [PATCH 08/13] Bump ace-builds from 1.35.4 to 1.35.5 in /graylog2-web-interface (#20229) Bumps [ace-builds](https://github.com/ajaxorg/ace-builds) from 1.35.4 to 1.35.5. - [Release notes](https://github.com/ajaxorg/ace-builds/releases) - [Changelog](https://github.com/ajaxorg/ace-builds/blob/master/CHANGELOG.md) - [Commits](https://github.com/ajaxorg/ace-builds/compare/v1.35.4...v1.35.5) --- updated-dependencies: - dependency-name: ace-builds dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- graylog2-web-interface/package.json | 2 +- graylog2-web-interface/yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/graylog2-web-interface/package.json b/graylog2-web-interface/package.json index 3d0ca6778b29d..2dfa4150e144b 100644 --- a/graylog2-web-interface/package.json +++ b/graylog2-web-interface/package.json @@ -55,7 +55,7 @@ "@reduxjs/toolkit": "^2.2.0", "@tanstack/query-sync-storage-persister": "^4.33.0", "@tanstack/react-query-persist-client": "^4.33.0", - "ace-builds": "1.35.4", + "ace-builds": "1.35.5", "bootstrap": "3.4.1", "bson-objectid": "^2.0.3", "chroma-js": "^2.0.3", diff --git a/graylog2-web-interface/yarn.lock b/graylog2-web-interface/yarn.lock index 9b37fc4944ac1..3575e1ecf8acd 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -3620,7 +3620,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@18.0.28", "@types/react@18.3.3", "@types/react@^16", "@types/react@^16.9.11", "@types/react@^16.9.9": +"@types/react@*", "@types/react@18.0.28", "@types/react@18.3.4", "@types/react@^16", "@types/react@^16.9.11", "@types/react@^16.9.9": version "18.0.28" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.28.tgz#accaeb8b86f4908057ad629a26635fe641480065" integrity sha512-RD0ivG1kEztNBdoAK7lekI9M+azSnitIn85h4iOiaLjaTrMjzslhaqCGaI4IyCJ1RljWiLCEu4jyrLLgqxBTew== @@ -4112,10 +4112,10 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8: mime-types "~2.1.34" negotiator "0.6.3" -ace-builds@1.35.4, ace-builds@^1.32.8: - version "1.35.4" - resolved "https://registry.yarnpkg.com/ace-builds/-/ace-builds-1.35.4.tgz#f41d7ef57c3a7d424cd7e3300bef0cbef905c84f" - integrity sha512-r0KQclhZ/uk5a4zOqRYQkJuQuu4vFMiA6VTj54Tk4nI1TUR3iEMMppZkWbNoWEgWwv4ciDloObb9Rf4V55Qgjw== +ace-builds@1.35.5, ace-builds@^1.32.8: + version "1.35.5" + resolved "https://registry.yarnpkg.com/ace-builds/-/ace-builds-1.35.5.tgz#6cddd56de260295473a24f3acc0efdb8bf8157e1" + integrity sha512-yh3V5BLHlN6gwbmk5sV00WRRvdEggJGJ3AIHhOOGHlgDWNWCSvOnHPO7Chb+AqaxxHuvpxOdXd7ZQesaiuJQZQ== acorn-globals@^4.1.0: version "4.3.4" @@ -8855,7 +8855,7 @@ graphemer@^1.4.0: "@tanstack/react-query" "4.36.1" "@types/create-react-class" "15.6.8" "@types/jquery" "3.5.30" - "@types/react" "18.3.3" + "@types/react" "18.3.4" babel-preset-graylog "file:packages/babel-preset-graylog" create-react-class "15.7.0" eslint-config-graylog "file:packages/eslint-config-graylog" From 0bcd84c8ac64143483659309363601eec3965946 Mon Sep 17 00:00:00 2001 From: Linus Pahl <46300478+linuspahl@users.noreply.github.com> Date: Wed, 21 Aug 2024 11:39:42 +0200 Subject: [PATCH 09/13] Implement hook to setup mantine and styled components theme. (#20186) * Implement hook to setup mantine and styled components theme. * Add missing license header --- .../src/theme/GraylogThemeProvider.tsx | 39 +----------- .../src/theme/hooks/useThemes.ts | 63 +++++++++++++++++++ 2 files changed, 65 insertions(+), 37 deletions(-) create mode 100644 graylog2-web-interface/src/theme/hooks/useThemes.ts diff --git a/graylog2-web-interface/src/theme/GraylogThemeProvider.tsx b/graylog2-web-interface/src/theme/GraylogThemeProvider.tsx index 882416201f7fa..71e9422f4eed1 100644 --- a/graylog2-web-interface/src/theme/GraylogThemeProvider.tsx +++ b/graylog2-web-interface/src/theme/GraylogThemeProvider.tsx @@ -18,18 +18,12 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import { ThemeProvider } from 'styled-components'; import type { ColorScheme } from '@graylog/sawmill'; -import SawmillSC from '@graylog/sawmill/styled-components'; -import type { MantineTheme } from '@graylog/sawmill/mantine'; -import SawmillMantine from '@graylog/sawmill/mantine'; -import { useMemo } from 'react'; import { MantineProvider } from '@mantine/core'; -import usePluginEntities from 'hooks/usePluginEntities'; -import type { CustomThemesColors } from 'theme/theme-types'; +import useThemes from 'theme/hooks/useThemes'; import ColorSchemeContext from './ColorSchemeContext'; import { COLOR_SCHEMES } from './constants'; -import usePreferredColorScheme from './hooks/usePreferredColorScheme'; import 'material-symbols/rounded.css'; @@ -39,37 +33,8 @@ type Props = { userIsLoggedIn: boolean, } -const useSCTheme = ( - changeColorScheme: (newColorScheme: ColorScheme) => void, - mantineTheme: MantineTheme, -) => useMemo(() => { - const theme = SawmillSC(mantineTheme); - - return ({ - ...theme, - changeMode: changeColorScheme, - mantine: mantineTheme, - }); -}, [changeColorScheme, mantineTheme]); - -const useMantineTheme = ( - colorScheme: ColorScheme, - useCustomThemeColors: () => ({ data: CustomThemesColors }), -) => { - const { data: customThemeColors } = useCustomThemeColors?.() ?? {}; - - return useMemo(() => SawmillMantine({ - colorScheme, - customColors: customThemeColors?.[colorScheme], - }), [colorScheme, customThemeColors]); -}; - const GraylogThemeProvider = ({ children, initialThemeModeOverride, userIsLoggedIn }: Props) => { - const [colorScheme, changeColorScheme] = usePreferredColorScheme(initialThemeModeOverride, userIsLoggedIn); - const themeCustomizer = usePluginEntities('customization.theme.customizer'); - const useCustomThemeColors = themeCustomizer?.[0]?.hooks.useCustomThemeColors; - const mantineTheme = useMantineTheme(colorScheme, useCustomThemeColors); - const scTheme = useSCTheme(changeColorScheme, mantineTheme); + const { scTheme, mantineTheme, colorScheme } = useThemes(initialThemeModeOverride, userIsLoggedIn); return ( diff --git a/graylog2-web-interface/src/theme/hooks/useThemes.ts b/graylog2-web-interface/src/theme/hooks/useThemes.ts new file mode 100644 index 0000000000000..58a5e84bdd1bd --- /dev/null +++ b/graylog2-web-interface/src/theme/hooks/useThemes.ts @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2020 Graylog, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the Server Side Public License, version 1, + * as published by MongoDB, Inc. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Server Side Public License for more details. + * + * You should have received a copy of the Server Side Public License + * along with this program. If not, see + * . + */ + +import { useMemo } from 'react'; +import type { ColorScheme } from '@graylog/sawmill'; +import SawmillMantine from '@graylog/sawmill/mantine'; +import type { MantineTheme } from '@graylog/sawmill/mantine'; +import SawmillSC from '@graylog/sawmill/styled-components'; + +import type { CustomThemesColors } from 'theme/theme-types'; +import usePreferredColorScheme from 'theme/hooks/usePreferredColorScheme'; +import usePluginEntities from 'hooks/usePluginEntities'; + +const useMantineTheme = ( + colorScheme: ColorScheme, + useCustomThemeColors: () => ({ data: CustomThemesColors }), +) => { + const { data: customThemeColors } = useCustomThemeColors?.() ?? {}; + + return useMemo(() => SawmillMantine({ + colorScheme, + customColors: customThemeColors?.[colorScheme], + }), [colorScheme, customThemeColors]); +}; + +const useStyledComponentsTheme = ( + changeColorScheme: (newColorScheme: ColorScheme) => void, + mantineTheme: MantineTheme, +) => useMemo(() => { + const theme = SawmillSC(mantineTheme); + + return ({ + ...theme, + changeMode: changeColorScheme, + mantine: mantineTheme, + }); +}, [changeColorScheme, mantineTheme]); + +const useThemes = (initialThemeModeOverride: ColorScheme, userIsLoggedIn: boolean) => { + const [colorScheme, changeColorScheme] = usePreferredColorScheme(initialThemeModeOverride, userIsLoggedIn); + const themeCustomizer = usePluginEntities('customization.theme.customizer'); + const useCustomThemeColors = themeCustomizer?.[0]?.hooks.useCustomThemeColors; + const mantineTheme = useMantineTheme(colorScheme, useCustomThemeColors); + const scTheme = useStyledComponentsTheme(changeColorScheme, mantineTheme); + + return { scTheme, mantineTheme, colorScheme }; +}; + +export default useThemes; From fe7b0e82038ec6b9dcfb03cbbeef34c797d248b1 Mon Sep 17 00:00:00 2001 From: Ousmane SAMBA Date: Thu, 22 Aug 2024 07:38:54 +0200 Subject: [PATCH 10/13] Show stream illuminate processing section only for Ilumminate stream (#20176) * show stream illuminate processing only for Ilumminate * fix review --------- Co-authored-by: Laura --- .../src/@types/graylog-web-plugin/index.d.ts | 5 ++++- .../StreamDataRoutingProcessing.tsx | 22 +++++++++---------- .../streams/StreamDetails/StreamDetails.tsx | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/graylog2-web-interface/src/@types/graylog-web-plugin/index.d.ts b/graylog2-web-interface/src/@types/graylog-web-plugin/index.d.ts index 49893e81f5cb4..8105c2345473d 100644 --- a/graylog2-web-interface/src/@types/graylog-web-plugin/index.d.ts +++ b/graylog2-web-interface/src/@types/graylog-web-plugin/index.d.ts @@ -186,7 +186,10 @@ interface PluginDataWarehouse { }>, StreamDataWarehouse: React.ComponentType<{}>, DataWarehouseJobs: React.ComponentType<{}>, - StreamIndexSetDataWarehouseWarning: React.ComponentType<{streamId: string, isArchivingEnabled: boolean}>, + StreamIlluminateProcessingSection: React.ComponentType<{ + stream: Stream, + }>, + StreamIndexSetDataWarehouseWarning: React.ComponentType<{streamId: string, isArchivingEnabled: boolean}>, getStreamDataWarehouseTableElements: (permission: Immutable.List) => { attributeName: string, attributes: Array<{ id: string, title: string }>, diff --git a/graylog2-web-interface/src/components/streams/StreamDetails/StreamDataRoutingProcessing.tsx b/graylog2-web-interface/src/components/streams/StreamDetails/StreamDataRoutingProcessing.tsx index 3d3537240b4eb..f8027a304c779 100644 --- a/graylog2-web-interface/src/components/streams/StreamDetails/StreamDataRoutingProcessing.tsx +++ b/graylog2-web-interface/src/components/streams/StreamDetails/StreamDataRoutingProcessing.tsx @@ -15,39 +15,39 @@ * . */ import * as React from 'react'; -import { useParams } from 'react-router-dom'; import styled, { css } from 'styled-components'; +import { PluginStore } from 'graylog-web-plugin/plugin'; import { defaultCompare as naturalSort } from 'logic/DefaultCompare'; import usePipelinesConnectedStream, { type StreamConnectedPipelines } from 'hooks/usePipelinesConnectedStream'; -import { Table, Button, Alert } from 'components/bootstrap'; +import { Table, Button } from 'components/bootstrap'; import Routes from 'routing/Routes'; import { IfPermitted, Section, Icon } from 'components/common'; import usePipelines from 'hooks/usePipelines'; import { LinkContainer } from 'components/common/router'; import StreamPipelinesConnectionForm from 'components/streams/StreamDetails/StreamPipelinesConnectionForm'; +import type { Stream } from 'logic/streams/types'; + +type Props = { + stream: Stream, +}; const ActionButtonsWrap = styled.span(({ theme }) => css` margin-right: ${theme.spacings.xxs}; float: right; `); -const StreamDataRoutingProcessing = () => { - const { streamId } = useParams<{streamId: string}>(); +const StreamDataRoutingProcessing = ({ stream }: Props) => { + const { id: streamId } = stream; const { data: connectedPipelines, isInitialLoading: isLoadingConnectPipelines } = usePipelinesConnectedStream(streamId); const hasConnectedPipelines = !isLoadingConnectPipelines && connectedPipelines?.length > 0; const { data: pipelines } = usePipelines(); const sortPipelines = (pipelinesList: StreamConnectedPipelines) => pipelinesList.sort((s1, s2) => naturalSort(s1.title, s2.title)); + const StreamIlluminateProcessingSection = PluginStore.exports('dataWarehouse')?.[0]?.StreamIlluminateProcessingSection; return ( <> - - The Illuminate Processing step is an immutable Pipeline that occurs before user Pipelines in the default processing order.
- It collects messages that meet supported formats from the All Messages stream, parses that data into the Graylog GIM schema fields and routes them to this Stream. -
-
-

Illuminate Processing step

-
+ {StreamIlluminateProcessingSection && ()}
diff --git a/graylog2-web-interface/src/components/streams/StreamDetails/StreamDetails.tsx b/graylog2-web-interface/src/components/streams/StreamDetails/StreamDetails.tsx index e168ed97ec6d6..15a7eccccb8b0 100644 --- a/graylog2-web-interface/src/components/streams/StreamDetails/StreamDetails.tsx +++ b/graylog2-web-interface/src/components/streams/StreamDetails/StreamDetails.tsx @@ -200,7 +200,7 @@ const StreamDetails = ({ stream }: Props) => { {currentSegment === INTAKE_SEGMENT && } - {currentSegment === PROCESSING_SEGMENT && } + {currentSegment === PROCESSING_SEGMENT && } {currentSegment === DESTINATIONS_SEGMENT && } From e5caa41dd86bd899b7d887fa572da746f962df06 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 07:43:32 +0200 Subject: [PATCH 11/13] Bump com.github.oshi:oshi-core from 6.6.2 to 6.6.3 (#20235) Bumps [com.github.oshi:oshi-core](https://github.com/oshi/oshi) from 6.6.2 to 6.6.3. - [Release notes](https://github.com/oshi/oshi/releases) - [Changelog](https://github.com/oshi/oshi/blob/master/CHANGELOG.md) - [Commits](https://github.com/oshi/oshi/compare/oshi-parent-6.6.2...oshi-parent-6.6.3) --- updated-dependencies: - dependency-name: com.github.oshi:oshi-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e77dd2634208b..e282b0a6fda0d 100644 --- a/pom.xml +++ b/pom.xml @@ -169,7 +169,7 @@ 2.0.1 2.2 1.1.10.6 - 6.6.2 + 6.6.3 1.5.2 2.0.16 0.8.2 From cdeffc0cbf69ba567567e79702ce13e0d784e886 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 07:44:01 +0200 Subject: [PATCH 12/13] Bump io.github.classgraph:classgraph from 4.8.174 to 4.8.175 (#20234) Bumps [io.github.classgraph:classgraph](https://github.com/classgraph/classgraph) from 4.8.174 to 4.8.175. - [Release notes](https://github.com/classgraph/classgraph/releases) - [Commits](https://github.com/classgraph/classgraph/compare/classgraph-4.8.174...classgraph-4.8.175) --- updated-dependencies: - dependency-name: io.github.classgraph:classgraph dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e282b0a6fda0d..52b1751d93aff 100644 --- a/pom.xml +++ b/pom.xml @@ -106,7 +106,7 @@ 1.14.19 3.1.8 0.0.1.10 - 4.8.174 + 4.8.175 1.17.1 1.11.0 1.6.0 From 4b328889370f0ff90d7e55c034105161d684e2df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 07:44:50 +0200 Subject: [PATCH 13/13] Bump org.apache.commons:commons-compress from 1.27.0 to 1.27.1 (#20233) Bumps org.apache.commons:commons-compress from 1.27.0 to 1.27.1. --- updated-dependencies: - dependency-name: org.apache.commons:commons-compress dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 52b1751d93aff..a5f997d61a0ed 100644 --- a/pom.xml +++ b/pom.xml @@ -419,7 +419,7 @@ org.apache.commons commons-compress - 1.27.0 + 1.27.1