@burdenoff/microfe-planmagnet 2026.1002.2 → 2026.1008.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.
- package/dist/generated/wspace-operations.d.ts +574 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-types.d.ts +486 -16
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/planmagnet/PlanMagnetRoot.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoot.js +174 -168
- package/dist/planmagnet/PlanMagnetRoot.js.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.js +63 -59
- package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
- package/dist/planmagnet/board/BulkActions.d.ts.map +1 -1
- package/dist/planmagnet/board/BulkActions.js +106 -55
- package/dist/planmagnet/board/BulkActions.js.map +1 -1
- package/dist/planmagnet/controls/Pickers.d.ts +3 -3
- package/dist/planmagnet/controls/Pickers.js.map +1 -1
- package/dist/planmagnet/dashboards/DashboardUI.d.ts +0 -4
- package/dist/planmagnet/dashboards/DashboardUI.d.ts.map +1 -1
- package/dist/planmagnet/dashboards/DashboardUI.js +6 -13
- package/dist/planmagnet/dashboards/DashboardUI.js.map +1 -1
- package/dist/planmagnet/dashboards/cards/SprintCapacityCard.d.ts.map +1 -1
- package/dist/planmagnet/dashboards/cards/SprintCapacityCard.js +70 -59
- package/dist/planmagnet/dashboards/cards/SprintCapacityCard.js.map +1 -1
- package/dist/planmagnet/forecast/ResourceForecastCard.js +1 -1
- package/dist/planmagnet/forecast/ResourceForecastCard.js.map +1 -1
- package/dist/planmagnet/index.d.ts +1 -1
- package/dist/planmagnet/index.d.ts.map +1 -1
- package/dist/planmagnet/pages/DashboardsProjectManagerPagePage.d.ts +3 -3
- package/dist/planmagnet/pages/DashboardsProjectManagerPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DashboardsProjectManagerPagePage.js +26 -19
- package/dist/planmagnet/pages/DashboardsProjectManagerPagePage.js.map +1 -1
- package/dist/planmagnet/pages/DashboardsTeamUtilizationPagePage.d.ts +2 -2
- package/dist/planmagnet/pages/DashboardsTeamUtilizationPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DashboardsTeamUtilizationPagePage.js +18 -12
- package/dist/planmagnet/pages/DashboardsTeamUtilizationPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsCustomerSatisfactionPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/ProductsCustomerSatisfactionPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/ProductsCustomerSatisfactionPagePage.js +251 -0
- package/dist/planmagnet/pages/ProductsCustomerSatisfactionPagePage.js.map +1 -0
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.js +94 -92
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js +116 -114
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.js +174 -159
- package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TasksCreateTaskPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksCreateTaskPagePage.js +159 -145
- package/dist/planmagnet/pages/TasksCreateTaskPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TasksEditTaskPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksEditTaskPagePage.js +161 -143
- package/dist/planmagnet/pages/TasksEditTaskPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.js +157 -155
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TeamInviteMemberPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TeamInviteMemberPagePage.js +142 -82
- package/dist/planmagnet/pages/TeamInviteMemberPagePage.js.map +1 -1
- package/dist/planmagnet/pages/analytics/DeliveryKpisCard.d.ts.map +1 -1
- package/dist/planmagnet/pages/analytics/DeliveryKpisCard.js +97 -99
- package/dist/planmagnet/pages/analytics/DeliveryKpisCard.js.map +1 -1
- package/dist/planmagnet/product/FeatureLinkPanels.js +66 -66
- package/dist/planmagnet/product/ProductFeatureControls.js +38 -38
- package/dist/planmagnet/product/ProductFeatureLinkCard.js +8 -8
- package/dist/planmagnet/product/ProductLineControls.js +83 -83
- package/dist/planmagnet/product/ProductTeamsPanel.js +6 -6
- package/dist/planmagnet/product/routes.d.ts +6 -0
- package/dist/planmagnet/product/routes.d.ts.map +1 -1
- package/dist/planmagnet/product/routes.js +2 -2
- package/dist/planmagnet/product/routes.js.map +1 -1
- package/dist/planmagnet/satisfaction/DeliverySatisfactionSection.d.ts +20 -0
- package/dist/planmagnet/satisfaction/DeliverySatisfactionSection.d.ts.map +1 -0
- package/dist/planmagnet/satisfaction/DeliverySatisfactionSection.js +55 -0
- package/dist/planmagnet/satisfaction/DeliverySatisfactionSection.js.map +1 -0
- package/dist/planmagnet/satisfaction/SatisfactionFigures.d.ts +30 -0
- package/dist/planmagnet/satisfaction/SatisfactionFigures.d.ts.map +1 -0
- package/dist/planmagnet/satisfaction/SatisfactionFigures.js +282 -0
- package/dist/planmagnet/satisfaction/SatisfactionFigures.js.map +1 -0
- package/dist/planmagnet/satisfaction/SatisfactionImportDialog.d.ts +9 -0
- package/dist/planmagnet/satisfaction/SatisfactionImportDialog.d.ts.map +1 -0
- package/dist/planmagnet/satisfaction/SatisfactionImportDialog.js +390 -0
- package/dist/planmagnet/satisfaction/SatisfactionImportDialog.js.map +1 -0
- package/dist/planmagnet/satisfaction/SatisfactionLinkFields.d.ts +17 -0
- package/dist/planmagnet/satisfaction/SatisfactionLinkFields.d.ts.map +1 -0
- package/dist/planmagnet/satisfaction/SatisfactionLinkFields.js +77 -0
- package/dist/planmagnet/satisfaction/SatisfactionLinkFields.js.map +1 -0
- package/dist/planmagnet/satisfaction/SatisfactionReleaseSelect.d.ts +18 -0
- package/dist/planmagnet/satisfaction/SatisfactionReleaseSelect.d.ts.map +1 -0
- package/dist/planmagnet/satisfaction/SatisfactionReleaseSelect.js +87 -0
- package/dist/planmagnet/satisfaction/SatisfactionReleaseSelect.js.map +1 -0
- package/dist/planmagnet/satisfaction/SatisfactionResponseDialog.d.ts +13 -0
- package/dist/planmagnet/satisfaction/SatisfactionResponseDialog.d.ts.map +1 -0
- package/dist/planmagnet/satisfaction/SatisfactionResponseDialog.js +326 -0
- package/dist/planmagnet/satisfaction/SatisfactionResponseDialog.js.map +1 -0
- package/dist/planmagnet/satisfaction/SatisfactionResponsesTable.d.ts +23 -0
- package/dist/planmagnet/satisfaction/SatisfactionResponsesTable.d.ts.map +1 -0
- package/dist/planmagnet/satisfaction/SatisfactionResponsesTable.js +258 -0
- package/dist/planmagnet/satisfaction/SatisfactionResponsesTable.js.map +1 -0
- package/dist/planmagnet/satisfaction/SatisfactionSummaryCard.d.ts +6 -0
- package/dist/planmagnet/satisfaction/SatisfactionSummaryCard.d.ts.map +1 -0
- package/dist/planmagnet/satisfaction/SatisfactionSummaryCard.js +56 -0
- package/dist/planmagnet/satisfaction/SatisfactionSummaryCard.js.map +1 -0
- package/dist/planmagnet/satisfaction/SatisfactionWindowPicker.d.ts +16 -0
- package/dist/planmagnet/satisfaction/SatisfactionWindowPicker.d.ts.map +1 -0
- package/dist/planmagnet/satisfaction/SatisfactionWindowPicker.js +102 -0
- package/dist/planmagnet/satisfaction/SatisfactionWindowPicker.js.map +1 -0
- package/dist/planmagnet/satisfaction/satisfaction.d.ts +154 -0
- package/dist/planmagnet/satisfaction/satisfaction.d.ts.map +1 -0
- package/dist/planmagnet/satisfaction/satisfaction.js +210 -0
- package/dist/planmagnet/satisfaction/satisfaction.js.map +1 -0
- package/dist/planmagnet/satisfaction/satisfactionCsv.d.ts +108 -0
- package/dist/planmagnet/satisfaction/satisfactionCsv.d.ts.map +1 -0
- package/dist/planmagnet/satisfaction/satisfactionCsv.js +211 -0
- package/dist/planmagnet/satisfaction/satisfactionCsv.js.map +1 -0
- package/dist/planmagnet/satisfaction/satisfactionForm.d.ts +90 -0
- package/dist/planmagnet/satisfaction/satisfactionForm.d.ts.map +1 -0
- package/dist/planmagnet/satisfaction/satisfactionForm.js +90 -0
- package/dist/planmagnet/satisfaction/satisfactionForm.js.map +1 -0
- package/dist/planmagnet/satisfaction/satisfactionOperations.d.ts +116 -0
- package/dist/planmagnet/satisfaction/satisfactionOperations.d.ts.map +1 -0
- package/dist/planmagnet/satisfaction/satisfactionOperations.js +86 -0
- package/dist/planmagnet/satisfaction/satisfactionOperations.js.map +1 -0
- package/dist/planmagnet/satisfaction/useSatisfactionAccess.d.ts +20 -0
- package/dist/planmagnet/satisfaction/useSatisfactionAccess.d.ts.map +1 -0
- package/dist/planmagnet/satisfaction/useSatisfactionAccess.js +31 -0
- package/dist/planmagnet/satisfaction/useSatisfactionAccess.js.map +1 -0
- package/dist/planmagnet/skills/RequiredSkillsEditor.d.ts +35 -0
- package/dist/planmagnet/skills/RequiredSkillsEditor.d.ts.map +1 -0
- package/dist/planmagnet/skills/RequiredSkillsEditor.js +124 -0
- package/dist/planmagnet/skills/RequiredSkillsEditor.js.map +1 -0
- package/dist/planmagnet/skills/SkillChips.d.ts +30 -0
- package/dist/planmagnet/skills/SkillChips.d.ts.map +1 -0
- package/dist/planmagnet/skills/SkillChips.js +57 -0
- package/dist/planmagnet/skills/SkillChips.js.map +1 -0
- package/dist/planmagnet/skills/SkillCoverageCard.d.ts +24 -0
- package/dist/planmagnet/skills/SkillCoverageCard.d.ts.map +1 -0
- package/dist/planmagnet/skills/SkillCoverageCard.js +256 -0
- package/dist/planmagnet/skills/SkillCoverageCard.js.map +1 -0
- package/dist/planmagnet/skills/WorkItemRequiredSkills.d.ts +10 -0
- package/dist/planmagnet/skills/WorkItemRequiredSkills.d.ts.map +1 -0
- package/dist/planmagnet/skills/WorkItemRequiredSkills.js +65 -0
- package/dist/planmagnet/skills/WorkItemRequiredSkills.js.map +1 -0
- package/dist/planmagnet/skills/skillOperations.d.ts +52 -0
- package/dist/planmagnet/skills/skillOperations.d.ts.map +1 -0
- package/dist/planmagnet/skills/skillOperations.js +44 -0
- package/dist/planmagnet/skills/skillOperations.js.map +1 -0
- package/dist/planmagnet/skills/skillTags.d.ts +103 -0
- package/dist/planmagnet/skills/skillTags.d.ts.map +1 -0
- package/dist/planmagnet/skills/skillTags.js +115 -0
- package/dist/planmagnet/skills/skillTags.js.map +1 -0
- package/dist/planmagnet/skills/useRequiredSkillsDraft.d.ts +28 -0
- package/dist/planmagnet/skills/useRequiredSkillsDraft.d.ts.map +1 -0
- package/dist/planmagnet/skills/useRequiredSkillsDraft.js +30 -0
- package/dist/planmagnet/skills/useRequiredSkillsDraft.js.map +1 -0
- package/dist/planmagnet/team/PendingInvitations.d.ts +27 -0
- package/dist/planmagnet/team/PendingInvitations.d.ts.map +1 -0
- package/dist/planmagnet/team/PendingInvitations.js +220 -0
- package/dist/planmagnet/team/PendingInvitations.js.map +1 -0
- package/dist/planmagnet/team/invitationEmail.d.ts +35 -0
- package/dist/planmagnet/team/invitationEmail.d.ts.map +1 -0
- package/dist/planmagnet/team/invitationEmail.js +73 -0
- package/dist/planmagnet/team/invitationEmail.js.map +1 -0
- package/package.json +1 -1
|
@@ -4,9 +4,9 @@ import { LEAVES_PAGE_CONTEXT as r, throwOnError as i } from "../utils/mutationRe
|
|
|
4
4
|
import { ConfirmButton as a, ErrorLine as o } from "../controls/ConfirmButton.js";
|
|
5
5
|
import { AssigneeSelect as s, enumLabel as c } from "../controls/WorkItemControls.js";
|
|
6
6
|
import { detailPath as l } from "../utils/rowNavigation.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { refusalMessage as u } from "./refusal.js";
|
|
8
|
+
import { ARCHIVE_PRODUCT_FEATURE as d, CREATE_PRODUCT_FEATURE as f, DELETE_PRODUCT_FEATURE as p, PRODUCT_FEATURES_LIST as m, PRODUCT_FEATURE_QUERIES as h, UNARCHIVE_PRODUCT_FEATURE as g, UPDATE_PRODUCT_FEATURE as _ } from "./hierarchyOperations.js";
|
|
9
|
+
import { PRODUCT_FEATURE_STATUSES as v, changedFields as y, normalizeText as b, productFeatureStatusVariant as x } from "./hierarchy.js";
|
|
10
10
|
import { useState as S } from "react";
|
|
11
11
|
import { Archive as C, ArchiveRestore as w, Pencil as T, Plus as E, Puzzle as D, Trash2 as O } from "lucide-react";
|
|
12
12
|
import { useMutation as k, useQuery as A } from "@apollo/client/react";
|
|
@@ -14,7 +14,7 @@ import { jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
|
14
14
|
import { Badge as N, Button as P, Input as F, ResponsiveDialog as I, ResponsiveDialogContent as L, ResponsiveDialogDescription as R, ResponsiveDialogFooter as z, ResponsiveDialogHeader as B, ResponsiveDialogTitle as V, ResponsiveDialogTrigger as H } from "@burdenoff/fe-libs/ui";
|
|
15
15
|
//#region src/planmagnet/product/ProductFeatureControls.tsx
|
|
16
16
|
var U = "mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm min-h-[72px]", W = "mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm disabled:opacity-60", G = {
|
|
17
|
-
refetchQueries:
|
|
17
|
+
refetchQueries: h,
|
|
18
18
|
awaitRefetchQueries: !0
|
|
19
19
|
};
|
|
20
20
|
function K() {
|
|
@@ -22,31 +22,31 @@ function K() {
|
|
|
22
22
|
}
|
|
23
23
|
function q({ status: e }) {
|
|
24
24
|
return /* @__PURE__ */ j(N, {
|
|
25
|
-
variant:
|
|
25
|
+
variant: x(e),
|
|
26
26
|
className: "text-xs",
|
|
27
27
|
"data-testid": "product-feature-status",
|
|
28
28
|
children: c(e)
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
function J({ productId: t, feature: r, disabled: a = !1 }) {
|
|
32
|
-
let l = n(),
|
|
32
|
+
let l = n(), d = K(), { currentUser: p } = e(), m = {
|
|
33
33
|
name: r?.name ?? "",
|
|
34
34
|
description: r?.description ?? "",
|
|
35
35
|
status: r?.status ?? "BACKLOG",
|
|
36
|
-
ownerId: r ? r.ownerId ?? "" :
|
|
37
|
-
}, [
|
|
36
|
+
ownerId: r ? r.ownerId ?? "" : p?.id ?? ""
|
|
37
|
+
}, [h, g] = S(!1), [x, C] = S(m), [w, D] = S(null), [O, A] = k(f, G), [N, q] = k(_, G), J = A.loading || q.loading, Y = x.name.trim() !== "" && !J, X = r ? `product-feature-edit-${r.id}` : `product-feature-new-${t}`, Z = v.includes(x.status) ? v : [x.status, ...v], Q = async () => {
|
|
38
38
|
D(null);
|
|
39
39
|
let e = {
|
|
40
|
-
name:
|
|
41
|
-
description:
|
|
42
|
-
status:
|
|
43
|
-
ownerId:
|
|
40
|
+
name: x.name.trim(),
|
|
41
|
+
description: b(x.description),
|
|
42
|
+
status: x.status,
|
|
43
|
+
ownerId: x.ownerId || null
|
|
44
44
|
};
|
|
45
45
|
try {
|
|
46
46
|
if (r) {
|
|
47
|
-
let t =
|
|
47
|
+
let t = y({
|
|
48
48
|
name: r.name.trim(),
|
|
49
|
-
description:
|
|
49
|
+
description: b(r.description ?? ""),
|
|
50
50
|
status: r.status,
|
|
51
51
|
ownerId: r.ownerId
|
|
52
52
|
}, e);
|
|
@@ -61,15 +61,15 @@ function J({ productId: t, feature: r, disabled: a = !1 }) {
|
|
|
61
61
|
...e.description ? { description: e.description } : {},
|
|
62
62
|
...e.ownerId ? { ownerId: e.ownerId } : {}
|
|
63
63
|
} } }));
|
|
64
|
-
|
|
64
|
+
g(!1);
|
|
65
65
|
} catch (e) {
|
|
66
|
-
D(
|
|
66
|
+
D(u(e, r ? l("planmagnet.productFeatures.errors.save", "The feature could not be saved.") : l("planmagnet.productFeatures.errors.create", "The feature could not be created."), d));
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
return /* @__PURE__ */ M(I, {
|
|
70
|
-
open:
|
|
70
|
+
open: h,
|
|
71
71
|
onOpenChange: (e) => {
|
|
72
|
-
|
|
72
|
+
g(e), e ? C(m) : D(null);
|
|
73
73
|
},
|
|
74
74
|
children: [/* @__PURE__ */ j(H, {
|
|
75
75
|
asChild: !0,
|
|
@@ -98,10 +98,10 @@ function J({ productId: t, feature: r, disabled: a = !1 }) {
|
|
|
98
98
|
}), /* @__PURE__ */ j(F, {
|
|
99
99
|
id: `${X}-name`,
|
|
100
100
|
className: "mt-1",
|
|
101
|
-
value:
|
|
101
|
+
value: x.name,
|
|
102
102
|
placeholder: l("planmagnet.productFeatures.fields.namePlaceholder", "e.g. Single sign-on"),
|
|
103
103
|
onChange: (e) => C({
|
|
104
|
-
...
|
|
104
|
+
...x,
|
|
105
105
|
name: e.target.value
|
|
106
106
|
}),
|
|
107
107
|
"data-testid": "product-feature-name"
|
|
@@ -113,9 +113,9 @@ function J({ productId: t, feature: r, disabled: a = !1 }) {
|
|
|
113
113
|
}), /* @__PURE__ */ j("textarea", {
|
|
114
114
|
id: `${X}-description`,
|
|
115
115
|
className: U,
|
|
116
|
-
value:
|
|
116
|
+
value: x.description,
|
|
117
117
|
onChange: (e) => C({
|
|
118
|
-
...
|
|
118
|
+
...x,
|
|
119
119
|
description: e.target.value
|
|
120
120
|
}),
|
|
121
121
|
"data-testid": "product-feature-description"
|
|
@@ -129,9 +129,9 @@ function J({ productId: t, feature: r, disabled: a = !1 }) {
|
|
|
129
129
|
}), /* @__PURE__ */ j("select", {
|
|
130
130
|
id: `${X}-status`,
|
|
131
131
|
className: W,
|
|
132
|
-
value:
|
|
132
|
+
value: x.status,
|
|
133
133
|
onChange: (e) => C({
|
|
134
|
-
...
|
|
134
|
+
...x,
|
|
135
135
|
status: e.target.value
|
|
136
136
|
}),
|
|
137
137
|
"data-testid": "product-feature-status-select",
|
|
@@ -147,10 +147,10 @@ function J({ productId: t, feature: r, disabled: a = !1 }) {
|
|
|
147
147
|
className: "mt-1",
|
|
148
148
|
children: /* @__PURE__ */ j(s, {
|
|
149
149
|
id: `${X}-owner`,
|
|
150
|
-
value:
|
|
150
|
+
value: x.ownerId,
|
|
151
151
|
noneLabel: l("planmagnet.productFeatures.fields.noOwner", "No owner"),
|
|
152
152
|
onChange: (e) => C({
|
|
153
|
-
...
|
|
153
|
+
...x,
|
|
154
154
|
ownerId: e
|
|
155
155
|
})
|
|
156
156
|
})
|
|
@@ -170,19 +170,19 @@ function J({ productId: t, feature: r, disabled: a = !1 }) {
|
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
function Y({ feature: e, epicCount: s, requestCount: c }) {
|
|
173
|
-
let
|
|
173
|
+
let f = n(), m = K(), h = t(), [_, v] = k(d, G), [y, b] = k(g, G), [x, T] = k(p, { context: r }), [E, D] = S(null), A = v.loading || b.loading || T.loading, N = async () => {
|
|
174
174
|
D(null);
|
|
175
175
|
try {
|
|
176
|
-
e.archivedAt ? await i(
|
|
176
|
+
e.archivedAt ? await i(y({ variables: { id: e.id } })) : await i(_({ variables: { id: e.id } }));
|
|
177
177
|
} catch (e) {
|
|
178
|
-
D(
|
|
178
|
+
D(u(e, f("planmagnet.productFeatures.errors.update", "The feature could not be updated."), m));
|
|
179
179
|
}
|
|
180
180
|
}, F = async () => {
|
|
181
181
|
D(null);
|
|
182
182
|
try {
|
|
183
|
-
await i(
|
|
183
|
+
await i(x({ variables: { id: e.id } })), h(l("/products/product-detail-page", e.productId));
|
|
184
184
|
} catch (e) {
|
|
185
|
-
D(
|
|
185
|
+
D(u(e, f("planmagnet.productFeatures.errors.delete", "The feature could not be deleted."), m));
|
|
186
186
|
}
|
|
187
187
|
};
|
|
188
188
|
return /* @__PURE__ */ M("div", {
|
|
@@ -200,19 +200,19 @@ function Y({ feature: e, epicCount: s, requestCount: c }) {
|
|
|
200
200
|
disabled: A,
|
|
201
201
|
onClick: () => void N(),
|
|
202
202
|
"data-testid": "product-feature-toggle-archive",
|
|
203
|
-
children: [e.archivedAt ? /* @__PURE__ */ j(w, { className: "mr-1 h-4 w-4" }) : /* @__PURE__ */ j(C, { className: "mr-1 h-4 w-4" }), e.archivedAt ?
|
|
203
|
+
children: [e.archivedAt ? /* @__PURE__ */ j(w, { className: "mr-1 h-4 w-4" }) : /* @__PURE__ */ j(C, { className: "mr-1 h-4 w-4" }), e.archivedAt ? f("planmagnet.productFeatures.actions.unarchive", "Unarchive") : f("planmagnet.productFeatures.actions.archive", "Archive")]
|
|
204
204
|
}),
|
|
205
205
|
/* @__PURE__ */ j(a, {
|
|
206
|
-
label:
|
|
206
|
+
label: f("planmagnet.productFeatures.actions.delete", "Delete"),
|
|
207
207
|
variant: "outline",
|
|
208
208
|
icon: /* @__PURE__ */ j(O, { className: "mr-1 h-4 w-4" }),
|
|
209
209
|
testId: "product-feature-delete",
|
|
210
|
-
title:
|
|
211
|
-
description:
|
|
210
|
+
title: f("planmagnet.productFeatures.confirmDelete.title", "Delete {{name}}?", { name: e.name }),
|
|
211
|
+
description: f("planmagnet.productFeatures.confirmDelete.description", "Its {{requests}} feature request(s) and {{epics}} epic(s) are kept — only their links to this feature are removed, and stories stay under their epics. No request or work item is deleted or changed. This cannot be undone here.", {
|
|
212
212
|
requests: c,
|
|
213
213
|
epics: s
|
|
214
214
|
}),
|
|
215
|
-
confirmLabel:
|
|
215
|
+
confirmLabel: f("planmagnet.productFeatures.confirmDelete.confirm", "Delete feature"),
|
|
216
216
|
destructive: !0,
|
|
217
217
|
disabled: A,
|
|
218
218
|
onConfirm: () => void F()
|
|
@@ -222,14 +222,14 @@ function Y({ feature: e, epicCount: s, requestCount: c }) {
|
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
function X({ productId: r, productArchived: i }) {
|
|
225
|
-
let a = n(), { workspaceId: s } = e(), c = t(), [u, d] = S(!1), { data: f, previousData:
|
|
225
|
+
let a = n(), { workspaceId: s } = e(), c = t(), [u, d] = S(!1), { data: f, previousData: p, loading: h, error: g } = A(m, {
|
|
226
226
|
variables: {
|
|
227
227
|
workspaceId: s ?? "",
|
|
228
228
|
productId: r,
|
|
229
229
|
filter: u ? void 0 : { isActive: !0 }
|
|
230
230
|
},
|
|
231
231
|
skip: !s || !r
|
|
232
|
-
}), _ = (f ??
|
|
232
|
+
}), _ = (f ?? p)?.planmagnetProductFeatures, v = _?.items ?? [];
|
|
233
233
|
return /* @__PURE__ */ M("div", {
|
|
234
234
|
className: "space-y-3",
|
|
235
235
|
"data-testid": "product-features",
|
|
@@ -4,8 +4,8 @@ import { throwOnError as r } from "../utils/mutationResult.js";
|
|
|
4
4
|
import { ErrorLine as i } from "../controls/ConfirmButton.js";
|
|
5
5
|
import { detailPath as a } from "../utils/rowNavigation.js";
|
|
6
6
|
import { ProductSelect as o } from "../controls/Pickers.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { refusalMessage as s } from "./refusal.js";
|
|
8
|
+
import { FEATURE_REQUEST_FEATURE_OPTIONS as c, FEATURE_REQUEST_PRODUCT_FEATURE as l, LINK_FEATURE_REQUEST_TO_PRODUCT_FEATURE as u, PRODUCT_FEATURE_QUERIES as d, UNLINK_FEATURE_REQUEST_FROM_PRODUCT_FEATURE as f } from "./hierarchyOperations.js";
|
|
9
9
|
import { ProductFeatureStatusBadge as p } from "./ProductFeatureControls.js";
|
|
10
10
|
import { useState as m } from "react";
|
|
11
11
|
import { Link2 as h, Puzzle as g, X as _ } from "lucide-react";
|
|
@@ -15,19 +15,19 @@ import { Badge as S, Button as C, Card as w, CardContent as T, CardHeader as E,
|
|
|
15
15
|
//#region src/planmagnet/product/ProductFeatureLinkCard.tsx
|
|
16
16
|
var O = "w-full rounded-md border border-input bg-background px-3 py-2 text-sm disabled:opacity-60";
|
|
17
17
|
function k({ featureRequestId: k }) {
|
|
18
|
-
let A = n(), { workspaceId: j } = e(), M = t(), [N, P] = m(!1), [F, I] = m(""), [L, R] = m(""), [z, B] = m(null), V = y(
|
|
18
|
+
let A = n(), { workspaceId: j } = e(), M = t(), [N, P] = m(!1), [F, I] = m(""), [L, R] = m(""), [z, B] = m(null), V = y(l, {
|
|
19
19
|
variables: { id: k },
|
|
20
20
|
skip: !k
|
|
21
|
-
}), H = V.data?.planmagnetFeatureRequest ?? null, U = H?.productFeature ?? null, W = H?.productId ?? F, G = y(
|
|
21
|
+
}), H = V.data?.planmagnetFeatureRequest ?? null, U = H?.productFeature ?? null, W = H?.productId ?? F, G = y(c, {
|
|
22
22
|
variables: {
|
|
23
23
|
workspaceId: j ?? "",
|
|
24
24
|
productId: W
|
|
25
25
|
},
|
|
26
26
|
skip: !N || !j || !W
|
|
27
27
|
}), K = {
|
|
28
|
-
refetchQueries:
|
|
28
|
+
refetchQueries: d,
|
|
29
29
|
awaitRefetchQueries: !0
|
|
30
|
-
}, [q, J] = v(
|
|
30
|
+
}, [q, J] = v(u, K), [Y, X] = v(f, K), Z = A("planmagnet.productFeatures.errors.forbiddenLinks", "Your role cannot change what this feature is linked to."), Q = (G.data?.planmagnetProductFeatures.items ?? []).filter((e) => e.id !== U?.id), $ = () => {
|
|
31
31
|
P(!1), I(""), R("");
|
|
32
32
|
}, ee = async () => {
|
|
33
33
|
if (L) {
|
|
@@ -38,7 +38,7 @@ function k({ featureRequestId: k }) {
|
|
|
38
38
|
productFeatureId: L
|
|
39
39
|
} })), $();
|
|
40
40
|
} catch (e) {
|
|
41
|
-
B(
|
|
41
|
+
B(s(e, A("planmagnet.productFeatures.requestCard.errors.link", "The request could not be linked to the feature."), Z));
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}, te = async () => {
|
|
@@ -50,7 +50,7 @@ function k({ featureRequestId: k }) {
|
|
|
50
50
|
productFeatureId: U.id
|
|
51
51
|
} }));
|
|
52
52
|
} catch (e) {
|
|
53
|
-
B(
|
|
53
|
+
B(s(e, A("planmagnet.productFeatures.requestCard.errors.unlink", "The request could not be unlinked from the feature."), Z));
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
};
|
|
@@ -4,9 +4,9 @@ import { throwOnError as r } from "../utils/mutationResult.js";
|
|
|
4
4
|
import { ConfirmButton as i, ErrorLine as a } from "../controls/ConfirmButton.js";
|
|
5
5
|
import { AssigneeSelect as o } from "../controls/WorkItemControls.js";
|
|
6
6
|
import { detailPath as s } from "../utils/rowNavigation.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { refusalMessage as c } from "./refusal.js";
|
|
8
|
+
import { ARCHIVE_PRODUCT_LINE as l, ASSIGN_PRODUCT_LINE as u, CREATE_PRODUCT_LINE as d, DELETE_PRODUCT_LINE as f, PRODUCT_LINE_ASSIGNMENT as p, PRODUCT_LINE_CANDIDATE_PRODUCTS as m, PRODUCT_LINE_OPTIONS as h, PRODUCT_LINE_QUERIES as g, UNARCHIVE_PRODUCT_LINE as _, UPDATE_PRODUCT_LINE as v } from "./hierarchyOperations.js";
|
|
9
|
+
import { changedFields as y, normalizeText as b } from "./hierarchy.js";
|
|
10
10
|
import { useState as x } from "react";
|
|
11
11
|
import { Archive as S, ArchiveRestore as C, Pencil as w, Plus as T, Trash2 as E, X as D } from "lucide-react";
|
|
12
12
|
import { useMutation as O, useQuery as k } from "@apollo/client/react";
|
|
@@ -14,29 +14,29 @@ import { jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
|
14
14
|
import { Badge as M, Button as N, Checkbox as P, Input as F, ResponsiveDialog as I, ResponsiveDialogContent as L, ResponsiveDialogDescription as R, ResponsiveDialogFooter as z, ResponsiveDialogHeader as B, ResponsiveDialogTitle as V, ResponsiveDialogTrigger as H } from "@burdenoff/fe-libs/ui";
|
|
15
15
|
//#region src/planmagnet/product/ProductLineControls.tsx
|
|
16
16
|
var U = "mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm min-h-[72px]", W = "w-full rounded-md border border-input bg-background px-3 py-2 text-sm disabled:opacity-60", G = {
|
|
17
|
-
refetchQueries:
|
|
17
|
+
refetchQueries: g,
|
|
18
18
|
awaitRefetchQueries: !0
|
|
19
19
|
};
|
|
20
20
|
function K() {
|
|
21
21
|
return n()("planmagnet.productLines.errors.forbidden", "Your role cannot change product lines in this workspace.");
|
|
22
22
|
}
|
|
23
23
|
function q({ line: t }) {
|
|
24
|
-
let i = n(), s = K(), { currentUser:
|
|
24
|
+
let i = n(), s = K(), { currentUser: l } = e(), u = {
|
|
25
25
|
name: t?.name ?? "",
|
|
26
26
|
description: t?.description ?? "",
|
|
27
|
-
ownerId: t ? t.ownerId ?? "" :
|
|
28
|
-
}, [
|
|
29
|
-
|
|
27
|
+
ownerId: t ? t.ownerId ?? "" : l?.id ?? ""
|
|
28
|
+
}, [f, p] = x(!1), [m, h] = x(u), [g, _] = x(null), [S, C] = O(d, G), [E, D] = O(v, G), k = C.loading || D.loading, M = m.name.trim() !== "" && !k, P = t ? `product-line-edit-${t.id}` : "product-line-new", W = async () => {
|
|
29
|
+
_(null);
|
|
30
30
|
let e = {
|
|
31
|
-
name:
|
|
32
|
-
description:
|
|
33
|
-
ownerId:
|
|
31
|
+
name: m.name.trim(),
|
|
32
|
+
description: b(m.description),
|
|
33
|
+
ownerId: m.ownerId || null
|
|
34
34
|
};
|
|
35
35
|
try {
|
|
36
36
|
if (t) {
|
|
37
|
-
let n =
|
|
37
|
+
let n = y({
|
|
38
38
|
name: t.name.trim(),
|
|
39
|
-
description:
|
|
39
|
+
description: b(t.description ?? ""),
|
|
40
40
|
ownerId: t.ownerId
|
|
41
41
|
}, e);
|
|
42
42
|
Object.keys(n).length > 0 && await r(E({ variables: {
|
|
@@ -48,15 +48,15 @@ function q({ line: t }) {
|
|
|
48
48
|
...e.description ? { description: e.description } : {},
|
|
49
49
|
...e.ownerId ? { ownerId: e.ownerId } : {}
|
|
50
50
|
} } }));
|
|
51
|
-
|
|
51
|
+
p(!1);
|
|
52
52
|
} catch (e) {
|
|
53
|
-
|
|
53
|
+
_(c(e, t ? i("planmagnet.productLines.errors.save", "The product line could not be saved.") : i("planmagnet.productLines.errors.create", "The product line could not be created."), s));
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
return /* @__PURE__ */ j(I, {
|
|
57
|
-
open:
|
|
57
|
+
open: f,
|
|
58
58
|
onOpenChange: (e) => {
|
|
59
|
-
|
|
59
|
+
p(e), e ? h(u) : _(null);
|
|
60
60
|
},
|
|
61
61
|
children: [/* @__PURE__ */ A(H, {
|
|
62
62
|
asChild: !0,
|
|
@@ -85,10 +85,10 @@ function q({ line: t }) {
|
|
|
85
85
|
}), /* @__PURE__ */ A(F, {
|
|
86
86
|
id: `${P}-name`,
|
|
87
87
|
className: "mt-1",
|
|
88
|
-
value:
|
|
88
|
+
value: m.name,
|
|
89
89
|
placeholder: i("planmagnet.productLines.fields.namePlaceholder", "e.g. Mobile apps"),
|
|
90
|
-
onChange: (e) =>
|
|
91
|
-
...
|
|
90
|
+
onChange: (e) => h({
|
|
91
|
+
...m,
|
|
92
92
|
name: e.target.value
|
|
93
93
|
}),
|
|
94
94
|
"data-testid": "product-line-name"
|
|
@@ -100,9 +100,9 @@ function q({ line: t }) {
|
|
|
100
100
|
}), /* @__PURE__ */ A("textarea", {
|
|
101
101
|
id: `${P}-description`,
|
|
102
102
|
className: U,
|
|
103
|
-
value:
|
|
104
|
-
onChange: (e) =>
|
|
105
|
-
...
|
|
103
|
+
value: m.description,
|
|
104
|
+
onChange: (e) => h({
|
|
105
|
+
...m,
|
|
106
106
|
description: e.target.value
|
|
107
107
|
}),
|
|
108
108
|
"data-testid": "product-line-description"
|
|
@@ -115,17 +115,17 @@ function q({ line: t }) {
|
|
|
115
115
|
className: "mt-1",
|
|
116
116
|
children: /* @__PURE__ */ A(o, {
|
|
117
117
|
id: `${P}-owner`,
|
|
118
|
-
value:
|
|
118
|
+
value: m.ownerId,
|
|
119
119
|
noneLabel: i("planmagnet.productLines.fields.noOwner", "No owner"),
|
|
120
|
-
onChange: (e) =>
|
|
121
|
-
...
|
|
120
|
+
onChange: (e) => h({
|
|
121
|
+
...m,
|
|
122
122
|
ownerId: e
|
|
123
123
|
})
|
|
124
124
|
})
|
|
125
125
|
})] })
|
|
126
126
|
]
|
|
127
127
|
}),
|
|
128
|
-
|
|
128
|
+
g && /* @__PURE__ */ A(a, { message: g }),
|
|
129
129
|
/* @__PURE__ */ A(z, { children: /* @__PURE__ */ A(N, {
|
|
130
130
|
onClick: () => void W(),
|
|
131
131
|
disabled: !M,
|
|
@@ -137,19 +137,19 @@ function q({ line: t }) {
|
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
function J({ line: e, productCount: t, onArchived: o, onDeleted: s }) {
|
|
140
|
-
let
|
|
140
|
+
let u = n(), d = K(), [p, m] = O(l, G), [h, g] = O(_, G), [v, y] = O(f, G), [b, w] = x(null), T = m.loading || g.loading || y.loading, D = async () => {
|
|
141
141
|
w(null);
|
|
142
142
|
try {
|
|
143
|
-
e.archivedAt ? await r(
|
|
143
|
+
e.archivedAt ? await r(h({ variables: { id: e.id } })) : (await r(p({ variables: { id: e.id } })), o?.(e.name));
|
|
144
144
|
} catch (e) {
|
|
145
|
-
w(
|
|
145
|
+
w(c(e, u("planmagnet.productLines.errors.update", "The product line could not be updated."), d));
|
|
146
146
|
}
|
|
147
147
|
}, k = async () => {
|
|
148
148
|
w(null);
|
|
149
149
|
try {
|
|
150
|
-
await r(
|
|
150
|
+
await r(v({ variables: { id: e.id } })), s?.(e.name);
|
|
151
151
|
} catch (e) {
|
|
152
|
-
w(
|
|
152
|
+
w(c(e, u("planmagnet.productLines.errors.delete", "The product line could not be deleted."), d));
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
155
|
return /* @__PURE__ */ j("div", {
|
|
@@ -164,36 +164,36 @@ function J({ line: e, productCount: t, onArchived: o, onDeleted: s }) {
|
|
|
164
164
|
disabled: T,
|
|
165
165
|
onClick: () => void D(),
|
|
166
166
|
"data-testid": "product-line-toggle-archive",
|
|
167
|
-
children: [e.archivedAt ? /* @__PURE__ */ A(C, { className: "mr-1 h-4 w-4" }) : /* @__PURE__ */ A(S, { className: "mr-1 h-4 w-4" }), e.archivedAt ?
|
|
167
|
+
children: [e.archivedAt ? /* @__PURE__ */ A(C, { className: "mr-1 h-4 w-4" }) : /* @__PURE__ */ A(S, { className: "mr-1 h-4 w-4" }), e.archivedAt ? u("planmagnet.productLines.actions.unarchive", "Unarchive") : u("planmagnet.productLines.actions.archive", "Archive")]
|
|
168
168
|
}),
|
|
169
169
|
/* @__PURE__ */ A(i, {
|
|
170
|
-
label:
|
|
170
|
+
label: u("planmagnet.productLines.actions.delete", "Delete"),
|
|
171
171
|
variant: "outline",
|
|
172
172
|
icon: /* @__PURE__ */ A(E, { className: "mr-1 h-4 w-4" }),
|
|
173
173
|
testId: "product-line-delete",
|
|
174
|
-
title:
|
|
175
|
-
description: t === 0 ?
|
|
176
|
-
confirmLabel:
|
|
174
|
+
title: u("planmagnet.productLines.confirmDelete.title", "Delete {{name}}?", { name: e.name }),
|
|
175
|
+
description: t === 0 ? u("planmagnet.productLines.confirmDelete.empty", "The line has no products. Nothing else changes. This cannot be undone here.") : u("planmagnet.productLines.confirmDelete.withProducts", "Its {{count}} product(s) are kept — they are only taken out of this line and show under \"No product line\". Nothing else about them changes. This cannot be undone here.", { count: t }),
|
|
176
|
+
confirmLabel: u("planmagnet.productLines.confirmDelete.confirm", "Delete product line"),
|
|
177
177
|
destructive: !0,
|
|
178
178
|
disabled: T,
|
|
179
179
|
onConfirm: () => void k()
|
|
180
180
|
})
|
|
181
181
|
]
|
|
182
|
-
}),
|
|
182
|
+
}), b && /* @__PURE__ */ A(a, { message: b })]
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
185
|
function Y({ line: e, products: i }) {
|
|
186
|
-
let o = n(),
|
|
187
|
-
|
|
186
|
+
let o = n(), l = K(), d = t(), [f, p] = O(u, G), [m, h] = x(null), [g, _] = x(null), v = async (e) => {
|
|
187
|
+
_(null), h(e);
|
|
188
188
|
try {
|
|
189
|
-
await r(
|
|
189
|
+
await r(f({ variables: {
|
|
190
190
|
productId: e,
|
|
191
191
|
productLineId: null
|
|
192
192
|
} }));
|
|
193
193
|
} catch (e) {
|
|
194
|
-
|
|
194
|
+
_(c(e, o("planmagnet.productLines.errors.unassign", "The product could not be taken out of the line."), l));
|
|
195
195
|
} finally {
|
|
196
|
-
|
|
196
|
+
h(null);
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
199
|
return /* @__PURE__ */ j("div", {
|
|
@@ -220,7 +220,7 @@ function Y({ line: e, products: i }) {
|
|
|
220
220
|
children: [/* @__PURE__ */ A("button", {
|
|
221
221
|
type: "button",
|
|
222
222
|
className: "min-w-0 truncate text-left hover:underline",
|
|
223
|
-
onClick: () =>
|
|
223
|
+
onClick: () => d(s("/products/product-detail-page", e.id)),
|
|
224
224
|
children: e.name
|
|
225
225
|
}), /* @__PURE__ */ j("div", {
|
|
226
226
|
className: "flex shrink-0 items-center gap-2",
|
|
@@ -232,43 +232,43 @@ function Y({ line: e, products: i }) {
|
|
|
232
232
|
size: "sm",
|
|
233
233
|
variant: "ghost",
|
|
234
234
|
"aria-label": o("planmagnet.productLines.products.removeNamed", "Take {{name}} out of this line", { name: e.name }),
|
|
235
|
-
disabled:
|
|
236
|
-
onClick: () => void
|
|
235
|
+
disabled: p.loading,
|
|
236
|
+
onClick: () => void v(e.id),
|
|
237
237
|
"data-testid": "product-line-product-remove",
|
|
238
|
-
children:
|
|
238
|
+
children: m === e.id ? "…" : /* @__PURE__ */ A(D, { className: "h-4 w-4" })
|
|
239
239
|
})]
|
|
240
240
|
})]
|
|
241
241
|
}, e.id))
|
|
242
242
|
}),
|
|
243
|
-
|
|
243
|
+
g && /* @__PURE__ */ A(a, { message: g })
|
|
244
244
|
]
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
247
|
function X({ line: t, existingIds: i }) {
|
|
248
|
-
let o = n(), s = K(), { workspaceId:
|
|
249
|
-
variables: { workspaceId:
|
|
250
|
-
skip: !
|
|
251
|
-
}), [S, C] = O(
|
|
248
|
+
let o = n(), s = K(), { workspaceId: l } = e(), [d, f] = x(!1), [p, h] = x(/* @__PURE__ */ new Set()), [g, _] = x(null), { data: v, loading: y, error: b } = k(m, {
|
|
249
|
+
variables: { workspaceId: l ?? "" },
|
|
250
|
+
skip: !d || !l
|
|
251
|
+
}), [S, C] = O(u, G), w = v?.planmagnetProducts.items ?? [], E = w.filter((e) => !i.includes(e.id)), D = v?.planmagnetProducts.totalCount ?? 0, F = (e, t) => h((n) => {
|
|
252
252
|
let r = new Set(n);
|
|
253
253
|
return t ? r.add(e) : r.delete(e), r;
|
|
254
254
|
}), U = async () => {
|
|
255
|
-
|
|
255
|
+
_(null);
|
|
256
256
|
try {
|
|
257
|
-
await Promise.all([...
|
|
257
|
+
await Promise.all([...p].map((e) => r(S({ variables: {
|
|
258
258
|
productId: e,
|
|
259
259
|
productLineId: t.id
|
|
260
|
-
} })))),
|
|
260
|
+
} })))), h(/* @__PURE__ */ new Set()), f(!1);
|
|
261
261
|
} catch (e) {
|
|
262
|
-
|
|
262
|
+
_(c(e, o("planmagnet.productLines.errors.assign", "The products could not be added."), s));
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
265
|
return t.archivedAt ? /* @__PURE__ */ A("span", {
|
|
266
266
|
className: "text-xs text-muted-foreground",
|
|
267
267
|
children: o("planmagnet.productLines.products.archivedNoAdd", "Unarchive to add products")
|
|
268
268
|
}) : /* @__PURE__ */ j(I, {
|
|
269
|
-
open:
|
|
269
|
+
open: d,
|
|
270
270
|
onOpenChange: (e) => {
|
|
271
|
-
|
|
271
|
+
f(e), e || (h(/* @__PURE__ */ new Set()), _(null));
|
|
272
272
|
},
|
|
273
273
|
children: [/* @__PURE__ */ A(H, {
|
|
274
274
|
asChild: !0,
|
|
@@ -286,12 +286,12 @@ function X({ line: t, existingIds: i }) {
|
|
|
286
286
|
className: "max-h-80 space-y-1 overflow-y-auto",
|
|
287
287
|
"data-testid": "product-line-add-candidates",
|
|
288
288
|
children: [
|
|
289
|
-
|
|
289
|
+
y && !v && /* @__PURE__ */ A("p", {
|
|
290
290
|
className: "py-4 text-center text-sm text-muted-foreground",
|
|
291
291
|
children: o("planmagnet.productLines.loading", "Loading…")
|
|
292
292
|
}),
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
b && /* @__PURE__ */ A(a, { message: b.message }),
|
|
294
|
+
v && E.length === 0 && /* @__PURE__ */ A("p", {
|
|
295
295
|
className: "py-4 text-center text-sm text-muted-foreground",
|
|
296
296
|
children: w.length === 0 ? o("planmagnet.productLines.products.noProducts", "No products yet.") : o("planmagnet.productLines.products.noCandidates", "Every product is already in this line.")
|
|
297
297
|
}),
|
|
@@ -303,7 +303,7 @@ function X({ line: t, existingIds: i }) {
|
|
|
303
303
|
children: [
|
|
304
304
|
/* @__PURE__ */ A(P, {
|
|
305
305
|
id: n,
|
|
306
|
-
checked:
|
|
306
|
+
checked: p.has(e.id),
|
|
307
307
|
onCheckedChange: (t) => F(e.id, t === !0)
|
|
308
308
|
}),
|
|
309
309
|
/* @__PURE__ */ A("span", {
|
|
@@ -331,38 +331,38 @@ function X({ line: t, existingIds: i }) {
|
|
|
331
331
|
})
|
|
332
332
|
]
|
|
333
333
|
}),
|
|
334
|
-
|
|
334
|
+
g && /* @__PURE__ */ A(a, { message: g }),
|
|
335
335
|
/* @__PURE__ */ A(z, { children: /* @__PURE__ */ A(N, {
|
|
336
336
|
onClick: () => void U(),
|
|
337
|
-
disabled:
|
|
337
|
+
disabled: p.size === 0 || C.loading,
|
|
338
338
|
"data-testid": "product-line-add-confirm",
|
|
339
|
-
children: C.loading ? o("planmagnet.productLines.actions.adding", "Adding…") : o("planmagnet.productLines.products.addCount", "Add {{count}} product(s)", { count:
|
|
339
|
+
children: C.loading ? o("planmagnet.productLines.actions.adding", "Adding…") : o("planmagnet.productLines.products.addCount", "Add {{count}} product(s)", { count: p.size })
|
|
340
340
|
}) })
|
|
341
341
|
]
|
|
342
342
|
})]
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
345
|
function Z({ productId: i }) {
|
|
346
|
-
let o = n(), s = K(), { workspaceId:
|
|
346
|
+
let o = n(), s = K(), { workspaceId: l } = e(), d = t(), f = k(p, {
|
|
347
347
|
variables: { productId: i },
|
|
348
348
|
skip: !i
|
|
349
|
-
}),
|
|
350
|
-
variables: { workspaceId:
|
|
351
|
-
skip: !
|
|
352
|
-
}), [
|
|
353
|
-
if (e !== (
|
|
354
|
-
|
|
349
|
+
}), m = k(h, {
|
|
350
|
+
variables: { workspaceId: l ?? "" },
|
|
351
|
+
skip: !l
|
|
352
|
+
}), [g, _] = O(u, G), [v, y] = x(null), b = f.data?.planmagnetProduct?.productLine ?? null, S = m.data?.planmagnetProductLines.items ?? [], C = !!b && S.some((e) => e.id === b.id), w = async (e) => {
|
|
353
|
+
if (e !== (b?.id ?? "")) {
|
|
354
|
+
y(null);
|
|
355
355
|
try {
|
|
356
|
-
await r(
|
|
356
|
+
await r(g({ variables: {
|
|
357
357
|
productId: i,
|
|
358
358
|
productLineId: e || null
|
|
359
359
|
} }));
|
|
360
360
|
} catch (e) {
|
|
361
|
-
|
|
361
|
+
y(c(e, o("planmagnet.productLines.errors.assignOne", "The product line could not be changed."), s));
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
};
|
|
365
|
-
return
|
|
365
|
+
return f.error ? /* @__PURE__ */ A(a, { message: o("planmagnet.productLines.errors.loadAssignment", "The product line could not be loaded: {{message}}", { message: f.error.message }) }) : /* @__PURE__ */ j("div", {
|
|
366
366
|
className: "space-y-2",
|
|
367
367
|
"data-testid": "product-line-picker",
|
|
368
368
|
children: [
|
|
@@ -374,18 +374,18 @@ function Z({ productId: i }) {
|
|
|
374
374
|
/* @__PURE__ */ j("select", {
|
|
375
375
|
id: "product-line-select",
|
|
376
376
|
className: W,
|
|
377
|
-
value:
|
|
378
|
-
disabled:
|
|
377
|
+
value: b?.id ?? "",
|
|
378
|
+
disabled: _.loading || f.loading && !f.data,
|
|
379
379
|
onChange: (e) => void w(e.target.value),
|
|
380
380
|
children: [
|
|
381
381
|
/* @__PURE__ */ A("option", {
|
|
382
382
|
value: "",
|
|
383
383
|
children: o("planmagnet.productLines.picker.none", "No product line")
|
|
384
384
|
}),
|
|
385
|
-
|
|
386
|
-
value:
|
|
385
|
+
b && !C && /* @__PURE__ */ A("option", {
|
|
386
|
+
value: b.id,
|
|
387
387
|
disabled: !0,
|
|
388
|
-
children:
|
|
388
|
+
children: b.archivedAt ? o("planmagnet.productLines.picker.archivedOption", "{{name}} (archived)", { name: b.name }) : b.name
|
|
389
389
|
}),
|
|
390
390
|
S.map((e) => /* @__PURE__ */ A("option", {
|
|
391
391
|
value: e.id,
|
|
@@ -393,8 +393,8 @@ function Z({ productId: i }) {
|
|
|
393
393
|
}, e.id))
|
|
394
394
|
]
|
|
395
395
|
}),
|
|
396
|
-
|
|
397
|
-
|
|
396
|
+
m.error && /* @__PURE__ */ A(a, { message: m.error.message }),
|
|
397
|
+
v && /* @__PURE__ */ A(a, { message: v }),
|
|
398
398
|
/* @__PURE__ */ j("p", {
|
|
399
399
|
className: "text-xs text-muted-foreground",
|
|
400
400
|
children: [
|
|
@@ -403,7 +403,7 @@ function Z({ productId: i }) {
|
|
|
403
403
|
/* @__PURE__ */ A("button", {
|
|
404
404
|
type: "button",
|
|
405
405
|
className: "text-primary hover:underline",
|
|
406
|
-
onClick: () =>
|
|
406
|
+
onClick: () => d("/products/product-lines-page"),
|
|
407
407
|
children: o("planmagnet.productLines.picker.manage", "Manage product lines")
|
|
408
408
|
})
|
|
409
409
|
]
|