Merge pull request '2385 - Replaced worker nickname' (#367) from 2385-worker_descriptor_refactor into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #367
Reviewed-by: Carlos Jimenez <carlosjr@verdnatura.es>
This commit is contained in:
Carlos Jimenez Ruiz 2020-09-09 09:24:19 +00:00
commit b625ea0eb8
39 changed files with 174 additions and 65 deletions

View File

@ -199,7 +199,7 @@ export default {
},
dms: {
deleteFileButton: 'vn-client-dms-index vn-tr:nth-child(1) vn-icon-button[icon="delete"]',
firstDocWorker: 'vn-client-dms-index vn-td:nth-child(7) > span',
firstDocWorker: 'vn-client-dms-index vn-td:nth-child(8) > span',
firstDocWorkerDescriptor: '.vn-popover.shown vn-worker-descriptor'
},
clientContacts: {

View File

@ -106,7 +106,7 @@ module.exports = Self => {
let stmt;
stmt = new ParameterizedSQL(
`SELECT cl.id, c.name, cl.clientFk, cl.workerFk, u.nickName, cs.description, cl.created
`SELECT cl.id, c.name, cl.clientFk, cl.workerFk, u.name AS userName, cs.description, cl.created
FROM claim cl
LEFT JOIN client c ON c.id = cl.clientFk
LEFT JOIN worker w ON w.id = cl.workerFk

View File

@ -12,7 +12,7 @@ class Controller extends ModuleCard {
include: {
relation: 'user',
scope: {
fields: ['nickname']
fields: ['name']
}
}
}

View File

@ -32,20 +32,32 @@
value="{{$ctrl.claim.created | date: 'dd/MM/yyyy HH:mm'}}">
</vn-label-value>
<vn-label-value
label="Salesperson"
value="{{$ctrl.claim.client.salesPersonUser.nickname}}">
label="Salesperson">
<span
ng-click="workerDescriptor.show($event, $ctrl.claim.client.salesPersonFk)"
class="link">
{{$ctrl.claim.client.salesPersonUser.name}}
</span>
</vn-label-value>
<vn-label-value
label="Attended by"
value="{{$ctrl.claim.worker.user.nickname}}">
label="Attended by">
<span
ng-click="workerDescriptor.show($event, $ctrl.claim.worker.userFk)"
class="link">
{{$ctrl.claim.worker.user.name}}
</span>
</vn-label-value>
<vn-label-value
label="Agency"
value="{{$ctrl.claim.ticket.agencyMode.name}}">
</vn-label-value>
<vn-label-value
label="Ticket"
value="{{$ctrl.claim.ticketFk}}">
label="Ticket">
<span
ng-click="ticketDescriptor.show($event, $ctrl.claim.ticketFk)"
class="link">
{{$ctrl.claim.ticketFk}}
</span>
</vn-label-value>
</div>
<div class="quicklinks">
@ -78,4 +90,10 @@
on-accept="$ctrl.deleteClaim()"
question="Delete claim"
message="Are you sure you want to delete this claim?">
</vn-confirm>
</vn-confirm>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
</vn-worker-descriptor-popover>
<vn-ticket-descriptor-popover
vn-id="ticketDescriptor">
</vn-ticket-descriptor-popover>

View File

@ -34,7 +34,7 @@
<span
vn-click-stop="workerDescriptor.show($event, claim.workerFk)"
class="link" >
{{::claim.nickName}}
{{::claim.userName}}
</span>
</vn-td>
<vn-td>

View File

@ -48,7 +48,7 @@ module.exports = Self => {
include: {
relation: 'user',
scope: {
fields: ['nickname']
fields: ['name']
}
}
}

View File

@ -23,7 +23,13 @@
<vn-tbody>
<vn-tr ng-repeat="credit in credits track by credit.id">
<vn-td>{{::credit.created | date:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td>{{::credit.worker.user.nickname}}</vn-td>
<vn-td>
<span
ng-click="workerDescriptor.show($event, credit.worker.userFk)"
class="link">
{{::credit.worker.user.name}}
</span>
</vn-td>
<vn-td number>{{::credit.amount | currency:'EUR':2}}</vn-td>
</vn-tr>
</vn-tbody>
@ -39,3 +45,6 @@
vn-bind="+"
fixed-bottom-right>
</vn-float-button>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
</vn-worker-descriptor-popover>

View File

@ -13,7 +13,7 @@ class Controller extends Section {
include: {
relation: 'user',
scope: {
fields: ['nickname']
fields: ['name']
}
}
}

View File

@ -35,8 +35,12 @@
info="Invoices minus payments plus orders not yet invoiced">
</vn-label-value>
<vn-label-value
label="Sales person"
value="{{$ctrl.client.salesPerson.user.nickname}}">
label="Sales person">
<span
ng-click="workerDescriptor.show($event, $ctrl.client.salesPersonFk)"
class="link">
{{$ctrl.client.salesPerson.user.name}}
</span>
</vn-label-value>
</div>
<div class="icons">
@ -89,4 +93,7 @@
<vn-client-sms
vn-id="sms"
sms="$ctrl.newSMS">
</vn-client-sms>
</vn-client-sms>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
</vn-worker-descriptor-popover>

View File

@ -53,6 +53,12 @@
{{::document.dms.description}}
</span>
</vn-td>
<vn-td shrink>
<vn-check
ng-model="document.dms.hasFile"
disabled="true">
</vn-check>
</vn-td>
<vn-td shrink>
<span title="{{'Download file' | translate}}" class="link"
ng-click="$ctrl.downloadFile(document.dmsFk)">
@ -62,7 +68,7 @@
<vn-td shrink>
<span class="link"
ng-click="workerDescriptor.show($event, document.dms.workerFk)">
{{::document.dms.worker.user.nickname | dashIfEmpty}}
{{::document.dms.worker.user.name | dashIfEmpty}}
</span></vn-td>
<vn-td>
{{::document.dms.created | date:'dd/MM/yyyy HH:mm'}}

View File

@ -32,7 +32,7 @@ class Controller extends Section {
include: {
relation: 'user',
scope: {
fields: ['nickname']
fields: ['name']
}
},
}

View File

@ -32,7 +32,7 @@
<span
ng-click="workerDescriptor.show($event, sample.worker.id)"
class="link">
{{::sample.worker.user.nickname}}
{{::sample.worker.user.name}}
</span>
</vn-td>
<vn-td>{{::sample.company.code}}</vn-td>

View File

@ -18,7 +18,7 @@ class Controller extends Section {
include: {
relation: 'user',
scope: {
fields: ['nickname']
fields: ['name']
}
}
}

View File

@ -21,8 +21,12 @@
<vn-label-value label="Email" ellipsize="false"
value="{{$ctrl.summary.email}}">
</vn-label-value>
<vn-label-value label="Sales person"
value="{{$ctrl.summary.salesPerson.user.nickname}}">
<vn-label-value label="Sales person">
<span
ng-click="workerDescriptor.show($event, $ctrl.summary.salesPersonFk)"
class="link">
{{$ctrl.summary.salesPerson.user.name}}
</span>
</vn-label-value>
<vn-label-value label="Channel"
value="{{$ctrl.summary.contactChannel.name}}">
@ -197,4 +201,7 @@
</vn-vertical>
</vn-one>
</vn-horizontal>
</vn-card>
</vn-card>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
</vn-worker-descriptor-popover>

View File

@ -37,8 +37,12 @@
value="{{$ctrl.invoiceOut.amount | currency: 'EUR': 2}}">
</vn-label-value>
<vn-label-value
label="Client"
value="{{$ctrl.invoiceOut.client.name}}">
label="Client">
<span
ng-click="clientDescriptor.show($event, $ctrl.invoiceOut.client.id)"
class="link">
{{$ctrl.invoiceOut.client.name}}
</span>
</vn-label-value>
<vn-label-value
label="Company"
@ -74,4 +78,7 @@
vn-id="bookConfirmation"
on-accept="$ctrl.bookInvoiceOut()"
question="Are you sure you want to book this invoice?">
</vn-confirm>
</vn-confirm>
<vn-client-descriptor-popover
vn-id="clientDescriptor">
</vn-client-descriptor-popover>

View File

@ -113,7 +113,7 @@ module.exports = Self => {
i.isActive,
t.name type,
t.workerFk buyerFk,
u.nickname userNickname,
u.name userName,
intr.description AS intrastat,
i.stems,
ori.code AS origin,

View File

@ -37,7 +37,7 @@ module.exports = Self => {
include: {
relation: 'user',
scope: {
fields: ['nickname']
fields: ['name']
}
}
}

View File

@ -38,7 +38,7 @@ module.exports = Self => {
include: {
relation: 'user',
scope: {
fields: ['nickname']
fields: ['name']
}
}
}

View File

@ -44,8 +44,12 @@
<slot-body>
<div class="attributes">
<vn-label-value
label="Buyer"
value="{{$ctrl.item.itemType.worker.user.nickname}}">
label="Buyer">
<span
ng-click="workerDescriptor.show($event, $ctrl.item.itemType.worker.userFk)"
class="link">
{{$ctrl.item.itemType.worker.user.name}}
</span>
</vn-label-value>
<vn-label-value
ng-repeat="tag in $ctrl.item.tags | limitTo:4"
@ -96,3 +100,6 @@
question="Do you want to clone this item?"
message="All it's properties will be copied">
</vn-confirm>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
</vn-worker-descriptor-popover>

View File

@ -70,11 +70,11 @@
{{::item.intrastat}}
</vn-td>
<vn-td shrink>{{::item.origin}}</vn-td>
<vn-td shrink title="{{::item.userNickname}}">
<vn-td shrink title="{{::item.userName}}">
<span
class="link"
vn-click-stop="workerDescriptor.show($event, item.buyerFk)">
{{::item.userNickname}}
{{::item.userName}}
</span>
</vn-td>
<vn-td shrink>{{::item.density}}</vn-td>

View File

@ -36,8 +36,12 @@
<vn-label-value label="stems"
value="{{$ctrl.summary.item.stems}}">
</vn-label-value>
<vn-label-value label="Buyer"
value="{{$ctrl.summary.item.itemType.worker.user.nickname}}">
<vn-label-value label="Buyer">
<span
ng-click="workerDescriptor.show($event, $ctrl.summary.item.itemType.worker.userFk)"
class="link">
{{$ctrl.summary.item.itemType.worker.user.name}}
</span>
</vn-label-value>
</vn-one>
<vn-one name="otherData">
@ -105,4 +109,7 @@
</p>
</vn-one>
</vn-horizontal>
</vn-card>
</vn-card>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
</vn-worker-descriptor-popover>

View File

@ -37,7 +37,7 @@ class Controller extends ModuleCard {
include: {
relation: 'user',
scope: {
fields: ['nickname']
fields: ['name']
}
}
}

View File

@ -15,8 +15,12 @@
value="{{$ctrl.$t($ctrl.order.isConfirmed ? 'Confirmed' : 'Not confirmed')}}">
</vn-label-value>
<vn-label-value
label="Sales person"
value="{{$ctrl.order.client.salesPerson.user.nickname}}">
label="Sales person">
<span
ng-click="workerDescriptor.show($event, $ctrl.order.client.salesPersonFk)"
class="link">
{{$ctrl.order.client.salesPerson.user.name}}
</span>
</vn-label-value>
<vn-label-value
label="Landed"
@ -64,4 +68,7 @@
on-accept="$ctrl.deleteOrder()"
message="You are going to delete this order"
question="continue anyway?">
</vn-confirm>
</vn-confirm>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
</vn-worker-descriptor-popover>

View File

@ -119,7 +119,7 @@ module.exports = Self => {
r.m3,
r.description,
am.name agencyName,
u.nickname AS workerNickname,
u.name AS workerUserName,
v.numberPlate AS vehiclePlateNumber
FROM route r
LEFT JOIN agencyMode am ON am.id = r.agencyModeFk
@ -128,7 +128,6 @@ module.exports = Self => {
LEFT JOIN account.user u ON u.id = w.userFk`
);
stmt.merge(conn.makeSuffix(filter));
let itemsIndex = stmts.push(stmt) - 1;

View File

@ -25,7 +25,7 @@ describe('route summary()', () => {
const result = await app.models.Route.summary(1);
const worker = result.route.worker().user();
expect(worker.nickname).toEqual('deliveryNick');
expect(worker.name).toEqual('delivery');
});
it(`should return a summary object containing data from the tickets`, async() => {

View File

@ -38,7 +38,7 @@ module.exports = Self => {
{
relation: 'user',
scope: {
fields: ['id', 'nickname']
fields: ['id', 'name']
}
}
]

View File

@ -38,7 +38,7 @@
<span
class="link"
vn-click-stop="workerDescriptor.show($event, route.workerFk)">
{{::route.workerNickname}}
{{::route.workerUserName}}
</span>
</vn-td>
<vn-td>{{::route.agencyName | dashIfEmpty}}</vn-td>

View File

@ -14,8 +14,12 @@
<vn-label-value label="Vehicle"
value="{{$ctrl.summary.route.vehicle.numberPlate}}">
</vn-label-value>
<vn-label-value label="Driver"
value="{{$ctrl.summary.route.worker.user.nickname}}">
<vn-label-value label="Driver">
<span
ng-click="workerDescriptor.show($event, $ctrl.summary.route.workerFk)"
class="link">
{{$ctrl.summary.route.worker.user.name}}
</span>
</vn-label-value>
<vn-label-value label="Cost"
value="{{$ctrl.summary.route.cost | currency: 'EUR':2}}">
@ -106,3 +110,6 @@
<vn-client-descriptor-popover
vn-id="clientDescriptor">
</vn-client-descriptor-popover>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
</vn-worker-descriptor-popover>

View File

@ -63,7 +63,7 @@ module.exports = Self => {
include: {
relation: 'user',
scope: {
fields: ['nickname']
fields: ['name']
}
}
}

View File

@ -44,7 +44,7 @@ class Controller extends ModuleCard {
include: {
relation: 'user',
scope: {
fields: ['nickname']
fields: ['name']
}
}
}

View File

@ -90,8 +90,12 @@
value="{{$ctrl.ticket.ticketState.state.name}}">
</vn-label-value>
<vn-label-value
label="Sales person"
value="{{$ctrl.ticket.client.salesPerson.user.nickname}}">
label="Sales person">
<span
ng-click="workerDescriptor.show($event, $ctrl.ticket.client.salesPersonFk)"
class="link">
{{$ctrl.ticket.client.salesPerson.user.name}}
</span>
</vn-label-value>
<vn-label-value
label="Shipped"
@ -295,4 +299,7 @@
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Save</button>
</tpl-buttons>
</vn-dialog>
</vn-dialog>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
</vn-worker-descriptor-popover>

View File

@ -210,7 +210,7 @@ class Controller extends Descriptor {
include: {
relation: 'user',
scope: {
fields: ['nickname']
fields: ['name']
}
}
}

View File

@ -51,6 +51,12 @@
{{::document.dms.description}}
</span>
</vn-td>
<vn-td shrink>
<vn-check
ng-model="document.dms.hasFile"
disabled="true">
</vn-check>
</vn-td>
<vn-td shrink>
<span title="{{'Download file' | translate}}" class="link"
ng-click="$ctrl.downloadFile(document.dmsFk)">
@ -60,8 +66,9 @@
<vn-td shrink>
<span class="link"
ng-click="workerDescriptor.show($event, document.dms.workerFk)">
{{::document.dms.worker.user.nickname | dashIfEmpty}}
</span></vn-td>
{{::document.dms.worker.user.name | dashIfEmpty}}
</span>
</vn-td>
<vn-td>
{{::document.dms.created | date:'dd/MM/yyyy HH:mm'}}
</vn-td>

View File

@ -33,7 +33,7 @@ class Controller extends Section {
include: {
relation: 'user',
scope: {
fields: ['nickname']
fields: ['name']
}
},
}

View File

@ -18,8 +18,12 @@
<vn-label-value label="State"
value="{{$ctrl.summary.ticketState.state.name}}">
</vn-label-value>
<vn-label-value label="Salesperson"
value="{{$ctrl.summary.client.salesPerson.user.nickname}}">
<vn-label-value label="Salesperson">
<span
ng-click="workerDescriptor.show($event, $ctrl.summary.client.salesPersonFk)"
class="link">
{{$ctrl.summary.client.salesPerson.user.name}}
</span>
</vn-label-value>
<vn-label-value label="Agency"
value="{{$ctrl.summary.agencyMode.name}}">
@ -239,4 +243,7 @@
</vn-item-descriptor-popover>
<vn-invoice-out-descriptor-popover
vn-id="invoice-out-descriptor">
</vn-invoice-out-descriptor-popover>
</vn-invoice-out-descriptor-popover>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
</vn-worker-descriptor-popover>

View File

@ -25,7 +25,7 @@
<span
class="link"
ng-click="workerDescriptor.show($event, tracking.worker.user.id)">
{{::tracking.worker.user.nickname | dashIfEmpty}}
{{::tracking.worker.user.name | dashIfEmpty}}
</span>
</vn-td>
<vn-td>{{::tracking.created | date:'dd/MM/yyyy HH:mm'}}</vn-td>

View File

@ -13,7 +13,7 @@ class Controller extends Section {
include: {
relation: 'user',
scope: {
fields: ['nickname']
fields: ['name']
}
}
}

View File

@ -1,6 +1,6 @@
Reference: Referencia
Wh. In: Warehouse entrada
Wh. Out: Warehouse salida
Wh. In: Almacén entrada
Wh. Out: Almacén salida
Shipped: F. envío
Landed: F. entrega
Total entries: Entradas totales

View File

@ -18,6 +18,7 @@
<vn-th field="reference" shrink>Reference</vn-th>
<vn-th expand>Description</vn-th>
<vn-th field="hasFile" shrink>Original</vn-th>
<vn-th shrink>File</vn-th>
<vn-th field="created">Created</vn-th>
<vn-th shrink></vn-th>
<vn-th shrink></vn-th>
@ -36,7 +37,13 @@
<span title="{{::document.description}}">
{{::document.description}}
</span>
</vn-td >
</vn-td>
<vn-td shrink>
<vn-check
ng-model="document.dms.hasFile"
disabled="true">
</vn-check>
</vn-td>
<vn-td shrink>
<span title="{{'Download file' | translate}}" class="link"
ng-click="$ctrl.downloadFile(document.dmsFk)">