bfg-common 1.5.384 → 1.5.386

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.
Files changed (35) hide show
  1. package/assets/img/icons/icons-sprite-dark-6.svg +114 -109
  2. package/assets/img/icons/icons-sprite-light-6.svg +114 -109
  3. package/assets/localization/local_be.json +12 -1
  4. package/assets/localization/local_en.json +12 -1
  5. package/assets/localization/local_hy.json +12 -1
  6. package/assets/localization/local_kk.json +12 -1
  7. package/assets/localization/local_ru.json +12 -1
  8. package/assets/localization/local_zh.json +12 -1
  9. package/assets/scss/common/icons/icons-6.scss +174 -168
  10. package/components/atoms/nav/NavBar.vue +10 -1
  11. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  12. package/components/common/browse/lib/models/interfaces.ts +5 -5
  13. package/components/common/diagramMain/adapter/AdapterItems.vue +61 -61
  14. package/components/common/diagramMain/lib/config/initial.ts +50 -50
  15. package/components/common/diagramMain/lib/models/types.ts +21 -21
  16. package/components/common/diagramMain/lib/utils/utils.ts +331 -331
  17. package/components/common/diagramMain/modals/editSettings/ConfirmTeamingSettingsModal.vue +40 -40
  18. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +214 -214
  19. package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +189 -189
  20. package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +163 -163
  21. package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +175 -175
  22. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +346 -346
  23. package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
  24. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
  25. package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
  26. package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
  27. package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
  28. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +169 -169
  29. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
  30. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
  31. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
  32. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
  33. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
  34. package/components/common/diagramMain/port/Ports.vue +47 -47
  35. package/package.json +1 -1
