vnField alpha with ngModel

This commit is contained in:
Juan Ferrer 2019-10-10 00:47:29 +02:00
parent fc09d76422
commit a9d5e87078
171 changed files with 1687 additions and 1809 deletions

View File

@ -19,16 +19,9 @@ let actions = {
clearInput: function(selector, done) {
this.wait(selector)
.evaluate(selector => {
let field = document.querySelector(selector)
.closest('*[model], *[field], *[value]');
let $ctrl = field.$ctrl;
if (field.classList.contains('vn-field')) {
$ctrl.field = null;
$ctrl.$.$apply();
} else
$ctrl.value = null;
let $ctrl = document.querySelector(selector).closest('.vn-field').$ctrl;
$ctrl.field = null;
$ctrl.$.$apply();
$ctrl.input.dispatchEvent(new Event('change'));
}, selector)
.then(done)
@ -41,6 +34,7 @@ let actions = {
let doLogin = () => {
this.wait(`vn-login input[name=user]`)
.clearInput(`vn-login input[name=user]`)
.write(`vn-login input[name=user]`, userName)
.write(`vn-login input[name=password]`, 'nightmare')
.click(`vn-login input[type=submit]`)
@ -85,7 +79,7 @@ let actions = {
},
changeLanguageToEnglish: function(done) {
let langSelector = '.user-configuration vn-autocomplete[field="$ctrl.lang"]';
let langSelector = '.user-popover vn-autocomplete[ng-model="$ctrl.lang"]';
this.waitToClick('#user')
.wait(langSelector)

View File

@ -11,11 +11,11 @@ export default {
claimsButton: '.modules-menu > li[ui-sref="claim.index"]',
returnToModuleIndexButton: 'a[ui-sref="order.index"]',
userMenuButton: 'vn-topbar #user',
userLocalWarehouse: '.user-configuration vn-autocomplete[field="$ctrl.localWarehouseFk"]',
userLocalBank: '.user-configuration vn-autocomplete[field="$ctrl.localBankFk"]',
userLocalCompany: '.user-configuration vn-autocomplete[field="$ctrl.localCompanyFk"]',
userWarehouse: '.user-configuration vn-autocomplete[field="$ctrl.warehouseFk"]',
userCompany: '.user-configuration vn-autocomplete[field="$ctrl.companyFk"]',
userLocalWarehouse: '.user-popover vn-autocomplete[ng-model="$ctrl.localWarehouseFk"]',
userLocalBank: '.user-popover vn-autocomplete[ng-model="$ctrl.localBankFk"]',
userLocalCompany: '.user-popover vn-autocomplete[ng-model="$ctrl.localCompanyFk"]',
userWarehouse: '.user-popover vn-autocomplete[ng-model="$ctrl.warehouseFk"]',
userCompany: '.user-popover vn-autocomplete[ng-model="$ctrl.companyFk"]',
userConfigFirstAutocompleteClear: '#localWarehouse .icons > vn-icon[icon=clear]',
userConfigSecondAutocompleteClear: '#localBank .icons > vn-icon[icon=clear]',
userConfigThirdAutocompleteClear: '#localCompany .icons > vn-icon[icon=clear]',
@ -35,11 +35,11 @@ export default {
street: `${components.vnTextfield}[name="street"]`,
postcode: `${components.vnTextfield}[name="postcode"]`,
city: `${components.vnTextfield}[name="city"]`,
province: `vn-autocomplete[field="$ctrl.client.provinceFk"]`,
country: `vn-autocomplete[field="$ctrl.client.countryFk"]`,
province: `vn-autocomplete[ng-model="$ctrl.client.provinceFk"]`,
country: `vn-autocomplete[ng-model="$ctrl.client.countryFk"]`,
userName: `${components.vnTextfield}[name="userName"]`,
email: `${components.vnTextfield}[name="email"]`,
salesPersonAutocomplete: `vn-autocomplete[field="$ctrl.client.salesPersonFk"]`,
salesPersonAutocomplete: `vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]`,
createButton: `${components.vnSubmit}`,
cancelButton: 'vn-button[href="#!/client/index"]'
},
@ -49,13 +49,13 @@ export default {
},
clientBasicData: {
basicDataButton: 'vn-left-menu a[ui-sref="client.card.basicData"]',
nameInput: 'vn-textfield[field="$ctrl.client.name"] input',
contactInput: 'vn-textfield[field="$ctrl.client.contact"] input',
phoneInput: 'vn-textfield[field="$ctrl.client.phone"] input',
mobileInput: 'vn-textfield[field="$ctrl.client.mobile"] input',
emailInput: 'vn-textfield[field="$ctrl.client.email"] input',
salesPersonAutocomplete: 'vn-autocomplete[field="$ctrl.client.salesPersonFk"]',
channelAutocomplete: 'vn-autocomplete[field="$ctrl.client.contactChannelFk"]',
nameInput: 'vn-textfield[ng-model="$ctrl.client.name"] input',
contactInput: 'vn-textfield[ng-model="$ctrl.client.contact"] input',
phoneInput: 'vn-textfield[ng-model="$ctrl.client.phone"] input',
mobileInput: 'vn-textfield[ng-model="$ctrl.client.mobile"] input',
emailInput: 'vn-textfield[ng-model="$ctrl.client.email"] input',
salesPersonAutocomplete: 'vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
channelAutocomplete: 'vn-autocomplete[ng-model="$ctrl.client.contactChannelFk"]',
saveButton: `${components.vnSubmit}`
},
clientFiscalData: {
@ -67,8 +67,8 @@ export default {
addressInput: `${components.vnTextfield}[name="street"]`,
postcodeInput: `${components.vnTextfield}[name="postcode"]`,
cityInput: `${components.vnTextfield}[name="city"]`,
provinceAutocomplete: 'vn-autocomplete[field="$ctrl.client.provinceFk"]',
countryAutocomplete: 'vn-autocomplete[field="$ctrl.client.countryFk"]',
provinceAutocomplete: 'vn-autocomplete[ng-model="$ctrl.client.provinceFk"]',
countryAutocomplete: 'vn-autocomplete[ng-model="$ctrl.client.countryFk"]',
activeCheckbox: 'vn-check[label="Active"]',
frozenCheckbox: 'vn-check[label="Frozen"]',
invoiceByAddressCheckbox: 'vn-check[label="Invoice by address"]',
@ -79,14 +79,14 @@ export default {
saveButton: `${components.vnSubmit}`
},
clientBillingData: {
payMethodAutocomplete: 'vn-client-billing-data vn-autocomplete[field="$ctrl.client.payMethodFk"]',
payMethodAutocomplete: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.payMethodFk"]',
IBANInput: `vn-client-billing-data ${components.vnTextfield}[name="iban"]`,
dueDayInput: `vn-client-billing-data ${components.vnInputNumber}[name="dueDay"]`,
receivedCoreLCRCheckbox: 'vn-client-billing-data vn-check[label="Received LCR"]',
receivedCoreVNLCheckbox: 'vn-client-billing-data vn-check[label="Received core VNL"]',
receivedB2BVNLCheckbox: 'vn-client-billing-data vn-check[label="Received B2B VNL"]',
swiftBicAutocomplete: 'vn-client-billing-data vn-autocomplete[field="$ctrl.client.bankEntityFk"]',
clearswiftBicButton: 'vn-client-billing-data vn-autocomplete[field="$ctrl.client.bankEntityFk"] .icons > vn-icon[icon=clear]',
swiftBicAutocomplete: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.bankEntityFk"]',
clearswiftBicButton: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.bankEntityFk"] .icons > vn-icon[icon=clear]',
newBankEntityButton: 'vn-client-billing-data vn-icon-button[vn-tooltip="New bank entity"] > button',
newBankEntityName: 'vn-client-billing-data > vn-dialog vn-textfield[label="Name"] input',
newBankEntityBIC: 'vn-client-billing-data > vn-dialog vn-textfield[label="Swift / BIC"] input',
@ -102,8 +102,8 @@ export default {
streetAddressInput: `${components.vnTextfield}[name="street"]`,
postcodeInput: `${components.vnTextfield}[name="postalCode"]`,
cityInput: `${components.vnTextfield}[name="city"]`,
provinceAutocomplete: 'vn-autocomplete[field="$ctrl.address.provinceFk"]',
agencyAutocomplete: 'vn-autocomplete[field="$ctrl.address.agencyModeFk"]',
provinceAutocomplete: 'vn-autocomplete[ng-model="$ctrl.address.provinceFk"]',
agencyAutocomplete: 'vn-autocomplete[ng-model="$ctrl.address.agencyModeFk"]',
phoneInput: `${components.vnTextfield}[name="phone"]`,
mobileInput: `${components.vnTextfield}[name="mobile"]`,
defaultAddress: 'vn-client-address-index div:nth-child(1) div[name="street"]',
@ -112,10 +112,10 @@ export default {
secondEditAddress: 'vn-client-address-index div:nth-child(2) > a',
activeCheckbox: 'vn-check[label="Enabled"]',
equalizationTaxCheckbox: 'vn-client-address-edit vn-check[label="Is equalizated"]',
firstObservationTypeAutocomplete: 'vn-client-address-edit [name=observations] :nth-child(1) [field="observation.observationTypeFk"]',
firstObservationDescriptionInput: 'vn-client-address-edit [name=observations] :nth-child(1) [model="observation.description"] input',
secondObservationTypeAutocomplete: 'vn-client-address-edit [name=observations] :nth-child(2) [field="observation.observationTypeFk"]',
secondObservationDescriptionInput: 'vn-client-address-edit [name=observations] :nth-child(2) [model="observation.description"] input',
firstObservationTypeAutocomplete: 'vn-client-address-edit [name=observations] :nth-child(1) [ng-model="observation.observationTypeFk"]',
firstObservationDescriptionInput: 'vn-client-address-edit [name=observations] :nth-child(1) [ng-model="observation.description"] input',
secondObservationTypeAutocomplete: 'vn-client-address-edit [name=observations] :nth-child(2) [ng-model="observation.observationTypeFk"]',
secondObservationDescriptionInput: 'vn-client-address-edit [name=observations] :nth-child(2) [ng-model="observation.description"] input',
addObservationButton: 'vn-client-address-edit div[name="observations"] vn-icon-button[icon="add_circle"]',
saveButton: `${components.vnSubmit}`,
cancelCreateAddressButton: 'button[ui-sref="client.card.address.index"]',
@ -143,7 +143,7 @@ export default {
addGreugeFloatButton: `${components.vnFloatButton}`,
amountInput: `${components.vnInputNumber}[name="amount"]`,
descriptionInput: `${components.vnTextfield}[name="description"]`,
typeAutocomplete: 'vn-autocomplete[field="$ctrl.greuge.greugeTypeFk"]',
typeAutocomplete: 'vn-autocomplete[ng-model="$ctrl.greuge.greugeTypeFk"]',
saveButton: `${components.vnSubmit}`,
firstGreugeText: 'vn-client-greuge-index vn-card > div vn-table vn-tbody > vn-tr'
},
@ -162,10 +162,10 @@ export default {
},
clientBalance: {
balanceButton: 'vn-left-menu a[ui-sref="client.card.balance.index"]',
companyAutocomplete: 'vn-client-balance-index vn-autocomplete[field="$ctrl.companyFk"]',
companyAutocomplete: 'vn-client-balance-index vn-autocomplete[ng-model="$ctrl.companyFk"]',
newPaymentButton: `${components.vnFloatButton}`,
newPaymentBank: 'vn-client-balance-create vn-autocomplete[field="$ctrl.receipt.bankFk"]',
newPaymentAmountInput: 'vn-client-balance-create vn-input-number[field="$ctrl.receipt.amountPaid"] input',
newPaymentBank: 'vn-client-balance-create vn-autocomplete[ng-model="$ctrl.receipt.bankFk"]',
newPaymentAmountInput: 'vn-client-balance-create vn-input-number[ng-model="$ctrl.receipt.amountPaid"] input',
saveButton: 'vn-client-balance-create vn-button[label="Save"]',
firstBalanceLine: 'vn-client-balance-index vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(8)'
@ -209,9 +209,9 @@ export default {
},
itemCreateView: {
temporalName: `${components.vnTextfield}[name="provisionalName"]`,
typeAutocomplete: 'vn-autocomplete[field="$ctrl.item.typeFk"]',
intrastatAutocomplete: 'vn-autocomplete[field="$ctrl.item.intrastatFk"]',
originAutocomplete: 'vn-autocomplete[field="$ctrl.item.originFk"]',
typeAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]',
intrastatAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]',
originAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]',
createButton: `${components.vnSubmit}`,
cancelButton: 'button[ui-sref="item.index"]'
},
@ -220,7 +220,7 @@ export default {
moreMenu: 'vn-item-descriptor vn-icon-menu > div > vn-icon',
moreMenuRegularizeButton: '.vn-popover.shown .vn-drop-down li[name="Regularize stock"]',
regularizeQuantityInput: 'vn-item-descriptor > vn-dialog > div > form > div.body > tpl-body > div > vn-textfield > div > div > div.infix > input',
regularizeWarehouseAutocomplete: 'vn-item-descriptor vn-dialog vn-autocomplete[field="$ctrl.warehouseFk"]',
regularizeWarehouseAutocomplete: 'vn-item-descriptor vn-dialog vn-autocomplete[ng-model="$ctrl.warehouseFk"]',
editButton: 'vn-item-card vn-item-descriptor vn-float-button[icon="edit"]',
regularizeSaveButton: 'vn-item-descriptor > vn-dialog > div > form > div.buttons > tpl-buttons > button',
inactiveIcon: 'vn-item-descriptor vn-icon[icon="icon-unavailable"]',
@ -229,13 +229,13 @@ export default {
itemBasicData: {
basicDataButton: 'vn-left-menu a[ui-sref="item.card.basicData"]',
goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]',
typeAutocomplete: 'vn-autocomplete[field="$ctrl.item.typeFk"]',
intrastatAutocomplete: 'vn-autocomplete[field="$ctrl.item.intrastatFk"]',
typeAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]',
intrastatAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]',
nameInput: 'vn-textfield[label="Name"] input',
relevancyInput: 'vn-input-number[label="Relevancy"] input',
originAutocomplete: 'vn-autocomplete[field="$ctrl.item.originFk"]',
expenceAutocomplete: 'vn-autocomplete[field="$ctrl.item.expenceFk"]',
longNameInput: 'vn-textfield[field="$ctrl.item.longName"] input',
relevancyInput: 'vn-input-number[ng-model="Relevancy"] input',
originAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]',
expenceAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.expenceFk"]',
longNameInput: 'vn-textfield[ng-model="$ctrl.item.longName"] input',
isActiveCheckbox: 'vn-check[label="Active"]',
priceInKgCheckbox: 'vn-check[label="Price in kg"]',
submitBasicDataButton: `${components.vnSubmit}`
@ -243,17 +243,17 @@ export default {
itemTags: {
goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]',
tagsButton: 'vn-left-menu a[ui-sref="item.card.tags"]',
fourthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(4) > vn-autocomplete[field="itemTag.tagFk"]',
fourthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(4) > vn-autocomplete[ng-model="itemTag.tagFk"]',
fourthValueInput: 'vn-item-tags vn-horizontal:nth-child(4) > vn-textfield[label="Value"] input',
fourthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(4) > vn-textfield[label="Relevancy"] input',
fourthRemoveTagButton: 'vn-item-tags vn-horizontal:nth-child(4) vn-icon-button[icon="delete"]',
fifthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(5) > vn-autocomplete[field="itemTag.tagFk"]',
fifthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(5) > vn-autocomplete[ng-model="itemTag.tagFk"]',
fifthValueInput: 'vn-item-tags vn-horizontal:nth-child(5) > vn-textfield[label="Value"] input',
fifthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(5) > vn-textfield[label="Relevancy"] input',
sixthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(6) > vn-autocomplete[field="itemTag.tagFk"]',
sixthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(6) > vn-autocomplete[ng-model="itemTag.tagFk"]',
sixthValueInput: 'vn-item-tags vn-horizontal:nth-child(6) > vn-textfield[label="Value"] input',
sixthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(6) > vn-textfield[label="Relevancy"] input',
seventhTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(7) > vn-autocomplete[field="itemTag.tagFk"]',
seventhTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(7) > vn-autocomplete[ng-model="itemTag.tagFk"]',
seventhValueInput: 'vn-item-tags vn-horizontal:nth-child(7) > vn-textfield[label="Value"] input',
seventhRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(7) > vn-textfield[label="Relevancy"] input',
addItemTagButton: 'vn-item-tags vn-icon-button[icon="add_circle"]',
@ -261,9 +261,9 @@ export default {
},
itemTax: {
undoChangesButton: 'vn-item-tax vn-button-bar > vn-button[label="Undo changes"]',
firstClassAutocomplete: 'vn-item-tax vn-horizontal:nth-child(1) > vn-autocomplete[field="tax.taxClassFk"]',
secondClassAutocomplete: 'vn-item-tax vn-horizontal:nth-child(2) > vn-autocomplete[field="tax.taxClassFk"]',
thirdClassAutocomplete: 'vn-item-tax vn-horizontal:nth-child(3) > vn-autocomplete[field="tax.taxClassFk"]',
firstClassAutocomplete: 'vn-item-tax vn-horizontal:nth-child(1) > vn-autocomplete[ng-model="tax.taxClassFk"]',
secondClassAutocomplete: 'vn-item-tax vn-horizontal:nth-child(2) > vn-autocomplete[ng-model="tax.taxClassFk"]',
thirdClassAutocomplete: 'vn-item-tax vn-horizontal:nth-child(3) > vn-autocomplete[ng-model="tax.taxClassFk"]',
submitTaxButton: `vn-item-tax ${components.vnSubmit}`
},
itemBarcodes: {
@ -274,19 +274,19 @@ export default {
},
itemNiches: {
addNicheButton: 'vn-item-niche vn-icon[icon="add_circle"]',
firstWarehouseAutocomplete: 'vn-item-niche vn-autocomplete[field="niche.warehouseFk"]',
firstWarehouseAutocomplete: 'vn-item-niche vn-autocomplete[ng-model="niche.warehouseFk"]',
firstCodeInput: 'vn-item-niche vn-horizontal:nth-child(1) > vn-textfield[label="Code"] input',
secondWarehouseAutocomplete: 'vn-item-niche vn-horizontal:nth-child(2) > vn-autocomplete[field="niche.warehouseFk"]',
secondWarehouseAutocomplete: 'vn-item-niche vn-horizontal:nth-child(2) > vn-autocomplete[ng-model="niche.warehouseFk"]',
secondCodeInput: 'vn-item-niche vn-horizontal:nth-child(2) > vn-textfield[label="Code"] input',
secondNicheRemoveButton: 'vn-item-niche vn-horizontal:nth-child(2) > vn-none > vn-icon-button[icon="delete"]',
thirdWarehouseAutocomplete: 'vn-item-niche vn-horizontal:nth-child(3) > vn-autocomplete[field="niche.warehouseFk"]',
thirdWarehouseAutocomplete: 'vn-item-niche vn-horizontal:nth-child(3) > vn-autocomplete[ng-model="niche.warehouseFk"]',
thirdCodeInput: 'vn-item-niche vn-horizontal:nth-child(3) > vn-textfield[label="Code"] input',
submitNichesButton: `vn-item-niche ${components.vnSubmit}`
},
itemBotanical: {
botanicalInput: `vn-item-botanical vn-horizontal:nth-child(1) > ${components.vnTextfield}`,
genusAutocomplete: 'vn-item-botanical vn-autocomplete[field="$ctrl.botanical.genusFk"]',
speciesAutocomplete: 'vn-item-botanical vn-autocomplete[field="$ctrl.botanical.specieFk"]',
genusAutocomplete: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.genusFk"]',
speciesAutocomplete: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.specieFk"]',
submitBotanicalButton: `vn-item-botanical ${components.vnSubmit}`
},
itemSummary: {
@ -301,7 +301,7 @@ export default {
secondTicketId: 'vn-item-diary vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(2) > span',
firstBalance: 'vn-item-diary vn-tbody > vn-tr:nth-child(1) > vn-td.balance',
fourthBalance: 'vn-item-diary vn-tbody > vn-tr:nth-child(4) > vn-td.balance',
warehouseAutocomplete: 'vn-item-diary vn-autocomplete[field="$ctrl.warehouseFk"]',
warehouseAutocomplete: 'vn-item-diary vn-autocomplete[ng-model="$ctrl.warehouseFk"]',
},
itemLog: {
anyLineCreated: 'vn-item-log > vn-log vn-tbody > vn-tr',
@ -324,8 +324,8 @@ export default {
setOk: 'vn-ticket-summary vn-button[label="SET OK"] > button'
},
ticketsIndex: {
openAdvancedSearchButton: 'vn-ticket-index vn-searchbar t-right-icons > vn-icon[icon="keyboard_arrow_down"]',
advancedSearchInvoiceOut: 'vn-ticket-search-panel vn-textfield[model="filter.refFk"] input',
openAdvancedSearchButton: 'vn-ticket-index vn-searchbar .append > vn-icon[icon="keyboard_arrow_down"]',
advancedSearchInvoiceOut: 'vn-ticket-search-panel vn-textfield[ng-model="filter.refFk"] input',
newTicketButton: 'vn-ticket-index > a',
searchResult: 'vn-ticket-index vn-card > div > vn-table > div > vn-tbody > a.vn-tr',
searchWeeklyResult: 'vn-ticket-weekly-index vn-table vn-tbody > vn-tr',
@ -338,17 +338,17 @@ export default {
searchWeeklyButton: 'vn-ticket-weekly-index vn-searchbar vn-icon[icon="search"]',
moreMenu: 'vn-ticket-index vn-icon-menu[vn-id="more-button"] > div > vn-icon',
moreMenuWeeklyTickets: '.vn-popover.shown .vn-drop-down li:nth-child(2)',
sixthWeeklyTicket: 'vn-ticket-weekly-index vn-table vn-tr:nth-child(6) vn-autocomplete[field="weekly.weekDay"] input',
sixthWeeklyTicket: 'vn-ticket-weekly-index vn-table vn-tr:nth-child(6) vn-autocomplete[ng-model="weekly.weekDay"] input',
weeklyTicket: 'vn-ticket-weekly-index vn-table > div > vn-tbody > vn-tr',
firstWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-tr:nth-child(1) vn-icon-button[icon="delete"]',
acceptDeleteTurn: 'vn-ticket-weekly-index > vn-confirm[vn-id="deleteWeekly"] button[response="ACCEPT"]'
},
createTicketView: {
clientAutocomplete: 'vn-ticket-create vn-autocomplete[field="$ctrl.clientFk"]',
addressAutocomplete: 'vn-ticket-create vn-autocomplete[field="$ctrl.addressFk"]',
deliveryDateInput: 'vn-ticket-create vn-date-picker[field="$ctrl.landed"]',
warehouseAutocomplete: 'vn-ticket-create vn-autocomplete[field="$ctrl.warehouseFk"]',
agencyAutocomplete: 'vn-ticket-create vn-autocomplete[field="$ctrl.ticket.agencyModeFk"]',
clientAutocomplete: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.clientFk"]',
addressAutocomplete: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.addressFk"]',
deliveryDateInput: 'vn-ticket-create vn-date-picker[ng-model="$ctrl.landed"]',
warehouseAutocomplete: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.warehouseFk"]',
agencyAutocomplete: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.ticket.agencyModeFk"]',
createButton: `${components.vnSubmit}`
},
ticketDescriptor: {
@ -377,7 +377,7 @@ export default {
ticketNotes: {
firstNoteRemoveButton: 'vn-icon[icon="delete"]',
addNoteButton: 'vn-icon[icon="add_circle"]',
firstNoteTypeAutocomplete: 'vn-autocomplete[field="observation.observationTypeFk"]',
firstNoteTypeAutocomplete: 'vn-autocomplete[ng-model="observation.observationTypeFk"]',
firstDescriptionInput: 'vn-textfield[label="Description"] input',
submitNotesButton: `${components.vnSubmit}`
},
@ -390,7 +390,7 @@ export default {
ticketPackages: {
packagesButton: 'vn-left-menu a[ui-sref="ticket.card.package"]',
firstPackageAutocomplete: 'vn-autocomplete[label="Package"]',
firstQuantityInput: 'vn-input-number[label="Quantity"] input',
firstQuantityInput: 'vn-input-number[ng-model="Quantity"] input',
firstRemovePackageButton: 'vn-icon-button[vn-tooltip="Remove package"]',
addPackageButton: 'vn-icon-button[vn-tooltip="Add package"]',
clearPackageAutocompleteButton: 'vn-autocomplete[label="Package"] .icons > vn-icon[icon=clear]',
@ -409,7 +409,7 @@ export default {
moreMenuReserve: '.vn-popover.shown .vn-drop-down li[name="Mark as reserved"]',
moreMenuUnmarkReseved: '.vn-popover.shown .vn-drop-down li[name="Unmark as reserved"]',
moreMenuUpdateDiscount: '.vn-popover.shown .vn-drop-down li[name="Update discount"]',
moreMenuUpdateDiscountInput: 'vn-ticket-sale vn-dialog form vn-ticket-sale-edit-discount vn-input-number[field="$ctrl.newDiscount"] input',
moreMenuUpdateDiscountInput: 'vn-ticket-sale vn-dialog form vn-ticket-sale-edit-discount vn-input-number[ng-model="$ctrl.newDiscount"] input',
transferQuantityInput: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable > span > text',
transferQuantityCell: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable',
firstSaleClaimIcon: 'vn-ticket-sale vn-table vn-tbody > vn-tr:nth-child(1) vn-icon[icon="icon-claims"]',
@ -417,9 +417,9 @@ export default {
firstSaleText: 'vn-table div > vn-tbody > vn-tr:nth-child(1)',
firstSaleThumbnailImage: 'vn-ticket-sale:nth-child(1) vn-tr:nth-child(1) vn-td:nth-child(3) > img',
firstSaleZoomedImage: 'body > div > div > img',
firstSaleQuantity: 'vn-input-number[field="sale.quantity"]:nth-child(1) input',
firstSaleQuantity: 'vn-input-number[ng-model="sale.quantity"]:nth-child(1) input',
firstSaleQuantityCell: 'vn-ticket-sale vn-tr:nth-child(1) > vn-td-editable:nth-child(5)',
firstSaleQuantityClearInput: 'vn-textfield[model="sale.quantity"] div.suffix > i',
firstSaleQuantityClearInput: 'vn-textfield[ng-model="sale.quantity"] div.suffix > i',
firstSaleIdInput: 'vn-ticket-sale vn-table vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(4) > vn-autocomplete input',
firstSaleIdAutocomplete: 'vn-ticket-sale vn-table vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(4) > vn-autocomplete',
idAutocompleteFirstResult: '.vn-popover.shown .vn-drop-down li',
@ -431,7 +431,7 @@ export default {
firstSaleReservedIcon: 'vn-ticket-sale vn-tr:nth-child(1) > vn-td:nth-child(2) > vn-icon:nth-child(3)',
firstSaleColour: 'vn-tr:nth-child(1) vn-fetched-tags section',
firstSaleLength: 'vn-ticket-sale vn-tr:nth-child(1) vn-td-editable:nth-child(6) section:nth-child(3)',
firstSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(1) vn-check[field="sale.checked"]',
firstSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(1) vn-check[ng-model="sale.checked"]',
secondSaleColour: 'vn-tr:nth-child(2) vn-fetched-tags section',
secondSalePrice: 'vn-ticket-sale vn-tr:nth-child(2) vn-td:nth-child(7) > span',
secondSaleDiscount: 'vn-ticket-sale vn-tr:nth-child(2) vn-td:nth-child(8)',
@ -446,11 +446,11 @@ export default {
secondSaleConceptInput: 'vn-ticket-sale vn-table vn-tr:nth-child(2) > vn-td-editable.ng-isolate-scope.selected vn-textfield input',
totalImport: 'vn-ticket-sale > vn-vertical > vn-card > div > vn-vertical > vn-horizontal > vn-one > p:nth-child(3) > strong',
selectAllSalesCheckbox: 'vn-ticket-sale vn-thead vn-check',
secondSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(2) vn-check[field="sale.checked"]',
thirdSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(3) vn-check[field="sale.checked"]',
secondSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(2) vn-check[ng-model="sale.checked"]',
thirdSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(3) vn-check[ng-model="sale.checked"]',
deleteSaleButton: 'vn-ticket-sale vn-tool-bar > vn-button[icon="delete"]',
transferSaleButton: 'vn-ticket-sale vn-tool-bar > vn-button[icon="call_split"]',
moveToTicketInput: '.vn-popover.shown vn-textfield[model="$ctrl.transfer.ticketId"] input',
moveToTicketInput: '.vn-popover.shown vn-textfield[ng-model="$ctrl.transfer.ticketId"] input',
moveToTicketInputClearButton: '.vn-popover.shown i[title="Clear"]',
moveToTicketButton: '.vn-popover.shown vn-icon[icon="arrow_forward_ios"]',
moveToNewTicketButton: '.vn-popover.shown vn-button[label="New ticket"]',
@ -461,20 +461,20 @@ export default {
ticketTracking: {
trackingButton: 'vn-left-menu a[ui-sref="ticket.card.tracking.index"]',
createStateButton: `${components.vnFloatButton}`,
stateAutocomplete: 'vn-ticket-tracking-edit vn-autocomplete[field="$ctrl.stateFk"]',
stateAutocomplete: 'vn-ticket-tracking-edit vn-autocomplete[ng-model="$ctrl.stateFk"]',
saveButton: `${components.vnSubmit}`,
cancelButton: 'vn-ticket-tracking-edit vn-button[ui-sref="ticket.card.tracking.index"]'
},
ticketBasicData: {
basicDataButton: 'vn-left-menu a[ui-sref="ticket.card.basicData.stepOne"]',
clientAutocomplete: 'vn-autocomplete[field="$ctrl.clientFk"]',
addressAutocomplete: 'vn-autocomplete[field="$ctrl.ticket.addressFk"]',
agencyAutocomplete: 'vn-autocomplete[field="$ctrl.agencyModeId"]',
zoneAutocomplete: 'vn-autocomplete[field="$ctrl.zoneId"]',
clientAutocomplete: 'vn-autocomplete[ng-model="$ctrl.clientFk"]',
addressAutocomplete: 'vn-autocomplete[ng-model="$ctrl.ticket.addressFk"]',
agencyAutocomplete: 'vn-autocomplete[ng-model="$ctrl.agencyModeId"]',
zoneAutocomplete: 'vn-autocomplete[ng-model="$ctrl.zoneId"]',
nextStepButton: 'vn-step-control > section > section.buttons > section:nth-child(2) > vn-button',
finalizeButton: 'vn-step-control > section > section.buttons > section:nth-child(2) > vn-submit',
stepTwoTotalPriceDif: 'vn-ticket-basic-data-step-two > form > vn-card > div > vn-horizontal > table > tfoot > tr > td:nth-child(4)',
chargesReasonAutocomplete: 'vn-autocomplete[field="$ctrl.ticket.option"]',
chargesReasonAutocomplete: 'vn-autocomplete[ng-model="$ctrl.ticket.option"]',
},
ticketComponents: {
base: 'vn-ticket-components tfoot > tr:nth-child(1) > td',
@ -485,7 +485,7 @@ export default {
addRequestButton: 'vn-ticket-request-index > a > vn-float-button > button',
request: 'vn-ticket-request-index > form > vn-card > div > vn-horizontal > vn-table > div > vn-tbody > vn-tr',
descriptionInput: 'vn-ticket-request-create > form > div > vn-card > div > vn-horizontal:nth-child(1) > vn-textfield > div > div > div.infix > input',
atenderAutocomplete: 'vn-ticket-request-create vn-autocomplete[field="$ctrl.ticketRequest.atenderFk"]',
atenderAutocomplete: 'vn-ticket-request-create vn-autocomplete[ng-model="$ctrl.ticketRequest.atenderFk"]',
quantityInput: 'vn-ticket-request-create vn-input-number input[name=quantity]',
priceInput: 'vn-ticket-request-create vn-input-number input[name=price]',
firstRemoveRequestButton: 'vn-ticket-request-index vn-icon[icon="delete"]:nth-child(1)',
@ -502,20 +502,20 @@ export default {
ticketService: {
addServiceButton: 'vn-ticket-service vn-icon-button[vn-tooltip="Add service"] > button',
firstAddDescriptionButton: 'vn-ticket-service vn-icon-button[vn-tooltip="New service type"] > button',
firstDescriptionAutocomplete: 'vn-ticket-service vn-autocomplete[field="service.description"]',
firstDescriptionAutocomplete: 'vn-ticket-service vn-autocomplete[ng-model="service.description"]',
firstQuantityInput: 'vn-ticket-service vn-input-number[label="Quantity"] input',
firstPriceInput: 'vn-ticket-service vn-input-number[label="Price"] input',
firstVatTypeAutocomplete: 'vn-ticket-service vn-autocomplete[label="Tax class"]',
fistDeleteServiceButton: 'vn-ticket-card > vn-main-block > div.content-block.ng-scope > vn-ticket-service > form > vn-card > div > vn-one:nth-child(1) > vn-horizontal:nth-child(1) > vn-auto > vn-icon-button[icon="delete"]',
newDescriptionInput: 'vn-ticket-service > vn-dialog vn-textfield[model="$ctrl.newServiceType.name"] input',
newDescriptionInput: 'vn-ticket-service > vn-dialog vn-textfield[ng-model="$ctrl.newServiceType.name"] input',
serviceLine: 'vn-ticket-service > form > vn-card > div > vn-one:nth-child(2) > vn-horizontal',
saveServiceButton: `${components.vnSubmit}`,
saveDescriptionButton: 'vn-ticket-service > vn-dialog[vn-id="createServiceTypeDialog"] > div > form > div.buttons > tpl-buttons > button'
},
createStateView: {
stateAutocomplete: 'vn-autocomplete[field="$ctrl.stateFk"]',
workerAutocomplete: 'vn-autocomplete[field="$ctrl.workerFk"]',
clearStateInputButton: 'vn-autocomplete[field="$ctrl.stateFk"] .icons > vn-icon[icon=clear]',
stateAutocomplete: 'vn-autocomplete[ng-model="$ctrl.stateFk"]',
workerAutocomplete: 'vn-autocomplete[ng-model="$ctrl.workerFk"]',
clearStateInputButton: 'vn-autocomplete[ng-model="$ctrl.stateFk"] .icons > vn-icon[icon=clear]',
saveStateButton: `${components.vnSubmit}`
},
claimsIndex: {
@ -531,7 +531,7 @@ export default {
claimSummary: {
header: 'vn-claim-summary > vn-card > div > h5',
state: 'vn-claim-summary vn-label-value[label="State"] > section > span',
observation: 'vn-claim-summary vn-textarea[model="$ctrl.summary.claim.observation"] > div > textarea',
observation: 'vn-claim-summary vn-textarea[ng-model="$ctrl.summary.claim.observation"] > div > textarea',
firstSaleItemId: 'vn-claim-summary vn-horizontal > vn-auto:nth-child(4) > vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(1) > span',
firstSaleDescriptorImage: '.vn-popover.shown vn-item-descriptor img',
itemDescriptorPopover: '.vn-popover.shown vn-item-descriptor',
@ -542,45 +542,45 @@ export default {
firstActionTicketDescriptor: '.vn-popover.shown vn-ticket-descriptor'
},
claimBasicData: {
claimStateAutocomplete: 'vn-claim-basic-data vn-autocomplete[field="$ctrl.claim.claimStateFk"]',
claimStateAutocomplete: 'vn-claim-basic-data vn-autocomplete[ng-model="$ctrl.claim.claimStateFk"]',
responsabilityInputRange: 'vn-input-range',
observationInput: 'vn-textarea[field="$ctrl.claim.observation"] textarea',
observationInput: 'vn-textarea[ng-model="$ctrl.claim.observation"] textarea',
saveButton: `${components.vnSubmit}`
},
claimDetail: {
secondItemDiscount: 'vn-claim-detail > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(6) > span',
discountInput: '.vn-popover.shown vn-input-number[field="$ctrl.newDiscount"] > div > div > div.infix > input',
discountInput: '.vn-popover.shown vn-input-number[ng-model="$ctrl.newDiscount"] > div > div > div.infix > input',
discoutPopoverMana: '.vn-popover.shown .content > div > vn-horizontal > h5',
addItemButton: 'vn-claim-detail a vn-float-button',
firstClaimableSaleFromTicket: 'vn-claim-detail > vn-dialog vn-tbody > vn-tr',
claimDetailLine: 'vn-claim-detail > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr',
firstItemQuantityInput: 'vn-claim-detail vn-tr:nth-child(1) vn-input-number[field="saleClaimed.quantity"] input',
firstItemQuantityInput: 'vn-claim-detail vn-tr:nth-child(1) vn-input-number[ng-model="saleClaimed.quantity"] input',
totalClaimed: 'vn-claim-detail > vn-vertical > vn-card > div > vn-vertical > vn-horizontal > div > vn-label-value:nth-child(2) > section > span',
secondItemDeleteButton: 'vn-claim-detail > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(8) > vn-icon-button > button > vn-icon > i'
},
claimDevelopment: {
addDevelopmentButton: 'vn-claim-development > vn-vertical > vn-card > div > vn-vertical > vn-one > vn-icon-button > button > vn-icon',
firstDeleteDevelopmentButton: 'vn-claim-development > vn-vertical > vn-card > div > vn-vertical > form > vn-horizontal:nth-child(2) > vn-icon-button > button > vn-icon',
firstClaimReasonAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[field="claimDevelopment.claimReasonFk"]',
firstClaimResultAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[field="claimDevelopment.claimResultFk"]',
firstClaimResponsibleAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[field="claimDevelopment.claimResponsibleFk"]',
firstClaimWorkerAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[field="claimDevelopment.workerFk"]',
firstClaimRedeliveryAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[field="claimDevelopment.claimRedeliveryFk"]',
secondClaimReasonAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[field="claimDevelopment.claimReasonFk"]',
secondClaimResultAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[field="claimDevelopment.claimResultFk"]',
secondClaimResponsibleAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[field="claimDevelopment.claimResponsibleFk"]',
secondClaimWorkerAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[field="claimDevelopment.workerFk"]',
secondClaimRedeliveryAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[field="claimDevelopment.claimRedeliveryFk"]',
firstClaimReasonAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
firstClaimResultAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
firstClaimResponsibleAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
firstClaimWorkerAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.workerFk"]',
firstClaimRedeliveryAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
secondClaimReasonAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
secondClaimResultAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
secondClaimResponsibleAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
secondClaimWorkerAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.workerFk"]',
secondClaimRedeliveryAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
saveDevelopmentButton: `${components.vnSubmit}`
},
claimAction: {
importClaimButton: 'vn-claim-action vn-button[label="Import claim"]',
importTicketButton: 'vn-claim-action vn-button[label="Import ticket"]',
secondImportableTicket: '.vn-popover.shown .content > div > vn-table > div > vn-tbody > vn-tr:nth-child(2)',
firstLineDestination: 'vn-claim-action vn-tr:nth-child(1) vn-autocomplete[field="saleClaimed.claimDestinationFk"]',
secondLineDestination: 'vn-claim-action vn-tr:nth-child(2) vn-autocomplete[field="saleClaimed.claimDestinationFk"]',
firstLineDestination: 'vn-claim-action vn-tr:nth-child(1) vn-autocomplete[ng-model="saleClaimed.claimDestinationFk"]',
secondLineDestination: 'vn-claim-action vn-tr:nth-child(2) vn-autocomplete[ng-model="saleClaimed.claimDestinationFk"]',
firstDeleteLine: 'vn-claim-action vn-tr:nth-child(1) vn-icon-button[icon="delete"]',
isPaidWithManaCheckbox: 'vn-check[field="$ctrl.claim.isChargedToMana"]'
isPaidWithManaCheckbox: 'vn-check[ng-model="$ctrl.claim.isChargedToMana"]'
},
ordersIndex: {
searchResult: 'vn-order-index vn-card > div > vn-table > div > vn-tbody > a.vn-tr',
@ -606,14 +606,14 @@ export default {
orderByAutocomplete: 'vn-autocomplete[label="Order by"]',
plantRealmButton: 'vn-order-catalog > vn-side-menu vn-icon[icon="icon-plant"]',
typeAutocomplete: 'vn-autocomplete[data="$ctrl.itemTypes"]',
itemIdInput: 'vn-order-catalog > vn-side-menu vn-catalog-filter vn-textfield[model="$ctrl.itemFk"] input',
itemTagValueInput: 'vn-order-catalog > vn-side-menu vn-catalog-filter vn-textfield[model="$ctrl.value"] input',
openTagSearch: 'vn-order-catalog > vn-side-menu > div > vn-catalog-filter > div > vn-vertical > vn-textfield[model="$ctrl.value"] > div > div > div.rightIcons > t-right-icons > i',
tagAutocomplete: 'vn-order-catalog-search-panel vn-autocomplete[field="filter.tagFk"]',
tagValueInput: 'vn-order-catalog-search-panel vn-textfield[model="filter.value"] input',
itemIdInput: 'vn-catalog-filter vn-textfield[ng-model="$ctrl.itemFk"] input',
itemTagValueInput: 'vn-catalog-filter vn-textfield[ng-model="$ctrl.value"] input',
openTagSearch: 'vn-catalog-filter > div > vn-vertical > vn-textfield[ng-model="$ctrl.value"] .append > i',
tagAutocomplete: 'vn-order-catalog-search-panel vn-autocomplete[ng-model="filter.tagFk"]',
tagValueInput: 'vn-order-catalog-search-panel vn-textfield[ng-model="filter.value"] input',
searchTagButton: 'vn-order-catalog-search-panel > div > form > vn-horizontal:nth-child(3) > vn-submit > input',
thirdFilterRemoveButton: 'vn-order-catalog > vn-side-menu vn-catalog-filter > div > vn-horizontal.chips > vn-chip:nth-child(3) button',
fourthFilterRemoveButton: 'vn-order-catalog > vn-side-menu vn-catalog-filter > div > vn-horizontal.chips > vn-chip:nth-child(4) button',
thirdFilterRemoveButton: 'vn-catalog-filter > div > vn-horizontal.chips > vn-chip:nth-child(3) button',
fourthFilterRemoveButton: 'vn-catalog-filter > div > vn-horizontal.chips > vn-chip:nth-child(4) button',
},
orderBasicData: {
clientAutocomplete: 'vn-autocomplete[label="Client"]',
@ -633,11 +633,11 @@ export default {
addNewRouteButton: 'vn-route-index > a[ui-sref="route.create"]'
},
createRouteView: {
workerAutocomplete: 'vn-route-create vn-autocomplete[field="$ctrl.route.workerFk"]',
createdDatePicker: 'vn-route-create vn-date-picker[field="$ctrl.route.created"]',
vehicleAutoComplete: 'vn-route-create vn-autocomplete[field="$ctrl.route.vehicleFk"]',
agencyAutoComplete: 'vn-route-create vn-autocomplete[field="$ctrl.route.agencyModeFk"]',
descriptionInput: 'vn-route-create vn-textfield[field="$ctrl.route.description"] input',
workerAutocomplete: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.workerFk"]',
createdDatePicker: 'vn-route-create vn-date-picker[ng-model="$ctrl.route.created"]',
vehicleAutoComplete: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]',
agencyAutoComplete: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.agencyModeFk"]',
descriptionInput: 'vn-route-create vn-textfield[ng-model="$ctrl.route.description"] input',
submitButton: 'vn-route-create vn-submit > input[type="submit"]'
},
routeDescriptor: {
@ -647,29 +647,29 @@ export default {
routeId: 'vn-route-summary > vn-card > div > vn-horizontal > vn-one:nth-child(1) > vn-label-value:nth-child(1) > section > span'
},
routeBasicData: {
workerAutoComplete: 'vn-route-basic-data vn-autocomplete[field="$ctrl.route.workerFk"]',
vehicleAutoComplete: 'vn-route-basic-data vn-autocomplete[field="$ctrl.route.vehicleFk"]',
agencyAutoComplete: 'vn-route-basic-data vn-autocomplete[field="$ctrl.route.agencyModeFk"]',
kmStartInput: 'vn-route-basic-data vn-input-number[field="$ctrl.route.kmStart"] input',
kmEndInput: 'vn-route-basic-data vn-input-number[field="$ctrl.route.kmEnd"] input',
createdDateInput: 'vn-route-basic-data vn-date-picker[field="$ctrl.route.created"]',
startedHourInput: 'vn-route-basic-data vn-input-time[field="$ctrl.route.started"] input',
finishedHourInput: 'vn-route-basic-data vn-input-time[field="$ctrl.route.finished"] input',
workerAutoComplete: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.workerFk"]',
vehicleAutoComplete: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]',
agencyAutoComplete: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.agencyModeFk"]',
kmStartInput: 'vn-route-basic-data vn-input-number[ng-model="$ctrl.route.kmStart"] input',
kmEndInput: 'vn-route-basic-data vn-input-number[ng-model="$ctrl.route.kmEnd"] input',
createdDateInput: 'vn-route-basic-data vn-date-picker[ng-model="$ctrl.route.created"]',
startedHourInput: 'vn-route-basic-data vn-input-time[ng-model="$ctrl.route.started"] input',
finishedHourInput: 'vn-route-basic-data vn-input-time[ng-model="$ctrl.route.finished"] input',
saveButton: 'vn-route-basic-data vn-submit[label="Save"] input'
},
routeTickets: {
firstTicketPriority: 'vn-route-tickets vn-tr:nth-child(1) vn-textfield[model="ticket.priority"] input',
secondTicketPriority: 'vn-route-tickets vn-tr:nth-child(2) vn-textfield[model="ticket.priority"] input',
thirdTicketPriority: 'vn-route-tickets vn-tr:nth-child(3) vn-textfield[model="ticket.priority"] input',
fourthTicketPriority: 'vn-route-tickets vn-tr:nth-child(4) vn-textfield[model="ticket.priority"] input',
eleventhTicketPriority: 'vn-route-tickets vn-tr:nth-child(11) vn-textfield[model="ticket.priority"] input',
firstTicketPriority: 'vn-route-tickets vn-tr:nth-child(1) vn-textfield[ng-model="ticket.priority"] input',
secondTicketPriority: 'vn-route-tickets vn-tr:nth-child(2) vn-textfield[ng-model="ticket.priority"] input',
thirdTicketPriority: 'vn-route-tickets vn-tr:nth-child(3) vn-textfield[ng-model="ticket.priority"] input',
fourthTicketPriority: 'vn-route-tickets vn-tr:nth-child(4) vn-textfield[ng-model="ticket.priority"] input',
eleventhTicketPriority: 'vn-route-tickets vn-tr:nth-child(11) vn-textfield[ng-model="ticket.priority"] input',
firstTicketCheckbox: 'vn-route-tickets vn-tr:nth-child(1) vn-check',
buscamanButton: 'vn-route-tickets vn-button[icon="icon-buscaman"]',
firstTicketDeleteButton: 'vn-route-tickets vn-tr:nth-child(1) vn-icon[icon="delete"]',
confirmButton: 'vn-route-tickets > vn-confirm button[response="ACCEPT"]'
},
workerPbx: {
extensionInput: 'vn-worker-pbx vn-textfield[model="$ctrl.worker.sip.extension"] input',
extensionInput: 'vn-worker-pbx vn-textfield[ng-model="$ctrl.worker.sip.extension"] input',
saveButton: 'vn-worker-pbx vn-submit[label="Save"] input'
},
workerTimeControl: {

View File

@ -1,4 +1,7 @@
<div class="container">
<div
class="container"
ng-click="$ctrl.onContainerMouseDown($event)"
ng-keydown="$ctrl.onContainerKeyDown($event)">
<div
ng-transclude="prepend"
class="prepend">
@ -7,9 +10,7 @@
<div class="fix prefix"></div>
<div class="control">
<input
type="button"
ng-click="$ctrl.onInputMouseDown($event)"
ng-keydown="$ctrl.onInputKeyDown($event)">
type="button">
</input>
</div>
<div class="fix suffix"></div>
@ -18,7 +19,7 @@
<span class="required">*</span>
</label>
</div>
<div class="icons">
<div class="icons pre">
<vn-icon
icon="clear"
translate-attr="{title: 'Clear'}"
@ -34,6 +35,11 @@
ng-transclude="append"
class="append">
</div>
<div class="icons post">
<vn-icon
icon="arrow_drop_down">
</vn-icon>
</div>
<div class="underline blur"></div>
<div class="underline focus"></div>
</div>

View File

@ -209,13 +209,13 @@ export default class Autocomplete extends Field {
this.field = value;
}
onInputKeyDown(event) {
// if (event.defaultPrevented) return;
onContainerKeyDown(event) {
if (event.defaultPrevented) return;
switch (event.keyCode) {
case 38: // Up
case 40: // Down
case 13: // Enter
switch (event.code) {
case 'ArrowUp':
case 'ArrowDown':
case 'Enter':
this.showDropDown();
break;
default:
@ -228,7 +228,7 @@ export default class Autocomplete extends Field {
event.preventDefault();
}
onInputMouseDown(event) {
onContainerMouseDown(event) {
if (event.defaultPrevented) return;
event.preventDefault();
this.showDropDown();
@ -261,7 +261,7 @@ export default class Autocomplete extends Field {
showDropDown(search) {
this.assignDropdownProps();
this.$.dropDown.show(this.input, search);
this.$.dropDown.show(this.container, search);
}
get fetchFunction() {

View File

@ -1,17 +1,23 @@
@import "effects";
vn-autocomplete.vn-field {
& > .container > .infix > .control {
overflow: hidden;
overflow: hidden;
& > input {
cursor: pointer;
text-overflow: ellipsis;
white-space: nowrap;
& > .container {
cursor: pointer;
& > .infix > .control {
overflow: hidden;
text-align: left;
padding-left: 0;
padding-right: 0;
& > input {
cursor: pointer;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
text-align: left;
padding-left: 0;
padding-right: 0;
}
}
}
}

View File

@ -12,13 +12,13 @@ import './style.scss';
*/
export default class Check extends Toggle {
set field(value) {
this._field = value;
super.field = value;
this.element.classList.toggle('checked', Boolean(value));
this.indeterminate = Boolean(value == null && this.tripleState);
}
get field() {
return this._field;
return super.field;
}
set checked(value) {

View File

@ -9,8 +9,6 @@ class DatePicker extends Field {
this.$translate = $translate;
this.input = $compile(`<input type="text"></input>`)($scope)[0];
this.control.appendChild(this.input);
this.initPicker();
}

View File

@ -6,10 +6,10 @@
<div ng-show="$ctrl.showFilter" class="filter">
<vn-textfield
vn-id="input"
model="$ctrl.search"
class="search"
ng-model="$ctrl.search"
class="dense search"
ng-blur="$ctrl.onFocusOut()"
label="Search">
placeholder="{{::'Search' | translate}}">
</vn-textfield>
</div>
<div vn-id="list" class="list" tabindex="-1">

View File

@ -106,8 +106,8 @@ export default class DropDown extends Component {
*/
show(parent, search) {
this._activeOption = -1;
this.search = search;
this.$.popover.show(parent || this.parent);
this.search = search;
this.buildList();
}

View File

@ -13,18 +13,7 @@
display: block;
width: 100%;
box-sizing: border-box;
border: none;
font-size: inherit;
padding: .6em;
margin: 0!important;
&.not-empty label{
display: none;
}
& .selected label {
font-size: inherit;
bottom: 2px;
color: $color-font-secondary;
}
padding: $spacing-sm;
}
& > vn-icon[icon=clear] {
display: none;

View File

@ -12,7 +12,7 @@
<span class="required">*</span>
</label>
</div>
<div class="icons">
<div class="icons pre">
<vn-icon
icon="clear"
translate-attr="{title: 'Clear'}"
@ -28,6 +28,8 @@
ng-transclude="append"
class="append">
</div>
<div class="icons post">
</div>
<div class="underline blur"></div>
<div class="underline focus"></div>
</div>

View File

@ -1,8 +1,8 @@
import ngModule from '../../module';
import Component from '../../lib/component';
import FormInput from '../form-input';
import './style.scss';
export default class Field extends Component {
export default class Field extends FormInput {
constructor($element, $scope, $compile) {
super($element, $scope);
this.$compile = $compile;
@ -15,11 +15,13 @@ export default class Field extends Component {
this.classList.add('vn-field');
this.element.addEventListener('click', e => this.onClick(e));
let container = this.element.querySelector('.container');
container.addEventListener('mousedown', e => this.onMouseDown(e));
this.container = this.element.querySelector('.container');
this.container.addEventListener('mousedown', e => this.onMouseDown(e));
}
$onInit() {
super.$onInit();
if (this.info) this.classList.add('has-icons');
this.input.addEventListener('focus', () => this.onFocus(true));
@ -27,24 +29,26 @@ export default class Field extends Component {
this.input.addEventListener('change', e => {
this.emit('change', {event: e});
});
// XXX: Compatibility with old inputs
let attrs = this.$element[0].attributes;
if (!this.name && attrs.field) {
let split = attrs.field.nodeValue.split('.');
this.name = split[split.length - 1];
}
}
set field(value) {
this._field = value;
super.field = value;
this.classList.toggle('not-empty', value != null && value !== '');
if (this.form) this.form.$setDirty();
this.validateValue();
}
get field() {
return this._field;
return super.field;
}
set input(value) {
if (this.input) this.control.removeChild(this.input);
this._input = value;
this.control.appendChild(value);
}
get input() {
return this._input;
}
set value(value) {
@ -71,6 +75,22 @@ export default class Field extends Component {
return this.input.name;
}
set placeholder(value) {
this.input.placeholder = value;
}
get placeholder() {
return this.input.placeholder;
}
set tabIndex(value) {
this.input.tabIndex = value;
}
get tabIndex() {
return this.input.tabIndex;
}
set disabled(value) {
this._disabled = boolTag(value);
this.input.disabled = this._disabled;
@ -185,9 +205,9 @@ export default class Field extends Component {
}
buildInput(type) {
let template = `<input type="${type}" ng-model="$ctrl.field"></input>`;
let template = `<input ng-model="$ctrl.field"></input>`;
this.input = this.$compile(template)(this.$)[0];
this.control.appendChild(this.input);
this.type = type;
}
/**
@ -209,23 +229,18 @@ ngModule.vnComponent('vnField', {
},
controller: Field,
bindings: {
field: '=?',
label: '@?',
name: '@?',
type: '@?',
placeholder: '@?',
value: '=?',
info: '@?',
disabled: '<?',
readonly: '<?',
required: '<?',
prefix: '@?',
suffix: '@?',
hint: '@?',
error: '<?',
onChange: '&?'
},
require: {
form: '?^form'
tabIndex: '<?',
onChange: '&?', // FIXME: Not implemented, nesessary?
rule: '@?' // FIXME: Not implemented
}
});

View File

@ -8,7 +8,6 @@
display: flex;
align-items: stretch;
position: relative;
height: 56px;
& > .infix {
position: relative;
@ -50,36 +49,40 @@
& > .control {
height: 100%;
flex: auto;
}
& > .control > input {
padding-top: 24px;
padding-bottom: 8px;
height: inherit;
outline: none;
border: none;
font-family: Arial, sans-serif;
display: block;
font-size: $input-font-size;
width: 100%;
background: 0;
color: inherit;
box-sizing: border-box;
&[type=time],
&[type=date] {
clip-path: inset(0 20px 0 0);
}
&[type=number] {
-moz-appearance: textfield;
&::-webkit-outer-spin-button,
&::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
& > * {
padding-top: 24px;
padding-bottom: 8px;
height: inherit;
outline: none;
border: none;
font-family: Arial, sans-serif;
display: block;
font-size: $input-font-size;
width: 100%;
background: 0;
color: inherit;
box-sizing: border-box;
min-height: 56px;
&[type=time],
&[type=date] {
clip-path: inset(0 20px 0 0);
opacity: 0;
transition: opacity 200ms ease-in-out;
}
&[type=number] {
-moz-appearance: textfield;
&::-webkit-outer-spin-button,
&::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
}
&:invalid {
box-shadow: none;
}
}
&:invalid {
box-shadow: none;
}
}
}
@ -102,14 +105,16 @@
& > .prepend > prepend {
padding-right: 12px;
}
& > .append > append {
padding-left: 12px;
}
& > .icons > vn-icon {
cursor: pointer;
}
& > .icons > vn-icon[icon=clear] {
display: none;
& > .icons {
&.pre {
padding-left: 12px;
}
& > vn-icon {
cursor: pointer;
}
& > vn-icon[icon=clear] {
display: none;
}
}
& > .underline {
position: absolute;
@ -133,29 +138,56 @@
}
}
}
&.not-empty > .container,
&.focused > .container,
&.invalid > .container {
& > .infix {
& > .fix {
opacity: 1;
&.dense {
& > .hint {
display: none;
}
& > .container > .infix {
& > label {
top: 8px;
}
& > .control > * {
padding-top: 8px;
min-height: 40px;
}
}
&.not-empty,
&.focused,
&.invalid {
& > .container > .infix > label {
top: 0;
line-height: 8px;
}
}
}
&.not-empty,
&.focused,
&.invalid {
& > .container > .infix {
& > label {
top: 5px;
color: $color-main;
padding: 0;
font-size: 12px;
}
& > .control > * {
&[type=time],
&[type=date] {
opacity: 1;
}
}
}
}
&.has-icons,
&.not-empty:hover,
&.not-empty.focused {
& > .container > .append > append {
padding-left: 0;
}
& > .container > .icons {
padding-left: 12px;
& > .container {
& > .append > append {
padding-left: 0;
}
& > .icons.pre {
padding-left: 12px;
}
}
}
&:not(.disabled):not(.readonly) {
@ -173,14 +205,8 @@
}
}
}
&:not(.not-empty):not(.focused) > .container > .infix > .control > input {
&[type=time],
&[type=date] {
opacity: 0;
}
}
&.readonly > .container {
& > .infix > .control > input {
& > .infix > .control > * {
caret-color: transparent;
}
& > .underline.blur {
@ -189,11 +215,11 @@
}
& > .hint {
z-index: -1;
padding-top: 8px;
height: 20px;
padding: 4px 0;
height: 12px;
color: rgba(0, 0, 0, .4);
font-size: 12px;
transform: translateY(-15px);
transform: translateY(-12px);
transition-property: opacity, transform, color;
transition-duration: 200ms;
transition-timing-function: ease-in-out;
@ -223,8 +249,3 @@
}
}
}
vn-table {
.vn-field {
margin: 0;
}
}

View File

@ -0,0 +1,58 @@
import ngModule from '../../module';
import Component from '../../lib/component';
/**
* Base component for form inputs.
*
* @property {String} label Label to display along the component
* @property {any} field The value with which the element is linked
* @property {Boolean} disabled Put component in disabled mode
*/
export default class FormInput extends Component {
$onInit() {
// XXX: Compatibility with old inputs
let attrs = this.$element[0].attributes;
if (!this.name && attrs['ng-model']) {
let split = attrs['ng-model'].nodeValue.split('.');
this.name = split[split.length - 1];
}
if (!this.ngModel) return;
this.ngModel.$render = () => {
this.field = this.ngModel.$viewValue;
};
}
set field(value) {
this._field = value;
if (this.ngModel)
this.ngModel.$setViewValue(value);
}
get field() {
return this._field;
}
set name(value) {
this.element.setAttribute('name', value);
}
get name() {
return this.element.getAttribute('name');
}
}
ngModule.vnComponent('vnFormInput', {
controller: FormInput,
bindings: {
label: '@?',
field: '=?',
name: '@?',
disabled: '<?',
readonly: '<?'
},
require: {
ngModel: '?ngModel'
}
});

View File

@ -1,9 +1,11 @@
@import "variables";
@import "effects";
vn-icon-button {
@extend %clickable-light;
outline: 0;
color: $color-main;
display: inline-block;
display: inline-flex;
align-items: center;
font-size: 18pt;
padding: .25em;

View File

@ -17,7 +17,6 @@ import './drop-down/drop-down';
import './menu/menu';
import './multi-check/multi-check';
import './button/button';
import './textarea/textarea';
import './icon-button/icon-button';
import './submit/submit';
import './card/card';
@ -43,5 +42,6 @@ import './list';
import './radio';
import './table';
import './td-editable';
import './textarea';
import './th';
import './treeview';

View File

@ -14,7 +14,7 @@ describe('Component vnInputFile', () => {
beforeEach(angular.mock.inject(($componentController, $rootScope) => {
$scope = $rootScope.$new();
$attrs = {field: '$ctrl.dms.file'};
$element = angular.element('<vn-input-file label="File" field="$ctrl.dms.file"><input type="file"><div class="infix"><div class="rightIcons"></div></vn-input-file>');
$element = angular.element('<vn-input-file label="File" ng-model="$ctrl.dms.file"><input type="file"><div class="infix"><div class="rightIcons"></div></vn-input-file>');
controller = $componentController('vnInputFile', {$element, $scope, $attrs, $timeout, $transclude: () => {}});
controller.input = $element[0].querySelector('input');
controller.validate = () => {};

View File

@ -1,8 +1,6 @@
@import "variables";
@import '../textfield/style.scss';
vn-input-file {
@extend vn-textfield;
.value {
color: $color-font-secondary;
cursor: pointer;
@ -12,4 +10,156 @@ vn-input-file {
input {
display: none !important
}
margin: 20px 0;
display: inline-block;
width: 100%;
& > .container {
width: 100%;
position: relative;
padding-bottom: 2px;
display: flex;
& > .textField {
width: 100%;
display: flex;
align-items: center;
position: relative;
padding-top: 4px;
}
}
.leftIcons, .rightIcons, .suffix {
display: flex;
color: $color-font-secondary;
.material-icons {
font-size: 20px !important
}
}
.suffix vn-icon-button {
padding: 0
}
t-left-icons {
padding-right: 0.5em
}
t-right-icons {
padding-left: 0.5em
}
.infix {
position: relative;
display: block;
flex: auto;
width: 100%;
min-width: 0;
}
i.clear {
visibility: hidden;
cursor: pointer;
outline: 0;
&:hover {
color: #222;
}
}
&:hover i.clear {
visibility: visible;
}
i.visible {
visibility: visible;
}
label {
position: absolute;
bottom: 0;
left: 0;
padding: 4px 0!important;
pointer-events: none;
color: $color-font-secondary;
transition-duration: .2s;
transition-timing-function: cubic-bezier(.4,0,.2,1);
}
&.not-empty label{
bottom: 24px;
color: $color-main;
padding: 0;
font-size: 12px;
}
input {
outline: none;
border: none;
font-family: "Helvetica", "Arial", sans-serif;
display: block;
font-size: 16px;
width: 100%;
background: 0 0;
color: inherit;
padding: 4px;
box-sizing: border-box;
border-bottom: 0!important;
&[type=number] {
-moz-appearance: textfield;
&::-webkit-outer-spin-button,
&::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
}
&:invalid {
box-shadow: none;
}
}
.underline {
position: absolute;
bottom: 0;
height: 1px;
content: ' ';
pointer-events: none;
width: 100%;
background-color: $color-input-underline;
}
.selected.underline {
background-color: $color-main;
height: 2px;
left: 50%;
width: 0px !important;
transition-duration: 0.2s;
transition-timing-function: cubic-bezier(.4,0,.2,1);
}
div.selected {
&.container{
border-bottom: 0px;
}
label {
bottom: 24px;
color: $color-main;
font-size: 12px;
}
.selected.underline{
left: 0;
width: 100%!important;
}
}
& > div.container > div.textField > div.infix.invalid {
@extend div.selected;
& > span.mdl-textfield__error {
visibility: visible;
}
& > label {
color: #d50000;
}
}
.infix.invalid + .underline {
background-color: #d50000;
}
label span:nth-child(2) {
color: $color-alert
}
}

View File

@ -12,12 +12,23 @@
<span class="required">*</span>
</label>
</div>
<div class="icons">
<div class="icons pre">
<vn-icon
icon="clear"
translate-attr="{title: 'Clear'}"
ng-click="$ctrl.onClear($event)">
</vn-icon>
<vn-icon
ng-if="::$ctrl.info"
icon="info_outline"
vn-tooltip="{{::$ctrl.info}}">
</vn-icon>
</div>
<div
ng-transclude="append"
class="append">
</div>
<div class="icons post">
<vn-icon
ng-if="$ctrl.displayControls"
icon="remove"
@ -30,15 +41,6 @@
ng-click="$ctrl.onStep($event, 'up')"
translate-attr="{title: 'Add'}">
</vn-icon>
<vn-icon
ng-if="::$ctrl.info"
icon="info_outline"
vn-tooltip="{{::$ctrl.info}}">
</vn-icon>
</div>
<div
ng-transclude="append"
class="append">
</div>
<div class="underline blur"></div>
<div class="underline focus"></div>

View File

@ -78,7 +78,6 @@ export default class InputNumber extends Field {
this.input.dispatchEvent(new Event('change'));
}
}
InputNumber.$inject = ['$element', '$scope', '$compile'];
ngModule.vnComponent('vnInputNumber', {
template: require('./index.html'),

View File

@ -8,7 +8,6 @@ export default class InputTime extends Field {
this.input = $compile(`<input type="time"></input>`)($scope)[0];
this.input.addEventListener('change', () => this.onValueUpdate());
this.control.appendChild(this.input);
}
get field() {

View File

@ -1,5 +1,5 @@
<vn-check
field="$ctrl.checked"
ng-model="$ctrl.checked"
intermediate="$ctrl.isIntermediate"
translate-attr="{title: 'Check all'}">
</vn-check>

View File

@ -188,8 +188,9 @@ export default class Popover extends Component {
}
onBgMouseDown(event) {
if (event != this.lastMouseEvent)
this.hide();
if (event == this.lastMouseEvent || event.defaultPrevented) return;
event.preventDefault();
this.hide();
}
}
Popover.$inject = ['$element', '$scope', '$timeout', '$transitions', '$transclude', '$compile'];

View File

@ -10,13 +10,13 @@ import './style.scss';
*/
export default class Radio extends Toggle {
set field(value) {
this._field = value;
super.field = value;
this.element.classList.toggle('checked',
Boolean(value) && value == this.val);
}
get field() {
return this._field;
return super.field;
}
set checked(value) {

View File

@ -1,29 +1,30 @@
<form ng-submit="$ctrl.onSubmit()">
<vn-horizontal>
<vn-textfield vn-one label="Search" model="$ctrl.searchString">
<t-left-icons>
<vn-icon
icon="search"
ng-click="$ctrl.clearFilter(); $ctrl.onSubmit()"
pointer>
</vn-icon>
</t-left-icons>
<t-right-icons vn-horizontal>
<vn-icon vn-one
<vn-textfield
class="dense vn-py-md"
placeholder="{{::'Search' | translate}}"
ng-model="$ctrl.searchString">
<prepend>
<vn-icon
icon="search"
ng-click="$ctrl.clearFilter(); $ctrl.onSubmit()"
pointer>
</vn-icon>
</prepend>
<append>
<vn-icon
ng-if="$ctrl.info"
icon="info_outline"
vn-tooltip = "{{$ctrl.info}}"
vn-tooltip="{{$ctrl.info}}"
pointer>
</vn-icon>
<vn-icon vn-one
ng-if="$ctrl.panel"
ng-click="$ctrl.openPanel($event)"
icon="keyboard_arrow_down"
pointer>
</vn-icon>
</t-right-icons>
</vn-textfield>
</vn-horizontal>
</vn-icon>
<vn-icon
ng-if="$ctrl.panel"
ng-click="$ctrl.openPanel($event)"
icon="arrow_drop_down"
pointer>
</vn-icon>
</append>
</vn-textfield>
</form>
<vn-popover
vn-id="popover"

View File

@ -1,12 +1,7 @@
@import "variables";
vn-searchbar {
padding-top: 6px;
display: block;
& > form > vn-horizontal > vn-icon-button {
color: black;
}
}
.search-panel {

View File

@ -0,0 +1,26 @@
import ngModule from '../../module';
import Field from '../field';
export default class Textarea extends Field {
constructor($element, $scope, $compile) {
super($element, $scope, $compile);
let html = `<textarea ng-model="$ctrl.field"></textarea>`;
this.input = $compile(html)($scope)[0];
}
set rows(value) {
this.input.rows = typeof value == 'number' && value > 0 ? value : 3;
}
get rows() {
return this.input.rows;
}
}
ngModule.vnComponent('vnTextarea', {
controller: Textarea,
bindings: {
rows: '<?'
}
});

View File

@ -0,0 +1,39 @@
import './index.js';
describe('Component vnTextarea', () => {
let $element;
let $ctrl;
beforeEach(angular.mock.module('vnCore', $translateProvider => {
$translateProvider.translations('en', {});
}));
beforeEach(angular.mock.inject(($compile, $rootScope) => {
$element = $compile(`<vn-textarea></vn-textarea>`)($rootScope);
$ctrl = $element.controller('vnTextarea');
}));
afterEach(() => {
$element.remove();
});
describe('rows() setter', () => {
it(`should set rows property of the element to the given value if it's a valid number`, () => {
$ctrl.rows = 27;
expect($ctrl.rows).toEqual(27);
});
it(`should set rows property of the element to 3 if the given value if it's null`, () => {
$ctrl.rows = null;
expect($ctrl.rows).toEqual(3);
});
it(`should set rows property of the element to 3 if the given value if it's not a valid number`, () => {
$ctrl.rows = 'a';
expect($ctrl.rows).toEqual(3);
});
});
});

View File

@ -1,24 +0,0 @@
@import "variables";
vn-textarea {
& > .mdl-textfield {
width: initial;
display: block;
}
label {
position: absolute;
bottom: 0;
pointer-events: none;
color: $color-font-secondary;
transition-duration: .2s;
transition-timing-function: cubic-bezier(.4,0,.2,1);
}
& textarea.ng-not-empty+label.placeholder{
top: 5px;
color: $color-main;
padding: 0;
font-size: 12px;
visibility: visible!important;
content: normal!important;
}
}

View File

@ -1,9 +0,0 @@
<div class="mdl-textfield mdl-js-textfield">
<textarea
class="mdl-textfield__input"
type="text"
ng-disabled="$ctrl.disabled"
ng-model="$ctrl.model">
</textarea>
<label class="mdl-textfield__label placeholder" translate>{{$ctrl.label}}</label>
</div>

View File

@ -1,43 +0,0 @@
import ngModule from '../../module';
import './style.scss';
export default class Textarea {
constructor($element, $scope, $attrs, vnTemplate) {
this.$ = $scope;
this.$attrs = $attrs;
this.element = $element;
vnTemplate.normalizeInputAttrs($attrs);
this.textarea = this.element[0].querySelector('textarea');
this.rows = null;
}
set model(value) {
this._model = value;
this.mdlUpdate();
}
set rows(value) {
this.textarea.rows = value ? value : 3;
}
get model() {
return this._model;
}
mdlUpdate() {
let mdlField = this.element[0].firstChild.MaterialTextfield;
if (mdlField)
mdlField.updateClasses_();
componentHandler.upgradeElement(this.element[0].firstChild);
}
}
Textarea.$inject = ['$element', '$scope', '$attrs', 'vnTemplate'];
ngModule.component('vnTextarea', {
template: require('./textarea.html'),
controller: Textarea,
bindings: {
model: '=model',
label: '@?',
rows: '@?',
name: '@?',
disabled: '<?',
rule: '@?'
}
});

View File

@ -1,56 +0,0 @@
import './textarea.js';
describe('Component vnTextarea', () => {
let $scope;
let $attrs;
let $element;
let controller;
beforeEach(angular.mock.module('vnCore', $translateProvider => {
$translateProvider.translations('en', {});
}));
beforeEach(angular.mock.inject(($componentController, $rootScope) => {
$scope = $rootScope.$new();
$attrs = {field: '$ctrl.claim.observation'};
$element = angular.element('<vn-textarea vn-three label="Observation" field="$ctrl.claim.observation" rows="9"><textarea></vn-textarea>');
$element[0].firstChild.MaterialTextfield = {updateClasses_: () => {}};
controller = $componentController('vnTextarea', {$scope, $element, $attrs});
}));
describe('model() setter', () => {
it(`should set model and call mdlUpdate`, () => {
spyOn(controller, 'mdlUpdate');
let model = 'model';
controller.model = model;
expect(controller._model).toEqual(model);
expect(controller.mdlUpdate).toHaveBeenCalledWith();
});
});
describe('rows() setter', () => {
it(`should set rows property of the element to the given value if its not null`, () => {
controller.rows = 27;
expect(controller.textarea.rows).toEqual(27);
});
it(`should set rows property of the element to 3 if the given value if its null`, () => {
controller.rows = null;
expect(controller.textarea.rows).toEqual(3);
});
});
describe('mdlUpdate()', () => {
it(`should should call mdlField.updateClasses if theres an mdlField defined and call upgradeElement with the textarea element`, () => {
spyOn($element[0].firstChild.MaterialTextfield, 'updateClasses_');
spyOn(componentHandler, 'upgradeElement');
controller.mdlUpdate();
expect($element[0].firstChild.MaterialTextfield.updateClasses_).toHaveBeenCalledWith();
expect(componentHandler.upgradeElement).toHaveBeenCalledWith(controller.element[0].firstChild);
});
});
});

View File

@ -1,162 +0,0 @@
@import "variables";
vn-textfield {
margin: 20px 0;
display: inline-block;
width: 100%;
& > .container {
width: 100%;
position: relative;
padding-bottom: 2px;
display: flex;
& > .textField {
width: 100%;
display: flex;
align-items: center;
position: relative;
padding-top: 4px;
}
}
.leftIcons, .rightIcons, .suffix {
display: flex;
color: $color-font-secondary;
.material-icons {
font-size: 20px !important
}
}
.suffix vn-icon-button {
padding: 0
}
t-left-icons {
padding-right: 0.5em
}
t-right-icons {
padding-left: 0.5em
}
.infix {
position: relative;
display: block;
flex: auto;
width: 100%;
min-width: 0;
}
i.clear {
visibility: hidden;
cursor: pointer;
outline: 0;
&:hover {
color: #222;
}
}
&:hover i.clear {
visibility: visible;
}
i.visible {
visibility: visible;
}
label {
position: absolute;
bottom: 0;
left: 0;
padding: 4px 0!important;
pointer-events: none;
color: $color-font-secondary;
transition-duration: .2s;
transition-timing-function: cubic-bezier(.4,0,.2,1);
}
&.not-empty label{
bottom: 24px;
color: $color-main;
padding: 0;
font-size: 12px;
}
input {
outline: none;
border: none;
font-family: "Helvetica", "Arial", sans-serif;
display: block;
font-size: 16px;
width: 100%;
background: 0 0;
color: inherit;
padding: 4px;
box-sizing: border-box;
border-bottom: 0!important;
&[type=number] {
-moz-appearance: textfield;
&::-webkit-outer-spin-button,
&::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
}
&:invalid {
box-shadow: none;
}
}
.underline {
position: absolute;
bottom: 0;
height: 1px;
content: ' ';
pointer-events: none;
width: 100%;
background-color: $color-input-underline;
}
.selected.underline {
background-color: $color-main;
height: 2px;
left: 50%;
width: 0px !important;
transition-duration: 0.2s;
transition-timing-function: cubic-bezier(.4,0,.2,1);
}
div.selected {
&.container{
border-bottom: 0px;
}
label {
bottom: 24px;
color: $color-main;
font-size: 12px;
}
.selected.underline{
left: 0;
width: 100%!important;
}
}
& > div.container > div.textField > div.infix.invalid {
@extend div.selected;
& > span.mdl-textfield__error {
visibility: visible;
}
& > label {
color: #d50000;
}
}
.infix.invalid + .underline {
background-color: #d50000;
}
label span:nth-child(2) {
color: $color-alert
}
}
vn-table {
vn-textfield {
margin: 0;
}
}

View File

@ -1,41 +0,0 @@
<div class="container"
ng-class="{selected: $ctrl.hasFocus}">
<div class="textField">
<div class="leftIcons" ng-transclude="leftIcons"></div>
<div class="infix">
<input
class="mdl-textfield__input"
type="{{$ctrl.type}}"
name="{{$ctrl.name}}"
ng-model="$ctrl.value"
vn-validation="{{$ctrl.rule}}"
ng-disabled="$ctrl.disabled"
ng-readonly="$ctrl.readonly"
ng-focus="$ctrl.hasFocus = true"
ng-blur="$ctrl.hasFocus = false"
tabindex="{{$ctrl.input.tabindex}}"/>
<label class="label">
<span translate>{{::$ctrl.label}}</span>
<span translate ng-show="::$ctrl.required">*</span>
</label>
</div>
<div class="underline"></div>
<div class="selected underline"></div>
<div class="suffix">
<i class="material-icons clear"
translate-attr="{title: 'Clear'}"
ng-show="!$ctrl.disabled
&& $ctrl.hasValue
&& !$ctrl.unclearable"
ng-click="$ctrl.clear()">
clear
</i>
<i class="material-icons"
ng-if="$ctrl.hasInfo"
vn-tooltip="{{$ctrl.info}}">
info_outline
</i>
</div>
<div class="rightIcons" ng-transclude="rightIcons"></div>
</div>
</div>

View File

@ -1,94 +1,13 @@
import ngModule from '../../module';
import Input from '../../lib/input';
import './style.scss';
import Field from '../field';
export default class Textfield extends Input {
constructor($element, $scope, $attrs, vnTemplate) {
super($element, $scope);
vnTemplate.normalizeInputAttrs($attrs);
this._value = null;
this.type = $attrs.type;
this.showActions = false;
this.hasInfo = Boolean($attrs.info);
this.hasFocus = false;
this.hasMouseIn = false;
this.input.addEventListener('keyup', e => {
if (e.defaultPrevented || e.key != 'Escape')
return;
this.value = this.oldValue;
this.cancelled = true;
e.preventDefault();
});
this.input.addEventListener('change', e => {
if (this.onChange && !this.cancelled && (this.oldValue != this.value)) {
this.onChange();
this.saveOldValue();
} else
this.cancelled = false;
});
}
$postLink() {
this.saveOldValue();
}
saveOldValue() {
this.oldValue = this.value;
}
set value(value) {
this._value = (value === undefined || value === '') ? null : value;
this.input.value = this._value;
this.hasValue = this._value != null;
this.element.classList.toggle('not-empty', this.hasValue);
}
get value() {
return this._value;
}
set type(value) {
this._type = value || 'text';
}
get type() {
return this._type;
}
set vnTabIndex(value) {
this.input.tabindex = value;
}
clear() {
this.saveOldValue();
this.value = null;
if (this.onClear) this.onClear();
this.input.focus();
export default class Textfield extends Field {
constructor($element, $scope, $compile) {
super($element, $scope, $compile);
this.buildInput('text');
}
}
Textfield.$inject = ['$element', '$scope', '$attrs', 'vnTemplate'];
ngModule.component('vnTextfield', {
template: require('./textfield.html'),
transclude: {
leftIcons: '?tLeftIcons',
rightIcons: '?tRightIcons'
},
controller: Textfield,
bindings: {
value: '=model',
label: '@?',
name: '@?',
disabled: '<?',
required: '@?',
readonly: '<?',
rule: '@?',
type: '@?',
vnTabIndex: '@?',
onChange: '&',
onClear: '&',
info: '@?'
}
ngModule.vnComponent('vnTextfield', {
controller: Textfield
});

View File

@ -1,84 +0,0 @@
import './textfield.js';
describe('Component vnTextfield', () => {
let $scope;
let $attrs;
let $timeout;
let $element;
let controller;
beforeEach(angular.mock.module('vnCore', $translateProvider => {
$translateProvider.translations('en', {});
}));
beforeEach(angular.mock.inject(($componentController, $rootScope) => {
$scope = $rootScope.$new();
$attrs = {field: '$ctrl.client.phone'};
$element = angular.element('<vn-textfield label="Phone" field="$ctrl.client.phone"><input><div class="leftIcons"><div class="rightIcons"></div></vn-textfield>');
controller = $componentController('vnTextfield', {$scope, $element, $attrs, $timeout, $transclude: () => {}});
}));
describe('saveOldValue()', () => {
it(`should equal oldValue property to the actual input value`, () => {
controller.value = 'pepino';
controller.saveOldValue();
expect(controller.oldValue).toEqual('pepino');
});
});
describe('value() setter', () => {
it(`should set _value, input.value and hasValue properties to null, '' and false`, () => {
let testValue = '';
controller.value = testValue;
expect(controller._value).toEqual(null);
expect(controller.input.value).toEqual(testValue);
expect(controller.hasValue).toEqual(Boolean(testValue));
});
it(`should set _value, input.value and hasValue propertiest to test, test and true`, () => {
let testValue = 'test';
controller.value = testValue;
expect(controller._value).toEqual(testValue);
expect(controller.input.value).toEqual(testValue);
expect(controller.hasValue).toEqual(Boolean(testValue));
});
it(`should add the class not-empty to the div`, () => {
let testValue = 'test';
controller.value = testValue;
expect(controller.element.classList).toContain('not-empty');
});
});
describe('type() setter', () => {
it(`should set _type to 'text' if theres not given value`, () => {
controller.type = null;
expect(controller._type).toEqual('text');
});
});
describe('vnTabIndex() setter', () => {
it(`should set input.tabindex to a given value`, () => {
controller.vnTabIndex = 9;
expect(controller.input.tabindex).toEqual(9);
});
});
describe('clear()', () => {
it(`should set value property to null, call focus and saveOldValue`, () => {
spyOn(controller.input, 'focus');
spyOn(controller, 'saveOldValue');
controller.clear();
expect(controller.value).toEqual(null);
expect(controller.saveOldValue).toHaveBeenCalledWith();
expect(controller.input.focus).toHaveBeenCalledWith();
});
});
});

View File

@ -1,16 +1,13 @@
import ngModule from '../../module';
import Component from '../../lib/component';
import FormInput from '../form-input';
import './style.scss';
/**
* Base component with common logic and styles for checkbox and radio button.
*
* @property {String} label Label to display along the component
* @property {any} field The value with which the element is linked
* @property {Boolean} checked Whether the checkbox is checked
* @property {Boolean} disabled Put component in disabled mode
*/
export default class Toggle extends Component {
export default class Toggle extends FormInput {
constructor($element, $) {
super($element, $);
@ -49,14 +46,10 @@ export default class Toggle extends Component {
this.emit('change', {value: this.field});
}
}
Toggle.$inject = ['$element', '$scope'];
ngModule.vnComponent('vnToggle', {
controller: Toggle,
bindings: {
label: '@?',
field: '=?',
disabled: '<?',
checked: '<?'
}
});

View File

@ -3,7 +3,8 @@
.vn-toggle {
position: relative;
cursor: pointer;
display: inline-block;
display: inline-flex;
align-items: center;
outline: none;
&.disabled {
@ -19,8 +20,9 @@
vertical-align: middle;
width: 20px;
height: 20px;
min-width: 20px;
margin: 6px 0;
margin-right: .4em;
margin-right: .6em;
border: 2px solid #666;
}
&.checked > .btn {

View File

@ -15,7 +15,7 @@
<vn-horizontal ng-repeat="field in fields">
<vn-check
vn-one label="{{titles[field]}}"
field="tableConfiguration.configuration[field]">
ng-model="tableConfiguration.configuration[field]">
</vn-check>
</vn-horizontal>
<vn-horizontal>

View File

@ -30,79 +30,13 @@ export default class Input extends Component {
if (this.mdlElement)
this.mdlElement.updateClasses_();
}
get validationError() {
return this.input.validationMessage;
}
/**
* Validates a valid input value
*
* @return {Boolean} - True if has a valid value
*/
hasValidValue() {
return this.input.checkValidity();
}
/**
* Changes the input element
* if has a validation error
*/
validateValue() {
if (!this.hasValidValue()) {
this.hideError();
this.showError();
} else
this.hideError();
}
/**
* Shows the input validation error
*/
showError() {
const infixElement = this.element.querySelector('.infix');
const infixClassList = infixElement.classList;
const errorSpan = document.createElement('span');
errorSpan.className = 'mdl-textfield__error';
const errorText = document.createTextNode(this.validationError);
errorSpan.append(errorText);
infixElement.append(errorSpan);
infixClassList.add('validated', 'invalid');
}
/**
* Hides the input validation error
*/
hideError() {
const infixElement = this.element.querySelector('.infix');
const infixClassList = infixElement.classList;
const errorElement = this.element.querySelector('.infix span.mdl-textfield__error');
if (errorElement)
errorElement.remove();
infixClassList.remove('validated', 'invalid');
}
}
Input.$inject = ['$element', '$scope'];
export const component = {
transclude: {
leftIcons: '?tLeftIcons',
rightIcons: '?tRightIcons'
},
export const $options = {
bindings: {
label: '@?',
disabled: '<?',
readonly: '<?',
rule: '@?',
value: '=model',
vnTabIndex: '@?',
onChange: '&',
onClear: '&'
readonly: '<?'
}
};

View File

@ -0,0 +1,73 @@
import ngModule from '../module';
/**
* Saves and loads the application configuration.
*/
export default class Config {
constructor($http, vnApp, $translate, $window) {
Object.assign(this, {
$http,
vnApp,
$translate,
user: {},
local: {},
storage: $window.localStorage
});
this.params = [
'warehouseFk',
'companyFk',
'bankFk'
];
}
initialize() {
for (let param of this.params)
this.local[param] = this.getItem(param);
return this.$http.get('api/UserConfigs/getUserConfig')
.then(res => {
for (let param of this.params)
this.user[param] = res.data[param];
this.mergeParams();
});
}
mergeParams() {
for (let param of this.params) {
let local = this.local[param];
this[param] = local != null && local != ''
? local
: this.user[param];
}
}
setUser(param, value) {
this.user[param] = value;
this.mergeParams();
let params = {[param]: value};
return this.$http.post('api/UserConfigs/setUserConfig', params);
}
setLocal(param, value) {
this.setItem(param, value);
this.local[param] = value;
this.mergeParams();
}
getItem(key) {
let value = this.storage[key];
return value !== undefined ? JSON.parse(value) : value;
}
setItem(key, value) {
if (value == null)
this.storage.removeItem(key);
else
this.storage[key] = JSON.stringify(value);
}
}
Config.$inject = ['$http', 'vnApp', '$translate', '$window'];
ngModule.service('vnConfig', Config);

View File

@ -4,3 +4,4 @@ import './auth';
import './token';
import './modules';
import './interceptor';
import './config';

View File

@ -64,14 +64,6 @@ vn-app {
box-sizing: border-box;
padding: $spacing-md;
height: inherit;
form vn-horizontal {
align-items: center;
& > * {
padding: .2em;
}
}
}
vn-main-block {
display: block;
@ -102,11 +94,6 @@ vn-app {
.content-block {
margin-left: 0;
margin-right: 0;
form vn-horizontal {
flex-direction: column;
align-items: initial;
}
}
vn-main-block {
padding-left: 0;
@ -117,3 +104,37 @@ vn-app {
}
}
}
form vn-horizontal {
align-items: center;
& > * {
box-sizing: border-box;
min-height: 2.8em;
padding: 0 $spacing-sm;
&:first-child {
padding-left: 0;
padding-right: $spacing-xs;
}
&:last-child {
padding-left: $spacing-xs;
padding-right: 0;
}
&:first-child:last-child {
padding: 0;
}
}
@media screen and (max-width: $mobile-width) {
flex-direction: column;
align-items: initial;
& > * {
&,
&:first-child,
&:last-child {
padding: 0;
}
}
}
}

View File

@ -6,6 +6,6 @@ import './background/background';
import './side-menu/side-menu';
import './left-menu/left-menu';
import './topbar/topbar';
import './user-configuration-popover';
import './user-popover';
import './descriptor';
import './summary';

View File

@ -3,20 +3,20 @@
<form name="form" ng-submit="$ctrl.submit()">
<vn-textfield
label="User"
model="$ctrl.user"
ng-model="$ctrl.user"
name="user"
vn-id="userField"
vn-focus>
</vn-textfield>
<vn-textfield
label="Password"
model="$ctrl.password"
ng-model="$ctrl.password"
name="password"
type="password">
</vn-textfield>
<vn-check
label="Do not close session"
field="$ctrl.remember"
ng-model="$ctrl.remember"
name="remember">
</vn-check>
<div class="footer">

View File

@ -32,10 +32,8 @@ vn-login {
& > form {
& > vn-textfield {
width: 100%;
margin: 1em 0;
}
& > vn-check {
padding-top: .5em;
display: block;
.md-label {
white-space: inherit;

View File

@ -1,6 +1,6 @@
<div>
<div
ng-click="$ctrl.openUserConfiguration($event)"
ng-click="userPopover.show($event)"
id="user"
class="unselectable">
{{$root.user.nickname}}
@ -15,7 +15,7 @@
id="logout"
icon="exit_to_app"
translate-attr="{title: 'Logout'}"
ng-click="$ctrl.onLogoutClick()">
ng-click="$ctrl.vnAuth.logout()">
</vn-icon-button>
</div>
<vn-menu vn-id="apps-menu">
@ -26,6 +26,6 @@
</li>
</ul>
</vn-menu>
<vn-user-configuration-popover
vn-id="popover">
</vn-user-configuration-popover>
<vn-user-popover
vn-id="user-popover">
</vn-user-popover>

View File

@ -21,14 +21,6 @@ export default class MainMenu {
window.localStorage.currentUserWorkerId = json.data.workerId;
});
}
openUserConfiguration(event) {
this.$.popover.show(event);
}
onLogoutClick() {
this.vnAuth.logout();
}
}
MainMenu.$inject = ['$scope', '$http', 'vnAuth', 'vnModules'];

View File

@ -1,158 +0,0 @@
import ngModule from '../../module';
import './style.scss';
let languages = {
es: 'Español',
en: 'English',
ca: 'Català',
pt: 'Português',
fr: 'Français',
nl: 'Nederlands',
mn: 'Монгол хэл'
};
class Controller {
constructor($scope, $http, $state, vnApp, $translate) {
this.$scope = $scope;
this.$http = $http;
this.$state = $state;
this.vnApp = vnApp;
this.$translate = $translate;
this.getUserConfig();
this.lang = $translate.use();
this.langs = [];
for (let code of $translate.getAvailableLanguageKeys()) {
this.langs.push({
code: code,
name: languages[code] ? languages[code] : code
});
}
}
$onInit() {
if (window.localStorage.localBankFk && window.localStorage.localBankFk !== 'null')
window.localStorage.defaultBankFk = window.localStorage.localBankFk;
else
localStorage.removeItem('defaultBankFk');
}
set lang(value) {
this._lang = value;
this.$translate.use(value);
}
get lang() {
return this._lang;
}
set localBankFk(value) {
window.localStorage.localBankFk = value;
window.localStorage.defaultBankFk = value;
this.showOk();
}
get localBankFk() {
return parseInt(window.localStorage.localBankFk);
}
set localWarehouseFk(value) {
window.localStorage.localWarehouseFk = value;
if (!value && this.warehouseFk)
window.localStorage.defaultWarehouseFk = this.warehouseFk;
else
window.localStorage.defaultWarehouseFk = value;
this.showOk();
}
get localWarehouseFk() {
return parseInt(window.localStorage.localWarehouseFk);
}
set localCompanyFk(value) {
window.localStorage.localCompanyFk = value;
if (!value && this.companyFk)
window.localStorage.defaultCompanyFk = this.companyFk;
else
window.localStorage.defaultCompanyFk = value;
this.showOk();
}
get localCompanyFk() {
return parseInt(window.localStorage.localCompanyFk);
}
set warehouseFk(value) {
this.warehouse = value;
if (value &&
(!window.localStorage.localWarehouseFk || window.localStorage.localWarehouseFk === 'null'))
window.localStorage.defaultWarehouseFk = value;
this.setUserConfig('warehouseFk', value);
}
get warehouseFk() {
return this.warehouse;
}
set companyFk(value) {
this.company = value;
if (value &&
(!window.localStorage.localCompanyFk || window.localStorage.localCompanyFk === 'null'))
window.localStorage.setItem('defaultCompanyFk', value);
this.setUserConfig('companyFk', value);
}
get companyFk() {
return this.company;
}
showOk() {
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
}
show(event) {
this.$scope.warehouses.refresh();
this.$scope.companies.refresh();
this.$scope.popover.parent = event.target;
this.$scope.popover.show();
}
getUserConfig() {
this.$http.get('/api/UserConfigs/getUserConfig')
.then(res => {
if (res.data && res.data.warehouseFk) {
this.warehouse = res.data.warehouseFk;
if (res.data.warehouseFk && !window.localStorage.localWarehouseFk)
window.localStorage.setItem('defaultWarehouseFk', res.data.warehouseFk);
}
if (res.data && res.data.companyFk) {
this.company = res.data.companyFk;
if (res.data.companyFk && !window.localStorage.localCompanyFk)
window.localStorage.setItem('defaultCompanyFk', res.data.companyFk);
}
});
}
setUserConfig(property, value) {
let params = {};
params[property] = value;
this.$http.post('/api/UserConfigs/setUserConfig', params)
.then(() => {
this.showOk();
});
}
searchLocalBank(a, b) {
return angular.equals(a.id, b.id);
}
}
Controller.$inject = ['$scope', '$http', '$state', 'vnApp', '$translate'];
ngModule.component('vnUserConfigurationPopover', {
template: require('./index.html'),
controller: Controller
});

View File

@ -1,96 +0,0 @@
import './index.js';
describe('Salix', () => {
describe('Component vnUserConfigurationPopover', () => {
let controller;
let $httpBackend;
let $scope;
beforeEach(angular.mock.module('salix', $translateProvider => {
$translateProvider.translations('en', {});
}));
beforeEach(angular.mock.inject(($componentController, _$httpBackend_, $rootScope) => {
$httpBackend = _$httpBackend_;
$scope = $rootScope.$new();
controller = $componentController('vnUserConfigurationPopover', {$scope});
}));
describe('localBankFk() setter', () => {
it('should set window.localStorage.localBank and call showOk', () => {
spyOn(controller, 'showOk');
controller.localBankFk = 4;
expect(window.localStorage.localBankFk).toBe('4');
expect(controller.showOk).toHaveBeenCalledWith();
});
});
describe('localWarehouseFk() setter', () => {
it('should set window.localStorage.localWarehouse and call showOk', () => {
spyOn(controller, 'showOk');
controller.localWarehouseFk = 4;
expect(window.localStorage.localWarehouseFk).toBe('4');
expect(controller.showOk).toHaveBeenCalledWith();
});
});
describe('localCompanyFk() setter', () => {
it('should set window.localStorage.localCompany and call showOk', () => {
spyOn(controller, 'showOk');
controller.localCompanyFk = 4;
expect(window.localStorage.localCompanyFk).toBe('4');
expect(controller.showOk).toHaveBeenCalledWith();
});
});
describe('warehouseFk() setter', () => {
it('should set warehouse and call setUserConfig', () => {
spyOn(controller, 'setUserConfig');
controller.warehouseFk = 4;
expect(controller.warehouse).toBe(4);
expect(controller.setUserConfig).toHaveBeenCalledWith('warehouseFk', 4);
});
});
describe('companyFk() setter', () => {
it('should set company and call setUserConfig', () => {
spyOn(controller, 'setUserConfig');
controller.companyFk = 4;
expect(controller.company).toBe(4);
expect(controller.setUserConfig).toHaveBeenCalledWith('companyFk', 4);
});
});
describe('getUserConfig()', () => {
it('should make a query, set company and not set warehouse if its not in the response', () => {
$httpBackend.when('GET', `/api/UserConfigs/getUserConfig`).respond({companyFk: 2});
$httpBackend.expect('GET', `/api/UserConfigs/getUserConfig`);
controller.getUserConfig();
$httpBackend.flush();
expect(controller.warehouse).toBeUndefined();
expect(controller.company).toEqual(2);
});
});
describe('setUserConfig()', () => {
it('should make a query with the property given and call showOk', () => {
spyOn(controller, 'showOk');
controller.company = 1;
$httpBackend.when('GET', `/api/UserConfigs/getUserConfig`).respond({companyFk: 2});
$httpBackend.expect('GET', `/api/UserConfigs/getUserConfig`);
$httpBackend.when('POST', `/api/UserConfigs/setUserConfig`, {companyFk: 1}).respond(200);
$httpBackend.expect('POST', `/api/UserConfigs/setUserConfig`);
controller.setUserConfig('companyFk', 1);
$httpBackend.flush();
expect(controller.showOk).toHaveBeenCalledWith();
});
});
});
});

View File

@ -11,7 +11,7 @@
order="code">
</vn-crud-model>
<vn-popover vn-id="popover">
<vn-vertical class="user-configuration vn-pa-md">
<vn-vertical class="user-popover vn-pa-md">
<div class="profile-card vn-pb-md">
<vn-icon icon="person"></vn-icon>
<div class="vn-pl-md">
@ -29,20 +29,18 @@
</div>
</div>
<vn-autocomplete
vn-one
label="Local warehouse"
id="localWarehouse"
field="$ctrl.localWarehouseFk"
ng-model="$ctrl.localWarehouseFk"
data="warehousesData"
select-fields="['id','name']"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete
vn-one
label="Local bank"
id="localBank"
field="$ctrl.localBankFk"
ng-model="$ctrl.localBankFk"
url="/api/Banks"
select-fields="['id','bank']"
show-field="bank"
@ -52,39 +50,35 @@
<tpl-item>{{id}}: {{bank}}</tpl-item>
</vn-autocomplete>
<vn-autocomplete
vn-one
label="Local company"
id="localCompany"
field="$ctrl.localCompanyFk"
ng-model="$ctrl.localCompanyFk"
data="companiesData"
select-fields="['id','code']"
show-field="code"
value-field="id">
</vn-autocomplete>
<vn-autocomplete
vn-one
label="User warehouse"
id="userWarehouse"
field="$ctrl.warehouseFk"
ng-model="$ctrl.warehouseFk"
data="warehousesData"
select-fields="['id', 'name']"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete
vn-one
label="User company"
id="userCompany"
field="$ctrl.companyFk"
ng-model="$ctrl.companyFk"
data="companiesData"
select-fields="['id', 'code']"
show-field="code"
value-field="id">
</vn-autocomplete>
<vn-autocomplete
vn-one
label="Language"
field="$ctrl.lang"
ng-model="$ctrl.lang"
data="$ctrl.langs"
show-field="name"
value-field="code">

View File

@ -0,0 +1,94 @@
import ngModule from '../../module';
import './style.scss';
let languages = {
es: 'Español',
en: 'English',
ca: 'Català',
pt: 'Português',
fr: 'Français',
nl: 'Nederlands',
mn: 'Монгол хэл'
};
class Controller {
constructor($, $translate, vnConfig) {
Object.assign(this, {
$,
$translate,
vnConfig,
lang: $translate.use(),
langs: []
});
for (let code of $translate.getAvailableLanguageKeys()) {
this.langs.push({
code: code,
name: languages[code] ? languages[code] : code
});
}
vnConfig.initialize();
}
set lang(value) {
this._lang = value;
this.$translate.use(value);
}
get lang() {
return this._lang;
}
set localBankFk(value) {
this.vnConfig.setLocal('bankFk', value);
}
get localBankFk() {
return this.vnConfig.local.bankFk;
}
set localWarehouseFk(value) {
this.vnConfig.setLocal('warehouseFk', value);
}
get localWarehouseFk() {
return this.vnConfig.local.warehouseFk;
}
set localCompanyFk(value) {
this.vnConfig.setLocal('companyFk', value);
}
get localCompanyFk() {
return this.vnConfig.local.companyFk;
}
set warehouseFk(value) {
this.vnConfig.setUser('warehouseFk', value);
}
get warehouseFk() {
return this.vnConfig.user.warehouseFk;
}
set companyFk(value) {
this.vnConfig.setUser('companyFk', value);
}
get companyFk() {
return this.vnConfig.user.companyFk;
}
show(event) {
this.$.warehouses.refresh();
this.$.companies.refresh();
this.$.popover.show(event.target);
}
}
Controller.$inject = ['$scope', '$translate', 'vnConfig'];
ngModule.component('vnUserPopover', {
template: require('./index.html'),
controller: Controller
});

View File

@ -0,0 +1,63 @@
import './index.js';
describe('Salix', () => {
describe('Component vnUserPopover', () => {
let controller;
let $scope;
beforeEach(angular.mock.module('salix', $translateProvider => {
$translateProvider.translations('en', {});
}));
beforeEach(angular.mock.inject(($componentController, $rootScope, $httpBackend) => {
$httpBackend.expectGET('api/UserConfigs/getUserConfig');
$scope = $rootScope.$new();
controller = $componentController('vnUserPopover', {$scope});
}));
afterEach(() => {
$scope.$destroy();
});
describe('localBankFk() setter', () => {
it('should set local bank', () => {
controller.localBankFk = 4;
expect(controller.localBankFk).toBe(4);
});
});
describe('localWarehouseFk() setter', () => {
it('should set local warehouse', () => {
controller.localWarehouseFk = 4;
expect(controller.localWarehouseFk).toBe(4);
});
});
describe('localCompanyFk() setter', () => {
it('should set local company', () => {
controller.localCompanyFk = 4;
expect(controller.localCompanyFk).toBe(4);
});
});
describe('warehouseFk() setter', () => {
it('should set user warehouse', () => {
controller.warehouseFk = 4;
expect(controller.warehouseFk).toBe(4);
});
});
describe('companyFk() setter', () => {
it('should set user company', () => {
controller.companyFk = 4;
expect(controller.companyFk).toBe(4);
});
});
});
});

View File

@ -1,6 +1,6 @@
@import "variables";
.vn-popover .user-configuration {
.vn-popover .user-popover {
width: 16em;
& > .profile-card {

View File

@ -1,4 +1,5 @@
import './module';
import './routes';
import './components';
import './services';
import './styles';

View File

@ -57,10 +57,14 @@ export function run($window, $rootScope, vnAuth, vnApp, $state) {
}
ngModule.run(run);
config.$inject = ['$translatePartialLoaderProvider', '$httpProvider'];
export function config($translatePartialLoaderProvider, $httpProvider) {
config.$inject = ['$translatePartialLoaderProvider', '$httpProvider', '$compileProvider'];
export function config($translatePartialLoaderProvider, $httpProvider, $compileProvider) {
$translatePartialLoaderProvider.addPart(appName);
$httpProvider.interceptors.push('vnInterceptor');
$compileProvider.debugInfoEnabled(false);
$compileProvider.commentDirectivesEnabled(false);
$compileProvider.cssClassDirectivesEnabled(false);
}
ngModule.config(config);

View File

View File

@ -14,7 +14,7 @@
<vn-horizontal>
<vn-textfield
label="Name"
field="$ctrl.zone.name"
ng-model="$ctrl.zone.name"
vn-acl="deliveryBoss"
rule>
</vn-textfield>
@ -22,7 +22,7 @@
<vn-horizontal>
<vn-autocomplete
vn-one
field="$ctrl.zone.agencyModeFk"
ng-model="$ctrl.zone.agencyModeFk"
url="/agency/api/AgencyModes"
show-field="name"
value-field="id"
@ -34,7 +34,7 @@
<vn-horizontal>
<vn-input-number
label="Traveling days"
field="$ctrl.zone.travelingDays"
ng-model="$ctrl.zone.travelingDays"
min="0"
step="1"
vn-acl="deliveryBoss"
@ -42,7 +42,7 @@
</vn-input-number>
<vn-input-time
label="Closing"
field="$ctrl.zone.hour"
ng-model="$ctrl.zone.hour"
vn-acl="deliveryBoss"
rule>
</vn-input-time>
@ -50,7 +50,7 @@
<vn-horizontal>
<vn-input-number
label="Price"
field="$ctrl.zone.price"
ng-model="$ctrl.zone.price"
min="0"
step="0.01"
vn-acl="deliveryBoss"
@ -58,7 +58,7 @@
</vn-input-number>
<vn-input-number
label="Bonus"
field="$ctrl.zone.bonus"
ng-model="$ctrl.zone.bonus"
min="0"
step="0.01"
vn-acl="deliveryBoss"
@ -69,7 +69,7 @@
<vn-input-number
vn-one
label="Inflation"
field="$ctrl.zone.inflation"
ng-model="$ctrl.zone.inflation"
min="0"
step="0.01"
vn-acl="deliveryBoss"
@ -78,7 +78,7 @@
<vn-check
vn-one
label="Volumetric"
field="$ctrl.zone.isVolumetric"
ng-model="$ctrl.zone.isVolumetric"
vn-acl="deliveryBoss"
rule>
</vn-check>

View File

@ -14,13 +14,14 @@
vn-one
vn-focus
label="Name"
field="$ctrl.zone.name">
ng-model="$ctrl.zone.name"
rule>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
vn-one
field="$ctrl.zone.warehouseFk"
ng-model="$ctrl.zone.warehouseFk"
url="/agency/api/Warehouses"
show-field="name"
value-field="id"
@ -29,7 +30,7 @@
</vn-autocomplete>
<vn-autocomplete
vn-one
field="$ctrl.zone.agencyModeFk"
ng-model="$ctrl.zone.agencyModeFk"
url="/agency/api/AgencyModes/isActive"
show-field="name"
value-field="id"
@ -41,7 +42,7 @@
<vn-input-number
vn-two
label="Traveling days"
field="$ctrl.zone.travelingDays"
ng-model="$ctrl.zone.travelingDays"
min="0"
step="1"
rule>
@ -49,7 +50,7 @@
<vn-input-time
vn-two
label="Estimated hour (ETD)"
field="$ctrl.zone.hour"
ng-model="$ctrl.zone.hour"
rule>
</vn-input-time>
</vn-horizontal>
@ -72,7 +73,7 @@
</vn-input-number>
</vn-horizontal>
<vn-horizontal>
<vn-check field="$ctrl.zone.isVolumetric" label="Volumetric"></vn-check>
<vn-check ng-model="$ctrl.zone.isVolumetric" label="Volumetric"></vn-check>
</vn-horizontal>
</vn-card>
<vn-button-bar>

View File

@ -6,7 +6,7 @@
<vn-autocomplete
vn-one
label="Agency"
field="$ctrl.params.agencyModeFk"
ng-model="$ctrl.params.agencyModeFk"
url="/api/AgencyModes/isActive">
</vn-autocomplete>
</vn-horizontal>
@ -14,7 +14,7 @@
<vn-autocomplete
vn-one
label="Province"
field="$ctrl.params.provinceFk"
ng-model="$ctrl.params.provinceFk"
url="/api/Provinces"
fields="['countryFk']"
include="'country'"
@ -29,7 +29,7 @@
<vn-textfield
vn-one
label="Postcode"
model="$ctrl.params.postCode">
ng-model="$ctrl.params.postCode">
</vn-textfield>
</vn-horizontal>
</vn-vertical>

View File

@ -15,14 +15,14 @@
vn-one
vn-focus
label="Name"
field="$ctrl.zone.name"
ng-model="$ctrl.zone.name"
rule>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
vn-one
field="$ctrl.zone.warehouseFk"
ng-model="$ctrl.zone.warehouseFk"
url="/agency/api/Warehouses"
show-field="name"
value-field="id"
@ -31,7 +31,7 @@
</vn-autocomplete>
<vn-autocomplete
vn-one
field="$ctrl.zone.agencyModeFk"
ng-model="$ctrl.zone.agencyModeFk"
url="/agency/api/AgencyModes/isActive"
show-field="name"
value-field="id"
@ -45,13 +45,13 @@
min="0"
step="1"
label="Traveling days"
field="$ctrl.zone.travelingDays"
ng-model="$ctrl.zone.travelingDays"
rule>
</vn-input-number>
<vn-input-time
vn-one
label="Estimated hour (ETD)"
field="$ctrl.zone.hour"
ng-model="$ctrl.zone.hour"
rule>
</vn-input-time>
</vn-horizontal>
@ -59,7 +59,7 @@
<vn-input-number
vn-one
label="Price"
field="$ctrl.zone.price"
ng-model="$ctrl.zone.price"
min="0.00"
step="0.50"
rule>
@ -67,7 +67,7 @@
<vn-input-number
vn-one
label="Bonus"
field="$ctrl.zone.bonus"
ng-model="$ctrl.zone.bonus"
min="0.00"
step="0.50"
rule>

View File

@ -74,17 +74,17 @@
<vn-vertical>
<vn-vertical class="vn-pb-md">
<vn-radio
field="$ctrl.eventType"
ng-model="$ctrl.eventType"
label="One day"
val="day">
</vn-radio>
<vn-radio
field="$ctrl.eventType"
ng-model="$ctrl.eventType"
label="Indefinitely"
val="indefinitely">
</vn-radio>
<vn-radio
field="$ctrl.eventType"
ng-model="$ctrl.eventType"
label="Range of dates"
val="range">
</vn-radio>
@ -99,41 +99,41 @@
{{wday.abr}}
</span>
</div>
<vn-vertical ng-if="$ctrl.eventType == 'day'">
<vn-date-picker
label="Day"
field="$ctrl.selected.from">
</vn-date-picker>
</vn-vertical>
<vn-horizontal ng-if="$ctrl.eventType == 'range'">
<vn-date-picker
ng-if="$ctrl.eventType == 'day'"
label="Day"
ng-model="$ctrl.selected.from">
</vn-date-picker>
<vn-horizontal
ng-if="$ctrl.eventType == 'range'">
<vn-date-picker
label="From"
field="$ctrl.selected.from">
ng-model="$ctrl.selected.from">
</vn-date-picker>
<vn-date-picker
label="To"
field="$ctrl.selected.to">
ng-model="$ctrl.selected.to">
</vn-date-picker>
</vn-horizontal>
<vn-input-time
label="Closing"
field="$ctrl.selected.hour">
ng-model="$ctrl.selected.hour">
</vn-input-time>
<vn-input-number
label="Traveling days"
field="$ctrl.selected.travelingDays"
ng-model="$ctrl.selected.travelingDays"
min="0"
step="1">
</vn-input-number>
<vn-input-number
label="Price"
field="$ctrl.selected.price"
ng-model="$ctrl.selected.price"
min="0"
step="0.01">
</vn-input-number>
<vn-input-number
label="Bonus"
field="$ctrl.selected.bonus"
ng-model="$ctrl.selected.bonus"
min="0"
step="0.01">
</vn-input-number>

View File

@ -8,7 +8,7 @@
<vn-tbody>
<vn-tr ng-repeat="row in data | orderBy:'day'">
<vn-td>{{::row.day | dateTime:'dd/MM/yyyy'}}</vn-td>
<vn-td style="width: 1px; text-align: center">
<vn-td shrink>
<vn-icon-button
icon="delete"
translate-attr="{title: 'Delete'}"
@ -28,9 +28,3 @@
on-selection="$ctrl.onCreate($days)">
</vn-zone-calendar>
</vn-side-menu>
<vn-confirm
vn-id="confirm"
message="This item will be deleted"
question="Are you sure you want to continue?"
on-response="$ctrl.delete(response)">
</vn-confirm>

View File

@ -23,18 +23,9 @@ class Controller extends Section {
}
onDelete(id) {
this.$.confirm.show();
this.deleteId = id;
}
delete(response) {
if (response != 'ACCEPT') return;
if (!this.deleteId) return;
this.$http.delete(`${this.path}/${this.deleteId}`)
.then(() => {
this.refresh();
this.deleteId = null;
});
if (!id) return;
this.$http.delete(`${this.path}/${id}`)
.then(() => this.refresh());
}
}

View File

@ -4,7 +4,7 @@
<vn-textfield
vn-one
label="General search"
model="filter.search"
ng-model="filter.search"
vn-focus>
</vn-textfield>
</vn-horizontal>
@ -12,14 +12,14 @@
<vn-textfield
vn-one
label="Name"
model="filter.name">
ng-model="filter.name">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
vn-one
label="Agency"
field="filter.agencyModeFk"
ng-model="filter.agencyModeFk"
url="/agency/api/AgencyModes/isActive"
show-field="name"
value-field="id">
@ -27,7 +27,7 @@
<vn-autocomplete
vn-one
label="Warehouse"
field="filter.warehouseFk"
ng-model="filter.warehouseFk"
url="/agency/api/Warehouses"
show-field="name"
value-field="id">

View File

@ -15,7 +15,7 @@
fetch-func="$ctrl.onFetch($item)"
sort-func="$ctrl.onSort($a, $b)">
<vn-check
field="item.selected"
ng-model="item.selected"
on-change="$ctrl.onSelection(value, item)"
triple-state="true"
label="{{::item.name}}">

View File

@ -4,7 +4,7 @@
<vn-textfield
vn-one
label="General search"
model="filter.search"
ng-model="filter.search"
info="Search zone by id or name"
vn-focus>
</vn-textfield>
@ -13,14 +13,14 @@
<vn-textfield
vn-one
label="Name"
model="filter.name">
ng-model="filter.name">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
vn-one
label="Agency"
field="filter.agencyModeFk"
ng-model="filter.agencyModeFk"
url="/api/AgencyModes/isActive"
show-field="name"
value-field="id">

View File

@ -27,7 +27,7 @@
</vn-label-value>
<vn-vertical>
<vn-check label="Volumetric" disabled="true"
field="$ctrl.summary.isVolumetric">
ng-model="$ctrl.summary.isVolumetric">
</vn-check>
</vn-vertical>
</vn-one>

View File

@ -7,7 +7,7 @@
<vn-tbody>
<vn-tr ng-repeat="row in data | orderBy:'warehouse.name'">
<vn-td>{{::row.warehouse.name}}</vn-td>
<vn-td style="width: 1px; text-align: center">
<vn-td shrink>
<vn-icon-button
icon="delete"
translate-attr="{title: 'Delete'}"
@ -32,7 +32,7 @@
<tpl-body>
<vn-vertical>
<vn-autocomplete
field="$ctrl.selected.warehouseFk"
ng-model="$ctrl.selected.warehouseFk"
url="/api/Warehouses"
show-field="name"
value-field="id"

View File

@ -44,7 +44,7 @@
<vn-check
vn-one
label="Is paid with mana"
field="$ctrl.claim.isChargedToMana"
ng-model="$ctrl.claim.isChargedToMana"
vn-acl="salesAssistant"
on-change="$ctrl.saveMana(value)">
</vn-check>
@ -86,7 +86,7 @@
<vn-autocomplete
vn-one
id="claimDestinationFk"
field="saleClaimed.claimDestinationFk"
ng-model="saleClaimed.claimDestinationFk"
url="/claim/api/ClaimDestinations"
fields="['id','description']"
value-field="id"

View File

@ -11,7 +11,7 @@
<vn-autocomplete
vn-one
disabled="true"
field="$ctrl.claim.clientFk"
ng-model="$ctrl.claim.clientFk"
url="/client/api/Clients"
show-field="name"
value-field="id"
@ -22,15 +22,15 @@
vn-one
disabled="true"
label="Created"
field="$ctrl.claim.created"
ng-model="$ctrl.claim.created"
options="{enableTime: true}">
</vn-date-picker>
</vn-horizontal>
<vn-horizontal class="vn-py-sm">
<vn-horizontal>
<vn-autocomplete
vn-one
disabled="false"
field="$ctrl.claim.workerFk"
ng-model="$ctrl.claim.workerFk"
url="/api/Clients/activeWorkersWithRole"
show-field="nickname"
search-function="{firstName: $search}"
@ -40,7 +40,7 @@
</vn-autocomplete>
<vn-autocomplete
vn-one
field="$ctrl.claim.claimStateFk"
ng-model="$ctrl.claim.claimStateFk"
url="/claim/api/ClaimStates"
show-field="description"
value-field="id"
@ -49,13 +49,14 @@
</vn-autocomplete>
</vn-horizontal>
</vn-horizontal>
<vn-horizontal class="vn-py-sm">
<vn-horizontal>
<vn-textarea
vn-three
vn-one
label="Observation"
field="$ctrl.claim.observation">
ng-model="$ctrl.claim.observation"
rule>
</vn-textarea>
</vn-horizontal>
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>

View File

@ -40,7 +40,7 @@
<vn-input-number
vn-focus min="0"
step="1"
field="saleClaimed.quantity"
ng-model="saleClaimed.quantity"
on-change="$ctrl.setClaimedQuantity(saleClaimed.id, saleClaimed.quantity)">
</vn-input-number>
</vn-td>
@ -140,7 +140,7 @@
<vn-input-number
vn-focus
label="Discount"
field="$ctrl.newDiscount"
ng-model="$ctrl.newDiscount"
type="text"
step="0.01"
on-change="$ctrl.updateDiscount()"

View File

@ -45,7 +45,7 @@
vn-one
vn-focus
label="Reason"
field="claimDevelopment.claimReasonFk"
ng-model="claimDevelopment.claimReasonFk"
data="claimReasons"
fields="['id', 'description']"
show-field="description"
@ -54,7 +54,7 @@
<vn-autocomplete
vn-one
label="Result"
field="claimDevelopment.claimResultFk"
ng-model="claimDevelopment.claimResultFk"
data="claimResults"
fields="['id', 'description']"
show-field="description"
@ -63,7 +63,7 @@
<vn-autocomplete
vn-one
label="Responsible"
field="claimDevelopment.claimResponsibleFk"
ng-model="claimDevelopment.claimResponsibleFk"
data="claimResponsibles"
fields="['id', 'description']"
show-field="description"
@ -71,7 +71,7 @@
</vn-autocomplete>
<vn-autocomplete
vn-one
field="claimDevelopment.workerFk"
ng-model="claimDevelopment.workerFk"
url="/api/Clients/activeWorkersWithRole"
show-field="nickname"
search-function="{firstName: $search}"
@ -83,7 +83,7 @@
<vn-autocomplete
vn-one
label="Redelivery"
field="claimDevelopment.claimRedeliveryFk"
ng-model="claimDevelopment.claimRedeliveryFk"
data="claimRedeliveries"
fields="['id', 'description']"
show-field="description"

View File

@ -2,13 +2,14 @@ import ngModule from '../../module';
import './style.scss';
class Controller {
constructor($stateParams, $scope, $http, $translate, vnToken, vnApp) {
constructor($stateParams, $scope, $http, $translate, vnToken, vnApp, vnConfig) {
this.$stateParams = $stateParams;
this.$ = $scope;
this.$http = $http;
this.$translate = $translate;
this.accessToken = vnToken.token;
this.vnApp = vnApp;
this.vnConfig = vnConfig;
}
showWorkerDescriptor(event, workerFk) {
@ -49,8 +50,8 @@ class Controller {
}};
return this.$http.get('/api/DmsTypes/findOne', {params}).then(res => {
const dmsTypeId = res.data && res.data.id;
const companyId = window.localStorage.defaultCompanyFk;
const warehouseId = window.localStorage.defaultWarehouseFk;
const companyId = this.vnConfig.companyFk;
const warehouseId = this.vnConfig.warehouseFk;
this.dms = {
hasFile: false,
hasFileAttached: false,
@ -92,7 +93,7 @@ class Controller {
}
}
Controller.$inject = ['$stateParams', '$scope', '$http', '$translate', 'vnToken', 'vnApp'];
Controller.$inject = ['$stateParams', '$scope', '$http', '$translate', 'vnToken', 'vnApp', 'vnConfig'];
ngModule.component('vnClaimDmsIndex', {
template: require('./index.html'),

View File

@ -4,7 +4,7 @@
<vn-textfield
vn-one
label="General search"
model="filter.search"
ng-model="filter.search"
info="Search claim by id or client name"
vn-focus>
</vn-textfield>
@ -13,25 +13,25 @@
<vn-textfield
vn-one
label="Client"
model="filter.client">
ng-model="filter.client">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Claim Id"
model="filter.id">
ng-model="filter.id">
</vn-textfield>
<vn-textfield
vn-one
label="Client Id"
model="filter.clientFk">
ng-model="filter.clientFk">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
vn-one
field="filter.salesPersonFk"
ng-model="filter.salesPersonFk"
url="/client/api/Clients/activeWorkersWithRole"
search-function="{firstName: $search}"
value-field="id"
@ -41,7 +41,7 @@
</vn-autocomplete>
<vn-autocomplete
vn-one
field="filter.attenderFk"
ng-model="filter.attenderFk"
url="/client/api/Clients/activeWorkersWithRole"
search-function="{firstName: $search}"
value-field="id"
@ -53,7 +53,7 @@
<vn-horizontal>
<vn-autocomplete vn-one
label="State"
field="filter.claimStateFk"
ng-model="filter.claimStateFk"
url="/claim/api/ClaimStates"
show-field="description"
value-field="id">
@ -62,7 +62,7 @@
<vn-date-picker
vn-one
label="Created"
field="filter.created">
ng-model="filter.created">
</vn-date-picker>
</vn-horizontal>
<vn-horizontal class="vn-mt-lg">

View File

@ -26,7 +26,7 @@
vn-three
disabled="true"
label="Observation"
model="$ctrl.summary.claim.observation">
ng-model="$ctrl.summary.claim.observation">
</vn-textarea>
</vn-one>
<vn-one>

View File

@ -16,24 +16,42 @@
</vn-crud-model>
<form name="form" ng-submit="$ctrl.onSubmit()" compact>
<vn-card class="vn-pa-lg">
<vn-horizontal class="vn-py-sm">
<vn-check vn-one label="Default" field="$ctrl.data.isDefaultAddress"></vn-check>
<vn-horizontal>
<vn-check
vn-one
label="Default" ng-model="$ctrl.data.isDefaultAddress">
</vn-check>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one label="Consignee" field="$ctrl.address.nickname" vn-focus></vn-textfield>
<vn-textfield vn-one label="Street address" field="$ctrl.address.street"></vn-textfield>
<vn-textfield
vn-one
label="Consignee"
ng-model="$ctrl.address.nickname"
rule
vn-focus>
</vn-textfield>
<vn-textfield
vn-one
label="Street address"
ng-model="$ctrl.address.street"
rule>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-id="province" vn-one
field="$ctrl.address.provinceFk"
<vn-autocomplete
vn-one
vn-id="province"
ng-model="$ctrl.address.provinceFk"
url="/api/Provinces"
show-field="name"
value-field="id"
label="Province">
</vn-autocomplete>
<vn-textfield vn-one
<vn-textfield
vn-one
label="City"
field="$ctrl.address.city">
ng-model="$ctrl.address.city"
rule>
</vn-textfield>
<!-- <vn-autocomplete vn-id="town" vn-one
label="City"
@ -42,12 +60,12 @@
where="{provinceFk: province.selection.id}"
show-field="name"
value-field="name"
field="$ctrl.address.city">
ng-model="$ctrl.address.city">
</vn-autocomplete>
<vn-autocomplete vn-one
url="/api/Postcodes/location"
fields="['code', 'townFk']"
field="$ctrl.address.postalCode"
ng-model="$ctrl.address.postalCode"
selection="$ctrl.postcodeSelection"
search-function="{code: $search}"
where="{townFk: town.selection.id}"
@ -60,9 +78,11 @@
({{town.province.country.country}})
</tpl-item>
</vn-autocomplete> -->
<vn-textfield vn-one
<vn-textfield
vn-one
label="Postcode"
field="$ctrl.address.postalCode">
ng-model="$ctrl.address.postalCode"
rule>
</vn-textfield>
<!--
<vn-icon-button
@ -77,14 +97,24 @@
<vn-horizontal>
<vn-autocomplete
vn-one
field="$ctrl.address.agencyModeFk"
ng-model="$ctrl.address.agencyModeFk"
url="/api/AgencyModes/isActive"
show-field="name"
value-field="id"
label="Agency">
</vn-autocomplete>
<vn-textfield vn-one label="Phone" field="$ctrl.address.phone"></vn-textfield>
<vn-textfield vn-one label="Mobile" field="$ctrl.address.mobile"></vn-textfield>
<vn-textfield
vn-one
label="Phone"
ng-model="$ctrl.address.phone"
rule>
</vn-textfield>
<vn-textfield
vn-one
label="Mobile"
ng-model="$ctrl.address.mobile"
rule>
</vn-textfield>
</vn-horizontal>
</vn-card>
<vn-button-bar>
@ -92,8 +122,8 @@
<button
class="mdl-button mdl-button--raised mdl-button--colored"
translate
ui-sref="client.card.address.index"
>Cancel
ui-sref="client.card.address.index">
Cancel
</button>
</vn-button-bar>
</form>

View File

@ -27,53 +27,77 @@
</vn-crud-model>
<form name="form" ng-submit="$ctrl.onSubmit()" compact>
<vn-card class="vn-pa-lg">
<vn-horizontal class="vn-py-sm">
<vn-check vn-one label="Enabled" field="$ctrl.address.isActive"></vn-check>
<vn-horizontal>
<vn-check
vn-one label="Is equalizated"
field="$ctrl.address.isEqualizated"
vn-one
label="Enabled"
ng-model="$ctrl.address.isActive">
</vn-check>
<vn-check
vn-one
label="Is equalizated"
ng-model="$ctrl.address.isEqualizated"
vn-acl="administrative, salesAssistant">
</vn-check>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one label="Consignee" field="$ctrl.address.nickname" vn-focus></vn-textfield>
<vn-textfield vn-one label="Street" field="$ctrl.address.street"></vn-textfield>
<vn-textfield
vn-one
label="Consignee"
ng-model="$ctrl.address.nickname"
rule
vn-focus>
</vn-textfield>
<vn-textfield
vn-one
label="Street"
ng-model="$ctrl.address.street"
rule>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-id="province" vn-one
field="$ctrl.address.provinceFk"
<vn-autocomplete
vn-one
vn-id="province"
ng-model="$ctrl.address.provinceFk"
url="/api/Provinces"
show-field="name"
value-field="id"
label="Province">
</vn-autocomplete>
<vn-textfield vn-one
<vn-textfield
vn-one
label="City"
field="$ctrl.address.city">
ng-model="$ctrl.address.city"
rule>
</vn-textfield>
<!-- <vn-autocomplete vn-id="town" vn-one
<!--
<vn-autocomplete vn-id="town" vn-one
label="City"
url="/api/Towns"
fields="['id', 'name']"
where="{provinceFk: province.selection.id}"
show-field="name"
value-field="name"
field="$ctrl.address.city">
ng-model="$ctrl.address.city">
</vn-autocomplete>
<vn-autocomplete vn-one
url="/api/Postcodes/location"
fields="['code', 'townFk']"
field="$ctrl.address.postalCode"
ng-model="$ctrl.address.postalCode"
where="{townFk: town.selection.id}"
search-function="{code: $search}"
order="code, townFk"
show-field="code"
value-field="code"
label="Postcode">
</vn-autocomplete> -->
<vn-textfield vn-one
</vn-autocomplete>
-->
<vn-textfield
vn-one
label="Postcode"
field="$ctrl.address.postalCode">
ng-model="$ctrl.address.postalCode"
rule>
</vn-textfield>
<!--
<vn-icon-button
@ -88,14 +112,24 @@
<vn-horizontal>
<vn-autocomplete vn-one
initial-data="$ctrl.address.agencyMode"
field="$ctrl.address.agencyModeFk"
ng-model="$ctrl.address.agencyModeFk"
url="/client/api/AgencyModes/isActive"
show-field="name"
value-field="id"
label="Agency">
</vn-autocomplete>
<vn-textfield vn-one label="Phone" field="$ctrl.address.phone"></vn-textfield>
<vn-textfield vn-one label="Mobile" field="$ctrl.address.mobile"></vn-textfield>
<vn-textfield
vn-one
label="Phone"
ng-model="$ctrl.address.phone"
rule>
</vn-textfield>
<vn-textfield
vn-one
label="Mobile"
ng-model="$ctrl.address.mobile"
rule>
</vn-textfield>
</vn-horizontal>
<vn-title>Notes</vn-title>
<div name="observations">
@ -104,14 +138,14 @@
vn-one
vn-focus
data="types"
field="observation.observationTypeFk"
ng-model="observation.observationTypeFk"
show-field="description"
label="Observation type">
</vn-autocomplete>
<vn-textfield
vn-two
label="Description"
model="observation.description"
ng-model="observation.description"
rule="addressObservation.description">
</vn-textfield>
<vn-none>

View File

@ -44,7 +44,7 @@
</div>
<vn-check
vn-one label="Is equalizated"
field="address.isEqualizated"
ng-model="address.isEqualizated"
disabled="true">
</vn-check>
</vn-one>

View File

@ -11,14 +11,14 @@
<vn-date-picker
vn-one
label="Date"
field="$ctrl.receipt.payed">
ng-model="$ctrl.receipt.payed">
</vn-date-picker>
<vn-autocomplete vn-one
url="/api/Companies"
label="Company"
show-field="code"
value-field="id"
field="$ctrl.receipt.companyFk">
ng-model="$ctrl.receipt.companyFk">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
@ -27,13 +27,13 @@
label="Bank"
show-field="bank"
value-field="id"
field="$ctrl.receipt.bankFk">
ng-model="$ctrl.receipt.bankFk">
</vn-autocomplete>
<vn-input-number
vn-one
vn-focus
label="Amount"
field="$ctrl.receipt.amountPaid"
ng-model="$ctrl.receipt.amountPaid"
step="0.01"
rule>
</vn-input-number>

View File

@ -2,7 +2,7 @@ import ngModule from '../../module';
import './style.scss';
class Controller {
constructor($scope, $state, $http, vnApp, $translate) {
constructor($scope, $state, $http, vnApp, $translate, vnConfig) {
this.$http = $http;
this.$ = $scope;
this.$state = $state;
@ -12,8 +12,8 @@ class Controller {
this.receipt = {
payed: new Date(),
clientFk: this.$state.params.id,
companyFk: window.localStorage.defaultCompanyFk,
bankFk: window.localStorage.defaultBankFk
companyFk: vnConfig.companyFk,
bankFk: vnConfig.bankFk
};
}
@ -86,7 +86,7 @@ class Controller {
});
}
}
Controller.$inject = ['$scope', '$state', '$http', 'vnApp', '$translate'];
Controller.$inject = ['$scope', '$state', '$http', 'vnApp', '$translate', 'vnConfig'];
ngModule.component('vnClientBalanceCreate', {
template: require('./index.html'),

View File

@ -20,7 +20,8 @@
<vn-one>
<vn-autocomplete
vn-id="company"
field="$ctrl.companyFk"
class="dense"
ng-model="$ctrl.companyFk"
on-change="$ctrl.setOrder(value)"
url="/client/api/Companies"
show-field="code"
@ -82,7 +83,7 @@
<vn-td number>{{balance.balance | currency: 'EUR':2}}</vn-td>
<vn-td center>
<vn-check
field="balance.isConciliate"
ng-model="balance.isConciliate"
disabled="true">
</vn-check>
</vn-td>

View File

@ -2,14 +2,14 @@ import ngModule from '../../module';
import './style.scss';
class Controller {
constructor($stateParams, $translate, $scope, vnToken, $http) {
constructor($stateParams, $translate, $scope, vnToken, $http, vnConfig) {
this.$http = $http;
this.$ = $scope;
this.$stateParams = $stateParams;
this.$translate = $translate;
this.accessToken = vnToken.token;
this.companyFk = window.localStorage.defaultCompanyFk;
this.companyFk = vnConfig.companyFk;
this.filter = {
include: {
relation: 'company',
@ -112,7 +112,7 @@ class Controller {
}
}
Controller.$inject = ['$stateParams', '$translate', '$scope', 'vnToken', '$http'];
Controller.$inject = ['$stateParams', '$translate', '$scope', 'vnToken', '$http', 'vnConfig'];
ngModule.component('vnClientBalanceIndex', {
template: require('./index.html'),

View File

@ -12,19 +12,23 @@
<vn-textfield
vn-one
label="Comercial Name"
field="$ctrl.client.name" vn-focus>
ng-model="$ctrl.client.name"
rule
vn-focus>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Contact"
field="$ctrl.client.contact">
ng-model="$ctrl.client.contact"
rule>
</vn-textfield>
<vn-textfield
vn-one
label="Email"
field="$ctrl.client.email"
ng-model="$ctrl.client.email"
rule
info="You can save multiple emails">
</vn-textfield>
</vn-horizontal>
@ -32,18 +36,20 @@
<vn-textfield
vn-one
label="Phone"
field="$ctrl.client.phone">
ng-model="$ctrl.client.phone"
rule>
</vn-textfield>
<vn-textfield
vn-one
label="Mobile"
field="$ctrl.client.mobile">
ng-model="$ctrl.client.mobile"
rule>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
vn-one
field="$ctrl.client.salesPersonFk"
ng-model="$ctrl.client.salesPersonFk"
url="/client/api/Clients/activeWorkersWithRole"
show-field="nickname"
search-function="{firstName: $search}"
@ -54,7 +60,7 @@
</vn-autocomplete>
<vn-autocomplete
vn-one
field="$ctrl.client.contactChannelFk"
ng-model="$ctrl.client.contactChannelFk"
url="/client/api/ContactChannels"
label="Channel">
</vn-autocomplete>

View File

@ -12,7 +12,7 @@
vn-one
label="Billing data"
vn-acl="salesAssistant"
field="$ctrl.client.payMethodFk"
ng-model="$ctrl.client.payMethodFk"
url="/client/api/PayMethods"
fields="['ibanRequired']"
initial-data="$ctrl.client.payMethod">
@ -22,7 +22,7 @@
min="0"
step="1"
label="Due day"
field="$ctrl.client.dueDay"
ng-model="$ctrl.client.dueDay"
vn-acl="salesAssistant"
rule>
</vn-input-number>
@ -31,7 +31,8 @@
<vn-textfield
vn-one
label="IBAN"
field="$ctrl.client.iban"
ng-model="$ctrl.client.iban"
rule
on-change="$ctrl.autofillBic()"
vn-acl="salesAssistant">
</vn-textfield>
@ -39,7 +40,7 @@
vn-one
label="Swift / BIC"
url="/client/api/BankEntities"
field="$ctrl.client.bankEntityFk"
ng-model="$ctrl.client.bankEntityFk"
fields="['name']"
initial-data="$ctrl.client.bankEntityFk"
on-change="$ctrl.autofillBic()"
@ -59,7 +60,6 @@
<append>
<vn-icon-button
vn-auto
class="vn-my-md"
icon="add_circle"
vn-tooltip="New bank entity"
vn-dialog="bankEntityDialog"
@ -68,28 +68,25 @@
</append>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal class="vn-py-sm">
<vn-one>
<vn-check
label="Received LCR"
field="$ctrl.client.hasLcr"
vn-acl="salesAssistant">
</vn-check>
</vn-one>
<vn-one>
<vn-check
label="Received core VNL"
field="$ctrl.client.hasCoreVnl"
vn-acl="salesAssistant">
</vn-check>
</vn-one>
<vn-one>
<vn-check
label="Received B2B VNL"
field="$ctrl.client.hasSepaVnl"
vn-acl="salesAssistant">
</vn-check>
</vn-one>
<vn-horizontal>
<vn-check
vn-one
label="Received LCR"
ng-model="$ctrl.client.hasLcr"
vn-acl="salesAssistant">
</vn-check>
<vn-check
vn-one
label="Received core VNL"
ng-model="$ctrl.client.hasCoreVnl"
vn-acl="salesAssistant">
</vn-check>
<vn-check
vn-one
label="Received B2B VNL"
ng-model="$ctrl.client.hasSepaVnl"
vn-acl="salesAssistant">
</vn-check>
</vn-horizontal>
</vn-card>
<vn-button-bar>
@ -106,16 +103,19 @@
<tpl-body>
<h5 class="vn-py-sm" translate>New bank entity</h5>
<vn-horizontal>
<vn-textfield vn-one
<vn-textfield
vn-one
label="Name"
model="$ctrl.newBankEntity.name"
ng-model="$ctrl.newBankEntity.name"
required="true">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-id="country" vn-one
<vn-autocomplete
vn-one
vn-id="country"
label="Country"
field="$ctrl.newBankEntity.countryFk"
ng-model="$ctrl.newBankEntity.countryFk"
fields="['id', 'country', 'code']"
url="/client/api/Countries"
value-field="id"
@ -124,16 +124,18 @@
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one
<vn-textfield
vn-one
label="Entity Code"
model="$ctrl.newBankEntity.id"
ng-model="$ctrl.newBankEntity.id"
ng-show="country.selection.code === 'ES'">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one
<vn-textfield
vn-one
label="Swift / BIC"
model="$ctrl.newBankEntity.bic"
ng-model="$ctrl.newBankEntity.bic"
required="true">
</vn-textfield>
</vn-horizontal>

View File

@ -83,7 +83,7 @@ export default class Controller {
}
autofillBic() {
if (!this.client.iban) return;
if (!this.client || !this.client.iban) return;
let bankEntityId = parseInt(this.client.iban.substr(4, 4));
let filter = {where: {id: bankEntityId}};

View File

@ -17,14 +17,15 @@
<vn-textfield
vn-one
label="Name"
model="contact.name"
ng-model="contact.name"
rule="clientContact.name">
</vn-textfield>
<vn-textfield
vn-one
label="Phone"
model="contact.phone"
rule="clientContact.phone" vn-focus>
ng-model="contact.phone"
rule="clientContact.phone"
vn-focus>
</vn-textfield>
<vn-none>
<vn-icon-button

View File

@ -9,9 +9,15 @@
<form name="form" vn-http-submit="$ctrl.onSubmit()" compact>
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-textfield vn-two label="Comercial Name" field="$ctrl.client.name" vn-focus></vn-textfield>
<vn-textfield
vn-two
label="Comercial Name"
ng-model="$ctrl.client.name"
rule
vn-focus>
</vn-textfield>
<vn-autocomplete vn-one
field="$ctrl.client.salesPersonFk"
ng-model="$ctrl.client.salesPersonFk"
url="/client/api/Clients/activeWorkersWithRole"
search-function="{firstName: $search}"
show-field="firstName"
@ -22,27 +28,42 @@
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-two label="Business name" field="$ctrl.client.socialName"></vn-textfield>
<vn-textfield vn-one label="Tax number" field="$ctrl.client.fi"></vn-textfield>
<vn-textfield
vn-two
label="Business name"
ng-model="$ctrl.client.socialName"
rule>
</vn-textfield>
<vn-textfield
vn-one
label="Tax number"
ng-model="$ctrl.client.fi"
rule>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-two
label="Street"
field="$ctrl.client.street">
ng-model="$ctrl.client.street"
rule>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-id="country" vn-one
field="$ctrl.client.countryFk"
<vn-autocomplete
vn-id="country"
vn-one
ng-model="$ctrl.client.countryFk"
url="/api/Countries"
show-field="country"
value-field="id"
label="Country">
</vn-autocomplete>
<vn-autocomplete vn-id="province" vn-one
<vn-autocomplete
vn-id="province"
vn-one
url="/api/Provinces"
field="$ctrl.client.provinceFk"
ng-model="$ctrl.client.provinceFk"
where="{countryFk: country.selection.id}"
show-field="name"
value-field="id"
@ -50,9 +71,11 @@
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one
<vn-textfield
vn-one
label="City"
field="$ctrl.client.city">
ng-model="$ctrl.client.city"
rule>
</vn-textfield>
<!--
<vn-autocomplete vn-id="town" vn-one
@ -62,7 +85,7 @@
where="{provinceFk: province.selection.id}"
show-field="name"
value-field="name"
field="$ctrl.client.city">
ng-model="$ctrl.client.city">
</vn-autocomplete>
<vn-icon-button
vn-auto
@ -72,14 +95,16 @@
ng-click="postcode.open()">
</vn-icon-button>
-->
<vn-textfield vn-one
<vn-textfield
vn-one
label="Postcode"
field="$ctrl.client.postcode">
ng-model="$ctrl.client.postcode"
rule>
</vn-textfield>
<!-- <vn-autocomplete vn-one
url="/api/Postcodes/location"
fields="['code', 'townFk']"
field="$ctrl.client.postcode"
ng-model="$ctrl.client.postcode"
selection="$ctrl.postcodeSelection"
search-function="{code: $search}"
where="{townFk: town.selection.id}"
@ -97,20 +122,22 @@
<vn-textfield
vn-one
label="Web user"
field="$ctrl.client.userName">
ng-model="$ctrl.client.userName"
rule>
</vn-textfield>
<vn-textfield
vn-one
label="Email"
field="$ctrl.client.email"
ng-model="$ctrl.client.email"
rule
info="You can save multiple emails">
</vn-textfield>
</vn-horizontal>
<vn-horizontal class="vn-py-sm">
<vn-horizontal>
<vn-check
vn-one
label="Is equalizated"
field="$ctrl.client.isEqualizated">
ng-model="$ctrl.client.isEqualizated">
</vn-check>
</vn-horizontal>
</vn-card>

View File

@ -5,7 +5,7 @@
vn-one
min="0"
label="Credit"
field="$ctrl.creditClassification.credit"
ng-model="$ctrl.creditClassification.credit"
rule="creditInsurance.credit"
vn-focus>
</vn-input-number>
@ -14,13 +14,13 @@
min="0"
step="1"
label="Grade"
field="$ctrl.creditClassification.grade"
ng-model="$ctrl.creditClassification.grade"
rule="CreditInsurance.grade">
</vn-input-number>
<vn-date-picker
vn-one
label="Since"
field="$ctrl.creditClassification.started">
ng-model="$ctrl.creditClassification.started">
</vn-date-picker>
</vn-horizontal>
</vn-card>

View File

@ -12,14 +12,14 @@
vn-one
min="0"
label="Credit"
field="$ctrl.insurance.credit"
ng-model="$ctrl.insurance.credit"
rule="CreditInsurance.credit"
vn-focus>
</vn-input-number>
<vn-date-picker
vn-one
label="Date"
field="$ctrl.insurance.created">
ng-model="$ctrl.insurance.created">
</vn-date-picker>
</vn-horizontal>
<vn-horizontal>
@ -28,7 +28,7 @@
min="0"
step="1"
label="Grade"
field="$ctrl.insurance.grade"
ng-model="$ctrl.insurance.grade"
rule="CreditInsurance.grade">
</vn-input-number>
</vn-horizontal>

View File

@ -12,7 +12,7 @@
vn-one
min="0"
label="Credit"
field="$ctrl.client.credit"
ng-model="$ctrl.client.credit"
vn-focus
rule>
</vn-input-number>

View File

@ -11,13 +11,16 @@
<div compact>
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-textfield vn-one vn-focus
<vn-textfield
vn-one
vn-focus
label="Reference"
field="$ctrl.dms.reference">
ng-model="$ctrl.dms.reference"
rule>
</vn-textfield>
<vn-autocomplete vn-one
label="Company"
field="$ctrl.dms.companyId"
ng-model="$ctrl.dms.companyId"
url="/api/Companies"
show-field="code"
value-field="id">
@ -26,23 +29,25 @@
<vn-horizontal>
<vn-autocomplete vn-one
label="Warehouse"
field="$ctrl.dms.warehouseId"
ng-model="$ctrl.dms.warehouseId"
url="/api/Warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete vn-one
label="Type"
field="$ctrl.dms.dmsTypeId"
ng-model="$ctrl.dms.dmsTypeId"
url="/api/DmsTypes"
show-field="name"
value-field="id">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-textarea vn-one
<vn-textarea
vn-one
label="Description"
field="$ctrl.dms.description">
ng-model="$ctrl.dms.description"
rule>
</vn-textarea>
</vn-horizontal>
<vn-horizontal>
@ -53,19 +58,19 @@
accept="{{$ctrl.allowedContentTypes}}"
required="true"
multiple="true">
<t-right-icons>
<append>
<vn-icon vn-none
color-secondary
title="{{$ctrl.contentTypesInfo}}"
icon="info">
</vn-icon>
</t-right-icons>
</append>
</vn-input-file>
</vn-horizontal>
<vn-vertical>
<vn-check
label="Generate identifier for original file"
field="$ctrl.dms.hasFile">
ng-model="$ctrl.dms.hasFile">
</vn-check>
</vn-vertical>
</vn-card>

View File

@ -2,12 +2,13 @@ import ngModule from '../../module';
import './style.scss';
class Controller {
constructor($scope, $http, $state, $translate, vnApp) {
constructor($scope, $http, $state, $translate, vnApp, vnConfig) {
this.$ = $scope;
this.$http = $http;
this.$state = $state;
this.$translate = $translate;
this.vnApp = vnApp;
this.vnConfig = vnConfig;
this.dms = {
files: [],
hasFile: false,
@ -47,8 +48,8 @@ class Controller {
}};
this.$http.get('/api/DmsTypes/findOne', {params}).then(res => {
const dmsType = res.data && res.data;
const companyId = window.localStorage.defaultCompanyFk;
const warehouseId = window.localStorage.defaultWarehouseFk;
const companyId = this.vnConfig.companyFk;
const warehouseId = this.vnConfig.warehouseFk;
const defaultParams = {
reference: this.client.id,
warehouseId: warehouseId,
@ -104,7 +105,7 @@ class Controller {
}
}
Controller.$inject = ['$scope', '$http', '$state', '$translate', 'vnApp'];
Controller.$inject = ['$scope', '$http', '$state', '$translate', 'vnApp', 'vnConfig'];
ngModule.component('vnClientDmsCreate', {
template: require('./index.html'),

View File

@ -10,13 +10,16 @@
<div compact>
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-textfield vn-one vn-focus
<vn-textfield
vn-one
vn-focus
label="Reference"
field="$ctrl.dms.reference">
ng-model="$ctrl.dms.reference"
rule>
</vn-textfield>
<vn-autocomplete vn-one required="true"
label="Company"
field="$ctrl.dms.companyId"
ng-model="$ctrl.dms.companyId"
url="/api/Companies"
show-field="code"
value-field="id">
@ -25,23 +28,26 @@
<vn-horizontal>
<vn-autocomplete vn-one required="true"
label="Warehouse"
field="$ctrl.dms.warehouseId"
ng-model="$ctrl.dms.warehouseId"
url="/api/Warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete vn-one required="true"
label="Type"
field="$ctrl.dms.dmsTypeId"
ng-model="$ctrl.dms.dmsTypeId"
url="/api/DmsTypes"
show-field="name"
value-field="id">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-textarea vn-one required="true"
<vn-textarea
vn-one
required="true"
label="Description"
field="$ctrl.dms.description">
ng-model="$ctrl.dms.description"
rule>
</vn-textarea>
</vn-horizontal>
<vn-horizontal>
@ -55,7 +61,7 @@
<vn-vertical>
<vn-check disabled="true"
label="Generate identifier for original file"
field="$ctrl.dms.hasFile">
ng-model="$ctrl.dms.hasFile">
</vn-check>
</vn-vertical>
</vn-card>

View File

@ -55,7 +55,7 @@
</vn-td>
<vn-td shrink>
<vn-check disabled="true"
field="document.dms.hasFile">
ng-model="document.dms.hasFile">
</vn-check>
</vn-td>
<vn-td shrink>

View File

@ -12,33 +12,36 @@
vn-two
vn-focus
label="Social name"
model="$ctrl.client.socialName"
ng-model="$ctrl.client.socialName"
rule="client.socialName"
info="You can use letters and spaces">
</vn-textfield>
<vn-textfield
vn-one
label="Tax number"
field="$ctrl.client.fi">
ng-model="$ctrl.client.fi"
rule>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-two
label="Street"
field="$ctrl.client.street">
ng-model="$ctrl.client.street"
rule>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-id="country" vn-one
field="$ctrl.client.countryFk"
<vn-autocomplete vn-id="country"
vn-one
ng-model="$ctrl.client.countryFk"
url="/api/Countries"
show-field="country"
value-field="id"
label="Country">
</vn-autocomplete>
<vn-autocomplete vn-id="province" vn-one
field="$ctrl.client.provinceFk"
ng-model="$ctrl.client.provinceFk"
url="/api/Provinces"
where="{countryFk: country.selection.id}"
show-field="name"
@ -47,13 +50,17 @@
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one
<vn-textfield
vn-one
label="City"
field="$ctrl.client.city">
ng-model="$ctrl.client.city"
rule>
</vn-textfield>
<vn-textfield vn-one
<vn-textfield
vn-one
label="Postcode"
field="$ctrl.client.postcode">
ng-model="$ctrl.client.postcode"
rule>
</vn-textfield>
<!-- <vn-autocomplete vn-id="town" vn-one
label="City"
@ -62,12 +69,12 @@
where="{provinceFk: province.selection.id}"
show-field="name"
value-field="name"
field="$ctrl.client.city">
ng-model="$ctrl.client.city">
</vn-autocomplete>
<vn-autocomplete vn-id="postcode" vn-one
url="/api/Postcodes/location"
fields="['code', 'townFk']"
field="$ctrl.client.postcode"
ng-model="$ctrl.client.postcode"
search-function="{code: $search}"
where="{townFk: town.selection.id}"
order="code, townFk"
@ -76,53 +83,53 @@
label="Postcode">
</vn-autocomplete> -->
</vn-horizontal>
<vn-horizontal class="vn-py-sm">
<vn-horizontal>
<vn-check
vn-one
label="Active"
field="$ctrl.client.isActive">
ng-model="$ctrl.client.isActive">
</vn-check>
<vn-check
vn-one
label="Frozen"
field="$ctrl.client.isFreezed">
ng-model="$ctrl.client.isFreezed">
</vn-check>
</vn-horizontal>
<vn-horizontal class="vn-py-sm">
<vn-horizontal>
<vn-check
vn-one
label="Has to invoice"
field="$ctrl.client.hasToInvoice">
ng-model="$ctrl.client.hasToInvoice">
</vn-check>
<vn-check
vn-one
label="Vies"
field="$ctrl.client.isVies">
ng-model="$ctrl.client.isVies">
</vn-check>
</vn-horizontal>
<vn-horizontal class="vn-py-sm">
<vn-horizontal>
<vn-check
vn-one
label="Invoice by mail"
field="$ctrl.client.isToBeMailed">
ng-model="$ctrl.client.isToBeMailed">
</vn-check>
<vn-check
vn-one
label="Invoice by address"
field="$ctrl.client.hasToInvoiceByAddress">
ng-model="$ctrl.client.hasToInvoiceByAddress">
</vn-check>
</vn-horizontal>
<vn-horizontal class="vn-py-sm">
<vn-horizontal>
<vn-check
vn-one
label="Is equalizated"
field="$ctrl.client.isEqualizated"
ng-model="$ctrl.client.isEqualizated"
info="In order to invoice, this field is not consulted, but the consignee's ET. When modifying this field if the invoice by address option is not checked, the change will be automatically propagated to all addresses, otherwise the user will be asked if he wants to propagate it or not.">
</vn-check>
<vn-check
vn-one
label="Verified data"
field="$ctrl.client.isTaxDataChecked"
ng-model="$ctrl.client.isTaxDataChecked"
vn-acl="salesAssistant">
</vn-check>
</vn-horizontal>

View File

@ -12,26 +12,26 @@
vn-one
vn-focus
label="Amount"
field="$ctrl.greuge.amount"
ng-model="$ctrl.greuge.amount"
step="0.01"
rule>
</vn-input-number>
<vn-date-picker
vn-one
label="Date"
field="$ctrl.greuge.shipped">
ng-model="$ctrl.greuge.shipped">
</vn-date-picker>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Comment"
field="$ctrl.greuge.description"
ng-model="$ctrl.greuge.description"
rule>
</vn-textfield>
<vn-autocomplete
vn-one
field="$ctrl.greuge.greugeTypeFk"
ng-model="$ctrl.greuge.greugeTypeFk"
url="/client/api/greugeTypes"
label="Type"
rule>

View File

@ -1,3 +1,3 @@
import {ng} from 'core/vendor';
export default ng.module('client', ['vnCore']);
export default ng.module('client', ['salix']);

View File

@ -12,9 +12,8 @@
<vn-textarea
vn-one
label="Note"
model="$ctrl.note.text"
vn-focus
padd-medium-top>
ng-model="$ctrl.note.text"
vn-focus>
</vn-textarea>
</vn-horizontal>
</vn-card>

Some files were not shown because too many files have changed in this diff Show More