Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:codeforboston/cliff-effects into ref…
Browse files Browse the repository at this point in the history
…actor-3
  • Loading branch information
knod committed Dec 9, 2018
2 parents 52105bf + 88ad5e2 commit 3e872b4
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

const PROGRAM_CHART_VALUES = {
const BENEFIT_CHART_VALUES = {
earned: {
name: `Earned`,
color: `rgb(136, 187, 236)`,
Expand All @@ -18,4 +18,4 @@ const PROGRAM_CHART_VALUES = {
},
};

export { PROGRAM_CHART_VALUES };
export { BENEFIT_CHART_VALUES };
8 changes: 4 additions & 4 deletions src/forms/output/BenefitsLines.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ import {

// LOGIC
import { timescaleMultipliers } from '../../utils/convert-by-timescale';
import { getChartData } from '../../utils/charts/getChartData';
import { toFancyMoneyStr } from '../../utils/charts/chartFormatting';
import { getChartData } from './getChartData';
import { toFancyMoneyStr } from './chartFormatting';
import {
formatMoneyWithK,
textFromTranslatedElement,
} from './chartStringTransformers';
import { zoom } from './zoom';

// DATA
import { PROGRAM_CHART_VALUES } from '../../utils/charts/PROGRAM_CHART_VALUES';
import { BENEFIT_CHART_VALUES } from './BENEFIT_CHART_VALUES';


// Graphs get things in monthly values, so we'll convert from there
let multipliers = timescaleMultipliers.fromMonthly,
// Each graph controls its own scaling
limits = PROGRAM_CHART_VALUES.limits;
limits = BENEFIT_CHART_VALUES.limits;

/** Graph of each benefit as household income changes. Uses Highchart lib.
* @class
Expand Down
2 changes: 1 addition & 1 deletion src/forms/output/GraphHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { Message } from 'semantic-ui-react';

// CUSTOM COMPONENTS
import { GraphTimeButtons } from '../../components/GraphTimeButtons';
import { GraphTimeButtons } from './GraphTimeButtons';


/** Keeps track of time interval currently requested
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/forms/output/ResourcesColumns.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {

// LOGIC
import { timescaleMultipliers } from '../../utils/convert-by-timescale';
import { getChartData } from '../../utils/charts/getChartData';
import { toFancyMoneyStr } from '../../utils/charts/chartFormatting';
import { getChartData } from './getChartData';
import { toFancyMoneyStr } from './chartFormatting';
import {
formatMoneyWithK,
textFromTranslatedElement,
Expand Down
8 changes: 4 additions & 4 deletions src/forms/output/StackedResources.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ import {

// LOGIC
import { timescaleMultipliers } from '../../utils/convert-by-timescale';
import { getChartData } from '../../utils/charts/getChartData';
import { toFancyMoneyStr } from '../../utils/charts/chartFormatting';
import { getChartData } from './getChartData';
import { toFancyMoneyStr } from './chartFormatting';
import {
formatMoneyWithK,
textFromTranslatedElement,
} from './chartStringTransformers';
import { zoom } from './zoom';

// DATA
import { PROGRAM_CHART_VALUES } from '../../utils/charts/PROGRAM_CHART_VALUES';
import { BENEFIT_CHART_VALUES } from './BENEFIT_CHART_VALUES';


// Graphs get things in monthly values, so we'll convert from there
let multipliers = timescaleMultipliers.fromMonthly,
// Each graph controls its own scaling
limits = PROGRAM_CHART_VALUES.limits;
limits = BENEFIT_CHART_VALUES.limits;


// Still @todo
Expand Down
10 changes: 5 additions & 5 deletions src/forms/output/Summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {

// DATA
// Colors and text for parts of the chart
import { PROGRAM_CHART_VALUES } from '../../utils/charts/PROGRAM_CHART_VALUES';
import { BENEFIT_CHART_VALUES } from './BENEFIT_CHART_VALUES';

// DATA MANIPULATION
import { cloneDeep } from 'lodash';
Expand Down Expand Up @@ -65,8 +65,8 @@ let totalLastItemsOfArraysInObject = function (accumulated) {
* accumulate values.
*
* @example
* // In PROGRAM_CHART_VALUES.js
* let PROGRAM_CHART_VALUES = {
* // In BENEFIT_CHART_VALUES.js
* let BENEFIT_CHART_VALUES = {
* benefit1: { name: "B1" },
* benefit2: { name: "B2" },
* };
Expand Down Expand Up @@ -99,7 +99,7 @@ let totalLastItemsOfArraysInObject = function (accumulated) {
* // }
*
* Unfortunately, stll relies on an outside value -
* PROGRAM_CHART_VALUES.
* BENEFIT_CHART_VALUES.
*
* @typedef {object} benefit
* @property {string} label Name to be displayed for the benefit
Expand Down Expand Up @@ -136,7 +136,7 @@ let fillInMoneyValues = (keys, sourceObject, index) => {
moneyValues.earned = amount;
} else {
moneyValues.benefits.push({
label: PROGRAM_CHART_VALUES[ itemKey ].name,
label: BENEFIT_CHART_VALUES[ itemKey ].name,
amount: amount,
});
// Add up all benefits (we're not including earned income)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
import { PROGRAM_CHART_VALUES } from '../../utils/charts/PROGRAM_CHART_VALUES';
import { BENEFIT_CHART_VALUES } from './BENEFIT_CHART_VALUES';

// LOGIC
import { applyAndPushBenefits } from '../../benefits/applyAndPushBenefits';
Expand Down Expand Up @@ -72,7 +72,7 @@ const getChartData = function (incomes, multiplier, client, activeBenefitsInOrde
// Return in the same order as it was asked for
for (let benefiti = 0; benefiti < benefits.length; benefiti++) {
let benefitName = benefits[ benefiti ],
graphFrosting = PROGRAM_CHART_VALUES[ benefitName ];
graphFrosting = BENEFIT_CHART_VALUES[ benefitName ];

// All the graph info for that benefit
benefitDatasets.push({
Expand Down
2 changes: 1 addition & 1 deletion src/test/components/GraphTimeButtons.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { mount } from 'enzyme';

import { GraphTimeButtons } from '../../components/GraphTimeButtons';
import { GraphTimeButtons } from '../../forms/output/GraphTimeButtons';

describe('<GraphTimeButtons>', () => {
it('renders Weekly, Monthly, and Yearly buttons', () => {
Expand Down

0 comments on commit 3e872b4

Please sign in to comment.