Merge pull request '1988-autocomplete_autoload' (#381) from 1988-autocomplete_prefetch into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #381
Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
Carlos Jimenez Ruiz 2020-09-21 09:58:20 +00:00
commit 6e3acfaa29
28 changed files with 254 additions and 51 deletions

View File

@ -276,7 +276,7 @@ export default {
relevancy: 'vn-item-basic-data vn-input-number[ng-model="$ctrl.item.relevancy"]',
origin: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]',
compression: 'vn-item-basic-data vn-input-number[ng-model="$ctrl.item.compression"]',
isFragile: 'vn-check[label="isFragile"]',
isFragile: 'vn-check[ng-model="$ctrl.item.isFragile"]',
longName: 'vn-textfield[ng-model="$ctrl.item.longName"]',
isActiveCheckbox: 'vn-check[label="Active"]',
priceInKgCheckbox: 'vn-check[label="Price in kg"]',

View File

@ -45,6 +45,7 @@ describe('Client balance path', () => {
});
it('should create a new payment that clears the debt', async() => {
await page.closePopup();
await page.waitToClick(selectors.clientBalance.newPaymentButton);
await page.autocompleteSearch(selectors.clientBalance.newPaymentBank, 'Pay on receipt');
await page.waitToClick(selectors.clientBalance.saveButton);

View File

@ -113,7 +113,7 @@ describe('Item Edit basic data path', () => {
const result = await page
.checkboxState(selectors.itemBasicData.isFragile);
expect(result).toBe('unchecked');
expect(result).toBe('checked');
});
it('should confirm isActive checkbox is unchecked', async() => {

View File

@ -7,7 +7,8 @@
auto-save="true"
on-save="$ctrl.onSave()">
</vn-crud-model>
<vn-crud-model auto-load="true"
<vn-crud-model
auto-load="true"
url="ClaimDestinations"
data="claimDestinations">
</vn-crud-model>

View File

@ -5,6 +5,11 @@
url="Claims/{{$ctrl.$params.id}}/updateClaim"
save="post">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="ClaimStates"
data="claimStates">
</vn-crud-model>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
@ -36,7 +41,7 @@
<vn-autocomplete
vn-one
ng-model="$ctrl.claim.claimStateFk"
url="ClaimStates"
data="claimStates"
show-field="description"
value-field="id"
label="Claim state"

View File

@ -8,12 +8,22 @@
form="form">
</vn-watcher>
<vn-crud-model
vn-id="model"
url="AddressObservations"
fields="['id', 'addressFk', 'observationTypeFk', 'description']"
link="{addressFk: $ctrl.$params.addressId}"
data="observations"
auto-load="true">
auto-load="true"
url="Provinces/location"
data="provincesLocation"
order="id">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="Incoterms"
data="incoterms"
order="name">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="CustomsAgents"
data="customsAgents"
order="fiscalName">
</vn-crud-model>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
@ -79,7 +89,7 @@
<vn-autocomplete vn-id="province" vn-one
label="Province"
ng-model="$ctrl.address.provinceId"
url="Provinces/location"
data="provincesLocation"
fields="['id', 'name', 'countryFk']"
show-field="name"
value-field="id"
@ -112,14 +122,14 @@
<vn-horizontal>
<vn-autocomplete vn-one
ng-model="$ctrl.address.incotermsId"
url="Incoterms"
data="incoterms"
show-field="name"
value-field="code"
label="Incoterms">
</vn-autocomplete>
<vn-autocomplete vn-one
ng-model="$ctrl.address.customsAgentId"
url="CustomsAgents"
data="customsAgents"
show-field="fiscalName"
value-field="id"
label="Customs agent">

View File

@ -2,13 +2,19 @@
New payment
</tpl-title>
<tpl-body>
<vn-crud-model
auto-load="true"
url="Companies"
data="companies"
order="code">
</vn-crud-model>
<vn-horizontal>
<vn-date-picker
label="Date"
ng-model="$ctrl.receipt.payed">
</vn-date-picker>
<vn-autocomplete
url="Companies"
data="companies"
label="Company"
show-field="code"
value-field="id"
@ -23,10 +29,10 @@
value-field="id"
fields="['accountingTypeFk']"
include="{relation: 'accountingType'}"
order="id"
ng-model="$ctrl.receipt.bankFk"
search-function="{or: [{id: $search}, {bank: {like: '%'+ $search +'%'}}]}"
selection="$ctrl.bankSelection">
selection="$ctrl.bankSelection"
order="id">
<tpl-item>{{id}}: {{bank}}</tpl-item>
</vn-autocomplete>
<vn-input-number

View File

@ -10,13 +10,19 @@
filter="$ctrl.filter"
data="$ctrl.clientRisks">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="Companies"
data="companies"
order="code">
</vn-crud-model>
<vn-side-menu side="right">
<div class="vn-pa-md">
<vn-autocomplete
vn-one
vn-id="company"
ng-model="$ctrl.companyId"
url="Companies"
data="companies"
show-field="code"
value-field="id"
label="Company">

View File

@ -5,6 +5,11 @@
form="form"
save="patch">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="ContactChannels"
data="contactChannels">
</vn-crud-model>
<form name="form" vn-http-submit="watcher.submit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
@ -60,7 +65,7 @@
<vn-autocomplete
vn-one
ng-model="$ctrl.client.contactChannelFk"
url="ContactChannels"
data="contactChannels"
label="Channel">
</vn-autocomplete>
</vn-horizontal>

View File

@ -5,6 +5,11 @@
form="form"
save="patch">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="PayMethods"
data="paymethods">
</vn-crud-model>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
@ -13,7 +18,7 @@
label="Billing data"
vn-acl="salesAssistant"
ng-model="$ctrl.client.payMethodFk"
url="PayMethods"
data="paymethods"
fields="['ibanRequired']"
initial-data="$ctrl.client.payMethod">
</vn-autocomplete>

View File

@ -5,6 +5,12 @@
form="form"
save="post">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="Towns/location"
data="townLocations"
order="name">
</vn-crud-model>
<form name="form" vn-http-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
@ -77,7 +83,7 @@
label="City"
ng-model="$ctrl.client.city"
selection="$ctrl.town"
url="Towns/location"
data="townsLocation"
fields="['id', 'name', 'provinceFk']"
show-field="name"
value-field="name">

View File

@ -3,6 +3,24 @@
vn-id="watcher"
data="$ctrl.dms">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="Companies"
data="companies"
order="code">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="Warehouses"
data="warehouses"
order="name">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="DmsTypes"
data="dmsTypes"
order="name">
</vn-crud-model>
<form
name="form"
ng-submit="$ctrl.onSubmit()"
@ -21,7 +39,7 @@
<vn-autocomplete vn-one
label="Company"
ng-model="$ctrl.dms.companyId"
url="Companies"
data="companies"
show-field="code"
value-field="id">
</vn-autocomplete>
@ -30,14 +48,14 @@
<vn-autocomplete vn-one
label="Warehouse"
ng-model="$ctrl.dms.warehouseId"
url="Warehouses"
data="warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete vn-one
label="Type"
ng-model="$ctrl.dms.dmsTypeId"
url="DmsTypes"
data="dmsTypes"
show-field="name"
value-field="id">
</vn-autocomplete>

View File

@ -6,6 +6,18 @@
form="form"
save="patch">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="Provinces/location"
data="provincesLocation"
order="name">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="Countries"
data="countries"
order="country">
</vn-crud-model>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
@ -76,7 +88,7 @@
label="Province"
ng-model="$ctrl.client.provinceFk"
selection="$ctrl.province"
url="Provinces/location"
data="provincesLocation"
fields="['id', 'name', 'countryFk']"
show-field="name"
value-field="id"
@ -85,7 +97,7 @@
</vn-autocomplete>
<vn-autocomplete vn-id="country" vn-one
ng-model="$ctrl.client.countryFk"
url="Countries"
data="countries"
show-field="country"
value-field="id"
label="Country"

View File

@ -5,6 +5,11 @@
form="form"
save="post">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="greugeTypes"
data="greugeTypes">
</vn-crud-model>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
@ -32,7 +37,7 @@
<vn-autocomplete
vn-one
ng-model="$ctrl.greuge.greugeTypeFk"
url="greugeTypes"
data="greugeTypes"
label="Type"
rule>
</vn-autocomplete>

View File

@ -4,6 +4,12 @@
data="companiesData"
order="code">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="Samples/visible"
data="samplesVisible"
order="description">
</vn-crud-model>
<vn-watcher
vn-id="watcher"
data="$ctrl.clientSample"
@ -24,7 +30,7 @@
ng-model="$ctrl.clientSample.typeFk"
model="ClientSample.typeFk"
fields="['code','hasCompany', 'hasPreview']"
url="Samples/visible"
data="samplesVisible"
show-field="description"
value-field="id"
label="Sample">

View File

@ -9,6 +9,13 @@
form="form"
save="patch">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="Origins"
data="originsData"
order="name"
vn-id="origin-model">
</vn-crud-model>
<form name="form" ng-submit="watcher.submit()" ng-cloak class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
@ -64,7 +71,13 @@
</append>
</vn-autocomplete>
<vn-autocomplete vn-one
url="Origins"
url="Expenses"
label="Expense"
ng-model="$ctrl.item.expenseFk"
initial-data="$ctrl.item.expense">
</vn-autocomplete>
<vn-autocomplete vn-one
data="originsData"
label="Origin"
show-field="name"
value-field="id"

View File

@ -5,6 +5,13 @@
form="form"
save="post">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="Origins"
data="originsData"
order="name"
vn-id="origin-model">
</vn-crud-model>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
@ -49,7 +56,7 @@
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
url="Origins"
data="originsData"
label="Origin"
show-field="name"
value-field="id"

View File

@ -5,13 +5,20 @@
data="sales"
auto-load="false">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="Warehouses"
data="warehouses"
order="name"
vn-id="warehouse-model">
</vn-crud-model>
<vn-vertical>
<vn-card class="vn-pa-lg vn-w-lg">
<vn-vertical>
<vn-horizontal>
<vn-autocomplete
vn-focus
url="Warehouses"
data="warehouses"
show-field="name"
value-field="id"
initial-data="$ctrl.warehouseFk"

View File

@ -11,16 +11,23 @@
data="niches"
form="form">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="Warehouses"
data="warehouses"
order="name"
vn-id="warehouse-model">
</vn-crud-model>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal ng-repeat="niche in niches track by $index">
<vn-autocomplete
url="Warehouses"
<vn-autocomplete vn-one vn-focus
data="warehouses"
label="Warehouse"
show-field="name"
value-field="id"
ng-model="niche.warehouseFk"
label="Warehouse"
vn-acl="buyer,replenisher" vn-one vn-focus>
vn-acl="buyer,replenisher">
</vn-autocomplete>
<vn-textfield
vn-three

View File

@ -1,10 +1,10 @@
<mg-ajax path="Orders/{{patch.params.id}}/updateBasicData" options="vnPatch"></mg-ajax>
<vn-crud-model
vn-id="address-model"
autoload="true"
url="Addresses"
data="address"
order="nickname"
autoload = "false">
vn-id="address-model">
</vn-crud-model>
<vn-watcher
vn-id="watcher"

View File

@ -1,3 +1,9 @@
<vn-crud-model
auto-load="true"
url="Warehouses"
data="warehouses"
order="name">
</vn-crud-model>
<vn-autocomplete vn-focus
vn-id="client"
url="Clients"
@ -26,7 +32,7 @@
<vn-autocomplete
disabled="!$ctrl.warehouseId && (!$ctrl.clientId || !$ctrl.landed)"
ng-model="$ctrl.warehouseId"
url="Warehouses"
data="warehouses"
show-field="name"
value-field="id"
label="Warehouse">

View File

@ -2,6 +2,24 @@
vn-id="watcher"
data="$ctrl.dms">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="Companies"
data="companies"
order="code">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="Warehouses"
data="warehouses"
order="name">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="DmsTypes"
data="dmsTypes"
order="name">
</vn-crud-model>
<form
name="form"
ng-submit="$ctrl.onSubmit()"
@ -20,7 +38,7 @@
<vn-autocomplete vn-one
label="Company"
ng-model="$ctrl.dms.companyId"
url="Companies"
data="companies"
show-field="code"
value-field="id">
</vn-autocomplete>
@ -29,14 +47,14 @@
<vn-autocomplete vn-one
label="Warehouse"
ng-model="$ctrl.dms.warehouseId"
url="Warehouses"
data="warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete vn-one
label="Type"
ng-model="$ctrl.dms.dmsTypeId"
url="DmsTypes"
data="dmsTypes"
show-field="name"
value-field="id">
</vn-autocomplete>

View File

@ -5,6 +5,18 @@
data="$ctrl.services"
auto-load="true">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="TicketServiceTypes"
data="ticketServiceTypes"
order="name">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="TaxClasses"
data="taxClasses"
order="description">
</vn-crud-model>
<vn-watcher
vn-id="watcher"
data="$ctrl.services">
@ -13,7 +25,7 @@
<vn-card class="vn-pa-lg">
<vn-horizontal ng-repeat="service in $ctrl.services track by $index">
<vn-autocomplete vn-two vn-focus
url="TicketServiceTypes"
data="ticketServiceTypes"
label="Description"
show-field="name"
value-field="id"
@ -42,7 +54,7 @@
step="0.01">
</vn-input-number>
<vn-autocomplete vn-one
url="TaxClasses"
data="taxClasses"
label="Tax class"
show-field="description"
value-field="id"

View File

@ -4,13 +4,18 @@
data="$ctrl.params"
form="form">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="States"
data="states">
</vn-crud-model>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-autocomplete
vn-one
ng-model="$ctrl.stateFk"
url="States"
data="states"
label="State"
vn-focus>
</vn-autocomplete>

View File

@ -5,6 +5,12 @@
form="form"
save="patch">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="Warehouses"
data="warehouses"
order="name">
</vn-crud-model>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
@ -38,7 +44,7 @@
<vn-autocomplete
vn-one
ng-model="$ctrl.travel.warehouseOutFk"
url="Warehouses"
data="warehouses"
show-field="name"
value-field="id"
label="Warehouse Out">
@ -46,7 +52,7 @@
<vn-autocomplete
vn-one
ng-model="$ctrl.travel.warehouseInFk"
url="Warehouses"
data="warehouses"
show-field="name"
value-field="id"
label="Warehouse In">

View File

@ -2,6 +2,24 @@
vn-id="watcher"
data="$ctrl.dms">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="DmsTypes"
data="dmsTypes"
order="name">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="Companies"
data="companies"
order="code">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="Warehouses"
data="warehouses"
order="name">
</vn-crud-model>
<form
name="form"
ng-submit="$ctrl.onSubmit()"
@ -45,7 +63,7 @@
<vn-autocomplete vn-one
label="Type"
ng-model="$ctrl.dms.dmsTypeId"
url="DmsTypes"
data="dmsTypes"
show-field="name"
value-field="id">
</vn-autocomplete>
@ -54,14 +72,14 @@
<vn-autocomplete vn-one
label="Company"
ng-model="$ctrl.dms.companyId"
url="Companies"
data="companies"
show-field="code"
value-field="id">
</vn-autocomplete>
<vn-autocomplete vn-one
label="Warehouse"
ng-model="$ctrl.dms.warehouseId"
url="Warehouses"
data="warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>

View File

@ -5,6 +5,18 @@
form="form"
save="post">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="Warehouses"
data="warehouses"
order="name">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="AgencyModes/isActive"
data="activeAgencyModes"
order="name">
</vn-crud-model>
<form
name="form"
vn-http-submit="$ctrl.onSubmit()"
@ -23,7 +35,7 @@
<vn-autocomplete
vn-one
ng-model="$ctrl.zone.warehouseFk"
url="Warehouses"
data="warehouses"
show-field="name"
value-field="id"
label="Warehouse"
@ -32,7 +44,7 @@
<vn-autocomplete
vn-one
ng-model="$ctrl.zone.agencyModeFk"
url="AgencyModes/isActive"
data="activeAgencyModes"
show-field="name"
value-field="id"
label="Agency"

View File

@ -26,13 +26,19 @@
ng-click="$ctrl.onCreate()"
fixed-bottom-right>
</vn-float-button>
<vn-crud-model
auto-load="true"
url="Warehouses"
data="warehouses"
order="name">
</vn-crud-model>
<vn-dialog
vn-id="dialog"
on-accept="$ctrl.onSave()">
<tpl-body>
<vn-autocomplete
ng-model="$ctrl.selected.warehouseFk"
url="Warehouses"
data="warehouses"
show-field="name"
value-field="id"
label="Warehouse">