Skip to content

Commit

Permalink
Merge pull request reactioncommerce#324 from sportsdirect/pete-daily-…
Browse files Browse the repository at this point in the history
…update-2019-05-05

Pete daily update 2019 05 05
  • Loading branch information
samkelleher authored May 7, 2019
2 parents 4d4cc52 + b16d580 commit 3ccc2a7
Show file tree
Hide file tree
Showing 143 changed files with 1,879 additions and 1,799 deletions.
9 changes: 9 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,22 @@ function main() {
add_new_env_vars
}

function file_ends_with_newline() {
[[ $(tail -c1 "${env_file}" | wc -l) -gt 0 ]]
}

function add_new_env_vars() {
# create .env and set perms if it does not exist
[[ ! -f "${env_file}" ]] && {
touch "${env_file}"
chmod 0600 "${env_file}"
}

# if the file does not end with new line add a new line to it
if ! file_ends_with_newline; then
echo "" >> "${env_file}"
fi

find . -name .env.example -type f -print0 |
(xargs -0 grep -Ehv '^\s*#' || true) |
sort |
Expand Down
44 changes: 0 additions & 44 deletions imports/collections/schemas/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,29 +73,6 @@ export const ImageInfo = new SimpleSchema({
}
});

/**
* @name CatalogPriceRange
* @memberof Schemas
* @type {SimpleSchema}
* @property {Number} max required
* @property {Number} min required
* @property {String} range required
*/
export const CatalogPriceRange = new SimpleSchema({
max: {
type: Number,
label: "Max price"
},
min: {
type: Number,
label: "Min price"
},
range: {
type: String,
label: "Price range"
}
});

