Skip to content

Commit

Permalink
v0.5.3 - Guest Checkout, RTL
Browse files Browse the repository at this point in the history
Thanks to contributions from @danielgindi `right to left internationalization` is now supported.

Take a look at the Russian or Hebrew languages to see RTL in action.

 - Resolves #176

Also contributions from  @firstred and @epson121 added Dutch and Croatian translations.

Thanks to contributions from @lovetostrike, the initial `reactioncommerce:reaction-social` package has been published, which gives basic social sharing functionality.

 - Resolves #61
 - Resolves #281

- if there is neither a sessionCart nor a userCart, create a sessionCart
  * add sessionId to cart.sessions
  * auto insert/update userId if authenticated
  * observers to ensure cart always exists (ie after deletion)
- if sessionCart is a not a userCart return sessionCart
- if sessionCart just authenticated, add userId
- only return a user cart when authenticated
  * copy existing userCart(s) into sessionCart and remove userCart(s)
- if userCart just logged out, remove sessionId from userCart and create new sessionCart
- allow multiple sessionId per cart when userCart

TODO:

- realistically this may not be very solid way to handle sessions.
- Session handling will need a **close review in the future**.
- potential edge cases where multiple session/auth/merge actions to a cart may destroy the cart
- cart really should have mirrored client and server methods and be tested offline

Issue updates:

- Remove packages introduced in reactioncommerce/reaction-core#76
- Resolves #271
- Resolves #339
- Resolves #326
- Resolves #183
- Strategic updates for issue #16
- Strategic updates for issue #318
- Strategic updates for issue #76

   * dashboard enable/disable **guest checkout**
   * change default step to **guest checkout** or create/sign-in
   * store email for order - **after order completion if guest**
   * not visible after destroyed session (ie: refresh)
   * updated checkout and progress bar to use
     cart value instead of session

TODO:

- validation on email guest entry
- add account creation instructions to an order completion email
- potentially add third prompt for account creation after email (or promos,etc)
- order emails!
- use workflow states to control checkout ui flow.

Thanks to initial contributions from @prinzdezibel!

- use new Accounts collection (previously referred to as customers)
- create account on user create, or use a session specific account
- implement Template.dynamic handling of AddressBook edit/add/grid
- changes to checkout address handling, fix accounts context
- update addressBook forms to autoform-v0.5.0 compatible (autoform not upgraded)
- change accounts/shop `email` from string to `emails` array
  - `emails: {'address': options.email, 'verified': true}`
- changed Shops, Accounts email to an array `emails`
- userAccountsDropdown icon for orders, profile
- user view of order history

TODO:

- merge session accounts to user account upon email confirmation (and email saved on cart)
- reduce / cleanup garbage sessions  (merge will help)
- session / accounts/ cart garbage collector
- account profile / settings
- on account creation / login  with password
    - if confirmed account creation email
      - create a account collection record with this userId
      - update all orders with matching email to match this userId
      - copy all order addresses into Accounts.profile.addressBook
      - copy all social / email info to Accounts.
      - users collection locked down, nothing exposed to client, used for authentication only
    - else
      - if there are more orders with this email
      - display on order view "Add order"

* moves user orders from cart/checkout folder to dashboard/orders
* add message for confirmation of email
* authenticated user can see all orders where userId in list view
* admin can see all in list view
* userAccountsDropdown icon for orders
* add cartId to Orders (instead of using cartId as orderId)

TODO:

- integrate the admin view of list into dashboard admin flow
- this is possibly a breaking change to the orders dashboard.
- remove sessionId from orders on logout

* updates to handling settings from registry (public, private)
* rename and move settingGeneral to shop/settings
* rename and move settingsAccounts to shop/accounts

**Multi-shop/vendor**

* shop account updates to prep multi-shop dashboard
* shopId added to cart.items (variants)

Issue updates:

- Strategic updates for issue #236
- Strategic updates for issue #327

* added settings.public to publish public settings to ReactionCore.xxx

Thanks to contributions and docs from @spencern

- Test coverage for product methods
- Fix, add coverage for core methods

* Upgrade to Meteor 1.0.4.2
* Implements `check` and `audit-argument-checks`
* Implements `browser-policy`
* Fixed footer layout pages loading.
* Updates CFS, removes FileStorage collection.
* **Contributions from @aldeed @prinzdezibel @spencern @boboci9 @evliu @ceh @gouthamve @KEFIRCHIK @epson21 @firstred
**
  • Loading branch information
