@burdenoff/microfe-planmagnet 2026.930.20 → 2026.930.22
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/node_modules/lodash/_arrayEach.js +14 -0
- package/dist/node_modules/lodash/_arrayEach.js.map +1 -0
- package/dist/node_modules/lodash/_assignValue.js +17 -0
- package/dist/node_modules/lodash/_assignValue.js.map +1 -0
- package/dist/node_modules/lodash/_baseAssign.js +16 -0
- package/dist/node_modules/lodash/_baseAssign.js.map +1 -0
- package/dist/node_modules/lodash/_baseAssignIn.js +16 -0
- package/dist/node_modules/lodash/_baseAssignIn.js.map +1 -0
- package/dist/node_modules/lodash/_baseClone.js +64 -0
- package/dist/node_modules/lodash/_baseClone.js.map +1 -0
- package/dist/node_modules/lodash/_baseCreate.js +21 -0
- package/dist/node_modules/lodash/_baseCreate.js.map +1 -0
- package/dist/node_modules/lodash/_baseIsMap.js +16 -0
- package/dist/node_modules/lodash/_baseIsMap.js.map +1 -0
- package/dist/node_modules/lodash/_baseIsSet.js +16 -0
- package/dist/node_modules/lodash/_baseIsSet.js.map +1 -0
- package/dist/node_modules/lodash/_baseKeysIn.js +20 -0
- package/dist/node_modules/lodash/_baseKeysIn.js.map +1 -0
- package/dist/node_modules/lodash/_baseSum.js +17 -0
- package/dist/node_modules/lodash/_baseSum.js.map +1 -0
- package/dist/node_modules/lodash/_baseUnset.js +26 -0
- package/dist/node_modules/lodash/_baseUnset.js.map +1 -0
- package/dist/node_modules/lodash/_cloneArrayBuffer.js +16 -0
- package/dist/node_modules/lodash/_cloneArrayBuffer.js.map +1 -0
- package/dist/node_modules/lodash/_cloneBuffer.js +17 -0
- package/dist/node_modules/lodash/_cloneBuffer.js.map +1 -0
- package/dist/node_modules/lodash/_cloneDataView.js +16 -0
- package/dist/node_modules/lodash/_cloneDataView.js.map +1 -0
- package/dist/node_modules/lodash/_cloneRegExp.js +15 -0
- package/dist/node_modules/lodash/_cloneRegExp.js.map +1 -0
- package/dist/node_modules/lodash/_cloneSymbol.js +15 -0
- package/dist/node_modules/lodash/_cloneSymbol.js.map +1 -0
- package/dist/node_modules/lodash/_cloneTypedArray.js +16 -0
- package/dist/node_modules/lodash/_cloneTypedArray.js.map +1 -0
- package/dist/node_modules/lodash/_copyArray.js +15 -0
- package/dist/node_modules/lodash/_copyArray.js.map +1 -0
- package/dist/node_modules/lodash/_copyObject.js +22 -0
- package/dist/node_modules/lodash/_copyObject.js.map +1 -0
- package/dist/node_modules/lodash/_copySymbols.js +16 -0
- package/dist/node_modules/lodash/_copySymbols.js.map +1 -0
- package/dist/node_modules/lodash/_copySymbolsIn.js +16 -0
- package/dist/node_modules/lodash/_copySymbolsIn.js.map +1 -0
- package/dist/node_modules/lodash/_customOmitClone.js +15 -0
- package/dist/node_modules/lodash/_customOmitClone.js.map +1 -0
- package/dist/node_modules/lodash/_flatRest.js +17 -0
- package/dist/node_modules/lodash/_flatRest.js.map +1 -0
- package/dist/node_modules/lodash/_getAllKeysIn.js +17 -0
- package/dist/node_modules/lodash/_getAllKeysIn.js.map +1 -0
- package/dist/node_modules/lodash/_getSymbolsIn.js +18 -0
- package/dist/node_modules/lodash/_getSymbolsIn.js.map +1 -0
- package/dist/node_modules/lodash/_initCloneArray.js +15 -0
- package/dist/node_modules/lodash/_initCloneArray.js.map +1 -0
- package/dist/node_modules/lodash/_initCloneByTag.js +40 -0
- package/dist/node_modules/lodash/_initCloneByTag.js.map +1 -0
- package/dist/node_modules/lodash/_initCloneObject.js +17 -0
- package/dist/node_modules/lodash/_initCloneObject.js.map +1 -0
- package/dist/node_modules/lodash/_nativeKeysIn.js +15 -0
- package/dist/node_modules/lodash/_nativeKeysIn.js.map +1 -0
- package/dist/node_modules/lodash/_parent.js +16 -0
- package/dist/node_modules/lodash/_parent.js.map +1 -0
- package/dist/node_modules/lodash/flatten.js +15 -0
- package/dist/node_modules/lodash/flatten.js.map +1 -0
- package/dist/node_modules/lodash/isMap.js +14 -0
- package/dist/node_modules/lodash/isMap.js.map +1 -0
- package/dist/node_modules/lodash/isSet.js +14 -0
- package/dist/node_modules/lodash/isSet.js.map +1 -0
- package/dist/node_modules/lodash/keysIn.js +17 -0
- package/dist/node_modules/lodash/keysIn.js.map +1 -0
- package/dist/node_modules/lodash/maxBy.js +17 -0
- package/dist/node_modules/lodash/maxBy.js.map +1 -0
- package/dist/node_modules/lodash/omit.js +28 -0
- package/dist/node_modules/lodash/omit.js.map +1 -0
- package/dist/node_modules/lodash/sumBy.js +16 -0
- package/dist/node_modules/lodash/sumBy.js.map +1 -0
- package/dist/node_modules/recharts/es6/chart/Sankey.js +556 -0
- package/dist/node_modules/recharts/es6/chart/Sankey.js.map +1 -0
- package/dist/node_modules/recharts/es6/chart/Treemap.js +545 -0
- package/dist/node_modules/recharts/es6/chart/Treemap.js.map +1 -0
- package/dist/node_modules/recharts/es6/shape/Polygon.js +112 -0
- package/dist/node_modules/recharts/es6/shape/Polygon.js.map +1 -0
- package/dist/node_modules/recharts/es6/util/Constants.js +31 -0
- package/dist/node_modules/recharts/es6/util/Constants.js.map +1 -0
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +15 -10
- package/dist/node_modules/recharts/es6/util/ReactUtils.js.map +1 -1
- package/dist/planmagnet/automation/AutomationExecutionsPanel.d.ts.map +1 -1
- package/dist/planmagnet/automation/AutomationExecutionsPanel.js +43 -39
- package/dist/planmagnet/automation/AutomationExecutionsPanel.js.map +1 -1
- package/dist/planmagnet/automation/AutomationRuleFields.d.ts +23 -4
- package/dist/planmagnet/automation/AutomationRuleFields.d.ts.map +1 -1
- package/dist/planmagnet/automation/AutomationRuleFields.js +255 -108
- package/dist/planmagnet/automation/AutomationRuleFields.js.map +1 -1
- package/dist/planmagnet/automation/automationRuleTypes.d.ts +138 -15
- package/dist/planmagnet/automation/automationRuleTypes.d.ts.map +1 -1
- package/dist/planmagnet/automation/automationRuleTypes.js +162 -22
- package/dist/planmagnet/automation/automationRuleTypes.js.map +1 -1
- package/dist/planmagnet/controls/AutomationRuleControls.d.ts.map +1 -1
- package/dist/planmagnet/controls/AutomationRuleControls.js +78 -73
- package/dist/planmagnet/controls/AutomationRuleControls.js.map +1 -1
- package/dist/planmagnet/controls/CompetitorControls.js +7 -7
- package/dist/planmagnet/controls/FeatureControls.js +38 -38
- package/dist/planmagnet/controls/ProgramControls.js +8 -8
- package/dist/planmagnet/dependency/DependencyGraph.js +9 -9
- package/dist/planmagnet/dependency/DependencyPanel.js +13 -13
- package/dist/planmagnet/pages/ActivityActivityPagePage.js +16 -16
- package/dist/planmagnet/pages/ActivityActivityPagePage.js.map +1 -1
- package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.js +91 -73
- package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/AutomationAutomationRuleDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/AutomationAutomationRuleDetailPagePage.js +85 -76
- package/dist/planmagnet/pages/AutomationAutomationRuleDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/AutomationAutomationRulesPagePage.js +18 -18
- package/dist/planmagnet/pages/AutomationAutomationRulesPagePage.js.map +1 -1
- package/dist/planmagnet/pages/AutomationCreateAutomationRulePagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/AutomationCreateAutomationRulePagePage.js +49 -45
- package/dist/planmagnet/pages/AutomationCreateAutomationRulePagePage.js.map +1 -1
- package/dist/planmagnet/pages/DashboardDashboardPagePage.js +11 -11
- package/dist/planmagnet/pages/DashboardsProjectManagerPagePage.js +5 -5
- package/dist/planmagnet/pages/DashboardsTeamUtilizationPagePage.js +5 -5
- package/dist/planmagnet/pages/IntegrationsNewSyncPagePage.js +6 -6
- package/dist/planmagnet/pages/IntegrationsNewSyncPagePage.js.map +1 -1
- package/dist/planmagnet/pages/IntegrationsSyncsPagePage.js +8 -8
- package/dist/planmagnet/pages/ProjectsBudgetsPagePage.js +10 -10
- package/dist/planmagnet/pages/ProjectsCriticalPathPagePage.js +6 -6
- package/dist/planmagnet/pages/ProjectsEditProjectPagePage.js +5 -5
- package/dist/planmagnet/pages/ProjectsPlanningPagePage.js +8 -8
- package/dist/planmagnet/pages/SprintsStartSprintPagePage.js +4 -4
- package/dist/planmagnet/pages/analytics/StatusFlowCard.d.ts +8 -0
- package/dist/planmagnet/pages/analytics/StatusFlowCard.d.ts.map +1 -0
- package/dist/planmagnet/pages/analytics/StatusFlowCard.js +231 -0
- package/dist/planmagnet/pages/analytics/StatusFlowCard.js.map +1 -0
- package/dist/planmagnet/pages/analytics/WorkBreakdownCard.d.ts +6 -0
- package/dist/planmagnet/pages/analytics/WorkBreakdownCard.d.ts.map +1 -0
- package/dist/planmagnet/pages/analytics/WorkBreakdownCard.js +364 -0
- package/dist/planmagnet/pages/analytics/WorkBreakdownCard.js.map +1 -0
- package/dist/planmagnet/people/People.d.ts.map +1 -1
- package/dist/planmagnet/people/People.js +30 -17
- package/dist/planmagnet/people/People.js.map +1 -1
- package/dist/planmagnet/roadmaps/RoadmapControls.js +17 -17
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { usePlanMagnet as e, usePlanMagnetNavigate as t } from "../providers/PlanMagnetProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { ROW_LINK_CLASS as n, detailPath as r, rowLinkProps as i, stopRowActivation as a } from "../utils/rowNavigation.js";
|
|
3
|
+
import { ProjectSelect as o } from "../controls/Pickers.js";
|
|
4
|
+
import { RULE_STATUSES as s, TRIGGER_TYPES as c, TRIGGER_TYPE_LABEL as l, triggerTypeLabel as u } from "../automation/automationRuleTypes.js";
|
|
5
|
+
import { AutomationRuleDeleteButton as d, AutomationRuleStatusSwitch as f } from "../controls/AutomationRuleControls.js";
|
|
6
6
|
import { useDeferredValue as p, useState as m } from "react";
|
|
7
7
|
import { Bot as h, Plus as g, Search as _ } from "lucide-react";
|
|
8
8
|
import { gql as v } from "@apollo/client";
|
|
@@ -39,23 +39,23 @@ var E = 50, D = v`
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
`, O = ["ALL", ...
|
|
42
|
+
`, O = ["ALL", ...s];
|
|
43
43
|
function k(e) {
|
|
44
44
|
return Array.isArray(e) ? e.length : 0;
|
|
45
45
|
}
|
|
46
46
|
function A() {
|
|
47
|
-
let { workspaceId:
|
|
47
|
+
let { workspaceId: s } = e(), v = t(), [A, j] = m(""), [M, N] = m("ALL"), [P, F] = m("ALL"), [I, L] = m(""), [R, z] = m(!1), B = p(A.trim()), V = {
|
|
48
48
|
...B ? { search: B } : {},
|
|
49
49
|
...M === "ALL" ? {} : { status: M },
|
|
50
50
|
...P === "ALL" ? {} : { triggerType: P },
|
|
51
51
|
...I ? { projectId: I } : {}
|
|
52
52
|
}, { data: H, loading: U, error: W, fetchMore: G } = y(D, {
|
|
53
53
|
variables: {
|
|
54
|
-
workspaceId:
|
|
54
|
+
workspaceId: s ?? "",
|
|
55
55
|
filter: V,
|
|
56
56
|
pagination: { first: E }
|
|
57
57
|
},
|
|
58
|
-
skip: !
|
|
58
|
+
skip: !s,
|
|
59
59
|
fetchPolicy: "cache-and-network"
|
|
60
60
|
}), K = H?.planmagnetAutomationRules, q = K?.items ?? [], J = async () => {
|
|
61
61
|
let e = K?.pageInfo.endCursor;
|
|
@@ -117,14 +117,14 @@ function A() {
|
|
|
117
117
|
children: [/* @__PURE__ */ b("option", {
|
|
118
118
|
value: "ALL",
|
|
119
119
|
children: "Any trigger"
|
|
120
|
-
}),
|
|
120
|
+
}), c.map((e) => /* @__PURE__ */ b("option", {
|
|
121
121
|
value: e,
|
|
122
|
-
children:
|
|
122
|
+
children: l[e]
|
|
123
123
|
}, e))]
|
|
124
124
|
}),
|
|
125
125
|
/* @__PURE__ */ b("div", {
|
|
126
126
|
className: "w-48",
|
|
127
|
-
children: /* @__PURE__ */ b(
|
|
127
|
+
children: /* @__PURE__ */ b(o, {
|
|
128
128
|
id: "automation-filter-project",
|
|
129
129
|
value: I,
|
|
130
130
|
onChange: L,
|
|
@@ -157,7 +157,7 @@ function A() {
|
|
|
157
157
|
K && q.length === 0 && /* @__PURE__ */ b(w, {
|
|
158
158
|
icon: /* @__PURE__ */ b(h, { className: "h-8 w-8 text-muted-foreground" }),
|
|
159
159
|
title: B || M !== "ALL" || P !== "ALL" || I ? "No rules match" : "No automation rules yet",
|
|
160
|
-
description: "Rules watch for an event
|
|
160
|
+
description: "Rules watch for an event — a work item, sprint, release or a daily schedule — and act automatically: assign, label, move status, or post a comment.",
|
|
161
161
|
action: B || M !== "ALL" || P !== "ALL" || I ? void 0 : /* @__PURE__ */ x(C, {
|
|
162
162
|
size: "sm",
|
|
163
163
|
onClick: () => v("/automation/create-automation-rule-page"),
|
|
@@ -167,9 +167,9 @@ function A() {
|
|
|
167
167
|
/* @__PURE__ */ b("ul", {
|
|
168
168
|
className: "space-y-2",
|
|
169
169
|
children: q.map((e) => /* @__PURE__ */ b("li", { children: /* @__PURE__ */ x("div", {
|
|
170
|
-
...
|
|
170
|
+
...i(() => v(r("/automation/automation-rule-detail-page", e.id)), e.name),
|
|
171
171
|
"data-testid": "automation-rule-row",
|
|
172
|
-
className: `flex flex-wrap items-center justify-between gap-3 rounded-md border p-3 ${
|
|
172
|
+
className: `flex flex-wrap items-center justify-between gap-3 rounded-md border p-3 ${n}`,
|
|
173
173
|
children: [/* @__PURE__ */ x("div", {
|
|
174
174
|
className: "min-w-0 flex-1",
|
|
175
175
|
children: [
|
|
@@ -180,7 +180,7 @@ function A() {
|
|
|
180
180
|
children: e.name
|
|
181
181
|
}), /* @__PURE__ */ b(S, {
|
|
182
182
|
variant: "outline",
|
|
183
|
-
children:
|
|
183
|
+
children: u(e.triggerType)
|
|
184
184
|
})]
|
|
185
185
|
}),
|
|
186
186
|
/* @__PURE__ */ x("p", {
|
|
@@ -205,11 +205,11 @@ function A() {
|
|
|
205
205
|
]
|
|
206
206
|
}), /* @__PURE__ */ x("div", {
|
|
207
207
|
className: "flex items-center gap-3",
|
|
208
|
-
onClick:
|
|
209
|
-
children: [/* @__PURE__ */ b(
|
|
208
|
+
onClick: a,
|
|
209
|
+
children: [/* @__PURE__ */ b(f, {
|
|
210
210
|
ruleId: e.id,
|
|
211
211
|
status: e.status
|
|
212
|
-
}), /* @__PURE__ */ b(
|
|
212
|
+
}), /* @__PURE__ */ b(d, {
|
|
213
213
|
ruleId: e.id,
|
|
214
214
|
name: e.name
|
|
215
215
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutomationAutomationRulesPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/AutomationAutomationRulesPagePage.tsx"],"sourcesContent":["import { useDeferredValue, useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Badge, Button, EmptyState, Input } from '@burdenoff/fe-libs/ui';\nimport { Bot, Plus, Search } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { ProjectSelect } from '../controls/Pickers';\nimport {\n AutomationRuleStatusSwitch,\n AutomationRuleDeleteButton,\n} from '../controls/AutomationRuleControls';\nimport {\n rowLinkProps,\n detailPath,\n stopRowActivation,\n ROW_LINK_CLASS,\n} from '../utils/rowNavigation';\nimport {\n RULE_STATUSES,\n TRIGGER_TYPES,\n TRIGGER_TYPE_LABEL,\n triggerTypeLabel,\n} from '../automation/automationRuleTypes';\n\n/**\n * Automation rules browse surface (BOFF-8047, capability register \"Automation rules\": model/API/authz were\n * already real and prod-verified — `planmagnetAutomationRules`/Create/Update/Delete/Toggle/Execute — gate 3\n * (UI) was the only gap; \"no UI anywhere\" until now.\n */\n\nconst PAGE = 50;\n\nconst RULES = gql`\n query AutomationRulesList(\n $workspaceId: ID!\n $filter: PlanmagnetAutomationRuleFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetAutomationRules(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n items {\n id\n name\n description\n status\n triggerType\n actions\n executionCount\n lastExecutedAt\n projectId\n project {\n id\n name\n }\n }\n }\n }\n`;\n\ninterface RuleRow {\n id: string;\n name: string;\n description: string | null;\n status: string;\n triggerType: string;\n actions: unknown;\n executionCount: number;\n lastExecutedAt: string | null;\n projectId: string | null;\n project: { id: string; name: string } | null;\n}\n\nconst STATUS_FILTERS = ['ALL', ...RULE_STATUSES] as const;\n\nfunction actionCount(actions: unknown): number {\n return Array.isArray(actions) ? actions.length : 0;\n}\n\nexport function AutomationAutomationRulesPagePage() {\n const { workspaceId } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n const [search, setSearch] = useState('');\n const [status, setStatus] = useState<(typeof STATUS_FILTERS)[number]>('ALL');\n const [triggerType, setTriggerType] = useState('ALL');\n const [projectId, setProjectId] = useState('');\n const [loadingMore, setLoadingMore] = useState(false);\n const term = useDeferredValue(search.trim());\n\n const filter = {\n ...(term ? { search: term } : {}),\n ...(status !== 'ALL' ? { status } : {}),\n ...(triggerType !== 'ALL' ? { triggerType } : {}),\n ...(projectId ? { projectId } : {}),\n };\n\n const { data, loading, error, fetchMore } = useQuery<{\n planmagnetAutomationRules: {\n totalCount: number;\n pageInfo: { hasNextPage: boolean; endCursor: string | null };\n items: RuleRow[];\n };\n }>(RULES, {\n variables: { workspaceId: workspaceId ?? '', filter, pagination: { first: PAGE } },\n skip: !workspaceId,\n fetchPolicy: 'cache-and-network',\n });\n\n const list = data?.planmagnetAutomationRules;\n const rules = list?.items ?? [];\n\n const loadMore = async () => {\n const after = list?.pageInfo.endCursor;\n if (!after) return;\n setLoadingMore(true);\n try {\n await fetchMore({\n variables: { pagination: { first: PAGE, after } },\n updateQuery: (prev, { fetchMoreResult }) => ({\n planmagnetAutomationRules: {\n ...fetchMoreResult.planmagnetAutomationRules,\n items: [\n ...prev.planmagnetAutomationRules.items,\n ...fetchMoreResult.planmagnetAutomationRules.items,\n ],\n },\n }),\n });\n } finally {\n setLoadingMore(false);\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\" data-testid=\"automation-rules-page\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Automation rules</h1>\n <p className=\"text-sm text-muted-foreground\">\n {list\n ? `${list.totalCount} rule${list.totalCount === 1 ? '' : 's'}`\n : 'Trigger, condition and action rules that run against work items'}\n </p>\n </div>\n <Button\n size=\"sm\"\n onClick={() => navigate('/automation/create-automation-rule-page')}\n data-testid=\"automation-new\"\n >\n <Plus className=\"mr-1 h-4 w-4\" />\n New rule\n </Button>\n </div>\n\n <div className=\"flex flex-wrap items-center gap-3\">\n <div className=\"relative w-full max-w-sm\">\n <Search className=\"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground\" />\n <Input\n aria-label=\"Search automation rules\"\n placeholder=\"Search by name or description\"\n className=\"pl-8\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n />\n </div>\n <select\n aria-label=\"Filter by trigger\"\n className=\"rounded-md border border-input bg-background px-2 py-1.5 text-sm\"\n value={triggerType}\n onChange={(e) => setTriggerType(e.target.value)}\n >\n <option value=\"ALL\">Any trigger</option>\n {TRIGGER_TYPES.map((t) => (\n <option key={t} value={t}>\n {TRIGGER_TYPE_LABEL[t]}\n </option>\n ))}\n </select>\n <div className=\"w-48\">\n <ProjectSelect\n id=\"automation-filter-project\"\n value={projectId}\n onChange={setProjectId}\n noneLabel=\"Any project\"\n />\n </div>\n </div>\n <div className=\"flex gap-1\" role=\"group\" aria-label=\"Filter by status\">\n {STATUS_FILTERS.map((s) => (\n <button\n key={s}\n type=\"button\"\n aria-pressed={status === s}\n onClick={() => setStatus(s)}\n className={`px-3 py-1.5 text-sm rounded-md capitalize ${status === s ? 'bg-primary text-primary-foreground' : 'text-muted-foreground hover:bg-muted'}`}\n >\n {s === 'ALL' ? 'All' : s.toLowerCase()}\n </button>\n ))}\n </div>\n\n {error && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n Automation rules could not be loaded: {error.message}\n </p>\n )}\n {loading && !data && (\n <p className=\"text-sm text-muted-foreground\">Loading automation rules…</p>\n )}\n {list && rules.length === 0 && (\n <EmptyState\n icon={<Bot className=\"h-8 w-8 text-muted-foreground\" />}\n title={\n term || status !== 'ALL' || triggerType !== 'ALL' || projectId\n ? 'No rules match'\n : 'No automation rules yet'\n }\n description=\"Rules watch for an event on a project's work items and act automatically — assign, label, or move status.\"\n action={\n !(term || status !== 'ALL' || triggerType !== 'ALL' || projectId) ? (\n <Button size=\"sm\" onClick={() => navigate('/automation/create-automation-rule-page')}>\n <Plus className=\"mr-1 h-4 w-4\" />\n New rule\n </Button>\n ) : undefined\n }\n />\n )}\n\n <ul className=\"space-y-2\">\n {rules.map((rule) => (\n <li key={rule.id}>\n <div\n {...rowLinkProps(\n () => navigate(detailPath('/automation/automation-rule-detail-page', rule.id)),\n rule.name\n )}\n data-testid=\"automation-rule-row\"\n className={`flex flex-wrap items-center justify-between gap-3 rounded-md border p-3 ${ROW_LINK_CLASS}`}\n >\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"truncate text-sm font-medium\">{rule.name}</span>\n <Badge variant=\"outline\">{triggerTypeLabel(rule.triggerType)}</Badge>\n </div>\n <p className=\"mt-0.5 truncate text-xs text-muted-foreground\">\n {rule.project?.name ?? 'Unknown project'} · {actionCount(rule.actions)} action\n {actionCount(rule.actions) === 1 ? '' : 's'} · run {rule.executionCount} time\n {rule.executionCount === 1 ? '' : 's'}\n {rule.lastExecutedAt\n ? ` · last ${new Date(rule.lastExecutedAt).toLocaleString()}`\n : ''}\n </p>\n {rule.description && (\n <p className=\"mt-0.5 truncate text-xs text-muted-foreground\">\n {rule.description}\n </p>\n )}\n </div>\n <div className=\"flex items-center gap-3\" onClick={stopRowActivation}>\n <AutomationRuleStatusSwitch ruleId={rule.id} status={rule.status} />\n <AutomationRuleDeleteButton ruleId={rule.id} name={rule.name} />\n </div>\n </div>\n </li>\n ))}\n </ul>\n {list?.pageInfo.hasNextPage && (\n <Button size=\"sm\" variant=\"outline\" onClick={() => void loadMore()} disabled={loadingMore}>\n {loadingMore ? 'Loading…' : `Show more (${rules.length} of ${list.totalCount})`}\n </Button>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA8BA,IAAM,IAAO,IAEP,IAAQ,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CX,IAAiB,CAAC,OAAO,GAAG,EAAc;AAEhD,SAAS,EAAY,GAA0B;AAC7C,QAAO,MAAM,QAAQ,EAAQ,GAAG,EAAQ,SAAS;;AAGnD,SAAgB,IAAoC;CAClD,IAAM,EAAE,mBAAgB,GAAe,EACjC,IAAW,GAAuB,EAClC,CAAC,GAAQ,KAAa,EAAS,GAAG,EAClC,CAAC,GAAQ,KAAa,EAA0C,MAAM,EACtE,CAAC,GAAa,KAAkB,EAAS,MAAM,EAC/C,CAAC,GAAW,KAAgB,EAAS,GAAG,EACxC,CAAC,GAAa,KAAkB,EAAS,GAAM,EAC/C,IAAO,EAAiB,EAAO,MAAM,CAAC,EAEtC,IAAS;EACb,GAAI,IAAO,EAAE,QAAQ,GAAM,GAAG,EAAE;EAChC,GAAI,MAAW,QAAqB,EAAE,GAAf,EAAE,WAAQ;EACjC,GAAI,MAAgB,QAA0B,EAAE,GAApB,EAAE,gBAAa;EAC3C,GAAI,IAAY,EAAE,cAAW,GAAG,EAAE;EACnC,EAEK,EAAE,SAAM,YAAS,UAAO,iBAAc,EAMzC,GAAO;EACR,WAAW;GAAE,aAAa,KAAe;GAAI;GAAQ,YAAY,EAAE,OAAO,GAAM;GAAE;EAClF,MAAM,CAAC;EACP,aAAa;EACd,CAAC,EAEI,IAAO,GAAM,2BACb,IAAQ,GAAM,SAAS,EAAE,EAEzB,IAAW,YAAY;EAC3B,IAAM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EACjE,kBAAC,GAAD;SAAO,SAAQ;mBAAW,EAAiB,EAAK,YAAY;SAAS,CAAA,CACjE;;OACN,kBAAC,KAAD;QAAG,WAAU;kBAAb;SACG,EAAK,SAAS,QAAQ;SAAkB;SAAI,EAAY,EAAK,QAAQ;SAAC;SACtE,EAAY,EAAK,QAAQ,KAAK,IAAI,KAAK;SAAI;SAAQ,EAAK;SAAe;SACvE,EAAK,mBAAmB,IAAI,KAAK;SACjC,EAAK,iBACF,WAAW,IAAI,KAAK,EAAK,eAAe,CAAC,gBAAgB,KACzD;SACF;;OACH,EAAK,eACJ,kBAAC,KAAD;QAAG,WAAU;kBACV,EAAK;QACJ,CAAA;OAEF;SACN,kBAAC,OAAD;MAAK,WAAU;MAA0B,SAAS;gBAAlD,CACE,kBAAC,GAAD;OAA4B,QAAQ,EAAK;OAAI,QAAQ,EAAK;OAAU,CAAA,EACpE,kBAAC,GAAD;OAA4B,QAAQ,EAAK;OAAI,MAAM,EAAK;OAAQ,CAAA,CAC5D;QACF;QACH,EAjCI,EAAK,GAiCT,CACL;IACC,CAAA;GACJ,GAAM,SAAS,eACd,kBAAC,GAAD;IAAQ,MAAK;IAAK,SAAQ;IAAU,eAAe,KAAK,GAAU;IAAE,UAAU;cAC3E,IAAc,aAAa,cAAc,EAAM,OAAO,MAAM,EAAK,WAAW;IACtE,CAAA;GAEP"}
|
|
1
|
+
{"version":3,"file":"AutomationAutomationRulesPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/AutomationAutomationRulesPagePage.tsx"],"sourcesContent":["import { useDeferredValue, useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Badge, Button, EmptyState, Input } from '@burdenoff/fe-libs/ui';\nimport { Bot, Plus, Search } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { ProjectSelect } from '../controls/Pickers';\nimport {\n AutomationRuleStatusSwitch,\n AutomationRuleDeleteButton,\n} from '../controls/AutomationRuleControls';\nimport {\n rowLinkProps,\n detailPath,\n stopRowActivation,\n ROW_LINK_CLASS,\n} from '../utils/rowNavigation';\nimport {\n RULE_STATUSES,\n TRIGGER_TYPES,\n TRIGGER_TYPE_LABEL,\n triggerTypeLabel,\n} from '../automation/automationRuleTypes';\n\n/**\n * Automation rules browse surface (BOFF-8047, capability register \"Automation rules\": model/API/authz were\n * already real and prod-verified — `planmagnetAutomationRules`/Create/Update/Delete/Toggle/Execute — gate 3\n * (UI) was the only gap; \"no UI anywhere\" until now.\n */\n\nconst PAGE = 50;\n\nconst RULES = gql`\n query AutomationRulesList(\n $workspaceId: ID!\n $filter: PlanmagnetAutomationRuleFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetAutomationRules(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n items {\n id\n name\n description\n status\n triggerType\n actions\n executionCount\n lastExecutedAt\n projectId\n project {\n id\n name\n }\n }\n }\n }\n`;\n\ninterface RuleRow {\n id: string;\n name: string;\n description: string | null;\n status: string;\n triggerType: string;\n actions: unknown;\n executionCount: number;\n lastExecutedAt: string | null;\n projectId: string | null;\n project: { id: string; name: string } | null;\n}\n\nconst STATUS_FILTERS = ['ALL', ...RULE_STATUSES] as const;\n\nfunction actionCount(actions: unknown): number {\n return Array.isArray(actions) ? actions.length : 0;\n}\n\nexport function AutomationAutomationRulesPagePage() {\n const { workspaceId } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n const [search, setSearch] = useState('');\n const [status, setStatus] = useState<(typeof STATUS_FILTERS)[number]>('ALL');\n const [triggerType, setTriggerType] = useState('ALL');\n const [projectId, setProjectId] = useState('');\n const [loadingMore, setLoadingMore] = useState(false);\n const term = useDeferredValue(search.trim());\n\n const filter = {\n ...(term ? { search: term } : {}),\n ...(status !== 'ALL' ? { status } : {}),\n ...(triggerType !== 'ALL' ? { triggerType } : {}),\n ...(projectId ? { projectId } : {}),\n };\n\n const { data, loading, error, fetchMore } = useQuery<{\n planmagnetAutomationRules: {\n totalCount: number;\n pageInfo: { hasNextPage: boolean; endCursor: string | null };\n items: RuleRow[];\n };\n }>(RULES, {\n variables: { workspaceId: workspaceId ?? '', filter, pagination: { first: PAGE } },\n skip: !workspaceId,\n fetchPolicy: 'cache-and-network',\n });\n\n const list = data?.planmagnetAutomationRules;\n const rules = list?.items ?? [];\n\n const loadMore = async () => {\n const after = list?.pageInfo.endCursor;\n if (!after) return;\n setLoadingMore(true);\n try {\n await fetchMore({\n variables: { pagination: { first: PAGE, after } },\n updateQuery: (prev, { fetchMoreResult }) => ({\n planmagnetAutomationRules: {\n ...fetchMoreResult.planmagnetAutomationRules,\n items: [\n ...prev.planmagnetAutomationRules.items,\n ...fetchMoreResult.planmagnetAutomationRules.items,\n ],\n },\n }),\n });\n } finally {\n setLoadingMore(false);\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\" data-testid=\"automation-rules-page\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Automation rules</h1>\n <p className=\"text-sm text-muted-foreground\">\n {list\n ? `${list.totalCount} rule${list.totalCount === 1 ? '' : 's'}`\n : 'Trigger, condition and action rules that run against work items'}\n </p>\n </div>\n <Button\n size=\"sm\"\n onClick={() => navigate('/automation/create-automation-rule-page')}\n data-testid=\"automation-new\"\n >\n <Plus className=\"mr-1 h-4 w-4\" />\n New rule\n </Button>\n </div>\n\n <div className=\"flex flex-wrap items-center gap-3\">\n <div className=\"relative w-full max-w-sm\">\n <Search className=\"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground\" />\n <Input\n aria-label=\"Search automation rules\"\n placeholder=\"Search by name or description\"\n className=\"pl-8\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n />\n </div>\n <select\n aria-label=\"Filter by trigger\"\n className=\"rounded-md border border-input bg-background px-2 py-1.5 text-sm\"\n value={triggerType}\n onChange={(e) => setTriggerType(e.target.value)}\n >\n <option value=\"ALL\">Any trigger</option>\n {TRIGGER_TYPES.map((t) => (\n <option key={t} value={t}>\n {TRIGGER_TYPE_LABEL[t]}\n </option>\n ))}\n </select>\n <div className=\"w-48\">\n <ProjectSelect\n id=\"automation-filter-project\"\n value={projectId}\n onChange={setProjectId}\n noneLabel=\"Any project\"\n />\n </div>\n </div>\n <div className=\"flex gap-1\" role=\"group\" aria-label=\"Filter by status\">\n {STATUS_FILTERS.map((s) => (\n <button\n key={s}\n type=\"button\"\n aria-pressed={status === s}\n onClick={() => setStatus(s)}\n className={`px-3 py-1.5 text-sm rounded-md capitalize ${status === s ? 'bg-primary text-primary-foreground' : 'text-muted-foreground hover:bg-muted'}`}\n >\n {s === 'ALL' ? 'All' : s.toLowerCase()}\n </button>\n ))}\n </div>\n\n {error && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n Automation rules could not be loaded: {error.message}\n </p>\n )}\n {loading && !data && (\n <p className=\"text-sm text-muted-foreground\">Loading automation rules…</p>\n )}\n {list && rules.length === 0 && (\n <EmptyState\n icon={<Bot className=\"h-8 w-8 text-muted-foreground\" />}\n title={\n term || status !== 'ALL' || triggerType !== 'ALL' || projectId\n ? 'No rules match'\n : 'No automation rules yet'\n }\n description=\"Rules watch for an event — a work item, sprint, release or a daily schedule — and act automatically: assign, label, move status, or post a comment.\"\n action={\n !(term || status !== 'ALL' || triggerType !== 'ALL' || projectId) ? (\n <Button size=\"sm\" onClick={() => navigate('/automation/create-automation-rule-page')}>\n <Plus className=\"mr-1 h-4 w-4\" />\n New rule\n </Button>\n ) : undefined\n }\n />\n )}\n\n <ul className=\"space-y-2\">\n {rules.map((rule) => (\n <li key={rule.id}>\n <div\n {...rowLinkProps(\n () => navigate(detailPath('/automation/automation-rule-detail-page', rule.id)),\n rule.name\n )}\n data-testid=\"automation-rule-row\"\n className={`flex flex-wrap items-center justify-between gap-3 rounded-md border p-3 ${ROW_LINK_CLASS}`}\n >\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"truncate text-sm font-medium\">{rule.name}</span>\n <Badge variant=\"outline\">{triggerTypeLabel(rule.triggerType)}</Badge>\n </div>\n <p className=\"mt-0.5 truncate text-xs text-muted-foreground\">\n {rule.project?.name ?? 'Unknown project'} · {actionCount(rule.actions)} action\n {actionCount(rule.actions) === 1 ? '' : 's'} · run {rule.executionCount} time\n {rule.executionCount === 1 ? '' : 's'}\n {rule.lastExecutedAt\n ? ` · last ${new Date(rule.lastExecutedAt).toLocaleString()}`\n : ''}\n </p>\n {rule.description && (\n <p className=\"mt-0.5 truncate text-xs text-muted-foreground\">\n {rule.description}\n </p>\n )}\n </div>\n <div className=\"flex items-center gap-3\" onClick={stopRowActivation}>\n <AutomationRuleStatusSwitch ruleId={rule.id} status={rule.status} />\n <AutomationRuleDeleteButton ruleId={rule.id} name={rule.name} />\n </div>\n </div>\n </li>\n ))}\n </ul>\n {list?.pageInfo.hasNextPage && (\n <Button size=\"sm\" variant=\"outline\" onClick={() => void loadMore()} disabled={loadingMore}>\n {loadingMore ? 'Loading…' : `Show more (${rules.length} of ${list.totalCount})`}\n </Button>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA8BA,IAAM,IAAO,IAEP,IAAQ,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CX,IAAiB,CAAC,OAAO,GAAG,EAAc;AAEhD,SAAS,EAAY,GAA0B;AAC7C,QAAO,MAAM,QAAQ,EAAQ,GAAG,EAAQ,SAAS;;AAGnD,SAAgB,IAAoC;CAClD,IAAM,EAAE,mBAAgB,GAAe,EACjC,IAAW,GAAuB,EAClC,CAAC,GAAQ,KAAa,EAAS,GAAG,EAClC,CAAC,GAAQ,KAAa,EAA0C,MAAM,EACtE,CAAC,GAAa,KAAkB,EAAS,MAAM,EAC/C,CAAC,GAAW,KAAgB,EAAS,GAAG,EACxC,CAAC,GAAa,KAAkB,EAAS,GAAM,EAC/C,IAAO,EAAiB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;IAAE,UAAU;cAC3E,IAAc,aAAa,cAAc,EAAM,OAAO,MAAM,EAAK,WAAW;IACtE,CAAA;GAEP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutomationCreateAutomationRulePagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/AutomationCreateAutomationRulePagePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AutomationCreateAutomationRulePagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/AutomationCreateAutomationRulePagePage.tsx"],"names":[],"mappings":"AAwCA,wBAAgB,sCAAsC,4CAoGrD"}
|
|
@@ -1,93 +1,97 @@
|
|
|
1
1
|
import { usePlanMagnet as e, usePlanMagnetNavigate as t } from "../providers/PlanMagnetProvider.js";
|
|
2
2
|
import { throwOnError as n } from "../utils/mutationResult.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { actionsToApi as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
3
|
+
import { isForbidden as r, mutationErrorMessage as i } from "../utils/graphqlErrors.js";
|
|
4
|
+
import { detailPath as a } from "../utils/rowNavigation.js";
|
|
5
|
+
import { actionsToApi as o, conditionsToApi as s, saveBlockReason as c, scheduleConditionsToApi as l } from "../automation/automationRuleTypes.js";
|
|
6
|
+
import { AUTOMATION_RULE_QUERIES as u } from "../controls/AutomationRuleControls.js";
|
|
7
|
+
import { AutomationRuleFields as d } from "../automation/AutomationRuleFields.js";
|
|
8
|
+
import { useState as f } from "react";
|
|
9
|
+
import { Bot as p, Save as m, X as h } from "lucide-react";
|
|
10
|
+
import { gql as g } from "@apollo/client";
|
|
11
|
+
import { useMutation as _ } from "@apollo/client/react";
|
|
12
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
13
|
+
import { Button as b, Card as x, CardContent as S, CardHeader as C, CardTitle as w } from "@burdenoff/fe-libs/ui";
|
|
13
14
|
//#region src/planmagnet/pages/AutomationCreateAutomationRulePagePage.tsx
|
|
14
|
-
var
|
|
15
|
+
var T = g`
|
|
15
16
|
mutation CreateAutomationRule($input: PlanmagnetCreateAutomationRuleInput!) {
|
|
16
17
|
planmagnetCreateAutomationRule(input: $input) {
|
|
17
18
|
id
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
`,
|
|
21
|
+
`, E = {
|
|
21
22
|
name: "",
|
|
22
23
|
description: "",
|
|
23
24
|
projectId: "",
|
|
24
25
|
triggerType: "WORK_ITEM_CREATED",
|
|
25
26
|
conditions: [],
|
|
27
|
+
scheduleStatuses: [],
|
|
28
|
+
scheduleNotUpdatedForDays: "",
|
|
26
29
|
actions: []
|
|
27
30
|
};
|
|
28
|
-
function
|
|
29
|
-
let { workspaceId:
|
|
30
|
-
if (!(!
|
|
31
|
-
|
|
31
|
+
function D() {
|
|
32
|
+
let { workspaceId: g } = e(), D = t(), [O, k] = f(E), [A, j] = f(null), [M, { loading: N }] = _(T, { refetchQueries: u }), P = c(O), F = O.name.trim() !== "" && O.projectId !== "" && !P && !N, I = async () => {
|
|
33
|
+
if (!(!F || !g)) {
|
|
34
|
+
j(null);
|
|
32
35
|
try {
|
|
33
|
-
let e = (await n(
|
|
34
|
-
projectId:
|
|
35
|
-
name:
|
|
36
|
-
description:
|
|
37
|
-
triggerType:
|
|
36
|
+
let e = (await n(M({ variables: { input: {
|
|
37
|
+
projectId: O.projectId,
|
|
38
|
+
name: O.name.trim(),
|
|
39
|
+
description: O.description.trim() || void 0,
|
|
40
|
+
triggerType: O.triggerType,
|
|
38
41
|
triggerConfig: {},
|
|
39
|
-
conditions:
|
|
40
|
-
actions:
|
|
42
|
+
conditions: O.triggerType === "SCHEDULE" ? l(O.scheduleStatuses, O.scheduleNotUpdatedForDays) : s(O.conditions),
|
|
43
|
+
actions: o(O.actions)
|
|
41
44
|
} } }))).data?.planmagnetCreateAutomationRule.id;
|
|
42
|
-
|
|
45
|
+
D(e ? a("/automation/automation-rule-detail-page", e) : "/automation/automation-rules-page");
|
|
43
46
|
} catch (e) {
|
|
44
|
-
|
|
47
|
+
j(r(e) ? "Your role can view automation rules but not change them." : i(e, "The rule could not be created."));
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
50
|
};
|
|
48
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ y("div", {
|
|
49
52
|
className: "space-y-6 p-6 max-w-3xl",
|
|
50
53
|
children: [
|
|
51
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ y("div", {
|
|
52
55
|
className: "flex items-center justify-between",
|
|
53
|
-
children: [/* @__PURE__ */
|
|
56
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h1", {
|
|
54
57
|
className: "text-2xl font-semibold",
|
|
55
58
|
children: "New automation rule"
|
|
56
|
-
}), /* @__PURE__ */
|
|
59
|
+
}), /* @__PURE__ */ v("p", {
|
|
57
60
|
className: "text-sm text-muted-foreground",
|
|
58
61
|
children: "Runs its actions when the trigger fires and every condition matches."
|
|
59
|
-
})] }), /* @__PURE__ */
|
|
62
|
+
})] }), /* @__PURE__ */ y("div", {
|
|
60
63
|
className: "flex gap-2",
|
|
61
|
-
children: [/* @__PURE__ */
|
|
64
|
+
children: [/* @__PURE__ */ y(b, {
|
|
62
65
|
variant: "outline",
|
|
63
66
|
size: "sm",
|
|
64
|
-
onClick: () =>
|
|
65
|
-
children: [/* @__PURE__ */
|
|
66
|
-
}), /* @__PURE__ */
|
|
67
|
+
onClick: () => D("/automation/automation-rules-page"),
|
|
68
|
+
children: [/* @__PURE__ */ v(h, { className: "mr-1 h-4 w-4" }), "Cancel"]
|
|
69
|
+
}), /* @__PURE__ */ y(b, {
|
|
67
70
|
size: "sm",
|
|
68
|
-
onClick: () => void
|
|
69
|
-
disabled: !
|
|
71
|
+
onClick: () => void I(),
|
|
72
|
+
disabled: !F,
|
|
73
|
+
title: P ?? void 0,
|
|
70
74
|
"data-testid": "automation-create-submit",
|
|
71
|
-
children: [/* @__PURE__ */ m
|
|
75
|
+
children: [/* @__PURE__ */ v(m, { className: "mr-1 h-4 w-4" }), N ? "Creating…" : "Create rule"]
|
|
72
76
|
})]
|
|
73
77
|
})]
|
|
74
78
|
}),
|
|
75
|
-
|
|
79
|
+
A && /* @__PURE__ */ v("div", {
|
|
76
80
|
role: "alert",
|
|
77
81
|
className: "p-3 bg-destructive/10 text-destructive rounded-md text-sm",
|
|
78
|
-
children:
|
|
82
|
+
children: A
|
|
79
83
|
}),
|
|
80
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ y(x, { children: [/* @__PURE__ */ v(C, { children: /* @__PURE__ */ y(w, {
|
|
81
85
|
className: "flex items-center gap-2",
|
|
82
|
-
children: [/* @__PURE__ */
|
|
83
|
-
}) }), /* @__PURE__ */
|
|
84
|
-
form:
|
|
85
|
-
onChange:
|
|
86
|
+
children: [/* @__PURE__ */ v(p, { className: "h-4 w-4" }), "Rule details"]
|
|
87
|
+
}) }), /* @__PURE__ */ v(S, { children: /* @__PURE__ */ v(d, {
|
|
88
|
+
form: O,
|
|
89
|
+
onChange: k
|
|
86
90
|
}) })] })
|
|
87
91
|
]
|
|
88
92
|
});
|
|
89
93
|
}
|
|
90
94
|
//#endregion
|
|
91
|
-
export {
|
|
95
|
+
export { D as AutomationCreateAutomationRulePagePage };
|
|
92
96
|
|
|
93
97
|
//# sourceMappingURL=AutomationCreateAutomationRulePagePage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutomationCreateAutomationRulePagePage.js","names":[],"sources":["../../../src/planmagnet/pages/AutomationCreateAutomationRulePagePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation } from '@apollo/client/react';\nimport { Button, Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport { Bot, Save, X } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { throwOnError } from '../utils/mutationResult';\nimport { detailPath } from '../utils/rowNavigation';\nimport {\n AutomationRuleFields,\n type AutomationRuleFormState,\n} from '../automation/AutomationRuleFields';\nimport {
|
|
1
|
+
{"version":3,"file":"AutomationCreateAutomationRulePagePage.js","names":[],"sources":["../../../src/planmagnet/pages/AutomationCreateAutomationRulePagePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation } from '@apollo/client/react';\nimport { Button, Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport { Bot, Save, X } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { throwOnError } from '../utils/mutationResult';\nimport { isForbidden, mutationErrorMessage } from '../utils/graphqlErrors';\nimport { detailPath } from '../utils/rowNavigation';\nimport {\n AutomationRuleFields,\n type AutomationRuleFormState,\n} from '../automation/AutomationRuleFields';\nimport {\n actionsToApi,\n conditionsToApi,\n saveBlockReason,\n scheduleConditionsToApi,\n} from '../automation/automationRuleTypes';\nimport { AUTOMATION_RULE_QUERIES } from '../controls/AutomationRuleControls';\n\nconst CREATE = gql`\n mutation CreateAutomationRule($input: PlanmagnetCreateAutomationRuleInput!) {\n planmagnetCreateAutomationRule(input: $input) {\n id\n }\n }\n`;\n\nconst EMPTY: AutomationRuleFormState = {\n name: '',\n description: '',\n projectId: '',\n triggerType: 'WORK_ITEM_CREATED',\n conditions: [],\n scheduleStatuses: [],\n scheduleNotUpdatedForDays: '',\n actions: [],\n};\n\nexport function AutomationCreateAutomationRulePagePage() {\n const { workspaceId } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n const [form, setForm] = useState<AutomationRuleFormState>(EMPTY);\n const [error, setError] = useState<string | null>(null);\n const [create, { loading }] = useMutation<{ planmagnetCreateAutomationRule: { id: string } }>(\n CREATE,\n {\n refetchQueries: AUTOMATION_RULE_QUERIES,\n }\n );\n\n const blockReason = saveBlockReason(form);\n const canSubmit = form.name.trim() !== '' && form.projectId !== '' && !blockReason && !loading;\n\n const handleCreate = async () => {\n if (!canSubmit || !workspaceId) return;\n setError(null);\n try {\n const result = await throwOnError(\n create({\n variables: {\n input: {\n projectId: form.projectId,\n name: form.name.trim(),\n description: form.description.trim() || undefined,\n triggerType: form.triggerType,\n triggerConfig: {},\n conditions:\n form.triggerType === 'SCHEDULE'\n ? scheduleConditionsToApi(form.scheduleStatuses, form.scheduleNotUpdatedForDays)\n : conditionsToApi(form.conditions),\n actions: actionsToApi(form.actions),\n },\n },\n })\n );\n const id = result.data?.planmagnetCreateAutomationRule.id;\n navigate(\n id\n ? detailPath('/automation/automation-rule-detail-page', id)\n : '/automation/automation-rules-page'\n );\n } catch (e) {\n setError(\n isForbidden(e)\n ? 'Your role can view automation rules but not change them.'\n : mutationErrorMessage(e, 'The rule could not be created.')\n );\n }\n };\n\n return (\n <div className=\"space-y-6 p-6 max-w-3xl\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h1 className=\"text-2xl font-semibold\">New automation rule</h1>\n <p className=\"text-sm text-muted-foreground\">\n Runs its actions when the trigger fires and every condition matches.\n </p>\n </div>\n <div className=\"flex gap-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => navigate('/automation/automation-rules-page')}\n >\n <X className=\"mr-1 h-4 w-4\" />\n Cancel\n </Button>\n <Button\n size=\"sm\"\n onClick={() => void handleCreate()}\n disabled={!canSubmit}\n title={blockReason ?? undefined}\n data-testid=\"automation-create-submit\"\n >\n <Save className=\"mr-1 h-4 w-4\" />\n {loading ? 'Creating…' : 'Create rule'}\n </Button>\n </div>\n </div>\n {error && (\n <div role=\"alert\" className=\"p-3 bg-destructive/10 text-destructive rounded-md text-sm\">\n {error}\n </div>\n )}\n <Card>\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <Bot className=\"h-4 w-4\" />\n Rule details\n </CardTitle>\n </CardHeader>\n <CardContent>\n <AutomationRuleFields form={form} onChange={setForm} />\n </CardContent>\n </Card>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAqBA,IAAM,IAAS,CAAG;;;;;;GAQZ,IAAiC;CACrC,MAAM;CACN,aAAa;CACb,WAAW;CACX,aAAa;CACb,YAAY,EAAE;CACd,kBAAkB,EAAE;CACpB,2BAA2B;CAC3B,SAAS,EAAE;CACZ;AAED,SAAgB,IAAyC;CACvD,IAAM,EAAE,mBAAgB,GAAe,EACjC,IAAW,GAAuB,EAClC,CAAC,GAAM,KAAW,EAAkC,EAAM,EAC1D,CAAC,GAAO,KAAY,EAAwB,KAAK,EACjD,CAAC,GAAQ,EAAE,gBAAa,EAC5B,GACA,EACE,gBAAgB,GACjB,CACF,EAEK,IAAc,EAAgB,EAAK,EACnC,IAAY,EAAK,KAAK,MAAM,KAAK,MAAM,EAAK,cAAc,MAAM,CAAC,KAAe,CAAC,GAEjF,IAAe,YAAY;AAC3B,SAAC,KAAa,CAAC,IACnB;KAAS,KAAK;AACd,OAAI;IAmBF,IAAM,KAlBS,MAAM,EACnB,EAAO,EACL,WAAW,EACT,OAAO;KACL,WAAW,EAAK;KAChB,MAAM,EAAK,KAAK,MAAM;KACtB,aAAa,EAAK,YAAY,MAAM,IAAI,KAAA;KACxC,aAAa,EAAK;KAClB,eAAe,EAAE;KACjB,YACE,EAAK,gBAAgB,aACjB,EAAwB,EAAK,kBAAkB,EAAK,0BAA0B,GAC9E,EAAgB,EAAK,WAAW;KACtC,SAAS,EAAa,EAAK,QAAQ;KACpC,EACF,EACF,CAAC,CACH,EACiB,MAAM,+BAA+B;AACvD,MACE,IACI,EAAW,2CAA2C,EAAG,GACzD,oCACL;YACM,GAAG;AACV,MACE,EAAY,EAAE,GACV,6DACA,EAAqB,GAAG,iCAAiC,CAC9D;;;;AAIL,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;eAAyB;KAAwB,CAAA,EAC/D,kBAAC,KAAD;KAAG,WAAU;eAAgC;KAEzC,CAAA,CACA,EAAA,CAAA,EACN,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,GAAD;MACE,SAAQ;MACR,MAAK;MACL,eAAe,EAAS,oCAAoC;gBAH9D,CAKE,kBAAC,GAAD,EAAG,WAAU,gBAAiB,CAAA,EAAA,SAEvB;SACT,kBAAC,GAAD;MACE,MAAK;MACL,eAAe,KAAK,GAAc;MAClC,UAAU,CAAC;MACX,OAAO,KAAe,KAAA;MACtB,eAAY;gBALd,CAOE,kBAAC,GAAD,EAAM,WAAU,gBAAiB,CAAA,EAChC,IAAU,cAAc,cAClB;QACL;OACF;;GACL,KACC,kBAAC,OAAD;IAAK,MAAK;IAAQ,WAAU;cACzB;IACG,CAAA;GAER,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;IAAW,WAAU;cAArB,CACE,kBAAC,GAAD,EAAK,WAAU,WAAY,CAAA,EAAA,eAEjB;OACD,CAAA,EACb,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;IAA4B;IAAM,UAAU;IAAW,CAAA,EAC3C,CAAA,CACT,EAAA,CAAA;GACH"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { usePlanMagnet as e, usePlanMagnetNavigate as t } from "../providers/PlanMagnetProvider.js";
|
|
2
2
|
import { PersonName as n } from "../people/People.js";
|
|
3
3
|
import { countLabel as r, useProjectCounts as i, useSprintCounts as a, workProgress as o } from "../hooks/useCounts.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { ROW_LINK_CLASS as s, detailPath as c, rowLinkProps as l } from "../utils/rowNavigation.js";
|
|
5
|
+
import { analyticsSearch as u, presetRange as d } from "./analytics/analyticsRange.js";
|
|
6
6
|
import { useLiveRefresh as f } from "../hooks/useLiveRefresh.js";
|
|
7
7
|
import { LiveStatus as p } from "../controls/LiveStatus.js";
|
|
8
8
|
import { AlertTriangle as m, ArrowUpRight as h, Calendar as g, CheckSquare as _, FolderKanban as v, LayoutDashboard as y, TrendingUp as b, Users as x, Zap as S } from "lucide-react";
|
|
@@ -183,7 +183,7 @@ function I() {
|
|
|
183
183
|
className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4",
|
|
184
184
|
children: Y.map((e) => /* @__PURE__ */ D(A, {
|
|
185
185
|
"data-testid": "dashboard-tile-link",
|
|
186
|
-
...
|
|
186
|
+
...l(() => H(`/analytics/analytics-page${u(d("30"))}`), `${e.label}: ${e.value}. ${I("planmagnet.dashboard.metrics.openAnalytics", "Open in Analytics")}`),
|
|
187
187
|
children: [/* @__PURE__ */ D(M, {
|
|
188
188
|
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
189
189
|
children: [/* @__PURE__ */ E(N, {
|
|
@@ -211,8 +211,8 @@ function I() {
|
|
|
211
211
|
children: [K.map((e) => {
|
|
212
212
|
let t = e.workItems.reduce((e, t) => e + (t.storyPoints ?? 0), 0), n = e.workItems.filter((e) => e.status === "DONE").reduce((e, t) => e + (t.storyPoints ?? 0), 0), r = e.workItems.length, i = e.workItems.filter((e) => e.status === "DONE").length, a = o(e.workItems) ?? 0;
|
|
213
213
|
return /* @__PURE__ */ D("div", {
|
|
214
|
-
...
|
|
215
|
-
className: `rounded-lg border p-4 ${
|
|
214
|
+
...l(() => H(c("/projects/planning-detail-page", e.id)), e.name),
|
|
215
|
+
className: `rounded-lg border p-4 ${s}`,
|
|
216
216
|
children: [
|
|
217
217
|
/* @__PURE__ */ D("div", {
|
|
218
218
|
className: "flex items-center justify-between mb-2",
|
|
@@ -294,8 +294,8 @@ function I() {
|
|
|
294
294
|
}) }), /* @__PURE__ */ D(j, {
|
|
295
295
|
className: "space-y-3",
|
|
296
296
|
children: [q.map((e) => /* @__PURE__ */ D("div", {
|
|
297
|
-
...
|
|
298
|
-
className: `flex items-start gap-3 rounded border p-2 ${
|
|
297
|
+
...l(() => H(c("/projects/milestone-detail-page", e.id)), e.name),
|
|
298
|
+
className: `flex items-start gap-3 rounded border p-2 ${s}`,
|
|
299
299
|
children: [/* @__PURE__ */ D("div", {
|
|
300
300
|
className: "flex-1 min-w-0",
|
|
301
301
|
children: [
|
|
@@ -341,8 +341,8 @@ function I() {
|
|
|
341
341
|
}) }), /* @__PURE__ */ D(j, {
|
|
342
342
|
className: "space-y-3",
|
|
343
343
|
children: [J.map((e) => /* @__PURE__ */ D("div", {
|
|
344
|
-
...
|
|
345
|
-
className: `flex items-center justify-between rounded border p-2 ${
|
|
344
|
+
...l(() => H(`/tasks/task-detail-page?taskId=${encodeURIComponent(e.id)}`), `${e.key} ${e.title}`),
|
|
345
|
+
className: `flex items-center justify-between rounded border p-2 ${s}`,
|
|
346
346
|
children: [/* @__PURE__ */ D("div", {
|
|
347
347
|
className: "min-w-0 flex-1",
|
|
348
348
|
children: [/* @__PURE__ */ D("p", {
|
|
@@ -385,8 +385,8 @@ function I() {
|
|
|
385
385
|
}) }), /* @__PURE__ */ D(j, {
|
|
386
386
|
className: "space-y-3",
|
|
387
387
|
children: [W.map((e) => /* @__PURE__ */ D("div", {
|
|
388
|
-
...
|
|
389
|
-
className: `flex items-center justify-between rounded border p-2 ${
|
|
388
|
+
...l(() => H(c("/projects/project-detail-page", e.id)), e.name),
|
|
389
|
+
className: `flex items-center justify-between rounded border p-2 ${s}`,
|
|
390
390
|
children: [/* @__PURE__ */ D("div", {
|
|
391
391
|
className: "min-w-0 flex-1",
|
|
392
392
|
children: [/* @__PURE__ */ E("p", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { usePlanMagnet as e, usePlanMagnetNavigate as t } from "../providers/PlanMagnetProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { detailPath as n } from "../utils/rowNavigation.js";
|
|
3
|
+
import { ProjectSelect as r } from "../controls/Pickers.js";
|
|
4
4
|
import { readUrlParam as i, writeUrlParam as a } from "../utils/urlParam.js";
|
|
5
5
|
import { combineLiveRefreshModes as o, useLiveRefresh as s } from "../hooks/useLiveRefresh.js";
|
|
6
6
|
import { LiveStatus as c } from "../controls/LiveStatus.js";
|
|
@@ -77,7 +77,7 @@ function D() {
|
|
|
77
77
|
children: O("planmagnet.dashboards.pm.subtitle", "Velocity, burndown, task completion, quality, risk and capacity for one project.")
|
|
78
78
|
})] }), /* @__PURE__ */ x("div", {
|
|
79
79
|
className: "w-full max-w-xs",
|
|
80
|
-
children: /* @__PURE__ */ x(
|
|
80
|
+
children: /* @__PURE__ */ x(r, {
|
|
81
81
|
id: "pm-dashboard-project",
|
|
82
82
|
value: k,
|
|
83
83
|
onChange: j,
|
|
@@ -111,7 +111,7 @@ function D() {
|
|
|
111
111
|
/* @__PURE__ */ x(d, {
|
|
112
112
|
workspaceId: y,
|
|
113
113
|
projectId: k,
|
|
114
|
-
onDrillDown: () => D(
|
|
114
|
+
onDrillDown: () => D(n("/projects/project-detail-page", k))
|
|
115
115
|
}),
|
|
116
116
|
/* @__PURE__ */ x(f, {
|
|
117
117
|
workspaceId: y,
|
|
@@ -129,7 +129,7 @@ function D() {
|
|
|
129
129
|
className: "space-y-2",
|
|
130
130
|
children: [/* @__PURE__ */ x(m, {
|
|
131
131
|
sprintId: I,
|
|
132
|
-
onDrillDown: () => D(
|
|
132
|
+
onDrillDown: () => D(n("/projects/project-detail-page", k))
|
|
133
133
|
}), /* @__PURE__ */ x(u, { message: O("planmagnet.dashboards.pm.noSkillView", "There is no skill concept in PlanMagnet — capacity above is per person, never per skill.") })]
|
|
134
134
|
})
|
|
135
135
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { usePlanMagnet as e, usePlanMagnetNavigate as t } from "../providers/PlanMagnetProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { detailPath as n } from "../utils/rowNavigation.js";
|
|
3
|
+
import { TeamSelect as r } from "../controls/Pickers.js";
|
|
4
4
|
import { readUrlParam as i, writeUrlParam as a } from "../utils/urlParam.js";
|
|
5
5
|
import { useLiveRefresh as o } from "../hooks/useLiveRefresh.js";
|
|
6
6
|
import { LiveStatus as s } from "../controls/LiveStatus.js";
|
|
@@ -58,7 +58,7 @@ function S() {
|
|
|
58
58
|
children: C("planmagnet.dashboards.team.subtitle", "Capacity, workload, individual delivery and time logged for one team.")
|
|
59
59
|
})] }), /* @__PURE__ */ g("div", {
|
|
60
60
|
className: "w-full max-w-xs",
|
|
61
|
-
children: /* @__PURE__ */ g(
|
|
61
|
+
children: /* @__PURE__ */ g(r, {
|
|
62
62
|
id: "team-dashboard-team",
|
|
63
63
|
value: w,
|
|
64
64
|
onChange: E,
|
|
@@ -70,7 +70,7 @@ function S() {
|
|
|
70
70
|
children: [
|
|
71
71
|
/* @__PURE__ */ g(l, {
|
|
72
72
|
teamId: w,
|
|
73
|
-
onDrillDown: () => S(
|
|
73
|
+
onDrillDown: () => S(n("/team/team-detail-page", w))
|
|
74
74
|
}),
|
|
75
75
|
/* @__PURE__ */ _("div", {
|
|
76
76
|
className: "space-y-2",
|
|
@@ -79,7 +79,7 @@ function S() {
|
|
|
79
79
|
memberActorIds: A,
|
|
80
80
|
sinceIso: D,
|
|
81
81
|
weeks: 4,
|
|
82
|
-
onDrillDown: () => S(
|
|
82
|
+
onDrillDown: () => S(n("/team/team-detail-page", w))
|
|
83
83
|
}), /* @__PURE__ */ g(c, { message: C("planmagnet.dashboards.team.noSkillUtilization", "Skill utilization is not modelled in PlanMagnet — workload above is by person only.") })]
|
|
84
84
|
}),
|
|
85
85
|
/* @__PURE__ */ g(d, {
|
|
@@ -2,9 +2,9 @@ import { usePlanMagnetNavigate as e } from "../providers/PlanMagnetProvider.js";
|
|
|
2
2
|
import { throwOnError as t } from "../utils/mutationResult.js";
|
|
3
3
|
import { ErrorLine as n } from "../controls/ConfirmButton.js";
|
|
4
4
|
import { enumLabel as r } from "../controls/WorkItemControls.js";
|
|
5
|
-
import {
|
|
6
|
-
import { detailPath as
|
|
7
|
-
import {
|
|
5
|
+
import { isForbidden as i, mutationErrorMessage as a } from "../utils/graphqlErrors.js";
|
|
6
|
+
import { detailPath as ee } from "../utils/rowNavigation.js";
|
|
7
|
+
import { ProjectSelect as te } from "../controls/Pickers.js";
|
|
8
8
|
import { useSyncProviderCapabilities as o } from "../integrations/useSyncProviderCapabilities.js";
|
|
9
9
|
import { CONFLICT_RESOLUTIONS as s, GITHUB_FIELD_MAPPING_DEFAULTS as c, SYNC_DIRECTIONS as ne, directionLabel as l, directionSupported as re, isValidGithubOwner as ie, isValidGithubRepo as ae, providerIsLive as u, providerLabel as d } from "../integrations/syncTypes.js";
|
|
10
10
|
import { CONFLICT_STRATEGY_EXPLANATION as oe, RunNowButton as se, SyncRunResultSummary as ce, TestConnectionButton as f } from "../controls/SyncControls.js";
|
|
@@ -91,7 +91,7 @@ function D() {
|
|
|
91
91
|
let e = await t(G({ variables: { input: we() } }));
|
|
92
92
|
e.data && Se(e.data.planmagnetCreateExternalSync);
|
|
93
93
|
} catch (e) {
|
|
94
|
-
H(
|
|
94
|
+
H(i(e) ? "Your role can view integrations but not set them up." : a(e, "The sync could not be created."));
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
97
|
return U ? /* @__PURE__ */ v("div", {
|
|
@@ -122,7 +122,7 @@ function D() {
|
|
|
122
122
|
}),
|
|
123
123
|
W && /* @__PURE__ */ v(ce, { result: W }),
|
|
124
124
|
/* @__PURE__ */ v(b, {
|
|
125
|
-
onClick: () => u(
|
|
125
|
+
onClick: () => u(ee("/integrations/sync-detail-page", U.id)),
|
|
126
126
|
"data-testid": "sync-wizard-view",
|
|
127
127
|
children: "View sync"
|
|
128
128
|
})
|
|
@@ -167,7 +167,7 @@ function D() {
|
|
|
167
167
|
children: "PlanMagnet project"
|
|
168
168
|
}), /* @__PURE__ */ v("div", {
|
|
169
169
|
className: "mt-1",
|
|
170
|
-
children: /* @__PURE__ */ v(
|
|
170
|
+
children: /* @__PURE__ */ v(te, {
|
|
171
171
|
id: "sync-wizard-project",
|
|
172
172
|
value: O,
|
|
173
173
|
noneLabel: "Choose a project",
|