You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2022/04/22 13:08:10 UTC

[isis] branch master updated (0b822e4b16 -> 50f933d7b1)

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


    from 0b822e4b16 Merge pull request #905 from apache/3005_bulktoggle_wkt
     new d83b0e7da2 ISIS-3005: remove debug lines
     new 50f933d7b1 ISIS-3016: jgrowl: basic multiline support

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../progmodel/assoc/AssociatedActionDemo.java      |  8 +++++++-
 .../CollectionContentsSortableDataProvider.java    |  2 --
 .../isis/viewer/wicket/ui/errors/JGrowlUtil.java   |  9 ++++++++-
 .../viewer/wicket/ui/errors/JGrowlUtilTest.java    | 22 ++++++++++++++++------
 4 files changed, 31 insertions(+), 10 deletions(-)


[isis] 02/02: ISIS-3016: jgrowl: basic multiline support

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 50f933d7b1465ecbaf80c7ed50831aaea7fe00eb
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Apr 22 15:08:03 2022 +0200

    ISIS-3016: jgrowl: basic multiline support
---
 .../progmodel/assoc/AssociatedActionDemo.java      |  8 +++++++-
 .../isis/viewer/wicket/ui/errors/JGrowlUtil.java   |  9 ++++++++-
 .../viewer/wicket/ui/errors/JGrowlUtilTest.java    | 22 ++++++++++++++++------
 3 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/AssociatedActionDemo.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/AssociatedActionDemo.java
index 28db4a3474..743881deab 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/AssociatedActionDemo.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/assoc/AssociatedActionDemo.java
@@ -33,6 +33,7 @@ import org.apache.isis.applib.annotation.ActionLayout;
 import org.apache.isis.applib.annotation.DomainObject;
 import org.apache.isis.applib.annotation.Editing;
 import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.ObjectSupport;
 import org.apache.isis.applib.annotation.PromptStyle;
 import org.apache.isis.applib.services.message.MessageService;
 
@@ -64,12 +65,17 @@ public class AssociatedActionDemo implements HasAsciiDocDescription {
 
     @Getter private final Set<DemoItem> items = new LinkedHashSet<>();
 
+    @XmlTransient @ObjectSupport
+    public String title() {
+        return "Associated Action Demo";
+    }
+
     @Action(choicesFrom = "items")
     @ActionLayout(promptStyle = PromptStyle.DIALOG_MODAL)
     public AssociatedActionDemo doSomethingWithItems(
 
             // bulk selection
-            Set<DemoItem> items) {
+            final Set<DemoItem> items) {
 
         if(items!=null) {
             items.forEach(item->messageService.informUser(item.getName()));
diff --git a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/errors/JGrowlUtil.java b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/errors/JGrowlUtil.java
index a436928fa9..3e127fb74f 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/errors/JGrowlUtil.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/errors/JGrowlUtil.java
@@ -20,6 +20,7 @@ package org.apache.isis.viewer.wicket.ui.errors;
 
 import org.apache.wicket.util.string.Strings;
 
+import org.apache.isis.commons.internal.base._Text;
 import org.apache.isis.core.config.IsisConfiguration;
 import org.apache.isis.core.interaction.session.MessageBroker;
 
@@ -95,11 +96,17 @@ public class JGrowlUtil {
     }
 
     String escape(final String origMsg) {
+
+        _Text.normalize(origMsg);
+
         final String escaped = Strings.escapeMarkup(origMsg).toString();
 
         // convert (what would originally have been either) ' or " to '
         return escaped
                 .replace("&quot;", "'")
-                .replace("&#039;", "'");
+                .replace("&#039;", "'")
+                .replace("\r", "")
+                .replace("\t", " ")
+                .replace("\n", "<br/>");
     }
 }
diff --git a/viewers/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/errors/JGrowlUtilTest.java b/viewers/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/errors/JGrowlUtilTest.java
index bd48f3487b..74719fbee5 100644
--- a/viewers/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/errors/JGrowlUtilTest.java
+++ b/viewers/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/errors/JGrowlUtilTest.java
@@ -18,19 +18,29 @@
  */
 package org.apache.isis.viewer.wicket.ui.errors;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.MatcherAssert.assertThat;
 
-public class JGrowlUtilTest {
+class JGrowlUtilTest {
 
     @Test
-    public void testEscape() throws Exception {
-
-        assertThat(JGrowlUtil.escape(
-                "double quotes \" and single quotes ' and <p>markup</p>"), equalTo(
+    void testEscape() throws Exception {
+        assertThat(JGrowlUtil
+                .escape(
+                        "double quotes \" and single quotes ' and <p>markup</p>"),
+                equalTo(
                         "double quotes ' and single quotes ' and &lt;p&gt;markup&lt;/p&gt;"));
     }
 
+    @Test
+    void testNewlineEscape() throws Exception {
+        assertThat(JGrowlUtil
+                .escape(
+                        "a\n\rb"),
+                equalTo(
+                        "a<br/>b"));
+    }
+
 }
\ No newline at end of file


[isis] 01/02: ISIS-3005: remove debug lines

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit d83b0e7da2af936eadeecc4ee66d3dd4c73f3467
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Apr 22 15:03:39 2022 +0200

    ISIS-3005: remove debug lines
---
 .../ajaxtable/CollectionContentsSortableDataProvider.java               | 2 --
 1 file changed, 2 deletions(-)

diff --git a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsSortableDataProvider.java b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsSortableDataProvider.java
index 77c76c82be..69f15c54ba 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsSortableDataProvider.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsSortableDataProvider.java
@@ -53,13 +53,11 @@ extends SortableDataProvider<DataRow, String> {
     }
 
     public DataTableModel getDataTableModel() {
-        System.err.printf("getDataTableModel %s%n", System.identityHashCode(dataTableModelHolder.getObject()));
         return dataTableModelHolder.getObject();
     }
 
     @Override
     public IModel<DataRow> model(final DataRow dataRow) {
-        System.err.printf("CollectionContentsSortableDataProvider model(%s)%n", dataRow.getUuid());
         return DataRowWkt.chain(dataTableModelHolder, dataRow);
     }