bfg-common 1.3.421 → 1.3.423

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.
@@ -2377,5 +2377,6 @@
2377
2377
  "useUnidirectionalChap": "Выкарыстоўвайце аднанакіраваны CHAP",
2378
2378
  "useBiderectionalChap": "Выкарыстоўвайце двухнакіраваны CHAP",
2379
2379
  "usernameIsRequired": "Патрабуецца імя карыстальніка",
2380
- "passwordIsRequired": "Патрабуецца пароль"
2380
+ "passwordIsRequired": "Патрабуецца пароль",
2381
+ "source": "Крыніца"
2381
2382
  }
@@ -2381,5 +2381,6 @@
2381
2381
  "useUnidirectionalChap": "Use unidirectional CHAP",
2382
2382
  "useBiderectionalChap": "Use biderectional CHAP",
2383
2383
  "usernameIsRequired": "Username is required",
2384
- "passwordIsRequired": "Password is required"
2384
+ "passwordIsRequired": "Password is required",
2385
+ "source": "Source"
2385
2386
  }
@@ -2381,5 +2381,6 @@
2381
2381
  "useUnidirectionalChap": "Օգտագործեք միակողմանի CHAP",
2382
2382
  "useBiderectionalChap": "Օգտագործեք երկու ուղղիչ CHAP",
2383
2383
  "usernameIsRequired": "Օգտվողի անունը պարտադիր է",
2384
- "passwordIsRequired": "Գաղտնաբառը պարտադիր է"
2384
+ "passwordIsRequired": "Գաղտնաբառը պարտադիր է",
2385
+ "source": "Աղբյուր"
2385
2386
  }
@@ -2380,5 +2380,6 @@
2380
2380
  "useUnidirectionalChap": "Бір бағытты CHAP пайдаланыңыз",
2381
2381
  "useBiderectionalChap": "Екі жақты CHAP пайдаланыңыз",
2382
2382
  "usernameIsRequired": "Пайдаланушы аты қажет",
2383
- "passwordIsRequired": "Құпия сөз қажет"
2383
+ "passwordIsRequired": "Құпия сөз қажет",
2384
+ "source": "Дереккөз"
2384
2385
  }
@@ -2386,5 +2386,6 @@
2386
2386
  "useUnidirectionalChap": "Используйте однонаправленный CHAP",
2387
2387
  "useBiderectionalChap": "Используйте двунаправленный CHAP",
2388
2388
  "usernameIsRequired": "Требуется имя пользователя",
2389
- "passwordIsRequired": "Требуется пароль"
2389
+ "passwordIsRequired": "Требуется пароль",
2390
+ "source": "Источник"
2390
2391
  }
@@ -2380,5 +2380,6 @@
2380
2380
  "useUnidirectionalChap": "使用单向 CHAP",
2381
2381
  "useBiderectionalChap": "使用双向 CHAP",
2382
2382
  "usernameIsRequired": "用户名是必需的",
2383
- "passwordIsRequired": "密码是必需的"
2383
+ "passwordIsRequired": "密码是必需的",
2384
+ "source": "来源"
2384
2385
  }
@@ -21,17 +21,20 @@
21
21
 
22
22
  <common-wizards-datastore-new-add-local
23
23
  v-show="selectedStep.id === 1"
24
- :mode="props.project"
24
+ :project="props.project"
25
25
  :datastore-type="datastoreType"
26
+ :alert-messages="alertMessages[1]"
27
+ :messages-fields="selectedStep.fields"
26
28
  :local-create-name-submit="localCreateNameSubmit"
27
29
  :datacenter-hosts="props.datacenterHosts"
28
30
  :is-main-filter="props.isMainFilter"
31
+ @hide-alert="onHideAlert"
29
32
  @loading="(e) => (loading = e)"
30
33
  @submit="onSaveNameAndNextLocal"
31
34
  @main-filter="emits('main-filter', $event)"
32
35
  />
33
36
 
34
- <common-wizards-datastore-add-new-shared-storm
37
+ <common-wizards-datastore-new-add-shared-storm
35
38
  v-show="datastoreType === 'shared-storm'"
36
39
  :mode="props.project"
37
40
  :step-id="selectedStep.id"
@@ -155,13 +158,111 @@ const datastoreForm = ref<UI_I_CreateDatastoreForm>({
155
158
  },
156
159
  })
157
160
 
