bfg-common 1.3.418 → 1.3.420

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.
@@ -450,6 +450,45 @@ export default class Wizard {
450
450
  return selectedStep !== undefined ? selectedStep.id : this.steps[0].id
451
451
  }
452
452
 
453
+ private async finalValidationFunc(
454
+ value: UI_I_WizardStep[],
455
+ currentStep: UI_I_WizardStep,
456
+ nextStep: UI_I_WizardStep,
457
+ finalValidationFunc: (
458
+ value: UI_I_WizardStep[],
459
+ currentStep: UI_I_WizardStep,
460
+ nextStep: UI_I_WizardStep
461
+ ) => Promise<UI_I_ValidationReturn>,
462
+ isOnlyFinalValidation = false
463
+ ) {
464
+ const finalValidation: UI_I_ValidationReturn = await finalValidationFunc(
465
+ value,
466
+ currentStep,
467
+ nextStep
468
+ )
469
+
470
+ if (
471
+ finalValidation.stepHasError ||
472
+ finalValidation.stepShouldStop?.ifFromAnyStep ||
473
+ finalValidation.stepShouldStop?.ifOnCurrentStep
474
+ ) {
475
+ finalValidation.stepShouldStop?.ifFromAnyStep &&
476
+ currentStep.id < finalValidation.stepShouldStop?.stoppageStepId &&
477
+ this.selectStepHard(finalValidation.stepShouldStop?.stoppageStepId)
478
+
479
+ finalValidation.stepShouldStop?.ifOnCurrentStep &&
480
+ this.selectStepHard(finalValidation.stepShouldStop?.stoppageStepId)
481
+
482
+ finalValidation.stepHasError && this.goToFirstInvalidStep()
483
+
484
+ return
485
+ } else {
486
+ currentStep.status = UI_E_WIZARD_STATUS.COMPLETED
487
+ }
488
+
489
+ this.changeStep(finalValidation.newValue)
490
+ }
491
+
453
492
  async changeSteps(
454
493
  value: UI_I_WizardStep[],
455
494
  validationFunc?: (
@@ -461,7 +500,8 @@ export default class Wizard {
461
500
  value: UI_I_WizardStep[],
462
501
  currentStep: UI_I_WizardStep,
463
502
  nextStep: UI_I_WizardStep
464
- ) => Promise<UI_I_ValidationReturn>
503
+ ) => Promise<UI_I_ValidationReturn>,
504
+ isOnlyFinalValidation = false
465
505
  ): Promise<void> {
466
506
  const currentStep: UI_I_WizardStep | undefined = this.steps.find(
467
507
  (step: UI_I_WizardStep) => this.isSelected(step.status)
@@ -474,6 +514,24 @@ export default class Wizard {
474
514
  if (!currentStep || !nextStep) return
475
515
  if (currentStep.id > nextStep.id) return this.changeStep(value)
476
516
 
517
+ if (
518
+ isOnlyFinalValidation &&
519
+ (this.isLastStep() ||
520
+ nextStep.id ===
521
+ this.selectedScheme.value[this.selectedScheme.value.length - 1]) &&
522
+ finalValidationFunc
523
+ ) {
524
+ this.finalValidationFunc(
525
+ value,
526
+ currentStep,
527
+ nextStep,
528
+ finalValidationFunc,
529
+ isOnlyFinalValidation
530
+ )
531
+
532
+ return
533
+ }
534
+
477
535
  if (validationFunc) {
478
536
  const validation: UI_I_ValidationReturn = await validationFunc(
479
537
  value,
@@ -502,29 +560,13 @@ export default class Wizard {
502
560
  this.selectedScheme.value[this.selectedScheme.value.length - 1]) &&
503
561
  finalValidationFunc
504
562
  ) {
505
- const finalValidation: UI_I_ValidationReturn =
506
- await finalValidationFunc(value, currentStep, nextStep)
507
-
508
- if (
509
- finalValidation.stepHasError ||
510
- finalValidation.stepShouldStop?.ifFromAnyStep ||
511
- finalValidation.stepShouldStop?.ifOnCurrentStep
512
- ) {
513
- finalValidation.stepShouldStop?.ifFromAnyStep &&
514
- currentStep.id < finalValidation.stepShouldStop?.stoppageStepId &&
515
- this.selectStepHard(finalValidation.stepShouldStop?.stoppageStepId)
516
-
517
- finalValidation.stepShouldStop?.ifOnCurrentStep &&
518
- this.selectStepHard(finalValidation.stepShouldStop?.stoppageStepId)
519
-
520
- finalValidation.stepHasError && this.goToFirstInvalidStep()
521
-
522
- return
523
- } else {
524
- currentStep.status = UI_E_WIZARD_STATUS.COMPLETED
525
- }
526
-
527
- this.changeStep(finalValidation.newValue)
563
+ this.finalValidationFunc(
564
+ value,
565
+ currentStep,
566
+ nextStep,
567
+ finalValidationFunc,
568
+ isOnlyFinalValidation
569
+ )
528
570
 
529
571
  return
530
572
  } else {
@@ -658,10 +700,6 @@ export default class Wizard {
658
700
  }
659
701
 
660
702
  isLastStep(): boolean {
661
- console.log(
662
- this.selectedScheme.value[this.selectedScheme.value.length - 2],
663
- this.selectedStepId
664
- )
665
703
  return (
666
704
  this.selectedScheme.value[this.selectedScheme.value.length - 2] ===
667
705
  this.selectedStepId
@@ -1,14 +1,12 @@
1
1
  <template>
2
2
  <div class="nfs-container">
3
- <span class="nfs-container__desc">{{ stepSubTitle }}</span>
4
-
5
3
  <common-wizards-datastore-add-nfs-version
6
- v-show="props.stepPosition === 1"
4
+ v-show="props.stepId === 4"
7
5
  v-model:version="nfsVersion"
8
6
  />
9
7
 
10
8
  <common-wizards-datastore-add-nfs-configuration
11
- v-show="props.stepPosition === 2"
9
+ v-show="props.stepId === 5"
12
10
  :mode="props.mode"
13
11
  :nfs-version="nfsVersion"
14
12
  :nfs-configuration-submit="nfsConfigurationSubmit"
@@ -39,11 +37,10 @@ import {
39
37
  UI_T_WizardDatastoreMode,
40
38
  } from '~/components/common/wizards/datastore/add/lib/models/types'
41
39
  import { UI_I_ConfigurationSendDataNfs } from '~/components/common/wizards/datastore/add/nfs/configuration/lib/models/interfaces'
42
- import { subTitleFunc } from '~/components/common/wizards/datastore/add/lib/config/stepItems'
43
40
 
44
41
  const props = defineProps<{
45
42
  mode: UI_T_WizardDatastoreMode
46
- stepPosition: number
43
+ stepId: number
47
44
  datastoreType: UI_T_DatastoreType
48
45
  nfsConfigurationSubmit: number
49
46
  hostAccessibilitySubmit: number
@@ -59,16 +56,6 @@ const localization = computed<UI_I_Localization>(() => useLocal())
59
56
 
60
57
  const nfsVersion = ref<UI_T_NfsType>('nfs-3')
61
58
 
62
- const stepSubTitle = computed<string>(() => {
63
- const { datastoreType, stepPosition } = props
64
- return subTitleFunc(
65
- localization.value,
66
- datastoreType,
67
- stepPosition,
68
- nfsVersion.value
69
- )
70
- })
71
-
72
59
  // const showHostAccessibility = computed<boolean>(() => {
73
60
  // return (
74
61
  // (props.stepPosition === 4 && nfsVersion.value === 'nfs-4.1') ||
@@ -76,7 +63,7 @@ const stepSubTitle = computed<string>(() => {
76
63
  // )
77
64
  // })
78
65
  const showHostAccessibility = computed<boolean>(() => {
79
- return props.mode === 'sphere' && props.stepPosition === 3
66
+ return props.mode === 'sphere' && props.stepId === 6
80
67
  })
81
68
 
82
69
  watch(nfsVersion, (newValue: UI_T_NfsType) => {
@@ -13,17 +13,15 @@
13
13
  @submit="onFinish"
14
14
  >
15
15
  <template #modalBody="{ selectedStep }">
16
- {{ datastoreType }}
17
16
  <common-wizards-datastore-new-add-types
18
17
  v-if="selectedStep.id === 0"
19
18
  v-model:datastore-type="datastoreType"
20
19
  :project="props.project"
21
20
  />
22
21
 
23
- <common-wizards-datastore-add-local
24
- v-show="datastoreType === 'local' && !isShowCompleteBlock"
22
+ <common-wizards-datastore-new-add-local
23
+ v-show="selectedStep.id === 1"
25
24
  :mode="props.project"
26
- :step-position="stepPosition"
27
25
  :datastore-type="datastoreType"
28
26
  :local-create-name-submit="localCreateNameSubmit"
29
27
  :datacenter-hosts="props.datacenterHosts"
@@ -34,9 +32,9 @@
34
32
  />
35
33
 
36
34
  <common-wizards-datastore-add-shared-storm
37
- v-show="datastoreType === 'shared-storm' && !isShowCompleteBlock"
35
+ v-show="datastoreType === 'shared-storm'"
38
36
  :mode="props.project"
39
- :step-position="stepPosition"
37
+ :step-id="selectedStep.id"
40
38
  :datastore-type="datastoreType"
41
39
  :device-selection-submit="deviceSelectionSubmit"
42
40
  :datacenter-hosts="props.datacenterHosts"
@@ -48,9 +46,9 @@
48
46
  />
49
47
 
50
48
  <common-wizards-datastore-add-nfs
51
- v-show="datastoreType === 'nfs' && !isShowCompleteBlock"
49
+ v-show="datastoreType === 'nfs'"
52
50
  :mode="props.project"
53
- :step-position="stepPosition"
51
+ :step-id="selectedStep.id"
54
52
  :datastore-type="datastoreType"
55
53
  :nfs-configuration-submit="nfsConfigurationSubmit"
56
54
  :host-accessibility-submit="hostAccessibilitySubmit"
@@ -61,7 +59,7 @@
61
59
  />
62
60
 
63
61
  <common-wizards-datastore-add-ready-complete
64
- v-show="isShowCompleteBlock"
62
+ v-show="selectedStep.id === 11"
65
63
  :data-ready-view="dataReadyView"
66
64
  />
67
65
  </template>
@@ -175,14 +173,21 @@ const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
175
173
 
176
174
  // Choosing Scheme
177
175
  watch(
178
- [datastoreType, props.project],
179
- (newValues) => {
180
- console.log(newValues, 'newValues')
181
- const [type, project] = newValues
182
- console.log(type)
183
- console.log(project)
184
-
185
- // wizard.changeScheme(4)
176
+ datastoreType,
177
+ (newValue: UI_T_DatastoreType) => {
178
+ if (props.project === 'procurator') {
179
+ if (newValue === 'local') {
180
+ wizard.changeScheme(0)
181
+ }
182
+
183
+ if (newValue === 'shared-storm') {
184
+ wizard.changeScheme(1)
185
+ }
186
+
187
+ if (newValue === 'nfs') {
188
+ wizard.changeScheme(2)
189
+ }
190
+ }
186
191
  },
187
192
  { deep: true, immediate: true }
188
193
  )
@@ -354,44 +359,44 @@ const saveChangesAndNextNfs = (event: any, next = true): void => {
354
359
  next && onNextStep(true)
355
360
  }
356
361
 
357
- const isShowCompleteBlock = computed<boolean>(() => {
358
- // TODO refactoring
359
- const localStep = datastoreType.value === 'local' && stepPosition.value === 2
360
-
361
- const sharesStep =
362
- datastoreType.value === 'shared-storm' &&
363
- (props.project === 'procurator'
364
- ? stepPosition.value === 3
365
- : stepPosition.value === 2)
366
-
367
- let nfsFirst
368
- if (props.project === 'procurator') {
369
- nfsFirst =
370
- datastoreType.value === 'nfs' &&
371
- nfsVersion.value === 'nfs-3' &&
372
- stepPosition.value === 3
373
- } else {
374
- nfsFirst =
375
- datastoreType.value === 'nfs' &&
376
- nfsVersion.value === 'nfs-3' &&
377
- stepPosition.value === 4
378
- }
379
-
380
- let nfsSecond
381
- if (props.project === 'procurator') {
382
- nfsSecond =
383
- datastoreType.value === 'nfs' &&
384
- nfsVersion.value === 'nfs-4.1' &&
385
- stepPosition.value === 3
386
- } else {
387
- nfsSecond =
388
- datastoreType.value === 'nfs' &&
389
- nfsVersion.value === 'nfs-4.1' &&
390
- stepPosition.value === 4
391
- }
392
-
393
- return localStep || sharesStep || nfsFirst || nfsSecond
394
- })
362
+ // const isShowCompleteBlock = computed<boolean>(() => {
363
+ // // TODO refactoring
364
+ // const localStep = datastoreType.value === 'local' && stepPosition.value === 2
365
+ //
366
+ // const sharesStep =
367
+ // datastoreType.value === 'shared-storm' &&
368
+ // (props.project === 'procurator'
369
+ // ? stepPosition.value === 3
370
+ // : stepPosition.value === 2)
371
+ //
372
+ // let nfsFirst
373
+ // if (props.project === 'procurator') {
374
+ // nfsFirst =
375
+ // datastoreType.value === 'nfs' &&
376
+ // nfsVersion.value === 'nfs-3' &&
377
+ // stepPosition.value === 3
378
+ // } else {
379
+ // nfsFirst =
380
+ // datastoreType.value === 'nfs' &&
381
+ // nfsVersion.value === 'nfs-3' &&
382
+ // stepPosition.value === 4
383
+ // }
384
+ //
385
+ // let nfsSecond
386
+ // if (props.project === 'procurator') {
387
+ // nfsSecond =
388
+ // datastoreType.value === 'nfs' &&
389
+ // nfsVersion.value === 'nfs-4.1' &&
390
+ // stepPosition.value === 3
391
+ // } else {
392
+ // nfsSecond =
393
+ // datastoreType.value === 'nfs' &&
394
+ // nfsVersion.value === 'nfs-4.1' &&
395
+ // stepPosition.value === 4
396
+ // }
397
+ //
398
+ // return localStep || sharesStep || nfsFirst || nfsSecond
399
+ // })
395
400
 
396
401
  const onAddDatastore = async (): Promise<void> => {
397
402
  loading.value = true
@@ -11,7 +11,7 @@ const stepFromSharedStorm = (
11
11
  mode: UI_T_WizardDatastoreMode
12
12
  ): UI_I_VerticalStepItem[] => {
13
13
  const steps = [
14
- { text: localization.type, disabled: false, complete: false },
14
+ // { text: localization.type, disabled: false, complete: false },
15
15
  {
16
16
  text: localization.nameAndDeviceSelection,
17
17
  disabled: true,
@@ -8,7 +8,6 @@ export const stepsFunc = (
8
8
  {
9
9
  id: 0,
10
10
  title: localization.type,
11
- subTitle: localization.selectConnectionTypeToCreate,
12
11
  status: UI_E_WIZARD_STATUS.SELECTED,
13
12
  fields: {},
14
13
  isValid: true,
@@ -18,7 +17,6 @@ export const stepsFunc = (
18
17
  {
19
18
  id: 1,
20
19
  title: localization.selectDatastoreName,
21
- subTitle: localization.selectConnectionTypeToCreate,
22
20
  status: UI_E_WIZARD_STATUS.INACTIVE,
23
21
  fields: {
24
22
  datastoreName: {
@@ -29,6 +27,54 @@ export const stepsFunc = (
29
27
  isValid: true,
30
28
  testId: 'select-datastore-name',
31
29
  },
30
+ {
31
+ id: 2,
32
+ title: localization.nameAndDeviceSelection,
33
+ subTitle: localization.nameAndDeviceSelectionDesc,
34
+ status: UI_E_WIZARD_STATUS.INACTIVE,
35
+ fields: {},
36
+ isValid: true,
37
+ testId: 'select-name-and-device-selection',
38
+ },
39
+
40
+ {
41
+ id: 3,
42
+ title: localization.partitionConfiguration,
43
+ subTitle: localization.partitionConfigurationDesc,
44
+ status: UI_E_WIZARD_STATUS.INACTIVE,
45
+ fields: {},
46
+ isValid: true,
47
+ testId: 'select-partition-configuration',
48
+ },
49
+
50
+ {
51
+ id: 4,
52
+ title: localization.nfsVersion,
53
+ subTitle: localization.selectNfsVersion,
54
+ status: UI_E_WIZARD_STATUS.INACTIVE,
55
+ fields: {},
56
+ isValid: true,
57
+ testId: 'select-nfs-version',
58
+ },
59
+ {
60
+ id: 5,
61
+ title: localization.nameAndConfiguration,
62
+ subTitle: localization.nameAndConfigurationDesc,
63
+ status: UI_E_WIZARD_STATUS.INACTIVE,
64
+ fields: {},
65
+ isValid: true,
66
+ testId: 'select-name-and-configuration',
67
+ },
68
+
69
+ {
70
+ id: 6,
71
+ title: localization.hostsAccessibility,
72
+ subTitle: localization.hostsAccessibilityDesc,
73
+ status: UI_E_WIZARD_STATUS.INACTIVE,
74
+ fields: {},
75
+ isValid: true,
76
+ testId: 'select-hosts-accessibility',
77
+ },
32
78
 
33
79
  // {
34
80
  // id: 1,
@@ -138,9 +184,9 @@ export const stepsFunc = (
138
184
  // testId: 'add-physical-network-adapter',
139
185
  // },
140
186
  {
141
- id: 7,
187
+ id: 11,
142
188
  title: localization.readyComplete,
143
- subTitle: localization.reviewYourSettingsSelectionsWizard,
189
+ subTitle: localization.readyCompleteDesc,
144
190
  status: UI_E_WIZARD_STATUS.INACTIVE,
145
191
  fields: {},
146
192
  isValid: true,
@@ -149,6 +195,8 @@ export const stepsFunc = (
149
195
  ]
150
196
 
151
197
  export const stepsSchemeInitial: number[][] = [
152
- [0, 1, 7], // Procurator
153
- [0, 2, 7], // Sphere
198
+ [0, 1, 11], // Procurator Scheme for "local" type
199
+ [0, 2, 3, 11], // Procurator Scheme for "shared-storm" type
200
+ [0, 4, 5, 11], // Procurator Scheme for "nfs" type
201
+ [0, 2, 11], // Sphere
154
202
  ]
@@ -1,25 +1,22 @@
1
1
  <template>
2
2
  <div class="local-step">
3
- <span
4
- v-if="mode === 'sphere' && props.stepPosition === 1"
5
- class="vmfs-container__desc"
6
- >
3
+ <span v-if="mode === 'sphere'" class="vmfs-container__desc">
7
4
  {{ localization.nameAndDeviceSelectionDesc }}
8
5
  </span>
9
6
 
10
- <common-wizards-datastore-add-local-create-name
11
- v-show="mode === 'procurator' && props.stepPosition === 1"
7
+ <common-wizards-datastore-new-add-local-create-name
8
+ v-show="mode === 'procurator'"
12
9
  :local-create-name-submit="props.localCreateNameSubmit"
13
10
  @loading="(e) => emits('loading', e)"
14
11
  @submit="(e) => emits('submit', e)"
15
12
  />
16
13
 
17
- <common-wizards-datastore-add-shared-storm-device-selection
18
- v-show="mode === 'sphere' && props.stepPosition === 1"
14
+ <common-wizards-datastore-new-add-shared-storm-device-selection
15
+ v-show="mode === 'sphere'"
19
16
  v-model:lun-disk="selectedLunDisk"
20
17
  mode="sphere"
21
18
  :device-selection-submit="props.localCreateNameSubmit"
22
- :step-position="props.stepPosition"
19
+ :step-position="1"
23
20
  :datastore-type="props.datastoreType"
24
21
  :datacenter-hosts="props.datacenterHosts"
25
22
  :is-main-filter="props.isMainFilter"
@@ -42,7 +39,6 @@ import {
42
39
  import { UI_I_Localization } from '~/lib/models/interfaces'
43
40
 
44
41
  const props = defineProps<{
45
- stepPosition: number
46
42
  localCreateNameSubmit: number
47
43
  datastoreType: UI_T_DatastoreType
48
44
  mode: UI_T_WizardDatastoreMode
@@ -1,7 +1,5 @@
1
1
  <template>
2
2
  <div class="ready-complete">
3
- <div class="ready-complete__desc">{{ localization.readyCompleteDesc }}</div>
4
-
5
3
  <common-details-list :items="properties" class="ready-complete__list list">
6
4
  <template #default="{ item }">
7
5
  <common-details-item :has-children="true" open-by-default>
@@ -27,7 +25,11 @@
27
25
  </template>
28
26
  <template #stackBlockContent>
29
27
  <div v-if="item2.data">
30
- <div v-for="item3 in item2.data" :key="item3" class="flex-align-center">
28
+ <div
29
+ v-for="item3 in item2.data"
30
+ :key="item3"
31
+ class="flex-align-center"
32
+ >
31
33
  <div class="vsphere-icon-host"></div>
32
34
  <span>{{ item3 }}</span>
33
35
  </div>
@@ -1,12 +1,10 @@
1
1
  <template>
2
2
  <div class="vmfs-container">
3
- <span class="vmfs-container__desc">{{ stepSubTitle }}</span>
4
-
5
3
  <common-wizards-datastore-add-shared-storm-device-selection
6
- v-show="props.stepPosition === 1"
4
+ v-show="props.stepId === 2"
7
5
  v-model:lun-disk="selectedLunDisk"
8
6
  :device-selection-submit="props.deviceSelectionSubmit"
9
- :step-position="props.stepPosition"
7
+ :step-position="1"
10
8
  :datastore-type="props.datastoreType"
11
9
  :mode="props.mode"
12
10
  :datacenter-hosts="props.datacenterHosts"
@@ -24,7 +22,7 @@
24
22
  <!-- TODO в shared-storm пока верси не будет -->
25
23
 
26
24
  <common-wizards-datastore-add-shared-storm-partition-configuration
27
- v-show="props.mode === 'procurator' && props.stepPosition === 2"
25
+ v-show="props.mode === 'procurator' && props.stepId === 3"
28
26
  :vmfs-version="vmfsVersion"
29
27
  :selected-lun-disk-size="lunDiskTotalCapacity"
30
28
  />
@@ -42,11 +40,10 @@ import {
42
40
  UI_I_SelectHostOptions,
43
41
  UI_I_CreateStorageLunDiskItem,
44
42
  } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
45
- import { subTitleFunc } from '~/components/common/wizards/datastore/add/lib/config/stepItems'
46
43
 
47
44
  const props = defineProps<{
48
45
  mode: UI_T_WizardDatastoreMode
49
- stepPosition: number
46
+ stepId: number
50
47
  deviceSelectionSubmit: number
51
48
  datastoreType: UI_T_DatastoreType
52
49
  datacenterHosts?: UI_I_SelectHostOptions[]
@@ -71,11 +68,6 @@ const lunDiskTotalCapacity = computed<number>(() => {
71
68
  .map((disk) => disk.capacity_mb)
72
69
  .reduce((acc, cur) => acc + cur)
73
70
  })
74
-
75
- const stepSubTitle = computed<string>(() => {
76
- const { datastoreType, stepPosition } = props
77
- return subTitleFunc(localization.value, datastoreType, stepPosition)
78
- })
79
71
  </script>
80
72
 
81
73
  <style lang="scss" scoped>
@@ -86,6 +78,7 @@ const stepSubTitle = computed<string>(() => {
86
78
  overflow-x: hidden;
87
79
  height: 100%;
88
80
  &_desc {
81
+
89
82
  }
90
83
  }
91
84
  </style>
@@ -132,6 +132,7 @@ import {
132
132
  import {
133
133
  UI_I_ValidationReturn,
134
134
  UI_I_WizardStep,
135
+ UI_I_WizardStepNavigation,
135
136
  } from '~/components/atoms/wizard/lib/models/interfaces'
136
137
  import { UI_E_ValidationFields } from '~/components/common/wizards/network/add/lib/models/enums'
137
138
  import { getVlanId } from '~/components/common/wizards/network/add/lib/utils'
@@ -252,7 +253,8 @@ const onChangeTargetDevice = (newTargetDevice: UI_I_TargetDevice): void => {
252
253
  }
253
254
 
254
255
  const selectedSwitch = props.standardSwitchesInitial.find(
255
- (sw) => newTargetDevice.standardSwitch === sw.name
256
+ (currentSwitch: UI_I_Switch) =>
257
+ newTargetDevice.standardSwitch === currentSwitch.name
256
258
  )
257
259
 
258
260
  if (newTargetDeviceSelected === '1' && selectedSwitch) {
@@ -365,7 +367,8 @@ watch(
365
367
  }
366
368
  if (newSelectedStep === 6 && flagSwitch !== targetDevice.value.switch) {
367
369
  const nics = props.standardSwitchesInitial.find(
368
- (sw) => sw.id === targetDevice.value.switch
370
+ (currentSwitch: UI_I_Switch) =>
371
+ currentSwitch.id === targetDevice.value.switch
369
372
  ).nics
370
373
  adapterStatus.value = {
371
374
  active: nics.active || [],
@@ -465,6 +468,20 @@ const onHideNoActiveAdaptersModal = (): void => {
465
468
  const onConfirmNoActiveAdaptersModal = (): void => {
466
469
  onHideNoConnectedActiveAdaptersModal()
467
470
  onHideNoActiveAdaptersModal()
471
+ if (wizard.waitingStepId === 7) {
472
+ wizard.changeSteps(
473
+ wizard.selectedStepData(
474
+ wizard.stepsInSelectedSchemeWithStatus.value.find(
475
+ (step: UI_I_WizardStepNavigation) => step.id === 7
476
+ )
477
+ ),
478
+ validationFunc,
479
+ finalValidationFunc,
480
+ true
481
+ )
482
+ wizard.waitingStepId = -1
483
+ return
484
+ }
468
485
  wizard.selectStepHard(wizard.waitingStepId)
469
486
  }
470
487
 
@@ -597,7 +614,8 @@ const validationFunc = async (
597
614
  nextStep.id,
598
615
  props.freeAdapters,
599
616
  showNoActiveAdaptersModal,
600
- showNoConnectedActiveAdaptersModal
617
+ showNoConnectedActiveAdaptersModal,
618
+ 2
601
619
  )
602
620
 
603
621
  value = adapterValidation.newValue
@@ -676,21 +694,27 @@ const validationFunc = async (
676
694
  connectionSettingsValidation.stepHasError
677
695
  }
678
696
 
679
- // if (wizard.isValidateForStep(6, currentStep.id, nextStep.id)) {
680
- // const connectionSettingsValidation = checkConnectionSettingsSync(
681
- // localization.value,
682
- // connectionSettings.value,
683
- // wizard,
684
- // value
685
- // )
686
- //
687
- // value = connectionSettingsValidation.newValue
688
- //
689
- // stepHasError =
690
- // stepHasError ||
691
- // labelValidation.stepHasError ||
692
- // connectionSettingsValidation.stepHasError
693
- // }
697
+ if (wizard.isValidateForStep(6, currentStep.id, nextStep.id)) {
698
+ wizard.waitingStepId = nextStep.id
699
+
700
+ const adapterValidation = checkAdaptersSync(
701
+ localization.value,
702
+ adapterStatus.value,
703
+ value,
704
+ currentStep.id,
705
+ nextStep.id,
706
+ props.adapters.items,
707
+ showNoActiveAdaptersModal,
708
+ showNoConnectedActiveAdaptersModal,
709
+ 6
710
+ )
711
+
712
+ value = adapterValidation.newValue
713
+
714
+ stepShouldStop = adapterValidation.stepShouldStop || stepShouldStop
715
+
716
+ stepHasError = stepHasError || adapterValidation.stepHasError
717
+ }
694
718
 
695
719
  return {
696
720
  newValue: value,
@@ -16,17 +16,18 @@ export const checkAdaptersSync = (
16
16
  nextStepId: number,
17
17
  freeAdapters: UI_I_Adapter[],
18
18
  showNoActiveAdaptersModal: () => void,
19
- showNoConnectedActiveAdaptersModal: () => void
19
+ showNoConnectedActiveAdaptersModal: () => void,
20
+ stoppageStepId: number
20
21
  ): UI_I_ValidationReturn => {
21
22
  const stepShouldStop = {
22
23
  ifOnCurrentStep: false,
23
24
  ifFromAnyStep: false,
24
- stoppageStepId: 2,
25
+ stoppageStepId,
25
26
  }
26
27
 
27
28
  const isOnStoppageStep = currentStepId === stepShouldStop.stoppageStepId
28
29
 
29
- if (isOnStoppageStep && data.active.length === 0) {
30
+ if (isOnStoppageStep && data.active?.length === 0) {
30
31
  stepShouldStop.ifOnCurrentStep = true
31
32
  showNoActiveAdaptersModal()
32
33
  }
@@ -38,14 +39,14 @@ export const checkAdaptersSync = (
38
39
  stepShouldStop,
39
40
  }
40
41
 
41
- const activeAndConnectedAdapters = data.active.filter(
42
+ const activeAndConnectedAdapters = data.active?.filter(
42
43
  (adapterName: string) =>
43
44
  freeAdapters.find(
44
45
  (freeAdapter: UI_I_Adapter) => freeAdapter.name === adapterName
45
46
  )?.carrier
46
47
  )
47
48
 
48
- if (isOnStoppageStep && activeAndConnectedAdapters.length === 0) {
49
+ if (isOnStoppageStep && activeAndConnectedAdapters?.length === 0) {
49
50
  stepShouldStop.ifOnCurrentStep = true
50
51
  showNoConnectedActiveAdaptersModal()
51
52
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.418",
4
+ "version": "1.3.420",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",