bfg-common 1.5.764 → 1.5.765

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.
@@ -10,7 +10,7 @@ import type { UI_I_SecurityProfileData } from '~/store/inventory/modules/configu
10
10
 
11
11
  const props = defineProps<{
12
12
  activeNodeName: string
13
- apiData: UI_I_SecurityProfileData
13
+ apiData: UI_I_SecurityProfileData | null
14
14
  }>()
15
15
  </script>
16
16
 
@@ -18,7 +18,7 @@
18
18
  </template>
19
19
  <template #stackBlockContent>
20
20
  <span data-id="certificate-subject-value">
21
- {{ securityProfileData.lockdownMode.lockdownMode }}
21
+ {{ currentTextLockdownMode }}
22
22
  </span>
23
23
  </template>
24
24
  </atoms-stack-block>
@@ -58,7 +58,7 @@ import { constructData } from '~/components/common/configure/securityProfile/loc
58
58
 
59
59
  const props = defineProps<{
60
60
  activeNodeName: string
61
- apiData: UI_I_SecurityProfileData
61
+ apiData: UI_I_SecurityProfileData | null
62
62
  }>()
63
63
 
64
64
  const { $store }: any = useNuxtApp()
@@ -68,13 +68,25 @@ const nodeId = useRoute().params.id
68
68
  const localization = computed<UI_I_Localization>(() => useLocal())
69
69
 
70
70
  const securityProfileData = computed<UI_I_SecurityProfileData>(() =>
71
- constructData(props.apiData, localization.value)
71
+ constructData(props.apiData)
72
72
  )
73
73
 
74
74
  const lockdownModeExceptionUsers = computed<string>(() =>
75
75
  securityProfileData.value.lockdownMode.exceptionUsers.join(', ')
76
76
  )
77
77
 
78
+ const currentTextLockdownMode = computed<string>(() => {
79
+ let result = ''
80
+
81
+ switch (securityProfileData.value.lockdownMode.lockdownMode) {
82
+ case 'disabled':
83
+ result = localization.value.common.disabled
84
+ break
85
+ }
86
+
87
+ return result
88
+ })
89
+
78
90
  const getData = (): void => {
79
91
  $store.dispatch('securityProfile/A_GET_SECURITY_PROFILE', nodeId)
80
92
  }
@@ -1,29 +1,23 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
1
  import type { UI_I_SecurityProfileData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
3
2
 
4
- const getLockdownModeCurrentText = (
5
- data: string,
6
- localization: UI_I_Localization
7
- ): string => {
3
+ const getLockdownModeCurrentText = (data: string): string => {
8
4
  switch (data) {
9
5
  case 'disabled':
10
- return localization.common.disabled
6
+ return 'disabled'
11
7
  default:
12
8
  return ''
13
9
  }
14
10
  }
15
11
 
16
12
  export const constructData = (
17
- data: UI_I_SecurityProfileData | null,
18
- localization: UI_I_Localization
13
+ data: UI_I_SecurityProfileData | null
19
14
  ): UI_I_SecurityProfileData => {
20
15
  let result: UI_I_SecurityProfileData | null = null
21
16
 
22
17
  result = {
23
18
  lockdownMode: {
24
19
  lockdownMode: getLockdownModeCurrentText(
25
- data?.lockdownMode.lockdownMode || '',
26
- localization
20
+ data?.lockdownMode.lockdownMode || ''
27
21
  ),
28
22
  exceptionUsers: data?.lockdownMode.exceptionUsers || [],
29
23
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.764",
4
+ "version": "1.5.765",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",