bfg-common 1.5.763 → 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.
@@ -1,12 +1,16 @@
1
1
  <template>
2
2
  <common-configure-security-profile-lockdown-mode
3
3
  :active-node-name="props.activeNodeName"
4
+ :api-data="props.apiData"
4
5
  />
5
6
  </template>
6
7
 
7
8
  <script setup lang="ts">
9
+ import type { UI_I_SecurityProfileData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
10
+
8
11
  const props = defineProps<{
9
12
  activeNodeName: string
13
+ apiData: UI_I_SecurityProfileData | null
10
14
  }>()
11
15
  </script>
12
16
 
@@ -1,6 +1,8 @@
1
1
  <template>
2
2
  <div class="lockdown-mode">
3
- <common-configure-security-profile-lockdown-mode-tools />
3
+ <common-configure-security-profile-lockdown-mode-tools
4
+ @show-edit="isShowEdit = true"
5
+ />
4
6
 
5
7
  <div class="stack-view">
6
8
  <atoms-stack-block
@@ -16,7 +18,7 @@
16
18
  </template>
17
19
  <template #stackBlockContent>
18
20
  <span data-id="certificate-subject-value">
19
- {{ securityProfileData.lockdownMode.lockdownMode }}
21
+ {{ currentTextLockdownMode }}
20
22
  </span>
21
23
  </template>
22
24
  </atoms-stack-block>
@@ -56,6 +58,7 @@ import { constructData } from '~/components/common/configure/securityProfile/loc
56
58
 
57
59
  const props = defineProps<{
58
60
  activeNodeName: string
61
+ apiData: UI_I_SecurityProfileData | null
59
62
  }>()
60
63
 
61
64
  const { $store }: any = useNuxtApp()
@@ -65,13 +68,25 @@ const nodeId = useRoute().params.id
65
68
  const localization = computed<UI_I_Localization>(() => useLocal())
66
69
 
67
70
  const securityProfileData = computed<UI_I_SecurityProfileData>(() =>
68
- constructData($store.getters['securityProfile/getSystemSecurityProfile'])
71
+ constructData(props.apiData)
69
72
  )
70
73
 
71
74
  const lockdownModeExceptionUsers = computed<string>(() =>
72
75
  securityProfileData.value.lockdownMode.exceptionUsers.join(', ')
73
76
  )
74
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
+
75
90
  const getData = (): void => {
76
91
  $store.dispatch('securityProfile/A_GET_SECURITY_PROFILE', nodeId)
77
92
  }
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <component
3
3
  :is="currentComponent"
4
+ v-model:local-edit-data="localEditData"
4
5
  :title="title"
5
6
  :selected-tab="selectedTab"
6
7
  :tab-items="tabItems"
@@ -106,45 +106,4 @@ const emits = defineEmits<{
106
106
  }
107
107
  }
108
108
  }
109
- .action-container {
110
- position: absolute;
111
- top: -33px;
112
- left: 5px;
113
- background: var(--block-view-bg-color2);
114
- border: 1px solid var(--block-border-color);
115
- padding: 5px 6px;
116
- border-radius: 3px;
117
-
118
- .action-wrap {
119
- &::after {
120
- content: '';
121
- display: block;
122
- position: absolute;
123
- width: 8px;
124
- height: 8px;
125
- background: var(--block-view-bg-color2);
126
- transform: rotate(45deg);
127
- left: -11px;
128
- bottom: calc(50% - 4px);
129
- border-left: 0.5px solid var(--block-border-color);
130
- border-bottom: 0.5px solid var(--block-border-color);
131
- z-index: var(--z-dropdown);
132
- }
133
- }
134
- .action {
135
- border: none;
136
- padding: 1px 20px;
137
- width: 100%;
138
- text-align: left;
139
- cursor: pointer;
140
- background: var(--block-view-bg-color2);
141
- color: var(--global-font-color3);
142
- white-space: nowrap;
143
- text-transform: capitalize;
144
-
145
- &:hover {
146
- background: var(--vertical-nav-hover-bg-color);
147
- }
148
- }
149
- }
150
109
  </style>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <component
3
3
  :is="currentComponent"
4
- v-model:local-edit-data="localEditData"
4
+ v-model:local-edit-data="form"
5
5
  @add="emits('add', $event)"
6
6
  />
7
7
  </template>
@@ -9,7 +9,7 @@
9
9
  <script setup lang="ts">
10
10
  import type { UI_I_LockdownModeData } from '~/store/inventory/modules/configure/securityProfile/lib/models/interfaces'
11
11
 
12
- const localEditData = defineModel<UI_I_LockdownModeData>('localEditData')
12
+ const form = defineModel<UI_I_LockdownModeData>('form')
13
13
 
