@daffodil/product 0.38.9 → 0.39.0
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.
- package/bundles/daffodil-product-driver-in-memory.umd.js +77 -160
- package/bundles/daffodil-product-driver-in-memory.umd.js.map +1 -1
- package/bundles/daffodil-product-driver-in-memory.umd.min.js +1 -1
- package/bundles/daffodil-product-driver-in-memory.umd.min.js.map +1 -1
- package/bundles/daffodil-product-driver-magento-testing.umd.js +12 -140
- package/bundles/daffodil-product-driver-magento-testing.umd.js.map +1 -1
- package/bundles/daffodil-product-driver-magento-testing.umd.min.js +1 -1
- package/bundles/daffodil-product-driver-magento-testing.umd.min.js.map +1 -1
- package/bundles/daffodil-product-driver-magento.umd.js +87 -676
- package/bundles/daffodil-product-driver-magento.umd.js.map +1 -1
- package/bundles/daffodil-product-driver-magento.umd.min.js +2 -2
- package/bundles/daffodil-product-driver-magento.umd.min.js.map +1 -1
- package/bundles/daffodil-product-driver-shopify.umd.js +14 -160
- package/bundles/daffodil-product-driver-shopify.umd.js.map +1 -1
- package/bundles/daffodil-product-driver-shopify.umd.min.js +1 -1
- package/bundles/daffodil-product-driver-shopify.umd.min.js.map +1 -1
- package/bundles/daffodil-product-driver-testing.umd.js +4 -62
- package/bundles/daffodil-product-driver-testing.umd.js.map +1 -1
- package/bundles/daffodil-product-driver-testing.umd.min.js +1 -1
- package/bundles/daffodil-product-driver-testing.umd.min.js.map +1 -1
- package/bundles/daffodil-product-driver.umd.js +12 -64
- package/bundles/daffodil-product-driver.umd.js.map +1 -1
- package/bundles/daffodil-product-routing.umd.js +4 -112
- package/bundles/daffodil-product-routing.umd.js.map +1 -1
- package/bundles/daffodil-product-routing.umd.min.js +1 -1
- package/bundles/daffodil-product-routing.umd.min.js.map +1 -1
- package/bundles/daffodil-product-state-testing.umd.js +15 -240
- package/bundles/daffodil-product-state-testing.umd.js.map +1 -1
- package/bundles/daffodil-product-state-testing.umd.min.js +1 -1
- package/bundles/daffodil-product-state-testing.umd.min.js.map +1 -1
- package/bundles/daffodil-product-state.umd.js +347 -2359
- package/bundles/daffodil-product-state.umd.js.map +1 -1
- package/bundles/daffodil-product-state.umd.min.js +1 -1
- package/bundles/daffodil-product-state.umd.min.js.map +1 -1
- package/bundles/daffodil-product-testing.umd.js +20 -230
- package/bundles/daffodil-product-testing.umd.js.map +1 -1
- package/bundles/daffodil-product-testing.umd.min.js +1 -1
- package/bundles/daffodil-product-testing.umd.min.js.map +1 -1
- package/bundles/daffodil-product.umd.js +21 -209
- package/bundles/daffodil-product.umd.js.map +1 -1
- package/bundles/daffodil-product.umd.min.js +1 -1
- package/bundles/daffodil-product.umd.min.js.map +1 -1
- package/driver/in-memory/backend/product.service.d.ts +3 -2
- package/driver/in-memory/daffodil-product-driver-in-memory.metadata.json +1 -1
- package/driver/in-memory/package.json +1 -1
- package/driver/magento/package.json +1 -1
- package/driver/magento/testing/package.json +1 -1
- package/driver/package.json +1 -1
- package/driver/shopify/package.json +1 -1
- package/driver/testing/package.json +1 -1
- package/esm2015/daffodil-product.js +2 -7
- package/esm2015/driver/daffodil-product-driver.js +2 -7
- package/esm2015/driver/in-memory/backend/product.service.js +62 -83
- package/esm2015/driver/in-memory/daffodil-product-driver-in-memory.js +2 -7
- package/esm2015/driver/in-memory/driver/product-driver.module.js +1 -9
- package/esm2015/driver/in-memory/driver/product.service.js +11 -53
- package/esm2015/driver/in-memory/index.js +2 -7
- package/esm2015/driver/in-memory/public_api.js +1 -6
- package/esm2015/driver/index.js +2 -7
- package/esm2015/driver/interfaces/product-service.interface.js +1 -39
- package/esm2015/driver/magento/config/default.js +2 -8
- package/esm2015/driver/magento/config/public_api.js +1 -6
- package/esm2015/driver/magento/daffodil-product-driver-magento.js +2 -7
- package/esm2015/driver/magento/index.js +2 -7
- package/esm2015/driver/magento/injection-tokens/fragments/product-preview.token.js +7 -22
- package/esm2015/driver/magento/injection-tokens/fragments/product.token.js +5 -20
- package/esm2015/driver/magento/injection-tokens/public_api.js +1 -6
- package/esm2015/driver/magento/injection-tokens/transforms/product-preview/preview-extra.token.js +6 -21
- package/esm2015/driver/magento/injection-tokens/transforms/product-preview/preview.token.js +4 -24
- package/esm2015/driver/magento/injection-tokens/transforms/product-response/response-extra.token.js +5 -20
- package/esm2015/driver/magento/injection-tokens/transforms/product-response/response.token.js +4 -25
- package/esm2015/driver/magento/interfaces/config.interface.js +3 -38
- package/esm2015/driver/magento/interfaces/product-preview-extra-transform.type.js +2 -6
- package/esm2015/driver/magento/interfaces/product-preview-transform.type.js +2 -6
- package/esm2015/driver/magento/interfaces/product-response-extra-transform.type.js +2 -6
- package/esm2015/driver/magento/interfaces/product-response-transform.type.js +2 -6
- package/esm2015/driver/magento/interfaces/public_api.js +6 -11
- package/esm2015/driver/magento/models/bundled-product.js +9 -65
- package/esm2015/driver/magento/models/configurable-product.js +2 -72
- package/esm2015/driver/magento/models/get-product-response.interface.js +2 -16
- package/esm2015/driver/magento/models/magento-product.js +7 -38
- package/esm2015/driver/magento/models/product-preview.interface.js +6 -40
- package/esm2015/driver/magento/models/public_api.js +4 -9
- package/esm2015/driver/magento/models/simple-product.js +2 -18
- package/esm2015/driver/magento/product-driver.module.js +3 -12
- package/esm2015/driver/magento/product.service.js +7 -78
- package/esm2015/driver/magento/public_api.js +7 -12
- package/esm2015/driver/magento/queries/fragments/bundled-product.js +2 -8
- package/esm2015/driver/magento/queries/fragments/configurable-product.js +1 -7
- package/esm2015/driver/magento/queries/fragments/product-preview.js +1 -7
- package/esm2015/driver/magento/queries/fragments/product.js +1 -7
- package/esm2015/driver/magento/queries/fragments/simple-product.js +1 -7
- package/esm2015/driver/magento/queries/get-all-products.js +3 -14
- package/esm2015/driver/magento/queries/get-product-by-url.js +3 -14
- package/esm2015/driver/magento/queries/get-product.js +3 -14
- package/esm2015/driver/magento/queries/public_api.js +4 -9
- package/esm2015/driver/magento/testing/daffodil-product-driver-magento-testing.js +2 -7
- package/esm2015/driver/magento/testing/factories/bundle/bundle.factory.js +4 -15
- package/esm2015/driver/magento/testing/factories/configurable/configurable.factory.js +3 -46
- package/esm2015/driver/magento/testing/factories/core/product-preview.factory.js +2 -29
- package/esm2015/driver/magento/testing/factories/core/product.factory.js +3 -46
- package/esm2015/driver/magento/testing/factories/public_api.js +6 -11
- package/esm2015/driver/magento/testing/factories/simple/simple.factory.js +3 -12
- package/esm2015/driver/magento/testing/index.js +2 -7
- package/esm2015/driver/magento/testing/public_api.js +2 -7
- package/esm2015/driver/magento/transforms/bundled-product-transformers.js +4 -25
- package/esm2015/driver/magento/transforms/configurable-product-transformers.js +4 -38
- package/esm2015/driver/magento/transforms/product-preview.js +5 -35
- package/esm2015/driver/magento/transforms/product-response.js +2 -23
- package/esm2015/driver/magento/transforms/product-transformers.js +5 -32
- package/esm2015/driver/magento/transforms/public_api.js +7 -12
- package/esm2015/driver/magento/transforms/simple-product-transformers.js +3 -31
- package/esm2015/driver/magento/transforms/truncate-url.js +2 -12
- package/esm2015/driver/models/public_api.js +2 -6
- package/esm2015/driver/models/response.interface.js +2 -28
- package/esm2015/driver/public_api.js +2 -7
- package/esm2015/driver/shopify/daffodil-product-driver-shopify.js +2 -7
- package/esm2015/driver/shopify/index.js +2 -7
- package/esm2015/driver/shopify/product-driver.module.js +2 -10
- package/esm2015/driver/shopify/product.service.js +12 -132
- package/esm2015/driver/shopify/public_api.js +1 -6
- package/esm2015/driver/testing/daffodil-product-driver-testing.js +2 -7
- package/esm2015/driver/testing/drivers/product-driver.module.js +2 -10
- package/esm2015/driver/testing/drivers/product.service.js +3 -39
- package/esm2015/driver/testing/index.js +2 -7
- package/esm2015/driver/testing/public_api.js +1 -6
- package/esm2015/helpers.js +7 -22
- package/esm2015/index.js +2 -7
- package/esm2015/injection-tokens/error-matcher.token.js +3 -12
- package/esm2015/injection-tokens/public_api.js +1 -6
- package/esm2015/models/composite-configuration-item.js +2 -25
- package/esm2015/models/composite-product-item.js +8 -62
- package/esm2015/models/composite-product.js +2 -25
- package/esm2015/models/configurable-product.js +2 -125
- package/esm2015/models/prices.js +2 -45
- package/esm2015/models/product-image.js +2 -18
- package/esm2015/models/product.js +8 -105
- package/esm2015/public_api.js +10 -15
- package/esm2015/routing/daffodil-product-routing.js +2 -7
- package/esm2015/routing/index.js +2 -7
- package/esm2015/routing/public_api.js +2 -7
- package/esm2015/routing/resolvers/product-page/product-page.resolver.js +2 -21
- package/esm2015/routing/resolvers/product-page-id/product-page-id.resolver.js +2 -33
- package/esm2015/routing/resolvers/product-page-url/product-page-url.resolver.js +2 -40
- package/esm2015/routing/resolvers/public_api.js +1 -6
- package/esm2015/state/actions/best-sellers.actions.js +9 -39
- package/esm2015/state/actions/composite-product.actions.js +9 -29
- package/esm2015/state/actions/configurable-product.actions.js +8 -56
- package/esm2015/state/actions/product-grid.actions.js +9 -39
- package/esm2015/state/actions/product-page.actions.js +10 -60
- package/esm2015/state/actions/product.actions.js +8 -39
- package/esm2015/state/actions/public_api.js +7 -12
- package/esm2015/state/daffodil-product-state.js +2 -7
- package/esm2015/state/effects/best-seller.effects.js +4 -52
- package/esm2015/state/effects/product-grid.effects.js +4 -52
- package/esm2015/state/effects/product-page.effects.js +6 -68
- package/esm2015/state/effects/product.effects.js +4 -52
- package/esm2015/state/effects/public_api.js +1 -6
- package/esm2015/state/facades/best-sellers/best-sellers.facade.js +4 -31
- package/esm2015/state/facades/composite-product/composite-product-facade.interface.js +2 -86
- package/esm2015/state/facades/composite-product/composite-product.facade.js +4 -61
- package/esm2015/state/facades/configurable-product/configurable-product-facade.interface.js +2 -108
- package/esm2015/state/facades/configurable-product/configurable-product.facade.js +4 -78
- package/esm2015/state/facades/product/product-facade.interface.js +2 -70
- package/esm2015/state/facades/product/product.facade.js +3 -58
- package/esm2015/state/facades/product-grid/product-grid-facade.interface.js +2 -23
- package/esm2015/state/facades/product-grid/product-grid.facade.js +3 -27
- package/esm2015/state/facades/product-page/facade.interface.js +2 -24
- package/esm2015/state/facades/product-page/facade.js +3 -32
- package/esm2015/state/facades/public_api.js +1 -6
- package/esm2015/state/index.js +2 -7
- package/esm2015/state/product-state.module.js +1 -6
- package/esm2015/state/public_api.js +6 -11
- package/esm2015/state/reducers/best-sellers/best-sellers-reducer-state.interface.js +2 -28
- package/esm2015/state/reducers/best-sellers/best-sellers.reducer.js +3 -24
- package/esm2015/state/reducers/composite-product-entities/composite-product-entities-reducer-adapter.js +5 -18
- package/esm2015/state/reducers/composite-product-entities/composite-product-entities.reducer.js +12 -46
- package/esm2015/state/reducers/composite-product-entities/composite-product-entity.js +2 -25
- package/esm2015/state/reducers/configurable-product-entities/configurable-product-entities-reducer-adapter.js +4 -17
- package/esm2015/state/reducers/configurable-product-entities/configurable-product-entities.reducer.js +11 -67
- package/esm2015/state/reducers/configurable-product-entities/configurable-product-entity.js +2 -40
- package/esm2015/state/reducers/injection-tokens/config.token.js +4 -13
- package/esm2015/state/reducers/injection-tokens/meta.token.js +5 -21
- package/esm2015/state/reducers/injection-tokens/public_api.js +1 -6
- package/esm2015/state/reducers/product/product-reducer-state.interface.js +2 -33
- package/esm2015/state/reducers/product/product.reducer.js +4 -11
- package/esm2015/state/reducers/product-entities/product-entities-reducer-adapter.js +4 -18
- package/esm2015/state/reducers/product-entities/product-entities.reducer.js +4 -11
- package/esm2015/state/reducers/product-grid/product-grid-reducer-state.interface.js +2 -29
- package/esm2015/state/reducers/product-grid/product-grid.reducer.js +4 -11
- package/esm2015/state/reducers/product-reducers-state.interface.js +1 -35
- package/esm2015/state/reducers/product-reducers.js +1 -7
- package/esm2015/state/reducers/product-store-feature-key.js +1 -7
- package/esm2015/state/reducers/public_api.js +3 -8
- package/esm2015/state/selectors/all-selectors.selectors.js +3 -19
- package/esm2015/state/selectors/best-sellers/best-sellers.selectors.js +12 -84
- package/esm2015/state/selectors/composite-product/composite-product.selectors.js +48 -254
- package/esm2015/state/selectors/composite-product-entities/composite-product-entities.selectors.js +16 -122
- package/esm2015/state/selectors/configurable-product/configurable-product.selectors.js +41 -387
- package/esm2015/state/selectors/configurable-product-entities/configurable-product-entities.selectors.js +12 -106
- package/esm2015/state/selectors/product/product.selectors.js +12 -80
- package/esm2015/state/selectors/product-entities/product-entities.selectors.js +16 -191
- package/esm2015/state/selectors/product-feature.selector.js +5 -29
- package/esm2015/state/selectors/product-grid/product-grid.selectors.js +10 -57
- package/esm2015/state/selectors/public_api.js +11 -16
- package/esm2015/state/testing/daffodil-product-state-testing.js +2 -7
- package/esm2015/state/testing/index.js +2 -7
- package/esm2015/state/testing/mock-best-sellers.facade.js +3 -18
- package/esm2015/state/testing/mock-composite-product-facade.js +4 -52
- package/esm2015/state/testing/mock-configurable-product-facade.js +4 -65
- package/esm2015/state/testing/mock-product-facade.js +3 -53
- package/esm2015/state/testing/mock-product-grid-facade.js +3 -19
- package/esm2015/state/testing/mock-product-page-facade.js +3 -19
- package/esm2015/state/testing/product-testing.module.js +1 -6
- package/esm2015/state/testing/public_api.js +1 -6
- package/esm2015/testing/daffodil-product-testing.js +2 -7
- package/esm2015/testing/factories/composite-product.factory.js +3 -14
- package/esm2015/testing/factories/configurable-product.factory.js +2 -45
- package/esm2015/testing/factories/default-product.factory.js +2 -53
- package/esm2015/testing/factories/extension.factory.js +3 -30
- package/esm2015/testing/factories/kind.factory.js +2 -23
- package/esm2015/testing/factories/product-image.factory.js +2 -16
- package/esm2015/testing/factories/public_api.js +7 -12
- package/esm2015/testing/helpers.js +2 -8
- package/esm2015/testing/index.js +2 -7
- package/esm2015/testing/injection-tokens/factories/extra.token.js +6 -22
- package/esm2015/testing/injection-tokens/factories/type.token.js +5 -21
- package/esm2015/testing/injection-tokens/public_api.js +1 -6
- package/esm2015/testing/public_api.js +4 -9
- package/esm2015/testing/testing.module.js +1 -6
- package/fesm2015/daffodil-product-driver-in-memory.js +73 -158
- package/fesm2015/daffodil-product-driver-in-memory.js.map +1 -1
- package/fesm2015/daffodil-product-driver-magento-testing.js +12 -165
- package/fesm2015/daffodil-product-driver-magento-testing.js.map +1 -1
- package/fesm2015/daffodil-product-driver-magento.js +81 -801
- package/fesm2015/daffodil-product-driver-magento.js.map +1 -1
- package/fesm2015/daffodil-product-driver-shopify.js +14 -156
- package/fesm2015/daffodil-product-driver-shopify.js.map +1 -1
- package/fesm2015/daffodil-product-driver-testing.js +5 -63
- package/fesm2015/daffodil-product-driver-testing.js.map +1 -1
- package/fesm2015/daffodil-product-driver.js +1 -59
- package/fesm2015/daffodil-product-driver.js.map +1 -1
- package/fesm2015/daffodil-product-routing.js +5 -113
- package/fesm2015/daffodil-product-routing.js.map +1 -1
- package/fesm2015/daffodil-product-state-testing.js +16 -241
- package/fesm2015/daffodil-product-state-testing.js.map +1 -1
- package/fesm2015/daffodil-product-state.js +294 -2412
- package/fesm2015/daffodil-product-state.js.map +1 -1
- package/fesm2015/daffodil-product-testing.js +20 -256
- package/fesm2015/daffodil-product-testing.js.map +1 -1
- package/fesm2015/daffodil-product.js +23 -454
- package/fesm2015/daffodil-product.js.map +1 -1
- package/package.json +3 -3
- package/routing/package.json +1 -1
- package/state/package.json +1 -1
- package/state/testing/package.json +1 -1
- package/testing/package.json +1 -1
|
@@ -1,33 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule } from '@angular/core';
|
|
2
2
|
import { of } from 'rxjs';
|
|
3
3
|
import { DaffProductExtensionFactory, DaffProductImageFactory, DaffProductTestingModule } from '@daffodil/product/testing';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { DaffProductDriver } from '@daffodil/product/driver';
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* @fileoverview added by tsickle
|
|
9
|
-
* Generated from: drivers/product.service.ts
|
|
10
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
11
|
-
*/
|
|
12
7
|
/**
|
|
13
8
|
* The product testing driver to mock the backend product service.
|
|
14
9
|
*
|
|
15
|
-
*
|
|
10
|
+
* @inheritdoc
|
|
16
11
|
* @param productFactory - A DaffProductFactory instance
|
|
17
12
|
* @param productImageFactory - A DaffProductImageFactory instance
|
|
18
13
|
*/
|
|
19
14
|
class DaffTestingProductService {
|
|
20
|
-
/**
|
|
21
|
-
* @param {?} productFactory
|
|
22
|
-
* @param {?} productImageFactory
|
|
23
|
-
*/
|
|
24
15
|
constructor(productFactory, productImageFactory) {
|
|
25
16
|
this.productFactory = productFactory;
|
|
26
17
|
this.productImageFactory = productImageFactory;
|
|
27
18
|
}
|
|
28
|
-
/**
|
|
29
|
-
* @return {?}
|
|
30
|
-
*/
|
|
31
19
|
getAll() {
|
|
32
20
|
return of([
|
|
33
21
|
this.productFactory.create({ images: this.productImageFactory.createMany(5) }),
|
|
@@ -37,9 +25,6 @@ class DaffTestingProductService {
|
|
|
37
25
|
this.productFactory.create({ images: this.productImageFactory.createMany(5) }),
|
|
38
26
|
]);
|
|
39
27
|
}
|
|
40
|
-
/**
|
|
41
|
-
* @return {?}
|
|
42
|
-
*/
|
|
43
28
|
getBestSellers() {
|
|
44
29
|
return of([
|
|
45
30
|
this.productFactory.create({ images: this.productImageFactory.createMany(5) }),
|
|
@@ -48,10 +33,6 @@ class DaffTestingProductService {
|
|
|
48
33
|
this.productFactory.create({ images: this.productImageFactory.createMany(5) }),
|
|
49
34
|
]);
|
|
50
35
|
}
|
|
51
|
-
/**
|
|
52
|
-
* @param {?} productId
|
|
53
|
-
* @return {?}
|
|
54
|
-
*/
|
|
55
36
|
get(productId) {
|
|
56
37
|
return of({
|
|
57
38
|
id: productId,
|
|
@@ -60,12 +41,7 @@ class DaffTestingProductService {
|
|
|
60
41
|
],
|
|
61
42
|
});
|
|
62
43
|
}
|
|
63
|
-
/**
|
|
64
|
-
* @param {?} url
|
|
65
|
-
* @return {?}
|
|
66
|
-
*/
|
|
67
44
|
getByUrl(url) {
|
|
68
|
-
/** @type {?} */
|
|
69
45
|
const product = this.productFactory.create({ images: this.productImageFactory.createMany(5), url });
|
|
70
46
|
return of({
|
|
71
47
|
id: product.id,
|
|
@@ -73,6 +49,7 @@ class DaffTestingProductService {
|
|
|
73
49
|
});
|
|
74
50
|
}
|
|
75
51
|
}
|
|
52
|
+
/** @nocollapse */ DaffTestingProductService.ɵprov = ɵɵdefineInjectable({ factory: function DaffTestingProductService_Factory() { return new DaffTestingProductService(ɵɵinject(DaffProductExtensionFactory), ɵɵinject(DaffProductImageFactory)); }, token: DaffTestingProductService, providedIn: "root" });
|
|
76
53
|
DaffTestingProductService.decorators = [
|
|
77
54
|
{ type: Injectable, args: [{
|
|
78
55
|
providedIn: 'root',
|
|
@@ -83,32 +60,11 @@ DaffTestingProductService.ctorParameters = () => [
|
|
|
83
60
|
{ type: DaffProductExtensionFactory },
|
|
84
61
|
{ type: DaffProductImageFactory }
|
|
85
62
|
];
|
|
86
|
-
/** @nocollapse */ DaffTestingProductService.ɵprov = ɵɵdefineInjectable({ factory: function DaffTestingProductService_Factory() { return new DaffTestingProductService(ɵɵinject(DaffProductExtensionFactory), ɵɵinject(DaffProductImageFactory)); }, token: DaffTestingProductService, providedIn: "root" });
|
|
87
|
-
if (false) {
|
|
88
|
-
/**
|
|
89
|
-
* @type {?}
|
|
90
|
-
* @private
|
|
91
|
-
*/
|
|
92
|
-
DaffTestingProductService.prototype.productFactory;
|
|
93
|
-
/**
|
|
94
|
-
* @type {?}
|
|
95
|
-
* @private
|
|
96
|
-
*/
|
|
97
|
-
DaffTestingProductService.prototype.productImageFactory;
|
|
98
|
-
}
|
|
99
63
|
|
|
100
64
|
/**
|
|
101
|
-
* @
|
|
102
|
-
* Generated from: drivers/product-driver.module.ts
|
|
103
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
104
|
-
*/
|
|
105
|
-
/**
|
|
106
|
-
* Module for providing the {\@link DaffProductTestingService} driver as the {\@link DaffProductDriver}.
|
|
65
|
+
* Module for providing the {@link DaffProductTestingService} driver as the {@link DaffProductDriver}.
|
|
107
66
|
*/
|
|
108
67
|
class DaffProductTestingDriverModule {
|
|
109
|
-
/**
|
|
110
|
-
* @return {?}
|
|
111
|
-
*/
|
|
112
68
|
static forRoot() {
|
|
113
69
|
return {
|
|
114
70
|
ngModule: DaffProductTestingDriverModule,
|
|
@@ -131,21 +87,7 @@ DaffProductTestingDriverModule.decorators = [
|
|
|
131
87
|
];
|
|
132
88
|
|
|
133
89
|
/**
|
|
134
|
-
*
|
|
135
|
-
* Generated from: public_api.ts
|
|
136
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* @fileoverview added by tsickle
|
|
141
|
-
* Generated from: index.ts
|
|
142
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
143
|
-
*/
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* @fileoverview added by tsickle
|
|
147
|
-
* Generated from: daffodil-product-driver-testing.ts
|
|
148
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
90
|
+
* Generated bundle index. Do not edit.
|
|
149
91
|
*/
|
|
150
92
|
|
|
151
93
|
export { DaffProductTestingDriverModule, DaffTestingProductService };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-product-driver-testing.js","sources":["../../../libs/product/driver/testing/src/drivers/product.service.ts","../../../libs/product/driver/testing/src/drivers/product-driver.module.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { randomSubset } from '@daffodil/core';\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffProduct } from '@daffodil/product';\nimport {\n DaffProductDriverResponse,\n DaffProductServiceInterface,\n} from '@daffodil/product/driver';\nimport {\n DaffProductImageFactory,\n DaffProductExtensionFactory,\n} from '@daffodil/product/testing';\n\n/**\n * The product testing driver to mock the backend product service.\n *\n * @inheritdoc\n * @param productFactory - A DaffProductFactory instance\n * @param productImageFactory - A DaffProductImageFactory instance\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingProductService implements DaffProductServiceInterface {\n\n constructor(\n private productFactory: DaffProductExtensionFactory,\n private productImageFactory: DaffProductImageFactory,\n ) {}\n\n getAll(): Observable<DaffProduct[]> {\n return of([\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n ]);\n }\n\n getBestSellers(): Observable<DaffProduct[]> {\n return of([\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n ]);\n }\n\n get(productId: DaffProduct['id']): Observable<DaffProductDriverResponse> {\n return of({\n id: productId,\n products: [\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n ],\n });\n }\n\n getByUrl(url: DaffProduct['url']): Observable<DaffProductDriverResponse> {\n const product = this.productFactory.create({ images: this.productImageFactory.createMany(5), url });\n return of({\n id: product.id,\n products: [product],\n });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffProductDriver } from '@daffodil/product/driver';\nimport { DaffProductTestingModule } from '@daffodil/product/testing';\n\nimport { DaffTestingProductService } from './product.service';\n\n/**\n * Module for providing the {@link DaffProductTestingService} driver as the {@link DaffProductDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffProductTestingModule,\n ],\n})\nexport class DaffProductTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffProductTestingDriverModule> {\n return {\n ngModule: DaffProductTestingDriverModule,\n providers: [\n {\n provide: DaffProductDriver,\n useExisting: DaffTestingProductService,\n },\n ],\n };\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"daffodil-product-driver-testing.js","sources":["../../../libs/product/driver/testing/src/drivers/product.service.ts","../../../libs/product/driver/testing/src/drivers/product-driver.module.ts","../../../libs/product/driver/testing/src/daffodil-product-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { randomSubset } from '@daffodil/core';\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffProduct } from '@daffodil/product';\nimport {\n DaffProductDriverResponse,\n DaffProductServiceInterface,\n} from '@daffodil/product/driver';\nimport {\n DaffProductImageFactory,\n DaffProductExtensionFactory,\n} from '@daffodil/product/testing';\n\n/**\n * The product testing driver to mock the backend product service.\n *\n * @inheritdoc\n * @param productFactory - A DaffProductFactory instance\n * @param productImageFactory - A DaffProductImageFactory instance\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingProductService implements DaffProductServiceInterface {\n\n constructor(\n private productFactory: DaffProductExtensionFactory,\n private productImageFactory: DaffProductImageFactory,\n ) {}\n\n getAll(): Observable<DaffProduct[]> {\n return of([\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n ]);\n }\n\n getBestSellers(): Observable<DaffProduct[]> {\n return of([\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n ]);\n }\n\n get(productId: DaffProduct['id']): Observable<DaffProductDriverResponse> {\n return of({\n id: productId,\n products: [\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n ],\n });\n }\n\n getByUrl(url: DaffProduct['url']): Observable<DaffProductDriverResponse> {\n const product = this.productFactory.create({ images: this.productImageFactory.createMany(5), url });\n return of({\n id: product.id,\n products: [product],\n });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffProductDriver } from '@daffodil/product/driver';\nimport { DaffProductTestingModule } from '@daffodil/product/testing';\n\nimport { DaffTestingProductService } from './product.service';\n\n/**\n * Module for providing the {@link DaffProductTestingService} driver as the {@link DaffProductDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffProductTestingModule,\n ],\n})\nexport class DaffProductTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffProductTestingDriverModule> {\n return {\n ngModule: DaffProductTestingDriverModule,\n providers: [\n {\n provide: DaffProductDriver,\n useExisting: DaffTestingProductService,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAkBA;;;;;;;MAUa,yBAAyB;IAEpC,YACU,cAA2C,EAC3C,mBAA4C;QAD5C,mBAAc,GAAd,cAAc,CAA6B;QAC3C,wBAAmB,GAAnB,mBAAmB,CAAyB;KAClD;IAEJ,MAAM;QACJ,OAAO,EAAE,CAAC;YACR,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9E,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9E,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9E,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9E,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;SAC/E,CAAC,CAAC;KACJ;IAED,cAAc;QACZ,OAAO,EAAE,CAAC;YACR,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9E,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9E,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9E,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;SAC/E,CAAC,CAAC;KACJ;IAED,GAAG,CAAC,SAA4B;QAC9B,OAAO,EAAE,CAAC;YACR,EAAE,EAAE,SAAS;YACb,QAAQ,EAAE;gBACR,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;aAC/E;SACF,CAAC,CAAC;KACJ;IAED,QAAQ,CAAC,GAAuB;QAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QACpG,OAAO,EAAE,CAAC;YACR,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB,CAAC,CAAC;KACJ;;;;YA5CF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;;YAZC,2BAA2B;YAD3B,uBAAuB;;;ACHzB;;;MASa,8BAA8B;IACzC,OAAO,OAAO;QACZ,OAAO;YACL,QAAQ,EAAE,8BAA8B;YACxC,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,iBAAiB;oBAC1B,WAAW,EAAE,yBAAyB;iBACvC;aACF;SACF,CAAC;KACH;;;YAjBF,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,wBAAwB;iBACzB;aACF;;;ACnBD;;;;;;"}
|
|
@@ -1,70 +1,12 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview added by tsickle
|
|
5
|
-
* Generated from: interfaces/product-service.interface.ts
|
|
6
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
7
|
-
*/
|
|
8
3
|
/**
|
|
9
4
|
* Injection token that serves as a placeholder for any service that implements the DaffProductServiceInterface.
|
|
10
|
-
* @type {?}
|
|
11
5
|
*/
|
|
12
6
|
const DaffProductDriver = new InjectionToken('DaffProductDriver');
|
|
13
|
-
/**
|
|
14
|
-
* An interface for any Product service drivers.
|
|
15
|
-
* @record
|
|
16
|
-
* @template T
|
|
17
|
-
*/
|
|
18
|
-
function DaffProductServiceInterface() { }
|
|
19
|
-
if (false) {
|
|
20
|
-
/**
|
|
21
|
-
* Get all products.
|
|
22
|
-
* @return {?}
|
|
23
|
-
*/
|
|
24
|
-
DaffProductServiceInterface.prototype.getAll = function () { };
|
|
25
|
-
/**
|
|
26
|
-
* Get best selling products.
|
|
27
|
-
* @return {?}
|
|
28
|
-
*/
|
|
29
|
-
DaffProductServiceInterface.prototype.getBestSellers = function () { };
|
|
30
|
-
/**
|
|
31
|
-
* Get a product by Id.
|
|
32
|
-
*
|
|
33
|
-
* @param {?} productId - A string of the product ID.
|
|
34
|
-
* @return {?}
|
|
35
|
-
*/
|
|
36
|
-
DaffProductServiceInterface.prototype.get = function (productId) { };
|
|
37
|
-
/**
|
|
38
|
-
* Get a product by URL.
|
|
39
|
-
*
|
|
40
|
-
* @param {?} url - A string of the product URL.
|
|
41
|
-
* @return {?}
|
|
42
|
-
*/
|
|
43
|
-
DaffProductServiceInterface.prototype.getByUrl = function (url) { };
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @fileoverview added by tsickle
|
|
48
|
-
* Generated from: models/public_api.ts
|
|
49
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @fileoverview added by tsickle
|
|
54
|
-
* Generated from: public_api.ts
|
|
55
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
56
|
-
*/
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @fileoverview added by tsickle
|
|
60
|
-
* Generated from: index.ts
|
|
61
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
62
|
-
*/
|
|
63
7
|
|
|
64
8
|
/**
|
|
65
|
-
*
|
|
66
|
-
* Generated from: daffodil-product-driver.ts
|
|
67
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
9
|
+
* Generated bundle index. Do not edit.
|
|
68
10
|
*/
|
|
69
11
|
|
|
70
12
|
export { DaffProductDriver };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-product-driver.js","sources":["../../../libs/product/driver/src/interfaces/product-service.interface.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffProduct } from '@daffodil/product';\n\nimport { DaffProductDriverResponse } from '../models/response.interface';\n/**\n * Injection token that serves as a placeholder for any service that implements the DaffProductServiceInterface.\n */\nexport const DaffProductDriver =\n new InjectionToken<DaffProductServiceInterface>('DaffProductDriver');\n\n\n/**\n * An interface for any Product service drivers.\n */\nexport interface DaffProductServiceInterface<T extends DaffProduct = DaffProduct> {\n /**\n * Get all products.\n */\n getAll(): Observable<T[]>;\n /**\n * Get best selling products.\n */\n getBestSellers(): Observable<T[]>;\n /**\n * Get a product by Id.\n *\n * @param productId - A string of the product ID.\n */\n get(productId: T['id']): Observable<DaffProductDriverResponse<T>>;\n /**\n * Get a product by URL.\n *\n * @param url - A string of the product URL.\n */\n getByUrl(url: DaffProduct['url']): Observable<DaffProductDriverResponse<T>>;\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"daffodil-product-driver.js","sources":["../../../libs/product/driver/src/interfaces/product-service.interface.ts","../../../libs/product/driver/src/daffodil-product-driver.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffProduct } from '@daffodil/product';\n\nimport { DaffProductDriverResponse } from '../models/response.interface';\n/**\n * Injection token that serves as a placeholder for any service that implements the DaffProductServiceInterface.\n */\nexport const DaffProductDriver =\n new InjectionToken<DaffProductServiceInterface>('DaffProductDriver');\n\n\n/**\n * An interface for any Product service drivers.\n */\nexport interface DaffProductServiceInterface<T extends DaffProduct = DaffProduct> {\n /**\n * Get all products.\n */\n getAll(): Observable<T[]>;\n /**\n * Get best selling products.\n */\n getBestSellers(): Observable<T[]>;\n /**\n * Get a product by Id.\n *\n * @param productId - A string of the product ID.\n */\n get(productId: T['id']): Observable<DaffProductDriverResponse<T>>;\n /**\n * Get a product by URL.\n *\n * @param url - A string of the product URL.\n */\n getByUrl(url: DaffProduct['url']): Observable<DaffProductDriverResponse<T>>;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAMA;;;MAGa,iBAAiB,GAC5B,IAAI,cAAc,CAA8B,mBAAmB;;ACVrE;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ɵɵdefineInjectable, ɵɵinject, PLATFORM_ID, Injectable, Inject } from '@angular/core';
|
|
2
2
|
import { isPlatformBrowser } from '@angular/common';
|
|
3
3
|
import { ofType } from '@ngrx/effects';
|
|
4
4
|
import { Store, ActionsSubject } from '@ngrx/store';
|
|
@@ -7,35 +7,22 @@ import { mapTo, take } from 'rxjs/operators';
|
|
|
7
7
|
import { DaffProductPageLoad, DaffProductPageActionTypes, DaffProductPageLoadByUrl } from '@daffodil/product/state';
|
|
8
8
|
import { DaffRoutingUriNormalizer } from '@daffodil/core/routing';
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* @fileoverview added by tsickle
|
|
12
|
-
* Generated from: resolvers/product-page-id/product-page-id.resolver.ts
|
|
13
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
14
|
-
*/
|
|
15
10
|
/**
|
|
16
11
|
* Resolves product data for product pages, and will only resolve the url after a product request succeeds or fails. This resolver expects a url
|
|
17
12
|
* of the form `some/url/{id}` where `{id}` is the product id.
|
|
18
13
|
*/
|
|
19
14
|
class DaffProductPageIdResolver {
|
|
20
|
-
/**
|
|
21
|
-
* @param {?} platformId
|
|
22
|
-
* @param {?} store
|
|
23
|
-
* @param {?} dispatcher
|
|
24
|
-
*/
|
|
25
15
|
constructor(platformId, store, dispatcher) {
|
|
26
16
|
this.platformId = platformId;
|
|
27
17
|
this.store = store;
|
|
28
18
|
this.dispatcher = dispatcher;
|
|
29
19
|
}
|
|
30
|
-
/**
|
|
31
|
-
* @param {?} route
|
|
32
|
-
* @return {?}
|
|
33
|
-
*/
|
|
34
20
|
resolve(route) {
|
|
35
21
|
this.store.dispatch(new DaffProductPageLoad(route.paramMap.get('id')));
|
|
36
22
|
return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(ofType(DaffProductPageActionTypes.ProductPageLoadSuccessAction, DaffProductPageActionTypes.ProductPageLoadFailureAction), mapTo(true), take(1));
|
|
37
23
|
}
|
|
38
24
|
}
|
|
25
|
+
/** @nocollapse */ DaffProductPageIdResolver.ɵprov = ɵɵdefineInjectable({ factory: function DaffProductPageIdResolver_Factory() { return new DaffProductPageIdResolver(ɵɵinject(PLATFORM_ID), ɵɵinject(Store), ɵɵinject(ActionsSubject)); }, token: DaffProductPageIdResolver, providedIn: "root" });
|
|
39
26
|
DaffProductPageIdResolver.decorators = [
|
|
40
27
|
{ type: Injectable, args: [{
|
|
41
28
|
providedIn: 'root',
|
|
@@ -47,30 +34,7 @@ DaffProductPageIdResolver.ctorParameters = () => [
|
|
|
47
34
|
{ type: Store },
|
|
48
35
|
{ type: ActionsSubject }
|
|
49
36
|
];
|
|
50
|
-
/** @nocollapse */ DaffProductPageIdResolver.ɵprov = ɵɵdefineInjectable({ factory: function DaffProductPageIdResolver_Factory() { return new DaffProductPageIdResolver(ɵɵinject(PLATFORM_ID), ɵɵinject(Store), ɵɵinject(ActionsSubject)); }, token: DaffProductPageIdResolver, providedIn: "root" });
|
|
51
|
-
if (false) {
|
|
52
|
-
/**
|
|
53
|
-
* @type {?}
|
|
54
|
-
* @private
|
|
55
|
-
*/
|
|
56
|
-
DaffProductPageIdResolver.prototype.platformId;
|
|
57
|
-
/**
|
|
58
|
-
* @type {?}
|
|
59
|
-
* @private
|
|
60
|
-
*/
|
|
61
|
-
DaffProductPageIdResolver.prototype.store;
|
|
62
|
-
/**
|
|
63
|
-
* @type {?}
|
|
64
|
-
* @private
|
|
65
|
-
*/
|
|
66
|
-
DaffProductPageIdResolver.prototype.dispatcher;
|
|
67
|
-
}
|
|
68
37
|
|
|
69
|
-
/**
|
|
70
|
-
* @fileoverview added by tsickle
|
|
71
|
-
* Generated from: resolvers/product-page/product-page.resolver.ts
|
|
72
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
73
|
-
*/
|
|
74
38
|
/**
|
|
75
39
|
* Resolves product data for product pages, and will only resolve the url after a product page request succeeds or fails. This resolver expects a url
|
|
76
40
|
* of the form `some/url/{id}` where `{id}` is the product id.
|
|
@@ -79,20 +43,14 @@ if (false) {
|
|
|
79
43
|
* @see DaffProductPageIdResolver
|
|
80
44
|
*/
|
|
81
45
|
class DaffProductPageResolver {
|
|
82
|
-
/**
|
|
83
|
-
* @param {?} productPageIdResolver
|
|
84
|
-
*/
|
|
85
46
|
constructor(productPageIdResolver) {
|
|
86
47
|
this.productPageIdResolver = productPageIdResolver;
|
|
87
48
|
}
|
|
88
|
-
/**
|
|
89
|
-
* @param {?} route
|
|
90
|
-
* @return {?}
|
|
91
|
-
*/
|
|
92
49
|
resolve(route) {
|
|
93
50
|
return this.productPageIdResolver.resolve(route);
|
|
94
51
|
}
|
|
95
52
|
}
|
|
53
|
+
/** @nocollapse */ DaffProductPageResolver.ɵprov = ɵɵdefineInjectable({ factory: function DaffProductPageResolver_Factory() { return new DaffProductPageResolver(ɵɵinject(DaffProductPageIdResolver)); }, token: DaffProductPageResolver, providedIn: "root" });
|
|
96
54
|
DaffProductPageResolver.decorators = [
|
|
97
55
|
{ type: Injectable, args: [{
|
|
98
56
|
providedIn: 'root',
|
|
@@ -102,20 +60,7 @@ DaffProductPageResolver.decorators = [
|
|
|
102
60
|
DaffProductPageResolver.ctorParameters = () => [
|
|
103
61
|
{ type: DaffProductPageIdResolver }
|
|
104
62
|
];
|
|
105
|
-
/** @nocollapse */ DaffProductPageResolver.ɵprov = ɵɵdefineInjectable({ factory: function DaffProductPageResolver_Factory() { return new DaffProductPageResolver(ɵɵinject(DaffProductPageIdResolver)); }, token: DaffProductPageResolver, providedIn: "root" });
|
|
106
|
-
if (false) {
|
|
107
|
-
/**
|
|
108
|
-
* @type {?}
|
|
109
|
-
* @private
|
|
110
|
-
*/
|
|
111
|
-
DaffProductPageResolver.prototype.productPageIdResolver;
|
|
112
|
-
}
|
|
113
63
|
|
|
114
|
-
/**
|
|
115
|
-
* @fileoverview added by tsickle
|
|
116
|
-
* Generated from: resolvers/product-page-url/product-page-url.resolver.ts
|
|
117
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
118
|
-
*/
|
|
119
64
|
/**
|
|
120
65
|
* Resolves product data for product pages, and will only resolve the url
|
|
121
66
|
* after a product request succeeds or fails. This resolver will take a full
|
|
@@ -123,28 +68,18 @@ if (false) {
|
|
|
123
68
|
* Assumes that the URL to be resolved is the primary outlet.
|
|
124
69
|
*/
|
|
125
70
|
class DaffProductPageUrlResolver {
|
|
126
|
-
/**
|
|
127
|
-
* @param {?} platformId
|
|
128
|
-
* @param {?} store
|
|
129
|
-
* @param {?} dispatcher
|
|
130
|
-
* @param {?} urlNormalizer
|
|
131
|
-
*/
|
|
132
71
|
constructor(platformId, store, dispatcher, urlNormalizer) {
|
|
133
72
|
this.platformId = platformId;
|
|
134
73
|
this.store = store;
|
|
135
74
|
this.dispatcher = dispatcher;
|
|
136
75
|
this.urlNormalizer = urlNormalizer;
|
|
137
76
|
}
|
|
138
|
-
/**
|
|
139
|
-
* @param {?} route
|
|
140
|
-
* @param {?} state
|
|
141
|
-
* @return {?}
|
|
142
|
-
*/
|
|
143
77
|
resolve(route, state) {
|
|
144
78
|
this.store.dispatch(new DaffProductPageLoadByUrl(this.urlNormalizer.normalize(state.url)));
|
|
145
79
|
return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(ofType(DaffProductPageActionTypes.ProductPageLoadSuccessAction, DaffProductPageActionTypes.ProductPageLoadFailureAction), mapTo(true), take(1));
|
|
146
80
|
}
|
|
147
81
|
}
|
|
82
|
+
/** @nocollapse */ DaffProductPageUrlResolver.ɵprov = ɵɵdefineInjectable({ factory: function DaffProductPageUrlResolver_Factory() { return new DaffProductPageUrlResolver(ɵɵinject(PLATFORM_ID), ɵɵinject(Store), ɵɵinject(ActionsSubject), ɵɵinject(DaffRoutingUriNormalizer)); }, token: DaffProductPageUrlResolver, providedIn: "root" });
|
|
148
83
|
DaffProductPageUrlResolver.decorators = [
|
|
149
84
|
{ type: Injectable, args: [{
|
|
150
85
|
providedIn: 'root',
|
|
@@ -157,52 +92,9 @@ DaffProductPageUrlResolver.ctorParameters = () => [
|
|
|
157
92
|
{ type: ActionsSubject },
|
|
158
93
|
{ type: DaffRoutingUriNormalizer }
|
|
159
94
|
];
|
|
160
|
-
/** @nocollapse */ DaffProductPageUrlResolver.ɵprov = ɵɵdefineInjectable({ factory: function DaffProductPageUrlResolver_Factory() { return new DaffProductPageUrlResolver(ɵɵinject(PLATFORM_ID), ɵɵinject(Store), ɵɵinject(ActionsSubject), ɵɵinject(DaffRoutingUriNormalizer)); }, token: DaffProductPageUrlResolver, providedIn: "root" });
|
|
161
|
-
if (false) {
|
|
162
|
-
/**
|
|
163
|
-
* @type {?}
|
|
164
|
-
* @private
|
|
165
|
-
*/
|
|
166
|
-
DaffProductPageUrlResolver.prototype.platformId;
|
|
167
|
-
/**
|
|
168
|
-
* @type {?}
|
|
169
|
-
* @private
|
|
170
|
-
*/
|
|
171
|
-
DaffProductPageUrlResolver.prototype.store;
|
|
172
|
-
/**
|
|
173
|
-
* @type {?}
|
|
174
|
-
* @private
|
|
175
|
-
*/
|
|
176
|
-
DaffProductPageUrlResolver.prototype.dispatcher;
|
|
177
|
-
/**
|
|
178
|
-
* @type {?}
|
|
179
|
-
* @private
|
|
180
|
-
*/
|
|
181
|
-
DaffProductPageUrlResolver.prototype.urlNormalizer;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* @fileoverview added by tsickle
|
|
186
|
-
* Generated from: resolvers/public_api.ts
|
|
187
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
188
|
-
*/
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* @fileoverview added by tsickle
|
|
192
|
-
* Generated from: public_api.ts
|
|
193
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
194
|
-
*/
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* @fileoverview added by tsickle
|
|
198
|
-
* Generated from: index.ts
|
|
199
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
200
|
-
*/
|
|
201
95
|
|
|
202
96
|
/**
|
|
203
|
-
*
|
|
204
|
-
* Generated from: daffodil-product-routing.ts
|
|
205
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
97
|
+
* Generated bundle index. Do not edit.
|
|
206
98
|
*/
|
|
207
99
|
|
|
208
100
|
export { DaffProductPageIdResolver, DaffProductPageResolver, DaffProductPageUrlResolver };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-product-routing.js","sources":["../../../libs/product/routing/src/resolvers/product-page-id/product-page-id.resolver.ts","../../../libs/product/routing/src/resolvers/product-page/product-page.resolver.ts","../../../libs/product/routing/src/resolvers/product-page-url/product-page-url.resolver.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n Resolve,\n} from '@angular/router';\nimport { ofType } from '@ngrx/effects';\nimport {\n ActionsSubject,\n Store,\n} from '@ngrx/store';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport {\n mapTo,\n take,\n} from 'rxjs/operators';\n\nimport {\n DaffProductStateRootSlice,\n DaffProductPageLoad,\n DaffProductPageActionTypes,\n} from '@daffodil/product/state';\n\n/**\n * Resolves product data for product pages, and will only resolve the url after a product request succeeds or fails. This resolver expects a url\n * of the form `some/url/{id}` where `{id}` is the product id.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffProductPageIdResolver implements Resolve<Observable<boolean>> {\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n private store: Store<DaffProductStateRootSlice>,\n private dispatcher: ActionsSubject,\n ) { }\n\n resolve(route: ActivatedRouteSnapshot): Observable<boolean> {\n this.store.dispatch(new DaffProductPageLoad(route.paramMap.get('id')));\n\n return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(\n ofType(DaffProductPageActionTypes.ProductPageLoadSuccessAction, DaffProductPageActionTypes.ProductPageLoadFailureAction),\n mapTo(true),\n take(1),\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n Resolve,\n} from '@angular/router';\nimport { Observable } from 'rxjs';\n\nimport { DaffProductPageIdResolver } from '../product-page-id/product-page-id.resolver';\n\n/**\n * Resolves product data for product pages, and will only resolve the url after a product page request succeeds or fails. This resolver expects a url\n * of the form `some/url/{id}` where `{id}` is the product id.\n *\n * @deprecated\n * @see DaffProductPageIdResolver\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffProductPageResolver implements Resolve<Observable<boolean>> {\n constructor(\n private productPageIdResolver: DaffProductPageIdResolver,\n ) { }\n\n resolve(route: ActivatedRouteSnapshot): Observable<boolean> {\n return this.productPageIdResolver.resolve(route);\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n Resolve,\n RouterStateSnapshot,\n} from '@angular/router';\nimport { ofType } from '@ngrx/effects';\nimport {\n ActionsSubject,\n Store,\n} from '@ngrx/store';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport {\n mapTo,\n take,\n} from 'rxjs/operators';\n\nimport { DaffRoutingUriNormalizer } from '@daffodil/core/routing';\nimport {\n DaffProductStateRootSlice,\n DaffProductPageLoadByUrl,\n DaffProductPageActionTypes,\n} from '@daffodil/product/state';\n\n/**\n * Resolves product data for product pages, and will only resolve the url\n * after a product request succeeds or fails. This resolver will take a full\n * a url of the form `some/url.html(secondary:outlet)?query=param#fragment` and attempt to resolve a product from it.\n * Assumes that the URL to be resolved is the primary outlet.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffProductPageUrlResolver implements Resolve<Observable<boolean>> {\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n private store: Store<DaffProductStateRootSlice>,\n private dispatcher: ActionsSubject,\n private urlNormalizer: DaffRoutingUriNormalizer,\n ) { }\n\n resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {\n this.store.dispatch(\n new DaffProductPageLoadByUrl(this.urlNormalizer.normalize(state.url)),\n );\n\n return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(\n ofType(DaffProductPageActionTypes.ProductPageLoadSuccessAction, DaffProductPageActionTypes.ProductPageLoadFailureAction),\n mapTo(true),\n take(1),\n );\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"daffodil-product-routing.js","sources":["../../../libs/product/routing/src/resolvers/product-page-id/product-page-id.resolver.ts","../../../libs/product/routing/src/resolvers/product-page/product-page.resolver.ts","../../../libs/product/routing/src/resolvers/product-page-url/product-page-url.resolver.ts","../../../libs/product/routing/src/daffodil-product-routing.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n Resolve,\n} from '@angular/router';\nimport { ofType } from '@ngrx/effects';\nimport {\n ActionsSubject,\n Store,\n} from '@ngrx/store';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport {\n mapTo,\n take,\n} from 'rxjs/operators';\n\nimport {\n DaffProductStateRootSlice,\n DaffProductPageLoad,\n DaffProductPageActionTypes,\n} from '@daffodil/product/state';\n\n/**\n * Resolves product data for product pages, and will only resolve the url after a product request succeeds or fails. This resolver expects a url\n * of the form `some/url/{id}` where `{id}` is the product id.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffProductPageIdResolver implements Resolve<Observable<boolean>> {\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n private store: Store<DaffProductStateRootSlice>,\n private dispatcher: ActionsSubject,\n ) { }\n\n resolve(route: ActivatedRouteSnapshot): Observable<boolean> {\n this.store.dispatch(new DaffProductPageLoad(route.paramMap.get('id')));\n\n return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(\n ofType(DaffProductPageActionTypes.ProductPageLoadSuccessAction, DaffProductPageActionTypes.ProductPageLoadFailureAction),\n mapTo(true),\n take(1),\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n Resolve,\n} from '@angular/router';\nimport { Observable } from 'rxjs';\n\nimport { DaffProductPageIdResolver } from '../product-page-id/product-page-id.resolver';\n\n/**\n * Resolves product data for product pages, and will only resolve the url after a product page request succeeds or fails. This resolver expects a url\n * of the form `some/url/{id}` where `{id}` is the product id.\n *\n * @deprecated\n * @see DaffProductPageIdResolver\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffProductPageResolver implements Resolve<Observable<boolean>> {\n constructor(\n private productPageIdResolver: DaffProductPageIdResolver,\n ) { }\n\n resolve(route: ActivatedRouteSnapshot): Observable<boolean> {\n return this.productPageIdResolver.resolve(route);\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n Resolve,\n RouterStateSnapshot,\n} from '@angular/router';\nimport { ofType } from '@ngrx/effects';\nimport {\n ActionsSubject,\n Store,\n} from '@ngrx/store';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport {\n mapTo,\n take,\n} from 'rxjs/operators';\n\nimport { DaffRoutingUriNormalizer } from '@daffodil/core/routing';\nimport {\n DaffProductStateRootSlice,\n DaffProductPageLoadByUrl,\n DaffProductPageActionTypes,\n} from '@daffodil/product/state';\n\n/**\n * Resolves product data for product pages, and will only resolve the url\n * after a product request succeeds or fails. This resolver will take a full\n * a url of the form `some/url.html(secondary:outlet)?query=param#fragment` and attempt to resolve a product from it.\n * Assumes that the URL to be resolved is the primary outlet.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffProductPageUrlResolver implements Resolve<Observable<boolean>> {\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n private store: Store<DaffProductStateRootSlice>,\n private dispatcher: ActionsSubject,\n private urlNormalizer: DaffRoutingUriNormalizer,\n ) { }\n\n resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {\n this.store.dispatch(\n new DaffProductPageLoadByUrl(this.urlNormalizer.normalize(state.url)),\n );\n\n return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(\n ofType(DaffProductPageActionTypes.ProductPageLoadSuccessAction, DaffProductPageActionTypes.ProductPageLoadFailureAction),\n mapTo(true),\n take(1),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA8BA;;;;MAOa,yBAAyB;IACpC,YAC+B,UAAkB,EACvC,KAAuC,EACvC,UAA0B;QAFL,eAAU,GAAV,UAAU,CAAQ;QACvC,UAAK,GAAL,KAAK,CAAkC;QACvC,eAAU,GAAV,UAAU,CAAgB;KAC/B;IAEL,OAAO,CAAC,KAA6B;QACnC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAEvE,OAAO,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CACzE,MAAM,CAAC,0BAA0B,CAAC,4BAA4B,EAAE,0BAA0B,CAAC,4BAA4B,CAAC,EACxH,KAAK,CAAC,IAAI,CAAC,EACX,IAAI,CAAC,CAAC,CAAC,CACR,CAAC;KACH;;;;YAlBF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;;yCAGI,MAAM,SAAC,WAAW;YA1BrB,KAAK;YADL,cAAc;;;ACHhB;;;;;;;MAUa,uBAAuB;IAClC,YACU,qBAAgD;QAAhD,0BAAqB,GAArB,qBAAqB,CAA2B;KACrD;IAEL,OAAO,CAAC,KAA6B;QACnC,OAAO,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAClD;;;;YAVF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;;YAXQ,yBAAyB;;;ACyBlC;;;;;;MASa,0BAA0B;IACrC,YAC+B,UAAkB,EACvC,KAAuC,EACvC,UAA0B,EAC1B,aAAuC;QAHlB,eAAU,GAAV,UAAU,CAAQ;QACvC,UAAK,GAAL,KAAK,CAAkC;QACvC,eAAU,GAAV,UAAU,CAAgB;QAC1B,kBAAa,GAAb,aAAa,CAA0B;KAC5C;IAEL,OAAO,CAAC,KAA6B,EAAE,KAA0B;QAC/D,IAAI,CAAC,KAAK,CAAC,QAAQ,CACjB,IAAI,wBAAwB,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CACtE,CAAC;QAEF,OAAO,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CACzE,MAAM,CAAC,0BAA0B,CAAC,4BAA4B,EAAE,0BAA0B,CAAC,4BAA4B,CAAC,EACxH,KAAK,CAAC,IAAI,CAAC,EACX,IAAI,CAAC,CAAC,CAAC,CACR,CAAC;KACH;;;;YArBF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;;yCAGI,MAAM,SAAC,WAAW;YA7BrB,KAAK;YADL,cAAc;YAYP,wBAAwB;;;ACzBjC;;;;;;"}
|