bfg-common 1.3.273 → 1.3.274

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.
@@ -26,6 +26,7 @@
26
26
  :selected-network="props.selectedNetwork"
27
27
  :is-visible-line="hasActiveAdapter"
28
28
  :is-dark-mode="props.isDarkMode"
29
+ :test-id="props.diagramData.testId"
29
30
  @toggle-adapters="onToggleAdapters"
30
31
  @select-adapter="onSelectAdapter"
31
32
  @show-modal="onShowModal"
@@ -8,6 +8,7 @@
8
8
  :in-portlet="props.inPortlet"
9
9
  :is-show-diagram="isShowDiagram"
10
10
  :diagram-name="props.diagramData.diagramName"
11
+ :test-id="props.diagramData.testId"
11
12
  @toggle-diagram="onToggleDiagram"
12
13
  @show-modal="onShowModal"
13
14
  />
@@ -10,7 +10,7 @@
10
10
  open: props.isShowDiagram,
11
11
  },
12
12
  ]"
13
- data-id="diagram-header-toggle-icon"
13
+ :data-id="`${props.testId}-toggle-icon`"
14
14
  @click="onToggleDiagram"
15
15
  />
16
16
  <a>
@@ -24,7 +24,7 @@
24
24
  <span class="vertical-separator"></span>
25
25
  <button
26
26
  id="add-networking-button"
27
- data-id="add-networking-button"
27
+ :data-id="`${props.testId}-add-networking-button`"
28
28
  type="button"
29
29
  @click="onShowModal('add-networking', props.diagramName)"
30
30
  >
@@ -32,7 +32,7 @@
32
32
  </button>
33
33
  <button
34
34
  id="switch-edit-button"
35
- data-id="switch-edit-button"
35
+ :data-id="`${props.testId}-edit-button`"
36
36
  type="button"
37
37
  @click="onShowModal('switch-edit')"
38
38
  >
@@ -40,7 +40,7 @@
40
40
  </button>
41
41
  <button
42
42
  id="switch-manage-physical-adapters-button"
43
- data-id="switch-manage-physical-adapters-button"
43
+ :data-id="`${props.testId}-manage-physical-adapters-button`"
44
44
  type="button"
45
45
  @click="onShowModal('switch-manage-physical-adapters')"
46
46
  >
@@ -51,7 +51,7 @@
51
51
  popup-class="diagram-main-actions__popup"
52
52
  :close-after-click="true"
53
53
  :items="switchMainNavigation"
54
- test-id="diagram-main-actions"
54
+ :test-id="`${props.testId}-actions-toggle`"
55
55
  @change="onShowModal"
56
56
  />
57
57
  </div>
@@ -73,6 +73,7 @@ const props = defineProps<{
73
73
  inPortlet: boolean
74
74
  isShowDiagram: boolean
75
75
  diagramName: string
76
+ testId: string
76
77
  }>()
77
78
 
