@processmaker/screen-builder 2.83.2 → 2.83.3

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.
@@ -18,6 +18,8 @@
18
18
  </template>
19
19
 
20
20
  <script>
21
+ import VueFormRenderer from '../vue-form-renderer.vue';
22
+
21
23
  const globalObject = typeof window === 'undefined'
22
24
  ? global
23
25
  : window;
@@ -30,6 +32,9 @@ const defaultConfig = [
30
32
  ];
31
33
 
32
34
  export default {
35
+ components:{
36
+ VueFormRenderer
37
+ },
33
38
  props: {
34
39
  name: String,
35
40
  screen: Number,
@@ -42,9 +42,13 @@
42
42
  <template v-else-if="isImage(field, item)">
43
43
  <img :src="mustache(field.key, item)" style="record-list-image" />
44
44
  </template>
45
+ <template v-else-if="isWebEntryFile(field, item)">
46
+ {{ formatIfWebEntryFile(field, item) }}
47
+ </template>
45
48
  <template v-else>
46
49
  {{ formatIfDate(mustache(field.key, item)) }}
47
50
  </template>
51
+
48
52
  </template>
49
53
  <template #cell(__actions)="{ index, item }">
50
54
  <div class="actions">
@@ -180,6 +184,7 @@
180
184
  <script>
181
185
  import _ from "lodash";
182
186
  import { dateUtils } from "@processmaker/vue-form-elements";
187
+ import VueFormRenderer from "@/components/vue-form-renderer.vue";
183
188
  import mustacheEvaluation from "../../mixins/mustacheEvaluation";
184
189
 
185
190
  const jsonOptionsActionsColumn = {
@@ -190,6 +195,9 @@ const jsonOptionsActionsColumn = {
190
195
  };
191
196
 
192
197
  export default {
198
+ components: {
199
+ VueFormRenderer
200
+ },
193
201
  mixins: [mustacheEvaluation],
194
202
  props: [
195
203
  "name",
@@ -341,6 +349,23 @@ export default {
341
349
  typeof content === "string" && content.substr(0, 11) === "data:image/"
342
350
  );
343
351
  },
352
+ isWebEntryFile(field, item) {
353
+ const content = _.get(item, field.key);
354
+ const regex = /^webentry_.*:*$/;
355
+ let checkWebEntryValue = content;
356
+
357
+ if (Array.isArray(content)) {
358
+ checkWebEntryValue = content[0].file;
359
+ }
360
+
361
+ return regex.test(checkWebEntryValue);
362
+ },
363
+ formatIfWebEntryFile(field, item) {
364
+ const requestFiles = _.get(window, "PM4ConfigOverrides.requestFiles", {});
365
+ const fileInfo = requestFiles[`${field.key}.${item.row_id}`];
366
+
367
+ return fileInfo.map((file) => file.file_name).join(", ");
368
+ },
344
369
  isFiledownload(field) {
345
370
  return field.key === "__filedownload";
346
371
  },
@@ -35,10 +35,11 @@ import { getItemsFromConfig } from "../itemProcessingUtils";
35
35
  import { ValidatorFactory } from "../factories/ValidatorFactory";
36
36
  import CurrentPageProperty from "../mixins/CurrentPageProperty";
37
37
  import DeviceDetector, { MAX_MOBILE_WIDTH } from "../mixins/DeviceDetector";
38
+ import ScreenRenderer from "@/components/screen-renderer.vue";
38
39
 
39
40
  export default {
40
41
  name: "VueFormRenderer",
41
- components: { CustomCssOutput },
42
+ components: { ScreenRenderer, CustomCssOutput },
42
43
  mixins: [CurrentPageProperty, DeviceDetector],
43
44
  model: {
44
45
  prop: "data",
package/src/main.js CHANGED
@@ -269,7 +269,7 @@ window.Echo = {
269
269
 
270
270
  window.axios = axios.create({
271
271
  baseURL: "/api/1.0/",
272
- adapter: cacheAdapterEnhancer(axios.defaults.adapter, {
272
+ adapter: cacheAdapterEnhancer(axios.getAdapter(axios.defaults.adapter), {
273
273
  enabledByDefault: window.ProcessMaker.screen.cacheEnabled,
274
274
  cacheFlag: "useCache",
275
275
  defaultCache: new LRUCache({
@@ -279,7 +279,9 @@ window.axios = axios.create({
279
279
  })
280
280
  });
281
281
 
282
- const scenario = (window.location.search.substr(1).match(/\w+=(\w+)/) || [])[1];
282
+ const searchParams = new URLSearchParams(window.location.search);
283
+
284
+ const scenario = searchParams?.get("scenario");
283
285
  if (scenario) {
284
286
  if (!TestComponents[scenario]) {
285
287
  // eslint-disable-next-line no-console