bfg-common 1.3.434 → 1.3.436

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.
@@ -37,10 +37,13 @@
37
37
  :project="props.project"
38
38
  :step-id="selectedStep.id"
39
39
  :datastore-type="datastoreType"
40
+ :alert-messages="alertMessages[selectedStep.id]"
41
+ :messages-fields="selectedStep.fields"
40
42
  :device-selection-submit="deviceSelectionSubmit"
41
43
  :datacenter-hosts="props.datacenterHosts"
42
44
  :is-main-filter="props.isMainFilter"
43
45
  :host-id="props.hostId"
46
+ @hide-alert="onHideAlert"
44
47
  @loading="(e) => (loading = e)"
45
48
  @submit="onSaveAndNextSharedStorm"
46
49
  @main-filter="emits('main-filter', $event)"
@@ -3,14 +3,16 @@
3
3
  <common-wizards-datastore-new-add-shared-storm-device-selection
4
4
  v-show="props.stepId === 2"
5
5
  v-model="model"
6
- v-model:lun-disk="[]"
7
6
  :step-id="props.stepId"
7
+ :alert-messages="props.alertMessages"
8
+ :messages-fields="props.messagesFields"
8
9
  :device-selection-submit="0"
9
10
  :datastore-type="props.datastoreType"
10
11
  :project="props.project"
11
12
  :datacenter-hosts="props.datacenterHosts"
12
13
  :is-main-filter="props.isMainFilter"
13
14
  :host-id="props.hostId"
15
+ @hide-alert="(e) => emits('hide-alert', e)"
14
16
  @loading="(e) => emits('loading', e)"
15
17
  @main-filter="emits('main-filter', $event)"
16
18
  />
@@ -30,21 +32,27 @@
30
32
  </template>
31
33
 
32
34
  <script lang="ts" setup>
33
- import { UI_I_Localization } from '~/lib/models/interfaces'
35
+ import {
36
+ UI_I_Localization,
37
+ UI_I_ArbitraryObject,
38
+ } from '~/lib/models/interfaces'
34
39
  import { UI_T_Project } from '~/lib/models/types'
40
+ import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
35
41
  import {
36
42
  UI_T_DatastoreType,
37
43
  UI_T_VmfsType,
38
44
  } from '~/components/common/wizards/datastore/add/lib/models/types'
39
45
  import {
40
46
  UI_I_SelectHostOptions,
41
- UI_I_CreateStorageLunDiskItem,
47
+ // UI_I_CreateStorageLunDiskItem,
42
48
  } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
43
49
 
