From 485133d54c87083002111c963a9887c59287155d Mon Sep 17 00:00:00 2001 From: stroomdev66 Date: Mon, 3 Feb 2025 10:55:18 +0000 Subject: [PATCH] #4696 Fix paging of large numbers of data sources --- .../java/stroom/query/impl/DataSources.java | 23 ++++++++---------- .../20250203_105435_840__4696.md | 24 +++++++++++++++++++ 2 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 unreleased_changes/20250203_105435_840__4696.md diff --git a/stroom-query/stroom-query-impl/src/main/java/stroom/query/impl/DataSources.java b/stroom-query/stroom-query-impl/src/main/java/stroom/query/impl/DataSources.java index f62582c4c7..5c395cd2da 100644 --- a/stroom-query/stroom-query-impl/src/main/java/stroom/query/impl/DataSources.java +++ b/stroom-query/stroom-query-impl/src/main/java/stroom/query/impl/DataSources.java @@ -84,19 +84,16 @@ public void addRows(final PageRequest pageRequest, new TrimmedSortedList<>(pageRequest, Comparator.comparing(QueryHelpRow::getTitle)); for (final DocRef docRef : dataSourceProviderRegistry.getDataSourceDocRefs()) { if (stringMatcher.match(docRef.getDisplayValue()).isPresent()) { - for (int i = 0; i < 1000; i++) { - final QueryHelpRow row = QueryHelpRow - .builder() - .type(QueryHelpType.DATA_SOURCE) - .id(DATA_SOURCE_ID + "." + docRef.getUuid() + "dszf") - .documentType(docRef.getType()) - .iconTooltip(docRef.getType() + " - " + docRef.getDisplayValue()) - .title("asdf " + i + " " + docRef.getDisplayValue()) - .data(new QueryHelpDocument(docRef)) - .build(); - - trimmedSortedList.add(row); - } + final QueryHelpRow row = QueryHelpRow + .builder() + .type(QueryHelpType.DATA_SOURCE) + .id(DATA_SOURCE_ID + "." + docRef.getUuid()) + .documentType(docRef.getType()) + .iconTooltip(docRef.getType() + " - " + docRef.getDisplayValue()) + .title(docRef.getDisplayValue()) + .data(new QueryHelpDocument(docRef)) + .build(); + trimmedSortedList.add(row); } } diff --git a/unreleased_changes/20250203_105435_840__4696.md b/unreleased_changes/20250203_105435_840__4696.md new file mode 100644 index 0000000000..b0fd93416c --- /dev/null +++ b/unreleased_changes/20250203_105435_840__4696.md @@ -0,0 +1,24 @@ +* Issue **#4696** : Fix paging of large numbers of data sources. + + +```sh +# ******************************************************************************** +# Issue title: Query Helper Next page control is greyed even when > 100 Data Sources are available +# Issue link: https://github.com/gchq/stroom/issues/4696 +# ******************************************************************************** + +# ONLY the top line will be included as a change entry in the CHANGELOG. +# The entry should be in GitHub flavour markdown and should be written on a SINGLE +# line with no hard breaks. You can have multiple change files for a single GitHub issue. +# The entry should be written in the imperative mood, i.e. 'Fix nasty bug' rather than +# 'Fixed nasty bug'. +# +# Examples of acceptable entries are: +# +# +# * Issue **123** : Fix bug with an associated GitHub issue in this repository +# +# * Issue **namespace/other-repo#456** : Fix bug with an associated GitHub issue in another repository +# +# * Fix bug with no associated GitHub issue. +```