Skip to content

Commit

Permalink
v0.16.0 (#1415)
Browse files Browse the repository at this point in the history
* Added babelrc and stage-2 preset (#1329)

* Meteor 1.4.1.1 (#1331)

* [email protected]

- [email protected]
- updated Meteor packages, collections2

* version 0.15.2

* move plugin loader from startup to reaction-cli (#1332)

* preserve custom profile fields in Accounts.onCreateUser (#1335)

* copy deprecated cfs:gridfs to local and update npm deps (#1336)

* rounding of total to negate fractions of cents

* updated version

- release 0.15.3

* Josh acceptance test setup user permissions (#1315)

* First round setting up acceptance test capabilities

* webdriver working

* adding meteor ignore file structure

* create tests directory

* adding png to gitignore

* element maps

* More progress on functional test setup

* fixed assert

* using dot notation

* adding chai to dev packages

* Begin adding acceptance testing instructions to readme

* Simple login test complete

* Adding to readme about failed tests screenshots

* adding stuff

* Core permissions acceptance test

* more fixes

* went off the deep end. added some low hanging fruit tests

* enabling all passing tests for now

* fixed userAddress call

* removing docs from main readme

* linting for config fixed

* more cleanup

* additional cleanup

* using chrome instead of firefox now since ff is borked

* adding refund test

* a couple more refund tests w/ a couple fixes

Will add more assertions later for these tests.

* adding new tests to runner

* argh

* remove screenshot

* remove ignore of all .png

* updated package.json

* updated reaction.json.example

* finishing up PR

* lint cleanup

* temp workaround for missing product in store

* A couple locator changes - commented out broken stripe tests

* persistent profile language (#1338)

* allow multiple languages in Translations

- allow array to pass multiple languages in addition to shopLanguage.

* updated i18next and Translation load order

* remove session handling from i18n

- remove “language” session
- rely on Meteor.user updates (stored lang in profile)
- update i18nchooser helpers to insert user profile lang into selected
element class

* retain language on anonymous user registration

* check admin before setting lang

— don’t set lang on initial admin

* updated accounts.js

- cleanup checks

* Josh test speed increase #1347 (#1355)

* turning verbosity off when running tests by default

* Removing sleeps/pauses when I can

* flaky test fix

* #1347 cut runtime down by nearly 50%

This is still just running synchronously. As tests grows we will need
to look into running tests in parallel, however this might require some
infrastructure in place, i.e. a hosted QA environment. An environment
that can handle the load of 5-10 tests hitting it at a time.

* only build Docker image on master/development (#1359)

* only build Docker image on master/development

* chmod +x

* fix CI script typos

* load default user from env (#1369)

resolves #1368

* remove duplicate translation

* remove duplicate translations

* Shipping 1320 (#1357)

* disabled ranges

- TODO ranges are not functional yet.

* update shipping form methods

* remove settings from registry

* update swal version

- updated sweetAlert2 version

* export Import, Fixture

- export Fixture independently of Import
- refactor Import.shipping to use a modified key
- refactor load-data to use Fixture

* updated Shipping schema

* updated shipping method names

- breaking change: shipping method names updated to follow convention
of Reaction
`updateShippingMethods` becomes `shipping/methods/update`.
- adds `shipping/provider/remove` method

* add missing import

* convert info logging to debug

* updated form methods

- update form methods
- add SWAL2 confirmations

* add handling to cart rates

- if `handling` has data add `handling` to `rate`.

* updated cartTransforms

- updated to use own methods and parse float to ensure consistent
results.

* move shipping from included to core

like taxes, the core will include flat rates and the ui handling for
additional  shipping methods, which will be added to included - in the
form of `shipping-shippo` etc.

* remove card cursor:pointer (#1384)

Resolves #1309

* Product Search (#1350)

* Mock Search Files

* Mock Search Files

* Remove addProduct method

* Remove Fixtures to remove mystery Shop

* Super limited, even for a fake search

* Don't overwrite the descriptions on first run

* Larger data set for testing

* Don't log unless we are actually adding Search Products

* A simple weighted product search

* Split out plug ins into "search" and "searchEngine" plugs.

* Improve product title search, add search settings panel

* Add in variant search

* Add more options for weighting. Make the settings panel better.

* Add tags to results and search on description

* Rename plugin to be consistent with others

* Add example config file

* New test data with "show store" model with tags

* Simple product subscription that returns products and facets (tags) for a searchterm

* Only return ids and names of tags (we will eventually only return ids, but names for readability for now)

* Filter by tags

* We only need one plugin since our decoupling is provided by the use of a publication

* Rename plugin

* Using Mongo full-text search rather than regex search

* Using Mongo full-text search rather than regex search

* alphabetize base-style imports

* Add in hooks to keep PS collection updated

* Move build/rebuild functions into module

* New settings for fields and weights

* New settings for fields and weights

* add in hooks

* New settings for fields and weights

* Build PS collection dynamically based on configuration

* Add in vendor to list of possible fields

* initial push of search UI

* Move collections to lib so that clients can subscribe

* Add shopId to required fields

* Move collections to global collections

* Use ProductSearch collection on the client side

* Filter tags by hashtags in ProductSearch results

* Populate template with search results

* Product search results sorted by score in Ascending order

* Move (re)building search collections to job queue

* Handle form with a method so that we can rebuild collection or index when settings change

* Queue job to rebuild indexes when weights have changed

* Don't run search hooks when ProductSearch collection has not been defined

* Add Order search

* Namespace product settings

* Don't run hooks when under test

* Add missing "shopId" field

* More fixes to make OrderSearch collection configurable.

* Ensure index when inserting product records

* testing larger datasets

* Make function names less ridiculously long

* Pass results without relying on the product already existing in the subscription

* Don't add a bunch of products for testing by default

* style cleanup

* style cleanup

* style cleanup

* Add handle to product search collection

* Clarify log statement

* Ensure but don't drop collections when creating an OrderSearch record

* No longer build productResults on the client

* Cleanup and add `maxResults`

* Cleanup settings form

* Don't queue search collection jobs when under test

* Search result tests

* Add price to results. Make results different based upon logged-in status

* Add tests for non-published products not showing up for anonymous users

* Add tests for non-published products not showing up for anonymous users

* Add account search, jobs, etc.

* Change account search to not use text search

* ui initial push

* conflict temporary fix

* move style into less

* i18n for search

* added delay on fadeout to feign smoother transition

* sped up tag color transitions

* componentize search results content

* componentize search results grid

* style updates for search modal

* get media to show in searchGrid

* updated id date for searchGridIcons

* Use hashtags not hastags

* Change order search to use a regular query plus tests

* removed console.log

* fixed typo

* switched content order

* commit of admin buttons (currently not functional)

* Add support for text indexes in other supported languages

* Make order search results case-insensitive

* close button classes

* removed outline from nav

* removed additional media from search

We only need to show one picture in search, for now at least

* updated text

* added search clear

* style updates

* Delete all existing records when rebuilding account search

* Remove startup test files

* Also remove test data files

* Make logging less chatty

* Allow for transformations outside of the ProductSearch method

* convert tags to flexbox

* style updates

* adding scroll tag container

* clean-up of development comments

* LESS cleanup

* style cleanup

* style updates

* 96% width input & tags

formerly 80%

* move some styling from search.less to navbar.less

* cleanup & i18n

* remove errant button

* changed tag active color to ban-active

* Add documentation around "supported language" as suggested by CR

* added i18n to search

* changed search tags to use btn classes

* disable currently unused admin controls

* rtl support

* rtl style adjustments

* Exclude anonymous users from accounts publication (#1390)

* Exclude anonymous users from accounts publication when logged in as admin

* NPM imports first

* update deprecated _.pluck

- Patch _.pluck = _.map in lodash 4.x
- resolves issue introduced in #1390

* metafields -> details for client visibility (#1397)

* metafields -> details for client visibility

* metafields -> details

* Search UI updates (#1410)

* add margin-bottom to hovered product for better visibility on last product

* removed font-size from .btn.flat

* created react flatButton

created a new react button component so we aren’t just if/elseing our
way through a different type of button to get what we need.

* adjustment for #1402 - added overflow toggle on body

* removed font size from btn-round

* allow ESC to exit modal even when not focused on input

* Release 0.16.0 (#1413)

* updated README.md

* update to v0.16.0

* conflict fixes
  • Loading branch information
kieckhafer authored Sep 21, 2016
1 parent 52aecd0 commit 8c0b726
Show file tree
Hide file tree
Showing 119 changed files with 5,939 additions and 1,721 deletions.
2 changes: 1 addition & 1 deletion .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ [email protected]
[email protected]
mrt:[email protected]
[email protected]
[email protected].48
[email protected].49
[email protected]
[email protected]
[email protected]
Expand Down
26 changes: 26 additions & 0 deletions .reaction/docker/scripts/ci-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# if we're not on a deployment branch, skip the Docker build/test
if [[ "$CIRCLE_BRANCH" != "master" && "$CIRCLE_BRANCH" != "development" ]]; then
echo "Not running a deployment branch. Skipping the Docker build test."
exit 0
fi

# load up cached image if there is one
if [[ -e ~/docker/image.tar ]]; then
docker load -i ~/docker/image.tar
fi

# build new image
docker build -t reactioncommerce/reaction:latest .

# if successful, save in cache
mkdir -p ~/docker
docker save reactioncommerce/reaction:latest > ~/docker/image.tar

# run the container and wait for it to boot
docker-compose -f .reaction/docker/docker-compose.test.yml up -d
sleep 30

# use curl to ensure the app returns 200's
curl --retry 10 --retry-delay 10 -v http://localhost
76 changes: 54 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,22 @@ cd reaction
reaction
```

> **reaction-cli** requires a recent version of [npm](https://www.npmjs.com/).
```
npm i -g n
n stable
```
`reaction -v` provides useful version information you'll need for debugging if you have issues with `reaction`.

[ImageMagick](http://www.imagemagick.org/script/binary-releases.php) is optional, but required for transforming images for responsive sizing.

**Windows** users should review the [Windows specific installation requirements for Meteor and Reaction](https://docs.reactioncommerce.com/reaction-docs/development/requirements).

Additional setup options, such as how to set the default credentials, installation without `reaction-cli`, and [Meteor](https://www.meteor.com/install) installation can be found in the [installation](https://docs.reactioncommerce.com/reaction-docs/development/installation) and [configuration documentation](https://docs.reactioncommerce.com/reaction-docs/development/configuration).
**reaction-cli** also requires a recent version of [npm](https://www.npmjs.com/).

## Docs
You can use [npm](https://www.npmjs.com/) to update to the latest version.

Installation, configuration and development documentation is available on [docs.reactioncommerce.com](https://docs.reactioncommerce.com/)
```
npm i -g n
n stable
```

The Reaction documentation source is located in the [reaction-docs](https://github.com/reactioncommerce/reaction-docs) repository, while the documentation site is the [reactioncommerce/redoc](https://github.com/reactioncommerce/redoc) application.
Additional setup options, such as how to set the default credentials, installation without `reaction-cli`, and [Meteor](https://www.meteor.com/install) installation can be found in the [installation](https://docs.reactioncommerce.com/reaction-docs/development/installation) and [configuration documentation](https://docs.reactioncommerce.com/reaction-docs/development/configuration).

![dashboard_and_new_tab](https://cloud.githubusercontent.com/assets/439959/17002746/a9fd1694-4e81-11e6-9963-28d6352787a3.png)

Expand All @@ -44,27 +42,61 @@ Reaction is expected to have a stable codebase ready for some production configu

Currently good for contributing, observing progress, and testing. We'd encourage due diligence in production usage, be very comfortable with the code, and risk tolerant. There are still many parts in development!

- Master ( [stable](https://github.com/reactioncommerce/reaction/tree/master) )
- Development ( [latest](https://github.com/reactioncommerce/reaction/tree/development) )
- Master ( [stable](https://github.com/reactioncommerce/reaction/tree/master) )
- Development ( [latest](https://github.com/reactioncommerce/reaction/tree/development) )

## Participation

If you are interested in participating in the development of Reaction, that's really great!

## Roadmap
Our [community guidelines](https://docs.reactioncommerce.com/reaction-docs/master/guidelines) can be found in our [documentation](https://docs.reactioncommerce.com/). This is a good place to start getting more familar with Reaction.

With ongoing feature development, and strong community contributions, we have a fluid roadmap.
The [Reaction Gitter channel](https://gitter.im/reactioncommerce/reaction) and [forum](http://discourse.reactioncommerce.com/) are good places to engage with core contributors and the community.


### Planning
For a high level review our roadmap, take a look at the [Reaction vision page](http://reactioncommerce.com/vision).

For grouping of development channels by feature, review the [project milestones](https://github.com/reactioncommerce/reaction/milestones).
For a kanban-esque, hardcore, real time progress overview of all Reaction Commerce projects use our [waffle board](https://waffle.io/reactioncommerce/reaction).

Grouped by functional area, [reactioncommerce/reaction projects](https://github.com/reactioncommerce/reaction/projects) deliver a progress view of the Reaction sub-projects.

For grouping of issues with an estimated release schedule, review the [release milestones](https://github.com/reactioncommerce/reaction/milestones).

### Contributing

If you are planning on [contributing](https://guides.github.com/activities/contributing-to-open-source/#contributing) to Reaction, that's great. We welcome contributions to Reaction.

Explore the GitHub issues already opened. If you find something you want to work on, let us know right there in the comments. If you are interested in a specific aspect of the [project](https://github.com/reactioncommerce/reaction/projects) but aren’t sure where to begin, feel free to ask. Start small and open up a dialogue with us. This will help to get your contributions accepted easily.

If the contribution you wish to make isn't documented in an existing issue, please [create an issue](https://github.com/reactioncommerce/reaction/issues/new), before you submit a [Pull Request](https://help.github.com/articles/about-pull-requests/). This will allow the Reaction Maintainers and Collaborators a chance to give additional feedback as well.

[Pull Requests](https://help.github.com/articles/about-pull-requests/) should
- Have an associated issue
- Have accepted the Contributor License Agreement
- Enforce the [Reaction style guide](https://docs.reactioncommerce.com/reaction-docs/master/styleguide)
- Pass both [Acceptance tests and Unit testing](https://docs.reactioncommerce.com/reaction-docs/master/testing-reaction).


### Documentation

Installation, configuration and development documentation is available on [docs.reactioncommerce.com](https://docs.reactioncommerce.com/)

The Reaction documentation source is located in the [reaction-docs](https://github.com/reactioncommerce/reaction-docs) repository, while the documentation site is the [reactioncommerce/redoc](https://github.com/reactioncommerce/redoc) application.

### Testing

And finally for the kanban-esque, hardcore real time progress overview of Reaction, take a look our [waffle board](https://waffle.io/reactioncommerce/reaction)
Testing is an important way of participating as well. If you do discover an issue, please create an [issue here](https://github.com/reactioncommerce/reaction/issues/new) to report an issue.

## Feedback
Integration tests can be run at the command line with `reaction test`. Use `npm run-script test-local` to run local tests.

**Create a GitHub Issue** on the [Reaction project](https://github.com/reactioncommerce/reaction) to report an issue.
We use [BrowserStack](https://www.browserstack.com) for automated acceptance testing.

Visit the **[Reaction forum](http://discourse.reactioncommerce.com/)** to engage with the core team and community on new feature requests, or get community support with customization of Reaction.
![BrowserStack Logo](https://d98b8t1nnulk5.cloudfront.net/production/images/layout/logo-header.png?1469004780)

Join us on our **[Gitter chat room](https://gitter.im/reactioncommerce/reaction)** to engage with other Meteor and Reaction users.
### Deployment
We require that all releases are deployable as [Docker](https://www.docker.com/) containers. While we do not actively test or support other methods of deployment, the community has documented deployment strategies for [Heroku](https://github.com/reactioncommerce/reaction/issues/1363), AWS, [Digital Ocean](https://gist.github.com/jshimko/745ca66748846551692e24c267a56060) and Galaxy.

## Docker
##### Docker

Docker images are available on the [Docker Hub](https://hub.docker.com/u/reactioncommerce/). There are two images available: [reactioncommerce:prequel](https://hub.docker.com/r/reactioncommerce/prequel/) - the latest `development` image and [reactioncommerce:reaction](https://hub.docker.com/r/reactioncommerce/reaction/), the `master` image.
Docker images are pushed when Reaction sucessfully builds and passes all tests on the `master` or `development` branches. These images are released on [Reaction Commerce Docker Hub](https://hub.docker.com/u/reactioncommerce/). There are two images available: [reactioncommerce:prequel](https://hub.docker.com/r/reactioncommerce/prequel/) - the latest `development` image and [reactioncommerce:reaction](https://hub.docker.com/r/reactioncommerce/reaction/), the `master` image.
8 changes: 2 additions & 6 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
machine:
node:
version: 4.4.7
version: 4.5.0
services:
- docker
pre:
Expand All @@ -14,17 +14,13 @@ dependencies:
- cd $HOME/reaction
- .reaction/scripts/clone-packages.sh
- .reaction/docker/scripts/plugin-loader.sh
- if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi
- docker build -t reactioncommerce/reaction:latest .
- mkdir -p ~/docker; docker save reactioncommerce/reaction:latest > ~/docker/image.tar

test:
override:
- cd $HOME/reaction
- meteor npm install
- SERVER_TEST_REPORTER="dot" meteor test --once --full-app --headless --driver-package dispatch:mocha
- docker-compose -f .reaction/docker/docker-compose.test.yml up -d; sleep 10
- curl --retry 10 --retry-delay 5 -v http://localhost
- .reaction/docker/scripts/ci-build.sh

deployment:
prequel:
Expand Down
119 changes: 7 additions & 112 deletions client/modules/i18n/main.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import _ from "lodash";
import i18next from "i18next";
import i18nextBrowserLanguageDetector from "i18next-browser-languagedetector";
import i18nextLocalStorageCache from "i18next-localstorage-cache";
import i18nextSprintfPostProcessor from "i18next-sprintf-postprocessor";
import i18nextJquery from "jquery-i18next";
import { Meteor } from "meteor/meteor";
import { Tracker } from "meteor/tracker";
import { Session } from "meteor/session";
import { SimpleSchema } from "meteor/aldeed:simple-schema";
import { Reaction } from "/client/api";
import { Packages, Shops, Translations } from "/lib/collections";
import * as Schemas from "/lib/collections/schemas";
import { Packages, Translations } from "/lib/collections";

//
// Reaction i18n Translations, RTL and Currency Exchange Support
Expand Down Expand Up @@ -40,7 +33,7 @@ export function getBrowserLanguage() {
* @param {String} name - name
* @return {Object} return schema label object
*/
function getLabelsFor(schema, name) {
export function getLabelsFor(schema, name) {
const labels = {};
// loop through all the rendered form fields and generate i18n keys
for (const fieldName of schema._schemaKeys) {
Expand Down Expand Up @@ -68,7 +61,7 @@ function getLabelsFor(schema, name) {
* @todo implement messaging hierarchy from simple-schema
* @return {Object} returns i18n translated message for schema labels
*/
function getMessagesFor() {
export function getMessagesFor() {
const messages = {};
for (const message in SimpleSchema._globalMessages) {
if ({}.hasOwnProperty.call(SimpleSchema._globalMessages, message)) {
Expand All @@ -89,19 +82,14 @@ function getMessagesFor() {
*/
export const i18nextDep = new Tracker.Dependency();
export const localeDep = new Tracker.Dependency();
const packageNamespaces = [];
export const packageNamespaces = [];

Meteor.startup(() => {
Tracker.autorun(function (c) {
// setting local and active packageNamespaces
// packageNamespaces are used to determine i18n namespace
if (Reaction.Subscriptions.Shops.ready()) {
// TODO: i18nextBrowserLanguageDetector
// const defaultLanguage = lng.detect() || shop.language;

// set default session language
Session.setDefault("language", getBrowserLanguage());

// every package gets a namespace, fetch them
// const packageNamespaces = [];
// every package gets a namespace, fetch them and export
const packages = Packages.find({}, {
fields: {
name: 1
Expand All @@ -128,97 +116,4 @@ Meteor.startup(() => {
});
});

// use tracker autorun to detect language changes
Tracker.autorun(function () {
return Meteor.subscribe("Translations", Session.get("language"), () => {
// fetch reaction translations
const translations = Translations.find({}, {
fields: {
_id: 0
}
}).fetch();

// map reduce translations into i18next formatting
const resources = translations.reduce(function (x, y) {
const ns = Object.keys(y.translation)[0];
// first creating the structure, when add additional namespaces
if (x[y.i18n]) {
x[y.i18n][ns] = y.translation[ns];
} else {
x[y.i18n] = y.translation;
}
return x;
}, {});

const shop = Shops.findOne(Reaction.getShopId());

//
// initialize i18next
//
i18next
.use(i18nextBrowserLanguageDetector)
.use(i18nextLocalStorageCache)
.use(i18nextSprintfPostProcessor)
.use(i18nextJquery)
.init({
debug: false,
ns: packageNamespaces, // translation namespace for every package
defaultNS: "core", // reaction "core" is the default namespace
lng: Session.get("language"), // user session language
fallbackLng: shop ? shop.language : null, // Shop language
resources: resources
// saveMissing: true,
// missingKeyHandler: function (lng, ns, key, fallbackValue) {
// Meteor.call("i18n/addTranslation", lng, ns, key, fallbackValue);
// }
}, (err, t) => {
// someday this should work
// see: https://github.com/aldeed/meteor-simple-schema/issues/494
for (const schema in _.omit(Schemas, "__esModule")) {
if ({}.hasOwnProperty.call(Schemas, schema)) {
const ss = Schemas[schema];
ss.labels(getLabelsFor(ss, schema));
ss.messages(getMessagesFor(ss, schema));
}
}

i18nextDep.changed();

// global first time init event finds and replaces
// data-i18n attributes in html/template source.
$elements = $("[data-i18n]").localize();

// apply language direction to html
if (t("languageDirection") === "rtl") {
return $("html").addClass("rtl");
}
return $("html").removeClass("rtl");
});
});
});

//
// init i18nextJquery
//
i18nextJquery.init(i18next, $, {
tName: "t", // --> appends $.t = i18next.t
i18nName: "i18n", // --> appends $.i18n = i18next
handleName: "localize", // --> appends $(selector).localize(opts);
selectorAttr: "data-i18n", // selector for translating elements
targetAttr: "data-i18n-target", // element attribute to grab target element to translate (if diffrent then itself)
parseDefaultValueFromContent: true // parses default values from content ele.val or ele.text
});

// global onRendered event finds and replaces
// data-i18n attributes in html/template source.
// uses methods from i18nextJquery
Template.onRendered(function () {
this.autorun((function () {
return function () {
i18nextDep.depend();
$elements = $("[data-i18n]").localize();
};
})(this));
});

export default i18next;
Loading

0 comments on commit 8c0b726

Please sign in to comment.