@processmaker/screen-builder 3.8.43 → 3.8.44

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": "3.8.43",
3
+ "version": "3.8.44",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -62,7 +62,7 @@
62
62
  "@originjs/vite-plugin-commonjs": "^1.0.3",
63
63
  "@panter/vue-i18next": "^0.15.2",
64
64
  "@processmaker/vue-form-elements": "0.65.11",
65
- "@processmaker/vue-multiselect": "2.3.2",
65
+ "@processmaker/vue-multiselect": "2.3.3",
66
66
  "@storybook/addon-essentials": "^7.6.13",
67
67
  "@storybook/addon-interactions": "^7.6.13",
68
68
  "@storybook/addon-links": "^7.6.13",
@@ -154,5 +154,10 @@
154
154
  ".js",
155
155
  ".vue"
156
156
  ]
157
+ },
158
+ "processmaker": {
159
+ "downstream": [
160
+ "modeler"
161
+ ]
157
162
  }
158
163
  }
@@ -17,7 +17,7 @@
17
17
  <CollectionRecordsList
18
18
  v-model="collectionFields"
19
19
  :record-pmql="pmql"
20
- @change="collectionChanged"
20
+ @collection-id-changed="collectionIdChanged"
21
21
  />
22
22
  <pmql-input
23
23
  v-model="pmql"
@@ -39,6 +39,7 @@
39
39
  v-model="dataSelectionOptions"
40
40
  :options="dataSelectionDisplayOptions"
41
41
  data-cy="inspector-collection-data-selection"
42
+ @change="dataSelectionChanged"
42
43
  />
43
44
  <small class="mt-3 form-text text-muted">
44
45
  {{ $t("The user can select specific data to be stored into a variable") }}
@@ -47,7 +48,7 @@
47
48
  <label for="single-columns">{{ $t("Column") }}</label>
48
49
  <b-form-select
49
50
  id="single-columns"
50
- v-model="singleField"
51
+ v-model="normalizedSingleField"
51
52
  :options="singleFieldOptions"
52
53
  data-cy="inspector-collection-single-field"
53
54
  >
@@ -58,9 +59,11 @@
58
59
  </div>
59
60
  </template>
60
61
  <script>
61
- import { cloneDeep } from "lodash";
62
62
  import CollectionRecordsList from "./collection-records-list.vue";
63
- import { getCollectionFieldOptions } from "../../collectionFieldUtils";
63
+ import {
64
+ getCollectionFieldOptions,
65
+ normalizeCollectionFieldPath
66
+ } from "../../collectionFieldUtils";
64
67
 
65
68
  const CONFIG_FIELDS = [
66
69
  "collectionFields",
@@ -124,6 +127,14 @@ export default {
124
127
  return Object.fromEntries(
125
128
  CONFIG_FIELDS.map((field) => [field, this[field]])
126
129
  );
130
+ },
131
+ normalizedSingleField: {
132
+ get() {
133
+ return normalizeCollectionFieldPath(this.singleField);
134
+ },
135
+ set(value) {
136
+ this.singleField = value;
137
+ }
127
138
  }
128
139
  },
129
140
  watch: {
@@ -133,6 +144,7 @@ export default {
133
144
  return;
134
145
  }
135
146
  CONFIG_FIELDS.forEach((field) => (this[field] = value[field]));
147
+ this.getCollectionColumns(this.collectionFields);
136
148
  },
137
149
  immediate: true
138
150
  },
@@ -161,9 +173,6 @@ export default {
161
173
  this.$emit("input", this.options);
162
174
  },
163
175
  deep: true
164
- },
165
- dataSelectionOptions() {
166
- this.singleField = null;
167
176
  }
168
177
  },
