Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit a136423

Browse files
committed
fixes #338
1 parent af4e63a commit a136423

File tree

4 files changed

+25
-114
lines changed

4 files changed

+25
-114
lines changed

package-lock.json

Lines changed: 12 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/news.yaml

Lines changed: 0 additions & 68 deletions
This file was deleted.

src/api/News.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import axios from 'axios';
2-
import yaml from 'js-yaml';
32

4-
export default async function getNewsItems() {
5-
const newsUrl = `${process.env.BASE_URL}news.yaml`;
6-
const newsResponse = await axios.get(newsUrl);
73

4+
export default async function getNewsItems() {
5+
const monarchRss = 'https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/@monarchinit';
86
let newsItems = [];
7+
98
try {
10-
const newsParsed = yaml.safeLoad(newsResponse.data, 'utf8');
11-
newsItems = newsParsed.news.items;
9+
const newsResponse = await axios.get(monarchRss);
10+
newsItems = newsResponse.data.items.map(elem => ({
11+
url: elem.link,
12+
date: new Date(elem.pubDate).toDateString().slice(4),
13+
title: elem.title
14+
}));
1215
} catch (e) {
13-
// console.log('getNewsItems yaml.safeLoad ERROR', e);
16+
// console.log('ERROR fetching and parsing medium RSS', e);
1417
}
15-
1618
return newsItems;
1719
}

src/views/Node.vue

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@
8282
</div>
8383

8484
<div v-if="inheritance" class="col-12 node-content-section">
85-
<b>Heritability: </b>&nbsp;{{ inheritance }}
85+
<b>Heritability: </b>&nbsp;{{ inheritance }}
8686
</div>
8787

8888
<div v-if="modifiers" class="col-12 node-content-section">
89-
<b>Clinical Modifiers: </b>&nbsp;{{ modifiers }}
89+
<b>Clinical Modifiers: </b>&nbsp;{{ modifiers }}
9090
</div>
9191
</div>
9292

@@ -117,9 +117,7 @@
117117
</div>
118118

119119
<div v-if="!expandedCard" class="row">
120-
121-
<div v-if="nodeType === 'disease'" class="col-12">
122-
120+
<div v-if="nodeType === 'disease' || nodeType === 'phenotype'" class="col-12">
123121
<div v-if="synonyms && synonyms['Exact Synonym'].length" class="node-content-section">
124122
<b>Exact Synonyms:</b>&nbsp;{{ synonyms['Exact Synonym'].join(', ') }}
125123
</div>
@@ -135,15 +133,13 @@
135133
<div v-if="synonyms && synonyms['Related Synonym'].length" class="node-content-section">
136134
<b>Related Synonyms:</b>&nbsp;{{ synonyms['Related Synonym'].join(', ') }}
137135
</div>
138-
139136
</div>
140137

141138
<div v-else class="col-12">
142139
<div v-if="synonyms && synonyms['Exact Synonym'].length" class="node-content-section">
143140
<b>Synonyms:</b>&nbsp;{{ synonyms['Exact Synonym'].join(', ') }}
144141
</div>
145142
</div>
146-
147143
</div>
148144

149145
<div v-if="!expandedCard && hasGeneExac" class="row py-2">

0 commit comments

Comments
 (0)