summaryrefslogtreecommitdiffstats
path: root/portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.html
blob: 927b5073af5dd6405cccc20014843f863acb067d (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!--
  ============LICENSE_START==========================================
  ONAP Portal
  ===================================================================
  Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  ===================================================================

  Unless otherwise specified, all software contained herein is licensed
  under the Apache License, Version 2.0 (the "License");
  you may not use this software 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.

  Unless otherwise specified, all documentation contained herein is licensed
  under the Creative Commons License, Attribution 4.0 Intl. (the "License");
  you may not use this documentation except in compliance with the License.
  You may obtain a copy of the License at

              https://creativecommons.org/licenses/by/4.0/

  Unless required by applicable law or agreed to in writing, documentation
  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.

  ============LICENSE_END============================================


  -->
<div class="container" *ngIf="dialogState===1">
  <div class="modal-header">
    <h4 class="modal-title">{{title}}</h4>
    <button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross')">
      <span aria-hidden="true">&times;</span>
    </button>
  </div>
  <div class="modal-body" *ngIf="!addUserFlag">
    <app-search-users [searchTitle]="searchTitleText" [isSystemUser]="isSystemUserCheck" [placeHolder]="placeholderText"
      (passBackSelectedUser)='changeSelectedUser($event)' (userNotFoundFlag)='addNewUser($event)'></app-search-users>
  </div>
  <div *ngIf="addUserFlag">
    <app-user-details-form></app-user-details-form>
  </div>
  <div class="modal-footer" *ngIf="!addUserFlag">
    <button type="submit" class="btn btn-primary" [disabled]='!changedSelectedUser && !isSystemUserCheck'
      (click)="getUserAppsRoles()">Next</button> &nbsp;
    <button type="button" class="btn btn-primary" (click)="activeModal.close('Close')">Close</button>
  </div>
</div>
<div class="container" *ngIf="dialogState===2">
  <div class="modal-header">
    <h4 class="modal-title">{{userTitle}}</h4>
    <button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross')">
      <span aria-hidden="true">&times;</span>
    </button>
  </div>
  <div class="modal-body adminApps">
    <!-- User App Roles List -->
    <span class="ecomp-spinner" *ngIf="adminApps.length === 0"></span>
    <div class="container adminApps" *ngIf="adminApps.length > 0">
      Access and roles:
      <table mat-table [dataSource]="userAdminAppsSource">
        <!-- Search Result Column-->
        <ng-container matColumnDef="applications">
          <th id="rowheader-result" mat-header-cell *matHeaderCellDef> Application
          <td id="table-data-{{i}}" mat-cell *matCellDef="let element; let i = index;">{{element.name}}
          </td>
        </ng-container>
        <ng-container matColumnDef="roles">
          <th id="rowheader-result" mat-header-cell *matHeaderCellDef> Roles
          <td id="rowheader_t1_{{i}}-roles" mat-cell *matCellDef="let element; let i=index;">
            <mat-form-field
              [hidden]="element.isError || element.showSpinner || element.noChanges || element.isUpdating || element.isDoneUpdating || element.isErrorUpdating">
              <mat-select (selectionChange)="roleSelectChange(element)"
                [(ngModel)]="modelSelectedRoles" multiple>
                <mat-option *ngFor="let appRole of element.appRoles; let j = index;" [value]="appRole">
                  {{appRole.roleName}}
                </mat-option>
              </mat-select>
            </mat-form-field>
            <span id="app-item-no-contact" class="app-item-right-error"
              [hidden]="!element.isError">{{element.errorMessage}}</span>
            <span id="app-item-contacting" class="app-item-right-contacting" [hidden]="!element.showSpinner">Contacting
              application... <span class="ecomp-small-spinner" *ngIf="showSpinner"></span></span>
            <span id="app-item-no-changes" class="app-item-right-contacting" [hidden]="!element.noChanges">No
              changes</span>
            <span id="app-item-no-updating" class="app-item-right-contacting" [hidden]="!element.isUpdating">Updating
              application... <span class="ecomp-small-spinner" *ngIf="showSpinner"></span></span>
            <span id="app-item-done-updating" class="app-item-right-contacting"
              [hidden]="!element.isDoneUpdating">Finished updating application</span>
            <span id="app-item-cannot-update" class="app-item-right-error" [hidden]="!element.isErrorUpdating">Could not
              update application... </span>
          </td>
        </ng-container>
        <ng-container matColumnDef="delete">
          <th id="rowheader-result" mat-header-cell *matHeaderCellDef> Delete
          <td id="table-data-{{i}}" mat-cell *matCellDef="let element; let i = index;">
            <span class="icon-trash" id="app-item-delete-{{i}}" [hidden]="element.showSpinner || element.isError"
              (click)="deleteApp(element)">
              <i class="icon ion-md-trash"></i>
            </span>
          </td>
        </ng-container>
        <tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
        <tr [hidden]="row.isDeleted" mat-row id="table-row-{{i}}"
          *matRowDef="let row; columns: displayedColumns; let i = index;"></tr>
      </table>
    </div>
  </div>
  <div class="modal-footer">
    <button [hidden]="disableBack" type="submit" class="btn btn-primary" [disabled]='!changedSelectedUser'
      (click)="navigateBack()">Back</button> &nbsp;
    <button type="submit" class="btn btn-primary" [disabled]='!anyChanges' (click)="updateUserAppsRoles()">Save</button>
    &nbsp;
    <button type="button" class="btn btn-primary" (click)="activeModal.close('Close')">Close</button>
  </div>
</div>