summaryrefslogtreecommitdiffstats
path: root/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.html
blob: 6d0c544692715caaae321007ba8bc6634794c6fb (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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
<!--
  ============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">
	<!--Modal Headers-->
	<div class="modal-header">
		<h4 class="modal-title">Application Details</h4>
		<button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross')">
			<span aria-hidden="true">&times;</span>
		</button>
	</div>
	<!--Modal Body goes here-->
	<div class="modal-body">
		<div class="application-details-modal">
			<div class="app-properties-main" scroll-top="appDetails.scrollApi">
				<form name="appForm" novalidate autocomplete="off">
					<div id="app-left-container" class="left-container">
						<!-- <div class="property-label checkbox-label">
						<mat-checkbox  name="isRestrictedApp" type="checkbox" [(ngModel)]="applicationObj.restrictedApp"
							id="checkbox-app-is-restricted" [disabled]="isEditMode"	[checked]="applicationObj.restrictedApp">
							Hyperlink only application
						</mat-checkbox>
					</div> -->

						<div class="property required">
							<div class="property-label" style="display: flex;">
								<span style="flex: 9">Application Name</span>
								<app-information-tooltip style="flex: 1;"
									[textMessage]="'Application Name Information'">
								</app-information-tooltip>
							</div>
							<input #applicationName id="input-app-name" type="text" [(ngModel)]="applicationObj.appName"
								maxlength="100" name="name" pattern="/^[a-zA-Z0-9_\-\s\&]*$/" required="true" />

							<div id="error-container-conflict" class="error-container"
								ng-show="appDetails.conflictMessages.name" id="conflictMessages-name">
								<small id="app-name-error-conflict" class="err-message"
									ng-bind="appDetails.conflictMessages.name">
								</small>
							</div>
						</div>

						<div id="property-active" class="property-active" style="display: flex;
						justify-content: flex-end;margin-right: 16px;">
							<mat-checkbox name="isEnabled" [(ngModel)]="applicationObj.isEnabled"
								[checked]="applicationObj.isEnabled" id="checkbox-app-is-enabled">Active
							</mat-checkbox>
						</div>

						<div class="property">
							<div class="property-label" style="display: flex;">
								<mat-label style="flex: 9">Application Type</mat-label>
								<app-information-tooltip style="flex: 1;"
									[textMessage]="'Application Type Information - Gui, Hyperlink or Non-gui'">
								</app-information-tooltip>
							</div>
							<mat-select [disabled]="action === 'edit'" [(value)]="applicationObj.applicationType">
								<mat-option *ngFor="let appType of applicationTypeArray" [value]="appType.value">
									{{appType.name}}
								</mat-option>
							</mat-select>
						</div>

						<div class="property" *ngIf="applicationObj.applicationType == '1'">
							<div class="property-label" style="display: flex;">
								<mat-label style="flex: 9">Mode of Integration</mat-label>
								<app-information-tooltip style="flex: 1;"
									[textMessage]="'Mode Of Integration. SDK or Framework'">
								</app-information-tooltip>
							</div>
							<mat-select [(value)]="applicationObj.modeOfIntegration">
								<mat-option *ngFor="let integrationType of modeOfIntegration"
									[value]="integrationType.value">
									{{integrationType.name}}
								</mat-option>
							</mat-select>
						</div>

						<div class="property" *ngIf="!(applicationObj.applicationType == '2')">
							<div class="property-label" style="display: flex;">
								<mat-label style="flex: 9">Roles Management Type</mat-label>
								<app-information-tooltip style="flex: 1;" [textMessage]="'Roles Management Type'">
								</app-information-tooltip>
							</div>
							<mat-select [(value)]="applicationObj.rolesInAAF">
								<mat-option *ngFor="let roleRepo of rolesManagementType" [value]="roleRepo.value">
									{{roleRepo.name}}
								</mat-option>
							</mat-select>
						</div>

						<div *ngIf="!((applicationObj.applicationType=='2') || (!applicationObj.rolesInAAF))"
							class="property-active" style="display: flex;">
							<mat-checkbox style="flex: 9" name="appAck" [(ngModel)]="applicationObj.appAck">
								Notify App For AAF Operations
							</mat-checkbox>
							<app-information-tooltip style="flex: 1;"
								[textMessage]="'Notify application for AAF operations'">
							</app-information-tooltip>
						</div>

						<div class="property-active" *ngIf="!(applicationObj.applicationType == '2' 
						||(!applicationObj.rolesInAAF))">
							<mat-checkbox name="usesCadi" [(ngModel)]="applicationObj.usesCadi"
								[checked]="applicationObj.usesCadi">Is CADI Enabled?
							</mat-checkbox>
						</div>

						<div class="table-control" style="display: inline-flex;"
							*ngIf="!(applicationObj.applicationType == '2' || !applicationObj.rolesInAAF)">

							<div [ngClass]="(applicationObj.rolesInAAF) ? 'property required' : 'property'"
								style="width: 250px;">
								<div id="pwd-property-label" class="property-label">AAF Namespace</div>
								<input type="text" id="input-mylogins-auth-namespace"
									[(ngModel)]="applicationObj.nameSpace" name="appAuthNameSpace" maxlength="256"
									[disabled]="!applicationObj.rolesInAAF" />
							</div>
							<div class="communitcaion-key" aria-haspopup="true" style="padding-left: 20px;">

								<div b2b-flyout-toggler class="notification-div">
									<div id="tooltip" class="icon-primary-flat-info" tabindex="0"
										b2b-accessibility-click="13,32" aria-label="notifications" aria-haspopup="true"
										role="button"></div>
								</div>
								<!--<div id="notification" align="left">
								<p class="nameSpace-text"  style="font: normal 12px Omnes-ECOMP-W02, Arial;">NameSpace should be created in AAF and portal mechid should be admin of the given namespace.</p>
							</div>-->
							</div>
						</div>

						<div *ngIf="!(applicationObj.applicationType == '3')"
							[ngClass]="(applicationObj.isEnabled) ? 'property required' : 'property'">
							<div class="property-label" style="display: flex;">
								<span style="flex: 9">Landing Page</span>
								<app-information-tooltip style="flex: 1;" [textMessage]="'Application URL Information'">
								</app-information-tooltip>
							</div>
							<input id="input-app-url" [(ngModel)]="applicationObj.landingPage" maxlength="256"
								name="url" type="url" placeholder="https://"
								pattern="/^((?:https?\:\/\/|ftp?\:\/\/)?(w{3}.)?(?:[-a-z0-9]+\.)*[-a-z0-9]+.*)[^-_.]$/i"
								required />

							<div id="error-container-edit" class="error-container"
								*ngIf="(applicationObj.isEnabled && applicationObj.landingPage=='')">
								<small id="app-name-error-required" class="err-message">
									Landing Page URL is required
								</small>
							</div>
						</div>

						<div [ngClass]="(applicationObj.isEnabled) ? 'property required' : 'property'"
							*ngIf="!(applicationObj.applicationType == '2' || applicationObj.applicationType == '3')">
							<div class="property-label" style="display: flex;">
								<span style="flex: 9">Rest API URL</span>
								<app-information-tooltip style="flex: 1;" [textMessage]="'Rest Api URL Information'">
								</app-information-tooltip>
							</div>
							<input id="input-app-rest-url" [(ngModel)]="applicationObj.restUrl" name="restUrl"
								type="url" placeholder="https://"
								pattern="/^((?:https?\:\/\/|ftp?\:\/\/)?(w{3}.)?(?:[-a-z0-9]+\.)*[-a-z0-9]+.*)[^-_.]$/i"
								maxlength="256" ng-required="applicationObj.applicationType == '1'" />

							<div id="error-container-edit" class="error-container"
								*ngIf="(applicationObj.isEnabled && applicationObj.restUrl=='')">
								<small id="app-name-error-required" class="err-message">
									Rest API URL is required
								</small>
							</div>
						</div>

						<div [ngClass]="(applicationObj.isEnabled || applicationObj.rolesInAAF) ? 'property required' : 'property'"
							*ngIf="!(applicationObj.applicationType == '2')">
							<div id="username-property-label" class="property-label" style="display: flex;">
								<span style="flex: 9">Auth Configured User</span>
								<app-information-tooltip style="flex: 1;"
									[textMessage]="'Basic Authentication Username Information'">
								</app-information-tooltip>
							</div>
							<input type="text" id="input-username-property"
								[(ngModel)]="applicationObj.appBasicAuthUsername" name="username" maxlength="256"
								ng-required="!appDetails.app.restrictedApp" />

							<div id="error-container-edit" class="error-container"
								*ngIf="((applicationObj.isEnabled || applicationObj.rolesInAAF) && applicationObj.appBasicAuthUsername =='')">
								<small id="app-name-error-required" class="err-message">
									App Username is required
								</small>
							</div>
						</div>

						<div [ngClass]="(applicationObj.isEnabled && !applicationObj.rolesInAAF) ? 'property required' : 'property'"
							*ngIf="!(applicationObj.applicationType == '2' || (applicationObj.rolesInAAF && applicationObj.usesCadi))">
							<div id="pwd-property-label" class="property-label" style="display: flex;">
								<span style="flex: 9">Basic Auth Password</span>
								<app-information-tooltip style="flex: 1;"
									[textMessage]="'Basic Authentication Password Information'">
								</app-information-tooltip>
							</div>
							<input type="password" id="input-mylogins-password"
								[(ngModel)]="applicationObj.appBasicAuthPassword" autocomplete="new-password"
								name="appPassword" maxlength="256" />

							<div id="error-container-edit" class="error-container"
								*ngIf="(applicationObj.isEnabled && !applicationObj.rolesInAAF && applicationObj.appBasicAuthPassword =='')">
								<small id="app-name-error-required" class="err-message">
									Password is required
								</small>
							</div>
						</div>
					</div>

					<!-- Right container-->
					<div class="right-container">

						<div class="property" *ngIf="!(applicationObj.applicationType == '3')">
							<div class="property-label" style="display: flex;">
								<span style="flex: 9">Upload
									Image</span>
								<app-information-tooltip style="flex: 1;"
									[textMessage]="'Image file must be smaller than 1MB'">
								</app-information-tooltip>
							</div>
							<input type="file" id="input-app-image-upload"
								class="input-file-field input-app-image-upload-ht" accept="image/*"
								[(ngModel)]="applicationObj.originalImage" name="appImage"
								image-upload="applicationObj.originalImage" image-upload-resize-max-height="300"
								image-upload-resize-max-width="360" image-upload-resize-quality="0.7"
								image-upload-api="appDetails.imageApi" (change)="appImageHandler($event)" />

							<div id="app-error-image-upload-type" class="error-container" *ngIf="appImageTypeError"
								class="ng-hide">
								<div class="error-container">
									<small id="error-app-invalid-image-size" class="err-message">File must be an
										image</small>
								</div>
							</div>

							<div id="app-error-image-upload" class="error-container"
								*ngIf="(applicationObj.originalImage && applicationObj.originalImage.dirty)">
								<div ng-messages="appForm.appImage.$error" class="error-container">
									<small id="error-app-invalid-image-size" class="err-message"
										ng-message="imageSize">Image file must be smaller than
										1MB</small>
								</div>
							</div>
						</div>


						<div class="property" *ngIf="!(applicationObj.applicationType == '3')">
							<div class="property-label preview">
								<span class="left-label">Preview</span>
								<span class="remove" (click)="removeImage()">Remove</span>
							</div>
							<img id="image-app-preview" class="image-preview"
								src="{{applicationObj.imageLink || applicationObj.thumbnail || emptyImgForPreview}}" />
						</div>

						<div class="property" *ngIf="!(applicationObj.applicationType == '3')">
							<div id="property-guest-access" class="property-guest-access">
								<mat-checkbox name="isOpen" [(ngModel)]="applicationObj.isOpen"
									id="checkbox-app-is-open"
									[checked]="(applicationObj.isOpen || applicationObj.applicationType == '2')"
									[disabled]="applicationObj.applicationType == '2'">Allow guest access
								</mat-checkbox>
							</div>
						</div>

						<div class="table-control" style="display: inline-flex;"
							*ngIf="!(applicationObj.applicationType == '2')">
							<div id="property-communication-key" class="property"
								*ngIf="!(applicationObj.applicationType == '2' || applicationObj.applicationType == '3')"
								style="width: 250px;">
								<div id="property-communication-key-label" class="property-label">Application
									UUID</div>
								<input type="text" id="input-UEB-communication-key" [(ngModel)]="applicationObj.uebKey"
									name="uebKey" readonly="readonly" [disabled]="true" />
							</div>

							<div class="communitcaion-key" aria-haspopup="true" style="padding-left: 20px;">
								<div b2b-flyout-toggler class="notification-div">
									<div id="tooltip" class="icon-primary-flat-info" tabindex="0"
										b2b-accessibility-click="13,32" aria-label="notifications" aria-haspopup="true"
										role="button"></div>
								</div>
								<!--<div id="notification" align="left">
								<p class="uuid-text" style="font: normal 12px Omnes-ECOMP-W02, Arial;">Application UUID is used as a communication
								key between application and portal.Please place this value in
								portal.properties</p>
							</div>-->
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>

		<div class="modal-footer">
			<button type="button" class="btn btn-primary"
				[disabled]="(!applicationObj.appName ||  applicationObj.appName.length == 0)"
				(click)="saveChanges()">Save</button> &nbsp;
			<button type="button" class="btn btn-primary" (click)="activeModal.close('Close')">Cancel</button>
		</div>

	</div>
</div>