@burdenoff/microfe-planmagnet 2026.930.16 → 2026.930.18
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/planmagnet/board/ProjectBoard.d.ts.map +1 -1
- package/dist/planmagnet/board/ProjectBoard.js +278 -271
- package/dist/planmagnet/board/ProjectBoard.js.map +1 -1
- package/dist/planmagnet/comments/CommentThread.d.ts +44 -0
- package/dist/planmagnet/comments/CommentThread.d.ts.map +1 -0
- package/dist/planmagnet/comments/CommentThread.js +513 -0
- package/dist/planmagnet/comments/CommentThread.js.map +1 -0
- package/dist/planmagnet/comments/MentionComposer.d.ts +25 -0
- package/dist/planmagnet/comments/MentionComposer.d.ts.map +1 -0
- package/dist/planmagnet/comments/MentionComposer.js +148 -0
- package/dist/planmagnet/comments/MentionComposer.js.map +1 -0
- package/dist/planmagnet/comments/TargetComments.d.ts +7 -0
- package/dist/planmagnet/comments/TargetComments.d.ts.map +1 -0
- package/dist/planmagnet/comments/TargetComments.js +207 -0
- package/dist/planmagnet/comments/TargetComments.js.map +1 -0
- package/dist/planmagnet/comments/WorkItemComments.d.ts.map +1 -1
- package/dist/planmagnet/comments/WorkItemComments.js +68 -216
- package/dist/planmagnet/comments/WorkItemComments.js.map +1 -1
- package/dist/planmagnet/controls/LiveStatus.d.ts +7 -0
- package/dist/planmagnet/controls/LiveStatus.d.ts.map +1 -0
- package/dist/planmagnet/controls/LiveStatus.js +31 -0
- package/dist/planmagnet/controls/LiveStatus.js.map +1 -0
- package/dist/planmagnet/hooks/useLiveRefresh.d.ts +76 -0
- package/dist/planmagnet/hooks/useLiveRefresh.d.ts.map +1 -0
- package/dist/planmagnet/hooks/useLiveRefresh.js +143 -0
- package/dist/planmagnet/hooks/useLiveRefresh.js.map +1 -0
- package/dist/planmagnet/pages/DashboardDashboardPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DashboardDashboardPagePage.js +138 -125
- package/dist/planmagnet/pages/DashboardDashboardPagePage.js.map +1 -1
- package/dist/planmagnet/pages/DashboardsExecutivePagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DashboardsExecutivePagePage.js +54 -39
- package/dist/planmagnet/pages/DashboardsExecutivePagePage.js.map +1 -1
- package/dist/planmagnet/pages/DashboardsLeadershipPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DashboardsLeadershipPagePage.js +52 -37
- package/dist/planmagnet/pages/DashboardsLeadershipPagePage.js.map +1 -1
- package/dist/planmagnet/pages/DashboardsProjectManagerPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DashboardsProjectManagerPagePage.js +93 -68
- package/dist/planmagnet/pages/DashboardsProjectManagerPagePage.js.map +1 -1
- package/dist/planmagnet/pages/DashboardsTeamUtilizationPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DashboardsTeamUtilizationPagePage.js +62 -47
- package/dist/planmagnet/pages/DashboardsTeamUtilizationPagePage.js.map +1 -1
- package/dist/planmagnet/pages/DocsDocDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DocsDocDetailPagePage.js +74 -72
- package/dist/planmagnet/pages/DocsDocDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.js +140 -125
- package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js +213 -195
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLiveRefresh.js","names":[],"sources":["../../../src/planmagnet/hooks/useLiveRefresh.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useApolloClient, useSubscription } from '@apollo/client/react';\nimport { usePlanMagnet } from '../providers/PlanMagnetProvider';\n\n/**\n * Live updates (PDM-05/11/21, ANR-23): a page subscribes to a thin, workspace-scoped event stream over the\n * gateway SSE path and re-reads its own named queries when something relevant changed — it never applies the\n * event payload as data (the payload carries identifiers and `changedFields` only, by server design, so a\n * subscriber re-reads under its own permissions instead of trusting something that bypassed RBAC and row-level\n * scoping). See `useDataSinkSubscription.ts` (microfe-bigconsole) for the sibling pattern this generalizes:\n * `skip` when the ids a subscription needs haven't loaded yet, and treat a transport/backend error as expected\n * degradation, not a page-breaking failure.\n *\n * Every event stream requires `workspaceId` server-side — a subscription whose `workspaceId` is not the\n * caller's own workspace is refused by the gateway, so this hook always reads it from `usePlanMagnet()` rather\n * than accepting it as a prop a caller could get wrong.\n *\n * Connection lifecycle. SSE has no connect acknowledgement: a refused subscription (bad variables, another\n * workspace, no auth) comes back at once as an error, while an accepted one simply stays open with nothing to\n * say until something changes. So a stream still open and error-free after `connectTimeoutMs` is treated as\n * live, and the first event proves it earlier. The server closes a stream after 60 s without events\n * (`REALTIME_SUBSCRIPTION_IDLE_TIMEOUT_MS` in the svc), which Apollo reports as completion — that is routine,\n * so the hook resubscribes rather than going quiet. A stream that keeps completing within seconds of opening is\n * not healthy and degrades to polling.\n *\n * Graceful fallback (this is the point of the hook, not an edge case): if the subscription errors, or keeps\n * closing as soon as it opens, `mode` becomes `'polling'` and a 30-second interval takes over, paused while the\n * tab is hidden (`document.visibilityState`). There is no reconnect-to-live attempt within one mount — once\n * degraded, a page stays on polling until it remounts. `standalone` dev/Storybook builds (no SSE link\n * configured — see `PlanMagnetProvider`) always take this path; that is expected, not a defect, and is why a\n * subscription error here is never surfaced as a page error.\n */\n\nexport type LiveRefreshKind = 'workItem' | 'project' | 'sprint';\nexport type LiveRefreshMode = 'connecting' | 'live' | 'polling';\n\ninterface LiveEvent {\n kind: string;\n id: string;\n workspaceId: string;\n projectId?: string | null;\n changedFields: string[];\n actorId: string;\n at: string;\n}\n\nconst ON_PROJECT_UPDATED = gql`\n subscription PlanmagnetLiveProjectUpdated($workspaceId: ID!, $projectId: ID) {\n planmagnetOnProjectUpdated(workspaceId: $workspaceId, projectId: $projectId) {\n kind\n id\n workspaceId\n changedFields\n actorId\n at\n }\n }\n`;\n\nconst ON_SPRINT_UPDATED = gql`\n subscription PlanmagnetLiveSprintUpdated($workspaceId: ID!, $sprintId: ID, $projectId: ID) {\n planmagnetOnSprintUpdated(\n workspaceId: $workspaceId\n sprintId: $sprintId\n projectId: $projectId\n ) {\n kind\n id\n projectId\n workspaceId\n changedFields\n actorId\n at\n }\n }\n`;\n\nconst ON_WORK_ITEM_UPDATED = gql`\n subscription PlanmagnetLiveWorkItemUpdated($workspaceId: ID!, $projectId: ID, $workItemId: ID) {\n planmagnetOnWorkItemUpdated(\n workspaceId: $workspaceId\n projectId: $projectId\n workItemId: $workItemId\n ) {\n kind\n id\n projectId\n workspaceId\n changedFields\n actorId\n at\n }\n }\n`;\n\nexport interface UseLiveRefreshOptions {\n /** Which event stream to subscribe to — see `PlanmagnetOn{Project,Sprint,WorkItem}Updated` in the schema. */\n kind: LiveRefreshKind;\n /** Narrows the stream server-side. Omitted on `workItem`/`project` this is a workspace-wide stream (the\n * Dashboard and role dashboards want every project's events); `sprint` needs `sprintId` to mean anything on a\n * single sprint's page, so the hook skips subscribing until it has one. */\n projectId?: string | null;\n /** For `kind: 'sprint'`, at least one of `sprintId`/`projectId` is required — one sprint's own events, or\n * every sprint in one project's. Neither means \"skip\" (every sprint workspace-wide has no current caller). */\n sprintId?: string | null;\n /** Narrows a `workItem`-kind stream to one item. Unused by every current caller (the board/dashboards want\n * every item's events for their scope) but supported for a future single-item page. */\n workItemId?: string | null;\n /** Apollo operation names this page's queries were declared with — refetched by name\n * (`client.refetchQueries({ include })`) on a (debounced, optionally throttled) event. Never the literal\n * query document, and never the event's own payload used as data. */\n queries: readonly string[];\n /** Coalesces a burst of events (e.g. a bulk update moving 20 cards) into one refetch. Default 500. */\n debounceMs?: number;\n /** A floor between refetches once debounced, for a page whose queries are expensive to re-run on every\n * change (ANR-23: the Dashboard and role dashboards, at most once per 15s). Unset: only the debounce window\n * applies. A pulse arriving inside the floor is never dropped — it runs at the floor's far edge (trailing). */\n minIntervalMs?: number;\n /** How long an open, error-free subscription stays \"Connecting…\" before it counts as live. Default 8000. */\n connectTimeoutMs?: number;\n /** Polling cadence once on the fallback path. Default 30000 (ANR-23/PDM-05: \"every 30s\"). */\n pollIntervalMs?: number;\n /** An extra gate beyond the kind's own required id(s) — e.g. a sprint page's `workItem`-kind stream (no id of\n * its own is required) should still wait for the sprint's `projectId` to resolve, and skip entirely for a\n * team-scoped sprint (no `projectId` at all) rather than falling back to a workspace-wide stream. Default\n * `true` (no extra gate). */\n enabled?: boolean;\n}\n\nexport interface UseLiveRefreshResult {\n /** `null` while a required id (e.g. a sprint page before `sprintId` resolves) hasn't loaded — there is\n * nothing to subscribe to yet, so `LiveStatus` renders nothing rather than a misleading \"Connecting…\". */\n mode: LiveRefreshMode | null;\n}\n\n/** Rolls up more than one `useLiveRefresh` result into the single indicator a page shows (e.g. the sprint\n * detail page subscribes to both sprint events and the sprint's project's work item events). Reports the least\n * favorable non-null mode present — `'polling'` beats `'connecting'` beats `'live'` — so the page never claims\n * \"Live\" while one of its own streams is actually degraded. `null` (nothing subscribed yet) only when every\n * input is `null`. */\nexport function combineLiveRefreshModes(\n ...modes: ReadonlyArray<LiveRefreshMode | null>\n): LiveRefreshMode | null {\n const present = modes.filter((mode): mode is LiveRefreshMode => mode !== null);\n if (present.length === 0) return null;\n if (present.includes('polling')) return 'polling';\n if (present.includes('connecting')) return 'connecting';\n return 'live';\n}\n\nconst RAPID_CLOSE_MS = 5000;\nconst RAPID_CLOSE_LIMIT = 3;\n\nfunction subscriptionDocumentFor(kind: LiveRefreshKind) {\n if (kind === 'project') return ON_PROJECT_UPDATED;\n if (kind === 'sprint') return ON_SPRINT_UPDATED;\n return ON_WORK_ITEM_UPDATED;\n}\n\n/** A debounced, optionally-throttled trigger: bursts inside `debounceMs` coalesce into one call; once debounced,\n * a call inside `minIntervalMs` of the last one is never dropped — it runs at the floor's far edge instead.\n * `run` is expected to be a `useCallback`-stable function (the hook below's `refetch` is, since it only depends\n * on `client` and `queries`) — accepted as a normal dependency rather than stashed in a ref, so it is never\n * read or written outside an effect/callback. */\nfunction useCoalescedTrigger(\n run: () => void,\n debounceMs: number,\n minIntervalMs: number | undefined\n) {\n const debounceTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const floorTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const lastRunAt = useRef(0);\n const floorPending = useRef(false);\n\n const runNow = useCallback(() => {\n floorPending.current = false;\n lastRunAt.current = Date.now();\n run();\n }, [run]);\n\n const trigger = useCallback(() => {\n if (debounceTimer.current) clearTimeout(debounceTimer.current);\n debounceTimer.current = setTimeout(() => {\n debounceTimer.current = null;\n if (!minIntervalMs) {\n runNow();\n return;\n }\n const elapsed = Date.now() - lastRunAt.current;\n if (elapsed >= minIntervalMs) {\n runNow();\n return;\n }\n if (floorPending.current) return; // a trailing run is already scheduled for this window\n floorPending.current = true;\n floorTimer.current = setTimeout(runNow, minIntervalMs - elapsed);\n }, debounceMs);\n }, [debounceMs, minIntervalMs, runNow]);\n\n useEffect(\n () => () => {\n if (debounceTimer.current) clearTimeout(debounceTimer.current);\n if (floorTimer.current) clearTimeout(floorTimer.current);\n },\n []\n );\n\n return trigger;\n}\n\nexport function useLiveRefresh({\n kind,\n projectId,\n sprintId,\n workItemId,\n queries,\n debounceMs = 500,\n minIntervalMs,\n connectTimeoutMs = 8000,\n pollIntervalMs = 30000,\n enabled = true,\n}: UseLiveRefreshOptions): UseLiveRefreshResult {\n const { workspaceId } = usePlanMagnet();\n const client = useApolloClient();\n\n // 'sprint' means something scoped to either one sprint (a sprint's own page) or every sprint in one project (a\n // project-scoped dashboard) — it needs at least one of the two ids, never neither (that would be every sprint\n // in the whole workspace, which no current caller wants). 'project' always needs its one id.\n const requiredIdMissing =\n (kind === 'sprint' && !sprintId && !projectId) || (kind === 'project' && !projectId);\n const skip = !workspaceId || requiredIdMissing || !enabled;\n\n // Identifies what we'd subscribe to right now — `null` when there's nothing to. `queries` is deliberately not\n // part of this: which QUERIES a page refetches changing (it never does, in practice — every caller passes a\n // module-level const array) shouldn't reset a live connection, only what STREAM we're on should.\n const subscriptionKey = skip\n ? null\n : `${kind}:${workspaceId}:${projectId ?? ''}:${sprintId ?? ''}:${workItemId ?? ''}`;\n\n const refetch = useCallback(() => {\n void client.refetchQueries({ include: [...queries] });\n }, [client, queries]);\n\n const trigger = useCoalescedTrigger(refetch, debounceMs, minIntervalMs);\n\n const [mode, setMode] = useState<LiveRefreshMode | null>(subscriptionKey ? 'connecting' : null);\n const [modeKey, setModeKey] = useState<string | null>(subscriptionKey);\n\n // Reset to \"connecting\" (or \"nothing to do\") the moment what we'd subscribe to changes — switching project,\n // sprint or page. This is the React-documented \"adjust state when a value changes\" pattern: a direct setState\n // call guarded by comparing against the last-seen key, during render, rather than in an effect — it lands in\n // the very render that changed, with no stale \"still connecting to the OLD target\" frame first.\n if (subscriptionKey !== modeKey) {\n setModeKey(subscriptionKey);\n setMode(subscriptionKey ? 'connecting' : null);\n }\n\n // The connect window needs a real timer; its only setState call lives inside the timeout's own callback (an\n // update \"when external state changes\"), never synchronously in the effect body. A refused subscription has\n // already errored into 'polling' by now (errors arrive at once), so a still-\"connecting\" one is open and\n // accepted — see the lifecycle note above.\n useEffect(() => {\n if (!subscriptionKey) return;\n const timer = setTimeout(() => {\n setMode((current) => (current === 'connecting' ? 'live' : current));\n }, connectTimeoutMs);\n return () => clearTimeout(timer);\n }, [subscriptionKey, connectTimeoutMs]);\n\n // Rapid-completion guard for the resubscribe below: when each stream closes within RAPID_CLOSE_MS of opening,\n // RAPID_CLOSE_LIMIT times in a row, the transport is not holding the stream open and polling takes over.\n const openedAt = useRef(0);\n const rapidCloses = useRef(0);\n const resubscribeTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(() => {\n openedAt.current = Date.now();\n rapidCloses.current = 0;\n return () => {\n if (resubscribeTimer.current) clearTimeout(resubscribeTimer.current);\n resubscribeTimer.current = null;\n };\n }, [subscriptionKey]);\n\n // The server's idle close (60 s without events), or the ALB ending a long-lived response: routine, so open a\n // fresh stream. Deferred a tick so Apollo finishes tearing down the completed one first. `restart` comes back\n // from `useSubscription` below, so it is reached through a ref kept current by an effect.\n const restartRef = useRef<(() => void) | null>(null);\n const handleComplete = useCallback(() => {\n const lived = Date.now() - openedAt.current;\n rapidCloses.current = lived < RAPID_CLOSE_MS ? rapidCloses.current + 1 : 0;\n if (rapidCloses.current >= RAPID_CLOSE_LIMIT) {\n setMode('polling');\n return;\n }\n resubscribeTimer.current = setTimeout(() => {\n resubscribeTimer.current = null;\n openedAt.current = Date.now();\n restartRef.current?.();\n }, 0);\n }, []);\n\n const { restart } = useSubscription<{\n planmagnetOnProjectUpdated?: LiveEvent;\n planmagnetOnSprintUpdated?: LiveEvent;\n planmagnetOnWorkItemUpdated?: LiveEvent;\n }>(subscriptionDocumentFor(kind), {\n variables: {\n workspaceId,\n projectId: projectId ?? undefined,\n sprintId: sprintId ?? undefined,\n workItemId: workItemId ?? undefined,\n },\n skip,\n onData: () => {\n // Proof the subscription is live: the connect-timeout above only flips a still-\"connecting\" mode, so this\n // is a no-op once already 'live', and never resurrects a mode that errored into 'polling'.\n setMode((current) => (current === 'connecting' ? 'live' : current));\n trigger();\n },\n onError: (error) => {\n // Covers both a real backend/network failure and the expected \"no SSE transport configured\" case in a\n // standalone/Storybook build (see PlanMagnetProvider) — either way the correct behavior is the same:\n // degrade to polling rather than break the page. Logged at debug level only; this is not a user-facing\n // error state.\n console.debug('[useLiveRefresh] subscription unavailable, falling back to polling:', {\n kind,\n message: error instanceof Error ? error.message : String(error),\n });\n setMode('polling');\n },\n onComplete: handleComplete,\n });\n\n useEffect(() => {\n restartRef.current = restart;\n }, [restart]);\n\n // Polling fallback: the same queries, every `pollIntervalMs`, paused while the tab is hidden. No separate\n // throttle window here — the interval itself is the pacing (30s default, already above any ANR-23 floor).\n useEffect(() => {\n if (skip || mode !== 'polling') return;\n const id = setInterval(() => {\n if (typeof document !== 'undefined' && document.visibilityState === 'hidden') return;\n refetch();\n }, pollIntervalMs);\n return () => clearInterval(id);\n }, [skip, mode, pollIntervalMs, refetch]);\n\n return { mode: skip ? null : mode };\n}\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardDashboardPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/DashboardDashboardPagePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DashboardDashboardPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/DashboardDashboardPagePage.tsx"],"names":[],"mappings":"AAyIA,wBAAgB,0BAA0B,4CAsZzC"}
|
|
@@ -3,14 +3,20 @@ 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
4
|
import { analyticsSearch as s, presetRange as c } from "./analytics/analyticsRange.js";
|
|
5
5
|
import { ROW_LINK_CLASS as l, detailPath as u, rowLinkProps as d } from "../utils/rowNavigation.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
6
|
+
import { useLiveRefresh as f } from "../hooks/useLiveRefresh.js";
|
|
7
|
+
import { LiveStatus as p } from "../controls/LiveStatus.js";
|
|
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";
|
|
9
|
+
import { gql as C } from "@apollo/client";
|
|
10
|
+
import { useQuery as w } from "@apollo/client/react";
|
|
11
|
+
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
12
|
+
import { useI18n as O } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
13
|
+
import { Badge as k, Card as A, CardContent as j, CardHeader as M, CardTitle as N } from "@burdenoff/fe-libs/ui";
|
|
12
14
|
//#region src/planmagnet/pages/DashboardDashboardPagePage.tsx
|
|
13
|
-
var
|
|
15
|
+
var P = [
|
|
16
|
+
"GetDashboardData",
|
|
17
|
+
"CountsProjects",
|
|
18
|
+
"CountsSprints"
|
|
19
|
+
], F = C`
|
|
14
20
|
query GetDashboardData($workspaceId: ID!, $today: DateTime) {
|
|
15
21
|
activeProjects: planmagnetProjects(
|
|
16
22
|
workspaceId: $workspaceId
|
|
@@ -114,137 +120,144 @@ var M = x`
|
|
|
114
120
|
}
|
|
115
121
|
}
|
|
116
122
|
`;
|
|
117
|
-
function
|
|
118
|
-
let { workspaceId:
|
|
119
|
-
workspaceId:
|
|
123
|
+
function I() {
|
|
124
|
+
let { workspaceId: C } = e(), { t: I } = O(), { data: L, loading: R, error: z } = w(F, { variables: {
|
|
125
|
+
workspaceId: C ?? "default",
|
|
120
126
|
today: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10)
|
|
121
|
-
} }),
|
|
122
|
-
|
|
127
|
+
} }), B = i(), V = a(), H = t(), U = f({
|
|
128
|
+
kind: "workItem",
|
|
129
|
+
queries: P,
|
|
130
|
+
minIntervalMs: 15e3
|
|
131
|
+
});
|
|
132
|
+
if (R && !L) return /* @__PURE__ */ E("div", {
|
|
123
133
|
className: "flex items-center justify-center p-12",
|
|
124
|
-
children: /* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ E("div", { className: "animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full" })
|
|
125
135
|
});
|
|
126
|
-
if (
|
|
136
|
+
if (z) return /* @__PURE__ */ D("div", {
|
|
127
137
|
className: "p-6 text-red-500",
|
|
128
138
|
children: [
|
|
129
|
-
|
|
139
|
+
I("planmagnet.dashboard.errorLoading", "Error loading dashboard"),
|
|
130
140
|
": ",
|
|
131
|
-
|
|
141
|
+
z.message
|
|
132
142
|
]
|
|
133
143
|
});
|
|
134
|
-
let
|
|
144
|
+
let W = L?.activeProjects?.items ?? [], G = L?.onHoldProjects?.items ?? [], K = [...L?.activeSprints?.items ?? [], ...L?.reviewSprints?.items ?? []], q = L?.upcomingMilestones?.items ?? [], J = L?.planmagnetWorkItems?.items ?? [], Y = [
|
|
135
145
|
{
|
|
136
|
-
label:
|
|
137
|
-
value: r(
|
|
138
|
-
trend: `${r(
|
|
146
|
+
label: I("planmagnet.dashboard.metrics.totalProjects.label", "Total Projects"),
|
|
147
|
+
value: r(B?.all),
|
|
148
|
+
trend: `${r(B?.active)} ${I("planmagnet.dashboard.metrics.totalProjects.trend", "active")}`
|
|
139
149
|
},
|
|
140
150
|
{
|
|
141
|
-
label:
|
|
142
|
-
value: r(
|
|
143
|
-
trend: `${r(
|
|
151
|
+
label: I("planmagnet.dashboard.metrics.activeSprints.label", "Active Sprints"),
|
|
152
|
+
value: r(V?.running),
|
|
153
|
+
trend: `${r(V?.all)} ${I("planmagnet.dashboard.metrics.activeSprints.trend", "total")}`
|
|
144
154
|
},
|
|
145
155
|
{
|
|
146
|
-
label:
|
|
147
|
-
value: r(
|
|
148
|
-
trend:
|
|
156
|
+
label: I("planmagnet.dashboard.metrics.workItems.label", "Work Items"),
|
|
157
|
+
value: r(L?.planmagnetWorkItems?.totalCount),
|
|
158
|
+
trend: I("planmagnet.dashboard.metrics.workItems.trend", "across all projects")
|
|
149
159
|
},
|
|
150
160
|
{
|
|
151
|
-
label:
|
|
152
|
-
value: r(
|
|
153
|
-
trend: `${r(
|
|
161
|
+
label: I("planmagnet.dashboard.metrics.milestones.label", "Milestones"),
|
|
162
|
+
value: r(L?.allMilestones?.totalCount),
|
|
163
|
+
trend: `${r(L?.upcomingMilestones?.totalCount)} ${I("planmagnet.dashboard.metrics.milestones.trend", "upcoming")}`
|
|
154
164
|
}
|
|
155
165
|
];
|
|
156
|
-
return /* @__PURE__ */
|
|
166
|
+
return /* @__PURE__ */ D("div", {
|
|
157
167
|
className: "space-y-6 p-6",
|
|
158
168
|
children: [
|
|
159
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ E("div", {
|
|
160
170
|
className: "flex items-center justify-between",
|
|
161
|
-
children: /* @__PURE__ */
|
|
162
|
-
className: "
|
|
163
|
-
children: [/* @__PURE__ */
|
|
164
|
-
|
|
171
|
+
children: /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ D("div", {
|
|
172
|
+
className: "flex items-center gap-2",
|
|
173
|
+
children: [/* @__PURE__ */ D("h1", {
|
|
174
|
+
className: "text-2xl font-semibold flex items-center gap-2",
|
|
175
|
+
children: [/* @__PURE__ */ E(y, { className: "h-6 w-6" }), I("planmagnet.dashboard.title", "Dashboard")]
|
|
176
|
+
}), /* @__PURE__ */ E(p, { mode: U.mode })]
|
|
177
|
+
}), /* @__PURE__ */ E("p", {
|
|
165
178
|
className: "text-sm text-muted-foreground mt-1",
|
|
166
|
-
children:
|
|
179
|
+
children: I("planmagnet.dashboard.subtitle", "Welcome back! Here is your project overview.")
|
|
167
180
|
})] })
|
|
168
181
|
}),
|
|
169
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ E("div", {
|
|
170
183
|
className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4",
|
|
171
|
-
children:
|
|
184
|
+
children: Y.map((e) => /* @__PURE__ */ D(A, {
|
|
172
185
|
"data-testid": "dashboard-tile-link",
|
|
173
|
-
...d(() =>
|
|
174
|
-
children: [/* @__PURE__ */
|
|
186
|
+
...d(() => H(`/analytics/analytics-page${s(c("30"))}`), `${e.label}: ${e.value}. ${I("planmagnet.dashboard.metrics.openAnalytics", "Open in Analytics")}`),
|
|
187
|
+
children: [/* @__PURE__ */ D(M, {
|
|
175
188
|
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
176
|
-
children: [/* @__PURE__ */
|
|
189
|
+
children: [/* @__PURE__ */ E(N, {
|
|
177
190
|
className: "text-sm font-medium",
|
|
178
191
|
children: e.label
|
|
179
|
-
}), /* @__PURE__ */
|
|
180
|
-
}), /* @__PURE__ */
|
|
192
|
+
}), /* @__PURE__ */ E(b, { className: "h-4 w-4 text-muted-foreground" })]
|
|
193
|
+
}), /* @__PURE__ */ D(j, { children: [/* @__PURE__ */ E("div", {
|
|
181
194
|
className: "text-2xl font-bold",
|
|
182
195
|
children: e.value
|
|
183
|
-
}), /* @__PURE__ */
|
|
196
|
+
}), /* @__PURE__ */ E("p", {
|
|
184
197
|
className: "text-xs text-muted-foreground",
|
|
185
198
|
children: e.trend
|
|
186
199
|
})] })]
|
|
187
200
|
}, e.label))
|
|
188
201
|
}),
|
|
189
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ D("div", {
|
|
190
203
|
className: "grid gap-6 lg:grid-cols-12",
|
|
191
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ D(A, {
|
|
192
205
|
className: "lg:col-span-8",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ E(M, { children: /* @__PURE__ */ D(N, {
|
|
194
207
|
className: "flex items-center gap-2 text-base",
|
|
195
|
-
children: [/* @__PURE__ */
|
|
196
|
-
}) }), /* @__PURE__ */
|
|
208
|
+
children: [/* @__PURE__ */ E(S, { className: "h-5 w-5 text-blue-500" }), I("planmagnet.dashboard.activeSprints.title", "Active Sprints")]
|
|
209
|
+
}) }), /* @__PURE__ */ D(j, {
|
|
197
210
|
className: "space-y-4",
|
|
198
|
-
children: [
|
|
211
|
+
children: [K.map((e) => {
|
|
199
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;
|
|
200
|
-
return /* @__PURE__ */
|
|
201
|
-
...d(() =>
|
|
213
|
+
return /* @__PURE__ */ D("div", {
|
|
214
|
+
...d(() => H(u("/projects/planning-detail-page", e.id)), e.name),
|
|
202
215
|
className: `rounded-lg border p-4 ${l}`,
|
|
203
216
|
children: [
|
|
204
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ D("div", {
|
|
205
218
|
className: "flex items-center justify-between mb-2",
|
|
206
|
-
children: [/* @__PURE__ */
|
|
219
|
+
children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("p", {
|
|
207
220
|
className: "font-medium",
|
|
208
221
|
children: e.name
|
|
209
|
-
}), /* @__PURE__ */
|
|
222
|
+
}), /* @__PURE__ */ E("p", {
|
|
210
223
|
className: "text-xs text-muted-foreground",
|
|
211
|
-
children: e.team ? /* @__PURE__ */ T
|
|
212
|
-
|
|
224
|
+
children: e.team ? /* @__PURE__ */ D(T, { children: [
|
|
225
|
+
I("planmagnet.dashboard.shared.team", "Team"),
|
|
213
226
|
": ",
|
|
214
227
|
e.team.name
|
|
215
|
-
] }) : /* @__PURE__ */ T
|
|
216
|
-
|
|
228
|
+
] }) : /* @__PURE__ */ D(T, { children: [
|
|
229
|
+
I("planmagnet.dashboard.shared.project", "Project"),
|
|
217
230
|
":",
|
|
218
231
|
" ",
|
|
219
|
-
e.project?.name ??
|
|
232
|
+
e.project?.name ?? I("planmagnet.dashboard.shared.projectUnavailable", "not available")
|
|
220
233
|
] })
|
|
221
|
-
})] }), /* @__PURE__ */
|
|
234
|
+
})] }), /* @__PURE__ */ D(k, {
|
|
222
235
|
variant: "secondary",
|
|
223
236
|
children: [
|
|
224
237
|
n,
|
|
225
238
|
"/",
|
|
226
239
|
t,
|
|
227
240
|
" ",
|
|
228
|
-
|
|
241
|
+
I("planmagnet.dashboard.shared.pointsShort", "pts")
|
|
229
242
|
]
|
|
230
243
|
})]
|
|
231
244
|
}),
|
|
232
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ E("div", {
|
|
233
246
|
className: "w-full h-2 bg-muted rounded-full overflow-hidden",
|
|
234
|
-
children: /* @__PURE__ */
|
|
247
|
+
children: /* @__PURE__ */ E("div", {
|
|
235
248
|
className: "h-full bg-primary rounded-full transition-all",
|
|
236
249
|
style: { width: `${a}%` }
|
|
237
250
|
})
|
|
238
251
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ D("div", {
|
|
240
253
|
className: "flex items-center justify-between mt-2 text-xs text-muted-foreground",
|
|
241
|
-
children: [/* @__PURE__ */
|
|
254
|
+
children: [/* @__PURE__ */ D("span", { children: [
|
|
242
255
|
i,
|
|
243
256
|
"/",
|
|
244
257
|
r,
|
|
245
258
|
" ",
|
|
246
|
-
|
|
247
|
-
] }), /* @__PURE__ */
|
|
259
|
+
I("planmagnet.dashboard.shared.tasks", "tasks")
|
|
260
|
+
] }), /* @__PURE__ */ D("span", { children: [
|
|
248
261
|
e.startDate ? new Date(e.startDate).toLocaleDateString() : "—",
|
|
249
262
|
" -",
|
|
250
263
|
" ",
|
|
@@ -253,150 +266,150 @@ function N() {
|
|
|
253
266
|
})
|
|
254
267
|
]
|
|
255
268
|
}, e.id);
|
|
256
|
-
}),
|
|
269
|
+
}), K.length === 0 && /* @__PURE__ */ E("p", {
|
|
257
270
|
className: "text-sm text-muted-foreground text-center py-4",
|
|
258
|
-
children:
|
|
271
|
+
children: I("planmagnet.dashboard.activeSprints.empty", "No active sprints.")
|
|
259
272
|
})]
|
|
260
273
|
})]
|
|
261
|
-
}), /* @__PURE__ */
|
|
274
|
+
}), /* @__PURE__ */ D("div", {
|
|
262
275
|
className: "lg:col-span-4 space-y-6",
|
|
263
|
-
children: [
|
|
276
|
+
children: [G.length > 0 && /* @__PURE__ */ D(A, { children: [/* @__PURE__ */ E(M, { children: /* @__PURE__ */ D(N, {
|
|
264
277
|
className: "flex items-center gap-2 text-base",
|
|
265
|
-
children: [/* @__PURE__ */
|
|
266
|
-
}) }), /* @__PURE__ */
|
|
278
|
+
children: [/* @__PURE__ */ E(m, { className: "h-5 w-5 text-orange-500" }), I("planmagnet.dashboard.onHoldProjects.title", "On-Hold Projects")]
|
|
279
|
+
}) }), /* @__PURE__ */ E(j, {
|
|
267
280
|
className: "space-y-3",
|
|
268
|
-
children:
|
|
281
|
+
children: G.map((e) => /* @__PURE__ */ D("div", {
|
|
269
282
|
className: "flex items-center justify-between rounded border p-2",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ E("div", { children: /* @__PURE__ */ E("p", {
|
|
271
284
|
className: "text-sm font-medium",
|
|
272
285
|
children: e.name
|
|
273
|
-
}) }), /* @__PURE__ */
|
|
286
|
+
}) }), /* @__PURE__ */ E(k, {
|
|
274
287
|
variant: "destructive",
|
|
275
288
|
children: e.status.toLowerCase().replace("_", " ")
|
|
276
289
|
})]
|
|
277
290
|
}, e.id))
|
|
278
|
-
})] }), /* @__PURE__ */
|
|
291
|
+
})] }), /* @__PURE__ */ D(A, { children: [/* @__PURE__ */ E(M, { children: /* @__PURE__ */ D(N, {
|
|
279
292
|
className: "flex items-center gap-2 text-base",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
281
|
-
}) }), /* @__PURE__ */
|
|
293
|
+
children: [/* @__PURE__ */ E(g, { className: "h-5 w-5 text-green-500" }), I("planmagnet.dashboard.upcomingMilestones.title", "Upcoming Milestones")]
|
|
294
|
+
}) }), /* @__PURE__ */ D(j, {
|
|
282
295
|
className: "space-y-3",
|
|
283
|
-
children: [
|
|
284
|
-
...d(() =>
|
|
296
|
+
children: [q.map((e) => /* @__PURE__ */ D("div", {
|
|
297
|
+
...d(() => H(u("/projects/milestone-detail-page", e.id)), e.name),
|
|
285
298
|
className: `flex items-start gap-3 rounded border p-2 ${l}`,
|
|
286
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ D("div", {
|
|
287
300
|
className: "flex-1 min-w-0",
|
|
288
301
|
children: [
|
|
289
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ E("p", {
|
|
290
303
|
className: "text-sm font-medium truncate",
|
|
291
304
|
children: e.name
|
|
292
305
|
}),
|
|
293
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ D("p", {
|
|
294
307
|
className: "text-xs text-muted-foreground",
|
|
295
308
|
children: [
|
|
296
|
-
|
|
309
|
+
I("planmagnet.dashboard.shared.project", "Project"),
|
|
297
310
|
":",
|
|
298
311
|
" ",
|
|
299
|
-
e.project?.name ??
|
|
312
|
+
e.project?.name ?? I("planmagnet.dashboard.shared.projectUnavailable", "not available")
|
|
300
313
|
]
|
|
301
314
|
}),
|
|
302
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ D("p", {
|
|
303
316
|
className: "text-xs text-muted-foreground",
|
|
304
317
|
children: [
|
|
305
|
-
|
|
318
|
+
I("planmagnet.dashboard.shared.due", "Due"),
|
|
306
319
|
" ",
|
|
307
320
|
e.dueDate ? new Date(e.dueDate).toLocaleDateString() : "—"
|
|
308
321
|
]
|
|
309
322
|
})
|
|
310
323
|
]
|
|
311
|
-
}), /* @__PURE__ */
|
|
324
|
+
}), /* @__PURE__ */ E(k, {
|
|
312
325
|
variant: "secondary",
|
|
313
326
|
className: "text-xs flex-shrink-0 capitalize",
|
|
314
327
|
children: e.status.toLowerCase().replace("_", " ")
|
|
315
328
|
})]
|
|
316
|
-
}, e.id)),
|
|
329
|
+
}, e.id)), q.length === 0 && /* @__PURE__ */ E("p", {
|
|
317
330
|
className: "text-sm text-muted-foreground text-center py-2",
|
|
318
|
-
children:
|
|
331
|
+
children: I("planmagnet.dashboard.upcomingMilestones.empty", "No upcoming milestones.")
|
|
319
332
|
})]
|
|
320
333
|
})] })]
|
|
321
334
|
})]
|
|
322
335
|
}),
|
|
323
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ D("div", {
|
|
324
337
|
className: "grid gap-6 lg:grid-cols-2",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
338
|
+
children: [/* @__PURE__ */ D(A, { children: [/* @__PURE__ */ E(M, { children: /* @__PURE__ */ D(N, {
|
|
326
339
|
className: "flex items-center gap-2 text-base",
|
|
327
|
-
children: [/* @__PURE__ */
|
|
328
|
-
}) }), /* @__PURE__ */
|
|
340
|
+
children: [/* @__PURE__ */ E(_, { className: "h-5 w-5 text-purple-500" }), I("planmagnet.dashboard.recentWorkItems.title", "Recent Work Items")]
|
|
341
|
+
}) }), /* @__PURE__ */ D(j, {
|
|
329
342
|
className: "space-y-3",
|
|
330
|
-
children: [
|
|
331
|
-
...d(() =>
|
|
343
|
+
children: [J.map((e) => /* @__PURE__ */ D("div", {
|
|
344
|
+
...d(() => H(`/tasks/task-detail-page?taskId=${encodeURIComponent(e.id)}`), `${e.key} ${e.title}`),
|
|
332
345
|
className: `flex items-center justify-between rounded border p-2 ${l}`,
|
|
333
|
-
children: [/* @__PURE__ */
|
|
346
|
+
children: [/* @__PURE__ */ D("div", {
|
|
334
347
|
className: "min-w-0 flex-1",
|
|
335
|
-
children: [/* @__PURE__ */
|
|
348
|
+
children: [/* @__PURE__ */ D("p", {
|
|
336
349
|
className: "text-sm font-medium truncate",
|
|
337
350
|
children: [
|
|
338
351
|
e.key,
|
|
339
352
|
" ",
|
|
340
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ E("span", {
|
|
341
354
|
className: "font-normal",
|
|
342
355
|
children: e.title
|
|
343
356
|
})
|
|
344
357
|
]
|
|
345
|
-
}), /* @__PURE__ */
|
|
358
|
+
}), /* @__PURE__ */ D("p", {
|
|
346
359
|
className: "text-xs text-muted-foreground",
|
|
347
|
-
children: [e.project?.name ??
|
|
360
|
+
children: [e.project?.name ?? I("planmagnet.dashboard.shared.projectUnavailable", "not available"), e.assigneeId ? /* @__PURE__ */ D(T, { children: [" · ", /* @__PURE__ */ E(n, { id: e.assigneeId })] }) : null]
|
|
348
361
|
})]
|
|
349
|
-
}), /* @__PURE__ */
|
|
362
|
+
}), /* @__PURE__ */ D("div", {
|
|
350
363
|
className: "flex items-center gap-2 flex-shrink-0",
|
|
351
|
-
children: [/* @__PURE__ */
|
|
364
|
+
children: [/* @__PURE__ */ D(k, {
|
|
352
365
|
variant: "outline",
|
|
353
366
|
className: "text-xs",
|
|
354
367
|
children: [
|
|
355
368
|
e.storyPoints ?? 0,
|
|
356
369
|
" ",
|
|
357
|
-
|
|
370
|
+
I("planmagnet.dashboard.shared.pointsShort", "pts")
|
|
358
371
|
]
|
|
359
|
-
}), /* @__PURE__ */
|
|
372
|
+
}), /* @__PURE__ */ E(k, {
|
|
360
373
|
variant: "secondary",
|
|
361
374
|
className: "text-xs capitalize",
|
|
362
375
|
children: e.status.toLowerCase().replace("_", " ")
|
|
363
376
|
})]
|
|
364
377
|
})]
|
|
365
|
-
}, e.id)),
|
|
378
|
+
}, e.id)), J.length === 0 && /* @__PURE__ */ E("p", {
|
|
366
379
|
className: "text-sm text-muted-foreground text-center py-4",
|
|
367
|
-
children:
|
|
380
|
+
children: I("planmagnet.dashboard.recentWorkItems.empty", "No work items yet.")
|
|
368
381
|
})]
|
|
369
|
-
})] }), /* @__PURE__ */
|
|
382
|
+
})] }), /* @__PURE__ */ D(A, { children: [/* @__PURE__ */ E(M, { children: /* @__PURE__ */ D(N, {
|
|
370
383
|
className: "flex items-center gap-2 text-base",
|
|
371
|
-
children: [/* @__PURE__ */
|
|
372
|
-
}) }), /* @__PURE__ */
|
|
384
|
+
children: [/* @__PURE__ */ E(v, { className: "h-5 w-5 text-cyan-500" }), I("planmagnet.dashboard.projectStatus.title", "Project Status")]
|
|
385
|
+
}) }), /* @__PURE__ */ D(j, {
|
|
373
386
|
className: "space-y-3",
|
|
374
|
-
children: [
|
|
375
|
-
...d(() =>
|
|
387
|
+
children: [W.map((e) => /* @__PURE__ */ D("div", {
|
|
388
|
+
...d(() => H(u("/projects/project-detail-page", e.id)), e.name),
|
|
376
389
|
className: `flex items-center justify-between rounded border p-2 ${l}`,
|
|
377
|
-
children: [/* @__PURE__ */
|
|
390
|
+
children: [/* @__PURE__ */ D("div", {
|
|
378
391
|
className: "min-w-0 flex-1",
|
|
379
|
-
children: [/* @__PURE__ */
|
|
392
|
+
children: [/* @__PURE__ */ E("p", {
|
|
380
393
|
className: "text-sm font-medium truncate",
|
|
381
394
|
children: e.name
|
|
382
|
-
}), /* @__PURE__ */
|
|
395
|
+
}), /* @__PURE__ */ E("p", {
|
|
383
396
|
className: "text-xs text-muted-foreground capitalize",
|
|
384
397
|
children: e.status.toLowerCase().replace("_", " ")
|
|
385
398
|
})]
|
|
386
|
-
}), /* @__PURE__ */
|
|
399
|
+
}), /* @__PURE__ */ D("div", {
|
|
387
400
|
className: "flex items-center gap-2 ml-3 flex-shrink-0",
|
|
388
401
|
children: [
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ E(x, { className: "h-3 w-3 text-muted-foreground" }),
|
|
403
|
+
/* @__PURE__ */ E("span", {
|
|
391
404
|
className: "text-xs text-muted-foreground",
|
|
392
|
-
children: /* @__PURE__ */
|
|
405
|
+
children: /* @__PURE__ */ E(n, { id: e.ownerId })
|
|
393
406
|
}),
|
|
394
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ E(h, { className: "h-3 w-3 text-muted-foreground" })
|
|
395
408
|
]
|
|
396
409
|
})]
|
|
397
|
-
}, e.id)),
|
|
410
|
+
}, e.id)), W.length === 0 && /* @__PURE__ */ E("p", {
|
|
398
411
|
className: "text-sm text-muted-foreground text-center py-4",
|
|
399
|
-
children:
|
|
412
|
+
children: I("planmagnet.dashboard.projectStatus.empty", "No active projects.")
|
|
400
413
|
})]
|
|
401
414
|
})] })]
|
|
402
415
|
})
|
|
@@ -404,6 +417,6 @@ function N() {
|
|
|
404
417
|
});
|
|
405
418
|
}
|
|
406
419
|
//#endregion
|
|
407
|
-
export {
|
|
420
|
+
export { I as DashboardDashboardPagePage };
|
|
408
421
|
|
|
409
422
|
//# sourceMappingURL=DashboardDashboardPagePage.js.map
|