fix(manage): 产品组概览项目 tag 补 × 移除入口,与 detail 视图自洽
All checks were successful
Push & PR Check / check (push) Successful in 49s
All checks were successful
Push & PR Check / check (push) Successful in 49s
This commit is contained in:
parent
aeacb9dcf9
commit
16556e1dcc
@ -463,10 +463,10 @@ function GroupsTab({ spaceId }: { spaceId?: string }) {
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody className="divide-y divide-gray-100">
|
<tbody className="divide-y divide-gray-100">
|
||||||
{groups.map((g) => {
|
{groups.map((g) => {
|
||||||
const groupProjectNames = maps
|
const groupProjectEntries = maps
|
||||||
.filter((m) => m.group_id === g.id)
|
.filter((m) => m.group_id === g.id)
|
||||||
.map((m) => projects.find((p) => p.id === m.project_id)?.name)
|
.map((m) => { const p = projects.find((x) => x.id === m.project_id); return p ? { id: p.id, name: p.name } : null; })
|
||||||
.filter((n): n is string => !!n);
|
.filter((e): e is { id: string; name: string } => e !== null);
|
||||||
return (
|
return (
|
||||||
<tr key={g.id} className="bg-white hover:bg-gray-50/60 transition-colors group">
|
<tr key={g.id} className="bg-white hover:bg-gray-50/60 transition-colors group">
|
||||||
<td className="px-5 py-4">
|
<td className="px-5 py-4">
|
||||||
@ -475,9 +475,13 @@ function GroupsTab({ spaceId }: { spaceId?: string }) {
|
|||||||
</td>
|
</td>
|
||||||
<td className="px-5 py-4 max-w-[320px]">
|
<td className="px-5 py-4 max-w-[320px]">
|
||||||
<div className="flex flex-wrap gap-1">
|
<div className="flex flex-wrap gap-1">
|
||||||
{groupProjectNames.length > 0 ? groupProjectNames.map((name) => (
|
{groupProjectEntries.length > 0 ? groupProjectEntries.map(({ id, name }) => (
|
||||||
<span key={name} className="px-2 py-0.5 rounded-md bg-blue-50 text-blue-700 text-xs font-medium border border-blue-100">
|
<span key={id} className="inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-blue-50 text-blue-700 text-xs font-medium border border-blue-100">
|
||||||
{name}
|
{name}
|
||||||
|
<button
|
||||||
|
onClick={async () => { await removeGroupMember(id, g.id); qc.invalidateQueries({ queryKey: ["maps"] }); }}
|
||||||
|
className="text-blue-400 hover:text-red-400 transition-colors leading-none"
|
||||||
|
>×</button>
|
||||||
</span>
|
</span>
|
||||||
)) : (
|
)) : (
|
||||||
<span className="text-xs text-gray-300">—</span>
|
<span className="text-xs text-gray-300">—</span>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user