Giter VIP home page Giter VIP logo

spartacus's Introduction

JavaScript storefront (spartacus)

REUSE status

Spartacus and Composable Storefront

Hello and welcome!

This README is part of the develop branch, which is an active development branch in the Spartacus repository. As such, the following text may contain references to work that is in progress and not yet officially released.

Starting with version 2211.19, composable storefront has aligned its versioning with SAP Commerce Cloud. The previous release of composable storefront was version 6.8. For more information, see Changes to Release Numbering and Update Policies for Composable Storefront Starting in February 2024.

Starting with version 5.0, “SAP Commerce Cloud, composable storefront” is the name for the official release of project “Spartacus” libraries published by SAP. The officially supported composable storefront is available to SAP Commerce Cloud customers. Documentation is available on the SAP Help Portal.

Composable storefront is based off the Spartacus open source code, and is included in the SAP Commerce Cloud license at no extra cost. Composable storefront has a roll-forward update policy.

On-premise customers may still use Spartacus open source. For more information, see Self-Publishing Spartacus Libraries Using the Open Source Code.

What is Spartacus?

Spartacus is a lean, Angular-based JavaScript storefront for SAP Commerce Cloud. Spartacus talks to SAP Commerce Cloud exclusively through the Commerce REST API.

Spartacus is...

  • Extendable: Spartacus is designed to be upgradable while maintaining full extendability. You'll be able to adopt new versions of Spartacus by updating the Spartacus libraries that we will regularly enhance. (In order to ensure that the first release is as extendable and upgradable as we'd like, breaking changes will very likely be introduced up until the 1.0 launch.)
  • Upgradable: Spartacus code is published and used as libraries and follows semantic versioning conventions. By using the libraries, Spartacus is upgradable for minor and patch releases.
  • Progressive: Spartacus is on a journey to be fully compliant with the Progressive Web Application (PWA) checklist. We aim to add support for all major features of a PWA-enabled storefront, to offer the best possible customer experience regardless of device or location.
  • Open Source: Spartacus is open source. It will be continually developed by the SAP Commerce Cloud team, but we are very keen to welcome contributors and to foster an inclusive, active development community for Spartacus. See our contributing documentation for more information.
  • Modern: The Spartacus storefront is part of our exciting new journey towards a customizable-yet-upgradable technology for SAP Commerce Cloud installations. See SAP Customer Experience for more information about SAP Commerce Cloud.

Storefront Features

Spartacus provides core storefront features such as:

  • Home page
  • Search
  • Categories
  • Product details
  • Cart page
  • Adding to cart
  • Checkout
  • Order history

See the Release documentation on the SAP Help Portal for more information.

Requirements

If you are working with Spartacus 2211, see the 2211 Angular development environment requirements on the SAP Help Portal.

If you are working with Spartacus 6.x, see the relevant 6.x Angular development environment requirements on the SAP Help Portal.

If you are working with Spartacus 5.x, see the relevant 5.x Angular development environment requirements on the SAP Help Portal.

For the back end requirements, see the Composable Storefront Compatibility Matrix.

If you are working with Spartacus 4.x, your Angular development environment should include the following:

  • Angular CLI: 12.0 or later, < 13.
  • yarn: v1.15 or later
  • node.js: Version 14.15 is required. Version 12.x reached end-of-life on April 30, 2022, and is no longer supported by Spartacus. It is strongly recommended that you migrate any existing Spartacus storefronts to Node.js 14 as soon as possible. If there are any issues with Spartacus and Node.js 14, please upgrade to the latest releases. If you continue to experience issues with Node.js 14, create a support ticket with SAP. Spartacus also supports version 16.x of Node.js, but this version is not yet supported in Commerce Cloud in the Public Cloud builder.

If you are working with Spartacus 3.x, your Angular development environment should include the following:

  • Angular CLI: 10.1 or later, < 11.
  • node.js: 12.16.1 or later, < 13.0. The most recent 12.x version is recommended.
  • yarn: v1.15 or later

If you are working with Spartacus 2.x, your Angular development environment should include the following:

  • Angular CLI: 9.1 or later, < 10.
  • node.js: 10.14.1 or later, < 13.0. The most recent 12.x version is recommended.
  • yarn: v1.15 or later

