@finema/finework-layer 0.0.13 → 0.0.14
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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.14](https://gitlab.finema.co/finema/finework/finework-frontend-layer/compare/0.0.13...0.0.14) (2025-10-14)
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* **ui:** adjust responsive header height and padding ([000e5d7](https://gitlab.finema.co/finema/finework/finework-frontend-layer/commit/000e5d75d2779c5fd94354cf4426f5a9085af733))
|
|
8
|
+
* **ui:** adjust responsive layout of admin header elements ([0c46820](https://gitlab.finema.co/finema/finework/finework-frontend-layer/commit/0c468205b498a1ff6c260eefd32b4e244a671f96))
|
|
9
|
+
|
|
3
10
|
## [0.0.13](https://gitlab.finema.co/finema/finework/finework-frontend-layer/compare/0.0.12...0.0.13) (2025-10-14)
|
|
4
11
|
|
|
5
12
|
### Features
|
|
@@ -148,6 +148,7 @@
|
|
|
148
148
|
import type { NavigationMenuItem } from '@nuxt/ui'
|
|
149
149
|
import { computed } from 'vue'
|
|
150
150
|
import { useRoute } from 'vue-router'
|
|
151
|
+
import type { Permission, UserModule } from '#imports'
|
|
151
152
|
import Navbar from './Apps.vue'
|
|
152
153
|
|
|
153
154
|
defineEmits<{
|
|
@@ -218,9 +219,56 @@ const mappedItems = (items: NavigationMenuItem[]): NavigationMenuItem[] => {
|
|
|
218
219
|
})
|
|
219
220
|
}
|
|
220
221
|
|
|
222
|
+
// filter items base on auth.hasPermission and nested children , permissions: ['pmo:USER', 'pmo:ADMIN', 'pmo:SUPER']
|
|
223
|
+
const filterItems = (items: NavigationMenuItem[]): NavigationMenuItem[] => {
|
|
224
|
+
return items.filter((item) => {
|
|
225
|
+
if (item.permissions && Array.isArray(item.permissions)) {
|
|
226
|
+
// permissions: ['pmo:USER', 'pmo:ADMIN', 'pmo:SUPER'] => module: 'pmo', permissions: ['USER', 'ADMIN', 'SUPER']
|
|
227
|
+
const permissionStrings = item.permissions as string[]
|
|
228
|
+
|
|
229
|
+
// Extract module from first permission (all should have same module)
|
|
230
|
+
const firstPermission = permissionStrings[0]
|
|
231
|
+
|
|
232
|
+
if (!firstPermission) {
|
|
233
|
+
return true
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const [moduleStr] = firstPermission.split(':')
|
|
237
|
+
|
|
238
|
+
// Extract all permission levels
|
|
239
|
+
const permissionLevels = permissionStrings.map((p) => p.split(':')[1]) as Permission[]
|
|
240
|
+
|
|
241
|
+
return auth.hasPermission(moduleStr as UserModule, ...permissionLevels)
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Recursively filter children
|
|
245
|
+
if (item.children) {
|
|
246
|
+
const filteredChildren = filterItems(item.children as NavigationMenuItem[])
|
|
247
|
+
|
|
248
|
+
// Only include parent if it has visible children or no permission requirement
|
|
249
|
+
return filteredChildren.length > 0
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return true
|
|
253
|
+
}).map((item) => {
|
|
254
|
+
// Apply filtering to children
|
|
255
|
+
if (item.children) {
|
|
256
|
+
return {
|
|
257
|
+
...item,
|
|
258
|
+
children: filterItems(item.children as NavigationMenuItem[]),
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return item
|
|
263
|
+
})
|
|
264
|
+
}
|
|
265
|
+
|
|
221
266
|
const navigationItems = computed<NavigationMenuItem[]>(() => {
|
|
267
|
+
// First filter items based on permissions
|
|
268
|
+
const filteredItems = filterItems(props.items)
|
|
269
|
+
|
|
222
270
|
if (props.isGroup) {
|
|
223
|
-
return
|
|
271
|
+
return filteredItems.map((group) => {
|
|
224
272
|
return {
|
|
225
273
|
...group,
|
|
226
274
|
children: mappedItems(group.children as NavigationMenuItem[]),
|
|
@@ -228,6 +276,6 @@ const navigationItems = computed<NavigationMenuItem[]>(() => {
|
|
|
228
276
|
})
|
|
229
277
|
}
|
|
230
278
|
|
|
231
|
-
return mappedItems(
|
|
279
|
+
return mappedItems(filteredItems)
|
|
232
280
|
})
|
|
233
281
|
</script>
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
>
|
|
26
26
|
<nav
|
|
27
27
|
class="
|
|
28
|
-
fixed top-0 left-0 z-20 flex min-h-[
|
|
29
|
-
|
|
28
|
+
fixed top-0 left-0 z-20 flex min-h-[64px] w-screen items-center justify-between
|
|
29
|
+
gap-4 bg-white px-5 lg:min-h-[72px]
|
|
30
30
|
lg:justify-end
|
|
31
31
|
"
|
|
32
32
|
style="box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.04);"
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
src="/logo-mini.png"
|
|
76
76
|
alt="logo_mini_color"
|
|
77
77
|
class="
|
|
78
|
-
|
|
79
|
-
lg:
|
|
78
|
+
w-[126px] min-w-[126px] lg:hidden
|
|
79
|
+
lg:w-[172px] lg:min-w-[172px]
|
|
80
80
|
"
|
|
81
81
|
/>
|
|
82
82
|
</NuxtLink>
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
>
|
|
98
98
|
<div class="relative flex cursor-pointer items-center gap-2">
|
|
99
99
|
<div
|
|
100
|
-
class="
|
|
100
|
+
class="hidden flex-col justify-end text-right lg:flex"
|
|
101
101
|
>
|
|
102
102
|
<p class="font-bold">
|
|
103
103
|
{{ auth.me.value?.display_name || auth.me.value?.full_name }}
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
</DropdownMenu>
|
|
120
120
|
</div>
|
|
121
121
|
</nav>
|
|
122
|
-
<div class="w-full bg-gray-50 pt-[72px]">
|
|
122
|
+
<div class="w-full bg-gray-50 pt-[64px] lg:pt-[72px]">
|
|
123
123
|
<main
|
|
124
124
|
class="
|
|
125
125
|
mx-auto min-h-full w-full flex-1 px-6 py-10 lg:px-8
|