bfg-common 1.3.276 → 1.3.278

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`"
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>(
@@ -20,25 +20,24 @@
20
20
  :hide="!isSelectedAdapter"
21
21
  />
22
22
 
23
- <a
24
- :id="`adapter-${props.adapter.id}`"
25
- :data-id="`${props.testId}-select`"
26
- data-title="adapter-name"
27
- cursor="pointer"
28
- class="adapter-name"
29
- @click="onSelectAdapter(props.adapter.id)"
23
+ <foreignObject
24
+ dy="11px"
25
+ height="20"
26
+ width="198"
27
+ x="482"
28
+ :y="props.adapter.adapterPosition"
29
+ class="diagram__values"
30
30
  >
31
- <text
32
- dy="11px"
33
- font-size="12"
34
- font-weight="400"
35
- x="482"
36
- :y="props.adapter.adapterPosition"
37
- class="diagram__values"
31
+ <span
32
+ :id="`adapter-${props.adapter.id}`"
33
+ :data-id="`${props.adapter.testId}-select`"
34
+ data-title="adapter-name"
35
+ class="adapter-name text-ellipsis"
36
+ @click="onSelectAdapter(props.adapter.id)"
38
37
  >
39
38
  {{ adapterName }}
40
- </text>
41
- </a>
39
+ </span>
40
+ </foreignObject>
42
41
 
43
42
  <foreignObject
44
43
  v-if="!props.adapter.carrier"
@@ -91,7 +90,7 @@
91
90
  popup-class="diagram-actions__popup"
92
91
  :close-after-click="true"
93
92
  :items="adapterPopupFields"
94
- :test-id="`adapter-${props.adapter.id}-toggle`"
93
+ :test-id="props.adapter.testId"
95
94
  @change="(value) => onShowModal(value, adapterProperties)"
96
95
  />
97
96
  </div>
@@ -142,7 +141,6 @@ const props = defineProps<{
142
141
  selectedAdapter: UI_I_SelectedAdapter
143
142
  networksCount: number
144
143
  isDarkMode: boolean
145
- testId?: string
146
144
  }>()
147
145
 
148
146
  const emits = defineEmits<{
@@ -156,9 +154,8 @@ const emits = defineEmits<{
156
154
 
157
155
  const localization = computed<UI_I_Localization>(() => useLocal())
158
156
 
159
- const adapterPopupFields = adapterPopupFieldsFunc(
160
- localization.value,
161
- props.adapter.id
157
+ const adapterPopupFields = computed(() =>
158
+ adapterPopupFieldsFunc(localization.value, props.adapter.testId)
162
159
  )
163
160
 
164
161
  const adapterProperties = dataForSelectedAdapterFunc(props.adapter)
@@ -220,6 +217,31 @@ const onShowModal = (
220
217
  .adapter-name {
221
218
  fill: #c1cdd4;
222
219
  }
220
+
221
+ .text-ellipsis {
222
+ color: #c1cdd4;
223
+
224
+ &:hover {
225
+ color: #c1cdd4;
226
+ text-decoration: solid underline #c1cdd4 1px;
227
+ }
228
+ }
229
+ }
230
+
231
+ .text-ellipsis {
232
+ display: block;
233
+ max-width: 198px;
234
+ text-overflow: ellipsis;
235
+ overflow: hidden;
236
+ white-space: nowrap;
237
+ font-weight: 400;
238
+ font-size: 12px;
239
+ color: #565656;
240
+
241
+ &:hover {
242
+ color: #565656;
243
+ text-decoration: solid underline #565656 1px;
244
+ }
223
245
  }
224
246
 
225
247
  .diagram {
@@ -244,5 +266,9 @@ const onShowModal = (
244
266
 
245
267
  .adapter-name {
246
268
  fill: #565656;
269
+ font-size: 12px;
270
+ font-weight: 400;
271
+ cursor: pointer;
272
+ line-height: normal;
247
273
  }
248
274
  </style>
@@ -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"
@@ -35,18 +35,22 @@
35
35
  {{ localization.physicalAdapters }}
36
36
  </text>
37
37
 
38
- <text
38
+ <foreignObject
39
39
  v-if="!hasAdapters"
40
40
  data-title="no-adapter-text"
41
41
  dy="11px"
42
- font-size="13"
43
- font-weight="400"
42
+ height="20"
43
+ width="230"
44
44
  x="462"
45
45
  y="53"
46
- class="no-physical-adapters"
47
46
  >
48
- {{ localization.noPhysicalNetworkAdapters }}
49
- </text>
47
+ <span
48
+ data-title="no-physical-adapters"
49
+ class="no-physical-adapters text-ellipsis"
50
+ >
51
+ {{ localization.noPhysicalNetworkAdapters }}
52
+ </span>
53
+ </foreignObject>
50
54
  </g>
51
55
  </template>
52
56
 
@@ -86,6 +90,20 @@ const onToggleAdapters = (networkId: string, portId: string): void => {
86
90
  .no-physical-adapters {
87
91
  fill: #c1cdd4;
88
92
  }
93
+ .text-ellipsis {
94
+ color: #c1cdd4;
95
+ }
96
+ }
97
+
98
+ .text-ellipsis {
99
+ display: block;
100
+ max-width: 230px;
101
+ text-overflow: ellipsis;
102
+ overflow: hidden;
103
+ white-space: nowrap;
104
+ font-weight: 400;
105
+ font-size: 12px;
106
+ color: #565656;
89
107
  }
90
108
 
91
109
  .virtual-switch__arrow-icon {
@@ -108,5 +126,8 @@ const onToggleAdapters = (networkId: string, portId: string): void => {
108
126
  }
109
127
  .no-physical-adapters {
110
128
  fill: #565656;
129
+ font-size: 13px;
130
+ font-weight: 400;
131
+ line-height: normal;
111
132
  }
112
133
  </style>
@@ -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,44 +22,42 @@
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
  >
29
29
  <foreignObject
30
30
  data-title="network-name-text"
31
31
  height="20"
32
- width="206"
33
- x="42"
32
+ width="226"
33
+ x="22"
34
34
  :y="portTitlePosition"
35
35
  class="diagram__values"
36
36
  >
37
37
  <span
38
- class="text-ellipsis"
38
+ v-if="props.port.state?.state === 2 || props.port.state?.state === 3"
39
+ class="port-state-icon-container"
40
+ :title="props.port.state?.errors?.[0] || ''"
41
+ >
42
+ <atoms-the-icon
43
+ v-if="props.port.state?.state === 2"
44
+ name="warning"
45
+ width="15"
46
+ height="15"
47
+ />
48
+ <atoms-the-icon
49
+ v-if="props.port.state?.state === 3"
50
+ name="error-outline"
51
+ width="15"
52
+ height="15"
53
+ />
54
+ </span>
55
+ <span
56
+ class="port-text text-ellipsis"
39
57
  :title="props.port.name"
40
58
  :id="`port_${props.port.id}`"
41
59
  >
42
60
  {{ props.port.name }}
43
- <span
44
- v-if="
45
- props.port.state?.state === 2 || props.port.state?.state === 3
46
- "
47
- class="port-state-icon-container"
48
- :title="props.port.state?.errors?.[0] || ''"
49
- >
50
- <atoms-the-icon
51
- v-if="props.port.state?.state === 2"
52
- name="warning"
53
- width="15"
54
- height="15"
55
- />
56
- <atoms-the-icon
57
- v-if="props.port.state?.state === 3"
58
- name="error-outline"
59
- width="15"
60
- height="15"
61
- />
62
- </span>
63
61
  </span>
64
62
  </foreignObject>
65
63
  </a>
@@ -114,7 +112,7 @@
114
112
  popup-class="diagram-actions__popup"
115
113
  :close-after-click="true"
116
114
  :items="navigationItems"
117
- :test-id="`${testId}-toggle`"
115
+ :test-id="`${testId}`"
118
116
  @change="onShowModalWithTypeCheck"
119
117
  />
120
118
  </div>
@@ -218,8 +216,14 @@ const macAddressPosition = computed<number>(() => props.port.portPosition + 16)
218
216
 
219
217
  const navigationItems = computed(() =>
220
218
  isVCenter.value || isVMPortsGroup.value
221
- ? vCenterPopupFieldsFunc(localization.value, testId.value)
222
- : portPopupFieldsFunc(localization.value, testId.value)
219
+ ? vCenterPopupFieldsFunc(
220
+ localization.value,
221
+ `${props.network.testId}-${props.port.testId}`
222
+ )
223
+ : portPopupFieldsFunc(
224
+ localization.value,
225
+ `${props.network.testId}-${props.port.testId}`
226
+ )
223
227
  )
224
228
 
225
229
  const showHighlightLine = computed(
@@ -392,9 +396,10 @@ const onSelectPort = (networkId: string, portId: string): void => {
392
396
  .port-state-icon-container {
393
397
  position: absolute;
394
398
  top: 4px;
399
+ left: 3px;
400
+ }
395
401
 
396
- //&:hover {
397
- // transform: scale(1.2);
398
- //}
402
+ .port-text {
403
+ padding-left: 20px;
399
404
  }
400
405
  </style>
@@ -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.276",
4
+ "version": "1.3.278",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",