refs #4945 changed input-number for autocomplete
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alexandre Riera 2023-01-20 12:01:13 +01:00
parent 199fabbb1a
commit a473d3a6f9
4 changed files with 18 additions and 11 deletions

View File

@ -428,7 +428,7 @@ export default {
},
itemCreateView: {
temporalName: 'vn-item-create vn-textfield[ng-model="$ctrl.item.provisionalName"]',
priority: 'vn-input-number[ng-model="$ctrl.item.priority"]',
priority: 'vn-autocomplete[ng-model="$ctrl.item.priority"]',
type: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]',
intrastat: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]',
origin: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]',

View File

@ -41,7 +41,7 @@ describe('Item Create', () => {
await page.autocompleteSearch(selectors.itemCreateView.type, 'Crisantemo');
await page.autocompleteSearch(selectors.itemCreateView.intrastat, 'Coral y materiales similares');
await page.autocompleteSearch(selectors.itemCreateView.origin, 'Holand');
await page.overwrite(selectors.itemCreateView.priority, '100');
await page.clearInput(selectors.itemCreateView.priority);
await page.waitToClick(selectors.itemCreateView.createButton);
const message = await page.waitForSnackbar();
@ -49,7 +49,7 @@ describe('Item Create', () => {
});
it('should create the Infinity Gauntlet item', async() => {
await page.overwrite(selectors.itemCreateView.priority, '2');
await page.autocompleteSearch(selectors.itemCreateView.priority, '2');
await page.waitToClick(selectors.itemCreateView.createButton);
const message = await page.waitForSnackbar();

View File

@ -16,22 +16,24 @@
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-textfield
label="Temporal name"
label="Name"
ng-model="$ctrl.item.provisionalName"
vn-focus>
</vn-textfield>
<vn-autocomplete
ng-model="$ctrl.item.tag"
translate-fields="['name']"
url="Tags"
show-field="name"
value-field="id"
label="Tag">
</vn-autocomplete>
<vn-input-number
<vn-autocomplete
data="$ctrl.validPriorities"
label="Priority"
ng-model="$ctrl.item.priority">
</vn-input-number>
ng-model="$ctrl.item.priority"
show-field="priority"
value-field="priority">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete

View File

@ -8,13 +8,18 @@ class Controller extends Section {
}
fetchDefaultPriorityTag() {
const filter = {fields: ['defaultPriority', 'defaultTag'], limit: 1};
this.validPriorities = [];
const filter = {fields: ['defaultPriority', 'defaultTag', 'validPriorities'], limit: 1};
this.$http.get(`ItemConfigs`, {filter})
.then(res => {
if (res.data) {
const dataRow = res.data[0];
dataRow.validPriorities.forEach(priority => {
this.validPriorities.push({priority});
});
this.item = {
priority: res.data[0].defaultPriority,
tag: res.data[0].defaultTag
priority: dataRow.defaultPriority,
tag: dataRow.defaultTag
};
}
});