/**
* @name SocialMetadata
* @memberof Schemas
Expand Down Expand Up @@ -140,8 +117,6 @@ export const SocialMetadata = new SimpleSchema({
* @property {Number} minOrderQuantity optional, default value: `1`
* @property {String} optionTitle optional
* @property {String} originCountry optional
* @property {CatalogPriceRange} price required
* @property {Object} pricing required
* @property {ImageInfo} primaryImage optional
* @property {String} shopId required
* @property {String} sku optional
Expand Down Expand Up @@ -255,14 +230,6 @@ export const VariantBaseSchema = new SimpleSchema({
label: "Origin country",
optional: true
},
"price": {
type: Number
},
"pricing": {
type: Object,
blackbox: true,
label: "Pricing"
},
"primaryImage": {
type: ImageInfo,
label: "Primary Image",
Expand Down Expand Up @@ -349,8 +316,6 @@ export const CatalogVariantSchema = VariantBaseSchema.clone().extend({
* @property {String} originCountry optional
* @property {String} pageTitle optional
* @property {ShippingParcel} parcel optional
* @property {CatalogPriceRange} price optional
* @property {Object} pricing required
* @property {ImageInfo} primaryImage optional
* @property {String} productId required
* @property {String} productType optional
Expand Down Expand Up @@ -480,15 +445,6 @@ export const CatalogProduct = new SimpleSchema({
label: "Shipping parcel",
optional: true
},
"price": {
type: CatalogPriceRange,
optional: true
},
"pricing": {
type: Object,
blackbox: true,
label: "Pricing"
},
"primaryImage": {
type: ImageInfo,
label: "Primary Image",
Expand Down
72 changes: 41 additions & 31 deletions imports/collections/schemas/navigationTrees.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,33 @@ const expanded = {
optional: true
};

const isPrivate = {
label: "Admin access only",
type: Boolean,
defaultValue: false
};

const isSecondary = {
label: "Secondary nav only",
type: Boolean,
defaultValue: false
};

const isVisible = {
label: "Show in storefront",
type: Boolean,
defaultValue: true
};

const NavigationItem = {
navigationItemId,
expanded,
isVisible,
isPrivate,
isSecondary,
items
};

/**
* @name NavigationTreeItem
* @memberof Schemas
Expand All @@ -25,57 +52,40 @@ const expanded = {
* @property {Array} items Child navigation items
*/
export const NavigationTreeItem = new SimpleSchema({
navigationItemId,
expanded,
items,
...NavigationItem,
"items.$": {
type: new SimpleSchema({
navigationItemId,
expanded,
items,
...NavigationItem,
"items.$": {
type: new SimpleSchema({
expanded,
navigationItemId,
items,
...NavigationItem,
"items.$": {
type: new SimpleSchema({
expanded,
navigationItemId,
items,
...NavigationItem,
"items.$": {
type: new SimpleSchema({
expanded,
navigationItemId,
items,
...NavigationItem,
"items.$": {
type: new SimpleSchema({
expanded,
navigationItemId,
items,
...NavigationItem,
"items.$": {
type: new SimpleSchema({
expanded,
navigationItemId,
items,
...NavigationItem,
"items.$": {
type: new SimpleSchema({
expanded,
navigationItemId,
items,
...NavigationItem,
"items.$": {
type: new SimpleSchema({
expanded,
navigationItemId,
items,
...NavigationItem,
"items.$": {
type: new SimpleSchema({
expanded,
navigationItemId,
items,
...NavigationItem,
"items.$": {
type: new SimpleSchema({
navigationItemId
navigationItemId,
isVisible,
isPrivate,
isSecondary
})
}
})
Expand Down
48 changes: 0 additions & 48 deletions imports/collections/schemas/products.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ registerSchema("VariantMedia", VariantMedia);
* @property {String} _id required, Variant ID
* @property {String[]} ancestors, default value: `[]`
* @property {String} barcode optional
* @property {Number} compareAtPrice optional, Compare at price
* @property {Date} createdAt optional
* @property {Event[]} eventLog optional, Variant Event Log
* @property {Number} height optional, default value: `0`
Expand All @@ -74,7 +73,6 @@ registerSchema("VariantMedia", VariantMedia);
* @property {Number} minOrderQuantity optional
* @property {String} optionTitle, Option internal name, default value: `"Untitled option"`
* @property {String} originCountry optional
* @property {Number} price, default value: `0.00`
* @property {String} shopId required, Variant ShopId
* @property {String} sku optional
* @property {String} title, Label for customers, default value: `""`
Expand Down Expand Up @@ -108,13 +106,6 @@ export const ProductVariant = new SimpleSchema({
}
}
},
"compareAtPrice": {
label: "Compare At Price",
type: Number,
optional: true,
min: 0,
defaultValue: 0.00
},
"createdAt": {
label: "Created at",
type: Date,
Expand Down Expand Up @@ -250,13 +241,6 @@ export const ProductVariant = new SimpleSchema({
type: String,
optional: true
},
"price": {
label: "Price",
type: Number,
defaultValue: 0.00,
min: 0,
optional: true
},
"shopId": {
type: String,
label: "Variant ShopId"
Expand Down Expand Up @@ -312,33 +296,6 @@ export const ProductVariant = new SimpleSchema({

registerSchema("ProductVariant", ProductVariant);

/**
* @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`
*/
export 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);

/**
* @name Product
* @type {SimpleSchema}
Expand All @@ -365,7 +322,6 @@ registerSchema("PriceRange", PriceRange);
* @property {String} pageTitle optional
* @property {ShippingParcel} parcel optional
* @property {String} pinterestMsg optional
* @property {PriceRange} price denormalized, object with range string, min and max
* @property {String} productType optional
* @property {Date} publishedAt optional
* @property {String} publishedProductHash optional
Expand Down Expand Up @@ -496,10 +452,6 @@ export const Product = new SimpleSchema({
optional: true,
max: 255
},
"price": {
label: "Price",
type: PriceRange
},
"productType": {
type: String,
optional: true
Expand Down
Loading

0 comments on commit 3ccc2a7

Please sign in to comment.