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

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2a1b9a4
fix: upgrade handlebars version
mpaktiti Nov 18, 2019
054090b
Merge pull request #5810 from reactioncommerce/fix-mpaktiti-snyk-vuln
Nov 18, 2019
7ed7374
Merge pull request #5810 from reactioncommerce/fix-mpaktiti-snyk-vuln
Nov 18, 2019
1713ceb
fix: made bin/setup always run from the desired path
rosshadden Dec 4, 2019
b309e37
Merge pull request #5853 from reactioncommerce/fix-bin-setup
rosshadden Dec 4, 2019
cd3ea0b
fix: revert removal of extendSimpleSchema
kieckhafer Dec 16, 2019
93f91c7
Revert "fix: revert removal of extendSimpleSchema"
kieckhafer Dec 16, 2019
ef4157e
fix: prices not updating via UI
kieckhafer Dec 16, 2019
b3a4d8a
fix: missing logout button
mikemurray Dec 17, 2019
1b17021
fix: add shop based roles to first user account
kieckhafer Dec 17, 2019
34565ca
fix: issue that prevented uploading images on Firefox
willopez Dec 18, 2019
d46f5b0
fix: routing when logging in from storefront
kieckhafer Dec 17, 2019
2e994c4
get challenge from URL
kieckhafer Dec 18, 2019
c8ac27e
add logout functionality from storefront
kieckhafer Dec 18, 2019
ac8761c
feat: add oauth to new AuthContainer alongside meteor
kieckhafer Dec 18, 2019
f9009e9
feat: add oauth call to AuthContainer
kieckhafer Dec 18, 2019
762839f
feat: add oauth-login for new users
kieckhafer Dec 19, 2019
ef85848
refactor: unneeded return
kieckhafer Dec 19, 2019
d6e9b58
chore: fixed linter violations
rosshadden Dec 19, 2019
27cdc3c
Revert "fix: revert removal of extendSimpleSchema"
kieckhafer Dec 16, 2019
a7f72cb
docs: add notable changes to release docs
kieckhafer Dec 19, 2019
ab3fa74
refactor: use better cache policy to show new tags
kieckhafer Dec 20, 2019
17be670
Merge pull request #5978 from reactioncommerce/fix-kieckhafer-tagsNot…
manueldelreal Dec 20, 2019
1f80239
Fix: recalculate shipping prices correctly
mdelreal Dec 20, 2019
29e93ab
Fix lint warnings
mdelreal Dec 21, 2019
2a7aca9
Fix linting error
mdelreal Dec 21, 2019
f60eee4
Merge pull request #5985 from reactioncommerce/fix-shippingHandling
kieckhafer Dec 21, 2019
c9b46aa
chore: update CHANGELOG with new commits
kieckhafer Dec 21, 2019
c13a956
chore: update changelog
kieckhafer Dec 21, 2019
d35a452
chore: update changelog
kieckhafer Dec 21, 2019
f150aea
Merge branch 'release-2.9.1' of github.com:/reactioncommerce/reaction…
kieckhafer Dec 21, 2019
4033039
Revert "Fix cart total calculation when shipping includes handling fee"
kieckhafer Dec 21, 2019
aaef0a2
fix: remove extra handling price calculation
kieckhafer Dec 21, 2019
0ba091e
Merge pull request #5986 from reactioncommerce/revert-5985-fix-shippi…
manueldelreal Dec 21, 2019
0ba7f50
style: lint fix
kieckhafer Dec 21, 2019
07598c9
refactor: remove unneeded code
kieckhafer Dec 21, 2019
1f3fedd
Merge branch 'release-2.9.1' into fix-kieckhafer-shippingHandlingNumbers
kieckhafer Dec 21, 2019
3aa27c5
fix: fix selected fulfillment method in cart total price
aldeed Dec 23, 2019
6f850aa
Merge pull request #5987 from reactioncommerce/fix-kieckhafer-shippin…
manueldelreal Dec 23, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
# v2.9.1

