Skip to content

Commit

Permalink
Merge pull request #5568 from reactioncommerce/release-v2.4.0
Browse files Browse the repository at this point in the history
release v2.4.0
  • Loading branch information
kieckhafer committed Sep 19, 2019
2 parents 651130e + ac209d0 commit de500d5
Show file tree
Hide file tree
Showing 845 changed files with 3,555 additions and 7,888 deletions.
27 changes: 0 additions & 27 deletions .circleci/config.yml
Expand Up @@ -197,29 +197,6 @@ jobs:
command: |
npm run lint:gql
test-app:
<<: *defaults
steps:
- checkout
- restore_cache:
name: Restoring Meteor cache
key: reaction-v2-meteor
- run:
name: Link Restored Meteor
command: sudo ln -s ~/.meteor/meteor /usr/local/bin/meteor
- restore_cache:
# Fall back to less specific caches
keys:
- reaction-v2-node-modules-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
- reaction-v2-node-modules-{{ .Branch }}
- reaction-v2-node-modules-master
- run:
name: Load App Plugins
command: node --experimental-modules ./.reaction/scripts/build.mjs
- run:
name: Run Meteor Integration Tests
command: .circleci/tests.sh

test-unit:
<<: *defaults
steps:
Expand Down Expand Up @@ -298,9 +275,6 @@ workflows:
jobs:
- build
- dockerfile-lint
- test-app:
requires:
- build
- test-unit:
requires:
- build
Expand All @@ -322,7 +296,6 @@ workflows:
- deploy-docs:
requires:
- test-unit
- test-app
- docker-build
filters:
branches:
Expand Down
20 changes: 0 additions & 20 deletions .circleci/tests.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .meteor/packages
Expand Up @@ -58,11 +58,4 @@ percolate:migrations
gadicc:blaze-react-component
orionsoft:graphql-compiler

# Testing packages
dburles:factory
meteortesting:mocha
practicalmeteor:chai
practicalmeteor:sinon
johanbrook:publication-collector

# Custom Packages
10 changes: 0 additions & 10 deletions .meteor/versions
Expand Up @@ -28,8 +28,6 @@ caching-compiler@1.2.1
caching-html-compiler@1.1.3
callback-hook@1.1.0
check@1.3.1
coffeescript@1.0.17
dburles:factory@1.1.0
ddp@1.4.0
ddp-client@2.3.3
ddp-common@1.4.0
Expand Down Expand Up @@ -58,22 +56,17 @@ htmljs@1.0.11
http@1.4.1
id-map@1.1.0
inter-process-messaging@0.1.0
johanbrook:publication-collector@1.1.0
jquery@1.11.11
juliancwirko:postcss@1.3.0
launch-screen@1.1.1
less@2.8.0
livedata@1.0.18
lmieulet:meteor-coverage@1.1.4
localstorage@1.2.0
logging@1.1.20
mdg:validated-method@1.2.0
meteor@1.9.2
meteor-base@1.4.0
meteorhacks:picker@1.0.3
meteorhacks:subs-manager@1.6.4
meteortesting:browser-tests@0.2.0
meteortesting:mocha@0.6.0
minifier-css@1.4.1
minifier-js@2.4.0
minimongo@1.4.5
Expand All @@ -98,9 +91,6 @@ ongoworks:security@2.1.0
ordered-dict@1.1.0
orionsoft:graphql-compiler@0.0.4
percolate:migrations@0.9.8
practicalmeteor:chai@2.1.0_1
practicalmeteor:mocha-core@1.0.1
practicalmeteor:sinon@1.14.1_2
promise@0.11.2
raix:eventemitter@0.1.3
random@1.1.0
Expand Down
20 changes: 20 additions & 0 deletions .reaction/graphql-linter/rules/arguments_have_descriptions.js
@@ -0,0 +1,20 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ArgumentsHaveDescriptions = ArgumentsHaveDescriptions;

var _validation_error = require("graphql-schema-linter/lib/validation_error");

function ArgumentsHaveDescriptions(context) {
return {
FieldDefinition: function FieldDefinition(node) {
for (const arg of node.arguments || []) {
if (!arg.description || typeof arg.description.value !== "string" || arg.description.value.length === 0) {
context.reportError(new _validation_error.ValidationError("arguments-have-descriptions", "Every argument must have a description", [arg]));
}
}
}
};
}
47 changes: 47 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,50 @@
# v2.4.0

Reaction v2.4.0 adds minor features and performance enhancements, fixes bugs and contains no breaking changes since v2.3.0.

