Skip to content

Commit 1051f92

Browse files
committed
gh-4168 Fix size of anno linked event screen
1 parent cf4263d commit 1051f92

File tree

4 files changed

+48
-22
lines changed

4 files changed

+48
-22
lines changed

stroom-core-client/src/main/java/stroom/annotation/client/AnnotationEditPresenter.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public AnnotationEditPresenter(final EventBus eventBus,
136136
this.assignedToPresenter.setDisplayValueFunction(userName -> {
137137
if (userName != null) {
138138
if (!GwtNullSafe.isBlankString(userName.getFullName())) {
139-
return userName.getUserIdentityForAudit() + " (" + userName.getFullName() + ")";
139+
return userName.getUserIdentityForAudit() + " (" + userName.getFullName() + ")";
140140
} else {
141141
return userName.getUserIdentityForAudit();
142142
}
@@ -927,8 +927,8 @@ public void showLinkedEvents() {
927927
linkedEventPresenter.edit(annotationDetail.getAnnotation(), refresh -> {
928928
if (refresh) {
929929
final AnnotationResource annotationResource = GWT.create(AnnotationResource.class);
930-
final Rest<AnnotationDetail> rest = restFactory.create();
931-
rest
930+
restFactory.builder()
931+
.forType(AnnotationDetail.class)
932932
.onSuccess(this::updateHistory)
933933
.call(annotationResource)
934934
.get(annotationDetail.getAnnotation().getId());

stroom-core-client/src/main/java/stroom/annotation/client/LinkedEventPresenter.java

+19-17
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,17 @@
1010
import stroom.data.client.presenter.DisplayMode;
1111
import stroom.data.grid.client.MyDataGrid;
1212
import stroom.data.grid.client.PagerView;
13-
import stroom.dispatch.client.Rest;
1413
import stroom.dispatch.client.RestFactory;
1514
import stroom.pipeline.shared.SourceLocation;
1615
import stroom.svg.client.SvgPresets;
16+
import stroom.util.client.DataGridUtil;
1717
import stroom.widget.button.client.ButtonView;
1818
import stroom.widget.popup.client.event.ShowPopupEvent;
1919
import stroom.widget.popup.client.presenter.PopupSize;
2020
import stroom.widget.popup.client.presenter.PopupType;
2121
import stroom.widget.util.client.MultiSelectionModelImpl;
2222

23-
import com.google.gwt.cell.client.TextCell;
2423
import com.google.gwt.core.client.GWT;
25-
import com.google.gwt.user.cellview.client.Column;
2624
import com.google.web.bindery.event.shared.EventBus;
2725
import com.gwtplatform.mvp.client.MyPresenterWidget;
2826
import com.gwtplatform.mvp.client.View;
@@ -81,12 +79,11 @@ public LinkedEventPresenter(final EventBus eventBus,
8179
view.setEventListView(pagerView);
8280
view.setDataView(dataPresenter.getView());
8381

84-
dataGrid.addResizableColumn(new Column<EventId, String>(new TextCell()) {
85-
@Override
86-
public String getValue(final EventId eventId) {
87-
return eventId.toString();
88-
}
89-
}, "Id", ColumnSizeConstants.SMALL_COL);
82+
dataGrid.addAutoResizableColumn(
83+
DataGridUtil.copyTextColumnBuilder(EventId::toString)
84+
.build(),
85+
"Id",
86+
ColumnSizeConstants.MEDIUM_COL);
9087
}
9188

9289
@Override
@@ -99,8 +96,9 @@ protected void onBind() {
9996
dirty = true;
10097

10198
final AnnotationResource annotationResource = GWT.create(AnnotationResource.class);
102-
final Rest<List<EventId>> rest = restFactory.create();
103-
rest.onSuccess(this::setData)
99+
restFactory.builder()
100+
.forListOf(EventId.class)
101+
.onSuccess(this::setData)
104102
.call(annotationResource)
105103
.link(new EventLink(annotation.getId(), eventId));
106104
}
@@ -120,8 +118,9 @@ protected void onBind() {
120118
}
121119

122120
final AnnotationResource annotationResource = GWT.create(AnnotationResource.class);
123-
final Rest<List<EventId>> rest = restFactory.create();
124-
rest.onSuccess(this::setData)
121+
restFactory.builder()
122+
.forListOf(EventId.class)
123+
.onSuccess(this::setData)
125124
.call(annotationResource)
126125
.unlink(new EventLink(annotation.getId(), selected));
127126
}
@@ -134,14 +133,17 @@ public void edit(final Annotation annotation, final Consumer<Boolean> consumer)
134133
dirty = false;
135134

136135
final AnnotationResource annotationResource = GWT.create(AnnotationResource.class);
137-
final Rest<List<EventId>> rest = restFactory.create();
138-
rest.onSuccess(this::show).call(annotationResource).getLinkedEvents(annotation.getId());
136+
restFactory.builder()
137+
.forListOf(EventId.class)
138+
.onSuccess(this::show)
139+
.call(annotationResource)
140+
.getLinkedEvents(annotation.getId());
139141
}
140142

141143
private void show(final List<EventId> data) {
142144
setData(data);
143145

144-
final PopupSize popupSize = PopupSize.resizable(800, 600);
146+
final PopupSize popupSize = PopupSize.resizable(1100, 600);
145147
ShowPopupEvent.builder(this)
146148
.popupType(PopupType.CLOSE_DIALOG)
147149
.popupSize(popupSize)
@@ -157,7 +159,7 @@ private void setData(final List<EventId> data) {
157159
dataGrid.setRowCount(data.size());
158160

159161
// Change the selection if we need to.
160-
if (data.size() > 0) {
162+
if (!data.isEmpty()) {
161163
final EventId currentSelection = selectionModel.getSelected();
162164
if (nextSelection != null && data.contains(nextSelection)) {
163165
selectionModel.setSelected(nextSelection);

stroom-core-client/src/main/resources/stroom/annotation/client/LinkedEventViewImpl.ui.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
xmlns:g="urn:import:com.google.gwt.user.client.ui">
44
<g:SimplePanel styleName="max default-min-sizes">
55
<g:MySplitLayoutPanel styleName="max">
6-
<g:west size="250">
6+
<g:west size="300">
77
<g:SimplePanel ui:field="eventList" styleName="max stroom-control"/>
88
</g:west>
99
<g:center>
1010
<g:SimplePanel ui:field="data" styleName="max stroom-control"/>
1111
</g:center>
1212
</g:MySplitLayoutPanel>
1313
</g:SimplePanel>
14-
</ui:UiBinder>
14+
</ui:UiBinder>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
* Issue **#4168** : Increase width of Id column on Annotations Linked Events dialog. Also increase size of dialog and the width of the left hand split pane.
2+
3+
4+
```sh
5+
# ********************************************************************************
6+
# Issue title: Annotations, Show Linked Events , List of Ids is too small for Medium/Large Fonts
7+
# Issue link: https://github.com/gchq/stroom/issues/4168
8+
# ********************************************************************************
9+
10+
# ONLY the top line will be included as a change entry in the CHANGELOG.
11+
# The entry should be in GitHub flavour markdown and should be written on a SINGLE
12+
# line with no hard breaks. You can have multiple change files for a single GitHub issue.
13+
# The entry should be written in the imperative mood, i.e. 'Fix nasty bug' rather than
14+
# 'Fixed nasty bug'.
15+
#
16+
# Examples of acceptable entries are:
17+
#
18+
#
19+
# * Issue **123** : Fix bug with an associated GitHub issue in this repository
20+
#
21+
# * Issue **namespace/other-repo#456** : Fix bug with an associated GitHub issue in another repository
22+
#
23+
# * Fix bug with no associated GitHub issue.
24+
```

0 commit comments

Comments
 (0)