Skip to content

Commit

Permalink
Merge pull request #2054 from reactioncommerce/release-1.1.0
Browse files Browse the repository at this point in the history
Release 1.1.0
  • Loading branch information
Aaron Judd authored Mar 28, 2017
2 parents 91e18f2 + 6742d3a commit 395df41
Show file tree
Hide file tree
Showing 69 changed files with 1,103 additions and 529 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
.fileStorage/
.vscode
.idea
*.csv
*.dat
Expand Down
25 changes: 12 additions & 13 deletions .meteor/versions
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
abernix:minifier-js@1.3.17
abernix:standard-minifier-js@1.3.3
abernix:minifier-js@1.3.19
abernix:standard-minifier-js@1.3.19
accounts-base@1.2.15
accounts-facebook@1.1.1
accounts-google@1.1.1
Expand All @@ -23,16 +23,16 @@ babel-compiler@6.14.1
babel-runtime@1.0.1
base64@1.0.10
binary-heap@1.0.10
blaze@2.3.0
blaze-html-templates@1.1.0
blaze@2.3.2
blaze-html-templates@1.1.2
blaze-tools@1.0.10
boilerplate-generator@1.0.11
browser-policy@1.1.0
browser-policy-common@1.0.11
browser-policy-content@1.1.0
browser-policy-framing@1.1.0
caching-compiler@1.1.9
caching-html-compiler@1.1.0
caching-html-compiler@1.1.2
callback-hook@1.0.10
cfs:access-point@0.1.49
cfs:base-package@0.0.30
Expand Down Expand Up @@ -113,7 +113,6 @@ meteorhacks:picker@1.0.3
meteorhacks:ssr@2.2.0
meteorhacks:subs-manager@1.6.4
minifier-css@1.2.16
minifier-js@1.2.18
minimongo@1.0.21
mobile-experience@1.0.4
mobile-status-bar@1.0.14
Expand Down Expand Up @@ -154,19 +153,19 @@ service-configuration@1.0.11
session@1.1.7
sha@1.0.9
shell-server@0.2.3
spacebars@1.0.13
spacebars-compiler@1.1.0
spacebars@1.0.15
spacebars-compiler@1.1.2
srp@1.0.10
templating@1.3.0
templating-compiler@1.3.0
templating-runtime@1.3.0
templating-tools@1.1.0
templating@1.3.2
templating-compiler@1.3.2
templating-runtime@1.3.2
templating-tools@1.1.2
tmeasday:check-npm-versions@0.3.1
tmeasday:publish-counts@0.8.0
tracker@1.1.2
twitter-config-ui@1.0.0
twitter-oauth@1.2.0
ui@1.0.12
ui@1.0.13
underscore@1.0.10
url@1.1.0
vsivsi:job-collection@1.4.0
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM reactioncommerce/base:v1.2.0
FROM reactioncommerce/base:v1.2.2

# Default environment variables
ENV ROOT_URL "http://localhost"
Expand Down
29 changes: 0 additions & 29 deletions client/modules/core/helpers/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,6 @@ export function toggleSession(sessionVariable, positiveState) {
return Session.get(sessionVariable);
}

/**
* locateUser
* @return {Object} set and return session address based on browser latitude, longitude
*/
export function locateUser() {
function successFunction(position) {
const lat = position.coords.latitude;
const lng = position.coords.longitude;
return Meteor.call("shop/locateAddress", lat, lng, function (error,
address) {
if (address) {
return Session.set("address", address);
}
});
}

function errorFunction() {
return Meteor.call("shop/locateAddress", function (error, address) {
if (address) {
return Session.set("address", address);
}
});
}

if (navigator.geolocation) {
return navigator.geolocation.getCurrentPosition(successFunction,
errorFunction);
}
}