If you are working with Spartacus 1.x, your Angular development environment should include the following:

  • Angular CLI: v8.0.0 or later, < v9.0.0
  • node.js: v10 or later, < v12
  • yarn: v1.15 or later

For the back end, SAP Commerce Cloud version 1905 or higher is required, and SAP Commerce Cloud version 2005 or newer is recommended.

Note: Some Spartacus features require API endpoints that are only available in newer versions of SAP Commerce Cloud. For more information, see Compatibility Matrix on the SAP Help Portal.

Download and Installation

To get up and running with Spartacus, the recommended approach is to build your storefront application from ready-made libraries. You can also clone and build from source, but upgrading is not as simple.

Spartacus currently can only be used with a SAP Commerce Cloud instance through Commerce APIs.

To quickly add Spartacus libraries to an Angular application, you can use Spartacus schematics: ng add @spartacus/schematics. This will setup and install Spartacus libraries to your Angular project. Please check the official Spartacus schematics documentation for all the prerequisites and instruction on how to use Spartacus schematics.

For complete setup instructions, see Setting Up the Composable Storefront on the SAP Help Portal.

Customizing and Extending Spartacus

To maintain our promise of upgradability, the design pattern for Spartacus is for non-core features to be built as feature libraries that add to or change the provided functionality.

When using Spartacus, you build an app that pulls in the Spartacus libraries, which contain the core resources needed to work with SAP Commerce. You then build new features that contain any custom functionality and pages.

Content for Spartacus pages is fetched from the SAP Commerce Cloud CMS (Content Management System), such as logos, links, banners and static pages. We recommend that new content-driven features follow the same pattern to enable Content Managers to modify page content through the CMS tools.

The documentation for customizing and extending Spartacus is still under development and is being released as it becomes available.

Spartacus application documentation

Version 5.x and newer

See Composable Storefront API.

Version 4.x and older

The latest generated documentation for Spartacus application libraries (modules, classes, interfaces, and so on) is hosted here: https://sap.github.io/spartacus/

The application documentation is versioned and it is included on the Assets section of every release of each and every Spartacus library. You can download the documentation for a particular version by accessing the Assets section of any Spartacus library from that particular release, and then clicking on docs.tar.gz or docs.zip. To find the Assets folder for a particular library, access the Released Libraries for Spartacus, click on the link for the library you are interested in, and scroll to the bottom of the page.

For example, to download the application documentation for the 3.4.0 release, you could access the Assets folder of the @spartacus/[email protected] library here.

Note: The 1.x and 2.x releases of the Spartacus libraries work only with SAP Commerce versions 1905 and 2005. Certain features, such as cancellations and returns, are only available with SAP Commerce 2005, because the necessary OCC API support is only available in SAP Commerce 2005.

Limitations

When 1.0.0 is released, it is recommended to use SAP Commerce 1905. Spartacus works with Release 1808 and 1811 of SAP Commerce Cloud, with some limitations.

Spartacus is also being updated so that it works well with upcoming releases of SAP Commerce Cloud. This means that certain features of Spartacus may only work with unreleased future editions of SAP Commerce Cloud. This will be noted as we release new versions of Spartacus.

Known Issues

Known issues are documented in the GitHub issue tracking system.

How to Obtain Support

Spartacus is provided "as-is" with no official lines of support.

To get help from the Spartacus community:

Contributing

Team Spartacus welcomes feedback, ideas, requests, and especially code contributions.

  • Read the Contributing document and learn how to:
    • Help others
    • Report an issue
    • Contribute code to Spartacus

To Do

Many improvements are coming! All tasks will be posted to our GitHub issue tracking system. As mentioned, some of the improvements will mean breaking changes. While we strive to avoid doing so, we cannot guarantee this will not happen before the first release.

License

Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.

spartacus's People

Contributors

