Deleted unused filter methods, fixed summary css

This commit is contained in:
Joan Sanchez 2018-07-18 13:18:40 +02:00
parent 469bc4c0eb
commit ebf38e225e
22 changed files with 55 additions and 310 deletions

View File

@ -53,7 +53,7 @@
ng-class="{bright: $ctrl.client.isTaxDataChecked == false}"> ng-class="{bright: $ctrl.client.isTaxDataChecked == false}">
</vn-icon> </vn-icon>
</vn-horizontal> </vn-horizontal>
<vn-horizontal pad-medium class="buttons"> <vn-horizontal pad-small class="buttons">
<vn-button <vn-button
vn-tooltip="Client ticket list" vn-tooltip="Client ticket list"
icon="icon-ticket" icon="icon-ticket"

View File

@ -199,16 +199,12 @@
<vn-label-value label="Credit" <vn-label-value label="Credit"
value="{{$ctrl.summary.credit | currency:'€ ':2}}"> value="{{$ctrl.summary.credit | currency:'€ ':2}}">
</vn-label-value> </vn-label-value>
<vn-horizontal>
<vn-one>
<vn-label-value label="Secured credit" <vn-label-value label="Secured credit"
value="{{$ctrl.summary.creditInsurance | currency:'€ ':2}}"> value="{{$ctrl.summary.creditInsurance | currency:'€ ':2}}">
</vn-label-value> </vn-label-value>
</vn-one> <vn-label-value label="Grade"
<vn-one title="Grade"> value="{{$ctrl.grade}}">
{{$ctrl.grade ? '&nbsp;/ ' + $ctrl.grade : '&nbsp;/ - '}} </vn-label-value>
</vn-one>
</vn-horizontal>
</vn-one> </vn-one>
</vn-horizontal> </vn-horizontal>
</vn-vertical> </vn-vertical>

View File

@ -1,3 +1,4 @@
vn-dialog vn-one { vn-dialog vn-one {
min-width: 15em min-width: 15em;
} }

View File

@ -67,4 +67,50 @@
} }
} }
} }
&.dialog-summary {
vn-card {
border: none;
box-shadow: none;
padding: 0;
& > div > vn-vertical {
padding: 0;
margin: 0
}
}
& > div > button.close > vn-icon {
color: $main-01;
}
& > div {
padding: 0
}
tpl-body {
width:auto;
background-color: transparent;
padding: 0 2em
}
.body {
overflow: auto;
margin-top: 2em;
max-height: 700px;
}
form {
min-width: 680px;
}
.buttons {
margin-top: 2em
}
vn-check label span {
font-size: .9em
}
}
} }

View File

@ -24,46 +24,3 @@
margin-bottom: .3em margin-bottom: .3em
} }
} }
.vn-dialog.dialog-summary {
vn-card {
border: none;
box-shadow: none;
}
vn-vertical {
padding: 0 !important
}
& > div > button.close > vn-icon {
color: $main-01;
}
& > div {
padding: 0
}
tpl-body {
width:auto;
background-color: transparent;
padding: 0 2em
}
.body {
overflow: auto;
margin-top: 2em;
max-height: 700px;
}
form {
min-width: 680px;
}
.buttons {
margin-top: 2em
}
vn-check label span {
font-size: .9em
}
}

View File

@ -1,20 +0,0 @@
module.exports = Self => {
Self.installMethod('filter', filterParams);
function filterParams(params) {
return {
where: {
clientFk: params.clientFk
},
skip: (params.page - 1) * parseInt(params.size),
limit: parseInt(params.size),
order: (params.order || 'shipped DESC') + ', id ASC',
include: {
relation: "greugeType",
scope: {
fields: ["id", "name"]
}
}
};
}
};

View File

@ -1,14 +0,0 @@
module.exports = Self => {
Self.installMethod('filter', filterParams);
function filterParams(params) {
return {
where: {
clientFk: params.clientFk
},
skip: (params.page - 1) * params.size,
limit: params.size,
order: params.order
};
}
};

View File

@ -1,28 +0,0 @@
module.exports = Self => {
Self.installMethod('filter', filterParams);
function filterParams(params) {
return {
where: {
clientFk: params.clientFk
},
skip: (params.page - 1) * params.size,
limit: params.size,
order: params.order || 'created DESC',
include: [
{
relation: "mandateType",
scope: {
fields: ["id", "name"]
}
},
{
relation: "company",
scope: {
fields: ["id", "code"]
}
}
]
};
}
};

View File

@ -1,14 +0,0 @@
module.exports = Self => {
Self.installMethod('filter', filterParams);
function filterParams(params) {
return {
where: {
clientFk: params.clientFk
},
skip: (params.page - 1) * params.size,
limit: params.size,
order: params.order
};
}
};

View File