@@ -1,40 +1,40 @@
1
- <template>
2
- <atoms-modal
3
- class="alert-modal"
4
- width="576px"
5
- :show="props.isShow"
6
- :title="localization.common.confirmTeamingAndFailoverSettings"
7
- @hide="onHide"
8
- @submit="onSubmit"
9
- >
10
- <template #modalBody>
11
- <atoms-alert
12
- status="alert-warning"
13
- :hide-close-icon="true"
14
- :items="[`${localization.common.thereAreNoActiveAdapters}`]"
15
- test-id="teaming-settings-alert"
16
- />
17
- <p class="warning-text">
18
- {{ localization.common.clickOkDiscardTheIssuesAndProceedCancelReviewChanges }}
19
- </p>
20
- </template>
21
- </atoms-modal>
22
- </template>
23
-
24
- <script setup lang="ts">
25
- import type { UI_I_Localization } from '~/lib/models/interfaces'
26
-
27
- const props = defineProps<{
28
- isShow: boolean
29
- }>()
30
-
31
- const emits = defineEmits<{
32
- (event: 'hide'): void
33
- (event: 'submit'): void
34
- }>()
35
-
36
- const onHide = () => emits('hide')
37
- const onSubmit = () => emits('submit')
38
-
39
- const localization = computed<UI_I_Localization>(() => useLocal())
40
- </script>
1
+ <template>
2
+ <atoms-modal
3
+ class="alert-modal"
4
+ width="576px"
5
+ :show="props.isShow"
6
+ :title="localization.common.confirmTeamingAndFailoverSettings"
7
+ @hide="onHide"
8
+ @submit="onSubmit"
9
+ >
10
+ <template #modalBody>
11
+ <atoms-alert
12
+ status="alert-warning"
13
+ :hide-close-icon="true"
14
+ :items="[`${localization.common.thereAreNoActiveAdapters}`]"
15
+ test-id="teaming-settings-alert"
16
+ />
17
+ <p class="warning-text">
18
+ {{ localization.common.clickOkDiscardTheIssuesAndProceedCancelReviewChanges }}
19
+ </p>
20
+ </template>
21
+ </atoms-modal>
22
+ </template>
23
+
24
+ <script setup lang="ts">
25
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
26
+
27
+ const props = defineProps<{
28
+ isShow: boolean
29
+ }>()
30
+
31
+ const emits = defineEmits<{
32
+ (event: 'hide'): void
33
+ (event: 'submit'): void
34
+ }>()
35
+
36
+ const onHide = () => emits('hide')
37
+ const onSubmit = () => emits('submit')
38
+
39
+ const localization = computed<UI_I_Localization>(() => useLocal())
40
+ </script>
@@ -1,214 +1,214 @@
1
- <template>
2
- <div class="wizard-content__container">
3
- <div class="wizard-content">
4
- <atoms-alert
5
- v-if="isShowErrorMessage"
6
- status="alert-danger"
7
- :items="validationMessagesArray"
8
- test-id="network-properties-alert"
9
- @remove="onHideErrorMessageAlert"
10
- />
11
- <form id="network-properties-form">
12
- <div class="horizontal-flex-container">
13
- <label class="property-label-group" for="network-label">
14
- {{ localization.common.networkLabel }}
15
- </label>
16
- <div class="margin-left-property-value-group">
17
- <div class="property-value-group">
18
- <fieldset>
19
- <atoms-tooltip-error
20
- :has-error="!!props.errorMessages.networkLabel"
21
- >
22
- <template #elem>
23
- <input
24
- id="network-label"
25
- v-model="fieldsValues.networkLabel"
26
- data-id="network-label-input"
27
- name="network-label"
28
- type="text"
29
- :class="[
30
- 'tooltip-field',
31
- {
32
- 'danger-not-valid': props.errorMessages.networkLabel,
33
- },
34
- ]"
35
- @click.stop
36
- />
37
- </template>
38
- <template #content>
39
- {{ props.errorMessages.networkLabel }}
40
- </template>
41
- </atoms-tooltip-error>
42
- </fieldset>
43
- </div>
44
- </div>
45
- </div>
46
- <div class="horizontal-flex-container port-properties-vlanid-row">
47
- <label class="property-label-group">
48
- {{ localization.common.vlanId }}
49
- </label>
50
- <div class="margin-left-property-value-group">
51
- <div class="property-value-group">
52
- <fieldset>
53
- <div class="flex-align-center">
54
- <atoms-combobox
55
- v-model="fieldsValues.vlanId"
56
- :items="vlanIdSelectData"
57
- test-id="vlan-id-select-combobox"
58
- @click.stop
59
- @select="selectVlanId"
60
- />
61
- <div
62
- v-show="props.errorMessages.vlanId"
63
- class="flex-align-center"
64
- >
65
- <div class="tooltip">
66
- <atoms-the-icon
67
- width="24px"
68
- height="24px"
69
- class="is-error tooltip-trigger"
70
- name="info"
71
- />
72
- <div class="tooltip-top-left tooltip-content error">
73
- {{ props.errorMessages.vlanId }}
74
- </div>
75
- </div>
76
- </div>
77
- </div>
78
- </fieldset>
79
- </div>
80
- </div>
81
- </div>
82
- </form>
83
- </div>
84
- </div>
85
- </template>
86
-
87
- <script setup lang="ts">
88
- import type { UI_I_Localization } from '~/lib/models/interfaces'
89
- import type {
90
- UI_I_ModalsInitialData,
91
- UI_I_EditSettingsErrorMessage,
92
- UI_I_PropertiesFields,
93
- } from '~/components/common/diagramMain/lib/models/interfaces'
94
- import type { UI_T_PropertiesFieldName } from '~/components/common/diagramMain/lib/models/types'
95
- import { validationMessagesArrayFunc } from '~/components/common/diagramMain/modals/lib/utils'
96
- import { vlanIdSelectData } from '~/components/common/wizards/network/add/lib/config/config'
97
-
98
- // Props from up
99
- const props = withDefaults(
100
- defineProps<{
101
- isShowErrorMessageAlert: boolean
102
- initialData?: UI_I_ModalsInitialData
103
- errorMessages: UI_I_EditSettingsErrorMessage
104
- hasErrorMessages?: boolean
105
- networkAlreadyExists: boolean
106
- }>(),
107
- {
108
- initialData: () => ({}),
109
- }
110
- )
111
-
112
- const validationMessagesArray = computed(() =>
113
- validationMessagesArrayFunc(['networkLabel', 'vlanId'], props.errorMessages)
114
- )
115
-
116
- // UI_I_Localization
117
- const localization = computed<UI_I_Localization>(() => useLocal())
118
-
119
- // For showing component validation errors on the top of modal
120
- const isShowErrorMessage = computed<boolean>(
121
- () => props.isShowErrorMessageAlert && props.hasErrorMessages
122
- )
123
-
124
- const fieldsValues = ref<UI_I_PropertiesFields>(
125
- useDeepCopy({
126
- vlanId: props.initialData.vlanId || 'None (0)',
127
- networkLabel: props.initialData.networkLabel || 'Network',
128
- })
129
- )
130
-
131
- const selectVlanId = (id: string): void => {
132
- fieldsValues.value.vlanId = id
133
- }
134
-
135
- // Validation
136
- const emits = defineEmits<{
137
- (
138
- event: 'change-error-messages',
139
- errorMessage: string,
140
- fieldName: keyof UI_I_EditSettingsErrorMessage
141
- ): void
142
- (event: 'hide-error-message-alert'): void
143
- (
144
- event: 'change-edit-properties-data',
145
- propertiesData: UI_I_PropertiesFields
146
- ): void
147
- }>()
148
-
149
- const onHideErrorMessageAlert = () => emits('hide-error-message-alert')
150
-
151
- const onChangeData = (data: UI_I_PropertiesFields) =>
152
- emits('change-edit-properties-data', data)
153
-
154
- const changeErrorMessage = (
155
- errorMessage: string,
156
- fieldName: keyof UI_I_EditSettingsErrorMessage
157
- ) => emits('change-error-messages', errorMessage, fieldName)
158
-
159
- const messageTexts = (local: UI_I_Localization) => ({
160
- vlanId: local.common.vlanIdInvalidMessage,
161
- networkLabel: local.common.networkLabelInvalidMessage,
162
- })
163
-
164
- const isNumberInRange = (value: number | string, down: number, up: number) =>
165
- isNaN(Number(value)) || Number(value) < down || Number(value) > up
166
-
167
- const setMessageOnChangedField = (
168
- values: string | number,
169
- name: UI_T_PropertiesFieldName,
170
- text: string
171
- ) => {
172
- if (name === 'networkLabel' && !values) {
173
- changeErrorMessage(text, name)
174
- return
175
- } else if (name === 'networkLabel' && props.networkAlreadyExists) return
176
-
177
- if (
178
- name === 'vlanId' &&
179
- values !== 'None (0)' &&
180
- values !== 'All (4095)' &&
181
- (isNumberInRange(values, 0, 4095) || values === '')
182
- ) {
183
- changeErrorMessage(text, name)
184
- return
185
- }
186
- changeErrorMessage('', name)
187
- }
188
-
189
- watch(
190
- fieldsValues,
191
- (newValues: UI_I_PropertiesFields) => {
192
- setMessageOnChangedField(
193
- newValues.vlanId,
194
- 'vlanId',
195
- messageTexts(localization.value).vlanId
196
- )
197
- setMessageOnChangedField(
198
- newValues.networkLabel,
199
- 'networkLabel',
200
- messageTexts(localization.value).networkLabel
201
- )
202
- onChangeData(newValues)
203
- !props.hasErrorMessages && onHideErrorMessageAlert()
204
- },
205
- { deep: true }
206
- )
207
-
208
- onMounted(() => {
209
- onChangeData(fieldsValues.value)
210
- })
211
- onUnmounted(() => {
212
- onHideErrorMessageAlert()
213
- })
214
- </script>
1
+ <template>
2
+ <div class="wizard-content__container">
3
+ <div class="wizard-content">
4
+ <atoms-alert
5
+ v-if="isShowErrorMessage"
6
+ status="alert-danger"
7
+ :items="validationMessagesArray"
8
+ test-id="network-properties-alert"
9
+ @remove="onHideErrorMessageAlert"
10
+ />
11
+ <form id="network-properties-form">
12
+ <div class="horizontal-flex-container">
13
+ <label class="property-label-group" for="network-label">
14
+ {{ localization.common.networkLabel }}
15
+ </label>
16
+ <div class="margin-left-property-value-group">
17
+ <div class="property-value-group">
18
+ <fieldset>
19
+ <atoms-tooltip-error
20
+ :has-error="!!props.errorMessages.networkLabel"
21
+ >
22
+ <template #elem>
23
+ <input
24
+ id="network-label"
25
+ v-model="fieldsValues.networkLabel"
26
+ data-id="network-label-input"
27
+ name="network-label"
28
+ type="text"
29
+ :class="[
30
+ 'tooltip-field',
31
+ {
32
+ 'danger-not-valid': props.errorMessages.networkLabel,
33
+ },
34
+ ]"
35
+ @click.stop
36
+ />
37
+ </template>
38
+ <template #content>
39
+ {{ props.errorMessages.networkLabel }}
40
+ </template>
41
+ </atoms-tooltip-error>
42
+ </fieldset>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ <div class="horizontal-flex-container port-properties-vlanid-row">
47
+ <label class="property-label-group">
48
+ {{ localization.common.vlanId }}
49
+ </label>
50
+ <div class="margin-left-property-value-group">
51
+ <div class="property-value-group">
52
+ <fieldset>
53
+ <div class="flex-align-center">
54
+ <atoms-combobox
55
+ v-model="fieldsValues.vlanId"
56
+ :items="vlanIdSelectData"
57
+ test-id="vlan-id-select-combobox"
58
+ @click.stop
59
+ @select="selectVlanId"
60
+ />
61
+ <div
62
+ v-show="props.errorMessages.vlanId"
63
+ class="flex-align-center"
64
+ >
65
+ <div class="tooltip">
66
+ <atoms-the-icon
67
+ width="24px"
68
+ height="24px"
69
+ class="is-error tooltip-trigger"
70
+ name="info"
71
+ />
72
+ <div class="tooltip-top-left tooltip-content error">
73
+ {{ props.errorMessages.vlanId }}
74
+ </div>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </fieldset>
79
+ </div>
80
+ </div>
81
+ </div>
82
+ </form>
83
+ </div>
84
+ </div>
85
+ </template>
86
+
87
+ <script setup lang="ts">
88
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
89
+ import type {
90
+ UI_I_ModalsInitialData,
91
+ UI_I_EditSettingsErrorMessage,
92
+ UI_I_PropertiesFields,
93
+ } from '~/components/common/diagramMain/lib/models/interfaces'
94
+ import type { UI_T_PropertiesFieldName } from '~/components/common/diagramMain/lib/models/types'
95
+ import { validationMessagesArrayFunc } from '~/components/common/diagramMain/modals/lib/utils'
96
+ import { vlanIdSelectData } from '~/components/common/wizards/network/add/lib/config/config'
97
+
98
+ // Props from up
99
+ const props = withDefaults(
100
+ defineProps<{
101
+ isShowErrorMessageAlert: boolean
102
+ initialData?: UI_I_ModalsInitialData
103
+ errorMessages: UI_I_EditSettingsErrorMessage
104
+ hasErrorMessages?: boolean
105
+ networkAlreadyExists: boolean
106
+ }>(),
107
+ {
108
+ initialData: () => ({}),
109
+ }
110
+ )
111
+
112
+ const validationMessagesArray = computed(() =>
113
+ validationMessagesArrayFunc(['networkLabel', 'vlanId'], props.errorMessages)
114
+ )
115
+
116
+ // UI_I_Localization
117
+ const localization = computed<UI_I_Localization>(() => useLocal())
118
+
119
+ // For showing component validation errors on the top of modal
120
+ const isShowErrorMessage = computed<boolean>(
121
+ () => props.isShowErrorMessageAlert && props.hasErrorMessages
122
+ )
123
+
124
+ const fieldsValues = ref<UI_I_PropertiesFields>(
125
+ useDeepCopy({
126
+ vlanId: props.initialData.vlanId || 'None (0)',
127
+ networkLabel: props.initialData.networkLabel || 'Network',
128
+ })
129
+ )
130
+
131
+ const selectVlanId = (id: string): void => {
132
+ fieldsValues.value.vlanId = id
133
+ }
134
+
135
+ // Validation
136
+ const emits = defineEmits<{
137
+ (
138
+ event: 'change-error-messages',
139
+ errorMessage: string,
140
+ fieldName: keyof UI_I_EditSettingsErrorMessage
141
+ ): void
142
+ (event: 'hide-error-message-alert'): void
143
+ (
144
+ event: 'change-edit-properties-data',
145
+ propertiesData: UI_I_PropertiesFields
146
+ ): void
147
+ }>()
148
+
149
+ const onHideErrorMessageAlert = () => emits('hide-error-message-alert')
150
+
151
+ const onChangeData = (data: UI_I_PropertiesFields) =>
152
+ emits('change-edit-properties-data', data)
153
+
154
+ const changeErrorMessage = (
155
+ errorMessage: string,
156
+ fieldName: keyof UI_I_EditSettingsErrorMessage
157
+ ) => emits('change-error-messages', errorMessage, fieldName)
158
+
159
+ const messageTexts = (local: UI_I_Localization) => ({
160
+ vlanId: local.common.vlanIdInvalidMessage,
161
+ networkLabel: local.common.networkLabelInvalidMessage,
162
+ })
163
+
164
+ const isNumberInRange = (value: number | string, down: number, up: number) =>
165
+ isNaN(Number(value)) || Number(value) < down || Number(value) > up
166
+
167
+ const setMessageOnChangedField = (
168
+ values: string | number,
169
+ name: UI_T_PropertiesFieldName,
170
+ text: string
171
+ ) => {
172
+ if (name === 'networkLabel' && !values) {
173
+ changeErrorMessage(text, name)
174
+ return
175
+ } else if (name === 'networkLabel' && props.networkAlreadyExists) return
176
+
177
+ if (
178
+ name === 'vlanId' &&
179
+ values !== 'None (0)' &&
180
+ values !== 'All (4095)' &&
181
+ (isNumberInRange(values, 0, 4095) || values === '')
182
+ ) {
183
+ changeErrorMessage(text, name)
184
+ return
185
+ }
186
+ changeErrorMessage('', name)
187
+ }
188
+
189
+ watch(
190
+ fieldsValues,
191
+ (newValues: UI_I_PropertiesFields) => {
192
+ setMessageOnChangedField(
193
+ newValues.vlanId,
194
+ 'vlanId',
195
+ messageTexts(localization.value).vlanId
196
+ )
197
+ setMessageOnChangedField(
198
+ newValues.networkLabel,
199
+ 'networkLabel',
200
+ messageTexts(localization.value).networkLabel
201
+ )
202
+ onChangeData(newValues)
203
+ !props.hasErrorMessages && onHideErrorMessageAlert()
204
+ },
205
+ { deep: true }
206
+ )
207
+
208
+ onMounted(() => {
209
+ onChangeData(fieldsValues.value)
210
+ })
211
+ onUnmounted(() => {
212
+ onHideErrorMessageAlert()
213
+ })
214
+ </script>