Skip to content

Commit

Permalink
Revert back to $.extend in orgStats view
Browse files Browse the repository at this point in the history
  • Loading branch information
benvinegar committed Jun 24, 2017
1 parent 1cd2042 commit 651ebf8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/sentry/static/sentry/app/views/organizationStats/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import _ from 'lodash';
import $ from 'jquery';
import React from 'react';
import ApiMixin from '../../mixins/apiMixin';
import LoadingError from '../../components/loadingError';
Expand Down Expand Up @@ -68,7 +68,7 @@ const OrganizationStats = React.createClass({

let statEndpoint = this.getOrganizationStatsEndpoint();

_.each(this.state.rawOrgData, statName => {
$.each(this.state.rawOrgData, statName => {
this.api.request(statEndpoint, {
query: {
since: this.state.querySince,
Expand All @@ -92,7 +92,7 @@ const OrganizationStats = React.createClass({
});
});

_.each(this.state.rawProjectData, statName => {
$.each(this.state.rawProjectData, statName => {
this.api.request(statEndpoint, {
query: {
since: this.state.querySince,
Expand Down Expand Up @@ -154,7 +154,7 @@ const OrganizationStats = React.createClass({
let orgPoints = []; // accepted, rejected, blacklisted
let aReceived = [0, 0]; // received, points
let rawOrgData = this.state.rawOrgData;
_.each(rawOrgData.received, (idx, point) => {
$.each(rawOrgData.received, (idx, point) => {
let dReceived = point[1];

This comment has been minimized.

Copy link
@jdalton

jdalton Jun 24, 2017

You might still be able to use _ here. It's just that $.each is ( index, value ) for its callback while Lodash is (value, index).

let dRejected = rawOrgData.rejected[idx][1];
let dBlacklisted = rawOrgData.blacklisted[idx][1];
Expand Down Expand Up @@ -187,11 +187,11 @@ const OrganizationStats = React.createClass({
processProjectData() {
let rawProjectData = this.state.rawProjectData;
let projectTotals = [];
_.each(rawProjectData.received, (projectId, data) => {
$.each(rawProjectData.received, (projectId, data) => {
let pReceived = 0;
let pRejected = 0;
let pBlacklisted = 0;
_.each(data, (idx, point) => {
$.each(data, (idx, point) => {
pReceived += point[1];
pRejected += rawProjectData.rejected[projectId][idx][1];
pBlacklisted += rawProjectData.blacklisted[projectId][idx][1];
Expand Down

0 comments on commit 651ebf8

Please sign in to comment.