workarea 3.4.16 → 3.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +81 -0
- metadata +10 -579
- data/docs/Gemfile +0 -8
- data/docs/Gemfile.lock +0 -130
- data/docs/bin/middleman +0 -29
- data/docs/config.rb +0 -87
- data/docs/config.ru +0 -7
- data/docs/data/articles.yml +0 -157
- data/docs/package.json +0 -15
- data/docs/source/404.html.erb +0 -13
- data/docs/source/articles/access-routes-in-javascript.html.md +0 -33
- data/docs/source/articles/add-a-content-area.html.md +0 -169
- data/docs/source/articles/add-a-content-block-type.html.md +0 -334
- data/docs/source/articles/add-a-report.html.md +0 -202
- data/docs/source/articles/add-css-through-the-admin-ui.html.md +0 -30
- data/docs/source/articles/add-javascript-through-a-manifest.html.md +0 -367
- data/docs/source/articles/add-javascript-through-a-view.html.md +0 -80
- data/docs/source/articles/add-javascript-through-the-admin-ui.html.md +0 -30
- data/docs/source/articles/add-metrics.html.md +0 -58
- data/docs/source/articles/add-or-replace-a-pricing-calculator.html.md +0 -150
- data/docs/source/articles/add-remove-or-change-a-mongoid-validation.html.md +0 -147
- data/docs/source/articles/add-remove-or-change-a-product-template.html.md +0 -142
- data/docs/source/articles/add-remove-sort-and-group-storefront-search-filters.html.md +0 -483
- data/docs/source/articles/add-stylesheets-through-a-manifest.html.md +0 -276
- data/docs/source/articles/add-system-content.html.md +0 -138
- data/docs/source/articles/analytics-overview.html.md +0 -51
- data/docs/source/articles/analyze-storefront-search-results.html.md +0 -261
- data/docs/source/articles/api-overview.html.md +0 -35
- data/docs/source/articles/appending.html.md +0 -506
- data/docs/source/articles/application-document.html.md +0 -88
- data/docs/source/articles/automated-javascript-testing.html.md +0 -162
- data/docs/source/articles/b2b-overview.html.md +0 -64
- data/docs/source/articles/browser-and-device-support.html.md +0 -47
- data/docs/source/articles/change-product-placeholder-image.html.md +0 -39
- data/docs/source/articles/change-storefront-search-results.html.md +0 -283
- data/docs/source/articles/change-the-storefront-product-pricing-ui.html.md +0 -348
- data/docs/source/articles/change-the-storefront-search-filters-ui.html.md +0 -103
- data/docs/source/articles/checkout.html.md +0 -479
- data/docs/source/articles/commerce-model.html.md +0 -164
- data/docs/source/articles/configuration-for-hosting.html.md +0 -106
- data/docs/source/articles/configuration.html.md +0 -406
- data/docs/source/articles/configure-a-payment-gateway.html.md +0 -58
- data/docs/source/articles/configure-asset-storage.html.md +0 -29
- data/docs/source/articles/configure-asset-types.html.md +0 -18
- data/docs/source/articles/configure-contact-form-subjects-list.html.md +0 -24
- data/docs/source/articles/configure-imageoptim.html.md +0 -23
- data/docs/source/articles/configure-locales.html.md +0 -45
- data/docs/source/articles/configure-logins-and-authentication.html.md +0 -42
- data/docs/source/articles/configure-low-inventory-threshold.html.md +0 -26
- data/docs/source/articles/configure-product-image-sizes-and-processing.html.md +0 -28
- data/docs/source/articles/content.html.md +0 -554
- data/docs/source/articles/contentable.html.md +0 -41
- data/docs/source/articles/contribute-code.html.md +0 -69
- data/docs/source/articles/contribute-documentation.html.md +0 -60
- data/docs/source/articles/create-a-custom-discount.html.md +0 -234
- data/docs/source/articles/create-a-new-app.html.md +0 -131
- data/docs/source/articles/create-a-plugin.html.md +0 -19
- data/docs/source/articles/create-a-style-guide.html.md +0 -71
- data/docs/source/articles/create-a-theme.html.md +0 -134
- data/docs/source/articles/css-architectural-overview.html.md +0 -89
- data/docs/source/articles/customize-a-helper.html.md +0 -91
- data/docs/source/articles/decoration.html.md +0 -415
- data/docs/source/articles/define-and-configure-inventory-policies.html.md +0 -107
- data/docs/source/articles/documentation-style-guide.html.md +0 -48
- data/docs/source/articles/documentation.html.md +0 -54
- data/docs/source/articles/domain-modeling.html.md +0 -82
- data/docs/source/articles/error-pages.html.md.erb +0 -95
- data/docs/source/articles/extension-overview.html.md +0 -152
- data/docs/source/articles/favicon-support.html.md +0 -112
- data/docs/source/articles/feature-spec-helper-stylesheet.html.md +0 -25
- data/docs/source/articles/featurejs-and-feature-spec-helper.html.md +0 -20
- data/docs/source/articles/help-and-support.html.md +0 -34
- data/docs/source/articles/html-fragment-caching.html.md +0 -46
- data/docs/source/articles/http-caching.html.md +0 -43
- data/docs/source/articles/i18n.html.md +0 -35
- data/docs/source/articles/images-flow.html.md +0 -10
- data/docs/source/articles/index-storefront-search-documents.html.md +0 -104
- data/docs/source/articles/infrastructure.html.md +0 -46
- data/docs/source/articles/installing.html.md +0 -61
- data/docs/source/articles/integrate-a-payment-gateway.html.md +0 -124
- data/docs/source/articles/integrate-a-web-analytics-provider.html.md +0 -35
- data/docs/source/articles/integrate-an-inventory-management-system.html.md +0 -88
- data/docs/source/articles/integrating-with-other-software.html.md +0 -59
- data/docs/source/articles/inventory.html.md +0 -352
- data/docs/source/articles/javascript-coding-standards.html.md +0 -30
- data/docs/source/articles/javascript-modules.html.md +0 -174
- data/docs/source/articles/javascript-overview.html.md +0 -62
- data/docs/source/articles/javascript-reference-documentation.html.md +0 -51
- data/docs/source/articles/javascript-templates.html.md +0 -52
- data/docs/source/articles/low-level-caching.html.md +0 -25
- data/docs/source/articles/maintain-a-plugin.html.md +0 -12
- data/docs/source/articles/maintenance-policy.html.md +0 -79
- data/docs/source/articles/navigable.html.md +0 -51
- data/docs/source/articles/navigating-the-code.html.md +0 -149
- data/docs/source/articles/navigation.html.md +0 -386
- data/docs/source/articles/order-life-cycle.html.md +0 -546
- data/docs/source/articles/order-pricing.html.md +0 -389
- data/docs/source/articles/orders-and-items.html.md +0 -210
- data/docs/source/articles/orders.html.md +0 -66
- data/docs/source/articles/overriding.html.md +0 -155
- data/docs/source/articles/overview.html.md +0 -43
- data/docs/source/articles/plugins-overview.html.md +0 -12
- data/docs/source/articles/prerequisites-and-dependencies.html.md +0 -202
- data/docs/source/articles/products.html.md.erb +0 -1270
- data/docs/source/articles/progressive-web-application-support.html.md +0 -148
- data/docs/source/articles/rails-asset-manifests.html.md +0 -33
- data/docs/source/articles/rails-asset-view-helpers.html.md +0 -25
- data/docs/source/articles/reading-data.html.md +0 -10
- data/docs/source/articles/releasable.html.md +0 -37
- data/docs/source/articles/report-a-bug.html.md +0 -75
- data/docs/source/articles/ruby-coding-standards.html.md +0 -10
- data/docs/source/articles/run-sidekiq-in-a-local-environment.html.md +0 -40
- data/docs/source/articles/searching.html.md +0 -1005
- data/docs/source/articles/security-policy.html.md +0 -42
- data/docs/source/articles/seeds.html.md +0 -345
- data/docs/source/articles/shipping.html.md +0 -756
- data/docs/source/articles/sort-and-exclude-product-options.html.md +0 -47
- data/docs/source/articles/storefront-search-features.html.md +0 -568
- data/docs/source/articles/storefront-searches.html.md +0 -126
- data/docs/source/articles/style-guides.html.md +0 -21
- data/docs/source/articles/stylesheet-coding-standards.html.md +0 -24
- data/docs/source/articles/stylesheets-overview.html.md +0 -67
- data/docs/source/articles/swappable-list-data-structure.html.md +0 -81
- data/docs/source/articles/system-emails.html.md +0 -102
- data/docs/source/articles/taggable.html.md +0 -8
- data/docs/source/articles/test-a-credit-card-transaction.html.md +0 -16
- data/docs/source/articles/test-if-a-plugin-is-installed.html.md +0 -34
- data/docs/source/articles/testing.html.md +0 -914
- data/docs/source/articles/themes-overview.html.md +0 -155
- data/docs/source/articles/translate-administrable-content.html.md +0 -14
- data/docs/source/articles/translate-javascript-content.html.md +0 -16
- data/docs/source/articles/translate-or-customize-message-content.html.md +0 -29
- data/docs/source/articles/translate-or-customize-static-content.html.md +0 -30
- data/docs/source/articles/use-an-existing-workarea-app.html.md +0 -108
- data/docs/source/articles/view-models.html.md +0 -509
- data/docs/source/articles/views.html.md +0 -14
- data/docs/source/articles/workers.html.md +0 -613
- data/docs/source/articles/writing-data.html.md +0 -10
- data/docs/source/cli.html.md +0 -163
- data/docs/source/favicon.ico +0 -0
- data/docs/source/images/3-variants-1-option.png +0 -0
- data/docs/source/images/3-variants-3-options.png +0 -0
- data/docs/source/images/3-years-primary-image.png +0 -0
- data/docs/source/images/404-storefront-error-page.png +0 -0
- data/docs/source/images/404-system-content-admin.png +0 -0
- data/docs/source/images/404.jpg +0 -0
- data/docs/source/images/5-years-primary-image.png +0 -0
- data/docs/source/images/activity-dashboard.png +0 -0
- data/docs/source/images/activity-for-object.png +0 -0
- data/docs/source/images/activity-ui.png +0 -0
- data/docs/source/images/adding-captioned-image-block-custom-icon.png +0 -0
- data/docs/source/images/adding-captioned-image-block-default-icon.png +0 -0
- data/docs/source/images/admin-alerts-ui.png +0 -0
- data/docs/source/images/admin-category-range-filters.png +0 -0
- data/docs/source/images/admin-for-3-column-hero.png +0 -0
- data/docs/source/images/admin-help-index.png +0 -0
- data/docs/source/images/admin-help-ui.png +0 -0
- data/docs/source/images/admin-javascript.png +0 -0
- data/docs/source/images/admin-notification-for-deactivated-discount.png +0 -0
- data/docs/source/images/admin-notifications-ui.png +0 -0
- data/docs/source/images/admin-product-show-page.png +0 -0
- data/docs/source/images/admin-products-index-page.png +0 -0
- data/docs/source/images/admin-range-filters.png +0 -0
- data/docs/source/images/admin-style-guides-navigation.png +0 -0
- data/docs/source/images/after-re-seeding.png +0 -0
- data/docs/source/images/after-seeding-localhost-3000.png +0 -0
- data/docs/source/images/after-seeding.png +0 -0
- data/docs/source/images/arrow.svg +0 -1
- data/docs/source/images/arrow_white.svg +0 -1
- data/docs/source/images/aws-resource-map.png +0 -0
- data/docs/source/images/backordered-until-output-on-inventory-sku-card.png +0 -0
- data/docs/source/images/before-seeding-localhost-3000.png +0 -0
- data/docs/source/images/before-seeding.png +0 -0
- data/docs/source/images/browsing-workarea-versions-on-the-web.png +0 -0
- data/docs/source/images/bulk-asset-upload-on-assets-index-page.png +0 -0
- data/docs/source/images/bulk-asset-upload-while-editing-content.png +0 -0
- data/docs/source/images/bundle-show-workarea-core.png +0 -0
- data/docs/source/images/bundle-show-workarea.png +0 -0
- data/docs/source/images/calendar-for-backordered-until-field.png +0 -0
- data/docs/source/images/captioned-image-block-in-storefront.png +0 -0
- data/docs/source/images/captioned-image-content-block-storefront-component-style-guide.png +0 -0
- data/docs/source/images/cart-system-content-in-admin.png +0 -0
- data/docs/source/images/cart-system-content-in-storefront.png +0 -0
- data/docs/source/images/checkout-addresses-guest.png +0 -0
- data/docs/source/images/checkout-addresses-user.png +0 -0
- data/docs/source/images/checkout-confirmation.png +0 -0
- data/docs/source/images/checkout-flow-0.png +0 -0
- data/docs/source/images/checkout-flow-1.png +0 -0
- data/docs/source/images/checkout-flow-2.png +0 -0
- data/docs/source/images/checkout-flow-3.png +0 -0
- data/docs/source/images/checkout-flow-4.png +0 -0
- data/docs/source/images/checkout-payment-guest.png +0 -0
- data/docs/source/images/checkout-payment-user.png +0 -0
- data/docs/source/images/checkout-shipping.png +0 -0
- data/docs/source/images/color-picker-component-admin-style-guide.png +0 -0
- data/docs/source/images/color-picker-component-on-content-editing-screen.png +0 -0
- data/docs/source/images/commerce-model-carts-orders.png +0 -0
- data/docs/source/images/commerce-model-order-pricing.png +0 -0
- data/docs/source/images/commerce-model.png +0 -0
- data/docs/source/images/configuring-an-index-pattern-in-kibana.png +0 -0
- data/docs/source/images/content-block-presets.png +0 -0
- data/docs/source/images/content-search-customization.png +0 -0
- data/docs/source/images/country-with-region-data-in-address-form.png +0 -0
- data/docs/source/images/country-without-region-data-in-address-form.png +0 -0
- data/docs/source/images/create-content-block-preset-ui.png +0 -0
- data/docs/source/images/credit-card-icons.png +0 -0
- data/docs/source/images/css-added-through-admin.png +0 -0
- data/docs/source/images/css-admin-ui.png +0 -0
- data/docs/source/images/current-configuration-shown-in-admin-settings.png +0 -0
- data/docs/source/images/customer-impersonation-in-admin.png +0 -0
- data/docs/source/images/customer-impersonation-in-store-front.png +0 -0
- data/docs/source/images/date-filter-same-day.png +0 -0
- data/docs/source/images/developer-toolbar-in-store-front.png +0 -0
- data/docs/source/images/discounts-sorted-by-most-redeemed.png +0 -0
- data/docs/source/images/edit-help-article.png +0 -0
- data/docs/source/images/editing-content-for-search-customization.png +0 -0
- data/docs/source/images/editing-dynamic-captioned-image-block.png +0 -0
- data/docs/source/images/editing-product-fields-in-the-admin.png +0 -0
- data/docs/source/images/editing-search-system-content.png +0 -0
- data/docs/source/images/editing-static-captioned-image-block-custom-icon.png +0 -0
- data/docs/source/images/editing-static-captioned-image-block-default-icon.png +0 -0
- data/docs/source/images/external.svg +0 -1
- data/docs/source/images/favicon_16.png +0 -0
- data/docs/source/images/favicon_180.png +0 -0
- data/docs/source/images/favicon_32.png +0 -0
- data/docs/source/images/filters-all.png +0 -0
- data/docs/source/images/filters-control.png +0 -0
- data/docs/source/images/filters-custom.png +0 -0
- data/docs/source/images/filters-groups.png +0 -0
- data/docs/source/images/filters-material.png +0 -0
- data/docs/source/images/filters-omitted.png +0 -0
- data/docs/source/images/filters-pinned.png +0 -0
- data/docs/source/images/filters-range.png +0 -0
- data/docs/source/images/filters-sorted.png +0 -0
- data/docs/source/images/filters-wrapping-to-second-line-in-admin.png +0 -0
- data/docs/source/images/generic-product-template-images-no-options-selected.png +0 -0
- data/docs/source/images/generic-product-template-images-options-selected.png +0 -0
- data/docs/source/images/generic-template.png +0 -0
- data/docs/source/images/hosting.svg +0 -1
- data/docs/source/images/image-group-content-block-in-storefront.png +0 -0
- data/docs/source/images/images.svg +0 -1
- data/docs/source/images/import-export-screenshot.png +0 -0
- data/docs/source/images/invalid-display.png +0 -0
- data/docs/source/images/itcss.png +0 -0
- data/docs/source/images/kibana-dev-tools-console.png +0 -0
- data/docs/source/images/layout-content-admin-with-2-areas.png +0 -0
- data/docs/source/images/layout-content-admin-with-3-areas.png +0 -0
- data/docs/source/images/link-to-search-system-content.png +0 -0
- data/docs/source/images/logo.svg +0 -1
- data/docs/source/images/menu.svg +0 -2
- data/docs/source/images/mongo-replica-set.svg +0 -1
- data/docs/source/images/multi-column-hero-blocks.png +0 -0
- data/docs/source/images/option-selects-product-template-images-options-selected.png +0 -0
- data/docs/source/images/option-selects-template.png +0 -0
- data/docs/source/images/option-thumbnails-template.png +0 -0
- data/docs/source/images/order-item-total-price-diagram.png +0 -0
- data/docs/source/images/order-pricing-cart-example.png +0 -0
- data/docs/source/images/order-pricing-example-adjustments.png +0 -0
- data/docs/source/images/order-pricing-example-totals.png +0 -0
- data/docs/source/images/order-pricing-placed-order-example.png +0 -0
- data/docs/source/images/order-shipping-total-diagram.png +0 -0
- data/docs/source/images/order-show-with-multiple-tenders.png +0 -0
- data/docs/source/images/order-subtotal-price-diagram.png +0 -0
- data/docs/source/images/order-tax-total-diagram.png +0 -0
- data/docs/source/images/order-total-price-diagram.png +0 -0
- data/docs/source/images/order-total-value-diagram.png +0 -0
- data/docs/source/images/orders-dashboard-links.png +0 -0
- data/docs/source/images/oval.svg +0 -1
- data/docs/source/images/payment-icon-storefront-style-guide.png +0 -0
- data/docs/source/images/people-dashboard-links.png +0 -0
- data/docs/source/images/price-adjustments-diagram.png +0 -0
- data/docs/source/images/price-display-no-options.png +0 -0
- data/docs/source/images/price-display-options-selected.png +0 -0
- data/docs/source/images/pricing-calculators-diagram.png +0 -0
- data/docs/source/images/product-list-content-block-admin.png +0 -0
- data/docs/source/images/product-list-content-block-in-store-front.png +0 -0
- data/docs/source/images/promo-products-excluded-autocomplete-results-after.png +0 -0
- data/docs/source/images/promo-products-excluded-featured-category-results-after.png +0 -0
- data/docs/source/images/promo-products-excluded-recommendations-results-after.png +0 -0
- data/docs/source/images/promo-products-excluded-search-category-results-after.png +0 -0
- data/docs/source/images/promo-products-excluded-search-results-after.png +0 -0
- data/docs/source/images/promo-products-included-autocomplete-results-before.png +0 -0
- data/docs/source/images/promo-products-included-featured-category-results-before.png +0 -0
- data/docs/source/images/promo-products-included-recommendations-results-before.png +0 -0
- data/docs/source/images/promo-products-included-search-category-results-before.png +0 -0
- data/docs/source/images/promo-products-included-search-results-before.png +0 -0
- data/docs/source/images/rails-version-constraint.png +0 -0
- data/docs/source/images/re-enable-discount.png +0 -0
- data/docs/source/images/reading-data.svg +0 -1
- data/docs/source/images/readme-hero.png +0 -0
- data/docs/source/images/redesigned-customized-sort-for-search-results.png +0 -0
- data/docs/source/images/reviews-summary-above-share-buttons.png +0 -0
- data/docs/source/images/reviews-summary-below-product-name.png +0 -0
- data/docs/source/images/reviews-summary-below-share-buttons.png +0 -0
- data/docs/source/images/reviews-summary-removed.png +0 -0
- data/docs/source/images/rsa-fingerprint-for-stash.png +0 -0
- data/docs/source/images/ruby-version-constraint.png +0 -0
- data/docs/source/images/script-tag-added-through-admin.png +0 -0
- data/docs/source/images/search-analysis-admin-alternate-rendering.png +0 -0
- data/docs/source/images/search-analysis-admin.png +0 -0
- data/docs/source/images/search-quality-report.png +0 -0
- data/docs/source/images/search.svg +0 -1
- data/docs/source/images/searching-for-cart-system-content-in-admin.png +0 -0
- data/docs/source/images/searching-for-layout-system-content-in-admin.png +0 -0
- data/docs/source/images/seeded-admin.png +0 -0
- data/docs/source/images/seeds-from-plugins.png +0 -0
- data/docs/source/images/seo-metadata-automation-ui.png +0 -0
- data/docs/source/images/show-password-button.png +0 -0
- data/docs/source/images/storefront-autocomplete.png +0 -0
- data/docs/source/images/storefront-category-summary-content-block.png +0 -0
- data/docs/source/images/storefront-category.png +0 -0
- data/docs/source/images/storefront-product-after-overriding.png +0 -0
- data/docs/source/images/storefront-product-before-overriding.png +0 -0
- data/docs/source/images/storefront-product-browse-page.png +0 -0
- data/docs/source/images/storefront-product-recommendations.png +0 -0
- data/docs/source/images/storefront-product-show-page.png +0 -0
- data/docs/source/images/storefront-requests-and-search-requests.png +0 -0
- data/docs/source/images/storefront-search-request-handling.png +0 -0
- data/docs/source/images/storefront-search-response-creation.png +0 -0
- data/docs/source/images/storefront-search.png +0 -0
- data/docs/source/images/storefront-style-guides-navigation.png +0 -0
- data/docs/source/images/styles.css +0 -3
- data/docs/source/images/tax-categories-ui.png +0 -0
- data/docs/source/images/tax-rates-ui.png +0 -0
- data/docs/source/images/unpurchasable-product.png +0 -0
- data/docs/source/images/url-redirects-filtering.png +0 -0
- data/docs/source/images/utility-nav-area-in-admin.png +0 -0
- data/docs/source/images/utility-nav-area-in-storefront.png +0 -0
- data/docs/source/images/validation-message-in-storefront.png +0 -0
- data/docs/source/images/view-model-interface.png +0 -0
- data/docs/source/images/viewing-workarea-version-in-source.png +0 -0
- data/docs/source/images/workarea.svg +0 -1
- data/docs/source/images/worst-performing-searches-on-results-customization-page.png +0 -0
- data/docs/source/images/writing-data.svg +0 -1
- data/docs/source/index.html.erb +0 -166
- data/docs/source/javascripts/jquery.js +0 -2
- data/docs/source/javascripts/lunr.js +0 -7
- data/docs/source/javascripts/site.js +0 -299
- data/docs/source/javascripts/vendor/highlight.pack.js +0 -2
- data/docs/source/layouts/article.erb +0 -106
- data/docs/source/layouts/bare.erb +0 -46
- data/docs/source/layouts/layout.erb +0 -43
- data/docs/source/release-notes/workarea-3-0-0.html.md +0 -146
- data/docs/source/release-notes/workarea-3-0-1.html.md +0 -161
- data/docs/source/release-notes/workarea-3-0-10.html.md +0 -39
- data/docs/source/release-notes/workarea-3-0-11.html.md +0 -277
- data/docs/source/release-notes/workarea-3-0-12.html.md +0 -14
- data/docs/source/release-notes/workarea-3-0-13.html.md +0 -153
- data/docs/source/release-notes/workarea-3-0-14.html.md +0 -93
- data/docs/source/release-notes/workarea-3-0-15.html.md +0 -107
- data/docs/source/release-notes/workarea-3-0-16.html.md +0 -36
- data/docs/source/release-notes/workarea-3-0-17.html.md +0 -141
- data/docs/source/release-notes/workarea-3-0-18.html.md +0 -123
- data/docs/source/release-notes/workarea-3-0-19.html.md +0 -160
- data/docs/source/release-notes/workarea-3-0-2.html.md +0 -222
- data/docs/source/release-notes/workarea-3-0-20.html.md +0 -95
- data/docs/source/release-notes/workarea-3-0-21.html.md +0 -168
- data/docs/source/release-notes/workarea-3-0-22.html.md +0 -268
- data/docs/source/release-notes/workarea-3-0-23.html.md +0 -173
- data/docs/source/release-notes/workarea-3-0-24.html.md +0 -19
- data/docs/source/release-notes/workarea-3-0-25.html.md +0 -26
- data/docs/source/release-notes/workarea-3-0-26.html.md +0 -199
- data/docs/source/release-notes/workarea-3-0-27.html.md +0 -113
- data/docs/source/release-notes/workarea-3-0-28.html.md +0 -39
- data/docs/source/release-notes/workarea-3-0-29.html.md +0 -73
- data/docs/source/release-notes/workarea-3-0-3.html.md +0 -35
- data/docs/source/release-notes/workarea-3-0-30.html.md +0 -186
- data/docs/source/release-notes/workarea-3-0-31.html.md +0 -125
- data/docs/source/release-notes/workarea-3-0-32.html.md +0 -73
- data/docs/source/release-notes/workarea-3-0-33.html.md +0 -137
- data/docs/source/release-notes/workarea-3-0-34.html.md +0 -203
- data/docs/source/release-notes/workarea-3-0-35.html.md +0 -205
- data/docs/source/release-notes/workarea-3-0-36.html.md +0 -105
- data/docs/source/release-notes/workarea-3-0-37.html.md +0 -144
- data/docs/source/release-notes/workarea-3-0-38.html.md +0 -73
- data/docs/source/release-notes/workarea-3-0-39.html.md +0 -77
- data/docs/source/release-notes/workarea-3-0-4.html.md +0 -14
- data/docs/source/release-notes/workarea-3-0-40.html.md +0 -130
- data/docs/source/release-notes/workarea-3-0-41.html.md +0 -70
- data/docs/source/release-notes/workarea-3-0-42.html.md +0 -52
- data/docs/source/release-notes/workarea-3-0-43.html.md +0 -72
- data/docs/source/release-notes/workarea-3-0-44.html.md +0 -93
- data/docs/source/release-notes/workarea-3-0-45.html.md +0 -61
- data/docs/source/release-notes/workarea-3-0-46.html.md +0 -171
- data/docs/source/release-notes/workarea-3-0-47.html.md +0 -130
- data/docs/source/release-notes/workarea-3-0-48.html.md +0 -160
- data/docs/source/release-notes/workarea-3-0-49.html.md +0 -28
- data/docs/source/release-notes/workarea-3-0-5.html.md +0 -225
- data/docs/source/release-notes/workarea-3-0-50.html.md +0 -74
- data/docs/source/release-notes/workarea-3-0-51.html.md +0 -61
- data/docs/source/release-notes/workarea-3-0-52.html.md +0 -76
- data/docs/source/release-notes/workarea-3-0-53.html.md +0 -126
- data/docs/source/release-notes/workarea-3-0-54.html.md +0 -112
- data/docs/source/release-notes/workarea-3-0-55.html.md +0 -105
- data/docs/source/release-notes/workarea-3-0-56.html.md +0 -56
- data/docs/source/release-notes/workarea-3-0-57.html.md +0 -82
- data/docs/source/release-notes/workarea-3-0-58.html.md +0 -153
- data/docs/source/release-notes/workarea-3-0-59.html.md +0 -78
- data/docs/source/release-notes/workarea-3-0-6.html.md +0 -165
- data/docs/source/release-notes/workarea-3-0-60.html.md +0 -43
- data/docs/source/release-notes/workarea-3-0-61.html.md +0 -46
- data/docs/source/release-notes/workarea-3-0-62.html.md +0 -23
- data/docs/source/release-notes/workarea-3-0-63.html.md +0 -25
- data/docs/source/release-notes/workarea-3-0-64.html.md +0 -25
- data/docs/source/release-notes/workarea-3-0-65.html.md +0 -37
- data/docs/source/release-notes/workarea-3-0-7.html.md +0 -207
- data/docs/source/release-notes/workarea-3-0-8.html.md +0 -337
- data/docs/source/release-notes/workarea-3-0-9.html.md +0 -196
- data/docs/source/release-notes/workarea-3-1-0.html.md +0 -414
- data/docs/source/release-notes/workarea-3-1-1.html.md +0 -139
- data/docs/source/release-notes/workarea-3-1-10.html.md +0 -19
- data/docs/source/release-notes/workarea-3-1-11.html.md +0 -27
- data/docs/source/release-notes/workarea-3-1-12.html.md +0 -216
- data/docs/source/release-notes/workarea-3-1-13.html.md +0 -113
- data/docs/source/release-notes/workarea-3-1-14.html.md +0 -39
- data/docs/source/release-notes/workarea-3-1-15.html.md +0 -107
- data/docs/source/release-notes/workarea-3-1-16.html.md +0 -188
- data/docs/source/release-notes/workarea-3-1-17.html.md +0 -141
- data/docs/source/release-notes/workarea-3-1-18.html.md +0 -73
- data/docs/source/release-notes/workarea-3-1-19.html.md +0 -137
- data/docs/source/release-notes/workarea-3-1-2.html.md +0 -55
- data/docs/source/release-notes/workarea-3-1-20.html.md +0 -203
- data/docs/source/release-notes/workarea-3-1-21.html.md +0 -205
- data/docs/source/release-notes/workarea-3-1-22.html.md +0 -121
- data/docs/source/release-notes/workarea-3-1-23.html.md +0 -144
- data/docs/source/release-notes/workarea-3-1-24.html.md +0 -94
- data/docs/source/release-notes/workarea-3-1-25.html.md +0 -77
- data/docs/source/release-notes/workarea-3-1-26.html.md +0 -130
- data/docs/source/release-notes/workarea-3-1-27.html.md +0 -70
- data/docs/source/release-notes/workarea-3-1-28.html.md +0 -52
- data/docs/source/release-notes/workarea-3-1-29.html.md +0 -44
- data/docs/source/release-notes/workarea-3-1-3.html.md +0 -185
- data/docs/source/release-notes/workarea-3-1-30.html.md +0 -72
- data/docs/source/release-notes/workarea-3-1-31.html.md +0 -93
- data/docs/source/release-notes/workarea-3-1-32.html.md +0 -61
- data/docs/source/release-notes/workarea-3-1-33.html.md +0 -171
- data/docs/source/release-notes/workarea-3-1-34.html.md +0 -130
- data/docs/source/release-notes/workarea-3-1-35.html.md +0 -179
- data/docs/source/release-notes/workarea-3-1-36.html.md +0 -28
- data/docs/source/release-notes/workarea-3-1-37.html.md +0 -74
- data/docs/source/release-notes/workarea-3-1-38.html.md +0 -61
- data/docs/source/release-notes/workarea-3-1-39.html.md +0 -96
- data/docs/source/release-notes/workarea-3-1-4.html.md +0 -148
- data/docs/source/release-notes/workarea-3-1-40.html.md +0 -126
- data/docs/source/release-notes/workarea-3-1-41.html.md +0 -128
- data/docs/source/release-notes/workarea-3-1-42.html.md +0 -105
- data/docs/source/release-notes/workarea-3-1-43.html.md +0 -37
- data/docs/source/release-notes/workarea-3-1-44.html.md +0 -82
- data/docs/source/release-notes/workarea-3-1-45.html.md +0 -153
- data/docs/source/release-notes/workarea-3-1-46.html.md +0 -91
- data/docs/source/release-notes/workarea-3-1-47.html.md +0 -65
- data/docs/source/release-notes/workarea-3-1-48.html.md +0 -46
- data/docs/source/release-notes/workarea-3-1-49.html.md +0 -23
- data/docs/source/release-notes/workarea-3-1-5.html.md +0 -169
- data/docs/source/release-notes/workarea-3-1-50.html.md +0 -42
- data/docs/source/release-notes/workarea-3-1-51.html.md +0 -25
- data/docs/source/release-notes/workarea-3-1-52.html.md +0 -57
- data/docs/source/release-notes/workarea-3-1-6.html.md +0 -117
- data/docs/source/release-notes/workarea-3-1-7.html.md +0 -176
- data/docs/source/release-notes/workarea-3-1-8.html.md +0 -283
- data/docs/source/release-notes/workarea-3-1-9.html.md +0 -212
- data/docs/source/release-notes/workarea-3-2-0.html.md +0 -1705
- data/docs/source/release-notes/workarea-3-2-1.html.md +0 -216
- data/docs/source/release-notes/workarea-3-2-10.html.md +0 -237
- data/docs/source/release-notes/workarea-3-2-11.html.md +0 -121
- data/docs/source/release-notes/workarea-3-2-12.html.md +0 -145
- data/docs/source/release-notes/workarea-3-2-13.html.md +0 -138
- data/docs/source/release-notes/workarea-3-2-14.html.md +0 -77
- data/docs/source/release-notes/workarea-3-2-15.html.md +0 -130
- data/docs/source/release-notes/workarea-3-2-16.html.md +0 -111
- data/docs/source/release-notes/workarea-3-2-17.html.md +0 -52
- data/docs/source/release-notes/workarea-3-2-18.html.md +0 -44
- data/docs/source/release-notes/workarea-3-2-19.html.md +0 -72
- data/docs/source/release-notes/workarea-3-2-2.html.md +0 -145
- data/docs/source/release-notes/workarea-3-2-20.html.md +0 -93
- data/docs/source/release-notes/workarea-3-2-21.html.md +0 -61
- data/docs/source/release-notes/workarea-3-2-22.html.md +0 -154
- data/docs/source/release-notes/workarea-3-2-23.html.md +0 -130
- data/docs/source/release-notes/workarea-3-2-24.html.md +0 -200
- data/docs/source/release-notes/workarea-3-2-25.html.md +0 -28
- data/docs/source/release-notes/workarea-3-2-26.html.md +0 -94
- data/docs/source/release-notes/workarea-3-2-27.html.md +0 -61
- data/docs/source/release-notes/workarea-3-2-28.html.md +0 -96
- data/docs/source/release-notes/workarea-3-2-29.html.md +0 -126
- data/docs/source/release-notes/workarea-3-2-30.html.md +0 -112
- data/docs/source/release-notes/workarea-3-2-31.html.md +0 -105
- data/docs/source/release-notes/workarea-3-2-32.html.md +0 -56
- data/docs/source/release-notes/workarea-3-2-33.html.md +0 -82
- data/docs/source/release-notes/workarea-3-2-34.html.md +0 -153
- data/docs/source/release-notes/workarea-3-2-35.html.md +0 -91
- data/docs/source/release-notes/workarea-3-2-36.html.md +0 -118
- data/docs/source/release-notes/workarea-3-2-37.html.md +0 -46
- data/docs/source/release-notes/workarea-3-2-38.html.md +0 -23
- data/docs/source/release-notes/workarea-3-2-39.html.md +0 -42
- data/docs/source/release-notes/workarea-3-2-4.html.md +0 -109
- data/docs/source/release-notes/workarea-3-2-40.html.md +0 -25
- data/docs/source/release-notes/workarea-3-2-41.html.md +0 -90
- data/docs/source/release-notes/workarea-3-2-5.html.md +0 -186
- data/docs/source/release-notes/workarea-3-2-6.html.md +0 -173
- data/docs/source/release-notes/workarea-3-2-7.html.md +0 -89
- data/docs/source/release-notes/workarea-3-2-8.html.md +0 -137
- data/docs/source/release-notes/workarea-3-2-9.html.md +0 -219
- data/docs/source/release-notes/workarea-3-3-0.html.md +0 -1272
- data/docs/source/release-notes/workarea-3-3-1.html.md +0 -324
- data/docs/source/release-notes/workarea-3-3-10.html.md +0 -69
- data/docs/source/release-notes/workarea-3-3-11.html.md +0 -72
- data/docs/source/release-notes/workarea-3-3-12.html.md +0 -136
- data/docs/source/release-notes/workarea-3-3-13.html.md +0 -61
- data/docs/source/release-notes/workarea-3-3-14.html.md +0 -196
- data/docs/source/release-notes/workarea-3-3-15.html.md +0 -167
- data/docs/source/release-notes/workarea-3-3-16.html.md +0 -234
- data/docs/source/release-notes/workarea-3-3-17.html.md +0 -82
- data/docs/source/release-notes/workarea-3-3-18.html.md +0 -165
- data/docs/source/release-notes/workarea-3-3-19.html.md +0 -106
- data/docs/source/release-notes/workarea-3-3-2.html.md +0 -72
- data/docs/source/release-notes/workarea-3-3-20.html.md +0 -116
- data/docs/source/release-notes/workarea-3-3-21.html.md +0 -228
- data/docs/source/release-notes/workarea-3-3-22.html.md +0 -125
- data/docs/source/release-notes/workarea-3-3-23.html.md +0 -154
- data/docs/source/release-notes/workarea-3-3-24.html.md +0 -70
- data/docs/source/release-notes/workarea-3-3-25.html.md +0 -114
- data/docs/source/release-notes/workarea-3-3-26.html.md +0 -260
- data/docs/source/release-notes/workarea-3-3-27.html.md +0 -138
- data/docs/source/release-notes/workarea-3-3-28.html.md +0 -147
- data/docs/source/release-notes/workarea-3-3-29.html.md +0 -63
- data/docs/source/release-notes/workarea-3-3-3.html.md +0 -153
- data/docs/source/release-notes/workarea-3-3-30.html.md +0 -102
- data/docs/source/release-notes/workarea-3-3-31.html.md +0 -57
- data/docs/source/release-notes/workarea-3-3-32.html.md +0 -44
- data/docs/source/release-notes/workarea-3-3-33.html.md +0 -114
- data/docs/source/release-notes/workarea-3-3-34.html.md +0 -29
- data/docs/source/release-notes/workarea-3-3-4.html.md +0 -332
- data/docs/source/release-notes/workarea-3-3-5.html.md +0 -242
- data/docs/source/release-notes/workarea-3-3-6.html.md +0 -100
- data/docs/source/release-notes/workarea-3-3-7.html.md +0 -148
- data/docs/source/release-notes/workarea-3-3-8.html.md +0 -163
- data/docs/source/release-notes/workarea-3-3-9.html.md +0 -93
- data/docs/source/release-notes/workarea-3-4-0.html.md +0 -580
- data/docs/source/release-notes/workarea-3-4-1.html.md +0 -150
- data/docs/source/release-notes/workarea-3-4-10.html.md +0 -72
- data/docs/source/release-notes/workarea-3-4-11.html.md +0 -60
- data/docs/source/release-notes/workarea-3-4-12.html.md +0 -155
- data/docs/source/release-notes/workarea-3-4-15.html.md +0 -100
- data/docs/source/release-notes/workarea-3-4-16.html.md +0 -88
- data/docs/source/release-notes/workarea-3-4-2.html.md +0 -188
- data/docs/source/release-notes/workarea-3-4-3.html.md +0 -136
- data/docs/source/release-notes/workarea-3-4-4.html.md +0 -114
- data/docs/source/release-notes/workarea-3-4-5.html.md +0 -275
- data/docs/source/release-notes/workarea-3-4-6.html.md +0 -169
- data/docs/source/release-notes/workarea-3-4-7.html.md +0 -162
- data/docs/source/release-notes/workarea-3-4-8.html.md +0 -95
- data/docs/source/release-notes/workarea-3-4-9.html.md +0 -135
- data/docs/source/release-notes.html.md +0 -261
- data/docs/source/search.html.erb +0 -34
- data/docs/source/shared/_header.erb +0 -61
- data/docs/source/shared/_svgs.erb +0 -17
- data/docs/source/style_guide/index.html.erb +0 -382
- data/docs/source/stylesheets/_base.scss +0 -125
- data/docs/source/stylesheets/_components.scss +0 -669
- data/docs/source/stylesheets/_helpers.scss +0 -10
- data/docs/source/stylesheets/_opinions.scss +0 -42
- data/docs/source/stylesheets/_settings.scss +0 -56
- data/docs/source/stylesheets/_typography.scss +0 -119
- data/docs/source/stylesheets/site.css.scss +0 -14
- data/docs/source/stylesheets/vendor/_avalanche.scss +0 -328
- data/docs/source/stylesheets/vendor/_normalize.scss +0 -341
- data/docs/source/stylesheets/vendor/highlight/_tomorrow_night_blue.scss +0 -75
- data/docs/source/upgrade-guides/workarea-3-4-0.html.md +0 -152
- data/docs/source/upgrade-guides.html.md +0 -18
- data/docs/workarea_renderer.rb +0 -8
- data/docs/yarn.lock +0 -2522
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Inventory
|
|
3
|
-
excerpt: Workarea includes an inventory subsystem providing inventory management and automated merchandising, which developers can extend
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Inventory
|
|
7
|
-
======================================================================
|
|
8
|
-
|
|
9
|
-
Workarea includes an inventory subsystem providing inventory management and automated merchandising based on inventory levels and policies.
|
|
10
|
-
This system is fully functional as it is, but developers may need to extend or operate the system to accomplish the following:
|
|
11
|
-
|
|
12
|
-
* Integrate Workarea with a retailer's inventory management system
|
|
13
|
-
* Define and configure inventory policies
|
|
14
|
-
* Explain to a retailer how the inventory system works, including inventory management and inventory's effects on the shopping experience (for example, you may need to explain how an item's inventory is preventing a product from matching a search)
|
|
15
|
-
|
|
16
|
-
To develop these skills, you'll need to know the following:
|
|
17
|
-
|
|
18
|
-
* How retailers manage inventory within Workarea
|
|
19
|
-
* How Workarea protects retailers by not overselling, while also maintaining the quality of the shopping experience for shoppers
|
|
20
|
-
* How Workarea captures and releases inventory when shoppers place and cancel orders, which maintains inventory integrity
|
|
21
|
-
|
|
22
|
-
This document therefore describes the Workarea inventory system, from management to reporting.
|
|
23
|
-
|
|
24
|
-
A retailer manages __inventory SKUs__, each of which has __administrable fields__, including a __policy__, from which Workarea derives various __inventory SKU states__.
|
|
25
|
-
Workarea uses these states to prevent overselling and to communicate availability when presenting searches, categories, recommendations, products, and carts.
|
|
26
|
-
Finally, when shoppers place and cancel orders, Workarea __purchases__, __captures__, and __releases__ inventory, managing the same inventory fields as retailers.
|
|
27
|
-
Workarea records these __inventory transactions__ for each order and also provides reports and insights to help a retailer restock inventory effectively.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Inventory Management
|
|
31
|
-
----------------------------------------------------------------------
|
|
32
|
-
|
|
33
|
-
A retailer can manage inventory within Workarea directly or within a separate inventory management system that is integrated with Workarea.
|
|
34
|
-
( Regarding the latter, see [Integrate an Inventory Management System](integrate-an-inventory-management-system.html). )
|
|
35
|
-
In either case, the retailer manages inventory via several administrable fields on inventory SKUs.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
### Inventory SKUs
|
|
39
|
-
|
|
40
|
-
An _inventory SKU_ is a MongoDB-backed model representing the inventory for an item in the retailer's catalog.
|
|
41
|
-
Each inventory SKU is identified by the item's SKU, a retailer-specific ID that relates the inventory SKU to other models representing the same item within Workarea.
|
|
42
|
-
( See [Products](products.html) for a more thorough explanation of the models that represent merchandise, and their relationships. )
|
|
43
|
-
|
|
44
|
-
Administrators, developers, and automated systems manage inventory by manipulating several administrable fields on each inventory SKU, including the inventory SKU's policy.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
### Administrable Fields & Policies
|
|
48
|
-
|
|
49
|
-
The following table describes the _administrable fields_ of each inventory SKU:
|
|
50
|
-
|
|
51
|
-
| Field | Description |
|
|
52
|
-
| ----- | ----------- |
|
|
53
|
-
| `:available` | The integer count of units that are available except when reserved; defaults to `0` |
|
|
54
|
-
| `:backordered` | The integer count of units that are available when backorder is allowed, except when reserved, defaults to `0` |
|
|
55
|
-
| `:reserve` | The integer count of units to reserve from the collective pool of `available` and `backordered`; defaults to `0` |
|
|
56
|
-
| `:backordered_until` | The `Time` at which backordered units are expected to move to available |
|
|
57
|
-
| `:policy` | A string identifying one of the policies enumerated in `Workarea.config.inventory_policies`; defaults to the first policy in that configurable collection |
|
|
58
|
-
|
|
59
|
-
The most important of these fields are the integer values `:available`, `:backordered` and `reserve`, and the `:policy`, which Workarea uses collectively to derive various inventory states, as explained in the following sections.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Presenting Products & Carts
|
|
63
|
-
----------------------------------------------------------------------
|
|
64
|
-
|
|
65
|
-
While the retailer is responsible for setting the inventory values in the above fields, Workarea is responsible for honoring those values throughout the shopping experience.
|
|
66
|
-
Workarea must prevent overselling to protect the retailer, and must also maintain the user experience for shoppers.
|
|
67
|
-
To accomplish both goals, Workarea performs automatic merchandising which prevents shoppers from adding unavailable items to their carts, or may hide items from shoppers altogether while inventory is unavailable.
|
|
68
|
-
This requires determining the displayability and purchasability of each item, based on its inventory.
|
|
69
|
-
Workarea derives these states from the administrable fields on the inventory SKU.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
### Inventory Policies & SKU States
|
|
73
|
-
|
|
74
|
-
Introduced above, an _inventory policy_ is a class of object that declares the logic for converting the administrable values of an inventory SKU into _inventory SKU states_.
|
|
75
|
-
An inventory policy also declares the logic for purchasing a SKU's inventory, which is covered below.
|
|
76
|
-
|
|
77
|
-
Workarea includes several inventory policies, and plugins and applications can define and configure their own policies.
|
|
78
|
-
( For a more in-depth look at policy class definitions and configuration, see [Define & Configure Inventory Policies](define-and-configure-inventory-policies.html). )
|
|
79
|
-
The following example enumerates the available policies:
|
|
80
|
-
|
|
81
|
-
```ruby
|
|
82
|
-
puts Workarea.config.inventory_policies
|
|
83
|
-
# Workarea::Inventory::Policies::Ignore
|
|
84
|
-
# Workarea::Inventory::Policies::Standard
|
|
85
|
-
# Workarea::Inventory::Policies::DisplayableWhenOutOfStock
|
|
86
|
-
# Workarea::Inventory::Policies::AllowBackorder
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
For each inventory SKU, workarea uses the SKU's policy and other values of its administrable fields to derive the following inventory SKU states:
|
|
90
|
-
|
|
91
|
-
| State | Description |
|
|
92
|
-
| ----- | ----------- |
|
|
93
|
-
| `available_to_sell` | The computed integer count of available units, derived from `:available`, `:backordered`, and `reserve` by the policy |
|
|
94
|
-
| `purchasable?(quantity)` | Whether the item is purchasable, determined by comparing the given quantity to `available_to_sell`; quantity defaults to `1` |
|
|
95
|
-
| `displayable?` | Whether the item is displayable, as determined by the policy |
|
|
96
|
-
| `backordered?` | Whether the item is backordered, which can be true only when the policy is `'allow_backorder'` |
|
|
97
|
-
|
|
98
|
-
The following sections explain each inventory policy and its effects on these inventory SKU states.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
#### Standard
|
|
102
|
-
|
|
103
|
-
The standard policy allows purchase only from the `:available` units, minus those in `:reserve`.
|
|
104
|
-
An item is displayable if it is purchasable.
|
|
105
|
-
|
|
106
|
-
```ruby
|
|
107
|
-
# create an inventory SKU
|
|
108
|
-
sku = 'WIZRDRPG-5ED'
|
|
109
|
-
inventory_sku = Workarea::Inventory::Sku.create(
|
|
110
|
-
_id: sku,
|
|
111
|
-
policy: 'standard',
|
|
112
|
-
available: 0,
|
|
113
|
-
backordered: 3,
|
|
114
|
-
reserve: 1
|
|
115
|
-
)
|
|
116
|
-
|
|
117
|
-
# review the administrable values
|
|
118
|
-
inventory_sku.available
|
|
119
|
-
# => 0
|
|
120
|
-
inventory_sku.backordered
|
|
121
|
-
# => 3
|
|
122
|
-
inventory_sku.reserve
|
|
123
|
-
# => 1
|
|
124
|
-
|
|
125
|
-
# there are none available to sell, because this policy
|
|
126
|
-
# does not allow purchase from :backordered
|
|
127
|
-
inventory_sku.available_to_sell
|
|
128
|
-
# => 0
|
|
129
|
-
|
|
130
|
-
# The item is therefore not purchasable and not displayable
|
|
131
|
-
inventory_sku.purchasable?
|
|
132
|
-
# => false
|
|
133
|
-
inventory_sku.displayable?
|
|
134
|
-
# => false
|
|
135
|
-
|
|
136
|
-
# And it is not considered backordered
|
|
137
|
-
inventory_sku.backordered?
|
|
138
|
-
# => false
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
#### Allow Backorder
|
|
143
|
-
|
|
144
|
-
When backorder is allowed, units from `:backordered` are additionally available for purchase, minus those in `:reserve`.
|
|
145
|
-
|
|
146
|
-
```ruby
|
|
147
|
-
# change the inventory SKU's policy and re-initialize it
|
|
148
|
-
# (to clear the memoized policy object)
|
|
149
|
-
inventory_sku.update_attribute(:policy, 'allow_backorder')
|
|
150
|
-
inventory_sku = Workarea::Inventory::Sku.find(sku)
|
|
151
|
-
|
|
152
|
-
# the administrable values haven't changed
|
|
153
|
-
inventory_sku.available
|
|
154
|
-
# => 0
|
|
155
|
-
inventory_sku.backordered
|
|
156
|
-
# => 3
|
|
157
|
-
inventory_sku.reserve
|
|
158
|
-
# => 1
|
|
159
|
-
|
|
160
|
-
# But the item is now considered backordered
|
|
161
|
-
inventory_sku.backordered?
|
|
162
|
-
# => true
|
|
163
|
-
|
|
164
|
-
# And there are units to sell
|
|
165
|
-
inventory_sku.available_to_sell
|
|
166
|
-
# => 2
|
|
167
|
-
|
|
168
|
-
# Up to 2 units are purchasable; the 3rd is reserved
|
|
169
|
-
inventory_sku.purchasable?
|
|
170
|
-
# => true
|
|
171
|
-
inventory_sku.purchasable?(2)
|
|
172
|
-
# => true
|
|
173
|
-
inventory_sku.purchasable?(3)
|
|
174
|
-
# => false
|
|
175
|
-
|
|
176
|
-
# And the item is displayable
|
|
177
|
-
inventory_sku.displayable?
|
|
178
|
-
# => true
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
#### Displayable When Out of Stock
|
|
183
|
-
|
|
184
|
-
An item that is displayable when out of stock behaves like a standard item, except it remains displayable when not purchasable.
|
|
185
|
-
|
|
186
|
-
```ruby
|
|
187
|
-
# Change the policy and re-init the inventory SKU
|
|
188
|
-
inventory_sku.update_attribute(:policy, 'displayable_when_out_of_stock')
|
|
189
|
-
inventory_sku = Workarea::Inventory::Sku.find(sku)
|
|
190
|
-
|
|
191
|
-
# No changes to the administrable values
|
|
192
|
-
inventory_sku.available
|
|
193
|
-
# => 0
|
|
194
|
-
inventory_sku.backordered
|
|
195
|
-
# => 3
|
|
196
|
-
inventory_sku.reserve
|
|
197
|
-
# => 1
|
|
198
|
-
|
|
199
|
-
# This policy does not allow backorder
|
|
200
|
-
inventory_sku.backordered?
|
|
201
|
-
# => false
|
|
202
|
-
|
|
203
|
-
# So there are therefore none to sell, and
|
|
204
|
-
# the item is not purchasable
|
|
205
|
-
inventory_sku.available_to_sell
|
|
206
|
-
# => 0
|
|
207
|
-
inventory_sku.purchasable?
|
|
208
|
-
# => false
|
|
209
|
-
|
|
210
|
-
# However, it is displayable
|
|
211
|
-
inventory_sku.displayable?
|
|
212
|
-
# => true
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
#### Ignore
|
|
217
|
-
|
|
218
|
-
Ignoring inventory can be useful for intangible items, such as gift cards, that have effectively infinite inventory.
|
|
219
|
-
A retailer may also use this policy if they are not concerned with tracking inventory within Workarea.
|
|
220
|
-
This is the default inventory policy.
|
|
221
|
-
|
|
222
|
-
```ruby
|
|
223
|
-
# Change the policy and re-init the inventory SKU
|
|
224
|
-
inventory_sku.update_attribute(:policy, 'ignore')
|
|
225
|
-
inventory_sku = Workarea::Inventory::Sku.find(sku)
|
|
226
|
-
|
|
227
|
-
# Administrable values are the same
|
|
228
|
-
inventory_sku.available
|
|
229
|
-
# => 0
|
|
230
|
-
inventory_sku.backordered
|
|
231
|
-
# => 3
|
|
232
|
-
inventory_sku.reserve
|
|
233
|
-
# => 1
|
|
234
|
-
|
|
235
|
-
# The item is not backordered
|
|
236
|
-
inventory_sku.backordered?
|
|
237
|
-
# => false
|
|
238
|
-
|
|
239
|
-
# But there are effectively infinite units available
|
|
240
|
-
# (This value will not change, even as orders with this item are placed)
|
|
241
|
-
inventory_sku.available_to_sell
|
|
242
|
-
# => 99999
|
|
243
|
-
|
|
244
|
-
# The item is therefore always purchasable and displayable
|
|
245
|
-
inventory_sku.purchasable?
|
|
246
|
-
# => true
|
|
247
|
-
inventory_sku.displayable?
|
|
248
|
-
# => true
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
### Searches, Categories & Recommendations
|
|
253
|
-
|
|
254
|
-
Workarea presents the items of the retailer's catalog as [products](products.html), which are (generally small) collections of items that share a name, description, and some details, while varying on other details (such as color, size, etc).
|
|
255
|
-
When a product document is indexed into Elasticsearch, it contains inventory information from all the items that make up the product.
|
|
256
|
-
|
|
257
|
-
[Storefront search features](storefront-search-features.html), such as searches, categories, and product recommendations, take inventory into account when deciding which products match and how they are sorted in results.
|
|
258
|
-
The inventory-related display logic can be summarized as follows:
|
|
259
|
-
|
|
260
|
-
* To match a search or category, a product must have at least one displayable SKU
|
|
261
|
-
* To match a query for search-based recommendations, a product must have at least one purchasable SKU
|
|
262
|
-
* When sorted by relevance (as opposed to a user-defined sort), search and category results sort products with at least one purchasable SKU above those without a purchasable SKU (unless the product is featured; featured products sort to the top)
|
|
263
|
-
|
|
264
|
-
Search features essentially re-implement the concepts of displayable and purchasable using inventory fields within product search documents and with queries defined with the Elasticsearch query DSL.
|
|
265
|
-
__These determinations can therefore be "stale" relative to the current inventory values in MongoDB__.
|
|
266
|
-
|
|
267
|
-
A retailer can use inventory policies to determine how products should appear in the results for search-based features.
|
|
268
|
-
It may be desirable for an item to be included in results even when it is not purchasable, but Workarea will de-prioritize the product within the results.
|
|
269
|
-
|
|
270
|
-
The purpose of these presentation rules is to prevent shoppers from adding to their cart items that are not purchasable, which would create a poor user experience for the shopper.
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
### Products & Carts
|
|
274
|
-
|
|
275
|
-
While searching and browsing products, a shopper will often select a specific product to view in detail.
|
|
276
|
-
The product detail page (PDP), like the search features, reflects the inventory of the items that make up the product.
|
|
277
|
-
|
|
278
|
-
A PDP presents product options that the shopper selects to narrow the product to a specific item to be added to the shopper's cart.
|
|
279
|
-
The product options are derived from the details of the product's displayable SKUs, hence, retailers can use inventory policies to determine which options should display.
|
|
280
|
-
For example, an item with only backordered inventory is considered displayable when the SKU's policy is `AllowBackorder`, but not when the policy is `Standard`.
|
|
281
|
-
|
|
282
|
-
Furthermore, after narrowing to a specific item, the shopper can add the item to the cart only if it is purchasable.
|
|
283
|
-
To continue the previous example, an item with only backordered inventory can be added to the cart only if its policy is `AllowBackorder` or `Ignore`.
|
|
284
|
-
|
|
285
|
-
As with the search features, these rules on the PDP are intended to keep non-purchasable items out of shoppers carts.
|
|
286
|
-
However, after a shopper adds an item to their cart, it can become non-purchasable if other shoppers purchase the remaining inventory first (or inventory changes due to inventory management).
|
|
287
|
-
Workarea therefore checks inventory on most cart and checkout requests to ensure the items in the cart are still purchasable.
|
|
288
|
-
If items become non-purchasable, Workarea removes them from the cart and notifies the shopper.
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
### Inventory Status Messages
|
|
292
|
-
|
|
293
|
-
To more directly communicate an item's availability to shoppers, Workarea displays _inventory status messages_ on the PDP and in the cart.
|
|
294
|
-
The messages are per-item, so on the PDP a shopper must first narrow the product to a specific item before being shown the inventory status.
|
|
295
|
-
|
|
296
|
-
The inventory status shown is one of the following:
|
|
297
|
-
|
|
298
|
-
* In Stock
|
|
299
|
-
* _Number_ Left
|
|
300
|
-
* Ships on _Date_
|
|
301
|
-
* Backordered
|
|
302
|
-
* Out of Stock
|
|
303
|
-
|
|
304
|
-
These messages are for display only, and their logic is therefore encapsulated in a [view model](view-models.html): `Storefront::InventoryStatusViewModel`.
|
|
305
|
-
Review the implementation of that view model in your Workarea version to see the logic for each status.
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
Placing & Canceling Orders
|
|
309
|
-
----------------------------------------------------------------------
|
|
310
|
-
|
|
311
|
-
You've seen above how Workarea prevents the sale of non-purchasable merchandise.
|
|
312
|
-
However, as shoppers place orders, Workarea must maintain accurate inventory levels.
|
|
313
|
-
Workarea uses inventory transactions to purchase and release inventory as users place and cancel orders.
|
|
314
|
-
Furthermore, Workarea exposes these inventory changes in the Admin through reports and insights.
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
### Purchasing, Capturing & Releasing Inventory
|
|
318
|
-
|
|
319
|
-
To maintain accurate inventory within its boundaries, Workarea must _purchase_ the inventory for an order, according to the inventory policy of each SKU.
|
|
320
|
-
|
|
321
|
-
Regardless of policy, the value of `:purchased` on the inventory SKU is incremented by the quantity purchased.
|
|
322
|
-
This value tracks the number of units purchased since the creation of the inventory SKU.
|
|
323
|
-
Additionally, the current computed value from `#available_to_sell` is persisted to the field `:sellable`, which is used for presenting a low inventory report.
|
|
324
|
-
|
|
325
|
-
Depending on policy, units are _captured_ from `:available` and `:backordered`, as described in the following table:
|
|
326
|
-
|
|
327
|
-
| Policy | Capture Logic |
|
|
328
|
-
| ------ | ------------- |
|
|
329
|
-
| `'standard'` | Purchased quantity is decremented from `:available` |
|
|
330
|
-
| `'displayable_when_out_of_stock'` | Same as `'standard'`, from which it inherits |
|
|
331
|
-
| `'allow_backorder'` | Purchased quantity is decremented first from `:available` (until exhausted) and then from `:backordered` |
|
|
332
|
-
| `'ignore'` | Nothing is captured |
|
|
333
|
-
|
|
334
|
-
If a shopper later cancels the order, Workarea must _release_ the inventory, which is the reverse of a capture and relies on the record of the purchase stored in the inventory transaction.
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
### Inventory Transactions
|
|
338
|
-
|
|
339
|
-
When an order is placed, the details of the inventory captured are recorded in an _inventory transaction_, a separate document (an `Inventory::Transaction`) which embeds an inventory transaction item for each corresponding order item.
|
|
340
|
-
Inventory transactions are used to manage the capturing of inventory and to provide a permanent record of what was captured.
|
|
341
|
-
They are also used in the event of a cancellation to free the appropriate amount of inventory.
|
|
342
|
-
|
|
343
|
-
( Inventory transactions are also covered in [Integrate an Inventory Management System](integrate-an-inventory-management-system.html). )
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
### Reports & Insights
|
|
347
|
-
|
|
348
|
-
Because Workarea is modifying inventory counts, it must provide a means for retailers to stay informed of current inventory levels.
|
|
349
|
-
In addition to the inventory SKU administration screens, Workarea provides two reports directly relevant to those responsible for restocking inventory: "Low Inventory" and "Sales by Product".
|
|
350
|
-
A retailer can view and export these reports in the Admin.
|
|
351
|
-
Insights based on these reports also appear within several Admin dashboards.
|
|
352
|
-
Relying on these insights, retailers can effectively manage inventory levels, completing the inventory cycle explained in this document.
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: JavaScript Coding Standards
|
|
3
|
-
excerpt: In addition to using a standard module structure, modules generally follow the coding style of Douglas Crockford.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# JavaScript Coding Standards
|
|
7
|
-
|
|
8
|
-
In addition to using a standard module structure, modules generally follow the [coding style of Douglas Crockford](http://javascript.crockford.com/code.html).
|
|
9
|
-
|
|
10
|
-
To enforce code style rules, we use [ESLint](http://eslint.org/).
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
npm install -g eslint
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
Each Workarea gem includes a `.eslintrc` file to configure ESLint. The following rules are also observed:
|
|
17
|
-
|
|
18
|
-
- Unless unavoidable, do not use the keyword `this`. Functions passed to jQuery's `on` and `each` methods include parameters that provide access to relevent DOM elements and data, so `this` is almost never required in Workarea modules. Avoid jQuery iteration methods that do not pass the current element as an argument to the iterator, such as the function form of `.attr`. Use `.each` instead.
|
|
19
|
-
- When chaining methods across multiple lines, indent/outdent only when the return value changes.
|
|
20
|
-
```
|
|
21
|
-
$('.product-form')
|
|
22
|
-
.find('fieldset')
|
|
23
|
-
.first()
|
|
24
|
-
.attr('id', 'first')
|
|
25
|
-
.end()
|
|
26
|
-
.end()
|
|
27
|
-
.attr('id', 'cart-form')
|
|
28
|
-
.serializeArray();
|
|
29
|
-
```
|
|
30
|
-
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: JavaScript Modules
|
|
3
|
-
excerpt: Workarea JavaScript modules are used to solve the problems of code organization and asynchronous initialization. First let's look at the issue of code organization so I can explain what I mean by "module".
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# JavaScript Modules
|
|
7
|
-
|
|
8
|
-
Workarea JavaScript modules are used to solve the problems of code organization and asynchronous initialization. First let's look at the issue of code organization so I can explain what I mean by "module".
|
|
9
|
-
|
|
10
|
-
## Organizing Code
|
|
11
|
-
|
|
12
|
-
JavaScript modules in the Workarea platform are simply named objects registered via `WORKAREA.registerModule`. Each module acts as a namespace for a collection of related functions. To create a module, start with an object. In the example below, I've assigned the object to a variable.
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
var obj = {
|
|
16
|
-
doSomething: function () {
|
|
17
|
-
// code to do something
|
|
18
|
-
},
|
|
19
|
-
doSomethingElse: function () {
|
|
20
|
-
// code to do somethinf else
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
To make this object a module, simply register it, giving it a name in the process. The name must be a valid JavaScript identifier.
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
WORKAREA.registerModule('demoModule', obj);
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
You can now access the module's methods using `WORKAREA.demoModule`.
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
WORKAREA.demoModule.doSomething();
|
|
35
|
-
WORKAREA.demoModule.doSomethingElse();
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
**Note:** Module names are guaranteed to be unique. If you try to register another module with the same name, an error will be thrown.
|
|
39
|
-
|
|
40
|
-
### Module Patterns
|
|
41
|
-
|
|
42
|
-
In practice, modules are not created using the pattern shown above. Instead, a function is created and immediatedly invoked to return the object passed to `WORKAREA.registerModule`. This allows you to program within the body of a function rather than within the body of an object but still return an object in the end.
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
WORKAREA.registerModule('demoModule', (function () {
|
|
46
|
-
var doSomething = function () {
|
|
47
|
-
// code to do something
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
doSomethingElse = function () {
|
|
51
|
-
// code to do something else
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
return {
|
|
55
|
-
doSomething: doSomething,
|
|
56
|
-
doSomethingElse: doSomethingElse
|
|
57
|
-
};
|
|
58
|
-
}()));
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
A secondary benefit of this pattern is private methods. The returned object includes only the methods that are considered public.
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
WORKAREA.registerModule('demoModule', (function () {
|
|
65
|
-
var doSomethingPrivately = function () {
|
|
66
|
-
// code to do something privately
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
doSomethingElsePrivately = function () {
|
|
70
|
-
// code to do something else privately
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
doSomething = function () {
|
|
74
|
-
// code to do something that may invoke
|
|
75
|
-
// doSomethingPrivately()
|
|
76
|
-
// or
|
|
77
|
-
// doSomethingElsePrivately()
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
doSomethingElse = function () {
|
|
81
|
-
// code to do something else that may invoke
|
|
82
|
-
// doSomethingPrivately()
|
|
83
|
-
// or
|
|
84
|
-
// doSomethingElsePrivately()
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
return {
|
|
88
|
-
doSomething: doSomething,
|
|
89
|
-
doSomethingElse: doSomethingElse
|
|
90
|
-
};
|
|
91
|
-
}()));
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
WORKAREA.demoModule.doSomething(); // does something
|
|
96
|
-
WORKAREA.demoModule.doSomethingElse(); // does something else
|
|
97
|
-
WORKAREA.demoModule.doSomethingPrivately(); // undefined (private)
|
|
98
|
-
WORKAREA.demoModule.doSomethingElsePrivately(); // undefined (private)
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### Method Naming Conventions
|
|
102
|
-
|
|
103
|
-
Public module methods generally fall into 2 categories: utilities and DOM manipulations. Utilities are methods like `WORKAREA.url.parse` that transform input into output and generally have no interaction with the DOM. On the other hand, **modules that manipulate the DOM always include a public method named `init` which is responsible for querying the DOM for the relevant elements**. This convention is important to ensure proper module initialization, which I explain next.
|
|
104
|
-
|
|
105
|
-
## Initializing Code
|
|
106
|
-
|
|
107
|
-
The 2nd problem modules address is code initialization, specifically asynchronous initialization. But first let's look at synchronous initialization.
|
|
108
|
-
|
|
109
|
-
The [application manifest](add-javascript-through-a-manifest.html) uses `require_asset` to load each JavaScript module into memory. At that point, each method on each module is defined, but none have yet been invoked. The manifest concludes by invoking a single JavaScript method:
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
WORKAREA.initModules($(document));
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
`WORKAREA.initModules` enumerates each registered module, in the order in which they were registered (the order in which they are included in the manifest) and invokes each module's `init` method if it has one. `$(document)`, the argument passed to `WORKAREA.initModules` is passed through to each module's `init` method when it is invoked.
|
|
116
|
-
|
|
117
|
-
This is the first time in the application that `WORKAREA.initModules` is called and the only time that it is called with a reference to the entire document as its argument. It may get called many more times before the page is reloaded, so **modules must be written to run multiple times and must be aware of their current scope**. The current scope is a DOM reference passed as an argument, which is covered next.
|
|
118
|
-
|
|
119
|
-
### Module Scope
|
|
120
|
-
|
|
121
|
-
**Scope is the most important concept in the Workarea module system.** It's easiest to explain scope through an example. Consider a module that implements the following methods:
|
|
122
|
-
|
|
123
|
-
```
|
|
124
|
-
var updateProductDetails = function (event) {
|
|
125
|
-
// asynchronously request a new DOM fragment with up to date
|
|
126
|
-
// product details and replace the current page's product
|
|
127
|
-
// details fragment with the new one
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
init = function ($scope) {
|
|
131
|
-
$('.change-color-button', $scope).on('click', updateProductDetails);
|
|
132
|
-
};
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
As explained above, the application manifest will invoke this module's `init` method, passing `$(document)` as the argument named `$scope`. The `init` method queries within `$scope`, in this case the entire document, for elements matching the selector `.change-color-button` and attaches a click handler to each. When clicked, the `updateProductDetails` method, shown above, is invoked.
|
|
136
|
-
|
|
137
|
-
So every change-color button has now been wired up with a click handler to replace the product details. Now the user clicks one of them. An ajax request is made to fetch new product details HTML and that HTML replaces the old product details HTML on the current page. However, the new HTML includes some change-color buttons and they don't have the click handler attached because they weren't present when modules were initialized the first time around. Same goes for the product zoom and any other JavaScript functionality that's supposed to happen within the new product details.
|
|
138
|
-
|
|
139
|
-
To fix this, the `updateProductDetails` method must call `WORKAREA.initModules` and pass in the new HTML as the `$scope` so that **modules are initialized again, but only within the new fragment that was added to the DOM**. It is important to not re-init modules on any part of the DOM other than the new fragment to avoid bugs from double event bindings and similar issues.
|
|
140
|
-
|
|
141
|
-
```
|
|
142
|
-
var updateProductDetails = function (event) {
|
|
143
|
-
// asynchronously request a new DOM fragment with up to date
|
|
144
|
-
// product details and replace the current page's product
|
|
145
|
-
// details fragment with the new one. store the new DOM
|
|
146
|
-
// fragment in the variable $newProductDetails for reference
|
|
147
|
-
|
|
148
|
-
WORKAREA.initModules($newProductDetails);
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
init = function ($scope) {
|
|
152
|
-
$('.change-color-button', $scope).on('click', updateProductDetails);
|
|
153
|
-
};
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
**Every init function must therefore accept a `$scope` argument and must always limit its DOM queries to within that scope.**
|
|
157
|
-
|
|
158
|
-
**Note:** Code that should run only once (like attaching a resize handler to `window`) should generally be run outside of an init function since init functions may be invoked multiple times. If the code must be run inside an init function (to test for a specific element within `$scope`, for example), programatically restrict the function to run only once using something like `_.once`.
|
|
159
|
-
|
|
160
|
-
## Customizing a Module
|
|
161
|
-
|
|
162
|
-
To customize an existing module you must [override](overriding.html) it, essentially making a copy of it in your application.
|
|
163
|
-
|
|
164
|
-
## Creating a Module
|
|
165
|
-
|
|
166
|
-
To create a new module, run the workarea:js\_module Rails generator within your application. This will generate the file and the module boilerplate, which you can then customize to taste.
|
|
167
|
-
|
|
168
|
-
Run the generator without any arguments to display its documentation.
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
cd path/to/your_app
|
|
172
|
-
bin/rails g workarea:js_module
|
|
173
|
-
```
|
|
174
|
-
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: JavaScript Overview
|
|
3
|
-
excerpt: A new Workarea application includes no JavaScript of its own. Create one to see for yourself. However, the Workarea platform adds an Admin and a Storefront to the application, and each of those includes its own JavaScript files that are fully custom
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# JavaScript Overview
|
|
7
|
-
|
|
8
|
-
A new Workarea application includes no JavaScript of its own. [Create one to see for yourself](create-a-new-app.html). However, the Workarea platform adds an Admin and a Storefront to the application, and each of those includes its own JavaScript files that are fully customizable.
|
|
9
|
-
|
|
10
|
-
This guide provides an overview of (1) how to get JavaScript on the page and (2) understanding JavaScript provided by Workarea.
|
|
11
|
-
|
|
12
|
-
## Getting JavaScript on the Page
|
|
13
|
-
|
|
14
|
-
Looking at the Storefront of a vanilla Workarea app (no customizations or plugins) in production, there are exactly 3 `script` elements, 2 in the `head` and 1 in the `body`.
|
|
15
|
-
|
|
16
|
-
The first in the head looks something like this:
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
<script type="text/javascript">window.NREUM /*...*/</script>
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
You won't see this code anywhere in the application. It's injected into the page by the New Relic APM agent to capture and report analytics back to [New Relic](http://newrelic.com/). This code is added at the middleware level and may vary based on your hosting arrangement.
|
|
23
|
-
|
|
24
|
-
The next `script` tag in the head looks something like this:
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
<script src="https://vanilla-app-production-workarea.cdn-ssl.com/assets/workarea/storefront/head-041c56bdb2104549c9bf5779d5de6892ca91d665a94417092f8233ea460689da.js"></script>
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
And the one in the body looks something like this:
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
<script src="https://vanilla-app-production-workarea.cdn-ssl.com/assets/workarea/storefront/application-2c3748f10d7452eaa5d2572fabc099650b49f8a372d0cc69c414aaeaf16ae62a.js"></script>
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
If you take the time to scroll horizontally (or look below), you'll see the file names are:
|
|
37
|
-
|
|
38
|
-
`head-041c56bdb2104549c9bf5779d5de6892ca91d665a94417092f8233ea460689da.js`
|
|
39
|
-
|
|
40
|
-
And:
|
|
41
|
-
|
|
42
|
-
`application-2c3748f10d7452eaa5d2572fabc099650b49f8a372d0cc69c414aaeaf16ae62a.js`
|
|
43
|
-
|
|
44
|
-
**These are the head and application JavaScript manifests, the primary mechanisms for adding and removing JavaScript files in your app**. Unless you have a good reason to do otherwise, **[Add and remove JavaScripts using a manifest](add-javascript-through-a-manifest.html)**. Not familiar with asset manifests? [I've got you covered](add-javascript-through-a-manifest.html).
|
|
45
|
-
|
|
46
|
-
So what if you do have a good reason to do otherwise? Then you can [add JavaScript through a view](add-javascript-through-a-view.html) or [add JavaScript through the Admin UI](add-javascript-through-the-admin-ui.html).
|
|
47
|
-
|
|
48
|
-
Plugins can add their own assets to your app as well, so check out [Appending](appending.html) to take control of that process.
|
|
49
|
-
|
|
50
|
-
## The JavaScript Universe According to Workarea
|
|
51
|
-
|
|
52
|
-
To understand the JavaScript provided by Workarea you should familiarize yourself with [Workarea modules](javascript-modules.html) and [JST/EJS templates](javascript-templates.html).
|
|
53
|
-
|
|
54
|
-
Also good to know are how to [access Rails routes in JavaScript](access-routes-in-javascript.html) and how to [configure JavaScript](configuration.html).
|
|
55
|
-
|
|
56
|
-
Regarding JavaScript dependencies, Feature.js behaves a bit differently than the others, and Workarea also has a feature test helper file that interacts with Feature.js. Those topics are covered in the cleverly named [Feature.js & Feature Test Helper](featurejs-and-feature-spec-helper.html) guide.
|
|
57
|
-
|
|
58
|
-
## Some Last Words on JavaScript
|
|
59
|
-
|
|
60
|
-
Lastly, [JavaScript reference documentation](javascript-reference-documentation.html) is available, which covers each of the public functions and their signatures.
|
|
61
|
-
|
|
62
|
-
If you'd care to [contribute](contribute-code.html) code back to the platform, or if you obsess over code style, check out the Workarea [JavaScript coding standards](javascript-coding-standards.html).
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: JavaScript Reference Documentation
|
|
3
|
-
excerpt: Workarea JavaScripts are documented with JSDoc comments. You can generate HTML documentation (among other formats) using a variety of tools designed to parse JSDoc comments, including the jsdoc tool itself.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# JavaScript Reference Documentation
|
|
7
|
-
|
|
8
|
-
Workarea JavaScripts are documented with [JSDoc](http://usejsdoc.org/) comments. You can generate HTML documentation (among other formats) using a variety of tools designed to parse JSDoc comments, including the `jsdoc` tool itself.
|
|
9
|
-
|
|
10
|
-
## Installing JSDoc
|
|
11
|
-
|
|
12
|
-
Install `jsdoc` or a similar tool using [npm](https://www.npmjs.com/).
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
npm install -g jsdoc
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Generating Documentation for Installed Gems
|
|
19
|
-
|
|
20
|
-
Create a directory for the generated documentation within your application.
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
cd path/to/your_app
|
|
24
|
-
mkdir docs
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
The following commands will generate the JavaScript reference documentation for workarea-core, workarea-admin, and workarea-storefront and place them within subdirectories of `/docs`, which was created above.
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
cd path/to/your_app
|
|
31
|
-
bundle
|
|
32
|
-
jsdoc `bundle show workarea-core` -r -d ./docs/workarea-core-javascript-reference
|
|
33
|
-
jsdoc `bundle show workarea-admin` -r -d ./docs/workarea-admin-javascript-reference
|
|
34
|
-
jsdoc `bundle show workarea-storefront` -r -d ./docs/workarea-store-front-javascript-reference
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Viewing Documentation
|
|
38
|
-
|
|
39
|
-
The commands above generate static HTML files. Open `index.html` to browser the documentation.
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
open docs/workarea-core-javascript-reference/index.html
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
**Note:** Avoid using undocumented Workarea functions and properties. They should be considered private and unstable.
|
|
46
|
-
|
|
47
|
-
Use similar commands to generate documentation for any Workarea plugins or additional gems.
|
|
48
|
-
|
|
49
|
-
**Note:** You may want to commit the documentation files into your application's code repository to save your teammates the trouble of generating their own documentation. Conversly, you may want to instruct your version control system to ignore these directories to force developers to generate fresh documentation each time.
|
|
50
|
-
|
|
51
|
-
|