Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1539 from NewSpring/give-routing
Browse files Browse the repository at this point in the history
New Give Pages & Routing
  • Loading branch information
richarddubay authored Dec 23, 2016
2 parents 7f3e0a2 + 960aadf commit 15d4065
Show file tree
Hide file tree
Showing 357 changed files with 18,837 additions and 9,722 deletions.
2 changes: 1 addition & 1 deletion .bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Vorpal
}

var meteorArgs = [ "--settings" ];
if (options.ios && !options.device) meteorArgs.unshift("run", "ios");
if (options.ios && !options.device) meteorArgs.unshift("run", "ios", "--mobile-server", "http://localhost:3000");
if (options.android && !options.device) meteorArgs.unshift("run", "android");
if (options.ios && options.device) meteorArgs.unshift("run", "ios-device");
if (options.android && options.device) meteorArgs.unshift("run", "android-device");
Expand Down
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"Media": true,
"FormElement": true,
"SyntheticInputEvent": true,
"React$Element": true
"React$Element": true,
"jest": true,
},
"rules": {
"arrow-parens": [2, "always"],
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@ launch.json

storybook-static
docs

# editor files
.vscode
tsconfig.json
6 changes: 6 additions & 0 deletions .meteor/mocks/mongo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

export const DDP = {
_CurrentInvocation: {
get: jest.fn(() => {}),
},
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ before_install:
script:
- npm link
- npm test -- --coverage
- coveralls < ./.coverage/lcov.info || true # ignore coveralls error
- coveralls < ./.coverage/lcov.info || true
- "./.scripts/prepare/app.sh"
- "./.scripts/deploy/app.sh"
3 changes: 3 additions & 0 deletions .types/file-saver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module "file-saver" {
declare var exports: any;
}
1 change: 1 addition & 0 deletions .types/react-router.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
declare module "react-router" {
declare function Link(to: Object, className: string): Function;
declare function withRouter(): Function;
}
3 changes: 3 additions & 0 deletions .types/react-swipeable-views.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module "react-swipeable-views" {
declare var exports: any;
}
42 changes: 0 additions & 42 deletions .vscode/settings.json

This file was deleted.

14 changes: 14 additions & 0 deletions __mocks__/victory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

const VictoryChart = "VictoryChart";
const VictoryAxis = "VictoryAxis";
const VictoryLine = "VictoryLine";
const VictoryScatter = "VictoryScatter";
const VictoryArea = "VictoryArea";

export {
VictoryChart,
VictoryAxis,
VictoryLine,
VictoryScatter,
VictoryArea,
};
Binary file added assets/icons/amazon/icon-114x114-xxhdpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/amazon/icon-48x48-mdpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/amazon/icon-512x512-xxxhpdi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/amazon/icon-72x72-hdpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/amazon/icon-96x96-xhdpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 22 additions & 22 deletions imports/blocks/add-schedule/__tests__/__snapshots__/Layout.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ exports[`Layout disables checkout when not ready 1`] = `
defaultValue={null}
hideLabel={true}
id={-1}
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="primary-account"
placeholder="$0.00"
style={
Expand Down Expand Up @@ -87,7 +87,7 @@ exports[`Layout disables checkout when not ready 1`] = `
format={[Function]}
hideLabel={true}
id="start-date"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="start-date"
past={false}
placeholder="select date"
Expand Down Expand Up @@ -129,7 +129,7 @@ exports[`Layout disables checkout when total is negative 1`] = `
defaultValue={null}
hideLabel={true}
id={-1}
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="primary-account"
placeholder="$0.00"
style={
Expand Down Expand Up @@ -192,7 +192,7 @@ exports[`Layout disables checkout when total is negative 1`] = `
format={[Function]}
hideLabel={true}
id="start-date"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="start-date"
past={false}
placeholder="select date"
Expand Down Expand Up @@ -234,7 +234,7 @@ exports[`Layout disables checkout when total is positive but not ready 1`] = `
defaultValue={null}
hideLabel={true}
id={-1}
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="primary-account"
placeholder="$0.00"
style={
Expand Down Expand Up @@ -297,7 +297,7 @@ exports[`Layout disables checkout when total is positive but not ready 1`] = `
format={[Function]}
hideLabel={true}
id="start-date"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="start-date"
past={false}
placeholder="select date"
Expand Down Expand Up @@ -339,7 +339,7 @@ exports[`Layout disables checkout when total is undefined 1`] = `
defaultValue={null}
hideLabel={true}
id={-1}
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="primary-account"
placeholder="$0.00"
style={
Expand Down Expand Up @@ -402,7 +402,7 @@ exports[`Layout disables checkout when total is undefined 1`] = `
format={[Function]}
hideLabel={true}
id="start-date"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="start-date"
past={false}
placeholder="select date"
Expand Down Expand Up @@ -444,7 +444,7 @@ exports[`Layout enables checkout when total is positive and ready 1`] = `
defaultValue={null}
hideLabel={true}
id={-1}
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="primary-account"
placeholder="$0.00"
style={
Expand Down Expand Up @@ -507,7 +507,7 @@ exports[`Layout enables checkout when total is positive and ready 1`] = `
format={[Function]}
hideLabel={true}
id="start-date"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="start-date"
past={false}
placeholder="select date"
Expand Down Expand Up @@ -551,7 +551,7 @@ exports[`Layout renders the prefilled amount for an existing schedule 1`] = `
defaultValue="$10"
hideLabel={true}
id={-1}
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="primary-account"
placeholder="$0.00"
style={
Expand Down Expand Up @@ -614,7 +614,7 @@ exports[`Layout renders the prefilled amount for an existing schedule 1`] = `
format={[Function]}
hideLabel={true}
id="start-date"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="start-date"
past={false}
placeholder="select date"
Expand Down Expand Up @@ -656,7 +656,7 @@ exports[`Layout renders the prefilled date for an existing schedule 1`] = `
defaultValue={null}
hideLabel={true}
id={-1}
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="primary-account"
placeholder="$0.00"
style={
Expand Down Expand Up @@ -719,7 +719,7 @@ exports[`Layout renders the prefilled date for an existing schedule 1`] = `
format={[Function]}
hideLabel={true}
id="start-date"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="start-date"
past={false}
placeholder="select date"
Expand Down Expand Up @@ -761,7 +761,7 @@ exports[`Layout renders the prefilled frequency for an existing schedule 1`] =
defaultValue={null}
hideLabel={true}
id={-1}
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="primary-account"
placeholder="$0.00"
style={
Expand Down Expand Up @@ -824,7 +824,7 @@ exports[`Layout renders the prefilled frequency for an existing schedule 1`] =
format={[Function]}
hideLabel={true}
id="start-date"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="start-date"
past={false}
placeholder="select date"
Expand Down Expand Up @@ -866,7 +866,7 @@ exports[`Layout renders the prefilled fund for an existing schedule 1`] = `
defaultValue={null}
hideLabel={true}
id={-1}
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="primary-account"
placeholder="$0.00"
style={
Expand Down Expand Up @@ -929,7 +929,7 @@ exports[`Layout renders the prefilled fund for an existing schedule 1`] = `
format={[Function]}
hideLabel={true}
id="start-date"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="start-date"
past={false}
placeholder="select date"
Expand Down Expand Up @@ -971,7 +971,7 @@ exports[`Layout renders when accounts & state exist 1`] = `
defaultValue={null}
hideLabel={true}
id={-1}
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="primary-account"
placeholder="$0.00"
style={
Expand Down Expand Up @@ -1034,7 +1034,7 @@ exports[`Layout renders when accounts & state exist 1`] = `
format={[Function]}
hideLabel={true}
id="start-date"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="start-date"
past={false}
placeholder="select date"
Expand Down Expand Up @@ -1076,7 +1076,7 @@ exports[`Layout renders with custom text 1`] = `
defaultValue={null}
hideLabel={true}
id={-1}
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="primary-account"
placeholder="$0.00"
style={
Expand Down Expand Up @@ -1139,7 +1139,7 @@ exports[`Layout renders with custom text 1`] = `
format={[Function]}
hideLabel={true}
id="start-date"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_1bkmqm1"
inputClasses="flush-bottom h3 hard-top outlined--dotted outlined--light text-dark-primary show-placeholder_11ef8g5"
name="start-date"
past={false}
placeholder="select date"
Expand Down
18 changes: 8 additions & 10 deletions imports/blocks/add-schedule/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type ICartContainer = {
accounts: Object,
addTransactions: Function,
alive: boolean,
clearAllSchedulesExcept: Function,
// clearAllSchedulesExcept: Function,
clearSchedules: Function,
clearTransactions: Function,
existing: Object,
Expand Down Expand Up @@ -72,9 +72,9 @@ class CartContainer extends Component {
}

componentWillReceiveProps(nextProps: Object) {
const { transactions, schedules } = nextProps.give;
const { transactions, schedule } = nextProps.give;

if (Object.keys(transactions).length === 0 && Object.keys(schedules).length === 0) {
if (transactions && Object.keys(transactions).length === 0 && schedule && !schedule.start) {
const form: FormElement = (document.getElementById("add-to-cart"): any);
if (form) form.reset();
}
Expand All @@ -93,10 +93,9 @@ class CartContainer extends Component {

let keepGoing = true;
if (cartFundId && cartTotal && cartFundLabel) {
this.props.clearAllSchedulesExcept(Number(this.state.fundId));
// this.props.clearAllSchedulesExcept(Number(this.state.fundId));

this.props.saveSchedule(this.state.fundId, {
label: this.state.fundLabel,
this.props.saveSchedule({
frequency: this.state.frequency,
start: this.state.startDate,
});
Expand All @@ -122,8 +121,7 @@ class CartContainer extends Component {
if (this.state.fundId !== id) this.props.removeSchedule(this.state.fundId);

this.setState({ fundId: id, fundLabel: name });
this.props.saveSchedule(id, {
label: name,
this.props.saveSchedule({
frequency: this.state.frequency,
start: this.state.startDate,
});
Expand All @@ -134,7 +132,7 @@ class CartContainer extends Component {
setFrequency = (value: string) => {
this.setState({ frequency: value });
if (this.state.fundId) {
this.props.saveSchedule(this.state.fundId, { frequency: value });
this.props.saveSchedule({ frequency: value });
}
}

Expand Down Expand Up @@ -172,7 +170,7 @@ class CartContainer extends Component {

this.setState({ startDate: date });

if (fundId) this.props.saveSchedule(fundId, { start: new Date(value) });
if (fundId) this.props.saveSchedule({ start: new Date(value) });
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion imports/blocks/add-schedule/styles-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default StyleSheet.create({
},
"show-placeholder": {
"::-webkit-input-placeholder": {
color: "#ddd!important",
color: "#858585!important",
},
},
});
Loading

0 comments on commit 15d4065

Please sign in to comment.