Skip to content

Commit c81e6f5

Browse files
authored
refactor: move ongoing projects to contribute page (#200)
* add ongoing projects list to contribute page * remove ongoing projects list from programs page
1 parent 79be351 commit c81e6f5

3 files changed

Lines changed: 134 additions & 49 deletions

File tree

src/components/Header/Header.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function Header() {
9999
className="text-color"
100100
activeClassName="active"
101101
>
102-
Programs & Projects
102+
Contributor Programs
103103
</Link>
104104
</NavLink>
105105
</DropdownItem>

src/pages/contribute.jsx

Lines changed: 85 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
import React from "react";
22
import { graphql, Link } from "gatsby";
33
import { Row, Col } from "reactstrap";
4+
import PostListing from "../components/PostListing/PostListing";
45
import Section from "../components/Section";
56
import SEO from "../components/SEO/SEO";
67
import Layout from "../layout";
78

8-
function GettingStarted() {
9+
function GettingStarted({ data }) {
10+
function toCardData(project, defaultCover) {
11+
const { id, name: title, labels, childMarkdownRemark } = project;
12+
const { excerpt } = childMarkdownRemark;
13+
const posttype = "project";
14+
const tags = labels.map((l) => l.name);
15+
const cover = defaultCover;
16+
return { posttype, title, path: `/projects/${id}`, excerpt, tags, cover };
17+
}
18+
19+
const defaultCover = data.projectCover;
20+
const ongoingProjects = data.ongoingProjects.nodes.map((project) =>
21+
toCardData(project, defaultCover)
22+
);
23+
924
return (
1025
<Layout title="Getting Contributors Started">
1126
<Row className="justify-content-center align-items-start">
@@ -17,11 +32,22 @@ function GettingStarted() {
1732
Workspace Setup
1833
</Link>
1934
{` and `}
20-
<Link className="text-success" to="#engine-modules">
21-
{`Terasology's Engine & Module Land`}
35+
<Link
36+
className="text-success"
37+
to="#terasology-engine-and-module-land"
38+
>
39+
Terasology Engine & Module Land
2240
</Link>{" "}
2341
should help you to get started and set yourself up for success.
2442
</p>
43+
<p>
44+
To get started with your first contribution, you will also find our
45+
current{" "}
46+
<Link className="text-success" to="#hot-topics">
47+
Hot Topics
48+
</Link>
49+
{` below that you can consider joining.`}
50+
</p>
2551
<p>
2652
Make sure to also join our{" "}
2753
<a
@@ -266,13 +292,68 @@ function GettingStarted() {
266292
</Col>
267293
</Row>
268294
</Section>
295+
<Section tag="h3" title="Tasks & Topics">
296+
<Row className="justify-content-center align-items-start">
297+
<Col md="8" className="text-justify">
298+
<p>
299+
While you are free to roam our codebase and contribute in any area
300+
you would like, below are some tasks and topics that we encourage
301+
you to consider. Their scope and feasibility are potentially more
302+
realistic than a goal you might set for yourself without knowing
303+
the depths and intricacies of our codebase.
304+
</p>
305+
</Col>
306+
</Row>
307+
{ongoingProjects.length !== 0 ? (
308+
<Section tag="h4" title="Hot Topics">
309+
<Row className="justify-content-center align-items-start">
310+
<Col md="8" className="text-justify">
311+
<p>
312+
Find our currently ongoing efforts below. Come talk to us on
313+
our{" "}
314+
<a
315+
className="text-success font-weight-bold"
316+
href="https://discordapp.com/invite/Terasology"
317+
>
318+
Discord
319+
</a>{" "}
320+
if you would like to join one of them. You can also propose
321+
your own project ideas.
322+
</p>
323+
</Col>
324+
</Row>
325+
<PostListing postList={ongoingProjects} />
326+
</Section>
327+
) : null}
328+
</Section>
269329
</Layout>
270330
);
271331
}
272332
export default GettingStarted;
273333

274334
export const pageQuery = graphql`
275-
query siteQuery {
335+
query pageQuery {
336+
ongoingProjects: allTrelloCard(
337+
filter: { list_id: { eq: "60ddd7cf64da4b3ee8c5a2e9" } }
338+
sort: { index: ASC }
339+
) {
340+
nodes {
341+
id
342+
list_id
343+
name
344+
labels {
345+
name
346+
}
347+
childMarkdownRemark {
348+
excerpt
349+
}
350+
}
351+
}
352+
projectCover: file(name: { eq: "defaultCardcover" }, ext: { eq: ".jpg" }) {
353+
childImageSharp {
354+
gatsbyImageData
355+
}
356+
}
276357
site {
277358
siteMetadata {
278359
title

src/pages/programs.jsx

Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -18,46 +18,38 @@ function toCardData(trelloCard, defaultCover) {
1818
}
1919

2020
function ContributorPrograms({ data }) {
21-
const trelloCards = data.allTrelloCard.nodes;
22-
2321
const defaultCover = data.projectCover;
24-
const availableProjects = trelloCards
25-
.filter((node) => node.list_id === "5c3aab0bd640fe19e4069de5")
26-
.map((node) => toCardData(node, defaultCover));
27-
const ongoingProjects = trelloCards
28-
.filter((node) => node.list_id === "60ddd7cf64da4b3ee8c5a2e9")
29-
.map((node) => toCardData(node, defaultCover));
30-
22+
const availableProjects = data.availableProjects.nodes.map((node) =>
23+
toCardData(node, defaultCover)
24+
);
3125
const defaultAvatar = data.profilePlaceholder;
32-
const mentorList = trelloCards
33-
.filter((node) => node.list_id === "5eb715b48caa18614425c25e")
34-
.map((node) => {
35-
const {
36-
name,
37-
labels,
38-
custom_fields: customFields,
39-
childMarkdownRemark,
40-
childCardMedia,
41-
} = node;
42-
const { html } = childMarkdownRemark;
43-
const avatar = childCardMedia ? childCardMedia.localFile : defaultAvatar;
26+
const mentorList = data.mentors.nodes.map((node) => {
27+
const {
28+
name,
29+
labels,
30+
custom_fields: customFields,
31+
childMarkdownRemark,
32+
childCardMedia,
33+
} = node;
34+
const { html } = childMarkdownRemark;
35+
const avatar = childCardMedia ? childCardMedia.localFile : defaultAvatar;
4436

45-
const tags = labels.map((l) => l.name);
46-
const githubProfile = customFields.find(
47-
(field) => field.idCustomField === "5eb71b3551de3a59ce8d9bd8"
48-
)?.value.text;
49-
const timeZone = customFields.find(
50-
(field) => field.idCustomField === "5eb71b53f52d88487f550e83"
51-
)?.value.text;
52-
const countryCode = customFields
53-
.find((field) => field.idCustomField === "5eb71b7081a67c3b58ea67ed")
54-
?.value.text.toLowerCase();
37+
const tags = labels.map((l) => l.name);
38+
const githubProfile = customFields.find(
39+
(field) => field.idCustomField === "5eb71b3551de3a59ce8d9bd8"
40+
)?.value.text;
41+
const timeZone = customFields.find(
42+
(field) => field.idCustomField === "5eb71b53f52d88487f550e83"
43+
)?.value.text;
44+
const countryCode = customFields
45+
.find((field) => field.idCustomField === "5eb71b7081a67c3b58ea67ed")
46+
?.value.text.toLowerCase();
5547

56-
return { name, avatar, tags, html, githubProfile, timeZone, countryCode };
57-
});
48+
return { name, avatar, tags, html, githubProfile, timeZone, countryCode };
49+
});
5850

5951
return (
60-
<Layout title="Contributor Programs & Projects">
52+
<Layout title="Contributor Programs">
6153
<Section tag="h3" title="GSoC & TSoC">
6254
<Row className="justify-content-center align-items-start">
6355
<Col md="5" className="text-justify student-programs-content">
@@ -94,13 +86,8 @@ function ContributorPrograms({ data }) {
9486
</Col>
9587
</Row>
9688
</Section>
97-
{ongoingProjects.length !== 0 ? (
98-
<Section tag="h3" title="Ongoing Projects">
99-
<PostListing postList={ongoingProjects} />
100-
</Section>
101-
) : null}
10289
{availableProjects.length !== 0 ? (
103-
<Section tag="h3" title="Available Projects">
90+
<Section tag="h3" title="Available Topics">
10491
<PostListing postList={availableProjects} />
10592
</Section>
10693
) : null}
@@ -130,7 +117,26 @@ export default ContributorPrograms;
130117

131118
export const pageQuery = graphql`
132119
query projectQuery {
133-
allTrelloCard(sort: { index: ASC }) {
120+
availableProjects: allTrelloCard(
121+
filter: { list_id: { eq: "5c3aab0bd640fe19e4069de5" } }
122+
sort: { index: ASC }
123+
) {
124+
nodes {
125+
id
126+
list_id
127+
name
128+
labels {
129+
name
130+
}
131+
childMarkdownRemark {
132+
excerpt
133+
}
134+
}
135+
}
136+
mentors: allTrelloCard(
137+
filter: { list_id: { eq: "5eb715b48caa18614425c25e" } }
138+
sort: { index: ASC }
139+
) {
134140
nodes {
135141
id
136142
list_id
@@ -180,8 +186,6 @@ export const pageQuery = graphql`
180186

181187
export function Head({ data }) {
182188
return (
183-
<SEO
184-
title={`Contributor Programs & Projects | ${data.site.siteMetadata.title}`}
185-
/>
189+
<SEO title={`Contributor Programs | ${data.site.siteMetadata.title}`} />
186190
);
187191
}

0 commit comments

Comments
 (0)