Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
a5aafb5
feat: use jest-mongodb pkg for integration tests
aldeed Aug 27, 2019
6e2e7c1
chore: remove Settings sidebar default translation
aldeed Aug 29, 2019
b57089b
refactor: move core translations into core plugin
aldeed Aug 29, 2019
e2230a5
fix: fix reaction-ui translation namespace
aldeed Aug 29, 2019
b472c21
fix: fix discount-codes translation namespace
aldeed Aug 29, 2019
da58ddc
fix: fix example-paymentmethod translation namespace
aldeed Aug 29, 2019
c64fc6a
fix: fix reaction-stripe translation namespace
aldeed Aug 29, 2019
7d447bf
fix: fix incorrect translation keys
aldeed Aug 29, 2019
4cad072
feat: de-Meteorize translation loading - stage 1
aldeed Aug 29, 2019
6858528
chore: remove unused dateBeforeNow validator
aldeed Aug 29, 2019
57e3305
chore: remove currencyDep and userProfileLanguage
aldeed Aug 29, 2019
913d9ee
refactor: use registerPlugin for accounts i18n
aldeed Aug 30, 2019
f5edc87
refactor: use registerPlugin for address i18n
aldeed Aug 30, 2019
cb6d713
refactor: use registerPlugin for catalog i18n
aldeed Aug 30, 2019
69dabf7
refactor: use registerPlugin for checkout i18n
aldeed Aug 30, 2019
e5dfb16
refactor: use registerPlugin for core i18n
aldeed Aug 30, 2019
d86ea24
refactor: use registerPlugin for dashboard i18n
aldeed Aug 30, 2019
b23c273
feat: registering translations in registerPlugin
aldeed Aug 30, 2019
67a98d0
feat: register dashboard plugin in Node app
aldeed Aug 30, 2019
72229b4
refactor: use registerPlugin for discounts i18n
aldeed Aug 30, 2019
82eb918
refactor: use registerPlugin for email i18n
aldeed Aug 30, 2019
40a44e6
refactor: use registerPlugin for i18n plugin i18n
aldeed Aug 30, 2019
da13157
refactor: use registerPlugin for inventory i18n
aldeed Aug 30, 2019
a064ebd
chore: delete unused layout plugin translations
aldeed Aug 30, 2019
e36d14d
refactor: use registerPlugin for navigation i18n
aldeed Aug 30, 2019
5f42b72
refactor: use registerPlugin for orders i18n
aldeed Aug 30, 2019
88e492f
refactor: use registerPlugin for payments i18n
aldeed Aug 30, 2019
b6bd0ac
refactor: use registerPlugin for shipping i18n
aldeed Aug 30, 2019
2e81a60
refactor: use registerPlugin for tags i18n
aldeed Aug 30, 2019
6540bf2
refactor: use registerPlugin for taxes i18n
aldeed Aug 30, 2019
6720124
refactor: use registerPlugin for templates i18n
aldeed Aug 30, 2019
009f309
refactor: use registerPlugin for ui i18n
aldeed Aug 30, 2019
2bb369d
chore: delete some unneeded translation files
aldeed Aug 30, 2019
4ad4463
refactor: use registerPlugin for discount-codes i18n
aldeed Aug 30, 2019
1473976
chore: delete unneeded jobcontrol i18n files
aldeed Aug 30, 2019
fbfd752
refactor: use registerPlugin for marketplace i18n
aldeed Aug 30, 2019
ff0201b
chore: delete unused translations
aldeed Aug 30, 2019
623d5a7
refactor: use registerPlugin for example payment i18n
aldeed Aug 30, 2019
819e426
refactor: use registerPlugin for stripe payments i18n
aldeed Aug 30, 2019
6f065d1
refactor: use registerPlugin for product-admin i18n
aldeed Aug 30, 2019
8cd245b
refactor: move product-detail-simple translations
aldeed Aug 30, 2019
7d2f181
refactor: use registerPlugin for product-variant i18n
aldeed Aug 30, 2019
820c40c
refactor: use registerPlugin for shipping rates i18n
aldeed Aug 30, 2019
a854b77
refactor: use registerPlugin for simple-inventory i18n
aldeed Aug 30, 2019
7b37ef5
refactor: use registerPlugin for sitemap-generator i18n
aldeed Aug 30, 2019
8df089d
chore: delete unused surcharges i18n
aldeed Aug 30, 2019
f992a68
feat: remove Meteor translation loading
aldeed Aug 30, 2019
684cf5c
Merge branch 'develop' into feat-aldeed-no-meteor-translations
aldeed Sep 9, 2019
34b27a0
chore: lint fix
aldeed Sep 10, 2019
55c9667
feat: remove Translations collection, schema, and pub
aldeed Sep 10, 2019
ab1f696
feat: delete translations from db
aldeed Sep 10, 2019
0bf3c3c
refactor: remove unneeded locale/language code
aldeed Sep 10, 2019
8943d0f
refactor: updateLanguageConfiguration cleanup
aldeed Sep 10, 2019
e5c4f92
feat: remove LanguageDropdown
aldeed Sep 10, 2019
aba2b7b
Merge branch 'develop' into feat-aldeed-no-meteor-translations
aldeed Sep 11, 2019
29655d0
refactor: use GraphQL instead of meteor method to publishProducts
kieckhafer Sep 11, 2019
633e02f
refactor: remove failing test that we will remove method for in near …
kieckhafer Sep 11, 2019
098ac82
style: typo fix
kieckhafer Sep 11, 2019
5d707f2
chore: remove outdated comment
aldeed Sep 11, 2019
fc82f18
fix: drop the Translations collection in migration
aldeed Sep 11, 2019
f9c6358
fix: show UI error when disabling default lang/currency
aldeed Sep 11, 2019
ee84f84
Merge pull request #5514 from reactioncommerce/feat-aldeed-no-meteor-…
kieckhafer Sep 11, 2019
52e02cc
refactor: use callback to avoid multiple renders
kieckhafer Sep 11, 2019
9501ff2
fix: restore loadTranslations fn
aldeed Sep 12, 2019
aa18b32
chore: add deprecation warning log
aldeed Sep 12, 2019
f7e0e7f
fix: fix import
aldeed Sep 12, 2019
a85c74c
docs: add gql lint rule requiring arg descriptions
aldeed Sep 12, 2019
dd1cf04
docs: add all missing GraphQL arg descriptions
aldeed Sep 12, 2019
e1c5c1d
Merge pull request #5541 from reactioncommerce/refactor-kieckhafer-re…
aldeed Sep 12, 2019
8099a41
Merge pull request #5547 from reactioncommerce/docs-aldeed-gql-arg-de…
Sep 12, 2019
a304395
Merge pull request #5546 from reactioncommerce/fix-aldeed-restore-loa…
mikemurray Sep 12, 2019
62cd078
Merge branch 'develop' into feat-aldeed-jest-mongodb
aldeed Sep 12, 2019
3754f23
test: faster integration test scripts
aldeed Sep 12, 2019
bf4ba8c
chore: fix various prop type validation errors
willopez Sep 13, 2019
976b1e1
Merge pull request #5551 from reactioncommerce/master
willopez Sep 13, 2019
aac603e
refactor: update export
mikemurray Sep 13, 2019
62282ea
refactor: update to a function component
mikemurray Sep 13, 2019
98c7c51
refactor: remove all code releated to inviting a shop owner, as this …
kieckhafer Sep 13, 2019
1147b05
Merge pull request #5550 from reactioncommerce/willopez-fix-prop-vali…
mikemurray Sep 13, 2019
6fa7abc
refactor: fix eslint issues
mikemurray Sep 13, 2019
0ae494c
Merge pull request #5552 from reactioncommerce/refactor-5548-mikemurr…
mikemurray Sep 13, 2019
6502165
test: revert to jsdom env
aldeed Sep 16, 2019
42773e2
refactor: remove Reaction.Email
kieckhafer Sep 16, 2019
8ca3e83
Merge pull request #5553 from reactioncommerce/refactor-kieckhafer-re…
aldeed Sep 16, 2019
6cf91a8
Merge pull request #5559 from reactioncommerce/refactor-kieckhafer-re…
aldeed Sep 16, 2019
b659306
chore: remove fixtures no longer used
kieckhafer Sep 16, 2019
8951c4f
chore: remove meteor-app-tests
kieckhafer Sep 16, 2019
c68dbbc
chore: remove testing related packages
kieckhafer Sep 16, 2019
28e2f20
chore: remove test-app from CI config
kieckhafer Sep 16, 2019
e3d18ac
chore: update package-lock.json
kieckhafer Sep 16, 2019
e85a2cb
chore: remove `test:app` from scripts
kieckhafer Sep 16, 2019
89ba992
chore: remove test:app shell script
kieckhafer Sep 16, 2019
9190c9c
chore: remove excess app-test files
kieckhafer Sep 16, 2019
708fc2e
Merge pull request #5560 from reactioncommerce/refactor-kieckhafer-re…
mikemurray Sep 16, 2019
ac2553c
refactor: use catalyst button for media uploader
Sep 16, 2019
6b4364f
chore: lint
Sep 16, 2019
97848e1
fix: restore Add/Remove menu item in products page
willopez Sep 16, 2019
048f9f1
Merge branch 'develop' into feat-aldeed-jest-mongodb
von-steinkirch Sep 17, 2019
c7566e2
Merge pull request #5549 from reactioncommerce/feat-aldeed-jest-mongodb
von-steinkirch Sep 17, 2019
e1eca16
chore: fix lint error
willopez Sep 17, 2019
6765fb6
fix test command in readme
Sep 17, 2019
e7024e0
Merge pull request #5565 from reactioncommerce/docs-steinkirch-fix-te…
Sep 17, 2019
ee3451e
Merge pull request #5563 from reactioncommerce/5526-dropzone-button
kieckhafer Sep 17, 2019
783233e
Merge pull request #5564 from reactioncommerce/willopez-restore-bulk-…
kieckhafer Sep 17, 2019
ac209d0
chore: update package.json and changelog with v2.4.0 info
kieckhafer Sep 18, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 0 additions & 27 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
20 changes: 20 additions & 0 deletions .reaction/graphql-linter/rules/arguments_have_descriptions.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading