@processmaker/screen-builder 2.99.3 → 2.99.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": "2.99.3",
3
+ "version": "2.99.5",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -56,7 +56,7 @@
56
56
  "@fortawesome/fontawesome-free": "^5.6.1",
57
57
  "@originjs/vite-plugin-commonjs": "^1.0.3",
58
58
  "@panter/vue-i18next": "^0.15.2",
59
- "@processmaker/vue-form-elements": "0.60.0",
59
+ "@processmaker/vue-form-elements": "0.60.1",
60
60
  "@processmaker/vue-multiselect": "2.3.0",
61
61
  "@storybook/addon-essentials": "^7.6.13",
62
62
  "@storybook/addon-interactions": "^7.6.13",
@@ -115,7 +115,7 @@
115
115
  },
116
116
  "peerDependencies": {
117
117
  "@panter/vue-i18next": "^0.15.0",
118
- "@processmaker/vue-form-elements": "0.60.0",
118
+ "@processmaker/vue-form-elements": "0.60.1",
119
119
  "i18next": "^15.0.8",
120
120
  "vue": "^2.6.12",
121
121
  "vuex": "^3.1.1"
@@ -461,6 +461,19 @@ export default {
461
461
  this.prefix = parent.loopContext + '.';
462
462
  }
463
463
  },
464
+ validateFile(file, acceptFiles){
465
+ const extensions = acceptFiles.filter(item => item.startsWith('.'));
466
+ const mimeTypes = acceptFiles.filter(item => !item.startsWith('.'));
467
+ const fileExtension = '.' + file.name.split('.').pop().toLowerCase();
468
+ const fileType = file.fileType;
469
+ const isExtensionValid = extensions.includes(fileExtension);
470
+ const isMimeTypeValid = mimeTypes.includes(fileType);
471
+
472
+ if (!isExtensionValid && !isMimeTypeValid) {
473
+ return false;
474
+ }
475
+ return true;
476
+ },
464
477
  addFile(file) {
465
478
  if (this.disabled) {
466
479
  file.ignored = true;
@@ -477,7 +490,7 @@ export default {
477
490
 
478
491
  if (this.filesAccept) {
479
492
  file.ignored = true;
480
- if (this.filesAccept.indexOf(file.fileType) !== -1) {
493
+ if (this.validateFile(file, this.filesAccept)) {
481
494
  file.ignored = false;
482
495
  }
483
496
  if (file.ignored) {
@@ -516,6 +529,10 @@ export default {
516
529
  }
517
530
 
518
531
  if (displayMessage.length > 0) {
532
+ const data = JSON.parse(displayMessage);
533
+ if (data.message) {
534
+ displayMessage = data.message;
535
+ }
519
536
  window.ProcessMaker.alert(`${this.$t('File Upload Error:')} ${displayMessage}`, 'danger');
520
537
  }
521
538
 
@@ -865,6 +865,7 @@ export default {
865
865
 
866
866
  if (
867
867
  elementDestinationValue &&
868
+ elementDestinationValue !== 'taskSource' &&
868
869
  data?.params[0]?.tokenId === this.taskId &&
869
870
  data?.params[0]?.requestStatus === 'ACTIVE'
870
871
  ) {
@@ -96,8 +96,8 @@ export const keyNameProperty = {
96
96
  config: {
97
97
  label: 'Variable Name',
98
98
  name: 'Variable Name',
99
- // Update tests/e2e/specs/Builder.spec.js when changing this
100
- validation: 'regex:/^([a-zA-Z]([a-zA-Z0-9_]?)+\\.?)+(?<!\\.)$/|required|not_in:' + javascriptReservedKeywords,
99
+ // Update tests/e2e/specs/Builder.spec.js when changing dot_notation
100
+ validation: 'dot_notation|required|not_in:' + javascriptReservedKeywords,
101
101
  helper: 'A variable name is a symbolic name to reference information.',
102
102
  },
103
103
  };