Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 18 #1516

Merged
merged 143 commits into from
Dec 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
8e54eeb
Register template (#1362)
mikemurray Oct 21, 2016
e48f466
Quick fixes for template registration (#1518)
mikemurray Oct 21, 2016
665432d
Remove unused imports
brent-hoover Oct 23, 2016
3789059
Add templates to database (#1522)
mikemurray Oct 24, 2016
1cb8eb8
Admin Invite & Password reset emails (#1523)
kieckhafer Oct 24, 2016
7c8c97a
Merge branch 'development' into release-0.18.0
mikemurray Oct 25, 2016
9e7fdca
update const to conform to new file name (#1528)
kieckhafer Oct 25, 2016
573b8a3
Merge branch 'development' into release-0.18.0
Oct 26, 2016
0fb4934
Merge branch 'development' into release-0.18.0
Nov 2, 2016
74781e7
Merge branch 'development' into release-0.18.0
Nov 7, 2016
c575fb5
Add registry settings to package
brent-hoover Nov 10, 2016
a2460a5
Conditionally show search
brent-hoover Nov 10, 2016
9c8a0af
Make naming consistent
brent-hoover Nov 10, 2016
ceb5395
Look up in registry to determine whether to show search, and if so wh…
brent-hoover Nov 10, 2016
b37401f
Merge branch 'release-0.18.0' into brent-fix-issue-1399
brent-hoover Nov 10, 2016
ac2e313
Add migration to update existing registries
brent-hoover Nov 10, 2016
c9a56b2
Modify all search-ui record
brent-hoover Nov 10, 2016
2a40c57
Loop until missing record is available to modify
brent-hoover Nov 10, 2016
1962101
Logging
brent-hoover Nov 10, 2016
164a024
No hook, no conditional
brent-hoover Nov 10, 2016
13fe738
Make field label more explicit
brent-hoover Nov 10, 2016
41d1aff
Set name which is required for some reason
brent-hoover Nov 10, 2016
a504444
Make registry consistent with migration. I guess schema is not valida…
brent-hoover Nov 10, 2016
0473ffd
Remove logging
brent-hoover Nov 10, 2016
d8078af
Update package.json to reflect release number
brent-hoover Nov 10, 2016
8e5eb79
Discounts (#1556)
Nov 10, 2016
68dca93
PDP Package Layout - ReactionLayout (#1536)
mikemurray Nov 10, 2016
bca6752
More email templates (#1557)
kieckhafer Nov 10, 2016
86f52d2
Revision control for images (#1555)
brent-hoover Nov 10, 2016
1663824
Green flash on fields in PDP page after change success (#1558)
mikemurray Nov 10, 2016
c1eea40
Merge branch 'development' into release-0.18.0
kieckhafer Nov 10, 2016
eabddb7
Fixed broken PDP template
mikemurray Nov 10, 2016
a1dbed3
Patched 0.18 tests (#1566)
Nov 11, 2016
bc83c9e
move discount rates to catalog/codes to payments
Nov 11, 2016
b7db046
restore default method data
Nov 11, 2016
1c344f8
Expandable cards
mikemurray Nov 11, 2016
2dca13a
Loading component added for reactionLayout
mikemurray Nov 11, 2016
1bc4f9d
Add missing NPM dependency
mikemurray Nov 11, 2016
02cfdd2
Merge branch 'release-0.18.0' into discount-code-payments
Nov 12, 2016
b9e0aeb
Meteor 1.4.2.1 (#1575)
Nov 13, 2016
6aa638e
Merge branch 'release-0.18.0' into discount-code-payments
Nov 13, 2016
b4c537c
Use App helper rather than ad-hoc query
brent-hoover Nov 13, 2016
be6cf6e
Merge branch 'release-0.18.0' into brent-fix-issue-1399
brent-hoover Nov 13, 2016
2f08e7a
Loading component added for reactionLayout (#1570)
Nov 14, 2016
4026db8
change templates importing to use Assets collection
kieckhafer Nov 15, 2016
92f857e
renamed templates function
kieckhafer Nov 15, 2016
a4cd2c8
fixed listing errors
kieckhafer Nov 15, 2016
a32f33c
add flush & changed onCoreInit -> afterCoreInit
kieckhafer Nov 15, 2016
b9f044f
removed isOriginalTemplate, which is no longer used
kieckhafer Nov 15, 2016
5c2703e
InitTemplates() -> initTemplates()
kieckhafer Nov 15, 2016
1568d06
Change templates importing to use Assets collection (#1583)
brent-hoover Nov 15, 2016
bfabfa6
move import settings (#1573)
Nov 15, 2016
158cc8a
Update Order Progress Workflow (#1580)
kieckhafer Nov 15, 2016
e6c3d34
PDP 500 (#1572)
mikemurray Nov 15, 2016
66d0aff
i18n updates for the Templates package (#1571)
kieckhafer Nov 15, 2016
f19f739
Fix remove icon not displaying / revision change (#1564)
brent-hoover Nov 15, 2016
9ace63d
Merge pull request #1561 from reactioncommerce/brent-fix-issue-1399
Nov 15, 2016
b5b5077
updated subject to use SSR
kieckhafer Nov 15, 2016
48428ed
update templates to use SSR
kieckhafer Nov 15, 2016
0ab2a60
update templates to use SSR
kieckhafer Nov 15, 2016
1766913
added new field to update
kieckhafer Nov 15, 2016
e7360a1
update schema for email templates
kieckhafer Nov 15, 2016
66d957f
removed unused fields
kieckhafer Nov 15, 2016
2c5c853
converted old shipping code to email template
kieckhafer Nov 15, 2016
df0e9ee
Merge branch 'release-0.18.0' into pdp-accordian
mikemurray Nov 15, 2016
17585fb
Merge branch 'release-0.18.0' into discount-code-payments
Nov 15, 2016
a200f2a
Added ecmascript dependency to gridfs package
mikemurray Nov 15, 2016
7d61088
Merge branch 'release-0.18.0' into pdp-accordian
mikemurray Nov 15, 2016
8303570
updated npm dependencies
Nov 15, 2016
94c3c99
Merge branch 'release-0.18.0' into discount-code-payments
Nov 15, 2016
59ad510
removed no longer needs isOriginalTemplate
kieckhafer Nov 15, 2016
ea5d6ba
remove old console.logs
kieckhafer Nov 15, 2016
010dfa4
fixed type
kieckhafer Nov 15, 2016
0eb19c2
add ecmascript to gridfs to enable strict
kieckhafer Nov 15, 2016
dccecb9
Fixed issue with closing cards on edit
mikemurray Nov 15, 2016
ca440d2
fixed prop validation
mikemurray Nov 15, 2016
3b48518
Merge branch 'release-0.18.0' into pdp-accordian
mikemurray Nov 15, 2016
ac05694
updated welcome email to use SSR for subject
kieckhafer Nov 15, 2016
7edfff2
Upgrade to react-komposer v2
mikemurray Nov 16, 2016
2139098
Merge pull request #1587 from reactioncommerce/react-komposer-v2
Nov 16, 2016
7ddd725
Merge branch 'release-0.18.0' into pdp-accordian
mikemurray Nov 17, 2016
067a495
Fix alerts
kieckhafer Nov 17, 2016
7d1b0ae
New Email: Refunds
kieckhafer Nov 17, 2016
ce4f4a7
Merge branch 'release-0.18.0' into ek-more-emails
kieckhafer Nov 17, 2016
897739c
remove unused email templates
kieckhafer Nov 17, 2016
cd44c7c
finalizing email templates - recovery commit
kieckhafer Nov 17, 2016
181831f
email template registration
kieckhafer Nov 17, 2016
ef0b7da
linting fixes
kieckhafer Nov 17, 2016
a6947bc
launchdock verification email
kieckhafer Nov 17, 2016
cd55c28
removed errant console
kieckhafer Nov 17, 2016
097a8aa
subject update
kieckhafer Nov 17, 2016
4b4cd75
camelCasing some things
kieckhafer Nov 17, 2016
c046824
updated subject for unavailable templates
kieckhafer Nov 18, 2016
715cf0b
Merge pull request #1569 from reactioncommerce/pdp-accordian
Nov 18, 2016
bd30fd3
Merge branch 'release-0.18.0' into ek-more-emails
kieckhafer Nov 18, 2016
35c3082
Merge branch 'development' into release-0.18.0
Nov 18, 2016
1a74744
disabled form fields that shouldn't be touched
kieckhafer Nov 18, 2016
7375f35
send order notification when user adds email
kieckhafer Nov 18, 2016
3a780d5
[WIP] Updates to package registry
Nov 20, 2016
bfbc451
Merge remote-tracking branch 'origin/release-0.18.0' into package-set…
Nov 20, 2016
b35ffad
Merge pull request #1588 from reactioncommerce/ek-431-sendNotification
brent-hoover Nov 21, 2016
7ab967c
updated reaction Apps
Nov 22, 2016
e2d11a0
Merge pull request #1585 from reactioncommerce/ek-more-emails
Nov 22, 2016
b90e0f4
Merge remote-tracking branch 'origin/development' into release-0.18.0
Nov 22, 2016
ac48108
Merge remote-tracking branch 'origin/release-0.18.0' into package-set…
Nov 22, 2016
2e25174
Add localhost WS browser-policy
Nov 23, 2016
81893a7
Payment package updates, removes name
Nov 23, 2016
a4704d6
Move mergeDeep into /lib/api/helpers
Nov 24, 2016
b9865ed
Update settings handling
Nov 24, 2016
2869e66
Cleanup panels in payments, taxes
Nov 24, 2016
3d56c34
Updated package
Nov 25, 2016
5825750
PayPal as split payment methods
Nov 25, 2016
1588b3e
Add Month Translations to monthOptions helper
Nov 27, 2016
73561ed
updated payments styling, missing i18n
Nov 27, 2016
86d2199
object-curly-spacing lint rules applied
Nov 27, 2016
46ec4e6
Avoid localLocale.defineLocale warning
Nov 28, 2016
66a8f00
Clarify Auth.net credentials messaging
Nov 28, 2016
100bafe
Only display enabled payment methods to admin in checkout
Nov 28, 2016
ea74c21
Updated import/requires for moment
Nov 28, 2016
41aa37b
Updated translation
Nov 28, 2016
35cf759
Update styling for payment settings
Nov 28, 2016
a1bae0b
Merge pull request #1592 from reactioncommerce/package-settings
Nov 28, 2016
c957d67
Templates fixes (#1600)
kieckhafer Dec 6, 2016
7692a0f
Use description for HTML description (#1606)
brent-hoover Dec 7, 2016
b1bb1d5
Fix permissions on Order when "guest" user (#1607)
kieckhafer Dec 7, 2016
65fb85d
Don't publish changes on a product when product is not found (happens…
brent-hoover Dec 8, 2016
4e4a87c
Fix bug that causes duplicated variants to be missing images. (#1611)
mikemurray Dec 12, 2016
9395c97
Don't blank out titles (#1617)
brent-hoover Dec 13, 2016
348fa57
fix browser-policy for websockets in Safari
jshimko Dec 13, 2016
c44946c
Fix for page title not updating when selecting product. (#1623)
mikemurray Dec 14, 2016
ff17146
Default product to blank object for instances where it may be undefin…
mikemurray Dec 14, 2016
6d81917
Build index immediately on startup so that search doesn't throw an er…
brent-hoover Dec 15, 2016
05355bd
added audience permissions to registry schema, and Reaction.Apps now …
lcampanis Dec 16, 2016
68d0ba5
Fix typo in i18n file so that error message showed key instead of tex…
brent-hoover Dec 16, 2016
0bcebfb
audience is passed as an array to match any user role, excluded owner…
lcampanis Dec 17, 2016
0816308
Prerender.io Integration - Feature #1249 (#1643)
Dec 20, 2016
8217a5d
Move Template editing to Sidebar (#1612)
kieckhafer Dec 20, 2016
29053d7
Merge pull request #1639 from reactioncommerce/1622-audience-registry…
Dec 20, 2016
b8d0df1
Merge pull request #1629 from reactioncommerce/safari-browser-policy
Dec 20, 2016
9f52b67
Fix price updates (#1633)
kieckhafer Dec 20, 2016
5146b27
Checkout discount code input (#1620)
Dec 21, 2016
fe706f0
Merge branch 'development' into release-0.18.0
brent-hoover Dec 21, 2016
cfa89b0
Attempt to make tests more consistent (#1565)
brent-hoover Dec 21, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
/**
* ES6
*/
"object-curly-spacing": ["error", "always", { "objectsInObjects": true }],
"no-var": 2, // http://eslint.org/docs/rules/no-var

/**
* Variables
*/
Expand Down
4 changes: 2 additions & 2 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ kadira:flow-router-ssr
matb33:collection-hooks
meteorhacks:ssr
meteorhacks:subs-manager
momentjs:moment
ongoworks:security
raix:ui-dropped-event
risul:moment-timezone
tmeasday:publish-counts
vsivsi:job-collection
react-meteor-data
percolate:migrations
johanbrook:[email protected]


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

# Performance & Debugging Tools
# meteorhacks:fast-render # improve initial page loads
Expand Down
2 changes: 1 addition & 1 deletion .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ [email protected]
[email protected]
[email protected]
[email protected]
momentjs:moment@2.16.0
momentjs:moment@2.17.0
[email protected]
[email protected]
[email protected]
Expand Down
6 changes: 3 additions & 3 deletions client/modules/accounts/helpers/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Template.registerHelper("displayName", function (displayUser) {
// new check covers previous check?
if (Roles.userIsInRole(user._id || user.userId, "account/profile",
Reaction.getShopId())) {
return i18next.t("accountsUI.guest", {defaultValue: "Guest"});
return i18next.t("accountsUI.guest", { defaultValue: "Guest" });
}
}
});
Expand Down Expand Up @@ -70,10 +70,10 @@ Template.registerHelper("fName", function (displayUser) {
case !user.services.pinterest:
return user.services.pinterest.first_name;
default:
return i18next.t("accountsUI.guest", {defaultValue: "Guest"});
return i18next.t("accountsUI.guest", { defaultValue: "Guest" });
}
})();
return username;
}
return i18next.t("accountsUI.signIn", {defaultValue: "Sign in"});
return i18next.t("accountsUI.signIn", { defaultValue: "Sign in" });
});
2 changes: 1 addition & 1 deletion client/modules/accounts/helpers/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class ServiceConfigHelper {
const configurations = ServiceConfiguration.configurations.find().fetch();

return _.map(availableServices, (name) => {
const matchingConfigurations = _.filter(configurations, {service: name});
const matchingConfigurations = _.filter(configurations, { service: name });
let service = {
name,
label: this.capitalizedServiceName(name),
Expand Down
2 changes: 1 addition & 1 deletion client/modules/accounts/templates/dropdown/dropdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<ul class="user-accounts-dropdown-apps">
{{> userAccountsDropdown}}
<!--administrative shortcut icons -->
{{#each reactionApps provides="shortcut" enabled=true}}
{{#each reactionApps reactionAppsOptions}}
<li class="dropdown-apps-icon">
<a href={{pathFor name}} id="dropdown-apps-{{name}}" title="{{label}}">
<i class="{{icon}}"></i>
Expand Down
13 changes: 13 additions & 0 deletions client/modules/accounts/templates/dropdown/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,16 @@ Template.loginDropdown.events({
template.$(".dropdown-toggle").dropdown("toggle");
}
});

Template.accountsDropdownApps.helpers({
reactionAppsOptions() {
// get shortcuts with audience permissions based on user roles
const roles = Roles.getRolesForUser(Meteor.userId(), Reaction.getShopId());

return {
provides: "shortcut",
enabled: true,
audience: roles
};
}
});
5 changes: 3 additions & 2 deletions client/modules/accounts/templates/members/member.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@


{{#each groupsForUser}}
{{#if permissionGroups}}
<div class="panel-body">
<h3><i class="fa fa-shopping-cart"></i> {{shopLabel}}</h3>
</div>
Expand Down Expand Up @@ -88,6 +89,6 @@ <h3><i class="fa fa-shopping-cart"></i> {{shopLabel}}</h3>
</div>
{{/each}}
</div>
{{/each}}

{{/if}}
{{/each}}
</template>
2 changes: 1 addition & 1 deletion client/modules/accounts/templates/members/member.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Template.memberSettings.helpers({
_id: shopId
});
if (shop && shop.name) {
return shop.name;
return shop.name || "Default Shop";
}
},
permissionGroups: function (thisShopId) {
Expand Down
2 changes: 1 addition & 1 deletion client/modules/accounts/templates/signIn/signIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Template.loginFormSignInView.events({
const password = passwordInput.val().trim();

const validatedEmail = LoginFormValidation.email(username);
const validatedPassword = LoginFormValidation.password(password, {validationLevel: "exists"});
const validatedPassword = LoginFormValidation.password(password, { validationLevel: "exists" });

const templateInstance = Template.instance();
const errors = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Template.loginFormChangePassword.events({

// 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
const validatedOldPassword = LoginFormValidation.password(password, {validationLevel: "exists"});
const validatedOldPassword = LoginFormValidation.password(password, { validationLevel: "exists" });
const validatedPassword = LoginFormValidation.password(password);

const templateInstance = Template.instance();
Expand Down
159 changes: 49 additions & 110 deletions client/modules/core/helpers/apps.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
import { Reaction, Logger } from "/client/api";
import _ from "lodash";
import { Reaction } from "/client/api";
import { Packages } from "/lib/collections";
import { Template } from "meteor/templating";

/**
*
* reactionApps
*
* provides="<where matching registry provides is this >"
* enabled=true <false for disabled packages>
* context= true filter templates to current route
*
* returns matching package registry objects
* @todo:
* - reintroduce a dependency context
* - introduce position,zones #148
* - is it better to get all packages once and filter in code
* and possibly have some cache benefits down the road,
* or to retrieve what is requested and gain the advantage of priviledged,
* unnecessary data not retrieved with the cost of additional requests.
* - context filter should be considered experimental
*
* returns matching package registry objects
* @example {{#each reactionApps provides="settings" name=packageName container=container}}
* @example {{#each reactionApps provides="userAccountDropdown" enabled=true}}
* @example
Expand Down Expand Up @@ -54,11 +44,14 @@ export function Apps(optionHash) {
const filter = {};
const registryFilter = {};
let key;
let match;
let packages;
let reactionApps = [];
const reactionApps = [];
let options = {};

// remove audience permissions for owner
if (Reaction.hasOwnerAccess() && optionHash.audience) {
delete optionHash.audience;
}

// allow for object or option.hash
if (optionHash) {
if (optionHash.hash) {
Expand All @@ -79,114 +72,60 @@ export function Apps(optionHash) {
for (key in options) {
if ({}.hasOwnProperty.call(options, key)) {
const value = options[key];
if (!(key === "enabled" || key === "name" || key === "shopId")) {
filter["registry." + key] = value;
registryFilter[key] = value;
} else {
filter[key] = value;
if (value) {
if (!(key === "enabled" || key === "name" || key === "shopId")) {
filter["registry." + key] = Array.isArray(options[key]) ? { $in: value } : value;
registryFilter[key] = value;
} else {
// perhaps not the best way to check but lets admin see all packages
if (!Reaction.hasOwnerAccess()) {
if (key !== "shopId") {
registryFilter[key] = value;
}
}
filter[key] = value;
}
}
}
}

// return these fields
const fields = {
enabled: 1,
registry: 1,
name: 1,
provides: 1
};

// fetch the packages
const reactionPackages = Packages.find(filter, fields).fetch();
Packages.find(filter).forEach((app) => {
const matchingRegistry = _.filter(app.registry, function (item) {
const itemFilter = registryFilter;

// apply filters to registry items
if (reactionPackages.length) {
// filter by package and enabled true/false
if (filter.name && filter.enabled) {
packages = (function () {
const results = [];
for (const pkg of reactionPackages) {
if (pkg.name === filter.name && pkg.enabled === filter.enabled) {
results.push(pkg);
}
}
return results;
})();
// we want all entries by package name
} else if (filter.name) {
packages = (function () {
const results = [];
for (const pkg of reactionPackages) {
if (pkg.name === filter.name) {
results.push(pkg);
// check audience permissions only if they exist as part of optionHash and are part of the registry item
// ideally all routes should use it, safe for backwards compatibility though
// owner bypasses permissions
if (!Reaction.hasOwnerAccess() && item.audience && registryFilter.audience) {
let hasAccess;

for (const permission of registryFilter.audience) {
if (item.audience.indexOf(permission) > -1) {
hasAccess = true;
}
}
return results;
})();
// just all enabled packages
} else if (filter.enabled) {
packages = (function () {
const results = [];
for (const pkg of reactionPackages) {
if (pkg.enabled === filter.enabled) {
results.push(pkg);
// make sure user also has audience perms
if (Roles.userIsInRole(Meteor.userId(), permission, Reaction.getShopId())) {
hasAccess = true;
}
}
return results;
})();
// no filter
} else {
packages = (function () {
const results = [];
for (const pkg of reactionPackages) {
results.push(pkg);
}
return results;
})();
}

// we have all the package app registry entries
for (const app of packages) {
// go through the registry entries and push enabled entries
if (app.registry) {
for (let registry of app.registry) {
match = 0;
for (key in registryFilter) {
// make sure we're dealing with valid keys
if ({}.hasOwnProperty.call(registryFilter, key)) {
const value = registryFilter[key];
if (registry[key] === value) {
match += 1;
}
if (match === Object.keys(registryFilter).length) {
if (!registry.packageName) registry.packageName = app.name;
if (registry.enabled !== false) {
registry = Reaction.translateRegistry(registry, app);
registry.enabled = registry.enabled || app.enabled;
registry.packageId = app._id;
// check permissions before pushing so that templates aren't required.
if (Reaction.hasPermission([registry.name, registry.route])) {
reactionApps.push(registry);
}
}
}
}
}
if (!hasAccess) {
return false;
}

// safe to clean up now, and isMatch can ignore audience
delete itemFilter.audience;
}
}
// we only need any given package once, let's be sure.
reactionApps = _.uniq(reactionApps);

// sort cycle to ensure order
reactionApps = reactionApps.sort((a, b) => a.priority - b.priority).slice();
} // end reactionPackages check
return _.isMatch(item, itemFilter);
});

// enable debug to find missing reaction apps
if (reactionApps.length === 0) {
Logger.info("Failed to return matching reaction apps for", optionHash);
}
// we're done.
for (const registry of matchingRegistry) {
reactionApps.push(registry);
}
});
// sort cycle to ensure order aka. is registry.priority working? .sort((a, b) => a.priority - b.priority).slice();
return reactionApps;
}

Expand Down
19 changes: 1 addition & 18 deletions client/modules/core/helpers/globals.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Session } from "meteor/session";
import { Meteor } from "meteor/meteor";
// import { Roles } from "meteor/roles";
import { Roles } from "meteor/alanning:roles";

// Reaction Globals
//
Expand All @@ -9,23 +9,6 @@ import { Meteor } from "meteor/meteor";
/* eslint "no-extend-native": [2, {"exceptions": ["String"]}] */
/* eslint "no-alert": 0 */

/**
* String.prototype.toCamelCase
* @summary special toCamelCase for converting a string to camelCase for use with i18n keys
* @return {String} camelCased string
*/
String.prototype.toCamelCase = function () {
let s;
s = this.replace(/([^a-zA-Z0-9_\- ])|^[_0-9]+/g, "").trim().toLowerCase();
s = s.replace(/([ -]+)([a-zA-Z0-9])/g, function (a, b, c) {
return c.toUpperCase();
});
s = s.replace(/([0-9]+)([a-zA-Z])/g, function (a, b, c) {
return b + c.toUpperCase();
});
return s;
};

/**
* toggleSession
* quick and easy snippet for toggling sessions
Expand Down
Loading