Core/Client

Core/Client

Source:

Reaction core namespace for client code

Members

(static) Locale :ReactiveVar

Current locale

Source:
Type:
  • ReactiveVar

(static) primaryShopId

primaryShopId is the first created shop.

Source:

primaryShopId is the first created shop. In a marketplace setting it's the shop that controls the marketplace and can see all other shops.

(static) shopId

shopId refers to the active shop.

Source:

shopId refers to the active shop. For most shoppers this will be the same as the primary shop, but for administrators this will usually be the shop they administer.

(static) shopId

shopId refers to the active shop.

Source:

shopId refers to the active shop. For most shoppers this will be the same as the primary shop, but for administrators this will usually be the shop they administer.

(static) state

Return global "reactionState" Reactive Dict

Source:

Methods

(static) allowGuestCheckout()

Source:

(static) canInviteToGroup(options) → {Boolean}

checks if the user making the request is allowed to make invitation to that group

Source:

(similar to server/api canInviteToGroup)

Parameters:
Name Type Description
options Object

-

Properties
Name Type Description
group Object

group to invite to

user Object

user object making the invite (Meteor.user())

Returns:

-

Type
Boolean

(static) clearActionView()

Source:

(static) clearActionViewDetail()

Source:

(static) getActionView()

Source:

(static) getActionViewDetail()

Source:

(static) getCurrentShop() → {Object|null}

Get the proper current shop based on various checks. This mirrors the logic in Reaction.getShopId on the server

Source:
Returns:

The shop document

Type
Object | null

(static) getCurrentTag()

Source:

(static) getMarketplaceSettings() → {Object}

finds the enabled reaction-marketplace package for the primary shop and returns the settings

Source:
Returns:

The marketplace settings from the primary shop or undefined

Type
Object

(static) getPackageSettings()

Source:

(static) getPackageSettingsWithOptions()

Source:

(static) getPrimaryShopCurrency()

Source:

(static) getPrimaryShopId()

Source:

(static) getPrimaryShopName()

Source:

(static) getPrimaryShopSettings()

Source:

(static) getRegistryForCurrentRoute()

Source:

(static) getSellerShopId()

Source:

(static) getShopId()

shopId refers to the active shop.

Source:

shopId refers to the active shop. For most shoppers this will be the same as the primary shop, but for administrators this will usually be the shop they administer.

(static) getShopName(providedShopID) → {String}

gets name of shop by provided shopId, or current active shop if shopId is not provided

Source:
Parameters:
Name Type Description
providedShopID String

shopId of shop to return name of

Returns:
  • shop name
Type
String

(static) getShopSettings()

Source:

(static) getUserPreferences()

Source:

(static) hasAdminAccess(shopIdopt) → {Boolean}

Checks to see if the user has admin permissions.

Source:

Checks to see if the user has admin permissions. If a shopId is optionally passed in, we check for that shopId, otherwise we check against the default

Parameters:
Name Type Attributes Description
shopId string <optional>

Optional shopId to check access against

Returns:

true if the user has admin or owner permission, otherwise false

Type
Boolean

(static) hasDashboardAccess()

Source:

(static) hasDashboardAccessForAnyShop(options) → {Boolean}

client permission check for any "owner", "admin", or "dashboard" permissions for any shop.

Source:
To Do:
  • This could be faster with a dedicated hasAdminDashboard boolean on the user object
Parameters:
Name Type Description
options Object

options object that can be passed a user and/or a set of permissions

Returns:

Boolean - true if has dashboard access for any shop

Type
Boolean

(static) hasDashboardAccessForMultipleShops() → {Boolean}

  • client permission check for any "owner", "admin", or "dashboard" permissions for more than one shop.

Source:
Returns:

Boolean - true if has dashboard access for more than one shop

Type
Boolean

(static) hasOwnerAccess()

Source:

(static) hasPermission(checkPermissions, checkUserId, checkGroup) → {Boolean}

client permissions checks. hasPermission exists on both the server and the client.

Source:
Parameters:
Name Type Description
checkPermissions String | Array

String or Array of permissions if empty, defaults to "admin, owner"

checkUserId String

userId, defaults to logged in user ID

checkGroup String

group - default to shopId

Returns:

Boolean - true if has permission

Type
Boolean

(static) hasShopSwitcherAccess()

Source:

(static) hideActionView()

Source:

(static) hideActionViewDetail()

Source:

(static) init()

Initialization code

Source:

(static) isActionViewAtRootView()

Source:

(static) isActionViewDetailAtRootView()

Source:

(static) isActionViewDetailOpen()

Source:

(static) isActionViewOpen()

Source:

(static) isPreview()

Source:

(static) popActionView()

Source:

(static) popActionViewDetail()

Source:

(static) pushActionView()

Source:

(static) pushActionViewDetail()

Source:

(static) setActionView()

Source:

(static) setActionViewDetail()

Source:

(static) setShopId()

shopId refers to the active shop.

Source:

shopId refers to the active shop. For most shoppers this will be the same as the primary shop, but for administrators this will usually be the shop they administer.

(static) setUserPreferences()

Source:

(static) showActionView(viewData) → {String}

Source:
Parameters:
Name Type Description
viewData String

{label, template, data}

Returns:

Session "admin/showActionView"

Type
String

(static) updateUserPreferences()

Source: