From a5c11a0154d5a5045cf0765a760b07c52d91d2e2 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 2 May 2023 17:17:16 +0200 Subject: [PATCH 1/2] refs #5517 Hide worker image on error --- front/salix/components/log/index.html | 15 +++++++-------- front/salix/components/log/index.js | 4 ++-- front/salix/components/log/style.scss | 19 +++++++++++-------- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html index b1e5ace12..a51e07cb3 100644 --- a/front/salix/components/log/index.html +++ b/front/salix/components/log/index.html @@ -19,19 +19,18 @@
+
+ {{::log.user ? log.user.name.charAt(0).toUpperCase() : 'S'}} +
+ ng-click="$ctrl.showWorkerDescriptor($event, log.user.worker.id)" + onload="this.style.display = 'block'"> -
- {{::log.user ? log.user.name.charAt(0).toUpperCase() : 'S'}} -
diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index 19bf5b597..b3a27ca5e 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -23,7 +23,7 @@ export default class Controller extends Section { include: [{ relation: 'user', scope: { - fields: ['nickname'], + fields: ['nickname', 'name'], include: { relation: 'worker', scope: { @@ -229,7 +229,7 @@ const colors = [ 'DC143C', // Red crimson '5681cf', // Blue steel 'FF1493', // Ping intense - '00d700', // Green lime + '02ba02', // Green lime '1E90FF', // Blue sky '8B008B', // Purple dark 'cc7000', // Orange bright diff --git a/front/salix/components/log/style.scss b/front/salix/components/log/style.scss index 34c432083..4bf6ca1a2 100644 --- a/front/salix/components/log/style.scss +++ b/front/salix/components/log/style.scss @@ -9,6 +9,7 @@ vn-log { padding-right: 10px; & > .user { + position: relative; border-radius: 50%; height: 36px; width: 36px; @@ -21,19 +22,21 @@ vn-log { width: 100%; height: 100%; } - img { - display: block; - cursor: pointer; + &.system { + background-color: $color-main; } - .user-icon { + .user-letter { font-size: 22px; display: flex; align-items: center; justify-content: center; - - &.system { - background-color: $color-main; - } + } + img { + display: none; + cursor: pointer; + position: absolute; + top: 0; + left: 0; } } & > .arrow { From a029071c4ecddd9d1970874352d009ca87bfbd46 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 2 May 2023 20:47:56 +0200 Subject: [PATCH 2/2] refs #5517 User image fixes --- front/salix/components/log/index.html | 13 +++---------- front/salix/components/log/index.js | 12 ++++++------ front/salix/components/log/style.scss | 1 - 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html index a51e07cb3..00ab23cc9 100644 --- a/front/salix/components/log/index.html +++ b/front/salix/components/log/index.html @@ -26,10 +26,9 @@ {{::log.user ? log.user.name.charAt(0).toUpperCase() : 'S'}}
+ 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)">
@@ -115,12 +114,6 @@
-
- Filter -
diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index b3a27ca5e..46c6cd0f4 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -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', { diff --git a/front/salix/components/log/style.scss b/front/salix/components/log/style.scss index 4bf6ca1a2..ca0c9473c 100644 --- a/front/salix/components/log/style.scss +++ b/front/salix/components/log/style.scss @@ -32,7 +32,6 @@ vn-log { justify-content: center; } img { - display: none; cursor: pointer; position: absolute; top: 0;