@processmaker/screen-builder 3.8.26 → 3.8.27

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.26",
3
+ "version": "3.8.27",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -341,6 +341,9 @@ export default {
341
341
  },
342
342
  ],
343
343
  valueTypeReturned: '',
344
+ assetType: null,
345
+ assetTypeResolved: false,
346
+ screenId: null,
344
347
  };
345
348
  },
346
349
  watch: {
@@ -504,9 +507,37 @@ export default {
504
507
  monacoMounted(editor) {
505
508
  editor.getAction('editor.action.formatDocument').run();
506
509
  },
507
- getDataSourceList() {
510
+ resolveAssetType() {
511
+ if (this.assetTypeResolved) {
512
+ return Promise.resolve(this.assetType);
513
+ }
514
+ const match = window.location.pathname.match(/screen-builder\/(\d+)\/edit/);
515
+ if (!match) {
516
+ this.assetTypeResolved = true;
517
+ return Promise.resolve(this.assetType);
518
+ }
519
+ this.screenId = match[1];
520
+ return this.$dataProvider
521
+ .get(`/screens/${this.screenId}`)
522
+ .then(response => {
523
+ this.assetType = response.data.asset_type || null;
524
+ this.assetTypeResolved = true;
525
+ return this.assetType;
526
+ })
527
+ .catch(() => {
528
+ this.assetTypeResolved = true;
529
+ return this.assetType;
530
+ });
531
+ },
532
+ async getDataSourceList() {
533
+ await this.resolveAssetType();
534
+ const params = {};
535
+ if (this.assetType) {
536
+ // For PM Block screens, expose both regular and PM Block connectors.
537
+ params.asset_type = this.assetType === 'PM_BLOCK' ? 'all' : this.assetType;
538
+ }
508
539
  this.$dataProvider
509
- .get('/data_sources')
540
+ .get('/data_sources', { params })
510
541
  .then(response => {
511
542
  let jsonData = response.data.data;
512
543
  // Map the data sources response to value/text items list