Added new componetnts inside page modules
[portal.git] / portal-FE-common / src / app / pages / users / users.component.html
1 <!--
2   ============LICENSE_START==========================================
3   ONAP Portal
4   ===================================================================
5   Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6   ===================================================================
7  
8   Unless otherwise specified, all software contained herein is licensed
9   under the Apache License, Version 2.0 (the "License");
10   you may not use this software except in compliance with the License.
11   You may obtain a copy of the License at
12  
13               http://www.apache.org/licenses/LICENSE-2.0
14  
15   Unless required by applicable law or agreed to in writing, software
16   distributed under the License is distributed on an "AS IS" BASIS,
17   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   See the License for the specific language governing permissions and
19   limitations under the License.
20  
21   Unless otherwise specified, all documentation contained herein is licensed
22   under the Creative Commons License, Attribution 4.0 Intl. (the "License");
23   you may not use this documentation except in compliance with the License.
24   You may obtain a copy of the License at
25  
26               https://creativecommons.org/licenses/by/4.0/
27  
28   Unless required by applicable law or agreed to in writing, documentation
29   distributed under the License is distributed on an "AS IS" BASIS,
30   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31   See the License for the specific language governing permissions and
32   limitations under the License.
33  
34   ============LICENSE_END============================================
35  
36   
37   -->
38
39 <div class="container">
40   <div class="onap-main-view-title">
41     <h1 class="heading-page">Users</h1>
42   </div>
43   <span *ngIf="showSpinner" class="onap-spinner"></span>
44   <mat-form-field>
45     <mat-label> Select Application </mat-label>
46     <mat-select [disabled]='adminApps.length === 0'>
47       <mat-option [value]="select-application" (click)="applyDropdownFilter('select-application')">Select Application
48       </mat-option>
49       <mat-option *ngFor="let app of adminApps" [value]="app.value" (click)="applyDropdownFilter(app)">
50         {{app.title}}</mat-option>
51     </mat-select>
52   </mat-form-field>
53   &nbsp;
54   <mat-form-field>
55     <input matInput type="text" (keyup)="applyFilter($event.target.value)" placeholder="Search in entire table">
56   </mat-form-field>
57   <button type="button" class="btn btn-primary" (click)="openBulkUserUploadModal()"><i
58       class="icon ion-md-cloud-upload"></i>
59     Bulk Upload</button>
60   <button type="button" class="btn btn-primary" (click)="openAddNewUserModal()"><i class="icon ion-md-person-add"></i>
61     Add </button>
62   <div class="error-text" id="div-select-app" [hidden]="!noAppSelected || adminApps.length === 0">
63     <p class="error-help">Use the 'Select application' dropdown to see users.</p>
64   </div>
65   <div class="error-text" id="div-error-no-users" [hidden]="!noUsersInApp">
66     <p>&nbsp;</p>
67     <p class="error-help">
68       No users found. Select "Add User" to add a User to the application.
69     </p>
70   </div>
71   <div class="error-text" id="div-error-app-down" [hidden]="!appsIsDown">
72     <p>&nbsp;</p>
73     <p class="error-help">
74       Failed to communicate with the application.
75       Please try again later or contact a system administrator.
76     </p>
77   </div>
78   <div class="error-text" id="div-error-403" [hidden]="!adminAppsIsNull">
79     <h1>Attention:</h1>
80     <p>&nbsp;</p>
81     <p class="error-help">It appears that you have not been added as an admin yet to an application.</p>
82     <p>&nbsp;</p>
83     <p class="error-help">Click on the Admins link to the left and check and see if you are listed as an admin for an
84       application.
85       If not, you can add yourself to the appropriate application.</p>
86   </div>
87   <table mat-table [dataSource]="adminsDataSource" matSort>
88     <!-- First Name Column -->
89     <ng-container matColumnDef="firstName">
90       <th id="col1" mat-header-cell *matHeaderCellDef mat-sort-header> First Name </th>
91       <td id="rowheader_t1_{{i}}-firstName" mat-cell *matCellDef="let element; let i = index;"> {{element.firstName}}
92       </td>
93     </ng-container>
94
95     <!-- Last Name Column -->
96     <ng-container matColumnDef="lastName">
97       <th id="col2" mat-header-cell *matHeaderCellDef mat-sort-header> Last Name </th>
98       <td id="rowheader_t1_{{i}}-lastName" mat-cell *matCellDef="let element; let i=index;"> {{element.lastName}}
99       </td>
100     </ng-container>
101
102     <!-- User ID Column -->
103     <ng-container matColumnDef="userId">
104       <th id="col3" mat-header-cell *matHeaderCellDef mat-sort-header> User ID </th>
105       <td id="rowheader_t1_{{i}}-userId" mat-cell *matCellDef="let element; let i=index;"> {{element.orgUserId}}
106       </td>
107     </ng-container>
108
109     <!-- Roles Column -->
110     <ng-container matColumnDef="roles">
111       <th id="col4" mat-header-cell *matHeaderCellDef> Roles </th>
112       <td id="rowheader_t1_{{i}}-applications" mat-cell *matCellDef="let element; let i=index;">
113         <div *ngFor="let element of element.roles; let i=index;"> {{element.name}} </div>
114       </td>
115     </ng-container>
116
117     <tr [hidden]="accountUsers.length === 0" mat-header-row *matHeaderRowDef="displayedColumns"></tr>
118     <tr mat-row *matRowDef="let row; columns: displayedColumns;" (click)="openExistingUserModal(row)"></tr>
119   </table>
120   <mat-paginator [hidden]="accountUsers.length === 0" [pageSizeOptions]="[10, 20]" showFirstLastButtons></mat-paginator>
121 </div>