bfg-common 1.5.87 → 1.5.88

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 (18) hide show
  1. package/components/common/wizards/datastore/add/Add.vue +7 -1
  2. package/components/common/wizards/datastore/add/New.vue +2 -15
  3. package/components/common/wizards/datastore/add/Old.vue +0 -10
  4. package/components/common/wizards/datastore/add/lib/config/steps.ts +1 -1
  5. package/components/common/wizards/datastore/add/lib/validations.ts +4 -4
  6. package/components/common/wizards/datastore/add/steps/hostAccessibility/table/new/New.vue +1 -0
  7. package/components/common/wizards/datastore/add/steps/nameAndConfigure/_serversList/ServersList.vue +2 -1
  8. package/package.json +1 -1
  9. package/components/common/wizards/datastore/add/nfs/Nfs.vue +0 -44
  10. package/components/common/wizards/datastore/add/nfs/accessibility/Accessibility.vue +0 -60
  11. package/components/common/wizards/datastore/add/nfs/accessibility/lib/config/tabsPannel.ts +0 -31
  12. package/components/common/wizards/datastore/add/nfs/accessibility/lib/models/interfaces.ts +0 -9
  13. package/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types.ts +0 -5
  14. package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/TablesView.vue +0 -85
  15. package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +0 -62
  16. package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/incompatibleTable.ts +0 -68
  17. package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/tableKeys.ts +0 -15
  18. package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces.ts +0 -11
@@ -160,7 +160,13 @@ const validationFunc = async (
160
160
  serverValidation.stepHasError
161
161
  }
162
162
 
