Dashboard refactory (#3581)

Create Chart component for all chart fetching and rendering, and apply redux architecture in dashboard view.
This commit is contained in:
Grace Guo
2017-11-08 10:46:21 -08:00
committed by GitHub
parent 39e502faae
commit 4fa1f0ab17
47 changed files with 2048 additions and 876 deletions

View File

@@ -240,3 +240,11 @@ export function tryNumify(s) {
}
return n;
}
export function getParam(name) {
/* eslint no-useless-escape: 0 */
const formattedName = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
const regex = new RegExp('[\\?&]' + formattedName + '=([^&#]*)');
const results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
}