14
14
  const emits = defineEmits<{
15
15
  (event: 'add', value: string): void
@@ -18,7 +18,7 @@
18
18
 
19
19
  <div class="mt-3">
20
20
  <atoms-table-data-grid
21
- :column-keys="columnKeys"
21
+ v-model:column-keys="columnItems"
22
22
  :head-items="headItems"
23
23
  :body-items="bodyItems"
24
24
  :total-items="bodyItems.length"
@@ -87,7 +87,7 @@ const localization = computed<UI_I_Localization>(() => useLocal())
87
87
 
88
88
  const newUserName = ref<string>('')
89
89
 
90
- const columnKeys = ref<UI_I_ColumnKey[]>(
90
+ const columnItems = computed<UI_I_ColumnKey[]>(() =>
91
91
  exceptionUsersTable.columnKeys(localization.value)
92
92
  )
93
93
  const headItems = computed<UI_I_HeadItem[]>(() =>
@@ -134,4 +134,46 @@ onUnmounted(() => {
134
134
  })
135
135
  </script>
136
136
 
137
- <style scoped lang="scss"></style>
137
+ <style scoped lang="scss">
138
+ .action-container {
139
+ position: absolute;
140
+ top: -33px;
141
+ left: 5px;
142
+ background: var(--block-view-bg-color2);
143
+ border: 1px solid var(--block-border-color);
144
+ padding: 5px 6px;
145
+ border-radius: 3px;
146
+
147
+ .action-wrap {
148
+ &::after {
149
+ content: '';
150
+ display: block;
151
+ position: absolute;
152
+ width: 8px;
153
+ height: 8px;
154
+ background: var(--block-view-bg-color2);
155
+ transform: rotate(45deg);
156
+ left: -11px;
157
+ bottom: calc(50% - 4px);
158
+ border-left: 0.5px solid var(--block-border-color);
159
+ border-bottom: 0.5px solid var(--block-border-color);
160
+ z-index: var(--z-dropdown);
161
+ }
162
+ }
163
+ .action {
164
+ border: none;
165
+ padding: 1px 20px;
166
+ width: 100%;
167
+ text-align: left;
168
+ cursor: pointer;
169
+ background: var(--block-view-bg-color2);
170
+ color: var(--global-font-color3);
171
+ white-space: nowrap;
172
+ text-transform: capitalize;
173
+
174
+ &:hover {
175
+ background: var(--vertical-nav-hover-bg-color);
176
+ }
177
+ }
178
+ }
179
+ </style>
@@ -4,8 +4,11 @@ import type {
4
4
  UI_I_HeadItem,
5
5
  UI_I_BodyItem,
6
6
  } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
7
- import * as defaultSettings from '~/components/atoms/table/dataGrid/lib/config/settingsTable'
8
7
  import { exceptionUsersTableKeys } from '~/components/common/configure/securityProfile/lockdownMode/modals/lockdownModeEdit/exceptionUsers/old/lib/config/tableKeys'
8
+ import {
9
+ constructColumnKey,
10
+ constructHeadItem,
11
+ } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
9
12
 
10
13
  const getItems = (
11
14
  localization: UI_I_Localization
@@ -16,11 +19,28 @@ const getItems = (
16
19
  ]
17
20
  }
18
21
 
19
- export const columnKeys = (localization: UI_I_Localization): UI_I_ColumnKey[] =>
20
- defaultSettings.defaultColumnKeys(getItems(localization))
22
+ export const columnKeys = (
23
+ localization: UI_I_Localization
24
+ ): UI_I_ColumnKey[] => {
25
+ const result: UI_I_ColumnKey[] = []
26
+ getItems(localization).forEach((item, i) => {
27
+ const col = `col${i + 1}`
28
+ result.push(constructColumnKey(col, item[0], item[1]))
29
+ })
21
30
 
22
- export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] =>
23
- defaultSettings.defaultHeadItems(getItems(localization))
31
+ return result
32
+ }
33
+
34
+ export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
35
+ const result: UI_I_HeadItem[] = []
36
+ getItems(localization).forEach((item, i) => {
37
+ const col = `col${i + 1}`
38
+ result.push(
39
+ constructHeadItem(col, item[0], item[3], false, item[2], '', item[3])
40
+ )
41
+ })
42
+ return result
43
+ }
24
44
 
25
45
  export const bodyItems = (data: string[]): UI_I_BodyItem[][] => {
26
46
  const bodyItems: UI_I_BodyItem[][] = []
@@ -39,5 +59,6 @@ export const bodyItems = (data: string[]): UI_I_BodyItem[][] => {
39
59
  },
40
60
  ])
41
61
  })
62
+
42
63
  return bodyItems
43
64
  }
@@ -3,12 +3,17 @@
3
3
  :is="currentComponent"
4
4
  :title="localization.common.lockdownMode"
5
5
  :description="localization.configureSecurityProfile.lockdownModeDesc"
6
+ @show-edit="emits('show-edit')"
6
7
  />
7
8
  </template>
8
9
 
9
10
  <script setup lang="ts">
10
11
  import type { UI_I_Localization } from '~/lib/models/interfaces'
11
12
 
13
+ const emits = defineEmits<{
14
+ (event: 'show-edit'): void
15
+ }>()
16
+
12
17
  const { $store }: any = useNuxtApp()
13
18
 
14
19
  const localization = computed<UI_I_Localization>(() => useLocal())
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.763",
4
+ "version": "1.5.765",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -3,10 +3,10 @@ export interface UI_API_I_LockdownModeData {
3
3
  exceptionUsers: string[]
4
4
  }
5
5
 
6
- export interface API_I_SecurityProfileData {
6
+ export interface UI_API_I_SecurityProfileData {
7
7
  lockdownMode: UI_API_I_LockdownModeData
8
8
  }
9
9
 
10
10
  export interface UI_I_LockdownModeData extends UI_API_I_LockdownModeData {}
11
11
 
12
- export interface UI_I_SecurityProfileData extends API_I_SecurityProfileData {}
12
+ export interface UI_I_SecurityProfileData extends UI_API_I_SecurityProfileData {}