Added portal-FE-os components
[portal.git] / portal-FE-os / src / app / pages / users / new-user-modal / new-user-modal.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 <div class="container" *ngIf="dialogState===1">
39   <div class="modal-header">
40     <h4 class="modal-title">{{title}}</h4>
41     <button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross')">
42       <span aria-hidden="true">&times;</span>
43     </button>
44   </div>
45   <div class="modal-body" *ngIf="!addUserFlag">
46     <app-search-users [searchTitle]="searchTitleText" [isSystemUser]="isSystemUserCheck" [placeHolder]="placeholderText"
47       (passBackSelectedUser)='changeSelectedUser($event)' (userNotFoundFlag)='addNewUser($event)'></app-search-users>
48   </div>
49   <div *ngIf="addUserFlag">
50     <app-user-details-form></app-user-details-form>
51   </div>
52   <div class="modal-footer" *ngIf="!addUserFlag">
53     <button type="submit" class="btn btn-primary" [disabled]='!changedSelectedUser && !isSystemUserCheck'
54       (click)="getUserAppsRoles()">Next</button> &nbsp;
55     <button type="button" class="btn btn-primary" (click)="activeModal.close('Close')">Close</button>
56   </div>
57 </div>
58 <div class="container" *ngIf="dialogState===2">
59   <div class="modal-header">
60     <h4 class="modal-title">{{userTitle}}</h4>
61     <button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross')">
62       <span aria-hidden="true">&times;</span>
63     </button>
64   </div>
65   <div class="modal-body adminApps">
66     <!-- User App Roles List -->
67     <span class="ecomp-spinner" *ngIf="adminApps.length === 0"></span>
68     <div class="container adminApps" *ngIf="adminApps.length > 0">
69       Access and roles:
70       <table mat-table [dataSource]="userAdminAppsSource">
71         <!-- Search Result Column-->
72         <ng-container matColumnDef="applications">
73           <th id="rowheader-result" mat-header-cell *matHeaderCellDef> Application
74           <td id="table-data-{{i}}" mat-cell *matCellDef="let element; let i = index;">{{element.name}}
75           </td>
76         </ng-container>
77         <ng-container matColumnDef="roles">
78           <th id="rowheader-result" mat-header-cell *matHeaderCellDef> Roles
79           <td id="rowheader_t1_{{i}}-roles" mat-cell *matCellDef="let element; let i=index;">
80             <mat-form-field
81               [hidden]="element.isError || element.showSpinner || element.noChanges || element.isUpdating || element.isDoneUpdating || element.isErrorUpdating">
82               <mat-select (selectionChange)="roleSelectChange(element)"
83                 [(ngModel)]="modelSelectedRoles" multiple>
84                 <mat-option *ngFor="let appRole of element.appRoles; let j = index;" [value]="appRole">
85                   {{appRole.roleName}}
86                 </mat-option>
87               </mat-select>
88             </mat-form-field>
89             <span id="app-item-no-contact" class="app-item-right-error"
90               [hidden]="!element.isError">{{element.errorMessage}}</span>
91             <span id="app-item-contacting" class="app-item-right-contacting" [hidden]="!element.showSpinner">Contacting
92               application... <span class="ecomp-small-spinner" *ngIf="showSpinner"></span></span>
93             <span id="app-item-no-changes" class="app-item-right-contacting" [hidden]="!element.noChanges">No
94               changes</span>
95             <span id="app-item-no-updating" class="app-item-right-contacting" [hidden]="!element.isUpdating">Updating
96               application... <span class="ecomp-small-spinner" *ngIf="showSpinner"></span></span>
97             <span id="app-item-done-updating" class="app-item-right-contacting"
98               [hidden]="!element.isDoneUpdating">Finished updating application</span>
99             <span id="app-item-cannot-update" class="app-item-right-error" [hidden]="!element.isErrorUpdating">Could not
100               update application... </span>
101           </td>
102         </ng-container>
103         <ng-container matColumnDef="delete">
104           <th id="rowheader-result" mat-header-cell *matHeaderCellDef> Delete
105           <td id="table-data-{{i}}" mat-cell *matCellDef="let element; let i = index;">
106             <span class="icon-trash" id="app-item-delete-{{i}}" [hidden]="element.showSpinner || element.isError"
107               (click)="deleteApp(element)">
108               <i class="icon ion-md-trash"></i>
109             </span>
110           </td>
111         </ng-container>
112         <tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
113         <tr [hidden]="row.isDeleted" mat-row id="table-row-{{i}}"
114           *matRowDef="let row; columns: displayedColumns; let i = index;"></tr>
115       </table>
116     </div>
117   </div>
118   <div class="modal-footer">
119     <button [hidden]="disableBack" type="submit" class="btn btn-primary" [disabled]='!changedSelectedUser'
120       (click)="navigateBack()">Back</button> &nbsp;
121     <button type="submit" class="btn btn-primary" [disabled]='!anyChanges' (click)="updateUserAppsRoles()">Save</button>
122     &nbsp;
123     <button type="button" class="btn btn-primary" (click)="activeModal.close('Close')">Close</button>
124   </div>
125 </div>