Skip to content

Commit

Permalink
Merge 2440db0 into 0b7bf42
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmavis committed Mar 6, 2018
2 parents 0b7bf42 + 2440db0 commit fc20f03
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
3 changes: 0 additions & 3 deletions network-api/networkapi/fellows/admin.py

This file was deleted.

3 changes: 0 additions & 3 deletions network-api/networkapi/fellows/models.py

This file was deleted.

3 changes: 0 additions & 3 deletions network-api/networkapi/fellows/tests.py

This file was deleted.

12 changes: 6 additions & 6 deletions source/js/fellowships.js
Expand Up @@ -8,7 +8,7 @@ import LoadingIndicator from './components/loading-indicator/loading-indicator.j

let pulseApiDomain = ``;
let pulseDomain = ``;
const DIRECOTRY_PAGE_FILTER_OPTIONS = {'program_year': `2017`};
const DIRECTORY_PAGE_FILTER_OPTIONS = {'program_year': `2017`};
const DIRECTORY_PAGE_TYPE_ORDER = [ `science`, `open web`, `tech policy`, `media`];

function getFellows(params, callback) {
Expand All @@ -17,9 +17,7 @@ function getFellows(params, callback) {
let queryString = Object.entries(params).map(pair => pair.map(encodeURIComponent).join(`=`)).join(`&`);
let req = new XMLHttpRequest();

req.addEventListener(`load`, () => {
callback.call(this, JSON.parse(req.response));
});
req.addEventListener(`load`, () => callback(JSON.parse(req.response)));

req.open(`GET`, `https://${pulseApiDomain}/api/pulse/profiles/?${queryString}`);
req.send();
Expand Down Expand Up @@ -60,12 +58,14 @@ function groupFellowsByAttr(attribute, fellows) {
let fellowsGroup = {};

fellows.forEach(fellow => {
let attr = fellow[attribute].toLowerCase();
let attr = fellow[attribute];

if (!attr) {
return;
}

attr = attr.toLowerCase();

if (!fellowsGroup[attr]) {
fellowsGroup[attr] = [fellow];
} else {
Expand Down Expand Up @@ -98,7 +98,7 @@ function renderFellowsOnDirectoryPage() {
ReactDOM.render(<div className="mx-auto my-5 text-center"><LoadingIndicator /></div>, CONTAINER);

// get fellow info from Pulse
getFellows(DIRECOTRY_PAGE_FILTER_OPTIONS, fellows => {
getFellows(DIRECTORY_PAGE_FILTER_OPTIONS, fellows => {
// render filter bar
let filterBar = <div className="row">
<div className="col-12">
Expand Down

0 comments on commit fc20f03

Please sign in to comment.