bfg-common 1.2.72 → 1.2.74

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.
@@ -36,7 +36,7 @@
36
36
  ></div>
37
37
  <atoms-collapse-nav-item
38
38
  v-else
39
- :test-id="collapsedBtnId"
39
+ :test-id="item.testId || collapsedBtnId"
40
40
  :is-link="props.isLink"
41
41
  :item="item"
42
42
  :value="value"
@@ -6,4 +6,5 @@ export interface UI_I_CollapseNavItem {
6
6
  disabled?: boolean
7
7
  separate?: boolean
8
8
  uploaded?: boolean
9
+ testId?: string
9
10
  }
@@ -1,171 +1,178 @@
1
- <template>
2
- <div
3
- :class="[
4
- 'stack-block',
5
- open ? 'stack-block-expanded' : 'stack-block-expandable',
6
- { 'not-children': !props.hasChildren },
7
- ]"
8
- >
9
- <div
10
- :id="`${props.testId}-toggle`"
11
- class="stack-block-label"
12
- @click="toggle"
13
- >
14
- <atoms-the-icon name="angle" class="angle-icon" fill="#565656" />
15
-
16
- <div class="stack-view-key">
17
- <slot name="stackBlockKey" />
18
- </div>
19
- <div class="stack-block-content">
20
- <slot name="stackBlockContent" />
21
- </div>
22
-
23
- <span
24
- v-if="props.removable && props.isRollBack"
25
- class="icon-roll-back"
26
- @mousedown="onRollBack"
27
- @click.stop
28
- />
29
- <atoms-the-icon
30
- v-else-if="props.removable"
31
- class="remove-icon"
32
- name="close-circle"
33
- @mousedown="onRemove"
34
- @click.stop
35
- />
36
- <span v-else class="empty-icon"></span>
37
- </div>
38
-
39
- <div v-show="open" class="stack-children">
40
- <div style="height: auto">
41
- <slot name="stackChildren" />
42
- </div>
43
- </div>
44
- </div>
45
- </template>
46
-
47
- <script setup lang="ts">
48
- const props = withDefaults(
49
- defineProps<{
50
- hasChildren: boolean
51
- removable?: boolean
52
- testId?: string
53
- openByDefault?: boolean
54
- isRollBack?: boolean
55
- }>(),
56
- { testId: 'ui-stack-block', openByDefault: false }
57
- )
58
- const emits = defineEmits<{
59
- (event: 'toggle', value: boolean): void
60
- (event: 'remove'): void
61
- (event: 'roll-back'): void
62
- }>()
63
-
64
- const open = ref(props.openByDefault || false)
65
- const toggle = (): void => {
66
- open.value = !open.value
67
- emits('toggle', open.value)
68
- }
69
-
70
- const onRemove = (): void => {
71
- emits('remove')
72
- }
73
- const onRollBack = (): void => {
74
- emits('roll-back')
75
- }
76
- </script>
77
-
78
- <style scoped lang="scss">
79
- .stack-block {
80
- cursor: pointer;
81
- background-color: var(--block-view-bg-color);
82
- border-color: var(--global-border-color);
83
-
84
- &.stack-block-expandable:hover {
85
- border-bottom: 1px solid #666;
86
- }
87
-
88
- .stack-block-label {
89
- padding: 6px 12px;
90
- flex: 1 1 auto;
91
- max-width: unset;
92
- display: flex;
93
-
94
- &:hover {
95
- .remove-icon {
96
- opacity: 1;
97
- }
98
- }
99
-
100
- &::before {
101
- display: none;
102
- }
103
-
104
- .angle-icon {
105
- width: 14px;
106
- height: 14px;
107
- margin-right: 4px;
108
- transform: rotate(90deg);
109
- align-self: center;
110
- }
111
-
112
- .remove-icon {
113
- width: 18px;
114
- height: 18px;
115
- opacity: 0;
116
- cursor: pointer;
117
- }
118
-
119
- .stack-view-key {
120
- flex: 0 0 40%;
121
- max-width: 40%;
122
- }
123
-
124
- .stack-block-content {
125
- padding: 0;
126
- flex: 1 1 auto;
127
- width: 60%;
128
- background-color: transparent;
129
- }
130
-
131
- .empty-icon {
132
- width: 18px;
133
- height: 18px;
134
- }
135
- }
136
-
137
- &.stack-block-expanded {
138
- .stack-block-label {
139
- color: #ffffff;
140
- background-color: #29414e;
141
-
142
- .angle-icon {
143
- fill: #ffffff;
144
- transform: rotate(180deg);
145
- }
146
-
147
- .remove-icon {
148
- fill: #ffffff;
149
- }
150
- }
151
- }
152
-
153
- &.not-children {
154
- cursor: default;
155
- .stack-block-label {
156
- background-color: transparent;
157
- color: #333333;
158
-
159
- &:hover {
160
- cursor: default;
161
- background-color: transparent;
162
- border-bottom: none;
163
- }
164
-
165
- .angle-icon {
166
- opacity: 0;
167
- }
168
- }
169
- }
170
- }
171
- </style>
1
+ <template>
2
+ <div
3
+ :class="[
4
+ 'stack-block',
5
+ open ? 'stack-block-expanded' : 'stack-block-expandable',
6
+ { 'not-children': !props.hasChildren },
7
+ ]"
8
+ >
9
+ <div
10
+ :id="`${props.testId}-toggle`"
11
+ class="stack-block-label"
12
+ @click="toggle"
13
+ >
14
+ <atoms-the-icon name="angle" class="angle-icon" fill="#565656" />
15
+
16
+ <div class="stack-view-key">
17
+ <slot name="stackBlockKey" />
18
+ </div>
19
+ <div class="stack-block-content">
20
+ <slot name="stackBlockContent" />
21
+ </div>
22
+
23
+ <span
24
+ v-if="props.removable && props.isRollBack"
25
+ class="icon-roll-back"
26
+ @mousedown="onRollBack"
27
+ @click.stop
28
+ />
29
+ <atoms-the-icon
30
+ v-else-if="props.removable"
31
+ class="remove-icon"
32
+ name="close-circle"
33
+ @mousedown="onRemove"
34
+ @click.stop
35
+ />
36
+ <span v-else class="empty-icon"></span>
37
+ </div>
38
+
39
+ <div v-show="open" class="stack-children">
40
+ <div style="height: auto">
41
+ <slot name="stackChildren" />
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </template>
46
+
47
+ <script setup lang="ts">
48
+ const props = withDefaults(
49
+ defineProps<{
50
+ hasChildren: boolean
51
+ removable?: boolean
52
+ testId?: string
53
+ openByDefault?: boolean
54
+ isRollBack?: boolean
55
+ }>(),
56
+ { testId: 'ui-stack-block', openByDefault: false }
57
+ )
58
+ const emits = defineEmits<{
59
+ (event: 'toggle', value: boolean): void
60
+ (event: 'remove'): void
61
+ (event: 'roll-back'): void
62
+ }>()
63
+
64
+ const open = ref(props.openByDefault || false)
65
+ const toggle = (): void => {
66
+ open.value = !open.value
67
+ emits('toggle', open.value)
68
+ }
69
+
70
+ const onRemove = (): void => {
71
+ emits('remove')
72
+ }
73
+ const onRollBack = (): void => {
74
+ emits('roll-back')
75
+ }
76
+ </script>
77
+
78
+ <style scoped lang="scss">
79
+ .stack-block {
80
+ cursor: pointer;
81
+ background-color: var(--block-view-bg-color);
82
+ border-color: var(--global-border-color);
83
+
84
+ &.stack-block-expandable:hover {
85
+ border-bottom: 1px solid #666;
86
+
87
+ .stack-block-label {
88
+ background-color: var(--block-view-bg-color);
89
+ border-color: var(--global-border-color);
90
+ }
91
+ }
92
+
93
+ .stack-block-label {
94
+ padding: 6px 12px;
95
+ flex: 1 1 auto;
96
+ max-width: unset;
97
+ display: flex;
98
+ background-color: var(--block-view-bg-color);
99
+ border-color: var(--global-border-color);
100
+
101
+ &:hover {
102
+ .remove-icon {
103
+ opacity: 1;
104
+ }
105
+ }
106
+
107
+ &::before {
108
+ display: none;
109
+ }
110
+
111
+ .angle-icon {
112
+ width: 14px;
113
+ height: 14px;
114
+ margin-right: 4px;
115
+ transform: rotate(90deg);
116
+ align-self: center;
117
+ }
118
+
119
+ .remove-icon {
120
+ width: 18px;
121
+ height: 18px;
122
+ opacity: 0;
123
+ cursor: pointer;
124
+ }
125
+
126
+ .stack-view-key {
127
+ flex: 0 0 40%;
128
+ max-width: 40%;
129
+ }
130
+
131
+ .stack-block-content {
132
+ padding: 0;
133
+ flex: 1 1 auto;
134
+ width: 60%;
135
+ background-color: transparent;
136
+ }
137
+
138
+ .empty-icon {
139
+ width: 18px;
140
+ height: 18px;
141
+ }
142
+ }
143
+
144
+ &.stack-block-expanded {
145
+ .stack-block-label {
146
+ color: #ffffff;
147
+ background-color: #29414e;
148
+
149
+ .angle-icon {
150
+ fill: #ffffff;
151
+ transform: rotate(180deg);
152
+ }
153
+
154
+ .remove-icon {
155
+ fill: #ffffff;
156
+ }
157
+ }
158
+ }
159
+
160
+ &.not-children {
161
+ cursor: default;
162
+ .stack-block-label {
163
+ background-color: transparent;
164
+ color: #333333;
165
+
166
+ &:hover {
167
+ cursor: default;
168
+ background-color: transparent;
169
+ border-bottom: none;
170
+ }
171
+
172
+ .angle-icon {
173
+ opacity: 0;
174
+ }
175
+ }
176
+ }
177
+ }
178
+ </style>
@@ -712,11 +712,7 @@ const countNetworksPositions = (): UI_I_NetworksWithPositions[] => {
712
712
  })
