glib-web 4.4.0 → 4.4.1
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.
|
@@ -3,13 +3,13 @@ export default class {
|
|
|
3
3
|
const dynamicGroupEntry = component.$closest("fields/internalDynamicGroupEntry");
|
|
4
4
|
if (dynamicGroupEntry) {
|
|
5
5
|
const values = dynamicGroupEntry.$values(spec.paramNameForFieldName || 'entry');
|
|
6
|
-
this.executeOnGet(spec, values)
|
|
6
|
+
this.executeOnGet(spec, values, component)
|
|
7
7
|
} else {
|
|
8
8
|
console.error('Action invoked outside of dynamicGroup')
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
executeOnGet(spec, formData) {
|
|
12
|
+
executeOnGet(spec, formData, component) {
|
|
13
13
|
Utils.type.ifObject(spec.onGet, onGet => {
|
|
14
14
|
const params = {
|
|
15
15
|
// Make sure to pass along the formData from the spec.
|
|
@@ -17,7 +17,7 @@ export default class {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
const data = Object.assign({}, onGet, params);
|
|
20
|
-
GLib.action.execute(data,
|
|
20
|
+
GLib.action.execute(data, component);
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
}
|
package/actions/logics/set.js
CHANGED
|
@@ -25,19 +25,31 @@ export default class {
|
|
|
25
25
|
execute(spec, component) {
|
|
26
26
|
let targetComponent = component;
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
targetComponent =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
const dynamicGroupEntry = component.$closest("fields/internalDynamicGroupEntry");
|
|
29
|
+
const targetIds = spec.targetId ? [spec.targetId] : spec.targetIds
|
|
30
|
+
if (targetIds.length > 0) {
|
|
31
|
+
targetComponent = targetIds.map((id) => {
|
|
32
|
+
if (dynamicGroupEntry) {
|
|
33
|
+
id = dynamicGroupEntry.$populateIndexes(id);
|
|
34
|
+
}
|
|
35
|
+
return GLib.component.findById(id)
|
|
36
|
+
});
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
let data = {};
|
|
38
40
|
Utils.type.ifObject(spec.conditionalData, (properties) => {
|
|
39
41
|
for (const key in properties) {
|
|
40
|
-
|
|
42
|
+
let condition = properties[key];
|
|
43
|
+
if (dynamicGroupEntry) {
|
|
44
|
+
condition = dynamicGroupEntry.$populateIndexes(condition);
|
|
45
|
+
}
|
|
46
|
+
if (spec.debug) {
|
|
47
|
+
console.log("Evaluating...", key, condition);
|
|
48
|
+
}
|
|
49
|
+
data[key] = jsonLogic.apply(condition, Object.assign({}, fieldModels, spec.variables));
|
|
50
|
+
if (spec.debug) {
|
|
51
|
+
console.log("Result: ", key, data[key]);
|
|
52
|
+
}
|
|
41
53
|
}
|
|
42
54
|
});
|
|
43
55
|
Utils.type.ifObject(spec.data, (additionalData) => {
|
package/actions/runMultiple.js
CHANGED
|
@@ -3,9 +3,14 @@ export default class {
|
|
|
3
3
|
return true;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
execute(
|
|
7
|
-
for (const
|
|
8
|
-
|
|
6
|
+
execute(spec, component) {
|
|
7
|
+
for (const actionSpec of spec.childActions) {
|
|
8
|
+
const params = {
|
|
9
|
+
// Make sure to pass along the formData from the spec.
|
|
10
|
+
formData: spec.formData
|
|
11
|
+
}
|
|
12
|
+
const properties = Object.assign({}, actionSpec, params);
|
|
13
|
+
GLib.action.execute(properties, component);
|
|
9
14
|
}
|
|
10
15
|
}
|
|
11
16
|
}
|
package/package.json
CHANGED
|
@@ -48,11 +48,6 @@ export default {
|
|
|
48
48
|
if (spec && spec.id && this.$registryEnabled()) {
|
|
49
49
|
GLib.component.deregister(spec.id, this);
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
// Utils.type.ifString(this.viewId, (viewId) => {
|
|
53
|
-
// console.log("DEREGISTER DATA1", viewId)
|
|
54
|
-
// GLib.component.deregisterData(viewId);
|
|
55
|
-
// })
|
|
56
51
|
},
|
|
57
52
|
$registryEnabled() {
|
|
58
53
|
// Common classes such as `_select` need to return false so that it doesn't override its parent (e.g. `select`).
|