bfg-common 1.3.392 → 1.3.394

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.
@@ -40,10 +40,26 @@
40
40
  />
41
41
  <span v-else :class="['icon', item.data.iconClassName]"></span>
42
42
  {{ item.text }}
43
+
44
+ <a
45
+ v-if="false"
46
+ id="sensor-item-warning"
47
+ :data-id="item.data.testId"
48
+ href="javascript:void(0)"
49
+ class="row-details__text"
50
+ @click="onShowFieldWarning(item.data.error)"
51
+ >{{ localization.details }}...
52
+ </a>
43
53
  </template>
44
54
  </atoms-table-data-grid>
45
55
  </div>
46
56
  </div>
57
+
58
+ <common-pages-hardware-health-table-view-modal-sensor-warning
59
+ v-if="isShowSensorWarningDetails"
60
+ :error="sensorWarningError"
61
+ @close-modal="isShowSensorWarningDetails = false"
62
+ />
47
63
  </template>
48
64
 
49
65
  <script lang="ts" setup>
@@ -92,10 +108,32 @@ const headItems = computed<UI_I_HeadItem[]>(() =>
92
108
  )
93
109
 
94
110
  const bodyItems = computed<UI_I_BodyItem[][]>(() => {
95
- const tableData = ['sensor'].includes(props.tableMode) ? props.dataTable : [] // TODO временно так
111
+ // const tableData = ['sensor'].includes(props.tableMode) ? props.dataTable : [] // TODO временно так
112
+ let tableData = props.dataTable
113
+
114
+ switch (props.tableMode) {
115
+ case 'storage-sensor':
116
+ tableData = []
117
+ break
118
+ case 'alert-warning':
119
+ tableData = tableData.filter((sensor: UI_I_HardwareHealthSensors) =>
120
+ [2, 3].includes(sensor.status)
121
+ )
122
+ break
123
+ case 'system-log':
124
+ tableData = []
125
+ break
126
+ }
96
127
 
97
128
  return table[props.tableMode].bodyItems(tableData, localization.value)
98
129
  })
130
+
131
+ const isShowSensorWarningDetails = ref<boolean>(false)
132
+ const sensorWarningError = ref<string | null>(null)
133
+ const onShowFieldWarning = (error: string): void => {
134
+ isShowSensorWarningDetails.value = true
135
+ sensorWarningError.value = error
136
+ }
99
137
  </script>
100
138
 
101
139
  <style lang="scss" scoped>
@@ -126,6 +164,9 @@ const bodyItems = computed<UI_I_BodyItem[][]>(() => {
126
164
  margin-top: 5px;
127
165
  }
128
166
  }
167
+ &__text {
168
+ margin-left: 8px;
169
+ }
129
170
  }