713
713
  : (network.sysx && [
714
714
  {
715
- id: `${network.sysx?.name} ${
716
- !network.sysx.tcp_config.auto
717
- ? `: ${network.sysx.tcp_config.ipv4}`
718
- : ''
719
- }`,
715
+ id: network.sysx?.name,
720
716
  name: `${network.sysx?.name} ${
721
717
  !network.sysx.tcp_config.auto
722
718
  ? `: ${network.sysx.tcp_config.ipv4}`
@@ -21,7 +21,7 @@
21
21
  />
22
22
 
23
23
  <a
24
- :id="`${props.testId}-adapter-name`"
24
+ :id="`adapter-${props.adapter.id}`"
25
25
  data-title="adapter-name"
26
26
  cursor="pointer"
27
27
  @click="onSelectAdapter(props.adapter.id)"
@@ -135,7 +135,6 @@ const props = defineProps<{
135
135
  selectedPort: UI_I_SelectedPort
136
136
  selectedAdapter: UI_I_SelectedAdapter
137
137
  networksCount: number
138
- testId: string
139
138
  }>()
140
139
 
141
140
  const emits = defineEmits<{
@@ -149,7 +148,10 @@ const emits = defineEmits<{
149
148
 
150
149
  const localization = computed<UI_I_Localization>(() => useLocal())
151
150
 
152
- const adapterPopupFields = adapterPopupFieldsFunc(localization.value)
151
+ const adapterPopupFields = adapterPopupFieldsFunc(
152
+ localization.value,
153
+ props.adapter.id
154
+ )
153
155
 
154
156
  const adapterProperties = dataForSelectedAdapterFunc(props.adapter)
155
157
 
@@ -102,9 +102,10 @@ export const adapterViewSettingsFunc = (
102
102
  },
103
103
  ]
104
104
 
105
- export const adapterPopupFieldsFunc = (localization: UI_I_Localization) => [
105
+ export const adapterPopupFieldsFunc = (localization: UI_I_Localization, id: string) => [
106
106
  {
107
107
  text: localization.viewSettings,
108
108
  value: 'adapter-view-settings',
109
+ testId: `adapter-view-${id}`
109
110
  },
110
111
  ]
@@ -250,12 +250,14 @@ export const networkEditSettingsTabsFunc = (
250
250
  export const networkPopupFieldsFunc = (
251
251
  localization: UI_I_Localization,
252
252
  _networkType: string,
253
+ id: string,
253
254
  inPortlet = false
254
255
  ) => {
255
256
  const inPortletConfig = [
256
257
  {
257
258
  text: localization.viewSettings,
258
259
  value: 'network-view-settings',
260
+ testId: `network-view-${id}`,
259
261
  },
260
262
  // {
261
263
  // text: localization.editSettings,
@@ -267,11 +269,13 @@ export const networkPopupFieldsFunc = (
267
269
  {
268
270
  text: localization.editSettings,
269
271
  value: 'network-edit-settings',
272
+ testId: `network-edit-${id}`,
270
273
  },
271
274
  { separate: true },
272
275
  {
273
276
  text: localization.remove,
274
277
  value: 'network-port-remove',
278
+ testId: `network-remove-${id}`,
275
279
  // networkType === '1' ? 'network-vkernel-remove' : 'network-port-remove',
276
280
  },
277
281
  ]
@@ -158,19 +158,25 @@ export const portEditSettingsTabsFunc = (localization: UI_I_Localization) => [
158
158
  },
159
159
  ]
160
160
 
161
- export const portPopupFieldsFunc = (localization: UI_I_Localization) => [
161
+ export const portPopupFieldsFunc = (
162
+ localization: UI_I_Localization,
163
+ id: string
164
+ ) => [
162
165
  {
163
166
  text: localization.viewSettings,
164
167
  value: 'port-view-settings',
168
+ testId: `view-${id}`,
165
169
  },
166
170
  {
167
171
  text: localization.editSettings,
168
172
  value: 'port-edit-settings',
173
+ testId: `edit-${id}`,
169
174
  },
170
175
  { separate: true },
171
176
  {
172
177
  text: localization.remove,
173
178
  value: 'port-remove',
179
+ testId: `remove-${id}`,
174
180
  },
175
181
  ]
176
182
 
@@ -22,9 +22,13 @@ export const vCenterViewSettingsFunc = (
22
22
  },
23
23
  ]
24
24
 
25
- export const vCenterPopupFieldsFunc = (localization: UI_I_Localization) => [
25
+ export const vCenterPopupFieldsFunc = (
26
+ localization: UI_I_Localization,
27
+ id: string
28
+ ) => [
26
29
  {
27
30
  text: localization.viewSettings,
28
31
  value: 'v-center-view-settings',
32
+ testId: `view-${id}`,
29
33
  },
30
34
  ]
@@ -11,7 +11,7 @@
11
11
  </foreignObject>
12
12
 
13
13
  <a
14
- id="network-connects-link"
14
+ :id="testId"
15
15
  cursor="pointer"
16
16
  data-title="network-name-link"
17
17
  @click="onSelectNetwork(props.network.id)"
@@ -155,10 +155,13 @@ const networkPopupFields = computed(() =>
155
155
  networkPopupFieldsFunc(
156
156
  localization.value,
157
157
  props.network.networkType,
158
+ props.network.title,
158
159
  props.inPortlet
159
160
  )
160
161
  )
161
162
 
163
+ const testId = computed<string>(() => `network-${props.network.title.replace(' ', '_')}`)
164
+
162
165
  const dataForSelectedNetwork = computed<UI_I_ModalsInitialData>(() =>
163
166
  dataForSelectedNetworkFunc(props.network)
164
167
  )
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <g>
3
+ {{ isVmKernel }} {{ props.network.networkType }}
3
4
  <common-diagram-main-highlights
4
5
  data-title="port-vm"
5
6
  type="main-blue"
@@ -20,7 +21,7 @@
20
21
  />
21
22
 
22
23
  <a
23
- id="port-vm-name-link"
24
+ :id="testId"
24
25
  data-title="port-vm-name"
25
26
  cursor="pointer"
26
27
  @click="onSelectPort(props.network.id, props.port.id)"
@@ -156,6 +157,14 @@ const isVMPortsGroup = computed<boolean>(
156
157
  () => props.network.networkType === UI_E_NetworkType.VMPortsGroup
157
158
  )
158
159
 
160
+ const testId = computed<string>(() =>
161
+ isVmKernel.value
162
+ ? `port-${props.port.id}`
163
+ : isVMPortsGroup.value
164
+ ? `vm-${props.port.name}`
165
+ : ''
166
+ )
167
+
159
168
  const portRectHeight = computed<number>(() => (isVCenter.value ? 29 : 18))
160
169
  const portRectPosition = computed<number>(() => props.port.portPosition - 1.5)
161
170
  const portLinePosition = computed<number>(() =>
@@ -171,8 +180,8 @@ const macAddressPosition = computed<number>(() => props.port.portPosition + 16)
171
180
 
172
181
  const navigationItems = computed(() =>
173
182
  isVCenter.value || isVMPortsGroup.value
174
- ? vCenterPopupFieldsFunc(localization.value)
175
- : portPopupFieldsFunc(localization.value)
183
+ ? vCenterPopupFieldsFunc(localization.value, testId.value)
184
+ : portPopupFieldsFunc(localization.value, testId.value)
176
185
  )
177
186
 
178
187
  const showHighlightLine = computed(
@@ -254,6 +263,13 @@ const onShowModalWithTypeCheck = (value: string) => {
254
263
  const onSelectPort = (networkId: string, portId: string): void => {
255
264
  emits('select-port', networkId, portId)
256
265
  }
266
+
267
+ watch(
268
+ () => props.port,
269
+ (newValue) => {
270
+ console.log('port', newValue)
271
+ }
272
+ )
257
273
  </script>
258
274
 
259
275
  <style scoped lang="scss">
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.2.72",
4
+ "version": "1.2.74",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",