Skip to content

Commit

Permalink
Merge pull request nishantwrp#96 from nishantwrp/2023-orgs
Browse files Browse the repository at this point in the history
2023 orgs
  • Loading branch information
nishantwrp authored Feb 25, 2023
2 parents 3cfc1e0 + 3393715 commit 2b9c7e4
Show file tree
Hide file tree
Showing 10 changed files with 4,297 additions and 9 deletions.
6 changes: 5 additions & 1 deletion api/compile-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {
nameFilters,
} = require("./filters")

const YEARS = [2016, 2017, 2018, 2019, 2020, 2021, 2022]
const YEARS = [2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023]

const getDataPath = year => {
return `api/data/${year}.json`
Expand Down Expand Up @@ -157,6 +157,8 @@ const updateOrg = (combinedJson, orgJson) => {
"twitter_url",
"blog_url",
"category",
"ideas_url",
"guide_url",
]
for (const prop of basic_properties) {
combinedJson[prop] = orgJson[prop] || combinedJson[prop]
Expand Down Expand Up @@ -208,6 +210,8 @@ const getCombinedOrgJson = orgList => {
irc_channel: "",
contact_email: "",
mailing_list: "",
ideas_url: "",
guide_url: "",
}

orgList = orgList.sort((a, b) => {
Expand Down
4,208 changes: 4,208 additions & 0 deletions api/data/2023.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions api/imp_links.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"url": "https://discord.gg/peGA5K8tJU"
}
],
"Casbin" : [
"Casbin": [
{
"title": "Contribution guidelines for Casbin",
"url":"https://github.com/casbin/casbin/blob/master/CONTRIBUTING.md"
"url": "https://github.com/casbin/casbin/blob/master/CONTRIBUTING.md"
}
]
}
5 changes: 3 additions & 2 deletions src/components/notification.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ const Notification = () => {
return (
<Message positive style={style}>
<Message.Header>
GSoC 2023 has been announced. Read the announcement blog{" "}
Organizations participating in GSoC 2023 have been announced. View them
in the official site{" "}
<a
href="https://opensource.googleblog.com/2022/11/get-ready-for-google-summer-of-code-2023.html"
href="https://summerofcode.withgoogle.com/programs/2023/organizations"
target="_blank"
>
<u>here</u>
Expand Down
42 changes: 41 additions & 1 deletion src/components/org-info.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import PropTypes from "prop-types"
import "./org-info.css"

import { OutboundLink } from "gatsby-plugin-google-analytics"
import { Divider, Button, Header, Icon, Popup } from "semantic-ui-react"
import {
Divider,
Button,
Header,
Icon,
Popup,
Message,
} from "semantic-ui-react"

const OrgInfo = ({ data }) => {
const years = Object.keys(data.years)
Expand All @@ -29,6 +36,8 @@ const OrgInfo = ({ data }) => {
return <span className="org-info-topic">{topic}</span>
})

const isParticipatingIn2023 = "2023" in data.years

return (
<div className="org-info-container">
<div
Expand All @@ -44,6 +53,37 @@ const OrgInfo = ({ data }) => {
}}
></div>
</div>
{isParticipatingIn2023 && (
<Message color="orange" style={{ margin: "1%" }}>
<Message.Header>
{data.name} is participating in{" "}
<OutboundLink
href={data.years["2023"].projects_url}
rel="noreferrer"
target="_blank"
>
<u>GSoC 2023</u>
</OutboundLink>
. View the{" "}
<OutboundLink
href={data.ideas_url}
rel="noreferrer"
target="_blank"
>
<u>ideas list</u>
</OutboundLink>{" "}
and the{" "}
<OutboundLink
href={data.guide_url}
rel="noreferrer"
target="_blank"
>
<u>contribution guide</u>
</OutboundLink>{" "}
for this organization.
</Message.Header>
</Message>
)}
<div className="org-info-site-container">
<OutboundLink href={data.url} rel="noreferrer" target="_blank">
<Button icon labelPosition="left" color="orange">
Expand Down
5 changes: 4 additions & 1 deletion src/components/projects-graph.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ const ProjectsGraph = ({ data }) => {
}
`)

const years = queryData.filter.years.map(item => item.name).sort()
const years = queryData.filter.years
.map(item => item.name)
.sort()
.filter(item => item != 2023)
const numProjects = []

for (const year of years) {
Expand Down
1 change: 1 addition & 0 deletions src/components/projects-section.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const ProjectsSection = ({ data }) => {
const projectColumns = useBreakpoint().l ? 3 : 4

const projectPanes = Object.entries(data)
.filter(([year, _]) => year != 2023)
.map(([year, yearData]) => {
return {
menuItem: year,
Expand Down
5 changes: 5 additions & 0 deletions src/components/sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ const Sidebar = ({ config, showFilters }) => {
</div>
<Divider className="sidebar-divider" />
<div className="sidebar-content-filters">
<Filter
name="shortcuts"
choices={[{ name: "First-time organizations", frequency: 20 }]}
sortBy="frequency"
/>
<Filter name="years" choices={years} sortBy="name" order="desc" />
<Filter name="categories" choices={categories} sortBy="name" />
<Filter
Expand Down
19 changes: 18 additions & 1 deletion src/pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const getFilteredOrganizations = (organizations, searchQuery, filters) => {
}

// NOTE: YEARS - intersection, REST - union.
const { years, categories, technologies, topics } = filters
const { years, categories, technologies, topics, shortcuts } = filters

if (years.length > 0) {
let newFilteredOrganizations = []
Expand Down Expand Up @@ -109,6 +109,18 @@ const getFilteredOrganizations = (organizations, searchQuery, filters) => {
filteredOrganizations = newFilteredOrganizations
}

if (shortcuts.length > 0) {
// There is only one shortcut. Directly implement it. Need to refactor this.
let newFilteredOrganizations = []
for (const organization of filteredOrganizations) {
const orgYears = Object.keys(organization.years)
if (orgYears.length == 1 && orgYears[0] == 2023) {
newFilteredOrganizations.push(organization)
}
}
filteredOrganizations = newFilteredOrganizations
}

return filteredOrganizations
}

Expand Down Expand Up @@ -136,6 +148,7 @@ const IndexPage = ({ data }) => {
categories: [],
technologies: [],
topics: [],
shortcuts: [],
}

dispatch(
Expand Down Expand Up @@ -286,6 +299,10 @@ export const query = graphql`
num_projects
projects_url
}
_2023 {
num_projects
projects_url
}
}
}
}
Expand Down
11 changes: 10 additions & 1 deletion src/store/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const filtersSlice = createSlice({
categories: [],
technologies: [],
topics: [],
shortcuts: [],
}
)
},
Expand All @@ -40,18 +41,26 @@ const filtersSlice = createSlice({
updateFiltersInUrl(state)
},
setFilters: (state, action) => {
const { years, categories, technologies, topics } = action.payload
const {
years,
categories,
technologies,
topics,
shortcuts,
} = action.payload
state.years = years
state.categories = categories
state.technologies = technologies
state.topics = topics
state.shortcuts = shortcuts
updateFiltersInUrl(state)
},
clearFilters: state => {
state.years = []
state.categories = []
state.technologies = []
state.topics = []
state.shortcuts = []
updateFiltersInUrl(state)
},
},
Expand Down

0 comments on commit 2b9c7e4

Please sign in to comment.