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