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

Add ucla-opensource page #125

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add ucla-opensource page #125

wants to merge 3 commits into from

Conversation

Amyh11325
Copy link
Contributor

Adds a ucla-opensource page containing repositories tagged with topic 'ucla-opensource'. Closes #124
Screen Shot 2022-07-20 at 9 19 10 PM

  • New page on /ucla-opensource
  • Left the code largely the same as the project page's
  • Wasn't sure what image put for the repos, so I left it the same as the project page
  • Searches for repos with topic ucla-opensource every hour

@Amyh11325 Amyh11325 requested a review from matthewcn56 July 21, 2022 04:19
Copy link
Member

@matthewcn56 matthewcn56 left a comment

Choose a reason for hiding this comment

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

Thanks for doing this Amy! There's a couple linked issues that I put similar to what Matt left for my PR, and aside from that we can probably change the default image with each ucla-opensource project as well as clean up some code smells by making the project display its own function. Great work though!

setFilteredProjects={setFilteredProjects}
/>
<hr/>
<div className="row same-height-grid">
Copy link
Member

Choose a reason for hiding this comment

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

This grid of projects is pretty much exactly the same as the projects page. Maybe we can export the grid as a React component which takes in an array of projects and shows them on the screen? That way, if we want to edit the layout of the ucla-opensource page or the projects page, it'll be easier to handle the differences between them!

@@ -3,6 +3,43 @@ import { paginateRest } from '@octokit/plugin-paginate-rest';
import githubColorsFixture from '../data/githubColors.json';
import { Project, ACMCommitteeTopics, GitHubColors } from './types';

export async function getUclaOpenSource(): Promise<Project[]> {
const PaginatedOctokit = Octokit.plugin(paginateRest);
const octokit = new PaginatedOctokit();
Copy link
Member

Choose a reason for hiding this comment

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

Similar comment to this pr!

Suggested change
const octokit = new PaginatedOctokit();
const octokit = new Octokit.plugin(paginateRest);

instead of

  const PaginatedOctokit = Octokit.plugin(paginateRest);
  const octokit = new PaginatedOctokit();

(a, b) =>
new Date(b.updated_at as string).getTime() - new Date(a.updated_at as string).getTime(),
);
return sortedData.map((repo) =>
Copy link
Member

Choose a reason for hiding this comment

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

Similar issue to this pr!

This entire function can be replaced by

Suggested change
return sortedData.map((repo) =>
return sortedData.map((repo) => ({
name: repo.name,
description: repo.description ?? '',
link: repo.homepage ?? '',
repo: repo.html_url,
lang: repo.language ?? '',
topics: repo.topics ?? [],
image: getImageFromTopics(repo.topics).image,
alt: getImageFromTopics(repo.topics).alt,
})

ucla-opensource
</h1>
<p>
a (work-in-progress) heads-up overview of open source projects at UCLA.
Copy link
Member

Choose a reason for hiding this comment

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

maybe call it a collection of open source projects at UCLA instead of an overview?

repo: repo.html_url,
lang: repo.language ?? '',
topics: repo.topics ?? [],
image: getImageFromTopics(repo.topics).image,
Copy link
Member

Choose a reason for hiding this comment

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

For our placeholder image, maybe we can use the UCLA logo instead of the ACM logo as these are projects by UCLA students? down the line, we can do stuff like grabbing the social media preview image for each project and displaying that, but that can be a stretch goal for later

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.

Fleshing Out ucla-opensource Page
2 participants