/**
* getCardTypes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
{{> afQuickField name='settings.openexchangerates.refreshPeriod' placeholder="every 1 hour"}}
{{> afQuickField name='settings.google.clientId'}}
{{> afQuickField name='settings.google.apiKey'}}
{{> afQuickField name='settings.cart.cleanupDurationDays' placeholder="older than 3 days"}}
{{> shopSettingsSubmitButton}}
{{/autoForm}}
</div>
Expand Down
5 changes: 3 additions & 2 deletions imports/plugins/core/discounts/client/components/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class DiscountForm extends Component {
this.state = {
discount: this.props.discount,
validationMessage: null,
validatedInput: false,
validatedInput: this.props.validatedInput || false,
attempts: 0,
discountApplied: false
};
Expand Down Expand Up @@ -144,5 +144,6 @@ export default class DiscountForm extends Component {
DiscountForm.propTypes = {
collection: PropTypes.string,
discount: PropTypes.string,
id: PropTypes.string
id: PropTypes.string,
validatedInput: PropTypes.bool
};
6 changes: 4 additions & 2 deletions imports/plugins/core/discounts/client/components/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class DiscountList extends Component {
// load form input view
renderNoneFound() {
return (
<DiscountForm id={this.props.id} collection={this.props.collection}/>
<DiscountForm id={this.props.id} collection={this.props.collection} validatedInput={this.props.validatedInput} />
);
}

Expand All @@ -63,7 +63,8 @@ class DiscountList extends Component {
DiscountList.propTypes = {
collection: PropTypes.string,
id: PropTypes.string,
listItems: PropTypes.array
listItems: PropTypes.array,
validatedInput: PropTypes.bool
};

function composer(props, onData) {
Expand All @@ -84,6 +85,7 @@ function composer(props, onData) {

onData(null, {
collection: props.collection,
validatedInput: props.validatedInput,
id: props.id,
listItems: listItems
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function composer(props, onData) {
languages.push({
label: language.label,
value: language.i18n,
enabled: language.enabled,
enabled: (language.i18n === shop.language || language.enabled),
i18nKey: i18nKey
});
}
Expand All @@ -90,10 +90,10 @@ function composer(props, onData) {
currencyList.push({
name: currency,
label,
enabled: structure.enabled
enabled: (structure.enabled || currency === shop.currency)
});

if (structure.enabled) {
if (structure.enabled || currency === shop.currency) {
currencyOptions.push({
label,
value: currency
Expand Down Expand Up @@ -130,7 +130,7 @@ function composer(props, onData) {
shop,
languages,
currencies: currencyList,
enabledLanguages: languages.filter(language => language.enabled),
enabledLanguages: languages.filter(language => (language.enabled || language.value === shop.language)),
countryOptions: countries,
currencyOptions,
uomOptions,
Expand Down
152 changes: 152 additions & 0 deletions imports/plugins/core/orders/client/components/invoice.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
import React, { Component, PropTypes } from "react";
import { formatPriceString } from "/client/api";
import { Translation } from "/imports/plugins/core/ui/client/components";
import DiscountList from "/imports/plugins/core/discounts/client/components/list";

class Invoice extends Component {
static propTypes = {
canMakeAdjustments: PropTypes.bool,
collection: PropTypes.string,
dateFormat: PropTypes.func,
discounts: PropTypes.bool,
handleClick: PropTypes.func,
invoice: PropTypes.object,
isFetching: PropTypes.bool,
isOpen: PropTypes.bool,
orderId: PropTypes.string,
paymentCaptured: PropTypes.bool,
refunds: PropTypes.array
}

renderDiscountForm() {
const { isOpen, orderId, collection } = this.props;

return (
<div>
{isOpen &&
<div>
<hr/>
<DiscountList
id={orderId}
collection={collection}
validatedInput={true}
/>
<hr/>
</div>
}
</div>
);
}

renderRefundsInfo() {
const { isFetching, refunds, dateFormat } = this.props;

return (
<div>
{isFetching &&
<div className="form-group order-summary-form-group">
<strong>Loading Refunds</strong>
<div className="invoice-details">
<i className="fa fa-spinner fa-spin" />
</div>
</div>
}

{refunds && refunds.map((refund) => (
<div className="order-summary-form-group text-danger" key={refund.created} style={{ marginBottom: 15 }}>
<strong>Refunded on: {dateFormat(refund.created, "MM/D/YYYY")}</strong>
<div className="invoice-details"><strong>{formatPriceString(refund.amount)}</strong></div>
</div>
))}
</div>
);
}

renderTotal() {
const { invoice } = this.props;

return (
<div className="order-summary-form-group">
<hr/>
<strong>TOTAL</strong>
<div className="invoice-details">
<strong>{formatPriceString(invoice.total)}</strong>
</div>
</div>
);
}

renderConditionalDisplay() {
const { canMakeAdjustments, paymentCaptured } = this.props;

return (
<div>
{canMakeAdjustments ?
<div> {this.renderTotal()} </div> :
<span>
{paymentCaptured ?
<div>
{this.renderRefundsInfo()}
</div>
:
<div> {this.renderTotal()} </div>
}
</span>
}
</div>
);
}

render() {
const { invoice, discounts, handleClick } = this.props;

return (
<div>
<div className="order-summary-form-group">
<strong>Quantity Total</strong>
<div className="invoice-details">
{invoice.totalItems}
</div>
</div>

<div className="order-summary-form-group">
<strong><Translation defaultValue="Subtotal" i18nKey="cartSubTotals.subtotal"/></strong>
<div className="invoice-details">
{formatPriceString(invoice.subtotal)}
</div>
</div>

<div className="order-summary-form-group">
<strong><Translation defaultValue="Shipping" i18nKey="cartSubTotals.shipping"/></strong>
<div className="invoice-details">
{formatPriceString(invoice.shipping)}
</div>
</div>

<div className="order-summary-form-group">
<strong><Translation defaultValue="Tax" i18nKey="cartSubTotals.tax"/></strong>
<div className="invoice-details">
{formatPriceString(invoice.taxes)}
</div>
</div>

{discounts &&
<div>
<div className="order-summary-form-group">
<strong><Translation defaultValue="Discount" i18nKey="cartSubTotals.discount"/></strong>
<div className="invoice-details">
<i className="fa fa-tag fa-lg" style={{ marginRight: 2 }}/>
<a className="btn-link" onClick={handleClick}>Add Discount</a>
</div>
</div>
{this.renderDiscountForm()}
</div>
}
{this.renderConditionalDisplay()}
</div>
);
}
}

export default Invoice;

Loading

0 comments on commit 395df41

Please sign in to comment.