Quellcode durchsuchen

fix: Add MPR UI id request parameter (#12412)

* fix: Add MPR UI id request parameter

Related-to https://github.com/vaadin/multiplatform-runtime/issues/85

* test: Remove redundant non-empty param test

* test: Remove leftovers

* fix: Init window.mprUiId earlier than window.vaadin

* Add missing '='
tags/8.15.0
Mikhail Shabarov vor 2 Jahren
Ursprung
Commit
c982b1c531
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden

+ 6
- 0
server/src/main/resources/VAADIN/vaadinBootstrap.js Datei anzeigen

params += '&v-wn=' + encodeURIComponent(window.name); 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 // Detect touch device support
var supportsTouch = false; var supportsTouch = false;
try { try {

+ 1
- 0
uitest/src/main/java/com/vaadin/tests/components/ui/UIInitBrowserDetails.java Datei anzeigen

addDetail("dst saving", "v-dstd", wb.getDSTSavings()); addDetail("dst saving", "v-dstd", wb.getDSTSavings());
addDetail("dst in effect", "v-dston", wb.isDSTInEffect()); addDetail("dst in effect", "v-dston", wb.isDSTInEffect());
addDetail("current date", "v-curdate", wb.getCurrentDate()); addDetail("current date", "v-curdate", wb.getCurrentDate());
addDetail("mpr ui id", "v-mui", "");
} }


private void addDetail(String name, String param, Object value) { private void addDetail(String name, String param, Object value) {

+ 4
- 1
uitest/src/test/java/com/vaadin/tests/components/ui/UIInitBrowserDetailsTest.java Datei anzeigen

public class UIInitBrowserDetailsTest extends MultiBrowserTest { public class UIInitBrowserDetailsTest extends MultiBrowserTest {


@Test @Test
public void testBrowserDetails() throws Exception {
public void testBrowserDetails() {
openTestURL(); openTestURL();
/* location */ /* location */
compareRequestAndBrowserValue("v-loc", "location", "null"); compareRequestAndBrowserValue("v-loc", "location", "null");
compareRequestAndBrowserValue("v-sw", "screen width", "-1"); compareRequestAndBrowserValue("v-sw", "screen width", "-1");
/* screen height */ /* screen height */
compareRequestAndBrowserValue("v-sh", "screen height", "-1"); compareRequestAndBrowserValue("v-sh", "screen height", "-1");
/* mpr ui id */
compareRequestAndBrowserValue("v-mui", "mpr ui id",
"any-non-empty-value");
/* timezone offset */ /* timezone offset */
assertTextNotNull("timezone offset"); assertTextNotNull("timezone offset");
/* raw timezone offset */ /* raw timezone offset */

Laden…
Abbrechen
Speichern