44
50
  const props = defineProps<{
45
51
  project: UI_T_Project
46
52
  stepId: number
47
53
  datastoreType: UI_T_DatastoreType
54
+ alertMessages: string[]
55
+ messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
48
56
  datacenterHosts?: UI_I_SelectHostOptions[]
49
57
  isMainFilter?: boolean
50
58
  hostId?: string
@@ -52,6 +60,7 @@ const props = defineProps<{
52
60
  const model = defineModel<any>()
53
61
  const emits = defineEmits<{
54
62
  // (event: 'submit', value: { name: string; lunDisk: string[] }): void
63
+ (event: 'hide-alert', value: boolean): void
55
64
  (event: 'loading', value: boolean): void
56
65
  (event: 'main-filter', value: string): void
57
66
  }>()
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
  <div class="device-selection">
3
3
  <atoms-alert
4
- v-show="errors.length"
4
+ v-show="props.alertMessages.length"
5
5
  test-id="device-selection-errors"
6
6
  status="alert-danger"
7
- :items="errors"
8
- @remove="onCloseAlertDanger"
7
+ :items="props.alertMessages"
8
+ @remove="onHideAlert"
9
9
  />
10
10
 
11
11
  <div class="clr-form-control clr-row">
@@ -99,7 +99,10 @@
99
99
  import { UI_T_Project } from '~/lib/models/types'
100
100
  import { UI_I_ValidationTouchResult } from '~/lib/models/plugins/validation/interfaces'
101
101
  // import { UI_I_SchemaTablePayload } from '~/lib/models/store/interfaces'
102
- import { UI_I_Localization } from '~/lib/models/interfaces'
102
+ import {
103
+ UI_I_Localization,
104
+ UI_I_ArbitraryObject,
105
+ } from '~/lib/models/interfaces'
103
106
  import {
104
107
  API_UI_I_DataTable,
105
108
  UI_I_Pagination,
@@ -112,6 +115,7 @@ import {
112
115
  UI_I_LunDiskSpherePayload,
113
116
  UI_I_SelectHostOptions,
114
117
  } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
118
+ import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
115
119
  // import { Ui_T_HostSelectedType } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/types'
116
120
  import { UI_T_DatastoreType } from '~/components/common/wizards/datastoreNew/add/lib/models/types'
117
121
  import { defaultFormFunc } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/config/defaultForm'
@@ -121,8 +125,9 @@ import { checkValidityName } from '~/components/common/wizards/datastoreNew/add/
121
125
  const props = defineProps<{
122
126
  project: UI_T_Project
123
127
  stepId: number
128
+ alertMessages: string[]
129
+ messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
124
130
  deviceSelectionSubmit: number
125
- lunDisk: UI_I_CreateStorageLunDiskItem[]
126
131
  datastoreType: UI_T_DatastoreType
127
132
  datacenterHosts?: UI_I_SelectHostOptions[] | undefined
128
133
  isMainFilter?: boolean
@@ -131,6 +136,7 @@ const props = defineProps<{
131
136
  const model = defineModel<any>()
132
137
  const emits = defineEmits<{
133
138
  (event: 'loading', value: boolean): void
139
+ (event: 'hide-alert', value: number): void
134
140
  (event: 'submit', value: UI_I_DeviceSelectionSendData): void
135
141
  (event: 'main-filter', value: string): void
136
142
  }>()
@@ -183,7 +189,7 @@ const pagination = ref<UI_I_Pagination>({
183
189
  })
184
190
  const sort = ref<string | null>(null)
185
191
 
186
- const selectedLunDisk = ref<number[]>([])
192
+ // const selectedLunDisk = ref<number[]>([])
187
193
 
188
194
  const updatePagination = (event: UI_I_Pagination): void => {
189
195
  pagination.value = event
@@ -238,9 +244,6 @@ const resetValidation = (): void => {
238
244
  const removeInputValidation = (): void => {
239
245
  formErrors.value = []
240
246
  }
241
- const onCloseAlertDanger = (): void => {
242
- errors.value = []
243
- }
244
247
  const validatePropertiesForSphere = (): boolean => {
245
248
  if (props.datastoreType === 'local') {
246
249
  return !selectedHost.value
@@ -287,7 +290,7 @@ const collectDataForReview = (
287
290
 
288
291
  if (props.datastoreType === 'shared-storm') {
289
292
  data.host = selectedHost.value
290
- data.lunDisk = props.lunDisk.map((lun) => {
293
+ data.lunDisk = model.value.lunDisk.map((lun) => {
291
294
  return { name: lun.name, capacity: lun.capacity_mb }
292
295
  })
293
296
  }
@@ -369,9 +372,14 @@ const initLunDisksDataTable = async (): Promise<void> => {
369
372
  } as UI_I_DataTableQuery)
370
373
  }
371
374
 
372
- if (props.project === 'procurator' ) { // && props.stepId === 2
375
+ if (props.project === 'procurator') {
376
+ // && props.stepId === 2
373
377
  initLunDisksDataTable()
374
378
  }
379
+
380
+ const onHideAlert = (): void => {
381
+ emits('hide-alert', props.stepId)
382
+ }
375
383
  </script>
376
384
 
377
385
  <style lang="scss" scoped>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.434",
4
+ "version": "1.3.436",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",