Added new componetnts inside page modules
[portal.git] / portal-FE-common / src / app / pages / users / bulk-user / bulk-user.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="modal-header">
41     <h4 class="modal-title">{{title}}</h4>
42     <button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross')">
43       <span aria-hidden="true">&times;</span>
44     </button>
45   </div>
46   <div class="modal-body">
47     <div *ngIf="dialogState===1">
48       <mat-form-field>
49         <mat-label> Select Application </mat-label>
50         <mat-select [disabled]='adminsAppsData.length === 0'>
51           <mat-option [value]="select-application" (click)="changeSelectApp('select-application')">Select Application
52           </mat-option>
53           <mat-option *ngFor="let app of adminsAppsData" (click)="changeSelectApp(app)" [value]="app.value">
54             {{app.title}}</mat-option>
55         </mat-select>
56       </mat-form-field>
57       <span class="onap-spinner" *ngIf="adminsAppsData.length === 0"></span>
58     </div>
59     <div *ngIf="dialogState===2">
60       <div class="upload-instructions">Select Upload File:</div>
61       <!-- input type=file is difficult to style.
62                                          Instead use a label styled as a button. -->
63       <label class="file-label">
64         <input type="file" (change)="onFileSelect($event.target)" accept="text/plain,.csv" />
65       </label>{{selectedFile}}
66       <div class="upload-instructions">File must be .csv or .txt and have one entry per line with this format:
67         <pre>orgUserId, role name</pre>
68       </div>
69     </div>
70     <div class="bulk-upload" *ngIf="dialogState===3">
71       <!-- progress indicator -->
72       <div class="upload-instructions" [hidden]="!isProcessing">
73         {{progressMsg}}
74         <br>
75         <br>
76         <span class="onap-spinner"></span>
77       </div>
78
79       <!-- progress indicator -->
80       <div class="upload-instructions" [hidden]="!isProcessedRecords">
81         {{conformMsg}}
82       </div>
83       <div [hidden]="isProcessing || isProcessedRecords">
84         <div class="upload-instructions">
85           Click OK to upload the valid requests.
86           Invalid requests will be ignored.</div>
87
88         <table mat-table [dataSource]="uploadFileDataSource">
89           <!-- Search Result Column-->
90           <ng-container matColumnDef="line">
91             <th id="rowheader-result" mat-header-cell *matHeaderCellDef> Line
92             <td id="table-data-{{i}}" mat-cell *matCellDef="let element; let i = index;">{{element.line}}
93             </td>
94           </ng-container>
95           <ng-container matColumnDef="orgUserId">
96             <th id="rowheader-result" mat-header-cell *matHeaderCellDef> OrgUserID
97             <td id="rowheader_t1_{{i}}-roles" mat-cell *matCellDef="let element; let i=index;">
98               {{element.orgUserId}}
99             </td>
100           </ng-container>
101           <ng-container matColumnDef="appRole">
102             <th id="rowheader-result" mat-header-cell *matHeaderCellDef> App Role
103             <td id="table-data-{{i}}" mat-cell *matCellDef="let element; let i = index;">
104               {{element.role}}
105             </td>
106           </ng-container>
107           <ng-container matColumnDef="status">
108             <th id="rowheader-result" mat-header-cell *matHeaderCellDef> Status
109             <td id="table-data-{{i}}" mat-cell *matCellDef="let element; let i = index;">
110               {{element.status}}
111             </td>
112           </ng-container>
113
114           <tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
115           <tr mat-row id="table-row-{{i}}" *matRowDef="let row; columns: displayedColumns; let i = index;"></tr>
116         </table>
117       </div>
118     </div>
119   </div>
120   <div class="modal-footer">
121     <button type="button" class="btn btn-primary" *ngIf="dialogState === 2" (click)="navigateBack()">Back</button>
122     &nbsp;
123     <button type="submit" id="dialog1Button" class="btn btn-primary" [disabled]="selectApp" *ngIf="dialogState === 1"
124       (click)="uploadFileDialog()">Next</button>
125     <button type="button" class="btn btn-primary" *ngIf="dialogState !== 3"
126       (click)="activeModal.close('Close')">Close</button>
127     <button type="submit" class="btn btn-primary" *ngIf="dialogState === 3" (click)="updateDB()">Ok</button> &nbsp;
128     <button type="button" class="btn btn-primary" *ngIf="dialogState === 3" (click)="navigateDialog2()">Cancel</button>
129   </div>
130 </div>