78
79
  const emits = defineEmits<{
@@ -87,7 +88,7 @@ const emits = defineEmits<{
87
88
  const localization = computed<UI_I_Localization>(() => useLocal())
88
89
 
89
90
  const switchMainNavigation = computed<UI_I_NavigationItem[]>(() =>
90
- switchMainNavigationFunc(localization.value)
91
+ switchMainNavigationFunc(localization.value, props.testId)
91
92
  )
92
93
 
93
94
  const onToggleDiagram = () => emits('toggle-diagram')
@@ -7,6 +7,7 @@
7
7
 
8
8
  <common-diagram-main-adapter-contents
9
9
  :adapters-with-positions="props.adaptersWithPositions"
10
+ :test-id="props.testId"
10
11
  @toggle-adapters="onToggleAdapters"
11
12
  />
12
13
 
@@ -55,6 +56,7 @@ const props = defineProps<{
55
56
  isVisibleLine: boolean
56
57
  networksCount: number
57
58
  isDarkMode: boolean
59
+ testId: string
58
60
  }>()
59
61
 
60
62
  const isOpenedAdapterBlockAndNoSelectedNetwork = computed<boolean>(
@@ -22,7 +22,7 @@
22
22
 
23
23
  <a
24
24
  :id="`adapter-${props.adapter.id}`"
25
- :data-id="`${props.testId}-select`"
25
+ :data-id="`${props.adapter.testId}-select`"
26
26
  data-title="adapter-name"
27
27
  cursor="pointer"
28
28
  class="adapter-name"
@@ -91,7 +91,7 @@
91
91
  popup-class="diagram-actions__popup"
92
92
  :close-after-click="true"
93
93
  :items="adapterPopupFields"
94
- :test-id="`adapter-${props.adapter.id}-toggle`"
94
+ :test-id="props.adapter.testId"
95
95
  @change="(value) => onShowModal(value, adapterProperties)"
96
96
  />
97
97
  </div>
@@ -142,7 +142,6 @@ const props = defineProps<{
142
142
  selectedAdapter: UI_I_SelectedAdapter
143
143
  networksCount: number
144
144
  isDarkMode: boolean
145
- testId?: string
146
145
  }>()
147
146
 
148
147
  const emits = defineEmits<{
@@ -156,9 +155,8 @@ const emits = defineEmits<{
156
155
 
157
156
  const localization = computed<UI_I_Localization>(() => useLocal())
158
157
 
159
- const adapterPopupFields = adapterPopupFieldsFunc(
160
- localization.value,
161
- props.adapter.id
158
+ const adapterPopupFields = computed(() =>
159
+ adapterPopupFieldsFunc(localization.value, props.adapter.testId)
162
160
  )
163
161
 
164
162
  const adapterProperties = dataForSelectedAdapterFunc(props.adapter)
@@ -6,7 +6,6 @@
6
6
  :key="adapter.id"
7
7
  >
8
8
  <common-diagram-main-adapter-item
9
- :test-id="`adapter-item-${key}`"
10
9
  :adapter="adapter"
11
10
  :selected-port="props.selectedPort"
12
11
  :selected-adapter="props.selectedAdapter"
@@ -2,7 +2,7 @@
2
2
  <g data-title="adapter-block-contents">
3
3
  <foreignObject
4
4
  v-if="hasAdapters"
5
- :data-id="`${props.testId}-toggle`"
5
+ :data-id="`${props.testId}-adapters-toggle`"
6
6
  data-title="adapter-toggle"
7
7
  width="18"
8
8
  height="18"
@@ -14,11 +14,13 @@ export interface UI_I_Port {
14
14
  macAddress?: string
15
15
  adapter?: string
16
16
  isActive?: boolean
17
+ testId: string
17
18
  }
18
19
 
19
20
  export interface UI_I_Adapter {
20
21
  name: string
21
22
  id: string
23
+ testId: string
22
24
  fullName: string
23
25
  state: UI_I_State
24
26
  adapter: string
@@ -66,6 +68,7 @@ export interface UI_I_SelectedAdapter {
66
68
 
67
69
  export interface UI_I_Sysx {
68
70
  id: string
71
+ testId: string
69
72
  state: UI_I_State
70
73
  index: UI_I_ListIndex
71
74
  switch: string
@@ -143,6 +146,7 @@ export interface UI_I_Network extends UI_I_NetworkInfo {
143
146
  toggle: boolean
144
147
  unusedAdapters?: string[]
145
148
  vlanId?: number | string
149
+ testId: string
146
150
  }
147
151
 
148
152
  export interface UI_I_SwitchInfo extends UI_I_NetworkInfo {
@@ -168,6 +172,7 @@ export interface UI_I_NetworkFullWithPositions extends UI_I_Network {
168
172
 
169
173
  export interface UI_I_DiagramData {
170
174
  id: string
175
+ testId: string
171
176
  diagramName: string
172
177
  networks: UI_I_Network[]
173
178
  networking?: UI_I_SwitchInfo
@@ -424,6 +429,7 @@ export interface UI_I_ModalsInitialData<T = string | number | boolean> {
424
429
  export interface UI_I_SwitchAdapterItem {
425
430
  name: string
426
431
  id: string
432
+ testId: string
427
433
  fullName: string
428
434
  state: UI_I_State
429
435
  adapter: string
@@ -116,11 +116,11 @@ export const adapterViewSettingsFunc = (
116
116
 
117
117
  export const adapterPopupFieldsFunc = (
118
118
  localization: UI_I_Localization,
119
- id: string
119
+ testId: string
120
120
  ) => [
121
121
  {
122
122
  text: localization.viewSettings,
123
123
  value: 'adapter-view-settings',
124
- testId: `adapter-view-${id}`,
124
+ testId: `${testId}-view`,
125
125
  },
126
126
  ]
@@ -2,21 +2,22 @@ import { UI_I_Localization } from '~/lib/models/interfaces'
2
2
  import { UI_I_NavigationItem } from '~/components/common/diagramMain/lib/models/interfaces'
3
3
 
4
4
  export const switchMainNavigationFunc = (
5
- localization: UI_I_Localization
5
+ localization: UI_I_Localization,
6
+ testId: string
6
7
  ): UI_I_NavigationItem[] => [
7
8
  {
8
9
  text: localization.migrateVmKernelAdapter,
9
10
  value: 'migrate-vmkernel-adapter',
10
- testId: 'switch-migrate-vm-kernel-adapter',
11
+ testId: `${testId}-migrate-vm-kernel-adapter`,
11
12
  },
12
13
  {
13
14
  text: localization.viewSettings,
14
15
  value: 'switch-view-settings',
15
- testId: 'switch-view-settings',
16
+ testId: `${testId}-view-settings`,
16
17
  },
17
18
  {
18
19
  text: localization.remove,
19
20
  value: 'switch-remove',
20
- testId: 'switch-remove',
21
+ testId: `${testId}-remove`,
21
22
  },
22
23
  ]
@@ -236,16 +236,14 @@ export const networkEditSettingsTabsFunc = (
236
236
  export const networkPopupFieldsFunc = (
237
237
  localization: UI_I_Localization,
238
238
  _networkType: string,
239
- id: string,
239
+ testId: string,
240
240
  inPortlet = false
241
241
  ) => {
242
- const formatedId = id.replaceAll('=', '_')
243
-
244
242
  const inPortletConfig = [
245
243
  {
246
244
  text: localization.viewSettings,
247
245
  value: 'network-view-settings',
248
- testId: `network-view-${formatedId}`,
246
+ testId: `${testId}-view`,
249
247
  },
250
248
  // {
251
249
  // text: localization.editSettings,
@@ -257,13 +255,13 @@ export const networkPopupFieldsFunc = (
257
255
  {
258
256
  text: localization.editSettings,
259
257
  value: 'network-edit-settings',
260
- testId: `network-edit-${formatedId}`,
258
+ testId: `${testId}-edit`,
261
259
  },
262
260
  { separate: true },
263
261
  {
264
262
  text: localization.remove,
265
263
  value: 'network-port-remove',
266
- testId: `network-remove-${formatedId}`,
264
+ testId: `${testId}-remove`,
267
265
  // networkType === '1' ? 'network-vkernel-remove' : 'network-port-remove',
268
266
  },
269
267
  ]
@@ -160,23 +160,23 @@ export const portEditSettingsTabsFunc = (localization: UI_I_Localization) => [
160
160
 
161
161
  export const portPopupFieldsFunc = (
162
162
  localization: UI_I_Localization,
163
- id: string
163
+ testId: string
164
164
  ) => [
165
165
  {
166
166
  text: localization.viewSettings,
167
167
  value: 'port-view-settings',
168
- testId: `view-${id}`,
168
+ testId: `${testId}-view`,
169
169
  },
170
170
  {
171
171
  text: localization.editSettings,
172
172
  value: 'port-edit-settings',
173
- testId: `edit-${id}`,
173
+ testId: `${testId}-edit`,
174
174
  },
175
175
  { separate: true },
176
176
  {
177
177
  text: localization.remove,
178
178
  value: 'port-remove',
179
- testId: `remove-${id}`,
179
+ testId: `${testId}-remove`,
180
180
  },
181
181
  ]
182
182
 
@@ -24,11 +24,11 @@ export const vCenterViewSettingsFunc = (
24
24
 
25
25
  export const vCenterPopupFieldsFunc = (
26
26
  localization: UI_I_Localization,
27
- id: string
27
+ testId: string
28
28
  ) => [
29
29
  {
30
30
  text: localization.viewSettings,
31
31
  value: 'v-center-view-settings',
32
- testId: `view-${id}`,
32
+ testId: `${testId}-view`,
33
33
  },
34
34
  ]
@@ -12,7 +12,7 @@
12
12
 
13
13
  <a
14
14
  :id="`network-${props.network.id}`"
15
- :data-id="`${props.testId}-link`"
15
+ :data-id="`${props.network.testId}-link`"
16
16
  style="text-decoration: none"
17
17
  cursor="pointer"
18
18
  data-title="network-name-link"
@@ -52,7 +52,7 @@
52
52
  popup-class="diagram-actions__popup"
53
53
  :close-after-click="true"
54
54
  :items="networkPopupFields"
55
- :test-id="`network-${props.network.title}`"
55
+ :test-id="`${props.network.testId}`"
56
56
  @change="(value: string) => onShowModal(value, dataForSelectedNetwork)"
57
57
  />
58
58
  </div>
@@ -88,7 +88,7 @@
88
88
  x="24"
89
89
  :y="portsArrowPosition"
90
90
  cursor="pointer"
91
- :data-id="`${props.testId}-toggle-ports`"
91
+ :data-id="`${props.network.testId}-toggle-ports`"
92
92
  @click="
93
93
  onTogglePorts(props.network.id, !props.network.toggle, props.diagramId)
94
94
  "
@@ -168,7 +168,7 @@ const networkPopupFields = computed(() =>
168
168
  networkPopupFieldsFunc(
169
169
  localization.value,
170
170
  props.network.networkType,
171
- props.network.id,
171
+ props.network.testId,
172
172
  props.inPortlet
173
173
  )
174
174
  )
@@ -22,7 +22,7 @@
22
22
  <a
23
23
  :id="testId"
24
24
  data-title="port-vm-name"
25
- data-id="port-vm-name-select"
25
+ :data-id="`${props.network.testId}-${props.port.testId}-select`"
26
26
  cursor="pointer"
27
27
  @click="onSelectPort(props.network.id, props.port.id)"
28
28
  >
@@ -114,7 +114,7 @@
114
114
  popup-class="diagram-actions__popup"
115
115
  :close-after-click="true"
116
116
  :items="navigationItems"
117
- :test-id="`${testId}-toggle`"
117
+ :test-id="`${testId}`"
118
118
  @change="onShowModalWithTypeCheck"
119
119
  />
120
120
  </div>
@@ -218,8 +218,14 @@ const macAddressPosition = computed<number>(() => props.port.portPosition + 16)
218
218
 
219
219
  const navigationItems = computed(() =>
220
220
  isVCenter.value || isVMPortsGroup.value
221
- ? vCenterPopupFieldsFunc(localization.value, testId.value)
222
- : portPopupFieldsFunc(localization.value, testId.value)
221
+ ? vCenterPopupFieldsFunc(
222
+ localization.value,
223
+ `${props.network.testId}-${props.port.testId}`
224
+ )
225
+ : portPopupFieldsFunc(
226
+ localization.value,
227
+ `${props.network.testId}-${props.port.testId}`
228
+ )
223
229
  )
224
230
 
225
231
  const showHighlightLine = computed(
@@ -73,6 +73,7 @@ export interface UI_I_SelectedNetwork {
73
73
  export interface UI_I_Switch {
74
74
  name: string
75
75
  id: string
76
+ testId: string
76
77
  mtu: number
77
78
  nics: UI_I_AdapterStatus
78
79
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.273",
4
+ "version": "1.3.274",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",