diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-01-30 14:50:17 +0000 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-01-30 14:50:17 +0000 |
commit | 07557a946bac1b596a28293d39e7bd2581ff828b (patch) | |
tree | f725f935880b122862880f9f18d18fb74a7f758b /app/assets/javascripts/graphs/graphs_show.js | |
parent | bf01452cc361842dab7442a9ad868213d53bd212 (diff) | |
parent | 03f386c2b20f95272e4846f5ecab54fd8b2566e0 (diff) | |
download | gitlab-ce-qa-define-selectors.tar.gz |
Merge branch 'master' into 'qa-define-selectors'qa-define-selectors
# Conflicts:
# qa/qa/page/group/show.rb
Diffstat (limited to 'app/assets/javascripts/graphs/graphs_show.js')
-rw-r--r-- | app/assets/javascripts/graphs/graphs_show.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/app/assets/javascripts/graphs/graphs_show.js b/app/assets/javascripts/graphs/graphs_show.js index 36bad6db3e1..b670e907a5c 100644 --- a/app/assets/javascripts/graphs/graphs_show.js +++ b/app/assets/javascripts/graphs/graphs_show.js @@ -1,11 +1,13 @@ +import flash from '../flash'; +import { __ } from '../locale'; +import axios from '../lib/utils/axios_utils'; import ContributorsStatGraph from './stat_graph_contributors'; document.addEventListener('DOMContentLoaded', () => { - $.ajax({ - type: 'GET', - url: document.querySelector('.js-graphs-show').dataset.projectGraphPath, - dataType: 'json', - success(data) { + const url = document.querySelector('.js-graphs-show').dataset.projectGraphPath; + + axios.get(url) + .then(({ data }) => { const graph = new ContributorsStatGraph(); graph.init(data); @@ -16,6 +18,6 @@ document.addEventListener('DOMContentLoaded', () => { $('.stat-graph').fadeIn(); $('.loading-graph').hide(); - }, - }); + }) + .catch(() => flash(__('Error fetching contributors data.'))); }); |