aaronjudd committed Mar 24, 2015
2 parents 01e955a + a2adb32 commit 3910815
Show file tree
Hide file tree
Showing 147 changed files with 5,623 additions and 2,446 deletions.
1 change: 1 addition & 0 deletions packages/reaction-core/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.DS_Store
*.log
versions.json
.versions
166 changes: 83 additions & 83 deletions packages/reaction-core/.versions
Original file line number Diff line number Diff line change
@@ -1,61 +1,60 @@
accounts-base@1.1.3
accounts-password@1.0.6
[email protected].6
accounts-base@1.2.0
accounts-password@1.1.0
[email protected].7
alanning:[email protected]
aldeed:[email protected]
aldeed:collection2@2.2.0
aldeed:collection2@2.3.2
aldeed:[email protected]
aldeed:simple-schema@1.2.0
aldeed:template-extension@3.1.1
aldeed:simple-schema@1.3.0
aldeed:template-extension@3.4.3
[email protected]
anti:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
cfs:[email protected]
[email protected]
cmather:[email protected]
[email protected]
cfs:[email protected]
cfs:[email protected]
[email protected]
[email protected]
d3js:[email protected]
dburles:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
fortawesome:[email protected]_2
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
iron:[email protected]
iron:[email protected]
iron:[email protected]
Expand All @@ -64,53 +63,54 @@ iron:[email protected]
iron:[email protected]
iron:[email protected]
iron:[email protected]
[email protected].3
[email protected].2
[email protected].1
[email protected].12
[email protected].12
[email protected].2
[email protected].6
[email protected].3_2
[email protected].3
[email protected].2
[email protected].13
[email protected].13
[email protected].3
[email protected].7
matb33:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
meteorhacks:[email protected]
[email protected]
[email protected]
[email protected]
momentjs:[email protected]
mongo@1.0.11
[email protected].7
mongo@1.1.0
[email protected].8
mrt:[email protected]
nemo64:[email protected]_1
nemo64:[email protected]_1
[email protected].7
[email protected].4
[email protected].8_1
[email protected].5
ongoworks:[email protected]
ongoworks:[email protected]
ongoworks:[email protected]
ongoworks:[email protected]
[email protected]
prinzdezibel:[email protected]
[email protected]
raix:[email protected]
raix:[email protected]
[email protected].2
reactioncommerce:core@0.3.0
reactioncommerce:core-theme@1.1.0
reactive-dict@1.0.5
[email protected].4
[email protected].2
[email protected].2
[email protected].4
[email protected].3
reactioncommerce:core@0.5.2
reactioncommerce:core-theme@1.3.1
reactive-dict@1.1.0
[email protected].5
[email protected].3
[email protected].3
[email protected].5
sacha:[email protected]
[email protected].3
session@1.0.5
[email protected].2
[email protected].5
[email protected].4
[email protected].2
templating@1.0.11
[email protected].5
[email protected].5
[email protected].2
[email protected].3
webapp@1.1.6
[email protected].2
[email protected].4
session@1.1.0
[email protected].3
[email protected].6
[email protected].5
[email protected].3
templating@1.1.0
[email protected].6
[email protected].6
[email protected].3
[email protected].4
webapp@1.2.0
[email protected].3
22 changes: 10 additions & 12 deletions packages/reaction-core/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# reaction-core
#Reaction Core

`meteor add reactioncommerce:core`
---

