a68cd55c2518be36e335aad03421f509afec92e6
[portal.git] / ecomp-portal-FE-common / client / app / views / users / new-user-dialogs / new-user.modal.html
1 <!--
2   ============LICENSE_START==========================================
3   ONAP Portal
4   ===================================================================
5   Copyright (C) 2017 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 <style>
39         .title {
40                 border-bottom: none !important;
41         }
42         
43         .b2b-modal-footer .cta-button-group {
44                 border-top: 0px solid #d2d2d2;
45         }
46         
47         .multiple-select {
48                 width: 250px;
49         }
50 </style>
51
52  <div >
53  
54 <div ng-if="newUser.dialogState===1">
55
56                 <div class="b2b-modal-header">
57                         <h2 class="heading-medium" id="newAdmin">New User</h2>
58
59                         <div class="corner-button in">
60                                 <button type="button" class="close" aria-label="Close" id="user-button-close" 
61                                         ng-click="$dismiss('cancel')"></button>
62                         </div>
63                 </div>
64
65                 <div class="b2b-modal-body" tabindex="0"
66                         aria-label="Modal header text content" role="region">
67                         <search-users search-title="" selected-user="newUser.selectedUser"></search-users>
68                 </div>
69
70                 <div class="b2b-modal-footer">
71                         <div class="cta-button-group in">
72                                 <button class="btn btn-alt btn-small" id="next-button"  ng-click="newUser.selectedUser && newUser.getUserAppsRoles()"
73                          ng-class="{disabled: !newUser.selectedUser}">Next
74                         </button>
75                                 <button id="search-users-button-cancel"
76                                         class="btn btn-alt btn-small" ng-click="$dismiss('cancel')">Cancel</button>
77                         </div>
78                 </div>
79
80         </div>
81                 <div ng-if="newUser.dialogState===3">
82         
83                         <div class="b2b-modal-header">
84                                 <div class="title"
85              ng-bind="newUser.selectedUser.firstName + ' ' + newUser.selectedUser.lastName + ' (' + newUser.selectedUser.orgUserId + ')'"></div>
86
87         
88                                 <div class="corner-button in">
89                                         <button type="button" class="close" aria-label="Close" id="div-cancel-button"
90                                                 ng-click="$dismiss('cancel')"></button>
91                                 </div>
92                         </div>
93         
94                         <div class="b2b-modal-body">
95                                 <div class="app-roles-main-title">
96                                         <span class="left">Access and roles:</span>
97                                 </div>
98                                 <br/>
99                                 <table  class="app-roles-list">
100                                         <tr class="app-item" ng-repeat="app in (newUser.adminApps) track by app.id" id="app-name-{{app.name.split(' ').join('-')}}" ng-show="!app.isDeleted">
101                                                 <td class="app-item-left" id="div-app-name-{{app.name.split(' ').join('-')}}">{{app.name | elipsis: 27}}</td>
102                                                 <td class="app-item-right" id="div-app-name-dropdown-{{app.name.split(' ').join('-')}}" ng-show="!app.isError && !app.isLoading && !app.noChanges && !app.isUpdating && !app.isDoneUpdating && !app.isErrorUpdating">
103                                                         <multiple-select id="app-roles-{{app.name}}" unique-data="{{$index}}" placeholder="Select roles"
104                                                                                 ng-model="app.appRoles" on-change="newUser.appChanged($index)" name-attr="roleName"
105                                                                                 value-attr="isApplied"></multiple-select>
106                                                 </td>
107                                                 <td id="app-item-no-contact" class="app-item-right-error" ng-show="app.isError">{{app.errorMessage}}</td>
108                                                 <td id="app-item-contacting" class="app-item-right-contacting" ng-show="app.isLoading">Contacting application...</td>
109                                                 <td id="app-item-no-changes" class="app-item-right-contacting" ng-show="app.noChanges">No changes</td>
110                                                 <td id="app-item-no-updating" class="app-item-right-contacting" ng-show="app.isUpdating">Updating application...</td>
111                                                 <td id="app-item-done-updating" class="app-item-right-contacting" ng-show="app.isDoneUpdating">Finished updating application</td>
112                                                 <td id="app-item-cannot-update" class="app-item-right-error" ng-show="app.isErrorUpdating">Could not update application...</td>
113                                                 <td id="app-item-delete" ng-click="newUser.deleteApp(app)" ng-show="!app.isLoading && !app.isError" >
114                                                         <i class="icon-misc-trash"></i>
115                                                 </td> 
116                                                 <td id='ecomp-small-spinner' class="ecomp-small-spinner" ng-show="app.isLoading"></td>
117                                         </tr>
118                                 </table >
119                         </div>
120         
121                         <div class="b2b-modal-footer">
122                                 <div class="cta-button-group in">
123                                         <span id="ecomp-save-spinner" class="ecomp-save-spinner" ng-show="newUser.isSaving || newUser.isGettingAdminApps"></span>
124                                         <button id="new-user-back-button" class="btn btn-alt btn-small" ng-show="newUser.isShowBack" ng-click="newUser.navigateBack()">Back</button>
125                                         <button id="new-user-save-button" class="btn btn-alt btn-small" ng-click="newUser.updateUserAppsRoles()"
126                                                         ng-disabled="(newUser.anyChanges == false)">Save
127                                         </button>
128                                         <button id="new-user-cancel-button" class="btn btn-alt btn-small" ng-click="$dismiss('cancel')">Cancel</button>
129                                 </div>
130                         </div>
131         </div>
132
133 </div>
134
135 <script>
136 $(document).ready(function(){
137     $(".ngdialog-close").attr('id','dialog-close');
138 });
139 </script>