Skip to content

Commit 7856633

Browse files
committed
linted the files and fixed lint highlighted errors
1 parent d0a06d2 commit 7856633

File tree

13 files changed

+350
-331
lines changed

13 files changed

+350
-331
lines changed

.eslintrc.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,5 @@
99
"parser": "@typescript-eslint/parser",
1010
"plugins": ["@typescript-eslint"],
1111
"root": true,
12-
"rules": {
13-
"no-unused-vars": "off",
14-
"@typescript-eslint/no-unused-vars": "error"
15-
}
12+
"rules": {}
1613
}

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
CHANGELOG.md
22
pnpm-lock.yaml
33
node_modules
4+
package-lock.json

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services:
33
image: mongo:latest
44
container_name: pldg-mongodb
55
ports:
6-
- "27017:27017"
6+
- '27017:27017'
77
volumes:
88
- mongodb_data:/data/db
99
environment:
@@ -13,7 +13,7 @@ services:
1313
networks:
1414
- pldg-network
1515
healthcheck:
16-
test: ["CMD", "mongo", "--eval", "db.adminCommand('ping')"]
16+
test: ['CMD', 'mongo', '--eval', "db.adminCommand('ping')"]
1717
interval: 10s
1818
timeout: 5s
1919
retries: 5

scripts/csv-uploader.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,24 @@ import dotenv from 'dotenv';
55

66
dotenv.config();
77

8-
const uri = process.env.MONGO_URI || "mongodb://pldg:password@localhost:27017/pldg-dashboard?authSource=admin";
8+
const uri =
9+
process.env.MONGO_URI ||
10+
'mongodb://pldg:password@localhost:27017/pldg-dashboard?authSource=admin';
911
const client = new MongoClient(uri);
1012

11-
const cohort1CSVPath = '../public/data/cohort-1/Weekly Engagement Survey Breakdown (4).csv';
12-
const cohort2CSVPath = '../public/data/cohort-2/[cohort 2] Weekly Engagement Survey-Raw Dataset.csv';
13-
const cohort1FeedbackCSVPath = '../public/data/cohort-1/PLDG Cohort 1 RetroPGF - TechPartner Feedback.csv';
14-
const cohort2FeedbackCSVPath = '../public/data/cohort-2/PLDG Cohort 2 RetroPGF - TechPartner Feedback.csv';
13+
const cohort1CSVPath =
14+
'../public/data/cohort-1/Weekly Engagement Survey Breakdown (4).csv';
15+
const cohort2CSVPath =
16+
'../public/data/cohort-2/[cohort 2] Weekly Engagement Survey-Raw Dataset.csv';
17+
/* const cohort1FeedbackCSVPath =
18+
'../public/data/cohort-1/PLDG Cohort 1 RetroPGF - TechPartner Feedback.csv'; */
19+
const cohort2FeedbackCSVPath =
20+
'../public/data/cohort-2/PLDG Cohort 2 RetroPGF - TechPartner Feedback.csv';
1521