130
171
  .icon {
131
172
  width: 18px;
@@ -9,8 +9,11 @@ import {
9
9
  constructColumnKey,
10
10
  } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
11
11
  import type { UI_I_HardwareHealthAlertWarnings } from '~/components/common/pages/hardwareHealth/tableView/lib/models/interfaces'
12
- // import { E_HostStatusIcon } from '~/components/templates/inventory/treeView/lib/models/enums'
13
12
  import { hardwareHealthAlertWarningTableKeys } from '~/components/common/pages/hardwareHealth/tableView/lib/config/tableKeys'
13
+ import {
14
+ sensorsLocalizationByStatus,
15
+ sensorsIconByStatus,
16
+ } from '~/components/common/pages/hardwareHealth/lib/config/status'
14
17
 
15
18
  const getItems = (
16
19
  localization: UI_I_Localization
@@ -68,7 +71,8 @@ export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
68
71
  }
69
72
 
70
73
  export const bodyItems = (
71
- data: UI_I_HardwareHealthAlertWarnings[]
74
+ data: UI_I_HardwareHealthAlertWarnings[],
75
+ localization: UI_I_Localization
72
76
  ): UI_I_BodyItem[][] => {
73
77
  const bodyItems: UI_I_BodyItem[][] = []
74
78
  data.forEach((sensor: UI_I_HardwareHealthAlertWarnings, key) => {
@@ -81,13 +85,16 @@ export const bodyItems = (
81
85
  },
82
86
  {
83
87
  key: 'icon',
84
- text: sensor[hardwareHealthAlertWarningTableKeys[1]],
88
+ text: localization[
89
+ sensorsLocalizationByStatus[
90
+ sensor[hardwareHealthAlertWarningTableKeys[1]]
91
+ ]
92
+ ],
85
93
  id: key,
86
- // data: {
87
- // iconClassName:
88
- // E_HostStatusIcon[sensor[hardwareHealthAlertWarningTableKeys[1]]],
89
- // },
90
- data: {},
94
+ data: {
95
+ iconClassName: sensorsIconByStatus[sensor.status],
96
+ isSprite: false,
97
+ },
91
98
  testId: `table-item-${key}`,
92
99
  },
93
100
  {
@@ -21,7 +21,7 @@ const getItems = (
21
21
  ): [string, boolean, string, string][] => {
22
22
  return [
23
23
  [localization.sensors, true, '330px', hardwareHealthSensorTableKeys[0]],
24
- [localization.status, true, '110px', hardwareHealthSensorTableKeys[1]],
24
+ [localization.status, true, '140px', hardwareHealthSensorTableKeys[1]],
25
25
  [localization.reading, true, '115px', hardwareHealthSensorTableKeys[2]],
26
26
  [localization.categories, true, '130px', hardwareHealthSensorTableKeys[3]],
27
27
  [localization.lastUpdated, true, '195px', hardwareHealthSensorTableKeys[4]],
@@ -0,0 +1,63 @@
1
+ <template>
2
+ <atoms-modal
3
+ show
4
+ width="580px"
5
+ class="feedback-field"
6
+ :title="localization.theOperationFailed"
7
+ test-id="feedback-filed-modal"
8
+ @hide="onCloseModal"
9
+ >
10
+ <template #modalBody>
11
+ <div class="feedback-field__body">
12
+ <atoms-the-icon name="info" class="feedback-field__icon" />
13
+
14
+ <p class="feedback-field__text">
15
+ {{ props.error }}
16
+ </p>
17
+ </div>
18
+ </template>
19
+
20
+ <template #modalFooter>
21
+ <button
22
+ id="sensor-feedback-field-apply-button"
23
+ data-id="sensor-feedback-field-apply-button"
24
+ class="btn btn-primary"
25
+ @click="onCloseModal"
26
+ >
27
+ {{ localization.ok }}
28
+ </button>
29
+ </template>
30
+ </atoms-modal>
31
+ </template>
32
+
33
+ <script setup lang="ts">
34
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
35
+
36
+ const props = defineProps<{
37
+ error: string
38
+ }>()
39
+ const localization = computed<UI_I_Localization>(() => useLocal())
40
+ const emits = defineEmits<{
41
+ (event: 'close-modal'): void
42
+ }>()
43
+ const onCloseModal = (): void => {
44
+ emits('close-modal')
45
+ }
46
+ </script>
47
+
48
+ <style lang="scss" scoped>
49
+ @import 'assets/scss/common/mixins.scss';
50
+ .feedback-field {
51
+ &__body {
52
+ @include flex($align: center);
53
+ }
54
+ &__icon {
55
+ min-width: 40px;
56
+ height: 40px;
57
+ margin-right: 20px;
58
+ }
59
+ &__text {
60
+ @include text($fs: 14px, $fw: 300);
61
+ }
62
+ }
63
+ </style>
@@ -8,7 +8,20 @@
8
8
  :show-toggle-button="props.showToggleButton"
9
9
  :hide-left-panel="props.hideLeftPanel"
10
10
  @dragend="emits('dragend', $event)"
11
- />
11
+ >
12
+ <template #toggleContent>
13
+ <slot name="toggleContent" />
14
+ </template>
15
+
16
+ <template #firstPanel>
17
+ <slot name="firstPanel" />
18
+ </template>
19
+
20
+ <template #secondPanel>
21
+ <slot name="secondPanel" />
22
+ </template>
23
+ </common-split-horizontal-new>
24
+
12
25
  <common-split-horizontal-old
13
26
  v-else
14
27
  :parent-element-selector="props.parentElementSelector"
@@ -18,7 +31,15 @@
18
31
  :show-toggle-button="props.showToggleButton"
19
32
  :hide-left-panel="props.hideLeftPanel"
20
33
  @dragend="emits('dragend', $event)"
21
- />
34
+ >
35
+ <template #firstPanel>
36
+ <slot name="firstPanel" />
37
+ </template>
38
+
39
+ <template #secondPanel>
40
+ <slot name="secondPanel" />
41
+ </template>
42
+ </common-split-horizontal-old>
22
43
  </template>
23
44
 
24
45
  <script setup lang="ts">
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.392",
4
+ "version": "1.3.394",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",