Skip to content

Commit

Permalink
Merge pull request #3454 from reactioncommerce/release-1.6.4
Browse files Browse the repository at this point in the history
Release 1.6.4
  • Loading branch information
spencern committed Jan 9, 2018
2 parents 9412742 + 3f2fecd commit 33c3d5b
Show file tree
Hide file tree
Showing 17 changed files with 106 additions and 41 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Since anything in our codebase can be extended, overwritten, or installed as a p

### Requirements

Reaction requires Meteor, Git, MongoDB, OS-specific build tools and optionally, ImageMagick. For step-by-step instructions, check out the [Requirements](https://docs.reactioncommerce.com/reaction-docs/master/requirements).
Reaction requires Meteor, Git, MongoDB, OS-specific build tools and optionally, ImageMagick. For step-by-step instructions, check out this [page](https://docs.reactioncommerce.com/reaction-docs/master/installation).

### Install and create your first store

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ class MainDropdown extends Component {
menuStyle={menuStyle}
className="accounts-li-tag"
onChange={this.props.handleChange}
constraints={[{
to: "window",
attachment: "together"
}]}
>
{this.renderUserIcons()}
{this.renderAdminIcons()}
Expand Down
6 changes: 3 additions & 3 deletions imports/plugins/core/orders/server/i18n/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
},
"admin": {
"shortcut": {
"ordersLabel": "命令"
"ordersLabel": "订单"
},
"orderRisk": {
"high": "高风险",
"riskCapture": "捕获订单与风险费用?",
"riskCaptureWarn": "您即将捕获带有收费风险的订单。继续之前确认。"
},
"dashboard": {
"ordersLabel": "命令",
"ordersTitle": "命令",
"ordersLabel": "订单",
"ordersTitle": "订单",
"ordersDescription": "完成订单",
"clearSearch": "明确"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class DropDownMenu extends Component {
label={this.label}
/>
}
constraints={this.props.constraints}
isOpen={this.isOpen}
onClick={this.handleDropdownToggle}
onRequestOpen={this.handleOpen}
Expand All @@ -117,6 +118,7 @@ DropDownMenu.propTypes = {
children: PropTypes.node,
className: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
closeOnClick: PropTypes.bool,
constraints: PropTypes.array,
isClickable: PropTypes.bool,
isEnabled: PropTypes.bool,
isOpen: PropTypes.bool,
Expand Down
19 changes: 17 additions & 2 deletions imports/plugins/included/default-theme/client/styles/media.less
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@

.rui.status-badge {
position: absolute;
top: -17px;
right: -17px;
top: -23px;
right: -23px;
width: 16px;
height: 16px;

Expand Down Expand Up @@ -164,6 +164,21 @@

}

.gallery-image.no-fade-on-hover {
&:hover {
opacity: 1;
}

& > div {
height: auto !important;

& > img {
height: auto !important;
}
}

}

.zoomed-image-container {
z-index: 1;
direction: ltr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@
.display(flex);
.align-items(center);
height: 100%;

padding: 0 14px;
}

.rui.navbar .languages,
Expand Down Expand Up @@ -340,3 +338,7 @@ html:not(.rtl) .rui.navbar .languages .dropdown-menu {
border: solid rgba(129, 122, 122, 0.62) 2px;
box-sizing: content-box !important;
}

.rui.navbar .dropdown-toggle .btn {
width: 81px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const wrapComponent = (Comp) => (
document.querySelector(".page > main").removeEventListener("click", this.onPageClick);
}

onPageClick = () => {
onPageClick = (event) => {
// Do nothing if we are in preview mode
if (Reaction.isPreview() === false) {
// Don't trigger the clear selection if we're clicking on a grid item.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ function getProductFindTerm(searchTerm, searchTags, userId) {
if (!Roles.userIsInRole(userId, ["admin", "owner"], shopId)) {
findTerm.isVisible = true;
}
// Deletes the shopId field from "findTerm" for primary shop
// thereby allowing users on primary shop to search all products
if (shopId === Reaction.getPrimaryShopId()) {
delete findTerm.shopId;
}
return findTerm;
}

Expand Down Expand Up @@ -97,7 +102,13 @@ getResults.orders = function (searchTerm, facets, maxResults, userId) {
$options: "i"
} }
] }
] };
]
};
// Deletes the shopId field from "findTerm" for primary shop
// thereby allowing users on primary shop to search all products
if (shopId === Reaction.getPrimaryShopId()) {
delete findTerm.$and[0].shopId;
}
if (Reaction.hasPermission("orders", userId)) {
orderResults = OrderSearch.find(findTerm, { limit: maxResults });
Logger.debug(`Found ${orderResults.count()} orders searching for ${regexSafeSearchTerm}`);
Expand Down Expand Up @@ -131,7 +142,13 @@ getResults.accounts = function (searchTerm, facets, maxResults, userId) {
$options: "i"
} }
] }
] };
]
};
// Deletes the shopId field from "findTerm" for primary shop
// thereby allowing users on primary shop to search all products
if (shopId === Reaction.getPrimaryShopId()) {
delete findTerm.$and[0].shopId;
}
accountResults = AccountSearch.find(findTerm, {
limit: maxResults
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ const wrapComponent = (Comp) => (

componentDidMount() {
document.addEventListener("keydown", this.handleKeyDown);
window.addEventListener("popstate", this.handleUrlChange);
}

componentWillUnmount() {
document.removeEventListener("keydown", this.handleKeyDown);
window.removeEventListener("popstate", this.handleUrlChange);
}

handleUrlChange = () => {
this.handleChildUnmount();
}

handleKeyDown = (event) => {
Expand Down
28 changes: 22 additions & 6 deletions lib/collections/collectionFS.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@

/**
* core collectionsFS configurations
* @file CollectionFS configuration and settings
*
* Reaction Commerce uses {@link https://github.com/CollectionFS/Meteor-CollectionFS|CollectionFS}
* to upload images and ImageMagick to handle resizing and manipulating images.
* See {@link https://docs.reactioncommerce.com/reaction-docs/master/image-handling|Reaction Docs} for examples.
*
* @class FS.Collection
*/

FS.HTTP.setBaseUrl("/assets");
FS.HTTP.setHeadersForGet([
["Cache-Control", "public, max-age=31536000"]
]);

/**
* Define CollectionFS collection
* See: https://github.com/CollectionFS/Meteor-CollectionFS
* chunkSize: 1024*1024*2; <- CFS default // 256k is default GridFS chunk size, but performs terribly
* @name Media
* @memberof FS.Collection
* @type FS.Collection
* @summary Defines {@link https://github.com/CollectionFS/Meteor-CollectionFS|CollectionFS} collection configuration
* Image files are resized to 4 different square sizes:
* 1. `image` - 1000px by 1000px
* 2. `medium` - 600px by 600px
* 3. `small` - 235px by 235px
* 4. `thumbnail` - 100px by 100px
* `chunkSize` 1024*1024*2 is the CFS default
* 256k is default GridFS `chunkSize`, but performs terribly
* To learn how to further manipulate images with ImageMagick, refer to the
* {@link https://github.com/CollectionFS/Meteor-CollectionFS/wiki/|CollectionFS wiki} and the
* @see https://github.com/CollectionFS/Meteor-CollectionFS
*/

export const Media = new FS.Collection("Media", {
stores: [
new FS.Store.GridFS("image", {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "reaction",
"description": "Reaction is a modern reactive, real-time event driven ecommerce platform.",
"version": "1.6.3",
"version": "1.6.4",
"main": "main.js",
"directories": {
"test": "tests"
Expand Down Expand Up @@ -51,7 +51,7 @@
"handlebars": "^4.0.11",
"history": "^4.7.2",
"hoist-non-react-statics": "^2.3.1",
"i18next": "10.2.1",
"i18next": "10.2.2",
"i18next-browser-languagedetector": "^2.1.0",
"i18next-localstorage-cache": "^1.1.1",
"i18next-sprintf-postprocessor": "^0.2.2",
Expand Down
3 changes: 2 additions & 1 deletion private/data/Shops.json
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@
"enabled": false,
"format": "%v %s",
"symbol": "",
"decimal": ","
"decimal": ",",
"thousand": " "
},
"QAR": {
"enabled": false,
Expand Down
2 changes: 2 additions & 0 deletions private/email/templates/orders/new.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@
<td valign="middle" align="left">
{{#if variantImage}}
<img src="{{variantImage}}" width="50" height="50" alt="" />
{{else if productImage}}
<img src="{{productImage}}" width="50" height="50" alt="" />
{{else}}
<img src="{{placeholderImage}}" width="50" height="50" alt="" />
{{/if}}
Expand Down
10 changes: 5 additions & 5 deletions server/api/core/accounts/password.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ export function sendResetPasswordEmail(userId, optionalEmail) {
homepage: Meteor.absoluteUrl(),
emailLogo: emailLogo,
copyrightDate: moment().format("YYYY"),
legalName: shop.addressBook[0].company,
legalName: _.get(shop, "addressBook[0].company"),
physicalAddress: {
address: shop.addressBook[0].address1 + " " + shop.addressBook[0].address2,
city: shop.addressBook[0].city,
region: shop.addressBook[0].region,
postal: shop.addressBook[0].postal
address: `${_.get(shop, "addressBook[0].address1")} ${_.get(shop, "addressBook[0].address2")}`,
city: _.get(shop, "addressBook[0].city"),
region: _.get(shop, "addressBook[0].region"),
postal: _.get(shop, "addressBook[0].postal")
},
shopName: shop.name,
socialLinks: {
Expand Down
10 changes: 5 additions & 5 deletions server/methods/accounts/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,12 +758,12 @@ export function sendWelcomeEmail(shopId, userId) {
contactEmail: shop.emails[0].address,
emailLogo: emailLogo,
copyrightDate: moment().format("YYYY"),
legalName: shop.addressBook[0].company,
legalName: _.get(shop, "addressBook[0].company"),
physicalAddress: {
address: shop.addressBook[0].address1 + " " + shop.addressBook[0].address2,
city: shop.addressBook[0].city,
region: shop.addressBook[0].region,
postal: shop.addressBook[0].postal
address: `${_.get(shop, "addressBook[0].address1")} ${_.get(shop, "addressBook[0].address2")}`,
city: _.get(shop, "addressBook[0].city"),
region: _.get(shop, "addressBook[0].region"),
postal: _.get(shop, "addressBook[0].postal")
},
shopName: shop.name,
socialLinks: {
Expand Down
14 changes: 7 additions & 7 deletions server/methods/core/orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -699,12 +699,12 @@ export const methods = {
});
// variant image
if (variantImage) {
orderItem.variantImage = path.join(Meteor.absoluteUrl(), variantImage.url());
orderItem.variantImage = Meteor.absoluteUrl(variantImage.url());
}
// find a default image
const productImage = Media.findOne({ "metadata.productId": orderItem.productId });
if (productImage) {
orderItem.productImage = path.join(Meteor.absoluteUrl(), productImage.url());
orderItem.productImage = Meteor.absoluteUrl(productImage.url());
}
}
}
Expand All @@ -717,12 +717,12 @@ export const methods = {
homepage: Meteor.absoluteUrl(),
emailLogo: emailLogo,
copyrightDate: moment().format("YYYY"),
legalName: shop.addressBook[0].company,
legalName: _.get(shop, "addressBook[0].company"),
physicalAddress: {
address: shop.addressBook[0].address1 + " " + shop.addressBook[0].address2,
city: shop.addressBook[0].city,
region: shop.addressBook[0].region,
postal: shop.addressBook[0].postal
address: `${_.get(shop, "addressBook[0].address1")} ${_.get(shop, "addressBook[0].address2")}`,
city: _.get(shop, "addressBook[0].city"),
region: _.get(shop, "addressBook[0].region"),
postal: _.get(shop, "addressBook[0].postal")
},
shopName: shop.name,
socialLinks: {
Expand Down

0 comments on commit 33c3d5b

Please sign in to comment.