bfg-common 1.5.78 → 1.5.79
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/datastore/add/Add.vue +8 -2
- package/components/common/wizards/datastore/add/New.vue +0 -1
- package/components/common/wizards/datastore/add/lib/validations.ts +3 -3
- package/components/common/wizards/datastore/add/steps/common/tooltipInfo/TooltipInfo.vue +20 -30
- package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigureNew.vue +96 -9
- package/package.json +1 -1
|
@@ -85,12 +85,18 @@ const validationFunc = async (
|
|
|
85
85
|
): Promise<UI_I_ValidationReturn> => {
|
|
86
86
|
let stepHasError = false
|
|
87
87
|
|
|
88
|
-
if (
|
|
88
|
+
if (
|
|
89
|
+
wizard.isValidateForStep(
|
|
90
|
+
dynamicSteps.nameAndDevice,
|
|
91
|
+
currentStep.id,
|
|
92
|
+
nextStep.id
|
|
93
|
+
)
|
|
94
|
+
) {
|
|
89
95
|
const nameValidation = await validation.checkDatastoreNameAsync(
|
|
90
96
|
localization.value,
|
|
91
97
|
value,
|
|
92
98
|
form.value,
|
|
93
|
-
|
|
99
|
+
dynamicSteps.nameAndDevice,
|
|
94
100
|
'datastoreName',
|
|
95
101
|
wizard,
|
|
96
102
|
props.project
|
|
@@ -83,14 +83,14 @@ export const checkSelectedLunDiskSync = (
|
|
|
83
83
|
if (!lunDisk.length && name) {
|
|
84
84
|
const isErrorTextForSphere =
|
|
85
85
|
project === 'sphere' && !hostId && !hosts.length
|
|
86
|
-
stepHasError = wizard.setValidation(
|
|
86
|
+
stepHasError = wizard.setValidation(dynamicSteps.nameAndDevice, 'lunDisk', {
|
|
87
87
|
fieldMessage: '',
|
|
88
88
|
alertMessage: isErrorTextForSphere
|
|
89
89
|
? localization.common.selectHostToContinueAlert
|
|
90
90
|
: localization.common.selectDiskToContinueAlert,
|
|
91
91
|
})
|
|
92
|
-
} else if (wizard.hasMessage(
|
|
93
|
-
value = wizard.removeValidation(
|
|
92
|
+
} else if (wizard.hasMessage(dynamicSteps.nameAndDevice, 'lunDisk')) {
|
|
93
|
+
value = wizard.removeValidation(dynamicSteps.nameAndDevice, 'lunDisk', value)
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
return {
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="tooltip-info">
|
|
3
3
|
<ui-icon
|
|
4
|
-
:id="
|
|
4
|
+
:id="`${props.id}-info-trigger`"
|
|
5
5
|
name="info"
|
|
6
|
-
width="
|
|
7
|
-
height="
|
|
8
|
-
:class="['
|
|
9
|
-
@click.stop="
|
|
6
|
+
width="16"
|
|
7
|
+
height="16"
|
|
8
|
+
:class="['tooltip-info__icon pointer', { active: isShowInfo }]"
|
|
9
|
+
@click.stop="isShowInfo = !isShowInfo"
|
|
10
10
|
/>
|
|
11
11
|
<ui-popup-window
|
|
12
12
|
v-model="isShowInfo"
|
|
13
13
|
top
|
|
14
14
|
left
|
|
15
|
-
|
|
15
|
+
width="272px"
|
|
16
|
+
:elem-id="`${props.id}-info-trigger`"
|
|
16
17
|
>
|
|
17
18
|
<div class="common-widget-info">
|
|
18
|
-
<div class="
|
|
19
|
-
<div class="flex
|
|
19
|
+
<div class="flex justify-between">
|
|
20
|
+
<div class="flex">
|
|
20
21
|
<ui-icon name="info-2" width="16px" height="16px" />
|
|
21
22
|
<span class="title"> {{ localization.common.information }}</span>
|
|
22
23
|
</div>
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
class="pointer hide-icon"
|
|
26
27
|
width="16px"
|
|
27
28
|
height="16px"
|
|
28
|
-
@click.stop="
|
|
29
|
+
@click.stop="isShowInfo = false"
|
|
29
30
|
/>
|
|
30
31
|
</div>
|
|
31
32
|
|
|
@@ -44,42 +45,30 @@ const props = withDefaults(
|
|
|
44
45
|
defineProps<{
|
|
45
46
|
id: string
|
|
46
47
|
info: string
|
|
47
|
-
openedError: string
|
|
48
48
|
}>(),
|
|
49
49
|
{}
|
|
50
50
|
)
|
|
51
51
|
|
|
52
52
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
53
53
|
|
|
54
|
-
const
|
|
55
|
-
(event: 'toggle-error', value: string): void
|
|
56
|
-
}>()
|
|
57
|
-
|
|
58
|
-
const isShowInfo = computed<boolean>({
|
|
59
|
-
get() {
|
|
60
|
-
return props.openedError === props.id
|
|
61
|
-
},
|
|
62
|
-
set() {
|
|
63
|
-
emits('toggle-error', '')
|
|
64
|
-
},
|
|
65
|
-
})
|
|
54
|
+
const isShowInfo = ref<boolean>(false)
|
|
66
55
|
</script>
|
|
67
56
|
|
|
68
57
|
<style lang="scss" scoped>
|
|
58
|
+
@import 'assets/scss/common/mixins.scss';
|
|
69
59
|
.tooltip-info {
|
|
70
|
-
|
|
60
|
+
@include flex($align: center);
|
|
61
|
+
&__icon {
|
|
71
62
|
color: var(--form-icon-color);
|
|
72
|
-
|
|
73
63
|
&:hover {
|
|
74
64
|
color: var(--close-icon);
|
|
75
65
|
}
|
|
76
|
-
&.
|
|
66
|
+
&.active {
|
|
77
67
|
color: var(--btn-primary-fill-bg-color);
|
|
78
68
|
}
|
|
79
69
|
}
|
|
80
70
|
|
|
81
71
|
.common-widget-info {
|
|
82
|
-
width: 232px;
|
|
83
72
|
padding: 16px;
|
|
84
73
|
|
|
85
74
|
.title {
|
|
@@ -90,16 +79,17 @@ const isShowInfo = computed<boolean>({
|
|
|
90
79
|
margin-left: 8px;
|
|
91
80
|
}
|
|
92
81
|
|
|
93
|
-
.hide-icon {
|
|
94
|
-
color: var(--alert-icon);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
82
|
.common-widget-info-description {
|
|
98
83
|
font-size: 13px;
|
|
99
84
|
line-height: 15.73px;
|
|
100
85
|
color: var(--zabbix-text-color);
|
|
101
86
|
margin-top: 12px;
|
|
102
87
|
}
|
|
88
|
+
|
|
89
|
+
svg {
|
|
90
|
+
color: var(--alert-icon);
|
|
91
|
+
min-width: 16px;
|
|
92
|
+
}
|
|
103
93
|
}
|
|
104
94
|
}
|
|
105
95
|
</style>
|
package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigureNew.vue
CHANGED
|
@@ -8,20 +8,66 @@
|
|
|
8
8
|
</div>
|
|
9
9
|
<div class="basics-step-row-content">
|
|
10
10
|
<ui-input
|
|
11
|
-
id="name"
|
|
11
|
+
id="configuration-name-input"
|
|
12
12
|
v-model="formModelLocal.name"
|
|
13
|
-
test-id="
|
|
14
|
-
:placeholder="localization.common.hostNameOrIPAddress"
|
|
13
|
+
test-id="configuration-name-input"
|
|
15
14
|
is-focused
|
|
16
|
-
:error="
|
|
17
|
-
@
|
|
15
|
+
:error="nameErrorText"
|
|
16
|
+
@blur="initValidation(true, ['name'])"
|
|
17
|
+
@input="initValidation(false, ['name'])"
|
|
18
18
|
/>
|
|
19
19
|
</div>
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
22
|
<div class="basics-step-line"></div>
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
<div class="basics-step-row">
|
|
25
|
+
<div class="basics-step-row-title">
|
|
26
|
+
<span class="basics-step-row-title-text">
|
|
27
|
+
{{ localization.common.folder }}
|
|
28
|
+
</span>
|
|
29
|
+
<common-wizards-datastore-add-steps-common-tooltip-info
|
|
30
|
+
:id="'option.testId'"
|
|
31
|
+
:info="'Specify the folder path - for example, /vols/vol0/datastore-001'"
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="basics-step-row-content">
|
|
35
|
+
<ui-input
|
|
36
|
+
id="configuration-folder-input"
|
|
37
|
+
v-model="formModelLocal.folder"
|
|
38
|
+
test-id="configuration-folder-input"
|
|
39
|
+
placeholder="E.g: /vols/vol0/datastore-001"
|
|
40
|
+
:error="folderErrorText"
|
|
41
|
+
@blur="initValidation(true, ['folder'])"
|
|
42
|
+
@input="initValidation(false, ['folder'])"
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div class="basics-step-line"></div>
|
|
48
|
+
|
|
49
|
+
<div class="basics-step-row">
|
|
50
|
+
<div class="basics-step-row-title">
|
|
51
|
+
<span class="basics-step-row-title-text">
|
|
52
|
+
{{ localization.common.server }}
|
|
53
|
+
</span>
|
|
54
|
+
<common-wizards-datastore-add-steps-common-tooltip-info
|
|
55
|
+
:id="'option.testIdserver'"
|
|
56
|
+
:info="'Specify the server address - for example, nas, nas.it.com or 192.168.0.1.'"
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="basics-step-row-content">
|
|
60
|
+
<ui-input
|
|
61
|
+
id="configuration-server-input"
|
|
62
|
+
v-model="formModelLocal.server"
|
|
63
|
+
test-id="configuration-server-input"
|
|
64
|
+
placeholder="E.g: nas, nas.it.com or 192.168.0.1"
|
|
65
|
+
:error="serverErrorText"
|
|
66
|
+
@blur="initValidation(true, ['server'])"
|
|
67
|
+
@input="initValidation(false, ['server'])"
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
25
71
|
</div>
|
|
26
72
|
</template>
|
|
27
73
|
|
|
@@ -31,7 +77,7 @@ import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/inter
|
|
|
31
77
|
import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
|
|
32
78
|
|
|
33
79
|
const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
|
|
34
|
-
const isShowAlertInfo = defineModel<boolean>('alertInfo', { required: true })
|
|
80
|
+
// const isShowAlertInfo = defineModel<boolean>('alertInfo', { required: true })
|
|
35
81
|
|
|
36
82
|
const props = defineProps<{
|
|
37
83
|
messagesFields: UI_I_WizardStep['fields']
|
|
@@ -42,9 +88,50 @@ const emits = defineEmits<{
|
|
|
42
88
|
|
|
43
89
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
44
90
|
|
|
45
|
-
const
|
|
46
|
-
|
|
91
|
+
const initValidationFields = ref<UI_I_InitialValidationFields>({
|
|
92
|
+
name: false,
|
|
93
|
+
folder: false,
|
|
94
|
+
server: false,
|
|
95
|
+
})
|
|
96
|
+
const initValidation = (onlyBlur = false, types: string[]): void => {
|
|
97
|
+
onlyBlur && types.forEach((type) => (initValidationFields.value[type] = true))
|
|
47
98
|
}
|
|
99
|
+
|
|
100
|
+
/* Validation error text for Name input field */
|
|
101
|
+
const nameErrorText = computed<string>(() => {
|
|
102
|
+
if (props.messagesFields?.name?.field && !formModelLocal.value.name) {
|
|
103
|
+
return props.messagesFields.name.field
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (!initValidationFields.value.name) return ''
|
|
107
|
+
return !formModelLocal.value.name
|
|
108
|
+
? localization.value.common.specifyDatastoreName
|
|
109
|
+
: ''
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
/* Validation error text for Folder input field */
|
|
113
|
+
const folderErrorText = computed<string>(() => {
|
|
114
|
+
if (props.messagesFields.folder?.field && !formModelLocal.value.folder) {
|
|
115
|
+
return props.messagesFields.folder.field
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (!initValidationFields.value.folder) return ''
|
|
119
|
+
return !formModelLocal.value.folder
|
|
120
|
+
? localization.value.common.specifyFolderName
|
|
121
|
+
: ''
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
/* Validation error text for Server input field */
|
|
125
|
+
const serverErrorText = computed<string>(() => {
|
|
126
|
+
if (props.messagesFields.server?.field && !formModelLocal.value.server) {
|
|
127
|
+
return props.messagesFields.server.field
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (!initValidationFields.value.server) return ''
|
|
131
|
+
return !formModelLocal.value.server
|
|
132
|
+
? localization.value.common.specifyServerName
|
|
133
|
+
: ''
|
|
134
|
+
})
|
|
48
135
|
</script>
|
|
49
136
|
|
|
50
137
|
<style scoped lang="scss">
|