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/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", 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 b03f102a8d784..f40b905e812a5 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 @@ -185,6 +185,9 @@ interface PluginDataWarehouse { } }>, StreamDataWarehouse: React.ComponentType<{}>, + StreamIlluminateProcessingSection: React.ComponentType<{ + stream: Stream, + }>, DataWarehouseJobs: React.ComponentType<{}>, StreamIndexSetDataWarehouseWarning: React.ComponentType<{streamId: string, isArchivingEnabled: boolean}>, fetchStreamDataWarehouseStatus: (streamId: string) => Promise<{ @@ -204,12 +207,12 @@ interface PluginDataWarehouse { restore_history: Array<{id:string}>, }>; - DataWarehouseStreamDeleteWarning: React.ComponentType<{}>, getStreamDataWarehouseTableElements: (permission: Immutable.List) => { attributeName: string, attributes: Array<{ id: string, title: string }>, columnRenderer: ColumnRenderers, } | undefined, + DataWarehouseStreamDeleteWarning: React.ComponentType<{}>, } declare module 'graylog-web-plugin/plugin' { 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; 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 && } 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; diff --git a/graylog2-web-interface/yarn.lock b/graylog2-web-interface/yarn.lock index 523caeae6ae11..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" @@ -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.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" @@ -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== + 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.5" - embla-carousel-reactive-utils "8.1.5" + embla-carousel "8.1.8" + embla-carousel-reactive-utils "8.1.8" -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-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.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== +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" @@ -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" diff --git a/pom.xml b/pom.xml index 9f205a7b3e624..a5f997d61a0ed 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 @@ -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 @@ -419,7 +419,7 @@ org.apache.commons commons-compress - 1.27.0 + 1.27.1 @@ -539,7 +539,7 @@ org.apache.maven.plugins maven-install-plugin - 3.1.2 + 3.1.3 org.apache.maven.plugins @@ -579,7 +579,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.2 + 3.1.3 org.apache.maven.plugins