andrey-vlasov avatar benjaminemiliani avatar bgambocjaviniar avatar christophhi avatar dependabot[bot] avatar developpeurweb avatar dunqan avatar gladius-mtl avatar hackergil avatar kacperknapik avatar kimhw0630 avatar kpawelczak avatar larisa-staroverova avatar marlass avatar matejk00 avatar morganm58 avatar pawelfras avatar pio-bar avatar plabadie avatar platonn avatar pucek9 avatar radheps avatar romerodiver avatar szczepaniak-michal avatar tobi-or-not-tobi avatar vkoulaxazov avatar weizhengsap avatar wishfulthinkerme avatar zeyber avatar znikola avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spartacus's Issues

Cart page E2E tests / SPA-1028

For other E2E tests, we decided to focus on where backend adds value or can influence or cause breakage.

The assumption is that these kinds of tests are in addition to what Stan already is working on, so check with him. E.g. you can register successfully, and the user is logged in.


Make sure not to redo what was already done with the big happy path that stan did, but here are some E2E cart ideas.

  • Changing quantities updates all cart calculations to a predicted total, with expected effect on promotions as well.
    ** Example: ootb promotion is $20 off if over $200. Increasing product quantity before tax over $200 means the promotion is applied; decreasing product quantity below $200 means the promotion is removed (but appears as potential promotion).
  • Clicking remove removes the item from the cart, and same rules for quantity changes apply for calculations and promotions.
  • When all items are removed from cart, the page states there are no items, and you can't go to checkout.

Is the following implemented? If not create a spa ticket for future.

  • If item A is added to the cart, and at the time there was stock, but then you load the cart later and the item becomes out of stock, we display a message stating that the item was removed from the cart due to out of stock.

 

Update Spartacus setup instructions for 1811

When we moved Spartacus to open source, we concentrated on 1808.

The instructions are similar but not the same for 1811, so would be good to make a copy and label them 1808 and 1811 respectively.

Some things I know so far:

  • We're still telling people to download the spaccelerator impex.
  • Fixes were done in 1811 that solve the issues of checkout, so those parts should be removed.
  • Would be good to retest the instructions on 1811 and remove anything else that might not be needed, that was special for 1808. Good to involve interns again.

Product Details E2E tests / SPA-1026

  • Test adding different quantities. (1,2,3) and assess that there is a correct number difference on the minicart.

  • Test the different operations the user can do from the add to cart modal
    -- change qty
    -- close
    -- view cart
    -- procede to checkout

  • Asses that the following are as expected:
    -- title.
    -- ID
    -- Price
    -- Short desc
    -- stock level
    -- pictures
    -- Tabs have the expected content:
    --- Product details
    --- Specs
    --- Shipping
    --- Reviews
    ---- Assess that we can submit a review without an error (and ideally asses that the review displays. May depend on the default backend settings, reviews need to be approved in backoffice before thay are displayed )

Allow for partial use of the storefront

While the complete storefront can be added in one go by using the cx-storefront component, customer sometimes use the commerce storefront partially. Some customer would only use the checkout flow, and have other areas of the storefront being rendered in a separate system.

We need to validate and most probably rework the organisation of our storefront:

  • validate whether partial components can be used separately
  • expose modules in a clean way, so that library consumers know what should be pulled in
  • optimise build (code splitting, tree-shaking) so that only required code will be shipped in the app bundles.

Also #1153

Configure JS application with runtime backend baseUrl

A number of areas in the storefront is driven by configuration. The commerce backend API (baseUrl) is good example. Angular-cli provides a mechanism for different configurations per environment, but at the end of the day, the configured baseUrl is baked into the JS code. This means that the application cannot be deployed to various environments (dev, qa, prod); a new build is required for each and every environment. The same is true for the pipeline; the pipeline's backend must be aligned with the baked in configuration.

When we deploy the JS app on a server, ideally, the server should provide a configuration to the JS app when it's served. Dev-ops can than reconfigure the backend baseUrl, and with the next request, the JS app will interact with the newly given baseUrl.

There are different possible solutions, none of them are standard (not in angular(-cli) nor in JS world).

  • Provide a local config file in the JS app that can be read before the app start to bootstrap
  • Provide a http header in the index.html
  • Provide a script tag in the index.html
  • Provide a meta-tag in the index.html

There a number of things we try to achieve/ avoid:

  • we do not want to do a separate network request (which is the case in 1 and 2)
  • we want a server agnostic solution
  • we want an easy to use solution (2 is complicated for non-webserver devs)
  • we want a layered approach (means, we could do multiple solutions, with fallbacks)

