]> source.dussan.org Git - vaadin-framework.git/commitdiff
Add MPR UI id request parameter (#12414)
authorTatu Lund <tatu@vaadin.com>
Tue, 28 Sep 2021 08:01:01 +0000 (11:01 +0300)
committerGitHub <noreply@github.com>
Tue, 28 Sep 2021 08:01:01 +0000 (11:01 +0300)
* Add MPR UI id request parameter

* Update test

* Update test

server/src/main/resources/VAADIN/vaadinBootstrap.js
uitest/src/main/java/com/vaadin/tests/components/ui/UIInitBrowserDetails.java
uitest/src/test/java/com/vaadin/tests/components/ui/UIInitBrowserDetailsTest.java

index 9fce53509a1e05c14af2c3f040bcf7e4dcd4a8b0..e03bb31e100b6f10f33e44e3c1b47442cecee616 100644 (file)
                                params += '&v-wn=' + encodeURIComponent(window.name);
                        }
 
+                       // This parameter is used in multiplatform-runtime as a key for
+                       // storing the MPR UI content in the session
+                       if (window.mprUiId) {
+                               params += '&v-mui=' + encodeURIComponent(window.mprUiId);
+                       }
+
                        // Detect touch device support
                        var supportsTouch = false;
                        try {
index 130d432940f446ec353973ba5c6cf2ccfe5146c9..957f99b0389d72870cc3108530a936770a81fa8d 100644 (file)
@@ -37,6 +37,7 @@ public class UIInitBrowserDetails extends AbstractTestUI {
         addDetail("dst saving", "v-dstd", wb.getDSTSavings());
         addDetail("dst in effect", "v-dston", wb.isDSTInEffect());
         addDetail("current date", "v-curdate", wb.getCurrentDate());
+        addDetail("mpr ui id", "v-mui", "");
     }
 
     private void addDetail(String name, String param, Object value) {
index 641ac6d82abc6c5320ce208ff80db93fb8b7221d..303c338eb136b3fb21528f2f98f0cd6c0e54968c 100644 (file)
@@ -21,6 +21,9 @@ public class UIInitBrowserDetailsTest extends MultiBrowserTest {
         compareRequestAndBrowserValue("v-sw", "screen width", "-1");
         /* screen height */
         compareRequestAndBrowserValue("v-sh", "screen height", "-1");
+        /* mpr ui id */
+        compareRequestAndBrowserValue("v-mui", "mpr ui id",
+                "any-non-empty-value");
         /* timezone offset */
         assertTextNotNull("timezone offset");
         /* raw timezone offset */