See [Meteor Docs](http://docs.meteor.com) for introduction to [Meteor](http://meteor.com).
Reaction Core provides a core set of methods and templates for creating, connecting, and managing user carts, sessions, products, checkout and orders for Reaction Commerce.

Read [Meteor Style Guide](https://github.com/meteor/meteor/wiki/Meteor-Style-Guide) for format and style of contributions.
`meteor add reactioncommerce:core`

Our core is being built with a preference for Coffeescript + LESS, but JavaScript is welcome in packages.

We try to always be using latest full release of all community packages.
## Developer Documentation

# Developer Documentation
[Meteor Documentation](http://docs.meteor.com)

[Getting started guide](http://thoughts.reactioncommerce.com/how-to-get-involved-with-reaction-commerce/)

Expand All @@ -29,15 +25,17 @@ We try to always be using latest full release of all community packages.

[Template Development](https://github.com/ongoworks/reaction-core/blob/master/docs/templates.md)

[Deploying](https://github.com/ongoworks/reaction-core/blob/master/docs/deploying.md)


# Roadmap
## Roadmap
For a high level review our roadmap, take a look at the vision page [Reaction Vision](http://reactioncommerce.com/vision)

For grouping of development channels by feature see project milestones: https://github.com/reactioncommerce/reaction/milestones *note: progress indicators highly volatile indicators at the moment*
For grouping of development channels by feature see project milestones: https://github.com/reactioncommerce/reaction/milestones

And finally for the kanban-esque, hardcore real time progress view, take a look our [waffle board](https://waffle.io/reactioncommerce/reaction)


# Issues
## Issues
For development tasks/issues please use the [Reaction project issues](https://github.com/ongoworks/reaction/issues?state=open). We're keeping this as the central issue tracking for all [reactioncommerce:*](https://github.com/reactioncommerce/) packages. You can also view issues on our [waffle board](https://waffle.io/reactioncommerce/reaction).

31 changes: 21 additions & 10 deletions packages/reaction-core/client/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ _.extend ReactionCore,
isMember: false
isOwner: null
isAdmin: null
canCheckoutAsGuest: false
userPermissions: []
shopPermissions: []
shopPermissionGroups: []
Expand All @@ -19,24 +18,29 @@ _.extend ReactionCore,

if shop
self.shopId = shop._id
# check to see if guest checkout is enabled
self.canCheckoutAsGuest = shop.canCheckoutAsGuest || false
# permissions and packages
permissions = []

# get current enabled packages
self.usedPackages = ReactionCore.Collections.Packages.find({shopId: self.shopId, enabled: true}).fetch()
enabledPackages = ReactionCore.Collections.Packages.find(shopId: self.shopId, enabled: true).fetch()

# extract package registry permissions
for usedPackage in self.usedPackages
if usedPackage?.shopPermissions
for shopPermission in usedPackage.shopPermissions
for pkg in enabledPackages
if pkg?.shopPermissions
for shopPermission in pkg.shopPermissions
permissions.push shopPermission

self.shopPermissions = _.pluck(permissions, "permission")
self.shopPermissionGroups = for groupName, groupPermissions of _.groupBy(permissions, "group")
group: groupName
permissions: groupPermissions

# exposes public settings for packages
for pkg in enabledPackages
if pkg?.settings?.public
for setting, value of pkg.settings.public
ReactionCore[setting] = value

#XXX probably should use deps to recheck this whenever login/logout?
self.isOwner = Meteor.userId() is shop.ownerId

Expand All @@ -59,20 +63,27 @@ _.extend ReactionCore,
self.userPermissions = []
self.shopPermissions = []
self.shopPermissionGroups = []
# role checkout
hasOwnerAccess: ->
return Roles.userIsInRole(Meteor.user(), "admin") or @isOwner
# dashboard access
hasDashboardAccess: ->
return @isMember or @.hasOwnerAccess()

# permission check
hasPermission: (permissions) ->
return false unless permissions
permissions = [permissions] unless _.isArray(permissions)
return @.hasOwnerAccess() or _.intersection(permissions, @userPermissions).length or (@isAdmin and _.intersection(permissions, @shopPermissions).length)
# role checkout
hasOwnerAccess: ->
return Roles.userIsInRole(Meteor.user(), "admin") or @isOwner
# returns shop id
getShopId: ->
return @shopId


Meteor.startup ->
# todo: this could grow.. and grow...
# quick little client safety check
if (PackageRegistry?) then console.error "Bravely warning you that PackageRegistry should not be exported to client."

# Ignition.....
ReactionCore.init()
10 changes: 9 additions & 1 deletion packages/reaction-core/client/helpers/helpers.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###
# convert a string to camelCase
# convert a string to camelCase for use with i18n keys
###
String::toCamelCase = ->
# remove all characters that should not be in a variable name
Expand Down Expand Up @@ -272,3 +272,11 @@ currentProduct = @currentProduct
re = new RegExp("^6011")
return "discover" if number.match(re)?
""

###
# getGuestLoginState
# return true if guest checkout
# return userId if authenticated checkout
###
@getGuestLoginState = ->
Meteor.userId() || Session.equals "guestCheckoutFlow", true
Loading

0 comments on commit 3910815

Please sign in to comment.