@burdenoff/microfe-planmagnet 2026.928.11 → 2026.930.1

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.
@@ -5,10 +5,10 @@ import { UserPlus as a } from "lucide-react";
5
5
  import { gql as o } from "@apollo/client";
6
6
  import { useQuery as s } from "@apollo/client/react";
7
7
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
- import { Button as u, Card as d, CardContent as f } from "@burdenoff/fe-libs/ui";
9
- import { useWorkspaceDirectory as p } from "@burdenoff/fe-libs/sharing";
8
+ import { Badge as u, Button as d, Card as f, CardContent as p } from "@burdenoff/fe-libs/ui";
9
+ import { useWorkspaceDirectory as m } from "@burdenoff/fe-libs/sharing";
10
10
  //#region src/planmagnet/pages/TeamTeamPagePage.tsx
11
- var m = o`
11
+ var h = o`
12
12
  query TeamMemberCounts($workspaceId: ID!, $userId: String!) {
13
13
  planmagnetWorkItemCounts(workspaceId: $workspaceId, filter: { assigneeId: $userId }) {
14
14
  total
@@ -26,48 +26,82 @@ var m = o`
26
26
  totalCount
27
27
  }
28
28
  }
29
+ `, g = o`
30
+ query TeamMemberRoles($actorId: String!, $scopeId: String!) {
31
+ actorRoleAssignments(actorId: $actorId, scopeId: $scopeId, pagination: { limit: 10 }) {
32
+ id
33
+ isActive
34
+ role {
35
+ id
36
+ name
37
+ }
38
+ }
39
+ }
29
40
  `;
30
- function h({ userId: t }) {
31
- let { workspaceId: a } = e(), { data: o, error: u } = s(m, {
41
+ function _({ userId: t }) {
42
+ let { workspaceId: n } = e(), { data: r, error: i } = s(g, {
43
+ variables: {
44
+ actorId: t,
45
+ scopeId: n
46
+ },
47
+ skip: !n
48
+ });
49
+ if (i) return null;
50
+ let a = [...new Set((r?.actorRoleAssignments ?? []).filter((e) => e.isActive && e.role?.name).map((e) => e.role?.name))];
51
+ return a.length === 0 ? null : /* @__PURE__ */ c("div", {
52
+ className: "flex flex-wrap gap-1",
53
+ "data-testid": "team-member-roles",
54
+ children: a.map((e) => /* @__PURE__ */ c(u, {
55
+ variant: "secondary",
56
+ className: "text-xs",
57
+ children: e
58
+ }, e))
59
+ });
60
+ }
61
+ function v({ userId: t }) {
62
+ let { workspaceId: a } = e(), { data: o, error: u } = s(h, {
32
63
  variables: {
33
64
  workspaceId: a,
34
65
  userId: t
35
66
  },
36
67
  skip: !a
37
- }), p = u ? void 0 : o?.planmagnetWorkItemCounts, h = p?.byStatus.find((e) => e.status === "DONE");
38
- return /* @__PURE__ */ c(d, {
68
+ }), d = u ? void 0 : o?.planmagnetWorkItemCounts, m = d?.byStatus.find((e) => e.status === "DONE");
69
+ return /* @__PURE__ */ c(f, {
39
70
  "data-testid": "team-member",
40
- children: /* @__PURE__ */ l(f, {
71
+ children: /* @__PURE__ */ l(p, {
41
72
  className: "pt-4 space-y-3",
42
73
  children: [/* @__PURE__ */ l("div", {
43
74
  className: "flex items-center gap-3",
44
75
  children: [/* @__PURE__ */ c(n, {
45
76
  id: t,
46
77
  className: "h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center text-sm font-medium text-primary"
47
- }), /* @__PURE__ */ c("p", {
48
- className: "text-sm font-medium",
49
- children: /* @__PURE__ */ c(r, { id: t })
78
+ }), /* @__PURE__ */ l("div", {
79
+ className: "min-w-0 space-y-1",
80
+ children: [/* @__PURE__ */ c("p", {
81
+ className: "text-sm font-medium",
82
+ children: /* @__PURE__ */ c(r, { id: t })
83
+ }), /* @__PURE__ */ c(_, { userId: t })]
50
84
  })]
51
85
  }), /* @__PURE__ */ l("div", {
52
86
  className: "grid grid-cols-4 gap-2 text-center text-xs",
53
87
  children: [
54
88
  /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("p", {
55
89
  className: "font-semibold",
56
- children: i(p?.total)
90
+ children: i(d?.total)
57
91
  }), /* @__PURE__ */ c("p", {
58
92
  className: "text-muted-foreground",
59
93
  children: "Assigned"
60
94
  })] }),
61
95
  /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("p", {
62
96
  className: "font-semibold",
63
- children: i(p ? h?.count ?? 0 : null)
97
+ children: i(d ? m?.count ?? 0 : null)
64
98
  }), /* @__PURE__ */ c("p", {
65
99
  className: "text-muted-foreground",
66
100
  children: "Done"
67
101
  })] }),
68
102
  /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("p", {
69
103
  className: "font-semibold",
70
- children: i(p ? h?.points ?? 0 : null)
104
+ children: i(d ? m?.points ?? 0 : null)
71
105
  }), /* @__PURE__ */ c("p", {
72
106
  className: "text-muted-foreground",
73
107
  children: "Points done"
@@ -84,8 +118,8 @@ function h({ userId: t }) {
84
118
  })
85
119
  });
86
120
  }
87
- function g() {
88
- let { workspaceId: n, authToken: r, apiGatewayUrl: i } = e(), o = t(), { members: s, loading: d, hasMore: f, fetchMore: m } = p({
121
+ function y() {
122
+ let { workspaceId: n, authToken: r, apiGatewayUrl: i } = e(), o = t(), { members: s, loading: u, hasMore: f, fetchMore: p } = m({
89
123
  workspaceId: n ?? "",
90
124
  authToken: r ?? void 0,
91
125
  apiGatewayUrl: i ?? void 0
@@ -100,8 +134,8 @@ function g() {
100
134
  children: "Team Overview"
101
135
  }), /* @__PURE__ */ c("p", {
102
136
  className: "text-sm text-muted-foreground",
103
- children: d && s.length === 0 ? "Loading members…" : `${s.length}${f ? "+" : ""} workspace member${s.length === 1 ? "" : "s"}`
104
- })] }), /* @__PURE__ */ l(u, {
137
+ children: u && s.length === 0 ? "Loading members…" : `${s.length}${f ? "+" : ""} workspace member${s.length === 1 ? "" : "s"}`
138
+ })] }), /* @__PURE__ */ l(d, {
105
139
  size: "sm",
106
140
  variant: "outline",
107
141
  onClick: () => o("/team/invite-member-page"),
@@ -111,18 +145,18 @@ function g() {
111
145
  }),
112
146
  /* @__PURE__ */ c("div", {
113
147
  className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
114
- children: s.map((e) => /* @__PURE__ */ c(h, { userId: e.id }, e.id))
148
+ children: s.map((e) => /* @__PURE__ */ c(v, { userId: e.id }, e.id))
115
149
  }),
116
- !d && s.length === 0 && /* @__PURE__ */ c("p", {
150
+ !u && s.length === 0 && /* @__PURE__ */ c("p", {
117
151
  className: "text-sm text-muted-foreground text-center py-4",
118
152
  children: "No members found. Invite someone to the workspace to work together."
119
153
  }),
120
154
  f && /* @__PURE__ */ c("div", {
121
155
  className: "text-center",
122
- children: /* @__PURE__ */ c(u, {
156
+ children: /* @__PURE__ */ c(d, {
123
157
  size: "sm",
124
158
  variant: "outline",
125
- onClick: m,
159
+ onClick: p,
126
160
  children: "Show more members"
127
161
  })
128
162
  })
@@ -130,6 +164,6 @@ function g() {
130
164
  });
131
165
  }
132
166
  //#endregion
133
- export { g as TeamTeamPagePage };
167
+ export { y as TeamTeamPagePage };
134
168
 
135
169
  //# sourceMappingURL=TeamTeamPagePage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TeamTeamPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/TeamTeamPagePage.tsx"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { useWorkspaceDirectory } from '@burdenoff/fe-libs/sharing';\nimport { Card, CardContent, Button } from '@burdenoff/fe-libs/ui';\nimport { UserPlus } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { PersonAvatar, PersonName } from '../people/People';\nimport { countLabel } from '../hooks/useCounts';\n\n/**\n * Team overview (BOFF-7972). Members are the workspace's real members (the workspace directory), and each member's\n * numbers are server counts over ALL of their work. The page used to build members from the newest 100 work items\n * and 100 projects (so anyone whose work was older undercounted or vanished), invent \"teams\" by grouping projects\n * by methodology, and make up an \"Engineering\" department and online/offline presence.\n */\n\nconst MEMBER_COUNTS = gql`\n query TeamMemberCounts($workspaceId: ID!, $userId: String!) {\n planmagnetWorkItemCounts(workspaceId: $workspaceId, filter: { assigneeId: $userId }) {\n total\n byStatus {\n status\n count\n points\n }\n }\n planmagnetProjects(\n workspaceId: $workspaceId\n filter: { ownerId: $userId }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n }\n`;\n\nfunction MemberCard({ userId }: { userId: string }) {\n const { workspaceId } = usePlanMagnet();\n const { data, error } = useQuery<{\n planmagnetWorkItemCounts: {\n total: number;\n byStatus: { status: string; count: number; points: number }[];\n };\n planmagnetProjects: { totalCount: number };\n }>(MEMBER_COUNTS, { variables: { workspaceId, userId }, skip: !workspaceId });\n const counts = error ? undefined : data?.planmagnetWorkItemCounts;\n const done = counts?.byStatus.find((s) => s.status === 'DONE');\n return (\n <Card data-testid=\"team-member\">\n <CardContent className=\"pt-4 space-y-3\">\n <div className=\"flex items-center gap-3\">\n <PersonAvatar\n id={userId}\n className=\"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center text-sm font-medium text-primary\"\n />\n <p className=\"text-sm font-medium\">\n <PersonName id={userId} />\n </p>\n </div>\n <div className=\"grid grid-cols-4 gap-2 text-center text-xs\">\n <div>\n <p className=\"font-semibold\">{countLabel(counts?.total)}</p>\n <p className=\"text-muted-foreground\">Assigned</p>\n </div>\n <div>\n <p className=\"font-semibold\">{countLabel(counts ? (done?.count ?? 0) : null)}</p>\n <p className=\"text-muted-foreground\">Done</p>\n </div>\n <div>\n <p className=\"font-semibold\">{countLabel(counts ? (done?.points ?? 0) : null)}</p>\n {/* All-time DONE points of this person's items: not a sprint velocity (BOFF-7944). */}\n <p className=\"text-muted-foreground\">Points done</p>\n </div>\n <div>\n <p className=\"font-semibold\">\n {countLabel(error ? null : data?.planmagnetProjects.totalCount)}\n </p>\n <p className=\"text-muted-foreground\">Projects owned</p>\n </div>\n </div>\n </CardContent>\n </Card>\n );\n}\n\nexport function TeamTeamPagePage() {\n const { workspaceId, authToken, apiGatewayUrl } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n const { members, loading, hasMore, fetchMore } = useWorkspaceDirectory({\n workspaceId: workspaceId ?? '',\n authToken: authToken ?? undefined,\n apiGatewayUrl: apiGatewayUrl ?? undefined,\n });\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-start justify-between gap-4\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Team Overview</h1>\n <p className=\"text-sm text-muted-foreground\">\n {loading && members.length === 0\n ? 'Loading members…'\n : `${members.length}${hasMore ? '+' : ''} workspace member${members.length === 1 ? '' : 's'}`}\n </p>\n </div>\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() => navigate('/team/invite-member-page')}\n data-testid=\"team-invite\"\n >\n <UserPlus className=\"mr-1 h-4 w-4\" />\n Invite member\n </Button>\n </div>\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n {members.map((member) => (\n <MemberCard key={member.id} userId={member.id} />\n ))}\n </div>\n {!loading && members.length === 0 && (\n <p className=\"text-sm text-muted-foreground text-center py-4\">\n No members found. Invite someone to the workspace to work together.\n </p>\n )}\n {hasMore && (\n <div className=\"text-center\">\n <Button size=\"sm\" variant=\"outline\" onClick={fetchMore}>\n Show more members\n </Button>\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAgBA,IAAM,IAAgB,CAAG;;;;;;;;;;;;;;;;;;;AAoBzB,SAAS,EAAW,EAAE,aAA8B;CAClD,IAAM,EAAE,mBAAgB,GAAe,EACjC,EAAE,SAAM,aAAU,EAMrB,GAAe;EAAE,WAAW;GAAE;GAAa;GAAQ;EAAE,MAAM,CAAC;EAAa,CAAC,EACvE,IAAS,IAAQ,KAAA,IAAY,GAAM,0BACnC,IAAO,GAAQ,SAAS,MAAM,MAAM,EAAE,WAAW,OAAO;AAC9D,QACE,kBAAC,GAAD;EAAM,eAAY;YAChB,kBAAC,GAAD;GAAa,WAAU;aAAvB,CACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD;KACE,IAAI;KACJ,WAAU;KACV,CAAA,EACF,kBAAC,KAAD;KAAG,WAAU;eACX,kBAAC,GAAD,EAAY,IAAI,GAAU,CAAA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,WAAW,IAC3B,qBACA,GAAG,EAAQ,SAAS,IAAU,MAAM,GAAG,mBAAmB,EAAQ,WAAW,IAAI,KAAK;KACxF,CAAA,CACA,EAAA,CAAA,EACN,kBAAC,GAAD;KACE,MAAK;KACL,SAAQ;KACR,eAAe,EAAS,2BAA2B;KACnD,eAAY;eAJd,CAME,kBAAC,GAAD,EAAU,WAAU,gBAAiB,CAAA,EAAA,gBAE9B;OACL;;GAEN,kBAAC,OAAD;IAAK,WAAU;cACZ,EAAQ,KAAK,MACZ,kBAAC,GAAD,EAA4B,QAAQ,EAAO,IAAM,EAAhC,EAAO,GAAyB,CACjD;IACE,CAAA;GACL,CAAC,KAAW,EAAQ,WAAW,KAC9B,kBAAC,KAAD;IAAG,WAAU;cAAiD;IAE1D,CAAA;GAEL,KACC,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD;KAAQ,MAAK;KAAK,SAAQ;KAAU,SAAS;eAAW;KAE/C,CAAA;IACL,CAAA;GAEJ"}
1
+ {"version":3,"file":"TeamTeamPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/TeamTeamPagePage.tsx"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { useWorkspaceDirectory } from '@burdenoff/fe-libs/sharing';\nimport { Badge, Card, CardContent, Button } from '@burdenoff/fe-libs/ui';\nimport { UserPlus } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { PersonAvatar, PersonName } from '../people/People';\nimport { countLabel } from '../hooks/useCounts';\n\n/**\n * Team overview (BOFF-7972). Members are the workspace's real members (the workspace directory), and each member's\n * numbers are server counts over ALL of their work. The page used to build members from the newest 100 work items\n * and 100 projects (so anyone whose work was older undercounted or vanished), invent \"teams\" by grouping projects\n * by methodology, and make up an \"Engineering\" department and online/offline presence.\n */\n\nconst MEMBER_COUNTS = gql`\n query TeamMemberCounts($workspaceId: ID!, $userId: String!) {\n planmagnetWorkItemCounts(workspaceId: $workspaceId, filter: { assigneeId: $userId }) {\n total\n byStatus {\n status\n count\n points\n }\n }\n planmagnetProjects(\n workspaceId: $workspaceId\n filter: { ownerId: $userId }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n }\n`;\n\n/**\n * The member's roles in this workspace (CWF-37: the roster shows each person's role). Needs rbac:read, which not every\n * viewer has: a refusal just hides the chips instead of breaking the card.\n */\nconst MEMBER_ROLES = gql`\n query TeamMemberRoles($actorId: String!, $scopeId: String!) {\n actorRoleAssignments(actorId: $actorId, scopeId: $scopeId, pagination: { limit: 10 }) {\n id\n isActive\n role {\n id\n name\n }\n }\n }\n`;\n\nfunction MemberRoles({ userId }: { userId: string }) {\n const { workspaceId } = usePlanMagnet();\n const { data, error } = useQuery<{\n actorRoleAssignments: {\n id: string;\n isActive: boolean;\n role: { id: string; name: string } | null;\n }[];\n }>(MEMBER_ROLES, {\n variables: { actorId: userId, scopeId: workspaceId },\n skip: !workspaceId,\n });\n if (error) return null;\n const names = [\n ...new Set(\n (data?.actorRoleAssignments ?? [])\n .filter((a) => a.isActive && a.role?.name)\n .map((a) => a.role?.name as string)\n ),\n ];\n if (names.length === 0) return null;\n return (\n <div className=\"flex flex-wrap gap-1\" data-testid=\"team-member-roles\">\n {names.map((name) => (\n <Badge key={name} variant=\"secondary\" className=\"text-xs\">\n {name}\n </Badge>\n ))}\n </div>\n );\n}\n\nfunction MemberCard({ userId }: { userId: string }) {\n const { workspaceId } = usePlanMagnet();\n const { data, error } = useQuery<{\n planmagnetWorkItemCounts: {\n total: number;\n byStatus: { status: string; count: number; points: number }[];\n };\n planmagnetProjects: { totalCount: number };\n }>(MEMBER_COUNTS, { variables: { workspaceId, userId }, skip: !workspaceId });\n const counts = error ? undefined : data?.planmagnetWorkItemCounts;\n const done = counts?.byStatus.find((s) => s.status === 'DONE');\n return (\n <Card data-testid=\"team-member\">\n <CardContent className=\"pt-4 space-y-3\">\n <div className=\"flex items-center gap-3\">\n <PersonAvatar\n id={userId}\n className=\"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center text-sm font-medium text-primary\"\n />\n <div className=\"min-w-0 space-y-1\">\n <p className=\"text-sm font-medium\">\n <PersonName id={userId} />\n </p>\n <MemberRoles userId={userId} />\n </div>\n </div>\n <div className=\"grid grid-cols-4 gap-2 text-center text-xs\">\n <div>\n <p className=\"font-semibold\">{countLabel(counts?.total)}</p>\n <p className=\"text-muted-foreground\">Assigned</p>\n </div>\n <div>\n <p className=\"font-semibold\">{countLabel(counts ? (done?.count ?? 0) : null)}</p>\n <p className=\"text-muted-foreground\">Done</p>\n </div>\n <div>\n <p className=\"font-semibold\">{countLabel(counts ? (done?.points ?? 0) : null)}</p>\n {/* All-time DONE points of this person's items: not a sprint velocity (BOFF-7944). */}\n <p className=\"text-muted-foreground\">Points done</p>\n </div>\n <div>\n <p className=\"font-semibold\">\n {countLabel(error ? null : data?.planmagnetProjects.totalCount)}\n </p>\n <p className=\"text-muted-foreground\">Projects owned</p>\n </div>\n </div>\n </CardContent>\n </Card>\n );\n}\n\nexport function TeamTeamPagePage() {\n const { workspaceId, authToken, apiGatewayUrl } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n const { members, loading, hasMore, fetchMore } = useWorkspaceDirectory({\n workspaceId: workspaceId ?? '',\n authToken: authToken ?? undefined,\n apiGatewayUrl: apiGatewayUrl ?? undefined,\n });\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-start justify-between gap-4\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Team Overview</h1>\n <p className=\"text-sm text-muted-foreground\">\n {loading && members.length === 0\n ? 'Loading members…'\n : `${members.length}${hasMore ? '+' : ''} workspace member${members.length === 1 ? '' : 's'}`}\n </p>\n </div>\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() => navigate('/team/invite-member-page')}\n data-testid=\"team-invite\"\n >\n <UserPlus className=\"mr-1 h-4 w-4\" />\n Invite member\n </Button>\n </div>\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n {members.map((member) => (\n <MemberCard key={member.id} userId={member.id} />\n ))}\n </div>\n {!loading && members.length === 0 && (\n <p className=\"text-sm text-muted-foreground text-center py-4\">\n No members found. Invite someone to the workspace to work together.\n </p>\n )}\n {hasMore && (\n <div className=\"text-center\">\n <Button size=\"sm\" variant=\"outline\" onClick={fetchMore}>\n Show more members\n </Button>\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAgBA,IAAM,IAAgB,CAAG;;;;;;;;;;;;;;;;;;GAwBnB,IAAe,CAAG;;;;;;;;;;;;AAaxB,SAAS,EAAY,EAAE,aAA8B;CACnD,IAAM,EAAE,mBAAgB,GAAe,EACjC,EAAE,SAAM,aAAU,EAMrB,GAAc;EACf,WAAW;GAAE,SAAS;GAAQ,SAAS;GAAa;EACpD,MAAM,CAAC;EACR,CAAC;AACF,KAAI,EAAO,QAAO;CAClB,IAAM,IAAQ,CACZ,GAAG,IAAI,KACJ,GAAM,wBAAwB,EAAE,EAC9B,QAAQ,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,CACzC,KAAK,MAAM,EAAE,MAAM,KAAe,CACtC,CACF;AAED,QADI,EAAM,WAAW,IAAU,OAE7B,kBAAC,OAAD;EAAK,WAAU;EAAuB,eAAY;YAC/C,EAAM,KAAK,MACV,kBAAC,GAAD;GAAkB,SAAQ;GAAY,WAAU;aAC7C;GACK,EAFI,EAEJ,CACR;EACE,CAAA;;AAIV,SAAS,EAAW,EAAE,aAA8B;CAClD,IAAM,EAAE,mBAAgB,GAAe,EACjC,EAAE,SAAM,aAAU,EAMrB,GAAe;EAAE,WAAW;GAAE;GAAa;GAAQ;EAAE,MAAM,CAAC;EAAa,CAAC,EACvE,IAAS,IAAQ,KAAA,IAAY,GAAM,0BACnC,IAAO,GAAQ,SAAS,MAAM,MAAM,EAAE,WAAW,OAAO;AAC9D,QACE,kBAAC,GAAD;EAAM,eAAY;YAChB,kBAAC,GAAD;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A8F;IAC9F,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,2CAqPA"}
@@ -37,13 +37,149 @@ var N = [
37
37
  }
38
38
  }
39
39
  `, F = p`
40
- mutation SprintControlsComplete($id: ID!) {
41
- planmagnetCompleteSprint(id: $id) {
40
+ mutation SprintControlsComplete($id: ID!, $input: PlanmagnetCompleteSprintInput) {
41
+ planmagnetCompleteSprint(id: $id, input: $input) {
42
42
  id
43
43
  status
44
44
  }
45
45
  }
46
46
  `, I = p`
47
+ query SprintControlsCompleteScope($id: ID!) {
48
+ planmagnetSprint(id: $id) {
49
+ id
50
+ projectId
51
+ teamId
52
+ }
53
+ }
54
+ `, L = p`
55
+ query SprintControlsCompleteTargets($workspaceId: ID!, $projectId: String, $teamId: String) {
56
+ planmagnetSprints(
57
+ workspaceId: $workspaceId
58
+ filter: { projectId: $projectId, teamId: $teamId }
59
+ pagination: { first: 100 }
60
+ ) {
61
+ items {
62
+ id
63
+ name
64
+ status
65
+ }
66
+ }
67
+ }
68
+ `;
69
+ function R({ sprintId: t, sprintName: n, disabled: r, error: i, onComplete: a }) {
70
+ let { workspaceId: o } = e(), [l, u] = s(!1), [d, f] = s("MOVE_TO_BACKLOG"), [p, m] = s(""), h = g(I, {
71
+ variables: { id: t },
72
+ skip: !l
73
+ }).data?.planmagnetSprint, y = g(L, {
74
+ variables: {
75
+ workspaceId: o,
76
+ projectId: h?.teamId ? null : h?.projectId ?? null,
77
+ teamId: h?.teamId ?? null
78
+ },
79
+ skip: !l || !h || !o
80
+ }), x = (y.data?.planmagnetSprints.items ?? []).filter((e) => e.id !== t && e.status !== "COMPLETED" && e.status !== "CANCELLED"), S = d !== "MOVE_TO_SPRINT" || p !== "", A = async () => {
81
+ await a(d === "MOVE_TO_SPRINT" ? {
82
+ openItems: d,
83
+ targetSprintId: p
84
+ } : { openItems: d }) && u(!1);
85
+ };
86
+ return /* @__PURE__ */ v(C, {
87
+ open: l,
88
+ onOpenChange: u,
89
+ children: [/* @__PURE__ */ _(k, {
90
+ asChild: !0,
91
+ children: /* @__PURE__ */ v(b, {
92
+ size: "sm",
93
+ disabled: r,
94
+ "data-testid": "sprint-complete-open",
95
+ children: [/* @__PURE__ */ _(c, { className: "mr-1 h-4 w-4" }), "Complete sprint"]
96
+ })
97
+ }), /* @__PURE__ */ v(w, {
98
+ className: "max-w-lg",
99
+ children: [
100
+ /* @__PURE__ */ v(D, { children: [/* @__PURE__ */ v(O, { children: [
101
+ "Complete ",
102
+ n,
103
+ "?"
104
+ ] }), /* @__PURE__ */ _(T, { children: "The sprint is closed and cannot be reopened. Choose what happens to work items that are not done or cancelled." })] }),
105
+ /* @__PURE__ */ v("fieldset", {
106
+ className: "space-y-2",
107
+ "data-testid": "sprint-complete-choice",
108
+ children: [
109
+ /* @__PURE__ */ _("legend", {
110
+ className: "sr-only",
111
+ children: "Unfinished work items"
112
+ }),
113
+ [
114
+ ["MOVE_TO_BACKLOG", "Return them to the backlog"],
115
+ ["MOVE_TO_SPRINT", "Carry them into another sprint"],
116
+ ["KEEP_IN_SPRINT", "Keep them in this sprint's record"]
117
+ ].map(([e, t]) => /* @__PURE__ */ v("label", {
118
+ className: "flex items-center gap-2 text-sm cursor-pointer",
119
+ children: [/* @__PURE__ */ _("input", {
120
+ type: "radio",
121
+ name: "sprint-open-items",
122
+ value: e,
123
+ checked: d === e,
124
+ onChange: () => f(e)
125
+ }), t]
126
+ }, e)),
127
+ d === "MOVE_TO_SPRINT" && /* @__PURE__ */ v("div", {
128
+ className: "pl-6",
129
+ children: [
130
+ /* @__PURE__ */ _("label", {
131
+ htmlFor: "sprint-complete-target",
132
+ className: "text-xs text-muted-foreground",
133
+ children: "Sprint to carry them into"
134
+ }),
135
+ /* @__PURE__ */ v("select", {
136
+ id: "sprint-complete-target",
137
+ className: "mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
138
+ value: p,
139
+ onChange: (e) => m(e.target.value),
140
+ "data-testid": "sprint-complete-target",
141
+ children: [/* @__PURE__ */ _("option", {
142
+ value: "",
143
+ children: "Choose a sprint…"
144
+ }), x.map((e) => /* @__PURE__ */ v("option", {
145
+ value: e.id,
146
+ children: [
147
+ e.name,
148
+ " (",
149
+ e.status.toLowerCase(),
150
+ ")"
151
+ ]
152
+ }, e.id))]
153
+ }),
154
+ y.data && x.length === 0 && /* @__PURE__ */ _("p", {
155
+ className: "mt-1 text-xs text-muted-foreground",
156
+ children: "No other unfinished sprint in this project or team."
157
+ })
158
+ ]
159
+ })
160
+ ]
161
+ }),
162
+ i && /* @__PURE__ */ _("p", {
163
+ role: "alert",
164
+ className: "text-sm text-destructive",
165
+ "data-testid": "sprint-complete-error",
166
+ children: i
167
+ }),
168
+ /* @__PURE__ */ v(E, { children: [/* @__PURE__ */ _(b, {
169
+ variant: "outline",
170
+ onClick: () => u(!1),
171
+ children: "Keep it open"
172
+ }), /* @__PURE__ */ _(b, {
173
+ onClick: () => void A(),
174
+ disabled: r || !S,
175
+ "data-testid": "sprint-complete-confirm",
176
+ children: "Complete sprint"
177
+ })] })
178
+ ]
179
+ })]
180
+ });
181
+ }
182
+ var z = p`
47
183
  mutation SprintControlsCancel($id: ID!) {
48
184
  planmagnetCancelSprint(id: $id) {
49
185
  id
@@ -51,18 +187,21 @@ var N = [
51
187
  }
52
188
  }
53
189
  `;
54
- function L({ sprintId: e, sprintName: i, status: a }) {
190
+ function B({ sprintId: e, sprintName: i, status: a }) {
55
191
  let o = {
56
192
  refetchQueries: N,
57
193
  awaitRefetchQueries: !0
58
- }, [u, d] = h(P, o), [p, m] = h(F, o), [g, y] = h(I, o), [x, S] = s(null), C = d.loading || m.loading || y.loading, w = j(a);
59
- if (w.length === 0) return x ? /* @__PURE__ */ _(r, { message: x }) : null;
60
- let T = async (n) => {
61
- S(null);
194
+ }, [c, u] = h(P, o), [d, p] = h(F, o), [m, g] = h(z, o), [y, x] = s(null), S = u.loading || p.loading || g.loading, C = j(a);
195
+ if (C.length === 0) return y ? /* @__PURE__ */ _(r, { message: y }) : null;
196
+ let w = async (n, r) => {
197
+ x(null);
62
198
  try {
63
- await t(n({ variables: { id: e } }));
199
+ return await t(n({ variables: {
200
+ id: e,
201
+ ...r ? { input: r } : {}
202
+ } })), !0;
64
203
  } catch (e) {
65
- S(e instanceof Error ? e.message : "The sprint could not be updated.");
204
+ return x(e instanceof Error ? e.message : "The sprint could not be updated."), !1;
66
205
  }
67
206
  };
68
207
  return /* @__PURE__ */ v("div", {
@@ -71,22 +210,20 @@ function L({ sprintId: e, sprintName: i, status: a }) {
71
210
  children: [/* @__PURE__ */ v("div", {
72
211
  className: "flex gap-2",
73
212
  children: [
74
- w.includes("start") && /* @__PURE__ */ v(b, {
213
+ C.includes("start") && /* @__PURE__ */ v(b, {
75
214
  size: "sm",
76
- onClick: () => T(u),
77
- disabled: C,
215
+ onClick: () => w(c),
216
+ disabled: S,
78
217
  children: [/* @__PURE__ */ _(l, { className: "mr-1 h-4 w-4" }), "Start sprint"]
79
218
  }),
80
- w.includes("complete") && /* @__PURE__ */ _(n, {
81
- label: "Complete sprint",
82
- icon: /* @__PURE__ */ _(c, { className: "mr-1 h-4 w-4" }),
83
- title: `Complete ${i}?`,
84
- description: "The sprint is closed and its work items can no longer be changed from it. This cannot be undone.",
85
- confirmLabel: "Complete sprint",
86
- disabled: C,
87
- onConfirm: () => T(p)
219
+ C.includes("complete") && /* @__PURE__ */ _(R, {
220
+ sprintId: e,
221
+ sprintName: i,
222
+ disabled: S,
223
+ error: y,
224
+ onComplete: (e) => w(d, e)
88
225
  }),
89
- w.includes("cancel") && /* @__PURE__ */ _(n, {
226
+ C.includes("cancel") && /* @__PURE__ */ _(n, {
90
227
  label: "Cancel sprint",
91
228
  variant: "outline",
92
229
  icon: /* @__PURE__ */ _(f, { className: "mr-1 h-4 w-4" }),
@@ -94,26 +231,26 @@ function L({ sprintId: e, sprintName: i, status: a }) {
94
231
  description: "The sprint is abandoned and cannot be restarted. Its work items stay in it for the record. This cannot be undone.",
95
232
  confirmLabel: "Cancel sprint",
96
233
  destructive: !0,
97
- disabled: C,
98
- onConfirm: () => T(g)
234
+ disabled: S,
235
+ onConfirm: () => w(m)
99
236
  })
100
237
  ]
101
- }), x && /* @__PURE__ */ _(r, { message: x })]
238
+ }), y && /* @__PURE__ */ _(r, { message: y })]
102
239
  });
103
240
  }
104
- var R = p`
241
+ var V = p`
105
242
  mutation SprintControlsAddItems($id: ID!, $input: PlanmagnetSprintWorkItemsInput!) {
106
243
  planmagnetAddWorkItemsToSprint(id: $id, input: $input) {
107
244
  id
108
245
  }
109
246
  }
110
- `, z = p`
247
+ `, H = p`
111
248
  mutation SprintControlsRemoveItems($id: ID!, $input: PlanmagnetSprintWorkItemsInput!) {
112
249
  planmagnetRemoveWorkItemsFromSprint(id: $id, input: $input) {
113
250
  id
114
251
  }
115
252
  }
116
- `, B = p`
253
+ `, U = p`
117
254
  query SprintControlsCandidates($workspaceId: ID!, $filter: PlanmagnetWorkItemFilter) {
118
255
  planmagnetWorkItems(workspaceId: $workspaceId, filter: $filter, pagination: { first: 100 }) {
119
256
  totalCount
@@ -128,9 +265,9 @@ var R = p`
128
265
  }
129
266
  }
130
267
  }
131
- `, V = (e) => e.toLowerCase().replace(/_/g, " ");
132
- function H({ sprintId: e, eligibleProjectIds: n, projectNames: i, status: a, items: o }) {
133
- let c = M(a), [l, u] = h(z, {
268
+ `, W = (e) => e.toLowerCase().replace(/_/g, " ");
269
+ function G({ sprintId: e, eligibleProjectIds: n, projectNames: i, status: a, items: o }) {
270
+ let c = M(a), [l, u] = h(H, {
134
271
  refetchQueries: N,
135
272
  awaitRefetchQueries: !0
136
273
  }), [f, p] = s(null), [m, g] = s(null), x = async (n) => {
@@ -159,7 +296,7 @@ function H({ sprintId: e, eligibleProjectIds: n, projectNames: i, status: a, ite
159
296
  " work item",
160
297
  o.length === 1 ? "" : "s"
161
298
  ]
162
- }), !c && n.length > 0 && /* @__PURE__ */ _(U, {
299
+ }), !c && n.length > 0 && /* @__PURE__ */ _(K, {
163
300
  sprintId: e,
164
301
  eligibleProjectIds: n,
165
302
  projectNames: i,
@@ -170,7 +307,7 @@ function H({ sprintId: e, eligibleProjectIds: n, projectNames: i, status: a, ite
170
307
  className: "text-xs text-muted-foreground",
171
308
  children: [
172
309
  "This sprint is ",
173
- V(a),
310
+ W(a),
174
311
  "; its work items can no longer be changed."
175
312
  ]
176
313
  }),
@@ -198,7 +335,7 @@ function H({ sprintId: e, eligibleProjectIds: n, projectNames: i, status: a, ite
198
335
  /* @__PURE__ */ _(y, {
199
336
  variant: "secondary",
200
337
  className: "text-xs capitalize",
201
- children: V(e.status)
338
+ children: W(e.status)
202
339
  }),
203
340
  /* @__PURE__ */ v("span", {
204
341
  className: "text-xs text-muted-foreground",
@@ -219,8 +356,8 @@ function H({ sprintId: e, eligibleProjectIds: n, projectNames: i, status: a, ite
219
356
  ]
220
357
  });
221
358
  }
222
- function U({ sprintId: n, eligibleProjectIds: i, projectNames: c, memberIds: l }) {
223
- let { workspaceId: d } = e(), f = m(), [p, g] = s(!1), [A, j] = s(""), M = a(A.trim()), [P, F] = s(/* @__PURE__ */ new Set()), [I, L] = s(null), z = `${i.join(",")}|${l.join(",")}|${M}`, [H, U] = s({
359
+ function K({ sprintId: n, eligibleProjectIds: i, projectNames: c, memberIds: l }) {
360
+ let { workspaceId: d } = e(), f = m(), [p, g] = s(!1), [A, j] = s(""), M = a(A.trim()), [P, F] = s(/* @__PURE__ */ new Set()), [I, L] = s(null), R = `${i.join(",")}|${l.join(",")}|${M}`, [z, B] = s({
224
361
  key: null,
225
362
  items: [],
226
363
  fetchedCount: 0,
@@ -233,7 +370,7 @@ function U({ sprintId: n, eligibleProjectIds: i, projectNames: c, memberIds: l }
233
370
  return (async () => {
234
371
  try {
235
372
  let t = await Promise.all(i.map((e) => f.query({
236
- query: B,
373
+ query: U,
237
374
  variables: {
238
375
  workspaceId: d,
239
376
  filter: {
@@ -245,8 +382,8 @@ function U({ sprintId: n, eligibleProjectIds: i, projectNames: c, memberIds: l }
245
382
  fetchPolicy: "network-only"
246
383
  })));
247
384
  if (e) return;
248
- U({
249
- key: z,
385
+ B({
386
+ key: R,
250
387
  items: t.flatMap((e) => e.data?.planmagnetWorkItems.items ?? []),
251
388
  fetchedCount: t.reduce((e, t) => e + (t.data?.planmagnetWorkItems.items.length ?? 0), 0),
252
389
  totalCount: t.reduce((e, t) => e + (t.data?.planmagnetWorkItems.totalCount ?? 0), 0),
@@ -254,8 +391,8 @@ function U({ sprintId: n, eligibleProjectIds: i, projectNames: c, memberIds: l }
254
391
  });
255
392
  } catch (t) {
256
393
  if (e) return;
257
- U({
258
- key: z,
394
+ B({
395
+ key: R,
259
396
  items: [],
260
397
  fetchedCount: 0,
261
398
  totalCount: 0,
@@ -272,12 +409,12 @@ function U({ sprintId: n, eligibleProjectIds: i, projectNames: c, memberIds: l }
272
409
  l,
273
410
  M,
274
411
  f,
275
- z
412
+ R
276
413
  ]);
277
- let [W, G] = h(R, {
414
+ let [H, G] = h(V, {
278
415
  refetchQueries: N,
279
416
  awaitRefetchQueries: !0
280
- }), K = H.items.filter((e) => e.sprintId !== n), { totalCount: q, fetchedCount: J } = H, Y = p && H.key !== z, X = i.length > 1 && !!c, Z = (e, t) => F((n) => {
417
+ }), K = z.items.filter((e) => e.sprintId !== n), { totalCount: q, fetchedCount: J } = z, Y = p && z.key !== R, X = i.length > 1 && !!c, Z = (e, t) => F((n) => {
281
418
  let r = new Set(n);
282
419
  return t ? r.add(e) : r.delete(e), r;
283
420
  }), Q = () => {
@@ -313,11 +450,11 @@ function U({ sprintId: n, eligibleProjectIds: i, projectNames: c, memberIds: l }
313
450
  className: "text-sm text-muted-foreground py-4 text-center",
314
451
  children: "Loading…"
315
452
  }),
316
- !Y && H.error && /* @__PURE__ */ _("p", {
453
+ !Y && z.error && /* @__PURE__ */ _("p", {
317
454
  className: "text-sm text-destructive py-4 text-center",
318
- children: H.error
455
+ children: z.error
319
456
  }),
320
- !Y && !H.error && K.length === 0 && /* @__PURE__ */ _("p", {
457
+ !Y && !z.error && K.length === 0 && /* @__PURE__ */ _("p", {
321
458
  className: "text-sm text-muted-foreground py-4 text-center",
322
459
  children: M ? "No matching work items." : i.length > 1 ? "Every work item in this team's projects is already in this sprint." : "Every work item in this project is already in this sprint."
323
460
  }),
@@ -350,7 +487,7 @@ function U({ sprintId: n, eligibleProjectIds: i, projectNames: c, memberIds: l }
350
487
  /* @__PURE__ */ _(y, {
351
488
  variant: "secondary",
352
489
  className: "text-xs capitalize shrink-0",
353
- children: V(e.status)
490
+ children: W(e.status)
354
491
  })
355
492
  ]
356
493
  }, e.id);
@@ -372,7 +509,7 @@ function U({ sprintId: n, eligibleProjectIds: i, projectNames: c, memberIds: l }
372
509
  onClick: async () => {
373
510
  L(null);
374
511
  try {
375
- await t(W({ variables: {
512
+ await t(H({ variables: {
376
513
  id: n,
377
514
  input: { workItemIds: [...P] }
378
515
  } })), Q(), g(!1);
@@ -388,13 +525,13 @@ function U({ sprintId: n, eligibleProjectIds: i, projectNames: c, memberIds: l }
388
525
  })]
389
526
  });
390
527
  }
391
- var W = p`
528
+ var q = p`
392
529
  mutation SprintControlsCreate($input: PlanmagnetCreateSprintInput!) {
393
530
  planmagnetCreateSprint(input: $input) {
394
531
  id
395
532
  }
396
533
  }
397
- `, G = p`
534
+ `, J = p`
398
535
  query SprintControlsProjects($workspaceId: ID!) {
399
536
  planmagnetProjects(workspaceId: $workspaceId, pagination: { first: 100 }) {
400
537
  items {
@@ -403,7 +540,7 @@ var W = p`
403
540
  }
404
541
  }
405
542
  }
406
- `, K = {
543
+ `, Y = {
407
544
  name: "",
408
545
  projectId: "",
409
546
  startDate: "",
@@ -411,14 +548,14 @@ var W = p`
411
548
  goal: "",
412
549
  capacity: ""
413
550
  };
414
- function q({ onCreated: n, initialScope: a, initialTeamId: o }) {
415
- let { workspaceId: c } = e(), [l, d] = s(!1), [f, p] = s(K), [m, y] = s(a ?? "project"), [x, A] = s(o ?? ""), [j, M] = s(null), { data: P, loading: F, error: I, refetch: L } = g(G, {
551
+ function X({ onCreated: n, initialScope: a, initialTeamId: o }) {
552
+ let { workspaceId: c } = e(), [l, d] = s(!1), [f, p] = s(Y), [m, y] = s(a ?? "project"), [x, A] = s(o ?? ""), [j, M] = s(null), { data: P, loading: F, error: I, refetch: L } = g(J, {
416
553
  variables: { workspaceId: c ?? "" },
417
554
  skip: !l || !c || m !== "project"
418
- }), R = P?.planmagnetProjects.items ?? [], z = f.projectId || R[0]?.id || "", [B, { loading: V }] = h(W, {
555
+ }), R = P?.planmagnetProjects.items ?? [], z = f.projectId || R[0]?.id || "", [B, { loading: V }] = h(q, {
419
556
  refetchQueries: N,
420
557
  awaitRefetchQueries: !0
421
- }), H = f.capacity.trim() === "" ? void 0 : Number(f.capacity), U = H !== void 0 && (!Number.isInteger(H) || H < 0), q = !!(f.startDate && f.endDate && f.endDate < f.startDate), J = m === "project" ? z !== "" : x !== "", Y = f.name.trim() !== "" && J && !U && !q && !V;
558
+ }), H = f.capacity.trim() === "" ? void 0 : Number(f.capacity), U = H !== void 0 && (!Number.isInteger(H) || H < 0), W = !!(f.startDate && f.endDate && f.endDate < f.startDate), G = m === "project" ? z !== "" : x !== "", K = f.name.trim() !== "" && G && !U && !W && !V;
422
559
  return /* @__PURE__ */ v(C, {
423
560
  open: l,
424
561
  onOpenChange: (e) => {
@@ -562,7 +699,7 @@ function q({ onCreated: n, initialScope: a, initialTeamId: o }) {
562
699
  })
563
700
  })] })]
564
701
  }),
565
- q && /* @__PURE__ */ _(r, { message: "The end date is before the start date." }),
702
+ W && /* @__PURE__ */ _(r, { message: "The end date is before the start date." }),
566
703
  /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
567
704
  htmlFor: "new-sprint-capacity",
568
705
  className: "text-sm font-medium",
@@ -607,12 +744,12 @@ function q({ onCreated: n, initialScope: a, initialTeamId: o }) {
607
744
  goal: f.goal.trim() || void 0,
608
745
  capacity: H
609
746
  } } }))).data?.planmagnetCreateSprint.id;
610
- p(K), d(!1), e && n(e);
747
+ p(Y), d(!1), e && n(e);
611
748
  } catch (e) {
612
749
  M(e instanceof Error ? e.message : "The sprint could not be created.");
613
750
  }
614
751
  },
615
- disabled: !Y,
752
+ disabled: !K,
616
753
  "data-testid": "new-sprint-submit",
617
754
  children: V ? "Creating…" : "Create sprint"
618
755
  }) })
@@ -621,6 +758,6 @@ function q({ onCreated: n, initialScope: a, initialTeamId: o }) {
621
758
  });
622
759
  }
623
760
  //#endregion
624
- export { q as NewSprintDialog, L as SprintLifecycleActions, H as SprintWorkItemsPanel };
761
+ export { X as NewSprintDialog, B as SprintLifecycleActions, G as SprintWorkItemsPanel };
625
762
 
626
763
  //# sourceMappingURL=SprintControls.js.map