Reaction v2.9.1 adds miscellaneous bug fixes and contains no breaking changes since v2.9.0.

This release is being coordinated with `reaction-platform` and is designed to work with `v2.9.1` of `example-storefront` and `reaction-hydra`.

## Notable changes

### Fix example-storefront login issue

Logging in from the example storefront has been fixed to allow a user to stay logged in when navigating to login from the storefront.

### Fix cart total calculation

Cart total calculation has been fixed to correctly add rate + handling numbers.

## Fixes

- fix: login from storefront [#5951](https://github.com/reactioncommerce/reaction/pull/5951)
- fix: issue that prevented uploading images on Firefox [#5939](https://github.com/reactioncommerce/reaction/pull/5939)
- fix: routing when logging in from storefront [#5932](https://github.com/reactioncommerce/reaction/pull/5932)
- fix: add shop based roles to first user account [#5926](https://github.com/reactioncommerce/reaction/pull/5926)
- fix: missing logout button [#5927](https://github.com/reactioncommerce/reaction/pull/5927)
- fix: prices not updating via UI [#5924](https://github.com/reactioncommerce/reaction/pull/5924)
- fix: made bin/setup always run from the desired path [#5853](https://github.com/reactioncommerce/reaction/pull/5853)
- fix: upgrade handlebars version [#5810](https://github.com/reactioncommerce/reaction/pull/5810)
- fix: cart total calculation when shipping includes handling fee [#5985](https://github.com/reactioncommerce/reaction/pull/5985)

## refactors

- refactor: use better cache policy to show newly created tags [#5978](https://github.com/reactioncommerce/reaction/pull/5978)

# v2.9.0

Reaction v2.9.0 adds integration tests for GraphQL API endpoints, security updates and fixes a fulfillment method bug.
Expand Down
4 changes: 2 additions & 2 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ set -o posix # more strict failures in subshells
IFS="$(printf "\n\t")"
# ---- End unofficial bash strict mode boilerplate

__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
env_file=${__dir}/../.env
cd "$(dirname "${BASH_SOURCE[0]}")/.."
env_file=./.env

function main() {
set -e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export default async function createDefaultAdminUser(context) {
$set: {
name: userInput.name,
roles: {
__global_roles__: defaultOwnerRoles // eslint-disable-line camelcase
__global_roles__: defaultOwnerRoles, // eslint-disable-line camelcase
[shop._id]: defaultOwnerRoles // eslint-disable-line camelcase
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export default function addInvoiceToGroup({
const effectiveTaxRate = taxableAmount > 0 ? taxTotal / taxableAmount : 0;

// Fulfillment
const shippingTotal = group.shipmentMethod.rate || 0;
const handlingTotal = group.shipmentMethod.handling || 0;
const fulfillmentTotal = shippingTotal + handlingTotal;
const fulfillmentTotal = group.shipmentMethod.rate || 0;

// Totals
// To avoid rounding errors, be sure to keep this calculation the same between here and
Expand Down
9 changes: 7 additions & 2 deletions imports/plugins/core/accounts/client/containers/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class AuthContainer extends Component {

const validatedEmail = LoginFormValidation.email(username);
const validatedPassword = LoginFormValidation.password(pword, { validationLevel: "exists" });
const challenge = Router.current().query.login_challenge;

if (validatedEmail !== true) {
errors.email = validatedEmail;
Expand Down Expand Up @@ -74,7 +75,9 @@ class AuthContainer extends Component {
}
});
} else {
Router.go(this.props.currentRoute.route.path);
Meteor.call("oauth/login", { challenge }, (err, redirectUrl) => {
window.location.href = redirectUrl;
});
}
});
} else if (this.props.currentView === "loginFormSignUpView") {
Expand All @@ -93,7 +96,9 @@ class AuthContainer extends Component {
}
});
} else {
Router.go(this.props.currentRoute.route.path);
Meteor.call("oauth/login", { challenge }, (err, redirectUrl) => {
window.location.href = redirectUrl;
});
}
});
}
Expand Down
5 changes: 5 additions & 0 deletions imports/plugins/core/accounts/server/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ Meteor.startup(() => {
emailIsVerified = true;
}

// Set the first email to be the default
if (user.emails[0]) {
user.emails[0].provides = "default";
}

// create a tokenObj and send a welcome email to new users,
// but skip the first default admin user and anonymous users
// (default admins already get a verification email)
Expand Down
24 changes: 15 additions & 9 deletions imports/plugins/core/graphql/server/no-meteor/xforms/cart.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { toFixed } from "accounting-js";
import getRateObjectForRate from "@reactioncommerce/api-utils/getRateObjectForRate.js";
import namespaces from "@reactioncommerce/api-utils/graphql/namespaces.js";
import ReactionError from "@reactioncommerce/reaction-error";
Expand Down Expand Up @@ -147,22 +148,27 @@ function xformCartFulfillmentGroup(fulfillmentGroup, cart) {
}));

let selectedFulfillmentOption = null;
if (fulfillmentGroup.shipmentMethod) {
const { shipmentMethod: selectedShipmentMethod } = fulfillmentGroup;
if (selectedShipmentMethod) {
selectedFulfillmentOption = {
fulfillmentMethod: {
_id: fulfillmentGroup.shipmentMethod._id,
carrier: fulfillmentGroup.shipmentMethod.carrier || null,
displayName: fulfillmentGroup.shipmentMethod.label || fulfillmentGroup.shipmentMethod.name,
group: fulfillmentGroup.shipmentMethod.group || null,
name: fulfillmentGroup.shipmentMethod.name,
fulfillmentTypes: fulfillmentGroup.shipmentMethod.fulfillmentTypes
_id: selectedShipmentMethod._id,
carrier: selectedShipmentMethod.carrier || null,
displayName: selectedShipmentMethod.label || selectedShipmentMethod.name,
group: selectedShipmentMethod.group || null,
name: selectedShipmentMethod.name,
fulfillmentTypes: selectedShipmentMethod.fulfillmentTypes
},
handlingPrice: {
amount: fulfillmentGroup.shipmentMethod.handling || 0,
amount: selectedShipmentMethod.handling || 0,
currencyCode: cart.currencyCode
},
price: {
amount: fulfillmentGroup.shipmentMethod.rate || 0,
amount: +toFixed((selectedShipmentMethod.handling || 0) + (selectedShipmentMethod.rate || 0), 3),
currencyCode: cart.currencyCode
},
shippingPrice: {
amount: selectedShipmentMethod.rate || 0,
currencyCode: cart.currencyCode
}
};
Expand Down
47 changes: 45 additions & 2 deletions imports/plugins/core/layout/client/components/coreLayout.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useState } from "react";
import PropTypes from "prop-types";
import { registerComponent, Components, composeWithTracker } from "@reactioncommerce/reaction-components";
import { Reaction } from "/client/api";
import { Reaction, Router } from "/client/api";
import Logger from "/client/modules/logger";
import { Meteor } from "meteor/meteor";
import Button from "@material-ui/core/Button";
import withStyles from "@material-ui/core/styles/withStyles";
import InlineAlert from "@reactioncommerce/components/InlineAlert/v1";
import ShopLogo from "/imports/client/ui/components/ShopLogoWithData/ShopLogoWithData";

const styles = (theme) => ({
Expand Down Expand Up @@ -35,7 +36,7 @@ const styles = (theme) => ({
* to operator 2.0
* @returns {Node} React component
*/
function CoreLayout({ classes, isAdmin, isLoading, isLoggedIn, location, storefrontHomeUrl }) {
function CoreLayout({ classes, isAdmin, isLoading, isLoggedIn, location, referer, storefrontHomeUrl }) {
const [isLoggingOut, setIsLoggingOut] = useState(false);

if (isLoading || isLoggingOut) return null;
Expand Down Expand Up @@ -82,6 +83,45 @@ function CoreLayout({ classes, isAdmin, isLoading, isLoggedIn, location, storefr
}
}


if (location.pathname.startsWith("/account/logout")) {
Meteor.logout();
if (referer) {
window.location.href = referer;
return null;
} else if (storefrontHomeUrl && storefrontHomeUrl.length) {
window.location.href = storefrontHomeUrl;
return null;
}

Logger.warn("Missing storefront home URL. Please set this from the shop settings panel so that customer users can be redirected to your storefront.");

content = (
<InlineAlert
alertType="error"
message="Missing storefront home URL. Please set this from the shop settings panel so that customer users can be redirected to your storefront."
/>
);
}

// If user is logged in, and they come from storefront (/account in url)
// redirect to storefront
if (location.pathname.startsWith("/account") && isLoggedIn) {
if (storefrontHomeUrl && storefrontHomeUrl.length) {
window.location.href = storefrontHomeUrl;
return null;
}

Logger.warn("Missing storefront home URL. Please set this from the shop settings panel so that customer users can be redirected to your storefront.");

content = (
<InlineAlert
alertType="error"
message="Missing storefront home URL. Please set this from the shop settings panel so that customer users can be redirected to your storefront."
/>
);
}

return (
<div id="reactionAppContainer">
<div className={classes.root}>
Expand All @@ -102,6 +142,7 @@ CoreLayout.propTypes = {
isLoading: PropTypes.bool,
isLoggedIn: PropTypes.bool,
location: PropTypes.object,
referer: PropTypes.string,
storefrontHomeUrl: PropTypes.string
};

Expand All @@ -118,11 +159,13 @@ function composer(props, onData) {
const shop = Reaction.getCurrentShop();
const isLoading = (isAdmin !== true && isAdmin !== false) || !shop;
const isLoggedIn = !!Reaction.getUserId();
const { referer } = Router.current().query;

onData(null, {
isAdmin,
isLoading,
isLoggedIn,
referer,
storefrontHomeUrl: (shop && shop.storefrontUrls && shop.storefrontUrls.storefrontHomeUrl) || null
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ class TagDataTable extends Component {

// All available props: https://github.com/tannerlinsley/react-table#props
return (
<Query query={query} variables={variables}>
<Query query={query} variables={variables} fetchPolicy="cache-and-network">
{({ data, fetchMore, refetch }) => {
const result = (data[otherProps.dataKey] && data[otherProps.dataKey].nodes) || [];
const resultCount = (Array.isArray(result) && result.length) || 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import SimpleSchema from "simpl-schema";
import { registerSchema } from "@reactioncommerce/schemas";
import {
CatalogProduct,
CatalogVariantSchema,
Product,
ProductVariant,
VariantBaseSchema
} from "/imports/collections/schemas";

/**
* @name PriceRange
* @type {SimpleSchema}
* @memberof Schemas
* @property {String} range, default value: `"0.00"`
* @property {Number} min optional, default value: `0`
* @property {Number} max optional, default value: `0`
*/
const PriceRange = new SimpleSchema({
range: {
type: String,
defaultValue: "0.00"
},
min: {
type: Number,
defaultValue: 0,
optional: true
},
max: {
type: Number,
defaultValue: 0,
optional: true
}
});

registerSchema("PriceRange", PriceRange);

Product.extend({
price: {
label: "Price",
type: PriceRange
}
});

ProductVariant.extend({
compareAtPrice: {
label: "Compare At Price",
type: Number,
optional: true,
min: 0,
defaultValue: 0.00
},
price: {
label: "Price",
type: Number,
defaultValue: 0.00,
min: 0,
optional: true
}
});

CatalogProduct.extend({
pricing: {
type: Object,
blackbox: true
}
});

// Extend the catalog variant database schemas
const variantSchemaExtension = {
pricing: {
type: Object,
blackbox: true
}
};

VariantBaseSchema.extend(variantSchemaExtension);
CatalogVariantSchema.extend(variantSchemaExtension);
1 change: 1 addition & 0 deletions imports/plugins/included/simple-pricing/server/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "./extendCoreSchemas.js";
Loading