bfg-common 1.4.50 → 1.4.52

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"
@@ -149,6 +149,8 @@ const nameErrorText = computed<string>(() => {
149
149
 
150
150
  const defaultDataId = ref<string>('device-selection-alert-error')
151
151
  const errorAlertDataId = computed<string>(() => {
152
+ if (!props.alertMessages?.length) return
153
+
152
154
  return !model.value.lunDisk.length
153
155
  ? `${defaultDataId.value}-not-selected-lundisk`
154
156
  : validateNameAndGenerateDataId(
@@ -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.50",
4
+ "version": "1.4.52",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",