Merge branch 'dev' into 4507-greuge-add-userFk
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
commit
c320342476
|
@ -23,12 +23,6 @@ module.exports = Self => {
|
|||
|
||||
Self.setPassword = async function(ctx, id, newPassword) {
|
||||
const models = Self.app.models;
|
||||
const userId = ctx.req.accessToken.userId;
|
||||
|
||||
const isSalesPerson = await models.Account.hasRole(userId, 'salesPerson');
|
||||
|
||||
if (!isSalesPerson)
|
||||
throw new UserError(`Not enough privileges to edit a client`);
|
||||
|
||||
const isClient = await models.Client.findById(id, null);
|
||||
const isUserAccount = await models.UserAccount.findById(id, null);
|
||||
|
|
|
@ -6,21 +6,6 @@ describe('Client setPassword', () => {
|
|||
req: {accessToken: {userId: salesPersonId}}
|
||||
};
|
||||
|
||||
it(`should throw an error if you don't have enough permissions`, async() => {
|
||||
let error;
|
||||
const employeeId = 1;
|
||||
const ctx = {
|
||||
req: {accessToken: {userId: employeeId}}
|
||||
};
|
||||
try {
|
||||
await models.Client.setPassword(ctx, 1, 't0pl3v3l.p455w0rd!');
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
expect(error.message).toEqual(`Not enough privileges to edit a client`);
|
||||
});
|
||||
|
||||
it('should throw an error the setPassword target is not just a client but a worker', async() => {
|
||||
let error;
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ module.exports = Self => {
|
|||
JOIN client c ON c.id = o.customer_id
|
||||
JOIN address a ON a.id = o.address_id
|
||||
JOIN agencyMode am ON am.id = o.agency_id
|
||||
JOIN user u ON u.id = c.salesPersonFk
|
||||
JOIN account.user u ON u.id = c.salesPersonFk
|
||||
JOIN workerTeamCollegues wtc ON c.salesPersonFk = wtc.collegueFk`);
|
||||
|
||||
if (!filter.where) filter.where = {};
|
||||
|
|
|
@ -89,7 +89,7 @@ class Controller extends Section {
|
|||
getUsesMana() {
|
||||
this.$http.get(`Sales/usesMana`)
|
||||
.then(res => {
|
||||
this.useMana = res.data;
|
||||
this.usesMana = res.data;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<div>{{$t('clientId')}}: <strong>{{client.id}}</strong></div>
|
||||
<div>{{$t('user')}}: <strong>{{client.userName}}</strong></div>
|
||||
<div>{{$t('password')}}: <strong>********</strong>
|
||||
(<a href="https://verdnatura.es">{{$t('passwordResetText')}}</a>)
|
||||
(<a href="https://shop.verdnatura.es">{{$t('passwordResetText')}}</a>)
|
||||
</div>
|
||||
</p>
|
||||
|
||||
|
@ -53,4 +53,4 @@
|
|||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</email-body>
|
||||
</email-body>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
subject: Bienvenido a Verdnatura
|
||||
title: "¡Te damos la bienvenida!"
|
||||
dearClient: Estimado cliente
|
||||
clientData: 'Tus datos para poder comprar en la web de Verdnatura (<a href="https://verdnatura.es"
|
||||
title="Visitar Verdnatura" target="_blank" style="color: #8dba25">https://verdnatura.es</a>)
|
||||
clientData: 'Tus datos para poder comprar en la web de Verdnatura (<a href="https://shop.verdnatura.es"
|
||||
title="Visitar Verdnatura" target="_blank" style="color: #8dba25">https://shop.verdnatura.es</a>)
|
||||
o en nuestras aplicaciones para <a href="https://goo.gl/3hC2mG" title="App Store"
|
||||
target="_blank" style="color: #8dba25">iOS</a> y <a href="https://goo.gl/8obvLc"
|
||||
title="Google Play" target="_blank" style="color: #8dba25">Android</a>, son'
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
const Stylesheet = require(`vn-print/core/stylesheet`);
|
||||
|
||||
const path = require('path');
|
||||
const vnPrintPath = path.resolve('print');
|
||||
|
||||
module.exports = new Stylesheet([
|
||||
`${vnPrintPath}/common/css/spacing.css`,
|
||||
`${vnPrintPath}/common/css/misc.css`,
|
||||
`${vnPrintPath}/common/css/layout.css`,
|
||||
`${vnPrintPath}/common/css/email.css`])
|
||||
.mergeStyles();
|
|
@ -0,0 +1,6 @@
|
|||
[
|
||||
{
|
||||
"filename": "vehicle-event-expired.pdf",
|
||||
"component": "vehicle-event-expired"
|
||||
}
|
||||
]
|
|
@ -0,0 +1,3 @@
|
|||
subject: Expiración Tarjetas Vehículos
|
||||
title: Expiración Tarjetas Vehículos
|
||||
description: A continuación se adjunta el informe de expiración de tarjetas vehículos
|
|
@ -0,0 +1,8 @@
|
|||
<email-body v-bind="$props">
|
||||
<div class="grid-row">
|
||||
<div class="grid-block vn-pa-ml">
|
||||
<h1>{{ $t('title') }}</h1>
|
||||
<p v-html="$t('description')"></p>
|
||||
</div>
|
||||
</div>
|
||||
</email-body>
|
|
@ -0,0 +1,9 @@
|
|||
const Component = require(`vn-print/core/component`);
|
||||
const emailBody = new Component('email-body');
|
||||
|
||||
module.exports = {
|
||||
name: 'vehicle-event-expired',
|
||||
components: {
|
||||
'email-body': emailBody.build()
|
||||
}
|
||||
};
|
|
@ -1,9 +1,12 @@
|
|||
const Stylesheet = require(`${appPath}/core/stylesheet`);
|
||||
const Stylesheet = require(`vn-print/core/stylesheet`);
|
||||
|
||||
const path = require('path');
|
||||
const vnPrintPath = path.resolve('print');
|
||||
|
||||
module.exports = new Stylesheet([
|
||||
`${appPath}/common/css/spacing.css`,
|
||||
`${appPath}/common/css/misc.css`,
|
||||
`${appPath}/common/css/layout.css`,
|
||||
`${appPath}/common/css/report.css`,
|
||||
`${vnPrintPath}/common/css/spacing.css`,
|
||||
`${vnPrintPath}/common/css/misc.css`,
|
||||
`${vnPrintPath}/common/css/layout.css`,
|
||||
`${vnPrintPath}/common/css/report.css`,
|
||||
`${__dirname}/style.css`])
|
||||
.mergeStyles();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const Component = require(`${appPath}/core/component`);
|
||||
const Component = require(`vn-print/core/component`);
|
||||
const reportBody = new Component('report-body');
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const Component = require(`${appPath}/core/component`);
|
||||
const Component = require(`vn-print/core/component`);
|
||||
const reportBody = new Component('report-body');
|
||||
|
||||
module.exports = {
|
||||
|
|
Loading…
Reference in New Issue