Added new componetnts inside page modules
[portal.git] / portal-FE-common / src / app / pages / role / role.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">Roles</h1>
42   </div>
43   <mat-form-field>
44     <mat-label> Select Application </mat-label>
45     <mat-select [disabled]='centralizedApps.length === 0' [(ngModel)]="selectedCentralizedApp">
46       <mat-option *ngFor="let app of centralizedApps" [value]="app.appId"
47         (click)="getRolesForSelectedCentralizedApp(selectedCentralizedApp)">
48         {{app.appName}}</mat-option>
49     </mat-select>
50   </mat-form-field>
51   &nbsp;
52   <button type="button" class="btn btn-primary" [disabled]='centralizedApps.length === 0'
53     (click)="openBulkUploadRolesAndFunctionsModal()"><i class="icon ion-md-cloud-upload"></i>
54     Bulk Upload</button>
55   <button type="button" class="btn btn-primary" [disabled]='centralizedApps.length === 0' [hidden]="!syncRolesApplied"
56     (click)="syncRolesFromExternalAuthSystem()"><i class="icon ion-md-sync"></i>
57     Sync Roles </button>
58   <button type="button" class="btn btn-primary" [disabled]='centralizedApps.length === 0'
59     (click)="addRoleModalPopup()"><i class="icon ion-md-add-circle-outline"></i>
60     Create </button>
61   <span class="onap-spinner" *ngIf="showSpinner"></span>
62   <table mat-table [dataSource]="roleDataSource" matSort>
63     <!-- Name Column -->
64     <ng-container matColumnDef="name">
65       <th id="col1" mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
66       <td id="rowheader_t1_{{i}}-firstName" mat-cell *matCellDef="let element; let i = index;"> {{element.name}}
67       </td>
68     </ng-container>
69
70     <!-- Priority Column -->
71     <ng-container matColumnDef="priority">
72       <th id="col2" mat-header-cell *matHeaderCellDef mat-sort-header> Priority </th>
73       <td id="rowheader_t1_{{i}}-lastName" mat-cell *matCellDef="let element; let i=index;"> {{element.priority}}
74       </td>
75     </ng-container>
76
77     <!-- Active Column -->
78     <ng-container matColumnDef="active">
79       <th id="col3" mat-header-cell *matHeaderCellDef mat-sort-header> Active </th>
80       <td id="rowheader_t1_{{i}}-userId" mat-cell *matCellDef="let element; let i=index;">
81         <mat-slide-toggle
82           [disabled]="(element.id === 1 || element.id === 999) || ((this.selectedCentralizedApp !== 1) && (element.name.indexOf('global_') !== -1))"
83           [(ngModel)]="element.active" (change)="toggleRole(element)"></mat-slide-toggle>
84       </td>
85     </ng-container>
86
87     <!-- Edit Column -->
88     <ng-container matColumnDef="edit">
89       <th id="col3" mat-header-cell *matHeaderCellDef mat-sort-header> Edit </th>
90       <td id="rowheader_t1_{{i}}-userId" mat-cell *matCellDef="let element; let i=index;">
91         <span class="icon-trash" id="{{i}}-button-edit" (click)="editRoleModalPopup(element)">
92           <i class="icon ion-md-create"></i>
93         </span>
94       </td>
95     </ng-container>
96
97     <!-- Delete Column -->
98     <ng-container matColumnDef="delete">
99       <th [hidden]="selectedCentralizedApp === 1" id="col4" mat-header-cell *matHeaderCellDef> Delete </th>
100       <td [hidden]="selectedCentralizedApp === 1" id="rowheader_t1_{{i}}-applications" mat-cell
101         *matCellDef="let element; let i=index;">
102         <span class="icon-trash" id="{{i}}-button-portal-admin-remove" (click)="removeRole(element)">
103           <i class="icon ion-md-trash"></i>
104         </span>
105       </td>
106     </ng-container>
107
108     <tr [hidden]="availableRoles.length === 0" mat-header-row *matHeaderRowDef="displayedColumns"></tr>
109     <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
110   </table>
111   <mat-paginator [hidden]="availableRoles.length === 0" [pageSizeOptions]="[10, 20]" showFirstLastButtons>
112   </mat-paginator>
113   <a id="manage-role" [hidden]="availableRoles.length === 0" [routerLink]="['/roleFunctions']">Manage Role
114     Functions</a><br><br>
115 </div>