Skip to content

Commit

Permalink
Merge pull request #4753 from gchq/gh-4374_find_multi_line_query
Browse files Browse the repository at this point in the history
#4734 Fix find in content multi line query behaviour
  • Loading branch information
stroomdev66 authored Feb 3, 2025
2 parents 6145500 + 7616ac3 commit 9b49156
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
5 changes: 5 additions & 0 deletions stroom-app/src/main/resources/ui/css/components.css
Original file line number Diff line number Diff line change
Expand Up @@ -2069,6 +2069,11 @@ button.main-menu svg {
height: 2.1rem;
}

.find-topBar .gwt-TextArea.multiLine {
/* Multi line */
height: 6.3rem;
}

.find-buttons {
display: flex;
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.KeyDownEvent;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
Expand Down Expand Up @@ -99,13 +100,24 @@ public void focus() {
}

@UiHandler("pattern")
void onPatternChange(final KeyUpEvent e) {
void onPatternKeyUp(final KeyUpEvent e) {
getUiHandlers().changePattern(pattern.getText(), toggleMatchCase.getState(), toggleRegex.getState());
}

@UiHandler("pattern")
void onPatternKeyDown(final KeyDownEvent event) {
getUiHandlers().onPatternKeyDown(event);
void onPatternKeyDown(final KeyDownEvent e) {
if (!e.getNativeEvent().getShiftKey()) {
getUiHandlers().onPatternKeyDown(e);
}
}

@UiHandler("pattern")
void onPatternChange(final ValueChangeEvent<String> e) {
if (pattern.getText().contains("\n")) {
pattern.getElement().addClassName("multiLine");
} else {
pattern.getElement().removeClassName("multiLine");
}
}

@UiHandler("toggleMatchCase")
Expand Down
24 changes: 24 additions & 0 deletions unreleased_changes/20250131_161637_158__4734.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
* Issue **#4734** : Fix find in content multi line query behaviour.


```sh
# ********************************************************************************
# Issue title: Find In Content, can press return in search string, behaviour is a bit odd.
# Issue link: https://github.com/gchq/stroom/issues/4734
# ********************************************************************************

# 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.
```

0 comments on commit 9b49156

Please sign in to comment.