bfg-common 1.5.77 → 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.
@@ -1,30 +1,210 @@
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="configuration-name-input"
12
+ v-model="formModelLocal.name"
13
+ test-id="configuration-name-input"
14
+ is-focused
15
+ :error="nameErrorText"
16
+ @blur="initValidation(true, ['name'])"
17
+ @input="initValidation(false, ['name'])"
18
+ />
19
+ </div>
20
+ </div>
21
+
22
+ <div class="basics-step-line"></div>
23
+
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>
5
71
  </div>
6
72
  </template>
7
73
 
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'
74
+ <script setup lang="ts">
75
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
76
+ import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
15
77
  import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
16
78
 
79
+ const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
80
+ // const isShowAlertInfo = defineModel<boolean>('alertInfo', { required: true })
81
+
17
82
  const props = defineProps<{
18
- project: UI_T_Project
19
- alertMessages: string[]
20
- messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
83
+ messagesFields: UI_I_WizardStep['fields']
84
+ }>()
85
+ const emits = defineEmits<{
86
+ (event: 'remove-errors'): void
21
87
  }>()
22
- const model = defineModel<UI_I_CreateDatastoreForm>({ required: true })
23
- // const emits = defineEmits<{
24
- // (event: 'hide-alert', value: number): void
25
- // }>()
26
88
 
27
- // const localization = computed<UI_I_Localization>(() => useLocal())
89
+ const localization = computed<UI_I_Localization>(() => useLocal())
90
+
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))
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
+ })
28
135
  </script>
29
136
 
30
- <style lang="scss" scoped></style>
137
+ <style scoped lang="scss">
138
+ .basics-step {
139
+ padding: 16px 0 16px;
140
+
141
+ &-row {
142
+ min-height: 36px;
143
+ width: 100%;
144
+ display: flex;
145
+ column-gap: 16px;
146
+ align-items: center;
147
+
148
+ &-title {
149
+ padding-top: 8px;
150
+ max-width: 240px;
151
+ width: 100%;
152
+ display: flex;
153
+ align-items: center;
154
+ column-gap: 8px;
155
+ font-weight: 400;
156
+ font-size: 13px;
157
+ line-height: 20px;
158
+ letter-spacing: 0;
159
+ vertical-align: middle;
160
+ align-self: flex-start;
161
+ color: var(--wizard-content-title);
162
+ white-space: nowrap;
163
+ text-overflow: ellipsis;
164
+ overflow: hidden;
165
+
166
+ &-text {
167
+ display: block;
168
+ white-space: nowrap;
169
+ text-overflow: ellipsis;
170
+ overflow: hidden;
171
+ }
172
+ }
173
+
174
+ &-content {
175
+ max-width: 480px;
176
+ width: 100%;
177
+ font-weight: 400;
178
+ font-size: 13px;
179
+ line-height: 20px;
180
+ letter-spacing: 0;
181
+ vertical-align: middle;
182
+ color: var(--wizard-content-value);
183
+
184
+ &-text {
185
+ display: flex;
186
+ column-gap: 8px;
187
+ align-items: center;
188
+
189
+ &-icon {
190
+ width: 20px;
191
+ min-width: 20px;
192
+ height: 20px;
193
+ min-height: 20px;
194
+ }
195
+ }
196
+
197
+ &-switch-container {
198
+ width: fit-content;
199
+ }
200
+ }
201
+ }
202
+
203
+ &-line {
204
+ height: 0;
205
+ width: 100%;
206
+ border-bottom: 1px solid var(--wizard-content-line);
207
+ margin: 16px 0;
208
+ }
209
+ }
210
+ </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.79",
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>