@burdenoff/microfe-planmagnet 2026.830.1 → 2026.923.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/planmagnet/PlanMagnetRoutes.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.js +32 -0
- package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
- package/dist/planmagnet/pages/ProductsFeaturesPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsFeaturesPagePage.js +148 -144
- package/dist/planmagnet/pages/ProductsFeaturesPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsProductsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsProductsPagePage.js +85 -84
- package/dist/planmagnet/pages/ProductsProductsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsReleasesPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsReleasesPagePage.js +95 -91
- package/dist/planmagnet/pages/ProductsReleasesPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapsPagePage.js +117 -113
- package/dist/planmagnet/pages/ProductsRoadmapsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TasksTasksPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksTasksPagePage.js +67 -66
- package/dist/planmagnet/pages/TasksTasksPagePage.js.map +1 -1
- package/dist/planmagnet/utils/rowNavigation.d.ts +29 -0
- package/dist/planmagnet/utils/rowNavigation.d.ts.map +1 -0
- package/dist/planmagnet/utils/rowNavigation.js +20 -0
- package/dist/planmagnet/utils/rowNavigation.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductsFeaturesPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/ProductsFeaturesPagePage.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, Badge, Button } from '@burdenoff/fe-libs/ui';\nimport {\n Star,\n Plus,\n ThumbsUp,\n MessageSquare,\n Target,\n Filter,\n ArrowUpDown,\n Loader2,\n} from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\n\nconst LIST_FEATURE_REQUESTS = gql`\n query ListFeatureRequests(\n $workspaceId: ID!\n $filter: PlanmagnetFeatureRequestFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetFeatureRequests(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {\n items {\n id\n title\n description\n status\n businessValue\n effortEstimate\n priorityScore\n voteCount\n submittedBy\n tags\n createdAt\n updatedAt\n }\n totalCount\n }\n }\n`;\n\ninterface FeatureRequestNode {\n id: string;\n title: string;\n description: string | null;\n status: string;\n businessValue: number | null;\n effortEstimate: string | null;\n priorityScore: number | null;\n voteCount: number;\n submittedBy: string;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n}\n\nconst statusColor: Record<string, string> = {\n SUBMITTED: 'bg-gray-100 text-gray-800',\n UNDER_REVIEW: 'bg-yellow-100 text-yellow-800',\n PLANNED: 'bg-blue-100 text-blue-800',\n IN_PROGRESS: 'bg-purple-100 text-purple-800',\n COMPLETED: 'bg-green-100 text-green-800',\n DECLINED: 'bg-red-100 text-red-800',\n DUPLICATE: 'bg-orange-100 text-orange-800',\n};\n\nexport function ProductsFeaturesPagePage() {\n const navigate = usePlanMagnetNavigate();\n const { workspaceId } = usePlanMagnet();\n const [statusFilter, setStatusFilter] = useState<string>('all');\n const [sortBy, setSortBy] = useState<'priorityScore' | 'voteCount' | 'businessValue'>(\n 'priorityScore'\n );\n\n const {\n data,\n loading,\n error,\n } = // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery<Record<string, any>>(LIST_FEATURE_REQUESTS, {\n variables: {\n workspaceId,\n filter: statusFilter !== 'all' ? { status: statusFilter } : undefined,\n pagination: { first: 50 },\n },\n skip: !workspaceId,\n });\n\n if (loading) {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <Loader2 className=\"h-8 w-8 animate-spin text-muted-foreground\" />\n </div>\n );\n }\n\n if (error) {\n return <div className=\"p-6 text-destructive\">Failed to load features: {error.message}</div>;\n }\n\n const features: FeatureRequestNode[] = data?.planmagnetFeatureRequests?.items ?? [];\n const totalCount = data?.planmagnetFeatureRequests?.totalCount ?? 0;\n\n const sorted = [...features].sort((a, b) => {\n const aVal = a[sortBy] ?? 0;\n const bVal = b[sortBy] ?? 0;\n return (bVal as number) - (aVal as number);\n });\n\n const statuses = [\n 'all',\n 'SUBMITTED',\n 'UNDER_REVIEW',\n 'PLANNED',\n 'IN_PROGRESS',\n 'COMPLETED',\n 'DECLINED',\n 'DUPLICATE',\n ];\n\n const stats = {\n total: totalCount,\n inProgress: features.filter((f) => f.status === 'IN_PROGRESS').length,\n completed: features.filter((f) => f.status === 'COMPLETED').length,\n avgPriority:\n features.length > 0\n ? Math.round(features.reduce((s, f) => s + (f.priorityScore ?? 0), 0) / features.length)\n : 0,\n };\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\">Features</h1>\n <p className=\"text-sm text-muted-foreground\">\n {totalCount} feature requests across all products\n </p>\n </div>\n <Button size=\"sm\" onClick={() => navigate('/products/new-feature-page')}>\n <Plus className=\"mr-1 h-4 w-4\" />\n New Feature\n </Button>\n </div>\n\n <div className=\"grid grid-cols-2 md:grid-cols-4 gap-4\">\n <Card>\n <CardContent className=\"pt-4\">\n <p className=\"text-xs text-muted-foreground\">Total Features</p>\n <p className=\"text-xl font-bold\">{stats.total}</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-4\">\n <p className=\"text-xs text-muted-foreground\">In Progress</p>\n <p className=\"text-xl font-bold\">{stats.inProgress}</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-4\">\n <p className=\"text-xs text-muted-foreground\">Completed</p>\n <p className=\"text-xl font-bold\">{stats.completed}</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-4\">\n <p className=\"text-xs text-muted-foreground\">Avg Priority Score</p>\n <p className=\"text-xl font-bold\">{stats.avgPriority}</p>\n </CardContent>\n </Card>\n </div>\n\n <div className=\"flex items-center justify-between flex-wrap gap-2\">\n <div className=\"flex items-center gap-2\">\n <Filter className=\"h-4 w-4 text-muted-foreground\" />\n {statuses.map((s) => (\n <button\n key={s}\n onClick={() => setStatusFilter(s)}\n className={`px-2 py-1 text-xs rounded-md capitalize ${statusFilter === s ? 'bg-primary text-primary-foreground' : 'bg-muted text-muted-foreground'}`}\n >\n {s === 'all' ? 'All' : s.toLowerCase().replace('_', ' ')}\n </button>\n ))}\n </div>\n <div className=\"flex items-center gap-2\">\n <ArrowUpDown className=\"h-4 w-4 text-muted-foreground\" />\n {(['priorityScore', 'voteCount', 'businessValue'] as const).map((s) => (\n <button\n key={s}\n onClick={() => setSortBy(s)}\n className={`px-2 py-1 text-xs rounded-md capitalize ${sortBy === s ? 'bg-primary text-primary-foreground' : 'bg-muted text-muted-foreground'}`}\n >\n {s === 'priorityScore' ? 'Priority' : s === 'voteCount' ? 'Votes' : 'Value'}\n </button>\n ))}\n </div>\n </div>\n\n <div className=\"space-y-3\">\n {sorted.map((feature) => (\n <Card key={feature.id}>\n <CardContent className=\"py-4\">\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"flex-1 space-y-2\">\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm font-medium\">{feature.title}</span>\n <span\n className={`text-[10px] px-1.5 py-0.5 rounded-full capitalize ${statusColor[feature.status] ?? 'bg-gray-100'}`}\n >\n {feature.status.toLowerCase().replace('_', ' ')}\n </span>\n </div>\n <p className=\"text-xs text-muted-foreground\">{feature.description}</p>\n <div className=\"flex items-center gap-4 text-xs text-muted-foreground\">\n <span>Effort: {feature.effortEstimate ?? 'N/A'}</span>\n <span>Submitted by: {feature.submittedBy}</span>\n <span>{new Date(feature.updatedAt).toLocaleDateString()}</span>\n </div>\n {feature.tags.length > 0 && (\n <div className=\"flex gap-1\">\n {feature.tags.map((tag) => (\n <Badge key={tag} variant=\"outline\" className=\"text-[10px]\">\n {tag}\n </Badge>\n ))}\n </div>\n )}\n </div>\n <div className=\"flex items-center gap-4 shrink-0\">\n <div className=\"text-center\">\n <div className=\"flex items-center gap-1\">\n <Target className=\"h-3 w-3 text-primary\" />\n <span className=\"text-sm font-bold\">{feature.priorityScore ?? 0}</span>\n </div>\n <p className=\"text-[10px] text-muted-foreground\">Priority</p>\n </div>\n <div className=\"text-center\">\n <div className=\"flex items-center gap-1\">\n <ThumbsUp className=\"h-3 w-3 text-green-500\" />\n <span className=\"text-sm font-bold\">{feature.voteCount}</span>\n </div>\n <p className=\"text-[10px] text-muted-foreground\">Votes</p>\n </div>\n <div className=\"text-center\">\n <div className=\"flex items-center gap-1\">\n <Star className=\"h-3 w-3 text-yellow-500\" />\n <span className=\"text-sm font-bold\">{feature.businessValue ?? 0}</span>\n </div>\n <p className=\"text-[10px] text-muted-foreground\">Value</p>\n </div>\n </div>\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n {sorted.length === 0 && (\n <p className=\"text-center text-muted-foreground py-8\">\n No features match the selected filters.\n </p>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAkBA,IAAM,IAAwB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;GAyC3B,IAAsC;CAC1C,WAAW;CACX,cAAc;CACd,SAAS;CACT,aAAa;CACb,WAAW;CACX,UAAU;CACV,WAAW;CACZ;AAED,SAAgB,IAA2B;CACzC,IAAM,IAAW,GAAuB,EAClC,EAAE,mBAAgB,GAAe,EACjC,CAAC,GAAc,KAAmB,EAAiB,MAAM,EAC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,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,GAAD,EAAQ,WAAU,wBAAyB,CAAA,EAC3C,kBAAC,QAAD;WAAM,WAAU;qBAAqB,EAAQ,iBAAiB;WAAS,CAAA,CACnE;aACN,kBAAC,KAAD;UAAG,WAAU;oBAAoC;UAAY,CAAA,CACzD;;QACN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,GAAD,EAAU,WAAU,0BAA2B,CAAA,EAC/C,kBAAC,QAAD;WAAM,WAAU;qBAAqB,EAAQ;WAAiB,CAAA,CAC1D;aACN,kBAAC,KAAD;UAAG,WAAU;oBAAoC;UAAS,CAAA,CACtD;;QACN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,GAAD,EAAM,WAAU,2BAA4B,CAAA,EAC5C,kBAAC,QAAD;WAAM,WAAU;qBAAqB,EAAQ,iBAAiB;WAAS,CAAA,CACnE;aACN,kBAAC,KAAD;UAAG,WAAU;oBAAoC;UAAS,CAAA,CACtD;;QACF;SACF;;KACM,CAAA,EACT,EArDI,EAAQ,GAqDZ,CACP;IACE,CAAA;GACL,EAAO,WAAW,KACjB,kBAAC,KAAD;IAAG,WAAU;cAAyC;IAElD,CAAA;GAEF"}
|
|
1
|
+
{"version":3,"file":"ProductsFeaturesPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/ProductsFeaturesPagePage.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, Badge, Button } from '@burdenoff/fe-libs/ui';\nimport {\n Star,\n Plus,\n ThumbsUp,\n MessageSquare,\n Target,\n Filter,\n ArrowUpDown,\n Loader2,\n} from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { rowLinkProps, detailPath } from '../utils/rowNavigation';\n\nconst LIST_FEATURE_REQUESTS = gql`\n query ListFeatureRequests(\n $workspaceId: ID!\n $filter: PlanmagnetFeatureRequestFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetFeatureRequests(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {\n items {\n id\n title\n description\n status\n businessValue\n effortEstimate\n priorityScore\n voteCount\n submittedBy\n tags\n createdAt\n updatedAt\n }\n totalCount\n }\n }\n`;\n\ninterface FeatureRequestNode {\n id: string;\n title: string;\n description: string | null;\n status: string;\n businessValue: number | null;\n effortEstimate: string | null;\n priorityScore: number | null;\n voteCount: number;\n submittedBy: string;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n}\n\nconst statusColor: Record<string, string> = {\n SUBMITTED: 'bg-gray-100 text-gray-800',\n UNDER_REVIEW: 'bg-yellow-100 text-yellow-800',\n PLANNED: 'bg-blue-100 text-blue-800',\n IN_PROGRESS: 'bg-purple-100 text-purple-800',\n COMPLETED: 'bg-green-100 text-green-800',\n DECLINED: 'bg-red-100 text-red-800',\n DUPLICATE: 'bg-orange-100 text-orange-800',\n};\n\nexport function ProductsFeaturesPagePage() {\n const navigate = usePlanMagnetNavigate();\n const { workspaceId } = usePlanMagnet();\n const [statusFilter, setStatusFilter] = useState<string>('all');\n const [sortBy, setSortBy] = useState<'priorityScore' | 'voteCount' | 'businessValue'>(\n 'priorityScore'\n );\n\n const {\n data,\n loading,\n error,\n } = // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery<Record<string, any>>(LIST_FEATURE_REQUESTS, {\n variables: {\n workspaceId,\n filter: statusFilter !== 'all' ? { status: statusFilter } : undefined,\n pagination: { first: 50 },\n },\n skip: !workspaceId,\n });\n\n if (loading) {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <Loader2 className=\"h-8 w-8 animate-spin text-muted-foreground\" />\n </div>\n );\n }\n\n if (error) {\n return <div className=\"p-6 text-destructive\">Failed to load features: {error.message}</div>;\n }\n\n const features: FeatureRequestNode[] = data?.planmagnetFeatureRequests?.items ?? [];\n const totalCount = data?.planmagnetFeatureRequests?.totalCount ?? 0;\n\n const sorted = [...features].sort((a, b) => {\n const aVal = a[sortBy] ?? 0;\n const bVal = b[sortBy] ?? 0;\n return (bVal as number) - (aVal as number);\n });\n\n const statuses = [\n 'all',\n 'SUBMITTED',\n 'UNDER_REVIEW',\n 'PLANNED',\n 'IN_PROGRESS',\n 'COMPLETED',\n 'DECLINED',\n 'DUPLICATE',\n ];\n\n const stats = {\n total: totalCount,\n inProgress: features.filter((f) => f.status === 'IN_PROGRESS').length,\n completed: features.filter((f) => f.status === 'COMPLETED').length,\n avgPriority:\n features.length > 0\n ? Math.round(features.reduce((s, f) => s + (f.priorityScore ?? 0), 0) / features.length)\n : 0,\n };\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\">Features</h1>\n <p className=\"text-sm text-muted-foreground\">\n {totalCount} feature requests across all products\n </p>\n </div>\n <Button size=\"sm\" onClick={() => navigate('/products/new-feature-page')}>\n <Plus className=\"mr-1 h-4 w-4\" />\n New Feature\n </Button>\n </div>\n\n <div className=\"grid grid-cols-2 md:grid-cols-4 gap-4\">\n <Card>\n <CardContent className=\"pt-4\">\n <p className=\"text-xs text-muted-foreground\">Total Features</p>\n <p className=\"text-xl font-bold\">{stats.total}</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-4\">\n <p className=\"text-xs text-muted-foreground\">In Progress</p>\n <p className=\"text-xl font-bold\">{stats.inProgress}</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-4\">\n <p className=\"text-xs text-muted-foreground\">Completed</p>\n <p className=\"text-xl font-bold\">{stats.completed}</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-4\">\n <p className=\"text-xs text-muted-foreground\">Avg Priority Score</p>\n <p className=\"text-xl font-bold\">{stats.avgPriority}</p>\n </CardContent>\n </Card>\n </div>\n\n <div className=\"flex items-center justify-between flex-wrap gap-2\">\n <div className=\"flex items-center gap-2\">\n <Filter className=\"h-4 w-4 text-muted-foreground\" />\n {statuses.map((s) => (\n <button\n key={s}\n onClick={() => setStatusFilter(s)}\n className={`px-2 py-1 text-xs rounded-md capitalize ${statusFilter === s ? 'bg-primary text-primary-foreground' : 'bg-muted text-muted-foreground'}`}\n >\n {s === 'all' ? 'All' : s.toLowerCase().replace('_', ' ')}\n </button>\n ))}\n </div>\n <div className=\"flex items-center gap-2\">\n <ArrowUpDown className=\"h-4 w-4 text-muted-foreground\" />\n {(['priorityScore', 'voteCount', 'businessValue'] as const).map((s) => (\n <button\n key={s}\n onClick={() => setSortBy(s)}\n className={`px-2 py-1 text-xs rounded-md capitalize ${sortBy === s ? 'bg-primary text-primary-foreground' : 'bg-muted text-muted-foreground'}`}\n >\n {s === 'priorityScore' ? 'Priority' : s === 'voteCount' ? 'Votes' : 'Value'}\n </button>\n ))}\n </div>\n </div>\n\n <div className=\"space-y-3\">\n {sorted.map((feature) => (\n <Card\n key={feature.id}\n {...rowLinkProps(\n () => navigate(detailPath('/products/feature-detail-page', feature.id)),\n feature.title\n )}\n >\n <CardContent className=\"py-4\">\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"flex-1 space-y-2\">\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm font-medium\">{feature.title}</span>\n <span\n className={`text-[10px] px-1.5 py-0.5 rounded-full capitalize ${statusColor[feature.status] ?? 'bg-gray-100'}`}\n >\n {feature.status.toLowerCase().replace('_', ' ')}\n </span>\n </div>\n <p className=\"text-xs text-muted-foreground\">{feature.description}</p>\n <div className=\"flex items-center gap-4 text-xs text-muted-foreground\">\n <span>Effort: {feature.effortEstimate ?? 'N/A'}</span>\n <span>Submitted by: {feature.submittedBy}</span>\n <span>{new Date(feature.updatedAt).toLocaleDateString()}</span>\n </div>\n {feature.tags.length > 0 && (\n <div className=\"flex gap-1\">\n {feature.tags.map((tag) => (\n <Badge key={tag} variant=\"outline\" className=\"text-[10px]\">\n {tag}\n </Badge>\n ))}\n </div>\n )}\n </div>\n <div className=\"flex items-center gap-4 shrink-0\">\n <div className=\"text-center\">\n <div className=\"flex items-center gap-1\">\n <Target className=\"h-3 w-3 text-primary\" />\n <span className=\"text-sm font-bold\">{feature.priorityScore ?? 0}</span>\n </div>\n <p className=\"text-[10px] text-muted-foreground\">Priority</p>\n </div>\n <div className=\"text-center\">\n <div className=\"flex items-center gap-1\">\n <ThumbsUp className=\"h-3 w-3 text-green-500\" />\n <span className=\"text-sm font-bold\">{feature.voteCount}</span>\n </div>\n <p className=\"text-[10px] text-muted-foreground\">Votes</p>\n </div>\n <div className=\"text-center\">\n <div className=\"flex items-center gap-1\">\n <Star className=\"h-3 w-3 text-yellow-500\" />\n <span className=\"text-sm font-bold\">{feature.businessValue ?? 0}</span>\n </div>\n <p className=\"text-[10px] text-muted-foreground\">Value</p>\n </div>\n </div>\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n {sorted.length === 0 && (\n <p className=\"text-center text-muted-foreground py-8\">\n No features match the selected filters.\n </p>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAmBA,IAAM,IAAwB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;GAyC3B,IAAsC;CAC1C,WAAW;CACX,cAAc;CACd,SAAS;CACT,aAAa;CACb,WAAW;CACX,UAAU;CACV,WAAW;CACZ;AAED,SAAgB,IAA2B;CACzC,IAAM,IAAW,GAAuB,EAClC,EAAE,mBAAgB,GAAe,EACjC,CAAC,GAAc,KAAmB,EAAiB,MAAM,EACzD,CAAC,GAAQ,KAAa,EAC1B,gBACD,EAEK,EACJ,SACA,YACA,aAGA,EAA8B,GAAuB;EACnD,WAAW;GACT;GACA,QAAQ,MAAiB,QAAmC,KAAA,IAA3B,EAAE,QAAQ,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,EAC3C,kBAAC,QAAD;YAAM,WAAU;sBAAqB,EAAQ,iBAAiB;YAAS,CAAA,CACnE;cACN,kBAAC,KAAD;WAAG,WAAU;qBAAoC;WAAY,CAAA,CACzD;;SACN,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,OAAD;WAAK,WAAU;qBAAf,CACE,kBAAC,GAAD,EAAU,WAAU,0BAA2B,CAAA,EAC/C,kBAAC,QAAD;YAAM,WAAU;sBAAqB,EAAQ;YAAiB,CAAA,CAC1D;cACN,kBAAC,KAAD;WAAG,WAAU;qBAAoC;WAAS,CAAA,CACtD;;SACN,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,OAAD;WAAK,WAAU;qBAAf,CACE,kBAAC,GAAD,EAAM,WAAU,2BAA4B,CAAA,EAC5C,kBAAC,QAAD;YAAM,WAAU;sBAAqB,EAAQ,iBAAiB;YAAS,CAAA,CACnE;cACN,kBAAC,KAAD;WAAG,WAAU;qBAAoC;WAAS,CAAA,CACtD;;SACF;UACF;;MACM,CAAA;KACT,EA1DA,EAAQ,GA0DR,CACP;IACE,CAAA;GACL,EAAO,WAAW,KACjB,kBAAC,KAAD;IAAG,WAAU;cAAyC;IAElD,CAAA;GAEF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductsProductsPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/ProductsProductsPagePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProductsProductsPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/ProductsProductsPagePage.tsx"],"names":[],"mappings":"AAiEA,wBAAgB,wBAAwB,4CA6LvC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { usePlanMagnet as e } from "../providers/PlanMagnetProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { usePlanMagnet as e, usePlanMagnetNavigate as t } from "../providers/PlanMagnetProvider.js";
|
|
2
|
+
import { detailPath as n, rowLinkProps as r } from "../utils/rowNavigation.js";
|
|
3
|
+
import { useState as i } from "react";
|
|
4
|
+
import { Calendar as a, GitBranch as o, Loader2 as s, Map as c, Package as l, Plus as u } from "lucide-react";
|
|
5
|
+
import { gql as d } from "@apollo/client";
|
|
6
|
+
import { useQuery as f } from "@apollo/client/react";
|
|
7
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
|
+
import { useI18n as h } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
9
|
+
import { Badge as g, Button as _, Card as v, CardContent as y, CardHeader as b, CardTitle as x } from "@burdenoff/fe-libs/ui";
|
|
9
10
|
//#region src/planmagnet/pages/ProductsProductsPagePage.tsx
|
|
10
|
-
var
|
|
11
|
+
var S = d`
|
|
11
12
|
query ListRoadmaps($workspaceId: ID!, $pagination: PlanmagnetPaginationInput) {
|
|
12
13
|
planmagnetRoadmaps(workspaceId: $workspaceId, pagination: $pagination) {
|
|
13
14
|
items {
|
|
@@ -31,52 +32,52 @@ var y = c`
|
|
|
31
32
|
totalCount
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
|
-
`,
|
|
35
|
+
`, C = d`
|
|
35
36
|
query ListFeatureRequestsForProducts($workspaceId: ID!, $pagination: PlanmagnetPaginationInput) {
|
|
36
37
|
planmagnetFeatureRequests(workspaceId: $workspaceId, pagination: $pagination) {
|
|
37
38
|
totalCount
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
|
-
`,
|
|
41
|
+
`, w = d`
|
|
41
42
|
query ListReleasesForProducts($workspaceId: ID!, $pagination: PlanmagnetPaginationInput) {
|
|
42
43
|
planmagnetReleases(workspaceId: $workspaceId, pagination: $pagination) {
|
|
43
44
|
totalCount
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
`;
|
|
47
|
-
function
|
|
48
|
-
let { workspaceId:
|
|
48
|
+
function T() {
|
|
49
|
+
let { workspaceId: d } = e(), T = t(), { t: E } = h(), [D, O] = i("grid"), { data: k, loading: A, error: j } = f(S, {
|
|
49
50
|
variables: {
|
|
50
|
-
workspaceId:
|
|
51
|
+
workspaceId: d,
|
|
51
52
|
pagination: { first: 50 }
|
|
52
53
|
},
|
|
53
|
-
skip: !
|
|
54
|
-
}), { data:
|
|
54
|
+
skip: !d
|
|
55
|
+
}), { data: M } = f(C, {
|
|
55
56
|
variables: {
|
|
56
|
-
workspaceId:
|
|
57
|
+
workspaceId: d,
|
|
57
58
|
pagination: { first: 1 }
|
|
58
59
|
},
|
|
59
|
-
skip: !
|
|
60
|
-
}), { data:
|
|
60
|
+
skip: !d
|
|
61
|
+
}), { data: N } = f(w, {
|
|
61
62
|
variables: {
|
|
62
|
-
workspaceId:
|
|
63
|
+
workspaceId: d,
|
|
63
64
|
pagination: { first: 1 }
|
|
64
65
|
},
|
|
65
|
-
skip: !
|
|
66
|
+
skip: !d
|
|
66
67
|
});
|
|
67
|
-
if (
|
|
68
|
+
if (A) return /* @__PURE__ */ p("div", {
|
|
68
69
|
className: "flex items-center justify-center p-12",
|
|
69
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ p(s, { className: "h-8 w-8 animate-spin text-muted-foreground" })
|
|
70
71
|
});
|
|
71
|
-
if (
|
|
72
|
+
if (j) return /* @__PURE__ */ m("div", {
|
|
72
73
|
className: "p-6 text-destructive",
|
|
73
74
|
children: [
|
|
74
|
-
|
|
75
|
+
E("planmagnet.products.errorLoading", "Failed to load products"),
|
|
75
76
|
": ",
|
|
76
|
-
|
|
77
|
+
j.message
|
|
77
78
|
]
|
|
78
79
|
});
|
|
79
|
-
let
|
|
80
|
+
let P = k?.planmagnetRoadmaps?.items ?? [], F = k?.planmagnetRoadmaps?.totalCount ?? 0, I = M?.planmagnetFeatureRequests?.totalCount ?? 0, L = N?.planmagnetReleases?.totalCount ?? 0, R = (e) => {
|
|
80
81
|
switch (e) {
|
|
81
82
|
case "TIMELINE": return "default";
|
|
82
83
|
case "GANTT": return "secondary";
|
|
@@ -84,130 +85,130 @@ function S() {
|
|
|
84
85
|
default: return "outline";
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ m("div", {
|
|
88
89
|
className: "space-y-6 p-6",
|
|
89
90
|
children: [
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ m("div", {
|
|
91
92
|
className: "flex items-center justify-between",
|
|
92
|
-
children: [/* @__PURE__ */
|
|
93
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("h1", {
|
|
93
94
|
className: "text-2xl font-semibold flex items-center gap-2",
|
|
94
95
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ p(l, { className: "h-6 w-6" }),
|
|
96
97
|
" ",
|
|
97
|
-
|
|
98
|
+
E("planmagnet.products.title", "Products")
|
|
98
99
|
]
|
|
99
|
-
}), /* @__PURE__ */
|
|
100
|
+
}), /* @__PURE__ */ p("p", {
|
|
100
101
|
className: "text-sm text-muted-foreground mt-1",
|
|
101
|
-
children:
|
|
102
|
-
})] }), /* @__PURE__ */
|
|
102
|
+
children: E("planmagnet.products.subtitle", "Manage your product portfolio and track feature development")
|
|
103
|
+
})] }), /* @__PURE__ */ m(_, {
|
|
103
104
|
size: "sm",
|
|
104
|
-
children: [/* @__PURE__ */ u
|
|
105
|
+
children: [/* @__PURE__ */ p(u, { className: "h-4 w-4 mr-1" }), E("planmagnet.products.actions.newProduct", "New Product")]
|
|
105
106
|
})]
|
|
106
107
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ p("div", {
|
|
108
109
|
className: "grid gap-4 md:grid-cols-4",
|
|
109
110
|
children: [
|
|
110
111
|
{
|
|
111
|
-
label:
|
|
112
|
-
val:
|
|
113
|
-
icon:
|
|
112
|
+
label: E("planmagnet.products.metrics.totalProducts", "Total Products"),
|
|
113
|
+
val: F,
|
|
114
|
+
icon: l,
|
|
114
115
|
color: "text-blue-500"
|
|
115
116
|
},
|
|
116
117
|
{
|
|
117
|
-
label:
|
|
118
|
-
val:
|
|
119
|
-
icon:
|
|
118
|
+
label: E("planmagnet.products.metrics.activeFeatures", "Active Features"),
|
|
119
|
+
val: I,
|
|
120
|
+
icon: o,
|
|
120
121
|
color: "text-green-500"
|
|
121
122
|
},
|
|
122
123
|
{
|
|
123
|
-
label:
|
|
124
|
-
val:
|
|
125
|
-
icon:
|
|
124
|
+
label: E("planmagnet.products.metrics.releases", "Releases"),
|
|
125
|
+
val: L,
|
|
126
|
+
icon: a,
|
|
126
127
|
color: "text-purple-500"
|
|
127
128
|
},
|
|
128
129
|
{
|
|
129
|
-
label:
|
|
130
|
-
val:
|
|
131
|
-
icon:
|
|
130
|
+
label: E("planmagnet.products.metrics.roadmaps", "Roadmaps"),
|
|
131
|
+
val: F,
|
|
132
|
+
icon: c,
|
|
132
133
|
color: "text-orange-500"
|
|
133
134
|
}
|
|
134
|
-
].map((e) => /* @__PURE__ */
|
|
135
|
+
].map((e) => /* @__PURE__ */ p(v, { children: /* @__PURE__ */ p(y, {
|
|
135
136
|
className: "pt-6",
|
|
136
|
-
children: /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ m("div", {
|
|
137
138
|
className: "flex items-center justify-between",
|
|
138
|
-
children: [/* @__PURE__ */
|
|
139
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
139
140
|
className: "text-sm text-muted-foreground",
|
|
140
141
|
children: e.label
|
|
141
|
-
}), /* @__PURE__ */
|
|
142
|
+
}), /* @__PURE__ */ p("p", {
|
|
142
143
|
className: "text-2xl font-bold",
|
|
143
144
|
children: e.val
|
|
144
|
-
})] }), /* @__PURE__ */
|
|
145
|
+
})] }), /* @__PURE__ */ p(e.icon, { className: `h-8 w-8 ${e.color} opacity-60` })]
|
|
145
146
|
})
|
|
146
147
|
}) }, e.label))
|
|
147
148
|
}),
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ p("div", {
|
|
149
150
|
className: "grid gap-4 md:grid-cols-2 lg:grid-cols-2",
|
|
150
|
-
children:
|
|
151
|
-
|
|
152
|
-
children: [/* @__PURE__ */
|
|
151
|
+
children: P.map((e) => /* @__PURE__ */ m(v, {
|
|
152
|
+
...r(() => T(n("/products/product-detail-page", e.id)), e.name),
|
|
153
|
+
children: [/* @__PURE__ */ p(b, { children: /* @__PURE__ */ m("div", {
|
|
153
154
|
className: "flex items-center justify-between",
|
|
154
|
-
children: [/* @__PURE__ */
|
|
155
|
+
children: [/* @__PURE__ */ p(x, {
|
|
155
156
|
className: "text-base",
|
|
156
157
|
children: e.name
|
|
157
|
-
}), /* @__PURE__ */
|
|
158
|
-
variant:
|
|
158
|
+
}), /* @__PURE__ */ p(g, {
|
|
159
|
+
variant: R(e.type),
|
|
159
160
|
children: e.type.toLowerCase()
|
|
160
161
|
})]
|
|
161
|
-
}) }), /* @__PURE__ */
|
|
162
|
+
}) }), /* @__PURE__ */ m(y, {
|
|
162
163
|
className: "space-y-3",
|
|
163
164
|
children: [
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ p("p", {
|
|
165
166
|
className: "text-sm text-muted-foreground",
|
|
166
|
-
children: e.description ??
|
|
167
|
+
children: e.description ?? E("planmagnet.products.shared.noDescription", "No description")
|
|
167
168
|
}),
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ m("div", {
|
|
169
170
|
className: "grid grid-cols-3 gap-2 text-center",
|
|
170
171
|
children: [
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ m("div", {
|
|
172
173
|
className: "rounded border p-2",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ p("p", {
|
|
174
175
|
className: "text-lg font-bold",
|
|
175
176
|
children: e.items?.length ?? 0
|
|
176
|
-
}), /* @__PURE__ */
|
|
177
|
+
}), /* @__PURE__ */ p("p", {
|
|
177
178
|
className: "text-xs text-muted-foreground",
|
|
178
|
-
children:
|
|
179
|
+
children: E("planmagnet.products.shared.items", "Items")
|
|
179
180
|
})]
|
|
180
181
|
}),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ m("div", {
|
|
182
183
|
className: "rounded border p-2",
|
|
183
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ p("p", {
|
|
184
185
|
className: "text-lg font-bold",
|
|
185
|
-
children: e.isPublic ?
|
|
186
|
-
}), /* @__PURE__ */
|
|
186
|
+
children: e.isPublic ? E("planmagnet.products.shared.public", "Public") : E("planmagnet.products.shared.private", "Private")
|
|
187
|
+
}), /* @__PURE__ */ p("p", {
|
|
187
188
|
className: "text-xs text-muted-foreground",
|
|
188
|
-
children:
|
|
189
|
+
children: E("planmagnet.products.shared.visibility", "Visibility")
|
|
189
190
|
})]
|
|
190
191
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ m("div", {
|
|
192
193
|
className: "rounded border p-2",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
194
|
+
children: [/* @__PURE__ */ p("p", {
|
|
194
195
|
className: "text-lg font-bold",
|
|
195
196
|
children: e.type.toLowerCase()
|
|
196
|
-
}), /* @__PURE__ */
|
|
197
|
+
}), /* @__PURE__ */ p("p", {
|
|
197
198
|
className: "text-xs text-muted-foreground",
|
|
198
|
-
children:
|
|
199
|
+
children: E("planmagnet.products.shared.type", "Type")
|
|
199
200
|
})]
|
|
200
201
|
})
|
|
201
202
|
]
|
|
202
203
|
}),
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ m("div", {
|
|
204
205
|
className: "flex items-center justify-between text-xs text-muted-foreground",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
206
|
-
|
|
206
|
+
children: [/* @__PURE__ */ m("span", { children: [
|
|
207
|
+
E("planmagnet.products.shared.owner", "Owner"),
|
|
207
208
|
": ",
|
|
208
209
|
e.ownerId
|
|
209
|
-
] }), /* @__PURE__ */
|
|
210
|
-
|
|
210
|
+
] }), /* @__PURE__ */ m("span", { children: [
|
|
211
|
+
E("planmagnet.products.shared.updated", "Updated"),
|
|
211
212
|
" ",
|
|
212
213
|
new Date(e.updatedAt).toLocaleDateString()
|
|
213
214
|
] })]
|
|
@@ -220,6 +221,6 @@ function S() {
|
|
|
220
221
|
});
|
|
221
222
|
}
|
|
222
223
|
//#endregion
|
|
223
|
-
export {
|
|
224
|
+
export { T as ProductsProductsPagePage };
|
|
224
225
|
|
|
225
226
|
//# sourceMappingURL=ProductsProductsPagePage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductsProductsPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/ProductsProductsPagePage.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, Badge, Button } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Package, Plus, TrendingUp, Calendar, GitBranch, Map, Loader2 } from 'lucide-react';\nimport { usePlanMagnet } from '../providers/PlanMagnetProvider';\n\nconst LIST_ROADMAPS = gql`\n query ListRoadmaps($workspaceId: ID!, $pagination: PlanmagnetPaginationInput) {\n planmagnetRoadmaps(workspaceId: $workspaceId, pagination: $pagination) {\n items {\n id\n workspaceId\n name\n description\n type\n isPublic\n ownerId\n metadata\n createdBy\n createdAt\n updatedAt\n updatedBy\n items {\n id\n status\n }\n }\n totalCount\n }\n }\n`;\n\nconst LIST_FEATURE_REQUESTS = gql`\n query ListFeatureRequestsForProducts($workspaceId: ID!, $pagination: PlanmagnetPaginationInput) {\n planmagnetFeatureRequests(workspaceId: $workspaceId, pagination: $pagination) {\n totalCount\n }\n }\n`;\n\nconst LIST_RELEASES = gql`\n query ListReleasesForProducts($workspaceId: ID!, $pagination: PlanmagnetPaginationInput) {\n planmagnetReleases(workspaceId: $workspaceId, pagination: $pagination) {\n totalCount\n }\n }\n`;\n\ninterface RoadmapNode {\n id: string;\n name: string;\n description: string | null;\n type: string;\n isPublic: boolean;\n ownerId: string;\n createdAt: string;\n updatedAt: string;\n items: { id: string; status: string }[];\n}\n\nexport function ProductsProductsPagePage() {\n const { workspaceId } = usePlanMagnet();\n const { t } = useI18n();\n const [view, setView] = useState<'grid' | 'list'>('grid');\n\n const {\n data: roadmapsData,\n loading: roadmapsLoading,\n error: roadmapsError,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } = useQuery<Record<string, any>>(LIST_ROADMAPS, {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n variables: { workspaceId, pagination: { first: 50 } },\n skip: !workspaceId,\n });\n\n const {\n data: featuresData,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } = // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery<Record<string, any>>(LIST_FEATURE_REQUESTS, {\n variables: { workspaceId, pagination: { first: 1 } },\n skip: !workspaceId,\n });\n\n const {\n data: releasesData,\n } = // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery<Record<string, any>>(LIST_RELEASES, {\n variables: { workspaceId, pagination: { first: 1 } },\n skip: !workspaceId,\n });\n\n if (roadmapsLoading) {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <Loader2 className=\"h-8 w-8 animate-spin text-muted-foreground\" />\n </div>\n );\n }\n\n if (roadmapsError) {\n return (\n <div className=\"p-6 text-destructive\">\n {t('planmagnet.products.errorLoading', 'Failed to load products')}: {roadmapsError.message}\n </div>\n );\n }\n\n const roadmaps: RoadmapNode[] = roadmapsData?.planmagnetRoadmaps?.items ?? [];\n const totalRoadmaps = roadmapsData?.planmagnetRoadmaps?.totalCount ?? 0;\n const totalFeatures = featuresData?.planmagnetFeatureRequests?.totalCount ?? 0;\n const totalReleases = releasesData?.planmagnetReleases?.totalCount ?? 0;\n\n const typeLabel = (t: string) => {\n switch (t) {\n case 'TIMELINE':\n return 'default';\n case 'GANTT':\n return 'secondary';\n case 'SWIMLANE':\n return 'outline';\n default:\n return 'outline';\n }\n };\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 flex items-center gap-2\">\n <Package className=\"h-6 w-6\" /> {t('planmagnet.products.title', 'Products')}\n </h1>\n <p className=\"text-sm text-muted-foreground mt-1\">\n {t(\n 'planmagnet.products.subtitle',\n 'Manage your product portfolio and track feature development'\n )}\n </p>\n </div>\n <Button size=\"sm\">\n <Plus className=\"h-4 w-4 mr-1\" />\n {t('planmagnet.products.actions.newProduct', 'New Product')}\n </Button>\n </div>\n\n <div className=\"grid gap-4 md:grid-cols-4\">\n {[\n {\n label: t('planmagnet.products.metrics.totalProducts', 'Total Products'),\n val: totalRoadmaps,\n icon: Package,\n color: 'text-blue-500',\n },\n {\n label: t('planmagnet.products.metrics.activeFeatures', 'Active Features'),\n val: totalFeatures,\n icon: GitBranch,\n color: 'text-green-500',\n },\n {\n label: t('planmagnet.products.metrics.releases', 'Releases'),\n val: totalReleases,\n icon: Calendar,\n color: 'text-purple-500',\n },\n {\n label: t('planmagnet.products.metrics.roadmaps', 'Roadmaps'),\n val: totalRoadmaps,\n icon: Map,\n color: 'text-orange-500',\n },\n ].map((s) => (\n <Card key={s.label}>\n <CardContent className=\"pt-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm text-muted-foreground\">{s.label}</p>\n <p className=\"text-2xl font-bold\">{s.val}</p>\n </div>\n <s.icon className={`h-8 w-8 ${s.color} opacity-60`} />\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n\n <div className=\"grid gap-4 md:grid-cols-2 lg:grid-cols-2\">\n {roadmaps.map((roadmap) => (\n <Card key={roadmap.id} className=\"hover:shadow-md transition-shadow\">\n <CardHeader>\n <div className=\"flex items-center justify-between\">\n <CardTitle className=\"text-base\">{roadmap.name}</CardTitle>\n <Badge variant={typeLabel(roadmap.type)}>{roadmap.type.toLowerCase()}</Badge>\n </div>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n <p className=\"text-sm text-muted-foreground\">\n {roadmap.description ??\n t('planmagnet.products.shared.noDescription', 'No description')}\n </p>\n <div className=\"grid grid-cols-3 gap-2 text-center\">\n <div className=\"rounded border p-2\">\n <p className=\"text-lg font-bold\">{roadmap.items?.length ?? 0}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t('planmagnet.products.shared.items', 'Items')}\n </p>\n </div>\n <div className=\"rounded border p-2\">\n <p className=\"text-lg font-bold\">\n {roadmap.isPublic\n ? t('planmagnet.products.shared.public', 'Public')\n : t('planmagnet.products.shared.private', 'Private')}\n </p>\n <p className=\"text-xs text-muted-foreground\">\n {t('planmagnet.products.shared.visibility', 'Visibility')}\n </p>\n </div>\n <div className=\"rounded border p-2\">\n <p className=\"text-lg font-bold\">{roadmap.type.toLowerCase()}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t('planmagnet.products.shared.type', 'Type')}\n </p>\n </div>\n </div>\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span>\n {t('planmagnet.products.shared.owner', 'Owner')}: {roadmap.ownerId}\n </span>\n <span>\n {t('planmagnet.products.shared.updated', 'Updated')}{' '}\n {new Date(roadmap.updatedAt).toLocaleDateString()}\n </span>\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAUA,IAAM,IAAgB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;GA0BnB,IAAwB,CAAG;;;;;;GAQ3B,IAAgB,CAAG;;;;;;;AAoBzB,SAAgB,IA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AAa,WAAU;gBAAvB;OACE,kBAAC,KAAD;QAAG,WAAU;kBACV,EAAQ,eACP,EAAE,4CAA4C,iBAAiB;QAC/D,CAAA;OACJ,kBAAC,OAAD;QAAK,WAAU;kBAAf;SACE,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,KAAD;WAAG,WAAU;qBAAqB,EAAQ,OAAO,UAAU;WAAM,CAAA,EACjE,kBAAC,KAAD;WAAG,WAAU;qBACV,EAAE,oCAAoC,QAAQ;WAC7C,CAAA,CACA;;SACN,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,KAAD;WAAG,WAAU;qBACV,EAAQ,WACL,EAAE,qCAAqC,SAAS,GAChD,EAAE,sCAAsC,UAAU;WACpD,CAAA,EACJ,kBAAC,KAAD;WAAG,WAAU;qBACV,EAAE,yCAAyC,aAAa;WACvD,CAAA,CACA;;SACN,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,KAAD;WAAG,WAAU;qBAAqB,EAAQ,KAAK,aAAa;WAAK,CAAA,EACjE,kBAAC,KAAD;WAAG,WAAU;qBACV,EAAE,mCAAmC,OAAO;WAC3C,CAAA,CACA;;SACF;;OACN,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,QAAD,EAAA,UAAA;SACG,EAAE,oCAAoC,QAAQ;SAAC;SAAG,EAAQ;SACtD,EAAA,CAAA,EACP,kBAAC,QAAD,EAAA,UAAA;SACG,EAAE,sCAAsC,UAAU;SAAE;SACpD,IAAI,KAAK,EAAQ,UAAU,CAAC,oBAAoB;SAC5C,EAAA,CAAA,CACH;;OACM;QACT;OA9CI,EAAQ,GA8CZ,CACP;IACE,CAAA;GACF"}
|
|
1
|
+
{"version":3,"file":"ProductsProductsPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/ProductsProductsPagePage.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, Badge, Button } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Package, Plus, TrendingUp, Calendar, GitBranch, Map, Loader2 } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { rowLinkProps, detailPath } from '../utils/rowNavigation';\n\nconst LIST_ROADMAPS = gql`\n query ListRoadmaps($workspaceId: ID!, $pagination: PlanmagnetPaginationInput) {\n planmagnetRoadmaps(workspaceId: $workspaceId, pagination: $pagination) {\n items {\n id\n workspaceId\n name\n description\n type\n isPublic\n ownerId\n metadata\n createdBy\n createdAt\n updatedAt\n updatedBy\n items {\n id\n status\n }\n }\n totalCount\n }\n }\n`;\n\nconst LIST_FEATURE_REQUESTS = gql`\n query ListFeatureRequestsForProducts($workspaceId: ID!, $pagination: PlanmagnetPaginationInput) {\n planmagnetFeatureRequests(workspaceId: $workspaceId, pagination: $pagination) {\n totalCount\n }\n }\n`;\n\nconst LIST_RELEASES = gql`\n query ListReleasesForProducts($workspaceId: ID!, $pagination: PlanmagnetPaginationInput) {\n planmagnetReleases(workspaceId: $workspaceId, pagination: $pagination) {\n totalCount\n }\n }\n`;\n\ninterface RoadmapNode {\n id: string;\n name: string;\n description: string | null;\n type: string;\n isPublic: boolean;\n ownerId: string;\n createdAt: string;\n updatedAt: string;\n items: { id: string; status: string }[];\n}\n\nexport function ProductsProductsPagePage() {\n const { workspaceId } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n const { t } = useI18n();\n const [view, setView] = useState<'grid' | 'list'>('grid');\n\n const {\n data: roadmapsData,\n loading: roadmapsLoading,\n error: roadmapsError,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } = useQuery<Record<string, any>>(LIST_ROADMAPS, {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n variables: { workspaceId, pagination: { first: 50 } },\n skip: !workspaceId,\n });\n\n const {\n data: featuresData,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } = // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery<Record<string, any>>(LIST_FEATURE_REQUESTS, {\n variables: { workspaceId, pagination: { first: 1 } },\n skip: !workspaceId,\n });\n\n const {\n data: releasesData,\n } = // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery<Record<string, any>>(LIST_RELEASES, {\n variables: { workspaceId, pagination: { first: 1 } },\n skip: !workspaceId,\n });\n\n if (roadmapsLoading) {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <Loader2 className=\"h-8 w-8 animate-spin text-muted-foreground\" />\n </div>\n );\n }\n\n if (roadmapsError) {\n return (\n <div className=\"p-6 text-destructive\">\n {t('planmagnet.products.errorLoading', 'Failed to load products')}: {roadmapsError.message}\n </div>\n );\n }\n\n const roadmaps: RoadmapNode[] = roadmapsData?.planmagnetRoadmaps?.items ?? [];\n const totalRoadmaps = roadmapsData?.planmagnetRoadmaps?.totalCount ?? 0;\n const totalFeatures = featuresData?.planmagnetFeatureRequests?.totalCount ?? 0;\n const totalReleases = releasesData?.planmagnetReleases?.totalCount ?? 0;\n\n const typeLabel = (t: string) => {\n switch (t) {\n case 'TIMELINE':\n return 'default';\n case 'GANTT':\n return 'secondary';\n case 'SWIMLANE':\n return 'outline';\n default:\n return 'outline';\n }\n };\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 flex items-center gap-2\">\n <Package className=\"h-6 w-6\" /> {t('planmagnet.products.title', 'Products')}\n </h1>\n <p className=\"text-sm text-muted-foreground mt-1\">\n {t(\n 'planmagnet.products.subtitle',\n 'Manage your product portfolio and track feature development'\n )}\n </p>\n </div>\n <Button size=\"sm\">\n <Plus className=\"h-4 w-4 mr-1\" />\n {t('planmagnet.products.actions.newProduct', 'New Product')}\n </Button>\n </div>\n\n <div className=\"grid gap-4 md:grid-cols-4\">\n {[\n {\n label: t('planmagnet.products.metrics.totalProducts', 'Total Products'),\n val: totalRoadmaps,\n icon: Package,\n color: 'text-blue-500',\n },\n {\n label: t('planmagnet.products.metrics.activeFeatures', 'Active Features'),\n val: totalFeatures,\n icon: GitBranch,\n color: 'text-green-500',\n },\n {\n label: t('planmagnet.products.metrics.releases', 'Releases'),\n val: totalReleases,\n icon: Calendar,\n color: 'text-purple-500',\n },\n {\n label: t('planmagnet.products.metrics.roadmaps', 'Roadmaps'),\n val: totalRoadmaps,\n icon: Map,\n color: 'text-orange-500',\n },\n ].map((s) => (\n <Card key={s.label}>\n <CardContent className=\"pt-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm text-muted-foreground\">{s.label}</p>\n <p className=\"text-2xl font-bold\">{s.val}</p>\n </div>\n <s.icon className={`h-8 w-8 ${s.color} opacity-60`} />\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n\n <div className=\"grid gap-4 md:grid-cols-2 lg:grid-cols-2\">\n {roadmaps.map((roadmap) => (\n <Card\n key={roadmap.id}\n {...rowLinkProps(\n () => navigate(detailPath('/products/product-detail-page', roadmap.id)),\n roadmap.name\n )}\n >\n <CardHeader>\n <div className=\"flex items-center justify-between\">\n <CardTitle className=\"text-base\">{roadmap.name}</CardTitle>\n <Badge variant={typeLabel(roadmap.type)}>{roadmap.type.toLowerCase()}</Badge>\n </div>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n <p className=\"text-sm text-muted-foreground\">\n {roadmap.description ??\n t('planmagnet.products.shared.noDescription', 'No description')}\n </p>\n <div className=\"grid grid-cols-3 gap-2 text-center\">\n <div className=\"rounded border p-2\">\n <p className=\"text-lg font-bold\">{roadmap.items?.length ?? 0}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t('planmagnet.products.shared.items', 'Items')}\n </p>\n </div>\n <div className=\"rounded border p-2\">\n <p className=\"text-lg font-bold\">\n {roadmap.isPublic\n ? t('planmagnet.products.shared.public', 'Public')\n : t('planmagnet.products.shared.private', 'Private')}\n </p>\n <p className=\"text-xs text-muted-foreground\">\n {t('planmagnet.products.shared.visibility', 'Visibility')}\n </p>\n </div>\n <div className=\"rounded border p-2\">\n <p className=\"text-lg font-bold\">{roadmap.type.toLowerCase()}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t('planmagnet.products.shared.type', 'Type')}\n </p>\n </div>\n </div>\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span>\n {t('planmagnet.products.shared.owner', 'Owner')}: {roadmap.ownerId}\n </span>\n <span>\n {t('planmagnet.products.shared.updated', 'Updated')}{' '}\n {new Date(roadmap.updatedAt).toLocaleDateString()}\n </span>\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAWA,IAAM,IAAgB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;GA0BnB,IAAwB,CAAG;;;;;;GAQ3B,IAAgB,CAAG;;;;;;;AAoBzB,SAAgB,IAA2B;CACzC,IAAM,EAAE,mBAAgB,GAAe,EACjC,IAAW,GAAuB,EAClC,EAAE,SAAM,GAAS,EACjB,CAAC,GAAM,KAAW,EAA0B,OAAO,EAEnD,EACJ,MAAM,GACN,SAAS,GACT,OAAO,MAEL,EAA8B,GAAe;EAE/C,WAAW;GAAE;GAAa,YAAY,EAAE,OAAO,IAAI;GAAE;EACrD,MAAM,CAAC;EACR,CAAC,EAEI,EACJ,MAAM,MAGN,EAA8B,GAAuB;EACnD,WAAW;GAAE;GAAa,YAAY,EAAE,OAAO,GAAG;GAAE;EACpD,MAAM,CAAC;EACR,CAAC,EAEE,EACJ,MAAM,MAGN,EAA8B,GAAe;EAC3C,WAAW;GAAE;GAAa,YAAY,EAAE,OAAO,GAAG;GAAE;EACpD,MAAM,CAAC;EACR,CAAC;AAEJ,KAAI,EACF,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,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AAD;WAAG,WAAU;qBACV,EAAE,yCAAyC,aAAa;WACvD,CAAA,CACA;;SACN,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,KAAD;WAAG,WAAU;qBAAqB,EAAQ,KAAK,aAAa;WAAK,CAAA,EACjE,kBAAC,KAAD;WAAG,WAAU;qBACV,EAAE,mCAAmC,OAAO;WAC3C,CAAA,CACA;;SACF;;OACN,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,QAAD,EAAA,UAAA;SACG,EAAE,oCAAoC,QAAQ;SAAC;SAAG,EAAQ;SACtD,EAAA,CAAA,EACP,kBAAC,QAAD,EAAA,UAAA;SACG,EAAE,sCAAsC,UAAU;SAAE;SACpD,IAAI,KAAK,EAAQ,UAAU,CAAC,oBAAoB;SAC5C,EAAA,CAAA,CACH;;OACM;QACT;OAnDA,EAAQ,GAmDR,CACP;IACE,CAAA;GACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductsReleasesPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/ProductsReleasesPagePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProductsReleasesPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/ProductsReleasesPagePage.tsx"],"names":[],"mappings":"AAwEA,wBAAgB,wBAAwB,4CAiIvC"}
|