@goplusvn/core 0.1.46 → 0.1.48
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/package.json +2 -1
- package/src/auth/__tests__/api-handler.test.ts +141 -0
- package/src/auth/api-handler.ts +141 -0
- package/src/rbac/pages/action-list-page.tsx +181 -256
- package/src/rbac/pages/index.ts +5 -0
- package/src/rbac/pages/lib/action-api.ts +38 -0
- package/src/rbac/pages/lib/group-taxonomy.ts +110 -0
- package/src/rbac/pages/lib/rbac-page-shell.tsx +148 -0
- package/src/rbac/pages/resource-list-page.tsx +350 -499
- package/src/schemas/branch.schema.ts +35 -0
- package/src/schemas/user.schema.ts +2 -0
- package/src/schemas/warehouse.schema.ts +2 -0
- package/src/user/components/unified-profile-dialog.tsx +81 -81
- package/src/user/components/users-card-view.tsx +12 -12
|
@@ -27,10 +27,10 @@ interface UsersCardViewProps {
|
|
|
27
27
|
// Professional Corporate Palette
|
|
28
28
|
const AVATAR_PALETTE = [
|
|
29
29
|
{ bg: "bg-primary", text: "text-primary-foreground" }, // Primary
|
|
30
|
-
{ bg: "bg-
|
|
31
|
-
{ bg: "bg-
|
|
32
|
-
{ bg: "bg-
|
|
33
|
-
{ bg: "bg-
|
|
30
|
+
{ bg: "bg-emerald-600", text: "text-white" }, // Emerald
|
|
31
|
+
{ bg: "bg-orange-600", text: "text-white" }, // Orange
|
|
32
|
+
{ bg: "bg-violet-600", text: "text-white" }, // Violet
|
|
33
|
+
{ bg: "bg-cyan-600", text: "text-white" }, // Cyan
|
|
34
34
|
];
|
|
35
35
|
|
|
36
36
|
const ROLE_PALETTE = [
|
|
@@ -62,7 +62,7 @@ export function UsersCardView({
|
|
|
62
62
|
}: UsersCardViewProps) {
|
|
63
63
|
if (!data.length) {
|
|
64
64
|
return (
|
|
65
|
-
<div className="flex flex-col items-center justify-center min-h-[400px] border border-
|
|
65
|
+
<div className="flex flex-col items-center justify-center min-h-[400px] border border-border rounded-xl bg-card p-8 text-center">
|
|
66
66
|
<div className="size-16 rounded-full bg-primary/5 flex items-center justify-center mb-4">
|
|
67
67
|
<User className="size-8 text-primary" strokeWidth={1.5} />
|
|
68
68
|
</div>
|
|
@@ -96,11 +96,11 @@ export function UsersCardView({
|
|
|
96
96
|
return (
|
|
97
97
|
<Card
|
|
98
98
|
key={user.id}
|
|
99
|
-
className="group relative transition-all duration-200 border border-
|
|
99
|
+
className="group relative transition-all duration-200 border border-border bg-card cursor-pointer h-full flex flex-col rounded-xl overflow-hidden shadow-sm hover:shadow-md hover:border-primary/30"
|
|
100
100
|
onClick={() => onSelect && onSelect(user)}
|
|
101
101
|
>
|
|
102
102
|
{/* Header */}
|
|
103
|
-
<div className="p-3 pb-2 flex gap-2.5 items-start bg-
|
|
103
|
+
<div className="p-3 pb-2 flex gap-2.5 items-start bg-muted border-b border-border">
|
|
104
104
|
<div className="relative shrink-0 mt-0.5">
|
|
105
105
|
<div
|
|
106
106
|
className={cn(
|
|
@@ -121,8 +121,8 @@ export function UsersCardView({
|
|
|
121
121
|
{/* Status Dot */}
|
|
122
122
|
<div
|
|
123
123
|
className={cn(
|
|
124
|
-
"absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 border-2 border-
|
|
125
|
-
isActive ? "bg-
|
|
124
|
+
"absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 border-2 border-card rounded-full z-10",
|
|
125
|
+
isActive ? "bg-success-semantic" : "bg-text-tertiary"
|
|
126
126
|
)}
|
|
127
127
|
title={isActive ? "Hoạt động" : "Đã khóa"}
|
|
128
128
|
/>
|
|
@@ -173,7 +173,7 @@ export function UsersCardView({
|
|
|
173
173
|
<MoreHorizontal className="size-4" />
|
|
174
174
|
</Button>
|
|
175
175
|
</DropdownMenuTrigger>
|
|
176
|
-
<DropdownMenuContent align="end" className="w-[140px] rounded-xl border-
|
|
176
|
+
<DropdownMenuContent align="end" className="w-[140px] rounded-xl border-border p-1.5">
|
|
177
177
|
<DropdownMenuItem
|
|
178
178
|
onSelect={(e) => {
|
|
179
179
|
e.preventDefault();
|
|
@@ -215,7 +215,7 @@ export function UsersCardView({
|
|
|
215
215
|
</div>
|
|
216
216
|
|
|
217
217
|
{/* Body */}
|
|
218
|
-
<div className="p-3 pt-0 flex-1 flex flex-col bg-
|
|
218
|
+
<div className="p-3 pt-0 flex-1 flex flex-col bg-card">
|
|
219
219
|
|
|
220
220
|
{/* 2-Column Compact Grid */}
|
|
221
221
|
<div className="grid grid-cols-2 gap-x-2 gap-y-1.5 mb-2 mt-2">
|
|
@@ -250,7 +250,7 @@ export function UsersCardView({
|
|
|
250
250
|
|
|
251
251
|
{/* Roles - Compact Format */}
|
|
252
252
|
{user.roleNames && user.roleNames.length > 0 && (
|
|
253
|
-
<div className="mt-auto pt-2.5 border-t border-
|
|
253
|
+
<div className="mt-auto pt-2.5 border-t border-border flex flex-wrap gap-1">
|
|
254
254
|
{user.roleNames.map((role: string, i: number) => {
|
|
255
255
|
const style = getRoleStyle(role);
|
|
256
256
|
return (
|