diff options
author | Phil Hughes <me@iamphill.com> | 2018-02-01 10:42:49 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-02-01 10:42:49 +0000 |
commit | c09a89c7557a93b728bab9eef9175abb1fd458d4 (patch) | |
tree | 7c0172a246cdc68d670a8e0b585fc916ddf8b0e8 /app | |
parent | b5b304466fbd8904196afeaa65adeb5282b21987 (diff) | |
download | gitlab-ce-c09a89c7557a93b728bab9eef9175abb1fd458d4.tar.gz |
Converted branch_graph.js to axios
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/network/branch_graph.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/assets/javascripts/network/branch_graph.js b/app/assets/javascripts/network/branch_graph.js index 5aad3908eb6..d3edcb724f1 100644 --- a/app/assets/javascripts/network/branch_graph.js +++ b/app/assets/javascripts/network/branch_graph.js @@ -1,5 +1,8 @@ /* eslint-disable func-names, space-before-function-paren, no-var, wrap-iife, quotes, comma-dangle, one-var, one-var-declaration-per-line, no-mixed-operators, no-loop-func, no-floating-decimal, consistent-return, no-unused-vars, prefer-template, prefer-arrow-callback, camelcase, max-len */ +import { __ } from '../locale'; +import axios from '../lib/utils/axios_utils'; +import flash from '../flash'; import Raphael from './raphael'; export default (function() { @@ -26,16 +29,13 @@ export default (function() { } BranchGraph.prototype.load = function() { - return $.ajax({ - url: this.options.url, - method: "get", - dataType: "json", - success: $.proxy(function(data) { + axios.get(this.options.url) + .then(({ data }) => { $(".loading", this.element).hide(); this.prepareData(data.days, data.commits); - return this.buildGraph(); - }, this) - }); + this.buildGraph(); + }) + .catch(() => __('Error fetching network graph.')); }; BranchGraph.prototype.prepareData = function(days, commits) { |