@ -1,5 +1,4 @@
module.exports = function(Self) { module.exports = function(Self) {
require('../methods/greuge/filter')(Self);
require('../methods/greuge/sumAmount')(Self); require('../methods/greuge/sumAmount')(Self);
Self.validatesLengthOf('description', { Self.validatesLengthOf('description', {

View File

@ -1,3 +0,0 @@
module.exports = function(Self) {
require('../methods/invoice-out/filter')(Self);
};

View File

@ -1,3 +0,0 @@
module.exports = function(Self) {
require('../methods/mandate/filter')(Self);
};

View File

@ -1,5 +1,4 @@
module.exports = function(Self) { module.exports = function(Self) {
require('../methods/recovery/filter')(Self);
require('../methods/recovery/hasActiveRecovery')(Self); require('../methods/recovery/hasActiveRecovery')(Self);
Self.validatesPresenceOf('period', {message: 'Period cannot be blank'}); Self.validatesPresenceOf('period', {message: 'Period cannot be blank'});

View File

@ -1,22 +0,0 @@
module.exports = Self => {
Self.installMethod('getLog', filterParams);
function filterParams(params) {
return {
where: {
originFk: params.itemFk
},
skip: (params.page - 1) * params.size,
limit: params.size,
include: [{
relation: "item"
},
{
relation: "user",
scope: {
fields: ["name"]
}
}]
};
}
};

View File

@ -1,3 +0,0 @@
module.exports = Self => {
require('../methods/item-log/getLog')(Self);
};

View File

@ -1,70 +0,0 @@
module.exports = function(Client) {
Client.remoteMethod('listAddresses', {
description: 'List items using a filter',
accessType: 'READ',
accepts: [
{
arg: 'id',
type: 'string',
required: true,
description: 'Model id',
http: {source: 'path'}
},
{
arg: 'filter',
type: 'object',
required: true,
description: 'Filter defining where',
http: function(ctx) {
return ctx.req.query;
}
}
],
returns: {
arg: 'data',
type: ['Address'],
root: true
},
http: {
path: `/:id/listAddresses`,
verb: 'GET'
}
});
Client.listAddresses = function(id, params, callback) {
let filter = {
where: {
clientFk: id
},
skip: (params.page - 1) * params.size,
limit: params.size,
order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'],
include: {observations: 'observationType'}
};
let total = null;
let items = null;
function response(type, value) {
if (type === 'total') {
total = value;
} else {
items = value;
}
if (total !== null && items !== null) {
callback(null, {total: total, items: items});
}
}
Client.app.models.Address.find(filter, function(err, instances) {
if (err) return callback(err);
response('find', instances);
});
Client.app.models.Address.count(filter.where, function(err, total) {
if (err) return callback(err);
response('total', total);
});
};
};

View File

@ -1,20 +0,0 @@
const app = require('../../../../../client/server/server');
const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors;
describe('Client addresses', () => {
it('should call the listAddresses method and receive total results and items', done => {
let id = 1;
let params = {
page: 1,
size: 1
};
let callback = (error, result) => {
if (error) return catchErrors(done)(error);
expect(Object.keys(result)).toEqual(['total', 'items']);
done();
};
app.models.Client.listAddresses(id, params, callback);
});
});

View File

@ -4,9 +4,7 @@ var isMultiple = require('../helpers').isMultiple;
module.exports = Self => { module.exports = Self => {
// Methods // Methods
require('../methods/client/activate')(Self); require('../methods/client/activate')(Self);
require('../methods/client/listAddresses')(Self);
require('../methods/client/card')(Self); require('../methods/client/card')(Self);
require('../methods/client/createWithUser')(Self); require('../methods/client/createWithUser')(Self);
require('../methods/client/listWorkers')(Self); require('../methods/client/listWorkers')(Self);

View File

@ -1,22 +0,0 @@
module.exports = Self => {
Self.installMethod('filter', filterParams);
function filterParams(params) {
return {
where: {
ticketFk: params.ticketFk
},
skip: (params.page - 1) * params.size,
limit: params.size,
order: params.order || 'created DESC',
include: [{
relation: 'item',
scope: {fields: ['name']}
},
{
relation: 'worker',
scope: {fields: ['firstName', 'name']}
}]
};
}
};

View File

@ -1,28 +0,0 @@
module.exports = Self => {
Self.installMethod('filter', filterParams);
function filterParams(params) {
return {
where: {
ticketFk: params.ticketFk
},
skip: (params.page - 1) * params.size,
limit: params.size,
order: params.order || 'created DESC',
include: [
{
relation: "worker",
scope: {
fields: ["firstName", "name"]
}
},
{
relation: "state",
scope: {
fields: ["name"]
}
}
]
};
}
};

View File

@ -1,3 +0,0 @@
module.exports = function(Self) {
require('../methods/expedition/filter.js')(Self);
};

View File

@ -1,5 +1,4 @@
module.exports = function(Self) { module.exports = function(Self) {
require('../methods/ticket-tracking/filter')(Self);
require('../methods/ticket-tracking/changeState')(Self); require('../methods/ticket-tracking/changeState')(Self);
Self.validatesPresenceOf('stateFk', {message: 'State cannot be blank'}); Self.validatesPresenceOf('stateFk', {message: 'State cannot be blank'});