1
1
import VueSelect from 'vue-select' ;
2
+ import { Octokit } from '@octokit/rest' ;
2
3
3
4
import { hydrateAppWithData } from "./hydration" ;
4
5
@@ -40,7 +41,7 @@ export const IssueCard = {
40
41
</h4>
41
42
<p class="is-size-6">
42
43
<a
43
- :href="issue.url "
44
+ :href="issue.html_url "
44
45
target="_blank">
45
46
<span class="has-color-forest-green">
46
47
{{ issue.repo }}#{{ issue.number }}
@@ -70,8 +71,7 @@ export const IssueCard = {
70
71
} ,
71
72
computed : {
72
73
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" )
75
75
return dateComponent
76
76
}
77
77
}
@@ -158,7 +158,7 @@ export const App = {
158
158
* @returns {array } the array of filtered issues
159
159
*/
160
160
filteredIssues ( ) {
161
- return window . issues . filter ( issue => {
161
+ return this . issues . filter ( issue => {
162
162
// Check experience match
163
163
if ( this . filters . experience === 'beginner' && ! issue . labels . includes ( 'good first issue' ) ) {
164
164
return false
@@ -178,6 +178,20 @@ export const App = {
178
178
const BASE_URL = 'https://raw.githubusercontent.com/creativecommons/ccos-scripts/master/normalize_repos'
179
179
const FILE_URL = name => `${ BASE_URL } /${ name } .json`
180
180
181
+ const octokit = new Octokit ( ) ;
182
+ octokit . search . issuesAndPullRequests ( {
183
+ q : 'org:creativecommons is:open is:issue label:"help wanted"' ,
184
+ per_page : 100
185
+ } ) . then ( res => {
186
+ this . issues = res . data . items
187
+ this . issues . forEach ( issue => {
188
+ issue . labels = issue . labels . map ( label => label . name )
189
+
190
+ const repoUrl = issue . repository_url
191
+ issue . repo = repoUrl . slice ( repoUrl . lastIndexOf ( '/' ) + 1 )
192
+ } )
193
+ } )
194
+
181
195
Promise
182
196
. all ( [
183
197
fetch ( FILE_URL ( 'skills' ) )
0 commit comments