This release is being coordinated with [Reaction Platform](https://github.com/reactioncommerce/reaction-platform) and is designed to work with `v2.4.0` of [Reaction Hydra](https://github.com/reactioncommerce/reaction-hydra) and [Example Storefront](https://github.com/reactioncommerce/example-storefront).

## Notable changes

### Translations have been moved out of Meteor

i18n translations have been moved outside of the Meteor context. This provides a standard route, `/locales/resources.json`, where all translations live, and allows for real-time updates to translations without needing to flush the cache.

### Meteor app-tests have

As part of our move away from Meteor, all Meteor app-tests have been removed. This speeds up both local testing, and testing on CI.

## Feature

- feat: Translations without Meteor ([#5514](http://github.com/reactioncommerce/reaction/pull/5514))

## Fixes

- fix: restore Add/Remove menu item in products page ([#5564](http://github.com/reactioncommerce/reaction/pull/5564))
- fix: use catalyst button for mediauploader ([#5563](http://github.com/reactioncommerce/reaction/pull/5563))
- fix: restore loadTranslations fn ([#5546](http://github.com/reactioncommerce/reaction/pull/5546))

## Refactors

- refactor: remove Reaction.Email ([#5559](http://github.com/reactioncommerce/reaction/pull/5559))
- refactor: remove all code releated to inviting a shop owner ([#5553](http://github.com/reactioncommerce/reaction/pull/5553))
- refactor: Fix proptype warning with ReactSortableTree ([#5552](http://github.com/reactioncommerce/reaction/pull/5552))
- refactor: remove `catalog/publish/products` meteor method, use `publi#5541hProductsToCatalog` GQL Mutation instead ([#](http:#5541//github.com/reactioncommerce/reaction/pull/))

## Tests

- tests: Faster Jest integration tests ([#5549](http://github.com/reactioncommerce/reaction/pull/5549))

## Docs

- docs: Fix test command in README.md ([#5565](http://github.com/reactioncommerce/reaction/pull/5565))
- docs: Add missing GraphQL argument descriptions ([#5547](http://github.com/reactioncommerce/reaction/pull/5547))

## Chores

- chore: remove meteor app-tests ([#5560](http://github.com/reactioncommerce/reaction/pull/5560))
- chore: fix various prop type validation errors ([#5550](http://github.com/reactioncommerce/reaction/pull/5550))

# v2.3.0

Reaction v2.3.0 adds minor features and performance enhancements, fixes bugs and contains no breaking changes since v2.2.1.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -53,7 +53,7 @@ We love your pull requests! Check our our [`Good First Issue`](https://github.co
### Pull Request guidelines
Pull requests should pass all automated tests, style, and security checks.

Your code should pass all [acceptance tests and unit tests](https://docs.reactioncommerce.com/reaction-docs/master/testing-reaction). Run `docker-compose run --rm reaction reaction test` to run the test suites locally. If you're adding functionality to Reaction, you should add tests for the added functionality
Your code should pass all [acceptance tests and unit tests](https://docs.reactioncommerce.com/reaction-docs/master/testing-reaction). Run `docker-compose run --rm reaction npm run test` to run the test suites in containers. If you're adding functionality to Reaction, you should add tests for the added functionality.


We require that all code contributed to Reaction follows [Reaction's ESLint rules](https://github.com/reactioncommerce/reaction-eslint-config). You can run `docker-compose run --rm reaction npm run lint` to run ESLint against your code locally.
Expand Down
139 changes: 12 additions & 127 deletions client/modules/core/main.js
Expand Up @@ -9,7 +9,6 @@ import { ReactiveDict } from "meteor/reactive-dict";
import { Roles } from "meteor/alanning:roles";
import Logger from "/client/modules/logger";
import { Countries } from "/client/collections";
import { localeDep } from "/client/modules/i18n";
import { Packages, Shops } from "/lib/collections";
import { Router } from "/client/modules/router";
import { DomainsMixin } from "./domains";
Expand Down Expand Up @@ -59,36 +58,15 @@ export default {
*/
marketplace: { _ready: false },

/**
* @summary Current locale
* @memberof Core/Client
* @type {ReactiveVar}
*/
Locale: new ReactiveVar({}),

/**
* @summary Initialization code
* @memberof Core/Client
* @method
* @returns {Tracker} tracker
*/
init() {
Tracker.autorun(() => {
// marketplaceSettings come over on the PrimaryShopPackages subscription
if (this.Subscriptions.PrimaryShopPackages.ready()) {
if (!this.marketplace._ready) {
const marketplacePkgSettings = this.getMarketplaceSettings();
if (marketplacePkgSettings && marketplacePkgSettings.public) {
this.marketplace._ready = true;
this.marketplace = marketplacePkgSettings.public;
this.marketplace.enabled = true;
}
}
}
});

// Listen for the primary shop subscription and set accordingly
Tracker.autorun(() => {
return Tracker.autorun(() => {
let shop;
if (this.Subscriptions.PrimaryShop.ready()) {
// There should only ever be one "primary" shop
Expand All @@ -99,84 +77,22 @@ export default {
if (shop) {
this._primaryShopId.set(shop._id);

// We'll initialize locale and currency for the primary shop unless
// marketplace settings exist and merchantLocale is set to true
if (this.marketplace.merchantLocale !== true) {
// initialize local client Countries collection
if (!Countries.findOne()) {
createCountryCollection(shop.locales.countries);
}
// We'll initialize locale and currency for the primary shop

const locale = this.Locale.get() || {};

// fix for https://github.com/reactioncommerce/reaction/issues/248
// we need to keep an eye for rates changes
if (typeof locale.locale === "object" &&
typeof locale.currency === "object" &&
typeof locale.locale.currency === "string") {
const localeCurrency = locale.locale.currency.split(",")[0];
if (typeof shop.currencies[localeCurrency] === "object") {
if (typeof shop.currencies[localeCurrency].rate === "number") {
locale.currency.rate = shop.currencies[localeCurrency].rate;
localeDep.changed();
}
}
}
// we are looking for a shopCurrency changes here
if (typeof locale.shopCurrency === "object") {
locale.shopCurrency = shop.currencies[shop.currency];
localeDep.changed();
}
// initialize local client Countries collection
if (!Countries.findOne()) {
createCountryCollection(shop.locales.countries);
}
}
}
});

// Listen for active shop change
return Tracker.autorun(() => { // eslint-disable-line consistent-return
if (this.Subscriptions.MerchantShops.ready()) {
// if we don't have an active shopId, try to retrieve it from the userPreferences object
// and set the shop from the storedShopId
if (!this.shopId) {
const shop = this.getCurrentShop();

if (shop) {
// Only set shopId if it hasn't been set yet
if (!this.shopId) {
this.shopId = shop._id;
this.shopName = shop.name;
}
// if we don't have an active shopId, try to retrieve it from the userPreferences object
// and set the shop from the storedShopId
if (!this.shopId) {
const currentShop = this.getCurrentShop();

// We only use the active shop to setup locale if marketplace settings
// are enabled and merchantLocale is set to true
if (this.marketplace.merchantLocale === true) {
// initialize local client Countries collection
if (!Countries.findOne()) {
createCountryCollection(shop.locales.countries);
}

const locale = this.Locale.get() || {};

// fix for https://github.com/reactioncommerce/reaction/issues/248
// we need to keep an eye for rates changes
if (typeof locale.locale === "object" &&
typeof locale.currency === "object" &&
typeof locale.locale.currency === "string") {
const localeCurrency = locale.locale.currency.split(",")[0];
if (typeof shop.currencies[localeCurrency] === "object") {
if (typeof shop.currencies[localeCurrency].rate === "number") {
locale.currency.rate = shop.currencies[localeCurrency].rate;
localeDep.changed();
}
}
}
// we are looking for a shopCurrency changes here
if (typeof locale.shopCurrency === "object") {
locale.shopCurrency = shop.currencies[shop.currency];
localeDep.changed();
}
if (currentShop) {
this.shopId = currentShop._id;
this.shopName = currentShop.name;
}
return this;
}
}
}
Expand Down Expand Up @@ -246,23 +162,6 @@ export default {
return true;
}

// global roles check
// TODO: Review this commented out code
/*
const sellerShopPermissions = Roles.getGroupsForUser(userId, "admin");
// we're looking for seller permissions.
if (sellerShopPermissions) {
// loop through shops roles and check permissions
for (const key in sellerShopPermissions) {
if (key) {
const shop = sellerShopPermissions[key];
if (Roles.userIsInRole(userId, permissions, shop)) {
return true;
}
}
}
}*/
// no specific permissions found returning false
return false;
}
Expand Down Expand Up @@ -473,20 +372,6 @@ export default {
return settings.settings || {};
},

/**
* @name getPrimaryShopCurrency
* @method
* @memberof Core/Client
* @returns {String} primary shop currency abbreviation
*/
getPrimaryShopCurrency() {
const shop = Shops.findOne({
_id: this.getPrimaryShopId()
});

return (shop && shop.currency) || "USD";
},

/**
* @name getCurrentShop
* @summary Get the proper current shop based on various checks. This mirrors the logic in
Expand Down

0 comments on commit de500d5

Please sign in to comment.