bfg-common 1.5.77 → 1.5.78

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.
@@ -42,9 +42,10 @@ import {
42
42
  stepsFunc,
43
43
  stepsSchemeInitial,
44
44
  getStepScheme,
45
+ dynamicSteps,
45
46
  } from '~/components/common/wizards/datastore/add/lib/config/steps'
46
47
  import { datastoreDefaultFormFunc } from '~/components/common/wizards/datastore/add/lib/config/createDatastore'
47
- import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails'
48
+ import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/steps/readyComplete/lib/config/propertiesDetails'
48
49
  import * as validation from '~/components/common/wizards/datastore/add/lib/validations'
49
50
 
50
51
  const props = defineProps<{
@@ -84,22 +85,6 @@ const validationFunc = async (
84
85
  ): Promise<UI_I_ValidationReturn> => {
85
86
  let stepHasError = false
86
87
 
87
- if (wizard.isValidateForStep(1, currentStep.id, nextStep.id)) {
88
- const nameValidation = await validation.checkDatastoreNameAsync(
89
- localization.value,
90
- value,
91
- form.value,
92
- 1,
93
- 'datastoreName',
94
- wizard,
95
- props.project
96
- )
97
-
98
- value = nameValidation.newValue
99
-
100
- stepHasError = nameValidation.stepHasError
101
- }
102
-
103
88
  if (wizard.isValidateForStep(2, currentStep.id, nextStep.id)) {
104
89
  const nameValidation = await validation.checkDatastoreNameAsync(
105
90
  localization.value,
@@ -127,12 +112,18 @@ const validationFunc = async (
127
112
  stepHasError = nameValidation.stepHasError || lunDiskValidation.stepHasError
128
113
  }
129
114
 
130
- if (wizard.isValidateForStep(4, currentStep.id, nextStep.id)) {
115
+ if (
116
+ wizard.isValidateForStep(
117
+ dynamicSteps.nameAndConfigure,
118
+ currentStep.id,
119
+ nextStep.id
120
+ )
121
+ ) {
131
122
  const nameValidation = await validation.checkDatastoreNameAsync(
132
123
  localization.value,
133
124
  value,
134
125
  form.value,
135
- 4,
126
+ dynamicSteps.nameAndConfigure,
136
127
  'name',
137
128
  wizard,
138
129
  props.project
@@ -103,7 +103,9 @@
103
103
  <div ref="subTitleBlock3">
104
104
  <div class="subtitle-block">
105
105
  <ui-alert
106
- v-if="props.alertMessages[dynamicSteps.hostAccessibility].length"
106
+ v-if="
107
+ props.alertMessages[dynamicSteps.hostAccessibility].length
108
+ "
107
109
  test-id="add-host-assign-license-error-alert"
108
110
  type="error"
109
111
  size="md"
@@ -127,25 +129,19 @@
127
129
  </ui-wizard-block>
128
130
 
129
131
  <ui-wizard-block
130
- v-if="selectedStep.id === dynamicSteps.lockdownMode"
132
+ v-if="selectedStep.id === dynamicSteps.readyComplete"
131
133
  :sub-title-height="height4"
132
134
  >
133
135
  <template #subTitle>
134
136
  <div ref="subTitleBlock4">
135
137
  <div class="subtitle-block">
136
138
  <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
137
- <ui-wizard-subtitle
138
- :sub-title="localization.common.whenEnabledLockdown"
139
- />
140
- <ui-wizard-subtitle
141
- :sub-title="localization.common.leaveLockdownDefault"
142
- />
143
139
  </div>
144
140
  </div>
145
141
  </template>
146
142
  <template #content>
147
- <common-wizards-datastore-add-ready-complete
148
- v-show="selectedStep.id === 11"
143
+ <common-wizards-datastore-add-steps-ready-complete
144
+ v-if="selectedStep.id === dynamicSteps.readyComplete"
149
145
  :data-ready-view="dataReadyView"
150
146
  />
151
147
  </template>
@@ -167,7 +163,7 @@ import type { UI_T_DatastoreTypeCode } from '~/components/common/wizards/datasto
167
163
  import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
168
164
  import type { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
169
165
  import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
170
- import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails'
166
+ import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/steps/readyComplete/lib/config/propertiesDetails'
171
167
  import { dynamicSteps } from '~/components/common/wizards/datastore/add/lib/config/steps'
172
168
 
173
169
  const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
@@ -40,7 +40,6 @@
40
40
  @hide-alert="(e) => emits('hide-alert', e)"
41
41
  />
42
42
 
43
-
44
43
  <common-wizards-datastore-add-steps-host-accessibility
45
44
  v-if="selectedStep.id === dynamicSteps.hostAccessibility"
46
45
  v-model="formModelLocal.hosts"
@@ -49,6 +48,11 @@
49
48
  @hide-alert="(e) => emits('hide-alert', e)"
50
49
  />
51
50
 
51
+ <common-wizards-datastore-add-steps-ready-complete
52
+ v-if="selectedStep.id === dynamicSteps.readyComplete"
53
+ :data-ready-view="dataReadyView"
54
+ />
55
+
52
56
  <common-wizards-datastore-add-shared-storm
53
57
  v-if="datastoreType === 'shared-storm'"
54
58
  v-model="formModelLocal"
@@ -73,11 +77,6 @@
73
77
  :messages-fields="selectedStep.fields"
74
78
  :hosts="props.nfsHosts"
75
79
  />
76
-
77
- <common-wizards-datastore-add-ready-complete
78
- v-show="selectedStep.id === 11"
79
- :data-ready-view="dataReadyView"
80
- />
81
80
  </template>
82
81
  </atoms-wizard>
83
82
  </div>
@@ -92,7 +91,7 @@ import type { UI_T_DatastoreTypeCode } from '~/components/common/wizards/datasto
92
91
  import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
93
92
  import type { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
94
93
  import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
95
- import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails'
94
+ import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/steps/readyComplete/lib/config/propertiesDetails'
96
95
  import { dynamicSteps } from '~/components/common/wizards/datastore/add/lib/config/steps'
97
96
 
98
97
  const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
@@ -4,14 +4,11 @@ import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/inter
4
4
  import { UI_E_WIZARD_STATUS } from '~/components/atoms/wizard/lib/models/enums'
5
5
  import type { UI_I_ChangeStepsSchemes } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
6
6
  import type { UI_T_DatastoreTypeCode } from '~/components/common/wizards/datastore/add/lib/models/types'
7
-
8
7
  export const dynamicSteps = {
9
8
  type: 0,
10
9
  nameAndDevice: 1,
11
10
  nameAndConfigure: 2,
12
11
  hostAccessibility: 3,
13
- lockdownMode: 4,
14
- vmLocation: 5,
15
12
  readyComplete: 6,
16
13
  }
17
14
  export const stepsFunc = (
@@ -131,7 +128,7 @@ export const stepsFunc = (
131
128
  // testId: 'select-kerberos-authentication',
132
129
  // },
133
130
  {
134
- id: 11,
131
+ id: dynamicSteps.readyComplete,
135
132
  title: localization.common.readyComplete,
136
133
  subTitle: localization.common.readyCompleteDesc,
137
134
  status: UI_E_WIZARD_STATUS.INACTIVE,
@@ -142,14 +139,18 @@ export const stepsFunc = (
142
139
  ]
143
140
 
144
141
  export const stepsSchemeInitial: number[][] = [
145
- [dynamicSteps.type, dynamicSteps.nameAndDevice, 11], // Procurator Scheme for "shared-storm" type
146
- [dynamicSteps.type, dynamicSteps.nameAndConfigure, 11], // Procurator Scheme for "nfs" type
147
- [dynamicSteps.type, dynamicSteps.nameAndDevice, 11], // Sphere Scheme for "shared-storm" type
142
+ [dynamicSteps.type, dynamicSteps.nameAndDevice, dynamicSteps.readyComplete], // Procurator Scheme for "shared-storm" type
143
+ [
144
+ dynamicSteps.type,
145
+ dynamicSteps.nameAndConfigure,
146
+ dynamicSteps.readyComplete,
147
+ ], // Procurator Scheme for "nfs" type
148
+ [dynamicSteps.type, dynamicSteps.nameAndDevice, dynamicSteps.readyComplete], // Sphere Scheme for "shared-storm" type
148
149
  [
149
150
  dynamicSteps.type,
150
151
  dynamicSteps.nameAndConfigure,
151
152
  dynamicSteps.hostAccessibility,
152
- 11,
153
+ dynamicSteps.readyComplete,
153
154
  ], // Sphere Scheme for "nfs" type (not used from <host Context Menu>)
154
155
  ]
155
156
 
@@ -8,7 +8,7 @@ import type Wizard from '~/components/atoms/wizard/lib/utils/utils'
8
8
  import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
9
9
  import type { UI_T_Project } from '~/lib/models/types'
10
10
  import { checkValidityName } from '~/components/common/wizards/datastore/add/lib/utils'
11
-
11
+ import { dynamicSteps } from '~/components/common/wizards/datastore/add/lib/config/steps'
12
12
  const checkName = async (
13
13
  form: UI_I_CreateDatastoreForm,
14
14
  localization: UI_I_Localization,
@@ -108,12 +108,20 @@ export const checkNfsFolderSync = (
108
108
  let stepHasError = false
109
109
 
110
110
  if (!name) {
111
- stepHasError = wizard.setValidation(4, 'folder', {
112
- fieldMessage: localization.common.specifyFolderName,
113
- alertMessage: '',
114
- })
115
- } else if (wizard.hasMessage(4, 'folder')) {
116
- value = wizard.removeValidation(4, 'folder', value)
111
+ stepHasError = wizard.setValidation(
112
+ dynamicSteps.nameAndConfigure,
113
+ 'folder',
114
+ {
115
+ fieldMessage: localization.common.specifyFolderName,
116
+ alertMessage: '',
117
+ }
118
+ )
119
+ } else if (wizard.hasMessage(dynamicSteps.nameAndConfigure, 'folder')) {
120
+ value = wizard.removeValidation(
121
+ dynamicSteps.nameAndConfigure,
122
+ 'folder',
123
+ value
124
+ )
117
125
  }
118
126
 
119
127
  return {
@@ -131,12 +139,20 @@ export const checkNfsServerSync = (
131
139
  let stepHasError = false
132
140
 
133
141
  if (!name) {
134
- stepHasError = wizard.setValidation(4, 'server', {
135
- fieldMessage: localization.common.specifyServerName,
136
- alertMessage: '',
137
- })
138
- } else if (wizard.hasMessage(4, 'server')) {
139
- value = wizard.removeValidation(4, 'server', value)
142
+ stepHasError = wizard.setValidation(
143
+ dynamicSteps.nameAndConfigure,
144
+ 'server',
145
+ {
146
+ fieldMessage: localization.common.specifyServerName,
147
+ alertMessage: '',
148
+ }
149
+ )
150
+ } else if (wizard.hasMessage(dynamicSteps.nameAndConfigure, 'server')) {
151
+ value = wizard.removeValidation(
152
+ dynamicSteps.nameAndConfigure,
153
+ 'server',
154
+ value
155
+ )
140
156
  }
141
157
 
142
158
  return {
@@ -1,185 +1,43 @@
1
1
  <template>
2
- <div class="configuration">
3
- <div>
4
- <atoms-alert
5
- v-show="props.alertMessages?.length"
6
- test-id="configure-error-alert"
7
- status="alert-danger"
8
- :items="props.alertMessages"
9
- @remove="onHideAlert"
10
- />
11
-
12
- <atoms-alert
13
- v-show="alertInfo"
14
- test-id="configure-information-alert"
15
- status="alert-info"
16
- :items="[localization.common.nameAndConfigurationAlertInfo]"
17
- @remove="alertInfo = false"
18
- />
19
- <h6 class="nd-mt-0">{{ localization.common.nfsShareDetails }}</h6>
20
-
21
- <div class="clr-form-control clr-row">
22
- <label for="" class="clr-control-label clr-col-md-2">
23
- {{ localization.common.name }}
24
- </label>
25
-
26
- <div
27
- class="clr-control-container"
28
- :class="nameErrorText && 'clr-error'"
29
- >
30
- <div class="flex-align-center">
31
- <input
32
- id="configuration-name-input"
33
- v-model="model.name"
34
- data-id="configuration-name-input"
35
- type="text"
36
- class="clr-input"
37
- @blur="initValidation(true, ['name'])"
38
- @input="initValidation(false, ['name'])"
39
- />
40
- <atoms-the-icon class="error-icon" name="info-circle" />
41
- </div>
42
-
43
- <div class="clr-subtext" data-id="nfs-datastore-name-field-require">
44
- {{ nameErrorText }}
45
- </div>
46
- </div>
47
- </div>
48
-
49
- <div class="clr-form-control clr-row">
50
- <label class="clr-control-label clr-col-md-2">
51
- {{ localization.common.folder }}
52
- </label>
53
-
54
- <div
55
- class="clr-control-container"
56
- :class="folderErrorText && 'clr-error'"
57
- >
58
- <div class="flex-align-center">
59
- <input
60
- id="configuration-folder-input"
61
- v-model="model.folder"
62
- data-id="configuration-folder-input"
63
- type="text"
64
- class="clr-input"
65
- @blur="initValidation(true, ['folder'])"
66
- @input="initValidation(false, ['folder'])"
67
- />
68
- <atoms-the-icon class="error-icon" name="info-circle" />
69
- </div>
70
-
71
- <div
72
- v-if="folderErrorText"
73
- class="clr-subtext"
74
- data-id="folder-name-field-require"
75
- >
76
- {{ folderErrorText }}
77
- </div>
78
- <div v-else class="clr-subtext">E.g: /vols/vol0/datastore-001</div>
79
- </div>
80
- </div>
81
-
82
- <div class="nd-mt-0 clr-form-control clr-row">
83
- <label class="clr-control-label clr-col-md-2">
84
- {{ localization.common.server }}
85
- </label>
86
-
87
- <div
88
- class="clr-control-container"
89
- :class="serverErrorText && 'clr-error'"
90
- >
91
- <div class="flex-align-center input-action-wrapper">
92
- <input
93
- id="configuration-server-input"
94
- v-model="model.server"
95
- data-id="configuration-server-input"
96
- type="text"
97
- class="clr-input"
98
- @blur="initValidation(true, ['server'])"
99
- @input="initValidation(false, ['server'])"
100
- />
101
- <atoms-the-icon class="error-icon" name="info-circle" />
102
- </div>
103
- <div
104
- v-if="serverErrorText"
105
- class="clr-subtext"
106
- data-id="server-name-field-require"
107
- >
108
- {{ serverErrorText }}
109
- </div>
110
- <div v-else class="clr-subtext">
111
- E.g: nas, nas.it.com or 192.168.0.1
112
- </div>
113
- </div>
114
- </div>
115
- </div>
116
- </div>
2
+ <common-wizards-datastore-add-steps-name-and-configure-new
3
+ v-if="isNewView"
4
+ v-model="formModel"
5
+ v-model:alert-info="isShowAlertInfo"
6
+ :messages-fields="props.messagesFields"
7
+ />
8
+
9
+ <common-wizards-datastore-add-steps-name-and-configure-old
10
+ v-else
11
+ v-model="formModel"
12
+ v-model:alert-info="isShowAlertInfo"
13
+ :alert-messages="props.alertMessages"
14
+ :messages-fields="props.messagesFields"
15
+ @hide-alert="(e) => emits('hide-alert', e)"
16
+ />
117
17
  </template>
118
18
 
119
19
  <script lang="ts" setup>
120
20
  import type { UI_T_Project } from '~/lib/models/types'
121
- import type {
122
- UI_I_Localization,
123
- UI_I_ArbitraryObject,
124
- } from '~/lib/models/interfaces'
125
- import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
126
- import type { UI_I_InitialValidationFields } from '~/components/common/wizards/datastore/add/nfs/configuration/lib/models/interfaces'
21
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
22
+ import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
127
23
  import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
128
24
 
25
+ const formModel = defineModel<UI_I_CreateDatastoreForm>({ required: true })
129
26
  const props = defineProps<{
130
27
  project: UI_T_Project
131
28
  alertMessages: string[]
132
- messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
29
+ messagesFields: UI_I_WizardStep['fields']
133
30
  }>()
134
- const model = defineModel<UI_I_CreateDatastoreForm>({ required: true })
135
31
  const emits = defineEmits<{
136
32
  (event: 'hide-alert', value: number): void
137
33
  }>()
138
34
 
139
35
  const localization = computed<UI_I_Localization>(() => useLocal())
36
+ const { $store }: any = useNuxtApp()
140
37
 
141
- const initValidationFields = ref<UI_I_InitialValidationFields>({
142
- name: false,
143
- folder: false,
144
- server: false,
145
- })
146
- const initValidation = (onlyBlur = false, types: string[]): void => {
147
- onlyBlur && types.forEach((type) => (initValidationFields.value[type] = true))
148
- }
38
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
149
39
 
150
- /* Validation error text for Name input field */
151
- const nameErrorText = computed<string>(() => {
152
- if (props.messagesFields?.name?.field && !model.value.name) {
153
- return props.messagesFields.name.field
154
- }
155
-
156
- if (!initValidationFields.value.name) return ''
157
- return !model.value.name ? localization.value.common.specifyDatastoreName : ''
158
- })
159
-
160
- /* Validation error text for Folder input field */
161
- const folderErrorText = computed<string>(() => {
162
- if (props.messagesFields.folder?.field && !model.value.folder) {
163
- return props.messagesFields.folder.field
164
- }
165
-
166
- if (!initValidationFields.value.folder) return ''
167
- return !model.value.folder ? localization.value.common.specifyFolderName : ''
168
- })
169
-
170
- /* Validation error text for Server input field */
171
- const serverErrorText = computed<string>(() => {
172
- if (props.messagesFields.server?.field && !model.value.server) {
173
- return props.messagesFields.server.field
174
- }
175
-
176
- if (!initValidationFields.value.server) return ''
177
- return !model.value.server ? localization.value.common.specifyServerName : ''
178
- })
179
- const onHideAlert = (): void => {
180
- emits('hide-alert', 5)
181
- }
182
- const alertInfo = ref<boolean>(props.project === 'procurator')
40
+ const isShowAlertInfo = ref<boolean>(props.project === 'procurator')
183
41
  </script>
184
42
 
185
43
  <style lang="scss" scoped>
@@ -1,30 +1,123 @@
1
1
  <template>
2
- <div class="name-and-configure">
3
- {{ props }}
4
- {{ model }}
2
+ <div class="basics-step">
3
+ <div class="basics-step-row">
4
+ <div class="basics-step-row-title">
5
+ <span class="basics-step-row-title-text">
6
+ {{ localization.common.name }}
7
+ </span>
8
+ </div>
9
+ <div class="basics-step-row-content">
10
+ <ui-input
11
+ id="name"
12
+ v-model="formModelLocal.name"
13
+ test-id="new-host-name-field"
14
+ :placeholder="localization.common.hostNameOrIPAddress"
15
+ is-focused
16
+ :error="errorText"
17
+ @input="onRemoveValidationErrors"
18
+ />
19
+ </div>
20
+ </div>
21
+
22
+ <div class="basics-step-line"></div>
23
+
24
+ {{ isShowAlertInfo }}
5
25
  </div>
6
26
  </template>
7
27
 
8
- <script lang="ts" setup>
9
- import type { UI_T_Project } from '~/lib/models/types'
10
- import type {
11
- // UI_I_Localization,
12
- UI_I_ArbitraryObject,
13
- } from '~/lib/models/interfaces'
14
- import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
28
+ <script setup lang="ts">
29
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
30
+ import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
15
31
  import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
16
32
 
33
+ const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
34
+ const isShowAlertInfo = defineModel<boolean>('alertInfo', { required: true })
35
+
17
36
  const props = defineProps<{
18
- project: UI_T_Project
19
- alertMessages: string[]
20
- messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
37
+ messagesFields: UI_I_WizardStep['fields']
38
+ }>()
39
+ const emits = defineEmits<{
40
+ (event: 'remove-errors'): void
21
41
  }>()
22
- const model = defineModel<UI_I_CreateDatastoreForm>({ required: true })
23
- // const emits = defineEmits<{
24
- // (event: 'hide-alert', value: number): void
25
- // }>()
26
42
 
27
- // const localization = computed<UI_I_Localization>(() => useLocal())
43
+ const localization = computed<UI_I_Localization>(() => useLocal())
44
+
45
+ const onRemoveValidationErrors = (): void => {
46
+ emits('remove-errors')
47
+ }
28
48
  </script>
29
49
 
30
- <style lang="scss" scoped></style>
50
+ <style scoped lang="scss">
51
+ .basics-step {
52
+ padding: 16px 0 16px;
53
+
54
+ &-row {
55
+ min-height: 36px;
56
+ width: 100%;
57
+ display: flex;
58
+ column-gap: 16px;
59
+ align-items: center;
60
+
61
+ &-title {
62
+ padding-top: 8px;
63
+ max-width: 240px;
64
+ width: 100%;
65
+ display: flex;
66
+ align-items: center;
67
+ column-gap: 8px;
68
+ font-weight: 400;
69
+ font-size: 13px;
70
+ line-height: 20px;
71
+ letter-spacing: 0;
72
+ vertical-align: middle;
73
+ align-self: flex-start;
74
+ color: var(--wizard-content-title);
75
+ white-space: nowrap;
76
+ text-overflow: ellipsis;
77
+ overflow: hidden;
78
+
79
+ &-text {
80
+ display: block;
81
+ white-space: nowrap;
82
+ text-overflow: ellipsis;
83
+ overflow: hidden;
84
+ }
85
+ }
86
+
87
+ &-content {
88
+ max-width: 480px;
89
+ width: 100%;
90
+ font-weight: 400;
91
+ font-size: 13px;
92
+ line-height: 20px;
93
+ letter-spacing: 0;
94
+ vertical-align: middle;
95
+ color: var(--wizard-content-value);
96
+
97
+ &-text {
98
+ display: flex;
99
+ column-gap: 8px;
100
+ align-items: center;
101
+
102
+ &-icon {
103
+ width: 20px;
104
+ min-width: 20px;
105
+ height: 20px;
106
+ min-height: 20px;
107
+ }
108
+ }
109
+
110
+ &-switch-container {
111
+ width: fit-content;
112
+ }
113
+ }
114
+ }
115
+
116
+ &-line {
117
+ height: 0;
118
+ width: 100%;
119
+ border-bottom: 1px solid var(--wizard-content-line);
120
+ margin: 16px 0;
121
+ }
122
+ }
123
+ </style>
@@ -1,115 +1,110 @@
1
1
  <template>
2
2
  <div class="configuration">
3
- <div>
4
- <atoms-alert
5
- v-show="props.alertMessages?.length"
6
- test-id="configure-error-alert"
7
- status="alert-danger"
8
- :items="props.alertMessages"
9
- @remove="onHideAlert"
10
- />
11
-
12
- <atoms-alert
13
- v-show="alertInfo"
14
- test-id="configure-information-alert"
15
- status="alert-info"
16
- :items="[localization.common.nameAndConfigurationAlertInfo]"
17
- @remove="alertInfo = false"
18
- />
19
- <h6 class="nd-mt-0">{{ localization.common.nfsShareDetails }}</h6>
20
-
21
- <div class="clr-form-control clr-row">
22
- <label for="" class="clr-control-label clr-col-md-2">
23
- {{ localization.common.name }}
24
- </label>
3
+ <atoms-alert
4
+ v-show="props.alertMessages?.length"
5
+ test-id="configure-error-alert"
6
+ status="alert-danger"
7
+ :items="props.alertMessages"
8
+ @remove="onHideAlert"
9
+ />
10
+
11
+ <atoms-alert
12
+ v-show="isShowAlertInfo"
13
+ test-id="configure-information-alert"
14
+ status="alert-info"
15
+ :items="[localization.common.nameAndConfigurationAlertInfo]"
16
+ @remove="isShowAlertInfo = false"
17
+ />
18
+ <h6 class="nd-mt-0">{{ localization.common.nfsShareDetails }}</h6>
19
+
20
+ <div class="clr-form-control clr-row">
21
+ <label for="" class="clr-control-label clr-col-md-2">
22
+ {{ localization.common.name }}
23
+ </label>
24
+
25
+ <div class="clr-control-container" :class="nameErrorText && 'clr-error'">
26
+ <div class="flex-align-center">
27
+ <input
28
+ id="configuration-name-input"
29
+ v-model="formModelLocal.name"
30
+ data-id="configuration-name-input"
31
+ type="text"
32
+ class="clr-input"
33
+ @blur="initValidation(true, ['name'])"
34
+ @input="initValidation(false, ['name'])"
35
+ />
36
+ <atoms-the-icon class="error-icon" name="info-circle" />
37
+ </div>
25
38
 
26
- <div
27
- class="clr-control-container"
28
- :class="nameErrorText && 'clr-error'"
29
- >
30
- <div class="flex-align-center">
31
- <input
32
- id="configuration-name-input"
33
- v-model="model.name"
34
- data-id="configuration-name-input"
35
- type="text"
36
- class="clr-input"
37
- @blur="initValidation(true, ['name'])"
38
- @input="initValidation(false, ['name'])"
39
- />
40
- <atoms-the-icon class="error-icon" name="info-circle" />
41
- </div>
42
-
43
- <div class="clr-subtext" data-id="nfs-datastore-name-field-require">
44
- {{ nameErrorText }}
45
- </div>
39
+ <div class="clr-subtext" data-id="nfs-datastore-name-field-require">
40
+ {{ nameErrorText }}
46
41
  </div>
47
42
  </div>
43
+ </div>
48
44
 
49
- <div class="clr-form-control clr-row">
50
- <label class="clr-control-label clr-col-md-2">
51
- {{ localization.common.folder }}
52
- </label>
45
+ <div class="clr-form-control clr-row">
46
+ <label class="clr-control-label clr-col-md-2">
47
+ {{ localization.common.folder }}
48
+ </label>
49
+
50
+ <div
51
+ class="clr-control-container"
52
+ :class="folderErrorText && 'clr-error'"
53
+ >
54
+ <div class="flex-align-center">
55
+ <input
56
+ id="configuration-folder-input"
57
+ v-model="formModelLocal.folder"
58
+ data-id="configuration-folder-input"
59
+ type="text"
60
+ class="clr-input"
61
+ @blur="initValidation(true, ['folder'])"
62
+ @input="initValidation(false, ['folder'])"
63
+ />
64
+ <atoms-the-icon class="error-icon" name="info-circle" />
65
+ </div>
53
66
 
54
67
  <div
55
- class="clr-control-container"
56
- :class="folderErrorText && 'clr-error'"
68
+ v-if="folderErrorText"
69
+ class="clr-subtext"
70
+ data-id="folder-name-field-require"
57
71
  >
58
- <div class="flex-align-center">
59
- <input
60
- id="configuration-folder-input"
61
- v-model="model.folder"
62
- data-id="configuration-folder-input"
63
- type="text"
64
- class="clr-input"
65
- @blur="initValidation(true, ['folder'])"
66
- @input="initValidation(false, ['folder'])"
67
- />
68
- <atoms-the-icon class="error-icon" name="info-circle" />
69
- </div>
70
-
71
- <div
72
- v-if="folderErrorText"
73
- class="clr-subtext"
74
- data-id="folder-name-field-require"
75
- >
76
- {{ folderErrorText }}
77
- </div>
78
- <div v-else class="clr-subtext">E.g: /vols/vol0/datastore-001</div>
72
+ {{ folderErrorText }}
79
73
  </div>
74
+ <div v-else class="clr-subtext">E.g: /vols/vol0/datastore-001</div>
80
75
  </div>
76
+ </div>
81
77
 
82
- <div class="nd-mt-0 clr-form-control clr-row">
83
- <label class="clr-control-label clr-col-md-2">
84
- {{ localization.common.server }}
85
- </label>
86
-
78
+ <div class="nd-mt-0 clr-form-control clr-row">
79
+ <label class="clr-control-label clr-col-md-2">
80
+ {{ localization.common.server }}
81
+ </label>
82
+
83
+ <div
84
+ class="clr-control-container"
85
+ :class="serverErrorText && 'clr-error'"
86
+ >
87
+ <div class="flex-align-center input-action-wrapper">
88
+ <input
89
+ id="configuration-server-input"
90
+ v-model="formModelLocal.server"
91
+ data-id="configuration-server-input"
92
+ type="text"
93
+ class="clr-input"
94
+ @blur="initValidation(true, ['server'])"
95
+ @input="initValidation(false, ['server'])"
96
+ />
97
+ <atoms-the-icon class="error-icon" name="info-circle" />
98
+ </div>
87
99
  <div
88
- class="clr-control-container"
89
- :class="serverErrorText && 'clr-error'"
100
+ v-if="serverErrorText"
101
+ class="clr-subtext"
102
+ data-id="server-name-field-require"
90
103
  >
91
- <div class="flex-align-center input-action-wrapper">
92
- <input
93
- id="configuration-server-input"
94
- v-model="model.server"
95
- data-id="configuration-server-input"
96
- type="text"
97
- class="clr-input"
98
- @blur="initValidation(true, ['server'])"
99
- @input="initValidation(false, ['server'])"
100
- />
101
- <atoms-the-icon class="error-icon" name="info-circle" />
102
- </div>
103
- <div
104
- v-if="serverErrorText"
105
- class="clr-subtext"
106
- data-id="server-name-field-require"
107
- >
108
- {{ serverErrorText }}
109
- </div>
110
- <div v-else class="clr-subtext">
111
- E.g: nas, nas.it.com or 192.168.0.1
112
- </div>
104
+ {{ serverErrorText }}
105
+ </div>
106
+ <div v-else class="clr-subtext">
107
+ E.g: nas, nas.it.com or 192.168.0.1
113
108
  </div>
114
109
  </div>
115
110
  </div>
@@ -117,21 +112,19 @@
117
112
  </template>
118
113
 
119
114
  <script lang="ts" setup>
120
- import type { UI_T_Project } from '~/lib/models/types'
121
- import type {
122
- UI_I_Localization,
123
- UI_I_ArbitraryObject,
124
- } from '~/lib/models/interfaces'
125
- import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
115
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
116
+ import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
126
117
  import type { UI_I_InitialValidationFields } from '~/components/common/wizards/datastore/add/nfs/configuration/lib/models/interfaces'
127
118
  import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
119
+ import { dynamicSteps } from '~/components/common/wizards/datastore/add/lib/config/steps'
120
+
121
+ const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
122
+ const isShowAlertInfo = defineModel<boolean>('alertInfo', { required: true })
128
123
 
129
124
  const props = defineProps<{
130
- project: UI_T_Project
131
125
  alertMessages: string[]
132
- messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
126
+ messagesFields: UI_I_WizardStep['fields']
133
127
  }>()
134
- const model = defineModel<UI_I_CreateDatastoreForm>({ required: true })
135
128
  const emits = defineEmits<{
136
129
  (event: 'hide-alert', value: number): void
137
130
  }>()
@@ -149,37 +142,41 @@ const initValidation = (onlyBlur = false, types: string[]): void => {
149
142
 
150
143
  /* Validation error text for Name input field */
151
144
  const nameErrorText = computed<string>(() => {
152
- if (props.messagesFields?.name?.field && !model.value.name) {
145
+ if (props.messagesFields?.name?.field && !formModelLocal.value.name) {
153
146
  return props.messagesFields.name.field
154
147
  }
155
148
 
156
149
  if (!initValidationFields.value.name) return ''
157
- return !model.value.name ? localization.value.common.specifyDatastoreName : ''
150
+ return !formModelLocal.value.name
151
+ ? localization.value.common.specifyDatastoreName
152
+ : ''
158
153
  })
159
154
 
160
155
  /* Validation error text for Folder input field */
161
156
  const folderErrorText = computed<string>(() => {
162
- if (props.messagesFields.folder?.field && !model.value.folder) {
157
+ if (props.messagesFields.folder?.field && !formModelLocal.value.folder) {
163
158
  return props.messagesFields.folder.field
164
159
  }
165
160
 
166
161
  if (!initValidationFields.value.folder) return ''
167
- return !model.value.folder ? localization.value.common.specifyFolderName : ''
162
+ return !formModelLocal.value.folder
163
+ ? localization.value.common.specifyFolderName
164
+ : ''
168
165
  })
169
166
 
170
167
  /* Validation error text for Server input field */
171
168
  const serverErrorText = computed<string>(() => {
172
- if (props.messagesFields.server?.field && !model.value.server) {
169
+ if (props.messagesFields.server?.field && !formModelLocal.value.server) {
173
170
  return props.messagesFields.server.field
174
171
  }
175
172
 
176
173
  if (!initValidationFields.value.server) return ''
177
- return !model.value.server ? localization.value.common.specifyServerName : ''
174
+ return !formModelLocal.value.server
175
+ ? localization.value.common.specifyServerName
176
+ : ''
178
177
  })
179
- const onHideAlert = (): void => {
180
- emits('hide-alert', 5)
181
- }
182
- const alertInfo = ref<boolean>(props.project === 'procurator')
178
+ const onHideAlert = (): void =>
179
+ emits('hide-alert', dynamicSteps.nameAndConfigure)
183
180
  </script>
184
181
 
185
182
  <style lang="scss" scoped>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.77",
4
+ "version": "1.5.78",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -1,92 +0,0 @@
1
- <template>
2
- <div class="ready-complete">
3
- <common-details-list :items="properties" class="ready-complete__list list">
4
- <template #default="{ item }">
5
- <common-details-item
6
- :has-children="true"
7
- open-by-default
8
- :test-id="item.testId"
9
- >
10
- <template #stackBlockKey>
11
- <span class="list__labels">
12
- {{ item.label }}
13
- </span>
14
- </template>
15
-
16
- <template #stackChildren>
17
- <template
18
- v-for="(item2, key2) in item.items"
19
- :key="`${item2}_${key2}`"
20
- >
21
- <common-details-item
22
- :has-children="false"
23
- :test-id="item2.testId"
24
- class="list__default-style"
25
- >
26
- <template #stackBlockKey>
27
- <div>
28
- {{ item2.label }}
29
- </div>
30
- </template>
31
- <template #stackBlockContent>
32
- <div v-if="item2.data">
33
- <div
34
- v-for="item3 in item2.data"
35
- :key="item3"
36
- class="flex-align-center"
37
- >
38
- <div class="vsphere-icon-host"></div>
39
- <span>{{ item3 }}</span>
40
- </div>
41
- </div>
42
- <span v-else>
43
- {{ item2.value }}
44
- </span>
45
- </template>
46
- </common-details-item>
47
- </template>
48
- </template>
49
- </common-details-item>
50
- </template>
51
- </common-details-list>
52
- </div>
53
- </template>
54
-
55
- <script lang="ts" setup>
56
- import { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
57
- import { UI_I_Localization } from '~/lib/models/interfaces'
58
-
59
- const props = defineProps<{
60
- dataReadyView: UI_I_DetailsItem[]
61
- }>()
62
-
63
- const localization = computed<UI_I_Localization>(() => useLocal())
64
-
65
- const properties = computed<UI_I_DetailsItem[]>(() => props.dataReadyView)
66
- </script>
67
-
68
- <style lang="scss" scoped>
69
- @import '~/assets/scss/common/mixins.scss';
70
- .ready-complete {
71
- &__list {
72
- @include flex($dir: column);
73
- padding: 12px 0;
74
- row-gap: 15px;
75
- }
76
- }
77
- .list {
78
- &__labels {
79
- @include text($fs: 13px, $fw: 700);
80
- }
81
- :deep(.list__default-style) {
82
- .stack-block {
83
- &__label {
84
- align-items: flex-start;
85
- }
86
- &-content {
87
- white-space: pre-line;
88
- }
89
- }
90
- }
91
- }
92
- </style>
@@ -1,142 +0,0 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
3
- import type { UI_T_Project } from '~/lib/models/types'
4
- import type { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
5
- import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
6
- import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
7
- const constructLunDiskItems = (
8
- disks: UI_I_CreateStorageLunDiskItem[]
9
- ): string => {
10
- const { $binary } = useNuxtApp() as any
11
-
12
- let result = ''
13
- disks.forEach((disk: UI_I_CreateStorageLunDiskItem) => {
14
- const capacity = $binary.round(disk.capacity_mb)
15
- result += `${disk.name} - ${capacity} \n`
16
- })
17
- return result
18
- }
19
-
20
- const nfsDetailsFunc = (
21
- localization: UI_I_Localization,
22
- data: UI_I_CreateDatastoreForm,
23
- project: UI_T_Project,
24
- nfsHosts: UI_I_CreateDatastoreHosts
25
- ): UI_I_DetailsItem[] => {
26
- const { name, server, folder, nfsVersion, hosts } = data
27
- // const accessMode = readonly ? 'Read-only' : 'Read-write'
28
-
29
- const details: UI_I_DetailsItem[] = [
30
- {
31
- label: localization.common.nfsVersion,
32
- value: '',
33
- items: [
34
- {
35
- label: localization.common.version,
36
- value: nfsVersion.toUpperCase(),
37
- items: [],
38
- testId: 'view-selected-nfs-version-in-complete',
39
- },
40
- ],
41
- actions: [],
42
- testId: 'view-selected-nfs-version',
43
- },
44
- {
45
- label: localization.common.nameAndConfiguration,
46
- value: '',
47
- items: [
48
- {
49
- label: localization.common.datastoreName,
50
- value: name,
51
- items: [],
52
- testId: 'view-storage-name-in-complete',
53
- },
54
- {
55
- label: localization.common.server,
56
- value: server,
57
- items: [],
58
- testId: 'view-server-name-in-complete',
59
- },
60
- {
61
- label: localization.common.folder,
62
- value: folder,
63
- items: [],
64
- testId: 'view-folder-name-in-complete',
65
- },
66
- // {
67
- // label: localization.accessMode,
68
- // value: accessMode,
69
- // items: [],
70
- // },
71
- ],
72
- actions: [],
73
- testId: 'view-selected-name-configuration',
74
- },
75
- ]
76
-
77
- if (project === 'sphere') {
78
- const hostsNames = nfsHosts
79
- ? nfsHosts.items
80
- .filter((host) => data.hosts.includes(host.id))
81
- .map((host) => host.host)
82
- : []
83
- details.push({
84
- label: localization.common.hostsAccessibility,
85
- value: '',
86
- items: [
87
- {
88
- label: localization.common.hosts,
89
- value: '',
90
- data: hostsNames,
91
- items: [],
92
- testId: 'view-hosts-name-in-complete',
93
- },
94
- ],
95
- actions: [],
96
- })
97
- }
98
-
99
- return details
100
- }
101
- const sharedStormDetailsFunc = (
102
- localization: UI_I_Localization,
103
- data: UI_I_CreateDatastoreForm
104
- ): UI_I_DetailsItem[] => {
105
- const { name, lunDisk } = data
106
-
107
- return [
108
- {
109
- label: localization.common.nameAndDeviceSelection,
110
- value: '',
111
- items: [
112
- {
113
- label: localization.common.datastoreName,
114
- value: name,
115
- items: [],
116
- testId: 'view-storage-name-in-complete',
117
- },
118
- {
119
- label: localization.common.diskLun,
120
- value: constructLunDiskItems(lunDisk),
121
- items: [],
122
- testId: 'view-selected-lun-disks-in-complete',
123
- },
124
- ],
125
- actions: [],
126
- },
127
- ]
128
- }
129
-
130
- export const constructDataReadyViewFunc = (
131
- localization: UI_I_Localization,
132
- data: UI_I_CreateDatastoreForm,
133
- project: UI_T_Project,
134
- nfsHosts: UI_I_CreateDatastoreHosts
135
- ): UI_I_DetailsItem[] => {
136
- const details = {
137
- 2: sharedStormDetailsFunc,
138
- 4: nfsDetailsFunc,
139
- }
140
-
141
- return details[data.type_code as 2 | 4](localization, data, project, nfsHosts)
142
- }