Test Setup Failed
Push — master ( cd1dab...2a689d )
by
unknown
03:51
created

ProductsPricesComponent   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
define(function(require) {
2
    'use strict';
3
4
    var ProductsPricesComponent;
5
    var mediator = require('oroui/js/mediator');
6
    var BaseProductsPricesComponent = require('oropricing/js/app/components/products-prices-component');
7
8
    /**
9
     * @export oroorder/js/app/components/entry-point-component
10
     * @extends oropricing.app.components.ProductsPricesComponent
11
     * @class oroorder.app.components.ProductsPricesComponent
12
     */
13
    ProductsPricesComponent = BaseProductsPricesComponent.extend({
14
        /**
15
         * @inheritDoc
16
         */
17
        constructor: function ProductsPricesComponent() {
18
            ProductsPricesComponent.__super__.constructor.apply(this, arguments);
19
        },
20
21
        /**
22
         * @param {Array} products
23
         * @param {Function} callback
24
         */
25
        loadProductsTierPrices: function(products, callback) {
26
            mediator.once('entry-point:order:load', function(response) {
27
                callback(response.tierPrices || {});
28
            });
29
        },
30
31
        reloadPrices: function() {
32
            ProductsPricesComponent.__super__.reloadPrices.apply(this, arguments);
33
34
            mediator.trigger('entry-point:order:trigger');
35
        }
36
    });
37
38
    return ProductsPricesComponent;
39
});
40