Skip to content

Commit

Permalink
Merge branch 'register-component-api' of github.com:reactioncommerce/…
Browse files Browse the repository at this point in the history
…reaction into register-component-api

* 'register-component-api' of github.com:reactioncommerce/reaction:
  Release 1.4.1 (#2583)
  LingoHub based on development (#2591)
  Fix Setting product visibility is not reflected in the Product Grid reactively (#2561)
  • Loading branch information
jshimko committed Jul 25, 2017
2 parents 5b5e98d + 70d8ddd commit 131ca5f
Show file tree
Hide file tree
Showing 24 changed files with 85 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ twitter-config-ui@1.0.0


# Community Packages
abernix:standard-minifier-js
alanning:roles
aldeed:autoform
aldeed:collection2
aldeed:schema-index
aldeed:template-extension
bozhao:accounts-instagram
cfs:filesystem
cfs:graphicsmagick
cfs:gridfs
Expand Down Expand Up @@ -92,5 +94,3 @@ johanbrook:publication-collector
# meteorhacks:sikka # additional ddp, login security

# Custom Packages
abernix:standard-minifier-js@2.1.0-beta.0
bozhao:accounts-instagram
2 changes: 1 addition & 1 deletion 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.4.0",
"version": "1.4.1",
"main": "main.js",
"directories": {
"test": "tests"
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "فيسبوك",
"google": "جوجل",
"github": "جيثب",
"instagram": "إنستاجرام",
"meetup": "ميتوب",
"ok": "حسناً",
"twitter": "تويتر",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "Добре",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "Dobře",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "OK",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "Εντάξει",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "OK",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "Ok",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/hr.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "U redu",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "Rendben",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "Ok",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/my.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook က",
"google": "Google က",
"github": "GitHub",
"instagram": "Instagram ကို",
"meetup": "Meetup",
"ok": "အိုကေ",
"twitter": "တွစ်တာ",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "OK",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "Ok",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "Ok",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "O.K.",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "Одноклассники",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "V redu",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "Ok",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "Tamam",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram",
"meetup": "Meetup",
"ok": "Được",
"twitter": "Twitter",
Expand Down
1 change: 1 addition & 0 deletions private/data/i18n/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
"facebook": "Facebook",
"google": "Google",
"github": "GitHub",
"instagram": "Instagram的",
"meetup": "Meetup",
"ok": "确定",
"twitter": "Twitter",
Expand Down
72 changes: 61 additions & 11 deletions server/publications/collections/products.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,30 +423,80 @@ Meteor.publish("Products", function (productScrollLimit = 24, productFilters, so
let newSelector = selector;

// Remove hashtag filter from selector (hashtags are not applied to variants, we need to get variants)
if (productFilters && productFilters.tags) {
newSelector = _.omit(selector, ["hashtags"]);
if (productFilters) {
newSelector = _.omit(selector, ["hashtags", "ancestors"]);

if (productFilters.tags) {
// Re-configure selector to pick either Variants of one of the top-level products, or the top-level products in the filter
_.extend(newSelector, {
$or: [
{
ancestors: {
$in: productIds
}
},
{ $and: [
{
hashtags: {
$in: productFilters.tags
}
}, {
_id: {
$in: productIds
}
}
]
}
]
});
}
// filter by query
if (productFilters.query) {
const cond = {
$regex: productFilters.query,
$options: "i"
};
_.extend(newSelector, {
$or: [{
title: cond
}, {
pageTitle: cond
}, {
description: cond
}, {
ancestors: {
$in: productIds
}
},
{
_id: {
$in: productIds
}
}]
});
}
} else {
newSelector = _.omit(selector, ["hashtags", "ancestors"]);

// Re-configure selector to pick either Variants of one of the top-level products, or the top-level products in the filter
_.extend(newSelector, {
$or: [
{
ancestors: {
$in: productIds
}
}, {
hashtags: {
$in: productFilters.tags
},
{
_id: {
$in: productIds
}
}
]
});
}
// Returning Complete product tree for top level products to avoid sold out warning.
const productCursor = Products.find({
$or: [
{ _id: { $in: productIds } },
{ ancestors: { $in: productIds } }
]
const productCursor = Products.find(newSelector, {
sort: sort,
limit: productScrollLimit
});

const mediaProductIds = productCursor.fetch().map((p) => p._id);
Expand Down

0 comments on commit 131ca5f

Please sign in to comment.