bfg-common 1.4.48 → 1.4.50
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.
- package/components/common/wizards/datastoreNew/add/Add.vue +1 -1
- package/components/common/wizards/datastoreNew/add/lib/utils.ts +34 -1
- package/components/common/wizards/datastoreNew/add/local/createName/CreateName.vue +2 -2
- package/components/common/wizards/datastoreNew/add/nfs/configuration/Configuration.vue +1 -1
- package/components/common/wizards/datastoreNew/add/sharedStorm/SharedStorm.vue +1 -1
- package/components/common/wizards/datastoreNew/add/sharedStorm/{version → _version}/Version.vue +5 -16
- package/components/common/wizards/datastoreNew/add/sharedStorm/{version → _version}/lib/config/versionOptions.ts +4 -4
- package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/DeviceSelection.vue +14 -2
- package/components/common/wizards/datastoreNew/add/types/Types.vue +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ export const checkValidityName = async (
|
|
|
6
6
|
name: string,
|
|
7
7
|
wizard: Wizard,
|
|
8
8
|
project: UI_T_Project,
|
|
9
|
-
sendMessage: (message: string) => void
|
|
9
|
+
sendMessage: (message: string) => void
|
|
10
10
|
): Promise<void> => {
|
|
11
11
|
// TODO move to projects!!!
|
|
12
12
|
|
|
@@ -29,3 +29,36 @@ export const checkValidityName = async (
|
|
|
29
29
|
}
|
|
30
30
|
sendMessage('')
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
export const validateNameAndGenerateDataId = (
|
|
34
|
+
name: string,
|
|
35
|
+
_errorMessage: string,
|
|
36
|
+
defaultDataId?: string
|
|
37
|
+
): string => {
|
|
38
|
+
let baseDataId = defaultDataId || 'storage-name-alert-error'
|
|
39
|
+
|
|
40
|
+
const patterns = [
|
|
41
|
+
{
|
|
42
|
+
regex: /^[a-zA-Z0-9_\-\.]+$/,
|
|
43
|
+
error_message:
|
|
44
|
+
/invalid name, must only contain letters, numbers, and '_', '-' '.' symbols/,
|
|
45
|
+
suffix: '-invalid-name-symbols',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
regex: /^.{3,64}$/,
|
|
49
|
+
error_message:
|
|
50
|
+
/invalid name length, must be between: \d+ and \d+ characters/,
|
|
51
|
+
suffix: '-invalid-name-length',
|
|
52
|
+
},
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
// Проверка error_message на соответствие шаблонам
|
|
56
|
+
|
|
57
|
+
for (const pattern of patterns) {
|
|
58
|
+
if (!pattern.regex.test(name)) {
|
|
59
|
+
return `${baseDataId}${pattern.suffix}`
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return baseDataId
|
|
64
|
+
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<div class="clr-form-control clr-row">
|
|
12
12
|
<label for="datastore-name" class="clr-control-label clr-col-md-2">
|
|
13
|
-
{{ localization.datastoreName }}
|
|
13
|
+
{{ localization.common.datastoreName }}
|
|
14
14
|
</label>
|
|
15
15
|
|
|
16
16
|
<div class="clr-control-container" :class="nameErrorText && 'clr-error'">
|
|
@@ -69,7 +69,7 @@ const nameErrorText = computed<string>(() => {
|
|
|
69
69
|
|
|
70
70
|
if (!isInitNameValidation.value) return ''
|
|
71
71
|
return !createDatastoreNameLocal.value
|
|
72
|
-
? localization.value.specifyDatastoreName
|
|
72
|
+
? localization.value.common.specifyDatastoreName
|
|
73
73
|
: ''
|
|
74
74
|
})
|
|
75
75
|
|
package/components/common/wizards/datastoreNew/add/sharedStorm/{version → _version}/Version.vue
RENAMED
|
@@ -1,36 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section class="nfs-version">
|
|
3
3
|
<common-select-radio-group
|
|
4
|
-
v-model="
|
|
4
|
+
v-model="selectedVersionLocal"
|
|
5
5
|
:options="vmfsVersion"
|
|
6
6
|
/>
|
|
7
7
|
</section>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script lang="ts" setup>
|
|
11
|
-
import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
12
|
-
import { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
|
|
13
|
-
import { UI_T_VmfsType } from '~/components/common/wizards/datastore/add/lib/models/types'
|
|
11
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
12
|
+
import type { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
|
|
13
|
+
import type { UI_T_VmfsType } from '~/components/common/wizards/datastore/add/lib/models/types'
|
|
14
14
|
import { vmfsVersionFunc } from '~/components/common/wizards/datastore/add/sharedStorm/version/lib/config/versionOptions'
|
|
15
15
|
|
|
16
16
|
const props = defineProps<{
|
|
17
17
|
version: UI_T_VmfsType
|
|
18
18
|
}>()
|
|
19
|
+
const selectedVersionLocal = defineModel<UI_T_VmfsType>({required: true})
|
|
19
20
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
20
|
-
const emits = defineEmits<{
|
|
21
|
-
(event: 'update:version', value: UI_T_VmfsType): void
|
|
22
|
-
}>()
|
|
23
21
|
|
|
24
22
|
const vmfsVersion = ref<UI_I_RadioOption[]>(vmfsVersionFunc(localization.value))
|
|
25
|
-
|
|
26
|
-
const selectedVersion = computed<UI_T_VmfsType>({
|
|
27
|
-
get() {
|
|
28
|
-
return props.version
|
|
29
|
-
},
|
|
30
|
-
set(newValue) {
|
|
31
|
-
emits('update:version', newValue)
|
|
32
|
-
},
|
|
33
|
-
})
|
|
34
23
|
</script>
|
|
35
24
|
|
|
36
25
|
<style lang="scss" scoped>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
-
import { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
|
|
1
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
+
import type { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
|
|
3
3
|
|
|
4
4
|
export const vmfsVersionFunc = (
|
|
5
5
|
localization: UI_I_Localization
|
|
@@ -9,13 +9,13 @@ export const vmfsVersionFunc = (
|
|
|
9
9
|
label: 'VMFS 6',
|
|
10
10
|
value: 'vmfs-6',
|
|
11
11
|
disabled: false,
|
|
12
|
-
description: localization.vmfsVersionDesc1,
|
|
12
|
+
description: localization.common.vmfsVersionDesc1,
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
label: 'VMFS 5',
|
|
16
16
|
value: 'vmfs-5',
|
|
17
17
|
disabled: false,
|
|
18
|
-
description: localization.vmfsVersionDesc2,
|
|
18
|
+
description: localization.common.vmfsVersionDesc2,
|
|
19
19
|
},
|
|
20
20
|
]
|
|
21
21
|
}
|
package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/DeviceSelection.vue
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="device-selection-step">
|
|
3
3
|
<atoms-alert
|
|
4
4
|
v-show="props.alertMessages?.length"
|
|
5
|
-
test-id="
|
|
5
|
+
:test-id="errorAlertDataId"
|
|
6
6
|
status="alert-danger"
|
|
7
7
|
:items="props.alertMessages"
|
|
8
8
|
@remove="onHideAlert"
|
|
@@ -110,8 +110,9 @@ import type {
|
|
|
110
110
|
} from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/interfaces'
|
|
111
111
|
import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
|
|
112
112
|
import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/models/interfaces'
|
|
113
|
-
import { UI_T_DatastoreType } from '~/components/common/wizards/datastoreNew/add/lib/models/types'
|
|
113
|
+
import type { UI_T_DatastoreType } from '~/components/common/wizards/datastoreNew/add/lib/models/types'
|
|
114
114
|
import { hostsOptionsFunc } from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/config/selectOptions'
|
|
115
|
+
import { validateNameAndGenerateDataId } from '~/components/common/wizards/datastoreNew/add/lib/utils'
|
|
115
116
|
|
|
116
117
|
const props = defineProps<{
|
|
117
118
|
project: UI_T_Project
|
|
@@ -146,6 +147,17 @@ const nameErrorText = computed<string>(() => {
|
|
|
146
147
|
return !model.value.name ? localization.value.common.specifyDatastoreName : ''
|
|
147
148
|
})
|
|
148
149
|
|
|
150
|
+
const defaultDataId = ref<string>('device-selection-alert-error')
|
|
151
|
+
const errorAlertDataId = computed<string>(() => {
|
|
152
|
+
return !model.value.lunDisk.length
|
|
153
|
+
? `${defaultDataId.value}-not-selected-lundisk`
|
|
154
|
+
: validateNameAndGenerateDataId(
|
|
155
|
+
model.value.name,
|
|
156
|
+
props.alertMessages[0],
|
|
157
|
+
defaultDataId.value
|
|
158
|
+
)
|
|
159
|
+
})
|
|
160
|
+
|
|
149
161
|
const alertInfo = ref<boolean>(true)
|
|
150
162
|
const onHideAlertInfo = (): void => {
|
|
151
163
|
alertInfo.value = false
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
test-id="select-datastore-type"
|
|
20
20
|
@hide="isShowTypeHelp = false"
|
|
21
21
|
>
|
|
22
|
-
<p class="help-desc">{{ localization.datastoreTypeHelpDesc }}</p>
|
|
22
|
+
<p class="help-desc">{{ localization.common.datastoreTypeHelpDesc }}</p>
|
|
23
23
|
</atoms-tooltip-signpost>
|
|
24
24
|
</div>
|
|
25
25
|
</div>
|