aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/modules/dashboard/dashboard.component.html
blob: 76a8e967b23284d2cc2529f9272b0491a5b67b50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!--
  ~ Copyright (c) 2022. Deutsche Telekom AG
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  ~ SPDX-License-Identifier: Apache-2.0
  -->


<app-breadcrumb>
  <app-breadcrumb-item>
    <span aria-current="page">{{ 'layout.menu.items.dashboard' | translate }}</span>
  </app-breadcrumb-item>
</app-breadcrumb>
<ng-container *ngIf="tiles$ | async as apps">
  <div class="w-100 d-flex justify-content-between">
    <h2 class="qa_title">{{ 'layout.menu.items.dashboard' | translate }}</h2>
    <ul>
      <li
        #settingsDrop="ngbDropdown"
        [ngbTooltip]="'dashboard.tooltips.settings' | translate"
        class="qa_alarm_auto_settings"
        ngbDropdown
      >
        <button
          [attr.aria-label]="'dashboard.showSettings' | translate"
          class="btn btn-outline-secondary no-border qa_dashboard_show_and_hide_settings_btn"
          id="dropdownColumnSettings"
          ngbDropdownToggle
        >
          <i aria-hidden="true" class="bi bi-gear-fill text-muted"></i>
        </button>
        <div aria-labelledby="dropdownColumnSettings" ngbDropdownMenu style="min-width: 250px">
          <p class="px-4 small text-muted mb-1">{{ 'dashboard.selectApplications' | translate }}</p>
          <form class="px-4 py-3 d-flex flex-column align-items-start">
            <div
              [appHasPermissions]="'dashboard.tile.' + app.type"
              *ngFor="let app of apps"
              class="d-flex justify-content-center"
            >
              <ng-container *ngIf="'dashboard.tile.' + app.type | hasPermission | async">
                <input
                  type="checkbox"
                  [(ngModel)]="app.displayed"
                  (ngModelChange)="updateAction.next(app)"
                  [ngModelOptions]="{ standalone: true }"
                  [ngClass]="'qa_dashboard_show_app_' + app.type"
                />
                <p class="ml-2">{{ 'dashboard.apps.' + app.type | translate }}</p>
              </ng-container>
            </div>
          </form>
        </div>
      </li>
    </ul>
  </div>
  <hr />
  <div class="row" cdkDropList (cdkDropListDropped)="dropAction.next($event)">
    <ng-container *ngFor="let app of apps | map: filterDisplayedTiles">
      <ng-container *ngIf="'dashboard.tile.' + app.type | hasPermission | async">
        <ng-container *ngIf="app.type === DashboardApplications.USER_LAST_ACTION_TILE">
          <app-user-last-action-tile></app-user-last-action-tile>
        </ng-container>
      </ng-container>
    </ng-container>
  </div>
</ng-container>