Sitelet https://github.com/KrailOrg/krail/commit/93eab52dcd5e7c533dc1e004e32c33a773a70c4a
Skip to content

Commit 93eab52

Browse files
author
David Sowerby
committed
Fix #749 A number of methods in KrailView passed as BeforeViewChangeBusMessage or AfterViewChangeBusMessage. These have now all had the parameter removed.
The same information is now available in an instance of `NavigationStateExt`, which is passed via the *beforeBuild* method
1 parent b7e6d0b commit 93eab52

54 files changed

Lines changed: 312 additions & 672 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Release Notes.md‎

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,44 @@
11
# Release notes for 0.16.12.0
22

3-
The original objective for this release was to provide a meaningful level of Forms support. That has happened, but the release was extended to include a simpler, lightweight UI as well (`SimpleUI`).
3+
## Overview
44

5-
This also inspired some improvements in handling I18N for components
5+
The original objective for this release was to provide a meaningful level of Forms support. This required the ability to use a `FormConfiguration`, which necessitated some changeds to `KrailView`
66

7-
## SimpleUI
7+
The release was alos extended to include a simpler, lightweight UI as well (`SimpleUI`). This inspired some improvements in handling I18N for components
8+
9+
## Breaking Changes
10+
11+
### KrailView
12+
13+
A number of methods in `KrailView` passed as `BeforeViewChangeBusMessage` or `AfterViewChangeBusMessage`. These have now all had the parameter removed. The same information is now available in an instance of `NavigationStateExt`, which is passed via the *beforeBuild* method
14+
15+
### Refactoring / renaming
16+
17+
- `DataModule` becomes `ConverterModule` and is moved to uk.q3c.krail.core.form
18+
- `ConverterFactory` and associated classes moved to uk.q3c.krail.core.form
19+
- `UserSitemapSorter` becomes `UserSitemapNodeComparator`
20+
- `SubPagePanel` and `Breadcrumb` replaced by `PageNavigationPanel`
21+
22+
23+
### Navigator
24+
- error() method has been removed - this does not play well when there is an error in the Sitemap (see also the notes on MessageBox and KrailErrorHandler)
25+
26+
27+
## Other Changes
28+
29+
### SimpleUI
830

931
A lightweight UI, `SimpleUI`, is available. It is suggested that this is used where the primary user audience is expected to be using mobile.
1032

1133
There is still more work to do on this, see issues #736 and #737
1234

13-
## ScopedUI
14-
15-
### Display panel size
35+
### ScopedUI
1636

1737
Previously the view display panel was always set to size full. This proved to be inappropriate in some cases but could not be changed. A protected property `viewDisplayPanelSizeFull` has been added, and the panel size is set only when this property is true.
1838

1939
To maintain existing use, this property is true by default
2040

21-
## Forms
41+
### Forms
2242

2343
Forms support added. MasterSitemapNode extended to include a configuration, so that a View or Form class can be declared, and its behaviour modified by its configuration.
2444
Views themselves do not yet support the use of configuration objects.
@@ -27,19 +47,12 @@ The Form class is supported by FormBuilders - currently the standard form builde
2747

