Skip to content

Commit

Permalink
Merge pull request #4922 from reactioncommerce/release-2.0.0-rc.9
Browse files Browse the repository at this point in the history
Release 2.0.0 rc.9
  • Loading branch information
spencern authored Jan 25, 2019
2 parents 98b24ba + fc0caf1 commit cb6939d
Show file tree
Hide file tree
Showing 149 changed files with 3,947 additions and 1,579 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ REACTION_SECURE_DEFAULT_ADMIN=false
REACTION_USER_NAME=admin
REACTION_USER=Admin
ROOT_URL=http://localhost:3000
IDENTITY_PROVIDER_MODE=all
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
# v2.0.0-rc.9
This is our ninth **release candidate** for v2.0.0 of Reaction. Please check it out and let us know what works and what doesn't for you.

This release is being coordinated with `reaction-platform` and is designed to work with the same versions of `reaction-next-starterkit` and `reaction-hydra`

## Inventory improvements
We've made some updates to the way inventory is tracked, introducing a new inventory field: `inventoryAvailableToSell`. This field tracks inventory that has been ordered, but has not yet been processed and so is still counted in-stock. This number is what is displayed to customers and determines whether a product is considered "sold out" or not. The old inventory number `inventoryQty` has been renamed to `inventoryInStock` and continues to represent the inventory available in stock. For more info see #4859.

## Breaking changes
### Inventory
- Migration 51 has been added to attach `inventoryAvailableToSell` to all products / variants, to correctly calculate the numbers on parent products / variants, and to publish this data to already published Catalog items.
- `currentQuantity` has been marked with `depreciated` in the cart. This isn't a breaking change at the moment, but lays the path to remove this field and replace with `inventoryAvailableToSell` and `inventoryInStock` in the future.
- `Catalog.getVariantQuantity` and `ReactionProduct.getVariantQuantity` have been removed. Custom plugins using these methods will need to be updated. The same data returned by these methods is now on the object that was being passed into these methods as the field `inventoryQuantity` or `inventoryAvailableToSell`
- Moved `isBackorder`, `isLowQuantity`, and `isSoldOut` functions from the `catalog` plugin to the new `inventory` plugin. Custom plugins using these methods will need to update their import path.

