@platforma-sdk/ui-vue 1.8.14 → 1.8.17

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": "@platforma-sdk/ui-vue",
3
- "version": "1.8.14",
3
+ "version": "1.8.17",
4
4
  "type": "module",
5
5
  "main": "dist/lib.umd.cjs",
6
6
  "module": "dist/lib.js",
@@ -4,7 +4,7 @@ import type { OutputErrors } from '../../types';
4
4
  // @TODO module
5
5
  import './pl-app-error-notification-alert.scss';
6
6
  import { PlBtnPrimary, PlDialogModal, PlNotificationAlert, PlSpacer, PlCopyData } from '@milaboratories/uikit';
7
- import { ref, watch } from 'vue';
7
+ import { computed, ref, watch } from 'vue';
8
8
 
9
9
  const props = defineProps<{ errors: OutputErrors<BlockOutputsBase> }>();
10
10
 
@@ -12,6 +12,8 @@ const isModalOpen = ref(false);
12
12
 
13
13
  const isAlertOpen = ref(true);
14
14
 
15
+ const existingErrors = computed(() => Object.entries(props.errors).filter((item) => !!item[1]));
16
+
15
17
  function showErrors() {
16
18
  isModalOpen.value = true;
17
19
  }
@@ -36,15 +38,17 @@ watch(
36
38
  <PlDialogModal v-model="isModalOpen" width="50%" style="max-height: 100vh">
37
39
  <template #title> Errors </template>
38
40
  <div class="pl-app-notification-alert__content">
39
- <div v-for="(err, name) in errors" :key="name" class="pl-app-notification-alert__item">
40
- <div class="pl-app-notification-alert__title">{{ name }}</div>
41
- <div class="pl-app-notification-alert__error-description">
42
- <code>
43
- {{ err?.message }}
44
- </code>
45
- <PlCopyData class="pl-app-notification-alert__copy-icon" @copy-data="copyData(err)" />
41
+ <template v-for="item in existingErrors" :key="item[0]">
42
+ <div class="pl-app-notification-alert__item">
43
+ <div class="pl-app-notification-alert__title">{{ item[0] }}</div>
44
+ <div class="pl-app-notification-alert__error-description">
45
+ <code>
46
+ {{ item[1]?.message }}
47
+ </code>
48
+ <PlCopyData class="pl-app-notification-alert__copy-icon" @copy-data="copyData(item[1])" />
49
+ </div>
46
50
  </div>
47
- </div>
51
+ </template>
48
52
  </div>
49
53
  </PlDialogModal>
50
54