jsf.js_next_gen 4.0.1-beta.3 → 4.0.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/window/faces-development.js +19 -13
- package/dist/window/faces-development.js.br +0 -0
- package/dist/window/faces-development.js.gz +0 -0
- package/dist/window/faces-development.js.map +1 -1
- package/dist/window/faces.js +1 -1
- package/dist/window/faces.js.br +0 -0
- package/dist/window/faces.js.gz +0 -0
- package/dist/window/faces.js.map +1 -1
- package/dist/window/jsf-development.js +19 -13
- package/dist/window/jsf-development.js.br +0 -0
- package/dist/window/jsf-development.js.gz +0 -0
- package/dist/window/jsf-development.js.map +1 -1
- package/dist/window/jsf.js +1 -1
- package/dist/window/jsf.js.br +0 -0
- package/dist/window/jsf.js.gz +0 -0
- package/dist/window/jsf.js.map +1 -1
- package/package.json +2 -2
- package/src/main/typescript/impl/AjaxImpl.ts +3 -3
- package/src/main/typescript/impl/util/ExtDomQuery.ts +2 -2
- package/src/main/typescript/impl/util/FileUtils.ts +3 -3
- package/src/main/typescript/impl/util/Lang.ts +2 -1
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +4 -4
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +2 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/blank.css +15 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/test.js +15 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/test2.js +15 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/jakarta.faces.resource/faces.js.jsf +15 -0
- package/src/main/typescript/test/impl/ImplTest.spec.ts +24 -6
- package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +9 -1
- package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +9 -1
- package/src/main/typescript/test/xhrCore/OamSubmitTest.spec.ts +9 -2
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +9 -2
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +9 -2
- package/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts +9 -1
- package/src/main/typescript/test/xhrCore/WebsocketTest.ts +10 -3
- package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +9 -2
- package/target/impl/AjaxImpl.js +3 -3
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/util/ExtDomQuery.js +1 -1
- package/target/impl/util/ExtDomQuery.js.map +1 -1
- package/target/impl/util/FileUtils.js +3 -2
- package/target/impl/util/FileUtils.js.map +1 -1
- package/target/impl/util/Lang.js +2 -1
- package/target/impl/util/Lang.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +2 -2
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +2 -1
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +138 -138
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +19 -1
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +8 -0
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/NamespacesRequestTest.spec.js +8 -0
- package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/OamSubmitTest.spec.js +8 -0
- package/target/test/xhrCore/OamSubmitTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +8 -0
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +8 -0
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js +8 -0
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/WebsocketTest.js +9 -0
- package/target/test/xhrCore/WebsocketTest.js.map +1 -1
- package/target/test/xhrCore/XhrFormDataTest.spec.js +8 -0
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsf.js_next_gen",
|
|
3
|
-
"version": "4.0.1-beta.
|
|
3
|
+
"version": "4.0.1-beta.5",
|
|
4
4
|
"description": "A next generation typescript reimplementation of jsf.js",
|
|
5
5
|
"main": "dist/window/faces.js",
|
|
6
6
|
"scripts": {
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
"webpack-dev-server": "^4.11.1"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"mona-dish": "0.28.
|
|
52
|
+
"mona-dish": "0.28.3"
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -523,16 +523,16 @@ export module Implementation {
|
|
|
523
523
|
* or non-existent. If they exist all of them must be the same
|
|
524
524
|
*/
|
|
525
525
|
|
|
526
|
-
let formWindowId:
|
|
526
|
+
let formWindowId: string = inputs.asArray.map(getValue).reduce(differenceCheck, INIT);
|
|
527
527
|
|
|
528
528
|
|
|
529
529
|
//if the resulting window id is set on altered then we have an unresolvable problem
|
|
530
|
-
assert(ALTERED != formWindowId
|
|
530
|
+
assert(ALTERED != formWindowId, "Multiple different windowIds found in document");
|
|
531
531
|
|
|
532
532
|
/*
|
|
533
533
|
* return the window id or null
|
|
534
534
|
*/
|
|
535
|
-
return formWindowId
|
|
535
|
+
return formWindowId != INIT ? formWindowId : (fetchWindowIdFromURL() || fetchWindowIdFromJSFJS());
|
|
536
536
|
}
|
|
537
537
|
|
|
538
538
|
/**
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {Config, IValueHolder, Optional, DomQuery, DQ} from "mona-dish";
|
|
16
|
+
import {Config, IValueHolder, Optional, DomQuery, DQ, Es2019Array} from "mona-dish";
|
|
17
17
|
import {$nsp, P_WINDOW_ID} from "../core/Const";
|
|
18
18
|
|
|
19
19
|
|
|
@@ -330,6 +330,6 @@ export class ExtConfig extends Config {
|
|
|
330
330
|
if(!this.$nspEnabled) {
|
|
331
331
|
return accessPath;
|
|
332
332
|
}
|
|
333
|
-
return
|
|
333
|
+
return new Es2019Array(...accessPath).map(key => $nsp(key));
|
|
334
334
|
}
|
|
335
335
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Config, DomQuery, DQ} from "mona-dish";
|
|
1
|
+
import {Config, DomQuery, DQ, Es2019Array} from "mona-dish";
|
|
2
2
|
import {ExtDomQuery} from "./ExtDomQuery";
|
|
3
3
|
import {$faces, EMPTY_STR} from "../core/Const";
|
|
4
4
|
|
|
@@ -27,7 +27,7 @@ export function encodeFormData(formData: Config,
|
|
|
27
27
|
const isNotFile = ([, value]) => !(value instanceof ExtDomQuery.global().File);
|
|
28
28
|
const mapIntoUrlParam = keyVal => `${encodeURIComponent(keyVal[0])}=${encodeURIComponent(keyVal[1])}`;
|
|
29
29
|
|
|
30
|
-
return Object.keys(assocValues)
|
|
30
|
+
return new Es2019Array(...Object.keys(assocValues))
|
|
31
31
|
.filter(isPropertyKey)
|
|
32
32
|
.flatMap(expandValueArrAndRename)
|
|
33
33
|
.filter(isNotFile)
|
|
@@ -104,5 +104,5 @@ function resolveViewState(parentItem: DomQuery): string[][] | [string, File][] {
|
|
|
104
104
|
export function getFormInputsAsArr(parentItem: DomQuery): string[][] | [string, File][] {
|
|
105
105
|
const standardInputs: any = resolveViewState(parentItem);
|
|
106
106
|
const fileInputs = resolveFiles(parentItem);
|
|
107
|
-
return standardInputs.concat(
|
|
107
|
+
return standardInputs.concat(fileInputs)
|
|
108
108
|
}
|
|
@@ -19,6 +19,7 @@ import {Lang as LangBase, Config, Optional, DomQuery, DQ} from "mona-dish";
|
|
|
19
19
|
import {Messages} from "../i18n/Messages";
|
|
20
20
|
import {EMPTY_STR, HTML_TAG_FORM} from "../core/Const";
|
|
21
21
|
import {getEventTarget} from "../xhrCore/RequestDataResolver";
|
|
22
|
+
import {Es2019Array} from "mona-dish";
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
export module ExtLang {
|
|
@@ -207,7 +208,7 @@ export module ExtLang {
|
|
|
207
208
|
* @param value
|
|
208
209
|
*/
|
|
209
210
|
export function ofAssoc(value: {[key: string]: any}) {
|
|
210
|
-
return Object.keys(value)
|
|
211
|
+
return new Es2019Array(...Object.keys(value))
|
|
211
212
|
.map(key => [key, value[key]]);
|
|
212
213
|
}
|
|
213
214
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {Config, DomQuery,
|
|
17
|
+
import {Config, DomQuery, DQ, DQ$, Lang, XMLQuery} from "mona-dish";
|
|
18
18
|
import {Implementation} from "../AjaxImpl";
|
|
19
19
|
import {Assertions} from "../util/Assertions";
|
|
20
20
|
import {IResponseProcessor} from "./IResponseProcessor";
|
|
@@ -115,8 +115,8 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
115
115
|
const nodesToAdd = (shadowHead.tagName.value === "HEAD") ? shadowHead.childNodes : shadowHead;
|
|
116
116
|
// this is stored for "post" processing
|
|
117
117
|
// after the rest of the "physical build up", head before body
|
|
118
|
-
const scriptElements = nodesToAdd.
|
|
119
|
-
.filter(item => scriptTags.indexOf(item.tagName.orElse("").value) != -1)
|
|
118
|
+
const scriptElements = new DomQuery(...nodesToAdd.asArray
|
|
119
|
+
.filter(item => scriptTags.indexOf(item.tagName.orElse("").value) != -1));
|
|
120
120
|
|
|
121
121
|
this.addToHeadDeferred(scriptElements);
|
|
122
122
|
}
|
|
@@ -366,7 +366,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
366
366
|
* is done.
|
|
367
367
|
*/
|
|
368
368
|
fixClientWindow() {
|
|
369
|
-
|
|
369
|
+
ofAssoc(this.internalContext.getIf(APPLIED_CLIENT_WINDOW).orElse({}).value)
|
|
370
370
|
.forEach(([, value]) => {
|
|
371
371
|
const namingContainerId = this.internalContext.getIf(NAMING_CONTAINER_ID);
|
|
372
372
|
const namedViewRoot = !!this.internalContext.getIf(NAMED_VIEWROOT).value;
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
} from "../util/FileUtils";
|
|
23
23
|
import {ExtLang} from "../util/Lang";
|
|
24
24
|
import ofAssoc = ExtLang.ofAssoc;
|
|
25
|
+
import {Es2019Array} from "mona-dish";
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
type ParamsMapper<V, K> = (key: V, item: K) => [V, K];
|
|
@@ -82,7 +83,7 @@ export class XhrFormData extends Config {
|
|
|
82
83
|
*/
|
|
83
84
|
let expandValueArrays = ([key, item]) => {
|
|
84
85
|
if (Array.isArray(item)) {
|
|
85
|
-
return item.map(value => {
|
|
86
|
+
return new Es2019Array(...item).map(value => {
|
|
86
87
|
return {key, value}
|
|
87
88
|
})
|
|
88
89
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import {expect} from 'chai';
|
|
18
18
|
import {describe, it} from 'mocha';
|
|
19
19
|
import {from} from "rxjs";
|
|
20
|
-
import {ArrayCollector, Config, DomQuery, DomQueryCollector, Lang, LazyStream, Stream} from "mona-dish";
|
|
20
|
+
import {ArrayCollector, Config, DomQuery, DomQueryCollector, Lang, LazyStream, Stream} from "mona-dish/dist/js/umd";
|
|
21
21
|
import {tobagoSheetWithHeader} from "./markups/tobago-with-header";
|
|
22
22
|
import {tobagoSheetWithoutHeader} from "./markups/tobago-without-header";
|
|
23
23
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
* this work for additional information regarding copyright ownership.
|
|
4
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
5
|
+
* (the "License"); you may not use this file except in compliance with
|
|
6
|
+
* the License. You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
@@ -1 +1,16 @@
|
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
* this work for additional information regarding copyright ownership.
|
|
4
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
5
|
+
* (the "License"); you may not use this file except in compliance with
|
|
6
|
+
* the License. You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
1
16
|
document.getElementById('id_1').innerHTML = "hello world";
|
|
@@ -1 +1,16 @@
|
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
* this work for additional information regarding copyright ownership.
|
|
4
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
5
|
+
* (the "License"); you may not use this file except in compliance with
|
|
6
|
+
* the License. You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
1
16
|
document.getElementById('id_1').innerHTML = "hello world";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
* this work for additional information regarding copyright ownership.
|
|
4
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
5
|
+
* (the "License"); you may not use this file except in compliance with
|
|
6
|
+
* the License. You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import {Config, DomQuery} from "mona-dish";
|
|
18
|
-
import {describe, it} from 'mocha';
|
|
18
|
+
import {afterEach, describe, it} from 'mocha';
|
|
19
19
|
import {expect} from 'chai';
|
|
20
20
|
import * as sinon from 'sinon';
|
|
21
21
|
|
|
22
22
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
23
23
|
import {CTX_PARAM_REQ_PASS_THR, P_EXECUTE, P_RENDER} from "../../impl/core/Const";
|
|
24
24
|
import defaultMyFaces = StandardInits.defaultMyFaces;
|
|
25
|
+
import {_Es2019Array} from "mona-dish";
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
sinon.reset();
|
|
@@ -37,11 +38,26 @@ declare var Implementation: any;
|
|
|
37
38
|
*/
|
|
38
39
|
|
|
39
40
|
describe('faces.ajax.request test suite', () => {
|
|
40
|
-
|
|
41
|
+
let oldFlatMap = null;
|
|
41
42
|
beforeEach(async () => {
|
|
42
|
-
|
|
43
|
+
//we test ES2019 with it and whether we have missed
|
|
44
|
+
//a map somewhere
|
|
45
|
+
return await defaultMyFaces().then( () => {
|
|
46
|
+
if(Array.prototype.map) {
|
|
47
|
+
oldFlatMap =Array.prototype["flatMap"];
|
|
48
|
+
window["Es2019Array"] = _Es2019Array;
|
|
49
|
+
delete Array.prototype["flatMap"];
|
|
50
|
+
}
|
|
51
|
+
});
|
|
43
52
|
});
|
|
44
53
|
|
|
54
|
+
afterEach(() => {
|
|
55
|
+
if(oldFlatMap) {
|
|
56
|
+
Array.prototype["flatMap"] = oldFlatMap;
|
|
57
|
+
oldFlatMap = null;
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
|
|
45
61
|
it("faces.ajax.request can be called", () => {
|
|
46
62
|
//we stub the addRequestToQueue, to enable the request check only
|
|
47
63
|
//without any xhr and response, both will be tested separately for
|
|
@@ -50,12 +66,15 @@ describe('faces.ajax.request test suite', () => {
|
|
|
50
66
|
//now the faces.ajax.request should trigger but should not go into
|
|
51
67
|
//the asynchronous event loop.
|
|
52
68
|
//lets check it out
|
|
69
|
+
let flatMap = Array.prototype.flatMap;
|
|
53
70
|
|
|
54
71
|
try {
|
|
55
72
|
DomQuery.byId("input_2").addEventListener("click", (event: Event) => {
|
|
56
|
-
|
|
73
|
+
|
|
74
|
+
faces.ajax.request(null, event, {render: '@all', execute: '@form'});
|
|
57
75
|
}).click();
|
|
58
76
|
|
|
77
|
+
|
|
59
78
|
expect(addRequestToQueue.called).to.be.true;
|
|
60
79
|
expect(addRequestToQueue.callCount).to.eq(1);
|
|
61
80
|
const context = (<Config>addRequestToQueue.args[0][2]);
|
|
@@ -103,7 +122,7 @@ describe('faces.ajax.request test suite', () => {
|
|
|
103
122
|
called["func5"] = true;
|
|
104
123
|
return false;
|
|
105
124
|
};
|
|
106
|
-
|
|
125
|
+
delete Array.prototype["flatMap"];
|
|
107
126
|
faces.util.chain(this, called, func1, func2, func3, func4, func5);
|
|
108
127
|
|
|
109
128
|
expect(called["func1"]).to.be.true;
|
|
@@ -118,7 +137,6 @@ describe('faces.ajax.request test suite', () => {
|
|
|
118
137
|
expect(called["func2"]).to.be.true;
|
|
119
138
|
expect(!!called["func4"]).to.be.true;
|
|
120
139
|
expect(!!called["func5"]).to.be.false;
|
|
121
|
-
|
|
122
140
|
});
|
|
123
141
|
|
|
124
142
|
|
|
@@ -17,7 +17,7 @@ import {describe, it} from "mocha";
|
|
|
17
17
|
import * as sinon from "sinon";
|
|
18
18
|
import {expect} from "chai";
|
|
19
19
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
20
|
-
import {DomQuery, DQ} from "mona-dish";
|
|
20
|
+
import {_Es2019Array, DomQuery, DQ} from "mona-dish";
|
|
21
21
|
import defaultFileForm = StandardInits.defaultFileForm;
|
|
22
22
|
import {Implementation} from "../../impl/AjaxImpl";
|
|
23
23
|
|
|
@@ -27,6 +27,7 @@ declare var faces: any;
|
|
|
27
27
|
* specialized tests testing the xhr core behavior when it hits the xmlHttpRequest object
|
|
28
28
|
*/
|
|
29
29
|
describe('Tests on the xhr core when it starts to call the request', function () {
|
|
30
|
+
let oldFlatMap = null;
|
|
30
31
|
beforeEach(async function () {
|
|
31
32
|
|
|
32
33
|
let waitForResult = defaultFileForm();
|
|
@@ -47,6 +48,9 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
47
48
|
};
|
|
48
49
|
(<any>global).XMLHttpRequest = this.xhr;
|
|
49
50
|
window.XMLHttpRequest = this.xhr;
|
|
51
|
+
oldFlatMap =Array.prototype["flatMap"];
|
|
52
|
+
window["Es2019Array"] = _Es2019Array;
|
|
53
|
+
delete Array.prototype["flatMap"];
|
|
50
54
|
|
|
51
55
|
this.closeIt = () => {
|
|
52
56
|
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
@@ -59,6 +63,10 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
59
63
|
});
|
|
60
64
|
afterEach(function () {
|
|
61
65
|
this.closeIt();
|
|
66
|
+
if(oldFlatMap) {
|
|
67
|
+
Array.prototype["flatMap"] = oldFlatMap;
|
|
68
|
+
oldFlatMap = null;
|
|
69
|
+
}
|
|
62
70
|
});
|
|
63
71
|
|
|
64
72
|
it('must have sent a form multipart request', function (done) {
|
|
@@ -18,7 +18,7 @@ import {describe, it} from "mocha";
|
|
|
18
18
|
import * as sinon from "sinon";
|
|
19
19
|
import {expect} from "chai";
|
|
20
20
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
21
|
-
import {DomQuery, DQ$, Stream} from "mona-dish";
|
|
21
|
+
import {_Es2019Array, DomQuery, DQ$, Stream} from "mona-dish";
|
|
22
22
|
import {
|
|
23
23
|
$nsp,
|
|
24
24
|
COMPLETE,
|
|
@@ -50,6 +50,7 @@ let issueStdReq = function (element) {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
describe('Namespacing tests', function () {
|
|
53
|
+
let oldFlatMap = null;
|
|
53
54
|
beforeEach(async function () {
|
|
54
55
|
|
|
55
56
|
let waitForResult = defaultMyFacesNamespaces();
|
|
@@ -65,6 +66,9 @@ describe('Namespacing tests', function () {
|
|
|
65
66
|
window.XMLHttpRequest = this.xhr;
|
|
66
67
|
|
|
67
68
|
this.jsfAjaxResponse = sinon.spy((<any>global).faces.ajax, "response");
|
|
69
|
+
oldFlatMap =Array.prototype["flatMap"];
|
|
70
|
+
window["Es2019Array"] = _Es2019Array;
|
|
71
|
+
delete Array.prototype["flatMap"];
|
|
68
72
|
|
|
69
73
|
this.closeIt = () => {
|
|
70
74
|
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
@@ -77,6 +81,10 @@ describe('Namespacing tests', function () {
|
|
|
77
81
|
|
|
78
82
|
afterEach(function () {
|
|
79
83
|
this.closeIt();
|
|
84
|
+
if(oldFlatMap) {
|
|
85
|
+
Array.prototype["flatMap"] = oldFlatMap;
|
|
86
|
+
oldFlatMap = null;
|
|
87
|
+
}
|
|
80
88
|
});
|
|
81
89
|
|
|
82
90
|
it('must send the element identifiers properly encoded', function () {
|
|
@@ -19,11 +19,11 @@ import * as sinon from "sinon";
|
|
|
19
19
|
import {Implementation} from "../../impl/AjaxImpl";
|
|
20
20
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
21
21
|
import defaultMyFaces = StandardInits.defaultMyFaces;
|
|
22
|
-
import {DQ, DQ$} from "mona-dish";
|
|
22
|
+
import {_Es2019Array, DQ, DQ$} from "mona-dish";
|
|
23
23
|
import {expect} from "chai";
|
|
24
24
|
|
|
25
25
|
describe('Tests for the MyFaces specifig oam submit', function () {
|
|
26
|
-
|
|
26
|
+
let oldFlatMap = null;
|
|
27
27
|
beforeEach(async function () {
|
|
28
28
|
|
|
29
29
|
let waitForResult = defaultMyFaces();
|
|
@@ -39,6 +39,9 @@ describe('Tests for the MyFaces specifig oam submit', function () {
|
|
|
39
39
|
window.XMLHttpRequest = this.xhr;
|
|
40
40
|
|
|
41
41
|
this.jsfAjaxResponse = sinon.spy((<any>global).faces.ajax, "response");
|
|
42
|
+
oldFlatMap =Array.prototype["flatMap"];
|
|
43
|
+
window["Es2019Array"] = _Es2019Array;
|
|
44
|
+
delete Array.prototype["flatMap"];
|
|
42
45
|
|
|
43
46
|
this.closeIt = () => {
|
|
44
47
|
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
@@ -51,6 +54,10 @@ describe('Tests for the MyFaces specifig oam submit', function () {
|
|
|
51
54
|
|
|
52
55
|
afterEach(function () {
|
|
53
56
|
this.closeIt();
|
|
57
|
+
if(oldFlatMap) {
|
|
58
|
+
Array.prototype["flatMap"] = oldFlatMap;
|
|
59
|
+
oldFlatMap = null;
|
|
60
|
+
}
|
|
54
61
|
});
|
|
55
62
|
|
|
56
63
|
it(("must handle oam submit correctly, tuples"), (done) => {
|
|
@@ -18,7 +18,7 @@ import {describe, it} from "mocha";
|
|
|
18
18
|
import * as sinon from "sinon";
|
|
19
19
|
import {expect} from "chai";
|
|
20
20
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
21
|
-
import {DomQuery} from "mona-dish";
|
|
21
|
+
import {_Es2019Array, DomQuery} from "mona-dish";
|
|
22
22
|
import {
|
|
23
23
|
COMPLETE, EMPTY_STR,
|
|
24
24
|
P_AJAX,
|
|
@@ -72,7 +72,7 @@ let issueStdPPSReq = function (element) {
|
|
|
72
72
|
* specialized tests testing the xhr core behavior when it hits the xmlHttpRequest object
|
|
73
73
|
*/
|
|
74
74
|
describe('Tests on the xhr core when it starts to call the request', function () {
|
|
75
|
-
|
|
75
|
+
let oldFlatMap = null;
|
|
76
76
|
beforeEach(async function () {
|
|
77
77
|
|
|
78
78
|
let waitForResult = defaultMyFaces();
|
|
@@ -88,6 +88,9 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
88
88
|
window.XMLHttpRequest = this.xhr;
|
|
89
89
|
|
|
90
90
|
this.jsfAjaxResponse = sinon.spy((<any>global).faces.ajax, "response");
|
|
91
|
+
oldFlatMap =Array.prototype["flatMap"];
|
|
92
|
+
window["Es2019Array"] = _Es2019Array;
|
|
93
|
+
delete Array.prototype["flatMap"];
|
|
91
94
|
|
|
92
95
|
this.closeIt = () => {
|
|
93
96
|
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
@@ -100,6 +103,10 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
100
103
|
|
|
101
104
|
afterEach(function () {
|
|
102
105
|
this.closeIt();
|
|
106
|
+
if(oldFlatMap) {
|
|
107
|
+
Array.prototype["flatMap"] = oldFlatMap;
|
|
108
|
+
oldFlatMap = null;
|
|
109
|
+
}
|
|
103
110
|
});
|
|
104
111
|
|
|
105
112
|
it('must have the standard parameters all in', function (done) {
|
|
@@ -21,7 +21,7 @@ import * as sinon from "sinon";
|
|
|
21
21
|
|
|
22
22
|
import {XmlResponses} from "../frameworkBase/_ext/shared/XmlResponses";
|
|
23
23
|
import {expect} from "chai";
|
|
24
|
-
import {DomQuery, DQ, DQ$} from "mona-dish";
|
|
24
|
+
import {_Es2019Array, DomQuery, DQ, DQ$} from "mona-dish";
|
|
25
25
|
import protocolPage = StandardInits.protocolPage;
|
|
26
26
|
|
|
27
27
|
|
|
@@ -35,7 +35,7 @@ declare var Implementation: any;
|
|
|
35
35
|
* we do not need to go through the entire ajax cycle for that.
|
|
36
36
|
*/
|
|
37
37
|
describe('Tests of the various aspects of the response protocol functionality', function () {
|
|
38
|
-
|
|
38
|
+
let oldFlatMap = null;
|
|
39
39
|
beforeEach(async function () {
|
|
40
40
|
let waitForResult = protocolPage();
|
|
41
41
|
return waitForResult.then((close) => {
|
|
@@ -55,6 +55,9 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
55
55
|
};
|
|
56
56
|
(<any>global).XMLHttpRequest = this.xhr;
|
|
57
57
|
window.XMLHttpRequest = this.xhr;
|
|
58
|
+
oldFlatMap =Array.prototype["flatMap"];
|
|
59
|
+
window["Es2019Array"] = _Es2019Array;
|
|
60
|
+
delete Array.prototype["flatMap"];
|
|
58
61
|
|
|
59
62
|
this.closeIt = () => {
|
|
60
63
|
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
@@ -66,6 +69,10 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
66
69
|
|
|
67
70
|
afterEach(function () {
|
|
68
71
|
this.closeIt();
|
|
72
|
+
if(oldFlatMap) {
|
|
73
|
+
Array.prototype["flatMap"] = oldFlatMap;
|
|
74
|
+
oldFlatMap = null;
|
|
75
|
+
}
|
|
69
76
|
});
|
|
70
77
|
|
|
71
78
|
it("must have a simple field updated as well as the viewstate", function (done) {
|
|
@@ -17,7 +17,7 @@ import {describe, it} from "mocha";
|
|
|
17
17
|
import * as sinon from "sinon";
|
|
18
18
|
import {expect} from "chai";
|
|
19
19
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
20
|
-
import {DomQuery} from "mona-dish";
|
|
20
|
+
import {_Es2019Array, DomQuery} from "mona-dish";
|
|
21
21
|
import {Implementation} from "../../impl/AjaxImpl";
|
|
22
22
|
import defaultFileForm = StandardInits.tobagoFileForm;
|
|
23
23
|
|
|
@@ -27,6 +27,7 @@ declare var faces: any;
|
|
|
27
27
|
* specialized tests testing the xhr core behavior when it hits the xmlHttpRequest object
|
|
28
28
|
*/
|
|
29
29
|
describe('Tests on the xhr core when it starts to call the request', function () {
|
|
30
|
+
let oldFlatMap = null;
|
|
30
31
|
beforeEach(async function () {
|
|
31
32
|
|
|
32
33
|
let waitForResult = defaultFileForm();
|
|
@@ -47,11 +48,18 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
47
48
|
};
|
|
48
49
|
(<any>global).XMLHttpRequest = this.xhr;
|
|
49
50
|
window.XMLHttpRequest = this.xhr;
|
|
51
|
+
oldFlatMap =Array.prototype["flatMap"];
|
|
52
|
+
window["Es2019Array"] = _Es2019Array;
|
|
53
|
+
delete Array.prototype["flatMap"];
|
|
50
54
|
|
|
51
55
|
this.closeIt = () => {
|
|
52
56
|
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
53
57
|
Implementation.reset();
|
|
54
58
|
close();
|
|
59
|
+
if(oldFlatMap) {
|
|
60
|
+
Array.prototype["flatMap"] = oldFlatMap;
|
|
61
|
+
oldFlatMap = null;
|
|
62
|
+
}
|
|
55
63
|
}
|
|
56
64
|
});
|
|
57
65
|
|
|
@@ -21,16 +21,16 @@ import {Implementation} from "../../impl/AjaxImpl";
|
|
|
21
21
|
import {expect} from "chai";
|
|
22
22
|
|
|
23
23
|
import defaultMyFaces = StandardInits.defaultMyFaces;
|
|
24
|
-
import {Lang} from "mona-dish";
|
|
24
|
+
import {_Es2019Array, Lang} from "mona-dish";
|
|
25
25
|
import {FakeWebsocket} from "./FakeWebsocket";
|
|
26
26
|
import assertType = Lang.assertType;
|
|
27
27
|
|
|
28
28
|
declare var faces: any;
|
|
29
29
|
|
|
30
30
|
describe('Tests the jsf websocket client side api on high level (generic test without any myfaces dependencies', function () {
|
|
31
|
-
|
|
31
|
+
let oldFlatMap = null;
|
|
32
32
|
beforeEach(async function () {
|
|
33
|
-
|
|
33
|
+
let oldFlatMap = null;
|
|
34
34
|
let waitForResult = defaultMyFaces();
|
|
35
35
|
|
|
36
36
|
return waitForResult.then((close) => {
|
|
@@ -51,6 +51,9 @@ describe('Tests the jsf websocket client side api on high level (generic test wi
|
|
|
51
51
|
|
|
52
52
|
this.pushImpl = (<any>global).PushImpl;
|
|
53
53
|
this.initSpy = sinon.spy(this.pushImpl, "init");
|
|
54
|
+
oldFlatMap =Array.prototype["flatMap"];
|
|
55
|
+
window["Es2019Array"] = _Es2019Array;
|
|
56
|
+
delete Array.prototype["flatMap"];
|
|
54
57
|
|
|
55
58
|
this.closeIt = () => {
|
|
56
59
|
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
@@ -67,6 +70,10 @@ describe('Tests the jsf websocket client side api on high level (generic test wi
|
|
|
67
70
|
|
|
68
71
|
afterEach(function () {
|
|
69
72
|
this.closeIt();
|
|
73
|
+
if(oldFlatMap) {
|
|
74
|
+
Array.prototype["flatMap"] = oldFlatMap;
|
|
75
|
+
oldFlatMap = null;
|
|
76
|
+
}
|
|
70
77
|
});
|
|
71
78
|
|
|
72
79
|
it("must register a channel", function (done: Function) {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import {describe, it} from 'mocha';
|
|
18
|
-
import {DQ} from "mona-dish";
|
|
18
|
+
import {_Es2019Array, DQ} from "mona-dish";
|
|
19
19
|
import * as sinon from 'sinon';
|
|
20
20
|
import {XhrFormData} from "../../impl/xhrCore/XhrFormData";
|
|
21
21
|
import {expect} from "chai";
|
|
@@ -27,7 +27,7 @@ const jsdom = require("jsdom");
|
|
|
27
27
|
const {JSDOM} = jsdom;
|
|
28
28
|
|
|
29
29
|
describe('XhrFormData tests', function () {
|
|
30
|
-
|
|
30
|
+
let oldFlatMap = null;
|
|
31
31
|
beforeEach(async function () {
|
|
32
32
|
|
|
33
33
|
let waitForResult = defaultMyFaces();
|
|
@@ -43,12 +43,19 @@ describe('XhrFormData tests', function () {
|
|
|
43
43
|
window.XMLHttpRequest = this.xhr;
|
|
44
44
|
|
|
45
45
|
this.jsfAjaxResponse = sinon.spy((<any>global).faces.ajax, "response");
|
|
46
|
+
oldFlatMap =Array.prototype["flatMap"];
|
|
47
|
+
window["Es2019Array"] = _Es2019Array;
|
|
48
|
+
delete Array.prototype["flatMap"];
|
|
46
49
|
|
|
47
50
|
this.closeIt = () => {
|
|
48
51
|
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
49
52
|
this.jsfAjaxResponse.restore();
|
|
50
53
|
Implementation.reset();
|
|
51
54
|
close();
|
|
55
|
+
if(oldFlatMap) {
|
|
56
|
+
Array.prototype["flatMap"] = oldFlatMap;
|
|
57
|
+
oldFlatMap = null;
|
|
58
|
+
}
|
|
52
59
|
}
|
|
53
60
|
});
|
|
54
61
|
});
|
package/target/impl/AjaxImpl.js
CHANGED
|
@@ -442,13 +442,13 @@ var Implementation;
|
|
|
442
442
|
* window ids must be present in all forms
|
|
443
443
|
* or non-existent. If they exist all of them must be the same
|
|
444
444
|
*/
|
|
445
|
-
let formWindowId = inputs.
|
|
445
|
+
let formWindowId = inputs.asArray.map(getValue).reduce(differenceCheck, INIT);
|
|
446
446
|
//if the resulting window id is set on altered then we have an unresolvable problem
|
|
447
|
-
assert(ALTERED != formWindowId
|
|
447
|
+
assert(ALTERED != formWindowId, "Multiple different windowIds found in document");
|
|
448
448
|
/*
|
|
449
449
|
* return the window id or null
|
|
450
450
|
*/
|
|
451
|
-
return formWindowId
|
|
451
|
+
return formWindowId != INIT ? formWindowId : (fetchWindowIdFromURL() || fetchWindowIdFromJSFJS());
|
|
452
452
|
}
|
|
453
453
|
Implementation.getClientWindow = getClientWindow;
|
|
454
454
|
/**
|