From bb443fd4af4554a28e0f5531d65951a01559a267 Mon Sep 17 00:00:00 2001 From: Sean Engelhardt Date: Mon, 17 Jun 2019 12:50:53 +0200 Subject: [PATCH] Add more user list options - Adds an icon with tooltip if a user is inactive to the user list - always show the 'present'-column, even though the user is not active - add a info icon if the user has a "comment". The content of the content is displayed in the tooltip --- .../icon-container.component.html | 3 +- .../icon-container.component.ts | 7 +++++ client/src/app/site/base/list-view-base.ts | 11 +++++++ .../user-list/user-list.component.html | 30 +++++++++++++++---- .../user-list/user-list.component.scss | 4 +++ client/src/styles.scss | 5 ++++ 6 files changed, 53 insertions(+), 7 deletions(-) diff --git a/client/src/app/shared/components/icon-container/icon-container.component.html b/client/src/app/shared/components/icon-container/icon-container.component.html index acbfd0229..df76ef155 100644 --- a/client/src/app/shared/components/icon-container/icon-container.component.html +++ b/client/src/app/shared/components/icon-container/icon-container.component.html @@ -1,4 +1,5 @@ -{{ icon }} +{{ icon }} +{{ icon }} diff --git a/client/src/app/shared/components/icon-container/icon-container.component.ts b/client/src/app/shared/components/icon-container/icon-container.component.ts index dc0148a8d..36bf635e2 100644 --- a/client/src/app/shared/components/icon-container/icon-container.component.ts +++ b/client/src/app/shared/components/icon-container/icon-container.component.ts @@ -30,4 +30,11 @@ export class IconContainerComponent { */ @Input() public size: 'medium' | 'large' = 'medium'; + + /** + * Reverse text and icon. + * Show the icon behind the text + */ + @Input() + public swap = false; } diff --git a/client/src/app/site/base/list-view-base.ts b/client/src/app/site/base/list-view-base.ts index d9daec998..f0e260b14 100644 --- a/client/src/app/site/base/list-view-base.ts +++ b/client/src/app/site/base/list-view-base.ts @@ -8,6 +8,7 @@ import { PblDataSource, PblColumnDefinition } from '@pebula/ngrid'; import { BaseViewComponent } from './base-view'; import { BaseViewModel } from './base-view-model'; import { StorageService } from 'app/core/core-services/storage.service'; +import { ViewUser } from '../users/models/view-user'; export abstract class ListViewBaseComponent extends BaseViewComponent implements OnDestroy { /** @@ -111,4 +112,14 @@ export abstract class ListViewBaseComponent extends Bas public saveScrollIndex(key: string, index: number): void { this.storage.set(`scroll_${key}`, index); } + + /** + * If the user is not active, formulate a tooltip accordingly + * + * @param user + * @returns "Inactive" as (untranslated) string if the given user is not active + */ + public getUserTooltip(user: ViewUser): string { + return user.is_active ? '' : 'Inactive'; + } } diff --git a/client/src/app/site/users/components/user-list/user-list.component.html b/client/src/app/site/users/components/user-list/user-list.component.html index 3e7dd2cdc..c90d8a401 100644 --- a/client/src/app/site/users/components/user-list/user-list.component.html +++ b/client/src/app/site/users/components/user-list/user-list.component.html @@ -32,9 +32,18 @@ (click)="saveScrollIndex('user', rowContext.identity)" [routerLink]="user.id" *ngIf="!isMultiSelect" + matTooltip="{{ getUserTooltip(user) | translate }}" >
- {{ name }} + + {{ name }} + + + + + {{ name }} + +
@@ -65,6 +74,7 @@
+ mail + + + + comment +
-
- - Present - -
+ + Present +
diff --git a/client/src/app/site/users/components/user-list/user-list.component.scss b/client/src/app/site/users/components/user-list/user-list.component.scss index d9f27e3d8..27eabb620 100644 --- a/client/src/app/site/users/components/user-list/user-list.component.scss +++ b/client/src/app/site/users/components/user-list/user-list.component.scss @@ -9,3 +9,7 @@ font-size: 80%; } } + +.infoCell { + display: grid; +} diff --git a/client/src/styles.scss b/client/src/styles.scss index dd6e2fdfc..9c058fb85 100644 --- a/client/src/styles.scss +++ b/client/src/styles.scss @@ -170,6 +170,10 @@ } } + .checkbox-ripple-padding { + padding-left: 12px; + } + .clickable { cursor: pointer; } @@ -342,6 +346,7 @@ mat-card { } // Shared table definitions +// TODO: Might be deprecated since we now have Virtual Scrolling Tables %os-table { width: 100%;