@goplusvn/core 0.1.41 → 0.1.43
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 +1 -1
- package/src/rbac/pages/index.ts +9 -0
- package/src/rbac/pages/permission-catalog-pages.tsx +1217 -0
- package/src/rbac/pages/role-form-page.tsx +191 -1
- package/src/rbac/pages/role-list-page.tsx +145 -0
- package/src/user/components/effective-permissions-dialog.tsx +235 -0
- package/src/user/components/users-card-view.tsx +20 -2
- package/src/user/pages/users-client-page.tsx +25 -1
|
@@ -21,6 +21,10 @@ import { UserToolbar } from "../components/user-toolbar";
|
|
|
21
21
|
import { UserStats } from "../components/user-stats";
|
|
22
22
|
import { UsersCardView } from "../components/users-card-view";
|
|
23
23
|
import { UnifiedProfileDialog } from "../components/unified-profile-dialog";
|
|
24
|
+
import {
|
|
25
|
+
EffectivePermissionsDialog,
|
|
26
|
+
type EffectiveMenuTreeSection,
|
|
27
|
+
} from "../components/effective-permissions-dialog";
|
|
24
28
|
|
|
25
29
|
interface UserStats {
|
|
26
30
|
totalUsers: number;
|
|
@@ -39,6 +43,9 @@ interface UsersClientPageProps {
|
|
|
39
43
|
stats: UserStats;
|
|
40
44
|
onAssignRoles?: (userId: string, roleCodes: string[]) => Promise<any>;
|
|
41
45
|
onResetPassword?: (userId: string, password: string) => Promise<any>;
|
|
46
|
+
/** Cây menu + meta action cho dialog "Quyền hiệu lực" (additive). */
|
|
47
|
+
menuTree?: EffectiveMenuTreeSection[];
|
|
48
|
+
actionMeta?: Record<string, { label?: string; flow?: string; description?: string }>;
|
|
42
49
|
}
|
|
43
50
|
|
|
44
51
|
export function UsersClientPage({
|
|
@@ -50,7 +57,10 @@ export function UsersClientPage({
|
|
|
50
57
|
stats,
|
|
51
58
|
onAssignRoles,
|
|
52
59
|
onResetPassword,
|
|
60
|
+
menuTree,
|
|
61
|
+
actionMeta,
|
|
53
62
|
}: UsersClientPageProps) {
|
|
63
|
+
const [permUser, setPermUser] = useState<any | null>(null);
|
|
54
64
|
const router = useRouter();
|
|
55
65
|
const pathname = usePathname();
|
|
56
66
|
|
|
@@ -207,10 +217,24 @@ export function UsersClientPage({
|
|
|
207
217
|
/>
|
|
208
218
|
</div>
|
|
209
219
|
) : (
|
|
210
|
-
<UsersCardView
|
|
220
|
+
<UsersCardView
|
|
221
|
+
data={initialData}
|
|
222
|
+
onSelect={handleSelectUser}
|
|
223
|
+
onViewPermissions={menuTree ? setPermUser : undefined}
|
|
224
|
+
/>
|
|
211
225
|
)}
|
|
212
226
|
</div>
|
|
213
227
|
|
|
228
|
+
{menuTree && (
|
|
229
|
+
<EffectivePermissionsDialog
|
|
230
|
+
open={!!permUser}
|
|
231
|
+
onOpenChange={(o) => !o && setPermUser(null)}
|
|
232
|
+
user={permUser}
|
|
233
|
+
menuTree={menuTree}
|
|
234
|
+
actionMeta={actionMeta}
|
|
235
|
+
/>
|
|
236
|
+
)}
|
|
237
|
+
|
|
214
238
|
{/* Create User Dialog */}
|
|
215
239
|
<UnifiedProfileDialog
|
|
216
240
|
open={userFormOpen}
|