Deliver centralized role management feature
[portal.git] / ecomp-portal-FE-os / client / src / views / applications / application-details-dialog / application-details.modal.html
1 <!--
2   ================================================================================
3   eCOMP Portal
4   ================================================================================
5   Copyright (C) 2017 AT&T Intellectual Property
6   ================================================================================
7   Licensed under the Apache License, Version 2.0 (the "License");
8   you may not use this file except in compliance with the License.
9   You may obtain a copy of the License at
10   
11        http://www.apache.org/licenses/LICENSE-2.0
12   
13   Unless required by applicable law or agreed to in writing, software
14   distributed under the License is distributed on an "AS IS" BASIS,
15   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   See the License for the specific language governing permissions and
17   limitations under the License.
18   ================================================================================
19   -->
20 <div class="application-details-modal">
21
22                 <div class="b2b-modal-header">
23                         <h2 class="account-details-title" id="application-details-title">Application Details</h2>
24
25                         <div class="corner-button in">
26                                 <button type="button" class="close" aria-label="Closhhhe"
27                                         ng-click="$dismiss('cancel')"></button>
28                         </div>
29                 </div>
30
31                 <div class="b2b-modal-body">
32     <div class="app-properties-main" scroll-top="appDetails.scrollApi">
33         <form name="appForm" novalidate autocomplete="off">
34             <!-- We can remove this script once we get to Firefox version 47
35                   autocomplete="off" won't work until v47 -->
36            <!--  <script type="text/javascript">
37                 document.getElementById("appForm").reset();
38             </script> -->
39             <div id="app-left-container" class="left-container">
40                 <div class="property-label checkbox-label"> 
41                                         <label for="checkbox-app-is-restricted" class="checkbox"> 
42                                 <input type="checkbox" ng-model="appDetails.app.restrictedApp" id="checkbox-app-is-restricted" ng-disabled="appDetails.isEditMode" ng-checked="appDetails.app.restrictedApp"/> 
43                                 <i class="skin"></i> 
44                                 <span>Hyperlink only application</span> 
45                             </label> 
46                                 </div>       
47                 <div class="property required">
48                     <div class="property-label">Application Name</div>
49                     <input id="input-app-name"  type="text"
50                            ng-model="appDetails.app.name"
51                            maxlength="100"
52                            name="name"
53                            ng-pattern="/^[a-zA-Z0-9_\-\s\&]*$/"
54                            required/>
55
56                     <div id="error-container-conflict" class="error-container" ng-show="appDetails.conflictMessages.name" id="conflictMessages-name">
57                         <small id="app-name-error-conflict" class="err-message" ng-bind="appDetails.conflictMessages.name"></small>
58                     </div>
59                     <div id="error-container-edit" class="error-container" ng-show="appForm.name.$dirty || appDetails.isEditMode">
60                         <div ng-messages="appForm.name.$error" class="error-container">
61                             <small id="app-name-error-required" class="err-message" ng-message="required">Application name is required</small>
62                             <small id="app-name-error-alpha-num" class="err-message" ng-message="pattern">Application name must be alphanumeric</small>
63                         </div>
64                     </div>
65                 </div>
66                 <!--<div class="property">-->
67                 <!--<div class="property-label">Description</div>-->
68                 <!--<input class="input-field" type="text" ng-model="appDetails.app.description"/>-->
69                 <!--</div>-->
70                 <!--<div class="property">-->
71                 <!--<div class="property-label">Notes</div>-->
72                 <!--<input class="input-field" type="text" ng-model="appDetails.app.notes"/>-->
73                 <!--</div>-->
74                 <div class="property required">
75                     <div id="url-property-label" class="property-label">URL</div>
76                     <input  id="input-app-url"
77                            ng-model="appDetails.app.url"
78                            maxlength="256"
79                            name="url"
80                            type="url" placeholder="https://"
81                            ng-pattern="appDetails.ECOMP_URL_REGEX"
82                            required />
83                     <div id="app-error-url" class="error-container" ng-show="appDetails.conflictMessages.url" id="div-app-name-err-url">
84                         <small class="err-message" ng-bind="appDetails.conflictMessages.url"></small>
85                     </div>
86                     <div id="app-error-url-message" class="error-container" ng-show="appForm.url.$dirty || appDetails.isEditMode">
87                         <div ng-messages="appForm.url.$error" class="error-container">
88                             <small id="error-app-url-req" class="err-message" ng-message="required">Application URL is required</small>
89                             <!--<small id="error-app-url-invalid" class="err-message" ng-message="pattern">Application URL must be a valid URL</small>-->
90                             <small id="error-app-url-invalid" class="err-message" ng-show="appForm.url.$error.url">Application URL must be a valid URL</small>
91                         </div>
92                     </div>
93                     <!--<span class="err-message" ng-show="appForm.url.$error.url"> Not valid URL!</span>-->
94                 </div>
95
96
97                 <div class="property" ng-show="!appDetails.app.restrictedApp">
98                     <div class="property-label">Rest API URL</div>
99                     <input  id="input-app-rest-url"
100                            ng-model="appDetails.app.restUrl"
101                            name="restUrl"
102                            type="url" placeholder="https://"
103                            ng-pattern="appDetails.ECOMP_URL_REGEX"
104                            maxlength="256"/>
105                     <div id="app-error-rest-message" class="error-container" ng-show="appForm.restUrl.$dirty || appDetails.isEditMode">
106                         <div ng-messages="appForm.restUrl.$error" class="error-container">
107                             <!--<small class="err-message" ng-message="pattern">Application REST URL must be a valid URL</small>-->
108                             <small class="err-message" ng-show="appForm.restUrl.$error.url">Application REST URL must be a valid URL</small>
109                         </div>
110                     </div>
111                 </div>
112
113                 <div class="property required" ng-show="!appDetails.app.restrictedApp">
114                     <div id="username-property-label"  class="property-label">Username</div>
115                     <input  type="text"
116                            ng-model="appDetails.app.username"
117                            name="username"
118                            maxlength="256"
119                            ng-required="!appDetails.app.restrictedApp"/>
120                     <div id="app-error-username-container" class="error-container" ng-show="appForm.username.$dirty || appDetails.isEditMode">
121                         <div ng-messages="appForm.username.$error" class="error-container">
122                             <small  id="error-appusername-reqd" class="err-message" ng-message="required">My Logins App Username is required</small>
123                         </div>
124                     </div>
125                 </div>
126                 <div class="property required" ng-show="!appDetails.app.restrictedApp">
127                     <div id="pwd-property-label"  class="property-label">Password</div>
128                     <input  type="password"  id="input-mylogins-password"
129                            ng-model="appDetails.app.appPassword" autocomplete="new-password"
130                            name="appPassword"
131                            maxlength="256"
132                            ng-required="!appDetails.app.restrictedApp"/>
133                     <div id="app-error-password-container" class="error-container" ng-show="appForm.appPassword.$dirty || appDetails.isEditMode">
134                         <div ng-messages="appForm.appPassword.$error" class="error-container">
135                             <small id="error-mylogins-password-reqd" class="err-message" ng-message="required">My Logins App Password is required</small>
136                         </div>
137                     </div>
138
139                         <div class="property" ng-show="!appDetails.app.restrictedApp">
140                             <div id="pwd-property-label"  class="property-label">Name Space</div>
141                             <input  type="text"  id="input-mylogins-auth-namespace"
142                                    ng-model="appDetails.app.nameSpace" 
143                                    name="appAuthNameSpace"
144                                    maxlength="256"/>
145                         </div>                                    
146                 </div>
147             </div>
148             <div class="right-container">
149                 <div class="property">
150                     <div class="property-label">Upload Image</div>
151                     <input type="file" id="input-app-image-upload"
152                            class="input-file-field"
153                            accept="image/*"
154                            ng-model="appDetails.originalImage"
155                            name="appImage"
156                            image-upload="appDetails.originalImage"
157                            image-upload-resize-max-height="300"
158                            image-upload-resize-max-width="360"
159                            image-upload-resize-quality="0.7"
160                            image-upload-api="appDetails.imageApi" style="height: 24px;"/>
161
162                     <div id="app-error-image-upload" class="error-container" ng-show="appForm.appImage.$dirty">
163                         <div ng-messages="appForm.appImage.$error" class="error-container">
164                             <small id="error-app-invalid-image" class="err-message" ng-message="mimeType">Uploaded file must be an image</small>
165                             <small id="error-app-invalid-image-size" class="err-message" ng-message="imageSize">Image file must be smaller than 1MB</small>
166                         </div>
167                     </div>
168
169                     <div class="property-label preview">
170                         <span class="left-label">Preview</span>
171                         <span class="remove" ng-click="appDetails.removeImage()">Remove</span>
172                     </div>
173                     <img id="image-app-preview" class="image-preview" ng-src="{{appDetails.app.imageLink || appDetails.app.thumbnail || appDetails.emptyImgForPreview}}"/>
174                     <div id="property-communication-inbox" class="property" ng-show="!appDetails.app.restrictedApp">
175                         <div id="property-communication-inbox-label" class="property-label">Communication Inbox</div>
176                         <input  type="text" id="input-UEB-topicname"
177                                ng-model="appDetails.app.uebTopicName"
178                                name="uebTopicName" readonly="readonly"/>
179                     </div>
180
181                     <div id="property-communication-key" class="property" ng-show="!appDetails.app.restrictedApp">
182                         <div id="property-communication-key-label" class="property-label">Communication Key</div>
183                         <input  type="text" id="input-UEB-communication-key"
184                                ng-model="appDetails.app.uebKey"
185                                name="uebKey" readonly="readonly" />
186                     </div>
187
188                     <div id="property-communication-secret" class="property" ng-show="!appDetails.app.restrictedApp">
189                         <div id="property-communication-secret-label" class="property-label">Communication Secret</div>
190                         <input  type="text" id="input-UEB-communication-secret"
191                                ng-model="appDetails.app.uebSecret"
192                                name="uebSecret" readonly="readonly" />
193                     </div>
194
195                     <div id="property-guest-access" class="property">
196                         <label for="checkbox-app-is-open" class="checkbox"> 
197                                 <input type="checkbox" ng-model="appDetails.app.isOpen" id="checkbox-app-is-open" ng-checked="appDetails.app.isOpen || appDetails.app.restrictedApp" ng-disabled="appDetails.app.restrictedApp"/> 
198                                 <i class="skin"></i> 
199                                 <span>Allow guest access</span> 
200                             </label> 
201                     </div>
202                     <div id="property-active" class="property">
203                      <label for="checkbox-app-is-enabled" class="checkbox"> 
204                                 <input type="checkbox" ng-model="appDetails.app.isEnabled" id="checkbox-app-is-enabled"/> 
205                                 <i class="skin"></i> 
206                                 <span>Active</span> 
207                             </label>    
208                     </div> <br/>
209                     <div id="property-is-central-auth" class="property" ng-show="!appDetails.app.restrictedApp">
210                      <label for="checkbox-app-is-central-auth" class="checkbox"> 
211                                 <input type="checkbox" ng-model="appDetails.app.isCentralAuth" id="checkbox-app-is-central-auth"/> 
212                                 <i class="skin"></i> 
213                                 <span>Centralized</span> 
214                             </label>    
215                     </div>
216
217                 </div>
218
219             </div>
220         </form>
221     </div>
222         </div>
223                 
224                         <br>
225                         <div class="b2b-modal-footer">
226                                 <div class="dialog-control">
227                                 <span class="ecomp-save-spinner" ng-show="appDetails.isSaving"></span> 
228                                 <button id="button-save-app" class="btn btn-alt btn-small" ng-class="{disabled: appForm.$invalid}" ng-click="appDetails.saveChanges()">Save</button>    
229                                                 <button id="button-notification-cancel" class="btn btn-alt btn-small" ng-click="$dismiss('cancel')"role="button" tabindex="0">Cancel</button>
230                                                 
231                                                 
232                                         </div>
233                         </div>
234                         
235                         
236                         
237
238 </div>
239
240
241 <script type="application/javascript">
242     $(document).ready(function(){
243         $(".ngdialog-content").css("top","-150px")
244     });
245 </script>