Skip to content

Commit d64c458

Browse files
committed
Update issue finder to work with the YAML files
1 parent 50b20c2 commit d64c458

File tree

3 files changed

+44
-44
lines changed

3 files changed

+44
-44
lines changed

webpack/js/components.js

+38-35
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import VueSelect from 'vue-select';
22
import {Octokit} from '@octokit/rest';
3+
import yaml from 'js-yaml'
34

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

@@ -98,40 +99,40 @@ export const App = {
9899
:clearable="false"/>
99100
<br/>
100101
<template v-if="filters.aim === 'contribute'">
101-
<label for="skills">
102-
<strong>Skill set*</strong><br/>
103-
Choose up to three skills that you would like to see issues for.
104-
</label>
105-
<VueSelect
106-
v-model="filters.skills"
107-
id="skills"
108-
name="skills"
109-
placeholder="No preference"
110-
:options="options.skills"
111-
:reduce="skill => skill.toLocaleLowerCase()"
112-
:selectable="() => filters.skills.length < 3"
113-
multiple/>
114-
<br/>
115-
<label for="experience">
116-
<strong>Experience</strong><br/>
117-
Is this your first time contributing to CC?
118-
</label>
119-
<VueSelect
120-
v-model="filters.experience"
121-
id="experience"
122-
name="experience"
123-
:options="options.experiences"
124-
label="name"
125-
:reduce="experience => experience.code"
126-
:clearable="false"/>
102+
<label for="skills">
103+
<strong>Skill set*</strong><br/>
104+
Choose up to three skills that you would like to see issues for.
105+
</label>
106+
<VueSelect
107+
v-model="filters.skills"
108+
id="skills"
109+
name="skills"
110+
placeholder="No preference"
111+
:options="options.skills"
112+
:reduce="skill => skill.toLocaleLowerCase()"
113+
:selectable="() => filters.skills.length < 3"
114+
multiple/>
115+
<br/>
116+
<label for="experience">
117+
<strong>Experience</strong><br/>
118+
Is this your first time contributing to CC?
119+
</label>
120+
<VueSelect
121+
v-model="filters.experience"
122+
id="experience"
123+
name="experience"
124+
:options="options.experiences"
125+
label="name"
126+
:reduce="experience => experience.code"
127+
:clearable="false"/>
128+
<p class="disclaimer">
129+
*Not all issues have skills marked on them, especially if they are
130+
simple issues that do not require proficiency in any specific
131+
framework or language. Those issues will not appear when filtering by
132+
skill.
133+
</p>
127134
</template>
128135
</form>
129-
<p class="disclaimer">
130-
*Not all issues have skills marked on them, especially if they are
131-
simple issues that do not require proficiency in any specific
132-
framework or language. Those issues will not appear when filtering by
133-
skill.
134-
</p>
135136
<div v-else>
136137
Loading filters, please wait...
137138
</div>
@@ -236,19 +237,21 @@ export const App = {
236237
},
237238
mounted() {
238239
const BASE_URL = 'https://raw.githubusercontent.com/creativecommons/ccos-scripts/master/normalize_repos'
239-
const FILE_URL = name => `${BASE_URL}/${name}.json`
240+
const FILE_URL = name => `${BASE_URL}/${name}.yml`
240241

241242
this.octokit = new Octokit()
242243
this.loadIssues()
243244

244245
Promise
245246
.all([
246247
fetch(FILE_URL('skills'))
247-
.then(response => response.json()),
248+
.then(response => response.text()),
248249
fetch(FILE_URL('labels'))
249-
.then(response => response.json())
250+
.then(response => response.text())
250251
])
251252
.then(([skillResponse, labelResponse]) => {
253+
skillResponse = yaml.safeLoad(skillResponse)
254+
labelResponse = yaml.safeLoad(labelResponse)
252255
const [skills, categories] = hydrateAppWithData(skillResponse, labelResponse)
253256
this.categories = categories
254257
this.options.skills = skills

webpack/package-lock.json

+5-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webpack/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
},
2828
"dependencies": {
2929
"@octokit/rest": "^18.0.6",
30+
"js-yaml": "^3.14.0",
3031
"vue": "^2.6.12",
3132
"vue-select": "^3.10.8"
3233
},

0 commit comments

Comments
 (0)