161
+ const checkIpFourSettingsSync = (
162
+ localization: UI_I_Localization,
163
+ data: string,
164
+ wizard: Wizard,
165
+ value: UI_I_WizardStep[]
166
+ ): UI_I_ValidationReturn => {
167
+ let stepHasError = false
168
+
169
+ if (!data) {
170
+ stepHasError = wizard.setValidation(1, 'datastoreName', {
171
+ fieldMessage: localization.specifyDatastoreName,
172
+ alertMessage: '',
173
+ })
174
+ } else if (wizard.hasMessage(1, 'datastoreName')) {
175
+ value = wizard.removeValidation(1, 'datastoreName', value)
176
+ }
177
+
178
+ return {
179
+ newValue: value,
180
+ stepHasError,
181
+ }
182
+ }
183
+
184
+ // const checkNetwork = async (
185
+ // label: string,
186
+ // localization: UI_I_Localization,
187
+ // emits: UI_I_AddNetworkingEmits
188
+ // ): Promise<UI_I_AsyncCheckReturn> => {
189
+ // if (label) {
190
+ // return new Promise((resolve, _reject) =>
191
+ // emits('check-network-label', label, (message: string) => {
192
+ // if (message === '') {
193
+ // resolve({
194
+ // isValid: true,
195
+ // message: '',
196
+ // })
197
+ // }
198
+ //
199
+ // if (message !== '') {
200
+ // resolve({
201
+ // isValid: false,
202
+ // message,
203
+ // })
204
+ // }
205
+ // })
206
+ // )
207
+ // } else {
208
+ // return {
209
+ // isValid: false,
210
+ // message: localization.networkLabelInvalidMessage,
211
+ // }
212
+ // }
213
+ // }
214
+
215
+ // export const checkNetworkAsync = async (
216
+ // value: UI_I_WizardStep[],
217
+ // label: string,
218
+ // stepId: number,
219
+ // fieldName: string,
220
+ // emits: UI_I_AddNetworkingEmits,
221
+ // localization: UI_I_Localization,
222
+ // wizard: Wizard
223
+ // ): Promise<UI_I_ValidationReturn> => {
224
+ // let stepHasError = false
225
+ //
226
+ // const labelValidation: {
227
+ // isValid: boolean
228
+ // message: string
229
+ // } = await checkNetwork(label, localization, emits)
230
+ //
231
+ // if (!labelValidation.isValid) {
232
+ // stepHasError = wizard.setValidation(stepId, fieldName, {
233
+ // fieldMessage: labelValidation.message,
234
+ // alertMessage: labelValidation.message,
235
+ // })
236
+ // } else if (wizard.hasMessage(stepId, fieldName)) {
237
+ // value = wizard.removeValidation(stepId, fieldName, value)
238
+ // }
239
+ //
240
+ // return {
241
+ // newValue: value,
242
+ // stepHasError,
243
+ // }
244
+ // }
245
+
158
246
  const validationFunc = async (
159
247
  value: UI_I_WizardStep[],
160
- _currentStep: UI_I_WizardStep,
161
- _nextStep: UI_I_WizardStep
248
+ currentStep: UI_I_WizardStep,
249
+ nextStep: UI_I_WizardStep
162
250
  ): Promise<UI_I_ValidationReturn> => {
163
251
  let stepHasError = false
164
252
 
253
+ if (wizard.isValidateForStep(1, currentStep.id, nextStep.id)) {
254
+ const nameValidation = checkIpFourSettingsSync(
255
+ localization.value,
256
+ datastoreForm.value.local.name,
257
+ wizard,
258
+ value
259
+ )
260
+
261
+ value = nameValidation.newValue
262
+
263
+ stepHasError = nameValidation.stepHasError
264
+ }
265
+
165
266
  return {
166
267
  newValue: value,
167
268
  stepHasError,
@@ -462,6 +563,9 @@ const onAddDatastore = async (): Promise<void> => {
462
563
  // return await createDatastore(sendDataTwo)
463
564
  // }
464
565
 
566
+ const onHideAlert = (stepId: number): void => {
567
+ wizard.hideAlertMessagesByStepId(stepId)
568
+ }
465
569
  const onFinish = async (): Promise<void> => {
466
570
  loading.value = true
467
571
 
@@ -1,18 +1,21 @@
1
1
  <template>
2
2
  <div class="local-step">
3
- <span v-if="mode === 'sphere'" class="vmfs-container__desc">
3
+ <span v-if="props.project === 'sphere'" class="vmfs-container__desc">
4
4
  {{ localization.nameAndDeviceSelectionDesc }}
5
5
  </span>
6
6
 
7
7
  <common-wizards-datastore-new-add-local-create-name
8
- v-show="mode === 'procurator'"
8
+ v-show="props.project === 'procurator'"
9
+ :alert-messages="props.alertMessages"
10
+ :messages-fields="props.messagesFields"
9
11
  :local-create-name-submit="props.localCreateNameSubmit"
12
+ @hide-alert="(e) => emits('hide-alert', e)"
10
13
  @loading="(e) => emits('loading', e)"
11
14
  @submit="(e) => emits('submit', e)"
12
15
  />
13
16
 
14
17
  <common-wizards-datastore-new-add-shared-storm-device-selection
15
- v-show="mode === 'sphere'"
18
+ v-show="props.project === 'sphere'"
16
19
  v-model:lun-disk="selectedLunDisk"
17
20
  mode="sphere"
18
21
  :device-selection-submit="props.localCreateNameSubmit"
@@ -28,25 +31,30 @@
28
31
  </template>
29
32
 
30
33
  <script lang="ts" setup>
31
- import {
34
+ import type { UI_T_Project } from '~/lib/models/types'
35
+ import type {
36
+ UI_I_Localization,
37
+ UI_I_ArbitraryObject,
38
+ } from '~/lib/models/interfaces'
39
+ import type {
32
40
  UI_I_CreateStorageLunDiskItem,
33
41
  UI_I_SelectHostOptions,
34
42
  } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
35
- import {
36
- UI_T_WizardDatastoreMode,
37
- UI_T_DatastoreType,
38
- } from '~/components/common/wizards/datastore/add/lib/models/types'
39
- import { UI_I_Localization } from '~/lib/models/interfaces'
43
+ import type { UI_T_DatastoreType } from '~/components/common/wizards/datastore/add/lib/models/types'
44
+ import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
40
45
 
41
46
  const props = defineProps<{
42
47
  localCreateNameSubmit: number
48
+ alertMessages: string[]
49
+ messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
43
50
  datastoreType: UI_T_DatastoreType
44
- mode: UI_T_WizardDatastoreMode
51
+ project: UI_T_Project
45
52
  datacenterHosts?: UI_I_SelectHostOptions[]
46
53
  isMainFilter?: boolean
47
54
  }>()
48
55
  const emits = defineEmits<{
49
56
  (event: 'loading', value: boolean): void
57
+ (event: 'hide-alert', value: number): void
50
58
  (event: 'submit', value: string): void
51
59
  (event: 'main-filter', value: string): void
52
60
  }>()
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
  <div class="create-datastore-name">
3
3
  <atoms-alert
4
- v-show="errors.length"
4
+ v-show="props.alertMessages.length"
5
5
  test-id="datastore-creat-name"
6
6
  status="alert-danger"
7
- :items="errors"
8
- @remove="onRemoveValidationErrors"
7
+ :items="props.alertMessages"
8
+ @remove="onHideAlert"
9
9
  />
10
10
 
11
11
  <div class="clr-form-control clr-row">
@@ -36,16 +36,23 @@
36
36
  </template>
37
37
 
38
38
  <script lang="ts" setup>
39
- import { UI_I_ValidationTouchResult } from '~/lib/models/plugins/validation/interfaces'
40
- import { UI_I_Localization } from '~/lib/models/interfaces'
41
- import { UI_I_FormValidationDataStore } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
39
+ import type { UI_I_ValidationTouchResult } from '~/lib/models/plugins/validation/interfaces'
40
+ import type {
41
+ UI_I_Localization,
42
+ UI_I_ArbitraryObject,
43
+ } from '~/lib/models/interfaces'
44
+ import type { UI_I_FormValidationDataStore } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
45
+ import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
42
46
  import { defaultFormFunc } from '~/components/common/wizards/datastore/add/local/createName/lib/config/defaultForm'
43
47
  import { checkValidityName } from '~/components/common/wizards/datastore/add/lib/utils'
44
48
 
45
49
  const props = defineProps<{
50
+ alertMessages: string[]
51
+ messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
46
52
  localCreateNameSubmit: number
47
53
  }>()
48
54
  const emits = defineEmits<{
55
+ (event: 'hide-alert', value: number): void
49
56
  (event: 'loading', value: boolean): void
50
57
  (event: 'submit', value: string): void
51
58
  }>()
@@ -81,14 +88,6 @@ const nameErrorText = computed<string>(() => {
81
88
  return validForm.value?.errors?.name?.[0] || ''
82
89
  })
83
90
  /* Validation Name input end */
84
-
85
- const errors = ref<string[]>([])
86
- const showValidationErrors = (data: string[]): void => {
87
- errors.value = data
88
- }
89
- const onRemoveValidationErrors = (): void => {
90
- errors.value = []
91
- }
92
91
  const submit = async (): Promise<void> => {
93
92
  const name = form.value.name.value
94
93
 
@@ -101,19 +100,20 @@ const submit = async (): Promise<void> => {
101
100
  if (name) {
102
101
  emits('loading', true)
103
102
 
104
- const { valid, msg } = await checkValidityName(name)
103
+ const { valid } = await checkValidityName(name)
105
104
 
106
105
  emits('loading', false)
107
106
 
108
107
  if (!valid) {
109
- showValidationErrors([msg])
110
108
  return
111
109
  }
112
110
  }
113
-
114
- onRemoveValidationErrors()
115
111
  emits('submit', name)
116
112
  }
113
+
114
+ const onHideAlert = (): void => {
115
+ emits('hide-alert', 1)
116
+ }
117
117
  watch(
118
118
  () => props.localCreateNameSubmit,
119
119
  () => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.421",
4
+ "version": "1.3.423",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",