231801_test_to_master #1519

Merged
alexm merged 490 commits from 231801_test_to_master into master 2023-05-12 06:29:59 +00:00
10 changed files with 26 additions and 45 deletions
Showing only changes of commit 2aaded4ed4 - Show all commits

View File

@ -29,19 +29,16 @@ describe('Client Add greuge path', () => {
expect(message.text).toContain('Some fields are invalid');
});
it(`should create a new greuge with all its data`, async() => {
it(`should create a new greuge with all its data and confirm the greuge was added to the list`, async() => {
await page.write(selectors.clientGreuge.amount, '999');
await page.waitForTextInField(selectors.clientGreuge.amount, '999');
await page.write(selectors.clientGreuge.description, 'new armor for Batman!');
await page.waitToClick(selectors.clientGreuge.saveButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should confirm the greuge was added to the list', async() => {
const result = await page.waitToGetProperty(selectors.clientGreuge.firstGreugeText, 'innerText');
expect(message.text).toContain('Data saved!');
expect(result).toContain(999);
expect(result).toContain('new armor for Batman!');
expect(result).toContain('Diff');

View File

@ -236,7 +236,7 @@ export default class CrudModel extends ModelProxy {
this.canceler = this.$q.defer();
this.isPaging = append;
if (!append && this.status != 'ready')
if (!append)
this.status = 'loading';
let params = Object.assign(

View File

@ -8,18 +8,8 @@ export default class Th {
$element.on('click', () => this.onToggleOrder());
}
/**
* Changes the order if the cell has a field and defaultOrder property
*/
$onInit() {
if (!this.field) return;
if (this.defaultOrder) {
this.order = this.defaultOrder;
this.table.applyOrder(this.field, this.order);
this.updateArrow();
}
this.updateArrow();
}
@ -82,9 +72,6 @@ ngModule.vnComponent('vnTh', {
template: require('./index.html'),
transclude: true,
controller: Th,
bindings: {
defaultOrder: '@?'
},
require: {
table: '^^vnTable'
}

View File

@ -14,10 +14,7 @@
order="changedModel"
auto-load="true">
</vn-crud-model>
<vn-data-viewer
model="model"
is-loading="model.isLoading"
class="vn-w-md vn-px-sm">
<vn-data-viewer model="model" class="vn-w-md vn-px-sm">
<div class="change vn-mb-sm" ng-repeat="log in $ctrl.logs">
<div class="user-wrapper">
<vn-avatar class="vn-mt-xs"

View File

@ -7,8 +7,8 @@
data="greuges"
auto-load="true">
</vn-crud-model>
<mg-ajax
path="greuges/{{$ctrl.$params.id}}/sumAmount"
<mg-ajax
path="greuges/{{$ctrl.$params.id}}/sumAmount"
options="mgEdit">
</mg-ajax>
<vn-data-viewer
@ -19,7 +19,7 @@
style="text-align: right;"
class="vn-mb-md vn-pa-lg">
<vn-label-value
label="Total"
label="Total"
value="{{edit.model.sumAmount | currency: 'EUR': 2}}">
</vn-label-value>
</vn-card>
@ -28,7 +28,7 @@
<vn-table model="model" auto-load="false">
<vn-thead>
<vn-tr>
<vn-th field="shipped" default-order="DESC" expand>Date</vn-th>
<vn-th field="shipped" expand>Date</vn-th>
<vn-th field="userFk">Created by</vn-thfield></vn-th>
<vn-th field="description">Comment</vn-th>
<vn-th field="greugeTypeFk">Type</vn-th>
@ -53,11 +53,11 @@
</vn-data-viewer>
<vn-float-button
icon="add"
ui-sref="client.card.greuge.create"
vn-tooltip="New greuge"
ui-sref="client.card.greuge.create"
vn-tooltip="New greuge"
vn-acl="salesAssistant,claimManager"
vn-acl-action="remove"
vn-bind="+"
fixed-bottom-right>
</vn-float-button>
<vn-worker-descriptor-popover vn-id="workerDescriptor"></vn-worker-descriptor-popover>
<vn-worker-descriptor-popover vn-id="workerDescriptor"></vn-worker-descriptor-popover>

View File

@ -11,8 +11,7 @@ class Controller extends Section {
scope: {
fields: ['id', 'name']
},
},
{
}, {
relation: 'user',
scope: {
fields: ['id', 'name']
@ -24,8 +23,6 @@ class Controller extends Section {
}
}
Controller.$inject = ['$element', '$scope'];
ngModule.vnComponent('vnClientGreugeIndex', {
template: require('./index.html'),
controller: Controller

View File

@ -12,11 +12,11 @@
<vn-data-viewer model="model" class="header vn-w-lg">
<vn-card class="vn-pa-lg">
<vn-label-value
label="Total"
label="Total"
value="{{::edit.model.totalVolume}} M³">
</vn-label-value>
<vn-label-value
label="Cajas"
label="Cajas"
value="{{::edit.model.totalBoxes | dashIfEmpty}} U">
</vn-label-value>
</vn-card>
@ -24,7 +24,7 @@
<vn-table model="model">
<vn-thead>
<vn-tr>
<vn-th shrink field="itemFk" default-order="ASC" number>Item</vn-th>
<vn-th shrink field="itemFk" number>Item</vn-th>
<vn-th>Description</vn-th>
<vn-th shrink field="quantity" number>Quantity</vn-th>
<vn-th shrink number>m³ per quantity</vn-th>

View File

@ -6,9 +6,10 @@ class Controller extends Section {
constructor($element, $) {
super($element, $);
this.filter = {
include: [{
include: {
relation: 'item'
}]
},
order: 'itemFk'
};
this.order = {};
this.ticketVolumes = [];

View File

@ -1,4 +1,5 @@
<vn-crud-model auto-load="false"
<vn-crud-model
auto-load="true"
vn-id="model"
url="sales"
filter="::$ctrl.filter"
@ -10,10 +11,10 @@
<vn-card class="vn-pa-lg">
<vn-horizontal>
<div class="totalBox" ng-repeat="packingType in $ctrl.packingTypeVolume">
<vn-label-value label="Tipo"
<vn-label-value label="Tipo"
value="{{::packingType.description}}">
</vn-label-value>
<vn-label-value label="Volumen"
<vn-label-value label="Volumen"
value="{{::packingType.volume}}">
</vn-label-value>
</div>
@ -23,7 +24,7 @@
<vn-thead>
<vn-tr>
<vn-th field="itemFk" number>Item</vn-th>
<vn-th field="concept" default-order="ASC">Description</vn-th>
<vn-th field="concept">Description</vn-th>
<vn-th field="itemPackingTypeFk" number>Packing type</vn-th>
<vn-th field="quantity" number>Quantity</vn-th>
<vn-th number>m³ per quantity</vn-th>

View File

@ -5,9 +5,10 @@ class Controller extends Section {
constructor($element, $) {
super($element, $);
this.filter = {
include: [{
include: {
relation: 'item'
}]
},
order: 'concept'
};
this.ticketVolumes = [];