|
1 | 1 | import VueSelect from 'vue-select';
|
2 | 2 | import {Octokit} from '@octokit/rest';
|
| 3 | +import yaml from 'js-yaml' |
3 | 4 |
|
4 | 5 | import {hydrateAppWithData} from "./hydration";
|
5 | 6 |
|
@@ -98,40 +99,40 @@ export const App = {
|
98 | 99 | :clearable="false"/>
|
99 | 100 | <br/>
|
100 | 101 | <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> |
127 | 134 | </template>
|
128 | 135 | </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> |
135 | 136 | <div v-else>
|
136 | 137 | Loading filters, please wait...
|
137 | 138 | </div>
|
@@ -236,19 +237,21 @@ export const App = {
|
236 | 237 | },
|
237 | 238 | mounted() {
|
238 | 239 | 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` |
240 | 241 |
|
241 | 242 | this.octokit = new Octokit()
|
242 | 243 | this.loadIssues()
|
243 | 244 |
|
244 | 245 | Promise
|
245 | 246 | .all([
|
246 | 247 | fetch(FILE_URL('skills'))
|
247 |
| - .then(response => response.json()), |
| 248 | + .then(response => response.text()), |
248 | 249 | fetch(FILE_URL('labels'))
|
249 |
| - .then(response => response.json()) |
| 250 | + .then(response => response.text()) |
250 | 251 | ])
|
251 | 252 | .then(([skillResponse, labelResponse]) => {
|
| 253 | + skillResponse = yaml.safeLoad(skillResponse) |
| 254 | + labelResponse = yaml.safeLoad(labelResponse) |
252 | 255 | const [skills, categories] = hydrateAppWithData(skillResponse, labelResponse)
|
253 | 256 | this.categories = categories
|
254 | 257 | this.options.skills = skills
|
|
0 commit comments