From 769f04ee1cfbac81e350bf32c7825a0ff89f8e9a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:37:39 +0100 Subject: [PATCH 01/39] Bump com.github.ben-manes.caffeine:caffeine from 2.8.1 to 3.1.8 (#16694) * Bump com.github.ben-manes.caffeine:caffeine from 2.8.1 to 3.1.8 Bumps [com.github.ben-manes.caffeine:caffeine](https://github.com/ben-manes/caffeine) from 2.8.1 to 3.1.8. - [Release notes](https://github.com/ben-manes/caffeine/releases) - [Commits](https://github.com/ben-manes/caffeine/compare/v2.8.1...v3.1.8) --- updated-dependencies: - dependency-name: com.github.ben-manes.caffeine:caffeine dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Fix CaffeineLookupCache compilation --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bernd Ahlers --- .../java/org/graylog2/lookup/caches/CaffeineLookupCache.java | 4 +++- pom.xml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/graylog2-server/src/main/java/org/graylog2/lookup/caches/CaffeineLookupCache.java b/graylog2-server/src/main/java/org/graylog2/lookup/caches/CaffeineLookupCache.java index 5dead742f3ac..9f0931b158cd 100644 --- a/graylog2-server/src/main/java/org/graylog2/lookup/caches/CaffeineLookupCache.java +++ b/graylog2-server/src/main/java/org/graylog2/lookup/caches/CaffeineLookupCache.java @@ -25,10 +25,12 @@ import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; import com.github.benmanes.caffeine.cache.Expiry; +import com.github.benmanes.caffeine.cache.RemovalCause; import com.github.benmanes.caffeine.cache.stats.CacheStats; import com.github.benmanes.caffeine.cache.stats.StatsCounter; import com.google.auto.value.AutoValue; import com.google.inject.assistedinject.Assisted; +import org.checkerframework.checker.index.qual.NonNegative; import org.checkerframework.checker.nullness.qual.NonNull; import org.graylog.autovalue.WithBeanGetter; import org.graylog2.plugin.lookup.LookupCache; @@ -301,7 +303,7 @@ public void recordLoadFailure(long loadTime) { } @Override - public void recordEviction() { + public void recordEviction(@NonNegative int i, RemovalCause removalCause) { // not tracking this metric } diff --git a/pom.xml b/pom.xml index 0acd1d71886e..8dcf35d0d7ee 100644 --- a/pom.xml +++ b/pom.xml @@ -104,7 +104,7 @@ 1.1.9 1.76 1.14.9 - 2.8.1 + 3.1.8 0.0.1.10 4.8.164 1.16.0 From b30cf4859a65d0a3d42270cb098896d05eab9668 Mon Sep 17 00:00:00 2001 From: Marco Pfatschbacher Date: Wed, 8 Nov 2023 15:34:50 +0000 Subject: [PATCH 02/39] Request a dispatched PR build (#17200) * Request a dispatched PR build Dispatch a PR build to graylog-project-internal. Provide all the necessary informations so that the dispatched build can update the commit status on the calling PR. * Simplify building PR dependencies string Co-authored-by: Bernd Ahlers * get pr_nr directoy from the github event * ignore grep failure on missing /jpd * fix wrong braces * avoid logging the entire pr body in the build output --------- Co-authored-by: Bernd Ahlers --- .github/workflows/dispatch-pr-build.yml | 47 +++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/dispatch-pr-build.yml diff --git a/.github/workflows/dispatch-pr-build.yml b/.github/workflows/dispatch-pr-build.yml new file mode 100644 index 000000000000..3d1bc996ebc5 --- /dev/null +++ b/.github/workflows/dispatch-pr-build.yml @@ -0,0 +1,47 @@ +name: Request dispatched PR Build + +on: + - pull_request + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + dispatchedPR: + name: Dispatch wait and check + runs-on: ubuntu-latest + + steps: + - name: Build pull requests string + id: pr_string + shell: bash + env: + PR_BODY: "${{ github.event.pull_request.body }}" + run: | + # Add the PR that triggered this workflow + pulls=("${{ github.repository }}#${{ github.event.number }}") + + # Add any PR dependencies to the list of pulls + pulls+=($(grep -P '^/(jenkins-pr-deps|jpd|prd)' <<< "$PR_BODY" | \ + grep -ioP '(Graylog2/\S+?#|https?://github.com/Graylog2/\S+?/pull/)[0-9]+' || true)) + + echo "pr_string=$(tr ' ' ',' <<< "${pulls[@]}")" >> $GITHUB_OUTPUT + + - name: dispatch job to graylog-project-internal + run: > + gh workflow run -R Graylog2/graylog-project-internal pr-build.yml + -f caller_repo=${{ github.repository }} + -f caller_pr_nr=${{ github.event.number }} + -f caller_base_branch=${{ github.base_ref || github.ref_name }} + -f caller_head_branch=${{ github.head_ref }} + -f head_sha=${{ github.event.pull_request.head.sha }} + -f pull_requests="${{ steps.pr_string.outputs.pr_string }}" + -f initial_actor="${{ github.actor }}/${{ github.triggering_actor }}" + env: + GITHUB_TOKEN: ${{ secrets.PAT_GRAYLOG_PROJECT_INTERNAL_WORKFLOW_RW }} + + - name: Give dispatched build time to add its status + run: sleep 20 + # This is mostly cosmetic. If this workflow finishes before the dispatched + # build creates the status on the PR, the build will show up green for a while. From 72897fb2b660eaa0b5341aeb2a50af4209ad74ff Mon Sep 17 00:00:00 2001 From: Marco Pfatschbacher Date: Wed, 8 Nov 2023 15:35:41 +0000 Subject: [PATCH 03/39] Add changelog check workflow (#17202) * Add changelog check workflow * add changelog * Revert "add changelog" This reverts commit 095e75be6f9322eff52b9d18f65a64c11802813c. * no need to retrigger the check on issue comments --- .github/workflows/changelog.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/changelog.yml diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 000000000000..62fa478bb56c --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,17 @@ +name: "Changelog Check" + +on: + pull_request: + types: + - "opened" + - "synchronize" + - "reopened" + - "edited" + +jobs: + test: + name: "Check Changelog presence" + runs-on: "ubuntu-latest" + + steps: + - uses: "Graylog2/actions/changelog-check@main" From abe699b22e457cf2950aff309212ab652892aa10 Mon Sep 17 00:00:00 2001 From: Othello Maurer Date: Wed, 8 Nov 2023 17:28:30 +0100 Subject: [PATCH 04/39] Update opensearch client from 2.9.0 to 2.11.0 (#17180) --- .../graylog/storage/opensearch2/MessagesAdapterOS2.java | 2 +- .../graylog/storage/opensearch2/ResultMessageFactory.java | 2 +- .../storage/opensearch2/views/OpenSearchBackend.java | 2 +- .../opensearch2/views/searchtypes/OSMessageList.java | 2 +- .../org/graylog/storage/opensearch2/MessagesOS2IT.java | 7 +------ .../storage/opensearch2/OpenSearchExceptionTest.java | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 12 deletions(-) diff --git a/graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/MessagesAdapterOS2.java b/graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/MessagesAdapterOS2.java index 12a5d51282be..89c142f0cd9c 100644 --- a/graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/MessagesAdapterOS2.java +++ b/graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/MessagesAdapterOS2.java @@ -31,7 +31,7 @@ import org.graylog.shaded.opensearch2.org.opensearch.client.indices.AnalyzeRequest; import org.graylog.shaded.opensearch2.org.opensearch.client.indices.AnalyzeResponse; import org.graylog.shaded.opensearch2.org.opensearch.common.xcontent.XContentType; -import org.graylog.shaded.opensearch2.org.opensearch.rest.RestStatus; +import org.graylog.shaded.opensearch2.org.opensearch.core.rest.RestStatus; import org.graylog2.indexer.messages.ChunkedBulkIndexer; import org.graylog2.indexer.messages.DocumentNotFoundException; import org.graylog2.indexer.messages.Indexable; diff --git a/graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/ResultMessageFactory.java b/graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/ResultMessageFactory.java index 6d41eb68c38a..5996c7505bd3 100644 --- a/graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/ResultMessageFactory.java +++ b/graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/ResultMessageFactory.java @@ -16,7 +16,7 @@ */ package org.graylog.storage.opensearch2; -import org.graylog.shaded.opensearch2.org.opensearch.common.text.Text; +import org.graylog.shaded.opensearch2.org.opensearch.core.common.text.Text; import org.graylog.shaded.opensearch2.org.opensearch.search.SearchHit; import org.graylog.shaded.opensearch2.org.opensearch.search.fetch.subphase.highlight.HighlightField; import org.graylog2.indexer.results.ResultMessage; diff --git a/graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/views/OpenSearchBackend.java b/graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/views/OpenSearchBackend.java index 00755e89c707..5039d39ed654 100644 --- a/graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/views/OpenSearchBackend.java +++ b/graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/views/OpenSearchBackend.java @@ -35,11 +35,11 @@ import org.graylog.plugins.views.search.filter.QueryStringFilter; import org.graylog.plugins.views.search.filter.StreamFilter; import org.graylog.plugins.views.search.searchfilters.db.UsedSearchFiltersToQueryStringsMapper; -import org.graylog.shaded.opensearch2.org.opensearch.action.ShardOperationFailedException; import org.graylog.shaded.opensearch2.org.opensearch.action.search.MultiSearchResponse; import org.graylog.shaded.opensearch2.org.opensearch.action.search.SearchRequest; import org.graylog.shaded.opensearch2.org.opensearch.action.search.SearchResponse; import org.graylog.shaded.opensearch2.org.opensearch.action.support.IndicesOptions; +import org.graylog.shaded.opensearch2.org.opensearch.core.action.ShardOperationFailedException; import org.graylog.shaded.opensearch2.org.opensearch.index.query.BoolQueryBuilder; import org.graylog.shaded.opensearch2.org.opensearch.index.query.QueryBuilder; import org.graylog.shaded.opensearch2.org.opensearch.index.query.QueryBuilders; diff --git a/graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/views/searchtypes/OSMessageList.java b/graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/views/searchtypes/OSMessageList.java index d1a85d0c806e..e41baa548217 100644 --- a/graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/views/searchtypes/OSMessageList.java +++ b/graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/views/searchtypes/OSMessageList.java @@ -24,7 +24,7 @@ import org.graylog.plugins.views.search.SearchType; import org.graylog.plugins.views.search.searchtypes.MessageList; import org.graylog.plugins.views.search.searchtypes.Sort; -import org.graylog.shaded.opensearch2.org.opensearch.common.text.Text; +import org.graylog.shaded.opensearch2.org.opensearch.core.common.text.Text; import org.graylog.shaded.opensearch2.org.opensearch.index.query.QueryBuilders; import org.graylog.shaded.opensearch2.org.opensearch.index.query.QueryStringQueryBuilder; import org.graylog.shaded.opensearch2.org.opensearch.search.SearchHit; diff --git a/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/MessagesOS2IT.java b/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/MessagesOS2IT.java index 2fb8114d9762..7f66764357d6 100644 --- a/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/MessagesOS2IT.java +++ b/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/MessagesOS2IT.java @@ -16,17 +16,12 @@ */ package org.graylog.storage.opensearch2; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.graylog.shaded.opensearch2.org.opensearch.action.admin.indices.refresh.RefreshRequest; import org.graylog.shaded.opensearch2.org.opensearch.action.index.IndexRequest; import org.graylog.shaded.opensearch2.org.opensearch.action.index.IndexResponse; -import org.graylog.shaded.opensearch2.org.opensearch.client.core.CountRequest; -import org.graylog.shaded.opensearch2.org.opensearch.client.core.CountResponse; -import org.graylog.shaded.opensearch2.org.opensearch.rest.RestStatus; +import org.graylog.shaded.opensearch2.org.opensearch.core.rest.RestStatus; import org.graylog.storage.opensearch2.testing.OpenSearchInstance; import org.graylog.testing.elasticsearch.SearchServerInstance; import org.graylog2.indexer.messages.MessagesIT; -import org.graylog2.shared.bindings.providers.ObjectMapperProvider; import org.junit.Rule; import java.util.Map; diff --git a/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/OpenSearchExceptionTest.java b/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/OpenSearchExceptionTest.java index 22b4d180fc09..c978c3a774cf 100644 --- a/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/OpenSearchExceptionTest.java +++ b/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/OpenSearchExceptionTest.java @@ -27,7 +27,7 @@ import org.graylog.shaded.opensearch2.org.opensearch.client.Response; import org.graylog.shaded.opensearch2.org.opensearch.client.ResponseException; import org.graylog.shaded.opensearch2.org.opensearch.client.RestHighLevelClient; -import org.graylog.shaded.opensearch2.org.opensearch.rest.RestStatus; +import org.graylog.shaded.opensearch2.org.opensearch.core.rest.RestStatus; import org.graylog2.indexer.BatchSizeTooLargeException; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/pom.xml b/pom.xml index 8dcf35d0d7ee..b33857048a92 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ false - 2.9.0-1 + 2.11.0-1 2.9.0 5.20.0 4.8-1 From 7fb6b199be84590feb332d5fecacb992dd7a8846 Mon Sep 17 00:00:00 2001 From: Marco Pfatschbacher Date: Wed, 8 Nov 2023 16:47:38 +0000 Subject: [PATCH 05/39] Fix workflow dispatch by explicitly providing master branch (#17221) --- .github/workflows/dispatch-pr-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dispatch-pr-build.yml b/.github/workflows/dispatch-pr-build.yml index 3d1bc996ebc5..9a22cefdb4d0 100644 --- a/.github/workflows/dispatch-pr-build.yml +++ b/.github/workflows/dispatch-pr-build.yml @@ -30,7 +30,7 @@ jobs: - name: dispatch job to graylog-project-internal run: > - gh workflow run -R Graylog2/graylog-project-internal pr-build.yml + gh workflow run -R Graylog2/graylog-project-internal pr-build.yml --ref master -f caller_repo=${{ github.repository }} -f caller_pr_nr=${{ github.event.number }} -f caller_base_branch=${{ github.base_ref || github.ref_name }} From e2c358ac140f7c908e061a8c810ebe4ad0dd44f2 Mon Sep 17 00:00:00 2001 From: Ezequiel Lopez <105670363+zeeklop@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:48:31 -0300 Subject: [PATCH 06/39] Fix/17204 rules editor tooltip (#17220) * fix(17206): Changes RuleEditor tooltip colors to use theme * fix(17204): Adds changelog entry * fix(17204): Adds padding and spacing between error messages * fix(17204): Adds PR number to changelog --- changelog/unreleased/issue-17204.toml | 5 +++++ .../src/components/common/SourceCodeEditor.tsx | 4 ++-- .../src/components/rules/RuleForm.tsx | 17 ++++++++++++----- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 changelog/unreleased/issue-17204.toml diff --git a/changelog/unreleased/issue-17204.toml b/changelog/unreleased/issue-17204.toml new file mode 100644 index 000000000000..6a743d9bf955 --- /dev/null +++ b/changelog/unreleased/issue-17204.toml @@ -0,0 +1,5 @@ +type = "fixed" +message = "Fix tooltip colors on Rule Editor." + +issues = ["17204"] +pulls = ["17220"] diff --git a/graylog2-web-interface/src/components/common/SourceCodeEditor.tsx b/graylog2-web-interface/src/components/common/SourceCodeEditor.tsx index 97e2750288f9..274d0d4f3f5c 100644 --- a/graylog2-web-interface/src/components/common/SourceCodeEditor.tsx +++ b/graylog2-web-interface/src/components/common/SourceCodeEditor.tsx @@ -59,7 +59,7 @@ const Toolbar = styled.div(({ theme }) => css` .btn-link { color: ${theme.colors.variant.dark.info}; - + &:hover { color: ${theme.colors.variant.darkest.info}; background-color: ${theme.colors.variant.lightest.info}; @@ -68,7 +68,7 @@ const Toolbar = styled.div(({ theme }) => css` &.disabled, &[disabled] { color: ${theme.colors.variant.light.default}; - + &:hover { color: ${theme.colors.variant.light.default}; } diff --git a/graylog2-web-interface/src/components/rules/RuleForm.tsx b/graylog2-web-interface/src/components/rules/RuleForm.tsx index 63ffe6615bc6..82e96371a73a 100644 --- a/graylog2-web-interface/src/components/rules/RuleForm.tsx +++ b/graylog2-web-interface/src/components/rules/RuleForm.tsx @@ -32,13 +32,20 @@ type Props = { }; const StyledContainer = styled.div` - & .react-resizable { - border: 1px solid #d4d5d7; - border-radius: 0 0 5px 5px; + & .source-code-editor div { + border-color: ${({ theme }) => theme.colors.input.border}; + border-radius: 0; + + & .ace_editor { + border-radius: 0; + } } & .ace_tooltip.ace-graylog { - background-color: #f5f5f5; + background-color: ${({ theme }) => theme.colors.global.background}; + padding: 4px; + padding-left: 0; + line-height: 1.5; } `; @@ -57,7 +64,7 @@ const RuleForm = ({ create }: Props) => { const [errorMessage, setErrorMessage] = useState(''); const history = useHistory(); - const handleError = (error) => { + const handleError = (error: { responseMessage: string }) => { if (error?.responseMessage?.includes('duplicate key error')) { const duplicatedTitle = error.responseMessage.match(/title: "(.*)"/i)[1]; setErrorMessage(`Rule title "${duplicatedTitle}" already exists!`); From 2495332b716cdba6edb6777a63c126144b63ff3b Mon Sep 17 00:00:00 2001 From: Ryan <103449971+ryan-carroll-graylog@users.noreply.github.com> Date: Wed, 8 Nov 2023 13:58:53 -0600 Subject: [PATCH 07/39] (Open) - Make Illuminate Pipeline Functions Available for General Use (#17205) * Move pipeline processor functions to open repo * Move changelog * Adds license headers * Add missing license header --- changelog/unreleased/issue-6032.toml | 13 +++ .../functions/ProcessorFunctionsModule.java | 10 ++ .../arrays/AbstractArrayFunction.java | 34 ++++++ .../functions/arrays/ArrayContains.java | 85 ++++++++++++++ .../functions/arrays/ArrayRemove.java | 93 +++++++++++++++ .../functions/arrays/StringArrayAdd.java | 107 ++++++++++++++++++ .../functions/lookup/LookupAll.java | 103 +++++++++++++++++ .../functions/FunctionsSnippetsTest.java | 84 ++++++++++++++ .../functions/arrayContains.txt | 11 ++ .../functions/arrayRemove.txt | 11 ++ .../pipelineprocessor/functions/lookupAll.txt | 7 ++ .../functions/stringArrayAdd.txt | 36 ++++++ .../functions/with-arrays.json | 37 ++++++ 13 files changed, 631 insertions(+) create mode 100644 changelog/unreleased/issue-6032.toml create mode 100644 graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/arrays/AbstractArrayFunction.java create mode 100644 graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/arrays/ArrayContains.java create mode 100644 graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/arrays/ArrayRemove.java create mode 100644 graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/arrays/StringArrayAdd.java create mode 100644 graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/lookup/LookupAll.java create mode 100644 graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/arrayContains.txt create mode 100644 graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/arrayRemove.txt create mode 100644 graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/lookupAll.txt create mode 100644 graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/stringArrayAdd.txt create mode 100644 graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/with-arrays.json diff --git a/changelog/unreleased/issue-6032.toml b/changelog/unreleased/issue-6032.toml new file mode 100644 index 000000000000..c5c05e1d72c6 --- /dev/null +++ b/changelog/unreleased/issue-6032.toml @@ -0,0 +1,13 @@ +type = "added" +message = "Added 4 pipeline functions for general use that were previously only available to Illuminate." + +issues = ["Graylog2/graylog-plugin-enterprise#6032"] +pulls = ["6112"] + +details.user = """ +The following pipeline functions were added: +- array_contains +- array_remove +- string_array_add +- lookup_all +""" diff --git a/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/ProcessorFunctionsModule.java b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/ProcessorFunctionsModule.java index 8b24a5431022..5510a1b93ae8 100644 --- a/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/ProcessorFunctionsModule.java +++ b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/ProcessorFunctionsModule.java @@ -21,6 +21,9 @@ import com.google.inject.TypeLiteral; import com.google.inject.multibindings.MapBinder; import org.graylog.plugins.pipelineprocessor.ast.functions.Function; +import org.graylog.plugins.pipelineprocessor.functions.arrays.ArrayContains; +import org.graylog.plugins.pipelineprocessor.functions.arrays.ArrayRemove; +import org.graylog.plugins.pipelineprocessor.functions.arrays.StringArrayAdd; import org.graylog.plugins.pipelineprocessor.functions.conversion.BooleanConversion; import org.graylog.plugins.pipelineprocessor.functions.conversion.CsvMapConversion; import org.graylog.plugins.pipelineprocessor.functions.conversion.DoubleConversion; @@ -84,6 +87,7 @@ import org.graylog.plugins.pipelineprocessor.functions.lookup.ListGet; import org.graylog.plugins.pipelineprocessor.functions.lookup.Lookup; import org.graylog.plugins.pipelineprocessor.functions.lookup.LookupAddStringList; +import org.graylog.plugins.pipelineprocessor.functions.lookup.LookupAll; import org.graylog.plugins.pipelineprocessor.functions.lookup.LookupAssignTtl; import org.graylog.plugins.pipelineprocessor.functions.lookup.LookupClearKey; import org.graylog.plugins.pipelineprocessor.functions.lookup.LookupHasValue; @@ -293,6 +297,7 @@ protected void configure() { addMessageProcessorFunction(LookupAssignTtl.NAME, LookupAssignTtl.class); addMessageProcessorFunction(ListGet.NAME, ListGet.class); addMessageProcessorFunction(ListCount.NAME, ListCount.class); + addMessageProcessorFunction(LookupAll.NAME, LookupAll.class); // Maps addMessageProcessorFunction(MapRemove.NAME, MapRemove.class); @@ -303,6 +308,11 @@ protected void configure() { // Debug addMessageProcessorFunction(Debug.NAME, Debug.class); addMessageProcessorFunction(MetricCounterIncrement.NAME, MetricCounterIncrement.class); + + // Arrays + addMessageProcessorFunction(ArrayContains.NAME, ArrayContains.class); + addMessageProcessorFunction(ArrayRemove.NAME, ArrayRemove.class); + addMessageProcessorFunction(StringArrayAdd.NAME, StringArrayAdd.class); } protected void addMessageProcessorFunction(String name, Class> functionClass) { diff --git a/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/arrays/AbstractArrayFunction.java b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/arrays/AbstractArrayFunction.java new file mode 100644 index 000000000000..33f6f4f90516 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/arrays/AbstractArrayFunction.java @@ -0,0 +1,34 @@ +/* + * 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 + * . + */ +package org.graylog.plugins.pipelineprocessor.functions.arrays; + +import com.google.common.collect.ImmutableList; +import org.graylog.plugins.pipelineprocessor.ast.functions.AbstractFunction; + +import java.util.Collection; +import java.util.List; + +abstract public class AbstractArrayFunction extends AbstractFunction { + @SuppressWarnings("rawtypes") + static List toList(Object obj) { + if (obj instanceof Collection) { + return ImmutableList.copyOf((Collection) obj); + } else { + throw new IllegalArgumentException("Unsupported data type for parameter 'elements': " + obj.getClass().getCanonicalName()); + } + } +} diff --git a/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/arrays/ArrayContains.java b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/arrays/ArrayContains.java new file mode 100644 index 000000000000..83b2cf8f6dca --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/arrays/ArrayContains.java @@ -0,0 +1,85 @@ +/* + * 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 + * . + */ +package org.graylog.plugins.pipelineprocessor.functions.arrays; + +import com.google.common.collect.ImmutableList; +import org.graylog.plugins.pipelineprocessor.EvaluationContext; +import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionArgs; +import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; +import org.graylog.plugins.pipelineprocessor.ast.functions.ParameterDescriptor; +import org.graylog.plugins.pipelineprocessor.rulebuilder.RuleBuilderFunctionGroup; + +import java.util.Collections; +import java.util.List; + +public class ArrayContains extends AbstractArrayFunction { + public static final String NAME = "array_contains"; + + private final ParameterDescriptor elementsParam; + private final ParameterDescriptor valueParam; + private final ParameterDescriptor caseSensitiveParam; + + public ArrayContains() { + elementsParam = ParameterDescriptor.type("elements", Object.class, List.class) + .transform(AbstractArrayFunction::toList) + .description("The input array, may be null") + .build(); + valueParam = ParameterDescriptor.object("value") + .description("The input value").build(); + caseSensitiveParam = ParameterDescriptor.bool("case_sensitive") + .optional() + .description("Whether or not to ignore case when checking string arrays").build(); + } + + @SuppressWarnings("unchecked") + @Override + public Boolean evaluate(FunctionArgs args, EvaluationContext context) { + final List elements = elementsParam.optional(args, context).orElse(Collections.emptyList()); + final Object value = valueParam.required(args, context); + final boolean caseSensitive = caseSensitiveParam.optional(args, context).orElse(false); + + if (elements.isEmpty()) { + return false; + } + + if (!caseSensitive && containsStringValue(elements)) { + return elements.stream() + .anyMatch(e -> e.toString().equalsIgnoreCase(String.valueOf(value))); + } + + return elements.contains(value); + } + + private static boolean containsStringValue(List elements) { + return elements.get(0) instanceof String; + } + + @Override + public FunctionDescriptor descriptor() { + return FunctionDescriptor.builder() + .name(NAME) + .pure(true) + .returnType(Boolean.class) + .params(ImmutableList.of(elementsParam, valueParam, caseSensitiveParam)) + .description("Checks if the specified element is contained in the array.") + .ruleBuilderEnabled() + .ruleBuilderName("Check if array contains value") + .ruleBuilderTitle("Check if '${value}' is contained in array '${elements}'") + .ruleBuilderFunctionGroup(RuleBuilderFunctionGroup.ARRAY) + .build(); + } +} diff --git a/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/arrays/ArrayRemove.java b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/arrays/ArrayRemove.java new file mode 100644 index 000000000000..34fac5805aef --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/arrays/ArrayRemove.java @@ -0,0 +1,93 @@ +/* + * 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 + * . + */ +package org.graylog.plugins.pipelineprocessor.functions.arrays; + +import com.google.common.collect.ImmutableList; +import org.graylog.plugins.pipelineprocessor.EvaluationContext; +import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionArgs; +import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; +import org.graylog.plugins.pipelineprocessor.ast.functions.ParameterDescriptor; +import org.graylog.plugins.pipelineprocessor.rulebuilder.RuleBuilderFunctionGroup; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class ArrayRemove extends AbstractArrayFunction { + public static final String NAME = "array_remove"; + private static final Logger LOG = LoggerFactory.getLogger(ArrayRemove.class); + private static final String VALUE_MISSING_MESSAGE = "Value [{}] was not present in array."; + + private final ParameterDescriptor elementsParam; + private final ParameterDescriptor valueParam; + private final ParameterDescriptor removeAllParam; + + public ArrayRemove() { + elementsParam = ParameterDescriptor.type("elements", Object.class, List.class) + .transform(AbstractArrayFunction::toList) + .description("The input array, all must have the same data type, may be null") + .build(); + valueParam = ParameterDescriptor.object("value") + .description("The value to remove from the array").build(); + removeAllParam = ParameterDescriptor.bool("remove_all") + .optional() + .description("Whether or not to remove all elements, or just a single one").build(); + } + + @SuppressWarnings("unchecked") + @Override + public List evaluate(FunctionArgs args, EvaluationContext context) { + // List must be copied to avoid mutating the source object. + final List elements = new ArrayList<>(elementsParam.optional(args, context) + .orElse(Collections.emptyList())); + final Object value = valueParam.required(args, context); + final boolean removeAll = removeAllParam.optional(args, context).orElse(false); + + if (elements.isEmpty()) { + return Collections.emptyList(); + } + + if (removeAll) { + if (!elements.removeAll(Collections.singleton(value))) { + LOG.trace(VALUE_MISSING_MESSAGE, value); + } + return elements; + } + + if (!elements.remove(value)) { + LOG.trace(VALUE_MISSING_MESSAGE, value); + } + return elements; + } + + @Override + public FunctionDescriptor descriptor() { + return FunctionDescriptor.builder() + .name(NAME) + .pure(true) + .returnType(List.class) + .params(ImmutableList.of(elementsParam, valueParam, removeAllParam)) + .description("Removes the specified element from the array.") + .ruleBuilderEnabled() + .ruleBuilderName("Remove element from array") + .ruleBuilderTitle("Remove '${value}' from array '${elements}'") + .ruleBuilderFunctionGroup(RuleBuilderFunctionGroup.ARRAY) + .build(); + } +} diff --git a/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/arrays/StringArrayAdd.java b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/arrays/StringArrayAdd.java new file mode 100644 index 000000000000..9538f49d40eb --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/arrays/StringArrayAdd.java @@ -0,0 +1,107 @@ +/* + * 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 + * . + */ +package org.graylog.plugins.pipelineprocessor.functions.arrays; + +import com.fasterxml.jackson.databind.node.ValueNode; +import com.google.common.collect.ImmutableList; +import com.google.common.reflect.TypeToken; +import org.graylog.plugins.pipelineprocessor.EvaluationContext; +import org.graylog.plugins.pipelineprocessor.ast.functions.AbstractFunction; +import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionArgs; +import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; +import org.graylog.plugins.pipelineprocessor.ast.functions.ParameterDescriptor; +import org.graylog.plugins.pipelineprocessor.rulebuilder.RuleBuilderFunctionGroup; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +public class StringArrayAdd extends AbstractFunction> { + public static final String NAME = "string_array_add"; + @SuppressWarnings("unchecked") + private static final Class> LIST_RETURN_TYPE = (Class>) new TypeToken>() { + }.getRawType(); + + private final ParameterDescriptor> elementsParam; + private final ParameterDescriptor> valueParam; + private final ParameterDescriptor onlyUniqueParam; + + public StringArrayAdd() { + elementsParam = ParameterDescriptor.object("elements", LIST_RETURN_TYPE) + .transform(this::transformToList) + .description("The input string array, may be null") + .build(); + valueParam = ParameterDescriptor.object("value", LIST_RETURN_TYPE) + .transform(this::transformToList) + .description("The string (or string array) value to add to the array").build(); + onlyUniqueParam = ParameterDescriptor.bool("only_unique") + .optional() + .description("Only add elements if not already present").build(); + } + + private List transformToList(Object value) { + if (value instanceof Collection) { + return ((Collection) value).stream() + .map(StringArrayAdd::convertValue) + // Non-text JSON nodes will return null, and type conversions are intentionally not done, + // since only string inputs are supported. + .filter(Objects::nonNull) + .collect(Collectors.toList()); + } + return Collections.singletonList(value.toString()); + } + + private static String convertValue(Object o) { + if (o instanceof ValueNode node) { + return node.textValue(); + } + return o.toString(); + } + + @Override + public List evaluate(FunctionArgs args, EvaluationContext context) { + List elements = new ArrayList(elementsParam.optional(args, context).orElse(Collections.emptyList())); + final List valueArray = valueParam.optional(args, context).orElse(Collections.emptyList()); + final boolean onlyUnique = onlyUniqueParam.optional(args, context).orElse(false); + + if (onlyUnique) { + valueArray.stream().filter(v -> !elements.contains(v)).forEach(elements::add); + return elements; + } + + elements.addAll(valueArray.stream().map(Object::toString).toList()); + return elements; + } + + @Override + public FunctionDescriptor> descriptor() { + return FunctionDescriptor.>builder() + .name(NAME) + .pure(true) + .returnType(LIST_RETURN_TYPE) + .params(ImmutableList.of(elementsParam, valueParam, onlyUniqueParam)) + .description("Adds the specified string (or string array) value to the supplied string array.") + .ruleBuilderEnabled() + .ruleBuilderName("Add to array") + .ruleBuilderTitle("Add '${elements}' to array '${value}'") + .ruleBuilderFunctionGroup(RuleBuilderFunctionGroup.ARRAY) + .build(); + } +} diff --git a/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/lookup/LookupAll.java b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/lookup/LookupAll.java new file mode 100644 index 000000000000..79de2299db3a --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/functions/lookup/LookupAll.java @@ -0,0 +1,103 @@ +/* + * 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 + * . + */ +package org.graylog.plugins.pipelineprocessor.functions.lookup; + +import com.google.common.base.Functions; +import com.google.common.collect.Lists; +import com.google.common.reflect.TypeToken; +import org.graylog.plugins.pipelineprocessor.EvaluationContext; +import org.graylog.plugins.pipelineprocessor.ast.functions.AbstractFunction; +import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionArgs; +import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; +import org.graylog.plugins.pipelineprocessor.ast.functions.ParameterDescriptor; +import org.graylog.plugins.pipelineprocessor.rulebuilder.RuleBuilderFunctionGroup; +import org.graylog2.lookup.LookupTableService; +import org.graylog2.plugin.lookup.LookupResult; + +import javax.inject.Inject; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import static org.graylog.plugins.pipelineprocessor.ast.functions.ParameterDescriptor.object; +import static org.graylog.plugins.pipelineprocessor.ast.functions.ParameterDescriptor.string; + +public class LookupAll extends AbstractFunction> { + + public static final String NAME = "lookup_all"; + + @SuppressWarnings("unchecked") + private static final Class> LIST_RETURN_TYPE = (Class>) new TypeToken>() { + }.getRawType(); + + private final ParameterDescriptor lookupTableParam; + private final ParameterDescriptor> keysParam; + + @Inject + public LookupAll(LookupTableService lookupTableService) { + lookupTableParam = string("lookup_table", LookupTableService.Function.class) + .description("The existing lookup table to use to lookup the given keys") + .transform(tableName -> lookupTableService.newBuilder().lookupTable(tableName).build()) + .build(); + keysParam = object("keys", LIST_RETURN_TYPE) + .description("The keys to lookup in the table") + .transform(LookupAll::transformValueToList) + .build(); + } + + @Override + public List evaluate(FunctionArgs args, EvaluationContext context) { + final List keys = keysParam.required(args, context); + if (keys == null || keys.isEmpty()) { + return List.of(); + } + LookupTableService.Function table = lookupTableParam.required(args, context); + if (table == null) { + return List.of(); + } + final List results = new ArrayList<>(); + for (Object key : keys) { + LookupResult result = table.lookup(key); + if (result != null && !result.isEmpty()) { + results.add(result.singleValue()); + } + } + return results; + } + + @Override + public FunctionDescriptor> descriptor() { + return FunctionDescriptor.>builder() + .name(NAME) + .description("Looks up all provided values in the named lookup table, and returns all results as an array.") + .params(lookupTableParam, keysParam) + .returnType(LIST_RETURN_TYPE) + .ruleBuilderEnabled() + .ruleBuilderName("Lookup all values in lookup table") + .ruleBuilderTitle("Lookup all values from '${keys}' in '${lookup_table}'") + .ruleBuilderFunctionGroup(RuleBuilderFunctionGroup.LOOKUP) + .build(); + } + + private static List transformValueToList(Object value) { + if (value instanceof List) { + return Lists.transform((List) value, Functions.toStringFunction()); + } else { + return Collections.singletonList(value.toString()); + } + } +} diff --git a/graylog2-server/src/test/java/org/graylog/plugins/pipelineprocessor/functions/FunctionsSnippetsTest.java b/graylog2-server/src/test/java/org/graylog/plugins/pipelineprocessor/functions/FunctionsSnippetsTest.java index 66065c150955..af9d0c45c133 100644 --- a/graylog2-server/src/test/java/org/graylog/plugins/pipelineprocessor/functions/FunctionsSnippetsTest.java +++ b/graylog2-server/src/test/java/org/graylog/plugins/pipelineprocessor/functions/FunctionsSnippetsTest.java @@ -24,10 +24,14 @@ import com.google.common.collect.Sets; import com.google.common.eventbus.EventBus; import com.google.common.net.InetAddresses; +import org.apache.commons.io.IOUtils; import org.graylog.plugins.pipelineprocessor.BaseParserTest; import org.graylog.plugins.pipelineprocessor.EvaluationContext; import org.graylog.plugins.pipelineprocessor.ast.Rule; import org.graylog.plugins.pipelineprocessor.ast.functions.Function; +import org.graylog.plugins.pipelineprocessor.functions.arrays.ArrayContains; +import org.graylog.plugins.pipelineprocessor.functions.arrays.ArrayRemove; +import org.graylog.plugins.pipelineprocessor.functions.arrays.StringArrayAdd; import org.graylog.plugins.pipelineprocessor.functions.conversion.BooleanConversion; import org.graylog.plugins.pipelineprocessor.functions.conversion.CsvMapConversion; import org.graylog.plugins.pipelineprocessor.functions.conversion.DoubleConversion; @@ -91,6 +95,7 @@ import org.graylog.plugins.pipelineprocessor.functions.lookup.ListCount; import org.graylog.plugins.pipelineprocessor.functions.lookup.ListGet; import org.graylog.plugins.pipelineprocessor.functions.lookup.LookupAddStringList; +import org.graylog.plugins.pipelineprocessor.functions.lookup.LookupAll; import org.graylog.plugins.pipelineprocessor.functions.lookup.LookupAssignTtl; import org.graylog.plugins.pipelineprocessor.functions.lookup.LookupClearKey; import org.graylog.plugins.pipelineprocessor.functions.lookup.LookupHasValue; @@ -159,6 +164,7 @@ import org.graylog2.streams.StreamService; import org.joda.time.DateTime; import org.joda.time.DateTimeUtils; +import org.joda.time.DateTimeZone; import org.joda.time.Duration; import org.joda.time.Period; import org.junit.BeforeClass; @@ -170,10 +176,14 @@ import org.slf4j.Logger; import javax.inject.Provider; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.concurrent.Executors; @@ -388,6 +398,7 @@ public static void registerFunctions() { functions.put(LookupRemoveStringList.NAME, new LookupRemoveStringList(lookupTableService)); functions.put(LookupHasValue.NAME, new LookupHasValue(lookupTableService)); functions.put(LookupAssignTtl.NAME, new LookupAssignTtl(lookupTableService)); + functions.put(LookupAll.NAME, new LookupAll(lookupTableService)); functions.put(MapRemove.NAME, new MapRemove()); functions.put(MapSet.NAME, new MapSet()); @@ -398,6 +409,10 @@ public static void registerFunctions() { functions.put(ListCount.NAME, new ListCount()); functions.put(IpAnonymize.NAME, new IpAnonymize()); + functions.put(StringArrayAdd.NAME, new StringArrayAdd()); + functions.put(ArrayContains.NAME, new ArrayContains()); + functions.put(ArrayRemove.NAME, new ArrayRemove()); + functionRegistry = new FunctionRegistry(functions); } @@ -1333,6 +1348,23 @@ public void lookupAssignTtl() { assertThat(message.getField("new_value")).isEqualTo(123L); } + @Test + public void lookupAll() { + doReturn(LookupResult.single("val1")).when(lookupTable).lookup("key1"); + doReturn(LookupResult.single("val2")).when(lookupTable).lookup("key2"); + doReturn(LookupResult.single("val3")).when(lookupTable).lookup("key3"); + + final Rule rule = parser.parseRule(ruleForTest(), false); + final Message message = evaluateRule(rule); + + verify(lookupTable).lookup("key1"); + verify(lookupTable).lookup("key2"); + verify(lookupTable).lookup("key3"); + verifyNoMoreInteractions(lookupTable); + + assertThat(message.getField("results")).isEqualTo(Arrays.asList("val1", "val2", "val3")); + } + @Test public void firstNonNull() { final Rule rule = parser.parseRule(ruleForTest(), true); @@ -1509,4 +1541,56 @@ public void setFields() { assertThat(message.getField("k_5")).isEqualTo("v_5"); assertThat(message.getField("k_6")).isEqualTo("will be added with clean_fields param"); } + + @Test + public void arrayContains() { + final Rule rule = parser.parseRule(ruleForTest(), false); + final Message message = evaluateRule(rule); + assertThat(actionsTriggered.get()).isTrue(); + assertThat(message).isNotNull(); + assertThat(message.getField("contains_number")).isEqualTo(true); + assertThat(message.getField("does_not_contain_number")).isEqualTo(false); + assertThat(message.getField("contains_string")).isEqualTo(true); + assertThat(message.getField("contains_string_case_insensitive")).isEqualTo(true); + assertThat(message.getField("contains_string_case_sensitive")).isEqualTo(false); + } + + @Test + public void stringArrayAdd() throws IOException { + final Rule rule = parser.parseRule(ruleForTest(), false); + final Message message = new Message("hello test", "source", DateTime.now(DateTimeZone.UTC)); + try (InputStream inputStream = getClass().getResourceAsStream("with-arrays.json")) { + String jsonString = IOUtils.toString(Objects.requireNonNull(inputStream), StandardCharsets.UTF_8); + message.addField("json_with_arrays", jsonString); + evaluateRule(rule, message); + assertThat(actionsTriggered.get()).isTrue(); + assertThat(message).isNotNull(); + assertThat(message.getField("add_to_number_array")).isEqualTo(List.of("1", "2", "3")); + assertThat(message.getField("add_number_to_string_array_converted")).isEqualTo(List.of("1", "2", "3")); + assertThat(message.getField("add_number_array_to_string_array_converted")).isEqualTo(List.of("1", "2", "3", "4")); + assertThat(message.getField("add_string")).isEqualTo(List.of("one", "two", "three")); + assertThat(message.getField("keep_duplicates")).isEqualTo(List.of("one", "two", "two")); + assertThat(message.getField("only_unique")).isEqualTo(List.of("one", "two")); + assertThat(message.getField("add_to_empty_array")).isEqualTo(List.of("from-empty-array")); + assertThat(message.getField("add_to_empty_array_from_message")).isEqualTo(List.of("from-empty-on-message")); + assertThat(message.getField("add_array_to_array")).isEqualTo(List.of("one", "two", "three", "four")); + assertThat(message.getField("add_array_to_array_empty_source")).isEqualTo(List.of("three", "four")); + assertThat(message.getField("add_array_to_array_empty_value")).isEqualTo(List.of("one", "two")); + assertThat(message.getField("combined_json_array")).isEqualTo(List.of("Administrator", "Administrator", "Administrator", "Administrator", "user01")); + assertThat(message.getField("mixed_types_json_array")).isEqualTo(List.of("text")); + } + } + + @Test + public void arrayRemove() { + final Rule rule = parser.parseRule(ruleForTest(), false); + final Message message = evaluateRule(rule); + assertThat(actionsTriggered.get()).isTrue(); + assertThat(message).isNotNull(); + assertThat(message.getField("remove_number")).isEqualTo(Arrays.asList(1L, 3L)); + assertThat(message.getField("remove_string")).isEqualTo(Arrays.asList("one", "three")); + assertThat(message.getField("remove_missing")).isEqualTo(Arrays.asList(1L, 2L, 3L)); + assertThat(message.getField("remove_only_one")).isEqualTo(Arrays.asList(1L, 2L)); + assertThat(message.getField("remove_all")).isEqualTo(List.of(1L)); + } } diff --git a/graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/arrayContains.txt b/graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/arrayContains.txt new file mode 100644 index 000000000000..1ee387d709c0 --- /dev/null +++ b/graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/arrayContains.txt @@ -0,0 +1,11 @@ +rule "array_contains" +when + true +then + set_field("contains_number", array_contains([1, 2, 3, 4, 5], 1)); + set_field("does_not_contain_number", array_contains([1, 2, 3, 4, 5], 7)); + set_field("contains_string", array_contains(["test", "test2"], "test")); + set_field("contains_string_case_insensitive", array_contains(["test", "test2"], "TEST")); + set_field("contains_string_case_sensitive", array_contains(["test", "test2"], "TEST", true)); + trigger_test(); +end diff --git a/graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/arrayRemove.txt b/graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/arrayRemove.txt new file mode 100644 index 000000000000..24acad0e9c0e --- /dev/null +++ b/graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/arrayRemove.txt @@ -0,0 +1,11 @@ +rule "array_remove" +when + true +then + set_field("remove_number", array_remove([1, 2, 3], 2)); + set_field("remove_string", array_remove(["one", "two", "three"], "two")); + set_field("remove_missing", array_remove([1, 2, 3], 4)); + set_field("remove_only_one", array_remove([1, 2, 2], 2)); + set_field("remove_all", array_remove([1, 2, 2], 2, true)); + trigger_test(); +end diff --git a/graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/lookupAll.txt b/graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/lookupAll.txt new file mode 100644 index 000000000000..5d525ccfd841 --- /dev/null +++ b/graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/lookupAll.txt @@ -0,0 +1,7 @@ +rule "lookup_all" +when + true +then + set_field("results", lookup_all("table", ["key1", "key2", "key3"])); + trigger_test(); +end \ No newline at end of file diff --git a/graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/stringArrayAdd.txt b/graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/stringArrayAdd.txt new file mode 100644 index 000000000000..8ecec6fde6d0 --- /dev/null +++ b/graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/stringArrayAdd.txt @@ -0,0 +1,36 @@ +rule "string_array_add" +when + true +then + set_field("add_to_number_array", string_array_add([1, 2], 3)); + set_field("add_number_to_string_array_converted", string_array_add(["1", "2"], 3)); + set_field("add_number_array_to_string_array_converted", string_array_add(["1", "2"], [3, 4])); + set_field("add_string", string_array_add(["one", "two"], "three")); + set_field("keep_duplicates", string_array_add(["one", "two"], "two")); + set_field("only_unique", string_array_add(["one", "two"], "two", true)); + set_field("add_to_empty_array", string_array_add([], "from-empty-array")); + set_field("empty_array_field", []); + set_field("add_to_empty_array_from_message", string_array_add($message.empty_array_field, "from-empty-on-message", true)); + set_field("add_array_to_array", string_array_add(["one", "two"], ["three", "four"])); + set_field("add_array_to_array_empty_source", string_array_add([], ["three", "four"])); + set_field("add_array_to_array_empty_value", string_array_add(["one", "two"], [])); + + let json = parse_json(to_string($message.json_with_arrays)); + let selectedPath = select_jsonpath(json: json, + paths: { logged_on_users: "$.loggedOnUsers[*].accountName", + accounts_evidence: "$.evidence[*].accountName", + mixed_types: "$.mixedTypes[*].value"}); + set_field (field: "combined_json_array", + value: string_array_add ( + elements: selectedPath.accounts_evidence, + value: selectedPath.logged_on_users, + only_unique: false)); + set_field (field: "mixed_types_json_array", + value: string_array_add ( + elements: [], + value: selectedPath.mixed_types, + only_unique: false)); + + trigger_test(); +end +""" diff --git a/graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/with-arrays.json b/graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/with-arrays.json new file mode 100644 index 000000000000..9e661e50d14c --- /dev/null +++ b/graylog2-server/src/test/resources/org/graylog/plugins/pipelineprocessor/functions/with-arrays.json @@ -0,0 +1,37 @@ +{ + "loggedOnUsers": [ + { + "accountName": "user01", + "domainName": "DESKTOP" + } + ], + "evidence": [ + { + "accountName": "Administrator", + "detectionStatus": "Detected" + }, + { + "accountName": "Administrator", + "detectionStatus": "Detected" + }, + { + "accountName": "Administrator", + "detectionStatus": "Detected" + }, + { + "accountName": "Administrator", + "detectionStatus": "Detected" + } + ], + "mixedTypes": [ + { + "value": false + }, + { + "value": 10 + }, + { + "value": "text" + } + ] +} \ No newline at end of file From caa6ffbb6f5c1058b3d9e2969d51e83a7d3ce922 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 10:08:01 +0100 Subject: [PATCH 08/39] Bump @types/jquery (#17206) Bumps [@types/jquery](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jquery) from 3.5.26 to 3.5.27. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jquery) --- updated-dependencies: - dependency-name: "@types/jquery" 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 c2c9b6513949..979eeac8c744 100644 --- a/graylog2-web-interface/packages/graylog-web-plugin/package.json +++ b/graylog2-web-interface/packages/graylog-web-plugin/package.json @@ -32,7 +32,7 @@ "@graylog/sawmill": "2.0.7", "@tanstack/react-query": "4.36.1", "@types/create-react-class": "15.6.5", - "@types/jquery": "3.5.26", + "@types/jquery": "3.5.27", "@types/react": "18.2.20", "babel-preset-graylog": "file:../babel-preset-graylog", "create-react-class": "15.7.0", From edde5840a8cb622c86f45bf99f4b23a908710707 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 10:08:48 +0100 Subject: [PATCH 09/39] Bump fork-ts-checker-webpack-plugin in /graylog2-web-interface (#17207) Bumps [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin) from 9.0.0 to 9.0.2. - [Release notes](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/releases) - [Changelog](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/main/CHANGELOG.md) - [Commits](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/compare/v9.0.0...v9.0.2) --- updated-dependencies: - dependency-name: fork-ts-checker-webpack-plugin dependency-type: direct:development 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 | 184 ++++++++++++++----------------- 1 file changed, 84 insertions(+), 100 deletions(-) diff --git a/graylog2-web-interface/yarn.lock b/graylog2-web-interface/yarn.lock index babf2f2d8aa6..a21c63262846 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -43,14 +43,7 @@ "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" chokidar "^3.4.0" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.5.tgz#234d98e1551960604f1246e6475891a570ad5658" - integrity sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ== - dependencies: - "@babel/highlight" "^7.22.5" - -"@babel/code-frame@^7.22.13": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.22.13", "@babel/code-frame@^7.22.5": version "7.22.13" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w== @@ -779,15 +772,6 @@ chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/highlight@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.5.tgz#aa6c05c5407a67ebce408162b7ede789b4d22031" - integrity sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw== - dependencies: - "@babel/helper-validator-identifier" "^7.22.5" - chalk "^2.0.0" - js-tokens "^4.0.0" - "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.18.0", "@babel/parser@^7.4.3": version "7.18.0" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.0.tgz#10a8d4e656bc01128d299a787aa006ce1a91e112" @@ -3299,10 +3283,10 @@ redux-thunk "^2.4.2" reselect "^4.1.8" -"@remix-run/router@1.10.0": - version "1.10.0" - resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.10.0.tgz#e2170dc2049b06e65bbe883adad0e8ddf8291278" - integrity sha512-Lm+fYpMfZoEucJ7cMxgt4dYt8jLfbpwRCzAjm9UgSLOkmlqo9gupxt6YX3DY0Fk155NT9l17d/ydi+964uS9Lw== +"@remix-run/router@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.11.0.tgz#e0e45ac3fff9d8a126916f166809825537e9f955" + integrity sha512-BHdhcWgeiudl91HvVa2wxqZjSHbheSgIiDvxrF1VjFzBzpTtuDPkOdOi3Iqvc08kXtFkLjhbS+ML9aM8mJS+wQ== "@sinclair/typebox@^0.27.8": version "0.27.8" @@ -3795,10 +3779,10 @@ expect "^29.0.0" pretty-format "^29.0.0" -"@types/jquery@3.5.25": - version "3.5.25" - resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.25.tgz#c817c71d414855f7d71f46da39f43e6b9579b0b9" - integrity sha512-gykx2c+OZf5nx2tv/5fDQqmvGgTiXshELy5jf9IgXPtVfSBl57IUYByN4osbwMXwJijWGOEYQABzGaFZE79A0Q== +"@types/jquery@3.5.26": + version "3.5.26" + resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.26.tgz#af9e5bf442b2ed813eb6a73c06c714621f68e9de" + integrity sha512-wWYf2NBI6b+1RPQY86B74HSgZNsLAUtr4eFlGQoOQPJw/B3mCMfwWCflZWQ7OKtAB18MJCcYpL6+0NZbMIXl5g== dependencies: "@types/sizzle" "*" @@ -4168,16 +4152,16 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@6.9.0": - version "6.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.9.0.tgz#fdb6f3821c0167e3356e9d89c80e8230b2e401f4" - integrity sha512-lgX7F0azQwRPB7t7WAyeHWVfW1YJ9NIgd9mvGhfQpRY56X6AVf8mwM8Wol+0z4liE7XX3QOt8MN1rUKCfSjRIA== +"@typescript-eslint/eslint-plugin@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.10.0.tgz#cfe2bd34e26d2289212946b96ab19dcad64b661a" + integrity sha512-uoLj4g2OTL8rfUQVx2AFO1hp/zja1wABJq77P6IclQs6I/m9GLrm7jCdgzZkvWdDCQf1uEvoa8s8CupsgWQgVg== dependencies: "@eslint-community/regexpp" "^4.5.1" - "@typescript-eslint/scope-manager" "6.9.0" - "@typescript-eslint/type-utils" "6.9.0" - "@typescript-eslint/utils" "6.9.0" - "@typescript-eslint/visitor-keys" "6.9.0" + "@typescript-eslint/scope-manager" "6.10.0" + "@typescript-eslint/type-utils" "6.10.0" + "@typescript-eslint/utils" "6.10.0" + "@typescript-eslint/visitor-keys" "6.10.0" debug "^4.3.4" graphemer "^1.4.0" ignore "^5.2.4" @@ -4185,15 +4169,15 @@ semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/parser@6.9.0": - version "6.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.9.0.tgz#2b402cadeadd3f211c25820e5433413347b27391" - integrity sha512-GZmjMh4AJ/5gaH4XF2eXA8tMnHWP+Pm1mjQR2QN4Iz+j/zO04b9TOvJYOX2sCNIQHtRStKTxRY1FX7LhpJT4Gw== +"@typescript-eslint/parser@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.10.0.tgz#578af79ae7273193b0b6b61a742a2bc8e02f875a" + integrity sha512-+sZwIj+s+io9ozSxIWbNB5873OSdfeBEH/FR0re14WLI6BaKuSOnnwCJ2foUiu8uXf4dRp1UqHP0vrZ1zXGrog== dependencies: - "@typescript-eslint/scope-manager" "6.9.0" - "@typescript-eslint/types" "6.9.0" - "@typescript-eslint/typescript-estree" "6.9.0" - "@typescript-eslint/visitor-keys" "6.9.0" + "@typescript-eslint/scope-manager" "6.10.0" + "@typescript-eslint/types" "6.10.0" + "@typescript-eslint/typescript-estree" "6.10.0" + "@typescript-eslint/visitor-keys" "6.10.0" debug "^4.3.4" "@typescript-eslint/scope-manager@5.10.1": @@ -4212,21 +4196,21 @@ "@typescript-eslint/types" "5.58.0" "@typescript-eslint/visitor-keys" "5.58.0" -"@typescript-eslint/scope-manager@6.9.0": - version "6.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.9.0.tgz#2626e9a7fe0e004c3e25f3b986c75f584431134e" - integrity sha512-1R8A9Mc39n4pCCz9o79qRO31HGNDvC7UhPhv26TovDsWPBDx+Sg3rOZdCELIA3ZmNoWAuxaMOT7aWtGRSYkQxw== +"@typescript-eslint/scope-manager@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.10.0.tgz#b0276118b13d16f72809e3cecc86a72c93708540" + integrity sha512-TN/plV7dzqqC2iPNf1KrxozDgZs53Gfgg5ZHyw8erd6jd5Ta/JIEcdCheXFt9b1NYb93a1wmIIVW/2gLkombDg== dependencies: - "@typescript-eslint/types" "6.9.0" - "@typescript-eslint/visitor-keys" "6.9.0" + "@typescript-eslint/types" "6.10.0" + "@typescript-eslint/visitor-keys" "6.10.0" -"@typescript-eslint/type-utils@6.9.0": - version "6.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.9.0.tgz#23923c8c9677c2ad41457cf8e10a5f2946be1b04" - integrity sha512-XXeahmfbpuhVbhSOROIzJ+b13krFmgtc4GlEuu1WBT+RpyGPIA4Y/eGnXzjbDj5gZLzpAXO/sj+IF/x2GtTMjQ== +"@typescript-eslint/type-utils@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.10.0.tgz#1007faede067c78bdbcef2e8abb31437e163e2e1" + integrity sha512-wYpPs3hgTFblMYwbYWPT3eZtaDOjbLyIYuqpwuLBBqhLiuvJ+9sEp2gNRJEtR5N/c9G1uTtQQL5AhV0fEPJYcg== dependencies: - "@typescript-eslint/typescript-estree" "6.9.0" - "@typescript-eslint/utils" "6.9.0" + "@typescript-eslint/typescript-estree" "6.10.0" + "@typescript-eslint/utils" "6.10.0" debug "^4.3.4" ts-api-utils "^1.0.1" @@ -4240,10 +4224,10 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.58.0.tgz#54c490b8522c18986004df7674c644ffe2ed77d8" integrity sha512-JYV4eITHPzVQMnHZcYJXl2ZloC7thuUHrcUmxtzvItyKPvQ50kb9QXBkgNAt90OYMqwaodQh2kHutWZl1fc+1g== -"@typescript-eslint/types@6.9.0": - version "6.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.9.0.tgz#86a0cbe7ac46c0761429f928467ff3d92f841098" - integrity sha512-+KB0lbkpxBkBSiVCuQvduqMJy+I1FyDbdwSpM3IoBS7APl4Bu15lStPjgBIdykdRqQNYqYNMa8Kuidax6phaEw== +"@typescript-eslint/types@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.10.0.tgz#f4f0a84aeb2ac546f21a66c6e0da92420e921367" + integrity sha512-36Fq1PWh9dusgo3vH7qmQAj5/AZqARky1Wi6WpINxB6SkQdY5vQoT2/7rW7uBIsPDcvvGCLi4r10p0OJ7ITAeg== "@typescript-eslint/typescript-estree@5.10.1": version "5.10.1" @@ -4271,30 +4255,30 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@6.9.0": - version "6.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.9.0.tgz#d0601b245be873d8fe49f3737f93f8662c8693d4" - integrity sha512-NJM2BnJFZBEAbCfBP00zONKXvMqihZCrmwCaik0UhLr0vAgb6oguXxLX1k00oQyD+vZZ+CJn3kocvv2yxm4awQ== +"@typescript-eslint/typescript-estree@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.10.0.tgz#667381eed6f723a1a8ad7590a31f312e31e07697" + integrity sha512-ek0Eyuy6P15LJVeghbWhSrBCj/vJpPXXR+EpaRZqou7achUWL8IdYnMSC5WHAeTWswYQuP2hAZgij/bC9fanBg== dependencies: - "@typescript-eslint/types" "6.9.0" - "@typescript-eslint/visitor-keys" "6.9.0" + "@typescript-eslint/types" "6.10.0" + "@typescript-eslint/visitor-keys" "6.10.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/utils@6.9.0": - version "6.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.9.0.tgz#5bdac8604fca4823f090e4268e681c84d3597c9f" - integrity sha512-5Wf+Jsqya7WcCO8me504FBigeQKVLAMPmUzYgDbWchINNh1KJbxCgVya3EQ2MjvJMVeXl3pofRmprqX6mfQkjQ== +"@typescript-eslint/utils@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.10.0.tgz#4d76062d94413c30e402c9b0df8c14aef8d77336" + integrity sha512-v+pJ1/RcVyRc0o4wAGux9x42RHmAjIGzPRo538Z8M1tVx6HOnoQBCX/NoadHQlZeC+QO2yr4nNSFWOoraZCAyg== dependencies: "@eslint-community/eslint-utils" "^4.4.0" "@types/json-schema" "^7.0.12" "@types/semver" "^7.5.0" - "@typescript-eslint/scope-manager" "6.9.0" - "@typescript-eslint/types" "6.9.0" - "@typescript-eslint/typescript-estree" "6.9.0" + "@typescript-eslint/scope-manager" "6.10.0" + "@typescript-eslint/types" "6.10.0" + "@typescript-eslint/typescript-estree" "6.10.0" semver "^7.5.4" "@typescript-eslint/utils@^5.10.0": @@ -4339,12 +4323,12 @@ "@typescript-eslint/types" "5.58.0" eslint-visitor-keys "^3.3.0" -"@typescript-eslint/visitor-keys@6.9.0": - version "6.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.9.0.tgz#cc69421c10c4ac997ed34f453027245988164e80" - integrity sha512-dGtAfqjV6RFOtIP8I0B4ZTBRrlTT8NHHlZZSchQx3qReaoDeXhYM++M4So2AgFK9ZB0emRPA6JI1HkafzA2Ibg== +"@typescript-eslint/visitor-keys@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.10.0.tgz#b9eaf855a1ac7e95633ae1073af43d451e8f84e3" + integrity sha512-xMGluxQIEtOM7bqFCo+rCMh5fqI+ZxV5RUUOa29iVPz1OgCZrtc7rFnz5cLUazlkPKYqX+75iuDq7m0HQ48nCg== dependencies: - "@typescript-eslint/types" "6.9.0" + "@typescript-eslint/types" "6.10.0" eslint-visitor-keys "^3.4.1" "@ungap/structured-clone@^1.2.0": @@ -5663,7 +5647,7 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.2: +chalk@^2.0.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -6147,7 +6131,7 @@ cosmiconfig@8.3.6, cosmiconfig@^8.2.0: parse-json "^5.2.0" path-type "^4.0.0" -cosmiconfig@^7.0.0, cosmiconfig@^7.0.1: +cosmiconfig@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6" integrity sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA== @@ -7728,13 +7712,13 @@ eslint-config-airbnb@19.0.4: dependencies: "@babel/eslint-parser" "7.16.5" "@tanstack/eslint-plugin-query" "4.36.1" - "@typescript-eslint/eslint-plugin" "6.9.0" - "@typescript-eslint/parser" "6.9.0" + "@typescript-eslint/eslint-plugin" "6.10.0" + "@typescript-eslint/parser" "6.10.0" eslint "8.53.0" eslint-config-airbnb "19.0.4" eslint-import-resolver-webpack "0.13.8" eslint-plugin-compat "4.2.0" - eslint-plugin-graylog "file:../../../../.cache/yarn/v6/npm-eslint-config-graylog-1.3.0-35ef9e8a-5c65-4a74-b872-be8ed2614014-1699254561490/node_modules/eslint-plugin-graylog" + eslint-plugin-graylog "file:packages/eslint-plugin-graylog" eslint-plugin-import "2.25.3" eslint-plugin-jest "27.6.0" eslint-plugin-jest-dom "5.1.0" @@ -8571,14 +8555,14 @@ forever-agent@~0.6.1: integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= fork-ts-checker-webpack-plugin@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-9.0.0.tgz#e12b9e6116d32b07a2dbc0ea08f62b1cea24d35a" - integrity sha512-Kw3JjsfGs0piB0V2Em8gCuo51O3p4KyCOK0Tn8X57oq2mSNBrMmONALRBw5frcmWsOVU7iELXXsJ+FVxJeQuhA== + version "9.0.2" + resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-9.0.2.tgz#c12c590957837eb02b02916902dcf3e675fd2b1e" + integrity sha512-Uochze2R8peoN1XqlSi/rGUkDQpRogtLFocP9+PGu68zk1BDAKXfdeCdyVZpgTk8V8WFVQXdEz426VKjXLO1Gg== dependencies: "@babel/code-frame" "^7.16.7" chalk "^4.1.2" chokidar "^3.5.3" - cosmiconfig "^7.0.1" + cosmiconfig "^8.2.0" deepmerge "^4.2.2" fs-extra "^10.0.0" memfs "^3.4.1" @@ -9177,15 +9161,15 @@ graphemer@^1.4.0: "@graylog/sawmill" "2.0.7" "@tanstack/react-query" "4.36.1" "@types/create-react-class" "15.6.5" - "@types/jquery" "3.5.25" + "@types/jquery" "3.5.26" "@types/react" "18.2.20" - babel-preset-graylog "file:../../../../.cache/yarn/v6/npm-graylog-web-plugin-6.0.0-SNAPSHOT-a43348ef-be3c-41b4-9231-0496750dcb2b-1699254561342/node_modules/babel-preset-graylog" + babel-preset-graylog "file:packages/babel-preset-graylog" create-react-class "15.7.0" - eslint-config-graylog "file:../../../../.cache/yarn/v6/npm-graylog-web-plugin-6.0.0-SNAPSHOT-a43348ef-be3c-41b4-9231-0496750dcb2b-1699254561342/node_modules/eslint-config-graylog" + eslint-config-graylog "file:packages/eslint-config-graylog" formik "2.4.5" history "^5.3.0" html-webpack-plugin "^5.5.0" - jest-preset-graylog "file:../../../../.cache/yarn/v6/npm-graylog-web-plugin-6.0.0-SNAPSHOT-a43348ef-be3c-41b4-9231-0496750dcb2b-1699254561342/node_modules/jest-preset-graylog" + jest-preset-graylog "file:packages/jest-preset-graylog" jquery "3.7.1" moment "2.29.4" moment-timezone "0.5.43" @@ -9193,7 +9177,7 @@ graphemer@^1.4.0: react "16.14.0" react-dom "16.14.0" react-router-bootstrap "0.26.2" - react-router-dom "6.17.0" + react-router-dom "6.18.0" reflux "0.2.13" styled-components "6.0.9" typescript "5.2.2" @@ -13618,20 +13602,20 @@ react-router-bootstrap@0.26.2: dependencies: prop-types "^15.7.2" -react-router-dom@6.17.0: - version "6.17.0" - resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.17.0.tgz#ea73f89186546c1cf72b10fcb7356d874321b2ad" - integrity sha512-qWHkkbXQX+6li0COUUPKAUkxjNNqPJuiBd27dVwQGDNsuFBdMbrS6UZ0CLYc4CsbdLYTckn4oB4tGDuPZpPhaQ== +react-router-dom@6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.18.0.tgz#0a50c167209d6e7bd2ed9de200a6579ea4fb1dca" + integrity sha512-Ubrue4+Ercc/BoDkFQfc6og5zRQ4A8YxSO3Knsne+eRbZ+IepAsK249XBH/XaFuOYOYr3L3r13CXTLvYt5JDjw== dependencies: - "@remix-run/router" "1.10.0" - react-router "6.17.0" + "@remix-run/router" "1.11.0" + react-router "6.18.0" -react-router@6.17.0: - version "6.17.0" - resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.17.0.tgz#7b680c4cefbc425b57537eb9c73bedecbdc67c1e" - integrity sha512-YJR3OTJzi3zhqeJYADHANCGPUu9J+6fT5GLv82UWRGSxu6oJYCKVmxUcaBQuGm9udpWmPsvpme/CdHumqgsoaA== +react-router@6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.18.0.tgz#32e2bedc318e095a48763b5ed7758e54034cd36a" + integrity sha512-vk2y7Dsy8wI02eRRaRmOs9g2o+aE72YCx5q9VasT1N9v+lrdB79tIqrjMfByHiY5+6aYkH2rUa5X839nwWGPDg== dependencies: - "@remix-run/router" "1.10.0" + "@remix-run/router" "1.11.0" react-select-event@^5.0.0: version "5.0.0" From d47abf353b77233f54f72d3d8cf4a6ca42a83ba8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 10:09:10 +0100 Subject: [PATCH 10/39] Bump @types/react-window from 1.8.7 to 1.8.8 in /graylog2-web-interface (#17208) Bumps [@types/react-window](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-window) from 1.8.7 to 1.8.8. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-window) --- updated-dependencies: - dependency-name: "@types/react-window" dependency-type: direct:development 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 a21c63262846..e917d8b594f5 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -3996,9 +3996,9 @@ "@types/react" "*" "@types/react-window@^1.8.3": - version "1.8.7" - resolved "https://registry.yarnpkg.com/@types/react-window/-/react-window-1.8.7.tgz#742a5e00b7aa45c9f0afc1be8c7b562a36950e8a" - integrity sha512-FpPHEhmGVOBKomuR4LD2nvua1Ajcw6PfnfbDysuCwwPae3JNulcq3+uZIpQNbDN2AI1z+Y4tKj2xQ4ELiQ4QDw== + version "1.8.8" + resolved "https://registry.yarnpkg.com/@types/react-window/-/react-window-1.8.8.tgz#c20645414d142364fbe735818e1c1e0a145696e3" + integrity sha512-8Ls660bHR1AUA2kuRvVG9D/4XpRC6wjAaPT9dil7Ckc76eP9TKWZwwmgfq8Q1LANX3QNDnoU4Zp48A3w+zK69Q== dependencies: "@types/react" "*" From 0a1c0965d7fa7c0dfb1b6d82d11513ef333eec8a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 10:09:30 +0100 Subject: [PATCH 11/39] Bump @types/moment-duration-format in /graylog2-web-interface (#17209) Bumps [@types/moment-duration-format](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/moment-duration-format) from 2.2.5 to 2.2.6. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/moment-duration-format) --- updated-dependencies: - dependency-name: "@types/moment-duration-format" dependency-type: direct:development 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 e917d8b594f5..01e8c4b12004 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -3838,9 +3838,9 @@ integrity sha512-Kfe/D3hxHTusnPNRbycJE1N77WHDsdS4AjUYIzlDzhDrS47NrwuL3YW4VITxwR7KCVpzwgy4Rbj829KSSQmwXQ== "@types/moment-duration-format@^2.2.2": - version "2.2.5" - resolved "https://registry.yarnpkg.com/@types/moment-duration-format/-/moment-duration-format-2.2.5.tgz#8e290780c5f23b69d99d78f456e8a974c65b6fbf" - integrity sha512-0ojMdyThftIMXblaNFbIC4RUNUuiKyXP9BwywS6fm6L4Sod78ziFzO+cH2UWReexJo3go3xhkY3CVdcBiryocg== + version "2.2.6" + resolved "https://registry.yarnpkg.com/@types/moment-duration-format/-/moment-duration-format-2.2.6.tgz#953e24479475b1bfbce948e75fd47c5a4ec7f837" + integrity sha512-Qw+6ys3sQCatqukjoIBsL1UJq6S7ep4ixrNvDkdViSgzw2ZG3neArXNu3ww7mEG8kwP32ZDoON/esWb7OUckRQ== dependencies: moment ">=2.14.0" From bcf03bf77f630d89341d7c5345dde47ee2ade7ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 15:37:34 +0100 Subject: [PATCH 12/39] Bump @types/enzyme (#17216) Bumps [@types/enzyme](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/enzyme) from 3.10.15 to 3.10.16. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/enzyme) --- updated-dependencies: - dependency-name: "@types/enzyme" 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> --- .../packages/jest-preset-graylog/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graylog2-web-interface/packages/jest-preset-graylog/package.json b/graylog2-web-interface/packages/jest-preset-graylog/package.json index 4b3fcdadfacc..c88df2f3bb14 100644 --- a/graylog2-web-interface/packages/jest-preset-graylog/package.json +++ b/graylog2-web-interface/packages/jest-preset-graylog/package.json @@ -16,7 +16,7 @@ "@testing-library/react": "12.1.5", "@testing-library/react-hooks": "^8.0.0", "@testing-library/user-event": "^13.5.0", - "@types/enzyme": "3.10.15", + "@types/enzyme": "3.10.16", "@types/jest": "29.5.5", "babel-jest": "29.6.2", "enzyme": "3.11.0", From fbdad3fd48624ac101db3d7836d9ea6fac8cdc91 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 15:37:50 +0100 Subject: [PATCH 13/39] Bump @types/create-react-class (#17193) Bumps [@types/create-react-class](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/create-react-class) from 15.6.5 to 15.6.6. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/create-react-class) --- updated-dependencies: - dependency-name: "@types/create-react-class" 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 979eeac8c744..13396e3077a9 100644 --- a/graylog2-web-interface/packages/graylog-web-plugin/package.json +++ b/graylog2-web-interface/packages/graylog-web-plugin/package.json @@ -31,7 +31,7 @@ "dependencies": { "@graylog/sawmill": "2.0.7", "@tanstack/react-query": "4.36.1", - "@types/create-react-class": "15.6.5", + "@types/create-react-class": "15.6.6", "@types/jquery": "3.5.27", "@types/react": "18.2.20", "babel-preset-graylog": "file:../babel-preset-graylog", From 838ed35b74eda3f800d94608d1f5df0ead35d926 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 15:43:05 +0100 Subject: [PATCH 14/39] Bump mongodb-driver.version from 4.11.0 to 4.11.1 (#17228) Bumps `mongodb-driver.version` from 4.11.0 to 4.11.1. Updates `org.mongodb:mongodb-driver-sync` from 4.11.0 to 4.11.1 - [Release notes](https://github.com/mongodb/mongo-java-driver/releases) - [Commits](https://github.com/mongodb/mongo-java-driver/compare/r4.11.0...r4.11.1) Updates `org.mongodb:mongodb-driver-legacy` from 4.11.0 to 4.11.1 - [Release notes](https://github.com/mongodb/mongo-java-driver/releases) - [Commits](https://github.com/mongodb/mongo-java-driver/compare/r4.11.0...r4.11.1) --- updated-dependencies: - dependency-name: org.mongodb:mongodb-driver-sync dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.mongodb:mongodb-driver-legacy 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 b33857048a92..985f8266376d 100644 --- a/pom.xml +++ b/pom.xml @@ -148,7 +148,7 @@ 2.21.1 9.1.0 4.1.9 - 4.11.0 + 4.11.1 2.10.1.4 4.8.1-1 0.13 From 73128d7f46a7ae0a8100442ba537d1809afbce01 Mon Sep 17 00:00:00 2001 From: Ousmane SAMBA Date: Thu, 9 Nov 2023 18:03:49 +0100 Subject: [PATCH 15/39] Handle ignore_null on lookup cache form (#17218) Co-authored-by: Laura --- changelog/unreleased/pr-17218.toml | 6 ++++++ .../caches/CaffeineCacheFieldSet.tsx | 18 ++++++++++++++++++ .../src/logic/lookup-tables/types.ts | 1 + 3 files changed, 25 insertions(+) create mode 100644 changelog/unreleased/pr-17218.toml diff --git a/changelog/unreleased/pr-17218.toml b/changelog/unreleased/pr-17218.toml new file mode 100644 index 000000000000..41754ff16d3c --- /dev/null +++ b/changelog/unreleased/pr-17218.toml @@ -0,0 +1,6 @@ +type = "fixed" +message = "Show ignore_null configuration on lookup cache form." + +issues = ["15200"] +pulls = ["17218"] + diff --git a/graylog2-web-interface/src/components/lookup-tables/caches/CaffeineCacheFieldSet.tsx b/graylog2-web-interface/src/components/lookup-tables/caches/CaffeineCacheFieldSet.tsx index da1c0b87eb29..affc1585ce6d 100644 --- a/graylog2-web-interface/src/components/lookup-tables/caches/CaffeineCacheFieldSet.tsx +++ b/graylog2-web-interface/src/components/lookup-tables/caches/CaffeineCacheFieldSet.tsx @@ -17,8 +17,10 @@ import * as React from 'react'; import { useFormikContext } from 'formik'; +import { Input } from 'components/bootstrap'; import { FormikFormGroup, TimeUnitInput } from 'components/common'; import type { LookupTableCache, LookupTableCacheConfig } from 'logic/lookup-tables/types'; +import { getValueFromInput } from 'util/FormsUtils'; type Props = { config: LookupTableCacheConfig, @@ -43,6 +45,14 @@ const CaffeineCacheFieldSet = ({ config }: Props, ref: any) => { validate: () => (validateConfig()), })); + const handleIgnoreNullChange = (event) => { + const ignoreValue = getValueFromInput(event.target); + + const valConfig = { ...values.config, ignore_null: ignoreValue }; + setStateConfig(valConfig); + setValues({ ...values, config: valConfig }); + }; + const handleUpdate = (name: string) => (value: number, unit: string, enabled: boolean) => { const auxConfig = { ...stateConfig }; const auxValConfig = { ...values.config }; @@ -85,6 +95,14 @@ const CaffeineCacheFieldSet = ({ config }: Props, ref: any) => { defaultEnabled={config.expire_after_write > 0} labelClassName="col-sm-3" wrapperClassName="col-sm-9" /> + ); }; diff --git a/graylog2-web-interface/src/logic/lookup-tables/types.ts b/graylog2-web-interface/src/logic/lookup-tables/types.ts index 31e87ac7ee78..db3e43799180 100644 --- a/graylog2-web-interface/src/logic/lookup-tables/types.ts +++ b/graylog2-web-interface/src/logic/lookup-tables/types.ts @@ -30,6 +30,7 @@ export type LookupTableCacheConfig = { expire_after_access_unit?: 'NANOSECONDS' | 'MICROSECONDS' | 'MILLISECONDS' | 'SECONDS' | 'MINUTES' | 'HOURS' | 'DAYS' | null, expire_after_write?: number, expire_after_write_unit?: 'NANOSECONDS' | 'MICROSECONDS' | 'MILLISECONDS' | 'SECONDS' | 'MINUTES' | 'HOURS' | 'DAYS' | null, + ignore_null?: boolean, }; export type LookupTableCache = GenericEntityType & { From a2d353568129279fb5afe20c066e1985dd781da9 Mon Sep 17 00:00:00 2001 From: Ousmane SAMBA Date: Fri, 10 Nov 2023 12:14:38 +0100 Subject: [PATCH 16/39] Fix contentPack create revision not redirecting after creation (#17233) Co-authored-by: Laura --- changelog/unreleased/pr-17233.toml | 6 ++++++ graylog2-web-interface/src/pages/EditContentPackPage.jsx | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/pr-17233.toml diff --git a/changelog/unreleased/pr-17233.toml b/changelog/unreleased/pr-17233.toml new file mode 100644 index 000000000000..d09467c4e48e --- /dev/null +++ b/changelog/unreleased/pr-17233.toml @@ -0,0 +1,6 @@ +type = "fixed" +message = "Fix redirect after creating contentpack revision." + +issues = ["17071"] +pulls = ["17233"] + diff --git a/graylog2-web-interface/src/pages/EditContentPackPage.jsx b/graylog2-web-interface/src/pages/EditContentPackPage.jsx index 0d6a3d6e30a4..2a5d0e6faaba 100644 --- a/graylog2-web-interface/src/pages/EditContentPackPage.jsx +++ b/graylog2-web-interface/src/pages/EditContentPackPage.jsx @@ -22,6 +22,7 @@ import createReactClass from 'create-react-class'; import cloneDeep from 'lodash/cloneDeep'; import groupBy from 'lodash/groupBy'; +import withHistory from 'routing/withHistory'; import { LinkContainer } from 'components/common/router'; import Routes from 'routing/Routes'; import { Button } from 'components/bootstrap'; @@ -221,4 +222,4 @@ const EditContentPackPage = createReactClass({ }, }); -export default withParams(EditContentPackPage); +export default withHistory(withParams(EditContentPackPage)); From 47bb3922cc603079f7ed4045f42fe68bcb54ef17 Mon Sep 17 00:00:00 2001 From: luk-kaminski Date: Fri, 10 Nov 2023 12:41:39 +0100 Subject: [PATCH 17/39] Index set field types list (#17057) --- .../java/org/graylog2/indexer/IndexSet.java | 19 +++ .../IndexFieldTypesListService.java | 120 +++++++++++++++ .../fieldtypes/IndexFieldTypesService.java | 14 +- .../fieldtypes/utils/FieldTypeDTOsMerger.java | 49 ++++++ .../indexer/indexset/CustomFieldMapping.java | 17 +-- .../indexer/indexset/CustomFieldMappings.java | 19 ++- .../indexer/IndexSetsMappingResource.java | 34 ++++- .../indexer/responses/IndexSetFieldType.java | 65 ++++++++ .../org/graylog2/indexer/IndexSetTest.java | 59 ++++++++ .../IndexFieldTypesListServiceTest.java | 140 ++++++++++++++++++ .../utils/FieldTypeDTOsMergerTest.java | 114 ++++++++++++++ .../indexset/CustomFieldMappingTest.java | 49 ++++++ .../responses/IndexSetFieldTypeTest.java | 93 ++++++++++++ 13 files changed, 777 insertions(+), 15 deletions(-) create mode 100644 graylog2-server/src/main/java/org/graylog2/indexer/fieldtypes/IndexFieldTypesListService.java create mode 100644 graylog2-server/src/main/java/org/graylog2/indexer/fieldtypes/utils/FieldTypeDTOsMerger.java create mode 100644 graylog2-server/src/main/java/org/graylog2/rest/resources/system/indexer/responses/IndexSetFieldType.java create mode 100644 graylog2-server/src/test/java/org/graylog2/indexer/IndexSetTest.java create mode 100644 graylog2-server/src/test/java/org/graylog2/indexer/fieldtypes/IndexFieldTypesListServiceTest.java create mode 100644 graylog2-server/src/test/java/org/graylog2/indexer/fieldtypes/utils/FieldTypeDTOsMergerTest.java create mode 100644 graylog2-server/src/test/java/org/graylog2/indexer/indexset/CustomFieldMappingTest.java create mode 100644 graylog2-server/src/test/java/org/graylog2/rest/resources/system/indexer/responses/IndexSetFieldTypeTest.java diff --git a/graylog2-server/src/main/java/org/graylog2/indexer/IndexSet.java b/graylog2-server/src/main/java/org/graylog2/indexer/IndexSet.java index 8860e685b661..e639244ab970 100644 --- a/graylog2-server/src/main/java/org/graylog2/indexer/IndexSet.java +++ b/graylog2-server/src/main/java/org/graylog2/indexer/IndexSet.java @@ -170,6 +170,25 @@ public interface IndexSet extends Comparable { */ IndexSetConfig getConfig(); + default String getNthIndexBeforeActiveIndexSet(final int n) { + final String activeWriteIndex = getActiveWriteIndex(); + if (activeWriteIndex != null) { + final Optional deflectorNumber = extractIndexNumber(activeWriteIndex); + final String indexPrefix = getIndexPrefix(); + return deflectorNumber + .map(num -> { + final int indexNumber = num - n; + if (indexNumber >= 0) { + return indexPrefix + MongoIndexSet.SEPARATOR + indexNumber; + } + return null; + }) + .orElse(null); + } + + return null; + } + class IndexNameComparator implements Comparator { private final IndexSet indexSet; diff --git a/graylog2-server/src/main/java/org/graylog2/indexer/fieldtypes/IndexFieldTypesListService.java b/graylog2-server/src/main/java/org/graylog2/indexer/fieldtypes/IndexFieldTypesListService.java new file mode 100644 index 000000000000..0d94ae8a55be --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/indexer/fieldtypes/IndexFieldTypesListService.java @@ -0,0 +1,120 @@ +/* + * 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 + * . + */ +package org.graylog2.indexer.fieldtypes; + +import com.google.common.collect.ImmutableSet; +import org.graylog2.database.PaginatedList; +import org.graylog2.indexer.IndexSet; +import org.graylog2.indexer.MongoIndexSet; +import org.graylog2.indexer.fieldtypes.mapping.FieldTypeMappingsService; +import org.graylog2.indexer.fieldtypes.utils.FieldTypeDTOsMerger; +import org.graylog2.indexer.indexset.CustomFieldMappings; +import org.graylog2.indexer.indexset.IndexSetConfig; +import org.graylog2.indexer.indexset.IndexSetService; +import org.graylog2.rest.models.tools.responses.PageListResponse; +import org.graylog2.rest.resources.entities.Sorting; +import org.graylog2.rest.resources.system.indexer.responses.IndexSetFieldType; + +import javax.inject.Inject; +import java.util.Collection; +import java.util.List; +import java.util.Locale; +import java.util.Optional; +import java.util.Set; + +import static org.graylog2.indexer.fieldtypes.FieldTypeMapper.TYPE_MAP; +import static org.graylog2.indexer.indexset.CustomFieldMappings.REVERSE_TYPES; + +public class IndexFieldTypesListService { + + private IndexFieldTypesService indexFieldTypesService; + private final IndexSetService indexSetService; + private final MongoIndexSet.Factory indexSetFactory; + + private FieldTypeDTOsMerger fieldTypeDTOsMerger; + + @Inject + public IndexFieldTypesListService(final IndexFieldTypesService indexFieldTypesService, + final IndexSetService indexSetService, + final MongoIndexSet.Factory indexSetFactory, + final FieldTypeDTOsMerger fieldTypeDTOsMerger) { + this.indexFieldTypesService = indexFieldTypesService; + this.indexSetService = indexSetService; + this.indexSetFactory = indexSetFactory; + this.fieldTypeDTOsMerger = fieldTypeDTOsMerger; + } + + public PageListResponse getIndexSetFieldTypesList( + final String indexSetId, + final int page, + final int perPage, + final String sort, + final Sorting.Direction order) { + + final Optional indexSetConfig = indexSetService.get(indexSetId); + final Optional mongoIndexSet = indexSetConfig.map(indexSetFactory::create); + + final CustomFieldMappings customFieldMappings = indexSetConfig.map(IndexSetConfig::customFieldMappings).orElse(new CustomFieldMappings()); + + final Set deflectorFieldDtos = mongoIndexSet + .map(IndexSet::getActiveWriteIndex) + .map(indexName -> indexFieldTypesService.findOneByIndexName(indexName)) + .map(IndexFieldTypesDTO::fields) + .orElse(ImmutableSet.of()); + + final Set previousFieldDtos = mongoIndexSet + .map(this::getPreviousActiveIndexSet) + .map(indexName -> indexFieldTypesService.findOneByIndexName(indexName)) + .map(IndexFieldTypesDTO::fields) + .orElse(ImmutableSet.of()); + + final Collection allFields = fieldTypeDTOsMerger.merge(deflectorFieldDtos, previousFieldDtos, customFieldMappings); + final List retrievedPage = allFields + .stream() + .map(fieldTypeDTO -> new IndexSetFieldType( + fieldTypeDTO.fieldName(), + REVERSE_TYPES.get(TYPE_MAP.get(fieldTypeDTO.physicalType())), + customFieldMappings.containsCustomMappingForField(fieldTypeDTO.fieldName()), + FieldTypeMappingsService.BLACKLISTED_FIELDS.contains(fieldTypeDTO.fieldName()) + ) + ) + .sorted(IndexSetFieldType.getComparator(sort, order)) + .skip((long) Math.max(0, page - 1) * perPage) + .limit(perPage) + .toList(); + + final int total = allFields.size(); + + return PageListResponse.create("", + PaginatedList.PaginationInfo.create( + total, + retrievedPage.size(), + page, + perPage), + total, + sort, + order.toString().toLowerCase(Locale.ROOT), + retrievedPage, + IndexSetFieldType.ATTRIBUTES, + IndexSetFieldType.ENTITY_DEFAULTS); + + } + + private String getPreviousActiveIndexSet(final IndexSet indexSet) { + return indexSet.getNthIndexBeforeActiveIndexSet(1); + } +} diff --git a/graylog2-server/src/main/java/org/graylog2/indexer/fieldtypes/IndexFieldTypesService.java b/graylog2-server/src/main/java/org/graylog2/indexer/fieldtypes/IndexFieldTypesService.java index e37a4ee1d45f..bb5c2bbef60d 100644 --- a/graylog2-server/src/main/java/org/graylog2/indexer/fieldtypes/IndexFieldTypesService.java +++ b/graylog2-server/src/main/java/org/graylog2/indexer/fieldtypes/IndexFieldTypesService.java @@ -65,10 +65,12 @@ public class IndexFieldTypesService { private final JacksonDBCollection db; private final StreamService streamService; private final MongoCollection mongoCollection; + + @Inject - public IndexFieldTypesService(MongoConnection mongoConnection, - StreamService streamService, - MongoJackObjectMapperProvider objectMapperProvider) { + public IndexFieldTypesService(final MongoConnection mongoConnection, + final StreamService streamService, + final MongoJackObjectMapperProvider objectMapperProvider) { this.streamService = streamService; this.mongoCollection = mongoConnection.getMongoDatabase().getCollection("index_field_types"); this.db = JacksonDBCollection.wrap(mongoConnection.getDatabase().getCollection("index_field_types"), @@ -114,7 +116,7 @@ public List fieldTypeHistory(final String indexSetId, } else { LinkedList reducedTypeHistory = new LinkedList<>(); typeHistory.forEach(type -> { - if (reducedTypeHistory.isEmpty() || !type.equals(reducedTypeHistory.getLast())) { + if (reducedTypeHistory.isEmpty() || (type != null && !type.equals(reducedTypeHistory.getLast()))) { reducedTypeHistory.add(type); } }); @@ -205,4 +207,8 @@ public Collection findAll() { private Collection findByQuery(DBQuery.Query query) { return ImmutableList.copyOf((Iterable) db.find(query)); } + + public IndexFieldTypesDTO findOneByIndexName(final String indexName) { + return db.findOne(DBQuery.is(FIELD_INDEX_NAME, indexName)); + } } diff --git a/graylog2-server/src/main/java/org/graylog2/indexer/fieldtypes/utils/FieldTypeDTOsMerger.java b/graylog2-server/src/main/java/org/graylog2/indexer/fieldtypes/utils/FieldTypeDTOsMerger.java new file mode 100644 index 000000000000..f51e6e27819c --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/indexer/fieldtypes/utils/FieldTypeDTOsMerger.java @@ -0,0 +1,49 @@ +/* + * 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 + * . + */ +package org.graylog2.indexer.fieldtypes.utils; + +import org.graylog2.indexer.fieldtypes.FieldTypeDTO; +import org.graylog2.indexer.indexset.CustomFieldMappings; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +public class FieldTypeDTOsMerger { + + public Collection merge(final Collection fromNewerIndex, + final Collection fromOlderIndex, + final CustomFieldMappings customFieldMappings) { + Map result = new HashMap<>(); + if (fromNewerIndex != null) { + fromNewerIndex.forEach(dto -> result.put(dto.fieldName(), dto)); + } + if (fromOlderIndex != null) { + fromOlderIndex.forEach(dto -> result.putIfAbsent(dto.fieldName(), dto)); + } + if (customFieldMappings != null) { + customFieldMappings.forEach(customFieldMapping -> + result.put( + customFieldMapping.fieldName(), + customFieldMapping.toFieldTypeDTO() + ) + ); + } + + return result.values(); + } +} diff --git a/graylog2-server/src/main/java/org/graylog2/indexer/indexset/CustomFieldMapping.java b/graylog2-server/src/main/java/org/graylog2/indexer/indexset/CustomFieldMapping.java index d6ab6b502001..51a9a53dfc48 100644 --- a/graylog2-server/src/main/java/org/graylog2/indexer/indexset/CustomFieldMapping.java +++ b/graylog2-server/src/main/java/org/graylog2/indexer/indexset/CustomFieldMapping.java @@ -17,11 +17,8 @@ package org.graylog2.indexer.indexset; import com.fasterxml.jackson.annotation.JsonProperty; +import org.graylog2.indexer.fieldtypes.FieldTypeDTO; -import java.util.Map; -import java.util.stream.Collectors; - -import static org.graylog2.indexer.fieldtypes.FieldTypeMapper.TYPE_MAP; import static org.graylog2.indexer.indexset.CustomFieldMappings.AVAILABLE_TYPES; public record CustomFieldMapping(@JsonProperty("field") String fieldName, @@ -32,11 +29,13 @@ public String toPhysicalType() { throw new IllegalStateException("Invalid type specified: " + type()); } - var reverseMap = TYPE_MAP.entrySet() - .stream() - .filter(entry -> !entry.getKey().equals("half_float") && !entry.getKey().equals("scaled_float")) - .collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey)); + return typeDescription.physicalType(); + } - return reverseMap.get(typeDescription.type()); + public FieldTypeDTO toFieldTypeDTO() { + return FieldTypeDTO.create( + fieldName(), + toPhysicalType() + ); } } diff --git a/graylog2-server/src/main/java/org/graylog2/indexer/indexset/CustomFieldMappings.java b/graylog2-server/src/main/java/org/graylog2/indexer/indexset/CustomFieldMappings.java index 5d22d5cebae3..49f0c2ee4b68 100644 --- a/graylog2-server/src/main/java/org/graylog2/indexer/indexset/CustomFieldMappings.java +++ b/graylog2-server/src/main/java/org/graylog2/indexer/indexset/CustomFieldMappings.java @@ -27,7 +27,20 @@ import java.util.stream.Collectors; public class CustomFieldMappings extends HashSet { - public record TypeDescription(String description, FieldTypes.Type type) {} + public record TypeDescription(String description, FieldTypes.Type type, String physicalType) { + public TypeDescription(String description, FieldTypes.Type type) { + this(description, + type, + FieldTypeMapper.TYPE_MAP.entrySet() + .stream() + .filter(entry -> !entry.getKey().equals("half_float") && !entry.getKey().equals("scaled_float")) + .filter(entry -> entry.getValue().equals(type)) + .findFirst() + .map(Map.Entry::getKey) + .orElseThrow(() -> new IllegalArgumentException(description + " field in CustomFieldMappings.AVAILABLE_TYPES is set to illegal value"))); + + } + } public static final Map AVAILABLE_TYPES = ImmutableMap.builder() .put("string", new TypeDescription("String (aggregatable)", FieldTypeMapper.STRING_TYPE)) @@ -59,4 +72,8 @@ public CustomFieldMappings mergeWith(final CustomFieldMapping changedMapping) { modifiedMappings.add(changedMapping); return new CustomFieldMappings(modifiedMappings); } + + public boolean containsCustomMappingForField(final String fieldName) { + return stream().anyMatch(m -> m.fieldName().equals(fieldName)); + } } diff --git a/graylog2-server/src/main/java/org/graylog2/rest/resources/system/indexer/IndexSetsMappingResource.java b/graylog2-server/src/main/java/org/graylog2/rest/resources/system/indexer/IndexSetsMappingResource.java index c30ab27a855c..0ca09dd9ef3f 100644 --- a/graylog2-server/src/main/java/org/graylog2/rest/resources/system/indexer/IndexSetsMappingResource.java +++ b/graylog2-server/src/main/java/org/graylog2/rest/resources/system/indexer/IndexSetsMappingResource.java @@ -24,10 +24,12 @@ import org.graylog.plugins.views.search.permissions.SearchUser; import org.graylog.plugins.views.search.rest.PermittedStreams; import org.graylog2.audit.jersey.NoAuditEvent; +import org.graylog2.indexer.fieldtypes.IndexFieldTypesListService; import org.graylog2.indexer.indexset.IndexSetFieldTypeSummaryService; import org.graylog2.rest.models.tools.responses.PageListResponse; import org.graylog2.rest.resources.entities.Sorting; import org.graylog2.rest.resources.system.indexer.requests.FieldTypeSummaryRequest; +import org.graylog2.rest.resources.system.indexer.responses.IndexSetFieldType; import org.graylog2.rest.resources.system.indexer.responses.IndexSetFieldTypeSummary; import org.graylog2.shared.rest.resources.RestResource; import org.graylog2.shared.security.RestPermissions; @@ -36,8 +38,10 @@ import javax.validation.Valid; import javax.validation.constraints.NotNull; import javax.ws.rs.DefaultValue; +import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; +import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; @@ -55,13 +59,41 @@ public class IndexSetsMappingResource extends RestResource { private final IndexSetFieldTypeSummaryService indexSetFieldTypeSummaryService; private final PermittedStreams permittedStreams; + private final IndexFieldTypesListService indexFieldTypesListService; @Inject - public IndexSetsMappingResource(IndexSetFieldTypeSummaryService indexSetFieldTypeSummaryService, PermittedStreams permittedStreams) { + public IndexSetsMappingResource(final IndexSetFieldTypeSummaryService indexSetFieldTypeSummaryService, + final IndexFieldTypesListService indexFieldTypesListService, + final PermittedStreams permittedStreams) { this.indexSetFieldTypeSummaryService = indexSetFieldTypeSummaryService; + this.indexFieldTypesListService = indexFieldTypesListService; this.permittedStreams = permittedStreams; } + @GET + @Path("/{index_set_id}") + @Timed + @NoAuditEvent("No change to the DB") + @ApiOperation(value = "Gets list of field_name-field_type pairs for given index set") + public PageListResponse indexSetFieldTypesList(@ApiParam(name = "index_set_id") @PathParam("index_set_id") String indexSetId, + @ApiParam(name = "page") @QueryParam("page") @DefaultValue("1") int page, + @ApiParam(name = "per_page") @QueryParam("per_page") @DefaultValue("50") int perPage, + @ApiParam(name = "sort", + value = "The field to sort the result on", + required = true, + allowableValues = "field_name,type,is_custom,is_reserved") + @DefaultValue(IndexSetFieldType.DEFAULT_SORT_FIELD) @QueryParam("sort") String sort, + @ApiParam(name = "order", value = "The sort direction", allowableValues = "asc,desc") + @DefaultValue("asc") @QueryParam("order") String order, + @Context SearchUser searchUser) { + checkPermission(RestPermissions.INDEXSETS_READ, indexSetId); + return indexFieldTypesListService.getIndexSetFieldTypesList(indexSetId, + page, + perPage, + sort, + Sorting.Direction.valueOf(order.toUpperCase(Locale.ROOT))); + } + @POST @Timed @NoAuditEvent("No change to the DB") diff --git a/graylog2-server/src/main/java/org/graylog2/rest/resources/system/indexer/responses/IndexSetFieldType.java b/graylog2-server/src/main/java/org/graylog2/rest/resources/system/indexer/responses/IndexSetFieldType.java new file mode 100644 index 000000000000..209040f40d32 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/rest/resources/system/indexer/responses/IndexSetFieldType.java @@ -0,0 +1,65 @@ +/* + * 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 + * . + */ +package org.graylog2.rest.resources.system.indexer.responses; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.graylog2.rest.resources.entities.EntityAttribute; +import org.graylog2.rest.resources.entities.EntityDefaults; +import org.graylog2.rest.resources.entities.Sorting; + +import java.util.Comparator; +import java.util.List; + +public record IndexSetFieldType(@JsonProperty(FIELD_NAME) String fieldName, + @JsonProperty(TYPE) String type, + @JsonProperty(IS_CUSTOM) boolean isCustom, + @JsonProperty(IS_RESERVED) boolean isReserved) { + + static final String FIELD_NAME = "field_name"; + static final String TYPE = "type"; + static final String IS_CUSTOM = "is_custom"; + static final String IS_RESERVED = "is_reserved"; + + public static final String DEFAULT_SORT_FIELD = IndexSetFieldType.FIELD_NAME; + public static final Sorting DEFAULT_SORT = Sorting.create(DEFAULT_SORT_FIELD, Sorting.Direction.ASC); + public static final EntityDefaults ENTITY_DEFAULTS = EntityDefaults.builder() + .sort(DEFAULT_SORT) + .build(); + + public static final List ATTRIBUTES = List.of( + EntityAttribute.builder().id(IndexSetFieldType.FIELD_NAME).title("Field name").sortable(true).build(), + EntityAttribute.builder().id(IndexSetFieldType.IS_CUSTOM).title("Is Custom").sortable(true).build(), + EntityAttribute.builder().id(IndexSetFieldType.IS_RESERVED).title("Is Reserved").sortable(true).build(), + EntityAttribute.builder().id(IndexSetFieldType.TYPE).title("Type").sortable(true).build() + ); + + public static Comparator getComparator(final String sort, + final Sorting.Direction order) { + final Comparator comparator = switch (sort) { + case TYPE -> Comparator.comparing(IndexSetFieldType::type); + case IS_RESERVED -> Comparator.comparing(IndexSetFieldType::isReserved); + case IS_CUSTOM -> Comparator.comparing(IndexSetFieldType::isCustom); + default -> Comparator.comparing(IndexSetFieldType::fieldName); + }; + + if (order == Sorting.Direction.DESC) { + return comparator.reversed(); + } else { + return comparator; + } + } +} diff --git a/graylog2-server/src/test/java/org/graylog2/indexer/IndexSetTest.java b/graylog2-server/src/test/java/org/graylog2/indexer/IndexSetTest.java new file mode 100644 index 000000000000..462a832779f8 --- /dev/null +++ b/graylog2-server/src/test/java/org/graylog2/indexer/IndexSetTest.java @@ -0,0 +1,59 @@ +/* + * 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 + * . + */ +package org.graylog2.indexer; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.mockito.Mockito.doReturn; + +class IndexSetTest { + + IndexSet indexSet; + + @BeforeEach + void setUp() { + indexSet = Mockito.spy(IndexSet.class); + doReturn("graylog_13").when(indexSet).getActiveWriteIndex(); + doReturn(Optional.of(13)).when(indexSet).extractIndexNumber("graylog_13"); + doReturn("graylog").when(indexSet).getIndexPrefix(); + } + + @Test + void testGetNthIndexBeforeActiveIndexSetReturnsProperIndexNamesForProperCalls() { + assertEquals("graylog_12", indexSet.getNthIndexBeforeActiveIndexSet(1)); + assertEquals("graylog_10", indexSet.getNthIndexBeforeActiveIndexSet(3)); + assertEquals("graylog_0", indexSet.getNthIndexBeforeActiveIndexSet(13)); + } + + @Test + void testGetNthIndexBeforeActiveIndexSetReturnsNullForImproperCalls() { + assertNull(indexSet.getNthIndexBeforeActiveIndexSet(14)); + assertNull(indexSet.getNthIndexBeforeActiveIndexSet(50)); + } + + @Test + void testGetNthIndexBeforeActiveIndexSetReturnsNullWhenDeflectorIndexNumberCannotBeExtracted() { + doReturn(Optional.empty()).when(indexSet).extractIndexNumber("graylog_13"); + assertNull(indexSet.getNthIndexBeforeActiveIndexSet(1)); + } +} diff --git a/graylog2-server/src/test/java/org/graylog2/indexer/fieldtypes/IndexFieldTypesListServiceTest.java b/graylog2-server/src/test/java/org/graylog2/indexer/fieldtypes/IndexFieldTypesListServiceTest.java new file mode 100644 index 000000000000..693eb2920a2b --- /dev/null +++ b/graylog2-server/src/test/java/org/graylog2/indexer/fieldtypes/IndexFieldTypesListServiceTest.java @@ -0,0 +1,140 @@ +/* + * 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 + * . + */ +package org.graylog2.indexer.fieldtypes; + +import com.google.common.collect.ImmutableSet; +import org.graylog2.indexer.MongoIndexSet; +import org.graylog2.indexer.fieldtypes.utils.FieldTypeDTOsMerger; +import org.graylog2.indexer.indexset.CustomFieldMapping; +import org.graylog2.indexer.indexset.CustomFieldMappings; +import org.graylog2.indexer.indexset.IndexSetConfig; +import org.graylog2.indexer.indexset.IndexSetService; +import org.graylog2.rest.models.tools.responses.PageListResponse; +import org.graylog2.rest.resources.entities.Sorting; +import org.graylog2.rest.resources.system.indexer.responses.IndexSetFieldType; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.util.List; +import java.util.Optional; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verifyNoInteractions; + +@ExtendWith(MockitoExtension.class) +class IndexFieldTypesListServiceTest { + + IndexFieldTypesListService toTest; + + @Mock + IndexFieldTypesService indexFieldTypesService; + @Mock + IndexSetService indexSetService; + @Mock + MongoIndexSet.Factory indexSetFactory; + + @BeforeEach + void setUp() { + toTest = new IndexFieldTypesListService(indexFieldTypesService, indexSetService, indexSetFactory, new FieldTypeDTOsMerger()); + } + + @Test + void testReturnsEmptyPageOnWrongIndexId() { + doReturn(Optional.empty()).when(indexSetService).get("I_do_not_exist!"); + + final PageListResponse response = toTest.getIndexSetFieldTypesList("I_do_not_exist!", 0, 10, "index_set_id", Sorting.Direction.ASC); + + assertEquals(0, response.total()); + assertTrue(response.elements().isEmpty()); + + verifyNoInteractions(indexFieldTypesService); + verifyNoInteractions(indexSetFactory); + } + + @Test + void testReturnsEmptyPageIfCannotCreateIndexSetFromConfig() { + IndexSetConfig indexSetConfig = mock(IndexSetConfig.class); + doReturn(Optional.of(indexSetConfig)).when(indexSetService).get("I_am_strangely_broken!"); + doReturn(new CustomFieldMappings()).when(indexSetConfig).customFieldMappings(); + doReturn(null).when(indexSetFactory).create(indexSetConfig); + + + final PageListResponse response = toTest.getIndexSetFieldTypesList("I_am_strangely_broken!", 0, 10, "index_set_id", Sorting.Direction.ASC); + + assertEquals(0, response.total()); + assertTrue(response.elements().isEmpty()); + + verifyNoInteractions(indexFieldTypesService); + } + + @Test + void testMergesFieldsFromAllSourcesWhenRetrievingPage() { + IndexSetConfig indexSetConfig = mock(IndexSetConfig.class); + doReturn(Optional.of(indexSetConfig)).when(indexSetService).get("I_am_fine!"); + final CustomFieldMappings customFieldMappings = new CustomFieldMappings( + List.of(new CustomFieldMapping("field_1", "ip")) + ); + doReturn(customFieldMappings).when(indexSetConfig).customFieldMappings(); + MongoIndexSet indexSet = mock(MongoIndexSet.class); + doReturn("graylog_42").when(indexSet).getActiveWriteIndex(); + doReturn("graylog_41").when(indexSet).getNthIndexBeforeActiveIndexSet(1); + doReturn(indexSet).when(indexSetFactory).create(indexSetConfig); + + ImmutableSet deflectorFields = ImmutableSet.of( + FieldTypeDTO.create("field_1", "long"), + FieldTypeDTO.create("field_2", "long"), + FieldTypeDTO.create("field_3", "ip") + ); + IndexFieldTypesDTO deflectorDTO = IndexFieldTypesDTO.create("nvmd", "graylog_42", deflectorFields); + doReturn(deflectorDTO) + .when(indexFieldTypesService) + .findOneByIndexName("graylog_42"); + + ImmutableSet previousFields = ImmutableSet.of( + FieldTypeDTO.create("field_4", "keyword"), + FieldTypeDTO.create("field_5", "text") + ); + IndexFieldTypesDTO previousDTO = IndexFieldTypesDTO.create("nvmd", "graylog_42", previousFields); + doReturn(previousDTO) + .when(indexFieldTypesService) + .findOneByIndexName("graylog_41"); + + + PageListResponse response = toTest.getIndexSetFieldTypesList("I_am_fine!", 0, 2, "field_name", Sorting.Direction.ASC); + assertThat(response.elements()) + .containsExactly( + new IndexSetFieldType("field_1", "ip", true, false), + new IndexSetFieldType("field_2", "long", false, false) + ); + + response = toTest.getIndexSetFieldTypesList("I_am_fine!", 0, 2, "field_name", Sorting.Direction.DESC); + assertThat(response.elements()) + .containsExactly( + new IndexSetFieldType("field_5", "string_fts", false, false), + new IndexSetFieldType("field_4", "string", false, false) + ); + + + } +} diff --git a/graylog2-server/src/test/java/org/graylog2/indexer/fieldtypes/utils/FieldTypeDTOsMergerTest.java b/graylog2-server/src/test/java/org/graylog2/indexer/fieldtypes/utils/FieldTypeDTOsMergerTest.java new file mode 100644 index 000000000000..06c2febe690b --- /dev/null +++ b/graylog2-server/src/test/java/org/graylog2/indexer/fieldtypes/utils/FieldTypeDTOsMergerTest.java @@ -0,0 +1,114 @@ +/* + * 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 + * . + */ +package org.graylog2.indexer.fieldtypes.utils; + +import org.graylog2.indexer.fieldtypes.FieldTypeDTO; +import org.graylog2.indexer.indexset.CustomFieldMapping; +import org.graylog2.indexer.indexset.CustomFieldMappings; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.util.Collection; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; + +class FieldTypeDTOsMergerTest { + + private FieldTypeDTOsMerger toTest; + + @BeforeEach + void setUp() { + toTest = new FieldTypeDTOsMerger(); + } + + @Test + void fieldDTOsFromNewerIndexOverrideFieldDTOsFromOlderIndex() { + final Collection merged = toTest.merge( + List.of( + FieldTypeDTO.create("changed_field", "long") + ), + List.of( + FieldTypeDTO.create("changed_field", "text") + ), + new CustomFieldMappings() + ); + + assertThat(merged) + .isNotNull() + .hasSize(1) + .contains(FieldTypeDTO.create("changed_field", "long")); + } + + @Test + void customMappingsOverrideEverything() { + final Collection merged = toTest.merge( + List.of( + FieldTypeDTO.create("changed_field", "long") + ), + List.of( + FieldTypeDTO.create("changed_field", "text") + ), + new CustomFieldMappings( + List.of(new CustomFieldMapping("changed_field", "ip")) + ) + ); + + assertThat(merged) + .isNotNull() + .hasSize(1) + .contains(FieldTypeDTO.create("changed_field", "ip")); + } + + @Test + void complexMergeScenario() { + final Collection merged = toTest.merge( + List.of( + FieldTypeDTO.create("unique_in_new", "long"), + FieldTypeDTO.create("present_everywhere", "long"), + FieldTypeDTO.create("present_new_and_old", "long"), + FieldTypeDTO.create("present_custom_and_new", "long") + ), + List.of( + FieldTypeDTO.create("unique_in_old", "text"), + FieldTypeDTO.create("present_everywhere", "text"), + FieldTypeDTO.create("present_new_and_old", "text"), + FieldTypeDTO.create("present_custom_and_old", "text") + ), + new CustomFieldMappings( + List.of( + new CustomFieldMapping("unique_in_custom", "ip"), + new CustomFieldMapping("present_everywhere", "ip"), + new CustomFieldMapping("present_custom_and_new", "ip"), + new CustomFieldMapping("present_custom_and_old", "ip") + ) + ) + ); + + assertThat(merged) + .isNotNull() + .hasSize(7) + .contains(FieldTypeDTO.create("present_everywhere", "ip")) + .contains(FieldTypeDTO.create("unique_in_custom", "ip")) + .contains(FieldTypeDTO.create("present_custom_and_new", "ip")) + .contains(FieldTypeDTO.create("present_custom_and_old", "ip")) + .contains(FieldTypeDTO.create("unique_in_new", "long")) + .contains(FieldTypeDTO.create("present_new_and_old", "long")) + .contains(FieldTypeDTO.create("unique_in_old", "text")); + + } +} diff --git a/graylog2-server/src/test/java/org/graylog2/indexer/indexset/CustomFieldMappingTest.java b/graylog2-server/src/test/java/org/graylog2/indexer/indexset/CustomFieldMappingTest.java new file mode 100644 index 000000000000..abaf9f079079 --- /dev/null +++ b/graylog2-server/src/test/java/org/graylog2/indexer/indexset/CustomFieldMappingTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * . + */ +package org.graylog2.indexer.indexset; + +import org.graylog2.indexer.fieldtypes.FieldTypeDTO; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +class CustomFieldMappingTest { + + @Test + void testToPhysicalTypeThrowsExceptionWhenWrongTypeUsed() { + assertThrows(IllegalStateException.class, () -> new CustomFieldMapping("field_name", "bajobongo_type").toPhysicalType()); + } + + @Test + void testToPhysicalTypeReturnsProperPhysicalStringRepresentations() { + assertEquals("keyword", new CustomFieldMapping("field_name", "string").toPhysicalType()); + assertEquals("text", new CustomFieldMapping("field_name", "string_fts").toPhysicalType()); + } + + @Test + void testToPhysicalTypeReturnsProperPhysicalNumericRepresentations() { + assertEquals("long", new CustomFieldMapping("field_name", "long").toPhysicalType()); + assertEquals("double", new CustomFieldMapping("field_name", "double").toPhysicalType()); + } + + @Test + void testToFieldTypeDTO() { + assertEquals(FieldTypeDTO.create("x", "long"), + new CustomFieldMapping("x", "long").toFieldTypeDTO()); + } +} diff --git a/graylog2-server/src/test/java/org/graylog2/rest/resources/system/indexer/responses/IndexSetFieldTypeTest.java b/graylog2-server/src/test/java/org/graylog2/rest/resources/system/indexer/responses/IndexSetFieldTypeTest.java new file mode 100644 index 000000000000..338ad35bf71b --- /dev/null +++ b/graylog2-server/src/test/java/org/graylog2/rest/resources/system/indexer/responses/IndexSetFieldTypeTest.java @@ -0,0 +1,93 @@ +/* + * 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 + * . + */ +package org.graylog2.rest.resources.system.indexer.responses; + +import org.graylog2.rest.resources.entities.Sorting; +import org.junit.jupiter.api.Test; + +import java.util.Comparator; + +import static org.graylog2.rest.resources.system.indexer.responses.IndexSetFieldType.FIELD_NAME; +import static org.graylog2.rest.resources.system.indexer.responses.IndexSetFieldType.TYPE; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class IndexSetFieldTypeTest { + + + @Test + void testComparatorOnFieldName() { + + final Comparator fieldNameComparator = IndexSetFieldType.getComparator(FIELD_NAME, Sorting.Direction.ASC); + final Comparator reversedFieldNameComparator = IndexSetFieldType.getComparator(FIELD_NAME, Sorting.Direction.DESC); + assertEquals(0, fieldNameComparator.compare( + new IndexSetFieldType("buhaha", "long", true, false), + new IndexSetFieldType("buhaha", "string", true, false) + )); + assertEquals(0, reversedFieldNameComparator.compare( + new IndexSetFieldType("buhaha", "long", true, false), + new IndexSetFieldType("buhaha", "string", true, false) + )); + assertTrue(0 > fieldNameComparator.compare( + new IndexSetFieldType("buhaha", "long", true, false), + new IndexSetFieldType("chiquita", "string", true, false) + )); + assertTrue(0 < reversedFieldNameComparator.compare( + new IndexSetFieldType("buhaha", "long", true, false), + new IndexSetFieldType("chiquita", "string", true, false) + )); + assertTrue(0 < fieldNameComparator.compare( + new IndexSetFieldType("buhaha", "long", true, false), + new IndexSetFieldType("arizona", "string", true, false) + )); + assertTrue(0 > reversedFieldNameComparator.compare( + new IndexSetFieldType("buhaha", "long", true, false), + new IndexSetFieldType("arizona", "string", true, false) + )); + } + + @Test + void testComparatorOnFieldType() { + + final Comparator fieldTypeComparator = IndexSetFieldType.getComparator(TYPE, Sorting.Direction.ASC); + final Comparator reversedFieldTypeComparator = IndexSetFieldType.getComparator(TYPE, Sorting.Direction.DESC); + assertEquals(0, fieldTypeComparator.compare( + new IndexSetFieldType("buhaha", "long", true, false), + new IndexSetFieldType("buhaha", "long", true, false) + )); + assertEquals(0, reversedFieldTypeComparator.compare( + new IndexSetFieldType("buhaha", "long", true, false), + new IndexSetFieldType("buhaha", "long", true, false) + )); + assertTrue(0 > fieldTypeComparator.compare( + new IndexSetFieldType("buhaha", "long", true, false), + new IndexSetFieldType("chiquita", "string", true, false) + )); + assertTrue(0 < reversedFieldTypeComparator.compare( + new IndexSetFieldType("buhaha", "long", true, false), + new IndexSetFieldType("chiquita", "string", true, false) + )); + assertTrue(0 < fieldTypeComparator.compare( + new IndexSetFieldType("buhaha", "text", true, false), + new IndexSetFieldType("arizona", "string", true, false) + )); + assertTrue(0 > reversedFieldTypeComparator.compare( + new IndexSetFieldType("buhaha", "text", true, false), + new IndexSetFieldType("arizona", "string", true, false) + )); + } +} From fd16f7d6e79c1a1ebcdfcaeafb80c4426b42f42b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Nov 2023 15:19:23 +0100 Subject: [PATCH 18/39] Bump @types/lodash from 4.14.200 to 4.14.201 in /graylog2-web-interface (#17239) Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.14.200 to 4.14.201. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash) --- updated-dependencies: - dependency-name: "@types/lodash" dependency-type: direct:development 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 | 38 +++++++++++++++++++------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/graylog2-web-interface/yarn.lock b/graylog2-web-interface/yarn.lock index 01e8c4b12004..069c4cf2c88e 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -3610,10 +3610,10 @@ dependencies: "@types/node" "*" -"@types/create-react-class@15.6.5": - version "15.6.5" - resolved "https://registry.yarnpkg.com/@types/create-react-class/-/create-react-class-15.6.5.tgz#e32a3e7069d578b5835654b97d8bc2d8e130dcca" - integrity sha512-siVnXy7YQaOCf52+WjIBI7y1LcZaTZnyq8d3BwMdoUboiiSsL29C/XRAs/Y5rUkkbqYgZSNU6CX4rqM8CEyIqQ== +"@types/create-react-class@15.6.6": + version "15.6.6" + resolved "https://registry.yarnpkg.com/@types/create-react-class/-/create-react-class-15.6.6.tgz#08f53503d469bbf2e17991ee3612e3a16773a7cf" + integrity sha512-Jf9g3h/qeSZ678DVy0RD77fngh7+hX/AFGf+nLCvWwYS8IL4bJuK4+cnfbvdrOjEIkn4VIleLt+DrpqQyT9u5w== dependencies: "@types/react" "*" @@ -3629,7 +3629,7 @@ dependencies: "@types/enzyme" "*" -"@types/enzyme@*", "@types/enzyme@3.10.15": +"@types/enzyme@*": version "3.10.15" resolved "https://registry.yarnpkg.com/@types/enzyme/-/enzyme-3.10.15.tgz#56d1167bb11a2c3f65af790de0cbb0e990b21489" integrity sha512-Tdm2XXW7TfyKhb/ddSLMpj8W0UgxbCOOauFNeLJH7+KzsfOBrHF6XPctw11SwGoOPyUglYQpvMoQNFXOF0uTwg== @@ -3637,6 +3637,14 @@ "@types/cheerio" "*" "@types/react" "^16" +"@types/enzyme@3.10.16": + version "3.10.16" + resolved "https://registry.yarnpkg.com/@types/enzyme/-/enzyme-3.10.16.tgz#100c49093f694545fc903266b2eb410df08859a9" + integrity sha512-17uMdJjSKjvdn/MhO/G2lRNPZGvJxFpvgONrsRoS1+khtJ6UcnCwC9v3gk2UqPyAkMZb6a1VYxScc/vOgkDl9w== + dependencies: + "@types/cheerio" "*" + "@types/react" "^16" + "@types/eslint-scope@^3.7.3": version "3.7.3" resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.3.tgz#125b88504b61e3c8bc6f870882003253005c3224" @@ -3779,10 +3787,10 @@ expect "^29.0.0" pretty-format "^29.0.0" -"@types/jquery@3.5.26": - version "3.5.26" - resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.26.tgz#af9e5bf442b2ed813eb6a73c06c714621f68e9de" - integrity sha512-wWYf2NBI6b+1RPQY86B74HSgZNsLAUtr4eFlGQoOQPJw/B3mCMfwWCflZWQ7OKtAB18MJCcYpL6+0NZbMIXl5g== +"@types/jquery@3.5.27": + version "3.5.27" + resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.27.tgz#d9d67a003d0292a36fe35868a618c82f8fd12b19" + integrity sha512-TR28Y8ezIGgfyA02UOh9x+Fy16/1qWYAnvtRd2gTBJuccX/vmddyti0MezLkTv7f+OLofVc2T961VPyKv1tXJQ== dependencies: "@types/sizzle" "*" @@ -3818,9 +3826,9 @@ "@types/geojson" "*" "@types/lodash@^4.14.165": - version "4.14.200" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.200.tgz#435b6035c7eba9cdf1e039af8212c9e9281e7149" - integrity sha512-YI/M/4HRImtNf3pJgbF+W6FrXovqj+T+/HpENLTooK9PnkacBsDpeP3IpHab40CClUfhNmdM2WTNP2sa2dni5Q== + version "4.14.201" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.201.tgz#76f47cb63124e806824b6c18463daf3e1d480239" + integrity sha512-y9euML0cim1JrykNxADLfaG0FgD1g/yTHwUs/Jg9ZIU7WKj2/4IW9Lbb1WZbvck78W/lfGXFfe+u2EGfIJXdLQ== "@types/md5@^2.3.0": version "2.3.4" @@ -9160,8 +9168,8 @@ graphemer@^1.4.0: dependencies: "@graylog/sawmill" "2.0.7" "@tanstack/react-query" "4.36.1" - "@types/create-react-class" "15.6.5" - "@types/jquery" "3.5.26" + "@types/create-react-class" "15.6.6" + "@types/jquery" "3.5.27" "@types/react" "18.2.20" babel-preset-graylog "file:packages/babel-preset-graylog" create-react-class "15.7.0" @@ -10764,7 +10772,7 @@ jest-pnp-resolver@^1.2.2: "@testing-library/react" "12.1.5" "@testing-library/react-hooks" "^8.0.0" "@testing-library/user-event" "^13.5.0" - "@types/enzyme" "3.10.15" + "@types/enzyme" "3.10.16" "@types/jest" "29.5.5" babel-jest "29.6.2" enzyme "3.11.0" From 664cd4be24f79378a2c5c278e0c0cc0994c2084f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Nov 2023 15:20:01 +0100 Subject: [PATCH 19/39] Bump @types/mousetrap from 1.6.13 to 1.6.14 in /graylog2-web-interface (#17238) Bumps [@types/mousetrap](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mousetrap) from 1.6.13 to 1.6.14. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mousetrap) --- updated-dependencies: - dependency-name: "@types/mousetrap" dependency-type: direct:development 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 | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/graylog2-web-interface/package.json b/graylog2-web-interface/package.json index 5a694be7c7b7..0d5f1778e48d 100644 --- a/graylog2-web-interface/package.json +++ b/graylog2-web-interface/package.json @@ -129,7 +129,7 @@ "@types/lodash": "^4.14.165", "@types/md5": "^2.3.0", "@types/moment-duration-format": "^2.2.2", - "@types/mousetrap": "1.6.13", + "@types/mousetrap": "1.6.14", "@types/numeral": "^2.0.1", "@types/plotly.js": "2.12.29", "@types/react-beautiful-dnd": "^13.0.0", diff --git a/graylog2-web-interface/yarn.lock b/graylog2-web-interface/yarn.lock index 069c4cf2c88e..668b4142427b 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -3852,10 +3852,10 @@ dependencies: moment ">=2.14.0" -"@types/mousetrap@1.6.13": - version "1.6.13" - resolved "https://registry.yarnpkg.com/@types/mousetrap/-/mousetrap-1.6.13.tgz#1b2e4cd374fdd1ee58a240be0aafd94f7270b3be" - integrity sha512-dEzDpaR+P/thkMsjsREQDX9OP8AMyLncTkgUgTTIxq5lJTlQffiLJt67ImDtaX+kC7CaNIX30pfdrrMZkym+eg== +"@types/mousetrap@1.6.14": + version "1.6.14" + resolved "https://registry.yarnpkg.com/@types/mousetrap/-/mousetrap-1.6.14.tgz#8043e982305d4a651a6488a128033ad6d82ff325" + integrity sha512-aY69yje/bZllr99dbIcQwB365YDH/9myLodpxQ8cQZhGfavICi389aRvwa5LUoW+gTpcZKHjVI/sc0dDjUqVuw== "@types/node@*": version "13.7.4" From 3bfae27a8132f903669c9aa762cad80d1af11db8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Nov 2023 15:20:20 +0100 Subject: [PATCH 20/39] Bump @types/react-beautiful-dnd in /graylog2-web-interface (#17237) Bumps [@types/react-beautiful-dnd](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-beautiful-dnd) from 13.1.6 to 13.1.7. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-beautiful-dnd) --- updated-dependencies: - dependency-name: "@types/react-beautiful-dnd" dependency-type: direct:development 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 668b4142427b..d61a8efe4243 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -3898,9 +3898,9 @@ integrity sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA== "@types/react-beautiful-dnd@^13.0.0": - version "13.1.6" - resolved "https://registry.yarnpkg.com/@types/react-beautiful-dnd/-/react-beautiful-dnd-13.1.6.tgz#a616443903bfc370fee298b0144dbce7234d5561" - integrity sha512-FXAuaa52ux7HWQDumi3MFSAAsW8OKfDImy1pSZPKe85nV9mZ1f4spVzW0a2boYvkIhphjbWUi5EwUiRG8Rq/Qg== + version "13.1.7" + resolved "https://registry.yarnpkg.com/@types/react-beautiful-dnd/-/react-beautiful-dnd-13.1.7.tgz#cc8038896ee7dee99b8bfd0eaed0a02a8617bedc" + integrity sha512-jQZLov9OkD0xRQkqz8/lx66bHYAYv+g4+POBqnH5Jtt/xo4MygzM879Q9sxAiosPBdNj1JYTdbPxDn3dNRYgow== dependencies: "@types/react" "*" From 659049352c3439e0a4263f34e8d673407e65b037 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Nov 2023 15:20:49 +0100 Subject: [PATCH 21/39] Bump the babel group (#17236) Bumps the babel group in /graylog2-web-interface/packages/babel-preset-graylog with 4 updates: [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime), [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env), [@babel/preset-react](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-react) and [@babel/preset-typescript](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-typescript). Updates `@babel/plugin-transform-runtime` from 7.23.2 to 7.23.3 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.3/packages/babel-plugin-transform-runtime) Updates `@babel/preset-env` from 7.23.2 to 7.23.3 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.3/packages/babel-preset-env) Updates `@babel/preset-react` from 7.22.15 to 7.23.3 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.3/packages/babel-preset-react) Updates `@babel/preset-typescript` from 7.23.2 to 7.23.3 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.3/packages/babel-preset-typescript) --- updated-dependencies: - dependency-name: "@babel/plugin-transform-runtime" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: babel - dependency-name: "@babel/preset-env" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: babel - dependency-name: "@babel/preset-react" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: babel - dependency-name: "@babel/preset-typescript" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: babel ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../packages/babel-preset-graylog/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/graylog2-web-interface/packages/babel-preset-graylog/package.json b/graylog2-web-interface/packages/babel-preset-graylog/package.json index 50c02ae0a527..dd105c5ac948 100644 --- a/graylog2-web-interface/packages/babel-preset-graylog/package.json +++ b/graylog2-web-interface/packages/babel-preset-graylog/package.json @@ -9,10 +9,10 @@ "dependencies": { "@babel/core": "^7.18.2", "@babel/plugin-syntax-dynamic-import": "7.8.3", - "@babel/plugin-transform-runtime": "7.23.2", - "@babel/preset-env": "7.23.2", - "@babel/preset-react": "7.22.15", - "@babel/preset-typescript": "7.23.2", + "@babel/plugin-transform-runtime": "7.23.3", + "@babel/preset-env": "7.23.3", + "@babel/preset-react": "7.23.3", + "@babel/preset-typescript": "7.23.3", "babel-plugin-styled-components": "^2.0.7" } } From 8f3f6c4dd9e0f81febd824becb209aa67cc38757 Mon Sep 17 00:00:00 2001 From: Patrick Mann Date: Fri, 10 Nov 2023 15:39:59 +0100 Subject: [PATCH 22/39] Exclude non-message streams from search in aggregation events (#17087) * exclude non-message streams from default search * update CL * update CL * apply filtering to search query * use PermittedStreams for filter search --- changelog/unreleased/pr-17087.toml | 5 +++ .../events/processor/EventStreamService.java | 4 +-- .../AggregationEventProcessor.java | 12 +++++-- .../AggregationEventProcessorTest.java | 32 +++++++++++-------- 4 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 changelog/unreleased/pr-17087.toml diff --git a/changelog/unreleased/pr-17087.toml b/changelog/unreleased/pr-17087.toml new file mode 100644 index 000000000000..417178003ee8 --- /dev/null +++ b/changelog/unreleased/pr-17087.toml @@ -0,0 +1,5 @@ +type = "f" +message = "Exclude non-message streams from aggregation event searches." + +issues = ["Graylog2/graylog-plugin-enterprise#6042"] +pulls = ["17087"] diff --git a/graylog2-server/src/main/java/org/graylog/events/processor/EventStreamService.java b/graylog2-server/src/main/java/org/graylog/events/processor/EventStreamService.java index 23f8f355afb4..f4f555499d45 100644 --- a/graylog2-server/src/main/java/org/graylog/events/processor/EventStreamService.java +++ b/graylog2-server/src/main/java/org/graylog/events/processor/EventStreamService.java @@ -41,11 +41,11 @@ public Set buildEventSourceStreams(Set searchStreams, Set !Stream.DEFAULT_EVENT_STREAM_IDS.contains(streamId)) + .filter(streamId -> !Stream.NON_MESSAGE_STREAM_IDS.contains(streamId)) .collect(Collectors.toSet()); } else if (searchStreams.isEmpty()) { // If the search streams is empty, we search in all streams and so we include all source streams from the result. diff --git a/graylog2-server/src/main/java/org/graylog/events/processor/aggregation/AggregationEventProcessor.java b/graylog2-server/src/main/java/org/graylog/events/processor/aggregation/AggregationEventProcessor.java index df610c351162..7feb0befc812 100644 --- a/graylog2-server/src/main/java/org/graylog/events/processor/aggregation/AggregationEventProcessor.java +++ b/graylog2-server/src/main/java/org/graylog/events/processor/aggregation/AggregationEventProcessor.java @@ -43,6 +43,7 @@ import org.graylog.plugins.views.search.elasticsearch.ElasticsearchQueryString; import org.graylog.plugins.views.search.errors.ParameterExpansionError; import org.graylog.plugins.views.search.errors.SearchException; +import org.graylog.plugins.views.search.rest.PermittedStreams; import org.graylog.plugins.views.search.searchtypes.pivot.HasField; import org.graylog.plugins.views.search.searchtypes.pivot.SeriesSpec; import org.graylog.plugins.views.search.searchtypes.pivot.series.HasOptionalField; @@ -62,6 +63,7 @@ import javax.inject.Inject; import java.io.IOException; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; @@ -92,6 +94,7 @@ public interface Factory extends EventProcessor.Factory getStreams(AggregationEventProcessorParameters parameters) { private void filterSearch(EventFactory eventFactory, AggregationEventProcessorParameters parameters, EventConsumer> eventsConsumer) throws EventProcessorException { - final Set streams = getStreams(parameters); + Set streams = getStreams(parameters); + if (streams.isEmpty()) { + streams = new HashSet<>(permittedStreams.load(streamId -> true)); + } final AtomicInteger messageCount = new AtomicInteger(0); final MoreSearch.ScrollCallback callback = (messages, continueScrolling) -> { diff --git a/graylog2-server/src/test/java/org/graylog/events/processor/aggregation/AggregationEventProcessorTest.java b/graylog2-server/src/test/java/org/graylog/events/processor/aggregation/AggregationEventProcessorTest.java index 8fa13a479e01..fe9bc18a66bb 100644 --- a/graylog2-server/src/test/java/org/graylog/events/processor/aggregation/AggregationEventProcessorTest.java +++ b/graylog2-server/src/test/java/org/graylog/events/processor/aggregation/AggregationEventProcessorTest.java @@ -33,6 +33,7 @@ import org.graylog.events.processor.EventProcessorPreconditionException; import org.graylog.events.processor.EventStreamService; import org.graylog.events.search.MoreSearch; +import org.graylog.plugins.views.search.rest.PermittedStreams; import org.graylog.plugins.views.search.searchtypes.pivot.SeriesSpec; import org.graylog.plugins.views.search.searchtypes.pivot.series.Cardinality; import org.graylog.plugins.views.search.searchtypes.pivot.series.Count; @@ -65,7 +66,6 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.times; @@ -93,20 +93,26 @@ public class AggregationEventProcessorTest { private Consumer> messageConsumer; @Mock private NotificationService notificationService; + @Mock + private StreamService streamService; + + private PermittedStreams permittedStreams; private EventStreamService eventStreamService; @Before public void setUp() throws Exception { - final StreamService streamService = mock(StreamService.class); - eventStreamService = new EventStreamService(streamService); when(streamService.loadAll()).thenReturn(ImmutableList.of( new StreamMock(Collections.singletonMap("_id", "stream-1"), Collections.emptyList()), new StreamMock(Collections.singletonMap("_id", "stream-2"), Collections.emptyList()), new StreamMock(Collections.singletonMap("_id", "stream-3"), Collections.emptyList()), new StreamMock(Collections.singletonMap("_id", StreamImpl.DEFAULT_STREAM_ID), Collections.emptyList()), new StreamMock(Collections.singletonMap("_id", StreamImpl.DEFAULT_EVENTS_STREAM_ID), Collections.emptyList()), - new StreamMock(Collections.singletonMap("_id", StreamImpl.DEFAULT_SYSTEM_EVENTS_STREAM_ID), Collections.emptyList()) + new StreamMock(Collections.singletonMap("_id", StreamImpl.DEFAULT_SYSTEM_EVENTS_STREAM_ID), Collections.emptyList()), + new StreamMock(Collections.singletonMap("_id", StreamImpl.FAILURES_STREAM_ID), Collections.emptyList()) )); + + eventStreamService = new EventStreamService(streamService); + permittedStreams = new PermittedStreams(streamService); } @Test @@ -127,7 +133,7 @@ public void testEventsFromAggregationResult() throws EventProcessorException { .build(); final AggregationEventProcessor eventProcessor = new AggregationEventProcessor( - eventDefinitionDto, searchFactory, eventProcessorDependencyCheck, stateService, moreSearch, eventStreamService, messages, notificationService); + eventDefinitionDto, searchFactory, eventProcessorDependencyCheck, stateService, moreSearch, eventStreamService, messages, notificationService, permittedStreams); final AggregationResult result = AggregationResult.builder() .effectiveTimerange(timerange) @@ -223,7 +229,7 @@ public void testEventsFromAggregationResultWithConditions() throws EventProcesso .timerange(timerange) .build(); - final AggregationEventProcessor eventProcessor = new AggregationEventProcessor(eventDefinitionDto, searchFactory, eventProcessorDependencyCheck, stateService, moreSearch, eventStreamService, messages, notificationService); + final AggregationEventProcessor eventProcessor = new AggregationEventProcessor(eventDefinitionDto, searchFactory, eventProcessorDependencyCheck, stateService, moreSearch, eventStreamService, messages, notificationService, permittedStreams); final AggregationResult result = AggregationResult.builder() .effectiveTimerange(timerange) @@ -326,13 +332,13 @@ public void createEventsWithFilter() throws Exception { .timerange(timerange) .build(); - final AggregationEventProcessor eventProcessor = new AggregationEventProcessor(eventDefinitionDto, searchFactory, eventProcessorDependencyCheck, stateService, moreSearch, eventStreamService, messages, notificationService); + final AggregationEventProcessor eventProcessor = new AggregationEventProcessor(eventDefinitionDto, searchFactory, eventProcessorDependencyCheck, stateService, moreSearch, eventStreamService, messages, notificationService, permittedStreams); assertThatCode(() -> eventProcessor.createEvents(eventFactory, parameters, (events) -> {})).doesNotThrowAnyException(); verify(moreSearch, times(1)).scrollQuery( eq(config.query()), - eq(config.streams()), + eq(ImmutableSet.of("stream-3", "stream-2", "stream-1", "000000000000000000000001")), eq(config.queryParameters()), eq(parameters.timerange()), eq(parameters.batchSize()), @@ -360,7 +366,7 @@ public void createEventsWithoutRequiredMessagesBeingIndexed() throws Exception { .timerange(timerange) .build(); - final AggregationEventProcessor eventProcessor = new AggregationEventProcessor(eventDefinitionDto, searchFactory, eventProcessorDependencyCheck, stateService, moreSearch, eventStreamService, messages, notificationService); + final AggregationEventProcessor eventProcessor = new AggregationEventProcessor(eventDefinitionDto, searchFactory, eventProcessorDependencyCheck, stateService, moreSearch, eventStreamService, messages, notificationService, permittedStreams); // If the dependency check returns true, there should be no exception raised and the state service should be called when(eventProcessorDependencyCheck.hasMessagesIndexedUpTo(timerange)).thenReturn(true); @@ -370,7 +376,7 @@ public void createEventsWithoutRequiredMessagesBeingIndexed() throws Exception { verify(stateService, times(1)).setState("dto-id-1", timerange.from(), timerange.to()); verify(moreSearch, times(1)).scrollQuery( eq(config.query()), - eq(config.streams()), + eq(ImmutableSet.of("stream-3", "stream-2", "stream-1", "000000000000000000000001")), eq(config.queryParameters()), eq(parameters.timerange()), eq(parameters.batchSize()), @@ -418,7 +424,7 @@ public void testEventsFromAggregationResultWithEmptyResultUsesEventDefinitionStr .timerange(timerange) .build(); - final AggregationEventProcessor eventProcessor = new AggregationEventProcessor(eventDefinitionDto, searchFactory, eventProcessorDependencyCheck, stateService, moreSearch, eventStreamService, messages, notificationService); + final AggregationEventProcessor eventProcessor = new AggregationEventProcessor(eventDefinitionDto, searchFactory, eventProcessorDependencyCheck, stateService, moreSearch, eventStreamService, messages, notificationService, permittedStreams); final AggregationResult result = buildAggregationResult(timerange, timerange.to(), ImmutableList.of("one", "two")); final ImmutableList eventsWithContext = eventProcessor.eventsFromAggregationResult(eventFactory, parameters, result); @@ -463,7 +469,7 @@ public void testEventsFromAggregationResultWithEmptyResultAndNoConfiguredStreams .build(); final AggregationEventProcessor eventProcessor = new AggregationEventProcessor(eventDefinitionDto, searchFactory, eventProcessorDependencyCheck, stateService, moreSearch, - eventStreamService, messages, notificationService); + eventStreamService, messages, notificationService, permittedStreams); final AggregationResult result = buildAggregationResult(timerange, timerange.to(), ImmutableList.of("one", "two")); final ImmutableList eventsWithContext = eventProcessor.eventsFromAggregationResult(eventFactory, parameters, result); @@ -554,7 +560,7 @@ private void sourceMessagesWithAggregation(Map groupByFields, in .build(); final EventDefinitionDto eventDefinitionDto = buildEventDefinitionDto(ImmutableSet.of(), ImmutableList.of(series), null); final AggregationEventProcessor eventProcessor = new AggregationEventProcessor( - eventDefinitionDto, searchFactory, eventProcessorDependencyCheck, stateService, moreSearch, eventStreamService, messages, notificationService); + eventDefinitionDto, searchFactory, eventProcessorDependencyCheck, stateService, moreSearch, eventStreamService, messages, notificationService, permittedStreams); eventProcessor.sourceMessagesForEvent(event, messageConsumer, batchLimit); } From cc4c966e4e3209c4a8359d6ea4be5e3ef7e0c77d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 08:16:26 +0100 Subject: [PATCH 23/39] Bump @types/react-slider from 1.3.3 to 1.3.4 in /graylog2-web-interface (#17252) Bumps [@types/react-slider](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-slider) from 1.3.3 to 1.3.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-slider) --- updated-dependencies: - dependency-name: "@types/react-slider" dependency-type: direct:development 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 | 734 ++++++++++++++++++++----------- 1 file changed, 488 insertions(+), 246 deletions(-) diff --git a/graylog2-web-interface/yarn.lock b/graylog2-web-interface/yarn.lock index d61a8efe4243..57f1eafaa2b9 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -76,10 +76,10 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.6.tgz#15606a20341de59ba02cd2fcc5086fcbe73bf544" integrity sha512-29tfsWTq2Ftu7MXmimyC0C5FDZv5DYxOZkh3XD3+QW4V/BYuv/LyEsjj3c0hqedEaDt6DBfDvexMKU8YevdqFg== -"@babel/compat-data@^7.23.2": - version "7.23.2" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.2.tgz#6a12ced93455827037bfb5ed8492820d60fc32cc" - integrity sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ== +"@babel/compat-data@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.3.tgz#3febd552541e62b5e883a25eb3effd7c7379db11" + integrity sha512-BmR4bWbDIoFJmJ9z2cZ8Gmm2MXgEDgjdWgpKmKWUt54UGFJdlj31ECtbaDvCG/qVdG3AQ1SfpZEs01lUFbzLOQ== "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.17.9", "@babel/core@^7.18.2": version "7.18.2" @@ -212,6 +212,13 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-builder-binary-assignment-operator-visitor@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.15.tgz#5426b109cf3ad47b91120f8328d8ab1be8b0b956" + integrity sha512-QkBXwGgaoC2GtGZRoma6kv7Szfv06khvhFav67ZExau2RaXzy8MpHSMO2PNoP2XtmQphJQRHFfg77Bq731Yizw== + dependencies: + "@babel/types" "^7.22.15" + "@babel/helper-builder-binary-assignment-operator-visitor@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.5.tgz#a3f4758efdd0190d8927fcffd261755937c71878" @@ -298,21 +305,6 @@ "@babel/helper-split-export-declaration" "^7.22.6" semver "^6.3.1" -"@babel/helper-create-class-features-plugin@^7.22.11": - version "7.22.11" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.11.tgz#4078686740459eeb4af3494a273ac09148dfb213" - integrity sha512-y1grdYL4WzmUDBRGK0pDbIoFd7UZKoDurDzWEoNMYoj1EL+foGRQNyPWDcC+YyegN5y1DUsFFmzjGijB3nSVAQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-environment-visitor" "^7.22.5" - "@babel/helper-function-name" "^7.22.5" - "@babel/helper-member-expression-to-functions" "^7.22.5" - "@babel/helper-optimise-call-expression" "^7.22.5" - "@babel/helper-replace-supers" "^7.22.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - semver "^6.3.1" - "@babel/helper-create-class-features-plugin@^7.22.15": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.15.tgz#97a61b385e57fe458496fad19f8e63b63c867de4" @@ -367,6 +359,15 @@ "@babel/helper-annotate-as-pure" "^7.18.6" regexpu-core "^5.1.0" +"@babel/helper-create-regexp-features-plugin@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz#5ee90093914ea09639b01c711db0d6775e558be1" + integrity sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + regexpu-core "^5.3.1" + semver "^6.3.1" + "@babel/helper-create-regexp-features-plugin@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.5.tgz#bb2bf0debfe39b831986a4efbf4066586819c6e4" @@ -538,10 +539,10 @@ "@babel/helper-split-export-declaration" "^7.22.6" "@babel/helper-validator-identifier" "^7.22.5" -"@babel/helper-module-transforms@^7.23.0": - version "7.23.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz#3ec246457f6c842c0aee62a01f60739906f7047e" - integrity sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw== +"@babel/helper-module-transforms@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" + integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== dependencies: "@babel/helper-environment-visitor" "^7.22.20" "@babel/helper-module-imports" "^7.22.15" @@ -590,6 +591,15 @@ "@babel/helper-wrap-function" "^7.22.5" "@babel/types" "^7.22.5" +"@babel/helper-replace-supers@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.20.tgz#e37d367123ca98fe455a9887734ed2e16eb7a793" + integrity sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw== + dependencies: + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-member-expression-to-functions" "^7.22.15" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-replace-supers@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.5.tgz#71bc5fb348856dea9fdc4eafd7e2e49f585145dc" @@ -797,13 +807,6 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.7.tgz#df8cf085ce92ddbdbf668a7f186ce848c9036cae" integrity sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q== -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.15.tgz#02dc8a03f613ed5fdc29fb2f728397c78146c962" - integrity sha512-FB9iYlz7rURmRJyXRKEnalYPPdn87H5no108cyuQQyMwlpJ2SJtpIUBI27kdTin956pz+LPypkPVPUTlxOmrsg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.5.tgz#87245a21cd69a73b0b81bcda98d443d6df08f05e" @@ -811,14 +814,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.15.tgz#2aeb91d337d4e1a1e7ce85b76a37f5301781200f" - integrity sha512-Hyph9LseGvAeeXzikV88bczhsrLrIZqDPxO+sSmAunMPaGrBGhfMWzCPYTtiW9t+HzSE2wtV8e5cc5P6r1xMDQ== +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.23.3.tgz#5cd1c87ba9380d0afb78469292c954fee5d2411a" + integrity sha512-iRkKcCqb7iGnq9+3G6rZ+Ciz5VywC4XNRHe57lKM+jOeYAoR0lVqdeeDRfh0tQcTfw/+vBhHn926FmQhLtlFLQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - "@babel/plugin-transform-optional-chaining" "^7.22.15" "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.22.5": version "7.22.5" @@ -829,6 +830,23 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" "@babel/plugin-transform-optional-chaining" "^7.22.5" +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.23.3.tgz#f6652bb16b94f8f9c20c50941e16e9756898dc5d" + integrity sha512-WwlxbfMNdVEpQjZmK5mhm7oSwD3dS6eU+Iwsi4Knl9wAletWem7kaRsGOG+8UEbRyqxY4SS5zvtfXwX+jMxUwQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/plugin-transform-optional-chaining" "^7.23.3" + +"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.23.3.tgz#20c60d4639d18f7da8602548512e9d3a4c8d7098" + integrity sha512-XaJak1qcityzrX0/IU5nKHb34VaibwP3saKqG6a/tppelgllOH13LUann4ZCIBcVOeE6H18K4Vx9QKkVww3z/w== + dependencies: + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-external-helpers@^7.18.6": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-external-helpers/-/plugin-external-helpers-7.22.5.tgz#92b0705b74756123f289388320e0e12c407fdf9a" @@ -917,6 +935,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-syntax-import-assertions@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.23.3.tgz#9c05a7f592982aff1a2768260ad84bcd3f0c77fc" + integrity sha512-lPgDSU+SJLK3xmFDTV2ZRQAiM7UuUjGidwBywFavObCiZc1BeAAcMtHJKUya92hPHO+at63JJPLygilZard8jw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-import-attributes@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.22.5.tgz#ab840248d834410b829f569f5262b9e517555ecb" @@ -924,6 +949,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-syntax-import-attributes@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.23.3.tgz#992aee922cf04512461d7dae3ff6951b90a2dc06" + integrity sha512-pawnE0P9g10xgoP7yKr6CK63K2FMsTE+FZidZO/1PwRdzmAPVs+HS1mAURUsgaoxammTJvULUdIkEK0gOcU2tA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-import-meta@^7.10.4", "@babel/plugin-syntax-import-meta@^7.8.3": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" @@ -945,6 +977,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-syntax-jsx@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz#8f2e4f8a9b5f9aa16067e142c1ac9cd9f810f473" + integrity sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-jsx@^7.7.2": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz#a8feef63b010150abd97f1649ec296e849943ca0" @@ -1015,6 +1054,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-syntax-typescript@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz#24f460c85dbbc983cd2b9c4994178bcc01df958f" + integrity sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-typescript@^7.7.2": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.12.13.tgz#9dff111ca64154cef0f4dc52cf843d9f12ce4474" @@ -1037,6 +1083,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-arrow-functions@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.23.3.tgz#94c6dcfd731af90f27a79509f9ab7fb2120fc38b" + integrity sha512-NzQcQrzaQPkaEwoTm4Mhyl8jI1huEL/WWIEvudjTCMJ9aBZNpsJbMASx7EQECtQQPS/DcnFpo0FIh3LvEO9cxQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-transform-async-generator-functions@^7.22.7": version "7.22.7" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.22.7.tgz#053e76c0a903b72b573cb1ab7d6882174d460a1b" @@ -1047,10 +1100,10 @@ "@babel/helper-remap-async-to-generator" "^7.22.5" "@babel/plugin-syntax-async-generators" "^7.8.4" -"@babel/plugin-transform-async-generator-functions@^7.23.2": - version "7.23.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.23.2.tgz#054afe290d64c6f576f371ccc321772c8ea87ebb" - integrity sha512-BBYVGxbDVHfoeXbOwcagAkOQAm9NxoTdMGfTqghu1GrvadSaw6iW3Je6IcL5PNOw8VwjxqBECXy50/iCQSY/lQ== +"@babel/plugin-transform-async-generator-functions@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.23.3.tgz#9df2627bad7f434ed13eef3e61b2b65cafd4885b" + integrity sha512-59GsVNavGxAXCDDbakWSMJhajASb4kBCqDjqJsv+p5nKdbz7istmZ3HrX3L2LuiI80+zsOADCvooqQH3qGCucQ== dependencies: "@babel/helper-environment-visitor" "^7.22.20" "@babel/helper-plugin-utils" "^7.22.5" @@ -1066,6 +1119,15 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-remap-async-to-generator" "^7.22.5" +"@babel/plugin-transform-async-to-generator@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.23.3.tgz#d1f513c7a8a506d43f47df2bf25f9254b0b051fa" + integrity sha512-A7LFsKi4U4fomjqXJlZg/u0ft/n8/7n7lpffUP/ZULx/DtV9SGlNKZolHH6PE8Xl1ngCc0M11OaeZptXVkfKSw== + dependencies: + "@babel/helper-module-imports" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-remap-async-to-generator" "^7.22.20" + "@babel/plugin-transform-block-scoped-functions@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.22.5.tgz#27978075bfaeb9fa586d3cb63a3d30c1de580024" @@ -1073,6 +1135,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-block-scoped-functions@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.23.3.tgz#fe1177d715fb569663095e04f3598525d98e8c77" + integrity sha512-vI+0sIaPIO6CNuM9Kk5VmXcMVRiOpDh7w2zZt9GXzmE/9KD70CUEVhvPR/etAeNK/FAEkhxQtXOzVF3EuRL41A== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-transform-block-scoping@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.22.5.tgz#8bfc793b3a4b2742c0983fadc1480d843ecea31b" @@ -1080,10 +1149,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-block-scoping@^7.23.0": - version "7.23.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.0.tgz#8744d02c6c264d82e1a4bc5d2d501fd8aff6f022" - integrity sha512-cOsrbmIOXmf+5YbL99/S49Y3j46k/T16b9ml8bm9lP6N9US5iQ2yBK7gpui1pg0V/WMcXdkfKbTb7HXq9u+v4g== +"@babel/plugin-transform-block-scoping@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.3.tgz#e99a3ff08f58edd28a8ed82481df76925a4ffca7" + integrity sha512-QPZxHrThbQia7UdvfpaRRlq/J9ciz1J4go0k+lPBXbgaNeY7IQrBj/9ceWjvMMI07/ZBzHl/F0R/2K0qH7jCVw== dependencies: "@babel/helper-plugin-utils" "^7.22.5" @@ -1095,14 +1164,13 @@ "@babel/helper-create-class-features-plugin" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-class-static-block@^7.22.11": - version "7.22.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.22.11.tgz#dc8cc6e498f55692ac6b4b89e56d87cec766c974" - integrity sha512-GMM8gGmqI7guS/llMFk1bJDkKfn3v3C4KHK9Yg1ey5qcHcOlKb0QvcMrgzvxo+T03/4szNh5lghY+fEC98Kq9g== +"@babel/plugin-transform-class-properties@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.23.3.tgz#35c377db11ca92a785a718b6aa4e3ed1eb65dc48" + integrity sha512-uM+AN8yCIjDPccsKGlw271xjJtGii+xQIF/uMPS8H15L12jZTsLfF4o5vNO7d/oUguOyfdikHGc/yi9ge4SGIg== dependencies: - "@babel/helper-create-class-features-plugin" "^7.22.11" + "@babel/helper-create-class-features-plugin" "^7.22.15" "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-class-static-block" "^7.14.5" "@babel/plugin-transform-class-static-block@^7.22.5": version "7.22.5" @@ -1113,20 +1181,14 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-class-static-block" "^7.14.5" -"@babel/plugin-transform-classes@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.15.tgz#aaf4753aee262a232bbc95451b4bdf9599c65a0b" - integrity sha512-VbbC3PGjBdE0wAWDdHM9G8Gm977pnYI0XpqMd6LrKISj8/DJXEsWqgRuTYaNE9Bv0JGhTZUzHDlMk18IpOuoqw== +"@babel/plugin-transform-class-static-block@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.23.3.tgz#56f2371c7e5bf6ff964d84c5dc4d4db5536b5159" + integrity sha512-PENDVxdr7ZxKPyi5Ffc0LjXdnJyrJxyqF5T5YjlVg4a0VFfQHW0r8iAtRiDXkfHlu1wwcvdtnndGYIeJLSuRMQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-compilation-targets" "^7.22.15" - "@babel/helper-environment-visitor" "^7.22.5" - "@babel/helper-function-name" "^7.22.5" - "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-create-class-features-plugin" "^7.22.15" "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-replace-supers" "^7.22.9" - "@babel/helper-split-export-declaration" "^7.22.6" - globals "^11.1.0" + "@babel/plugin-syntax-class-static-block" "^7.14.5" "@babel/plugin-transform-classes@^7.22.6": version "7.22.6" @@ -1143,6 +1205,21 @@ "@babel/helper-split-export-declaration" "^7.22.6" globals "^11.1.0" +"@babel/plugin-transform-classes@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.3.tgz#73380c632c095b03e8503c24fd38f95ad41ffacb" + integrity sha512-FGEQmugvAEu2QtgtU0uTASXevfLMFfBeVCIIdcQhn/uBQsMTjBajdnAtanQlOcuihWh10PZ7+HWvc7NtBwP74w== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.20" + "@babel/helper-split-export-declaration" "^7.22.6" + globals "^11.1.0" + "@babel/plugin-transform-computed-properties@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz#cd1e994bf9f316bd1c2dafcd02063ec261bb3869" @@ -1151,6 +1228,14 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/template" "^7.22.5" +"@babel/plugin-transform-computed-properties@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.23.3.tgz#652e69561fcc9d2b50ba4f7ac7f60dcf65e86474" + integrity sha512-dTj83UVTLw/+nbiHqQSFdwO9CbTtwq1DsDqm3CUEtDrZNET5rT5E6bIdTlOftDTDLMYxvxHNEYO4B9SLl8SLZw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/template" "^7.22.15" + "@babel/plugin-transform-destructuring@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.22.5.tgz#d3aca7438f6c26c78cdd0b0ba920a336001b27cc" @@ -1158,10 +1243,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-destructuring@^7.23.0": - version "7.23.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.23.0.tgz#6447aa686be48b32eaf65a73e0e2c0bd010a266c" - integrity sha512-vaMdgNXFkYrB+8lbgniSYWHsgqK5gjaMNcc84bMIOMRLH0L9AqYq3hwMdvnyqj1OPqea8UtjPEuS/DCenah1wg== +"@babel/plugin-transform-destructuring@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.23.3.tgz#8c9ee68228b12ae3dff986e56ed1ba4f3c446311" + integrity sha512-n225npDqjDIr967cMScVKHXJs7rout1q+tt50inyBCPkyZ8KxeI6d+GIbSBTT/w/9WdlWDOej3V9HE5Lgk57gw== dependencies: "@babel/helper-plugin-utils" "^7.22.5" @@ -1173,6 +1258,14 @@ "@babel/helper-create-regexp-features-plugin" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-dotall-regex@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.23.3.tgz#3f7af6054882ede89c378d0cf889b854a993da50" + integrity sha512-vgnFYDHAKzFaTVp+mneDsIEbnJ2Np/9ng9iviHw3P/KVcgONxpNULEW/51Z/BaFojG2GI2GwwXck5uV1+1NOYQ== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-transform-dotall-regex@^7.4.4": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.7.tgz#6b2d67686fab15fb6a7fd4bd895d5982cfc81241" @@ -1188,13 +1281,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-dynamic-import@^7.22.11": - version "7.22.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.22.11.tgz#2c7722d2a5c01839eaf31518c6ff96d408e447aa" - integrity sha512-g/21plo58sfteWjaO0ZNVb+uEOkJNjAaHhbejrnBmu011l/eNDScmkbjCC3l4FKb10ViaGU4aOkFznSu2zRHgA== +"@babel/plugin-transform-duplicate-keys@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.23.3.tgz#664706ca0a5dfe8d066537f99032fc1dc8b720ce" + integrity sha512-RrqQ+BQmU3Oyav3J+7/myfvRCq7Tbz+kKLLshUmMwNlDHExbGL7ARhajvoBJEvc+fCguPPu887N+3RRXBVKZUA== dependencies: "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" "@babel/plugin-transform-dynamic-import@^7.22.5": version "7.22.5" @@ -1204,6 +1296,14 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-dynamic-import" "^7.8.3" +"@babel/plugin-transform-dynamic-import@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.23.3.tgz#82625924da9ed5fb11a428efb02e43bc9a3ab13e" + integrity sha512-vTG+cTGxPFou12Rj7ll+eD5yWeNl5/8xvQvF08y5Gv3v4mZQoyFf8/n9zg4q5vvCWt5jmgymfzMAldO7orBn7A== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + "@babel/plugin-transform-exponentiation-operator@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.22.5.tgz#402432ad544a1f9a480da865fda26be653e48f6a" @@ -1212,13 +1312,13 @@ "@babel/helper-builder-binary-assignment-operator-visitor" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-export-namespace-from@^7.22.11": - version "7.22.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.22.11.tgz#b3c84c8f19880b6c7440108f8929caf6056db26c" - integrity sha512-xa7aad7q7OiT8oNZ1mU7NrISjlSkVdMbNxn9IuLZyL9AJEhs1Apba3I+u5riX1dIkdptP5EKDG5XDPByWxtehw== +"@babel/plugin-transform-exponentiation-operator@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.23.3.tgz#ea0d978f6b9232ba4722f3dbecdd18f450babd18" + integrity sha512-5fhCsl1odX96u7ILKHBj4/Y8vipoqwsJMh4csSA8qFfxrZDEA4Ssku2DyNvMJSmZNOEBT750LfFPbtrnTP90BQ== dependencies: + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.22.15" "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" "@babel/plugin-transform-export-namespace-from@^7.22.5": version "7.22.5" @@ -1228,12 +1328,13 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-transform-for-of@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.15.tgz#f64b4ccc3a4f131a996388fae7680b472b306b29" - integrity sha512-me6VGeHsx30+xh9fbDLLPi0J1HzmeIIyenoOQHuw2D4m2SAU3NrspX5XxJLBpqn5yrLzrlw2Iy3RA//Bx27iOA== +"@babel/plugin-transform-export-namespace-from@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.23.3.tgz#dcd066d995f6ac6077e5a4ccb68322a01e23ac49" + integrity sha512-yCLhW34wpJWRdTxxWtFZASJisihrfyMOTOQexhVzA78jlU+dH7Dw+zQgcPepQ5F3C6bAIiblZZ+qBggJdHiBAg== dependencies: "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-export-namespace-from" "^7.8.3" "@babel/plugin-transform-for-of@^7.22.5": version "7.22.5" @@ -1242,6 +1343,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-for-of@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.23.3.tgz#afe115ff0fbce735e02868d41489093c63e15559" + integrity sha512-X8jSm8X1CMwxmK878qsUGJRmbysKNbdpTv/O1/v0LuY/ZkZrng5WYiekYSdg9m09OTmDDUWeEDsTE+17WYbAZw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-transform-function-name@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.22.5.tgz#935189af68b01898e0d6d99658db6b164205c143" @@ -1251,13 +1359,14 @@ "@babel/helper-function-name" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-json-strings@^7.22.11": - version "7.22.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.22.11.tgz#689a34e1eed1928a40954e37f74509f48af67835" - integrity sha512-CxT5tCqpA9/jXFlme9xIBCc5RPtdDq3JpkkhgHQqtDdiTnTI0jtZ0QzXhr5DILeYifDPp2wvY2ad+7+hLMW5Pw== +"@babel/plugin-transform-function-name@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.23.3.tgz#8f424fcd862bf84cb9a1a6b42bc2f47ed630f8dc" + integrity sha512-I1QXp1LxIvt8yLaib49dRW5Okt7Q4oaxao6tFVKS/anCdEOMtYwWVKoiOA1p34GOWIZjUK0E+zCp7+l1pfQyiw== dependencies: + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-function-name" "^7.23.0" "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-json-strings" "^7.8.3" "@babel/plugin-transform-json-strings@^7.22.5": version "7.22.5" @@ -1267,6 +1376,14 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-json-strings" "^7.8.3" +"@babel/plugin-transform-json-strings@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.23.3.tgz#489724ab7d3918a4329afb4172b2fd2cf3c8d245" + integrity sha512-H9Ej2OiISIZowZHaBwF0tsJOih1PftXJtE8EWqlEIwpc7LMTGq0rPOrywKLQ4nefzx8/HMR0D3JGXoMHYvhi0A== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/plugin-transform-literals@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.22.5.tgz#e9341f4b5a167952576e23db8d435849b1dd7920" @@ -1274,13 +1391,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-logical-assignment-operators@^7.22.11": - version "7.22.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.22.11.tgz#24c522a61688bde045b7d9bc3c2597a4d948fc9c" - integrity sha512-qQwRTP4+6xFCDV5k7gZBF3C31K34ut0tbEcTKxlX/0KXxm9GLcO14p570aWxFvVzx6QAfPgq7gaeIHXJC8LswQ== +"@babel/plugin-transform-literals@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.23.3.tgz#8214665f00506ead73de157eba233e7381f3beb4" + integrity sha512-wZ0PIXRxnwZvl9AYpqNUxpZ5BiTGrYt7kueGQ+N5FiQ7RCOD4cm8iShd6S6ggfVIWaJf2EMk8eRzAh52RfP4rQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" "@babel/plugin-transform-logical-assignment-operators@^7.22.5": version "7.22.5" @@ -1290,6 +1406,14 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" +"@babel/plugin-transform-logical-assignment-operators@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.23.3.tgz#3a406d6083feb9487083bca6d2334a3c9b6c4808" + integrity sha512-+pD5ZbxofyOygEp+zZAfujY2ShNCXRpDRIPOiBmTO693hhyOEteZgl876Xs9SAHPQpcV0vz8LvA/T+w8AzyX8A== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + "@babel/plugin-transform-member-expression-literals@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.22.5.tgz#4fcc9050eded981a468347dd374539ed3e058def" @@ -1297,6 +1421,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-member-expression-literals@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.23.3.tgz#e37b3f0502289f477ac0e776b05a833d853cabcc" + integrity sha512-sC3LdDBDi5x96LA+Ytekz2ZPk8i/Ck+DEuDbRAll5rknJ5XRTSaPKEYwomLcs1AA8wg9b3KjIQRsnApj+q51Ag== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-transform-modules-amd@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.22.5.tgz#4e045f55dcf98afd00f85691a68fc0780704f526" @@ -1305,12 +1436,12 @@ "@babel/helper-module-transforms" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-modules-amd@^7.23.0": - version "7.23.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.23.0.tgz#05b2bc43373faa6d30ca89214731f76f966f3b88" - integrity sha512-xWT5gefv2HGSm4QHtgc1sYPbseOyf+FFDo2JbpE25GWl5BqTGO9IMwTYJRoIdjsF85GE+VegHxSCUt5EvoYTAw== +"@babel/plugin-transform-modules-amd@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.23.3.tgz#e19b55436a1416829df0a1afc495deedfae17f7d" + integrity sha512-vJYQGxeKM4t8hYCKVBlZX/gtIY2I7mRGFNcm85sgXGMTBcoV3QdVtdpbcWEbzbfUIUZKwvgFT82mRvaQIebZzw== dependencies: - "@babel/helper-module-transforms" "^7.23.0" + "@babel/helper-module-transforms" "^7.23.3" "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-transform-modules-commonjs@^7.22.5": @@ -1322,12 +1453,12 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-simple-access" "^7.22.5" -"@babel/plugin-transform-modules-commonjs@^7.23.0": - version "7.23.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.0.tgz#b3dba4757133b2762c00f4f94590cf6d52602481" - integrity sha512-32Xzss14/UVc7k9g775yMIvkVK8xwKE0DPdP5JTapr3+Z9w4tzeOuLNY6BXDQR6BdnzIlXnCGAzsk/ICHBLVWQ== +"@babel/plugin-transform-modules-commonjs@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.3.tgz#661ae831b9577e52be57dd8356b734f9700b53b4" + integrity sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA== dependencies: - "@babel/helper-module-transforms" "^7.23.0" + "@babel/helper-module-transforms" "^7.23.3" "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-simple-access" "^7.22.5" @@ -1341,13 +1472,13 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-validator-identifier" "^7.22.5" -"@babel/plugin-transform-modules-systemjs@^7.23.0": - version "7.23.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.0.tgz#77591e126f3ff4132a40595a6cccd00a6b60d160" - integrity sha512-qBej6ctXZD2f+DhlOC9yO47yEYgUh5CZNz/aBoH4j/3NOlRfJXJbY7xDQCqQVf9KbrqGzIWER1f23doHGrIHFg== +"@babel/plugin-transform-modules-systemjs@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.3.tgz#fa7e62248931cb15b9404f8052581c302dd9de81" + integrity sha512-ZxyKGTkF9xT9YJuKQRo19ewf3pXpopuYQd8cDXqNzc3mUNbOME0RKMoZxviQk74hwzfQsEe66dE92MaZbdHKNQ== dependencies: "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-module-transforms" "^7.23.0" + "@babel/helper-module-transforms" "^7.23.3" "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-validator-identifier" "^7.22.20" @@ -1359,6 +1490,14 @@ "@babel/helper-module-transforms" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-modules-umd@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.23.3.tgz#5d4395fccd071dfefe6585a4411aa7d6b7d769e9" + integrity sha512-zHsy9iXX2nIsCBFPud3jKn1IRPWg3Ing1qOZgeKV39m1ZgIdpJqvlWVeiHBZC6ITRG0MfskhYe9cLgntfSFPIg== + dependencies: + "@babel/helper-module-transforms" "^7.23.3" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-transform-named-capturing-groups-regex@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz#67fe18ee8ce02d57c855185e27e3dc959b2e991f" @@ -1374,13 +1513,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-nullish-coalescing-operator@^7.22.11": - version "7.22.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.11.tgz#debef6c8ba795f5ac67cd861a81b744c5d38d9fc" - integrity sha512-YZWOw4HxXrotb5xsjMJUDlLgcDXSfO9eCmdl1bgW4+/lAGdkjaEvOnQ4p5WKKdUgSzO39dgPl0pTnfxm0OAXcg== +"@babel/plugin-transform-new-target@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.23.3.tgz#5491bb78ed6ac87e990957cea367eab781c4d980" + integrity sha512-YJ3xKqtJMAT5/TIZnpAR3I+K+WaDowYbN3xyxI8zxx/Gsypwf9B9h0VB+1Nh6ACAAPRS5NSRje0uVv5i79HYGQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" "@babel/plugin-transform-nullish-coalescing-operator@^7.22.5": version "7.22.5" @@ -1390,13 +1528,13 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" -"@babel/plugin-transform-numeric-separator@^7.22.11": - version "7.22.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.22.11.tgz#498d77dc45a6c6db74bb829c02a01c1d719cbfbd" - integrity sha512-3dzU4QGPsILdJbASKhF/V2TVP+gJya1PsueQCxIPCEcerqF21oEcrob4mzjsp2Py/1nLfF5m+xYNMDpmA8vffg== +"@babel/plugin-transform-nullish-coalescing-operator@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.23.3.tgz#8a613d514b521b640344ed7c56afeff52f9413f8" + integrity sha512-xzg24Lnld4DYIdysyf07zJ1P+iIfJpxtVFOzX4g+bsJ3Ng5Le7rXx9KwqKzuyaUeRnt+I1EICwQITqc0E2PmpA== dependencies: "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" "@babel/plugin-transform-numeric-separator@^7.22.5": version "7.22.5" @@ -1406,16 +1544,13 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-transform-object-rest-spread@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.15.tgz#21a95db166be59b91cde48775310c0df6e1da56f" - integrity sha512-fEB+I1+gAmfAyxZcX1+ZUwLeAuuf8VIg67CTznZE0MqVFumWkh8xWtn58I4dxdVf080wn7gzWoF8vndOViJe9Q== +"@babel/plugin-transform-numeric-separator@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.23.3.tgz#2f8da42b75ba89e5cfcd677afd0856d52c0c2e68" + integrity sha512-s9GO7fIBi/BLsZ0v3Rftr6Oe4t0ctJ8h4CCXfPoEJwmvAPMyNrfkOOJzm6b9PX9YXcCJWWQd/sBF/N26eBiMVw== dependencies: - "@babel/compat-data" "^7.22.9" - "@babel/helper-compilation-targets" "^7.22.15" "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.22.15" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" "@babel/plugin-transform-object-rest-spread@^7.22.5": version "7.22.5" @@ -1428,6 +1563,17 @@ "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-transform-parameters" "^7.22.5" +"@babel/plugin-transform-object-rest-spread@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.23.3.tgz#509373753b5f7202fe1940e92fd075bd7874955f" + integrity sha512-VxHt0ANkDmu8TANdE9Kc0rndo/ccsmfe2Cx2y5sI4hu3AukHQ5wAu4cM7j3ba8B9548ijVyclBU+nuDQftZsog== + dependencies: + "@babel/compat-data" "^7.23.3" + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-transform-parameters" "^7.23.3" + "@babel/plugin-transform-object-super@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.22.5.tgz#794a8d2fcb5d0835af722173c1a9d704f44e218c" @@ -1436,13 +1582,13 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-replace-supers" "^7.22.5" -"@babel/plugin-transform-optional-catch-binding@^7.22.11": - version "7.22.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.22.11.tgz#461cc4f578a127bb055527b3e77404cad38c08e0" - integrity sha512-rli0WxesXUeCJnMYhzAglEjLWVDF6ahb45HuprcmQuLidBJFWjNnOzssk2kuc6e33FlLaiZhG/kUIzUMWdBKaQ== +"@babel/plugin-transform-object-super@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.23.3.tgz#81fdb636dcb306dd2e4e8fd80db5b2362ed2ebcd" + integrity sha512-BwQ8q0x2JG+3lxCVFohg+KbQM7plfpBwThdW9A6TMtWwLsbDA01Ek2Zb/AgDN39BiZsExm4qrXxjk+P1/fzGrA== dependencies: "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/helper-replace-supers" "^7.22.20" "@babel/plugin-transform-optional-catch-binding@^7.22.5": version "7.22.5" @@ -1452,14 +1598,13 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-transform-optional-chaining@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.15.tgz#d7a5996c2f7ca4ad2ad16dbb74444e5c4385b1ba" - integrity sha512-ngQ2tBhq5vvSJw2Q2Z9i7ealNkpDMU0rGWnHPKqRZO0tzZ5tlaoz4hDvhXioOoaE0X2vfNss1djwg0DXlfu30A== +"@babel/plugin-transform-optional-catch-binding@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.23.3.tgz#362c0b545ee9e5b0fa9d9e6fe77acf9d4c480027" + integrity sha512-LxYSb0iLjUamfm7f1D7GpiS4j0UAC8AOiehnsGAP8BEsIX8EOi3qV6bbctw8M7ZvLtcoZfZX5Z7rN9PlWk0m5A== dependencies: "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" "@babel/plugin-transform-optional-chaining@^7.22.5": version "7.22.5" @@ -1479,10 +1624,10 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-transform-optional-chaining@^7.23.0": - version "7.23.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.0.tgz#73ff5fc1cf98f542f09f29c0631647d8ad0be158" - integrity sha512-sBBGXbLJjxTzLBF5rFWaikMnOGOk/BmK6vVByIdEggZ7Vn6CvWXZyRkkLFK6WE0IF8jSliyOkUN6SScFgzCM0g== +"@babel/plugin-transform-optional-chaining@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.3.tgz#92fc83f54aa3adc34288933fa27e54c13113f4be" + integrity sha512-zvL8vIfIUgMccIAK1lxjvNv572JHFJIKb4MWBz5OGdBQA0fB0Xluix5rmOby48exiJc987neOmP/m9Fnpkz3Tg== dependencies: "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" @@ -1495,10 +1640,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-parameters@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.15.tgz#719ca82a01d177af358df64a514d64c2e3edb114" - integrity sha512-hjk7qKIqhyzhhUvRT683TYQOFa/4cQKwQy7ALvTpODswN40MljzNDa0YldevS6tGbxwaEKVn502JmY0dP7qEtQ== +"@babel/plugin-transform-parameters@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.23.3.tgz#83ef5d1baf4b1072fa6e54b2b0999a7b2527e2af" + integrity sha512-09lMt6UsUb3/34BbECKVbVwrT9bO6lILWln237z7sLaWnMsTi7Yc9fhX5DLpkJzAGfaReXI22wP41SZmnAA3Vw== dependencies: "@babel/helper-plugin-utils" "^7.22.5" @@ -1510,15 +1655,13 @@ "@babel/helper-create-class-features-plugin" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-private-property-in-object@^7.22.11": - version "7.22.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.11.tgz#ad45c4fc440e9cb84c718ed0906d96cf40f9a4e1" - integrity sha512-sSCbqZDBKHetvjSwpyWzhuHkmW5RummxJBVbYLkGkaiTOWGxml7SXt0iWa03bzxFIx7wOj3g/ILRd0RcJKBeSQ== +"@babel/plugin-transform-private-methods@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.23.3.tgz#b2d7a3c97e278bfe59137a978d53b2c2e038c0e4" + integrity sha512-UzqRcRtWsDMTLrRWFvUBDwmw06tCQH9Rl1uAjfh6ijMSmGYQ+fpdB+cnqRC8EMh5tuuxSv0/TejGL+7vyj+50g== dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-create-class-features-plugin" "^7.22.11" + "@babel/helper-create-class-features-plugin" "^7.22.15" "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" "@babel/plugin-transform-private-property-in-object@^7.22.5": version "7.22.5" @@ -1530,6 +1673,16 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" +"@babel/plugin-transform-private-property-in-object@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.23.3.tgz#5cd34a2ce6f2d008cc8f91d8dcc29e2c41466da6" + integrity sha512-a5m2oLNFyje2e/rGKjVfAELTVI5mbA0FeZpBnkOWWV7eSmKQ+T/XW0Vf+29ScLzSxX+rnsarvU0oie/4m6hkxA== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-create-class-features-plugin" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-transform-property-literals@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.22.5.tgz#b5ddabd73a4f7f26cd0e20f5db48290b88732766" @@ -1537,6 +1690,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-property-literals@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.23.3.tgz#54518f14ac4755d22b92162e4a852d308a560875" + integrity sha512-jR3Jn3y7cZp4oEWPFAlRsSWjxKe4PZILGBSd4nis1TsC5qeSpb+nrtihJuDhNI7QHiVbUaiXa0X2RZY3/TI6Nw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-transform-react-display-name@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.22.5.tgz#3c4326f9fce31c7968d6cb9debcaf32d9e279a2b" @@ -1544,6 +1704,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-react-display-name@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.23.3.tgz#70529f034dd1e561045ad3c8152a267f0d7b6200" + integrity sha512-GnvhtVfA2OAtzdX58FJxU19rhoGeQzyVndw3GgtdECQvQFXPEZIOVULHVZGAYmOgmqjXpVpfocAbSjh99V/Fqw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-transform-react-jsx-development@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.22.5.tgz#e716b6edbef972a92165cd69d92f1255f7e73e87" @@ -1581,13 +1748,13 @@ "@babel/helper-annotate-as-pure" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-regenerator@^7.22.10": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.10.tgz#8ceef3bd7375c4db7652878b0241b2be5d0c3cca" - integrity sha512-F28b1mDt8KcT5bUyJc/U9nwzw6cV+UmTeRlXYIl2TNqMMJif0Jeey9/RQ3C4NOd2zp0/TRsDns9ttj2L523rsw== +"@babel/plugin-transform-react-pure-annotations@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.23.3.tgz#fabedbdb8ee40edf5da96f3ecfc6958e3783b93c" + integrity sha512-qMFdSS+TUhB7Q/3HVPnEdYJDQIk57jkntAwSuz9xfSE4n+3I+vHYCli3HoHawN1Z3RfCz/y1zXA/JXjG6cVImQ== dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" - regenerator-transform "^0.15.2" "@babel/plugin-transform-regenerator@^7.22.5": version "7.22.5" @@ -1597,6 +1764,14 @@ "@babel/helper-plugin-utils" "^7.22.5" regenerator-transform "^0.15.1" +"@babel/plugin-transform-regenerator@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.23.3.tgz#141afd4a2057298602069fce7f2dc5173e6c561c" + integrity sha512-KP+75h0KghBMcVpuKisx3XTu9Ncut8Q8TuvGO4IhY+9D5DFEckQefOuIsB/gQ2tG71lCke4NMrtIPS8pOj18BQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + regenerator-transform "^0.15.2" + "@babel/plugin-transform-reserved-words@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.22.5.tgz#832cd35b81c287c4bcd09ce03e22199641f964fb" @@ -1604,10 +1779,17 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-runtime@7.23.2": - version "7.23.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.23.2.tgz#c956a3f8d1aa50816ff6c30c6288d66635c12990" - integrity sha512-XOntj6icgzMS58jPVtQpiuF6ZFWxQiJavISGx5KGjRj+3gqZr8+N6Kx+N9BApWzgS+DOjIZfXXj0ZesenOWDyA== +"@babel/plugin-transform-reserved-words@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.23.3.tgz#4130dcee12bd3dd5705c587947eb715da12efac8" + integrity sha512-QnNTazY54YqgGxwIexMZva9gqbPa15t/x9VS+0fsEFWplwVpXYZivtgl43Z1vMpc1bdPP2PP8siFeVcnFvA3Cg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-runtime@7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.23.3.tgz#0aa7485862b0b5cb0559c1a5ec08b4923743ee3b" + integrity sha512-XcQ3X58CKBdBnnZpPaQjgVMePsXtSZzHoku70q9tUAQp02ggPQNM04BF3RvlW1GSM/McbSOQAzEK4MXbS7/JFg== dependencies: "@babel/helper-module-imports" "^7.22.15" "@babel/helper-plugin-utils" "^7.22.5" @@ -1623,6 +1805,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-shorthand-properties@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.23.3.tgz#97d82a39b0e0c24f8a981568a8ed851745f59210" + integrity sha512-ED2fgqZLmexWiN+YNFX26fx4gh5qHDhn1O2gvEhreLW2iI63Sqm4llRLCXALKrCnbN4Jy0VcMQZl/SAzqug/jg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-transform-spread@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.22.5.tgz#6487fd29f229c95e284ba6c98d65eafb893fea6b" @@ -1631,6 +1820,14 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" +"@babel/plugin-transform-spread@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.23.3.tgz#41d17aacb12bde55168403c6f2d6bdca563d362c" + integrity sha512-VvfVYlrlBVu+77xVTOAoxQ6mZbnIq5FM0aGBSFEcIh03qHf+zNqA4DC/3XMUozTg7bZV3e3mZQ0i13VB6v5yUg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/plugin-transform-sticky-regex@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.22.5.tgz#295aba1595bfc8197abd02eae5fc288c0deb26aa" @@ -1638,6 +1835,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-sticky-regex@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.23.3.tgz#dec45588ab4a723cb579c609b294a3d1bd22ff04" + integrity sha512-HZOyN9g+rtvnOU3Yh7kSxXrKbzgrm5X4GncPY1QOquu7epga5MxKHVpYu2hvQnry/H+JjckSYRb93iNfsioAGg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-transform-template-literals@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.22.5.tgz#8f38cf291e5f7a8e60e9f733193f0bcc10909bff" @@ -1645,6 +1849,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-template-literals@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.23.3.tgz#5f0f028eb14e50b5d0f76be57f90045757539d07" + integrity sha512-Flok06AYNp7GV2oJPZZcP9vZdszev6vPBkHLwxwSpaIqx75wn6mUd3UFWsSsA0l8nXAKkyCmL/sR02m8RYGeHg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-transform-typeof-symbol@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.22.5.tgz#5e2ba478da4b603af8673ff7c54f75a97b716b34" @@ -1652,15 +1863,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-typescript@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.22.15.tgz#15adef906451d86349eb4b8764865c960eb54127" - integrity sha512-1uirS0TnijxvQLnlv5wQBwOX3E1wCFX7ITv+9pBV2wKEk4K+M5tqDaoNXnTH8tjEIYHLO98MwiTWO04Ggz4XuA== +"@babel/plugin-transform-typeof-symbol@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.23.3.tgz#9dfab97acc87495c0c449014eb9c547d8966bca4" + integrity sha512-4t15ViVnaFdrPC74be1gXBSMzXk3B4Us9lP7uLRQHTFpV5Dvt33pn+2MyyNxmN3VTTm3oTrZVMUmuw3oBnQ2oQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-create-class-features-plugin" "^7.22.15" "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-typescript" "^7.22.5" "@babel/plugin-transform-typescript@^7.22.5": version "7.22.5" @@ -1672,12 +1880,15 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-typescript" "^7.22.5" -"@babel/plugin-transform-unicode-escapes@^7.22.10": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.22.10.tgz#c723f380f40a2b2f57a62df24c9005834c8616d9" - integrity sha512-lRfaRKGZCBqDlRU3UIFovdp9c9mEvlylmpod0/OatICsSfuQ9YFthRo1tpTkGsklEefZdqlEFdY4A2dwTb6ohg== +"@babel/plugin-transform-typescript@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.23.3.tgz#ce806e6cb485d468c48c4f717696719678ab0138" + integrity sha512-ogV0yWnq38CFwH20l2Afz0dfKuZBx9o/Y2Rmh5vuSS0YD1hswgEgTfyTzuSrT2q9btmHRSqYoSfwFUVaC1M1Jw== dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-create-class-features-plugin" "^7.22.15" "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-typescript" "^7.23.3" "@babel/plugin-transform-unicode-escapes@^7.22.5": version "7.22.5" @@ -1686,6 +1897,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-unicode-escapes@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.23.3.tgz#1f66d16cab01fab98d784867d24f70c1ca65b925" + integrity sha512-OMCUx/bU6ChE3r4+ZdylEqAjaQgHAgipgW8nsCfu5pGqDcFytVd91AwRvUJSBZDz0exPGgnjoqhgRYLRjFZc9Q== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-transform-unicode-property-regex@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.22.5.tgz#098898f74d5c1e86660dc112057b2d11227f1c81" @@ -1694,6 +1912,14 @@ "@babel/helper-create-regexp-features-plugin" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-unicode-property-regex@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.23.3.tgz#19e234129e5ffa7205010feec0d94c251083d7ad" + integrity sha512-KcLIm+pDZkWZQAFJ9pdfmh89EwVfmNovFBcXko8szpBeF8z68kWIPeKlmSOkT9BXJxs2C0uk+5LxoxIv62MROA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-transform-unicode-regex@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.22.5.tgz#ce7e7bb3ef208c4ff67e02a22816656256d7a183" @@ -1702,6 +1928,14 @@ "@babel/helper-create-regexp-features-plugin" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-transform-unicode-regex@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.23.3.tgz#26897708d8f42654ca4ce1b73e96140fbad879dc" + integrity sha512-wMHpNA4x2cIA32b/ci3AfwNgheiva2W0WUKWTK7vBHBhDKfPsc5cFGNWm69WBqpwd86u1qwZ9PWevKqm1A3yAw== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-transform-unicode-sets-regex@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.22.5.tgz#77788060e511b708ffc7d42fdfbc5b37c3004e91" @@ -1710,25 +1944,34 @@ "@babel/helper-create-regexp-features-plugin" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/preset-env@7.23.2": - version "7.23.2" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.23.2.tgz#1f22be0ff0e121113260337dbc3e58fafce8d059" - integrity sha512-BW3gsuDD+rvHL2VO2SjAUNTBe5YrjsTiDyqamPDWY723na3/yPQ65X5oQkFVJZ0o50/2d+svm1rkPoJeR1KxVQ== +"@babel/plugin-transform-unicode-sets-regex@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.23.3.tgz#4fb6f0a719c2c5859d11f6b55a050cc987f3799e" + integrity sha512-W7lliA/v9bNR83Qc3q1ip9CQMZ09CcHDbHfbLRDNuAhn1Mvkr1ZNF7hPmztMQvtTGVLJ9m8IZqWsTkXOml8dbw== dependencies: - "@babel/compat-data" "^7.23.2" + "@babel/helper-create-regexp-features-plugin" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/preset-env@7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.23.3.tgz#d299e0140a7650684b95c62be2db0ef8c975143e" + integrity sha512-ovzGc2uuyNfNAs/jyjIGxS8arOHS5FENZaNn4rtE7UdKMMkqHCvboHfcuhWLZNX5cB44QfcGNWjaevxMzzMf+Q== + dependencies: + "@babel/compat-data" "^7.23.3" "@babel/helper-compilation-targets" "^7.22.15" "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-validator-option" "^7.22.15" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.22.15" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.22.15" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.23.3" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.23.3" + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly" "^7.23.3" "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-class-properties" "^7.12.13" "@babel/plugin-syntax-class-static-block" "^7.14.5" "@babel/plugin-syntax-dynamic-import" "^7.8.3" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-import-assertions" "^7.22.5" - "@babel/plugin-syntax-import-attributes" "^7.22.5" + "@babel/plugin-syntax-import-assertions" "^7.23.3" + "@babel/plugin-syntax-import-attributes" "^7.23.3" "@babel/plugin-syntax-import-meta" "^7.10.4" "@babel/plugin-syntax-json-strings" "^7.8.3" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" @@ -1740,56 +1983,55 @@ "@babel/plugin-syntax-private-property-in-object" "^7.14.5" "@babel/plugin-syntax-top-level-await" "^7.14.5" "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" - "@babel/plugin-transform-arrow-functions" "^7.22.5" - "@babel/plugin-transform-async-generator-functions" "^7.23.2" - "@babel/plugin-transform-async-to-generator" "^7.22.5" - "@babel/plugin-transform-block-scoped-functions" "^7.22.5" - "@babel/plugin-transform-block-scoping" "^7.23.0" - "@babel/plugin-transform-class-properties" "^7.22.5" - "@babel/plugin-transform-class-static-block" "^7.22.11" - "@babel/plugin-transform-classes" "^7.22.15" - "@babel/plugin-transform-computed-properties" "^7.22.5" - "@babel/plugin-transform-destructuring" "^7.23.0" - "@babel/plugin-transform-dotall-regex" "^7.22.5" - "@babel/plugin-transform-duplicate-keys" "^7.22.5" - "@babel/plugin-transform-dynamic-import" "^7.22.11" - "@babel/plugin-transform-exponentiation-operator" "^7.22.5" - "@babel/plugin-transform-export-namespace-from" "^7.22.11" - "@babel/plugin-transform-for-of" "^7.22.15" - "@babel/plugin-transform-function-name" "^7.22.5" - "@babel/plugin-transform-json-strings" "^7.22.11" - "@babel/plugin-transform-literals" "^7.22.5" - "@babel/plugin-transform-logical-assignment-operators" "^7.22.11" - "@babel/plugin-transform-member-expression-literals" "^7.22.5" - "@babel/plugin-transform-modules-amd" "^7.23.0" - "@babel/plugin-transform-modules-commonjs" "^7.23.0" - "@babel/plugin-transform-modules-systemjs" "^7.23.0" - "@babel/plugin-transform-modules-umd" "^7.22.5" + "@babel/plugin-transform-arrow-functions" "^7.23.3" + "@babel/plugin-transform-async-generator-functions" "^7.23.3" + "@babel/plugin-transform-async-to-generator" "^7.23.3" + "@babel/plugin-transform-block-scoped-functions" "^7.23.3" + "@babel/plugin-transform-block-scoping" "^7.23.3" + "@babel/plugin-transform-class-properties" "^7.23.3" + "@babel/plugin-transform-class-static-block" "^7.23.3" + "@babel/plugin-transform-classes" "^7.23.3" + "@babel/plugin-transform-computed-properties" "^7.23.3" + "@babel/plugin-transform-destructuring" "^7.23.3" + "@babel/plugin-transform-dotall-regex" "^7.23.3" + "@babel/plugin-transform-duplicate-keys" "^7.23.3" + "@babel/plugin-transform-dynamic-import" "^7.23.3" + "@babel/plugin-transform-exponentiation-operator" "^7.23.3" + "@babel/plugin-transform-export-namespace-from" "^7.23.3" + "@babel/plugin-transform-for-of" "^7.23.3" + "@babel/plugin-transform-function-name" "^7.23.3" + "@babel/plugin-transform-json-strings" "^7.23.3" + "@babel/plugin-transform-literals" "^7.23.3" + "@babel/plugin-transform-logical-assignment-operators" "^7.23.3" + "@babel/plugin-transform-member-expression-literals" "^7.23.3" + "@babel/plugin-transform-modules-amd" "^7.23.3" + "@babel/plugin-transform-modules-commonjs" "^7.23.3" + "@babel/plugin-transform-modules-systemjs" "^7.23.3" + "@babel/plugin-transform-modules-umd" "^7.23.3" "@babel/plugin-transform-named-capturing-groups-regex" "^7.22.5" - "@babel/plugin-transform-new-target" "^7.22.5" - "@babel/plugin-transform-nullish-coalescing-operator" "^7.22.11" - "@babel/plugin-transform-numeric-separator" "^7.22.11" - "@babel/plugin-transform-object-rest-spread" "^7.22.15" - "@babel/plugin-transform-object-super" "^7.22.5" - "@babel/plugin-transform-optional-catch-binding" "^7.22.11" - "@babel/plugin-transform-optional-chaining" "^7.23.0" - "@babel/plugin-transform-parameters" "^7.22.15" - "@babel/plugin-transform-private-methods" "^7.22.5" - "@babel/plugin-transform-private-property-in-object" "^7.22.11" - "@babel/plugin-transform-property-literals" "^7.22.5" - "@babel/plugin-transform-regenerator" "^7.22.10" - "@babel/plugin-transform-reserved-words" "^7.22.5" - "@babel/plugin-transform-shorthand-properties" "^7.22.5" - "@babel/plugin-transform-spread" "^7.22.5" - "@babel/plugin-transform-sticky-regex" "^7.22.5" - "@babel/plugin-transform-template-literals" "^7.22.5" - "@babel/plugin-transform-typeof-symbol" "^7.22.5" - "@babel/plugin-transform-unicode-escapes" "^7.22.10" - "@babel/plugin-transform-unicode-property-regex" "^7.22.5" - "@babel/plugin-transform-unicode-regex" "^7.22.5" - "@babel/plugin-transform-unicode-sets-regex" "^7.22.5" + "@babel/plugin-transform-new-target" "^7.23.3" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.23.3" + "@babel/plugin-transform-numeric-separator" "^7.23.3" + "@babel/plugin-transform-object-rest-spread" "^7.23.3" + "@babel/plugin-transform-object-super" "^7.23.3" + "@babel/plugin-transform-optional-catch-binding" "^7.23.3" + "@babel/plugin-transform-optional-chaining" "^7.23.3" + "@babel/plugin-transform-parameters" "^7.23.3" + "@babel/plugin-transform-private-methods" "^7.23.3" + "@babel/plugin-transform-private-property-in-object" "^7.23.3" + "@babel/plugin-transform-property-literals" "^7.23.3" + "@babel/plugin-transform-regenerator" "^7.23.3" + "@babel/plugin-transform-reserved-words" "^7.23.3" + "@babel/plugin-transform-shorthand-properties" "^7.23.3" + "@babel/plugin-transform-spread" "^7.23.3" + "@babel/plugin-transform-sticky-regex" "^7.23.3" + "@babel/plugin-transform-template-literals" "^7.23.3" + "@babel/plugin-transform-typeof-symbol" "^7.23.3" + "@babel/plugin-transform-unicode-escapes" "^7.23.3" + "@babel/plugin-transform-unicode-property-regex" "^7.23.3" + "@babel/plugin-transform-unicode-regex" "^7.23.3" + "@babel/plugin-transform-unicode-sets-regex" "^7.23.3" "@babel/preset-modules" "0.1.6-no-external-plugins" - "@babel/types" "^7.23.0" babel-plugin-polyfill-corejs2 "^0.4.6" babel-plugin-polyfill-corejs3 "^0.8.5" babel-plugin-polyfill-regenerator "^0.5.3" @@ -1902,17 +2144,17 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/preset-react@7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.22.15.tgz#9a776892b648e13cc8ca2edf5ed1264eea6b6afc" - integrity sha512-Csy1IJ2uEh/PecCBXXoZGAZBeCATTuePzCSB7dLYWS0vOEj6CNpjxIhW4duWwZodBNueH7QO14WbGn8YyeuN9w== +"@babel/preset-react@7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.23.3.tgz#f73ca07e7590f977db07eb54dbe46538cc015709" + integrity sha512-tbkHOS9axH6Ysf2OUEqoSZ6T3Fa2SrNH6WTWSPBboxKzdxNc9qOICeLXkNG0ZEwbQ1HY8liwOce4aN/Ceyuq6w== dependencies: "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-validator-option" "^7.22.15" - "@babel/plugin-transform-react-display-name" "^7.22.5" + "@babel/plugin-transform-react-display-name" "^7.23.3" "@babel/plugin-transform-react-jsx" "^7.22.15" "@babel/plugin-transform-react-jsx-development" "^7.22.5" - "@babel/plugin-transform-react-pure-annotations" "^7.22.5" + "@babel/plugin-transform-react-pure-annotations" "^7.23.3" "@babel/preset-react@^7.18.6": version "7.22.5" @@ -1926,16 +2168,16 @@ "@babel/plugin-transform-react-jsx-development" "^7.22.5" "@babel/plugin-transform-react-pure-annotations" "^7.22.5" -"@babel/preset-typescript@7.23.2": - version "7.23.2" - resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.23.2.tgz#c8de488130b7081f7e1482936ad3de5b018beef4" - integrity sha512-u4UJc1XsS1GhIGteM8rnGiIvf9rJpiVgMEeCnwlLA7WJPC+jcXWJAGxYmeqs5hOZD8BbAfnV5ezBOxQbb4OUxA== +"@babel/preset-typescript@7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.23.3.tgz#14534b34ed5b6d435aa05f1ae1c5e7adcc01d913" + integrity sha512-17oIGVlqz6CchO9RFYn5U6ZpWRZIngayYCtrPRSgANSwC2V1Jb+iP74nVxzzXJte8b8BYxrL1yY96xfhTBrNNQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-validator-option" "^7.22.15" - "@babel/plugin-syntax-jsx" "^7.22.5" - "@babel/plugin-transform-modules-commonjs" "^7.23.0" - "@babel/plugin-transform-typescript" "^7.22.15" + "@babel/plugin-syntax-jsx" "^7.23.3" + "@babel/plugin-transform-modules-commonjs" "^7.23.3" + "@babel/plugin-transform-typescript" "^7.23.3" "@babel/preset-typescript@^7.21.0": version "7.22.5" @@ -3976,9 +4218,9 @@ react-select "*" "@types/react-slider@^1.3.1": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@types/react-slider/-/react-slider-1.3.3.tgz#100cb75dc950edaa725e4ee7abe8324a65b649c2" - integrity sha512-UMzMsqZh3wzHM4h/3yy3xQKTa3DfjF+S4WLuryDCmOcufgX2m+bNjSQV/xWsKAMfV5DXucQBsFlIu9dcvS+e1A== + version "1.3.4" + resolved "https://registry.yarnpkg.com/@types/react-slider/-/react-slider-1.3.4.tgz#acba82354b62195d73d21499ae734e7adc48f4d1" + integrity sha512-r744XX7HAnsDXH8wfSBTBWC0I4v5laRJOTRwDF2JbSWIvfxhh5psGJa2cl9gOEisJoTlCcHJw6/C7GNDYwX7Xw== dependencies: "@types/react" "*" @@ -5252,10 +5494,10 @@ babel-preset-current-node-syntax@^1.0.0: dependencies: "@babel/core" "^7.18.2" "@babel/plugin-syntax-dynamic-import" "7.8.3" - "@babel/plugin-transform-runtime" "7.23.2" - "@babel/preset-env" "7.23.2" - "@babel/preset-react" "7.22.15" - "@babel/preset-typescript" "7.23.2" + "@babel/plugin-transform-runtime" "7.23.3" + "@babel/preset-env" "7.23.3" + "@babel/preset-react" "7.23.3" + "@babel/preset-typescript" "7.23.3" babel-plugin-styled-components "^2.0.7" babel-preset-jest@^29.5.0: From 1d6ee0f547eb3ecf12b87ca0d70f91ef24ce41f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 08:17:57 +0100 Subject: [PATCH 24/39] Bump @types/express from 4.17.19 to 4.17.21 in /graylog2-web-interface (#17249) Bumps [@types/express](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/express) from 4.17.19 to 4.17.21. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/express) --- updated-dependencies: - dependency-name: "@types/express" dependency-type: direct:development 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 57f1eafaa2b9..9bfcad745fac 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -3931,9 +3931,9 @@ "@types/range-parser" "*" "@types/express@*", "@types/express@^4.17.13": - version "4.17.19" - resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.19.tgz#6ff9b4851fda132c5d3dcd2f89fdb6a7a0031ced" - integrity sha512-UtOfBtzN9OvpZPPbnnYunfjM7XCI4jyk1NvnFhTVz5krYAnW4o5DCoIekvms+8ApqhB4+9wSge1kBijdfTSmfg== + version "4.17.21" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.21.tgz#c26d4a151e60efe0084b23dc3369ebc631ed192d" + integrity sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ== dependencies: "@types/body-parser" "*" "@types/express-serve-static-core" "^4.17.33" From c7d098c201ff808ea6e3291c860368abebda0489 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 08:18:19 +0100 Subject: [PATCH 25/39] Bump ace-builds from 1.30.0 to 1.31.1 in /graylog2-web-interface (#17195) Bumps [ace-builds](https://github.com/ajaxorg/ace-builds) from 1.30.0 to 1.31.1. - [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.30.0...v1.31.1) --- updated-dependencies: - dependency-name: ace-builds 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/package.json | 2 +- graylog2-web-interface/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/graylog2-web-interface/package.json b/graylog2-web-interface/package.json index 0d5f1778e48d..86e78463818c 100644 --- a/graylog2-web-interface/package.json +++ b/graylog2-web-interface/package.json @@ -60,7 +60,7 @@ "@reduxjs/toolkit": "^1.9.1", "@tanstack/query-sync-storage-persister": "^4.33.0", "@tanstack/react-query-persist-client": "^4.33.0", - "ace-builds": "1.30.0", + "ace-builds": "1.31.1", "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 9bfcad745fac..58160d4e87f9 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -4755,10 +4755,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.30.0, ace-builds@^1.4.14: - version "1.30.0" - resolved "https://registry.yarnpkg.com/ace-builds/-/ace-builds-1.30.0.tgz#e2f8ba89d81f642138296491a061d3c709a949a8" - integrity sha512-ZC+G1ozrrVCVL/KPkeU9R7TEwYeNJUYRrjnEvNhF8r2+WR2tkcCjmduL8M6D3abIdf/16ccEXHtpoRBhAnTyCw== +ace-builds@1.31.1, ace-builds@^1.4.14: + version "1.31.1" + resolved "https://registry.yarnpkg.com/ace-builds/-/ace-builds-1.31.1.tgz#dedb9807f67b4bbe775b2b79adb31deac06995ec" + integrity sha512-3DnE5bZF6Ji+l4F5acoLk+rV7mxrUt1C4r61Xy9owp5rVM4lj5NL8GJfoX6Jnnbhx6kKV7Vdpb+Tco+0ORTvhg== acorn-globals@^4.1.0: version "4.3.4" From ad6d820d8a91aea72c43319e7ebe5f3bc045455c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 10:33:34 +0100 Subject: [PATCH 26/39] Bump react-grid-layout and @types/react-grid-layout (#17250) Bumps [react-grid-layout](https://github.com/STRML/react-grid-layout) and [@types/react-grid-layout](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-grid-layout). These dependencies needed to be updated together. Updates `react-grid-layout` from 1.4.2 to 1.4.3 - [Release notes](https://github.com/STRML/react-grid-layout/releases) - [Changelog](https://github.com/react-grid-layout/react-grid-layout/blob/master/CHANGELOG.md) - [Commits](https://github.com/STRML/react-grid-layout/compare/1.4.2...1.4.3) Updates `@types/react-grid-layout` from 1.3.3 to 1.3.5 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-grid-layout) --- updated-dependencies: - dependency-name: react-grid-layout dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: "@types/react-grid-layout" dependency-type: direct:development 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 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/graylog2-web-interface/yarn.lock b/graylog2-web-interface/yarn.lock index 58160d4e87f9..d131075eaff3 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -4169,9 +4169,9 @@ "@types/react" "^17" "@types/react-grid-layout@^1.3.2": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@types/react-grid-layout/-/react-grid-layout-1.3.3.tgz#44cee676d9c843767891e95cdebe42e5ec2f81bb" - integrity sha512-VLgUoEN0PaAL3GeRsmYbHuoN0tpDNoRhlkdzHK4Ll8shHW6e16YpNCZWb7P9vrlZdzFtY75cM/hPr8p0ukZQCw== + version "1.3.5" + resolved "https://registry.yarnpkg.com/@types/react-grid-layout/-/react-grid-layout-1.3.5.tgz#f4b52bf27775290ee0523214be0987be14e66823" + integrity sha512-WH/po1gcEcoR6y857yAnPGug+ZhkF4PaTUxgAbwfeSH/QOgVSakKHBXoPGad/sEznmkiaK3pqHk+etdWisoeBQ== dependencies: "@types/react" "*" @@ -13677,9 +13677,9 @@ react-fast-compare@^3.2.0: integrity sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ== react-grid-layout@^1.3.0: - version "1.4.2" - resolved "https://registry.yarnpkg.com/react-grid-layout/-/react-grid-layout-1.4.2.tgz#ab3577455f519ae331405c6353cf222721c6a6b3" - integrity sha512-LLOZogtw5XNHbdCquKQRG/Dspjyfelk+kE9DKRbLUl3UArFRQu/IiH+aPcjh+wSkSHUjf+Rv32ueEYigbGzRLQ== + version "1.4.3" + resolved "https://registry.yarnpkg.com/react-grid-layout/-/react-grid-layout-1.4.3.tgz#9622c4dbdbc863bf1a29a50ed5c35c4c52922d3a" + integrity sha512-maZJfspM5aDmO/1kJj1U13HQ44rh6svcV7VQPOU9c2UfZhh8Z5AuZb+iVrzETWjsisHBYD3e2zckVovUnqvGHA== dependencies: clsx "^2.0.0" fast-equals "^4.0.3" From c1d956cb71053b164faffe90e4a1e7f932d897f4 Mon Sep 17 00:00:00 2001 From: Ousmane SAMBA Date: Mon, 13 Nov 2023 15:17:26 +0100 Subject: [PATCH 27/39] Fix Content pack install modal have two superposed modal element (#17073) * WIP * remove unused * move ContentPackDownloadControl to tsx * move ContentPacksList to function * fix Install * move ContentPacksList to typescript - add types - fix PageSize position * update test * move ContentPackVersions row to external component * fix linter * revert EditPatternModal file * add ContentPackListItem test * add missing headers * fix linter * move ContentPackVersions to tsx * add spave after link * add changelog * update ContentPackDownloadControl types * fix reviews * remove empty line --- changelog/unreleased/pr-17073.toml | 7 + .../ContentPackDownloadControl.jsx | 84 ----- .../ContentPackDownloadControl.tsx | 82 +++++ .../content-packs/ContentPackVersions.jsx | 191 ----------- .../ContentPackVersions.test.jsx | 3 +- .../content-packs/ContentPackVersions.tsx | 77 +++++ .../content-packs/ContentPacksList.jsx | 298 ------------------ .../content-packs/ContentPacksList.test.tsx | 38 +-- .../content-packs/ContentPacksList.tsx | 155 +++++++++ .../src/components/content-packs/Types.ts | 78 +++++ .../components/ContentPackListItem.test.tsx | 79 +++++ .../components/ContentPackListItem.tsx | 149 +++++++++ .../components/ContentPackVersionItem.tsx | 150 +++++++++ .../src/pages/ContentPacksPage.tsx | 3 +- .../src/routing/ApiRoutes.ts | 12 +- 15 files changed, 808 insertions(+), 598 deletions(-) create mode 100644 changelog/unreleased/pr-17073.toml delete mode 100644 graylog2-web-interface/src/components/content-packs/ContentPackDownloadControl.jsx create mode 100644 graylog2-web-interface/src/components/content-packs/ContentPackDownloadControl.tsx delete mode 100644 graylog2-web-interface/src/components/content-packs/ContentPackVersions.jsx create mode 100644 graylog2-web-interface/src/components/content-packs/ContentPackVersions.tsx delete mode 100644 graylog2-web-interface/src/components/content-packs/ContentPacksList.jsx create mode 100644 graylog2-web-interface/src/components/content-packs/ContentPacksList.tsx create mode 100644 graylog2-web-interface/src/components/content-packs/Types.ts create mode 100644 graylog2-web-interface/src/components/content-packs/components/ContentPackListItem.test.tsx create mode 100644 graylog2-web-interface/src/components/content-packs/components/ContentPackListItem.tsx create mode 100644 graylog2-web-interface/src/components/content-packs/components/ContentPackVersionItem.tsx diff --git a/changelog/unreleased/pr-17073.toml b/changelog/unreleased/pr-17073.toml new file mode 100644 index 000000000000..cdcd46cf40f6 --- /dev/null +++ b/changelog/unreleased/pr-17073.toml @@ -0,0 +1,7 @@ +type = "fixed" +message = "Fix Content pack install modal having two superposed modal element" + +issues = ["16834", "15752"] +pulls = ["17073"] + + diff --git a/graylog2-web-interface/src/components/content-packs/ContentPackDownloadControl.jsx b/graylog2-web-interface/src/components/content-packs/ContentPackDownloadControl.jsx deleted file mode 100644 index ea27469141fc..000000000000 --- a/graylog2-web-interface/src/components/content-packs/ContentPackDownloadControl.jsx +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 PropTypes from 'prop-types'; -import React from 'react'; - -import { qualifyUrl } from 'util/URLUtils'; -import ApiRoutes from 'routing/ApiRoutes'; -import { Modal, Button } from 'components/bootstrap'; -import { Icon } from 'components/common'; -import BootstrapModalWrapper from 'components/bootstrap/BootstrapModalWrapper'; - -class ContentPackDownloadControl extends React.Component { - static propTypes = { - contentPackId: PropTypes.string.isRequired, - revision: PropTypes.number.isRequired, - }; - - constructor(props) { - super(props); - - this.state = { - showDownloadModal: false, - }; - - this._closeModal = this._closeModal.bind(this); - } - - _getDownloadUrl() { - const { contentPackId, revision } = this.props; - - return qualifyUrl(ApiRoutes.ContentPacksController.downloadRev(contentPackId, revision).url); - } - - _closeModal() { - this.setState({ showDownloadModal: false }); - } - - // eslint-disable-next-line react/no-unused-class-component-methods - open() { - this.setState({ showDownloadModal: true }); - } - - render() { - const infoText = 'Please right click the download link below and choose "Save Link As..." to download the JSON file.'; - const modalTitle = 'Download Content Pack'; - - return ( - - - {modalTitle} - - -

{infoText}

-

- - {' '}Download - -

-
- - - -
- ); - } -} - -export default ContentPackDownloadControl; diff --git a/graylog2-web-interface/src/components/content-packs/ContentPackDownloadControl.tsx b/graylog2-web-interface/src/components/content-packs/ContentPackDownloadControl.tsx new file mode 100644 index 000000000000..0a65e4847e5d --- /dev/null +++ b/graylog2-web-interface/src/components/content-packs/ContentPackDownloadControl.tsx @@ -0,0 +1,82 @@ +/* + * 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 * as React from 'react'; +import { useState } from 'react'; +import PropTypes from 'prop-types'; + +import { qualifyUrl } from 'util/URLUtils'; +import ApiRoutes from 'routing/ApiRoutes'; +import { Modal, Button } from 'components/bootstrap'; +import { Icon } from 'components/common'; +import BootstrapModalWrapper from 'components/bootstrap/BootstrapModalWrapper'; + +type Props = { + contentPackId: string, + revision: number, + show: boolean, + onHide: () => void, +} + +const ContentPackDownloadControl = ({ contentPackId, revision, show, onHide }: Props) => { + const [showDownloadModal, setShowDownloadModal] = useState(show); + + const getDownloadUrl = () => qualifyUrl(ApiRoutes.ContentPacksController.downloadRev(contentPackId, revision).url); + + const closeModal = () => { + setShowDownloadModal(false); + onHide(); + }; + + const infoText = 'Please right click the download link below and choose "Save Link As..." to download the JSON file.'; + const modalTitle = 'Download Content Pack'; + + return ( + + + {modalTitle} + + +

{infoText}

+

+ + {' '}Download + +

+
+ + + +
+ ); +}; + +ContentPackDownloadControl.propTypes = { + contentPackId: PropTypes.string.isRequired, + revision: PropTypes.number.isRequired, + show: PropTypes.bool, + onHide: PropTypes.func, +}; + +ContentPackDownloadControl.defaultProps = { + show: false, + onHide: () => { + }, +}; + +export default ContentPackDownloadControl; diff --git a/graylog2-web-interface/src/components/content-packs/ContentPackVersions.jsx b/graylog2-web-interface/src/components/content-packs/ContentPackVersions.jsx deleted file mode 100644 index 6835d99f6d90..000000000000 --- a/graylog2-web-interface/src/components/content-packs/ContentPackVersions.jsx +++ /dev/null @@ -1,191 +0,0 @@ -/* - * 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 PropTypes from 'prop-types'; -import React from 'react'; - -import { LinkContainer } from 'components/common/router'; -import Routes from 'routing/Routes'; -import { DataTable, ModalSubmit } from 'components/common'; -import { BootstrapModalWrapper, Button, DropdownButton, ButtonToolbar, MenuItem, Modal } from 'components/bootstrap'; -import ContentPackDownloadControl from 'components/content-packs/ContentPackDownloadControl'; -import ContentPackInstall from 'components/content-packs/ContentPackInstall'; - -import './ContentPackVersions.css'; - -class ContentPackVersions extends React.Component { - static propTypes = { - contentPackRevisions: PropTypes.object.isRequired, - onChange: PropTypes.func, - onDeletePack: PropTypes.func, - onInstall: PropTypes.func, - }; - - static defaultProps = { - onChange: () => { - }, - onDeletePack: () => { - }, - onInstall: () => { - }, - }; - - constructor(props) { - super(props); - const { contentPackRevisions } = this.props; - - this.state = { - modalRev: 0, - showModal: false, - selectedVersion: contentPackRevisions.latestRevision, - }; - - this.onChange = this.onChange.bind(this); - this.rowFormatter = this.rowFormatter.bind(this); - this.headerFormatter = this.headerFormatter.bind(this); - } - - onChange(event) { - const { onChange } = this.props; - - this.setState({ - selectedVersion: event.target.value, - }); - - onChange(event.target.value); - } - - // eslint-disable-next-line class-methods-use-this - headerFormatter = (header) => { - if (header === 'Action') { - return ({header}); - } - - return ({header}); - }; - - rowFormatter(pack) { - const { onDeletePack } = this.props; - const { selectedVersion } = this.state; - - const { openFunc, installModal } = this._installModal(pack); - let downloadRef; - const downloadModal = ( - { - downloadRef = node; - }} - contentPackId={pack.id} - revision={pack.rev} /> - ); - - return ( - - - - - {pack.rev} - - - - - Install - - Create New From Revision - - - { - onDeletePack(pack.id, pack.rev); - }}>Delete - - {installModal} - - - - {downloadModal} - - ); - } - - _installModal(item) { - let installRef; - - const { onInstall: onInstallProp } = this.props; - - const closeModal = () => { - this.setState({ showModal: false, modalRev: 0 }); - }; - - const open = () => { - this.setState({ showModal: true, modalRev: item.rev }); - }; - - const onInstall = () => { - installRef.onInstall(); - closeModal(); - }; - - const modal = ( - - - Install - - - { - installRef = node; - }} - contentPack={item} - onInstall={onInstallProp} /> - - - - - - ); - - return { openFunc: open, installModal: modal }; - } - - render() { - const { contentPackRevisions: { contentPacks } } = this.props; - const headers = ['Select', 'Revision', 'Action']; - - return ( - c.rev.toString()} - dataRowFormatter={this.rowFormatter} - rows={contentPacks} - filterKeys={[]} /> - ); - } -} - -export default ContentPackVersions; diff --git a/graylog2-web-interface/src/components/content-packs/ContentPackVersions.test.jsx b/graylog2-web-interface/src/components/content-packs/ContentPackVersions.test.jsx index 263ed10cc447..a796ddea1d0a 100644 --- a/graylog2-web-interface/src/components/content-packs/ContentPackVersions.test.jsx +++ b/graylog2-web-interface/src/components/content-packs/ContentPackVersions.test.jsx @@ -20,7 +20,8 @@ import { mount } from 'wrappedEnzyme'; import 'helpers/mocking/react-dom_mock'; import ContentPack from 'logic/content-packs/ContentPack'; import ContentPackRevisions from 'logic/content-packs/ContentPackRevisions'; -import ContentPackVersions from 'components/content-packs/ContentPackVersions'; + +import ContentPackVersions from './ContentPackVersions'; describe('', () => { const contentPackRev = ContentPack.builder() diff --git a/graylog2-web-interface/src/components/content-packs/ContentPackVersions.tsx b/graylog2-web-interface/src/components/content-packs/ContentPackVersions.tsx new file mode 100644 index 000000000000..0f0c7525ce56 --- /dev/null +++ b/graylog2-web-interface/src/components/content-packs/ContentPackVersions.tsx @@ -0,0 +1,77 @@ +/* + * 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 PropTypes from 'prop-types'; +import React from 'react'; + +import { DataTable } from 'components/common'; +import ContentPackVersionItem from 'components/content-packs/components/ContentPackVersionItem'; +import type { ContentPackVersionsType, ContentPackInstallation } from 'components/content-packs/Types'; + +import './ContentPackVersions.css'; + +type Props = { + contentPackRevisions: ContentPackVersionsType, + onDeletePack: (id: string) => void, + onChange: (id: string) => void, + onInstall: (id: string, contentPackRev: string, parameters: unknown) => void, +}; + +const headerFormatter = (header) => { + if (header === 'Action') { + return ({header}); + } + + return ({header}); +}; + +const ContentPackVersions = ({ onDeletePack, contentPackRevisions, onInstall, onChange }: Props) => { + const { contentPacks } = contentPackRevisions; + const headers = ['Select', 'Revision', 'Action']; + const rowFormatter = (item: ContentPackInstallation) => ( + + ); + + return ( + c.rev.toString()} + dataRowFormatter={rowFormatter} + rows={contentPacks} + filterKeys={[]} /> + ); +}; + +ContentPackVersions.propTypes = { + contentPackRevisions: PropTypes.object.isRequired, + onChange: PropTypes.func, + onDeletePack: PropTypes.func, + onInstall: PropTypes.func, +}; + +ContentPackVersions.defaultProps = { + onChange: () => {}, + onDeletePack: () => {}, + onInstall: () => {}, +}; + +export default ContentPackVersions; diff --git a/graylog2-web-interface/src/components/content-packs/ContentPacksList.jsx b/graylog2-web-interface/src/components/content-packs/ContentPacksList.jsx deleted file mode 100644 index f735c198b336..000000000000 --- a/graylog2-web-interface/src/components/content-packs/ContentPacksList.jsx +++ /dev/null @@ -1,298 +0,0 @@ -/* - * 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 PropTypes from 'prop-types'; -import React from 'react'; - -import { LinkContainer, Link } from 'components/common/router'; -import Routes from 'routing/Routes'; -import { - Button, - Col, - DropdownButton, - MenuItem, - Modal, - Row, - ButtonToolbar, -} from 'components/bootstrap'; -import { - Pagination, PageSizeSelect, - ModalSubmit, NoSearchResult, NoEntitiesExist, -} from 'components/common'; -import TypeAheadDataFilter from 'components/common/TypeAheadDataFilter'; -import BootstrapModalWrapper from 'components/bootstrap/BootstrapModalWrapper'; -import ControlledTableList from 'components/common/ControlledTableList'; -import ContentPackStatus from 'components/content-packs/ContentPackStatus'; -import ContentPackDownloadControl from 'components/content-packs/ContentPackDownloadControl'; -import withTelemetry from 'logic/telemetry/withTelemetry'; -import { getPathnameWithoutId } from 'util/URLUtils'; -import { TELEMETRY_EVENT_TYPE } from 'logic/telemetry/Constants'; -import withLocation from 'routing/withLocation'; - -import ContentPackInstall from './ContentPackInstall'; - -class ContentPacksList extends React.Component { - static propTypes = { - contentPacks: PropTypes.arrayOf(PropTypes.object), - contentPackMetadata: PropTypes.object, - onDeletePack: PropTypes.func, - onInstall: PropTypes.func, - sendTelemetry: PropTypes.func.isRequired, - location: PropTypes.object.isRequired, - }; - - static defaultProps = { - contentPacks: [], - onDeletePack: () => { - }, - onInstall: () => { - }, - contentPackMetadata: {}, - }; - - constructor(props) { - super(props); - - this.state = { - showModal: false, - filteredContentPacks: props.contentPacks, - pageSize: 10, - currentPage: 1, - }; - - this._filterContentPacks = this._filterContentPacks.bind(this); - this._itemsShownChange = this._itemsShownChange.bind(this); - this._onChangePage = this._onChangePage.bind(this); - } - - UNSAFE_componentWillReceiveProps(nextProps) { - this.setState({ filteredContentPacks: nextProps.contentPacks }); - } - - _installModal(item) { - let installRef; - - const { onInstall: onInstallProp } = this.props; - - const closeModal = () => { - this.setState({ showModal: false }); - }; - - const open = () => { - this.setState({ showModal: true }); - }; - - const onInstall = () => { - installRef.onInstall(); - closeModal(); - }; - - const modal = ( - - - Install Content Pack - - - { - installRef = node; - }} - contentPack={item} - onInstall={onInstallProp} /> - - - - - - ); - - return { openFunc: open, installModal: modal }; - } - - _formatItems(items) { - const { pageSize, currentPage } = this.state; - const { contentPackMetadata, onDeletePack, sendTelemetry, location } = this.props; - const begin = (pageSize * (currentPage - 1)); - const end = begin + pageSize; - const shownItems = items.slice(begin, end); - - return shownItems.map((item) => { - const { openFunc, installModal } = this._installModal(item); - let downloadRef; - const downloadModal = ( - { - downloadRef = node; - }} - contentPackId={item.id} - revision={item.rev} /> - ); - - const metadata = contentPackMetadata[item.id] || {}; - const installed = Object.keys(metadata).find((rev) => metadata[rev].installation_count > 0); - const states = installed ? ['installed'] : []; - const updateButton = states.includes('updatable') ? : ''; - - const handleInstall = () => { - sendTelemetry(TELEMETRY_EVENT_TYPE.CONTENT_PACK.INSTALLED, { - app_pathname: getPathnameWithoutId(location.pathname), - app_section: 'content-packs', - app_action_value: 'install-button', - }); - - openFunc(); - }; - - const handleDownload = () => { - sendTelemetry(TELEMETRY_EVENT_TYPE.CONTENT_PACK.DOWNLOADED, { - app_pathname: getPathnameWithoutId(location.pathname), - app_section: 'content-packs', - app_action_value: 'download-menu-item', - }); - - downloadRef.open(); - }; - - const handleDeleteAllVersions = () => { - sendTelemetry(TELEMETRY_EVENT_TYPE.CONTENT_PACK.ALL_VERSIONS_DELETED, { - app_pathname: getPathnameWithoutId(location.pathname), - app_section: 'content-packs', - app_action_value: 'delete-all-versions-menu-item', - }); - - onDeletePack(item.id); - }; - - return ( - - - -

{item.name} - Latest - Version: {item.rev} - -

- - - - {updateButton} - - {installModal} - - - Show - - - Create New Version - - - Download - - - - Delete All Versions - - - {downloadModal} - - -
- - - {item.summary}  - - -
- ); - }); - } - - _filterContentPacks(filteredItems) { - this.setState({ filteredContentPacks: filteredItems }); - } - - _itemsShownChange(pageSize) { - this.setState({ pageSize, currentPage: 1 }); - } - - _onChangePage(nextPage) { - this.setState({ currentPage: nextPage }); - } - - render() { - const { filteredContentPacks, pageSize, currentPage } = this.state; - const { contentPacks } = this.props; - const numberPages = Math.ceil(filteredContentPacks.length / pageSize); - - const pagination = ( - - ); - - const pageSizeSelect = ( - - ); - - const noContentMessage = contentPacks.length <= 0 - ? No content packs found. Please create or upload one - : No matching content packs have been found; - const content = filteredContentPacks.length <= 0 - ? (
{noContentMessage}
) - : ( - - - {this._formatItems(filteredContentPacks)} - - ); - - return ( -
- - - - - - {pagination} - - - {pageSizeSelect} - - - {content} - - - - {pagination} - - - {pageSizeSelect} - - -
- ); - } -} - -export default withLocation(withTelemetry(ContentPacksList)); diff --git a/graylog2-web-interface/src/components/content-packs/ContentPacksList.test.tsx b/graylog2-web-interface/src/components/content-packs/ContentPacksList.test.tsx index da598516e40e..8f3abf7c3c29 100644 --- a/graylog2-web-interface/src/components/content-packs/ContentPacksList.test.tsx +++ b/graylog2-web-interface/src/components/content-packs/ContentPacksList.test.tsx @@ -20,26 +20,26 @@ import userEvent from '@testing-library/user-event'; import ContentPacksList from 'components/content-packs/ContentPacksList'; -jest.mock('routing/withLocation', () => (Component) => (props) => ); +import type { ContentPackInstallation, ContentPackMetadata } from './Types'; describe('', () => { const contentPacks = [ - { id: '1', rev: 1, title: 'UFW Grok Patterns', summary: 'Content Pack: Grok Patterns to extract informations from UFW logfiles', version: '1.0' }, - { id: '2', rev: 1, title: 'Rails Log Patterns', summary: 'Patterns to retreive rails production logs', version: '2.1' }, - { id: '3', rev: 1, title: 'Backup Content Pack', summary: '', version: '3.0' }, - { id: '4', rev: 1, title: 'SSH Archive', summary: 'A crypted backup over ssh.', version: '3.4' }, - { id: '5', rev: 1, title: 'FTP Backup', summary: 'Fast but insecure backup', version: '1.0' }, - { id: '6', rev: 1, title: 'UFW Grok Patterns', summary: 'Grok Patterns to extract informations from UFW logfiles', version: '1.0' }, - { id: '7', rev: 1, title: 'Rails Log Patterns', summary: 'Patterns to retreive rails production logs', version: '2.1' }, - { id: '8', rev: 1, title: 'Backup Content Pack', summary: '', version: '3.0', states: ['installed'] }, - { id: '9', rev: 1, title: 'SSH Archive', summary: 'A crypted backup over ssh.', version: '3.4' }, - { id: '10', rev: 1, title: 'FTP Backup', summary: 'Fast but insecure backup', version: '1.0' }, - { id: '11', rev: 1, title: 'UFW Grok Patterns', summary: 'Grok Patterns to extract informations from UFW logfiles', version: '1.0' }, - { id: '12', rev: 1, title: 'Rails Log Patterns', summary: 'Patterns to retreive rails production logs', version: '2.1' }, - { id: '13', rev: 1, title: 'Backup Content Pack', summary: '', version: '3.0' }, - { id: '14', rev: 1, title: 'SSH Archive', summary: 'A crypted backup over ssh.', version: '3.4' }, - { id: '15', rev: 1, title: 'FTP Backup', summary: 'Fast but insecure backup', version: '1.0' }, - ]; + { id: '1', rev: 1, name: 'UFW Grok Patterns', summary: 'Content Pack: Grok Patterns to extract informations from UFW logfiles', server_version: '1.0' }, + { id: '2', rev: 1, name: 'Rails Log Patterns', summary: 'Patterns to retreive rails production logs', server_version: '2.1' }, + { id: '3', rev: 1, name: 'Backup Content Pack', summary: '', server_version: '3.0' }, + { id: '4', rev: 1, name: 'SSH Archive', summary: 'A crypted backup over ssh.', server_version: '3.4' }, + { id: '5', rev: 1, name: 'FTP Backup', summary: 'Fast but insecure backup', server_version: '1.0' }, + { id: '6', rev: 1, name: 'UFW Grok Patterns', summary: 'Grok Patterns to extract informations from UFW logfiles', server_version: '1.0' }, + { id: '7', rev: 1, name: 'Rails Log Patterns', summary: 'Patterns to retreive rails production logs', server_version: '2.1' }, + { id: '8', rev: 1, name: 'Backup Content Pack', summary: '', server_version: '3.0', states: ['installed'] }, + { id: '9', rev: 1, name: 'SSH Archive', summary: 'A crypted backup over ssh.', server_version: '3.4' }, + { id: '10', rev: 1, name: 'FTP Backup', summary: 'Fast but insecure backup', server_version: '1.0' }, + { id: '11', rev: 1, name: 'UFW Grok Patterns', summary: 'Grok Patterns to extract informations from UFW logfiles', server_version: '1.0' }, + { id: '12', rev: 1, name: 'Rails Log Patterns', summary: 'Patterns to retreive rails production logs', server_version: '2.1' }, + { id: '13', rev: 1, name: 'Backup Content Pack', summary: '', server_version: '3.0' }, + { id: '14', rev: 1, name: 'SSH Archive', summary: 'A crypted backup over ssh.', server_version: '3.4' }, + { id: '15', rev: 1, name: 'FTP Backup', summary: 'Fast but insecure backup', server_version: '1.0' }, + ] as Array; it('should render with empty content packs', async () => { render(); @@ -51,7 +51,7 @@ describe('', () => { const metadata = { 1: { 1: { installation_count: 1 } }, 2: { 5: { installation_count: 2 } }, - }; + } as ContentPackMetadata; render(); await screen.findByText('Content Pack: Grok Patterns to extract informations from UFW logfiles'); @@ -72,7 +72,7 @@ describe('', () => { it('should delete a content pack', async () => { const deleteFn = jest.fn(); - render(); + render(); userEvent.click((await screen.findAllByRole('menuitem', { name: 'Delete All Versions' }))[0]); diff --git a/graylog2-web-interface/src/components/content-packs/ContentPacksList.tsx b/graylog2-web-interface/src/components/content-packs/ContentPacksList.tsx new file mode 100644 index 000000000000..4b2188f19a6f --- /dev/null +++ b/graylog2-web-interface/src/components/content-packs/ContentPacksList.tsx @@ -0,0 +1,155 @@ +/* + * 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 * as React from 'react'; +import { useState } from 'react'; +import PropTypes from 'prop-types'; +import styled, { css } from 'styled-components'; + +import { + Col, + Row, +} from 'components/bootstrap'; +import { + Pagination, PageSizeSelect, NoSearchResult, NoEntitiesExist, +} from 'components/common'; +import TypeAheadDataFilter from 'components/common/TypeAheadDataFilter'; +import ControlledTableList from 'components/common/ControlledTableList'; +import ContentPackListItem from 'components/content-packs/components/ContentPackListItem'; +import { DEFAULT_PAGINATION } from 'stores/PaginationTypes'; + +import type { ContentPackInstallation, ContentPackMetadata } from './Types'; + +type Props = { + contentPacks: Array, + contentPackMetadata: ContentPackMetadata, + onDeletePack: (id: string) => void, + onInstall: (id: string, contentPackRev: string, parameters: unknown) => void, +}; + +const StyledPageSizeSelect = styled(PageSizeSelect)(({ theme }) => css` + display: flex; + align-items: center; + gap: ${theme.spacings.xs}; + float: right; +`); + +const ContentPacksList = ({ contentPacks, contentPackMetadata, onDeletePack, onInstall }: Props) => { + const [filteredContentPacks, setFilteredContentPacks] = useState(contentPacks); + const [paginationOption, setPaginationOption] = useState(DEFAULT_PAGINATION); + + const formatItems = (items: Array) => { + const { perPage, page } = paginationOption; + const begin = (perPage * (page - 1)); + const end = begin + perPage; + const shownItems = items.slice(begin, end); + + return shownItems.map((item) => ( + + )); + }; + + const filterContentPacks = (filteredItems: Array) => { + setFilteredContentPacks(filteredItems); + }; + + const onItemsShownChange = (pageSize: number) => { + setPaginationOption({ ...paginationOption, perPage: pageSize }); + }; + + const onChangePage = (nextPage: number) => { + setPaginationOption({ ...paginationOption, page: nextPage }); + }; + + const numberPages = Math.ceil(filteredContentPacks.length / paginationOption.perPage); + + const pagination = ( + + ); + + const pageSizeSelect = ( + + ); + + const noContentMessage = contentPacks.length <= 0 + ? No content packs found. Please create or upload one + : No matching content packs have been found; + + const content = filteredContentPacks.length <= 0 + ? (
{noContentMessage}
) + : ( + + + {formatItems(filteredContentPacks)} + + ); + + return ( +
+ + + + + + {pagination} + + + {pageSizeSelect} + + + {content} + + + + {pagination} + + + {pageSizeSelect} + + +
+ ); +}; + +ContentPacksList.propTypes = { + contentPacks: PropTypes.arrayOf(PropTypes.object), + contentPackMetadata: PropTypes.object, + onDeletePack: PropTypes.func, + onInstall: PropTypes.func, +}; + +ContentPacksList.defaultProps = { + contentPacks: [], + contentPackMetadata: {}, + onDeletePack: () => {}, + onInstall: () => {}, +}; + +export default ContentPacksList; diff --git a/graylog2-web-interface/src/components/content-packs/Types.ts b/graylog2-web-interface/src/components/content-packs/Types.ts new file mode 100644 index 000000000000..a18b946f857a --- /dev/null +++ b/graylog2-web-interface/src/components/content-packs/Types.ts @@ -0,0 +1,78 @@ +/* + * 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 + * . + */ + +export type ContentPackInstallation = { + created_at: string, + description: string, + entities?: Array, + id: string, + name: string, + parameters?: Array, + rev: number, + server_version: string, + summary: string, + url: string, + v: number, + vendor: string, +} + +export type ContentPackVersionsType = { + contentPacks: Array, + latest: ContentPackInstallation, + latestRevision: number, + revisions: Array +} + +export type ContentPackEntity = { + id: string, + type: EntityType, + v: string, + data: Data, + constraints: Array, +} + +export interface EntityType { + name: string; + + version: string; +} + +export interface Data { + [key: string]: Type | { [key: string]: Type }, +} + +export interface Type { + '@type': string, + + '@value': string, +} + +export interface Constraint { + type: string, + + plugin?: string, + + version: string, +} + +export type ContentPackMetadata = { + [key: number]: { + [key: number]: { + [key: string]: number, + }, + }, +} diff --git a/graylog2-web-interface/src/components/content-packs/components/ContentPackListItem.test.tsx b/graylog2-web-interface/src/components/content-packs/components/ContentPackListItem.test.tsx new file mode 100644 index 000000000000..6a117a3ec924 --- /dev/null +++ b/graylog2-web-interface/src/components/content-packs/components/ContentPackListItem.test.tsx @@ -0,0 +1,79 @@ +/* + * 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 React from 'react'; +import { render, screen } from 'wrappedTestingLibrary'; +import userEvent from '@testing-library/user-event'; + +import ContentPackListItem from './ContentPackListItem'; + +describe('', () => { + const pack = { + id: '14', + name: 'SSH Archive', + created_at: '2023-10-25T13:33:51.147Z', + description: 'description', + rev: 3, + server_version: '6.0.0-SNAPSHOT', + summary: 'The Open Thread Exchange Lookup Table of the Threat Intel Plugin', + url: 'https://github.com/Graylog2/graylog2-server', + v: 1, + vendor: 'Graylog ', + }; + + const metadata = { + 1: { 1: { installation_count: 1 } }, + 2: { 5: { installation_count: 2 } }, + }; + + it('render content pack item', async () => { + render( + {}} + onInstall={() => {}} />); + + await screen.findByText('SSH Archive'); + }); + + it('delete content pack item version', async () => { + const deleteFn = jest.fn(); + + render( + {}} />); + + userEvent.click((await screen.findAllByRole('menuitem', { name: 'Delete All Versions' }))[0]); + + expect(deleteFn).toHaveBeenCalledTimes(1); + }); + + it('install content pack item version', async () => { + const deleteFn = jest.fn(); + + render( + {}} />); + + userEvent.click((await screen.findAllByRole('menuitem', { name: 'Delete All Versions' }))[0]); + + expect(deleteFn).toHaveBeenCalledTimes(1); + }); +}); diff --git a/graylog2-web-interface/src/components/content-packs/components/ContentPackListItem.tsx b/graylog2-web-interface/src/components/content-packs/components/ContentPackListItem.tsx new file mode 100644 index 000000000000..2bac244f811d --- /dev/null +++ b/graylog2-web-interface/src/components/content-packs/components/ContentPackListItem.tsx @@ -0,0 +1,149 @@ +/* + * 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 * as React from 'react'; +import { useState, useRef } from 'react'; +import PropTypes from 'prop-types'; + +import { + Button, + Col, + DropdownButton, + MenuItem, + Modal, + Row, + ButtonToolbar, +} from 'components/bootstrap'; +import { ModalSubmit } from 'components/common'; +import ControlledTableListItem from 'components/common/ControlledTableListItem'; +import { LinkContainer, Link } from 'components/common/router'; +import ContentPackStatus from 'components/content-packs/ContentPackStatus'; +import BootstrapModalWrapper from 'components/bootstrap/BootstrapModalWrapper'; +import ContentPackInstall from 'components/content-packs/ContentPackInstall'; +import ContentPackDownloadControl from 'components/content-packs/ContentPackDownloadControl'; +import Routes from 'routing/Routes'; + +import type { ContentPackInstallation, ContentPackMetadata } from '../Types'; + +type Props = { + pack: ContentPackInstallation, + contentPackMetadata: ContentPackMetadata, + onDeletePack: (id: string) => void, + onInstall: (id: string, contentPackRev: string, parameters: unknown) => void, +}; + +const ContentPackListItem = ({ pack, contentPackMetadata, onDeletePack, onInstall: onInstallProp }: Props) => { + const [showInstallModal, setShowInstallModal] = useState(false); + const [showDownloadModal, setShowDownloadModal] = useState(false); + const installRef = useRef(null); + const metadata = contentPackMetadata[pack.id] || {}; + const installed = Object.keys(metadata).find((rev) => metadata[rev].installation_count > 0); + const states = installed ? ['installed'] : []; + const updateButton = states.includes('updatable') ? : ''; + + const handleInstall = () => setShowInstallModal(true); + + const handleDownload = () => setShowDownloadModal(true); + + const handleDeleteAllVersions = () => onDeletePack(pack.id); + + const onCloseInstallModal = () => setShowInstallModal(false); + + const onInstall = () => { + if (installRef.current !== null) { + installRef.current?.onInstall(); + } + + setShowInstallModal(false); + }; + + return ( + + + +

{pack.name} + {' '} + Latest + Version: {pack.rev} + +

+ + + + {updateButton} + + + + Show + + + Create New Version + + + Download + + + + Delete All Versions + + + + +
+ + + {pack.summary}  + + + {showInstallModal && ( + + + Install Content Pack + + + + + + + + + )} + {showDownloadModal && ( + setShowDownloadModal(false)} + contentPackId={pack.id} + revision={pack.rev} /> + )} +
+ + ); +}; + +ContentPackListItem.propTypes = { + pack: PropTypes.object.isRequired, + contentPackMetadata: PropTypes.object.isRequired, + onDeletePack: PropTypes.func.isRequired, + onInstall: PropTypes.func.isRequired, +}; + +ContentPackListItem.defaultProps = {}; + +export default ContentPackListItem; diff --git a/graylog2-web-interface/src/components/content-packs/components/ContentPackVersionItem.tsx b/graylog2-web-interface/src/components/content-packs/components/ContentPackVersionItem.tsx new file mode 100644 index 000000000000..09cf9989c3f7 --- /dev/null +++ b/graylog2-web-interface/src/components/content-packs/components/ContentPackVersionItem.tsx @@ -0,0 +1,150 @@ +/* + * 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 * as React from 'react'; +import { useState, useRef } from 'react'; +import PropTypes from 'prop-types'; + +import { LinkContainer } from 'components/common/router'; +import Routes from 'routing/Routes'; +import { ModalSubmit } from 'components/common'; +import ContentPackDownloadControl from 'components/content-packs/ContentPackDownloadControl'; +import ContentPackInstall from 'components/content-packs/ContentPackInstall'; +import { + BootstrapModalWrapper, + Button, + DropdownButton, + ButtonToolbar, + MenuItem, + Modal, +} from 'components/bootstrap'; +import type { ContentPackVersionsType, ContentPackInstallation } from 'components/content-packs/Types'; + +type Props = { + pack: ContentPackInstallation + contentPackRevisions: ContentPackVersionsType, + onDeletePack: (id: string, rev: number) => void, + onChange: (id: string) => void, + onInstall: (id: string, contentPackRev: string, parameters: unknown) => void, +}; + +const ContentPackVersionItem = ({ + pack, + contentPackRevisions, + onChange: onChangeProp, + onDeletePack, + onInstall: onInstallProp, +}: Props) => { + const [showInstallModal, setShowInstallModal] = useState(false); + const [showDownloadModal, setShowDownloadModal] = useState(false); + const [selectedVersion, setSelectedVersion] = useState(contentPackRevisions.latestRevision); + const installRef = useRef(null); + + const handleInstall = () => setShowInstallModal(true); + + const handleDownload = () => setShowDownloadModal(true); + + const onCloseInstallModal = () => setShowInstallModal(false); + + const onChange = (event) => { + const version = event.target.value; + + setSelectedVersion(version); + onChangeProp(version); + }; + + const onInstall = () => { + if (installRef.current !== null) { + installRef.current?.onInstall(); + } + + setShowInstallModal(false); + }; + + return ( + + {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */} + + + + {pack.rev} + + + + + handleInstall()}>Install + + Create New From Revision + + + { + onDeletePack(pack.id, pack.rev); + }}>Delete + + + + + {showInstallModal && ( + + + Install Content Pack + + + + + + + + + )} + {showDownloadModal && ( + setShowDownloadModal(false)} + contentPackId={pack.id} + revision={pack.rev} /> + )} + + + ); +}; + +ContentPackVersionItem.propTypes = { + pack: PropTypes.object.isRequired, + contentPackRevisions: PropTypes.object.isRequired, + onChange: PropTypes.func, + onDeletePack: PropTypes.func, + onInstall: PropTypes.func, +}; + +ContentPackVersionItem.defaultProps = { + onChange: () => {}, + onDeletePack: () => {}, + onInstall: () => {}, +}; + +export default ContentPackVersionItem; diff --git a/graylog2-web-interface/src/pages/ContentPacksPage.tsx b/graylog2-web-interface/src/pages/ContentPacksPage.tsx index a3ed66146982..9596ef1e7fde 100644 --- a/graylog2-web-interface/src/pages/ContentPacksPage.tsx +++ b/graylog2-web-interface/src/pages/ContentPacksPage.tsx @@ -27,6 +27,7 @@ import ContentPacksList from 'components/content-packs/ContentPacksList'; import ContentPackUploadControls from 'components/content-packs/ContentPackUploadControls'; import { ContentPacksActions, ContentPacksStore } from 'stores/content-packs/ContentPacksStore'; import { useStore } from 'stores/connect'; +import type { ContentPackInstallation, ContentPackMetadata } from 'components/content-packs/Types'; const ConfigurationBundles = styled.div(({ theme }) => css` font-size: ${theme.fonts.size.body}; @@ -64,7 +65,7 @@ const _installContentPack = (contentPackId: string, contentPackRev: string, para }; const ContentPacksPage = () => { - const { contentPacks, contentPackMetadata } = useStore<{ contentPacks: unknown, contentPackMetadata: unknown }>(ContentPacksStore); + const { contentPacks, contentPackMetadata } = useStore<{ contentPacks: Array, contentPackMetadata: ContentPackMetadata }>(ContentPacksStore); useEffect(() => { ContentPacksActions.list(); diff --git a/graylog2-web-interface/src/routing/ApiRoutes.ts b/graylog2-web-interface/src/routing/ApiRoutes.ts index 8d84cb2d643e..ddeef87c3897 100644 --- a/graylog2-web-interface/src/routing/ApiRoutes.ts +++ b/graylog2-web-interface/src/routing/ApiRoutes.ts @@ -22,7 +22,7 @@ type SearchQueryString = { query: string, limit?: number, offset?: number, - sort?: `${string}:${'asc'|'desc'}`, + sort?: `${string}:${'asc' | 'desc'}`, decorate?: boolean, fields?: string, filter?: string, @@ -76,7 +76,7 @@ const ApiRoutes = { list: () => ({ url: '/system/content_packs/latest' }), get: (contentPackId: string) => ({ url: `/system/content_packs/${contentPackId}` }), getRev: (contentPackId: string, revision: string) => ({ url: `/system/content_packs/${contentPackId}/${revision}` }), - downloadRev: (contentPackId: string, revision: string) => ({ url: `/system/content_packs/${contentPackId}/${revision}/download` }), + downloadRev: (contentPackId: string, revision: number) => ({ url: `/system/content_packs/${contentPackId}/${revision}/download` }), create: () => ({ url: '/system/content_packs' }), delete: (contentPackId: string) => ({ url: `/system/content_packs/${contentPackId}` }), deleteRev: (contentPackId: string, revision: string) => ({ url: `/system/content_packs/${contentPackId}/${revision}` }), @@ -335,9 +335,13 @@ const ApiRoutes = { queryString.query = query; - Object.keys(timerange).forEach((key) => { queryString[key] = timerange[key]; }); + Object.keys(timerange).forEach((key) => { + queryString[key] = timerange[key]; + }); - Object.keys(streamFilter).forEach((key) => { queryString[key] = streamFilter[key]; }); + Object.keys(streamFilter).forEach((key) => { + queryString[key] = streamFilter[key]; + }); return queryString as SearchQueryString; }, From 8b8a885187e26c41bd8c7cf9be0aef5ed2daf33e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 19:28:51 +0100 Subject: [PATCH 28/39] Bump antlr.version from 4.8-1 to 4.13.1 (#16681) Bumps `antlr.version` from 4.8-1 to 4.13.1. Updates `org.antlr:antlr4-maven-plugin` from 4.8-1 to 4.13.1 - [Release notes](https://github.com/antlr/antlr4/releases) - [Changelog](https://github.com/antlr/antlr4/blob/dev/CHANGES.txt) - [Commits](https://github.com/antlr/antlr4/commits/4.13.1) Updates `org.antlr:antlr4-runtime` from 4.8-1 to 4.13.1 - [Release notes](https://github.com/antlr/antlr4/releases) - [Changelog](https://github.com/antlr/antlr4/blob/dev/CHANGES.txt) - [Commits](https://github.com/antlr/antlr4/commits/4.13.1) --- updated-dependencies: - dependency-name: org.antlr:antlr4-maven-plugin dependency-type: direct:production - dependency-name: org.antlr:antlr4-runtime dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bernd Ahlers Co-authored-by: Bernd Ahlers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 985f8266376d..39e6aba72fd1 100644 --- a/pom.xml +++ b/pom.xml @@ -90,7 +90,7 @@ 2.11.0-1 2.9.0 5.20.0 - 4.8-1 + 4.13.1 1.0.3 4.5.14 4.4.16 From 967c0b83377761761594aebad1546f475524136e Mon Sep 17 00:00:00 2001 From: Othello Maurer Date: Mon, 13 Nov 2023 20:01:03 +0100 Subject: [PATCH 29/39] Manage dependencies: avro, commons-compress (#16941) Co-authored-by: Marco Pfatschbacher --- pom.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pom.xml b/pom.xml index 39e6aba72fd1..5e94d0b87e32 100644 --- a/pom.xml +++ b/pom.xml @@ -372,6 +372,22 @@ okhttp-tls ${okhttp.version} + + + org.apache.avro + avro + 1.11.3 + + + + org.apache.commons + commons-compress + 1.24.0 + + commons-net commons-net From 50fc375f33cea766382ad9660090e441ee5c9a58 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 08:09:32 +0100 Subject: [PATCH 30/39] Bump the typescript-eslint group (#17269) Bumps the typescript-eslint group in /graylog2-web-interface/packages/eslint-config-graylog with 2 updates: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser). Updates `@typescript-eslint/eslint-plugin` from 6.10.0 to 6.11.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.11.0/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 6.10.0 to 6.11.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.11.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: typescript-eslint - dependency-name: "@typescript-eslint/parser" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: typescript-eslint ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../packages/eslint-config-graylog/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graylog2-web-interface/packages/eslint-config-graylog/package.json b/graylog2-web-interface/packages/eslint-config-graylog/package.json index 66ef1c204423..ebbf7a908625 100644 --- a/graylog2-web-interface/packages/eslint-config-graylog/package.json +++ b/graylog2-web-interface/packages/eslint-config-graylog/package.json @@ -15,8 +15,8 @@ "dependencies": { "@babel/eslint-parser": "7.16.5", "@tanstack/eslint-plugin-query": "4.36.1", - "@typescript-eslint/eslint-plugin": "6.10.0", - "@typescript-eslint/parser": "6.10.0", + "@typescript-eslint/eslint-plugin": "6.11.0", + "@typescript-eslint/parser": "6.11.0", "eslint": "8.53.0", "eslint-config-airbnb": "19.0.4", "eslint-import-resolver-webpack": "0.13.8", From e81d3a03bbf91ec7c4da0db4350403d9a87678a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 08:10:03 +0100 Subject: [PATCH 31/39] Bump @types/md5 from 2.3.4 to 2.3.5 in /graylog2-web-interface (#17266) Bumps [@types/md5](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/md5) from 2.3.4 to 2.3.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/md5) --- updated-dependencies: - dependency-name: "@types/md5" dependency-type: direct:development 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 d131075eaff3..4e7a5f35bdc6 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -4073,9 +4073,9 @@ integrity sha512-y9euML0cim1JrykNxADLfaG0FgD1g/yTHwUs/Jg9ZIU7WKj2/4IW9Lbb1WZbvck78W/lfGXFfe+u2EGfIJXdLQ== "@types/md5@^2.3.0": - version "2.3.4" - resolved "https://registry.yarnpkg.com/@types/md5/-/md5-2.3.4.tgz#48f2372f0aed1341c196ebc75eb1e13a00f16fd7" - integrity sha512-e/L4hvpCK8GavKXmP02QlNilZOj8lpmZGGA9QGMMPZjCUoKgi1B4BvhXcbruIi6r+PqzpcjLfda/tocpHFKqDA== + version "2.3.5" + resolved "https://registry.yarnpkg.com/@types/md5/-/md5-2.3.5.tgz#481cef0a896e3a5dcbfc5a8a8b02c05958af48a5" + integrity sha512-/i42wjYNgE6wf0j2bcTX6kuowmdL/6PE4IVitMpm2eYKBUuYCprdcWVK+xEF0gcV6ufMCRhtxmReGfc6hIK7Jw== "@types/mime@*": version "3.0.1" From 71fa432be4db0491f0ddabab925a004a864b05ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 08:10:11 +0100 Subject: [PATCH 32/39] Bump @types/chroma-js from 2.4.2 to 2.4.3 in /graylog2-web-interface (#17265) Bumps [@types/chroma-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chroma-js) from 2.4.2 to 2.4.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chroma-js) --- updated-dependencies: - dependency-name: "@types/chroma-js" dependency-type: direct:development 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 4e7a5f35bdc6..2b79cb30577a 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -3816,9 +3816,9 @@ "@types/node" "*" "@types/chroma-js@^2.1.3": - version "2.4.2" - resolved "https://registry.yarnpkg.com/@types/chroma-js/-/chroma-js-2.4.2.tgz#5c57e9f9ce5343f134e376fb76e07fd3271f150f" - integrity sha512-gbiHvCuBS9aXkE3OEDfS69bscNLTYtbbx2TQf6WyOu+4eCH1AH1gPSiDGF2UzwkRFAbqKNsC5F0mY0xcaEHCbg== + version "2.4.3" + resolved "https://registry.yarnpkg.com/@types/chroma-js/-/chroma-js-2.4.3.tgz#2f10bd16483a87d8ead68764fc439550e9c4cbb6" + integrity sha512-1ly5ly/7S/YF8aD7MxUQnFOZxdegimuOunJl0xDsLlguu5JrwuSTVGVH3UpIUlh6YauI0RMNT4cqjBonhgbdIQ== "@types/classnames@^2.2.9": version "2.2.9" From 83b171373c91a3a2a0cee97fc4b0e5d12aab2f14 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 08:10:21 +0100 Subject: [PATCH 33/39] Bump @types/react-sticky-el in /graylog2-web-interface (#17264) Bumps [@types/react-sticky-el](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-sticky-el) from 1.0.5 to 1.0.6. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-sticky-el) --- updated-dependencies: - dependency-name: "@types/react-sticky-el" dependency-type: direct:development 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 2b79cb30577a..6b2e1af3c84f 100644 --- a/graylog2-web-interface/yarn.lock +++ b/graylog2-web-interface/yarn.lock @@ -4225,9 +4225,9 @@ "@types/react" "*" "@types/react-sticky-el@^1.0.3": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@types/react-sticky-el/-/react-sticky-el-1.0.5.tgz#882c8d6016ef5d5ab1dc168207c24871233324d5" - integrity sha512-aaR8feNGPZqC+GDB0ieW9xmvP6qRqNc0RsyqtYgrWObaGGVjdo/x2Ft8rJQaHzh8RbKynCd5FK3gJGuElR/iww== + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/react-sticky-el/-/react-sticky-el-1.0.6.tgz#36ffec271872dcd53de3782f8199fe9c2ec44659" + integrity sha512-ermllRAXMOLxrIcIxMZWssz3hcod+Jbr30+jTfPUf5ORmDwR845vjX4qJU4suf4YXHFxZg56PijUg7qhaT6bNg== dependencies: "@types/react" "*" From fc91fbe89a6d7d55f8a4ee077dd50b32fb0898e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 08:55:27 +0100 Subject: [PATCH 34/39] Bump org.codehaus.mojo:buildnumber-maven-plugin from 1.4 to 3.2.0 (#16745) * Bump org.codehaus.mojo:buildnumber-maven-plugin from 1.4 to 3.2.0 Bumps [org.codehaus.mojo:buildnumber-maven-plugin](https://github.com/mojohaus/buildnumber-maven-plugin) from 1.4 to 3.2.0. - [Release notes](https://github.com/mojohaus/buildnumber-maven-plugin/releases) - [Commits](https://github.com/mojohaus/buildnumber-maven-plugin/compare/buildnumber-maven-plugin-1.4...3.2.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:buildnumber-maven-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Don't use useLastCommittedRevision setting If this is enabled, the new buildnumber plugin version sets the buildNumber to "null" instead of the last commit in the repository. * Missed the removal of useLastCommittedRevision in data-node/pom.xml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bernd Ahlers --- data-node/pom.xml | 5 +---- graylog2-server/pom.xml | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/data-node/pom.xml b/data-node/pom.xml index cea9df0f53b5..ecd2c1e94ba3 100644 --- a/data-node/pom.xml +++ b/data-node/pom.xml @@ -481,7 +481,7 @@ org.codehaus.mojo buildnumber-maven-plugin - 1.4 + 3.2.0 org.codehaus.mojo @@ -694,9 +694,6 @@ - - true - com.mycila diff --git a/graylog2-server/pom.xml b/graylog2-server/pom.xml index 63d23164b137..513bcba8421f 100644 --- a/graylog2-server/pom.xml +++ b/graylog2-server/pom.xml @@ -873,7 +873,7 @@ org.codehaus.mojo buildnumber-maven-plugin - 1.4 + 3.2.0 org.codehaus.mojo @@ -989,9 +989,6 @@ - - true - com.mycila From a3004b630e60165b289277215219a6255510d51c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 08:58:41 +0100 Subject: [PATCH 35/39] Bump eslint-plugin-testing-library (#17241) Bumps [eslint-plugin-testing-library](https://github.com/testing-library/eslint-plugin-testing-library) from 6.1.0 to 6.1.2. - [Release notes](https://github.com/testing-library/eslint-plugin-testing-library/releases) - [Changelog](https://github.com/testing-library/eslint-plugin-testing-library/blob/main/.releaserc.json) - [Commits](https://github.com/testing-library/eslint-plugin-testing-library/compare/v6.1.0...v6.1.2) --- updated-dependencies: - dependency-name: eslint-plugin-testing-library 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> --- .../packages/eslint-config-graylog/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graylog2-web-interface/packages/eslint-config-graylog/package.json b/graylog2-web-interface/packages/eslint-config-graylog/package.json index ebbf7a908625..9e17173126c4 100644 --- a/graylog2-web-interface/packages/eslint-config-graylog/package.json +++ b/graylog2-web-interface/packages/eslint-config-graylog/package.json @@ -29,6 +29,6 @@ "eslint-plugin-jsx-a11y": "6.8.0", "eslint-plugin-react": "7.33.2", "eslint-plugin-react-hooks": "4.6.0", - "eslint-plugin-testing-library": "6.1.0" + "eslint-plugin-testing-library": "6.1.2" } } From 8cb8adeb24652e0737c91fd38f2064be76c826e5 Mon Sep 17 00:00:00 2001 From: Bernd Ahlers Date: Tue, 14 Nov 2023 09:27:02 +0100 Subject: [PATCH 36/39] Update download-maven-plugin to our fork (#17245) The caching in the latest upstream version is completely broken since April 2023 and the maintainers are currently unresponsive. Our fork is based on version 1.6.8 and fixes the excessive download progress logging which is a problem with the log size limit on GitHub Actions. --- data-node/pom.xml | 2 +- pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data-node/pom.xml b/data-node/pom.xml index ecd2c1e94ba3..20453df4c057 100644 --- a/data-node/pom.xml +++ b/data-node/pom.xml @@ -498,7 +498,7 @@ - com.googlecode.maven-download-plugin + org.graylog.repackaged download-maven-plugin ${download-maven-plugin.version} diff --git a/pom.xml b/pom.xml index 5e94d0b87e32..b365c931066c 100644 --- a/pom.xml +++ b/pom.xml @@ -203,7 +203,7 @@ 4.0.rc2 - 1.6.8 + 1.6.8.1 @@ -894,7 +894,7 @@ - com.googlecode.maven-download-plugin + org.graylog.repackaged download-maven-plugin ${download-maven-plugin.version} From 98fb2c1872ef03c25f3b4179ddfb5c671665ff7f Mon Sep 17 00:00:00 2001 From: Dennis Oelkers Date: Tue, 14 Nov 2023 09:28:36 +0100 Subject: [PATCH 37/39] Include basic data node usage information in telemetry. (#17042) * Include basic data node usage information in telemetry. * Adding changelog snippet. --- changelog/unreleased/pr-17042.toml | 5 +++++ .../rest/TelemetryResponseFactory.java | 5 ++++- .../telemetry/rest/TelemetryService.java | 18 +++++++++++++++--- .../telemetry/rest/TelemetryServiceTest.java | 10 ++++++++-- .../rest/TelemetryServiceWithDbTest.java | 10 ++++++++-- .../telemetry/rest/TelemetryTestHelper.java | 2 ++ .../src/logic/telemetry/TelemetryProvider.tsx | 2 ++ .../src/logic/telemetry/useTelemetryData.tsx | 3 +++ 8 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 changelog/unreleased/pr-17042.toml diff --git a/changelog/unreleased/pr-17042.toml b/changelog/unreleased/pr-17042.toml new file mode 100644 index 000000000000..9f547d01e011 --- /dev/null +++ b/changelog/unreleased/pr-17042.toml @@ -0,0 +1,5 @@ +type = "a" +message = "Including basic data node usage information in telemetry." + +pulls = ["17042"] + diff --git a/graylog2-server/src/main/java/org/graylog2/telemetry/rest/TelemetryResponseFactory.java b/graylog2-server/src/main/java/org/graylog2/telemetry/rest/TelemetryResponseFactory.java index 1530300b6c73..c6ab97426ff4 100644 --- a/graylog2-server/src/main/java/org/graylog2/telemetry/rest/TelemetryResponseFactory.java +++ b/graylog2-server/src/main/java/org/graylog2/telemetry/rest/TelemetryResponseFactory.java @@ -39,6 +39,7 @@ class TelemetryResponseFactory { private static final String LICENSE = "license"; private static final String PLUGIN = "plugin"; private static final String SEARCH_CLUSTER = "search_cluster"; + private static final String DATA_NODES = "data_nodes"; private static boolean isLeader(Map n) { if (n.get(FIELD_IS_LEADER) instanceof Boolean isLeader) { @@ -52,7 +53,8 @@ Map createTelemetryResponse(Map clusterInfo, Map pluginInfo, Map searchClusterInfo, List licenseStatuses, - TelemetryUserSettings telemetryUserSettings) { + TelemetryUserSettings telemetryUserSettings, + Map dataNodeInfo) { Map telemetryResponse = new LinkedHashMap<>(); telemetryResponse.put(CURRENT_USER, userInfo); telemetryResponse.put(USER_TELEMETRY_SETTINGS, telemetryUserSettings); @@ -60,6 +62,7 @@ Map createTelemetryResponse(Map clusterInfo, telemetryResponse.put(LICENSE, createLicenseInfo(licenseStatuses)); telemetryResponse.put(PLUGIN, pluginInfo); telemetryResponse.put(SEARCH_CLUSTER, searchClusterInfo); + telemetryResponse.put(DATA_NODES, dataNodeInfo); return telemetryResponse; } diff --git a/graylog2-server/src/main/java/org/graylog2/telemetry/rest/TelemetryService.java b/graylog2-server/src/main/java/org/graylog2/telemetry/rest/TelemetryService.java index bdd0b7cf6301..7c80f3c5d902 100644 --- a/graylog2-server/src/main/java/org/graylog2/telemetry/rest/TelemetryService.java +++ b/graylog2-server/src/main/java/org/graylog2/telemetry/rest/TelemetryService.java @@ -19,6 +19,8 @@ import com.google.common.eventbus.EventBus; import com.google.common.eventbus.Subscribe; import com.google.common.hash.HashCode; +import org.graylog2.cluster.Node; +import org.graylog2.cluster.NodeService; import org.graylog2.indexer.cluster.ClusterAdapter; import org.graylog2.plugin.PluginMetaData; import org.graylog2.plugin.database.users.User; @@ -65,7 +67,7 @@ public class TelemetryService { private final boolean isTelemetryEnabled; private final TelemetryClusterService telemetryClusterService; private final String installationSource; - + private final NodeService nodeService; @Inject public TelemetryService( @@ -80,7 +82,8 @@ public TelemetryService( DBTelemetryUserSettingsService dbTelemetryUserSettingsService, EventBus eventBus, TelemetryClusterService telemetryClusterService, - @Named("installation_source") String installationSource) { + @Named("installation_source") String installationSource, + NodeService nodeService) { this.isTelemetryEnabled = isTelemetryEnabled; this.trafficCounterService = trafficCounterService; this.enterpriseDataProvider = enterpriseDataProvider; @@ -92,6 +95,7 @@ public TelemetryService( this.dbTelemetryUserSettingsService = dbTelemetryUserSettingsService; this.telemetryClusterService = telemetryClusterService; this.installationSource = installationSource; + this.nodeService = nodeService; eventBus.register(this); } @@ -108,7 +112,8 @@ public Map getTelemetryResponse(User currentUser) { getPluginInfo(), getSearchClusterInfo(), licenseStatuses, - telemetryUserSettings); + telemetryUserSettings, + getDataNodeInfo()); } else { return telemetryResponseFactory.createTelemetryDisabledResponse(telemetryUserSettings); } @@ -206,4 +211,11 @@ private Map getSearchClusterInfo() { elasticsearchVersion.toString(), nodesInfo); } + + private Map getDataNodeInfo() { + final var dataNodes = nodeService.allActive(Node.Type.DATANODE); + return Map.of( + "data_nodes_count", dataNodes.size() + ); + } } diff --git a/graylog2-server/src/test/java/org/graylog2/telemetry/rest/TelemetryServiceTest.java b/graylog2-server/src/test/java/org/graylog2/telemetry/rest/TelemetryServiceTest.java index a76ca39a7325..9975c7790d0e 100644 --- a/graylog2-server/src/test/java/org/graylog2/telemetry/rest/TelemetryServiceTest.java +++ b/graylog2-server/src/test/java/org/graylog2/telemetry/rest/TelemetryServiceTest.java @@ -17,6 +17,7 @@ package org.graylog2.telemetry.rest; import com.google.common.eventbus.EventBus; +import org.graylog2.cluster.NodeService; import org.graylog2.indexer.cluster.ClusterAdapter; import org.graylog2.plugin.PluginMetaData; import org.graylog2.plugin.database.users.User; @@ -45,6 +46,7 @@ import static org.graylog2.shared.utilities.StringUtils.f; import static org.graylog2.telemetry.rest.TelemetryTestHelper.CLUSTER; import static org.graylog2.telemetry.rest.TelemetryTestHelper.CURRENT_USER; +import static org.graylog2.telemetry.rest.TelemetryTestHelper.DATA_NODES; import static org.graylog2.telemetry.rest.TelemetryTestHelper.LICENSE; import static org.graylog2.telemetry.rest.TelemetryTestHelper.PLUGIN; import static org.graylog2.telemetry.rest.TelemetryTestHelper.SEARCH_CLUSTER; @@ -77,6 +79,9 @@ public class TelemetryServiceTest { @Mock User user; + @Mock + NodeService nodeService; + @Test void test_telemetry_is_disabled_globally() { TelemetryService telemetryService = createTelemetryService(false); @@ -177,7 +182,7 @@ private TelemetryLicenseStatus createLicense(String subject) { } private void assertThatAllTelemetryDataIsPresent(Map response) { - assertThat(response).containsOnlyKeys(USER_TELEMETRY_SETTINGS, CURRENT_USER, CLUSTER, LICENSE, PLUGIN, SEARCH_CLUSTER); + assertThat(response).containsOnlyKeys(USER_TELEMETRY_SETTINGS, CURRENT_USER, CLUSTER, LICENSE, PLUGIN, SEARCH_CLUSTER, DATA_NODES); } private TelemetryService createTelemetryService(boolean isTelemetryEnabled) { @@ -193,7 +198,8 @@ private TelemetryService createTelemetryService(boolean isTelemetryEnabled) { dbTelemetryUserSettingsService, eventBus, telemetryClusterService, - "unknown"); + "unknown", + nodeService); } private void mockUserTelemetryEnabled(boolean isTelemetryEnabled) { diff --git a/graylog2-server/src/test/java/org/graylog2/telemetry/rest/TelemetryServiceWithDbTest.java b/graylog2-server/src/test/java/org/graylog2/telemetry/rest/TelemetryServiceWithDbTest.java index 43a1c11c0947..1eedd8d96e66 100644 --- a/graylog2-server/src/test/java/org/graylog2/telemetry/rest/TelemetryServiceWithDbTest.java +++ b/graylog2-server/src/test/java/org/graylog2/telemetry/rest/TelemetryServiceWithDbTest.java @@ -20,6 +20,7 @@ import com.google.common.eventbus.EventBus; import org.graylog.testing.mongodb.MongoDBInstance; import org.graylog2.bindings.providers.MongoJackObjectMapperProvider; +import org.graylog2.cluster.NodeService; import org.graylog2.cluster.leader.LeaderElectionService; import org.graylog2.indexer.cluster.ClusterAdapter; import org.graylog2.plugin.PluginMetaData; @@ -50,6 +51,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.graylog2.telemetry.rest.TelemetryTestHelper.CLUSTER; import static org.graylog2.telemetry.rest.TelemetryTestHelper.CURRENT_USER; +import static org.graylog2.telemetry.rest.TelemetryTestHelper.DATA_NODES; import static org.graylog2.telemetry.rest.TelemetryTestHelper.LICENSE; import static org.graylog2.telemetry.rest.TelemetryTestHelper.PLUGIN; import static org.graylog2.telemetry.rest.TelemetryTestHelper.SEARCH_CLUSTER; @@ -88,6 +90,9 @@ public class TelemetryServiceWithDbTest { @Mock LeaderElectionService leaderElectionService; + @Mock + NodeService nodeService; + TelemetryService telemetryService; @Before @@ -111,7 +116,8 @@ public void setUp() { new DBTelemetryUserSettingsService(mongodb.mongoConnection(), mongoJackObjectMapperProvider), eventBus, telemetryClusterService, - "unknown"); + "unknown", + nodeService); } @Test @@ -153,7 +159,7 @@ public void test_all_telemetry_data_is_present() { telemetryService.updateTelemetryClusterData(); Map telemetryResponse = telemetryService.getTelemetryResponse(saveUserSettings(true)); - assertThat(telemetryResponse).containsOnlyKeys(USER_TELEMETRY_SETTINGS, CURRENT_USER, CLUSTER, LICENSE, PLUGIN, SEARCH_CLUSTER); + assertThat(telemetryResponse).containsOnlyKeys(USER_TELEMETRY_SETTINGS, CURRENT_USER, CLUSTER, LICENSE, PLUGIN, SEARCH_CLUSTER, DATA_NODES); } diff --git a/graylog2-server/src/test/java/org/graylog2/telemetry/rest/TelemetryTestHelper.java b/graylog2-server/src/test/java/org/graylog2/telemetry/rest/TelemetryTestHelper.java index 35be3c63db65..f6e33fa9bada 100644 --- a/graylog2-server/src/test/java/org/graylog2/telemetry/rest/TelemetryTestHelper.java +++ b/graylog2-server/src/test/java/org/graylog2/telemetry/rest/TelemetryTestHelper.java @@ -35,6 +35,8 @@ public class TelemetryTestHelper { static final String PLUGIN = "plugin"; static final String SEARCH_CLUSTER = "search_cluster"; + static final String DATA_NODES = "data_nodes"; + public static void mockTrafficData(TrafficCounterService trafficCounterService1) { when(trafficCounterService1.clusterTrafficOfLastDays(any(), any())).thenReturn(TelemetryTestHelper.TRAFFIC_HISTOGRAM); } diff --git a/graylog2-web-interface/src/logic/telemetry/TelemetryProvider.tsx b/graylog2-web-interface/src/logic/telemetry/TelemetryProvider.tsx index cabf6660635f..5e270c2aab07 100644 --- a/graylog2-web-interface/src/logic/telemetry/TelemetryProvider.tsx +++ b/graylog2-web-interface/src/logic/telemetry/TelemetryProvider.tsx @@ -79,6 +79,7 @@ const TelemetryProvider = ({ children }: { children: React.ReactElement }) => { license, plugin, search_cluster: searchCluster, + data_nodes: dataNodes, user_telemetry_settings: { telemetry_permission_asked: isPermissionAsked }, } = telemetryData as TelemetryDataType; setGlobalProps(getGlobalProps(telemetryData)); @@ -90,6 +91,7 @@ const TelemetryProvider = ({ children }: { children: React.ReactElement }) => { ...license, ...plugin, ...searchCluster, + ...dataNodes, ...getGlobalProps(telemetryData), }); diff --git a/graylog2-web-interface/src/logic/telemetry/useTelemetryData.tsx b/graylog2-web-interface/src/logic/telemetry/useTelemetryData.tsx index c5d97b968750..7ef1bde257ed 100644 --- a/graylog2-web-interface/src/logic/telemetry/useTelemetryData.tsx +++ b/graylog2-web-interface/src/logic/telemetry/useTelemetryData.tsx @@ -39,6 +39,9 @@ export type TelemetryDataType = { search_cluster?: { [key: string]: string, }, + data_nodes?: { + data_nodes_count: number, + } } const useTelemetryData = () => useQuery([TELEMETRY_CLUSTER_INFO_QUERY_KEY], () => Telemetry.get() as Promise, { From 55a1a4cfb04815bdc558e1ef17e385b62bb74093 Mon Sep 17 00:00:00 2001 From: maxiadlovskii Date: Tue, 14 Nov 2023 09:45:50 +0100 Subject: [PATCH 38/39] Add index set field type management page (#17070) * Add page and hook * Add paginated table * Change modal, add modal to the list * fix test * add is custom and is reserved * add delete button * Fix merge. Fix tests * Add more tests to ChangeFieldTypeModal * Add useIndexSetFieldType.test * Add test to IndexSetFieldTypesList * Add changelog file * Add permission check * rename file * Fix label for rotation * add reserved column * Remove search field * fix tests * refactoring --- changelog/unreleased/pr-17070.toml | 5 + .../indices/IndexSetFieldTypesList.test.tsx | 220 ++++++++++++++++++ .../indices/IndexSetFieldTypesList.tsx | 187 +++++++++++++++ .../indices/IndicesMaintenanceDropdown.tsx | 11 + .../src/hooks/useIndexSetFieldType.test.ts | 108 +++++++++ .../src/hooks/useIndexSetFieldType.ts | 97 ++++++++ .../src/pages/IndexSetFieldTypesPage.tsx | 75 ++++++ graylog2-web-interface/src/pages/index.jsx | 3 + .../src/routing/AppRouter.tsx | 2 + graylog2-web-interface/src/routing/Routes.ts | 1 + .../ChangeFieldType/ChangeFieldType.tsx | 8 +- .../ChangeFieldTypeModal.test.tsx | 74 ++++-- .../ChangeFieldType/ChangeFieldTypeModal.tsx | 52 +++-- .../ChangeFieldType/IndexSetsTable.tsx | 6 +- 14 files changed, 807 insertions(+), 42 deletions(-) create mode 100644 changelog/unreleased/pr-17070.toml create mode 100644 graylog2-web-interface/src/components/indices/IndexSetFieldTypesList.test.tsx create mode 100644 graylog2-web-interface/src/components/indices/IndexSetFieldTypesList.tsx create mode 100644 graylog2-web-interface/src/hooks/useIndexSetFieldType.test.ts create mode 100644 graylog2-web-interface/src/hooks/useIndexSetFieldType.ts create mode 100644 graylog2-web-interface/src/pages/IndexSetFieldTypesPage.tsx diff --git a/changelog/unreleased/pr-17070.toml b/changelog/unreleased/pr-17070.toml new file mode 100644 index 000000000000..91ebac42a8e4 --- /dev/null +++ b/changelog/unreleased/pr-17070.toml @@ -0,0 +1,5 @@ +type = "added" +message = "Add index set field type management page" + +issues = ["17160"] +pulls = ["17070"] diff --git a/graylog2-web-interface/src/components/indices/IndexSetFieldTypesList.test.tsx b/graylog2-web-interface/src/components/indices/IndexSetFieldTypesList.test.tsx new file mode 100644 index 000000000000..d607443d9b8e --- /dev/null +++ b/graylog2-web-interface/src/components/indices/IndexSetFieldTypesList.test.tsx @@ -0,0 +1,220 @@ +/* + * 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 * as React from 'react'; +import { render, screen, fireEvent, within } from 'wrappedTestingLibrary'; + +import asMock from 'helpers/mocking/AsMock'; +import useIndexSetFieldTypes from 'hooks/useIndexSetFieldType'; +import useUserLayoutPreferences from 'components/common/EntityDataTable/hooks/useUserLayoutPreferences'; +import { layoutPreferences } from 'fixtures/entityListLayoutPreferences'; +import TestStoreProvider from 'views/test/TestStoreProvider'; +import { loadViewsPlugin, unloadViewsPlugin } from 'views/test/testViewsPlugin'; +import type { Attributes } from 'stores/PaginationTypes'; +import IndexSetFieldTypesList from 'components/indices/IndexSetFieldTypesList'; +import useFiledTypes from 'views/logic/fieldactions/ChangeFieldType/hooks/useFieldTypes'; + +const attributes: Attributes = [ + { + id: 'field_name', + title: 'Field Name', + type: 'STRING', + sortable: true, + }, + { + id: 'is_custom', + title: 'Custom', + type: 'STRING', + sortable: true, + }, + { + id: 'is_reserved', + title: 'Reserved', + type: 'STRING', + sortable: true, + }, + { + id: 'type', + title: 'Type', + type: 'STRING', + sortable: true, + }, +]; + +const getData = (list = [{ + id: 'field', + fieldName: 'field', + type: 'bool', + isCustom: false, + isReserved: false, +}]) => ( + { + list, + pagination: { + total: 1, + }, + attributes, + } +); +const renderIndexSetFieldTypesList = () => render( + + + , +); + +jest.mock('views/logic/fieldactions/ChangeFieldType/hooks/useFieldTypes', () => jest.fn()); +jest.mock('hooks/useIndexSetFieldType', () => jest.fn()); + +jest.mock('components/common/EntityDataTable/hooks/useUserLayoutPreferences'); + +describe('IndexSetFieldTypesList', () => { + beforeAll(loadViewsPlugin); + + afterAll(unloadViewsPlugin); + + beforeEach(() => { + asMock(useUserLayoutPreferences).mockReturnValue({ + data: { + ...layoutPreferences, + displayedAttributes: ['field_name', + 'is_custom', + 'is_reserved', + 'type'], + }, + isInitialLoading: false, + }); + + asMock(useFiledTypes).mockReturnValue({ + data: { + fieldTypes: { + string: 'String type', + int: 'Number(int)', + bool: 'Boolean', + }, + }, + isLoading: false, + }); + }); + + describe('Shows list of set field types with correct data', () => { + it('for field with non custom type', async () => { + asMock(useIndexSetFieldTypes).mockReturnValue({ + isLoading: false, + refetch: () => {}, + data: getData(), + }); + + renderIndexSetFieldTypesList(); + const tableRow = await screen.findByTestId('table-row-field'); + + await within(tableRow).findByText('field'); + await within(tableRow).findByText('Boolean'); + await within(tableRow).findByText('Edit'); + + expect(within(tableRow).queryByTitle('Field has custom field type')).not.toBeInTheDocument(); + }); + + it('for field with custom type', async () => { + asMock(useIndexSetFieldTypes).mockReturnValue({ + isLoading: false, + refetch: () => {}, + data: getData([{ + id: 'field', + fieldName: 'field', + type: 'bool', + isCustom: true, + isReserved: false, + }]), + }); + + renderIndexSetFieldTypesList(); + const tableRow = await screen.findByTestId('table-row-field'); + + await within(tableRow).findByText('field'); + await within(tableRow).findByText('Boolean'); + await within(tableRow).findByText('Edit'); + await within(tableRow).findByTitle('Field has custom field type'); + }); + + it('for field with non reserved type', async () => { + asMock(useIndexSetFieldTypes).mockReturnValue({ + isLoading: false, + refetch: () => {}, + data: getData([{ + id: 'field', + fieldName: 'field', + type: 'bool', + isCustom: true, + isReserved: false, + }]), + }); + + renderIndexSetFieldTypesList(); + const tableRow = await screen.findByTestId('table-row-field'); + + const editButton = await within(tableRow).findByText('Edit'); + + expect(within(tableRow).queryByTitle('Field has reserved field type')).not.toBeInTheDocument(); + expect(editButton.hasAttribute('disabled')).toBe(false); + }); + + it('for field with reserved type', async () => { + asMock(useIndexSetFieldTypes).mockReturnValue({ + isLoading: false, + refetch: () => {}, + data: getData([{ + id: 'field', + fieldName: 'field', + type: 'bool', + isCustom: true, + isReserved: true, + }]), + }); + + renderIndexSetFieldTypesList(); + const tableRow = await screen.findByTestId('table-row-field'); + + const editButton = await within(tableRow).findByText('Edit'); + await within(tableRow).findByTitle('Field has reserved field type'); + + expect(editButton.hasAttribute('disabled')).toBe(true); + }); + }); + + it('Shows modal on action click', async () => { + asMock(useIndexSetFieldTypes).mockReturnValue({ + isLoading: false, + refetch: () => {}, + data: getData([{ + id: 'field', + fieldName: 'field', + type: 'bool', + isCustom: true, + isReserved: false, + }]), + }); + + renderIndexSetFieldTypesList(); + const tableRow = await screen.findByTestId('table-row-field'); + const editButton = await within(tableRow).findByText('Edit'); + fireEvent.click(editButton); + await screen.findByText(/change field field type/i); + const modal = await screen.findByTestId('modal-form'); + await within(modal).findByText('Boolean'); + + expect(within(modal).queryByText(/select targeted index sets/i)).not.toBeInTheDocument(); + }); +}); diff --git a/graylog2-web-interface/src/components/indices/IndexSetFieldTypesList.tsx b/graylog2-web-interface/src/components/indices/IndexSetFieldTypesList.tsx new file mode 100644 index 000000000000..a42468d17ea9 --- /dev/null +++ b/graylog2-web-interface/src/components/indices/IndexSetFieldTypesList.tsx @@ -0,0 +1,187 @@ +/* + * 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 React, { useCallback, useMemo, useState } from 'react'; + +import type { IndexSetFieldType } from 'hooks/useIndexSetFieldType'; +import { Button } from 'components/bootstrap'; +import useIndexSetFieldTypes from 'hooks/useIndexSetFieldType'; +import useParams from 'routing/useParams'; +import { + HoverForHelp, + Icon, + NoEntitiesExist, + PaginatedList, + Spinner, +} from 'components/common'; +import EntityDataTable from 'components/common/EntityDataTable'; +import useTableLayout from 'components/common/EntityDataTable/hooks/useTableLayout'; +import type { Sort } from 'stores/PaginationTypes'; +import useUpdateUserLayoutPreferences from 'components/common/EntityDataTable/hooks/useUpdateUserLayoutPreferences'; +import ChangeFieldTypeModal from 'views/logic/fieldactions/ChangeFieldType/ChangeFieldTypeModal'; +import useFiledTypes from 'views/logic/fieldactions/ChangeFieldType/hooks/useFieldTypes'; + +export const ENTITY_TABLE_ID = 'index-set-field-types'; +export const DEFAULT_LAYOUT = { + pageSize: 20, + sort: { attributeId: 'field_name', direction: 'asc' } as Sort, + displayedColumns: ['field_name', 'type', 'is_custom', 'is_reserved'], + columnsOrder: ['field_name', 'type', 'is_custom', 'is_reserved'], +}; + +const IndexSetFieldTypesList = () => { + const { indexSetId } = useParams(); + const [editingField, setEditingField] = useState(null); + + const handleOnClose = useCallback(() => { + setEditingField(null); + }, []); + + const handleOnOpen = useCallback((fieldType: IndexSetFieldType) => { + setEditingField(fieldType); + }, []); + + const initialSelection = useMemo(() => [indexSetId], [indexSetId]); + const [query] = useState(''); + const [activePage, setActivePage] = useState(1); + const { data: { fieldTypes }, isLoading: isOptionsLoading } = useFiledTypes(); + const { layoutConfig, isInitialLoading: isLoadingLayoutPreferences } = useTableLayout({ + entityTableId: ENTITY_TABLE_ID, + defaultPageSize: DEFAULT_LAYOUT.pageSize, + defaultDisplayedAttributes: DEFAULT_LAYOUT.displayedColumns, + defaultSort: DEFAULT_LAYOUT.sort, + }); + const searchParams = useMemo(() => ({ + query, + page: activePage, + pageSize: layoutConfig.pageSize, + sort: layoutConfig.sort, + }), [activePage, layoutConfig.pageSize, layoutConfig.sort, query]); + const { mutate: updateTableLayout } = useUpdateUserLayoutPreferences(ENTITY_TABLE_ID); + const onPageChange = useCallback( + (newPage: number, newPageSize: number) => { + if (newPage) { + setActivePage(newPage); + } + + if (newPageSize) { + updateTableLayout({ perPage: newPageSize }); + } + }, [updateTableLayout], + ); + + const onPageSizeChange = useCallback((newPageSize: number) => { + setActivePage(1); + updateTableLayout({ perPage: newPageSize }); + }, [updateTableLayout]); + + const onSortChange = useCallback((newSort: Sort) => { + setActivePage(1); + updateTableLayout({ sort: newSort }); + }, [updateTableLayout]); + + const onColumnsChange = useCallback((displayedAttributes: Array) => { + updateTableLayout({ displayedAttributes }); + }, [updateTableLayout]); + const { isLoading, data: { list, pagination, attributes }, refetch } = useIndexSetFieldTypes(indexSetId, searchParams, { enabled: !isLoadingLayoutPreferences }); + + const customColumnRenderers = useMemo(() => ({ + attributes: { + type: { + renderCell: (item: string) => {fieldTypes[item]}, + }, + is_custom: { + renderCell: (isCustom: boolean) => (isCustom ? : null), + staticWidth: 120, + }, + is_reserved: { + renderCell: (isReserved: boolean) => (isReserved ? : null), + staticWidth: 120, + }, + }, + }), [fieldTypes]); + + const openEditModal = useCallback((fieldType: IndexSetFieldType) => { + handleOnOpen(fieldType); + }, [handleOnOpen]); + + const renderActions = useCallback((fieldType: IndexSetFieldType) => ( + + ), [openEditModal]); + + if (isLoadingLayoutPreferences || isLoading) { + return ; + } + + return ( + <> + + {pagination?.total === 0 && !searchParams.query && ( + + No fields have been created yet. + + )} + {!!list?.length && ( + data={list} + visibleColumns={layoutConfig.displayedAttributes} + columnsOrder={DEFAULT_LAYOUT.columnsOrder} + onColumnsChange={onColumnsChange} + onSortChange={onSortChange} + activeSort={layoutConfig.sort} + pageSize={searchParams.pageSize} + onPageSizeChange={onPageSizeChange} + actionsCellWidth={120} + columnRenderers={customColumnRenderers} + columnDefinitions={attributes} + rowActions={renderActions} /> + )} + + { + editingField ? ( + + ) : null + } + + ); +}; + +export default IndexSetFieldTypesList; diff --git a/graylog2-web-interface/src/components/indices/IndicesMaintenanceDropdown.tsx b/graylog2-web-interface/src/components/indices/IndicesMaintenanceDropdown.tsx index 1df851fa4b66..e1792d32f4c6 100644 --- a/graylog2-web-interface/src/components/indices/IndicesMaintenanceDropdown.tsx +++ b/graylog2-web-interface/src/components/indices/IndicesMaintenanceDropdown.tsx @@ -22,6 +22,9 @@ import { ButtonGroup, DropdownButton, MenuItem } from 'components/bootstrap'; import { DeflectorActions } from 'stores/indices/DeflectorStore'; import { IndexRangesActions } from 'stores/indices/IndexRangesStore'; import type { IndexSet } from 'stores/indices/IndexSetsStore'; +import useHistory from 'routing/useHistory'; +import Routes from 'routing/Routes'; +import useCurrentUser from 'hooks/useCurrentUser'; const _onRecalculateIndexRange = (indexSetId: string) => { // eslint-disable-next-line no-alert @@ -45,14 +48,22 @@ type Props = { }; const IndicesMaintenanceDropdown = ({ indexSet, indexSetId }: Props) => { + const currentUser = useCurrentUser(); + const history = useHistory(); const onCycleDeflector = useCallback(() => _onCycleDeflector(indexSetId), [indexSetId]); const onRecalculateIndexRange = useCallback(() => _onRecalculateIndexRange(indexSetId), [indexSetId]); const cycleButton = useMemo(() => (indexSet?.writable ? Rotate active write index : null), [indexSet?.writable, onCycleDeflector]); + const onShowFieldTypes = useCallback(() => { + history.push(Routes.SYSTEM.INDEX_SETS.FIELD_TYPES(indexSetId)); + }, [history, indexSetId]); + + const hasMappingPermission = currentUser.permissions.includes('typemappings:edit') || currentUser.permissions.includes('*'); return ( Recalculate index ranges + {hasMappingPermission && Show index field types} {cycleButton} diff --git a/graylog2-web-interface/src/hooks/useIndexSetFieldType.test.ts b/graylog2-web-interface/src/hooks/useIndexSetFieldType.test.ts new file mode 100644 index 000000000000..f857235746e5 --- /dev/null +++ b/graylog2-web-interface/src/hooks/useIndexSetFieldType.test.ts @@ -0,0 +1,108 @@ +/* + * 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 { renderHook } from 'wrappedTestingLibrary/hooks'; + +import asMock from 'helpers/mocking/AsMock'; +import UserNotification from 'util/UserNotification'; +import suppressConsole from 'helpers/suppressConsole'; +import useIndexSetFieldType from 'hooks/useIndexSetFieldType'; +import fetch from 'logic/rest/FetchProvider'; +import { qualifyUrl } from 'util/URLUtils'; + +const mockData = { + attributes: [], + query: '', + pagination: { + total: 1, + count: 1, + page: 1, + per_page: 10, + }, + defaults: { + sort: { + id: 'field_name', + direction: 'ASC', + } as { id: string, direction: 'ASC' | 'DESC'}, + }, + total: 1, + sort: 'field_name', + order: 'desc', + elements: [{ + field_name: 'field', + type: 'bool', + is_custom: false, + is_reserved: false, + }], +}; + +const expectedState = { + attributes: [], + list: [{ + id: 'field', + fieldName: 'field', + type: 'bool', + isCustom: false, + isReserved: false, + }], + pagination: { + total: 1, + }, +}; +jest.mock('util/UserNotification', () => ({ error: jest.fn() })); +jest.mock('logic/rest/FetchProvider', () => jest.fn(() => Promise.resolve())); + +jest.mock('@graylog/server-api', () => ({ + SystemFieldTypes: { + getAllFieldTypes: jest.fn(() => Promise.resolve()), + }, +})); + +const renderUseIndexSetFieldTypeHook = () => renderHook(() => useIndexSetFieldType('id-1', { page: 1, query: '', pageSize: 10, sort: { attributeId: 'field_name', direction: 'asc' } }, { enabled: true })); + +describe('useIndexSetFieldType custom hook', () => { + afterEach(() => { + jest.clearAllMocks(); + }); + + it('Test return initial data and take from fetch', async () => { + asMock(fetch).mockImplementation(() => Promise.resolve(mockData)); + const { result, waitFor } = renderUseIndexSetFieldTypeHook(); + + await waitFor(() => result.current.isLoading); + await waitFor(() => !result.current.isLoading); + + expect(fetch).toHaveBeenCalledWith('GET', qualifyUrl('/system/indices/index_sets/types/id-1?page=1&per_page=10&sort=field_name&order=asc')); + + expect(result.current.data).toEqual(expectedState); + }); + + it('Test trigger notification on fail', async () => { + asMock(fetch).mockImplementation(() => Promise.reject(new Error('Error'))); + + const { result, waitFor } = renderUseIndexSetFieldTypeHook(); + + await suppressConsole(async () => { + await waitFor(() => result.current.isLoading); + await waitFor(() => !result.current.isLoading); + }); + + expect(UserNotification.error).toHaveBeenCalledWith( + 'Loading index field types failed with status: Error: Error', + 'Could not load index field types'); + }); +}); diff --git a/graylog2-web-interface/src/hooks/useIndexSetFieldType.ts b/graylog2-web-interface/src/hooks/useIndexSetFieldType.ts new file mode 100644 index 000000000000..49c7f67ee7d8 --- /dev/null +++ b/graylog2-web-interface/src/hooks/useIndexSetFieldType.ts @@ -0,0 +1,97 @@ +/* + * 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 { useQuery } from '@tanstack/react-query'; + +import UserNotification from 'util/UserNotification'; +import fetch from 'logic/rest/FetchProvider'; +import { qualifyUrl } from 'util/URLUtils'; +import type { Attribute, SearchParams } from 'stores/PaginationTypes'; +import PaginationURL from 'util/PaginationURL'; + +const INITIAL_DATA = { + pagination: { total: 0 }, + list: [], + attributes: [], +}; +export type IndexSetFieldTypeJson = { + field_name: string, + type: string, + is_custom: boolean, + is_reserved: boolean, +} + +export type IndexSetFieldType = { + id: string, + fieldName: string, + isCustom: boolean, + isReserved: boolean, + type: string, +} + +const fetchIndexSetFieldTypes = async (indexSetId: string, searchParams: SearchParams) => { + const indexSetFiledTypeUrl = qualifyUrl(`/system/indices/index_sets/types/${indexSetId}`); + const url = PaginationURL( + indexSetFiledTypeUrl, + searchParams.page, + searchParams.pageSize, + searchParams.query, + { sort: searchParams.sort.attributeId, order: searchParams.sort.direction }); + + return fetch('GET', url).then( + ({ elements, total, attributes }) => ({ + list: elements.map((fieldType: IndexSetFieldTypeJson) => ({ + id: fieldType.field_name, + fieldName: fieldType.field_name, + type: fieldType.type, + isCustom: fieldType.is_custom, + isReserved: fieldType.is_reserved, + })), + pagination: { total }, + attributes, + })); +}; + +const useIndexSetFieldTypes = (indexSetId: string, searchParams: SearchParams, { enabled }): { + data: { + list: Readonly>, + pagination: { total: number }, + attributes: Array + }, + isLoading: boolean, + refetch: () => void, +} => { + const { data, isLoading, refetch } = useQuery( + ['indexSetFieldTypes', searchParams], + () => fetchIndexSetFieldTypes(indexSetId, searchParams), + { + onError: (errorThrown) => { + UserNotification.error(`Loading index field types failed with status: ${errorThrown}`, + 'Could not load index field types'); + }, + keepPreviousData: true, + enabled, + }, + ); + + return ({ + data: data ?? INITIAL_DATA, + isLoading, + refetch, + }); +}; + +export default useIndexSetFieldTypes; diff --git a/graylog2-web-interface/src/pages/IndexSetFieldTypesPage.tsx b/graylog2-web-interface/src/pages/IndexSetFieldTypesPage.tsx new file mode 100644 index 000000000000..ce89ffe84c18 --- /dev/null +++ b/graylog2-web-interface/src/pages/IndexSetFieldTypesPage.tsx @@ -0,0 +1,75 @@ +/* + * 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 React, { useEffect } from 'react'; +import { useNavigate } from 'react-router-dom'; + +import { DocumentTitle, PageHeader } from 'components/common'; +import { Row, Col, Button } from 'components/bootstrap'; +import { useStore } from 'stores/connect'; +import { IndexSetsActions, IndexSetsStore } from 'stores/indices/IndexSetsStore'; +import useParams from 'routing/useParams'; +import DocsHelper from 'util/DocsHelper'; +import { LinkContainer } from 'components/common/router'; +import Routes from 'routing/Routes'; +import IndexSetFieldTypesList from 'components/indices/IndexSetFieldTypesList'; +import useCurrentUser from 'hooks/useCurrentUser'; + +const IndexSetFieldTypesPage = () => { + const { indexSetId } = useParams(); + const navigate = useNavigate(); + const { indexSet } = useStore(IndexSetsStore); + const currentUser = useCurrentUser(); + + useEffect(() => { + const hasMappingPermission = currentUser.permissions.includes('typemappings:edit') || currentUser.permissions.includes('*'); + + if (!hasMappingPermission) { + navigate(Routes.NOTFOUND); + } else { + IndexSetsActions.get(indexSetId); + } + }, [currentUser.permissions, indexSetId, navigate]); + + return ( + +
+ + + + )}> + + Modify the current field types configuration for this index set. + + + + + + + + +
+
+ ); +}; + +export default IndexSetFieldTypesPage; diff --git a/graylog2-web-interface/src/pages/index.jsx b/graylog2-web-interface/src/pages/index.jsx index 48a60938235e..43616bf331ef 100644 --- a/graylog2-web-interface/src/pages/index.jsx +++ b/graylog2-web-interface/src/pages/index.jsx @@ -99,6 +99,8 @@ const UserTokensEditPage = loadAsync(() => import('./UserTokensEditPage')); const UsersOverviewPage = loadAsync(() => import('./UsersOverviewPage')); const ViewEventDefinitionPage = loadAsync(() => import('./ViewEventDefinitionPage')); +const IndexSetFieldTypesPage = loadAsync(() => import('./IndexSetFieldTypesPage')); + export { AuthenticationCreatePage, AuthenticationPage, @@ -132,6 +134,7 @@ export { IndexerFailuresPage, IndexSetConfigurationPage, IndexSetCreationPage, + IndexSetFieldTypesPage, IndexSetPage, IndicesPage, InputsPage, diff --git a/graylog2-web-interface/src/routing/AppRouter.tsx b/graylog2-web-interface/src/routing/AppRouter.tsx index b9b94cc51501..0db546c1ed9b 100644 --- a/graylog2-web-interface/src/routing/AppRouter.tsx +++ b/graylog2-web-interface/src/routing/AppRouter.tsx @@ -99,6 +99,7 @@ import { UsersOverviewPage, ViewEventDefinitionPage, SidecarFailureTrackingPage, + IndexSetFieldTypesPage, } from 'pages'; import AppConfig from 'util/AppConfig'; import { appPrefixed } from 'util/URLUtils'; @@ -211,6 +212,7 @@ const AppRouter = () => { { path: RoutePaths.SYSTEM.INDEX_SETS.CREATE, element: }, { path: RoutePaths.SYSTEM.INDEX_SETS.SHOW(':indexSetId'), element: }, { path: RoutePaths.SYSTEM.INDEX_SETS.CONFIGURATION(':indexSetId'), element: }, + { path: RoutePaths.SYSTEM.INDEX_SETS.FIELD_TYPES(':indexSetId'), element: }, { path: RoutePaths.SYSTEM.INDICES.LIST, element: }, !isCloud && ( diff --git a/graylog2-web-interface/src/routing/Routes.ts b/graylog2-web-interface/src/routing/Routes.ts index 8e7de51b5ac2..43cd53afb726 100644 --- a/graylog2-web-interface/src/routing/Routes.ts +++ b/graylog2-web-interface/src/routing/Routes.ts @@ -93,6 +93,7 @@ const Routes = { return `/system/index_sets/${indexSetId}/configuration`; }, SHOW: (indexSetId: string) => `/system/index_sets/${indexSetId}`, + FIELD_TYPES: (indexSetId: string) => `/system/index_sets/${indexSetId}/field-types`, CREATE: '/system/index_sets/create', }, INPUTS: '/system/inputs', diff --git a/graylog2-web-interface/src/views/logic/fieldactions/ChangeFieldType/ChangeFieldType.tsx b/graylog2-web-interface/src/views/logic/fieldactions/ChangeFieldType/ChangeFieldType.tsx index 9621da24487a..bcbf3e4e61a1 100644 --- a/graylog2-web-interface/src/views/logic/fieldactions/ChangeFieldType/ChangeFieldType.tsx +++ b/graylog2-web-interface/src/views/logic/fieldactions/ChangeFieldType/ChangeFieldType.tsx @@ -22,19 +22,23 @@ import { isFunction } from 'views/logic/aggregationbuilder/Series'; import type User from 'logic/users/User'; import AppConfig from 'util/AppConfig'; import isReservedField from 'views/logic/IsReservedField'; +import useInitialSelection from 'views/logic/fieldactions/ChangeFieldType/hooks/useInitialSelection'; +import useFiledTypes from 'views/logic/fieldactions/ChangeFieldType/hooks/useFieldTypes'; const ChangeFieldType = ({ field, onClose, }: ActionComponentProps) => { const [show, setShow] = useState(true); - + const { data: { fieldTypes }, isLoading: isOptionsLoading } = useFiledTypes(); const handleOnClose = useCallback(() => { setShow(false); onClose(); }, [onClose]); - return show ? : null; + const initialSelection = useInitialSelection(); + + return show ? : null; }; const hasMappingPermission = (currentUser: User) => currentUser.permissions.includes('typemappings:edit') || currentUser.permissions.includes('*'); diff --git a/graylog2-web-interface/src/views/logic/fieldactions/ChangeFieldType/ChangeFieldTypeModal.test.tsx b/graylog2-web-interface/src/views/logic/fieldactions/ChangeFieldType/ChangeFieldTypeModal.test.tsx index 7150be8598c7..f2375498a2f2 100644 --- a/graylog2-web-interface/src/views/logic/fieldactions/ChangeFieldType/ChangeFieldTypeModal.test.tsx +++ b/graylog2-web-interface/src/views/logic/fieldactions/ChangeFieldType/ChangeFieldTypeModal.test.tsx @@ -20,16 +20,13 @@ import selectEvent from 'react-select-event'; import asMock from 'helpers/mocking/AsMock'; import useFieldTypeMutation from 'views/logic/fieldactions/ChangeFieldType/hooks/useFieldTypeMutation'; -import useFieldTypes from 'views/logic/fieldactions/ChangeFieldType/hooks/useFieldTypes'; import useFieldTypeUsages from 'views/logic/fieldactions/ChangeFieldType/hooks/useFieldTypeUsages'; -import type { FieldTypes } from 'views/logic/fieldactions/ChangeFieldType/types'; import useUserLayoutPreferences from 'components/common/EntityDataTable/hooks/useUserLayoutPreferences'; import { layoutPreferences } from 'fixtures/entityListLayoutPreferences'; import TestStoreProvider from 'views/test/TestStoreProvider'; import { loadViewsPlugin, unloadViewsPlugin } from 'views/test/testViewsPlugin'; import ChangeFieldTypeModal from 'views/logic/fieldactions/ChangeFieldType/ChangeFieldTypeModal'; import type { Attributes } from 'stores/PaginationTypes'; -import useInitialSelection from 'views/logic/fieldactions/ChangeFieldType/hooks/useInitialSelection'; import suppressConsole from 'helpers/suppressConsole'; const onCloseMock = jest.fn(); @@ -37,9 +34,24 @@ const renderChangeFieldTypeModal = ({ onClose = onCloseMock, field = 'field', show = true, + showSelectionTable = undefined, + initialFieldType = undefined, + fieldTypes = { + string: 'String type', + int: 'Number(int)', + bool: 'Boolean', + }, + initialSelectedIndexSets = ['id-1', 'id-2'], }) => render( - + , ); const attributes: Attributes = [ @@ -101,25 +113,10 @@ const paginatedFieldUsage = ({ isLoading: false, }); -const fieldTypes: { - data: { fieldTypes: FieldTypes }, - isLoading: boolean, -} = { - data: { - fieldTypes: { - string: 'String type', - int: 'Number(int)', - boolean: 'Boolean', - }, - }, - isLoading: false, -}; jest.mock('views/logic/fieldactions/ChangeFieldType/hooks/useFieldTypeMutation', () => jest.fn()); -jest.mock('views/logic/fieldactions/ChangeFieldType/hooks/useFieldTypes', () => jest.fn()); jest.mock('views/logic/fieldactions/ChangeFieldType/hooks/useFieldTypeUsages', () => jest.fn()); jest.mock('views/logic/fieldactions/ChangeFieldType/hooks/useFieldTypeMutation', () => jest.fn()); -jest.mock('views/logic/fieldactions/ChangeFieldType/hooks/useInitialSelection', () => jest.fn()); jest.mock('components/common/EntityDataTable/hooks/useUserLayoutPreferences'); describe('ChangeFieldTypeModal', () => { @@ -132,8 +129,6 @@ describe('ChangeFieldTypeModal', () => { beforeEach(() => { asMock(useFieldTypeMutation).mockReturnValue({ isLoading: false, putFiledTypeMutation: putFiledTypeMutationMock }); asMock(useFieldTypeUsages).mockReturnValue(paginatedFieldUsage); - asMock(useFieldTypes).mockReturnValue(fieldTypes); - asMock(useInitialSelection).mockReturnValue(['id-1', 'id-2']); asMock(useUserLayoutPreferences).mockReturnValue({ data: { @@ -194,4 +189,41 @@ describe('ChangeFieldTypeModal', () => { field: 'field', })); }); + + it('run putFiledTypeMutationMock with selected type and indexes when showSelectionTable false', async () => { + renderChangeFieldTypeModal({ initialSelectedIndexSets: ['id-2'] }); + + const typeSelect = await screen.findByLabelText(/select field type for field/i); + selectEvent.openMenu(typeSelect); + await selectEvent.select(typeSelect, 'Number(int)'); + + const submit = await screen.findByTitle(/change field type/i); + + fireEvent.click(submit); + + await waitFor(() => expect(putFiledTypeMutationMock).toHaveBeenCalledWith({ + indexSetSelection: ['id-2'], + newFieldType: 'int', + rotated: true, + field: 'field', + })); + }); + + it('Doesn\'t shows index sets data when showSelectionTable false', async () => { + renderChangeFieldTypeModal({ showSelectionTable: false }); + + expect(screen.queryByText('Stream Title 1')).not.toBeInTheDocument(); + expect(screen.queryByText('Stream Title 1')).not.toBeInTheDocument(); + expect(screen.queryByText('Index Title 1')).not.toBeInTheDocument(); + expect(screen.queryByText('String type')).not.toBeInTheDocument(); + expect(screen.queryByText('Stream Title 2')).not.toBeInTheDocument(); + expect(screen.queryByText('Index Title 2')).not.toBeInTheDocument(); + expect(screen.queryByText('Number(int)')).not.toBeInTheDocument(); + }); + + it('Use initial type', async () => { + renderChangeFieldTypeModal({ initialFieldType: 'bool' }); + + await screen.findByText('Boolean'); + }); }); diff --git a/graylog2-web-interface/src/views/logic/fieldactions/ChangeFieldType/ChangeFieldTypeModal.tsx b/graylog2-web-interface/src/views/logic/fieldactions/ChangeFieldType/ChangeFieldTypeModal.tsx index 22a0c9287b0f..7ea84023212e 100644 --- a/graylog2-web-interface/src/views/logic/fieldactions/ChangeFieldType/ChangeFieldTypeModal.tsx +++ b/graylog2-web-interface/src/views/logic/fieldactions/ChangeFieldType/ChangeFieldTypeModal.tsx @@ -20,7 +20,6 @@ import styled, { css } from 'styled-components'; import { Badge, BootstrapModalForm, Alert, Input } from 'components/bootstrap'; import { Select, Spinner } from 'components/common'; import StreamLink from 'components/streams/StreamLink'; -import useFiledTypes from 'views/logic/fieldactions/ChangeFieldType/hooks/useFieldTypes'; import IndexSetsTable from 'views/logic/fieldactions/ChangeFieldType/IndexSetsTable'; import usePutFiledTypeMutation from 'views/logic/fieldactions/ChangeFieldType/hooks/useFieldTypeMutation'; import useStream from 'components/streams/hooks/useStream'; @@ -31,7 +30,7 @@ import useSendTelemetry from 'logic/telemetry/useSendTelemetry'; import { TELEMETRY_EVENT_TYPE } from 'logic/telemetry/Constants'; import { getPathnameWithoutId } from 'util/URLUtils'; import useLocation from 'routing/useLocation'; -import useInitialSelection from 'views/logic/fieldactions/ChangeFieldType/hooks/useInitialSelection'; +import type { FieldTypes } from 'views/logic/fieldactions/ChangeFieldType/types'; const StyledSelect = styled(Select)` width: 400px; @@ -54,14 +53,19 @@ const failureStreamId = '000000000000000000000004'; type Props = { show: boolean, field: string, - onClose: () => void + onClose: () => void, + onSubmitCallback?: () => void, + initialSelectedIndexSets: Array, + showSelectionTable?: boolean, + fieldTypes: FieldTypes, + isOptionsLoading: boolean, + initialFieldType?: string, } -const ChangeFieldTypeModal = ({ show, onClose, field }: Props) => { +const ChangeFieldTypeModal = ({ show, onSubmitCallback, fieldTypes, isOptionsLoading, initialSelectedIndexSets, onClose, field, showSelectionTable, initialFieldType }: Props) => { const sendTelemetry = useSendTelemetry(); const [rotated, setRotated] = useState(true); const [newFieldType, setNewFieldType] = useState(null); - const { data: { fieldTypes }, isLoading: isOptionsLoading } = useFiledTypes(); const fieldTypeOptions = useMemo(() => Object.entries(fieldTypes) .sort(([, label1], [, label2]) => defaultCompare(label1, label2)) .map(([value, label]) => ({ @@ -73,7 +77,7 @@ const ChangeFieldTypeModal = ({ show, onClose, field }: Props) => { const [indexSetSelection, setIndexSetSelection] = useState>(); const { putFiledTypeMutation } = usePutFiledTypeMutation(); - const initialSelection = useInitialSelection(); + const { pathname } = useLocation(); const telemetryPathName = useMemo(() => getPathnameWithoutId(pathname), [pathname]); const onSubmit = useCallback((e: React.FormEvent) => { @@ -91,13 +95,13 @@ const ChangeFieldTypeModal = ({ show, onClose, field }: Props) => { { value: 'change-field-type', rotated, - isAllIndexesSelected: indexSetSelection.length === initialSelection.length, + isAllIndexesSelected: indexSetSelection.length === initialSelectedIndexSets.length, }, }); onClose(); - }); - }, [field, indexSetSelection, initialSelection.length, newFieldType, onClose, putFiledTypeMutation, rotated, sendTelemetry, telemetryPathName]); + }).then(() => onSubmitCallback && onSubmitCallback()); + }, [field, indexSetSelection, initialSelectedIndexSets.length, newFieldType, onClose, onSubmitCallback, putFiledTypeMutation, rotated, sendTelemetry, telemetryPathName]); const onChangeFieldType = useCallback((value: string) => { setNewFieldType(value); @@ -112,6 +116,14 @@ const ChangeFieldTypeModal = ({ show, onClose, field }: Props) => { onClose(); }, [onClose, sendTelemetry, telemetryPathName]); + useEffect(() => { + setIndexSetSelection(initialSelectedIndexSets); + }, [initialSelectedIndexSets, setIndexSetSelection]); + + useEffect(() => { + if (initialFieldType) setNewFieldType(initialFieldType); + }, [initialFieldType]); + return ( Change {field} Field Type } submitButtonText="Change field type" @@ -137,11 +149,17 @@ const ChangeFieldTypeModal = ({ show, onClose, field }: Props) => { inputProps={{ 'aria-label': `Select Field Type For ${field}` }} required /> - Select Targeted Index Sets -

- By default the {newFieldType ? {newFieldType} : 'selected'} field type will be set for the {field} field in all index sets of the current message/search. You can select for which index sets you would like to make the change. -

- + { + showSelectionTable && ( + <> + Select Targeted Index Sets +

+ By default the {newFieldType ? {newFieldType} : 'selected'} field type will be set for the {field} field in all index sets of the current message/search. You can select for which index sets you would like to make the change. +

+ + + ) + } Select Rotation Strategy

To see and use the {newFieldType ? {newFieldType} : 'selected field type'} as a field type for {field}, you have to rotate indices. You can automatically rotate affected indices after submitting this form or do that manually later. @@ -157,4 +175,10 @@ const ChangeFieldTypeModal = ({ show, onClose, field }: Props) => { ); }; +ChangeFieldTypeModal.defaultProps = { + showSelectionTable: true, + onSubmitCallback: undefined, + initialFieldType: null, +}; + export default ChangeFieldTypeModal; diff --git a/graylog2-web-interface/src/views/logic/fieldactions/ChangeFieldType/IndexSetsTable.tsx b/graylog2-web-interface/src/views/logic/fieldactions/ChangeFieldType/IndexSetsTable.tsx index c7f979fa52db..3b63c039af5a 100644 --- a/graylog2-web-interface/src/views/logic/fieldactions/ChangeFieldType/IndexSetsTable.tsx +++ b/graylog2-web-interface/src/views/logic/fieldactions/ChangeFieldType/IndexSetsTable.tsx @@ -14,7 +14,7 @@ * along with this program. If not, see * . */ -import React, { useMemo, useCallback, useState, useEffect } from 'react'; +import React, { useMemo, useCallback, useState } from 'react'; import styled from 'styled-components'; import { @@ -71,10 +71,6 @@ const IndexSetsTable = ({ field, setIndexSetSelection, fieldTypes, initialSelect const { mutate: updateTableLayout } = useUpdateUserLayoutPreferences(ENTITY_TABLE_ID); - useEffect(() => { - setIndexSetSelection(initialSelection); - }, [initialSelection, setIndexSetSelection]); - const onPageChange = useCallback( (newPage: number, newPageSize: number) => { if (newPage) { From a95c74cc6224c1e8f91baf1d49fc991de3b8bd03 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 10:09:14 +0100 Subject: [PATCH 39/39] Bump io.netty:netty-bom from 4.1.100.Final to 4.1.101.Final (#17244) Bumps [io.netty:netty-bom](https://github.com/netty/netty) from 4.1.100.Final to 4.1.101.Final. - [Commits](https://github.com/netty/netty/compare/netty-4.1.100.Final...netty-4.1.101.Final) --- updated-dependencies: - dependency-name: io.netty:netty-bom 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 b365c931066c..c9ddc6ddc897 100644 --- a/pom.xml +++ b/pom.xml @@ -152,7 +152,7 @@ 2.10.1.4 4.8.1-1 0.13 - 4.1.100.Final + 4.1.101.Final 2.0.62.Final 4.12.0 2.3