163
- if (wizard.isValidateForStep(6, currentStep.id, nextStep.id)) {
163
+ if (
164
+ wizard.isValidateForStep(
165
+ dynamicSteps.hostAccessibility,
166
+ currentStep.id,
167
+ nextStep.id
168
+ )
169
+ ) {
164
170
  const nameValidation = await validation.checkHostsAccessibilitySync(
165
171
  localization.value,
166
172
  form.value.hosts,
@@ -110,7 +110,7 @@
110
110
  v-if="
111
111
  props.alertMessages[dynamicSteps.hostAccessibility].length
112
112
  "
113
- test-id="add-host-assign-license-error-alert"
113
+ test-id="add-host-accessibility-error-alert"
114
114
  type="error"
115
115
  size="md"
116
116
  :messages="props.alertMessages[dynamicSteps.hostAccessibility]"
@@ -163,7 +163,6 @@ import type {
163
163
  import type Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
164
164
  import type { UI_I_Localization } from '~/lib/models/interfaces'
165
165
  import type { UI_T_Project } from '~/lib/models/types'
166
- import type { UI_T_DatastoreTypeCode } from '~/components/common/wizards/datastore/add/lib/models/types'
167
166
  import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
168
167
  import type { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
169
168
  import type { UI_I_CompatibleHosts } from '~/components/common/wizards/datastore/add/steps/hostAccessibility/table/lib/models/interfaces'
@@ -218,25 +217,13 @@ const { height: height3 } = useElementSize(subTitleBlock3)
218
217
  const subTitleBlock4 = ref<HTMLElement | null>(null)
219
218
  const { height: height4 } = useElementSize(subTitleBlock4)
220
219
 
221
- const datastoreType = ref<UI_T_DatastoreTypeCode>(2)
222
- const form = ref<UI_I_CreateDatastoreForm>({
223
- name: 'Datastore',
224
- lunDisk: [],
225
- hosts: props.hostId ? [props?.hostId] : [],
226
- type_code: 2,
227
- nfsVersion: 'nfs-4.1',
228
- readonly: false,
229
- server: '',
230
- folder: '',
231
- })
232
-
233
220
  const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
234
221
  emits('change-steps', value)
235
222
 
236
223
  const dataReadyView = computed<UI_I_DetailsItem>(() =>
237
224
  constructDataReadyViewFunc(
238
225
  localization.value,
239
- form.value,
226
+ formModelLocal.value,
240
227
  props.project,
241
228
  props.nfsHosts
242
229
  )
@@ -67,16 +67,6 @@
67
67
  @hide-alert="onHideAlert"
68
68
  @main-filter="emits('main-filter', $event)"
69
69
  />
70
-
71
- <common-wizards-datastore-add-nfs
72
- v-if="datastoreType === 'nfs'"
73
- v-model="formModelLocal"
74
- :project="props.project"
75
- :step-id="selectedStep.id"
76
- :alert-messages="alertMessages[selectedStep.id]"
77
- :messages-fields="selectedStep.fields"
78
- :hosts="props.nfsHosts"
79
- />
80
70
  </template>
81
71
  </atoms-wizard>
82
72
  </div>
@@ -9,7 +9,7 @@ export const dynamicSteps = {
9
9
  nameAndDevice: 1,
10
10
  nameAndConfigure: 2,
11
11
  hostAccessibility: 3,
12
- readyComplete: 6,
12
+ readyComplete: 4,
13
13
  }
14
14
  export const stepsFunc = (
15
15
  localization: UI_I_Localization
@@ -163,19 +163,19 @@ export const checkNfsServerSync = (
163
163
 
164
164
  export const checkHostsAccessibilitySync = (
165
165
  localization: UI_I_Localization,
166
- hosts: any,
166
+ hosts: string[],
167
167
  wizard: Wizard,
168
168
  value: UI_I_WizardStep[]
169
169
  ): UI_I_ValidationReturn => {
170
170
  let stepHasError = false
171
171
 
172
172
  if (!hosts.length) {
173
- stepHasError = wizard.setValidation(5, 'hostsAccessibility', {
173
+ stepHasError = wizard.setValidation(dynamicSteps.hostAccessibility, 'hostsAccessibility', {
174
174
  fieldMessage: '',
175
175
  alertMessage: localization.common.selectLeastEntityContinue,
176
176
  })
177
- } else if (wizard.hasMessage(5, 'hostsAccessibility')) {
178
- value = wizard.removeValidation(5, 'hostsAccessibility', value)
177
+ } else if (wizard.hasMessage(dynamicSteps.hostAccessibility, 'hostsAccessibility')) {
178
+ value = wizard.removeValidation(dynamicSteps.hostAccessibility, 'hostsAccessibility', value)
179
179
  }
180
180
 
181
181
  return {
@@ -112,6 +112,7 @@ const onSelectRow = (value: UI_I_DataTableBody[]): void => {
112
112
  margin-bottom: 12px;
113
113
  }
114
114
  .icon {
115
+ margin-right: 4px;
115
116
  }
116
117
  }
117
118
  </style>
@@ -1,4 +1,5 @@
1
1
  <template>
2
+ <!-- TODO: если использовать этот компонент, нужно отрефакторить весь код — сейчас всё по-старому -->
2
3
  <div class="servers-list">
3
4
  <atoms-table-data-grid
4
5
  v-model:selected-row="selectedDisk"
@@ -25,7 +26,7 @@
25
26
  <atoms-the-icon name="ellipsis-vertical" />
26
27
  </template>
27
28
  <template #content>
28
- <common-wizards-datastore-add-nfs-configuration-servers-list-delete-popover
29
+ <common-wizards-datastore-add-steps-name-and-configure-servers-list-delete-popover
29
30
  v-if="showTooltip && item[0].id === selectedServerForRemove"
30
31
  class="data-table__popover"
31
32
  @hide="showTooltip = false"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.87",
4
+ "version": "1.5.88",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -1,44 +0,0 @@
1
- <template>
2
- <div class="nfs-container">
3
- <common-wizards-datastore-add-nfs-accessibility
4
- v-if="showHostAccessibility"
5
- v-model="model.hosts"
6
- :alert-messages="props.alertMessages"
7
- :hosts="props.hosts"
8
- @hide-alert="(e) => emits('hide-alert', e)"
9
- />
10
- </div>
11
- </template>
12
-
13
- <script lang="ts" setup>
14
- import type { UI_I_ArbitraryObject } from '~/lib/models/interfaces'
15
- import type { UI_T_Project } from '~/lib/models/types'
16
- import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
17
- import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
18
-
19
- const props = defineProps<{
20
- project: UI_T_Project
21
- stepId: number
22
- alertMessages: string[]
23
- messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
24
- hosts?: any
25
- }>()
26
- const model = defineModel<UI_I_CreateDatastoreForm>({ required: true })
27
- const emits = defineEmits<{
28
- (event: 'hide-alert', value: number): void
29
- }>()
30
-
31
- const showHostAccessibility = computed<boolean>(() => {
32
- return props.project === 'sphere' && props.stepId === 5
33
- })
34
- </script>
35
-
36
- <style lang="scss" scoped>
37
- @import '~/assets/scss/common/mixins.scss';
38
- .nfs-container {
39
- @include flex($dir: column);
40
- height: inherit;
41
- &__desc {
42
- }
43
- }
44
- </style>
@@ -1,60 +0,0 @@
1
- <template>
2
- <div class="host-accessibility">
3
- <atoms-alert
4
- v-show="props.alertMessages?.length"
5
- test-id="accessibility"
6
- status="alert-danger"
7
- :items="props.alertMessages"
8
- @remove="onHideAlert"
9
- />
10
-
11
- <atoms-tabs
12
- v-model="activeTab"
13
- test-id="accessibility"
14
- :items="tabs"
15
- size="small"
16
- class="w-100"
17
- />
18
- <common-wizards-datastore-add-nfs-accessibility-tables-view
19
- v-model="modelHosts"
20
- :data-table="dataTable?.items || []"
21
- :total-items="dataTable?.total_items || 0"
22
- :total-pages="dataTable?.total_pages || 1"
23
- :table-type="activeTab"
24
- />
25
- </div>
26
- </template>
27
-
28
- <script lang="ts" setup>
29
- import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
30
- import type { UI_I_Localization } from '~/lib/models/interfaces'
31
- import type { T_HostsAccessibilityTab } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types'
32
- import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
33
- import { hostAccessibilityTabsFunc } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/config/tabsPannel'
34
-
35
- const props = defineProps<{
36
- alertMessages: string[]
37
- hosts?: UI_I_CreateDatastoreHosts
38
- }>()
39
- const modelHosts = defineModel<string[]>()
40
- const emits = defineEmits<{
41
- (event: 'hide-alert', value: number): void
42
- }>()
43
-
44
- const localization = computed<UI_I_Localization>(() => useLocal())
45
-
46
- const activeTab = ref<T_HostsAccessibilityTab>('compatible-hosts')
47
- const tabs = computed<UI_I_CollapseNavItem[]>(() =>
48
- hostAccessibilityTabsFunc(localization.value, [
49
- (props.hosts?.items?.length || 0) + '',
50
- '0',
51
- ])
52
- )
53
-
54
- const dataTable = computed<UI_I_CreateDatastoreHosts>(() => props.hosts)
55
- const onHideAlert = (): void => {
56
- emits('hide-alert', 6)
57
- }
58
- </script>
59
-
60
- <style lang="scss" scoped></style>
@@ -1,31 +0,0 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
3
-
4
- export const hostAccessibilityTabsFunc = (
5
- localization: UI_I_Localization,
6
- hosts: string[]
7
- ) => {
8
- const [compatibleHosts, incompatibleHost] = hosts
9
-
10
- const tabs: UI_I_CollapseNavItem[] = [
11
- {
12
- text: localization.common.compatibleHosts.replace(
13
- '{0}',
14
- compatibleHosts || ''
15
- ),
16
- value: 'compatible-hosts',
17
- disabled: false,
18
- testId: 'host-accessibility-compatible',
19
- },
20
- {
21
- text: localization.common.incompatibleHosts.replace(
22
- '{0}',
23
- incompatibleHost || ''
24
- ),
25
- value: 'incompatible-hosts',
26
- disabled: true,
27
- testId: 'host-accessibility-incompatible',
28
- },
29
- ]
30
- return tabs
31
- }
@@ -1,9 +0,0 @@
1
- export interface I_CompatibleHostsTable {
2
- id: number,
3
- host: string,
4
- cluster: string
5
- }
6
-
7
- export interface I_IncompatibleHostsTable extends I_CompatibleHostsTable{
8
- host_incompatibility_reason: string
9
- }
@@ -1,5 +0,0 @@
1
- export type T_HostsAccessibilityTab = 'compatible-hosts' | 'incompatible-hosts'
2
-
3
- export type T_CompatibleHostsTableKeys = 'host' | 'cluster'
4
-
5
- export type T_IncompatibleHostsTableKeys = 'host' | 'cluster' | 'host_incompatibility_reason'
@@ -1,85 +0,0 @@
1
- <template>
2
- <div class="data-table-view">
3
- <div>
4
- <atoms-table-data-grid
5
- v-model:selected-row="selectedHostsIdLocal"
6
- v-model:page-size="pagination.pageSize"
7
- v-model:page="pagination.page"
8
- type="checkbox"
9
- class="data-table"
10
- test-id="accessibility-table"
11
- :head-items="headItems"
12
- :body-items="bodyItems"
13
- :total-items="props.totalItems"
14
- :total-pages="props.totalPages"
15
- hide-page-size
16
- :loading="loading"
17
- server-off
18
- >
19
- <template #icon="{ item }">
20
- <span :class="['datagrid-cell-icon', item.data.iconClassName]" />
21
- <span class="text-ellipsis">
22
- {{ item.text }}
23
- </span>
24
- </template>
25
- </atoms-table-data-grid>
26
- </div>
27
- </div>
28
- </template>
29
-
30
- <script lang="ts" setup>
31
- import type {
32
- UI_I_HeadItem,
33
- UI_I_BodyItem,
34
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
35
- import type { UI_I_Localization } from '~/lib/models/interfaces'
36
- import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
37
- import type { T_HostsAccessibilityTab } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types'
38
- import {
39
- I_CompatibleHostsTable,
40
- I_IncompatibleHostsTable,
41
- } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/interfaces'
42
- import * as compatibleTable from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/compatibleTable'
43
- import * as incompatibleTable from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/incompatibleTable'
44
-
45
- const props = defineProps<{
46
- dataTable: I_CompatibleHostsTable[] | I_IncompatibleHostsTable[]
47
- tableType: T_HostsAccessibilityTab
48
- totalItems: number
49
- totalPages: number
50
- }>()
51
- const selectedHostsIdLocal = defineModel<string[]>()
52
-
53
- const localization = computed<UI_I_Localization>(() => useLocal())
54
-
55
- const loading = computed<boolean>(() => false)
56
-
57
- const pagination = ref<UI_I_Pagination>({
58
- page: 1,
59
- pageSize: 1,
60
- })
61
-
62
- const tables: any = {
63
- 'compatible-hosts': compatibleTable,
64
- 'incompatible-hosts': incompatibleTable,
65
- }
66
-
67
- const headItems = computed<UI_I_HeadItem[]>(() =>
68
- tables[props.tableType].headItems(localization.value)
69
- )
70
- const bodyItems = computed<UI_I_BodyItem[][]>(() => {
71
- return tables[props.tableType].bodyItems(props.dataTable)
72
- })
73
- </script>
74
-
75
- <style lang="scss" scoped>
76
- .data-table-view {
77
- height: inherit;
78
- .data-table {
79
- height: inherit;
80
- :deep(.datagrid-outer-wrapper) {
81
- height: inherit;
82
- }
83
- }
84
- }
85
- </style>
@@ -1,62 +0,0 @@
1
- import type {
2
- UI_I_HeadItem,
3
- UI_I_BodyItem,
4
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
5
- import type { UI_I_Localization } from '~/lib/models/interfaces'
6
- import { constructHeadItem } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
7
- import type { I_CompatibleHostsTable } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/interfaces'
8
- import { compatibleHostsTableKeys } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/tableKeys'
9
- import {
10
- hostIconByState,
11
- clusterIconByState,
12
- } from '~/components/common/lib/config/states'
13
-
14
- const getItems = (
15
- localization: UI_I_Localization
16
- ): [string, boolean, string, string][] => {
17
- return [
18
- [localization.common.host, true, '300px', compatibleHostsTableKeys[0]],
19
- [localization.common.cluster, true, '300px', compatibleHostsTableKeys[1]],
20
- ]
21
- }
22
-
23
- export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
24
- const result: UI_I_HeadItem[] = []
25
- getItems(localization).forEach((item) => {
26
- result.push(constructHeadItem('icon', item[0], item[3], false, item[2]))
27
- })
28
- return result
29
- }
30
-
31
- export const bodyItems = (
32
- data: I_CompatibleHostsTable[]
33
- ): UI_I_BodyItem[][] => {
34
- const bodyItems: UI_I_BodyItem[][] = []
35
- data.forEach((item: I_CompatibleHostsTable, key) => {
36
- const hostData = {
37
- // @ts-ignore
38
- iconClassName: `vsphere-icon-${hostIconByState[item.state]}`,
39
- }
40
- const clusterData = {
41
- iconClassName: `vsphere-icon-${clusterIconByState[1]}`,
42
- }
43
-
44
- bodyItems.push([
45
- {
46
- key: 'icon',
47
- text: item[compatibleHostsTableKeys[0]],
48
- data: hostData,
49
- id: item.id,
50
- testId: `host-table-item-${item.host}`,
51
- },
52
- {
53
- key: 'icon',
54
- text: item[compatibleHostsTableKeys[1]],
55
- data: clusterData,
56
- id: item.id,
57
- testId: `host-table-item-${item.host}`,
58
- },
59
- ])
60
- })
61
- return bodyItems
62
- }
@@ -1,68 +0,0 @@
1
- import type {
2
- UI_I_HeadItem,
3
- UI_I_BodyItem,
4
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
5
- import type { UI_I_Localization } from '~/lib/models/interfaces'
6
- import type { I_IncompatibleHostsTable } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/interfaces'
7
- import { E_NodeIconsByState } from '~/lib/models/enums'
8
- import { incompatibleHostsTableKeys } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/tableKeys'
9
- import { constructHeadItem } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
10
-
11
- const getItems = (
12
- localization: UI_I_Localization
13
- ): [string, boolean, string, string][] => {
14
- return [
15
- [localization.common.host, true, 'auto', incompatibleHostsTableKeys[0]],
16
- [
17
- localization.common.hostIncompatibilityReason,
18
- true,
19
- 'auto',
20
- incompatibleHostsTableKeys[1],
21
- ],
22
- [localization.common.cluster, true, 'auto', incompatibleHostsTableKeys[2]],
23
- ]
24
- }
25
-
26
- export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
27
- const result: UI_I_HeadItem[] = []
28
- getItems(localization).forEach((item, i) => {
29
- const col = i === 0 || i === 2 ? 'icon' : `col${i}`
30
- result.push(constructHeadItem(col, item[0], item[3], false, item[2]))
31
- })
32
- return result
33
- }
34
-
35
- export const bodyItems = (
36
- data: I_IncompatibleHostsTable[]
37
- ): UI_I_BodyItem[][] => {
38
- const bodyItems: UI_I_BodyItem[][] = []
39
- data.forEach((item: I_IncompatibleHostsTable, key) => {
40
- const hostData = {
41
- iconClassName: E_NodeIconsByState.host_Normal,
42
- }
43
- const clusterData = {
44
- iconClassName: E_NodeIconsByState.host_Normal,
45
- }
46
-
47
- bodyItems.push([
48
- {
49
- key: 'icon',
50
- text: item[incompatibleHostsTableKeys[0]],
51
- data: hostData,
52
- id: key,
53
- },
54
- {
55
- key: 'col1',
56
- text: item[incompatibleHostsTableKeys[1]],
57
- id: key,
58
- },
59
- {
60
- key: 'icon',
61
- text: item[incompatibleHostsTableKeys[2]],
62
- data: clusterData,
63
- id: key,
64
- },
65
- ])
66
- })
67
- return bodyItems
68
- }
@@ -1,15 +0,0 @@
1
- import type {
2
- T_CompatibleHostsTableKeys,
3
- T_IncompatibleHostsTableKeys,
4
- } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types'
5
-
6
- export const compatibleHostsTableKeys: T_CompatibleHostsTableKeys[] = [
7
- 'host',
8
- 'cluster',
9
- ]
10
-
11
- export const incompatibleHostsTableKeys: T_IncompatibleHostsTableKeys[] = [
12
- 'host',
13
- 'cluster',
14
- 'host_incompatibility_reason',
15
- ]
@@ -1,11 +0,0 @@
1
- import type { API_UI_I_DataTable } from '~/lib/models/table/interfaces'
2
-
3
- export interface UI_I_CompatibleHostsTableItem {
4
- id: string
5
- host: string
6
- cluster: string
7
- state: 0 | 1 | 2 | 3
8
- }
9
-
10
- export interface UI_I_CreateDatastoreHosts
11
- extends API_UI_I_DataTable<UI_I_CompatibleHostsTableItem[]> {}