Based on this, we envision:

The storefront looks for meta-tag with a specific name, indicating the commerce backend base URL

<meta name="occ-backend-base-url" content="https://localhost:9002" >

If the meta tag is not available (can be empty though), the config will fallback to configuration (what we have today). Customers can decide to configure the baseUrl or use a proxy to reroute the request.

This architecture should be reused for other configurations, such as other backends.

Create sample data (mock server)

We've started a mock server implementation, using json-server and faker.js. The goal of this mock server is to be up and running for devs so that they can start right away without being dependent on a commerce backend. (no commerce backend required). Other advantages are around mocking unit tests, e2e testing, and implementing new features for those areas where there's not yet a backend ready.

Currently the mock data can be generated for a commerce backend. The sample data is outdated, and this is the main thing we like to fix in this epic:

  • complete mock data
  • generate sample up-to-date sample data
  • consider using the mock server for e2e

In addition, we need to publish the mock/sample data in an npm package, so that it can be versioned and pulled for projects.

We might want to do this with the following approach:

  1. update existing or create a new sample data set (that's in the backend)
  2. generate the mock data from the sample data set

This approach gives a number of advantages:

  • we can regenerate with each and every release
  • our e2e tests will validate our storefront against the sample data we deliver
  • customer can regenerate the sample data for their own projects, e2e tests, etc.
  • existing commerce applications can benefit from the data sets
  • we can run parts of the app with mock data and others with a real backend

Cart: Potential promotions - whole Cart

In SPA-850, we added fired promotions to cart. For some reason, potential promotions aren't appearing. Creating this ticket and assigning to Bill to talk with promotions team and figure out where that data is.

Address Management page

This ticket is for implementing the customer's Payment Management page.
We need to add cms in the backend but you can use page label for order history in the meantime.

Tasks

  • ux design
  • sandbox (SPA-400 and 421)
  • implement
  • unit tests
  • e2e tests
  • proper cms label

General behavior

Go to the page and there are already addresses

Display cards of existing addresses, like checkout
https://98qkkl.axshare.com/#g=1&p=addresses_added

Go to the page and there are NO addresses

Display empty form by default
https://98qkkl.axshare.com/#g=1&p=spa-179-addresses_empty

Deleting Addresses

Clicking Delete displays "are you sure" inside the box
https://98qkkl.axshare.com/#g=1&p=addresses_delete

Setting Default Address

Clicking "Set as default" sets the address as default, and it moves to first spot.
Confirmation message appears at top.
https://98qkkl.axshare.com/#g=1&p=addresses_setasdefault

Click Add or Edit

Add

Clicking Add shows the form with fields blanked with intro text "Add a new shipping address."
Like: https://98qkkl.axshare.com/#g=1&p=spa-179-addresses_empty
Remember the country/state thing in checkout, same thing.
For default country, use same country as the user's default address (if there is one).
Otherwise use same behavior as checkout.

Edit

Clicking Edit shows the form with fields filled in, with intro text "Edit an existing shipping address."
Like: https://98qkkl.axshare.com/#g=1&p=spa-179-addresses_empty
but with info.
Ignore the wire https://98qkkl.axshare.com/#g=1&p=addresses_addform, it's a bit weird.

State/Province/Regions

Don't forget that if there are no state/regions for a country, hide the state/region menu.
The backend will give an error if you supply an invalid state/region code, but is ok if there is none at all.

Set as Default when adding and editing

  • If there are no addresses yet, don't display check box "Set as default address"
  • If there exists one other address, display check box "Set as default address"
    If checked, make this address the default.

Forms and Verification

Copy what we have in checkout.

Address Verification

Trigger address verification when user clicks Save.

Canceling

Clicking cancel drops the changes and goes back to the list.

Out of Scope

  • The UX has a menu at left, but we left that out so far

Clarify when contributor can agree to CLA agreement, in contributions doc

The contributions document mentions the CLA.
"Contributor License Agreement" section

What's not clear is that you don't need to 'sign' the CLA until you make your first PR.
The PR status page will list all the things that have to happen to accept the PR:

  • CI is passing
  • A maintainer reviewed the PR
  • CLA is signed

If CLA is not signed, there is a link to do so. Only then does the spartacus repo show up in that menu in cla-assistant.io.

[doc input] Add type safety to other layers + create tickets

We need to introduce type safety on a lot of layers, but at least on the facade layer (#6). We've already generated types from out OCC backend (using swagger.json and a standard generator), and ideally we use those generated types.

Type safety provides static code validation and helps customers to develop faster.

Spike refactor routes and configurability

The route configuration requires several enhancements:

  • configurable routes – the routes are hardcoded, which means it cannot be customised
  • localised routes – different languages or brands requires localised routes for the same route
  • nested routes – only first-level routes are used with a single route outlet, we should consider nested outlets

Investigate (s)CSS refactor for flexible styling

We like to fully adapt CSS custom properties in order to:

  • runtime configurability (no need to rebuild the system)
  • easy customisation
  • avoid strict view encapsulation for theming and customisation (shadow DOM, CSS vars peers through it)

We've experimented with this approach in https://github.com/tobi-or-not-tobi/lipstick-css and the recent decision to drop Internet Explorer 11 has strengthen our decision here (no need for fallbacks).

This is an important input in our rework on the UI framework, see #10.

Big contribution guidelines review

Bill created CONTRIBUTING.md for early October; Wei did a preliminary review (see SPA-1367) and I made updates.

We need all developers to study and provide feedback to ensure the process reflect our working model and improves efficiency.

  • Wei
  • Gil
  • Nik
  • Patrick
  • Louis
  • Kate

Create custom component schematic

We can provide an angular schematic to simplify the creation of custom components, routes, page templates, etc. This will help to:

  • customise very fast
  • customise according to our best practice
  • avoid reading documentation

Angular schematics are the technique that can be used for this.

Language E2E test / SPA-944

For other E2E tests, we decided to focus on where backend adds value or can influence or cause breakage.

The assumption is that these kinds of tests are in addition to what Stan already is working on, so check with him. E.g. you can register successfully, and the user is logged in.


For E2E purposes, some suggestions related to how we get data from the backend:

  • Check that the menu is there and populated (even if there is only 1 language right now it's still there I think)
  • Changing the language refreshes the whole site
    ** ... but stay on same page/view/screen.
    *** In fact if you are in the middle of registering and change the language, your entire form should remain the same.
    ** Check that the text has changed to target language.

Product details page is a good one to make assertions from, as well as registration page for forms.

  • Another test: do a browser refresh after switching the currency/language, to make sure the change sticks beyond the explicit change request from the user. (and doesn't fall immediately back to the default)

The backend sampledata provides English, German, Chinese and Japanese.

Note that language and currency e2e tests are similar in scope - see SPA-945.

[for 2.0 upgrading] Update custom applications

While the architecture is completely driven to allow for upgradability, there will be breaking changes from one version to another that wil make upgrades less seamless as we'd like. Also, dependency management can cause a lot of time for app developers for each and every (larger) release that we bring. Therefor we like to use angular schematics to allow for a seamless upgrade of dependencies and other breaking changes we might do.

Implement Added to Cart Modal Negative Unit Tests / SPA-588

 
Task: Add any negative tests to Added to Cart Modal. Either as functional, integration, unit test.

For example:

  • Attempt to remove twice from modal.
  • Attempt to click on "Add to Cart" while modal is displayed. (One click only)
  • etc

Use your imagination :)

Please note pull request [https://stash.hybris.com/projects/C3PO/repos/spaccelerator/pull-requests/122] doesn't include any sort of negative tests.
See definition of done

Change y- prefixes to cx- in code

  • Change y- prefixes to cx- in component selectors in .ts and in .html.
  • Update tslint rule to remove y-.
  • Run automated tests after.

Separate ticket for styling: #43.

Previous internal ticket: SPA-1218
Main selector was changed in: SPA-1219

Spike lazy loading

For runtime performance reasons we need to move into an architecture where different parts of the application are lazy loaded. Angular provides lazy loading out of the box, however the lazy loaded elements are driven by the router. The router is typically related to "pages". This works well in case the page content is determined during design time, so that the code can be split up at build time. But with CMS driven pages, where the page content is composed at runtime, this technique doesn't fly. A smarter approach is required to allow for a good mix of CMS driven pages and lazy-loaded techniques.
We basically need to lazy load components. The granularity can be decided, but CMS components should be lazy loaded (although a few of them could be bundled together) as they can be added to any CMS page at any time.

Some things to keep in mind:

  • lazy loading and SSR might conflict as the initial served page already has some components. These components shouldn't be reloaded
  • Angular elements could be leveraged, but the current footprint for bootstrapping is probably to big (until we get ngivy)
  • web components could be the answer, but we must carefully evaluate browser support and the size of polyfills to enable it

Refactor Page templates

Page templates control the overal layout of a page and can be selected by business users in the CMS. Our storefront UI must have a clean list of page template components, which only represent a CMS page templates from the backend. The current implementation has a number of issues:

  • Multiple page templates have been introduced lately for no good reason, we need to clean this up
  • Page templates and page components are redundant. We can drop the page components and route directly to the page template component. This is related to the work in #3.
  • Page templates should only represent the "page", any sub sections (i.e. myaccount/addresses) should reuse the page template (and could introduce nested router outlets, see again #3.

Site labels / translation

The storefronts is driven by different content streams. Most of the content is driven by either the CMS or by the product content. There's however a portion of content that is provided by so-called site labels.

Site labels are in the current storefront solution (spring mvc based) based on java resource bundles, which gives some issues:

  • they cannot be controlled by business users and require a full development cycle
  • they aren't exposed through a webservice
  • they do not have any structure (it's a flat list, although they're separated over multiple files)

There's a lot of room for improvement. We like to setup a solution that provides:

  • runtime language switching
  • lazy load languages
  • avoid hardcoded text

Angular doesn't provide these features yet, but have hired the author of translate to build this is as a standard feature in Angular. This takes longer then expected and it's recommended to start embracing ng-translate so that we can relatively smoothly transition to the standard solution (probably beyond ng7 and in parallel with ngyvi).

console errors after refresh on checkout address form page / SPA-1285

(Using backend dev-com2 and just-registered user without any addresses added before):

When a user goes to checkout (address form) and refreshes, then after reload there are many errors in console of the same type:
{code:java}
ERROR TypeError: Cannot read property 'childs' of undefined (NavigationComponent.html:2){code}

Reorganise package structure [in progress already?]

The code base has grown lately and a bit of clean structure is missing. We like to improve this with 2 changes:

  1. split up storefront lib in 2 libraries
  2. reorganize UI components

Split up libraries
Currently the storefront is implemented in two main libraries: storefront and styles. In order to scale better and separate out the framework bits and UI components, we need to separate those out over 2 libraries. Other storefront dev teams (i.e. telco, fsa) can then start building their own UI component lib with a dependency on the core lib only.

The tasks foreseen for this epic are:

  • move out UI components to new library
  • rename storefront library (core seems to be the right name)

Reorganize UI components
TBD

Spike multi-site

While our commerce backend is really strong with multi-site capabilities, this has not yet land fully in the Spartacus storefront. We already support multi-site with a configuration property, but the true multi-site features require:

  • a lookup on the storefront domain in the backend. This is done in commerce cloud by default for accelerators, but must be added here. It requires a new endpoint that takes the current location (url).
  • an endpoint that provides all (available) stores / sites, so that we can build a site landing page (i.e. "select your country site")
  • allows for multiple catalogs for sites that are driven in a multi-country fashion

Regression test all new facades

This ticket is to regression test all facades.
Documentation is #416.

Original master description:

While we're using ngrx store inside, we like customers to not necessarily be bother with the complexity of ngrx. Moreover, we might want to move (partially) to other state management solutions in the future. We've already started to build a facade layer on top of ngrx store, and must finalise this for all ngrx services.

  • add facades as services in a facade folder
  • all methods should be public or protected (assess as we go)
  • any components/services outside store should use facades instead of use store directly
  • update all tests (outside store) to use facades, remove StoreModule from tests if possible

Spike was done as part of #140. Tobias and Wei working on it and probably done eod Nov 1.
It can be used as an example for the facade (but not the move).

Form labels should focus the form control / SPA-1265

In angular we don't use the class element IDs and therefor we can't do:

<label for="FORM_CONTROL_ID">label text</label>
<input id="FORM_CONTROL_ID">

Instead, we should ideally do:

<label>
  label text
  <input>
</label>

This is both a fix as well as a simplification. 

This should be fixed in the various forms we have (login, address forms, checkout, etc.)

 

Registration E2E tests / SPA-1021

For other E2E tests, we decided to focus on where backend adds value or can influence or cause breakage.

The assumption is that these kinds of tests are in addition to what Stan already is working on, so check with him. E.g. you can register successfully, and the user is logged in.
h2. 1. Error situation + check what happens when user tries to register with existing username

  • Register a user with an email that is already registered
  • Should get an error message (global messaging for registration)
  • Angular page stays on same page; user can keep trying to register
  • Most information remains on page
  • And the valid user should not be blocked from logging in
    ** Unless there is some kind of protection if you try 5 times or more
  • Because if this breaks: something changed in the backend
  • Future: Captcha?

h2. T&C link

  • Clicking T&C gives you the page and OK response

h2. Cart merging tests that aren’t in big e2e test

  • Anonymous user has items in cart, logs in, new cart has all items
  • Logged in user adds items to cart, logs out, adds items to cart, logs in, carts merged

The following would be Angular unit tests as they don't touch the backend.

  • Not allowing submit if salutation not chosen, fields don't meet requirements, etc.
  • Email or password validation
  • Not allowing submit if T&C not checked

Currency E2E test / SPA-945

For other E2E tests, we decided to focus on where backend adds value or can influence or cause breakage.

The assumption is that these kinds of tests are in addition to what Stan already is working on, so check with him. E.g. you can register successfully, and the user is logged in.


For E2E purposes, some suggestions:

  • Check that the menu is there and populated (even if there is only 1 currency right now it's still there I think)

  • Changing the currency refreshes pricing only

** ...but stay on same page/view/screen.
** In fact if you are in the middle of checking out, adding an address in a form, and change the currency, your entire form should remain the same.

Product details page is a good one to make assertions from. Check that prices updated to expect new amounts. But also, a checkout form like shipping address to ensure the user's data isn't erased.

Also: do a browser refresh after switching the currency/language, to make sure the change sticks beyond the explicit change request from the user. (and doesn;t fall immediately back to the default).

The backend sample data has US dollars and Japanese Yen, 

Note that language and currency e2e tests are similar in scope - see SPA-944.

Investigate making our UI framework-agnostic

Currently our UI framework of choice has polluted all UI components. This is bad for customers who do not or cannot use bootstrap. We want our UI layer to be independent on a specific UI framework. Moreover, we should avoid a mandatory peer dependencies like bootstrap and ng-bootstrap.

This requires a number of poc's (such as https://github.com/tobi-or-not-tobi/agnos) and rework.
The goal of this work is:

  • a very clean and standard UI layer (html5, avoid UI framework specific markup)
  • a mapping, extension, pre-processing technique that can be applied to our standard UI

With Agnos I've learned that SASS is a great choice for UI framework agnostic approach:

  • all large frameworks use sass
  • sass has an @extend mechanism
  • sass has a placeholder selector (which no one seems to use though :( )

But, we're open to other approaches.

An alternative approach is obviously a design system. ng-bootstrap is an example of this, but there are big hesitations with this:

  • it's a lot of work (been there, and have seen how much time good design systems take)
  • customising is a lot of work still, although its more cleaner

Account Profile Management page

This ticket is for implementing the customer's Account Profile page.
We need to add cms in the backend (SPA-1416) but you can use page label for order history in the meantime.

Wires are: https://98qkkl.axshare.com/#g=1&p=spa-143-_profile
but waiting to hear if they are final.

Tasks (can be split into separate issues, use epic profilepageimpl):

  • ux design
  • sandbox
  • implement
  • unit tests
  • e2e tests
  • proper cms label

The new Account page combines items that were separate pages in Accelerator: changing name, email, password, or consent preferences, as well as closing your account.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.