169
178
  mounted() {
@@ -176,14 +185,11 @@ export default {
176
185
  this.pmql = null;
177
186
  this.$root.$emit("collection-changed", true);
178
187
  },
179
- collectionChanged(data) {
180
- if (Array.isArray(data)) {
181
- const [firstItem] = data;
182
- const collectionId = firstItem?.collection_id;
183
- if (collectionId !== this.collectionFields.collectionId) {
184
- this.$root.$emit("collection-changed", true);
185
- }
186
- }
188
+ collectionIdChanged() {
189
+ this.$root.$emit("collection-changed", true);
190
+ },
191
+ dataSelectionChanged() {
192
+ this.singleField = null;
187
193
  },
188
194
  getCollectionColumns(records) {
189
195
  this.singleFieldOptions = getCollectionFieldOptions(records);
@@ -8,6 +8,7 @@
8
8
  v-model="collectionId"
9
9
  :options="collections"
10
10
  data-cy="inspector-collection"
11
+ @change="onCollectionIdChange"
11
12
  />
12
13
  <b-form-text class="mt-2">
13
14
  {{ $t("Collection Record Control is not available for Anonymous Web Entry") }}
@@ -29,8 +30,6 @@
29
30
 
30
31
  <script>
31
32
  import { debounce } from "lodash";
32
- import MustacheHelper from "./mustache-helper.vue";
33
- import ScreenVariableSelector from "../screen-variable-selector.vue";
34
33
 
35
34
  const CONFIG_FIELDS = [
36
35
  "collectionId",
@@ -40,10 +39,6 @@ const CONFIG_FIELDS = [
40
39
  ];
41
40
 
42
41
  export default {
43
- components: {
44
- MustacheHelper,
45
- ScreenVariableSelector
46
- },
47
42
  props: ["value"],
48
43
  data() {
49
44
  return {
@@ -111,13 +106,15 @@ export default {
111
106
  });
112
107
  },
113
108
  methods: {
114
- onCollectionChange() {
109
+ onCollectionIdChange(collectionId) {
110
+ this.$emit("collection-id-changed", collectionId);
111
+ },
112
+ loadCollectionRecords() {
115
113
  this.$dataProvider
116
114
  .getCollectionRecordsList(this.collectionId)
117
115
  .then((response) => {
118
116
  this.dataRecordList = response.data;
119
117
  });
120
- this.$emit('change', this.dataRecordList);
121
118
  },
122
119
  getCollections() {
123
120
  this.$dataProvider.getCollections().then((response) => {
@@ -158,7 +155,7 @@ export default {
158
155
  value: field.field
159
156
  }));
160
157
 
161
- this.onCollectionChange();
158
+ this.loadCollectionRecords();
162
159
  });
163
160
  },
164
161
  onNLQConversion(pmql) {
@@ -0,0 +1,6 @@
1
+ export default function resolveCollectionMode(
2
+ collectionMode,
3
+ defaultMode = "Edit"
4
+ ) {
5
+ return collectionMode?.modeId ?? defaultMode;
6
+ }
@@ -17,6 +17,7 @@
17
17
  import _ from "lodash";
18
18
  import VueFormRenderer from "../vue-form-renderer.vue";
19
19
  import CollectionRecordsList from "../inspector/collection-records-list.vue";
20
+ import resolveCollectionMode from "./collection-record-mode";
20
21
 
21
22
  const globalObject = typeof window === "undefined" ? global : window;
22
23
 
@@ -120,7 +121,7 @@ export default {
120
121
  this.loadRecordCollection(
121
122
  this.collection.collectionId,
122
123
  record,
123
- this.selDisplayMode
124
+ this.getCollectionMode()
124
125
  );
125
126
  } else {
126
127
  if (this.isMustache(record)) {
@@ -154,7 +155,7 @@ export default {
154
155
  this.hasMustache = true;
155
156
  }
156
157
 
157
- const collectionMode = this.collectionmode?.modeId ?? this.defaultCollectionMode;
158
+ const collectionMode = this.getCollectionMode();
158
159
 
159
160
  this.loadRecordCollection(
160
161
  this.collection.collectionId,
@@ -164,6 +165,12 @@ export default {
164
165
  }
165
166
  },
166
167
  methods: {
168
+ getCollectionMode() {
169
+ return resolveCollectionMode(
170
+ this.collectionmode,
171
+ this.defaultCollectionMode
172
+ );
173
+ },
167
174
  isSubmitButton(item) {
168
175
  return (
169
176
  item.config &&