Skip to content

Commit

Permalink
Merge pull request #3605 from reactioncommerce/release-1.7.0
Browse files Browse the repository at this point in the history
Release 1.7.0
  • Loading branch information
spencern authored Jan 29, 2018
2 parents 79d2b62 + be55c5a commit f40ff53
Show file tree
Hide file tree
Showing 375 changed files with 2,358 additions and 2,425 deletions.
49 changes: 29 additions & 20 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -266,18 +266,27 @@
// "array-callback-return": ["error", { "allowImplicit": true }],
// "arrow-body-style": ["error", "as-needed", { "requireReturnForObjectLiteral": false }],
// "arrow-parens": [ "error", "always", { "requireForBlockBody": true }],
// "block-spacing": ["error", "always"],
// "computed-property-spacing": ["error", "never"],
// "dot-location": ["error", "property"],
// "function-paren-newline": ["error", "multiline"],
// "import/export": "error",
// "import/first": ["error", "absolute-first"],
// "import/newline-after-import": "error",
// "import/no-duplicates": "error",
// "import/no-mutable-exports": "error",
// "import/no-named-default": "error",
// "new-parens": "error",
// "newline-per-chained-call": ["error", { "ignoreChainWithDepth": 4 }],
"block-spacing": ["error", "always"],
"computed-property-spacing": ["error", "never"],
"dot-location": ["error", "property"],
"function-paren-newline": ["error", "multiline"],
"import/export": "error",
"import/order": ["error", {
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index"
]
}],
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"import/no-mutable-exports": "error",
"import/no-named-default": "error",
"new-parens": "error",
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 4 }],
// "no-await-in-loop": "error",
// "no-bitwise": "error",
// "no-case-declarations": "error",
Expand Down Expand Up @@ -318,9 +327,9 @@
// "no-void": "error",
// "object-curly-newline": ["error", { "ObjectExpression": { "multiline": true, "consistent": true }, "ObjectPattern": { "multiline": true, "consistent": true } }],
// "object-property-newline": ["error", { "allowAllPropertiesOnSameLine": true }],
// "object-shorthand": ["error", "always"],
"object-shorthand": ["error", "always"],
// "operator-assignment": ["error", "always"],
// "prefer-arrow-callback": ["error", { "allowNamedFunctions": false, "allowUnboundThis": true }],
"prefer-arrow-callback": ["error", { "allowNamedFunctions": false, "allowUnboundThis": true }],
// "prefer-destructuring": ["error", {
// "VariableDeclarator": {
// "array": false,
Expand All @@ -337,11 +346,11 @@
// "prefer-spread": "error",
// "prefer-template": "error",
// "rest-spread-spacing": ["error", "never"],
// "space-unary-ops": ["error", {
// "words": true,
// "nonwords": false,
// "overrides": {}
// }],
// "template-curly-spacing": "error"
"space-unary-ops": ["error", {
"words": true,
"nonwords": false,
"overrides": {}
}],
"template-curly-spacing": "error"
}
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ Learn more on how to [configure your project](https://docs.reactioncommerce.com/
- [Customization themes & plugins tutorial](https://docs.reactioncommerce.com/reaction-docs/master/tutorial)
- [Reaction Commerce YouTube videos](https://www.youtube.com/user/reactioncommerce/videos)

## Join the community calls
## Contact the team
- [Security reporting instructions](https://docs.reactioncommerce.com/reaction-docs/master/reporting-vulnerabilities): Report security vulnerabilities to [security@reactioncommerce.com](mailto:security@reactioncommerce.com).
- [Reaction community calls](http://getrxn.io/2rcCal): Join our biweekly community calls every other Wednesday at 7AM PST/10AM EST.
- Subscribe to our [Reaction Community Google Calendar](http://getrxn.io/2rcCal) to RSVP to the next call and check out the [agenda](https://docs.google.com/document/d/1PwenrammgQJpQfFoUUJZ96i_JJYCM_4glAjB1_ZzgwA/edit?usp=sharing).
- [Reaction Action](http://getrxn.io/2rcCal): RSVP for the monthly Reaction Action livestreams.
Expand Down
10 changes: 3 additions & 7 deletions client/modules/core/helpers/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export function Apps(optionHash) {
let key;
const reactionApps = [];
let options = {};
let shopType;

// allow for object or option.hash
if (optionHash) {
Expand All @@ -67,11 +66,8 @@ export function Apps(optionHash) {
}

// Get the shop to determine shopType
const shop = Shops.findOne({ _id: options.shopId });
if (shop) {
shopType = shop.shopType;
}

const shop = Shops.findOne({ _id: options.shopId }) || {};
const { shopType } = shop;

// remove audience permissions for owner (still needed here for older/legacy calls)
if (Reaction.hasOwnerAccess() && options.audience) {
Expand Down Expand Up @@ -109,7 +105,7 @@ export function Apps(optionHash) {
// For now, the audience checks (after the Package.find call) filters out the registry items based on permissions. But
// part of the filtering should have been handled by the Package.find call, if the "audience" filter works as it should.
Packages.find(filter).forEach((app) => {
const matchingRegistry = _.filter(app.registry, function (item) {
const matchingRegistry = _.filter(app.registry, (item) => {
const itemFilter = _.cloneDeep(registryFilter);

// check audience permissions only if they exist as part of optionHash and are part of the registry item
Expand Down
12 changes: 6 additions & 6 deletions client/modules/core/helpers/layout.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import _ from "lodash";
import Logger from "/client/modules/logger";
import { Reaction } from "../";
import * as Collections from "/lib/collections";
import { Meteor } from "meteor/meteor";
import { Template } from "meteor/templating";
import { Reaction } from "../";
import Logger from "/client/modules/logger";
import * as Collections from "/lib/collections";

/**
* reactionTemplate helper
Expand All @@ -15,7 +15,7 @@ import { Template } from "meteor/templating";
* @param {Object} options - workflow defaults to "coreLayout/coreWorkflow"
* @returns {Array} returns an array with labels, templates that match workflow
*/
Template.registerHelper("reactionTemplate", function (options) {
Template.registerHelper("reactionTemplate", (options) => {
const shopId = options.hash.shopId || Reaction.getShopId();
// get shop info, defaults to current
const Shop = Collections.Shops.findOne(shopId);
Expand Down Expand Up @@ -69,11 +69,11 @@ Template.registerHelper("reactionTemplate", function (options) {
layout: {
$elemMatch: options.hash
},
shopId: shopId
shopId
});

// we can have multiple packages contributing to the layout / workflow
packages.forEach(function (reactionPackage) {
packages.forEach((reactionPackage) => {
const layoutWorkflows = _.filter(reactionPackage.layout, options.hash);
// check the packages for layout workflow templates
for (layout of layoutWorkflows) {
Expand Down
18 changes: 9 additions & 9 deletions client/modules/core/helpers/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,28 @@ import { Reaction } from "../";
* @param {String} checkUserId - optional Meteor.userId, default to current
* @return {Boolean}
*/
Template.registerHelper("hasPermission", function (permissions, options) {
Template.registerHelper("hasPermission", (permissions, options) => {
// default to checking this.userId
let userId = Meteor.userId();
const loggedInUser = Meteor.userId();
const shopId = Reaction.getShopId();
// we don't necessarily need to check here
// as these same checks and defaults are
// also performed in Reaction.hasPermission
if (typeof options === "object") {
if (options.hash.userId) {
userId = options.hash.userId;
return Reaction.hasPermission(permissions, userId, shopId);
const { userId } = options.hash;
return Reaction.hasPermission(permissions, userId || loggedInUser, shopId);
}
}
return Reaction.hasPermission(permissions, userId, shopId);
return Reaction.hasPermission(permissions, loggedInUser, shopId);
});

/**
* hasOwnerAccess template helper
* @summary check if user has owner access
* @return {Boolean} return true if owner
*/
Template.registerHelper("hasOwnerAccess", function () {
Template.registerHelper("hasOwnerAccess", () => {
return Reaction.hasOwnerAccess();
});

Expand All @@ -46,7 +46,7 @@ Template.registerHelper("hasOwnerAccess", function () {
* @summary check if user has admin access
* @return {Boolean} return true if admin
*/
Template.registerHelper("hasAdminAccess", function () {
Template.registerHelper("hasAdminAccess", () => {
return Reaction.hasAdminAccess();
});

Expand All @@ -55,7 +55,7 @@ Template.registerHelper("hasAdminAccess", function () {
* @summary check if user has dashboard access
* @return {Boolean} return true if user has dashboard permission
*/
Template.registerHelper("hasDashboardAccess", function () {
Template.registerHelper("hasDashboardAccess", () => {
return Reaction.hasDashboardAccess();
});

Expand All @@ -64,6 +64,6 @@ Template.registerHelper("hasDashboardAccess", function () {
* @summary check if guest users are allowed to checkout
* @return {Boolean} return true if shop has guest checkout enabled
*/
Template.registerHelper("allowGuestCheckout", function () {
Template.registerHelper("allowGuestCheckout", () => {
return Reaction.allowGuestCheckout();
});
Loading

0 comments on commit f40ff53

Please sign in to comment.