autoload en componente table #876
This commit is contained in:
parent
97ba5ae190
commit
d7c567c661
|
@ -1,4 +1,4 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model auto-load="false"
|
||||
vn-id="model"
|
||||
url="claim/api/ClaimEnds"
|
||||
filter="$ctrl.filter"
|
||||
|
@ -152,7 +152,7 @@
|
|||
<!-- Transfer Popover -->
|
||||
<vn-popover class="lastTicketsPopover" vn-id="lastTicketsPopover">
|
||||
<div class="ticketList" pad-medium>
|
||||
<vn-table model="lastTicketsModel" class="vn-grid">
|
||||
<vn-table model="lastTicketsModel" auto-load="false" class="vn-grid">
|
||||
<vn-thead>
|
||||
<vn-tr>
|
||||
<vn-th field="id" number>ID</vn-th>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model auto-load="false"
|
||||
vn-id="model"
|
||||
url="claim/api/ClaimBeginnings"
|
||||
filter="$ctrl.filter"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
url="/client/api/CreditInsurances"
|
||||
link="{creditClassification: $ctrl.$stateParams.classificationId}"
|
||||
limit="20"
|
||||
data="insurances">
|
||||
data="insurances" auto-load="false">
|
||||
</vn-crud-model>
|
||||
|
||||
<vn-vertical>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
filter="::$ctrl.filter"
|
||||
link="{clientFk: $ctrl.$stateParams.id}"
|
||||
limit="20"
|
||||
data="credits">
|
||||
data="credits" auto-load="false">
|
||||
</vn-crud-model>
|
||||
|
||||
<vn-vertical>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
filter="::$ctrl.filter"
|
||||
link="{clientFk: $ctrl.$stateParams.id}"
|
||||
limit="20"
|
||||
data="greuges">
|
||||
data="greuges" auto-load="false">
|
||||
</vn-crud-model>
|
||||
|
||||
<mg-ajax
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
link="{originFk: $ctrl.$stateParams.id}"
|
||||
filter="$ctrl.filter"
|
||||
limit="20"
|
||||
data="$ctrl.logs">
|
||||
data="$ctrl.logs" auto-load="false">
|
||||
</vn-crud-model>
|
||||
|
||||
<vn-log model="model"></vn-log>
|
|
@ -4,7 +4,7 @@
|
|||
filter="::$ctrl.filter"
|
||||
link="{clientFk: $ctrl.$stateParams.id}"
|
||||
limit="20"
|
||||
data="mandates">
|
||||
data="mandates" auto-load="false">
|
||||
</vn-crud-model>
|
||||
|
||||
<vn-vertical>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
filter="{}"
|
||||
link="{clientFk: $ctrl.$stateParams.id}"
|
||||
limit="20"
|
||||
data="recoveries">
|
||||
data="recoveries" auto-load="false">
|
||||
</vn-crud-model>
|
||||
|
||||
<vn-vertical>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
url="/client/api/receipts/filter"
|
||||
params="$ctrl.params"
|
||||
limit="20"
|
||||
data="$ctrl.risks">
|
||||
data="$ctrl.risks" auto-load="false">
|
||||
</vn-crud-model>
|
||||
<vn-crud-model
|
||||
vn-id="riskModel"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
filter="::$ctrl.filter"
|
||||
link="{clientFk: $ctrl.$stateParams.id}"
|
||||
limit="20"
|
||||
data="samples">
|
||||
data="samples" auto-load="false">
|
||||
</vn-crud-model>
|
||||
|
||||
<vn-vertical>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
url="/client/api/clients/getTransactions"
|
||||
link="{clientFk: $ctrl.$stateParams.id}"
|
||||
limit="20"
|
||||
data="transactions">
|
||||
data="transactions" auto-load="false">
|
||||
</vn-crud-model>
|
||||
|
||||
<vn-vertical>
|
||||
|
|
|
@ -7,6 +7,7 @@ export default class Table {
|
|||
this.table = $element[0];
|
||||
this.field = null;
|
||||
this.order = null;
|
||||
this.autoLoad = true;
|
||||
|
||||
$transclude($scope.$parent, clone => {
|
||||
angular.element($element[0].querySelector('div')).append(clone);
|
||||
|
@ -19,15 +20,16 @@ export default class Table {
|
|||
}
|
||||
|
||||
applyOrder(field = this.field, order = this.order) {
|
||||
if (!field) return;
|
||||
if (field && order) {
|
||||
this.model.order = `${field} ${order}`;
|
||||
this.setActiveArrow();
|
||||
}
|
||||
|
||||
this.model.order = `${field} ${order}`;
|
||||
this.model.refresh();
|
||||
this.setActiveArrow();
|
||||
}
|
||||
|
||||
$onChanges() {
|
||||
if (this.model && this.model.autoLoad)
|
||||
if (this.model && this.autoLoad)
|
||||
this.applyOrder();
|
||||
}
|
||||
|
||||
|
@ -50,6 +52,7 @@ ngModule.component('vnTable', {
|
|||
transclude: true,
|
||||
controller: Table,
|
||||
bindings: {
|
||||
model: '<?'
|
||||
model: '<?',
|
||||
autoLoad: '<?'
|
||||
}
|
||||
});
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
vn-id="model"
|
||||
url="item/api/Items/getDiary"
|
||||
filter="$ctrl.filter"
|
||||
data="sales">
|
||||
data="sales" auto-load="false">
|
||||
</vn-crud-model>
|
||||
<vn-vertical>
|
||||
<vn-card pad-large>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
filter="::$ctrl.filter"
|
||||
link="{originFk: $ctrl.$stateParams.id}"
|
||||
limit="20"
|
||||
data="logs">
|
||||
data="logs" auto-load="false">
|
||||
</vn-crud-model>
|
||||
|
||||
<vn-vertical>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
vn-id="model"
|
||||
url="/item/api/Items/getLastEntries"
|
||||
filter="::$ctrl.filter"
|
||||
data="entries">
|
||||
data="entries" auto-load="false">
|
||||
</vn-crud-model>
|
||||
<vn-vertical>
|
||||
<vn-card pad-large>
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
url="/order/api/Orders"
|
||||
filter="::$ctrl.filter"
|
||||
limit="20"
|
||||
data="orders">
|
||||
data="orders" auto-load="false">
|
||||
</vn-crud-model>
|
||||
<div margin-medium>
|
||||
<div class="vn-list">
|
||||
<vn-card pad-medium-h>
|
||||
<vn-searchbar
|
||||
<vn-searchbar auto-load="false"
|
||||
panel="vn-order-search-panel"
|
||||
model="model"
|
||||
expr-builder="$ctrl.exprBuilder(param, value)"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<strong>{{$ctrl.order.total | currency:'€':2}}</strong>
|
||||
</div>
|
||||
</vn-horizontal>
|
||||
<vn-table model="model">
|
||||
<vn-table>
|
||||
<vn-thead>
|
||||
<vn-tr>
|
||||
<vn-th style="text-align: center">Item</vn-th>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model auto-load="false"
|
||||
vn-id="model"
|
||||
url="/order/api/OrderRows"
|
||||
filter="::$ctrl.filter"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model auto-load="false"
|
||||
vn-id="model"
|
||||
url="/ticket/api/Sales"
|
||||
link="{ticketFk: $ctrl.$stateParams.id}"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model auto-load="false"
|
||||
vn-id="model"
|
||||
url="/ticket/api/Expeditions/filter"
|
||||
link="{ticketFk: $ctrl.$stateParams.id}"
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model auto-load="false"
|
||||
vn-id="model"
|
||||
url="/ticket/api/Tickets/filter"
|
||||
limit="20"
|
||||
data="tickets"
|
||||
order="shipped DESC"
|
||||
auto-load="false">
|
||||
order="shipped DESC">
|
||||
</vn-crud-model>
|
||||
<div margin-medium>
|
||||
<div class="vn-list">
|
||||
|
@ -30,7 +29,7 @@
|
|||
</vn-card>
|
||||
</div>
|
||||
<vn-card margin-medium-v pad-medium>
|
||||
<vn-table model="model">
|
||||
<vn-table model="model" auto-load="false">
|
||||
<vn-thead>
|
||||
<vn-tr>
|
||||
<vn-th></vn-th>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model auto-load="false"
|
||||
vn-id="model"
|
||||
url="/ticket/api/TicketLogs"
|
||||
link="{originFk: $ctrl.$stateParams.id}"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model
|
||||
vn-id="model"
|
||||
url="/ticket/api/TicketPackagings"
|
||||
fields="['id', 'ticketFk', 'packagingFk', 'quantity', 'created']"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model auto-load="false"
|
||||
vn-id="model"
|
||||
url="/ticket/api/sales"
|
||||
link="{ticketFk: $ctrl.$stateParams.id}"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model auto-load="false"
|
||||
vn-id="model"
|
||||
url="/ticket/api/TicketRequests"
|
||||
fields="['id', 'description', 'created', 'requesterFk', 'atenderFk', 'quantity', 'price', 'saleFk', 'isOk']"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model auto-load="false"
|
||||
vn-id="model"
|
||||
url="/ticket/api/sales"
|
||||
filter="::$ctrl.filter"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model auto-load="false"
|
||||
vn-id="model"
|
||||
url="/ticket/api/SaleTrackings/listSaleTracking"
|
||||
link="{ticketFk: $ctrl.$stateParams.id}"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model auto-load="false"
|
||||
vn-id="model"
|
||||
url="/api/Tickets/{{$ctrl.$stateParams.id}}/getSales"
|
||||
data="$ctrl.sales">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model auto-load="false"
|
||||
vn-id="model"
|
||||
url="/ticket/api/TicketTrackings"
|
||||
filter="::$ctrl.filter"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model auto-load="false"
|
||||
vn-id="model"
|
||||
url="/ticket/api/sales"
|
||||
filter="::$ctrl.filter"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model auto-load="false"
|
||||
vn-id="model"
|
||||
url="/ticket/api/TicketWeeklies"
|
||||
filter="::$ctrl.filter"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<vn-crud-model
|
||||
<vn-crud-model auto-load="false"
|
||||
vn-id="model"
|
||||
url="/travel/api/Travels"
|
||||
filter="::$ctrl.filter"
|
||||
|
@ -18,7 +18,7 @@
|
|||
</vn-card>
|
||||
</div>
|
||||
<vn-card margin-medium-v pad-medium>
|
||||
<vn-table model="model">
|
||||
<vn-table model="model" auto-load="false">
|
||||
<vn-thead>
|
||||
<vn-tr>
|
||||
<vn-th field="id" number>Id</vn-th>
|
||||
|
|
|
@ -307,14 +307,14 @@ describe('Client lock verified data path', () => {
|
|||
expect(url.hash).toContain('fiscal-data');
|
||||
});
|
||||
|
||||
it('should confirm verified data button is disabled for salesAssistant', async () => {
|
||||
it('should confirm verified data button is enabled for salesAssistant', async () => {
|
||||
const result = await nightmare
|
||||
.wait(selectors.clientFiscalData.verifiedDataCheckboxInput)
|
||||
.evaluate(selector => {
|
||||
return document.querySelector(selector).disabled;
|
||||
}, selectors.clientFiscalData.verifiedDataCheckbox);
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
expect(result).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should now edit the social name', async () => {
|
||||
|
|
|
@ -18,5 +18,7 @@
|
|||
"Package cannot be blank": "Package cannot be blank",
|
||||
"The new quantity should be smaller than the old one": "The new quantity should be smaller than the old one",
|
||||
"The sales of this ticket can't be modified": "The sales of this ticket can't be modified",
|
||||
"Cannot check VIES and Equalization Tax": "Cannot check VIES and Equalization Tax"
|
||||
"Cannot check VIES and Equalization Tax": "Cannot check VIES and Equalization Tax",
|
||||
"Cannot check Equalization Tax in this NIF/CIF": "Cannot check Equalization Tax in this NIF/CIF",
|
||||
"You can't create an order for a frozen client": "You can't create an order for a frozen client"
|
||||
}
|
Loading…
Reference in New Issue