Code Monkey home page Code Monkey logo

sunrise-spa's Introduction

CommerceTools demo project - Vue SunriseSPA

Links

Demo Sunrise website

Sunrise frontend

Sunrise CommerceTools demo data

Start guide

You need to install the dependencies with yarn install --frozen-lockfile, then you can start the project with yarn start.

If you want to use the default merchant center project there is no need to add a .env file, if you want to connect to your own merchant center project you need to set this up

yarn start

sunrise-spa's People

Contributors

dependabot[bot] avatar emmenko avatar felipe-lemos avatar harm-meijer avatar lauraluiz avatar plaskevich avatar zeina-idris avatar zombieleet 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

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

sunrise-spa's Issues

Add "add to cart" button in Sunrise SPA (TEST EPIC)

Add "add to cart" button in Sunrise SPA

What

Users want a way of defining and inserting a product into the cart

Why

So that they can buy the product

Acceptance criteria

  • Users can use a button on the PDP to add the specified product in the cart
  • The specified product can be used in the cart and checkout process

Use image dimensions graphql field

Fix how we implement images url according to image dimensions field in graphql fields, instead of getting random sized images.

Sunrise data now gets the images url with random sizes (e.g
..../products/072750_1_large/.jpg or
..../products/072750_1_medium/.jpg ) with no specification. Despite the fact that in the source images we have all sizes to each image that are not being used, so we should be able to get the images according to those sizes.

Set favicon

Currently the one from Vue appears instead

Home with CMS integration

What?
Enable the easy use of CMS systems to display banners on Sunrise SPA

Why?
To demonstrate that we integrate easily with CMS providers and to make prototyping easier

Ideas:

[ ] Consider Contentful as CMS
[ ] If no CMS setup are provided it will fallback to current behaviour(static home)

Handle concurrency issues

At the moment the cart (and customer) is cached and synchronized when you use it in the same browser, but when the cart (or customer) is modified from the outside, a 409 error will raise and won't recover.

We need to make sure it recovers.

Setup sale category

What?
Virtual category to aggregate sales products

Why?
So that sale products get inserted in the right category with a predicate instead of adding them manually

Eg. When Sale category is selected in the navigation all products with discounts will appear in the category even though they are not assigned to the category.

Move logic of logout into a single place

At the moment, every logout button needs to call the logoutClient and handle redirection on its own. In order to avoid repetition, we need to bring it into a single place.
Maybe handling it in the router, just before the authGuard?

Display line item discounts

When applying a line item discount (e.g. coming from a cart discount) the total price for the line item is correct, but no visual indicator that a discount was applied appears.

Export common GraphQL fragments to avoid duplication

Currently there are many vuex actions that modify a customer, and for every modification we need to request some fields in particular to be returned. These fields are duplicated for each action, and if they diverge it may make the app fail.

Extracting the fragments to a global access and just calling them at each method would be a more elegant solution.

Don't allow negative numbers in cart quantity

In cart detail page, using - and + buttons yields zero or negative numbers in the input field. Of course the input field doesn't accept these values, so nothing is broken. But displaying quantity below zero looks weird.

We should not allow quantity to be displayed as less than 1.

Fix warnings during unit test

Fix some warnings that appear during unit tests:

(node:3915) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3915) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

(node:3915) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'then' of undefined
(node:3915) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

Use currency coming from mixin

Some components are using this.$store.state.currency and others this.currency. All of them should be using this.currency (coming from priceMixin) to avoid exposing the implementation details, and thus allow to change the way currency is stored/obtained in the future.

Remove refresh token on 401

There might be situations in which the invalid credentials error happens because of an invalid refresh token and then Sunrise breaks.

Situations are pretty common: you are logged in with a customer from project A, then you switch to using project B and the refresh token from project A is sent against auth of project B, returning a 401.

Start all pages with Page prefix

Consider starting the pages with Page, for easy spotting them.
At the moment they end with Page, but that might be more difficult to identify.
Cons are the naming might be difficult to understand.

Vuex should fetch categories

At least additionally to the category menu, as otherwise category information would be empty if the user never visits a page with the category menu.

Enable cart discount code

Form in cart detail page where to introduce the discount code and show the current applied discount codes.

Fix thumbnail height on big screens

The product thumbnail can get very long, as it seems like the height is proportional to the size of the screen. It should stay always the same ratio.

screen shot 2018-09-25 at 17 40 47

Handle concurrent modification

When opening multiple tabs and adding items to the cart on both pages, it happens that the cart version may be not up-to-date and it just raises a general error.

We need to either handle the error and re-fetch the cart, or ask the customer to reload the page (worst case scenario).

Handle empty results

We need some nice approach to show the case in which there are no results.

  • product overview page
  • my orders
  • my cart

Cannot Sign _in_ because password input requires five characters

The new Sign-in does not submit the sign-in when the password does not have at least five characters. Eg. a demo account with password "test" does not sign in.

It's not the role of the sign-in form to validate password strength requirements, that is the role of the sign-up form.

Update documentation with MC

Current documentation explains how to create an API Client in the Admin Center. But this functionality no longer exists in the Admin Center, but in the MC. We should update the explanations.

Pagination

Product Pagination - decide if we use

  • Load more
    or
  • Pagination: 1,2,3
    or
  • both

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.