2848
Although the configuration supports sub-sections, the Form itself does not do so yet (see #712)
2949

30-
## Changes to existing classes / interfaces
31-
3250
### KrailErrorHandler
3351

3452
- Handles uncaught exceptions directly (by logging and popup message box) instead of calling Navigator.error(). The latter does not work well when an error occurs in Sitemap code.
3553
- binding moved from ShiroVaadinModule to ErrorModule
3654
- introduces [SystemErrorNotification] and [SystemErrorNotificationGroup] to improve flexibility in defining how to report errors
3755

38-
### KrailView
39-
40-
A ``NavigationStateExt`` is passed in the ``KrailView.beforeBuild`` and stored in ``ViewBase``. this makes passing the ``ViewChangedMessage`` redundant in ``buildView()``, ``doBuild()`` and ``afterBuild()``, as the same information is available within the view from ``NavigationStateExt``
41-
42-
The methods with a parameter have therefore been deprecated and replaced with parameterless versions.
4356

4457
### Message Box
4558

@@ -75,13 +88,9 @@ New classes are in Kotlin. Quite a few classes were ported, this is just a few o
7588
- MasterSitemapNode, UserSitemapNode, NodeRecord, SitemapFinisher and NavigationCommand
7689
- A couple of tests which mock UserSitemapNode (Mockito cannot mock final classes, Mockk can)
7790
- All in package uk.q3c.krail.core.navigate.sitemap.comparator
91+
- KrailView
7892

79-
## Refactoring / renaming
8093

81-
- `DataModule` becomes `ConverterModule` and is moved to uk.q3c.krail.core.form
82-
- `ConverterFactory` and associated classes moved to uk.q3c.krail.core.form
83-
- `UserSitemapSorter` becomes `UserSitemapNodeComparator`
84-
- `SubPagePanel` and `Breadcrumb` replaced by `PageNavigationPanel`
8594

8695
## Tests
8796

‎build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ repositories {
7070
kaytee {
7171
version {
7272
number = "0.16.12.0"
73-
qualifier="krail-743"
73+
qualifier="krail-749"
7474
}
7575
changelog {
7676
maxVersions = 10

‎src/main/java/uk/q3c/krail/core/sysadmin/I18NView.java‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import uk.q3c.krail.core.i18n.MessageKey;
3030
import uk.q3c.krail.core.user.notify.UserNotifier;
3131
import uk.q3c.krail.core.view.Grid3x3ViewBase;
32-
import uk.q3c.krail.core.view.component.ViewChangeBusMessage;
3332
import uk.q3c.krail.eventbus.SubscribeTo;
3433
import uk.q3c.krail.i18n.LocaleChangeBusMessage;
3534
import uk.q3c.krail.i18n.Translate;
@@ -83,8 +82,8 @@ public Label getInstructions2() {
8382
* {@inheritDoc}
8483
*/
8584
@Override
86-
protected void doBuild(ViewChangeBusMessage busMessage) {
87-
super.doBuild(busMessage);
85+
protected void doBuild() {
86+
super.doBuild();
8887
instructions1 = new Label();
8988
instructions2 = new Label();
9089
localeList = new TextArea();

‎src/main/java/uk/q3c/krail/core/sysadmin/SitemapReportView.java‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import uk.q3c.krail.core.i18n.LabelKey;
2121
import uk.q3c.krail.core.navigate.sitemap.MasterSitemap;
2222
import uk.q3c.krail.core.view.Grid3x3ViewBase;
23-
import uk.q3c.krail.core.view.component.ViewChangeBusMessage;
2423
import uk.q3c.krail.i18n.Translate;
2524
import uk.q3c.krail.util.Experimental;
2625
import uk.q3c.util.guice.SerializationSupport;
@@ -43,8 +42,8 @@ protected SitemapReportView(MasterSitemap masterSitemap, Translate translate, Se
4342
}
4443

4544
@Override
46-
protected void doBuild(ViewChangeBusMessage busMessage) {
47-
super.doBuild(busMessage);
45+
protected void doBuild() {
46+
super.doBuild();
4847
reportArea = new TextArea();
4948
// reportArea.setEnabled(false);
5049
reportArea.setSizeFull();

‎src/main/java/uk/q3c/krail/core/view/DefaultErrorView.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.slf4j.LoggerFactory;
2121
import uk.q3c.krail.core.i18n.CommonLabelKey;
2222
import uk.q3c.krail.core.i18n.DescriptionKey;
23-
import uk.q3c.krail.core.view.component.ViewChangeBusMessage;
2423
import uk.q3c.krail.i18n.Translate;
2524
import uk.q3c.util.guice.SerializationSupport;
2625

@@ -57,7 +56,7 @@ public void setError(Throwable error) {
5756

5857

5958
@Override
60-
public void doBuild(ViewChangeBusMessage busMessage) {
59+
public void doBuild() {
6160
textArea = new TextArea();
6261
textArea.setSizeFull();
6362
textArea.setReadOnly(false);

‎src/main/java/uk/q3c/krail/core/view/DefaultLogoutView.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import com.google.inject.Inject;
1616
import com.vaadin.ui.Panel;
17-
import uk.q3c.krail.core.view.component.ViewChangeBusMessage;
1817
import uk.q3c.krail.i18n.Translate;
1918
import uk.q3c.util.guice.SerializationSupport;
2019

@@ -28,7 +27,8 @@ protected DefaultLogoutView(Translate translate, SerializationSupport serializat
2827

2928

3029
@Override
31-
public void doBuild(ViewChangeBusMessage busMessage) {
30+
public void doBuild() {
31+
super.doBuild();
3232
Panel p = new Panel("Logged out");
3333
p.setSizeFull();
3434
getLayout().addComponent(p);

‎src/main/java/uk/q3c/krail/core/view/Grid3x3ViewBase.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import com.google.inject.Inject;
1717
import com.vaadin.ui.Component;
1818
import com.vaadin.ui.GridLayout;
19-
import uk.q3c.krail.core.view.component.ViewChangeBusMessage;
2019
import uk.q3c.krail.i18n.Translate;
2120
import uk.q3c.util.guice.SerializationSupport;
2221

@@ -33,7 +32,7 @@ protected Grid3x3ViewBase(Translate translate, SerializationSupport serializatio
3332
}
3433

3534
@Override
36-
protected void doBuild(ViewChangeBusMessage busMessage) {
35+
protected void doBuild() {
3736

3837
grid = new GridLayout(3, 3);
3938
grid.setSizeFull();

‎src/main/java/uk/q3c/krail/core/view/GridViewBase.java‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import org.slf4j.Logger;
1919
import org.slf4j.LoggerFactory;
2020
import uk.q3c.krail.core.ui.ScopedUI;
21-
import uk.q3c.krail.core.view.component.ViewChangeBusMessage;
2221
import uk.q3c.krail.i18n.Translate;
2322
import uk.q3c.util.guice.SerializationSupport;
2423

@@ -43,12 +42,9 @@ public GridLayout getGridLayout() {
4342
* need to check whether components have already been constructed, as this method may be called when the View is
4443
* selected again after initial construction.
4544
*
46-
* @param event
47-
* contains information about the change to this View
4845
*/
4946
@Override
50-
public void buildView(ViewChangeBusMessage event) {
51-
super.buildView(event);
47+
public void doBuild() {
5248
setRootComponent(gridLayout);
5349
setIds();
5450
}

‎src/main/java/uk/q3c/krail/core/view/KrailView.java‎

Lines changed: 0 additions & 107 deletions
This file was deleted.

‎src/main/java/uk/q3c/krail/core/view/StandardPageViewBase.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import com.google.inject.Inject;
1616
import com.vaadin.ui.GridLayout;
1717
import com.vaadin.ui.Label;
18-
import uk.q3c.krail.core.view.component.ViewChangeBusMessage;
1918
import uk.q3c.krail.i18n.Translate;
2019
import uk.q3c.util.guice.SerializationSupport;
2120

@@ -30,7 +29,7 @@ protected StandardPageViewBase(Translate translate, SerializationSupport seriali
3029
}
3130

3231
@Override
33-
public void doBuild(ViewChangeBusMessage busMessage) {
32+
public void doBuild() {
3433

3534
label = new Label("This is the " + this.getClass()
3635
.getSimpleName());

0 commit comments

Comments
 (0)