@processmaker/screen-builder 3.0.4 → 3.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/screen-builder",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -61,7 +61,8 @@ export default {
61
61
  screenType: "",
62
62
  hasMustache: false,
63
63
  flagDraft: {},
64
- taskDraft: {}
64
+ taskDraft: {},
65
+ enableDraft: true
65
66
  };
66
67
  },
67
68
  computed: {
@@ -167,7 +168,6 @@ export default {
167
168
  this.selCollectionId = collectionId;
168
169
  this.selRecordId = recordId;
169
170
  this.selDisplayMode = modeId;
170
-
171
171
  this.$dataProvider
172
172
  .getCollectionRecordsView(collectionId, recordId)
173
173
  .then((response) => {
@@ -176,22 +176,25 @@ export default {
176
176
  const viewScreen = response.collection.read_screen_id;
177
177
  const editScreen = response.collection.update_screen_id;
178
178
  //Choose screen id regarding of the display Mode
179
- this.screenCollectionId =
180
- this.selDisplayMode === "View" ? viewScreen : editScreen;
181
-
179
+ this.screenCollectionId =
180
+ typeof this.selDisplayMode === 'function' ?
181
+ (this.collectionmode.modeId === "View" ? viewScreen : editScreen) :
182
+ (this.selDisplayMode === "View" ? viewScreen : editScreen);
182
183
  this.loadScreen(this.screenCollectionId);
183
184
 
184
185
  //This section validates if Collection has draft data
185
- if(this.taskDraft?.draft?.data == null || this.taskDraft.draft.data === '') {
186
+ if (this.taskDraft?.draft?.data == null || this.taskDraft.draft.data === '' || !this.enableDraft)
187
+ {
186
188
  this.localData = respData;
187
189
  }else{
188
190
  this.localData = _.merge({}, respData, this.taskDraft.draft.data);
189
191
  }
190
-
192
+
191
193
  })
192
194
  .catch(() => {
193
195
  this.localData = {};
194
196
  globalObject.ProcessMaker.alert(this.$t('This content does not exist. We could not locate indicated data'), "danger");
197
+ this.placeholder = "Select a collection";
195
198
  });;
196
199
  },
197
200
  isMustache(record) {
@@ -213,6 +216,7 @@ export default {
213
216
  },
214
217
  record(record) {
215
218
  this.hasMustache = false;
219
+ this.enableDraft = false;
216
220
  if (record && !isNaN(record) && record > 0 && this.collection.collectionId) {
217
221
  this.selRecordId = record;
218
222
  this.loadRecordCollection(this.collection.collectionId, record, this.selDisplayMode);
@@ -160,12 +160,12 @@ export default {
160
160
  },
161
161
  watch: {
162
162
  listOption() {
163
- this.title = this.checkTitle(this.listOption);
163
+ this.title = this.$t(this.checkTitle(this.listOption));
164
164
  this.dataControl = {};
165
165
  }
166
166
  },
167
167
  mounted() {
168
- this.title = this.checkTitle(this.listOption);
168
+ this.title = this.$t(this.checkTitle(this.listOption));
169
169
  },
170
170
  methods: {
171
171
  /**
@@ -17,7 +17,7 @@
17
17
  </div>
18
18
  </div>
19
19
  <div v-else>
20
- <formEmpty link="" title="No Case to Start" url="" />
20
+ <formEmpty link="" :title="$t('No Case to Start')" url="" />
21
21
  </div>
22
22
  </div>
23
23
  </template>
@@ -431,20 +431,22 @@ export default {
431
431
  }
432
432
 
433
433
  // Adds radio buttons or checkbox to the table depending selected option
434
- if (['single-field', 'single-record'].includes(this.source?.dataSelectionOptions)) {
435
- fields.unshift({
436
- key: 'radio',
437
- label: '',
438
- sortable: false,
439
- });
440
- }
441
-
442
- if (this.source?.dataSelectionOptions === 'multiple-records') {
443
- fields.unshift({
444
- key: 'checkbox',
445
- label: '',
446
- sortable: false
447
- });
434
+ if(this.source?.sourceOptions === "Collection") {
435
+ if (['single-field', 'single-record'].includes(this.source?.dataSelectionOptions)) {
436
+ fields.unshift({
437
+ key: 'radio',
438
+ label: '',
439
+ sortable: false,
440
+ });
441
+ }
442
+
443
+ if (this.source?.dataSelectionOptions === 'multiple-records') {
444
+ fields.unshift({
445
+ key: 'checkbox',
446
+ label: '',
447
+ sortable: false
448
+ });
449
+ }
448
450
  }
449
451
 
450
452
  return fields;
@@ -70,7 +70,7 @@
70
70
  </filter-table>
71
71
  </div>
72
72
  <div v-else>
73
- <formEmpty link="Requests" title="No Cases to Show" :url="noDataUrl" />
73
+ <formEmpty link="Requests" :title="$t('No Cases to Show')" :url="noDataUrl" />
74
74
  </div>
75
75
  </template>
76
76
 
@@ -481,6 +481,15 @@ export default [
481
481
  jsonData: '',
482
482
  },
483
483
  form: '',
484
+ source: {
485
+ collectionFields: [],
486
+ collectionFieldsColumns: [],
487
+ pmql: null,
488
+ sourceOptions: "Variable",
489
+ variableStore: null,
490
+ dataSelectionOptions: "no-selection",
491
+ singleField: null
492
+ }
484
493
  },
485
494
  inspector: [
486
495
  keyNameProperty,