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

[WIP] - Marketplace: Seller permissions, Allow guests to become sellers, Create a shop, Post products and edit their shop settings #1669

Closed
wants to merge 177 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 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
8dbd1dc
allow admin users to add products via Add Product when they have the …
lcampanis Nov 22, 2016
2e25174
Add localhost WS browser-policy
Nov 23, 2016
c83c856
code cleanup
lcampanis 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
4aa28e1
allow guests to become sellers when marketplace module is enabled, de…
lcampanis Nov 26, 2016
a04cabe
fixed translation
lcampanis Nov 26, 2016
1eb493a
simplified argument
lcampanis Nov 26, 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
86c2056
ammended createShop function to trust cloned parent shop, introduced …
lcampanis Dec 7, 2016
14cd748
Marketplace schema, dashboard settings panel with general settings fo…
lcampanis Dec 7, 2016
12c84ec
Merge branch 'development' of https://github.com/reactioncommerce/rea…
lcampanis Dec 7, 2016
7692a0f
Use description for HTML description (#1606)
brent-hoover Dec 7, 2016
2d81762
merged release 0.18
lcampanis Dec 7, 2016
46f14e5
fixed getPackageSettings func
lcampanis 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
792a7bc
consolidated getSellerShopId into safe method shop/getSellerShopId in…
lcampanis Dec 9, 2016
95c4d74
internal review fixes
lcampanis Dec 9, 2016
4e4a87c
Fix bug that causes duplicated variants to be missing images. (#1611)
mikemurray Dec 12, 2016
4317082
userDropdown now looks at route permissions, added orders perms, fixe…
lcampanis Dec 12, 2016
11803c7
cleanup,fixed several things to make a new product work for new selle…
lcampanis Dec 12, 2016
d319c58
fixed comment
lcampanis Dec 12, 2016
d282eaa
internal review fixes
lcampanis 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
6511167
removed shortcut fixes, clean up and comments
lcampanis Dec 17, 2016
fc527e3
reverted dropdown template
lcampanis Dec 17, 2016
f3a8a4b
reverted dropdown template
lcampanis Dec 17, 2016
30ae5a2
inernal review and cleanup
lcampanis Dec 18, 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
01ac135
Merge branch 'development' into release-0.18.0
prosf Dec 22, 2016
3b4705e
added body class for current route based on theme and routeName
lcampanis Dec 22, 2016
ab81430
merged release 18
lcampanis Dec 23, 2016
1885513
optimised method by setting/getting session
lcampanis Dec 24, 2016
6d101e8
fixed import order
lcampanis Dec 24, 2016
5931cdd
removed console log from conflicts
lcampanis Jan 1, 2017
84dcb38
React no-ui Slider implementation
lcampanis Jan 1, 2017
175261e
React MultiSelect component implementation
lcampanis Jan 1, 2017
05d2c56
Merged in route-theme-body-class (pull request #7)
lcampanis Jan 5, 2017
17f812a
Merged in react-multiselect-component (pull request #8)
lcampanis Jan 5, 2017
6095e25
merged release 19
lcampanis Jan 5, 2017
2d07880
Merged in react-no-ui-slider-component (pull request #5)
lcampanis Jan 5, 2017
bbea639
Merge branch 'release-0.19.0' of https://github.com/reactioncommerce/…
lcampanis Jan 5, 2017
bac3e5b
Merge branch 'release-0.19.0' of bitbucket.org:artlimes/reaction_comm…
lcampanis Jan 5, 2017
01b9ad9
fixed create shop, now using Reaction lib instead
lcampanis Jan 5, 2017
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
14 changes: 14 additions & 0 deletions client/modules/accounts/templates/profile/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ <h3 class="panel-title" data-i18n="accountsUI.yourOrders">Your Orders</h3>
{{> addressBookPanel}}
</div>

{{#if isMarketplaceGuest }}
<div class="flex-item">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title" data-i18n="marketplace.becomeSeller">Become a Seller</h3>
</div>

<div class="panel-content">
{{> becomeSellerButton}}
</div>
</div>
</div>
{{/if}}

</div>

</template>
6 changes: 6 additions & 0 deletions client/modules/accounts/templates/profile/profile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Reaction } from "/client/api";
import * as Collections from "/lib/collections";
import { Meteor } from "meteor/meteor";
import { Template } from "meteor/templating";
import { Marketplace } from "/imports/plugins/included/marketplace/lib/api";

/**
* onCreated: Account Profile View
Expand Down Expand Up @@ -64,5 +66,9 @@ Template.accountProfile.helpers({
return "addressBookGrid";
}
return "addressBookAdd";
},

isMarketplaceGuest: function() {
return Marketplace.hasMarketplaceGuestAccess();
}
});
25 changes: 20 additions & 5 deletions client/modules/core/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,17 @@ export default {
return this.hasPermission(dashboardPermissions);
},

getSellerShopId: function (userId = Meteor.userId()) {
if (userId) {
const group = Roles.getGroupsForUser(userId, "admin")[0];
if (group) {
return group;
}
}

return this.getShopId();
},

getShopId() {
return this.shopId;
},
Expand All @@ -213,7 +224,14 @@ export default {
},

getPackageSettings(name) {
return Packages.findOne({ name, shopId: this.getShopId() });
const shopId = this.getShopId();
const query = { name };

if (shopId) {
query.shopId = shopId;
}

return Packages.findOne(query);
},

allowGuestCheckout() {
Expand All @@ -226,10 +244,6 @@ export default {
return allowGuest;
},

getSellerShopId() {
return Roles.getGroupsForUser(this.userId, "admin");
},

/**
* @description showActionView
*
Expand Down Expand Up @@ -277,6 +291,7 @@ export default {
});
},


getCurrentTag() {
if (this.Router.getRouteName() === "tag") {
return this.Router.current().params.slug;
Expand Down
6 changes: 5 additions & 1 deletion imports/plugins/core/dashboard/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ Reaction.registerPackage({
label: "Dashboard",
template: "dashboardPackages",
icon: "icon-reaction-logo",
priority: 0
priority: 0,
permissions: [{
label: "Dashboard",
permission: "dashboard"
}]
}, {
route: "/dashboard/shop/settings",
template: "shopSettings",
Expand Down
6 changes: 5 additions & 1 deletion imports/plugins/core/orders/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ Reaction.registerPackage({
label: "Orders",
description: "Fulfill your orders",
icon: "fa fa-sun-o",
priority: 1
priority: 1,
permissions: [{
label: "Create Product",
permission: "createProduct"
}]
}, {
route: "/dashboard/pdf/orders/:id",
workflow: "coreOrderPrintWorkflow",
Expand Down
2 changes: 1 addition & 1 deletion imports/plugins/included/analytics/server/publications.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AnalyticsEvents } from "/lib/collections";
import { Reaction } from "/server/api";

Meteor.publish("AnalyticsEvents", function () {
const shopId = Reaction.getShopId();
const shopId = Reaction.getSellerShopId();
if (!shopId) {
return this.ready();
}
Expand Down
5 changes: 5 additions & 0 deletions imports/plugins/included/marketplace/client/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import "./templates/becomeSellerButton/becomeSellerButton.html";
import "./templates/becomeSellerButton/becomeSellerButton.js";

import "./templates/dashboard/settings.html";
import "./templates/dashboard/settings.js";
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template name="becomeSellerButton">
<button
class="btn {{classes}}"
data-event-category="marketplace"
data-event-action="button-click-become-seller"
data-event-label="Become a Seller button click"
data-event-value="clicked"
data-i18n="marketplace.becomeSeller">Become a seller</button>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { Meteor } from "meteor/meteor";
import { Reaction, i18next } from "/client/api";


// Page


// Button
Template.becomeSellerButton.helpers({
/**
* Give it a size and style
* @return {String} The classes
*/
classes() {
const classes = [
(this.type || "btn-info"),
(this.size || "")
];

return classes.join(" ");
}
});


Template.becomeSellerButton.events({
"click [data-event-action='button-click-become-seller']": function () {
Meteor.call("shop/createShop", Meteor.userId(), function (error, response) {
if (error) {
const error = i18next.t("marketplace.cannotCreateShop", { defaultValue: "Could not create shop for current user {{user}}" });
return Alerts.toast(error, "error");
}

const success = i18next.t("marketplace.yourShopIsReady", { defaultValue: "Your shop is now ready!" });
return Alerts.toast(success, "success");
});
}
});

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template name="marketplaceSettings">
<div class="panel panel-default">
<div class="panel-heading panel-heading-flex">
<h3 class="panel-title">
<i class="{{PackageData.settings.icon}}"></i> General
</h3>
</div>
<div class="panel-body">
{{#autoForm collection=Collections.Packages schema=MarketplacePackageConfig
doc=packageData id="marketplaceOptionsForm" type="update" autosave=true}}
{{> afFieldInput name="settings.public.allowGuestSellers"}}
{{/autoForm}}

{{schema}}
</div>
</div>
</template>

<template name="marketplaceCatalogSettings">
{{#autoForm collection=Collections.Packages schema=MarketplacePackageConfig
doc=packageData id="marketplaceOptionsForm" type="update" autosave=true}}
{{> afFieldInput name="settings.public.allowGuestSellers"}}
{{/autoForm}}

{{schema}}
</template>


Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { i18next } from "/client/api";
import { Packages } from "/lib/collections";
import { MarketplacePackageConfig } from "../../../lib/collections/schemas";


/**
* marketplaceSettings helpers
*
*/
Template.marketplaceSettings.helpers({
MarketplacePackageConfig() {
return MarketplacePackageConfig;
},

packageData() {
return Packages.findOne({
name: "reaction-marketplace"
});
}
});

/**
* marketplace Catalog settings
*/
Template.marketplaceCatalogSettings.inheritsHelpersFrom("marketplaceSettings");

/**
* marketplaceSettings autoform alerts
*/

AutoForm.hooks({
marketplaceOptionsForm: {
onSuccess() {
return Alerts.toast(i18next.t("marketplace.dashboardSettingsSaved"),
"success");
},
onError(operation, error) {
return Alerts.toast(
`${i18next.t("marketplace.dashboardSettingsFailed")} ${error}`, "error"
);
}
}
});
1 change: 1 addition & 0 deletions imports/plugins/included/marketplace/lib/api/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./marketplace";
32 changes: 32 additions & 0 deletions imports/plugins/included/marketplace/lib/api/marketplace.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Meteor } from "meteor/meteor";
import { Reaction } from "/lib/api";

/**
* hasMarketplaceGuestAccess
* @summary Checks if the current user is a guest in the marketplace and not a seller
* Owners always have full access
* @returns {Boolean} True if current user is a guest and not a seller, or the owner
*/
function hasMarketplaceGuestAccess() {
const currentUser = Meteor.user();

// parent shop owners have full access
if (Roles.getGroupsForUser(currentUser, "owner").length) {
return true;
}

const packageSettings = Reaction.getPackageSettings("reaction-marketplace");

// if marketplace is on
// allow only guests, who aren't sellers already
// to become sellers for their shop group
return (
packageSettings.enabled &&
packageSettings.settings.public.allowGuestSellers &&
Roles.getGroupsForUser(currentUser, "admin").length < 1
);
}

export const Marketplace = {
hasMarketplaceGuestAccess
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./marketplace";
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { SimpleSchema } from "meteor/aldeed:simple-schema";
import { PackageConfig } from "/lib/collections/schemas/registry";
/*
* Meteor.settings.marketplace =
* allowGuestSellers: false
*
*
*/

export const MarketplacePackageConfig = new SimpleSchema([
PackageConfig, {
"settings.public": {
type: Object,
optional: true
}
},
{
"settings.public.allowGuestSellers": {
type: Boolean,
defaultValue: false
}
}
]);

40 changes: 40 additions & 0 deletions imports/plugins/included/marketplace/register.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Reaction } from "/server/api";

Reaction.registerPackage({
label: "Marketplace",
name: "reaction-marketplace",
icon: "fa fa-globe",
autoEnable: true,
settings: {
name: "Marketplace",
public: {
allowGuestSellers: true
}
},
registry: [
// Dashboard card
/* Moved into catalog - settings below will provide a card instead
{
provides: "dashboard",
label: "Marketplace",
description: "Allow users to become sellers, switch shops UI",
icon: "fa fa-globe",
priority: 2,
container: "marketplace",
permissions: [{
label: "Marketplace",
permission: "dashboard/marketplace"
}]
},*/

// Settings reside in Catalog settings
{
label: "Marketplace Settings",
icon: "fa fa-globe",
provides: "catalogSettings",
container: "dashboard",
template: "marketplaceCatalogSettings"
}
]
});

Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<template name="gridControls">
{{#if hasPermission "createProduct"}}
{{#if hasControl }}
<div class="product-grid-controls">
<label class="like-button hidden" for="select-product-{{product._id}}">
<input
type="checkbox"
name="selectProduct"
value="{{product._id}}"
id="select-product-{{product._id}}"
checked={{checked}}
>
checked={{checked}}>
</label>

{{#if product.isDeleted}}
Expand Down
Loading