@burdenoff/microfe-planmagnet 2026.924.2 → 2026.924.3
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/PlanMagnetRoot.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoot.js +93 -142
- package/dist/planmagnet/PlanMagnetRoot.js.map +1 -1
- package/dist/planmagnet/admin/PlanMagnetAdminRoot.d.ts.map +1 -1
- package/dist/planmagnet/admin/PlanMagnetAdminRoot.js +150 -149
- package/dist/planmagnet/admin/PlanMagnetAdminRoot.js.map +1 -1
- package/dist/planmagnet/pages/DashboardDashboardPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DashboardDashboardPagePage.js +113 -116
- package/dist/planmagnet/pages/DashboardDashboardPagePage.js.map +1 -1
- package/dist/planmagnet/pages/GoalsGoalsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/GoalsGoalsPagePage.js +59 -58
- package/dist/planmagnet/pages/GoalsGoalsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.js +150 -149
- package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsEditProductPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsEditProductPagePage.js +108 -107
- package/dist/planmagnet/pages/ProductsEditProductPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.js +93 -92
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsProductsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsProductsPagePage.js +89 -87
- package/dist/planmagnet/pages/ProductsProductsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js +94 -93
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsReleasesPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsReleasesPagePage.js +57 -56
- package/dist/planmagnet/pages/ProductsReleasesPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js +82 -81
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapsPagePage.js +72 -71
- package/dist/planmagnet/pages/ProductsRoadmapsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsActiveProjectsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsActiveProjectsPagePage.js +38 -37
- package/dist/planmagnet/pages/ProjectsActiveProjectsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsMilestoneDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsMilestoneDetailPagePage.js +72 -71
- package/dist/planmagnet/pages/ProjectsMilestoneDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsMilestonesPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsMilestonesPagePage.js +47 -46
- package/dist/planmagnet/pages/ProjectsMilestonesPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.js +120 -119
- 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 +131 -130
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectsPagePage.js +77 -75
- package/dist/planmagnet/pages/ProjectsProjectsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ReportsReportsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ReportsReportsPagePage.js +71 -70
- package/dist/planmagnet/pages/ReportsReportsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TeamTeamPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TeamTeamPagePage.js +58 -57
- package/dist/planmagnet/pages/TeamTeamPagePage.js.map +1 -1
- package/dist/planmagnet/pages/WorkspaceCreateWorkspacePagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/WorkspaceCreateWorkspacePagePage.js +81 -72
- package/dist/planmagnet/pages/WorkspaceCreateWorkspacePagePage.js.map +1 -1
- package/dist/planmagnet/people/People.d.ts +20 -0
- package/dist/planmagnet/people/People.d.ts.map +1 -0
- package/dist/planmagnet/people/People.js +42 -0
- package/dist/planmagnet/people/People.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsReportsPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/ReportsReportsPagePage.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent, CardHeader, CardTitle, Button } from '@burdenoff/fe-libs/ui';\nimport { BarChart3, Plus, Clock, Calendar } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\n\nconst GET_REPORTS_DATA = gql`\n query GetReportsData(\n $workspaceId: ID!\n $projectPagination: PlanmagnetPaginationInput\n $sprintPagination: PlanmagnetPaginationInput\n $workItemPagination: PlanmagnetPaginationInput\n ) {\n planmagnetProjects(workspaceId: $workspaceId, pagination: $projectPagination) {\n items {\n id\n name\n key\n status\n methodology\n startDate\n endDate\n }\n totalCount\n }\n planmagnetSprints(workspaceId: $workspaceId, pagination: $sprintPagination) {\n items {\n id\n name\n status\n velocity\n startDate\n endDate\n }\n totalCount\n }\n planmagnetWorkItems(workspaceId: $workspaceId, pagination: $workItemPagination) {\n items {\n id\n status\n storyPoints\n createdAt\n }\n totalCount\n }\n }\n`;\n\ninterface ProjectNode {\n id: string;\n name: string;\n key: string;\n status: string;\n methodology: string | null;\n startDate: string | null;\n endDate: string | null;\n}\n\ninterface SprintNode {\n id: string;\n name: string;\n status: string;\n velocity: number | null;\n startDate: string | null;\n endDate: string | null;\n}\n\ninterface WorkItemNode {\n id: string;\n status: string;\n storyPoints: number | null;\n createdAt: string;\n}\n\ninterface ReportsData {\n projects: { items: ProjectNode[]; totalCount: number };\n sprints: { items: SprintNode[]; totalCount: number };\n workItems: { items: WorkItemNode[]; totalCount: number };\n}\n\nconst typeColor: Record<string, string> = {\n velocity: 'bg-blue-100 text-blue-800',\n burndown: 'bg-orange-100 text-orange-800',\n burnup: 'bg-green-100 text-green-800',\n cumulative_flow: 'bg-purple-100 text-purple-800',\n cycle_time: 'bg-yellow-100 text-yellow-800',\n lead_time: 'bg-pink-100 text-pink-800',\n project_status: 'bg-gray-100 text-gray-800',\n};\n\nexport function ReportsReportsPagePage() {\n const { workspaceId, currentUser } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n const [typeFilter, setTypeFilter] = useState<string>('all');\n\n const { data, loading, error } = useQuery<ReportsData>(GET_REPORTS_DATA, {\n variables: {\n workspaceId,\n projectPagination: { first: 100 },\n sprintPagination: { first: 100 },\n workItemPagination: { first: 500 },\n },\n skip: !workspaceId,\n });\n\n if (loading) {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <div className=\"animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full\" />\n </div>\n );\n }\n\n if (error) {\n return <div className=\"p-6 text-red-500\">Error: {error.message}</div>;\n }\n\n const projects = data?.planmagnetProjects?.items ?? [];\n const sprints = data?.planmagnetSprints?.items ?? [];\n const workItems = data?.planmagnetWorkItems?.items ?? [];\n\n const completedSprints = sprints.filter((s) => s.status === 'COMPLETED');\n const activeSprints = sprints.filter((s) => s.status === 'ACTIVE');\n const creatorName = currentUser?.name ?? currentUser?.firstName ?? 'System';\n\n const reports = [\n ...completedSprints.map((sprint) => ({\n id: `velocity-${sprint.id}`,\n name: `${sprint.name} Velocity Report`,\n description: `Velocity analysis for ${sprint.name} (${sprint.velocity ?? 0} pts)`,\n type: 'velocity',\n createdBy: creatorName,\n lastRun: sprint.endDate ?? '',\n schedule: null as string | null,\n })),\n ...activeSprints.map((sprint) => ({\n id: `burndown-${sprint.id}`,\n name: `${sprint.name} Burndown`,\n description: `Active burndown tracking for ${sprint.name}`,\n type: 'burndown',\n createdBy: creatorName,\n lastRun: new Date().toISOString().split('T')[0],\n schedule: 'daily' as string | null,\n })),\n ...projects\n .filter((p) => p.status === 'ACTIVE')\n .map((project) => ({\n id: `status-${project.id}`,\n name: `${project.name} Status Report`,\n description: `Project status overview for ${project.key}`,\n type: 'project_status',\n createdBy: creatorName,\n lastRun: new Date().toISOString().split('T')[0],\n schedule: 'weekly' as string | null,\n })),\n ];\n\n const types = ['all', ...new Set(reports.map((r) => r.type))];\n const filtered = typeFilter === 'all' ? reports : reports.filter((r) => r.type === typeFilter);\n\n const scheduledCount = reports.filter((r) => r.schedule).length;\n const todayStr = new Date().toISOString().split('T')[0];\n const runTodayCount = reports.filter((r) => r.lastRun === todayStr).length;\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Reports</h1>\n <p className=\"text-sm text-muted-foreground\">{reports.length} reports configured</p>\n </div>\n {/* The route is `reports/create-report-page`; `/reports/create` has never\n existed, so this button navigated into the catch-all. */}\n <Button size=\"sm\" onClick={() => navigate('/reports/create-report-page')}>\n <Plus className=\"mr-1 h-4 w-4\" />\n New Report\n </Button>\n </div>\n <div className=\"grid grid-cols-3 gap-4\">\n <Card>\n <CardContent className=\"pt-4\">\n <p className=\"text-xs text-muted-foreground\">Total Reports</p>\n <p className=\"text-xl font-bold\">{reports.length}</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-4\">\n <p className=\"text-xs text-muted-foreground\">Scheduled</p>\n <p className=\"text-xl font-bold\">{scheduledCount}</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-4\">\n <p className=\"text-xs text-muted-foreground\">Run Today</p>\n <p className=\"text-xl font-bold\">{runTodayCount}</p>\n </CardContent>\n </Card>\n </div>\n <div className=\"flex gap-1\">\n {types.map((t) => (\n <button\n key={t}\n onClick={() => setTypeFilter(t)}\n className={`px-3 py-1.5 text-sm rounded-md capitalize ${typeFilter === t ? 'bg-primary text-primary-foreground' : 'text-muted-foreground hover:bg-muted'}`}\n >\n {t === 'all' ? 'All' : t.replace('_', ' ')}\n </button>\n ))}\n </div>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {filtered.map((report) => (\n <Card key={report.id}>\n <CardHeader className=\"pb-2\">\n <div className=\"flex items-center justify-between\">\n <CardTitle className=\"text-base flex items-center gap-2\">\n <BarChart3 className=\"h-4 w-4 text-primary\" />\n {report.name}\n </CardTitle>\n <span\n className={`text-xs px-2 py-0.5 rounded-full capitalize ${typeColor[report.type] ?? 'bg-gray-100'}`}\n >\n {report.type.replace('_', ' ')}\n </span>\n </div>\n </CardHeader>\n <CardContent className=\"space-y-2\">\n <p className=\"text-sm text-muted-foreground\">{report.description}</p>\n <div className=\"flex gap-3 text-xs text-muted-foreground\">\n {report.schedule && (\n <span className=\"flex items-center gap-1\">\n <Clock className=\"h-3 w-3\" />\n {report.schedule}\n </span>\n )}\n {report.lastRun && (\n <span className=\"flex items-center gap-1\">\n <Calendar className=\"h-3 w-3\" />\n Last: {report.lastRun}\n </span>\n )}\n <span className=\"flex items-center gap-1\">{report.createdBy}</span>\n </div>\n </CardContent>\n </Card>\n ))}\n {filtered.length === 0 && (\n <div className=\"col-span-2 text-center py-12\">\n <BarChart3 className=\"h-12 w-12 text-muted-foreground mx-auto mb-3\" />\n <p className=\"text-sm text-muted-foreground\">\n No reports found for the selected filter.\n </p>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AASA,IAAM,IAAmB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EtB,IAAoC;CACxC,UAAU;CACV,UAAU;CACV,QAAQ;CACR,iBAAiB;CACjB,YAAY;CACZ,WAAW;CACX,gBAAgB;CACjB;AAED,SAAgB,IAAyB;CACvC,IAAM,EAAE,gBAAa,mBAAgB,GAAe,EAC9C,IAAW,GAAuB,EAClC,CAAC,GAAY,KAAiB,EAAiB,MAAM,EAErD,EAAE,SAAM,YAAS,aAAU,EAAsB,GAAkB;EACvE,WAAW;GACT;GACA,mBAAmB,EAAE,OAAO,KAAK;GACjC,kBAAkB,EAAE,OAAO,KAAK;GAChC,oBAAoB,EAAE,OAAO,KAAK;GACnC;EACD,MAAM,CAAC;EACR,CAAC;AAEF,KAAI,EACF,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD,EAAK,WAAU,kFAAmF,CAAA;EAC9F,CAAA;AAIV,KAAI,EACF,QAAO,kBAAC,OAAD;EAAK,WAAU;YAAf,CAAkC,WAAQ,EAAM,QAAc;;CAGvE,IAAM,IAAW,GAAM,oBAAoB,SAAS,EAAE,EAChD,IAAU,GAAM,mBAAmB,SAAS,EAAE;AAClC,IAAM,qBAAqB;CAE7C,IAAM,IAAmB,EAAQ,QAAQ,MAAM,EAAE,WAAW,YAAY,EAClE,IAAgB,EAAQ,QAAQ,MAAM,EAAE,WAAW,SAAS,EAC5D,IAAc,GAAa,QAAQ,GAAa,aAAa,UAE7D,IAAU;EACd,GAAG,EAAi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;OACE,WAAW,+CAA+C,EAAU,EAAO,SAAS;iBAEnF,EAAO,KAAK,QAAQ,KAAK,IAAI;OACzB,CAAA,CACH;;KACK,CAAA,EACb,kBAAC,GAAD;KAAa,WAAU;eAAvB,CACE,kBAAC,KAAD;MAAG,WAAU;gBAAiC,EAAO;MAAgB,CAAA,EACrE,kBAAC,OAAD;MAAK,WAAU;gBAAf;OACG,EAAO,YACN,kBAAC,QAAD;QAAM,WAAU;kBAAhB,CACE,kBAAC,GAAD,EAAO,WAAU,WAAY,CAAA,EAC5B,EAAO,SACH;;OAER,EAAO,WACN,kBAAC,QAAD;QAAM,WAAU;kBAAhB;SACE,kBAAC,GAAD,EAAU,WAAU,WAAY,CAAA;;SACzB,EAAO;SACT;;OAET,kBAAC,QAAD;QAAM,WAAU;kBAA2B,EAAO;QAAiB,CAAA;OAC/D;QACM;OACT,EAAA,EAhCI,EAAO,GAgCX,CACP,EACD,EAAS,WAAW,KACnB,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,GAAD,EAAW,WAAU,gDAAiD,CAAA,EACtE,kBAAC,KAAD;MAAG,WAAU;gBAAgC;MAEzC,CAAA,CACA;OAEJ;;GACF"}
|
|
1
|
+
{"version":3,"file":"ReportsReportsPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/ReportsReportsPagePage.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent, CardHeader, CardTitle, Button } from '@burdenoff/fe-libs/ui';\nimport { BarChart3, Plus, Clock, Calendar } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { PersonName } from '../people/People';\n\nconst GET_REPORTS_DATA = gql`\n query GetReportsData(\n $workspaceId: ID!\n $projectPagination: PlanmagnetPaginationInput\n $sprintPagination: PlanmagnetPaginationInput\n $workItemPagination: PlanmagnetPaginationInput\n ) {\n planmagnetProjects(workspaceId: $workspaceId, pagination: $projectPagination) {\n items {\n id\n name\n key\n status\n methodology\n startDate\n endDate\n }\n totalCount\n }\n planmagnetSprints(workspaceId: $workspaceId, pagination: $sprintPagination) {\n items {\n id\n name\n status\n velocity\n startDate\n endDate\n }\n totalCount\n }\n planmagnetWorkItems(workspaceId: $workspaceId, pagination: $workItemPagination) {\n items {\n id\n status\n storyPoints\n createdAt\n }\n totalCount\n }\n }\n`;\n\ninterface ProjectNode {\n id: string;\n name: string;\n key: string;\n status: string;\n methodology: string | null;\n startDate: string | null;\n endDate: string | null;\n}\n\ninterface SprintNode {\n id: string;\n name: string;\n status: string;\n velocity: number | null;\n startDate: string | null;\n endDate: string | null;\n}\n\ninterface WorkItemNode {\n id: string;\n status: string;\n storyPoints: number | null;\n createdAt: string;\n}\n\ninterface ReportsData {\n projects: { items: ProjectNode[]; totalCount: number };\n sprints: { items: SprintNode[]; totalCount: number };\n workItems: { items: WorkItemNode[]; totalCount: number };\n}\n\nconst typeColor: Record<string, string> = {\n velocity: 'bg-blue-100 text-blue-800',\n burndown: 'bg-orange-100 text-orange-800',\n burnup: 'bg-green-100 text-green-800',\n cumulative_flow: 'bg-purple-100 text-purple-800',\n cycle_time: 'bg-yellow-100 text-yellow-800',\n lead_time: 'bg-pink-100 text-pink-800',\n project_status: 'bg-gray-100 text-gray-800',\n};\n\nexport function ReportsReportsPagePage() {\n const { workspaceId, currentUser } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n const [typeFilter, setTypeFilter] = useState<string>('all');\n\n const { data, loading, error } = useQuery<ReportsData>(GET_REPORTS_DATA, {\n variables: {\n workspaceId,\n projectPagination: { first: 100 },\n sprintPagination: { first: 100 },\n workItemPagination: { first: 500 },\n },\n skip: !workspaceId,\n });\n\n if (loading) {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <div className=\"animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full\" />\n </div>\n );\n }\n\n if (error) {\n return <div className=\"p-6 text-red-500\">Error: {error.message}</div>;\n }\n\n const projects = data?.planmagnetProjects?.items ?? [];\n const sprints = data?.planmagnetSprints?.items ?? [];\n const workItems = data?.planmagnetWorkItems?.items ?? [];\n\n const completedSprints = sprints.filter((s) => s.status === 'COMPLETED');\n const activeSprints = sprints.filter((s) => s.status === 'ACTIVE');\n const creatorName = currentUser?.name ?? currentUser?.firstName ?? 'System';\n\n const reports = [\n ...completedSprints.map((sprint) => ({\n id: `velocity-${sprint.id}`,\n name: `${sprint.name} Velocity Report`,\n description: `Velocity analysis for ${sprint.name} (${sprint.velocity ?? 0} pts)`,\n type: 'velocity',\n createdBy: creatorName,\n lastRun: sprint.endDate ?? '',\n schedule: null as string | null,\n })),\n ...activeSprints.map((sprint) => ({\n id: `burndown-${sprint.id}`,\n name: `${sprint.name} Burndown`,\n description: `Active burndown tracking for ${sprint.name}`,\n type: 'burndown',\n createdBy: creatorName,\n lastRun: new Date().toISOString().split('T')[0],\n schedule: 'daily' as string | null,\n })),\n ...projects\n .filter((p) => p.status === 'ACTIVE')\n .map((project) => ({\n id: `status-${project.id}`,\n name: `${project.name} Status Report`,\n description: `Project status overview for ${project.key}`,\n type: 'project_status',\n createdBy: creatorName,\n lastRun: new Date().toISOString().split('T')[0],\n schedule: 'weekly' as string | null,\n })),\n ];\n\n const types = ['all', ...new Set(reports.map((r) => r.type))];\n const filtered = typeFilter === 'all' ? reports : reports.filter((r) => r.type === typeFilter);\n\n const scheduledCount = reports.filter((r) => r.schedule).length;\n const todayStr = new Date().toISOString().split('T')[0];\n const runTodayCount = reports.filter((r) => r.lastRun === todayStr).length;\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Reports</h1>\n <p className=\"text-sm text-muted-foreground\">{reports.length} reports configured</p>\n </div>\n {/* The route is `reports/create-report-page`; `/reports/create` has never\n existed, so this button navigated into the catch-all. */}\n <Button size=\"sm\" onClick={() => navigate('/reports/create-report-page')}>\n <Plus className=\"mr-1 h-4 w-4\" />\n New Report\n </Button>\n </div>\n <div className=\"grid grid-cols-3 gap-4\">\n <Card>\n <CardContent className=\"pt-4\">\n <p className=\"text-xs text-muted-foreground\">Total Reports</p>\n <p className=\"text-xl font-bold\">{reports.length}</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-4\">\n <p className=\"text-xs text-muted-foreground\">Scheduled</p>\n <p className=\"text-xl font-bold\">{scheduledCount}</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-4\">\n <p className=\"text-xs text-muted-foreground\">Run Today</p>\n <p className=\"text-xl font-bold\">{runTodayCount}</p>\n </CardContent>\n </Card>\n </div>\n <div className=\"flex gap-1\">\n {types.map((t) => (\n <button\n key={t}\n onClick={() => setTypeFilter(t)}\n className={`px-3 py-1.5 text-sm rounded-md capitalize ${typeFilter === t ? 'bg-primary text-primary-foreground' : 'text-muted-foreground hover:bg-muted'}`}\n >\n {t === 'all' ? 'All' : t.replace('_', ' ')}\n </button>\n ))}\n </div>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {filtered.map((report) => (\n <Card key={report.id}>\n <CardHeader className=\"pb-2\">\n <div className=\"flex items-center justify-between\">\n <CardTitle className=\"text-base flex items-center gap-2\">\n <BarChart3 className=\"h-4 w-4 text-primary\" />\n {report.name}\n </CardTitle>\n <span\n className={`text-xs px-2 py-0.5 rounded-full capitalize ${typeColor[report.type] ?? 'bg-gray-100'}`}\n >\n {report.type.replace('_', ' ')}\n </span>\n </div>\n </CardHeader>\n <CardContent className=\"space-y-2\">\n <p className=\"text-sm text-muted-foreground\">{report.description}</p>\n <div className=\"flex gap-3 text-xs text-muted-foreground\">\n {report.schedule && (\n <span className=\"flex items-center gap-1\">\n <Clock className=\"h-3 w-3\" />\n {report.schedule}\n </span>\n )}\n {report.lastRun && (\n <span className=\"flex items-center gap-1\">\n <Calendar className=\"h-3 w-3\" />\n Last: {report.lastRun}\n </span>\n )}\n <span className=\"flex items-center gap-1\">\n <PersonName id={report.createdBy} />\n </span>\n </div>\n </CardContent>\n </Card>\n ))}\n {filtered.length === 0 && (\n <div className=\"col-span-2 text-center py-12\">\n <BarChart3 className=\"h-12 w-12 text-muted-foreground mx-auto mb-3\" />\n <p className=\"text-sm text-muted-foreground\">\n No reports found for the selected filter.\n </p>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAUA,IAAM,IAAmB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EtB,IAAoC;CACxC,UAAU;CACV,UAAU;CACV,QAAQ;CACR,iBAAiB;CACjB,YAAY;CACZ,WAAW;CACX,gBAAgB;CACjB;AAED,SAAgB,IAAyB;CACvC,IAAM,EAAE,gBAAa,mBAAgB,GAAe,EAC9C,IAAW,GAAuB,EAClC,CAAC,GAAY,KAAiB,EAAiB,MAAM,EAErD,EAAE,SAAM,YAAS,aAAU,EAAsB,GAAkB;EACvE,WAAW;GACT;GACA,mBAAmB,EAAE,OAAO,KAAK;GACjC,kBAAkB,EAAE,OAAO,KAAK;GAChC,oBAAoB,EAAE,OAAO,KAAK;GACnC;EACD,MAAM,CAAC;EACR,CAAC;AAEF,KAAI,EACF,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD,EAAK,WAAU,kFAAmF,CAAA;EAC9F,CAAA;AAIV,KAAI,EACF,QAAO,kBAAC,OAAD;EAAK,WAAU;YAAf,CAAkC,WAAQ,EAAM,QAAc;;CAGvE,IAAM,IAAW,GAAM,oBAAoB,SAAS,EAAE,EAChD,IAAU,GAAM,mBAAmB,SAAS,EAAE;AAClC,IAAM,qBAAqB;CAE7C,IAAM,IAAmB,EAAQ,QAAQ,MAAM,EAAE,WAAW,YAAY,EAClE,IAAgB,EAAQ,QAAQ,MAAM,EAAE,WAAW,SAAS,EAC5D,IAAc,GAAa,QAAQ,GAAa,aAAa,UAE7D,IA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;UACZ,kBAAC,QAAD;OACE,WAAW,+CAA+C,EAAU,EAAO,SAAS;iBAEnF,EAAO,KAAK,QAAQ,KAAK,IAAI;OACzB,CAAA,CACH;;KACK,CAAA,EACb,kBAAC,GAAD;KAAa,WAAU;eAAvB,CACE,kBAAC,KAAD;MAAG,WAAU;gBAAiC,EAAO;MAAgB,CAAA,EACrE,kBAAC,OAAD;MAAK,WAAU;gBAAf;OACG,EAAO,YACN,kBAAC,QAAD;QAAM,WAAU;kBAAhB,CACE,kBAAC,GAAD,EAAO,WAAU,WAAY,CAAA,EAC5B,EAAO,SACH;;OAER,EAAO,WACN,kBAAC,QAAD;QAAM,WAAU;kBAAhB;SACE,kBAAC,GAAD,EAAU,WAAU,WAAY,CAAA;;SACzB,EAAO;SACT;;OAET,kBAAC,QAAD;QAAM,WAAU;kBACd,kBAAC,GAAD,EAAY,IAAI,EAAO,WAAa,CAAA;QAC/B,CAAA;OACH;QACM;OACT,EAAA,EAlCI,EAAO,GAkCX,CACP,EACD,EAAS,WAAW,KACnB,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,GAAD,EAAW,WAAU,gDAAiD,CAAA,EACtE,kBAAC,KAAD;MAAG,WAAU;gBAAgC;MAEzC,CAAA,CACA;OAEJ;;GACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TeamTeamPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/TeamTeamPagePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TeamTeamPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/TeamTeamPagePage.tsx"],"names":[],"mappings":"AAkEA,wBAAgB,gBAAgB,4CAqK/B"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { usePlanMagnet as e } from "../providers/PlanMagnetProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { PersonName as t } from "../people/People.js";
|
|
3
|
+
import { gql as n } from "@apollo/client";
|
|
4
|
+
import { useQuery as r } from "@apollo/client/react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { Badge as o, Card as s, CardContent as c, CardHeader as l, CardTitle as u } from "@burdenoff/fe-libs/ui";
|
|
6
7
|
//#region src/planmagnet/pages/TeamTeamPagePage.tsx
|
|
7
|
-
var
|
|
8
|
+
var d = n`
|
|
8
9
|
query GetTeamData(
|
|
9
10
|
$workspaceId: ID!
|
|
10
11
|
$projectPagination: PlanmagnetPaginationInput
|
|
@@ -31,164 +32,164 @@ var u = t`
|
|
|
31
32
|
totalCount
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
|
-
`,
|
|
35
|
+
`, f = {
|
|
35
36
|
active: "bg-green-400",
|
|
36
37
|
away: "bg-yellow-400",
|
|
37
38
|
busy: "bg-red-400",
|
|
38
39
|
offline: "bg-gray-300"
|
|
39
40
|
};
|
|
40
|
-
function
|
|
41
|
-
let { workspaceId:
|
|
41
|
+
function p() {
|
|
42
|
+
let { workspaceId: n } = e(), { data: p, loading: m, error: h } = r(d, {
|
|
42
43
|
variables: {
|
|
43
|
-
workspaceId:
|
|
44
|
+
workspaceId: n,
|
|
44
45
|
projectPagination: { first: 100 },
|
|
45
46
|
workItemPagination: { first: 500 }
|
|
46
47
|
},
|
|
47
|
-
skip: !
|
|
48
|
+
skip: !n
|
|
48
49
|
});
|
|
49
|
-
if (
|
|
50
|
+
if (m) return /* @__PURE__ */ i("div", {
|
|
50
51
|
className: "flex items-center justify-center p-12",
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
+
children: /* @__PURE__ */ i("div", { className: "animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full" })
|
|
52
53
|
});
|
|
53
|
-
if (
|
|
54
|
+
if (h) return /* @__PURE__ */ a("div", {
|
|
54
55
|
className: "p-6 text-red-500",
|
|
55
|
-
children: ["Error: ",
|
|
56
|
+
children: ["Error: ", h.message]
|
|
56
57
|
});
|
|
57
|
-
let
|
|
58
|
-
let t =
|
|
58
|
+
let g = p?.planmagnetProjects?.items ?? [], _ = p?.planmagnetWorkItems?.items ?? [], v = new Set(_.filter((e) => e.assigneeId).map((e) => e.assigneeId)), y = new Set(g.filter((e) => e.ownerId).map((e) => e.ownerId)), b = new Set([...v, ...y]), x = Array.from(b).map((e) => {
|
|
59
|
+
let t = _.filter((t) => t.assigneeId === e), n = t.length, r = t.filter((e) => e.status === "DONE").length, i = t.filter((e) => e.status === "DONE").reduce((e, t) => e + (t.storyPoints ?? 0), 0);
|
|
59
60
|
return {
|
|
60
61
|
id: e,
|
|
61
62
|
name: e,
|
|
62
|
-
role:
|
|
63
|
+
role: g.filter((t) => t.ownerId === e).length > 0 ? "Project Owner" : "Contributor",
|
|
63
64
|
department: "Engineering",
|
|
64
65
|
tasksAssigned: n,
|
|
65
66
|
tasksCompleted: r,
|
|
66
67
|
velocity: i,
|
|
67
68
|
status: n > 0 ? "active" : "offline"
|
|
68
69
|
};
|
|
69
|
-
}),
|
|
70
|
+
}), S = g.reduce((e, t) => {
|
|
70
71
|
let n = t.methodology ?? "unassigned";
|
|
71
72
|
return e[n] || (e[n] = {
|
|
72
73
|
projects: [],
|
|
73
74
|
ownerIds: /* @__PURE__ */ new Set()
|
|
74
75
|
}), e[n].projects.push(t), t.ownerId && e[n].ownerIds.add(t.ownerId), e;
|
|
75
|
-
}, {}),
|
|
76
|
+
}, {}), C = Object.entries(S).map(([e, t]) => ({
|
|
76
77
|
id: e,
|
|
77
78
|
name: `${e.charAt(0).toUpperCase()}${e.slice(1)} Team`,
|
|
78
79
|
description: `Projects using ${e} methodology`,
|
|
79
80
|
projectsCount: t.projects.length,
|
|
80
81
|
leadId: Array.from(t.ownerIds)[0] ?? "Unassigned"
|
|
81
82
|
}));
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ a("div", {
|
|
83
84
|
className: "space-y-6 p-6",
|
|
84
85
|
children: [
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("h1", {
|
|
86
87
|
className: "text-2xl font-semibold",
|
|
87
88
|
children: "Team Overview"
|
|
88
|
-
}), /* @__PURE__ */
|
|
89
|
+
}), /* @__PURE__ */ a("p", {
|
|
89
90
|
className: "text-sm text-muted-foreground",
|
|
90
91
|
children: [
|
|
91
|
-
|
|
92
|
+
x.length,
|
|
92
93
|
" contributors across ",
|
|
93
|
-
|
|
94
|
+
C.length,
|
|
94
95
|
" teams"
|
|
95
96
|
]
|
|
96
97
|
})] }),
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ a("div", {
|
|
98
99
|
className: "space-y-4",
|
|
99
|
-
children: [/* @__PURE__ */
|
|
100
|
+
children: [/* @__PURE__ */ i("h2", {
|
|
100
101
|
className: "text-lg font-medium",
|
|
101
102
|
children: "Teams"
|
|
102
|
-
}), /* @__PURE__ */
|
|
103
|
+
}), /* @__PURE__ */ a("div", {
|
|
103
104
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
104
|
-
children: [
|
|
105
|
+
children: [C.map((e) => /* @__PURE__ */ a(s, { children: [/* @__PURE__ */ i(l, {
|
|
105
106
|
className: "pb-2",
|
|
106
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ a("div", {
|
|
107
108
|
className: "flex items-center justify-between",
|
|
108
|
-
children: [/* @__PURE__ */
|
|
109
|
+
children: [/* @__PURE__ */ i(u, {
|
|
109
110
|
className: "text-base",
|
|
110
111
|
children: e.name
|
|
111
|
-
}), /* @__PURE__ */
|
|
112
|
+
}), /* @__PURE__ */ a(o, {
|
|
112
113
|
variant: "outline",
|
|
113
114
|
children: [e.projectsCount, " projects"]
|
|
114
115
|
})]
|
|
115
116
|
})
|
|
116
|
-
}), /* @__PURE__ */
|
|
117
|
+
}), /* @__PURE__ */ a(c, { children: [/* @__PURE__ */ i("p", {
|
|
117
118
|
className: "text-sm text-muted-foreground",
|
|
118
119
|
children: e.description
|
|
119
|
-
}), /* @__PURE__ */
|
|
120
|
+
}), /* @__PURE__ */ a("p", {
|
|
120
121
|
className: "text-xs text-muted-foreground mt-2",
|
|
121
|
-
children: ["Lead: ", e.leadId]
|
|
122
|
-
})] })] }, e.id)),
|
|
122
|
+
children: ["Lead: ", /* @__PURE__ */ i(t, { id: e.leadId })]
|
|
123
|
+
})] })] }, e.id)), C.length === 0 && /* @__PURE__ */ i("p", {
|
|
123
124
|
className: "text-sm text-muted-foreground col-span-2 text-center py-4",
|
|
124
125
|
children: "No teams found. Create projects to see team groupings."
|
|
125
126
|
})]
|
|
126
127
|
})]
|
|
127
128
|
}),
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ a("div", {
|
|
129
130
|
className: "space-y-4",
|
|
130
|
-
children: [/* @__PURE__ */
|
|
131
|
+
children: [/* @__PURE__ */ i("h2", {
|
|
131
132
|
className: "text-lg font-medium",
|
|
132
133
|
children: "Members"
|
|
133
|
-
}), /* @__PURE__ */
|
|
134
|
+
}), /* @__PURE__ */ a("div", {
|
|
134
135
|
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
135
|
-
children: [
|
|
136
|
+
children: [x.map((e) => /* @__PURE__ */ i(s, { children: /* @__PURE__ */ a(c, {
|
|
136
137
|
className: "pt-4 space-y-3",
|
|
137
138
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ a("div", {
|
|
139
140
|
className: "flex items-center gap-3",
|
|
140
|
-
children: [/* @__PURE__ */
|
|
141
|
+
children: [/* @__PURE__ */ a("div", {
|
|
141
142
|
className: "relative",
|
|
142
|
-
children: [/* @__PURE__ */
|
|
143
|
+
children: [/* @__PURE__ */ i("div", {
|
|
143
144
|
className: "h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center text-sm font-medium text-primary",
|
|
144
145
|
children: e.name.split(/[\s-]+/).slice(0, 2).map((e) => e[0]?.toUpperCase() ?? "").join("")
|
|
145
|
-
}), /* @__PURE__ */
|
|
146
|
-
}), /* @__PURE__ */
|
|
146
|
+
}), /* @__PURE__ */ i("div", { className: `absolute -bottom-0.5 -right-0.5 h-3 w-3 rounded-full border-2 border-background ${f[e.status]}` })]
|
|
147
|
+
}), /* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("p", {
|
|
147
148
|
className: "text-sm font-medium",
|
|
148
149
|
children: e.name
|
|
149
|
-
}), /* @__PURE__ */
|
|
150
|
+
}), /* @__PURE__ */ i("p", {
|
|
150
151
|
className: "text-xs text-muted-foreground",
|
|
151
152
|
children: e.role
|
|
152
153
|
})] })]
|
|
153
154
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ a("div", {
|
|
155
156
|
className: "grid grid-cols-3 gap-2 text-center text-xs",
|
|
156
157
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("p", {
|
|
158
159
|
className: "font-semibold",
|
|
159
160
|
children: e.tasksAssigned
|
|
160
|
-
}), /* @__PURE__ */
|
|
161
|
+
}), /* @__PURE__ */ i("p", {
|
|
161
162
|
className: "text-muted-foreground",
|
|
162
163
|
children: "Assigned"
|
|
163
164
|
})] }),
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("p", {
|
|
165
166
|
className: "font-semibold",
|
|
166
167
|
children: e.tasksCompleted
|
|
167
|
-
}), /* @__PURE__ */
|
|
168
|
+
}), /* @__PURE__ */ i("p", {
|
|
168
169
|
className: "text-muted-foreground",
|
|
169
170
|
children: "Done"
|
|
170
171
|
})] }),
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("p", {
|
|
172
173
|
className: "font-semibold",
|
|
173
174
|
children: e.velocity
|
|
174
|
-
}), /* @__PURE__ */
|
|
175
|
+
}), /* @__PURE__ */ i("p", {
|
|
175
176
|
className: "text-muted-foreground",
|
|
176
177
|
children: "Velocity"
|
|
177
178
|
})] })
|
|
178
179
|
]
|
|
179
180
|
}),
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ a("div", {
|
|
181
182
|
className: "flex justify-between text-xs",
|
|
182
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ i("span", {
|
|
183
184
|
className: "text-muted-foreground",
|
|
184
185
|
children: e.department
|
|
185
|
-
}), /* @__PURE__ */
|
|
186
|
+
}), /* @__PURE__ */ i("span", {
|
|
186
187
|
className: "capitalize text-muted-foreground",
|
|
187
188
|
children: e.status
|
|
188
189
|
})]
|
|
189
190
|
})
|
|
190
191
|
]
|
|
191
|
-
}) }, e.id)),
|
|
192
|
+
}) }, e.id)), x.length === 0 && /* @__PURE__ */ i("p", {
|
|
192
193
|
className: "text-sm text-muted-foreground col-span-3 text-center py-4",
|
|
193
194
|
children: "No team members found. Assign work items to see members here."
|
|
194
195
|
})]
|
|
@@ -198,6 +199,6 @@ function f() {
|
|
|
198
199
|
});
|
|
199
200
|
}
|
|
200
201
|
//#endregion
|
|
201
|
-
export {
|
|
202
|
+
export { p as TeamTeamPagePage };
|
|
202
203
|
|
|
203
204
|
//# sourceMappingURL=TeamTeamPagePage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TeamTeamPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/TeamTeamPagePage.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent, CardHeader, CardTitle, Badge } from '@burdenoff/fe-libs/ui';\nimport { Users } from 'lucide-react';\nimport { usePlanMagnet } from '../providers/PlanMagnetProvider';\n\nconst GET_TEAM_DATA = gql`\n query GetTeamData(\n $workspaceId: ID!\n $projectPagination: PlanmagnetPaginationInput\n $workItemPagination: PlanmagnetPaginationInput\n ) {\n planmagnetProjects(workspaceId: $workspaceId, pagination: $projectPagination) {\n items {\n id\n name\n key\n status\n ownerId\n methodology\n }\n totalCount\n }\n planmagnetWorkItems(workspaceId: $workspaceId, pagination: $workItemPagination) {\n items {\n id\n status\n assigneeId\n storyPoints\n }\n totalCount\n }\n }\n`;\n\ninterface ProjectNode {\n id: string;\n name: string;\n key: string;\n status: string;\n ownerId: string | null;\n methodology: string | null;\n}\n\ninterface WorkItemNode {\n id: string;\n status: string;\n assigneeId: string | null;\n storyPoints: number | null;\n}\n\ninterface TeamData {\n projects: { items: ProjectNode[]; totalCount: number };\n workItems: { items: WorkItemNode[]; totalCount: number };\n}\n\nconst statusColor: Record<string, string> = {\n active: 'bg-green-400',\n away: 'bg-yellow-400',\n busy: 'bg-red-400',\n offline: 'bg-gray-300',\n};\n\nexport function TeamTeamPagePage() {\n const { workspaceId } = usePlanMagnet();\n\n const { data, loading, error } = useQuery<TeamData>(GET_TEAM_DATA, {\n variables: {\n workspaceId,\n projectPagination: { first: 100 },\n workItemPagination: { first: 500 },\n },\n skip: !workspaceId,\n });\n\n if (loading) {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <div className=\"animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full\" />\n </div>\n );\n }\n\n if (error) {\n return <div className=\"p-6 text-red-500\">Error: {error.message}</div>;\n }\n\n const projects = data?.planmagnetProjects?.items ?? [];\n const workItems = data?.planmagnetWorkItems?.items ?? [];\n\n const assigneeIds = new Set(\n workItems.filter((wi) => wi.assigneeId).map((wi) => wi.assigneeId as string)\n );\n const ownerIds = new Set(projects.filter((p) => p.ownerId).map((p) => p.ownerId as string));\n const allMemberIds = new Set([...assigneeIds, ...ownerIds]);\n\n const members = Array.from(allMemberIds).map((memberId) => {\n const memberWorkItems = workItems.filter((wi) => wi.assigneeId === memberId);\n const assigned = memberWorkItems.length;\n const completed = memberWorkItems.filter((wi) => wi.status === 'DONE').length;\n const velocity = memberWorkItems\n .filter((wi) => wi.status === 'DONE')\n .reduce((s, wi) => s + (wi.storyPoints ?? 0), 0);\n const memberProjects = projects.filter((p) => p.ownerId === memberId);\n\n return {\n id: memberId,\n name: memberId,\n role: memberProjects.length > 0 ? 'Project Owner' : 'Contributor',\n department: 'Engineering',\n tasksAssigned: assigned,\n tasksCompleted: completed,\n velocity,\n status: assigned > 0 ? 'active' : 'offline',\n };\n });\n\n const teamsByMethodology = projects.reduce(\n (acc, p) => {\n const method = p.methodology ?? 'unassigned';\n if (!acc[method]) {\n acc[method] = { projects: [], ownerIds: new Set<string>() };\n }\n acc[method].projects.push(p);\n if (p.ownerId) acc[method].ownerIds.add(p.ownerId);\n return acc;\n },\n {} as Record<string, { projects: ProjectNode[]; ownerIds: Set<string> }>\n );\n\n const teams = Object.entries(teamsByMethodology).map(([methodology, group]) => ({\n id: methodology,\n name: `${methodology.charAt(0).toUpperCase()}${methodology.slice(1)} Team`,\n description: `Projects using ${methodology} methodology`,\n projectsCount: group.projects.length,\n leadId: Array.from(group.ownerIds)[0] ?? 'Unassigned',\n }));\n\n return (\n <div className=\"space-y-6 p-6\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Team Overview</h1>\n <p className=\"text-sm text-muted-foreground\">\n {members.length} contributors across {teams.length} teams\n </p>\n </div>\n\n <div className=\"space-y-4\">\n <h2 className=\"text-lg font-medium\">Teams</h2>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {teams.map((team) => (\n <Card key={team.id}>\n <CardHeader className=\"pb-2\">\n <div className=\"flex items-center justify-between\">\n <CardTitle className=\"text-base\">{team.name}</CardTitle>\n <Badge variant=\"outline\">{team.projectsCount} projects</Badge>\n </div>\n </CardHeader>\n <CardContent>\n <p className=\"text-sm text-muted-foreground\">{team.description}</p>\n <p className=\"text-xs text-muted-foreground mt-2\">Lead: {team.leadId}</p>\n </CardContent>\n </Card>\n ))}\n {teams.length === 0 && (\n <p className=\"text-sm text-muted-foreground col-span-2 text-center py-4\">\n No teams found. Create projects to see team groupings.\n </p>\n )}\n </div>\n </div>\n\n <div className=\"space-y-4\">\n <h2 className=\"text-lg font-medium\">Members</h2>\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n {members.map((member) => (\n <Card key={member.id}>\n <CardContent className=\"pt-4 space-y-3\">\n <div className=\"flex items-center gap-3\">\n <div className=\"relative\">\n <div className=\"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center text-sm font-medium text-primary\">\n {member.name\n .split(/[\\s-]+/)\n .slice(0, 2)\n .map((n) => n[0]?.toUpperCase() ?? '')\n .join('')}\n </div>\n <div\n className={`absolute -bottom-0.5 -right-0.5 h-3 w-3 rounded-full border-2 border-background ${statusColor[member.status]}`}\n />\n </div>\n <div>\n <p className=\"text-sm font-medium\">{member.name}</p>\n <p className=\"text-xs text-muted-foreground\">{member.role}</p>\n </div>\n </div>\n <div className=\"grid grid-cols-3 gap-2 text-center text-xs\">\n <div>\n <p className=\"font-semibold\">{member.tasksAssigned}</p>\n <p className=\"text-muted-foreground\">Assigned</p>\n </div>\n <div>\n <p className=\"font-semibold\">{member.tasksCompleted}</p>\n <p className=\"text-muted-foreground\">Done</p>\n </div>\n <div>\n <p className=\"font-semibold\">{member.velocity}</p>\n <p className=\"text-muted-foreground\">Velocity</p>\n </div>\n </div>\n <div className=\"flex justify-between text-xs\">\n <span className=\"text-muted-foreground\">{member.department}</span>\n <span className=\"capitalize text-muted-foreground\">{member.status}</span>\n </div>\n </CardContent>\n </Card>\n ))}\n {members.length === 0 && (\n <p className=\"text-sm text-muted-foreground col-span-3 text-center py-4\">\n No team members found. Assign work items to see members here.\n </p>\n )}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;AAQA,IAAM,IAAgB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDnB,IAAsC;CAC1C,QAAQ;CACR,MAAM;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N,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,KAAD;UAAG,WAAU;oBAAiB,EAAO;UAAa,CAAA,EAClD,kBAAC,KAAD;UAAG,WAAU;oBAAwB;UAAY,CAAA,CAC7C,EAAA,CAAA;SACF;;OACN,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,QAAD;SAAM,WAAU;mBAAyB,EAAO;SAAkB,CAAA,EAClE,kBAAC,QAAD;SAAM,WAAU;mBAAoC,EAAO;SAAc,CAAA,CACrE;;OACM;SACT,EAvCI,EAAO,GAuCX,CACP,EACD,EAAQ,WAAW,KAClB,kBAAC,KAAD;MAAG,WAAU;gBAA4D;MAErE,CAAA,CAEF;OACF;;GACF"}
|
|
1
|
+
{"version":3,"file":"TeamTeamPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/TeamTeamPagePage.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent, CardHeader, CardTitle, Badge } from '@burdenoff/fe-libs/ui';\nimport { Users } from 'lucide-react';\nimport { usePlanMagnet } from '../providers/PlanMagnetProvider';\nimport { PersonName } from '../people/People';\n\nconst GET_TEAM_DATA = gql`\n query GetTeamData(\n $workspaceId: ID!\n $projectPagination: PlanmagnetPaginationInput\n $workItemPagination: PlanmagnetPaginationInput\n ) {\n planmagnetProjects(workspaceId: $workspaceId, pagination: $projectPagination) {\n items {\n id\n name\n key\n status\n ownerId\n methodology\n }\n totalCount\n }\n planmagnetWorkItems(workspaceId: $workspaceId, pagination: $workItemPagination) {\n items {\n id\n status\n assigneeId\n storyPoints\n }\n totalCount\n }\n }\n`;\n\ninterface ProjectNode {\n id: string;\n name: string;\n key: string;\n status: string;\n ownerId: string | null;\n methodology: string | null;\n}\n\ninterface WorkItemNode {\n id: string;\n status: string;\n assigneeId: string | null;\n storyPoints: number | null;\n}\n\ninterface TeamData {\n projects: { items: ProjectNode[]; totalCount: number };\n workItems: { items: WorkItemNode[]; totalCount: number };\n}\n\nconst statusColor: Record<string, string> = {\n active: 'bg-green-400',\n away: 'bg-yellow-400',\n busy: 'bg-red-400',\n offline: 'bg-gray-300',\n};\n\nexport function TeamTeamPagePage() {\n const { workspaceId } = usePlanMagnet();\n\n const { data, loading, error } = useQuery<TeamData>(GET_TEAM_DATA, {\n variables: {\n workspaceId,\n projectPagination: { first: 100 },\n workItemPagination: { first: 500 },\n },\n skip: !workspaceId,\n });\n\n if (loading) {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <div className=\"animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full\" />\n </div>\n );\n }\n\n if (error) {\n return <div className=\"p-6 text-red-500\">Error: {error.message}</div>;\n }\n\n const projects = data?.planmagnetProjects?.items ?? [];\n const workItems = data?.planmagnetWorkItems?.items ?? [];\n\n const assigneeIds = new Set(\n workItems.filter((wi) => wi.assigneeId).map((wi) => wi.assigneeId as string)\n );\n const ownerIds = new Set(projects.filter((p) => p.ownerId).map((p) => p.ownerId as string));\n const allMemberIds = new Set([...assigneeIds, ...ownerIds]);\n\n const members = Array.from(allMemberIds).map((memberId) => {\n const memberWorkItems = workItems.filter((wi) => wi.assigneeId === memberId);\n const assigned = memberWorkItems.length;\n const completed = memberWorkItems.filter((wi) => wi.status === 'DONE').length;\n const velocity = memberWorkItems\n .filter((wi) => wi.status === 'DONE')\n .reduce((s, wi) => s + (wi.storyPoints ?? 0), 0);\n const memberProjects = projects.filter((p) => p.ownerId === memberId);\n\n return {\n id: memberId,\n name: memberId,\n role: memberProjects.length > 0 ? 'Project Owner' : 'Contributor',\n department: 'Engineering',\n tasksAssigned: assigned,\n tasksCompleted: completed,\n velocity,\n status: assigned > 0 ? 'active' : 'offline',\n };\n });\n\n const teamsByMethodology = projects.reduce(\n (acc, p) => {\n const method = p.methodology ?? 'unassigned';\n if (!acc[method]) {\n acc[method] = { projects: [], ownerIds: new Set<string>() };\n }\n acc[method].projects.push(p);\n if (p.ownerId) acc[method].ownerIds.add(p.ownerId);\n return acc;\n },\n {} as Record<string, { projects: ProjectNode[]; ownerIds: Set<string> }>\n );\n\n const teams = Object.entries(teamsByMethodology).map(([methodology, group]) => ({\n id: methodology,\n name: `${methodology.charAt(0).toUpperCase()}${methodology.slice(1)} Team`,\n description: `Projects using ${methodology} methodology`,\n projectsCount: group.projects.length,\n leadId: Array.from(group.ownerIds)[0] ?? 'Unassigned',\n }));\n\n return (\n <div className=\"space-y-6 p-6\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Team Overview</h1>\n <p className=\"text-sm text-muted-foreground\">\n {members.length} contributors across {teams.length} teams\n </p>\n </div>\n\n <div className=\"space-y-4\">\n <h2 className=\"text-lg font-medium\">Teams</h2>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {teams.map((team) => (\n <Card key={team.id}>\n <CardHeader className=\"pb-2\">\n <div className=\"flex items-center justify-between\">\n <CardTitle className=\"text-base\">{team.name}</CardTitle>\n <Badge variant=\"outline\">{team.projectsCount} projects</Badge>\n </div>\n </CardHeader>\n <CardContent>\n <p className=\"text-sm text-muted-foreground\">{team.description}</p>\n <p className=\"text-xs text-muted-foreground mt-2\">\n Lead: <PersonName id={team.leadId} />\n </p>\n </CardContent>\n </Card>\n ))}\n {teams.length === 0 && (\n <p className=\"text-sm text-muted-foreground col-span-2 text-center py-4\">\n No teams found. Create projects to see team groupings.\n </p>\n )}\n </div>\n </div>\n\n <div className=\"space-y-4\">\n <h2 className=\"text-lg font-medium\">Members</h2>\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n {members.map((member) => (\n <Card key={member.id}>\n <CardContent className=\"pt-4 space-y-3\">\n <div className=\"flex items-center gap-3\">\n <div className=\"relative\">\n <div className=\"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center text-sm font-medium text-primary\">\n {member.name\n .split(/[\\s-]+/)\n .slice(0, 2)\n .map((n) => n[0]?.toUpperCase() ?? '')\n .join('')}\n </div>\n <div\n className={`absolute -bottom-0.5 -right-0.5 h-3 w-3 rounded-full border-2 border-background ${statusColor[member.status]}`}\n />\n </div>\n <div>\n <p className=\"text-sm font-medium\">{member.name}</p>\n <p className=\"text-xs text-muted-foreground\">{member.role}</p>\n </div>\n </div>\n <div className=\"grid grid-cols-3 gap-2 text-center text-xs\">\n <div>\n <p className=\"font-semibold\">{member.tasksAssigned}</p>\n <p className=\"text-muted-foreground\">Assigned</p>\n </div>\n <div>\n <p className=\"font-semibold\">{member.tasksCompleted}</p>\n <p className=\"text-muted-foreground\">Done</p>\n </div>\n <div>\n <p className=\"font-semibold\">{member.velocity}</p>\n <p className=\"text-muted-foreground\">Velocity</p>\n </div>\n </div>\n <div className=\"flex justify-between text-xs\">\n <span className=\"text-muted-foreground\">{member.department}</span>\n <span className=\"capitalize text-muted-foreground\">{member.status}</span>\n </div>\n </CardContent>\n </Card>\n ))}\n {members.length === 0 && (\n <p className=\"text-sm text-muted-foreground col-span-3 text-center py-4\">\n No team members found. Assign work items to see members here.\n </p>\n )}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;AASA,IAAM,IAAgB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDnB,IAAsC;CAC1C,QAAQ;CACR,MAAM;CACN,MAAM;CACN,SAAS;CACV;AAED,SAAgB,IAAmB;CACjC,IAAM,EAAE,mBAAgB,GAAe,EAEjC,EAAE,SAAM,YAAS,aAAU,EAAmB,GAAe;EACjE,WAAW;GACT;GACA,mBAAmB,EAAE,OAAO,KAAK;GACjC,oBAAoB,EAAE,OAAO,KAAK;GACnC;EACD,MAAM,CAAC;EACR,CAAC;AAEF,KAAI,EACF,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD,EAAK,WAAU,kFAAmF,CAAA;EAC9F,CAAA;AAIV,KAAI,EACF,QAAO,kBAAC,OAAD;EAAK,WAAU;YAAf,CAAkC,WAAQ,EAAM,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,kBAAC,KAAD;MAAG,WAAU;gBAA4D;MAErE,CAAA,CAEF;OACF;;GACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceCreateWorkspacePagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/WorkspaceCreateWorkspacePagePage.tsx"],"names":[],"mappings":"AAOA,wBAAgB,gCAAgC,
|
|
1
|
+
{"version":3,"file":"WorkspaceCreateWorkspacePagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/WorkspaceCreateWorkspacePagePage.tsx"],"names":[],"mappings":"AAOA,wBAAgB,gCAAgC,4CA2F/C"}
|
|
@@ -12,83 +12,92 @@ function m() {
|
|
|
12
12
|
});
|
|
13
13
|
return /* @__PURE__ */ s("div", {
|
|
14
14
|
className: "space-y-6 p-6 max-w-4xl",
|
|
15
|
-
children: [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ s("div", {
|
|
17
|
+
className: "flex items-center justify-between",
|
|
18
|
+
children: [/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("h1", {
|
|
19
|
+
className: "text-2xl font-semibold",
|
|
20
|
+
children: "Create Workspace"
|
|
21
|
+
}), /* @__PURE__ */ o("p", {
|
|
22
|
+
className: "text-sm text-muted-foreground",
|
|
23
|
+
children: "Set up a new workspace for your organization."
|
|
24
|
+
})] }), /* @__PURE__ */ s("div", {
|
|
25
|
+
className: "flex gap-2",
|
|
26
|
+
children: [/* @__PURE__ */ s(c, {
|
|
27
|
+
variant: "outline",
|
|
28
|
+
size: "sm",
|
|
29
|
+
onClick: () => h("/"),
|
|
30
|
+
children: [/* @__PURE__ */ o(a, { className: "mr-1 h-4 w-4" }), "Cancel"]
|
|
31
|
+
}), /* @__PURE__ */ s(c, {
|
|
32
|
+
size: "sm",
|
|
33
|
+
disabled: !0,
|
|
34
|
+
title: "Not available here — see the notice below",
|
|
35
|
+
children: [/* @__PURE__ */ o(i, { className: "mr-1 h-4 w-4" }), "Create Workspace"]
|
|
36
|
+
})]
|
|
36
37
|
})]
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
className: "mt-1",
|
|
55
|
-
placeholder: "e.g. PlanMagnet HQ"
|
|
56
|
-
})] }),
|
|
57
|
-
/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("label", {
|
|
58
|
-
className: "text-sm font-medium",
|
|
59
|
-
children: "URL Slug"
|
|
60
|
-
}), /* @__PURE__ */ s("div", {
|
|
61
|
-
className: "mt-1 flex items-center gap-1",
|
|
62
|
-
children: [/* @__PURE__ */ o("span", {
|
|
63
|
-
className: "text-sm text-muted-foreground",
|
|
64
|
-
children: "planmagnet.com/"
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ s("div", {
|
|
40
|
+
className: "rounded-md border border-border bg-muted p-4 text-sm text-muted-foreground",
|
|
41
|
+
children: [/* @__PURE__ */ o("strong", {
|
|
42
|
+
className: "text-foreground",
|
|
43
|
+
children: "Not available here."
|
|
44
|
+
}), " Workspaces are created from the workspace switcher at the top of the app, not from PlanMagnet. Nothing entered on this page is stored."]
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ s(l, { children: [/* @__PURE__ */ o(d, { children: /* @__PURE__ */ s(f, {
|
|
47
|
+
className: "flex items-center gap-2",
|
|
48
|
+
children: [/* @__PURE__ */ o(r, { className: "h-4 w-4" }), "Workspace Details"]
|
|
49
|
+
}) }), /* @__PURE__ */ s(u, {
|
|
50
|
+
className: "space-y-4",
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("label", {
|
|
53
|
+
className: "text-sm font-medium",
|
|
54
|
+
children: "Workspace Name"
|
|
65
55
|
}), /* @__PURE__ */ o(p, {
|
|
66
|
-
value: g.
|
|
56
|
+
value: g.name,
|
|
67
57
|
onChange: (e) => _({
|
|
68
58
|
...g,
|
|
69
|
-
|
|
59
|
+
name: e.target.value,
|
|
60
|
+
slug: e.target.value.toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "")
|
|
70
61
|
}),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
62
|
+
className: "mt-1",
|
|
63
|
+
placeholder: "e.g. PlanMagnet HQ"
|
|
64
|
+
})] }),
|
|
65
|
+
/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("label", {
|
|
66
|
+
className: "text-sm font-medium",
|
|
67
|
+
children: "URL Slug"
|
|
68
|
+
}), /* @__PURE__ */ s("div", {
|
|
69
|
+
className: "mt-1 flex items-center gap-1",
|
|
70
|
+
children: [/* @__PURE__ */ o("span", {
|
|
71
|
+
className: "text-sm text-muted-foreground",
|
|
72
|
+
children: "planmagnet.com/"
|
|
73
|
+
}), /* @__PURE__ */ o(p, {
|
|
74
|
+
value: g.slug,
|
|
75
|
+
onChange: (e) => _({
|
|
76
|
+
...g,
|
|
77
|
+
slug: e.target.value
|
|
78
|
+
}),
|
|
79
|
+
placeholder: "planmagnet-hq"
|
|
80
|
+
})]
|
|
81
|
+
})] }),
|
|
82
|
+
/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("label", {
|
|
83
|
+
className: "text-sm font-medium",
|
|
84
|
+
children: "Description"
|
|
85
|
+
}), /* @__PURE__ */ o("textarea", {
|
|
86
|
+
className: "mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm min-h-[80px]",
|
|
87
|
+
value: g.description,
|
|
88
|
+
onChange: (e) => _({
|
|
89
|
+
...g,
|
|
90
|
+
description: e.target.value
|
|
91
|
+
}),
|
|
92
|
+
placeholder: "Describe what this workspace is for..."
|
|
93
|
+
})] }),
|
|
94
|
+
m && /* @__PURE__ */ s("p", {
|
|
95
|
+
className: "text-xs text-muted-foreground",
|
|
96
|
+
children: ["Current workspace: ", m]
|
|
97
|
+
})
|
|
98
|
+
]
|
|
99
|
+
})] })
|
|
100
|
+
]
|
|
92
101
|
});
|
|
93
102
|
}
|
|
94
103
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceCreateWorkspacePagePage.js","names":[],"sources":["../../../src/planmagnet/pages/WorkspaceCreateWorkspacePagePage.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { useState } from 'react';\nimport { Card, CardContent, CardHeader, CardTitle, Button, Input } from '@burdenoff/fe-libs/ui';\nimport { Save, X, Building2 } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\n\nexport function WorkspaceCreateWorkspacePagePage() {\n const { workspaceId } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n const [form, setForm] = useState({ name: '', description: '', slug: '' });\n\n
|
|
1
|
+
{"version":3,"file":"WorkspaceCreateWorkspacePagePage.js","names":[],"sources":["../../../src/planmagnet/pages/WorkspaceCreateWorkspacePagePage.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { useState } from 'react';\nimport { Card, CardContent, CardHeader, CardTitle, Button, Input } from '@burdenoff/fe-libs/ui';\nimport { Save, X, Building2 } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\n\nexport function WorkspaceCreateWorkspacePagePage() {\n const { workspaceId } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n const [form, setForm] = useState({ name: '', description: '', slug: '' });\n\n // NOTE: nothing here can create a workspace. Workspaces are a platform\n // capability, created from the shell's workspace switcher; this MFE has no\n // workspace mutation. The previous handler only called navigate('/'), so a\n // user named a workspace, clicked Create, landed on the home page, and no\n // workspace existed — indistinguishable from success (found 2026-09-24). The\n // button is disabled and the notice points to the real flow, matching the\n // Create Report / Create Team / Invite Member pages.\n\n return (\n <div className=\"space-y-6 p-6 max-w-4xl\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Create Workspace</h1>\n <p className=\"text-sm text-muted-foreground\">\n Set up a new workspace for your organization.\n </p>\n </div>\n <div className=\"flex gap-2\">\n <Button variant=\"outline\" size=\"sm\" onClick={() => navigate('/')}>\n <X className=\"mr-1 h-4 w-4\" />\n Cancel\n </Button>\n <Button size=\"sm\" disabled title=\"Not available here — see the notice below\">\n <Save className=\"mr-1 h-4 w-4\" />\n Create Workspace\n </Button>\n </div>\n </div>\n <div className=\"rounded-md border border-border bg-muted p-4 text-sm text-muted-foreground\">\n <strong className=\"text-foreground\">Not available here.</strong> Workspaces are created from\n the workspace switcher at the top of the app, not from PlanMagnet. Nothing entered on this\n page is stored.\n </div>\n <Card>\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <Building2 className=\"h-4 w-4\" />\n Workspace Details\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <div>\n <label className=\"text-sm font-medium\">Workspace Name</label>\n <Input\n value={form.name}\n onChange={(e) =>\n setForm({\n ...form,\n name: e.target.value,\n slug: e.target.value\n .toLowerCase()\n .replace(/\\s+/g, '-')\n .replace(/[^a-z0-9-]/g, ''),\n })\n }\n className=\"mt-1\"\n placeholder=\"e.g. PlanMagnet HQ\"\n />\n </div>\n <div>\n <label className=\"text-sm font-medium\">URL Slug</label>\n <div className=\"mt-1 flex items-center gap-1\">\n <span className=\"text-sm text-muted-foreground\">planmagnet.com/</span>\n <Input\n value={form.slug}\n onChange={(e) => setForm({ ...form, slug: e.target.value })}\n placeholder=\"planmagnet-hq\"\n />\n </div>\n </div>\n <div>\n <label className=\"text-sm font-medium\">Description</label>\n <textarea\n className=\"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm min-h-[80px]\"\n value={form.description}\n onChange={(e) => setForm({ ...form, description: e.target.value })}\n placeholder=\"Describe what this workspace is for...\"\n />\n </div>\n {workspaceId && (\n <p className=\"text-xs text-muted-foreground\">Current workspace: {workspaceId}</p>\n )}\n </CardContent>\n </Card>\n </div>\n );\n}\n"],"mappings":";;;;;;AAOA,SAAgB,IAAmC;CACjD,IAAM,EAAE,mBAAgB,GAAe,EACjC,IAAW,GAAuB,EAClC,CAAC,GAAM,KAAW,EAAS;EAAE,MAAM;EAAI,aAAa;EAAI,MAAM;EAAI,CAAC;AAUzE,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;eAAyB;KAAqB,CAAA,EAC5D,kBAAC,KAAD;KAAG,WAAU;eAAgC;KAEzC,CAAA,CACA,EAAA,CAAA,EACN,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,GAAD;MAAQ,SAAQ;MAAU,MAAK;MAAK,eAAe,EAAS,IAAI;gBAAhE,CACE,kBAAC,GAAD,EAAG,WAAU,gBAAiB,CAAA,EAAA,SAEvB;SACT,kBAAC,GAAD;MAAQ,MAAK;MAAK,UAAA;MAAS,OAAM;gBAAjC,CACE,kBA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MACZ,CAAA,CACE,EAAA,CAAA;KACL,KACC,kBAAC,KAAD;MAAG,WAAU;gBAAb,CAA6C,uBAAoB,EAAgB;;KAEvE;MACT,EAAA,CAAA;GACH"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare function PeopleProvider({ workspaceId, children, }: {
|
|
4
|
+
workspaceId?: string;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export interface PersonNameProps {
|
|
8
|
+
/** A user id. Empty or missing renders an em dash. */
|
|
9
|
+
id: string | null | undefined;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Inline text on purpose. fe-libs' `ActorIdentity` is a block (avatar plus two
|
|
14
|
+
* stacked paragraphs); every place this replaces is an inline label —
|
|
15
|
+
* "Owner: …", a table cell, a <span> inside a <p> — where a block would break
|
|
16
|
+
* the layout and nest a <div> inside a <p>. The email, when known, is the
|
|
17
|
+
* hover title, so two people with the same name stay distinguishable.
|
|
18
|
+
*/
|
|
19
|
+
export declare function PersonName({ id, className }: PersonNameProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=People.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"People.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/people/People.tsx"],"names":[],"mappings":"AAMA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AA8Bf,wBAAgB,cAAc,CAAC,EAC7B,WAAW,EACX,QAAQ,GACT,EAAE;IACD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAkBA;AAED,MAAM,WAAW,eAAe;IAC9B,sDAAsD;IACtD,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,eAAe,2CAgB5D"}
|