@processmaker/screen-builder 2.61.0 → 2.62.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/screen-builder",
3
- "version": "2.61.0",
3
+ "version": "2.62.0",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -246,11 +246,9 @@ export default {
246
246
  return;
247
247
  }
248
248
 
249
- this.$set(
250
- object,
251
- attr,
252
- setValue,
253
- );
249
+ if (object instanceof Object) {
250
+ this.$set(object, attr, setValue);
251
+ }
254
252
 
255
253
  object = get(object, attr);
256
254
  defaults = get(defaults, attr);
@@ -32,13 +32,17 @@ function countErrors(obj) {
32
32
  }
33
33
 
34
34
  const updateValidationRules = async (screen, commit) => {
35
- const mainScreen = findRootScreen(screen);
35
+ const rootScreen = findRootScreen(screen);
36
+ if (rootScreen !== screen) {
37
+ // refresh nested screen validation rules
38
+ await screen.loadValidationRules();
39
+ }
36
40
  try {
37
- await mainScreen.loadValidationRules();
41
+ await rootScreen.loadValidationRules();
38
42
  } catch (error) {
39
43
  console.warn("There was a problem rendering the screen", error);
40
44
  }
41
- const validate = mainScreen.$v;
45
+ const validate = rootScreen.$v;
42
46
  // update the global error state used by submit buttons
43
47
  if (validate) {
44
48
  let errors = 0;
@@ -50,7 +54,7 @@ const updateValidationRules = async (screen, commit) => {
50
54
  errors === 1
51
55
  ? "There is a validation error in your form."
52
56
  : "There are {{items}} validation errors in your form.";
53
- message = mainScreen.$t(message, { items: errors });
57
+ message = rootScreen.$t(message, { items: errors });
54
58
  }
55
59
  commit("basic", {
56
60
  key: "valid",