bfg-common 1.5.98 → 1.5.99

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.
@@ -9,6 +9,7 @@
9
9
  :selected-node="props.selectedNode"
10
10
  :title="title"
11
11
  :nfs-hosts="props.nfsHosts"
12
+ :host-id="props.hostId"
12
13
  @change-steps="onChangeSteps"
13
14
  @hide="onHideModal"
14
15
  @submit="onCreateDatastore"
@@ -23,6 +24,7 @@
23
24
  :selected-node="props.selectedNode"
24
25
  :title="title"
25
26
  :nfs-hosts="props.nfsHosts"
27
+ :host-id="props.hostId"
26
28
  @change-steps="onChangeSteps"
27
29
  @hide-alert="onHideAlert"
28
30
  @hide="onHideModal"
@@ -8,6 +8,7 @@
8
8
  :host-id="props.hostId"
9
9
  :lun-disks-data="lunDisksData"
10
10
  :host-options="hostOptions"
11
+ :is-show-select-host="isShowSelectHost"
11
12
  :is-main-filter="props.isMainFilter"
12
13
  :pagination="pagination"
13
14
  :loading="loading"
@@ -24,6 +25,7 @@
24
25
  :host-id="props.hostId"
25
26
  :lun-disks-data="lunDisksData"
26
27
  :host-options="hostOptions"
28
+ :is-show-select-host="isShowSelectHost"
27
29
  :is-main-filter="props.isMainFilter"
28
30
  :pagination="pagination"
29
31
  :loading="loading"
@@ -72,6 +74,9 @@ const { $store }: any = useNuxtApp()
72
74
 
73
75
  const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
74
76
 
77
+ const isShowSelectHost = computed<boolean>(
78
+ () => props.project === 'sphere' && !props.hostId
79
+ )
75
80
  const isShowAlertInfo = ref<boolean>(true)
76
81
  const pagination = ref<UI_I_Pagination>({
77
82
  page: 1,
@@ -1,5 +1,7 @@
1
1
  <template>
2
2
  <div class="name-and-device">
3
+ {{ nameErrorText }}
4
+
3
5
  <div class="name-and-device__disk-list">
4
6
  <common-wizards-datastore-add-steps-name-and-device-table
5
7
  v-model="formModelLocal.lunDisk"
@@ -24,11 +26,8 @@ import type {
24
26
  import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
25
27
  import type { UI_I_SelectHostOptions } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
26
28
  import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
27
- import type { UI_I_CompatibleHosts } from '~/components/common/wizards/datastore/add/steps/hostAccessibility/table/lib/models/interfaces'
28
- import type { UI_T_DatastoreTypeCode } from '~/components/common/wizards/datastore/add/lib/models/types'
29
29
  import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
30
30
  import type { UI_I_CreateStorageLunDisks } from '~/components/common/wizards/datastore/add/steps/nameAndDevice/table/lib/models/interfaces'
31
- import { validateNameAndGenerateDataId } from '~/components/common/wizards/datastore/add/lib/utils'
32
31
 
33
32
  const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
34
33
  const isShowInfoAlert = defineModel<boolean>('isShowInfoAlert', {
@@ -40,10 +39,7 @@ const props = defineProps<{
40
39
  hostOptions: UI_I_SelectHostOptions[]
41
40
  alertMessages: string[]
42
41
  messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
43
- datastoreType: UI_T_DatastoreTypeCode
44
- hosts?: UI_I_CompatibleHosts | undefined
45
42
  isMainFilter?: boolean
46
- hostId?: string
47
43
  loading: boolean
48
44
  }>()
49
45
  const emits = defineEmits<{
@@ -55,53 +51,18 @@ const localization = computed<UI_I_Localization>(() => useLocal())
55
51
  const isInitDatastoreNameValidation = ref<boolean>(false)
56
52
 
57
53
  const nameErrorText = computed<string>(() => {
58
- if (props.messagesFields?.datastoreName?.field && !model.value.name) {
54
+ if (
55
+ props.messagesFields?.datastoreName?.field &&
56
+ !formModelLocal.value.name
57
+ ) {
59
58
  return props.messagesFields.datastoreName.field
60
59
  }
61
60
 
62
61
  if (!isInitDatastoreNameValidation.value) return ''
63
- return !model.value.name ? localization.value.common.specifyDatastoreName : ''
64
- })
65
-
66
- const defaultDataId = ref<string>('device-selection-alert-error')
67
- const errorAlertDataId = computed<string>(() => {
68
- if (!props.alertMessages?.length) return
69
-
70
- return !model.value.lunDisk.length
71
- ? `${defaultDataId.value}-not-selected-lundisk`
72
- : validateNameAndGenerateDataId(
73
- model.value.name,
74
- props.alertMessages[0],
75
- defaultDataId.value
76
- )
77
- })
78
-
79
- const alertInfo = ref<boolean>(true)
80
-
81
- /* Lun disk table */
82
-
83
- const pagination = ref<UI_I_Pagination>({
84
- page: 1,
85
- pageSize: 35,
62
+ return !formModelLocal.value.name
63
+ ? localization.value.common.specifyDatastoreName
64
+ : ''
86
65
  })
87
- const sort = ref<string | null>(null)
88
-
89
- const updatePagination = (event: UI_I_Pagination): void => {
90
- pagination.value = event
91
- }
92
- const sortTable = (event: string): void => {
93
- sort.value = event
94
-
95
- props.project === 'procurator'
96
- ? initLunDisksDataTable()
97
- : initLunDisksForSphere(model.value.hosts[0])
98
- }
99
-
100
- const onSelectHost = (): void => {
101
- if (props.datastoreType !== 'shared-storm') return // TODO рефакторинг ( удалить проверку )
102
-
103
- initLunDisksForSphere(model.value.hosts[0])
104
- }
105
66
  </script>
106
67
 
107
68
  <style lang="scss" scoped>
@@ -34,7 +34,7 @@
34
34
  </div>
35
35
 
36
36
  <atoms-alert
37
- v-if="isShowInfoAlert"
37
+ v-if="isShowInfoAlert && !props.hostId"
38
38
  test-id="device-selection-information-alert"
39
39
  class="device-selection-step__alert-info"
40
40
  status="alert-info"
@@ -42,10 +42,7 @@
42
42
  @remove="isShowInfoAlert = false"
43
43
  />
44
44
 
45
- <div
46
- v-if="props.project === 'sphere' && !props.hostId"
47
- class="clr-form-control clr-row mb-1"
48
- >
45
+ <div v-if="props.isShowSelectHost" class="clr-form-control clr-row mb-1">
49
46
  <label class="clr-control-label clr-col-12 clr-col-md-2">
50
47
  {{ localization.common.selectHost }}
51
48
  </label>
@@ -109,13 +106,14 @@ const isShowInfoAlert = defineModel<boolean>('isShowInfoAlert', {
109
106
  })
110
107
  const props = defineProps<{
111
108
  project: UI_T_Project
112
- alertMessages: string[]
113
- messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
114
- isMainFilter?: boolean
115
- hostId?: string
116
109
  lunDisksData: UI_I_CreateStorageLunDisks
117
110
  hostOptions: UI_I_SelectHostOptions[]
111
+ alertMessages: string[]
112
+ messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
118
113
  pagination: UI_I_Pagination
114
+ hostId?: string
115
+ isShowSelectHost: boolean
116
+ isMainFilter?: boolean
119
117
  loading: boolean
120
118
  }>()
121
119
  const emits = defineEmits<{
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.98",
4
+ "version": "1.5.99",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",