diff --git a/.bithoundrc b/.bithoundrc
new file mode 100644
index 00000000000..3986566a291
--- /dev/null
+++ b/.bithoundrc
@@ -0,0 +1,76 @@
+{
+ "ignore": [
+ "**/deps/**",
+ "**/node_modules/**",
+ "**/thirdparty/**",
+ "**/third_party/**",
+ "**/vendor/**",
+ "**/**-min-**",
+ "**/**-min.**",
+ "**/**.min.**",
+ "**/**jquery.?(ui|effects)-*.*.?(*).?(cs|j)s",
+ "**/**jquery-*.*.?(*).?(cs|j)s",
+ "**/prototype?(*).js",
+ "**/mootools*.*.*.js",
+ "**/dojo.js",
+ "**/MochiKit.js",
+ "**/yahoo-*.js",
+ "**/yui*.js",
+ "**/ckeditor*.js",
+ "**/tiny_mce*.js",
+ "**/tiny_mce/?(langs|plugins|themes|utils)/**",
+ "**/MathJax/**",
+ "**/shBrush*.js",
+ "**/shCore.js",
+ "**/shLegacy.js",
+ "**/modernizr.custom.?(*).js",
+ "**/knockout-*.*.*.debug.js",
+ "**/extjs/*.js",
+ "**/extjs/*.xml",
+ "**/extjs/*.txt",
+ "**/extjs/*.html",
+ "**/extjs/*.properties",
+ "**/extjs/.sencha",
+ "**/extjs/docs/**",
+ "**/extjs/builds/**",
+ "**/extjs/cmd/**",
+ "**/extjs/examples/**",
+ "**/extjs/locale/**",
+ "**/extjs/packages/**",
+ "**/extjs/plugins/**",
+ "**/extjs/resources/**",
+ "**/extjs/src/**",
+ "**/extjs/welcome/**",
+ "bower_components/**"
+ ],
+ "test": [
+ "**/test/**",
+ "**/tests/**",
+ "**/spec/**",
+ "**/specs/**",
+ "**/**.app-test.**"
+ ],
+ "critics": {
+ "wc": {"limit": 5000},
+ "lint": {"engine": "eslint"}
+ },
+ "dependencies": {
+ "mute": [
+ "wdio-mocha-framework"
+ ],
+ "unused-ignores": [
+ "jquery",
+ "sweetalert2",
+ "font-awesome",
+ "bcrypt",
+ "react-addons-pure-render-mixin",
+ "url",
+ "griddle-react",
+ "tether-tooltip",
+ "react-textarea-autosize",
+ "react-color",
+ "react-autosuggest",
+ "meteor-node-stubs"
+ ]
+ }
+}
diff --git a/.codeclimate.yml b/.codeclimate.yml
index 1d9b1639232..438fa8df732 100644
--- a/.codeclimate.yml
+++ b/.codeclimate.yml
@@ -6,18 +6,17 @@ exclude_paths:
- ".codeclimate.yml"
engines:
eslint:
- enabled: true
- channel: "eslint-2"
+ enabled: false
csslint:
enabled: false
duplication:
- enabled: true
+ enabled: false
config:
languages:
javascript:
mass_threshold: 150
fixme:
- enabled: true
+ enabled: false
config:
strings:
- FIXME
diff --git a/.eslintignore b/.eslintignore
index ca441ef1b09..c218494866f 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1 +1,5 @@
+# things to ignore in lint
+
*.min.*
+server/plugins.js
+client/plugins.js
diff --git a/.eslintrc b/.eslintrc
index 997b9dd6a02..361695d2172 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,5 +1,5 @@
{
- "parser": "babel-eslint", // for support of spread operator
+ "parser": "babel-eslint", // now for the support of allowImportExportEverywhere
"env": {
"browser": true,
"node": true,
@@ -7,7 +7,8 @@
},
"parserOptions": {
"ecmaVersion": 6,
- "sourceType": "module"
+ "sourceType": "module",
+ "allowImportExportEverywhere": true
},
"plugins": ["react"],
"ecmaFeatures": {
@@ -28,14 +29,14 @@
"templateStrings": true,
"jsx": true
},
- // NOTE: This is ESLINT v1 syntax because Code Climate v2 seg faults.
+ // NOTE: We're now using eslint-3
"rules": {
/**
* Strict mode
* babel inserts "use strict"; for us
* http://eslint.org/docs/rules/strict
*/
- "strict": [2, "never"],
+ "strict": 0,
/**
* ES6
@@ -83,7 +84,7 @@
* JSX / React
*/
"jsx-quotes": [2, "prefer-double"], // http://eslint.org/docs/rules/jsx-quotes
- /*"react/no-deprecated": 1,*/
+ "react/no-deprecated": 1,
"react/display-name": 1,
"react/forbid-prop-types": 1,
"react/jsx-boolean-value": [1, "always"],
@@ -93,11 +94,11 @@
"react/jsx-max-props-per-line": [1, {
"maximum": 4
}],
- /*"react/jsx-no-bind": 1,*/
+ "react/jsx-no-bind": 1,
"react/jsx-no-duplicate-props": 1,
"react/jsx-no-literals": 1,
"react/jsx-no-undef": 1,
- "react/jsx-sort-prop-types": 1,
+ "react/sort-prop-types": 1,
"react/jsx-sort-props": 1,
"react/jsx-uses-react": 1,
"react/jsx-uses-vars": 1,
@@ -111,15 +112,16 @@
"react/prefer-es6-class": 1,
"react/prop-types": 1,
"react/react-in-jsx-scope": 0,
- "react/require-extension": 1,
+ "react/require-extension": "off",
"react/self-closing-comp": 1,
"react/sort-comp": 1,
- "react/wrap-multilines": 1,
/**
* Best practices
*/
- "consistent-return": 2, // http://eslint.org/docs/rules/consistent-return
+ "consistent-return": [1, { // http://eslint.org/docs/rules/consistent-return
+ "treatUndefinedAsUnspecified": false
+ }],
"curly": [2, "multi-line"], // http://eslint.org/docs/rules/curly
"default-case": 2, // http://eslint.org/docs/rules/default-case
"dot-notation": [2, { // http://eslint.org/docs/rules/dot-notation
@@ -127,6 +129,10 @@
}],
"eqeqeq": 2, // http://eslint.org/docs/rules/eqeqeq
"guard-for-in": 2, // http://eslint.org/docs/rules/guard-for-in
+ "prefer-const": [1, {
+ "destructuring": "any",
+ "ignoreReadBeforeAssign": false
+ }],
"no-caller": 2, // http://eslint.org/docs/rules/no-caller
"no-else-return": 2, // http://eslint.org/docs/rules/no-else-return
"no-eq-null": 2, // http://eslint.org/docs/rules/no-eq-null
@@ -158,11 +164,11 @@
"vars-on-top": 2, // http://eslint.org/docs/rules/vars-on-top
"wrap-iife": [2, "any"], // http://eslint.org/docs/rules/wrap-iife
"yoda": 2, // http://eslint.org/docs/rules/yoda
- "max-len": [2, 160, 2, {
+ "max-len": [1, 160, 2, {
"ignoreComments": true,
"ignoreUrls": true
}], // http://eslint.org/docs/rules/max-len
- "valid-jsdoc": 2, // http://eslint.org/docs/rules/valid-jsdoc
+ "valid-jsdoc": 1, // http://eslint.org/docs/rules/valid-jsdoc
"quote-props": [2, "consistent-as-needed"], // http://eslint.org/docs/rules/quote-props
/**
* Style
diff --git a/.gitignore b/.gitignore
index f364c229162..15517295466 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,3 +36,5 @@ private/custom/*
imports/plugins/custom/*
!imports/plugins/custom/.gitkeep
+
+.reaction/config.json
diff --git a/.meteor/.finished-upgraders b/.meteor/.finished-upgraders
index 3e712bc5a9f..a541808f2b3 100644
--- a/.meteor/.finished-upgraders
+++ b/.meteor/.finished-upgraders
@@ -13,3 +13,4 @@ notices-for-facebook-graph-api-2
1.3.0-split-minifiers-package
1.3.5-remove-old-dev-bundle-link
1.4.0-remove-old-dev-bundle-link
+1.4.1-add-shell-server-package
diff --git a/.meteor/packages b/.meteor/packages
index 3b6f05b393a..39f932d0f4c 100644
--- a/.meteor/packages
+++ b/.meteor/packages
@@ -10,38 +10,39 @@
meteor-base@1.0.4 # Packages every Meteor app needs to have
mobile-experience@1.0.4 # Packages for a great mobile UX
blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views
-es5-shim@4.6.13 # ECMAScript 5 compatibility for older browsers.
-ecmascript@0.5.7 # Enable ECMAScript2015+ syntax in app code
+es5-shim@4.6.14 # ECMAScript 5 compatibility for older browsers.
+ecmascript@0.5.8 # Enable ECMAScript2015+ syntax in app code
audit-argument-checks@1.0.7 # ensure meteor method argument validation
browser-policy@1.0.9 # security-related policies enforced by newer browsers
juliancwirko:postcss # CSS post-processing plugin (replaces standard-minifier-css)
-standard-minifier-js@1.1.8 # a minifier plugin used for Meteor apps by default
+standard-minifier-js@1.2.0 # a minifier plugin used for Meteor apps by default
session@1.1.6 # ReactiveDict whose contents are preserved across Hot Code Push
tracker@1.1.0 # Meteor transparent reactive programming library
-mongo@1.1.10
+mongo@1.1.11
random@1.0.10
reactive-var@1.0.10
reactive-dict@1.1.8
check@1.2.3
-http@1.2.8
+http@1.2.9
ddp-rate-limiter@1.0.5
underscore@1.0.9
-logging@1.1.14
+logging@1.1.15
reload@1.1.10
ejson@1.0.12
-less@2.7.4
-email@1.1.16
+less@2.7.5
+email@1.1.17
service-configuration@1.0.10
amplify
mdg:validated-method
+shell-server
# Meteor Auth Packages
-accounts-base@1.2.9
-accounts-password@1.2.12
+accounts-base@1.2.11
+accounts-password@1.3.0
accounts-facebook@1.0.10
accounts-google@1.0.10
accounts-twitter@1.1.11
-oauth-encryption@1.1.13
+oauth-encryption@1.2.0
# accounts-github
# accounts-weibo
# accounts-oauth
diff --git a/.meteor/release b/.meteor/release
index c85944c1dba..30b2c590e30 100644
--- a/.meteor/release
+++ b/.meteor/release
@@ -1 +1 @@
-METEOR@1.4.0.1
+METEOR@1.4.1
diff --git a/.meteor/versions b/.meteor/versions
index 05273e8a078..f20f1d612e4 100644
--- a/.meteor/versions
+++ b/.meteor/versions
@@ -1,8 +1,8 @@
-accounts-base@1.2.10
+accounts-base@1.2.11
accounts-facebook@1.0.10
accounts-google@1.0.10
accounts-oauth@1.1.13
-accounts-password@1.2.14
+accounts-password@1.3.0
accounts-twitter@1.1.11
alanning:roles@1.2.15
aldeed:autoform@5.8.1
@@ -16,8 +16,8 @@ allow-deny@1.0.5
amplify@1.0.0
audit-argument-checks@1.0.7
autoupdate@1.3.11
-babel-compiler@6.9.0
-babel-runtime@0.1.10
+babel-compiler@6.9.1
+babel-runtime@0.1.11
base64@1.0.9
binary-heap@1.0.9
blaze@2.1.8
@@ -28,7 +28,7 @@ browser-policy@1.0.9
browser-policy-common@1.0.10
browser-policy-content@1.0.11
browser-policy-framing@1.0.11
-caching-compiler@1.1.6
+caching-compiler@1.1.7
caching-html-compiler@1.0.6
callback-hook@1.0.9
cfs:access-point@0.1.49
@@ -53,29 +53,29 @@ cfs:upload-http@0.0.20
cfs:worker@0.1.4
check@1.2.3
chuangbo:cookie@1.1.0
-coffeescript@1.2.3
+coffeescript@1.2.4
dburles:factory@1.1.0
ddp@1.2.5
-ddp-client@1.3.0
+ddp-client@1.3.1
ddp-common@1.2.6
ddp-rate-limiter@1.0.5
-ddp-server@1.3.9
+ddp-server@1.3.10
deps@1.0.12
diff-sequence@1.0.6
dispatch:mocha@0.0.9
-ecmascript@0.5.7
-ecmascript-runtime@0.3.13
+ecmascript@0.5.8
+ecmascript-runtime@0.3.14
ejson@1.0.12
-email@1.1.16
-es5-shim@4.6.13
-facebook@1.2.8
+email@1.1.17
+es5-shim@4.6.14
+facebook@1.2.9
fastclick@1.0.12
geojson-utils@1.0.9
-google@1.1.13
+google@1.1.14
hot-code-push@1.0.4
html-tools@1.0.10
htmljs@1.0.10
-http@1.2.8
+http@1.2.9
id-map@1.0.8
jeremy:stripe@1.6.0
jparker:crypto-core@0.1.0
@@ -89,35 +89,35 @@ kadira:blaze-layout@2.3.0
kadira:dochead@1.5.0
kadira:flow-router-ssr@3.13.0
launch-screen@1.0.12
-less@2.7.4
+less@2.7.5
livedata@1.0.18
localstorage@1.0.11
-logging@1.1.14
-matb33:collection-hooks@0.8.3
+logging@1.1.15
+matb33:collection-hooks@0.8.4
mdg:validated-method@1.1.0
mdg:validation-error@0.5.1
-meteor@1.2.16
+meteor@1.2.17
meteor-base@1.0.4
-meteorhacks:fast-render@2.14.0
+meteorhacks:fast-render@2.16.0
meteorhacks:inject-data@2.0.0
meteorhacks:meteorx@1.4.1
meteorhacks:picker@1.0.3
meteorhacks:ssr@2.2.0
meteorhacks:subs-manager@1.6.4
-minifier-css@1.2.13
-minifier-js@1.2.13
+minifier-css@1.2.14
+minifier-js@1.2.14
minimongo@1.0.17
mobile-experience@1.0.4
mobile-status-bar@1.0.12
-modules@0.7.5
-modules-runtime@0.7.5
+modules@0.7.6
+modules-runtime@0.7.6
momentjs:moment@2.14.4
-mongo@1.1.10
+mongo@1.1.11
mongo-id@1.0.5
mongo-livedata@1.0.12
mrt:later@1.6.1
-npm-bcrypt@0.8.7_1
-npm-mongo@1.5.45
+npm-bcrypt@0.9.1
+npm-mongo@1.5.46
oauth@1.1.11
oauth-encryption@1.2.0
oauth1@1.1.10
@@ -128,7 +128,7 @@ ordered-dict@1.0.8
practicalmeteor:chai@2.1.0_1
practicalmeteor:mocha-core@1.0.1
practicalmeteor:sinon@1.14.1_2
-promise@0.8.3
+promise@0.8.4
raix:eventemitter@0.1.3
raix:ui-dropped-event@0.0.7
random@1.0.10
@@ -143,11 +143,12 @@ routepolicy@1.0.11
service-configuration@1.0.10
session@1.1.6
sha@1.0.8
+shell-server@0.2.1
spacebars@1.0.12
spacebars-compiler@1.0.12
srp@1.0.9
-standard-minifier-js@1.1.8
-templating@1.2.13
+standard-minifier-js@1.2.0
+templating@1.2.14
templating-tools@1.0.4
tmeasday:check-npm-versions@0.3.1
tmeasday:publish-counts@0.7.3
@@ -157,5 +158,5 @@ ui@1.0.11
underscore@1.0.9
url@1.0.10
vsivsi:job-collection@1.4.0
-webapp@1.3.10
+webapp@1.3.11
webapp-hashing@1.0.9
diff --git a/README.md b/README.md
index 2ca04c6a8bd..1edb4a1e50e 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-# Reaction [![Circle CI](https://circleci.com/gh/reactioncommerce/reaction.svg?style=svg)](https://circleci.com/gh/reactioncommerce/reaction) [![Code Climate](https://codeclimate.com/github/reactioncommerce/reaction/badges/gpa.svg)](https://codeclimate.com/github/reactioncommerce/reaction) [![bitHound Code](https://www.bithound.io/github/reactioncommerce/reaction/badges/code.svg)](https://www.bithound.io/github/reactioncommerce/reaction)
+# Reaction
-[![Gitter](https://badges.gitter.im/JoinChat.svg)](https://gitter.im/reactioncommerce/reaction?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+[![bitHound Overall Score](https://www.bithound.io/github/reactioncommerce/reaction/badges/score.svg)](https://www.bithound.io/github/reactioncommerce/reaction) [![bitHound Dev Dependencies](https://www.bithound.io/github/reactioncommerce/reaction/badges/devDependencies.svg)](https://www.bithound.io/github/reactioncommerce/reaction/9a858eb459d7260d5ae59124c2b364bc791a3e70/dependencies/npm) [![bitHound Code](https://www.bithound.io/github/reactioncommerce/reaction/badges/code.svg)](https://www.bithound.io/github/reactioncommerce/reaction) [![Code Climate](https://codeclimate.com/github/reactioncommerce/reaction/badges/gpa.svg)](https://codeclimate.com/github/reactioncommerce/reaction) [![Circle CI](https://circleci.com/gh/reactioncommerce/reaction.svg?style=svg)](https://circleci.com/gh/reactioncommerce/reaction) [![Gitter](https://badges.gitter.im/JoinChat.svg)](https://gitter.im/reactioncommerce/reaction?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Reaction is a modern reactive, real-time event driven ecommerce platform.
@@ -13,6 +13,8 @@ Reaction is built with JavaScript (ES6), Meteor, Node.js and works nicely with D
```bash
npm install -g reaction-cli
reaction init
+cd reaction
+reaction
```
> **reaction-cli** requires a recent version of [npm](https://www.npmjs.com/).
@@ -28,8 +30,6 @@ n stable
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).
-_Note: When using a standalone MongoDB server, make sure you are using version 2.6 or later._
-
## Docs
Installation, configuration and development documentation is available on [docs.reactioncommerce.com](https://docs.reactioncommerce.com/)
diff --git a/client/jquery-ui.css b/client/jquery-ui.css
deleted file mode 100644
index 18d36c75a61..00000000000
--- a/client/jquery-ui.css
+++ /dev/null
@@ -1,955 +0,0 @@
-/*! jQuery UI - v1.10.3 - 2013-12-08
-* http://jqueryui.com
-* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.theme.css
-* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Helvetica%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=2px&bgColorHeader=dddddd&bgTextureHeader=highlight_soft&bgImgOpacityHeader=50&borderColorHeader=dddddd&fcHeader=444444&iconColorHeader=0073ea&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=dddddd&fcContent=444444&iconColorContent=ff0084&bgColorDefault=f6f6f6&bgTextureDefault=highlight_soft&bgImgOpacityDefault=100&borderColorDefault=dddddd&fcDefault=0073ea&iconColorDefault=666666&bgColorHover=0073ea&bgTextureHover=highlight_soft&bgImgOpacityHover=25&borderColorHover=0073ea&fcHover=ffffff&iconColorHover=ffffff&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=dddddd&fcActive=ff0084&iconColorActive=454545&bgColorHighlight=ffffff&bgTextureHighlight=flat&bgImgOpacityHighlight=55&borderColorHighlight=cccccc&fcHighlight=444444&iconColorHighlight=0073ea&bgColorError=ffffff&bgTextureError=flat&bgImgOpacityError=55&borderColorError=ff0084&fcError=222222&iconColorError=ff0084&bgColorOverlay=eeeeee&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=80&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=60&thicknessShadow=4px&offsetTopShadow=-4px&offsetLeftShadow=-4px&cornerRadiusShadow=0px
-* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
-
-/* Layout helpers
-----------------------------------*/
-.ui-helper-hidden {
- display: none;
-}
-.ui-helper-hidden-accessible {
- border: 0;
- clip: rect(0 0 0 0);
- height: 1px;
- margin: -1px;
- overflow: hidden;
- padding: 0;
- position: absolute;
- width: 1px;
-}
-.ui-helper-reset {
- margin: 0;
- padding: 0;
- border: 0;
- outline: 0;
- line-height: 1.3;
- text-decoration: none;
- font-size: 100%;
- list-style: none;
-}
-.ui-helper-clearfix:before,
-.ui-helper-clearfix:after {
- content: "";
- display: table;
- border-collapse: collapse;
-}
-.ui-helper-clearfix:after {
- clear: both;
-}
-.ui-helper-clearfix {
- min-height: 0; /* support: IE7 */
-}
-.ui-helper-zfix {
- width: 100%;
- height: 100%;
- top: 0;
- left: 0;
- position: absolute;
- opacity: 0;
- filter:Alpha(Opacity=0);
-}
-
-.ui-front {
- z-index: 100;
-}
-
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-disabled {
- cursor: default !important;
-}
-
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon {
- display: block;
- text-indent: -99999px;
- overflow: hidden;
- background-repeat: no-repeat;
-}
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
-}
-.ui-resizable {
- position: relative;
-}
-.ui-resizable-handle {
- position: absolute;
- font-size: 0.1px;
- display: block;
-}
-.ui-resizable-disabled .ui-resizable-handle,
-.ui-resizable-autohide .ui-resizable-handle {
- display: none;
-}
-.ui-resizable-n {
- cursor: n-resize;
- height: 7px;
- width: 100%;
- top: -5px;
- left: 0;
-}
-.ui-resizable-s {
- cursor: s-resize;
- height: 7px;
- width: 100%;
- bottom: -5px;
- left: 0;
-}
-.ui-resizable-e {
- cursor: e-resize;
- width: 7px;
- right: -5px;
- top: 0;
- height: 100%;
-}
-.ui-resizable-w {
- cursor: w-resize;
- width: 7px;
- left: -5px;
- top: 0;
- height: 100%;
-}
-.ui-resizable-se {
- cursor: se-resize;
- width: 12px;
- height: 12px;
- right: 1px;
- bottom: 1px;
-}
-.ui-resizable-sw {
- cursor: sw-resize;
- width: 9px;
- height: 9px;
- left: -5px;
- bottom: -5px;
-}
-.ui-resizable-nw {
- cursor: nw-resize;
- width: 9px;
- height: 9px;
- left: -5px;
- top: -5px;
-}
-.ui-resizable-ne {
- cursor: ne-resize;
- width: 9px;
- height: 9px;
- right: -5px;
- top: -5px;
-}
-.ui-autocomplete {
- position: absolute;
- top: 0;
- left: 0;
- cursor: default;
-}
-.ui-button {
- display: inline-block;
- position: relative;
- padding: 0;
- line-height: normal;
- margin-right: .1em;
- cursor: pointer;
- vertical-align: middle;
- text-align: center;
- overflow: visible; /* removes extra width in IE */
-}
-.ui-button,
-.ui-button:link,
-.ui-button:visited,
-.ui-button:hover,
-.ui-button:active {
- text-decoration: none;
-}
-/* to make room for the icon, a width needs to be set here */
-.ui-button-icon-only {
- width: 2.2em;
-}
-/* button elements seem to need a little more width */
-button.ui-button-icon-only {
- width: 2.4em;
-}
-.ui-button-icons-only {
- width: 3.4em;
-}
-button.ui-button-icons-only {
- width: 3.7em;
-}
-
-/* button text element */
-.ui-button .ui-button-text {
- display: block;
- line-height: normal;
-}
-.ui-button-text-only .ui-button-text {
- padding: .4em 1em;
-}
-.ui-button-icon-only .ui-button-text,
-.ui-button-icons-only .ui-button-text {
- padding: .4em;
- text-indent: -9999999px;
-}
-.ui-button-text-icon-primary .ui-button-text,
-.ui-button-text-icons .ui-button-text {
- padding: .4em 1em .4em 2.1em;
-}
-.ui-button-text-icon-secondary .ui-button-text,
-.ui-button-text-icons .ui-button-text {
- padding: .4em 2.1em .4em 1em;
-}
-.ui-button-text-icons .ui-button-text {
- padding-left: 2.1em;
- padding-right: 2.1em;
-}
-/* no icon support for input elements, provide padding by default */
-input.ui-button {
- padding: .4em 1em;
-}
-
-/* button icon element(s) */
-.ui-button-icon-only .ui-icon,
-.ui-button-text-icon-primary .ui-icon,
-.ui-button-text-icon-secondary .ui-icon,
-.ui-button-text-icons .ui-icon,
-.ui-button-icons-only .ui-icon {
- position: absolute;
- top: 50%;
- margin-top: -8px;
-}
-.ui-button-icon-only .ui-icon {
- left: 50%;
- margin-left: -8px;
-}
-.ui-button-text-icon-primary .ui-button-icon-primary,
-.ui-button-text-icons .ui-button-icon-primary,
-.ui-button-icons-only .ui-button-icon-primary {
- left: .5em;
-}
-.ui-button-text-icon-secondary .ui-button-icon-secondary,
-.ui-button-text-icons .ui-button-icon-secondary,
-.ui-button-icons-only .ui-button-icon-secondary {
- right: .5em;
-}
-
-/* button sets */
-.ui-buttonset {
- margin-right: 7px;
-}
-.ui-buttonset .ui-button {
- margin-left: 0;
- margin-right: -.3em;
-}
-
-/* workarounds */
-/* reset extra padding in Firefox, see h5bp.com/l */
-input.ui-button::-moz-focus-inner,
-button.ui-button::-moz-focus-inner {
- border: 0;
- padding: 0;
-}
-.ui-datepicker {
- width: 17em;
- padding: .2em .2em 0;
- display: none;
-}
-.ui-datepicker .ui-datepicker-header {
- position: relative;
- padding: .2em 0;
-}
-.ui-datepicker .ui-datepicker-prev,
-.ui-datepicker .ui-datepicker-next {
- position: absolute;
- top: 2px;
- width: 1.8em;
- height: 1.8em;
-}
-.ui-datepicker .ui-datepicker-prev-hover,
-.ui-datepicker .ui-datepicker-next-hover {
- top: 1px;
-}
-.ui-datepicker .ui-datepicker-prev {
- left: 2px;
-}
-.ui-datepicker .ui-datepicker-next {
- right: 2px;
-}
-.ui-datepicker .ui-datepicker-prev-hover {
- left: 1px;
-}
-.ui-datepicker .ui-datepicker-next-hover {
- right: 1px;
-}
-.ui-datepicker .ui-datepicker-prev span,
-.ui-datepicker .ui-datepicker-next span {
- display: block;
- position: absolute;
- left: 50%;
- margin-left: -8px;
- top: 50%;
- margin-top: -8px;
-}
-.ui-datepicker .ui-datepicker-title {
- margin: 0 2.3em;
- line-height: 1.8em;
- text-align: center;
-}
-.ui-datepicker .ui-datepicker-title select {
- font-size: 1em;
- margin: 1px 0;
-}
-.ui-datepicker select.ui-datepicker-month-year {
- width: 100%;
-}
-.ui-datepicker select.ui-datepicker-month,
-.ui-datepicker select.ui-datepicker-year {
- width: 49%;
-}
-.ui-datepicker table {
- width: 100%;
- font-size: .9em;
- border-collapse: collapse;
- margin: 0 0 .4em;
-}
-.ui-datepicker th {
- padding: .7em .3em;
- text-align: center;
- font-weight: bold;
- border: 0;
-}
-.ui-datepicker td {
- border: 0;
- padding: 1px;
-}
-.ui-datepicker td span,
-.ui-datepicker td a {
- display: block;
- padding: .2em;
- text-align: right;
- text-decoration: none;
-}
-.ui-datepicker .ui-datepicker-buttonpane {
- background-image: none;
- margin: .7em 0 0 0;
- padding: 0 .2em;
- border-left: 0;
- border-right: 0;
- border-bottom: 0;
-}
-.ui-datepicker .ui-datepicker-buttonpane button {
- float: right;
- margin: .5em .2em .4em;
- cursor: pointer;
- padding: .2em .6em .3em .6em;
- width: auto;
- overflow: visible;
-}
-.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
- float: left;
-}
-
-/* with multiple calendars */
-.ui-datepicker.ui-datepicker-multi {
- width: auto;
-}
-.ui-datepicker-multi .ui-datepicker-group {
- float: left;
-}
-.ui-datepicker-multi .ui-datepicker-group table {
- width: 95%;
- margin: 0 auto .4em;
-}
-.ui-datepicker-multi-2 .ui-datepicker-group {
- width: 50%;
-}
-.ui-datepicker-multi-3 .ui-datepicker-group {
- width: 33.3%;
-}
-.ui-datepicker-multi-4 .ui-datepicker-group {
- width: 25%;
-}
-.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
-.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
- border-left-width: 0;
-}
-.ui-datepicker-multi .ui-datepicker-buttonpane {
- clear: left;
-}
-.ui-datepicker-row-break {
- clear: both;
- width: 100%;
- font-size: 0;
-}
-
-/* RTL support */
-.ui-datepicker-rtl {
- direction: rtl;
-}
-.ui-datepicker-rtl .ui-datepicker-prev {
- right: 2px;
- left: auto;
-}
-.ui-datepicker-rtl .ui-datepicker-next {
- left: 2px;
- right: auto;
-}
-.ui-datepicker-rtl .ui-datepicker-prev:hover {
- right: 1px;
- left: auto;
-}
-.ui-datepicker-rtl .ui-datepicker-next:hover {
- left: 1px;
- right: auto;
-}
-.ui-datepicker-rtl .ui-datepicker-buttonpane {
- clear: right;
-}
-.ui-datepicker-rtl .ui-datepicker-buttonpane button {
- float: left;
-}
-.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
-.ui-datepicker-rtl .ui-datepicker-group {
- float: right;
-}
-.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
-.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
- border-right-width: 0;
- border-left-width: 1px;
-}
-.ui-dialog {
- position: absolute;
- top: 0;
- left: 0;
- padding: .2em;
- outline: 0;
-}
-.ui-dialog .ui-dialog-titlebar {
- padding: .4em 1em;
- position: relative;
-}
-.ui-dialog .ui-dialog-title {
- float: left;
- margin: .1em 0;
- white-space: nowrap;
- width: 90%;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-.ui-dialog .ui-dialog-titlebar-close {
- position: absolute;
- right: .3em;
- top: 50%;
- width: 21px;
- margin: -10px 0 0 0;
- padding: 1px;
- height: 20px;
-}
-.ui-dialog .ui-dialog-content {
- position: relative;
- border: 0;
- padding: .5em 1em;
- background: none;
- overflow: auto;
-}
-.ui-dialog .ui-dialog-buttonpane {
- text-align: left;
- border-width: 1px 0 0 0;
- background-image: none;
- margin-top: .5em;
- padding: .3em 1em .5em .4em;
-}
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
- float: right;
-}
-.ui-dialog .ui-dialog-buttonpane button {
- margin: .5em .4em .5em 0;
- cursor: pointer;
-}
-.ui-dialog .ui-resizable-se {
- width: 12px;
- height: 12px;
- right: -5px;
- bottom: -5px;
- background-position: 16px 16px;
-}
-.ui-draggable .ui-dialog-titlebar {
- cursor: move;
-}
-.ui-menu {
- list-style: none;
- padding: 2px;
- margin: 0;
- display: block;
- outline: none;
-}
-.ui-menu .ui-menu {
- margin-top: -3px;
- position: absolute;
-}
-.ui-menu .ui-menu-item {
- margin: 0;
- padding: 0;
- width: 100%;
- /* support: IE10, see #8844 */
- list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);
-}
-.ui-menu .ui-menu-divider {
- margin: 5px -2px 5px -2px;
- height: 0;
- font-size: 0;
- line-height: 0;
- border-width: 1px 0 0 0;
-}
-.ui-menu .ui-menu-item a {
- text-decoration: none;
- display: block;
- padding: 2px .4em;
- line-height: 1.5;
- min-height: 0; /* support: IE7 */
- font-weight: normal;
-}
-.ui-menu .ui-menu-item a.ui-state-focus,
-.ui-menu .ui-menu-item a.ui-state-active {
- font-weight: normal;
- margin: -1px;
-}
-
-.ui-menu .ui-state-disabled {
- font-weight: normal;
- margin: .4em 0 .2em;
- line-height: 1.5;
-}
-.ui-menu .ui-state-disabled a {
- cursor: default;
-}
-
-/* icon support */
-.ui-menu-icons {
- position: relative;
-}
-.ui-menu-icons .ui-menu-item a {
- position: relative;
- padding-left: 2em;
-}
-
-/* left-aligned */
-.ui-menu .ui-icon {
- position: absolute;
- top: .2em;
- left: .2em;
-}
-
-/* right-aligned */
-.ui-menu .ui-menu-icon {
- position: static;
- float: right;
-}
-
-/* Component containers
-----------------------------------*/
-.ui-widget {
- font-family: Helvetica,Arial,sans-serif;
- font-size: 1.1em;
-}
-.ui-widget .ui-widget {
- font-size: 1em;
-}
-.ui-widget input,
-.ui-widget select,
-.ui-widget textarea,
-.ui-widget button {
- font-family: Helvetica,Arial,sans-serif;
- font-size: 1em;
-}
-.ui-widget-content {
- border: 1px solid #dddddd;
- background: #ffffff url(/images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
- color: #444444;
-}
-.ui-widget-content a {
- color: #444444;
-}
-.ui-widget-header {
- border: 1px solid #dddddd;
- background: #dddddd url(/images/ui-bg_highlight-soft_50_dddddd_1x100.png) 50% 50% repeat-x;
- color: #444444;
- font-weight: bold;
-}
-.ui-widget-header a {
- color: #444444;
-}
-
-/* Interaction states
-----------------------------------*/
-.ui-state-default,
-.ui-widget-content .ui-state-default,
-.ui-widget-header .ui-state-default {
- border: 1px solid #dddddd;
- background: #f6f6f6 url(/images/ui-bg_highlight-soft_100_f6f6f6_1x100.png) 50% 50% repeat-x;
- font-weight: bold;
- color: #0073ea;
-}
-.ui-state-default a,
-.ui-state-default a:link,
-.ui-state-default a:visited {
- color: #0073ea;
- text-decoration: none;
-}
-.ui-state-hover,
-.ui-widget-content .ui-state-hover,
-.ui-widget-header .ui-state-hover,
-.ui-state-focus,
-.ui-widget-content .ui-state-focus,
-.ui-widget-header .ui-state-focus {
- border: 1px solid #0073ea;
- background: #0073ea url(/images/ui-bg_highlight-soft_25_0073ea_1x100.png) 50% 50% repeat-x;
- font-weight: bold;
- color: #ffffff;
-}
-.ui-state-hover a,
-.ui-state-hover a:hover,
-.ui-state-hover a:link,
-.ui-state-hover a:visited {
- color: #ffffff;
- text-decoration: none;
-}
-.ui-state-active,
-.ui-widget-content .ui-state-active,
-.ui-widget-header .ui-state-active {
- border: 1px solid #dddddd;
- background: #ffffff url(/images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
- font-weight: bold;
- color: #ff0084;
-}
-.ui-state-active a,
-.ui-state-active a:link,
-.ui-state-active a:visited {
- color: #ff0084;
- text-decoration: none;
-}
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-highlight,
-.ui-widget-content .ui-state-highlight,
-.ui-widget-header .ui-state-highlight {
- border: 1px solid #cccccc;
- background: #ffffff url(/images/ui-bg_flat_55_ffffff_40x100.png) 50% 50% repeat-x;
- color: #444444;
-}
-.ui-state-highlight a,
-.ui-widget-content .ui-state-highlight a,
-.ui-widget-header .ui-state-highlight a {
- color: #444444;
-}
-.ui-state-error,
-.ui-widget-content .ui-state-error,
-.ui-widget-header .ui-state-error {
- border: 1px solid #ff0084;
- background: #ffffff url(/images/ui-bg_flat_55_ffffff_40x100.png) 50% 50% repeat-x;
- color: #222222;
-}
-.ui-state-error a,
-.ui-widget-content .ui-state-error a,
-.ui-widget-header .ui-state-error a {
- color: #222222;
-}
-.ui-state-error-text,
-.ui-widget-content .ui-state-error-text,
-.ui-widget-header .ui-state-error-text {
- color: #222222;
-}
-.ui-priority-primary,
-.ui-widget-content .ui-priority-primary,
-.ui-widget-header .ui-priority-primary {
- font-weight: bold;
-}
-.ui-priority-secondary,
-.ui-widget-content .ui-priority-secondary,
-.ui-widget-header .ui-priority-secondary {
- opacity: .7;
- filter:Alpha(Opacity=70);
- font-weight: normal;
-}
-.ui-state-disabled,
-.ui-widget-content .ui-state-disabled,
-.ui-widget-header .ui-state-disabled {
- opacity: .35;
- filter:Alpha(Opacity=35);
- background-image: none;
-}
-.ui-state-disabled .ui-icon {
- filter:Alpha(Opacity=35); /* For IE8 - See #6059 */
-}
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon {
- width: 16px;
- height: 16px;
-}
-.ui-icon,
-.ui-widget-content .ui-icon {
- background-image: url(/images/ui-icons_ff0084_256x240.png);
-}
-.ui-widget-header .ui-icon {
- background-image: url(/images/ui-icons_0073ea_256x240.png);
-}
-.ui-state-default .ui-icon {
- background-image: url(/images/ui-icons_666666_256x240.png);
-}
-.ui-state-hover .ui-icon,
-.ui-state-focus .ui-icon {
- background-image: url(/images/ui-icons_ffffff_256x240.png);
-}
-.ui-state-active .ui-icon {
- background-image: url(/images/ui-icons_454545_256x240.png);
-}
-.ui-state-highlight .ui-icon {
- background-image: url(/images/ui-icons_0073ea_256x240.png);
-}
-.ui-state-error .ui-icon,
-.ui-state-error-text .ui-icon {
- background-image: url(/images/ui-icons_ff0084_256x240.png);
-}
-
-/* positioning */
-.ui-icon-blank { background-position: 16px 16px; }
-.ui-icon-carat-1-n { background-position: 0 0; }
-.ui-icon-carat-1-ne { background-position: -16px 0; }
-.ui-icon-carat-1-e { background-position: -32px 0; }
-.ui-icon-carat-1-se { background-position: -48px 0; }
-.ui-icon-carat-1-s { background-position: -64px 0; }
-.ui-icon-carat-1-sw { background-position: -80px 0; }
-.ui-icon-carat-1-w { background-position: -96px 0; }
-.ui-icon-carat-1-nw { background-position: -112px 0; }
-.ui-icon-carat-2-n-s { background-position: -128px 0; }
-.ui-icon-carat-2-e-w { background-position: -144px 0; }
-.ui-icon-triangle-1-n { background-position: 0 -16px; }
-.ui-icon-triangle-1-ne { background-position: -16px -16px; }
-.ui-icon-triangle-1-e { background-position: -32px -16px; }
-.ui-icon-triangle-1-se { background-position: -48px -16px; }
-.ui-icon-triangle-1-s { background-position: -64px -16px; }
-.ui-icon-triangle-1-sw { background-position: -80px -16px; }
-.ui-icon-triangle-1-w { background-position: -96px -16px; }
-.ui-icon-triangle-1-nw { background-position: -112px -16px; }
-.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
-.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
-.ui-icon-arrow-1-n { background-position: 0 -32px; }
-.ui-icon-arrow-1-ne { background-position: -16px -32px; }
-.ui-icon-arrow-1-e { background-position: -32px -32px; }
-.ui-icon-arrow-1-se { background-position: -48px -32px; }
-.ui-icon-arrow-1-s { background-position: -64px -32px; }
-.ui-icon-arrow-1-sw { background-position: -80px -32px; }
-.ui-icon-arrow-1-w { background-position: -96px -32px; }
-.ui-icon-arrow-1-nw { background-position: -112px -32px; }
-.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
-.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
-.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
-.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
-.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
-.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
-.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
-.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
-.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
-.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
-.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
-.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
-.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
-.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
-.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
-.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
-.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
-.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
-.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
-.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
-.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
-.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
-.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
-.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
-.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
-.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
-.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
-.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
-.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
-.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
-.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
-.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
-.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
-.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
-.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
-.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
-.ui-icon-arrow-4 { background-position: 0 -80px; }
-.ui-icon-arrow-4-diag { background-position: -16px -80px; }
-.ui-icon-extlink { background-position: -32px -80px; }
-.ui-icon-newwin { background-position: -48px -80px; }
-.ui-icon-refresh { background-position: -64px -80px; }
-.ui-icon-shuffle { background-position: -80px -80px; }
-.ui-icon-transfer-e-w { background-position: -96px -80px; }
-.ui-icon-transferthick-e-w { background-position: -112px -80px; }
-.ui-icon-folder-collapsed { background-position: 0 -96px; }
-.ui-icon-folder-open { background-position: -16px -96px; }
-.ui-icon-document { background-position: -32px -96px; }
-.ui-icon-document-b { background-position: -48px -96px; }
-.ui-icon-note { background-position: -64px -96px; }
-.ui-icon-mail-closed { background-position: -80px -96px; }
-.ui-icon-mail-open { background-position: -96px -96px; }
-.ui-icon-suitcase { background-position: -112px -96px; }
-.ui-icon-comment { background-position: -128px -96px; }
-.ui-icon-person { background-position: -144px -96px; }
-.ui-icon-print { background-position: -160px -96px; }
-.ui-icon-trash { background-position: -176px -96px; }
-.ui-icon-locked { background-position: -192px -96px; }
-.ui-icon-unlocked { background-position: -208px -96px; }
-.ui-icon-bookmark { background-position: -224px -96px; }
-.ui-icon-tag { background-position: -240px -96px; }
-.ui-icon-home { background-position: 0 -112px; }
-.ui-icon-flag { background-position: -16px -112px; }
-.ui-icon-calendar { background-position: -32px -112px; }
-.ui-icon-cart { background-position: -48px -112px; }
-.ui-icon-pencil { background-position: -64px -112px; }
-.ui-icon-clock { background-position: -80px -112px; }
-.ui-icon-disk { background-position: -96px -112px; }
-.ui-icon-calculator { background-position: -112px -112px; }
-.ui-icon-zoomin { background-position: -128px -112px; }
-.ui-icon-zoomout { background-position: -144px -112px; }
-.ui-icon-search { background-position: -160px -112px; }
-.ui-icon-wrench { background-position: -176px -112px; }
-.ui-icon-gear { background-position: -192px -112px; }
-.ui-icon-heart { background-position: -208px -112px; }
-.ui-icon-star { background-position: -224px -112px; }
-.ui-icon-link { background-position: -240px -112px; }
-.ui-icon-cancel { background-position: 0 -128px; }
-.ui-icon-plus { background-position: -16px -128px; }
-.ui-icon-plusthick { background-position: -32px -128px; }
-.ui-icon-minus { background-position: -48px -128px; }
-.ui-icon-minusthick { background-position: -64px -128px; }
-.ui-icon-close { background-position: -80px -128px; }
-.ui-icon-closethick { background-position: -96px -128px; }
-.ui-icon-key { background-position: -112px -128px; }
-.ui-icon-lightbulb { background-position: -128px -128px; }
-.ui-icon-scissors { background-position: -144px -128px; }
-.ui-icon-clipboard { background-position: -160px -128px; }
-.ui-icon-copy { background-position: -176px -128px; }
-.ui-icon-contact { background-position: -192px -128px; }
-.ui-icon-image { background-position: -208px -128px; }
-.ui-icon-video { background-position: -224px -128px; }
-.ui-icon-script { background-position: -240px -128px; }
-.ui-icon-alert { background-position: 0 -144px; }
-.ui-icon-info { background-position: -16px -144px; }
-.ui-icon-notice { background-position: -32px -144px; }
-.ui-icon-help { background-position: -48px -144px; }
-.ui-icon-check { background-position: -64px -144px; }
-.ui-icon-bullet { background-position: -80px -144px; }
-.ui-icon-radio-on { background-position: -96px -144px; }
-.ui-icon-radio-off { background-position: -112px -144px; }
-.ui-icon-pin-w { background-position: -128px -144px; }
-.ui-icon-pin-s { background-position: -144px -144px; }
-.ui-icon-play { background-position: 0 -160px; }
-.ui-icon-pause { background-position: -16px -160px; }
-.ui-icon-seek-next { background-position: -32px -160px; }
-.ui-icon-seek-prev { background-position: -48px -160px; }
-.ui-icon-seek-end { background-position: -64px -160px; }
-.ui-icon-seek-start { background-position: -80px -160px; }
-/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
-.ui-icon-seek-first { background-position: -80px -160px; }
-.ui-icon-stop { background-position: -96px -160px; }
-.ui-icon-eject { background-position: -112px -160px; }
-.ui-icon-volume-off { background-position: -128px -160px; }
-.ui-icon-volume-on { background-position: -144px -160px; }
-.ui-icon-power { background-position: 0 -176px; }
-.ui-icon-signal-diag { background-position: -16px -176px; }
-.ui-icon-signal { background-position: -32px -176px; }
-.ui-icon-battery-0 { background-position: -48px -176px; }
-.ui-icon-battery-1 { background-position: -64px -176px; }
-.ui-icon-battery-2 { background-position: -80px -176px; }
-.ui-icon-battery-3 { background-position: -96px -176px; }
-.ui-icon-circle-plus { background-position: 0 -192px; }
-.ui-icon-circle-minus { background-position: -16px -192px; }
-.ui-icon-circle-close { background-position: -32px -192px; }
-.ui-icon-circle-triangle-e { background-position: -48px -192px; }
-.ui-icon-circle-triangle-s { background-position: -64px -192px; }
-.ui-icon-circle-triangle-w { background-position: -80px -192px; }
-.ui-icon-circle-triangle-n { background-position: -96px -192px; }
-.ui-icon-circle-arrow-e { background-position: -112px -192px; }
-.ui-icon-circle-arrow-s { background-position: -128px -192px; }
-.ui-icon-circle-arrow-w { background-position: -144px -192px; }
-.ui-icon-circle-arrow-n { background-position: -160px -192px; }
-.ui-icon-circle-zoomin { background-position: -176px -192px; }
-.ui-icon-circle-zoomout { background-position: -192px -192px; }
-.ui-icon-circle-check { background-position: -208px -192px; }
-.ui-icon-circlesmall-plus { background-position: 0 -208px; }
-.ui-icon-circlesmall-minus { background-position: -16px -208px; }
-.ui-icon-circlesmall-close { background-position: -32px -208px; }
-.ui-icon-squaresmall-plus { background-position: -48px -208px; }
-.ui-icon-squaresmall-minus { background-position: -64px -208px; }
-.ui-icon-squaresmall-close { background-position: -80px -208px; }
-.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
-.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
-.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
-.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
-.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
-.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Corner radius */
-.ui-corner-all,
-.ui-corner-top,
-.ui-corner-left,
-.ui-corner-tl {
- border-top-left-radius: 2px;
-}
-.ui-corner-all,
-.ui-corner-top,
-.ui-corner-right,
-.ui-corner-tr {
- border-top-right-radius: 2px;
-}
-.ui-corner-all,
-.ui-corner-bottom,
-.ui-corner-left,
-.ui-corner-bl {
- border-bottom-left-radius: 2px;
-}
-.ui-corner-all,
-.ui-corner-bottom,
-.ui-corner-right,
-.ui-corner-br {
- border-bottom-right-radius: 2px;
-}
-
-/* Overlays */
-.ui-widget-overlay {
- background: #eeeeee url(/images/ui-bg_flat_0_eeeeee_40x100.png) 50% 50% repeat-x;
- opacity: .8;
- filter: Alpha(Opacity=80);
-}
-.ui-widget-shadow {
- margin: -4px 0 0 -4px;
- padding: 4px;
- background: #aaaaaa url(/images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
- opacity: .6;
- filter: Alpha(Opacity=60);
- border-radius: 0px;
-}
diff --git a/client/modules/accounts/helpers/templates.js b/client/modules/accounts/helpers/templates.js
index 5fe6700133d..2a53d05d986 100644
--- a/client/modules/accounts/helpers/templates.js
+++ b/client/modules/accounts/helpers/templates.js
@@ -59,18 +59,18 @@ Template.registerHelper("fName", function (displayUser) {
if (user && user.services) {
const username = (function () {
switch (false) {
- case !user.services.twitter:
- return user.services.twitter.first_name;
- case !user.services.google:
- return user.services.google.given_name;
- case !user.services.facebook:
- return user.services.facebook.first_name;
- case !user.services.instagram:
- return user.services.instagram.first_name;
- case !user.services.pinterest:
- return user.services.pinterest.first_name;
- default:
- return i18next.t("accountsUI.guest", {defaultValue: "Guest"});
+ case !user.services.twitter:
+ return user.services.twitter.first_name;
+ case !user.services.google:
+ return user.services.google.given_name;
+ case !user.services.facebook:
+ return user.services.facebook.first_name;
+ case !user.services.instagram:
+ return user.services.instagram.first_name;
+ case !user.services.pinterest:
+ return user.services.pinterest.first_name;
+ default:
+ return i18next.t("accountsUI.guest", {defaultValue: "Guest"});
}
})();
return username;
diff --git a/client/modules/accounts/templates/addressBook/add/add.js b/client/modules/accounts/templates/addressBook/add/add.js
index 88ca8c36578..27750701db0 100644
--- a/client/modules/accounts/templates/addressBook/add/add.js
+++ b/client/modules/accounts/templates/addressBook/add/add.js
@@ -6,9 +6,9 @@ import { Template } from "meteor/templating";
Template.addressBookAdd.helpers({
thisAddress: function () {
- let thisAddress = {};
+ const thisAddress = {};
// admin should receive his account
- let account = Collections.Accounts.findOne({
+ const account = Collections.Accounts.findOne({
userId: Meteor.userId()
});
if (account) {
@@ -38,7 +38,7 @@ Template.addressBookAdd.helpers({
},
hasAddressBookEntries: function () {
- let account = Collections.Accounts.findOne({
+ const account = Collections.Accounts.findOne({
userId: Meteor.userId()
});
if (account) {
@@ -72,7 +72,7 @@ AutoForm.hooks({
addressBookAddForm: {
onSubmit: function (insertDoc) {
this.event.preventDefault();
- let addressBook = $(this.template.firstNode).closest(".address-book");
+ const addressBook = $(this.template.firstNode).closest(".address-book");
Meteor.call("accounts/addressBookAdd", insertDoc, (error, result) => {
if (error) {
diff --git a/client/modules/accounts/templates/addressBook/addressBook.js b/client/modules/accounts/templates/addressBook/addressBook.js
index ce72a1e442d..5946ea1a02b 100644
--- a/client/modules/accounts/templates/addressBook/addressBook.js
+++ b/client/modules/accounts/templates/addressBook/addressBook.js
@@ -18,7 +18,7 @@ Template.addressBook.onCreated(function () {
this.autorun(() => {
this.subscribe("Accounts", Meteor.userId());
- let account = Collections.Accounts.findOne({
+ const account = Collections.Accounts.findOne({
userId: Meteor.userId()
});
@@ -42,7 +42,7 @@ Template.addressBook.onCreated(function () {
Template.addressBook.helpers({
account: function () {
- let account = Collections.Accounts.findOne({
+ const account = Collections.Accounts.findOne({
userId: Meteor.userId()
});
return account;
@@ -99,7 +99,7 @@ Template.addressBook.events({
Alerts.toast(i18next.t("addressBookGrid.cantRemoveThisAddress", { err: error.message }), "error");
}
if (result) {
- let account = Collections.Accounts.findOne({
+ const account = Collections.Accounts.findOne({
userId: Meteor.userId()
});
if (account) {
diff --git a/client/modules/accounts/templates/addressBook/form/form.js b/client/modules/accounts/templates/addressBook/form/form.js
index 68e41b47d3e..a9e5f95b800 100644
--- a/client/modules/accounts/templates/addressBook/form/form.js
+++ b/client/modules/accounts/templates/addressBook/form/form.js
@@ -24,12 +24,14 @@ Template.addressBookForm.helpers({
}
options = [];
const ref = shop !== null ? shop.locales.countries[selectedCountry].states : void 0;
- for (let state in ref) {
- locale = ref[state];
- options.push({
- label: locale.name,
- value: state
- });
+ for (const state in ref) {
+ if ({}.hasOwnProperty.call(ref, state)) {
+ locale = ref[state];
+ options.push({
+ label: locale.name,
+ value: state
+ });
+ }
}
return options;
},
@@ -44,7 +46,7 @@ Template.addressBookForm.helpers({
return typeof this.address === "object" ? this.address.isShippingDefault : true;
},
hasAddressBookEntries: function () {
- let account = Collections.Accounts.findOne({
+ const account = Collections.Accounts.findOne({
userId: Meteor.userId()
});
if (account) {
diff --git a/client/modules/accounts/templates/addressBook/grid/grid.js b/client/modules/accounts/templates/addressBook/grid/grid.js
index fa308b9df23..57486194221 100644
--- a/client/modules/accounts/templates/addressBook/grid/grid.js
+++ b/client/modules/accounts/templates/addressBook/grid/grid.js
@@ -7,7 +7,7 @@ import { Template } from "meteor/templating";
*/
Template.addressBookGrid.helpers({
selectedBilling: function () {
- let cart = Collections.Cart.findOne({
+ const cart = Collections.Cart.findOne({
userId: Meteor.userId()
});
@@ -29,7 +29,7 @@ Template.addressBookGrid.helpers({
},
selectedShipping: function () {
- let cart = Collections.Cart.findOne({
+ const cart = Collections.Cart.findOne({
userId: Meteor.userId()
});
diff --git a/client/modules/accounts/templates/dashboard/dashboard.js b/client/modules/accounts/templates/dashboard/dashboard.js
index 2ba66f9ce88..246c23e947b 100644
--- a/client/modules/accounts/templates/dashboard/dashboard.js
+++ b/client/modules/accounts/templates/dashboard/dashboard.js
@@ -42,7 +42,7 @@ Template.accountsDashboard.helpers({
const shopUsers = Meteor.users.find();
return shopUsers.map(user => {
- let member = {};
+ const member = {};
member.userId = user._id;
@@ -153,7 +153,7 @@ Template.accountsSettings.events({
// todo remove this after i18next 2 will be installed
// let niceName = serviceHelper.capitalizedServiceName(service);
- for (let field of fields) {
+ for (const field of fields) {
field.value = event.target[field.property].value;
}
diff --git a/client/modules/accounts/templates/forgot/forgot.js b/client/modules/accounts/templates/forgot/forgot.js
index 1f0087827fc..4060cafd114 100644
--- a/client/modules/accounts/templates/forgot/forgot.js
+++ b/client/modules/accounts/templates/forgot/forgot.js
@@ -13,10 +13,10 @@ Template.loginFormResetPasswordView.events({
"submit form": (event, template) => {
event.preventDefault();
- let emailAddress = template.$(".login-input-email").val().trim();
- let validatedEmail = LoginFormValidation.email(emailAddress);
- let templateInstance = Template.instance();
- let errors = {};
+ const emailAddress = template.$(".login-input-email").val().trim();
+ const validatedEmail = LoginFormValidation.email(emailAddress);
+ const templateInstance = Template.instance();
+ const errors = {};
templateInstance.formMessages.set({});
@@ -55,7 +55,7 @@ Template.loginFormResetPasswordView.events({
*
*/
Template.loginFormResetPasswordView.onCreated(() => {
- let template = Template.instance();
+ const template = Template.instance();
template.uniqueId = Random.id();
template.formMessages = new ReactiveVar({});
diff --git a/client/modules/accounts/templates/login/loginForm.js b/client/modules/accounts/templates/login/loginForm.js
index 9e4a5cde038..e7825e870ba 100644
--- a/client/modules/accounts/templates/login/loginForm.js
+++ b/client/modules/accounts/templates/login/loginForm.js
@@ -8,7 +8,7 @@ import { Template } from "meteor/templating";
// XXX from http://epeli.github.com/underscore.string/lib/underscore.string.js
function capitalize(str) {
- let finalString = str === null ? "" : String(str);
+ const finalString = str === null ? "" : String(str);
return finalString.charAt(0).toUpperCase() + finalString.slice(1);
}
@@ -51,8 +51,8 @@ Template.loginForm.helpers({
* Login form onCreated
*/
Template.loginForm.onCreated(function () {
- let template = Template.instance();
- let currentData = Template.currentData();
+ const template = Template.instance();
+ const currentData = Template.currentData();
let startView = "loginFormSignInView";
if (currentData) {
@@ -148,8 +148,8 @@ Template.loginFormServiceButton.events({
serviceName = capitalize(serviceName);
}
- let loginWithService = Meteor["loginWith" + serviceName];
- let options = {}; // use default scope unless specified
+ const loginWithService = Meteor["loginWith" + serviceName];
+ const options = {}; // use default scope unless specified
loginWithService(options, () => {
// TODO: add error message for failed login attempt
diff --git a/client/modules/accounts/templates/members/member.js b/client/modules/accounts/templates/members/member.js
index 20a4306a4c0..ab3af69a67b 100644
--- a/client/modules/accounts/templates/members/member.js
+++ b/client/modules/accounts/templates/members/member.js
@@ -43,12 +43,12 @@ Template.memberSettings.helpers({
}
},
groupsForUser: function (groupUserId) {
- let userId = groupUserId || this.userId || Template.parentData(1).userId;
+ const userId = groupUserId || this.userId || Template.parentData(1).userId;
return Roles.getGroupsForUser(userId);
},
shopLabel: function (thisShopId) {
const shopId = thisShopId || Template.currentData();
- let shop = Shops.findOne({
+ const shop = Shops.findOne({
_id: shopId
});
if (shop && shop.name) {
@@ -56,7 +56,7 @@ Template.memberSettings.helpers({
}
},
permissionGroups: function (thisShopId) {
- let permissionGroups = [];
+ const permissionGroups = [];
const shopId = thisShopId || Template.currentData();
const packages = Packages.find({
shopId: shopId
@@ -65,7 +65,7 @@ Template.memberSettings.helpers({
packages.forEach(function (pkg) {
const permissions = [];
if (pkg.registry && pkg.enabled) {
- for (let registryItem of pkg.registry) {
+ for (const registryItem of pkg.registry) {
// Skip entires with missing routes
if (!registryItem.route) {
continue;
@@ -73,14 +73,14 @@ Template.memberSettings.helpers({
// Get all permissions, add them to an array
if (registryItem.permissions) {
- for (let permission of registryItem.permissions) {
+ for (const permission of registryItem.permissions) {
permission.shopId = shopId;
permissions.push(permission);
}
}
// Also create an object map of those same permissions as above
- let permissionMap = getPermissionMap(permissions);
+ const permissionMap = getPermissionMap(permissions);
if (!permissionMap[registryItem.route]) {
permissions.push({
shopId: pkg.shopId,
@@ -120,14 +120,14 @@ Template.memberSettings.helpers({
Template.memberSettings.events({
"change [data-event-action=toggleMemberPermission]": function (event, template) {
const self = this;
- let permissions = [];
+ const permissions = [];
const member = template.data;
if (!this.shopId) {
throw new Meteor.Error("Shop is required");
}
if (self.name) {
permissions.push(self.name);
- for (let pkgPermissions of self.permissions) {
+ for (const pkgPermissions of self.permissions) {
permissions.push(pkgPermissions.permission);
}
} else {
@@ -143,7 +143,7 @@ Template.memberSettings.events({
const $icon = $(event.currentTarget);
if (confirm($icon.data("confirm"))) {
const results = [];
- for (let role of template.data.roles) {
+ for (const role of template.data.roles) {
results.push(Meteor.call("accounts/setUserPermissions", this.userId, ["guest", "account/profile"], role));
}
return results;
diff --git a/client/modules/accounts/templates/members/memberForm.js b/client/modules/accounts/templates/members/memberForm.js
index bf380ac4d01..6d23cdf8508 100644
--- a/client/modules/accounts/templates/members/memberForm.js
+++ b/client/modules/accounts/templates/members/memberForm.js
@@ -10,8 +10,8 @@ Template.memberForm.events({
"submit form": function (event, template) {
event.preventDefault();
- let newMemberEmail = template.$('input[name="email"]').val();
- let newMemberName = template.$('input[name="name"]').val();
+ const newMemberEmail = template.$('input[name="email"]').val();
+ const newMemberName = template.$('input[name="name"]').val();
return Meteor.call("accounts/inviteShopMember", Reaction.getShopId(),
newMemberEmail, newMemberName, function (error, result) {
diff --git a/client/modules/accounts/templates/profile/profile.js b/client/modules/accounts/templates/profile/profile.js
index fc6829daf14..4c1df963822 100644
--- a/client/modules/accounts/templates/profile/profile.js
+++ b/client/modules/accounts/templates/profile/profile.js
@@ -6,7 +6,7 @@ import { Template } from "meteor/templating";
* onCreated: Account Profile View
*/
Template.accountProfile.onCreated(() => {
- let template = Template.instance();
+ const template = Template.instance();
template.userHasPassword = ReactiveVar(false);
@@ -59,7 +59,7 @@ Template.accountProfile.helpers({
* @return {String} "addressBookGrid" || "addressBookAdd"
*/
addressBookView: function () {
- let account = Collections.Accounts.findOne();
+ const account = Collections.Accounts.findOne();
if (account.profile) {
return "addressBookGrid";
}
diff --git a/client/modules/accounts/templates/signIn/signIn.js b/client/modules/accounts/templates/signIn/signIn.js
index 3cfcadcb8e1..935335f8cdc 100644
--- a/client/modules/accounts/templates/signIn/signIn.js
+++ b/client/modules/accounts/templates/signIn/signIn.js
@@ -6,7 +6,7 @@ import { Template } from "meteor/templating";
* onCreated: Login form sign in view
*/
Template.loginFormSignInView.onCreated(() => {
- let template = Template.instance();
+ const template = Template.instance();
template.uniqueId = Random.id();
template.formMessages = new ReactiveVar({});
@@ -31,17 +31,17 @@ Template.loginFormSignInView.events({
"submit form": (event, template) => {
event.preventDefault();
- let usernameInput = template.$(".login-input-email");
- let passwordInput = template.$(".login-input-password");
+ const usernameInput = template.$(".login-input-email");
+ const passwordInput = template.$(".login-input-password");
- let username = usernameInput.val().trim();
- let password = passwordInput.val().trim();
+ const username = usernameInput.val().trim();
+ const password = passwordInput.val().trim();
- let validatedEmail = LoginFormValidation.email(username);
- let validatedPassword = LoginFormValidation.password(password, {validationLevel: "exists"});
+ const validatedEmail = LoginFormValidation.email(username);
+ const validatedPassword = LoginFormValidation.password(password, {validationLevel: "exists"});
- let templateInstance = Template.instance();
- let errors = {};
+ const templateInstance = Template.instance();
+ const errors = {};
templateInstance.formMessages.set({});
diff --git a/client/modules/accounts/templates/signUp/signUp.js b/client/modules/accounts/templates/signUp/signUp.js
index 4b1c4ea50a3..4b94a19aa59 100644
--- a/client/modules/accounts/templates/signUp/signUp.js
+++ b/client/modules/accounts/templates/signUp/signUp.js
@@ -5,7 +5,7 @@ import { Template } from "meteor/templating";
* onCreated: Login form sign up view
*/
Template.loginFormSignUpView.onCreated(() => {
- let template = Template.instance();
+ const template = Template.instance();
template.uniqueId = Random.id();
template.formMessages = new ReactiveVar({});
@@ -31,17 +31,17 @@ Template.loginFormSignUpView.events({
event.preventDefault();
// var usernameInput = template.$(".login-input--username");
- let emailInput = template.$(".login-input-email");
- let passwordInput = template.$(".login-input-password");
+ const emailInput = template.$(".login-input-email");
+ const passwordInput = template.$(".login-input-password");
- let email = emailInput.val().trim();
- let password = passwordInput.val().trim();
+ const email = emailInput.val().trim();
+ const password = passwordInput.val().trim();
- let validatedEmail = LoginFormValidation.email(email);
- let validatedPassword = LoginFormValidation.password(password);
+ const validatedEmail = LoginFormValidation.email(email);
+ const validatedPassword = LoginFormValidation.password(password);
- let templateInstance = Template.instance();
- let errors = {};
+ const templateInstance = Template.instance();
+ const errors = {};
templateInstance.formMessages.set({});
@@ -61,7 +61,7 @@ Template.loginFormSignUpView.events({
return;
}
- let newUserData = {
+ const newUserData = {
// username: username,
email: email,
password: password
diff --git a/client/modules/accounts/templates/updatePassword/updatePassword.js b/client/modules/accounts/templates/updatePassword/updatePassword.js
index 9e2b8e75e48..4739c7478cf 100644
--- a/client/modules/accounts/templates/updatePassword/updatePassword.js
+++ b/client/modules/accounts/templates/updatePassword/updatePassword.js
@@ -42,7 +42,7 @@ Accounts.onEmailVerificationLink(function (token, done) {
* onCreated: Login Form Update Password Overlay
*/
Template.loginFormUpdatePasswordOverlay.onCreated(() => {
- let template = Template.instance();
+ const template = Template.instance();
template.uniqueId = Random.id();
template.formMessages = new ReactiveVar({});
@@ -78,12 +78,12 @@ Template.loginFormUpdatePasswordOverlay.events({
event.preventDefault();
event.stopPropagation();
- let passwordInput = template.$(".login-input--password");
- let password = passwordInput.val().trim();
- let validatedPassword = LoginFormValidation.password(password);
+ const passwordInput = template.$(".login-input--password");
+ const password = passwordInput.val().trim();
+ const validatedPassword = LoginFormValidation.password(password);
- let templateInstance = Template.instance();
- let errors = {};
+ const templateInstance = Template.instance();
+ const errors = {};
templateInstance.formMessages.set({});
@@ -121,7 +121,7 @@ Template.loginFormUpdatePasswordOverlay.events({
* onCreated: Login Form Change Password
*/
Template.loginFormChangePassword.onCreated(() => {
- let template = Template.instance();
+ const template = Template.instance();
template.uniqueId = Random.id();
template.formMessages = new ReactiveVar({});
@@ -147,19 +147,19 @@ Template.loginFormChangePassword.events({
event.preventDefault();
event.stopPropagation();
- let oldPasswordInput = template.$(".login-input--oldPassword");
- let passwordInput = template.$(".login-input--password");
+ const oldPasswordInput = template.$(".login-input--oldPassword");
+ const passwordInput = template.$(".login-input--password");
- let oldPassword = oldPasswordInput.val().trim();
- let password = passwordInput.val().trim();
+ const oldPassword = oldPasswordInput.val().trim();
+ const password = passwordInput.val().trim();
// We only check if it exists, just incase we"ve change the password strength and want the
// user to have an oppurtinity to update to a stronger password
- let validatedOldPassword = LoginFormValidation.password(password, {validationLevel: "exists"});
- let validatedPassword = LoginFormValidation.password(password);
+ const validatedOldPassword = LoginFormValidation.password(password, {validationLevel: "exists"});
+ const validatedPassword = LoginFormValidation.password(password);
- let templateInstance = Template.instance();
- let errors = {};
+ const templateInstance = Template.instance();
+ const errors = {};
templateInstance.formMessages.set({});
diff --git a/client/modules/core/helpers/apps.js b/client/modules/core/helpers/apps.js
index 3a90c300774..6b98758fcbd 100644
--- a/client/modules/core/helpers/apps.js
+++ b/client/modules/core/helpers/apps.js
@@ -51,15 +51,12 @@ import { Template } from "meteor/templating";
*/
export function Apps(optionHash) {
- let fields;
- let filter;
+ const filter = {};
+ const registryFilter = {};
let key;
let match;
let packages;
-
let reactionApps = [];
- let reactionPackages;
- let registryFilter;
let options = {};
// allow for object or option.hash
@@ -76,16 +73,12 @@ export function Apps(optionHash) {
options.shopId = Reaction.getShopId();
}
- reactionApps = [];
- filter = {};
- registryFilter = {};
-
//
// build filter to only get matching registry elements
//
for (key in options) {
if ({}.hasOwnProperty.call(options, key)) {
- let value = options[key];
+ const value = options[key];
if (!(key === "enabled" || key === "name" || key === "shopId")) {
filter["registry." + key] = value;
registryFilter[key] = value;
@@ -96,7 +89,7 @@ export function Apps(optionHash) {
}
// return these fields
- fields = {
+ const fields = {
enabled: 1,
registry: 1,
name: 1,
@@ -104,7 +97,7 @@ export function Apps(optionHash) {
};
// fetch the packages
- reactionPackages = Packages.find(filter, fields).fetch();
+ const reactionPackages = Packages.find(filter, fields).fetch();
// apply filters to registry items
if (reactionPackages.length) {
@@ -112,7 +105,7 @@ export function Apps(optionHash) {
if (filter.name && filter.enabled) {
packages = (function () {
const results = [];
- for (let pkg of reactionPackages) {
+ for (const pkg of reactionPackages) {
if (pkg.name === filter.name && pkg.enabled === filter.enabled) {
results.push(pkg);
}
@@ -123,7 +116,7 @@ export function Apps(optionHash) {
} else if (filter.name) {
packages = (function () {
const results = [];
- for (let pkg of reactionPackages) {
+ for (const pkg of reactionPackages) {
if (pkg.name === filter.name) {
results.push(pkg);
}
@@ -134,7 +127,7 @@ export function Apps(optionHash) {
} else if (filter.enabled) {
packages = (function () {
const results = [];
- for (let pkg of reactionPackages) {
+ for (const pkg of reactionPackages) {
if (pkg.enabled === filter.enabled) {
results.push(pkg);
}
@@ -145,7 +138,7 @@ export function Apps(optionHash) {
} else {
packages = (function () {
const results = [];
- for (let pkg of reactionPackages) {
+ for (const pkg of reactionPackages) {
results.push(pkg);
}
return results;
@@ -153,7 +146,7 @@ export function Apps(optionHash) {
}
// we have all the package app registry entries
- for (let app of packages) {
+ for (const app of packages) {
// go through the registry entries and push enabled entries
if (app.registry) {
for (let registry of app.registry) {
@@ -161,7 +154,7 @@ export function Apps(optionHash) {
for (key in registryFilter) {
// make sure we're dealing with valid keys
if ({}.hasOwnProperty.call(registryFilter, key)) {
- let value = registryFilter[key];
+ const value = registryFilter[key];
if (registry[key] === value) {
match += 1;
}
diff --git a/client/modules/core/helpers/globals.js b/client/modules/core/helpers/globals.js
index cccc51d7938..2e2b95285ec 100644
--- a/client/modules/core/helpers/globals.js
+++ b/client/modules/core/helpers/globals.js
@@ -50,8 +50,8 @@ export function toggleSession(sessionVariable, positiveState) {
*/
export function locateUser() {
function successFunction(position) {
- let lat = position.coords.latitude;
- let lng = position.coords.longitude;
+ const lat = position.coords.latitude;
+ const lng = position.coords.longitude;
return Meteor.call("shop/locateAddress", lat, lng, function (error,
address) {
if (address) {
diff --git a/client/modules/core/helpers/permissions.js b/client/modules/core/helpers/permissions.js
index 8ab690e55c4..841b71446c6 100644
--- a/client/modules/core/helpers/permissions.js
+++ b/client/modules/core/helpers/permissions.js
@@ -19,7 +19,7 @@ import { Template } from "meteor/templating";
Template.registerHelper("hasPermission", function (permissions, options) {
// default to checking this.userId
let userId = Meteor.userId();
- let shopId = Reaction.getShopId();
+ const shopId = Reaction.getShopId();
// we don't necessarily need to check here
// as these same checks and defaults are
// also performed in Reaction.hasPermission
diff --git a/client/modules/core/helpers/templates.js b/client/modules/core/helpers/templates.js
index 6ad92881189..9d8161aa671 100644
--- a/client/modules/core/helpers/templates.js
+++ b/client/modules/core/helpers/templates.js
@@ -39,6 +39,7 @@ if (Package.blaze) {
return isGuest && !isAnonymous ? user : null;
}
+ return null;
});
}
@@ -48,15 +49,15 @@ if (Package.blaze) {
* @return {Array} returns array of months [value:, label:]
*/
Template.registerHelper("monthOptions", function () {
- let label = i18next.t("app.monthOptions", "Choose month");
- let monthOptions = [{
+ const label = i18next.t("app.monthOptions", "Choose month");
+ const monthOptions = [{
value: "",
label: label
}];
- let months = moment.months();
- for (let index in months) {
+ const months = moment.months();
+ for (const index in months) {
if ({}.hasOwnProperty.call(months, index)) {
- let month = months[index];
+ const month = months[index];
monthOptions.push({
value: parseInt(index, 10) + 1,
label: month
@@ -72,8 +73,8 @@ Template.registerHelper("monthOptions", function () {
* @return {Array} returns array of years [value:, label:]
*/
Template.registerHelper("yearOptions", function () {
- let label = i18next.t("app.yearOptions", "Choose year");
- let yearOptions = [{
+ const label = i18next.t("app.yearOptions", "Choose year");
+ const yearOptions = [{
value: "",
label: label
}];
@@ -94,13 +95,13 @@ Template.registerHelper("yearOptions", function () {
* @return {Array} returns array of timezones [value:, label:]
*/
Template.registerHelper("timezoneOptions", function () {
- let label = i18next.t("app.timezoneOptions", "Choose timezone");
- let timezoneOptions = [{
+ const label = i18next.t("app.timezoneOptions", "Choose timezone");
+ const timezoneOptions = [{
value: "",
label: label
}];
- let timezones = moment.tz.names();
- for (let timezone of timezones) {
+ const timezones = moment.tz.names();
+ for (const timezone of timezones) {
timezoneOptions.push({
value: timezone,
label: timezone
@@ -117,7 +118,7 @@ Template.registerHelper("timezoneOptions", function () {
* @return {String} returns space formatted string
*/
Template.registerHelper("camelToSpace", function (str) {
- let downCamel = str.replace(/\W+/g, "-").replace(/([a-z\d])([A-Z])/g, "$1 $2");
+ const downCamel = str.replace(/\W+/g, "-").replace(/([a-z\d])([A-Z])/g, "$1 $2");
return downCamel.toLowerCase();
});
@@ -187,38 +188,38 @@ Template.registerHelper("siteName", function () {
*/
Template.registerHelper("condition", function (v1, operator, v2) {
switch (operator) {
- case "==":
- case "eq":
- return v1 === v2;
- case "!=":
- case "neq":
- return v1 !== v2;
- case "===":
- case "ideq":
- return v1 === v2;
- case "!==":
- case "nideq":
- return v1 !== v2;
- case "&&":
- case "and":
- return v1 && v2;
- case "||":
- case "or":
- return v1 || v2;
- case "<":
- case "lt":
- return v1 < v2;
- case "<=":
- case "lte":
- return v1 <= v2;
- case ">":
- case "gt":
- return v1 > v2;
- case ">=":
- case "gte":
- return v1 >= v2;
- default:
- throw new Meteor.Error(`Undefined conditional operator ${operator}`);
+ case "==":
+ case "eq":
+ return v1 === v2;
+ case "!=":
+ case "neq":
+ return v1 !== v2;
+ case "===":
+ case "ideq":
+ return v1 === v2;
+ case "!==":
+ case "nideq":
+ return v1 !== v2;
+ case "&&":
+ case "and":
+ return v1 && v2;
+ case "||":
+ case "or":
+ return v1 || v2;
+ case "<":
+ case "lt":
+ return v1 < v2;
+ case "<=":
+ case "lte":
+ return v1 <= v2;
+ case ">":
+ case "gt":
+ return v1 > v2;
+ case ">=":
+ case "gte":
+ return v1 >= v2;
+ default:
+ throw new Meteor.Error(`Undefined conditional operator ${operator}`);
}
});
@@ -240,8 +241,7 @@ Template.registerHelper("orElse", function (v1, v2) {
* @return {Array} returns array[key:,value:]
*/
Template.registerHelper("key_value", function (context) {
- let result;
- result = [];
+ const result = [];
_.each(context, function (value, key) {
return result.push({
key: key,
@@ -259,8 +259,7 @@ Template.registerHelper("key_value", function (context) {
* @returns {String} returns formatted Spacebars.SafeString
*/
Template.registerHelper("nl2br", function (text) {
- let nl2br;
- nl2br = (text + "").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, "$1" +
+ const nl2br = (text + "").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, "$1" +
"
" + "$2");
return new Spacebars.SafeString(nl2br);
});
@@ -277,9 +276,8 @@ Template.registerHelper("nl2br", function (text) {
* @return {Date} return formatted date
*/
Template.registerHelper("dateFormat", function (context, block) {
- let f;
if (window.moment) {
- f = block.hash.format || "MMM DD, YYYY hh:mm:ss A";
+ const f = block.hash.format || "MMM DD, YYYY hh:mm:ss A";
return moment(context).format(f);
}
return context;
diff --git a/client/modules/core/main.js b/client/modules/core/main.js
index effd6fb9361..28cb259a3f5 100644
--- a/client/modules/core/main.js
+++ b/client/modules/core/main.js
@@ -106,13 +106,13 @@ export default {
return true;
}
// global roles check
- let sellerShopPermissions = Roles.getGroupsForUser(userId, "admin");
+ const sellerShopPermissions = Roles.getGroupsForUser(userId, "admin");
// we're looking for seller permissions.
if (sellerShopPermissions) {
// loop through shops roles and check permissions
- for (let key in sellerShopPermissions) {
+ for (const key in sellerShopPermissions) {
if (key) {
- let shop = sellerShopPermissions[key];
+ const shop = sellerShopPermissions[key];
if (Roles.userIsInRole(userId, permissions, shop)) {
return true;
}
@@ -171,17 +171,17 @@ export default {
},
hasOwnerAccess() {
- let ownerPermissions = ["owner"];
+ const ownerPermissions = ["owner"];
return this.hasPermission(ownerPermissions);
},
hasAdminAccess() {
- let adminPermissions = ["owner", "admin"];
+ const adminPermissions = ["owner", "admin"];
return this.hasPermission(adminPermissions);
},
hasDashboardAccess() {
- let dashboardPermissions = ["owner", "admin", "dashboard"];
+ const dashboardPermissions = ["owner", "admin", "dashboard"];
return this.hasPermission(dashboardPermissions);
},
@@ -231,7 +231,7 @@ export default {
if (viewData) {
Session.set("admin/actionView", viewData);
} else {
- let registryItem = this.getRegistryForCurrentRoute(
+ const registryItem = this.getRegistryForCurrentRoute(
"settings");
if (registryItem) {
@@ -271,7 +271,7 @@ export default {
const currentRoute = this.Router.current();
const template = currentRoute.route.options.template;
// find registry entries for routeName
- let reactionApp = Packages.findOne({
+ const reactionApp = Packages.findOne({
"registry.name": currentRouteName,
"registry.provides": provides
}, {
@@ -284,7 +284,7 @@ export default {
// valid application
if (reactionApp) {
- let settingsData = _.find(reactionApp.registry, function (item) {
+ const settingsData = _.find(reactionApp.registry, function (item) {
return item.provides === provides && item.template === template;
});
return settingsData;
@@ -305,9 +305,9 @@ export default {
function createCountryCollection(countries) {
check(countries, Object);
const countryOptions = [];
- for (let locale in countries) {
+ for (const locale in countries) {
if ({}.hasOwnProperty.call(countries, locale)) {
- let country = countries[locale];
+ const country = countries[locale];
countryOptions.push({
label: country.name,
value: locale
@@ -324,7 +324,7 @@ function createCountryCollection(countries) {
return 0;
});
- for (let country of countryOptions) {
+ for (const country of countryOptions) {
Countries.insert(country);
}
return countryOptions;
diff --git a/client/modules/core/startup.js b/client/modules/core/startup.js
index c343106b9c0..b58c5cb60db 100644
--- a/client/modules/core/startup.js
+++ b/client/modules/core/startup.js
@@ -27,7 +27,7 @@ if (typeof document.hidden !== "undefined") {
Meteor.startup(function () {
// warn on insecure exporting of PackageRegistry settings
if (typeof PackageRegistry !== "undefined" && PackageRegistry !== null) {
- let msg = "PackageRegistry: Insecure export to client.";
+ const msg = "PackageRegistry: Insecure export to client.";
Logger.warn(msg, PackageRegistry);
}
// init the core
diff --git a/client/modules/i18n/helpers.js b/client/modules/i18n/helpers.js
index 1b15bb176a1..ba045644783 100644
--- a/client/modules/i18n/helpers.js
+++ b/client/modules/i18n/helpers.js
@@ -1,9 +1,8 @@
import accounting from "accounting-js";
-import { localeDep, i18nextDep } from "./main";
-import { Reaction, Logger, i18next } from "/client/api";
-import { Session } from "meteor/session";
import { Meteor } from "meteor/meteor";
import { Template } from "meteor/templating";
+import { localeDep, i18nextDep } from "./main";
+import { Reaction, Logger, i18next } from "/client/api";
/**
* i18n
@@ -25,7 +24,7 @@ Template.registerHelper("i18n", function (i18nKey, i18nMessage) {
i18nextDep.depend();
- const message = new Handlebars.SafeString(i18nMessage);
+ const message = new Spacebars.SafeString(i18nMessage);
// returning translated key
return i18next.t(i18nKey, {defaultValue: message});
@@ -63,7 +62,7 @@ Template.registerHelper("formatPrice", function (formatPrice) {
}
// for the cases then we have only one price. It is a number.
- let currentPrice = formatPrice.toString();
+ const currentPrice = formatPrice.toString();
let price = 0;
const prices = ~currentPrice.indexOf(" - ") ?
currentPrice.split(" - ") : [currentPrice];
@@ -71,7 +70,7 @@ Template.registerHelper("formatPrice", function (formatPrice) {
// basic "for" is faster then "for ...of" for arrays. We need more speed here
const len = prices.length;
for (let i = 0; i < len; i++) {
- let originalPrice = prices[i];
+ const originalPrice = prices[i];
try {
// we know the locale, but we don"t know exchange rate. In that case we
// should return to default shop currency
@@ -97,10 +96,10 @@ Reaction.Currency = {};
Reaction.Currency.formatNumber = function (currentPrice) {
const locale = Reaction.Locale.get();
let price = currentPrice;
- let format = Object.assign({}, locale.currency, {
+ const format = Object.assign({}, locale.currency, {
format: "%v"
});
- let shopFormat = Object.assign({}, locale.shopCurrency, {
+ const shopFormat = Object.assign({}, locale.shopCurrency, {
format: "%v"
});
@@ -152,7 +151,7 @@ function _formatPrice(price, originalPrice, actualPrice, currentPrice, currency,
// For now it should be manually added to fixtures shop data.
if (typeof currency.where === "string" && currency.where === "right" &&
len > 1 && pos === 0) {
- let modifiedCurrency = Object.assign({}, currency, {
+ const modifiedCurrency = Object.assign({}, currency, {
symbol: ""
});
formattedPrice = accounting.formatMoney(adjustedPrice, modifiedCurrency);
diff --git a/client/modules/i18n/main.js b/client/modules/i18n/main.js
index fe14e451d13..7a821d0b29f 100644
--- a/client/modules/i18n/main.js
+++ b/client/modules/i18n/main.js
@@ -41,9 +41,9 @@ export function getBrowserLanguage() {
* @return {Object} return schema label object
*/
function getLabelsFor(schema, name) {
- let labels = {};
+ const labels = {};
// loop through all the rendered form fields and generate i18n keys
- for (let fieldName of schema._schemaKeys) {
+ for (const fieldName of schema._schemaKeys) {
const i18nKey = name.charAt(0).toLowerCase() + name.slice(1) + "." +
fieldName
.split(".$").join("");
@@ -69,8 +69,8 @@ function getLabelsFor(schema, name) {
* @return {Object} returns i18n translated message for schema labels
*/
function getMessagesFor() {
- let messages = {};
- for (let message in SimpleSchema._globalMessages) {
+ const messages = {};
+ for (const message in SimpleSchema._globalMessages) {
if ({}.hasOwnProperty.call(SimpleSchema._globalMessages, message)) {
const i18nKey = `globalMessages.${message}`;
const t = i18next.t(i18nKey);
@@ -174,9 +174,9 @@ Tracker.autorun(function () {
}, (err, t) => {
// someday this should work
// see: https://github.com/aldeed/meteor-simple-schema/issues/494
- for (let schema in _.omit(Schemas, "__esModule")) {
+ for (const schema in _.omit(Schemas, "__esModule")) {
if ({}.hasOwnProperty.call(Schemas, schema)) {
- let ss = Schemas[schema];
+ const ss = Schemas[schema];
ss.labels(getLabelsFor(ss, schema));
ss.messages(getMessagesFor(ss, schema));
}
diff --git a/client/modules/i18n/templates/header/i18n.js b/client/modules/i18n/templates/header/i18n.js
index 71e86bf85c9..26af4cca63a 100644
--- a/client/modules/i18n/templates/header/i18n.js
+++ b/client/modules/i18n/templates/header/i18n.js
@@ -8,11 +8,11 @@ import { Session } from "meteor/session";
Template.i18nChooser.helpers({
languages() {
- let languages = [];
+ const languages = [];
if (Reaction.Subscriptions.Shops.ready()) {
- let shop = Shops.findOne();
+ const shop = Shops.findOne();
if (typeof shop === "object" && shop.languages) {
- for (let language of shop.languages) {
+ for (const language of shop.languages) {
if (language.enabled === true) {
language.translation = "languages." + language.label.toLowerCase();
languages.push(language);
diff --git a/client/modules/i18n/templates/i18nSettings.js b/client/modules/i18n/templates/i18nSettings.js
index 1b18425bbb6..ff3c21dd945 100644
--- a/client/modules/i18n/templates/i18nSettings.js
+++ b/client/modules/i18n/templates/i18nSettings.js
@@ -21,9 +21,9 @@ Template.i18nSettings.helpers({
currencyOptions() {
const currencies = Shops.findOne().currencies;
const currencyOptions = [];
- for (let currency in currencies) {
+ for (const currency in currencies) {
if ({}.hasOwnProperty.call(currencies, currency)) {
- let structure = currencies[currency];
+ const structure = currencies[currency];
currencyOptions.push({
label: currency + " | " + structure.symbol + " | " +
structure.format,
@@ -36,7 +36,7 @@ Template.i18nSettings.helpers({
uomOptions() {
const unitsOfMeasure = Shops.findOne().unitsOfMeasure;
const uomOptions = [];
- for (let measure of unitsOfMeasure) {
+ for (const measure of unitsOfMeasure) {
uomOptions.push({
label: i18next.t(`uom.${measure.uom}`, {defaultValue: measure.uom}),
value: measure.uom
@@ -45,10 +45,10 @@ Template.i18nSettings.helpers({
return uomOptions;
},
enabledLanguages() {
- let languages = [];
+ const languages = [];
const shop = Shops.findOne();
if (typeof shop === "object" && shop.languages) {
- for (let language of shop.languages) {
+ for (const language of shop.languages) {
if (language.enabled === true) {
languages.push({
label: language.label,
@@ -60,10 +60,10 @@ Template.i18nSettings.helpers({
}
},
languages() {
- let languages = [];
+ const languages = [];
const shop = Shops.findOne();
if (typeof shop === "object" && shop.languages) {
- for (let language of shop.languages) {
+ for (const language of shop.languages) {
const i18nKey = "languages." + language.label.toLowerCase();
languages.push({
label: language.label,
diff --git a/client/modules/router/main.js b/client/modules/router/main.js
index 5d61a2f8e63..a8404548e4b 100644
--- a/client/modules/router/main.js
+++ b/client/modules/router/main.js
@@ -111,7 +111,7 @@ export function ReactionLayout(options = {}) {
// check if router has denied permissions
// see: checkRouterPermissions
- let unauthorized = {};
+ const unauthorized = {};
if (Router.current().unauthorized) {
unauthorized.template = "unauthorized";
}
@@ -183,12 +183,12 @@ Router.initPackageRoutes = () => {
});
// get package registry route configurations
- for (let pkg of pkgs) {
+ for (const pkg of pkgs) {
const newRoutes = [];
// pkg registry
if (pkg.registry) {
const registry = Array.from(pkg.registry);
- for (let registryItem of registry) {
+ for (const registryItem of registry) {
// registryItems
if (registryItem.route) {
const {
@@ -227,7 +227,7 @@ Router.initPackageRoutes = () => {
// add group and routes to routing table
//
const uniqRoutes = new Set(newRoutes);
- for (let route of uniqRoutes) {
+ for (const route of uniqRoutes) {
// allow overriding of prefix in route definitions
// define an "absolute" url by excluding "/"
if (route.route.substring(0, 1) !== "/") {
@@ -271,10 +271,10 @@ Router.initPackageRoutes = () => {
* @return {String} returns current router path
*/
Router.pathFor = (path, options = {}) => {
- let params = options.hash || {};
- let query = params.query ? Router._qs.parse(params.query) : {};
+ const params = options.hash || {};
+ const query = params.query ? Router._qs.parse(params.query) : {};
// prevent undefined param error
- for (let i in params) {
+ for (const i in params) {
if (params[i] === null || params[i] === undefined) {
params[i] = "/";
}
diff --git a/imports/plugins/core/checkout/client/helpers/cart.js b/imports/plugins/core/checkout/client/helpers/cart.js
index 83c6d67ec0f..2429a35df81 100644
--- a/imports/plugins/core/checkout/client/helpers/cart.js
+++ b/imports/plugins/core/checkout/client/helpers/cart.js
@@ -18,7 +18,7 @@ import { Template } from "meteor/templating";
* @return {Object} returns inventory helpers
*/
Template.registerHelper("cart", function () {
- let cartHelpers = {
+ const cartHelpers = {
/**
* showCartIconWarning
* @return {Boolean} return true if low inventory on any item in cart
@@ -35,7 +35,7 @@ Template.registerHelper("cart", function () {
*/
showLowInventoryWarning() {
let item;
- let storedCart = Cart.findOne();
+ const storedCart = Cart.findOne();
// we're not being picky here - first thing in cart
// that is low will trigger a inventory warning
if (storedCart && storedCart.items) {
@@ -73,7 +73,7 @@ Template.registerHelper("cart", function () {
*/
Template.registerHelper("cartPayerName", function () {
- let cart = Cart.findOne();
+ const cart = Cart.findOne();
if (cart) {
if (cart.billing) {
if (cart.billing[0].address) {
diff --git a/imports/plugins/core/checkout/client/methods/cart.js b/imports/plugins/core/checkout/client/methods/cart.js
index 0cf423862c4..e2f2b6d8c4b 100644
--- a/imports/plugins/core/checkout/client/methods/cart.js
+++ b/imports/plugins/core/checkout/client/methods/cart.js
@@ -9,13 +9,13 @@ import { Cart } from "/lib/collections";
Meteor.methods({
"cart/submitPayment": function (paymentMethod) {
check(paymentMethod, Reaction.Schemas.PaymentMethod);
- let checkoutCart = Cart.findOne({
+ const checkoutCart = Cart.findOne({
userId: Meteor.userId()
});
- let cart = _.clone(checkoutCart);
- let cartId = cart._id;
- let invoice = {
+ const cart = _.clone(checkoutCart);
+ const cartId = cart._id;
+ const invoice = {
shipping: cart.cartShipping(),
subtotal: cart.cartSubTotal(),
taxes: cart.cartTaxes(),
diff --git a/imports/plugins/core/checkout/client/templates/cartDrawer/cartDrawer.js b/imports/plugins/core/checkout/client/templates/cartDrawer/cartDrawer.js
index 0093817ce60..d190d35e2a5 100644
--- a/imports/plugins/core/checkout/client/templates/cartDrawer/cartDrawer.js
+++ b/imports/plugins/core/checkout/client/templates/cartDrawer/cartDrawer.js
@@ -18,11 +18,11 @@ Template.cartDrawer.helpers({
return null;
}
- let storedCart = Cart.findOne();
+ const storedCart = Cart.findOne();
let count = 0;
if (typeof storedCart === "object" && storedCart.items) {
- for (let items of storedCart.items) {
+ for (const items of storedCart.items) {
count += items.quantity;
}
}
diff --git a/imports/plugins/core/checkout/client/templates/cartDrawer/cartItems/cartItems.js b/imports/plugins/core/checkout/client/templates/cartDrawer/cartItems/cartItems.js
index e533aa22cf2..a60700d9f4b 100644
--- a/imports/plugins/core/checkout/client/templates/cartDrawer/cartItems/cartItems.js
+++ b/imports/plugins/core/checkout/client/templates/cartDrawer/cartItems/cartItems.js
@@ -13,7 +13,7 @@ Template.cartDrawerItems.helpers({
return Products.findOne(this.productId);
},
media: function () {
- let product = Products.findOne(this.productId);
+ const product = Products.findOne(this.productId);
let defaultImage = Media.findOne({
"metadata.variantId": this.variants._id
});
diff --git a/imports/plugins/core/checkout/client/templates/checkout/completed/completed.js b/imports/plugins/core/checkout/client/templates/checkout/completed/completed.js
index 1f2d6770d65..6038efd224a 100644
--- a/imports/plugins/core/checkout/client/templates/checkout/completed/completed.js
+++ b/imports/plugins/core/checkout/client/templates/checkout/completed/completed.js
@@ -50,7 +50,7 @@ Template.cartCompleted.helpers({
*/
Template.cartCompleted.events({
"click #update-order": function () {
- let templateInstance = Template.instance();
+ const templateInstance = Template.instance();
const email = templateInstance.find("input[name=email]").value;
check(email, String);
const cartId = Reaction.Router.getQueryParam("_id");
@@ -65,9 +65,9 @@ Template.cartCompleted.events({
* the subscription to get the new cart
*/
Template.cartCompleted.onCreated(function () {
- let sessionId = Session.get("sessionId");
- let userId = Meteor.userId();
- let cartSub = Reaction.Subscriptions.Cart = Meteor.subscribe("Cart", sessionId, userId);
+ const sessionId = Session.get("sessionId");
+ const userId = Meteor.userId();
+ const cartSub = Reaction.Subscriptions.Cart = Meteor.subscribe("Cart", sessionId, userId);
cartSub.stop();
Reaction.Subscriptions.Cart = Meteor.subscribe("Cart", sessionId, userId);
});
diff --git a/imports/plugins/core/checkout/client/templates/checkout/payment/methods/cards.js b/imports/plugins/core/checkout/client/templates/checkout/payment/methods/cards.js
index c26bdf3f4ed..a3bc519963f 100644
--- a/imports/plugins/core/checkout/client/templates/checkout/payment/methods/cards.js
+++ b/imports/plugins/core/checkout/client/templates/checkout/payment/methods/cards.js
@@ -28,10 +28,10 @@ Template.corePaymentMethods.helpers({
},
appDetails: function () {
// Provides a fallback to the package icon / label if one is not found for this reaction app
- let self = this;
+ const self = this;
if (!(this.icon && this.label)) {
- let app = Packages.findOne(this.packageId);
- for (let registry of app.registry) {
+ const app = Packages.findOne(this.packageId);
+ for (const registry of app.registry) {
if (!(registry.provides === "dashboard")) {
continue;
}
diff --git a/imports/plugins/core/checkout/client/templates/checkout/shipping/shipping.js b/imports/plugins/core/checkout/client/templates/checkout/shipping/shipping.js
index 59c4582310f..1408e9afe36 100644
--- a/imports/plugins/core/checkout/client/templates/checkout/shipping/shipping.js
+++ b/imports/plugins/core/checkout/client/templates/checkout/shipping/shipping.js
@@ -8,7 +8,7 @@ import { Template } from "meteor/templating";
// cartShippingMethods to get current shipment methods
// until we handle multiple methods, we just use the first
function cartShippingMethods(currentCart) {
- let cart = currentCart || Cart.findOne();
+ const cart = currentCart || Cart.findOne();
if (cart) {
if (cart.shipping) {
if (cart.shipping[0].shipmentQuotes) {
@@ -21,7 +21,7 @@ function cartShippingMethods(currentCart) {
// getShipmentMethod to get current shipment method
// until we handle multiple methods, we just use the first
function getShipmentMethod(currentCart) {
- let cart = currentCart || Cart.findOne();
+ const cart = currentCart || Cart.findOne();
if (cart) {
if (cart.shipping) {
if (cart.shipping[0].shipmentMethod) {
@@ -58,8 +58,8 @@ Template.coreCheckoutShipping.helpers({
// helper to display currently selected shipmentMethod
isSelected: function () {
- let self = this;
- let shipmentMethod = getShipmentMethod();
+ const self = this;
+ const shipmentMethod = getShipmentMethod();
// if there is already a selected method, set active
if (_.isEqual(self.method, shipmentMethod)) {
return "active";
@@ -77,8 +77,8 @@ Template.coreCheckoutShipping.events({
"click .list-group-item": function (event) {
event.preventDefault();
event.stopPropagation();
- let self = this;
- let cart = Cart.findOne();
+ const self = this;
+ const cart = Cart.findOne();
try {
Meteor.call("cart/setShipmentMethod", cart._id, self.method);
diff --git a/imports/plugins/core/checkout/server/methods/workflow.js b/imports/plugins/core/checkout/server/methods/workflow.js
index 5dc2e1ac6a2..b75e232a6db 100644
--- a/imports/plugins/core/checkout/server/methods/workflow.js
+++ b/imports/plugins/core/checkout/server/methods/workflow.js
@@ -27,7 +27,7 @@ Meteor.methods({
this.unblock();
let currentCart;
- let defaultPackageWorkflows = [];
+ const defaultPackageWorkflows = [];
let nextWorkflowStep = {
template: ""
};
@@ -46,8 +46,8 @@ Meteor.methods({
// exit if a cart doesn't exist.
if (!currentCart) return [];
// TODO doc this
- let currentWorkflowStatus = currentCart.workflow.status;
- let packages = Packages.find({
+ const currentWorkflowStatus = currentCart.workflow.status;
+ const packages = Packages.find({
"shopId": Reaction.getShopId(),
"layout.workflow": workflow
});
@@ -56,14 +56,14 @@ Meteor.methods({
packages.forEach(function (reactionPackage) {
// todo fix this hack for not filtering nicely
if (!reactionPackage.layout.layout) {
- let layouts = _.filter(reactionPackage.layout, {
+ const layouts = _.filter(reactionPackage.layout, {
workflow: workflow
});
// for every layout, process the associated workflows
_.each(layouts, function (layout) {
// audience is the layout permissions
if (typeof layout.audience !== "object") {
- let defaultRoles = Shops.findOne(
+ const defaultRoles = Shops.findOne(
Reaction.getShopId(), {
sort: {
priority: 1
@@ -148,7 +148,7 @@ Meteor.methods({
Logger.debug(
`######## Condition One #########: initialise the ${currentCart._id} ${workflow}: ${defaultPackageWorkflows[0].template}`
);
- let result = Cart.update(currentCart._id, {
+ const result = Cart.update(currentCart._id, {
$set: {
"workflow.status": defaultPackageWorkflows[0].template
}
@@ -322,7 +322,7 @@ Meteor.methods({
const items = order.items.map((item) => {
// Add the current status to completed workflows
if (item.workflow.status !== "new") {
- let workflows = item.workflow.workflow || [];
+ const workflows = item.workflow.workflow || [];
workflows.push(status);
item.workflow.workflow = _.uniq(workflows);
diff --git a/imports/plugins/core/dashboard/client/templates/import/import.js b/imports/plugins/core/dashboard/client/templates/import/import.js
index b81e8ac6d99..f37ce9e9b42 100644
--- a/imports/plugins/core/dashboard/client/templates/import/import.js
+++ b/imports/plugins/core/dashboard/client/templates/import/import.js
@@ -2,12 +2,12 @@ import { Reaction } from "/client/api";
import { Media, Products } from "/lib/collections";
function uploadHandler(event) {
- let shopId = Reaction.getShopId();
- let userId = Meteor.userId();
- let files = event.target.files.files;
+ const shopId = Reaction.getShopId();
+ const userId = Meteor.userId();
+ const files = event.target.files.files;
for (let i = 0; i < files.length; i++) {
- let parts = files[i].name.split(".");
+ const parts = files[i].name.split(".");
let product;
if (parts[0]) {
product = Products.findOne({
@@ -21,8 +21,7 @@ function uploadHandler(event) {
});
}
if (product) {
- let fileObj;
- fileObj = new FS.File(files[i]);
+ const fileObj = new FS.File(files[i]);
fileObj.metadata = {
ownerId: userId,
productId: product._id,
diff --git a/imports/plugins/core/dashboard/client/templates/packages/grid/package.js b/imports/plugins/core/dashboard/client/templates/packages/grid/package.js
index 9ea8b476a58..159454a7f7c 100644
--- a/imports/plugins/core/dashboard/client/templates/packages/grid/package.js
+++ b/imports/plugins/core/dashboard/client/templates/packages/grid/package.js
@@ -39,7 +39,7 @@ Template.gridPackage.helpers({
name: data.package.packageName
});
- let controls = [];
+ const controls = [];
if (data.package.priority > 1) {
controls.push({
@@ -55,7 +55,7 @@ Template.gridPackage.helpers({
});
}
- for (let app of apps) {
+ for (const app of apps) {
controls.push({
icon: app.icon || "fa fa-cog fa-fw",
onClick() {
diff --git a/imports/plugins/core/dashboard/client/templates/shop/settings/settings.js b/imports/plugins/core/dashboard/client/templates/shop/settings/settings.js
index 65844a8ed61..6b7cdcb00e2 100644
--- a/imports/plugins/core/dashboard/client/templates/shop/settings/settings.js
+++ b/imports/plugins/core/dashboard/client/templates/shop/settings/settings.js
@@ -4,7 +4,7 @@ import { Media, Packages, Shops } from "/lib/collections";
Template.shopBrandImageOption.helpers({
cardProps(data) {
- let props = {
+ const props = {
controls: []
};
@@ -110,7 +110,7 @@ Template.shopSettings.helpers({
const shopId = Reaction.getShopId();
return (files) => {
- for (let file of files) {
+ for (const file of files) {
file.metadata = {
type: "brandAsset",
ownerId: userId,
@@ -142,7 +142,7 @@ Template.shopSettings.helpers({
}];
if (paymentMethods && _.isArray(paymentMethods)) {
- for (let method of paymentMethods) {
+ for (const method of paymentMethods) {
options.push({
label: i18next.t(method.i18nKeyLabel),
value: method.packageName
diff --git a/imports/plugins/core/layout/client/templates/layout/admin/admin.js b/imports/plugins/core/layout/client/templates/layout/admin/admin.js
index a1ed2678aeb..dab2a073c23 100644
--- a/imports/plugins/core/layout/client/templates/layout/admin/admin.js
+++ b/imports/plugins/core/layout/client/templates/layout/admin/admin.js
@@ -1,10 +1,10 @@
import Drop from "tether-drop";
import { Meteor } from "meteor/meteor";
-import { Session } from "meteor/session";
+import { Blaze } from "meteor/blaze";
import { Template } from "meteor/templating";
import { Reaction, i18next } from "/client/api";
import { Packages } from "/lib/collections";
-import { Blaze } from "meteor/blaze";
+
Template.coreAdminLayout.onRendered(function () {
$("body").addClass("admin");
@@ -23,10 +23,10 @@ Template.coreAdminLayout.helpers({
container: undefined
});
- let items = [];
+ const items = [];
if (_.isArray(shortcuts)) {
- for (let shortcut of shortcuts) {
+ for (const shortcut of shortcuts) {
items.push({
type: "link",
href: Reaction.Router.pathFor(shortcut.name),
@@ -80,9 +80,9 @@ Template.coreAdminLayout.helpers({
if (routeName !== "dashboard") {
const registryItems = Reaction.Apps({provides: "settings", container: routeName});
- let buttons = [];
+ const buttons = [];
- for (let item of registryItems) {
+ for (const item of registryItems) {
if (Reaction.hasPermission(item.route, Meteor.userId())) {
let icon = item.icon;
@@ -104,6 +104,7 @@ Template.coreAdminLayout.helpers({
return buttons;
}
+ return [];
},
control: function () {
diff --git a/imports/plugins/core/layout/client/templates/layout/alerts/alerts.js b/imports/plugins/core/layout/client/templates/layout/alerts/alerts.js
index 33a8e959446..6ee6766af14 100644
--- a/imports/plugins/core/layout/client/templates/layout/alerts/alerts.js
+++ b/imports/plugins/core/layout/client/templates/layout/alerts/alerts.js
@@ -8,8 +8,8 @@ Template.inlineAlert.onCreated(function () {
});
Template.inlineAlert.onRendered(function () {
- let alert = this.data;
- let $node = $(this.firstNode);
+ const alert = this.data;
+ const $node = $(this.firstNode);
Meteor.defer(function () {
Alerts.collection_.update(alert._id, {
diff --git a/imports/plugins/core/layout/client/templates/layout/alerts/reactionAlerts.js b/imports/plugins/core/layout/client/templates/layout/alerts/reactionAlerts.js
index 2cfff5b03cd..2e7e26701de 100644
--- a/imports/plugins/core/layout/client/templates/layout/alerts/reactionAlerts.js
+++ b/imports/plugins/core/layout/client/templates/layout/alerts/reactionAlerts.js
@@ -73,12 +73,12 @@ Object.assign(Alerts, {
});
}
- let title = titleOrOptions;
- let message = messageOrCallback;
+ const title = titleOrOptions;
+ const message = messageOrCallback;
return swal({
title,
- message,
+ text: message,
type: "info",
...options
}).then((isConfirm) => {
diff --git a/imports/plugins/core/orders/client/templates/list/items.js b/imports/plugins/core/orders/client/templates/list/items.js
index 4444216845b..2d5ba1ab10e 100644
--- a/imports/plugins/core/orders/client/templates/list/items.js
+++ b/imports/plugins/core/orders/client/templates/list/items.js
@@ -28,12 +28,12 @@ Template.ordersListItems.helpers({
items() {
const { order } = Template.instance().data;
- let combinedItems = [];
+ const combinedItems = [];
if (order) {
// Lopp through all items in the order. The items are split into indivital items
- for (let orderItem of order.items) {
+ for (const orderItem of order.items) {
// Find an exising item in the combinedItems array
const foundItem = combinedItems.find((combinedItem) => {
// If and item variant exists, then we return true
diff --git a/imports/plugins/core/orders/client/templates/list/ordersList.js b/imports/plugins/core/orders/client/templates/list/ordersList.js
index b6bc9968a0f..108ac46300d 100644
--- a/imports/plugins/core/orders/client/templates/list/ordersList.js
+++ b/imports/plugins/core/orders/client/templates/list/ordersList.js
@@ -30,7 +30,7 @@ Template.dashboardOrdersList.helpers({
return this.shipping[0].shipmentMethod.tracking;
},
shopName() {
- let shop = Shops.findOne(this.shopId);
+ const shop = Shops.findOne(this.shopId);
return shop !== null ? shop.name : void 0;
}
});
diff --git a/imports/plugins/core/orders/client/templates/orderPage/orderPage.js b/imports/plugins/core/orders/client/templates/orderPage/orderPage.js
index 2b4b4633fbd..3ddb887ab00 100644
--- a/imports/plugins/core/orders/client/templates/orderPage/orderPage.js
+++ b/imports/plugins/core/orders/client/templates/orderPage/orderPage.js
@@ -27,7 +27,7 @@ Template.orderPage.events({
"click .btn-add-note": function (event, template) {
const date = new Date();
const content = template.find("textarea[name=note]").value;
- let note = {
+ const note = {
content: content,
userId: Meteor.userId(),
updatedAt: date
diff --git a/imports/plugins/core/orders/client/templates/orders.js b/imports/plugins/core/orders/client/templates/orders.js
index 6bf6b091a38..7b82daeb3f9 100644
--- a/imports/plugins/core/orders/client/templates/orders.js
+++ b/imports/plugins/core/orders/client/templates/orders.js
@@ -21,58 +21,58 @@ const OrderHelper = {
switch (filter) {
// New orders
- case "new":
- query = {
- "workflow.status": "new"
- };
- break;
+ case "new":
+ query = {
+ "workflow.status": "new"
+ };
+ break;
// Orders that have yet to be captured & shipped
- case "processing":
- query = {
- "workflow.status": "coreOrderWorkflow/processing"
- };
- break;
+ case "processing":
+ query = {
+ "workflow.status": "coreOrderWorkflow/processing"
+ };
+ break;
// Orders that have been shipped, based on if the items have been shipped
- case "shipped":
- query = {
- "items.workflow.status": "coreOrderItemWorkflow/shipped"
- };
- break;
+ case "shipped":
+ query = {
+ "items.workflow.status": "coreOrderItemWorkflow/shipped"
+ };
+ break;
// Orders that are complete, including all items with complete status
- case "completed":
- query = {
- "workflow.status": "coreOrderWorkflow/completed",
- "items.workflow.workflow": {
- $in: ["coreOrderItemWorkflow/completed"]
- }
- };
- break;
+ case "completed":
+ query = {
+ "workflow.status": "coreOrderWorkflow/completed",
+ "items.workflow.workflow": {
+ $in: ["coreOrderItemWorkflow/completed"]
+ }
+ };
+ break;
// Orders that have been captured, but not yet shipped
- case "captured":
- query = {
- "billing.paymentMethod.status": "completed",
- "shipping.shipped": false
- };
- break;
-
- case "canceled":
- query = {
- "workflow.status": "canceled"
- };
- break;
+ case "captured":
+ query = {
+ "billing.paymentMethod.status": "completed",
+ "shipping.shipped": false
+ };
+ break;
+
+ case "canceled":
+ query = {
+ "workflow.status": "canceled"
+ };
+ break;
// Orders that have been refunded partially or fully
- case "refunded":
- query = {
- "billing.paymentMethod.status": "captured",
- "shipping.shipped": true
- };
- break;
- default:
+ case "refunded":
+ query = {
+ "billing.paymentMethod.status": "captured",
+ "shipping.shipped": true
+ };
+ break;
+ default:
}
return query;
@@ -132,7 +132,7 @@ Template.orders.helpers({
},
currentFilterLabel() {
- let foundFilter = _.find(orderFilters, (filter) => {
+ const foundFilter = _.find(orderFilters, (filter) => {
return filter.name === Reaction.Router.getQueryParam("filter");
});
@@ -307,7 +307,7 @@ Template.orderStatusDetail.helpers({
const self = this;
const shipment = this.shipping[0];
const shipped = _.every(shipment.items, (shipmentItem) => {
- for (let fullItem of self.items) {
+ for (const fullItem of self.items) {
if (fullItem._id === shipmentItem._id) {
if (fullItem.workflow) {
if (_.isArray(fullItem.workflow.workflow)) {
diff --git a/imports/plugins/core/orders/client/templates/workflow/shippingInvoice.js b/imports/plugins/core/orders/client/templates/workflow/shippingInvoice.js
index fa576a5d917..2e7d4bc830f 100644
--- a/imports/plugins/core/orders/client/templates/workflow/shippingInvoice.js
+++ b/imports/plugins/core/orders/client/templates/workflow/shippingInvoice.js
@@ -307,7 +307,7 @@ Template.coreOrderShippingInvoice.helpers({
},
refunds() {
- let refunds = Template.instance().refunds.get();
+ const refunds = Template.instance().refunds.get();
if (_.isArray(refunds)) {
return refunds.reverse();
@@ -364,7 +364,7 @@ Template.coreOrderShippingInvoice.helpers({
const instance = Template.instance();
const order = instance.state.get("order");
- let shipment = _.filter(order.shipping, {_id: currentData.fulfillment._id})[0];
+ const shipment = _.filter(order.shipping, {_id: currentData.fulfillment._id})[0];
return shipment;
},
@@ -375,8 +375,8 @@ Template.coreOrderShippingInvoice.helpers({
const currentData = Template.currentData();
const shipment = currentData.fulfillment;
- let items = _.map(shipment.items, (item) => {
- let originalItem = _.find(order.items, {
+ const items = _.map(shipment.items, (item) => {
+ const originalItem = _.find(order.items, {
_id: item._id
});
return _.extend(originalItem, item);
@@ -397,7 +397,7 @@ Template.coreOrderShippingInvoice.helpers({
variantId = variantObjectOrId._id;
}
- let defaultImage = Media.findOne({
+ const defaultImage = Media.findOne({
"metadata.variantId": variantId,
"metadata.priority": 0
});
diff --git a/imports/plugins/core/orders/client/templates/workflow/shippingSummary.js b/imports/plugins/core/orders/client/templates/workflow/shippingSummary.js
index 279a148753e..de1c7443c04 100644
--- a/imports/plugins/core/orders/client/templates/workflow/shippingSummary.js
+++ b/imports/plugins/core/orders/client/templates/workflow/shippingSummary.js
@@ -6,8 +6,8 @@ import { i18next } from "/client/api";
import { Orders } from "/lib/collections";
Template.coreOrderShippingSummary.onCreated(() => {
- let template = Template.instance();
- let currentData = Template.currentData();
+ const template = Template.instance();
+ const currentData = Template.currentData();
template.orderDep = new Tracker.Dependency;
@@ -29,8 +29,8 @@ Template.coreOrderShippingSummary.onCreated(() => {
*/
Template.coreOrderShippingSummary.onRendered(function () {
- let template = Template.instance();
- let order = template.order;
+ const template = Template.instance();
+ const order = template.order;
if (order.workflow) {
if (order.workflow.status === "coreOrderCreated") {
@@ -53,7 +53,7 @@ Template.coreOrderShippingSummary.events({
Template.coreOrderShippingSummary.helpers({
order() {
- let template = Template.instance();
+ const template = Template.instance();
return template.order;
},
shipment() {
@@ -69,7 +69,7 @@ Template.coreOrderShippingSummary.helpers({
},
tracking() {
- let shipment = Template.instance().order.shipping[0];
+ const shipment = Template.instance().order.shipping[0];
if (shipment.tracking) {
return shipment.tracking;
}
@@ -80,7 +80,7 @@ Template.coreOrderShippingSummary.helpers({
const order = Template.instance().order;
const shipment = Template.instance().order.shipping[0];
const shipped = _.every(shipment.items, (shipmentItem) => {
- for (let fullItem of order.items) {
+ for (const fullItem of order.items) {
if (fullItem._id === shipmentItem._id) {
if (fullItem.workflow) {
if (_.isArray(fullItem.workflow.workflow)) {
diff --git a/imports/plugins/core/orders/client/templates/workflow/shippingTracking.js b/imports/plugins/core/orders/client/templates/workflow/shippingTracking.js
index 1588d2af072..7caf81c0293 100644
--- a/imports/plugins/core/orders/client/templates/workflow/shippingTracking.js
+++ b/imports/plugins/core/orders/client/templates/workflow/shippingTracking.js
@@ -5,8 +5,8 @@ import { Template } from "meteor/templating";
import { Orders } from "/lib/collections";
Template.coreOrderShippingTracking.onCreated(() => {
- let template = Template.instance();
- let currentData = Template.currentData();
+ const template = Template.instance();
+ const currentData = Template.currentData();
template.orderDep = new Tracker.Dependency;
template.showTrackingEditForm = ReactiveVar(false);
@@ -30,13 +30,13 @@ Template.coreOrderShippingTracking.onCreated(() => {
*/
Template.coreOrderShippingTracking.events({
"click [data-event-action=shipmentShipped]": function () {
- let template = Template.instance();
+ const template = Template.instance();
Meteor.call("orders/shipmentShipped", template.order, template.order.shipping[0]);
// Meteor.call("workflow/pushOrderShipmentWorkflow", "coreOrderShipmentWorkflow", "orderShipped", this._id);
},
"click [data-event-action=resendNotification]": function () {
- let template = Template.instance();
+ const template = Template.instance();
Meteor.call("orders/sendNotification", template.order, (err) => {
if (err) {
Alerts.toast("Server Error: Can't send email notification.", "error");
@@ -110,7 +110,7 @@ Template.coreOrderShippingTracking.helpers({
},
editTracking() {
- let template = Template.instance();
+ const template = Template.instance();
if (!template.order.shipping[0].tracking || template.showTrackingEditForm.get()) {
return true;
}
@@ -123,8 +123,8 @@ Template.coreOrderShippingTracking.helpers({
return Template.instance().order.shipping[0];
},
shipmentReady() {
- let order = Template.instance().order;
- let shipment = order.shipping[0];
+ const order = Template.instance().order;
+ const shipment = order.shipping[0];
return shipment.packed && shipment.tracking;
}
diff --git a/imports/plugins/core/orders/client/templates/workflow/workflow.js b/imports/plugins/core/orders/client/templates/workflow/workflow.js
index 71c6f74d2c5..65b747f7db1 100644
--- a/imports/plugins/core/orders/client/templates/workflow/workflow.js
+++ b/imports/plugins/core/orders/client/templates/workflow/workflow.js
@@ -34,7 +34,7 @@ Template.coreOrderWorkflow.helpers({
* @return {Object|Boolean} An order or false
*/
order() {
- let id = Reaction.Router.getQueryParam("_id");
+ const id = Reaction.Router.getQueryParam("_id");
if (id) {
return Orders.findOne(id);
}
@@ -56,7 +56,7 @@ Template.coreOrderWorkflow.helpers({
* @return {String|Boolean} order completion status or false
*/
isCompleted() {
- let order = Template.parentData(1);
+ const order = Template.parentData(1);
if (this.status === true) {
return order.workflow.status;
}
diff --git a/imports/plugins/core/orders/server/startup.js b/imports/plugins/core/orders/server/startup.js
index 01892d6f87c..2bf9c2b2ca0 100644
--- a/imports/plugins/core/orders/server/startup.js
+++ b/imports/plugins/core/orders/server/startup.js
@@ -31,8 +31,8 @@ Orders.before.update((userId, order, fieldNames, modifier) => {
if (modifier.$set) {
// Updating status of order e.g. "coreOrderWorkflow/processing"
if (modifier.$set["workflow.status"]) {
- let status = modifier.$set["workflow.status"];
- let workflowMethod = `workflow/${status}`;
+ const status = modifier.$set["workflow.status"];
+ const workflowMethod = `workflow/${status}`;
if (Meteor.server.method_handlers[workflowMethod]) {
const result = Meteor.call(workflowMethod, {
diff --git a/imports/plugins/core/taxes/client/settings/custom.js b/imports/plugins/core/taxes/client/settings/custom.js
index 669edf65491..beb1e0b212e 100644
--- a/imports/plugins/core/taxes/client/settings/custom.js
+++ b/imports/plugins/core/taxes/client/settings/custom.js
@@ -140,7 +140,7 @@ Template.customTaxRates.helpers({
const shop = Shops.findOne();
const instance = Template.instance();
const id = instance.state.get("editingId");
- let tax = Taxes.findOne(id) || {};
+ const tax = Taxes.findOne(id) || {};
// enforce a default country that makes sense.
if (!tax.country) {
if (shop && typeof shop.addressBook === "object") {
@@ -161,7 +161,7 @@ Template.customTaxRates.helpers({
value: "RC_NOTAX"
}];
- for (let taxCode of taxCodes) {
+ for (const taxCode of taxCodes) {
options.push({
label: i18next.t(taxCode.label),
value: taxCode.id
diff --git a/imports/plugins/core/taxes/client/settings/settings.js b/imports/plugins/core/taxes/client/settings/settings.js
index eea7bd5cc92..4dddbacb2c8 100644
--- a/imports/plugins/core/taxes/client/settings/settings.js
+++ b/imports/plugins/core/taxes/client/settings/settings.js
@@ -53,7 +53,7 @@ Template.taxSettings.helpers({
value: "none"
}];
- for (let taxCode of taxCodes) {
+ for (const taxCode of taxCodes) {
options.push({
label: i18next.t(taxCode.label),
value: taxCode.id
@@ -104,8 +104,8 @@ Template.taxSettings.events({
* @return {void}
*/
"click [data-event-action=showSecret]": (event) => {
- let button = $(event.currentTarget);
- let input = button.closest(".form-group").find("input[name=secret]");
+ const button = $(event.currentTarget);
+ const input = button.closest(".form-group").find("input[name=secret]");
if (input.attr("type") === "password") {
input.attr("type", "text");
diff --git a/imports/plugins/core/taxes/server/methods/methods.js b/imports/plugins/core/taxes/server/methods/methods.js
index f9d6da9970d..48ed1410d31 100644
--- a/imports/plugins/core/taxes/server/methods/methods.js
+++ b/imports/plugins/core/taxes/server/methods/methods.js
@@ -111,7 +111,7 @@ export const methods = {
let customTaxRate = 0;
let totalTax = 0;
// lookup custom tax rate
- let addressTaxData = Taxes.find(
+ const addressTaxData = Taxes.find(
{
$and: [{
$or: [{
@@ -140,7 +140,7 @@ export const methods = {
}
// calculate line item taxes
- for (let items of cartToCalc.items) {
+ for (const items of cartToCalc.items) {
// only processs taxable products
if (items.variants.taxable === true) {
const subTotal = items.variants.price * items.quantity;
diff --git a/imports/plugins/core/ui-navbar/client/components/i18n/i18n.js b/imports/plugins/core/ui-navbar/client/components/i18n/i18n.js
index 6ca5613618a..2ee34890b25 100644
--- a/imports/plugins/core/ui-navbar/client/components/i18n/i18n.js
+++ b/imports/plugins/core/ui-navbar/client/components/i18n/i18n.js
@@ -8,10 +8,10 @@ import { Template } from "meteor/templating";
Template.CoreNavigationLanguage.helpers({
languages: function () {
- let languages = [];
- let shop = Shops.findOne();
+ const languages = [];
+ const shop = Shops.findOne();
if (typeof shop === "object" && shop.languages) {
- for (let language of shop.languages) {
+ for (const language of shop.languages) {
if (language.enabled === true) {
language.translation = "languages." + language.label.toLowerCase();
languages.push(language);
diff --git a/imports/plugins/core/ui-tagnav/client/components/tagNav/tagNav.js b/imports/plugins/core/ui-tagnav/client/components/tagNav/tagNav.js
index f3f1891e08a..311d72a7c59 100644
--- a/imports/plugins/core/ui-tagnav/client/components/tagNav/tagNav.js
+++ b/imports/plugins/core/ui-tagnav/client/components/tagNav/tagNav.js
@@ -1,7 +1,7 @@
import Sortable from "sortablejs";
-import { TagHelpers } from "/imports/plugins/core/ui-tagnav/client/helpers";
-import { Session } from "meteor/session";
import { Template } from "meteor/templating";
+import { ReactiveDict } from "meteor/reactive-dict";
+import { TagHelpers } from "/imports/plugins/core/ui-tagnav/client/helpers";
import { IconButton } from "/imports/plugins/core/ui/client/components";
const NavbarStates = {
@@ -142,13 +142,14 @@ Template.tagNav.onRendered(() => {
group: "tags",
handle: ".js-tagNav-item",
onSort(event) {
- let tagIds = instance.data.tags.map(item => {
+ const tagIds = instance.data.tags.map(item => {
if (item) {
return item._id;
}
+ return null;
});
- let newTagsOrder = instance.moveItem(tagIds, event.oldIndex, event.newIndex);
+ const newTagsOrder = instance.moveItem(tagIds, event.oldIndex, event.newIndex);
if (newTagsOrder) {
TagNavHelpers.onTagSort(newTagsOrder, instance.data.parentTag);
@@ -159,10 +160,11 @@ Template.tagNav.onRendered(() => {
onAdd(event) {
const toListId = event.to.dataset.id;
const movedTagId = event.item.dataset.id;
- let tagIds = instance.data.tags.map(item => {
+ const tagIds = instance.data.tags.map(item => {
if (item) {
return item._id;
}
+ return null;
});
TagNavHelpers.onTagDragAdd(movedTagId, toListId, event.newIndex, tagIds);
@@ -171,7 +173,7 @@ Template.tagNav.onRendered(() => {
// Tag removed from list becuase it was dragged to a different list
onRemove(event) {
const movedTagId = event.item.dataset.id;
- let foundTag = _.find(instance.data.tags, (tag) => {
+ const foundTag = _.find(instance.data.tags, (tag) => {
return tag._id === movedTagId;
});
diff --git a/imports/plugins/core/ui-tagnav/client/components/tagTree/tagTree.js b/imports/plugins/core/ui-tagnav/client/components/tagTree/tagTree.js
index 8ef31ca55d1..c4fd6e7a03e 100644
--- a/imports/plugins/core/ui-tagnav/client/components/tagTree/tagTree.js
+++ b/imports/plugins/core/ui-tagnav/client/components/tagTree/tagTree.js
@@ -10,13 +10,13 @@ Template.tagTree.onRendered(() => {
handle: ".js-drag-handle",
draggable: ".rui.grouptag",
onSort(event) {
- let tagIds = instance.data.subTagGroups.map(item => {
+ const tagIds = instance.data.subTagGroups.map(item => {
if (item) {
return item._id;
}
});
- let newTagsOrder = TagHelpers.moveItem(tagIds, event.oldIndex, event.newIndex);
+ const newTagsOrder = TagHelpers.moveItem(tagIds, event.oldIndex, event.newIndex);
if (newTagsOrder) {
if (instance.data.onTagSort) {
@@ -29,7 +29,7 @@ Template.tagTree.onRendered(() => {
onAdd(event) {
const toListId = event.to.dataset.id;
const movedTagId = event.item.dataset.id;
- let tagIds = instance.data.subTagGroups.map(item => {
+ const tagIds = instance.data.subTagGroups.map(item => {
if (item) {
return item._id;
}
@@ -45,7 +45,7 @@ Template.tagTree.onRendered(() => {
const movedTagId = event.item.dataset.id;
if (instance.data.onTagRemove) {
- let foundTag = _.find(instance.data.subTagGroups, (tag) => {
+ const foundTag = _.find(instance.data.subTagGroups, (tag) => {
return tag._id === movedTagId;
});
diff --git a/imports/plugins/core/ui-tagnav/client/helpers/tags.js b/imports/plugins/core/ui-tagnav/client/helpers/tags.js
index 7c2a02cd40b..6f5ab67c008 100644
--- a/imports/plugins/core/ui-tagnav/client/helpers/tags.js
+++ b/imports/plugins/core/ui-tagnav/client/helpers/tags.js
@@ -102,6 +102,10 @@ export const TagHelpers = {
});
},
+ /* eslint no-unused-vars: 0 */
+ //
+ // TODO review toIndex, ofList variable implementation in tags.js moveTagToNewParent
+ //
moveTagToNewParent(movedTagId, toListId, toIndex, ofList) {
if (movedTagId) {
if (toListId) {
@@ -126,13 +130,14 @@ export const TagHelpers = {
return result;
}
+ return 0;
},
sortTags(tagIds, parentTag) {
if (_.isArray(tagIds)) {
if (_.isEmpty(parentTag)) {
// Top level tags
- for (let tagId of tagIds) {
+ for (const tagId of tagIds) {
Tags.update(tagId, {
$set: {
position: tagIds.indexOf(tagId)
diff --git a/imports/plugins/core/ui/client/components/button/button.js b/imports/plugins/core/ui/client/components/button/button.js
index 2e3820c7d19..18ebc117555 100644
--- a/imports/plugins/core/ui/client/components/button/button.js
+++ b/imports/plugins/core/ui/client/components/button/button.js
@@ -1,8 +1,8 @@
import _ from "lodash";
+import Tooltip from "tether-tooltip";
import { Template } from "meteor/templating";
import { i18next, i18nextDep } from "/client/api";
import { Icon } from "/imports/plugins/core/ui/client/components";
-import Tooltip from "tether-tooltip";
Template.button.onRendered(function () {
const buttonElement = this.$("button, a")[0];
@@ -26,6 +26,10 @@ Template.button.onRendered(function () {
});
});
+/* eslint no-unused-vars: 1 */
+//
+// TODO review Template.button helpers for unused elementProps
+//
Template.button.helpers({
iconComponent() {
return Icon;
diff --git a/imports/plugins/core/ui/client/components/button/iconButton.js b/imports/plugins/core/ui/client/components/button/iconButton.js
index 72c42ee2b82..657163a71a5 100644
--- a/imports/plugins/core/ui/client/components/button/iconButton.js
+++ b/imports/plugins/core/ui/client/components/button/iconButton.js
@@ -1,3 +1,7 @@
+/* eslint no-unused-vars: 1 */
+//
+// TODO review PropTypes import in iconButton.js
+//
import React, { Component, PropTypes } from "react";
import classnames from "classnames";
import Button from "./button.jsx";
@@ -15,7 +19,7 @@ class IconButton extends Component {
"rui": true,
"button": true,
"edit": true,
- "variant-edit": true,
+ "variant-edit": true
// "btn-success": isEditing
});
diff --git a/imports/plugins/core/ui/client/components/tags/tagItem.html b/imports/plugins/core/ui/client/components/tags/tagItem.html
index 89ca6cc1863..4332e55df2a 100644
--- a/imports/plugins/core/ui/client/components/tags/tagItem.html
+++ b/imports/plugins/core/ui/client/components/tags/tagItem.html
@@ -22,12 +22,9 @@