## Features
- feat: Add flag to enable only IDP routes (#4903)
- feat: Record plugin versions in DB and show in Shop panel (#4895)
- feat: Add support for fallback tax service (#4871)
- feat: Update to Apollo Server 2.0 (#4884)
- feat(#4848): Return only isVisible Tags, unless admin (#4879)
- feat: Support remote graphql schemas in plugins (#4870)
- feat: Support plugins directly registering React components (#4875)

## Bugfixes
- fix: Password reset page not found (#4917)
- fix: add replace to remove comma from formatting (#4910)
- fix: add contentForLanguage resolver for nav item content (#4913)
- fix: Restore CORS for 401s (#4894)
- fix: Meteor method permissions fixes (#4883)
- fix: Multi-shop permission fixes (#4872)
- fix: check permissions for order workflow methods (#4863)

## Tests
- test: Fix sitemaps test timeouts (#4920)

## Refactors
- refactor: updates to inventory counts and statuses (#4859)


# v2.0.0-rc.8
This is our eighth **release candidate** for v2.0.0 of Reaction. Please check it out and let us know what works and what doesn't for you.

Expand Down
60 changes: 42 additions & 18 deletions imports/collections/schemas/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,17 @@ export const SocialMetadata = new SimpleSchema({
* @type {SimpleSchema}
* @property {String} _id required
* @property {String} barcode optional
* @property {Boolean} canBackorder required, Indicates when the seller has allowed the sale of product which is not in stock
* @property {Date} createdAt required
* @property {Number} height optional, default value: `0`
* @property {Number} index required
* @property {Boolean} inventoryManagement required
* @property {Boolean} inventoryPolicy required
* @property {Boolean} isBackorder required
* @property {Boolean} isLowQuantity required
* @property {Boolean} isSoldOut required
* @property {Boolean} inventoryAvailableToSell required, The quantity of this item currently available to sell. This number does not include reserved inventory (i.e. inventory that has been ordered, but not yet processed by the operator). If this is a variant, this number is created by summing all child option inventory numbers. This is most likely the quantity to display in the storefront UI.
* @property {Boolean} inventoryInStock required, The quantity of this item currently in stock. This number is updated when an order is processed by the operator. This number includes all inventory, including reserved inventory (i.e. inventory that has been ordered, but not yet processed by the operator). If this is a variant, this number is created by summing all child option inventory numbers. This is most likely just used as a reference in the operator UI, and not displayed in the storefront UI. Called `inventoryQuantity` in the Product Schema, and `inventoryInStock` in the Catalog schema.
* @property {Boolean} inventoryManagement required, True if inventory management is enabled for this variant
* @property {Boolean} inventoryPolicy required, True if inventory policy is enabled for this variant
* @property {Boolean} isBackorder required, Indicates when a product is currently backordered
* @property {Boolean} isLowQuantity required, Indicates that the product quantity is too low
* @property {Boolean} isSoldOut required, Indicates when the product quantity is zero
* @property {Number} length optional, default value: `0`
* @property {Number} lowInventoryWarningThreshold optional, default value: `0`
* @property {ImageInfo[]} media optional
Expand Down Expand Up @@ -158,6 +161,10 @@ export const VariantBaseSchema = new SimpleSchema({
label: "Barcode",
optional: true
},
"canBackorder": {
type: Boolean,
label: "Can backorder"
},
"createdAt": {
type: Date,
label: "Date/time this variant was created at"
Expand All @@ -173,26 +180,34 @@ export const VariantBaseSchema = new SimpleSchema({
type: SimpleSchema.Integer,
label: "The position of this variant among other variants at the same level of the product-variant-option hierarchy"
},
"inventoryAvailableToSell": {
type: SimpleSchema.Integer,
label: "Inventory available to sell"
},
"inventoryInStock": {
type: SimpleSchema.Integer,
label: "Inventory in stock"
},
"inventoryManagement": {
type: Boolean,
label: "True if inventory management is enabled for this variant"
label: "Inventory management"
},
"inventoryPolicy": {
type: Boolean,
label: "True if inventory policy is enabled for this variant"
label: "Inventory policy"
},
"isBackorder": {
type: Boolean,
label: "Indicates when the seller has allowed the sale of product which is not in stock",
label: "Is backordered",
defaultValue: false
},
"isLowQuantity": {
type: Boolean,
label: "Indicates that the product quantity is too low"
label: "Is low quantity"
},
"isSoldOut": {
type: Boolean,
label: "Indicates when the product quantity is zero"
label: "Is sold out"
},
"length": {
type: Number,
Expand Down Expand Up @@ -320,10 +335,11 @@ export const CatalogVariantSchema = VariantBaseSchema.clone().extend({
* @property {Date} createdAt required
* @property {String} description optional
* @property {Number} height optional, default value: `0`
* @property {Boolean} isBackorder required
* @property {Boolean} isDeleted required, default value: `false`
* @property {Boolean} isLowQuantity required
* @property {Boolean} isSoldOut required
* @property {Boolean} inventoryAvailableToSell required, The quantity of this item currently available to sell. This number does not include reserved inventory (i.e. inventory that has been ordered, but not yet processed by the operator). If this is a variant, this number is created by summing all child option inventory numbers. This is most likely the quantity to display in the storefront UI.
* @property {Boolean} inventoryInStock required, The quantity of this item currently in stock. This number is updated when an order is processed by the operator. This number includes all inventory, including reserved inventory (i.e. inventory that has been ordered, but not yet processed by the operator). If this is a variant, this number is created by summing all child option inventory numbers. This is most likely just used as a reference in the operator UI, and not displayed in the storefront UI. Called `inventoryQuantity` in the Product Schema, and `inventoryInStock` in the Catalog schema.
* @property {Boolean} isBackorder required, Indicates when a product is currently backordered
* @property {Boolean} isLowQuantity required, Indicates that the product quantity is too low
* @property {Boolean} isSoldOut required, Indicates when the product quantity is zero
* @property {Boolean} isVisible required, default value: `false`
* @property {Number} length optional, default value: `0`
* @property {Number} lowInventoryWarningThreshold optional, default value: `0`
Expand Down Expand Up @@ -380,23 +396,31 @@ export const CatalogProduct = new SimpleSchema({
optional: true,
defaultValue: 0
},
"inventoryAvailableToSell": {
type: SimpleSchema.Integer,
label: "Inventory available to sell"
},
"inventoryInStock": {
type: SimpleSchema.Integer,
label: "Inventory in stock"
},
"isBackorder": {
type: Boolean,
label: "Indicates when the seller has allowed the sale of product which is not in stock"
label: "Is backorder"
},
"isDeleted": {
type: Boolean,
label: "Indicates when a product is archived",
label: "Is deleted",
index: 1,
defaultValue: false
},
"isLowQuantity": {
type: Boolean,
label: "Indicates that the product quantity is too low"
label: "Is low quantity"
},
"isSoldOut": {
type: Boolean,
label: "Indicates when the product quantity is zero"
label: "Is sold out"
},
"isVisible": {
type: Boolean,
Expand Down
48 changes: 43 additions & 5 deletions imports/collections/schemas/products.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ registerSchema("VariantMedia", VariantMedia);
* @property {Event[]} eventLog optional, Variant Event Log
* @property {Number} height optional, default value: `0`
* @property {Number} index optional, Variant position number in list. Keep array index for moving variants in a list.
* @property {Boolean} inventoryAvailableToSell required
* @property {Boolean} inventoryInStock required
* @property {Boolean} inventoryManagement, default value: `true`
* @property {Boolean} inventoryPolicy, default value: `false`, If disabled, item can be sold even if it not in stock.
* @property {Number} inventoryQuantity, default value: `0`
Expand Down Expand Up @@ -168,15 +170,29 @@ export const ProductVariant = new SimpleSchema({
}
}
},
"inventoryAvailableToSell": {
type: SimpleSchema.Integer,
label: "The quantity of this item currently available to sell." +
"This number is updated when an order is placed by the customer." +
"This number does not include reserved inventory (i.e. inventory that has been ordered, but not yet processed by the operator)." +
"If this is a variant, this number is created by summing all child option inventory numbers." +
"This is most likely the quantity to display in the storefront UI.",
optional: true,
defaultValue: 0
},
"inventoryQuantity": {
type: SimpleSchema.Integer,
label: "Quantity",
label: "The quantity of this item currently in stock." +
"This number is updated when an order is processed by the operator." +
"This number includes all inventory, including reserved inventory (i.e. inventory that has been ordered, but not yet processed by the operator)." +
"If this is a variant, this number is created by summing all child option inventory numbers." +
"This is most likely just used as a reference in the operator UI, and not displayed in the storefront UI." +
"Called `inventoryQuantity` in the Product Schema, and `inventoryInStock` in the Catalog schema.",
optional: true,
defaultValue: 0
},
"isBackorder": {
label: "Indicates when the seller has allowed the sale of product which" +
" is not in stock",
label: "Indicates when a product is currently backordered",
type: Boolean,
optional: true
},
Expand Down Expand Up @@ -339,6 +355,8 @@ registerSchema("PriceRange", PriceRange);
* @property {String} googleplusMsg optional
* @property {String} handle optional, slug
* @property {String[]} hashtags optional
* @property {Boolean} inventoryAvailableToSell required
* @property {Boolean} inventoryInStock required
* @property {Boolean} isBackorder denormalized, `true` if product not in stock, but customers anyway could order it
* @property {Boolean} isDeleted, default value: `false`
* @property {Boolean} isLowQuantity denormalized, true when at least 1 variant is below `lowInventoryWarningThreshold`
Expand Down Expand Up @@ -414,9 +432,29 @@ export const Product = new SimpleSchema({
"hashtags.$": {
type: String
},
"inventoryAvailableToSell": {
type: SimpleSchema.Integer,
label: "The quantity of this item currently available to sell." +
"This number is updated when an order is placed by the customer." +
"This number does not include reserved inventory (i.e. inventory that has been ordered, but not yet processed by the operator)." +
"If this is a variant, this number is created by summing all child option inventory numbers." +
"This is most likely the quantity to display in the storefront UI.",
optional: true,
defaultValue: 0
},
"inventoryQuantity": {
type: SimpleSchema.Integer,
label: "The quantity of this item currently in stock." +
"This number is updated when an order is processed by the operator." +
"This number includes all inventory, including reserved inventory (i.e. inventory that has been ordered, but not yet processed by the operator)." +
"If this is a variant, this number is created by summing all child option inventory numbers." +
"This is most likely just used as a reference in the operator UI, and not displayed in the storefront UI." +
"Called `inventoryQuantity` in the Product Schema, and `inventoryInStock` in the Catalog schema.",
optional: true,
defaultValue: 0
},
"isBackorder": {
label: "Indicates when the seller has allowed the sale of product which" +
" is not in stock",
label: "Indicates when a product is currently backordered",
type: Boolean,
optional: true
},
Expand Down
5 changes: 5 additions & 0 deletions imports/collections/schemas/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ export const PackageConfig = new SimpleSchema({
type: Boolean,
defaultValue: true
},
"version": {
type: String,
label: "Package Version",
optional: true
},
"icon": {
type: String,
optional: true
Expand Down
9 changes: 5 additions & 4 deletions imports/node-app/core/ReactionNodeApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@ export default class ReactionNodeApp {

this.mongodb = options.mongodb || mongodb;

const { graphiql, resolvers, schemas } = options.graphQL;
const { resolvers, schemas } = options.graphQL;

this.expressApp = createApolloServer({
const { expressApp } = createApolloServer({
addCallMeteorMethod: this.options.addCallMeteorMethod || defaultAddCallMethod,
context: this.context,
debug: this.options.debug || false,
graphiql: graphiql || false,
resolvers,
typeDefs: schemas
schemas
});

this.expressApp = expressApp;
}

setMongoDatabase(db) {
Expand Down
Loading

0 comments on commit cb6939d

Please sign in to comment.