Skip to content

Commit 2523054

Browse files
Merge branch 'master' into master
2 parents bb17848 + 50b20c2 commit 2523054

File tree

8 files changed

+328
-86
lines changed

8 files changed

+328
-86
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
title: Finish GSoD Tasks and Explore CC Catalog Documentation
2+
3+
---
4+
categories:
5+
cc-catalog
6+
gsod
7+
gsod-2020
8+
open-source
9+
community
10+
---
11+
author: ariessa
12+
---
13+
series: gsod-2020-cccatalog-api-usage-guide
14+
---
15+
pub_date: 2020-11-20
16+
---
17+
body:
18+
19+
Today marks my fifth blog entry on Creative Commons.
20+
For week 9 and 10, I explored CC Catalog documentation and began improving the documentation by removing keys and generalizing instructions.
21+
22+
### Week 9
23+
24+
I had completed all GSoD tasks by week 9.
25+
So, I took a couple of days off and fixed last week's PR.
26+
Kriti assigned me with new tasks, which is to port CC Catalog documentation from the internal wiki into GitHub repository.
27+
Brent, the CC Catalog maintainer explained to me about what needs to be done.
28+
29+
### Week 10
30+
31+
For week 10, I started exploring CC Catalog and its documentation.
32+
Reminds me a lot about the first and second weeks of GSoD.
33+
Trying to understand new stuff and having an "aha" moment when the dots finally connect.
34+
I started to move the documentation from the internal wiki to CC Catalog’s GitHub repository.
35+
I also wrote and published this blog post.
36+
37+
----
38+
39+
End of blog entry.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
title: Restructure README and Add Documentation Guidelines
2+
3+
---
4+
categories:
5+
cc-catalog-api
6+
gsod
7+
gsod-2020
8+
open-source
9+
community
10+
---
11+
author: ariessa
12+
---
13+
series: gsod-2020-cccatalog-api-usage-guide
14+
---
15+
pub_date: 2020-11-5
16+
---
17+
body:
18+
19+
This is my fourth blog entry on Creative Commons.
20+
For week 7 and 8, I restructured the file README to be more digestible to new users and created Documentation Guidelines for CC Catalog API documentation.
21+
22+
### Week 7
23+
For this week, I restructured the file README in CC Catalog API repository.
24+
I added a step by step guide on how to run the server locally.
25+
I hope new users will be less intimidated to contribute to this project with the updated guide on how to run the server locally.
26+
27+
### Week 8
28+
29+
For week 8, I created Documentation Guidelines which provides steps on how to contribute to CC Catalog API documentation, documentation styles, and cheat sheet for drf-yasg.
30+
I also wrote and published this blog post.
31+
32+
----
33+
34+
Finis.

databags/issues.json