1622
async function uploadCSVToCollection(filePath, collectionName) {
1723
return new Promise((resolve, reject) => {
1824
const results = [];
19-
25+
2026
fs.createReadStream(filePath)
2127
.pipe(csvParser())
2228
.on('data', (data) => results.push(data))
@@ -42,13 +48,13 @@ async function uploadAllCSVs() {
4248
try {
4349
await client.connect();
4450
console.log('Connected to MongoDB Atlas');
45-
51+
4652
// Upload all CSV files to their respective collections
4753
await uploadCSVToCollection(cohort1CSVPath, 'cohort1');
4854
await uploadCSVToCollection(cohort2CSVPath, 'cohort2');
4955
// await uploadCSVToCollection(cohort1FeedbackCSVPath, 'cohort1feedback');
5056
await uploadCSVToCollection(cohort2FeedbackCSVPath, 'cohort2feedback');
51-
57+
5258
console.log('All CSV files uploaded successfully');
5359
} catch (err) {
5460
console.error('Error uploading CSV files:', err);
@@ -58,4 +64,4 @@ async function uploadAllCSVs() {
5864
}
5965
}
6066

61-
uploadAllCSVs();
67+
uploadAllCSVs();

scripts/package.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
{
2-
"name": "scripts",
3-
"version": "1.0.0",
4-
"main": "csv-uploader.js",
5-
"type": "module",
6-
"dependencies": {
7-
"bson": "^6.10.3",
8-
"csv-parser": "^3.2.0",
9-
"dotenv": "^16.5.0",
10-
"memory-pager": "^1.5.0",
11-
"mongodb": "^6.16.0",
12-
"mongodb-connection-string-url": "^3.0.2",
13-
"punycode": "^2.3.1",
14-
"sparse-bitfield": "^3.0.3",
15-
"tr46": "^5.1.1",
16-
"webidl-conversions": "^7.0.0",
17-
"whatwg-url": "^14.2.0"
18-
},
19-
"scripts": {
20-
"test": "echo \"Error: no test specified\" && exit 1",
21-
"start": "node csv-uploader.js"
22-
},
23-
"keywords": [],
24-
"author": "",
25-
"license": "ISC",
26-
"description": ""
27-
}
2+
"name": "scripts",
3+
"version": "1.0.0",
4+
"main": "csv-uploader.js",
5+
"type": "module",
6+
"dependencies": {
7+
"bson": "^6.10.3",
8+
"csv-parser": "^3.2.0",
9+
"dotenv": "^16.5.0",
10+
"memory-pager": "^1.5.0",
11+
"mongodb": "^6.16.0",
12+
"mongodb-connection-string-url": "^3.0.2",
13+
"punycode": "^2.3.1",
14+
"sparse-bitfield": "^3.0.3",
15+
"tr46": "^5.1.1",
16+
"webidl-conversions": "^7.0.0",
17+
"whatwg-url": "^14.2.0"
18+
},
19+
"scripts": {
20+
"test": "echo \"Error: no test specified\" && exit 1",
21+
"start": "node csv-uploader.js"
22+
},
23+
"keywords": [],
24+
"author": "",
25+
"license": "ISC",
26+
"description": ""
27+
}

src/components/dashboard/DeveloperEngagementDashboard.tsx

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
"use client";
2-
3-
import * as React from "react";
4-
import { useDashboardSystemContext } from "@/context/DashboardSystemContext";
5-
import ExecutiveSummary from "./ExecutiveSummary";
6-
import { ActionableInsights } from "./ActionableInsights";
7-
import EngagementChart from "./EngagementChart";
8-
import TechnicalProgressChart from "./TechnicalProgressChart";
9-
import { TechPartnerChart } from "./TechPartnerChart";
10-
import TopPerformersTable from "./TopPerformersTable";
11-
import { LoadingSpinner } from "../ui/loading";
12-
import { Card, CardHeader, CardTitle, CardContent } from "../ui/card";
13-
import { Button } from "../ui/button";
14-
import { RefreshCw } from "lucide-react";
15-
import { enhanceTechPartnerData } from "@/lib/utils";
16-
import { processData } from "@/lib/data-processing";
17-
import { CohortSelector } from "./CohortSelector";
18-
import { CohortId, COHORT_DATA } from "@/types/cohort";
19-
import { useCohortData } from "@/hooks/useCohortData";
20-
import PartnerFeedbackMatrix from "./PartnerFeedbackMatrix";
21-
import { AlertsPanel } from "./AlertsPanel";
22-
1+
'use client';
2+
3+
import { useMemo } from 'react';
4+
import { useDashboardSystemContext } from '@/context/DashboardSystemContext';
5+
import ExecutiveSummary from './ExecutiveSummary';
6+
import { ActionableInsights } from './ActionableInsights';
7+
import EngagementChart from './EngagementChart';
8+
import TechnicalProgressChart from './TechnicalProgressChart';
9+
import { TechPartnerChart } from './TechPartnerChart';
10+
import TopPerformersTable from './TopPerformersTable';
11+
import { LoadingSpinner } from '../ui/loading';
12+
import { Card, CardHeader, CardTitle, CardContent } from '../ui/card';
13+
import { Button } from '../ui/button';
14+
import { RefreshCw } from 'lucide-react';
15+
import { enhanceTechPartnerData } from '@/lib/utils';
16+
import { processData } from '@/lib/data-processing';
17+
import { CohortSelector } from './CohortSelector';
18+
import { CohortId, COHORT_DATA } from '@/types/cohort';
19+
import { useCohortData } from '@/hooks/useCohortData';
20+
import PartnerFeedbackMatrix from './PartnerFeedbackMatrix';
21+
//import { AlertsPanel } from './AlertsPanel';
2322

2423
export default function DeveloperEngagementDashboard() {
2524
const {
@@ -68,7 +67,7 @@ export default function DeveloperEngagementDashboard() {
6867
}
6968

7069
if (errorCSV || !processedData) {
71-
return <div>Error: {errorCSV || "No data available"}</div>;
70+
return <div>Error: {errorCSV || 'No data available'}</div>;
7271
}
7372

7473
if (!processedData && isLoadingCSV) {
@@ -131,7 +130,7 @@ export default function DeveloperEngagementDashboard() {
131130
className="flex items-center gap-1 xl:gap-2 max-lg:py-5 bg-white/10 hover:bg-white/20 text-white border-white/20"
132131
>
133132
<RefreshCw
134-
className={`w-4 h-4 ${isFetching ? "animate-spin" : ""}`}
133+
className={`w-4 h-4 ${isFetching ? 'animate-spin' : ''}`}
135134
/>
136135
<p className="w-full text-xs">Refresh Data</p>
137136
</Button>
@@ -145,9 +144,9 @@ export default function DeveloperEngagementDashboard() {
145144
<ExecutiveSummary data={processedData} />
146145
</div>
147146

148-
<div className="mb-6 bg-white rounded-lg shadow-md">
147+
{/* <div className="mb-6 bg-white rounded-lg shadow-md">
149148
<AlertsPanel />
150-
</div>
149+
</div> */}
151150

152151
{/* Action Items Section */}
153152
<div className="mb-8">

src/components/dashboard/ExecutiveSummary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export default function ExecutiveSummary({ data }: Props) {
153153
<Download
154154
className={`w-4 h-4 ${isExporting ? 'animate-spin' : ''}`}
155155
/>
156-
<p className='w-full text-xs'>Export Report</p>
156+
<p className="w-full text-xs">Export Report</p>
157157
</Button>
158158
</div>
159159
</CardHeader>

src/components/dashboard/views/ContributorView.tsx

Lines changed: 58 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
1-
"use client";
2-
import * as React from "react";
1+
'use client';
32

4-
5-
import { EnhancedTechPartnerData } from "@/types/dashboard";
3+
import { EnhancedTechPartnerData } from '@/types/dashboard';
4+
import { useMemo, useState } from 'react';
5+
import { ExternalLink } from 'lucide-react';
6+
import { Button } from '@/components/ui/button';
7+
import {
8+
Dialog,
9+
DialogContent,
10+
DialogDescription,
11+
DialogFooter,
12+
DialogHeader,
13+
DialogTitle,
14+
} from '@/components/ui/dialog';
615
import {
716
Table,
817
TableBody,
918
TableCell,
1019
TableHead,
1120
TableHeader,
1221
TableRow,
13-
} from "@/components/ui/table";
14-
15-
import { ExternalLink, GitPullRequest } from "lucide-react";
22+
} from '@/components/ui/table';
1623
import {
1724
Tooltip,
1825
TooltipContent,
1926
TooltipProvider,
2027
TooltipTrigger,
21-
} from "@/components/ui/tooltip";
22-
import { Button } from "@/components/ui/button";
23-
import {
24-
Dialog,
25-
DialogContent,
26-
DialogDescription,
27-
DialogFooter,
28-
DialogHeader,
29-
DialogTitle,
30-
DialogTrigger,
31-
} from "@/components/ui/dialog";
28+
} from '@/components/ui/tooltip';
3229

3330
interface Contribution {
3431
title: string;
@@ -50,14 +47,14 @@ interface ContributorViewProps {
5047
}
5148

5249
export function ContributorView({ data }: ContributorViewProps) {
53-
54-
const [selectedContributorContributions, setSelectedContributorContributions] =
55-
React.useState<Contribution[]>([]);
56-
const [isDialogOpen, setIsDialogOpen] = React.useState(false);
57-
const [dialogTitle, setDialogTitle] = React.useState("");
58-
59-
const contributors = React.useMemo(() => {
60-
50+
const [
51+
selectedContributorContributions,
52+
setSelectedContributorContributions,
53+
] = useState<Contribution[]>([]);
54+
const [isDialogOpen, setIsDialogOpen] = useState(false);
55+
const [dialogTitle, setDialogTitle] = useState('');
56+
57+
const contributors = useMemo(() => {
6158
if (!data?.length) return [];
6259
const contributorMap = new Map<string, ContributorDetails>();
6360

@@ -159,29 +156,31 @@ export function ContributorView({ data }: ContributorViewProps) {
159156
<TableCell>{contributor.totalIssues}</TableCell>
160157
<TableCell>{contributor.engagement.toFixed(1)}</TableCell>
161158
<TableCell className="text-right">
162-
{contributor.contributions.slice(0, 3).map((contribution, idx) => (
163-
<Tooltip key={idx}>
164-
<TooltipTrigger className="underline cursor-pointer text-blue-500">
165-
{contribution.title.length > 20
166-
? `${contribution.title.slice(0, 20)}...`
167-
: contribution.title}
168-
</TooltipTrigger>
169-
<TooltipContent className="bg-white border border-black">
170-
<p className="text-black">{contribution.title}</p>
171-
<p className="text-xs text-muted-foreground">
172-
Week: {contribution.week}
173-
</p>
174-
<a
175-
href={contribution.url}
176-
target="_blank"
177-
rel="noopener noreferrer"
178-
className="text-xs text-green-600 hover:text-green-800 flex items-center gap-1"
179-
>
180-
View on GitHub <ExternalLink className="h-3 w-3" />
181-
</a>
182-
</TooltipContent>
183-
</Tooltip>
184-
))}
159+
{contributor.contributions
160+
.slice(0, 3)
161+
.map((contribution, idx) => (
162+
<Tooltip key={idx}>
163+
<TooltipTrigger className="underline cursor-pointer text-blue-500">
164+
{contribution.title.length > 20
165+
? `${contribution.title.slice(0, 20)}...`
166+
: contribution.title}
167+
</TooltipTrigger>
168+
<TooltipContent className="bg-white border border-black">
169+
<p className="text-black">{contribution.title}</p>
170+
<p className="text-xs text-muted-foreground">
171+
Week: {contribution.week}
172+
</p>
173+
<a
174+
href={contribution.url}
175+
target="_blank"
176+
rel="noopener noreferrer"
177+
className="text-xs text-green-600 hover:text-green-800 flex items-center gap-1"
178+
>
179+
View on GitHub <ExternalLink className="h-3 w-3" />
180+
</a>
181+
</TooltipContent>
182+
</Tooltip>
183+
))}
185184
{contributor.contributions.length > 3 && (
186185
<Button
187186
size="sm"
@@ -192,7 +191,9 @@ export function ContributorView({ data }: ContributorViewProps) {
192191
</Button>
193192
)}
194193
{contributor.contributions.length === 0 && (
195-
<span className="text-muted-foreground">No recent contributions</span>
194+
<span className="text-muted-foreground">
195+
No recent contributions
196+
</span>
196197
)}
197198
</TableCell>
198199
</TableRow>
@@ -204,15 +205,19 @@ export function ContributorView({ data }: ContributorViewProps) {
204205
<DialogContent className="sm:max-w-[425px]">
205206
<DialogHeader>
206207
<DialogTitle>{dialogTitle}</DialogTitle>
207-
<DialogDescription>All contributions from this contributor.</DialogDescription>
208+
<DialogDescription>
209+
All contributions from this contributor.
210+
</DialogDescription>
208211
</DialogHeader>
209212
<div className="max-h-[400px] overflow-y-auto">
210213
{selectedContributorContributions.length > 0 ? (
211214
<ul className="space-y-2">
212215
{selectedContributorContributions.map((contribution, index) => (
213216
<li key={index} className="border rounded-md p-2">
214217
<p className="font-semibold">{contribution.title}</p>
215-
<p className="text-sm text-muted-foreground">Week: {contribution.week}</p>
218+
<p className="text-sm text-muted-foreground">
219+
Week: {contribution.week}
220+
</p>
216221
<a
217222
href={contribution.url}
218223
target="_blank"
@@ -237,4 +242,4 @@ export function ContributorView({ data }: ContributorViewProps) {
237242
</Dialog>
238243
</TooltipProvider>
239244
);
240-
}
245+
}

0 commit comments

Comments
 (0)