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

View File

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

View File

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