From 5e201419f86e158672e1cc3b861c75b7f739b268 Mon Sep 17 00:00:00 2001 From: Jorge Padawan Date: Fri, 8 Jan 2021 10:46:50 +0100 Subject: [PATCH] Second step, add component bankEntity --- modules/supplier/front/account/index.html | 2 +- modules/supplier/front/account/index.js | 7 ------- modules/supplier/front/bankentity/index.html | 6 +++--- modules/supplier/front/bankentity/index.js | 5 ++--- modules/supplier/front/bankentity/index.spec.js | 2 +- modules/supplier/front/index.js | 1 + 6 files changed, 8 insertions(+), 15 deletions(-) diff --git a/modules/supplier/front/account/index.html b/modules/supplier/front/account/index.html index 864b362286..6d391e06ae 100644 --- a/modules/supplier/front/account/index.html +++ b/modules/supplier/front/account/index.html @@ -2,7 +2,7 @@ vn-id="model" url="SupplierAccounts" fields="['id', 'supplierFk', 'iban', 'bankEntityFk']" - link="{bankEntityFk: $ctrl.$params.id}" + link="{supplierFk: $ctrl.$params.id}" include="$ctrl.include" data="$ctrl.supplierAccounts" auto-load="true"> diff --git a/modules/supplier/front/account/index.js b/modules/supplier/front/account/index.js index e72e6d0db7..069601a207 100644 --- a/modules/supplier/front/account/index.js +++ b/modules/supplier/front/account/index.js @@ -38,13 +38,6 @@ class Controller extends Section { return this.$http.patch(query, this.newBankEntity) .then(res => this.supplierAccount.bankEntityFk = res.data.id); } - - onResponse(response) { - this.supplier.postcode = response.code; - this.supplier.city = response.city; - this.supplier.provinceFk = response.provinceFk; - this.supplier.countryFk = response.countryFk; - } } ngModule.vnComponent('vnSupplierAccount', { diff --git a/modules/supplier/front/bankentity/index.html b/modules/supplier/front/bankentity/index.html index ed1691f27f..55b40f4816 100644 --- a/modules/supplier/front/bankentity/index.html +++ b/modules/supplier/front/bankentity/index.html @@ -1,5 +1,5 @@ @@ -9,7 +9,7 @@ @@ -35,6 +35,6 @@ - + diff --git a/modules/supplier/front/bankentity/index.js b/modules/supplier/front/bankentity/index.js index 20be668dad..babf64c115 100644 --- a/modules/supplier/front/bankentity/index.js +++ b/modules/supplier/front/bankentity/index.js @@ -4,12 +4,11 @@ import './style.scss'; class Controller extends Component { open() { - this.$.bankentityDialog.show(); + this.$.bankEntityDialog.show(); } onOpen() { this.location = {}; - this.$.bankentity.focus(); } onCountryResponse(response) { @@ -22,7 +21,7 @@ class Controller extends Component { throw new Error(`The country can't be empty`); this.$http.patch(`bankentities`, this.location).then(() => { - this.vnApp.showMessage(this.$t('The bankentity has been created. You can save the data now')); + this.vnApp.showMessage(this.$t('The bank entity has been created. You can save the data now')); this.emit('response', {$response: this.location}); }); } catch (e) { diff --git a/modules/supplier/front/bankentity/index.spec.js b/modules/supplier/front/bankentity/index.spec.js index bb5591f357..b999ab21f2 100644 --- a/modules/supplier/front/bankentity/index.spec.js +++ b/modules/supplier/front/bankentity/index.spec.js @@ -27,7 +27,7 @@ describe('Supplier', () => { controller.onAccept(); $httpBackend.flush(); - expect(controller.vnApp.showMessage).toHaveBeenCalledWith('The bankentity has been created. You can save the data now'); + expect(controller.vnApp.showMessage).toHaveBeenCalledWith('The bank entity has been created. You can save the data now'); }); }); }); diff --git a/modules/supplier/front/index.js b/modules/supplier/front/index.js index 80c49a8b45..f24fb997ef 100644 --- a/modules/supplier/front/index.js +++ b/modules/supplier/front/index.js @@ -8,6 +8,7 @@ import './search-panel'; import './summary'; import './basic-data'; import './fiscal-data'; +import './bankentity'; import './account'; import './contact'; import './log';