diff --git a/src/CoreShop/Bundle/AddressBundle/Resources/public/pimcore/js/resource.js b/src/CoreShop/Bundle/AddressBundle/Resources/public/pimcore/js/resource.js index 9cef642de4..cbe59812f1 100644 --- a/src/CoreShop/Bundle/AddressBundle/Resources/public/pimcore/js/resource.js +++ b/src/CoreShop/Bundle/AddressBundle/Resources/public/pimcore/js/resource.js @@ -28,12 +28,6 @@ coreshop.address.resource = Class.create(coreshop.resource, { value: true }); - pimcore.globalmanager.get('coreshop_countries').load(); - pimcore.globalmanager.get('coreshop_address_identifier').load(); - pimcore.globalmanager.get('coreshop_countries_active').load(); - pimcore.globalmanager.get('coreshop_states').load(); - pimcore.globalmanager.get('coreshop_zones').load(); - coreshop.broker.fireEvent('resource.register', 'coreshop.address', this); }, @@ -77,4 +71,4 @@ coreshop.address.resource = Class.create(coreshop.resource, { coreshop.broker.addListener('pimcore.ready', function() { new coreshop.address.resource(); -}); \ No newline at end of file +}); diff --git a/src/CoreShop/Bundle/AddressBundle/Resources/public/pimcore/js/resource/country.js b/src/CoreShop/Bundle/AddressBundle/Resources/public/pimcore/js/resource/country.js index 8960b23b9d..b1111859be 100644 --- a/src/CoreShop/Bundle/AddressBundle/Resources/public/pimcore/js/resource/country.js +++ b/src/CoreShop/Bundle/AddressBundle/Resources/public/pimcore/js/resource/country.js @@ -4,10 +4,7 @@ Ext.define('CoreShop.store.Country', { name: 'country', fieldLabel: t('coreshop_country'), - - initComponent: function () { - this.store = pimcore.globalmanager.get('coreshop_countries'); - - this.callParent(); + store: { + type: 'coreshop_countries' } -}); \ No newline at end of file +}); diff --git a/src/CoreShop/Bundle/AddressBundle/Resources/public/pimcore/js/resource/state.js b/src/CoreShop/Bundle/AddressBundle/Resources/public/pimcore/js/resource/state.js index 52d04ea8b7..0776ea77f8 100644 --- a/src/CoreShop/Bundle/AddressBundle/Resources/public/pimcore/js/resource/state.js +++ b/src/CoreShop/Bundle/AddressBundle/Resources/public/pimcore/js/resource/state.js @@ -4,10 +4,7 @@ Ext.define('CoreShop.store.State', { name: 'state', fieldLabel: t('coreshop_state'), - - initComponent: function () { - this.store = pimcore.globalmanager.get('coreshop_states'); - - this.callParent(); + store: { + type: 'coreshop_states' } -}); \ No newline at end of file +}); diff --git a/src/CoreShop/Bundle/AddressBundle/Resources/public/pimcore/js/resource/zone.js b/src/CoreShop/Bundle/AddressBundle/Resources/public/pimcore/js/resource/zone.js index 75dc490ac0..d9eaed81a3 100644 --- a/src/CoreShop/Bundle/AddressBundle/Resources/public/pimcore/js/resource/zone.js +++ b/src/CoreShop/Bundle/AddressBundle/Resources/public/pimcore/js/resource/zone.js @@ -4,10 +4,7 @@ Ext.define('CoreShop.store.Zone', { name: 'zone', fieldLabel: t('coreshop_zone'), - - initComponent: function () { - this.store = pimcore.globalmanager.get('coreshop_zones'); - - this.callParent(); + store: { + type: 'coreshop_zones' } -}); \ No newline at end of file +}); diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/cart/pricerules/conditions/carriers.js b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/cart/pricerules/conditions/carriers.js index b2a96373a9..b76660eb82 100644 --- a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/cart/pricerules/conditions/carriers.js +++ b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/cart/pricerules/conditions/carriers.js @@ -16,14 +16,15 @@ coreshop.cart.pricerules.conditions.carriers = Class.create(coreshop.rules.condi getForm: function () { var me = this; - var store = pimcore.globalmanager.get('coreshop_carriers'); var carriers = { fieldLabel: t('coreshop_carrier'), typeAhead: true, listWidth: 100, width: 500, - store: store, + store: { + type: 'coreshop_carriers' + }, displayField: 'identifier', valueField: 'id', forceSelection: true, @@ -32,15 +33,7 @@ coreshop.cart.pricerules.conditions.carriers = Class.create(coreshop.rules.condi name: 'carriers', maxHeight: 400, delimiter: false, - listeners: { - beforerender: function () { - if (!store.isLoaded() && !store.isLoading()) - store.load(); - - if (me.data && me.data.carriers) - this.setValue(me.data.carriers); - } - } + value: me.data.carriers }; if (this.data && this.data.carriers) { diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/coreExtension/tags/coreShopStorePrice.js b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/coreExtension/tags/coreShopStorePrice.js index 5b9281d2f2..364a93983a 100755 --- a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/coreExtension/tags/coreShopStorePrice.js +++ b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/coreExtension/tags/coreShopStorePrice.js @@ -220,4 +220,4 @@ pimcore.object.tags.coreShopStorePrice = Class.create(pimcore.object.tags.abstra return false; } -}); \ No newline at end of file +}); diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/notification/conditions/invoice/invoiceState.js b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/notification/conditions/invoice/invoiceState.js index 62bc222db9..607ffffbb7 100644 --- a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/notification/conditions/invoice/invoiceState.js +++ b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/notification/conditions/invoice/invoiceState.js @@ -24,7 +24,9 @@ coreshop.notification.rule.conditions.invoiceState = Class.create(coreshop.rules name: 'invoiceState', value: this.data ? this.data.invoiceState : [], width: 250, - store: pimcore.globalmanager.get('coreshop_states_invoice'), + store: { + type: 'coreshop_states_invoice' + }, triggerAction: 'all', typeAhead: false, editable: false, diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/notification/conditions/order/carriers.js b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/notification/conditions/order/carriers.js index c783a40d32..ec51784224 100644 --- a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/notification/conditions/order/carriers.js +++ b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/notification/conditions/order/carriers.js @@ -17,14 +17,15 @@ coreshop.notification.rule.conditions.carriers = Class.create(coreshop.rules.con getForm: function () { var me = this; - var store = pimcore.globalmanager.get('coreshop_carriers'); var carriers = { fieldLabel: t('coreshop_carrier'), typeAhead: true, listWidth: 100, width: 500, - store: store, + store: { + type: 'coreshop_carriers' + }, displayField: 'identifier', valueField: 'id', forceSelection: true, @@ -33,15 +34,7 @@ coreshop.notification.rule.conditions.carriers = Class.create(coreshop.rules.con name: 'carriers', maxHeight: 400, delimiter: false, - listeners: { - beforerender: function () { - if (!store.isLoaded() && !store.isLoading()) - store.load(); - - if (me.data && me.data.carriers) - this.setValue(me.data.carriers); - } - } + value: me.data.carriers }; if (this.data && this.data.carriers) { diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/notification/conditions/payment/paymentState.js b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/notification/conditions/payment/paymentState.js index 6a8985e035..443253376e 100644 --- a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/notification/conditions/payment/paymentState.js +++ b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/notification/conditions/payment/paymentState.js @@ -24,7 +24,9 @@ coreshop.notification.rule.conditions.paymentState = Class.create(coreshop.rules name: 'paymentState', value: this.data ? this.data.paymentState : [], width: 250, - store: pimcore.globalmanager.get('coreshop_states_payment'), + store: { + type: 'coreshop_states_payment' + }, triggerAction: 'all', typeAhead: false, editable: false, diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/notification/conditions/shipment/shipmentState.js b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/notification/conditions/shipment/shipmentState.js index c559ac41a5..6b746297ea 100644 --- a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/notification/conditions/shipment/shipmentState.js +++ b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/notification/conditions/shipment/shipmentState.js @@ -24,7 +24,9 @@ coreshop.notification.rule.conditions.shipmentState = Class.create(coreshop.rule name: 'shipmentState', value: this.data ? this.data.shipmentState : [], width: 250, - store: pimcore.globalmanager.get('coreshop_states_shipment'), + store: { + type: 'coreshop_states_shipment' + }, triggerAction: 'all', typeAhead: false, editable: false, diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/order/shipment.js b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/order/shipment.js index 2e4550a67a..0597aa1809 100644 --- a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/order/shipment.js +++ b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/order/shipment.js @@ -15,10 +15,7 @@ coreshop.order.order.shipment = Class.create(coreshop.order.order.shipment, { cb: null, createWindow: function ($super, shipAbleItems) { - pimcore.globalmanager.get('coreshop_carriers').load(); - var window = $super(shipAbleItems), - store = pimcore.globalmanager.get('coreshop_carriers'), hasCarrier = this.order.shippingPayment.carrier !== null, orderCarrierId = parseInt(this.order.carrier), orderCarrierName = this.order.shippingPayment.carrier, @@ -28,7 +25,9 @@ coreshop.order.order.shipment = Class.create(coreshop.order.order.shipment, { xtype: 'combo', fieldLabel: t('coreshop_carrier'), mode: 'local', - store: store, + store: { + type: 'coreshop_carriers' + }, displayField: 'identifier', valueField: 'id', forceSelection: true, @@ -60,25 +59,6 @@ coreshop.order.order.shipment = Class.create(coreshop.order.order.shipment, { }, change: function() { showToolTip = false; - }, - afterrender: function () { - if (hasCarrier === true) { - var orderCarrierIndex; - if (store.isLoaded()) { - orderCarrierIndex = store.findExact('id', orderCarrierId); - if (orderCarrierIndex !== -1) { - this.setValue(store.getAt(orderCarrierIndex)); - } - } else { - store.load(); - store.on('load', function (store, records, options) { - orderCarrierIndex = store.findExact('id', orderCarrierId); - if (orderCarrierIndex !== -1) { - this.setValue(store.getAt(orderCarrierIndex)); - } - }.bind(this)); - } - } } } }); diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/settings.js b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/settings.js index d3be331213..bc0cd6a72b 100644 --- a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/settings.js +++ b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/settings.js @@ -27,12 +27,19 @@ coreshop.core.settings = Class.create({ this.data = Ext.decode(response.responseText).data; - this.getTabPanel(); + this.loadStores(); }.bind(this) }); }, + loadStores: function() + { + this.stores = Ext.create('store.coreshop_stores').load(function() { + this.getTabPanel(); + }.bind(this)); + }, + getValue: function (shopId, key) { var current = null; @@ -248,8 +255,7 @@ coreshop.core.settings = Class.create({ var me = this, shopPanel, - store = pimcore.globalmanager.get('coreshop_stores'), - shop = store.getById(shopId); + shop = this.stores.getById(shopId); if (!shop) { alert('STORE NOT FOUND!'); diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/shipping/rules/conditions/countries.js b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/shipping/rules/conditions/countries.js index fa8eb90ef1..5c79d0894b 100644 --- a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/shipping/rules/conditions/countries.js +++ b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/shipping/rules/conditions/countries.js @@ -16,14 +16,15 @@ coreshop.shippingrule.conditions.countries = Class.create(coreshop.rules.conditi getForm: function () { var me = this; - var store = pimcore.globalmanager.get('coreshop_countries'); var countries = { fieldLabel: t('coreshop_condition_countries'), typeAhead: true, listWidth: 100, width: 500, - store: store, + store: { + type: 'coreshop_countries' + }, displayField: 'name', valueField: 'id', forceSelection: true, @@ -32,15 +33,7 @@ coreshop.shippingrule.conditions.countries = Class.create(coreshop.rules.conditi name: 'countries', height: 400, delimiter: false, - listeners: { - beforerender: function () { - if (!store.isLoaded() && !store.isLoading()) - store.load(); - - if (me.data && me.data.countries) - this.setValue(me.data.countries); - } - } + value: me.data.countries }; diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/shipping/rules/conditions/currencies.js b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/shipping/rules/conditions/currencies.js index db6d5ce74c..db42cc99f7 100644 --- a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/shipping/rules/conditions/currencies.js +++ b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/shipping/rules/conditions/currencies.js @@ -16,14 +16,15 @@ coreshop.shippingrule.conditions.currencies = Class.create(coreshop.rules.condit getForm: function () { var me = this; - var store = pimcore.globalmanager.get('coreshop_currencies'); var currencies = { fieldLabel: t('coreshop_condition_currencies'), typeAhead: true, listWidth: 100, width: 500, - store: store, + store: { + type: 'coreshop_currencies' + }, displayField: 'name', valueField: 'id', forceSelection: true, @@ -32,15 +33,7 @@ coreshop.shippingrule.conditions.currencies = Class.create(coreshop.rules.condit name: 'currencies', maxHeight: 400, delimiter: false, - listeners: { - beforerender: function () { - if (!store.isLoaded() && !store.isLoading()) - store.load(); - - if (me.data && me.data.currencies) - this.setValue(me.data.currencies); - } - } + value: me.data.currencies }; if (this.data && this.data.currencies) { diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/shipping/rules/conditions/zones.js b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/shipping/rules/conditions/zones.js index 6bc76b4b93..679502b5dc 100644 --- a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/shipping/rules/conditions/zones.js +++ b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/shipping/rules/conditions/zones.js @@ -16,14 +16,15 @@ coreshop.shippingrule.conditions.zones = Class.create(coreshop.rules.conditions. getForm: function () { var me = this; - var store = pimcore.globalmanager.get('coreshop_zones'); var zones = { fieldLabel: t('coreshop_condition_zones'), typeAhead: true, listWidth: 100, width: 500, - store: store, + store: { + type: 'coreshop_zones' + }, displayField: 'name', valueField: 'id', forceSelection: true, @@ -32,15 +33,7 @@ coreshop.shippingrule.conditions.zones = Class.create(coreshop.rules.conditions. name: 'zones', maxHeight: 400, delimiter: false, - listeners: { - beforerender: function () { - if (!store.isLoaded() && !store.isLoading()) - store.load(); - - if (me.data && me.data.zones) - this.setValue(me.data.zones); - } - } + value: me.data.zones }; if (this.data && this.data.zones) { diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/store/item.js b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/store/item.js index e651bc2792..1b3d5d97be 100644 --- a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/store/item.js +++ b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/store/item.js @@ -14,7 +14,6 @@ coreshop.store.item = Class.create(coreshop.store.item, { getFormPanel: function ($super) { var me = this, - store = pimcore.globalmanager.get('coreshop_countries'), panel = $super(); panel.down('fieldset').add( @@ -26,7 +25,9 @@ coreshop.store.item = Class.create(coreshop.store.item, { value: this.data.baseCountry, mode: 'local', listWidth: 100, - store: pimcore.globalmanager.get('coreshop_countries_active'), + store: { + type: 'coreshop_countries_active' + }, displayField: 'name', valueField: 'id', forceSelection: true, @@ -45,7 +46,9 @@ coreshop.store.item = Class.create(coreshop.store.item, { typeAhead: true, listWidth: 100, width: 500, - store: store, + store: { + type: 'coreshop_countries' + }, displayField: 'name', valueField: 'id', forceSelection: true, @@ -54,15 +57,7 @@ coreshop.store.item = Class.create(coreshop.store.item, { name: 'countries', height: 400, delimiter: false, - listeners: { - beforerender: function () { - if (!store.isLoaded() && !store.isLoading()) - store.load(); - - if (me.data && me.data.countries) - this.setValue(me.data.countries); - } - } + value: me.data.countries } ] ); diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/taxation/taxrulegroup/item.js b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/taxation/taxrulegroup/item.js index 85d6f69db8..46661ed613 100644 --- a/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/taxation/taxrulegroup/item.js +++ b/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/taxation/taxrulegroup/item.js @@ -89,6 +89,9 @@ coreshop.taxrulegroup.item = Class.create(coreshop.taxrulegroup.item, { disabled: false }); + var taxRateStore = Ext.create('store.coreshop_tax_rates'); + taxRateStore.load(); + var gridColumns = [ { header: t('coreshop_country'), @@ -125,13 +128,13 @@ coreshop.taxrulegroup.item = Class.create(coreshop.taxrulegroup.item, { width: 200, dataIndex: 'taxRate', editor: new Ext.form.ComboBox({ - store: pimcore.globalmanager.get('coreshop_tax_rates'), + store: taxRateStore, valueField: 'id', displayField: 'name', queryMode: 'local' }), renderer: function (taxRate) { - var record = pimcore.globalmanager.get('coreshop_tax_rates').getById(taxRate); + var record = taxRateStore.getById(taxRate); if (record) { return record.get('name'); diff --git a/src/CoreShop/Bundle/CurrencyBundle/Resources/public/pimcore/js/exchangeRate/panel.js b/src/CoreShop/Bundle/CurrencyBundle/Resources/public/pimcore/js/exchangeRate/panel.js index 56672e3b4d..81521b8bc5 100644 --- a/src/CoreShop/Bundle/CurrencyBundle/Resources/public/pimcore/js/exchangeRate/panel.js +++ b/src/CoreShop/Bundle/CurrencyBundle/Resources/public/pimcore/js/exchangeRate/panel.js @@ -36,6 +36,9 @@ coreshop.exchange_rate.panel = Class.create(coreshop.resource.panel, { getExchangeRatesGrid: function () { pimcore.globalmanager.get(this.storeId).load(); + var currencyStore = Ext.create('store.coreshop_currencies'); + currencyStore.load(); + this.grid = Ext.create('Ext.grid.Panel', { store: pimcore.globalmanager.get(this.storeId), region: 'center', @@ -45,15 +48,14 @@ coreshop.exchange_rate.panel = Class.create(coreshop.resource.panel, { flex: 1, dataIndex: 'fromCurrency', editor: new Ext.form.ComboBox({ - store: pimcore.globalmanager.get('coreshop_currencies'), + store: currencyStore, valueField: 'id', displayField: 'name', queryMode: 'local', required: true }), - renderer: function (currencyId) { - var store = pimcore.globalmanager.get('coreshop_currencies'); - var currency = store.getById(currencyId); + renderer: function (currencyId) {; + var currency = currencyStore.getById(currencyId); if (currency) { return currency.get('name'); } @@ -66,15 +68,14 @@ coreshop.exchange_rate.panel = Class.create(coreshop.resource.panel, { flex: 1, dataIndex: 'toCurrency', editor: new Ext.form.ComboBox({ - store: pimcore.globalmanager.get('coreshop_currencies'), + store: currencyStore, valueField: 'id', displayField: 'name', queryMode: 'local', required: true }), renderer: function (currencyId) { - var store = pimcore.globalmanager.get('coreshop_currencies'); - var currency = store.getById(currencyId); + var currency = currencyStore.getById(currencyId); if (currency) { return currency.get('name'); } diff --git a/src/CoreShop/Bundle/CurrencyBundle/Resources/public/pimcore/js/resource.js b/src/CoreShop/Bundle/CurrencyBundle/Resources/public/pimcore/js/resource.js index ffa4693e69..ed571d1ab2 100644 --- a/src/CoreShop/Bundle/CurrencyBundle/Resources/public/pimcore/js/resource.js +++ b/src/CoreShop/Bundle/CurrencyBundle/Resources/public/pimcore/js/resource.js @@ -21,8 +21,6 @@ coreshop.currency.resource = Class.create(coreshop.resource, { {name: 'exchangeRate'} ]); - pimcore.globalmanager.get('coreshop_currencies').load(); - coreshop.broker.fireEvent('resource.register', 'coreshop.currency', this); }, @@ -55,4 +53,4 @@ coreshop.currency.resource = Class.create(coreshop.resource, { coreshop.broker.addListener('pimcore.ready', function() { new coreshop.currency.resource(); -}); \ No newline at end of file +}); diff --git a/src/CoreShop/Bundle/CurrencyBundle/Resources/public/pimcore/js/resource/currency.js b/src/CoreShop/Bundle/CurrencyBundle/Resources/public/pimcore/js/resource/currency.js index 63d801b948..32bfdbc21c 100644 --- a/src/CoreShop/Bundle/CurrencyBundle/Resources/public/pimcore/js/resource/currency.js +++ b/src/CoreShop/Bundle/CurrencyBundle/Resources/public/pimcore/js/resource/currency.js @@ -4,10 +4,7 @@ Ext.define('CoreShop.store.Currency', { name: 'currency', fieldLabel: t('coreshop_currency'), - - initComponent: function () { - this.store = pimcore.globalmanager.get('coreshop_currencies'); - - this.callParent(); + store: { + type: 'coreshop_currencies' } -}); \ No newline at end of file +}); diff --git a/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/filter/item.js b/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/filter/item.js index b2825574d6..8f4c0474a5 100644 --- a/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/filter/item.js +++ b/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/filter/item.js @@ -121,7 +121,9 @@ coreshop.filter.item = Class.create(coreshop.resource.item, { typeAhead: true, listWidth: 100, width: 250, - store: pimcore.globalmanager.get('coreshop_indexes'), + store: { + type: 'coreshop_indexes' + }, displayField: 'name', valueField: 'id', forceSelection: true, diff --git a/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/filter/panel.js b/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/filter/panel.js index 16d7112c1c..2367c03446 100644 --- a/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/filter/panel.js +++ b/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/filter/panel.js @@ -40,8 +40,6 @@ coreshop.filter.panel = Class.create(coreshop.resource.panel, { initialize: function () { var me = this; - pimcore.globalmanager.get('coreshop_indexes').load(); - Ext.Ajax.request({ url: '/admin/coreshop/filters/get-config', method: 'GET', diff --git a/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/interpreters/iterator.js b/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/interpreters/iterator.js index 5b025bee03..3f8e072beb 100644 --- a/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/interpreters/iterator.js +++ b/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/interpreters/iterator.js @@ -15,7 +15,9 @@ pimcore.registerNS('coreshop.index.interpreters.iterator'); coreshop.index.interpreters.iterator = Class.create(coreshop.index.interpreters.abstract, { getStore: function() { - return pimcore.globalmanager.get('coreshop_index_interpreters'); + return { + type: 'coreshop_index_interpreters' + } }, getClassItem: function() { diff --git a/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/interpreters/nested.js b/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/interpreters/nested.js index 74c1d824a0..1ce1791509 100644 --- a/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/interpreters/nested.js +++ b/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/interpreters/nested.js @@ -18,40 +18,45 @@ coreshop.index.interpreters.nested = Class.create(coreshop.index.interpreters.ab // init var _this = this; var addMenu = []; - var store = pimcore.globalmanager.get('coreshop_index_interpreters').getRange(); - store.clearFilter(); + var store = Ext.create('store.coreshop_index_interpreters'); - var records = store.map(function(interpreter) {return interpreter.get('type')}); + this.wrapperContainer = new Ext.container.Container(); - Ext.each(records, function (interpreter) { - if (interpreter === 'abstract') - return; + store.load(function() { + var types = store.map(function(interpreter) {return interpreter.get('type')}); - addMenu.push({ - text: interpreter, - handler: _this.addInterpreter.bind(_this, interpreter, record, {}) + Ext.each(types, function (interpreter) { + if (interpreter === 'abstract') + return; + + addMenu.push({ + text: interpreter, + handler: _this.addInterpreter.bind(_this, interpreter, record, {}) + }); }); - }); - - this.interpreterContainer = new Ext.Panel({ - autoScroll: true, - forceLayout: true, - tbar: [{ - iconCls: 'pimcore_icon_add', - menu: addMenu - }], - border: false - }); - - if (interpreterConfig && interpreterConfig.interpreters) { - Ext.each(interpreterConfig.interpreters, function (interpreter) { - this.addInterpreter(interpreter.type, record, interpreter.interpreterConfig); - }.bind(this)); - } + this.interpreterContainer = new Ext.Panel({ + autoScroll: true, + forceLayout: true, + tbar: [{ + iconCls: 'pimcore_icon_add', + menu: addMenu + }], + border: false + }); + + if (interpreterConfig && interpreterConfig.interpreters) { + Ext.each(interpreterConfig.interpreters, function (interpreter) { + this.addInterpreter(interpreter.type, record, interpreter.interpreterConfig); + }.bind(this)); + } + + + this.wrapperContainer.add(this.interpreterContainer); + }.bind(this)); - return this.interpreterContainer; + return this.wrapperContainer; }, destroy: function () { diff --git a/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/item.js b/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/item.js index 3f3a7aa29e..1e2bf14524 100644 --- a/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/item.js +++ b/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/item.js @@ -98,7 +98,9 @@ coreshop.index.item = Class.create(coreshop.resource.item, { value: this.data.worker, mode: 'local', listWidth: 100, - store: this.parentPanel.typesStore, + store: { + type: 'coreshop_index_types' + }, displayField: 'name', valueField: 'name', forceSelection: true, diff --git a/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/objecttype/abstract.js b/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/objecttype/abstract.js index f9e8b64b68..32e8cdaa4b 100644 --- a/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/objecttype/abstract.js +++ b/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/objecttype/abstract.js @@ -25,7 +25,7 @@ coreshop.index.objecttype.abstract = Class.create({ name: 'columnType', length: 255, value: record.data.columnType, - store: pimcore.globalmanager.get('coreshop_index_fieldTypes'), + store: pimcore.globalmanager.get('coreshop_index_field_types'), valueField: 'type', displayField: 'name', queryMode: 'local', diff --git a/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/panel.js b/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/panel.js index 8dc9233cee..9750091a9e 100644 --- a/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/panel.js +++ b/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/index/panel.js @@ -34,22 +34,6 @@ coreshop.index.panel = Class.create(coreshop.resource.panel, { * constructor */ initialize: function () { - var proxy = new Ext.data.HttpProxy({ - url: this.url.types - }); - - var reader = new Ext.data.JsonReader({}, [ - {name: 'name'} - ]); - - this.typesStore = new Ext.data.Store({ - restful: false, - proxy: proxy, - reader: reader, - autoload: true - }); - this.typesStore.load(); - this.getConfig(); this.panels = []; @@ -87,7 +71,7 @@ coreshop.index.panel = Class.create(coreshop.resource.panel, { pimcore.globalmanager.add('coreshop_index_getters', this.getterStore); pimcore.globalmanager.add('coreshop_index_interpreters', this.interpreterStore); pimcore.globalmanager.add('coreshop_index_classes', this.classes); - pimcore.globalmanager.add('coreshop_index_fieldTypes', this.fieldTypeStore); + pimcore.globalmanager.add('coreshop_index_field_types', this.fieldTypeStore); Ext.Ajax.request({ url: this.url.config, diff --git a/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/resource.js b/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/resource.js index 0d7297ec06..ebc7e53c5b 100644 --- a/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/resource.js +++ b/src/CoreShop/Bundle/IndexBundle/Resources/public/pimcore/js/resource.js @@ -15,10 +15,11 @@ coreshop.index.resource = Class.create(coreshop.resource, { initialize: function () { coreshop.global.addStore('coreshop_indexes', 'coreshop/indices'); coreshop.global.addStore('coreshop_filters', 'coreshop/filters'); + coreshop.global.addStoreWithUrl('coreshop_index_types', '/admin/coreshop/indices/get-types'); coreshop.broker.fireEvent('resource.register', 'coreshop.index', this); }, - + openResource: function(item) { if (item === 'index') { this.openIndex(); @@ -26,7 +27,7 @@ coreshop.index.resource = Class.create(coreshop.resource, { this.openFilter(); } }, - + openIndex: function() { try { pimcore.globalmanager.get('coreshop_indexes_panel').activate(); @@ -35,7 +36,7 @@ coreshop.index.resource = Class.create(coreshop.resource, { pimcore.globalmanager.add('coreshop_indexes_panel', new coreshop.index.panel()); } }, - + openFilter: function() { try { pimcore.globalmanager.get('coreshop_filters_panel').activate(); @@ -48,4 +49,4 @@ coreshop.index.resource = Class.create(coreshop.resource, { coreshop.broker.addListener('pimcore.ready', function() { new coreshop.index.resource(); -}); \ No newline at end of file +}); diff --git a/src/CoreShop/Bundle/OrderBundle/Resources/public/pimcore/js/sale/create/step/payment.js b/src/CoreShop/Bundle/OrderBundle/Resources/public/pimcore/js/sale/create/step/payment.js index a842327d27..cc547cb07b 100644 --- a/src/CoreShop/Bundle/OrderBundle/Resources/public/pimcore/js/sale/create/step/payment.js +++ b/src/CoreShop/Bundle/OrderBundle/Resources/public/pimcore/js/sale/create/step/payment.js @@ -38,7 +38,9 @@ coreshop.order.sale.create.step.payment = Class.create(coreshop.order.sale.creat editable: false, mode: 'local', listWidth: 100, - store: pimcore.globalmanager.get('coreshop_payment_provider'), + store: { + type: 'coreshop_payment_provider' + }, displayField: 'identifier', valueField: 'id', triggerAction: 'all', @@ -65,4 +67,4 @@ coreshop.order.sale.create.step.payment = Class.create(coreshop.order.sale.creat getIconCls: function() { return 'coreshop_icon_payment_provider'; } -}); \ No newline at end of file +}); diff --git a/src/CoreShop/Bundle/ResourceBundle/Resources/public/pimcore/js/global.js b/src/CoreShop/Bundle/ResourceBundle/Resources/public/pimcore/js/global.js index f9053fd35f..392824f922 100644 --- a/src/CoreShop/Bundle/ResourceBundle/Resources/public/pimcore/js/global.js +++ b/src/CoreShop/Bundle/ResourceBundle/Resources/public/pimcore/js/global.js @@ -15,10 +15,10 @@ coreshop.global = { resource: null, addStore: function (name, url, fields, sorters) { - var proxy = new Ext.data.HttpProxy({ - url: '/admin/' + url + '/list' - }); + return this.addStoreWithUrl(name, '/admin/' + url + '/list', fields, sorters); + }, + addStoreWithUrl: function(name, url, fields, sorters) { if (!fields) { fields = [ {name: 'id'}, @@ -26,21 +26,31 @@ coreshop.global = { ]; } - var reader = new Ext.data.JsonReader({}, fields); - - var store = new Ext.data.Store({ - restful: false, - proxy: proxy, - reader: reader, - autoload: true, - fields: fields, - sorters: sorters ? sorters : [], - remoteSort: false, - remoteFilter: false + if (Ext.isDefined('Ext.CoreShop.Store.' + name)) { + Ext.define('Ext.CoreShop.Store.' + name, { + extend: 'Ext.data.Store', + alias: 'store.' + name, + proxy: { + type: 'ajax', + url: url, + reader: { + type: 'json', + } + }, + fields: fields, + autoLoad: true, + sorters: sorters ? sorters : [], + remoteSort: false, + remoteFilter: false + }); + } + + var store = new Ext.CoreShop.Store[name]({ + autoLoad: false }); pimcore.globalmanager.add(name, store); - } + }, }; diff --git a/src/CoreShop/Bundle/ResourceBundle/Resources/public/pimcore/js/resource/comboBox.js b/src/CoreShop/Bundle/ResourceBundle/Resources/public/pimcore/js/resource/comboBox.js index be0482263c..d43df82b39 100644 --- a/src/CoreShop/Bundle/ResourceBundle/Resources/public/pimcore/js/resource/comboBox.js +++ b/src/CoreShop/Bundle/ResourceBundle/Resources/public/pimcore/js/resource/comboBox.js @@ -10,19 +10,4 @@ Ext.define('CoreShop.resource.ComboBox', { forceSelection: true, triggerAction: 'all', queryMode: 'local', - - config: { - storeId: null - }, - - initComponent: function() { - this.callParent(); - - if (this.getStoreId()) { - this.setStore(pimcore.globalmanager.get(this.getStoreId())); - } - else { - this.setStore(coreshop.deepCloneStore(this.getStore())); - } - } -}); \ No newline at end of file +}); diff --git a/src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/carrier/item.js b/src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/carrier/item.js index 20a3bd86e6..20402d5ccf 100644 --- a/src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/carrier/item.js +++ b/src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/carrier/item.js @@ -25,7 +25,9 @@ coreshop.carrier.item = Class.create(coreshop.resource.item, { this.panelKey = panelKey; this.type = type; - pimcore.globalmanager.get('coreshop_carrier_shipping_rules').load(function () { + var store = Ext.create('store.coreshop_carrier_shipping_rules'); + + store.load(function () { this.initPanel(); }.bind(this)); }, @@ -137,6 +139,9 @@ coreshop.carrier.item = Class.create(coreshop.resource.item, { data: this.data.shippingRules }); + var store = Ext.create('store.coreshop_carrier_shipping_rules'); + store.load(); + this.shippingRuleGroupsGrid = Ext.create('Ext.grid.Panel', { store: this.shippingRuleGroupsStore, columns: [ @@ -145,14 +150,13 @@ coreshop.carrier.item = Class.create(coreshop.resource.item, { flex: 2, dataIndex: 'shippingRule', editor: new Ext.form.ComboBox({ - store: pimcore.globalmanager.get('coreshop_carrier_shipping_rules'), + store: store, valueField: 'id', displayField: 'name', queryMode: 'local', required: true }), renderer: function (shippingRule) { - var store = pimcore.globalmanager.get('coreshop_carrier_shipping_rules'); var pos = store.findExact('id', shippingRule); if (pos >= 0) { return store.getAt(pos).get('name'); diff --git a/src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/resource.js b/src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/resource.js index 6bd7c62c01..f8d5a2e614 100644 --- a/src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/resource.js +++ b/src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/resource.js @@ -21,9 +21,6 @@ coreshop.shipping.resource = Class.create(coreshop.resource, { ]); coreshop.global.addStore('coreshop_carrier_shipping_rules', 'coreshop/shipping_rules'); - pimcore.globalmanager.get('coreshop_carriers').load(); - pimcore.globalmanager.get('coreshop_carrier_shipping_rules').load(); - coreshop.broker.fireEvent('resource.register', 'coreshop.shipping', this); }, @@ -56,4 +53,4 @@ coreshop.shipping.resource = Class.create(coreshop.resource, { coreshop.broker.addListener('pimcore.ready', function() { new coreshop.shipping.resource(); -}); \ No newline at end of file +}); diff --git a/src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/shippingrule/actions/shippingRule.js b/src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/shippingrule/actions/shippingRule.js index 1873881193..202007dc79 100644 --- a/src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/shippingrule/actions/shippingRule.js +++ b/src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/shippingrule/actions/shippingRule.js @@ -16,7 +16,6 @@ coreshop.shippingrule.actions.shippingRule = Class.create(coreshop.rules.actions getForm: function () { var me = this; - var store = pimcore.globalmanager.get('coreshop_carrier_shipping_rules'); var rule = { xtype: 'combo', @@ -24,7 +23,9 @@ coreshop.shippingrule.actions.shippingRule = Class.create(coreshop.rules.actions typeAhead: true, listWidth: 100, width: 500, - store: store, + store: { + type: 'coreshop_carrier_shipping_rules' + }, displayField: 'name', valueField: 'id', forceSelection: true, @@ -33,15 +34,7 @@ coreshop.shippingrule.actions.shippingRule = Class.create(coreshop.rules.actions name: 'shippingRule', maxHeight: 400, delimiter: false, - listeners: { - beforerender: function () { - if (!store.isLoaded() && !store.isLoading()) - store.load(); - - if (me.data && me.data.shippingRule) - this.setValue(me.data.shippingRule); - } - } + value: me.data.shippingRule }; if (this.data && this.data.shippingRule) { diff --git a/src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/shippingrule/conditions/shippingRule.js b/src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/shippingrule/conditions/shippingRule.js index 3ec292cc11..80d6ff8c0d 100644 --- a/src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/shippingrule/conditions/shippingRule.js +++ b/src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/shippingrule/conditions/shippingRule.js @@ -17,7 +17,7 @@ coreshop.shippingrule.conditions.shippingRule = Class.create(coreshop.rules.cond getForm: function () { var me = this; - var store = pimcore.globalmanager.get('coreshop_carrier_shipping_rules'); + var store = pimcore.globalmanager.get(''); var rule = { xtype: 'combo', @@ -25,7 +25,9 @@ coreshop.shippingrule.conditions.shippingRule = Class.create(coreshop.rules.cond typeAhead: true, listWidth: 100, width: 500, - store: store, + store: { + type: 'coreshop_carrier_shipping_rules' + }, displayField: 'name', valueField: 'id', forceSelection: true, @@ -34,15 +36,7 @@ coreshop.shippingrule.conditions.shippingRule = Class.create(coreshop.rules.cond name: 'shippingRule', maxHeight: 400, delimiter: false, - listeners: { - beforerender: function () { - if (!store.isLoaded() && !store.isLoading()) - store.load(); - - if (me.data && me.data.shippingRule) - this.setValue(me.data.shippingRule); - } - } + value: me.data.shippingRule }; if (this.data && this.data.shippingRule) { diff --git a/src/CoreShop/Bundle/StoreBundle/Resources/public/pimcore/js/resource/store.js b/src/CoreShop/Bundle/StoreBundle/Resources/public/pimcore/js/resource/store.js index 599f2a4691..7b6c163fcf 100644 --- a/src/CoreShop/Bundle/StoreBundle/Resources/public/pimcore/js/resource/store.js +++ b/src/CoreShop/Bundle/StoreBundle/Resources/public/pimcore/js/resource/store.js @@ -4,10 +4,7 @@ Ext.define('CoreShop.store.Store', { name: 'store', fieldLabel: t('coreshop_store'), - - initComponent: function () { - this.store = pimcore.globalmanager.get('coreshop_stores'); - - this.callParent(); + store: { + type: 'coreshop_stores' } -}); \ No newline at end of file +}); diff --git a/src/CoreShop/Bundle/TaxationBundle/Resources/public/pimcore/js/resource.js b/src/CoreShop/Bundle/TaxationBundle/Resources/public/pimcore/js/resource.js index 4fe7272180..1ab247b4de 100644 --- a/src/CoreShop/Bundle/TaxationBundle/Resources/public/pimcore/js/resource.js +++ b/src/CoreShop/Bundle/TaxationBundle/Resources/public/pimcore/js/resource.js @@ -19,8 +19,7 @@ coreshop.taxation.resource = Class.create(coreshop.resource, { {name: 'rate'} ]); coreshop.global.addStore('coreshop_taxrulegroups', 'coreshop/tax_rule_groups'); - - pimcore.globalmanager.get('coreshop_tax_rates').load(); + coreshop.global.addStore('coreshop_tax_rule_groups', 'coreshop/tax_rule_groups'); coreshop.broker.fireEvent('resource.register', 'coreshop.taxation', this); }, @@ -54,4 +53,4 @@ coreshop.taxation.resource = Class.create(coreshop.resource, { coreshop.broker.addListener('pimcore.ready', function() { new coreshop.taxation.resource(); -}); \ No newline at end of file +}); diff --git a/src/CoreShop/Bundle/TaxationBundle/Resources/public/pimcore/js/resource/taxRate.js b/src/CoreShop/Bundle/TaxationBundle/Resources/public/pimcore/js/resource/taxRate.js index c2c065d0bb..53b5cd6966 100644 --- a/src/CoreShop/Bundle/TaxationBundle/Resources/public/pimcore/js/resource/taxRate.js +++ b/src/CoreShop/Bundle/TaxationBundle/Resources/public/pimcore/js/resource/taxRate.js @@ -4,10 +4,7 @@ Ext.define('CoreShop.store.TaxRate', { name: 'taxRate', fieldLabel: t('coreshop_tax_rate'), - - initComponent: function () { - this.store = pimcore.globalmanager.get('coreshop_tax_rates'); - - this.callParent(); + store: { + type: 'coreshop_tax_rates' } -}); \ No newline at end of file +}); diff --git a/src/CoreShop/Bundle/TaxationBundle/Resources/public/pimcore/js/resource/taxRuleGroup.js b/src/CoreShop/Bundle/TaxationBundle/Resources/public/pimcore/js/resource/taxRuleGroup.js index 732d74f427..4d35bb4ba6 100644 --- a/src/CoreShop/Bundle/TaxationBundle/Resources/public/pimcore/js/resource/taxRuleGroup.js +++ b/src/CoreShop/Bundle/TaxationBundle/Resources/public/pimcore/js/resource/taxRuleGroup.js @@ -5,16 +5,13 @@ Ext.define('CoreShop.store.TaxRuleGroup', { name: 'taxRule', storeId: 'coreshop_taxrulegroups', fieldLabel: t('coreshop_tax_rule_group'), + store: { + type: 'coreshop_tax_rule_groups' + }, listeners: { beforerender: function () { if (!this.getStore().isLoaded() && !this.getStore().isLoading()) this.getStore().load(); } - }, - - initComponent: function () { - this.store = pimcore.globalmanager.get('coreshop_tax_rule_group'); - - this.callParent(); } -}); \ No newline at end of file +}); diff --git a/src/CoreShop/Bundle/TaxationBundle/Resources/public/pimcore/js/taxrulegroup/item.js b/src/CoreShop/Bundle/TaxationBundle/Resources/public/pimcore/js/taxrulegroup/item.js index f8c2057a36..27d34fd0de 100644 --- a/src/CoreShop/Bundle/TaxationBundle/Resources/public/pimcore/js/taxrulegroup/item.js +++ b/src/CoreShop/Bundle/TaxationBundle/Resources/public/pimcore/js/taxrulegroup/item.js @@ -93,19 +93,22 @@ coreshop.taxrulegroup.item = Class.create(coreshop.resource.item, { data: this.data.taxRules }); + var taxRatesStore = Ext.create('store.coreshop_tax_rates'); + taxRatesStore.load(); + var gridColumns = [ { header: t('coreshop_tax'), width: 200, dataIndex: 'taxRate', editor: new Ext.form.ComboBox({ - store: pimcore.globalmanager.get('coreshop_tax_rates'), + store: taxRatesStore, valueField: 'id', displayField: 'name', queryMode: 'local' }), renderer: function (taxRate) { - var record = pimcore.globalmanager.get('coreshop_tax_rates').getById(taxRate); + var record = taxRatesStore.getById(taxRate); if (record) { return record.get('name');