optional bank entity code #1416
gitea/salix/dev There was a failure building this commit Details

This commit is contained in:
Joan Sanchez 2019-06-17 08:14:48 +02:00
parent 5203c33483
commit 471da18a6c
10 changed files with 35 additions and 11 deletions

View File

@ -14,7 +14,10 @@
translate-attr="{title: 'Clear'}">
</vn-icon>
</div>
<label class="mdl-textfield__label" translate>{{::$ctrl.label}}</label>
<label class="mdl-textfield__label">
<span translate>{{::$ctrl.label}}</span>
<span translate ng-show="::$ctrl.required">(*)</span>
</label>
</div>
</div>
<vn-drop-down

View File

@ -294,6 +294,7 @@ ngModule.component('vnAutocomplete', {
label: '@',
field: '=?',
disabled: '<?',
required: '@?',
showField: '@?',
valueField: '@?',
initialData: '<?',

View File

@ -37,6 +37,10 @@ vn-autocomplete {
display: block;
}
}
label span:nth-child(2) {
color: $color-alert
}
}
ul.vn-autocomplete {

View File

@ -149,6 +149,10 @@ vn-textfield {
.infix.invalid + .underline {
background-color: #d50000;
}
label span:nth-child(2) {
color: $color-alert
}
}
vn-table {

View File

@ -14,7 +14,10 @@
ng-focus="$ctrl.hasFocus = true"
ng-blur="$ctrl.hasFocus = false"
tabindex="{{$ctrl.input.tabindex}}"/>
<label class="label" translate>{{::$ctrl.label}}</label>
<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>

View File

@ -84,6 +84,7 @@ ngModule.component('vnTextfield', {
label: '@?',
name: '@?',
disabled: '<?',
required: '@?',
readonly: '<?',
rule: '@?',
type: '@?',

View File

@ -0,0 +1,5 @@
module.exports = Self => {
Self.validatesPresenceOf('name', {
message: 'Name cannot be blank'
});
};

View File

@ -98,28 +98,33 @@
<vn-horizontal>
<vn-textfield vn-one
label="Name"
model="$ctrl.newBankEntity.name">
model="$ctrl.newBankEntity.name"
required="true">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
<vn-autocomplete vn-id="country" vn-one
label="Country"
field="$ctrl.newBankEntity.countryFk"
fields="['id', 'country', 'code']"
url="/client/api/Countries"
value-field="id"
show-field="country">
show-field="country"
required="true">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one
label="Code"
model="$ctrl.newBankEntity.id">
label="Entity Code"
model="$ctrl.newBankEntity.id"
ng-show="country.selection.code === 'ES'">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one
label="Swift / BIC"
model="$ctrl.newBankEntity.bic">
model="$ctrl.newBankEntity.bic"
required="true">
</vn-textfield>
</vn-horizontal>
</tpl-body>

View File

@ -59,8 +59,6 @@ export default class Controller {
try {
if (!this.newBankEntity.name)
throw new Error(`Name can't be empty`);
if (!this.newBankEntity.id)
throw new Error(`Code can't be empty`);
if (!this.newBankEntity.bic)
throw new Error(`Swift / BIC can't be empty`);

View File

@ -16,4 +16,4 @@ Save: Guardar
New bank entity: Nueva entidad bancaria
Name can't be empty: El nombre no puede quedar vacío
Swift / BIC can't be empty: El Swift / BIC no puede quedar vacío
Code: Código
Entity Code: Código