refs #5517 User image fixes
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2023-05-02 20:47:56 +02:00
parent 0ed6fe3d32
commit a029071c4e
3 changed files with 9 additions and 17 deletions

View File

@ -26,10 +26,9 @@
{{::log.user ? log.user.name.charAt(0).toUpperCase() : 'S'}} {{::log.user ? log.user.name.charAt(0).toUpperCase() : 'S'}}
</div> </div>
<img <img
ng-if="::log.user.worker" ng-if="::log.user.image"
src="/api/Images/user/160x160/{{::log.user.worker.id}}/download?access_token={{::$ctrl.vnToken.token}}" ng-src="/api/Images/user/160x160/{{::log.userFk}}/download?access_token={{::$ctrl.vnToken.token}}"
ng-click="$ctrl.showWorkerDescriptor($event, log.user.worker.id)" ng-click="$ctrl.showWorkerDescriptor($event, log)">
onload="this.style.display = 'block'">
</img> </img>
</div> </div>
<div class="arrow bg-panel"></div> <div class="arrow bg-panel"></div>
@ -115,12 +114,6 @@
<form vn-vertical <form vn-vertical
ng-model-options="{updateOn: 'change blur'}" ng-model-options="{updateOn: 'change blur'}"
class="vn-pa-md filter"> class="vn-pa-md filter">
<h6
class="text-secondary vn-mb-md"
style="font-weight: normal;"
translate>
Filter
</h6>
<vn-textfield <vn-textfield
label="Name" label="Name"
ng-model="filter.changedModelValue"> ng-model="filter.changedModelValue">

View File

@ -23,7 +23,7 @@ export default class Controller extends Section {
include: [{ include: [{
relation: 'user', relation: 'user',
scope: { scope: {
fields: ['nickname', 'name'], fields: ['nickname', 'name', 'image'],
include: { include: {
relation: 'worker', relation: 'worker',
scope: { scope: {
@ -120,11 +120,6 @@ export default class Controller extends Section {
return this.dateFilter(date, `${format} HH:mm`); return this.dateFilter(date, `${format} HH:mm`);
} }
showWorkerDescriptor(event, workerId) {
if (!workerId) return;
this.$.workerDescriptor.show(event.target, workerId);
}
resetFilter() { resetFilter() {
this.$.filter = {who: 'all'}; this.$.filter = {who: 'all'};
} }
@ -201,6 +196,11 @@ export default class Controller extends Section {
backgroundColor: '#'+ colors[hash % colors.length] backgroundColor: '#'+ colors[hash % colors.length]
}; };
} }
showWorkerDescriptor(event, log) {
if (log.user?.worker)
this.$.workerDescriptor.show(event.target, log.userFk);
}
} }
ngModule.vnComponent('vnLog', { ngModule.vnComponent('vnLog', {

View File

@ -32,7 +32,6 @@ vn-log {
justify-content: center; justify-content: center;
} }
img { img {
display: none;
cursor: pointer; cursor: pointer;
position: absolute; position: absolute;
top: 0; top: 0;