Added Widget-Onboarding and dependent Services
[portal.git] / portal-FE-common / src / app / pages / widget-onboarding / widget-details-dialog / widget-details-dialog.component.html
1 <!--
2   ============LICENSE_START==========================================
3   ONAP Portal
4   ===================================================================
5   Copyright (C) 2019 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
39 <div class="container">
40   <!--Modal Headers-->
41   <div class="modal-header">
42     <h4 class="modal-title">Widget Details</h4>
43     <button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross')">
44         <span aria-hidden="true">&times;</span>
45     </button>
46   </div>
47
48   <!--Modal Body goes here-->
49   <form id="widgets-details-form" name="widgetForm" [formGroup] = "uploadForm" (ngSubmit)="saveChanges()"
50           enctype="multipart/form-data" novalidate autocomplete="off">
51   <div class="modal-body">
52       <div class="widget-model-body">
53           <div class="item-label">Widget Name</div>
54           <input id="widgets-details-input-name" class="widget-name-field"
55               type="text" formControlName="widgetName" [(ngModel)]="widget.name"
56               ng-pattern="/^[\w -]*$/" maxlength="100"
57               ng-disabled="widgetOnboardingDetails.isEditMode" required />
58
59           <div class="item-label" style="padding-top: 20px">Widget Description</div>
60           
61           <textarea b2b-reset b2b-reset-textarea class="widgets-details-input-desc"
62             formControlName="description" [(ngModel)]="widget.desc" type="text" maxlength="200">
63           </textarea>
64             
65           <div class="table-dropdown">
66             <mat-form-field class="widget-service-select">
67                 <mat-label> Service Endpoint </mat-label>
68                 <mat-select name="widget-service-select" id="serviceEndPoint" 
69                   formControlName="serviceEndPoint" [(ngModel)]="widget.serviceURL" [disabled]="isEditMode">
70                   <mat-option *ngFor="let rowData of availableMicroServices" [value]="rowData.id" >{{rowData.option}}</mat-option>
71                 </mat-select>
72             </mat-form-field>
73           </div>
74
75           <div class="property-label checkbox-label" style="padding-top: 20px">
76             <mat-checkbox  formControlName="allowAllUser" type="checkbox" [(ngModel)]="widget.allUser"
77                 id="allow-all-user">
78                 Allow all user access
79             </mat-checkbox>
80           </div> 
81
82           <div [hidden]="widget.allUser">
83             <div class="table-dropdown">
84               <mat-form-field class="widget-applications-select">
85                   <mat-label> Application Name </mat-label>
86                   <mat-select multiple name="widget-application-select" id="application" 
87                     formControlName="applicationName" [(ngModel)]="widget.appName">
88                     <mat-option *ngFor="let rowData of availableApps" [value]="rowData.id" >{{rowData.name}}</mat-option>
89                   </mat-select>
90               </mat-form-field>
91             </div>
92           </div>
93
94           <div [hidden]="widget.allUser">
95             <div class="table-dropdown">
96               <mat-form-field class="widget-roles-select">
97                   <mat-label> User Role Name </mat-label>
98                   <mat-select multiple name="widget-role-select" id="roles" 
99                     formControlName="applicationRole" [(ngModel)]="widget.widgetRoles">
100                     <mat-option *ngFor="let appRole of availableApps.roles" [value]="appRole.id" >{{appRole.name}}</mat-option>
101                   </mat-select>
102               </mat-form-field>
103             </div>
104           </div>
105
106           <div class="item-label widget-upload">Upload Widget</div>
107           <div>
108             <input id="widget-onboarding-details-upload-file" 
109               name="profile" type="file" 
110               class="widget-onboarding-details-upload-file ht"
111               (change)="onFileSelect($event)"/>
112           </div>
113         </div>
114       </div> 
115       <div class="modal-footer">
116         <button type="submit" class="btn btn-primary"[disabled]="(isFileNotSelected && !isEditMode)">Save</button>
117         <button type="button" class="btn btn-primary" (click)="activeModal.close('Close')">Cancel</button>
118     </div>
119   </form> 
120 </div>