Lines changed: 31 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
{
22
"issues": [
3+
{
4+
"createdAt": 1597429171,
5+
"labels": [
6+
"Hacktoberfest",
7+
"help wanted",
8+
"\ud83d\udcaa skill: python",
9+
"\ud83d\udee0 goal: fix",
10+
"\ud83e\udd16 aspect: dx"
11+
],
12+
"number": 60,
13+
"repo": "ccos-scripts",
14+
"title": "Code organisation can be improved",
15+
"updatedAt": 1601578230,
16+
"url": "https://github.com/creativecommons/ccos-scripts/issues/60"
17+
},
318
{
419
"createdAt": 1596741568,
520
"labels": [
@@ -303,19 +318,6 @@
303318
"updatedAt": 1601490653,
304319
"url": "https://github.com/creativecommons/creativecommons.github.io-source/issues/159"
305320
},
306-
{
307-
"createdAt": 1579285909,
308-
"labels": [
309-
"Hacktoberfest",
310-
"good first issue",
311-
"help wanted"
312-
],
313-
"number": 405,
314-
"repo": "cccatalog-api",
315-
"title": "Document error schemas",
316-
"updatedAt": 1606390369,
317-
"url": "https://github.com/creativecommons/cccatalog-api/issues/405"
318-
},
319321
{
320322
"createdAt": 1578954773,
321323
"labels": [
@@ -430,36 +432,37 @@
430432
"url": "https://github.com/creativecommons/creativecommons.org/issues/940"
431433
},
432434
{
433-
"createdAt": 1605704389,
435+
"createdAt": 1606659007,
434436
"labels": [
435437
"good first issue",
436438
"help wanted",
437439
"\ud83c\udfc1 status: ready for work",
438-
"\ud83d\udcc4 aspect: text",
440+
"\ud83d\udcbb aspect: code",
439441
"\ud83d\udee0 goal: fix",
440-
"\ud83d\udfe7 priority: high"
442+
"\ud83d\udfe8 priority: medium",
443+
"\ud83e\udd16 aspect: dx"
441444
],
442-
"number": 207,
443-
"repo": "chooser",
444-
"title": "Correct the attribution information for the CC0 license",
445-
"updatedAt": 1606284360,
446-
"url": "https://github.com/creativecommons/chooser/issues/207"
445+
"number": 105,
446+
"repo": "ccos-scripts",
447+
"title": "TypeError: Item in __all__ must be str, not function",
448+
"updatedAt": 1606659105,
449+
"url": "https://github.com/creativecommons/ccos-scripts/issues/105"
447450
},
448451
{
449-
"createdAt": 1605704042,
452+
"createdAt": 1605704389,
450453
"labels": [
451454
"good first issue",
452455
"help wanted",
453456
"\ud83c\udfc1 status: ready for work",
454-
"\ud83d\udcbb aspect: code",
457+
"\ud83d\udcc4 aspect: text",
455458
"\ud83d\udee0 goal: fix",
456459
"\ud83d\udfe7 priority: high"
457460
],
458-
"number": 206,
461+
"number": 207,
459462
"repo": "chooser",
460-
"title": "Copy action is not working in plain text tab",
461-
"updatedAt": 1606041470,
462-
"url": "https://github.com/creativecommons/chooser/issues/206"
463+
"title": "Correct the attribution information for the CC0 license",
464+
"updatedAt": 1606284360,
465+
"url": "https://github.com/creativecommons/chooser/issues/207"
463466
},
464467
{
465468
"createdAt": 1604609253,
@@ -490,7 +493,7 @@
490493
"number": 759,
491494
"repo": "vocabulary",
492495
"title": "Add two new text styles",
493-
"updatedAt": 1606142607,
496+
"updatedAt": 1606601290,
494497
"url": "https://github.com/creativecommons/vocabulary/issues/759"
495498
},
496499
{
@@ -607,24 +610,6 @@
607610
"updatedAt": 1606498685,
608611
"url": "https://github.com/creativecommons/vocabulary/issues/689"
609612
},
610-
{
611-
"createdAt": 1601003812,
612-
"labels": [
613-
"Hacktoberfest",
614-
"good first issue",
615-
"help wanted",
616-
"\u2728 goal: improvement",
617-
"\ud83c\udfc1 status: ready for work",
618-
"\ud83d\udcbb aspect: code",
619-
"\ud83d\udfe9 priority: low",
620-
"\ud83e\udd16 aspect: dx"
621-
],
622-
"number": 85,
623-
"repo": "ccos-scripts",
624-
"title": "Increase readability of label data files",
625-
"updatedAt": 1602076855,
626-
"url": "https://github.com/creativecommons/ccos-scripts/issues/85"
627-
},
628613
{
629614
"createdAt": 1600925457,
630615
"labels": [
@@ -748,21 +733,6 @@
748733
"title": "Improvements to logging",
749734
"updatedAt": 1606560369,
750735
"url": "https://github.com/creativecommons/ccos-scripts/issues/63"
751-
},
752-
{
753-
"createdAt": 1597429171,
754-
"labels": [
755-
"Hacktoberfest",
756-
"help wanted",
757-
"\ud83d\udcaa skill: python",
758-
"\ud83d\udee0 goal: fix",
759-
"\ud83e\udd16 aspect: dx"
760-
],
761-
"number": 60,
762-
"repo": "ccos-scripts",
763-
"title": "Code organisation can be improved",
764-
"updatedAt": 1601578230,
765-
"url": "https://github.com/creativecommons/ccos-scripts/issues/60"
766736
}
767737
]
768738
}

themes/vocabulary_theme/templates/issue_finder.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,4 @@ <h1>{{ this.title }}</h1>
3939
</div>
4040
</div>
4141
</div>
42-
<script>
43-
// Transfer all issues to the JavaScript domain
44-
window.issues =
45-
{{ bag('issues.issues')|tojson }}
46-
</script>
4742
{% endblock %}

webpack/js/components.js

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import VueSelect from 'vue-select';
2+
import {Octokit} from '@octokit/rest';
23

34
import {hydrateAppWithData} from "./hydration";
45

@@ -40,7 +41,7 @@ export const IssueCard = {
4041
</h4>
4142
<p class="is-size-6">
4243
<a
43-
:href="issue.url"
44+
:href="issue.html_url"
4445
target="_blank">
4546
<span class="has-color-forest-green">
4647
{{ issue.repo }}#{{ issue.number }}
@@ -70,8 +71,7 @@ export const IssueCard = {
7071
},
7172
computed: {
7273
dateCreated() {
73-
const dateCreated = new Date(this.issue.createdAt * 1000)
74-
const [dateComponent,] = dateCreated.toISOString().split("T")
74+
const [dateComponent,] = this.issue.created_at.split("T")
7575
return dateComponent
7676
}
7777
}
@@ -84,6 +84,20 @@ export const App = {
8484
<div class="columns">
8585
<div class="column is-one-quarter">
8686
<form id="filters" v-if="options.skills.length">
87+
<label for="aim">
88+
<strong>Aim</strong><br/>
89+
I am interested in...
90+
</label>
91+
<VueSelect
92+
v-model="filters.aim"
93+
id="aim"
94+
name="aim"
95+
:options="options.aims"
96+
label="name"
97+
:reduce="aim => aim.code"
98+
:clearable="false"/>
99+
<br/>
100+
<template v-if="filters.aim === 'contribute'">
87101
<label for="skills">
88102
<strong>Skill set*</strong><br/>
89103
Choose up to three skills that you would like to see issues for.
@@ -110,6 +124,7 @@ export const App = {
110124
label="name"
111125
:reduce="experience => experience.code"
112126
:clearable="false"/>
127+
</template>
113128
</form>
114129
<p class="disclaimer">
115130
*Not all issues have skills marked on them, especially if they are
@@ -144,18 +159,24 @@ export const App = {
144159
data() {
145160
return {
146161
options: {
162+
aims: [
163+
{name: 'Contributing code', code: 'contribute'},
164+
{name: 'Triaging issues', code: 'triage'}
165+
],
147166
skills: [],
148167
experiences: [
149168
{name: 'Yes, it is', code: 'beginner'},
150169
{name: 'No, it isn\'t', code: 'experienced'}
151170
]
152171
},
153172
filters: {
173+
aim: 'contribute',
154174
skills: [],
155175
experience: 'experienced'
156176
},
157177
categories: {},
158-
issues: []
178+
issues: [],
179+
octokit: null
159180
}
160181
},
161182
computed: {
@@ -165,26 +186,61 @@ export const App = {
165186
* @returns {array} the array of filtered issues
166187
*/
167188
filteredIssues() {
168-
return window.issues.filter(issue => {
189+
return this.issues.filter(issue => {
190+
// If aim is to triage issues
191+
if (this.filters.aim === 'triage') {
192+
// Show all issues as they all have the label "🚦 status: awaiting triage"
193+
return true
194+
}
195+
169196
// Check experience match
170197
if (this.filters.experience === 'beginner' && !issue.labels.includes('good first issue')) {
171198
return false
172199
}
173200

174201
// Check skill set match
175202
const joinedLabels = issue.labels.join(',')
176-
if (this.filters.skills.length && !this.filters.skills.some(skill => joinedLabels.includes(skill))) {
177-
return false
178-
}
179-
180-
return true
203+
return !(this.filters.skills.length && !this.filters.skills.some(skill => joinedLabels.includes(skill)));
181204
}).sort((a, b) => b.createdAt - a.createdAt)
182205
}
183206
},
207+
watch: {
208+
'filters.aim' (to, from) {
209+
if (to !== from) {
210+
this.loadIssues()
211+
}
212+
}
213+
},
214+
methods: {
215+
loadIssues () {
216+
const q = ['org:creativecommons', 'is:open', 'is:issue']
217+
if (this.filters.aim === 'contribute') {
218+
q.push('label:"help wanted"')
219+
} else if (this.filters.aim === 'triage') {
220+
q.push('label:"🚦 status: awaiting triage"')
221+
}
222+
this.octokit.search.issuesAndPullRequests({
223+
q: q.join(' '),
224+
per_page: 100,
225+
sort: 'updated'
226+
}).then(res => {
227+
this.issues = res.data.items
228+
this.issues.forEach(issue => {
229+
issue.labels = issue.labels.map(label => label.name)
230+
231+
const repoUrl = issue.repository_url
232+
issue.repo = repoUrl.slice(repoUrl.lastIndexOf('/') + 1)
233+
})
234+
})
235+
}
236+
},
184237
mounted() {
185238
const BASE_URL = 'https://raw.githubusercontent.com/creativecommons/ccos-scripts/master/normalize_repos'
186239
const FILE_URL = name => `${BASE_URL}/${name}.json`
187240

241+
this.octokit = new Octokit()
242+
this.loadIssues()
243+
188244
Promise
189245
.all([
190246
fetch(FILE_URL('skills'))

0 commit comments

Comments
 (0)