SAP / spartacus

Spartacus is a lean, Angular-based JavaScript storefront for SAP Commerce Cloud that communicates exclusively through the Commerce REST API.
Apache License 2.0
738 stars 383 forks source link

Refactor product carousel component to use CmsComponentData #401

Closed dunqan closed 5 years ago

dunqan commented 5 years ago

Note: This ticket is also master description ticket for all tickets in this group if tasks.

  1. Inject CmsComponentData instead of extending AbstractCmsComponent

  2. Try to leverage observables if possible + async pipe in templates: a) component data is exposed as an observable (data$ property od CmsComponentData) b) using async pipe with ChangeDetectionStrategy.OnPush works without any additional calls to ChangeDetectorRef c) if you decide that you need to subscribe to observable, make sure to unsubscribe in ngOnDestroy

More info: see https://github.com/SAP/cloud-commerce-spartacus-storefront/blob/develop/projects/storefrontlib/src/lib/occ/docs/cms-component-implementation.md

Some refactoring might be needed.

Acceptance criteria:

Can follow up with Stan, but team can do own peer review.

Testing: If it works as before, we're done.

Pucek9 commented 5 years ago

Acceptance criteria referenced to get rid of subscriptions are passed in #884 QA done