bfg-common 1.3.457 → 1.3.458

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.
@@ -172,7 +172,16 @@ const checkName = async (
172
172
  wizard: Wizard
173
173
  // emits: UI_I_AddNetworkingEmits
174
174
  ): Promise<UI_I_AsyncCheckReturn> => {
175
- if (label) {
175
+ const typeCode = form.value.type_code
176
+
177
+ let help = typeCode === 1
178
+ if (typeCode === 2) {
179
+ help = form.value.lunDisk.length
180
+ }
181
+ if (typeCode === 4) {
182
+ help = form.value.folder && form.value.server
183
+ }
184
+ if (label && help) {
176
185
  return new Promise((resolve, _reject) =>
177
186
  checkValidityName(label, wizard, (message: string) => {
178
187
  resolve({
@@ -280,7 +289,7 @@ const checkNfsFolderSync = (
280
289
 
281
290
  if (!name) {
282
291
  stepHasError = wizard.setValidation(5, 'folder', {
283
- fieldMessage: localization.noHostOrClusterSelected,
292
+ fieldMessage: localization.specifyFolderName,
284
293
  alertMessage: '',
285
294
  })
286
295
  } else if (wizard.hasMessage(5, 'folder')) {
@@ -292,6 +301,28 @@ const checkNfsFolderSync = (
292
301
  stepHasError,
293
302
  }
294
303
  }
304
+ const checkNfsServerSync = (
305
+ localization: UI_I_Localization,
306
+ name: string,
307
+ wizard: Wizard,
308
+ value: UI_I_WizardStep[]
309
+ ): UI_I_ValidationReturn => {
310
+ let stepHasError = false
311
+
312
+ if (!name) {
313
+ stepHasError = wizard.setValidation(5, 'server', {
314
+ fieldMessage: localization.specifyServerName,
315
+ alertMessage: '',
316
+ })
317
+ } else if (wizard.hasMessage(5, 'server')) {
318
+ value = wizard.removeValidation(5, 'server', value)
319
+ }
320
+
321
+ return {
322
+ newValue: value,
323
+ stepHasError,
324
+ }
325
+ }
295
326
 
296
327
  const validationFunc = async (
297
328
  value: UI_I_WizardStep[],
@@ -347,7 +378,17 @@ const validationFunc = async (
347
378
  value
348
379
  )
349
380
 
350
- stepHasError = folderValidation.stepHasError || nameValidation.stepHasError
381
+ const serverValidation = checkNfsServerSync(
382
+ localization.value,
383
+ form.value.folder,
384
+ wizard,
385
+ value
386
+ )
387
+
388
+ stepHasError =
389
+ folderValidation.stepHasError ||
390
+ nameValidation.stepHasError ||
391
+ serverValidation.stepHasError
351
392
  }
352
393
 
353
394
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.457",
4
+ "version": "1.3.458",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",