Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#195 Issue:Project Stats Page #231

Open
wants to merge 8 commits into
base: truth-redefined-again
Choose a base branch
from

Conversation

pranjal3060
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Jan 6, 2024

@pranjal3060 is attempting to deploy a commit to the kossiitkgp Team on Vercel.

A member of the Team first needs to authorize it.

import { makeRequest } from "../util/backend";
import { useAuthContext } from "../util/auth";
import { IEndpointTypes } from "../util/types";
//import { Console } from "console";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove unused code.

const [error, setError] = useState<string | null>(null);

// Access the project ID from the route parameters
const { } = useParams();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, unused.

// Make a request to the specific project stats endpoint
makeRequest("stats/projects", "get", null, authContext.jwt)
.then((response) => {
console.log(response)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logging the response is not necessary.

<td>{project.repo_link}</td>
<td>{project.commit_count}</td>
<td>{project.pull_count}</td>
{/* Add more cells as needed */}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any data left?

src/util/types.ts Show resolved Hide resolved
Copy link

vercel bot commented Jan 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kwoc-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2024 5:29pm

import { IEndpointTypes } from "../util/types";
import { useAuthContext } from "../util/auth";

// ... (imports)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// ... (imports)

pull_count: number;
lines_added: number;
lines_removed: number;
languages_used: string[];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not returned by the endpoint.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rename the file to ProjectStats.tsx?

<tbody>
{projectStats.map((project) => (
<tr key={project.repo_link}>
<td>{project.name}</td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to display the name as a link to the repo.

{projectStats.map((project) => (
<tr key={project.repo_link}>
<td>{project.name}</td>
<td>{project.repo_link}</td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field won't be required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants