diff --git a/.meteor/versions b/.meteor/versions index 9255aee11c8..d38b3d4bde6 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -19,7 +19,7 @@ allow-deny@1.0.5 amplify@1.0.0 audit-argument-checks@1.0.7 autoupdate@1.3.12 -babel-compiler@6.18.1 +babel-compiler@6.18.2 babel-runtime@1.0.1 base64@1.0.10 binary-heap@1.0.10 @@ -67,7 +67,7 @@ deps@1.0.12 diff-sequence@1.0.7 dispatch:mocha@0.3.0 dispatch:run-as-user@1.1.1 -ecmascript@0.7.2 +ecmascript@0.7.3 ecmascript-runtime@0.3.15 ejson@1.0.13 email@1.2.0 @@ -78,7 +78,7 @@ fastclick@1.0.13 gadicc:blaze-react-component@1.4.0 geojson-utils@1.0.10 google-config-ui@1.0.0 -google-oauth@1.2.1 +google-oauth@1.2.3 hot-code-push@1.0.4 html-tools@1.0.11 htmljs@1.0.11 @@ -116,7 +116,7 @@ minifier-css@1.2.16 minimongo@1.0.21 mobile-experience@1.0.4 mobile-status-bar@1.0.14 -modules@0.8.1 +modules@0.8.2 modules-runtime@0.7.10 momentjs:moment@2.17.1 mongo@1.1.16 diff --git a/Dockerfile b/Dockerfile index cbcdf016d2b..adb8cc0a8c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM reactioncommerce/base:v1.2.2 +FROM reactioncommerce/base:v1.3.0 # Default environment variables ENV ROOT_URL "http://localhost" diff --git a/README.md b/README.md index 0b24dc07e9d..fd77b3d0b62 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Docker images are pushed when Reaction sucessfully builds and passes all tests o ### Contributing -Want to contribute? That's great! [Here's you can get started](https://guides.github.com/activities/contributing-to-open-source/#contributing). +Want to contribute? That's great! [Here's how you can get started](https://guides.github.com/activities/contributing-to-open-source/#contributing). Check out our Issues page, and if you find something you want to work on, let us know in the comments. If you're interested in a particular [project](https://github.com/reactioncommerce/reaction/projects) and you aren’t sure where to begin, feel free to ask. Start small! diff --git a/imports/plugins/core/email/client/components/emailTableColumn.js b/imports/plugins/core/email/client/components/emailTableColumn.js index 6e40ec37f95..fe8decab88c 100644 --- a/imports/plugins/core/email/client/components/emailTableColumn.js +++ b/imports/plugins/core/email/client/components/emailTableColumn.js @@ -1,10 +1,14 @@ import React, { Component, PropTypes } from "react"; import moment from "moment"; import { Icon } from "/imports/plugins/core/ui/client/components"; +import { i18next } from "/client/api"; class EmailTableColumn extends Component { static propTypes = { - data: PropTypes.object, + data: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.instanceOf(Date) + ]), metadata: PropTypes.object, rowData: PropTypes.object } diff --git a/imports/plugins/included/payments-braintree/server/methods/braintreeapi-methods-refund.app-test.js b/imports/plugins/included/payments-braintree/server/methods/braintreeapi-methods-refund.app-test.js index 0248016ffe1..7052fcc7a11 100644 --- a/imports/plugins/included/payments-braintree/server/methods/braintreeapi-methods-refund.app-test.js +++ b/imports/plugins/included/payments-braintree/server/methods/braintreeapi-methods-refund.app-test.js @@ -54,21 +54,15 @@ describe("braintree/refund/create", function () { sandbox.stub(BraintreeApi.apiCall, "createRefund", function () { return braintreeRefundResult; }); - - let refundResult = null; let refundError = null; - - Meteor.call("braintree/refund/create", paymentMethod, paymentMethod.amount, function (error, result) { refundResult = result; refundError = error; + expect(refundError).to.be.undefined; + expect(refundResult).to.not.be.undefined; + expect(refundResult.saved).to.be.true; + return done(); }); - - - expect(refundError).to.be.undefined; - expect(refundResult).to.not.be.undefined; - expect(refundResult.saved).to.be.true; - done(); }); }); diff --git a/imports/plugins/included/payments-paypal/server/methods/payflowpro-methods-refund.app-test.js b/imports/plugins/included/payments-paypal/server/methods/payflowpro-methods-refund.app-test.js index 59e7f050e00..e5a2fe1144d 100644 --- a/imports/plugins/included/payments-paypal/server/methods/payflowpro-methods-refund.app-test.js +++ b/imports/plugins/included/payments-paypal/server/methods/payflowpro-methods-refund.app-test.js @@ -77,27 +77,15 @@ describe("payflowpro/refund/create", function () { sandbox.stub(PayflowproApi.apiCall, "createRefund", function () { return payflowproRefundResult; }); - - let refundResult = null; let refundError = null; - - Meteor.call("payflowpro/refund/create", paymentMethod, paymentMethod.amount, function (error, result) { refundResult = result; refundError = error; + expect(refundError).to.be.undefined; + expect(refundResult).to.not.be.undefined; + expect(refundResult.saved).to.be.true; + done(); }); - - - expect(refundError).to.be.undefined; - expect(refundResult).to.not.be.undefined; - expect(refundResult.saved).to.be.true; - // expect(BraintreeApi.apiCall.createRefund).to.have.been.calledWith({ - // createRefund: { - // amount: 99.95, - // transactionId: paymentMethod.transactionId - // } - // }); - done(); }); }); diff --git a/imports/plugins/included/payments-stripe/server/methods/stripeapi-methods-capture.app-test.js b/imports/plugins/included/payments-stripe/server/methods/stripeapi-methods-capture.app-test.js index 4ceb2a4202a..c3d528a5130 100644 --- a/imports/plugins/included/payments-stripe/server/methods/stripeapi-methods-capture.app-test.js +++ b/imports/plugins/included/payments-stripe/server/methods/stripeapi-methods-capture.app-test.js @@ -98,18 +98,17 @@ describe("stripe/payment/capture", function () { Meteor.call("stripe/payment/capture", paymentMethod, function (error, result) { captureResult = result; captureError = error; + expect(captureError).to.be.undefined; + expect(captureResult).to.not.be.undefined; + expect(captureResult.saved).to.be.true; + expect(StripeApi.methods.captureCharge.call).to.have.been.calledWith({ + transactionId: paymentMethod.transactionId, + captureDetails: { + amount: 1999 + } + }); + done(); }); - - expect(captureError).to.be.undefined; - expect(captureResult).to.not.be.undefined; - expect(captureResult.saved).to.be.true; - expect(StripeApi.methods.captureCharge.call).to.have.been.calledWith({ - transactionId: paymentMethod.transactionId, - captureDetails: { - amount: 1999 - } - }); - done(); }); }); @@ -144,11 +143,10 @@ describe("stripe/payment/capture", function () { Meteor.call("stripe/payment/capture", paymentMethod, function (error, result) { captureResult = result; captureError = error; + expect(captureError.message).to.equal("Match error: Match error: Transaction id is required"); + expect(captureResult).to.be.undefined; + done(); }); - - expect(captureError.message).to.equal("Match error: Match error: Transaction id is required"); - expect(captureResult).to.be.undefined; - done(); }); }); diff --git a/imports/plugins/included/payments-stripe/server/methods/stripeapi-methods-charge.app-test.js b/imports/plugins/included/payments-stripe/server/methods/stripeapi-methods-charge.app-test.js index eecb776422f..17498ca295b 100644 --- a/imports/plugins/included/payments-stripe/server/methods/stripeapi-methods-charge.app-test.js +++ b/imports/plugins/included/payments-stripe/server/methods/stripeapi-methods-charge.app-test.js @@ -55,7 +55,7 @@ describe("Stripe.authorize", function () { sandbox.restore(); }); - it("should call StripeApi.methods.createCharge with the proper parameters and return saved = true", function () { + it("should call StripeApi.methods.createCharge with the proper parameters and return saved = true", function (done) { sandbox.stub(StripeApi.methods.createCharge, "call", function () { return stripeChargeResult; }); @@ -72,9 +72,10 @@ describe("Stripe.authorize", function () { let chargeResult = null; Stripe.authorize(cardData, { total: total, currency: currency }, function (error, result) { chargeResult = result; + expect(chargeResult).to.not.be.undefined; + expect(chargeResult.saved).to.be.true; + done(); }); - expect(chargeResult).to.not.be.undefined; - expect(chargeResult.saved).to.be.true; }); }); @@ -89,7 +90,7 @@ describe("Stripe.authorize", function () { sandbox.restore(); }); - it("should properly charge a card when using a currency besides USD", function () { + it("should properly charge a card when using a currency besides USD", function (done) { const form = { cvv2: "345", expire_month: "4", @@ -108,22 +109,22 @@ describe("Stripe.authorize", function () { let chargeResult = null; Stripe.authorize(form, { total: total, currency: currency }, function (error, result) { chargeResult = result; - }); - - expect(chargeResult).to.not.be.undefined; - expect(chargeResult.saved).to.be.true; - expect(StripeApi.methods.createCharge.call).to.have.been.calledWith({ - chargeObj: { - amount: 2298, - currency: "EUR", - card: { - number: "4242424242424242", - name: "Test User", - cvc: "345", - exp_month: "4", - exp_year: "2019" - }, capture: false - } + expect(chargeResult).to.not.be.undefined; + expect(chargeResult.saved).to.be.true; + expect(StripeApi.methods.createCharge.call).to.have.been.calledWith({ + chargeObj: { + amount: 2298, + currency: "EUR", + card: { + number: "4242424242424242", + name: "Test User", + cvc: "345", + exp_month: "4", + exp_year: "2019" + }, capture: false + } + }); + done(); }); }); }); @@ -139,7 +140,7 @@ describe("Stripe.authorize", function () { sandbox.restore(); }); - it("should return saved = false when card is declined", function () { + it("should return saved = false when card is declined", function (done) { const form = { cvv2: "345", expire_month: "4", @@ -181,23 +182,24 @@ describe("Stripe.authorize", function () { let chargeResult = null; Stripe.authorize(form, { total: total, currency: currency }, function (error, result) { chargeResult = result; - }); - expect(chargeResult).to.not.be.undefined; - expect(chargeResult.saved).to.be.false; - expect(chargeResult.error).to.equal("Your card was declined."); - expect(StripeApi.methods.createCharge.call).to.have.been.calledWith({ - chargeObj: { - amount: 2298, - currency: "EUR", - card: { - number: "4000000000000002", - name: "Test User", - cvc: "345", - exp_month: "4", - exp_year: "2019" - }, capture: false - } + expect(chargeResult).to.not.be.undefined; + expect(chargeResult.saved).to.be.false; + expect(chargeResult.error).to.equal("Your card was declined."); + expect(StripeApi.methods.createCharge.call).to.have.been.calledWith({ + chargeObj: { + amount: 2298, + currency: "EUR", + card: { + number: "4000000000000002", + name: "Test User", + cvc: "345", + exp_month: "4", + exp_year: "2019" + }, capture: false + } + }); + done(); }); }); }); @@ -213,7 +215,7 @@ describe("Stripe.authorize", function () { sandbox.restore(); }); - it("should return saved = false when an expired card is returned", function () { + it("should return saved = false when an expired card is returned", function (done) { // Note that this test number makes the Stripe API return this error, it is // not looking at the actual expiration date. const form = { @@ -252,28 +254,27 @@ describe("Stripe.authorize", function () { sandbox.stub(StripeApi.methods.createCharge, "call", function () { return stripeExpiredCardResult; }); - // spyOn(StripeApi.methods.createCharge, "call").and.returnValue(stripeExpiredCardResult); let chargeResult = null; Stripe.authorize(form, { total: total, currency: currency }, function (error, result) { chargeResult = result; - }); - - expect(chargeResult).to.not.be.undefined; - expect(chargeResult.saved).to.be.false; - expect(chargeResult.error).to.equal("Your card has expired."); - expect(StripeApi.methods.createCharge.call).to.have.been.calledWith({ - chargeObj: { - amount: 2298, - currency: "USD", - card: { - number: "4000000000000069", - name: "Test User", - cvc: "345", - exp_month: "4", - exp_year: "2019" - }, capture: false - } + expect(chargeResult).to.not.be.undefined; + expect(chargeResult.saved).to.be.false; + expect(chargeResult.error).to.equal("Your card has expired."); + expect(StripeApi.methods.createCharge.call).to.have.been.calledWith({ + chargeObj: { + amount: 2298, + currency: "USD", + card: { + number: "4000000000000069", + name: "Test User", + cvc: "345", + exp_month: "4", + exp_year: "2019" + }, capture: false + } + }); + done(); }); }); }); diff --git a/imports/plugins/included/payments-stripe/server/methods/stripeapi-methods-refund.app-test.js b/imports/plugins/included/payments-stripe/server/methods/stripeapi-methods-refund.app-test.js index 29a2518bd29..e93cf841832 100644 --- a/imports/plugins/included/payments-stripe/server/methods/stripeapi-methods-refund.app-test.js +++ b/imports/plugins/included/payments-stripe/server/methods/stripeapi-methods-refund.app-test.js @@ -52,19 +52,18 @@ describe("stripe/refund/create", function () { Meteor.call("stripe/refund/create", paymentMethod, paymentMethod.amount, function (error, result) { refundResult = result; refundError = error; + expect(refundError).to.be.undefined; + expect(refundResult).to.not.be.undefined; + expect(refundResult.saved).to.be.true; + expect(StripeApi.methods.createRefund.call).to.have.been.calledWith({ + refundDetails: { + charge: paymentMethod.transactionId, + amount: 1999, + reason: "requested_by_customer" + } + }); + done(); }); - - expect(refundError).to.be.undefined; - expect(refundResult).to.not.be.undefined; - expect(refundResult.saved).to.be.true; - expect(StripeApi.methods.createRefund.call).to.have.been.calledWith({ - refundDetails: { - charge: paymentMethod.transactionId, - amount: 1999, - reason: "requested_by_customer" - } - }); - done(); }); }); diff --git a/imports/plugins/included/payments-stripe/server/methods/stripeapi-methods-refundlist.app-test.js b/imports/plugins/included/payments-stripe/server/methods/stripeapi-methods-refundlist.app-test.js index 39728db4836..ea999746bd2 100644 --- a/imports/plugins/included/payments-stripe/server/methods/stripeapi-methods-refundlist.app-test.js +++ b/imports/plugins/included/payments-stripe/server/methods/stripeapi-methods-refundlist.app-test.js @@ -54,26 +54,24 @@ describe("stripe/refunds/list", function () { sandbox.stub(StripeApi.methods.listRefunds, "call", function () { return stripeRefundListResult; }); - // spyOn(StripeApi.methods.listRefunds, "call").and.returnValue(stripeRefundListResult); let refundListResult = null; let refundListError = null; Meteor.call("stripe/refund/list", paymentMethod, function (error, result) { refundListResult = result; refundListError = error; - }); - - expect(refundListError).to.be.undefined; - expect(refundListResult).to.not.be.undefined; - expect(refundListResult.length).to.equal(1); - expect(refundListResult[0].type).to.equal("refund"); - expect(refundListResult[0].amount).to.equal(19.99); - expect(refundListResult[0].currency).to.equal("usd"); + expect(refundListError).to.be.undefined; + expect(refundListResult).to.not.be.undefined; + expect(refundListResult.length).to.equal(1); + expect(refundListResult[0].type).to.equal("refund"); + expect(refundListResult[0].amount).to.equal(19.99); + expect(refundListResult[0].currency).to.equal("usd"); - expect(StripeApi.methods.listRefunds.call).to.have.been.calledWith({ - transactionId: paymentMethod.transactionId + expect(StripeApi.methods.listRefunds.call).to.have.been.calledWith({ + transactionId: paymentMethod.transactionId + }); + done(); }); - done(); }); }); diff --git a/imports/plugins/included/product-variant/client/templates/products/productDetail/variants/variantForm/variantForm.html b/imports/plugins/included/product-variant/client/templates/products/productDetail/variants/variantForm/variantForm.html index 31c9514681e..22614935fae 100644 --- a/imports/plugins/included/product-variant/client/templates/products/productDetail/variants/variantForm/variantForm.html +++ b/imports/plugins/included/product-variant/client/templates/products/productDetail/variants/variantForm/variantForm.html @@ -88,7 +88,7 @@ {{/if}} -