bfg-common 1.4.51 → 1.4.53

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.
@@ -15,7 +15,7 @@
15
15
  <template #modalBody="{ selectedStep }">
16
16
  <common-wizards-datastore-new-add-types
17
17
  v-if="selectedStep.id === 0"
18
- v-model="form.type_code"
18
+ v-model="form"
19
19
  v-model:datastore-type="datastoreType"
20
20
  :project="props.project"
21
21
  />
@@ -115,7 +115,7 @@ const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
115
115
  const datastoreType = ref<UI_T_DatastoreType>('shared-storm')
116
116
 
117
117
  const form = ref<UI_I_CreateDatastoreForm>({
118
- name: '',
118
+ name: 'Datastore',
119
119
  lunDisk: [],
120
120
  hosts: props.hostId ? [props?.hostId] : [],
121
121
  type_code: E_DatastoreTypeKode[datastoreType.value],
@@ -15,6 +15,7 @@ import type { UI_T_Project } from '~/lib/models/types'
15
15
  import type { UI_I_ArbitraryObject } from '~/lib/models/interfaces'
16
16
  import type { UI_T_DatastoreType } from '~/components/common/wizards/datastore/add/lib/models/types'
17
17
  import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
18
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastoreNew/add/lib/models/interfaces'
18
19
 
19
20
  const props = defineProps<{
20
21
  project: UI_T_Project
@@ -23,7 +24,7 @@ const props = defineProps<{
23
24
  alertMessages: string[]
24
25
  messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
25
26
  }>()
26
- const model = defineModel<any>()
27
+ const model = defineModel<UI_I_CreateDatastoreForm>({ required: true })
27
28
  const emits = defineEmits<{
28
29
  (event: 'hide-alert', value: number): void
29
30
  }>()
@@ -31,6 +31,7 @@ import type {
31
31
  } from '~/lib/models/interfaces'
32
32
  import type { UI_T_Project } from '~/lib/models/types'
33
33
  import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
34
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastoreNew/add/lib/models/interfaces'
34
35
 
35
36
  const props = defineProps<{
36
37
  project: UI_T_Project
@@ -39,7 +40,7 @@ const props = defineProps<{
39
40
  messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
40
41
  hosts?: any
41
42
  }>()
42
- const model = defineModel<any>()
43
+ const model = defineModel<UI_I_CreateDatastoreForm>({ required: true })
43
44
  const emits = defineEmits<{
44
45
  (event: 'hide-alert', value: number): void
45
46
  }>()
@@ -42,6 +42,7 @@ import {
42
42
  } from '~/components/common/wizards/datastore/add/lib/models/types'
43
43
  import type { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
44
44
  import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/models/interfaces'
45
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastoreNew/add/lib/models/interfaces'
45
46
 
46
47
  const props = defineProps<{
47
48
  project: UI_T_Project
@@ -53,7 +54,7 @@ const props = defineProps<{
53
54
  isMainFilter?: boolean
54
55
  hostId?: string
55
56
  }>()
56
- const model = defineModel<any>()
57
+ const model = defineModel<UI_I_CreateDatastoreForm>({ required: true })
57
58
  const emits = defineEmits<{
58
59
  (event: 'hide-alert', value: boolean): void
59
60
  (event: 'main-filter', value: string): void
@@ -34,7 +34,7 @@
34
34
  </div>
35
35
 
36
36
  <atoms-alert
37
- v-show="alertInfo"
37
+ v-if="alertInfo"
38
38
  test-id="device-selection-information-alert"
39
39
  class="device-selection-step__alert-info"
40
40
  status="alert-info"
@@ -1,8 +1 @@
1
- export type UI_T_HostTableItemsKey =
2
- | 'name'
3
- | 'identifier'
4
- | 'lun'
5
- | 'capacity_mb'
6
- | 'hardware_acceleration'
7
- | 'drive_type'
8
- | 'sector_format'
1
+ export type T_DatastoreTableItemsTuple = ['name', 'type_ds', 'description']
@@ -31,16 +31,15 @@
31
31
 
32
32
  <script lang="ts" setup>
33
33
  import { useDebounceFn } from '@vueuse/core'
34
- import {
34
+ import type {
35
35
  UI_I_HeadItem,
36
36
  UI_I_ColumnKey,
37
37
  UI_I_BodyItem,
38
38
  } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
39
39
  import { UI_I_Localization } from '~/lib/models/interfaces'
40
40
  import { UI_I_Pagination } from '~/lib/models/table/interfaces'
41
- // import { optionsDefault as itemsPerPage } from '~/node_modules/nuxt-3-uikit/components/atoms/table/dataGrid/config'
42
41
  import { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/interfaces'
43
- import * as lunDiskTable from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/hostsTable'
42
+ import * as lunDiskTable from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/lunDiskTable'
44
43
 
45
44
  const props = defineProps<{
46
45
  dataTable: UI_I_CreateStorageLunDiskItem[]
@@ -108,11 +107,11 @@ const bodyItems = computed<UI_I_BodyItem[][]>(() => {
108
107
  return result
109
108
  })
110
109
 
111
- const selectedLunDiskLocal = ref<number[]>()
110
+ const selectedLunDiskLocal = ref<number[]>([])
112
111
  watch(
113
112
  selectedLunDiskLocal,
114
113
  (newValue: number[]) => {
115
- modelLunDisk.value = props.dataTable.filter((_: any, key: number) =>
114
+ modelLunDisk.value = props.dataTable.filter((_: never, key: number) =>
116
115
  newValue.includes(key)
117
116
  )
118
117
  },
@@ -0,0 +1,84 @@
1
+ import type {
2
+ UI_I_HeadItem,
3
+ UI_I_ColumnKey,
4
+ UI_I_BodyItem,
5
+ } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
6
+ import * as defaultSettings from '~/components/atoms/table/dataGrid/lib/config/settingsTable'
7
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
8
+ import type { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
9
+ import { lunDiskTableItemsKeys } from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/tableKeys'
10
+
11
+ const getItems = (
12
+ localization: UI_I_Localization
13
+ ): [string, boolean, string, string][] => {
14
+ return [
15
+ [localization.common.name, true, '180px', lunDiskTableItemsKeys[0]],
16
+ [localization.common.identifier, false, '96px', lunDiskTableItemsKeys[1]],
17
+ [localization.common.lun, true, '96px', lunDiskTableItemsKeys[2]],
18
+ [localization.common.capacity, true, '96px', lunDiskTableItemsKeys[3]],
19
+ [
20
+ localization.common.hardwareAcceleration,
21
+ true,
22
+ '96px',
23
+ lunDiskTableItemsKeys[4],
24
+ ],
25
+ [localization.common.driveType, true, '96px', lunDiskTableItemsKeys[5]],
26
+ [localization.common.sectorFormat, true, '96px', lunDiskTableItemsKeys[6]],
27
+ ]
28
+ }
29
+
30
+ export const columnKeys = (
31
+ localization: UI_I_Localization
32
+ ): UI_I_ColumnKey[] => {
33
+ return defaultSettings.defaultColumnKeys(getItems(localization))
34
+ }
35
+ export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
36
+ return defaultSettings.defaultHeadItems(getItems(localization))
37
+ }
38
+
39
+ export const bodyItems = (
40
+ data: UI_I_CreateStorageLunDiskItem[]
41
+ ): UI_I_BodyItem[][] => {
42
+ const bodyItems: UI_I_BodyItem[][] = []
43
+ const { $binary } = useNuxtApp() as any
44
+ data.forEach((lanDisk: UI_I_CreateStorageLunDiskItem, key) => {
45
+ bodyItems.push([
46
+ {
47
+ key: 'col0',
48
+ text: lanDisk[lunDiskTableItemsKeys[0]],
49
+ id: key,
50
+ },
51
+ {
52
+ key: 'col1',
53
+ text: lanDisk[lunDiskTableItemsKeys[1]],
54
+ id: key,
55
+ },
56
+ {
57
+ key: 'col2',
58
+ text: lanDisk[lunDiskTableItemsKeys[2]],
59
+ id: key,
60
+ },
61
+ {
62
+ key: 'col3',
63
+ text: $binary.round(lanDisk[lunDiskTableItemsKeys[3]]),
64
+ id: key,
65
+ },
66
+ {
67
+ key: 'col4',
68
+ text: lanDisk[lunDiskTableItemsKeys[4]],
69
+ id: key,
70
+ },
71
+ {
72
+ key: 'col5',
73
+ text: lanDisk[lunDiskTableItemsKeys[5]],
74
+ id: key,
75
+ },
76
+ {
77
+ key: 'col6',
78
+ text: lanDisk[lunDiskTableItemsKeys[6]],
79
+ id: key,
80
+ },
81
+ ])
82
+ })
83
+ return bodyItems
84
+ }
@@ -1,6 +1,6 @@
1
- import { UI_T_HostTableItemsKey } from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/types'
1
+ import type { UI_T_LunDiskTableItemTuple } from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/models/types'
2
2
 
3
- export const hostTableItemsKeys: UI_T_HostTableItemsKey[] = [
3
+ export const lunDiskTableItemsKeys: UI_T_LunDiskTableItemTuple = [
4
4
  'name',
5
5
  'identifier',
6
6
  'lun',
@@ -0,0 +1,9 @@
1
+ export type UI_T_LunDiskTableItemTuple = [
2
+ 'name',
3
+ 'identifier',
4
+ 'lun',
5
+ 'capacity_mb',
6
+ 'hardware_acceleration',
7
+ 'drive_type',
8
+ 'sector_format'
9
+ ]
@@ -19,7 +19,9 @@
19
19
  test-id="select-datastore-type"
20
20
  @hide="isShowTypeHelp = false"
21
21
  >
22
- <p class="help-desc">{{ localization.common.datastoreTypeHelpDesc }}</p>
22
+ <p class="help-desc">
23
+ {{ localization.common.datastoreTypeHelpDesc }}
24
+ </p>
23
25
  </atoms-tooltip-signpost>
24
26
  </div>
25
27
  </div>
@@ -37,23 +39,26 @@ import type { UI_I_Localization } from '~/lib/models/interfaces'
37
39
  import type { UI_T_Project } from '~/lib/models/types'
38
40
  import type { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
39
41
  import type { UI_T_DatastoreType } from '~/components/common/wizards/datastore/add/lib/models/types'
42
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastoreNew/add/lib/models/interfaces'
40
43
  import { E_DatastoreTypeKode } from '~/components/common/wizards/datastoreNew/add/lib/models/enums'
41
- import { datastoreTypesFunc } from '~/components/common/wizards/datastore/add/types/lib/config/typeOptions'
44
+ import { datastoreTypesFunc } from '~/components/common/wizards/datastoreNew/add/types/lib/config/typeOptions'
42
45
 
43
46
  const props = defineProps<{
44
47
  project: UI_T_Project
45
48
  }>()
46
49
  const selectedDatastoreTypeLocal =
47
50
  defineModel<UI_T_DatastoreType>('datastoreType')
48
- const typeCodeLocal = defineModel()
51
+ const model = defineModel<UI_I_CreateDatastoreForm>({ required: true })
49
52
 
50
53
  const localization = computed<UI_I_Localization>(() => useLocal())
51
54
 
52
55
  const datastoreTypes = ref<UI_I_RadioOption[]>(
53
- datastoreTypesFunc(localization.value, props.project)
56
+ datastoreTypesFunc(localization.value)
54
57
  )
55
58
  const onChangeType = (): void => {
56
- typeCodeLocal.value = E_DatastoreTypeKode[selectedDatastoreTypeLocal.value]
59
+ model.value.type_code = E_DatastoreTypeKode[selectedDatastoreTypeLocal.value]
60
+
61
+ model.value.name = 'Datastore' // default value is 'Datastore' every time
57
62
  }
58
63
 
59
64
  const isShowTypeHelp = ref<boolean>(false)
@@ -4,46 +4,38 @@ import { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/in
4
4
 
5
5
  export const datastoreTypesFunc = (
6
6
  localization: UI_I_Localization,
7
- project: UI_T_Project
7
+ _project?: UI_T_Project
8
8
  ): UI_I_RadioOption[] => {
9
- const types = [
9
+ return [
10
10
  {
11
- label: localization.stormSharedStorage,
11
+ label: localization.common.stormSharedStorage,
12
12
  value: 'shared-storm',
13
13
  disabled: false,
14
- description: localization.sharedStormDesc,
14
+ description: localization.common.sharedStormDesc,
15
15
  isTooltip: false,
16
- tooltipContent: localization.stormSharedStorageHelpDesc,
16
+ tooltipContent: localization.common.stormSharedStorageHelpDesc,
17
17
  testId: 'datastore-type-shared-storm',
18
18
  },
19
19
  {
20
- label: localization.nfs,
20
+ label: localization.common.nfs,
21
21
  value: 'nfs',
22
22
  disabled: false,
23
- description: localization.nfsDesc,
23
+ description: localization.common.nfsDesc,
24
24
  isTooltip: false,
25
- tooltipContent: localization.nfsHelpDesc,
25
+ tooltipContent: localization.common.nfsHelpDesc,
26
26
  testId: 'datastore-type-nfs',
27
27
  },
28
- // {
29
- // label: localization.vVol,
30
- // value: 'vVol',
31
- // disabled: true,
32
- // desc: localization.vVolDesc,
33
- // },
34
28
  ]
35
29
 
36
- if (project === 'procurator') {
37
- types.unshift({
38
- label: localization.localStorage,
39
- value: 'local',
40
- disabled: false,
41
- description: localization.localDesc,
42
- isTooltip: false,
43
- tooltipContent: localization.localStorageHelpDesc,
44
- testId: 'datastore-type-local',
45
- })
46
- }
47
-
48
- return types
30
+ // if (project === 'procurator') {
31
+ // types.unshift({
32
+ // label: localization.common.localStorage,
33
+ // value: 'local',
34
+ // disabled: false,
35
+ // description: localization.common.localDesc,
36
+ // isTooltip: false,
37
+ // tooltipContent: localization.common.localStorageHelpDesc,
38
+ // testId: 'datastore-type-local',
39
+ // })
40
+ // }
49
41
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.51",
4
+ "version": "1.4.53",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -1,87 +0,0 @@
1
- import {
2
- UI_I_HeadItem,
3
- UI_I_ColumnKey,
4
- UI_I_BodyItem,
5
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
6
- import { UI_I_Localization } from '~/lib/models/interfaces'
7
- import {
8
- constructHeadItem,
9
- constructColumnKey,
10
- } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
11
- import { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
12
- import { hostTableItemsKeys } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/hostTable/lib/config/tableKeys'
13
-
14
- const getItems = (
15
- localization: UI_I_Localization
16
- ): [string, boolean, string, string][] => {
17
- return [
18
- [localization.common.name, true, '180px', hostTableItemsKeys[0]],
19
- [localization.common.identifier, false, '96px', hostTableItemsKeys[1]],
20
- [localization.common.lun, true, '96px', hostTableItemsKeys[2]],
21
- [localization.common.capacity, true, '96px', hostTableItemsKeys[3]],
22
- [localization.common.hardwareAcceleration, true, '96px', hostTableItemsKeys[4]],
23
- [localization.common.driveType, true, '96px', hostTableItemsKeys[5]],
24
- [localization.common.sectorFormat, true, '96px', hostTableItemsKeys[6]],
25
- ]
26
- }
27
- export const columnKeys = (localization: UI_I_Localization): UI_I_ColumnKey[] => {
28
- const result: UI_I_ColumnKey[] = []
29
- getItems(localization).forEach((item, i) => {
30
- const col = `col${i}`
31
- result.push(constructColumnKey(col, item[0], item[1]))
32
- })
33
- return result
34
- }
35
- export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
36
- const result: UI_I_HeadItem[] = []
37
- getItems(localization).forEach((item, i) => {
38
- const col = `col${i}`
39
- result.push(constructHeadItem(col, item[0], item[3], false, item[2]))
40
- })
41
- return result
42
- }
43
-
44
- export const bodyItems = (data: UI_I_CreateStorageLunDiskItem[]): UI_I_BodyItem[][] => {
45
- const bodyItems: UI_I_BodyItem[][] = []
46
- const { $binary } = useNuxtApp() as any
47
- data.forEach((host: UI_I_CreateStorageLunDiskItem, key) => {
48
- bodyItems.push([
49
- {
50
- key: 'col0',
51
- text: host[hostTableItemsKeys[0]],
52
- id: key,
53
- },
54
- {
55
- key: 'col1',
56
- text: host[hostTableItemsKeys[1]],
57
- id: key,
58
- },
59
- {
60
- key: 'col2',
61
- text: host[hostTableItemsKeys[2]],
62
- id: key,
63
- },
64
- {
65
- key: 'col3',
66
- text: $binary.round(host[hostTableItemsKeys[3]]),
67
- id: key,
68
- },
69
- {
70
- key: 'col4',
71
- text: host[hostTableItemsKeys[4]],
72
- id: key,
73
- },
74
- {
75
- key: 'col5',
76
- text: host[hostTableItemsKeys[5]],
77
- id: key,
78
- },
79
- {
80
- key: 'col6',
81
- text: host[hostTableItemsKeys[6]],
82
- id: key,
83
- },
84
- ])
85
- })
86
- return bodyItems
87
- }