summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-FE-common/client/app/views/widget-onboarding/widget-details-dialog/widget-details.modal.html
blob: ade07b95ba91268e97fbceba50e10c52a9e4f56c (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
<!--
  ============LICENSE_START==========================================
  ONAP Portal
  ===================================================================
  Copyright (C) 2017 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="widget-details-modal">

		<div class="b2b-modal-header">
			<h2 class="widget-title" id="widgets-details-title">Widget Details</h2>

			<div class="corner-button in">
				<button type="button" class="close" aria-label="Close"
					ng-click="$dismiss('cancel')"></button>
			</div>
		</div>

		<div class="b2b-modal-body">
		<div class="widget-properties-main"
		scroll-top="widgetOnboardingDetails.scrollApi">
		<form id="widgets-details-form" name="widgetForm" novalidate
			autocomplete="off">

			<div class="item required">
				<div class="item-label">Widget Name</div>
				<input id="widgets-details-input-name" class="table-search-field"
					type="text" ng-model="widgetOnboardingDetails.widget.name"
					ng-change="widgetOnboardingDetails.updateWidgetName()" name="name"
					ng-pattern="/^[\w -]*$/" maxlength="100"
					ng-disabled="widgetOnboardingDetails.isEditMode" required />

				<div class="error-container"
					ng-show="(widgetOnboardingDetails.emptyWidgetName || widgetForm.name.$dirty) && !widgetOnboardingDetails.duplicatedName">
					<div id="widgets-details-input-name-conflict" class="err-message">Name
						not available - choose different name</div>
				</div>

				<div class="error-container"
					ng-show="(widgetOnboardingDetails.emptyWidgetName || widgetForm.name.$dirty) && widgetOnboardingDetails.duplicatedName">
					<div ng-messages="widgetForm.name.$error" class="error-container">
						<small id="widgets-details-input-name-required"
							class="err-message" ng-message="required">Widget Name is
							required</small> <small id="widgets-details-input-name-pattern"
							class="err-message" ng-message="pattern">Widget Name must
							be letters, numbers, space, dash or underscore</small>
					</div>
				</div>
			</div>

			<div class="item">
				<div class="item-label">Widget Description</div>
				<!-- <input id="widgets-details-input-description" class="input-field"
					type="text" ng-model="widgetOnboardingDetails.widget.desc"
					name="desc" maxlength="200" /> -->
					<textarea b2b-reset b2b-reset-textarea id="widgets-details-input-desc"
						name="desc" type="text" ng-model="widgetOnboardingDetails.widget.desc"  maxlength="200" 	></textarea>
			</div>

			<div class="item">
				<div class="item-label">Service Endpoint</div>
				<div class="table-dropdown" >
							<select id="widgets-details-input-endpoint-url" name="url" b2b-dropdown placeholder-text="Select Microservice Endpoint" ng-model="widgetOnboardingDetails.widget.serviceURL" ng-disabled="widgetOnboardingDetails.isEditMode" >
				            	<option b2b-dropdown-list option-repeat="service in widgetOnboardingDetails.availableServices" value="{{service.id}}">{{service.option}}</option>
				            </select>
						</div>
			</div>

			<div class="widget-property">
				<label for="widget-checkbox-app-is-enabled" class="checkbox">
					<input type="checkbox"
					ng-model="widgetOnboardingDetails.widget.allUser"
					id="widget-checkbox-app-is-enabled"> <i class="skin"></i>
					<span class="property-label checkbox-label">Allow all user
						access</span>
				</label>
			</div>

			<div class="item required"
				ng-show="!widgetOnboardingDetails.widget.allUser">
				<div class="item-label">Application Name</div>
				<div>
					<multiple-select id="widget-applications" unique-data="{{$index}}"
						placeholder="Select Applications"
						ng-model="widgetOnboardingDetails.availableApps"
						on-change="widgetOnboardingDetails.appUpdate()" name-attr="name"
						value-attr="isSelected"> </multiple-select>
				</div>
				<div class="error-container"
					ng-show="widgetOnboardingDetails.appCounter == 0">
					<div id="widgets-details-input-name-conflict" class="err-message">Please
						select at least one Application</div>
				</div>
			</div>

			<div class="item" ng-show="!widgetOnboardingDetails.widget.allUser">
				<div ng-show="widgetOnboardingDetails.hasSelectedApp"
					class="item-label">User Role Name</div>
				<div ng-repeat="appRoles in widgetOnboardingDetails.availableApps"
					id="roles-{{appRoles.roles.split(' ').join('-')}}">
					<div class="item required">
						<div class="app-item-left" ng-show="appRoles.isSelected">{{appRoles.name}}</div>
						<div class="app-item-right" ng-show="appRoles.isSelected">
							<multiple-select id="widget-roles-by-application"
								unique-data="{{$index}}" placeholder="Select Roles"
								ng-model="appRoles.roles" name-attr="name"
								on-change="widgetOnboardingDetails.roleUpdate(appRoles)"
								value-attr="isSelected"></multiple-select>
							<div class="error-container" ng-show="!appRoles.roleSelected">
								<div id="widgets-details-input-name-conflict"
									class="err-message">Please select at least one role</div>
							</div>
						</div>
					</div>
				</div>
			</div>

			<div ng-show=" widgetOnboardingDetails.uploadFlag">
				<div class="item-label">Upload Widget</div>
				<div>
					<input id="widget-onboarding-details-upload-file"
						file-model="widgetOnboardingDetails.widget.file" type="file"
						class="widget-onboarding-details-upload-file ht" />


					<div class="error-container"
						ng-show="widgetOnboardingDetails.widget.file == undefined && !widgetOnboardingDetails.isEditMode">
						<div class="err-message">Please upload your widget (.zip)</div>
					</div>
				</div>
			</div>
		</form>
	</div>
			</div>
			<br>
			<div class="b2b-modal-footer">
				<div class="cta-button-group cta-modal-footer-flex">						
					<span class="ecomp-save-spinner" ng-show="widgetOnboardingDetails.isSaving"></span>
					<button id="widgets-details-save-button" class="btn btn-alt btn-small" 	ng-class="{disabled: widgetOnboardingDetails.widget.name == undefined || !widgetOnboardingDetails.duplicatedName 
					|| (!widgetOnboardingDetails.widget.allUser && widgetOnboardingDetails.appCounter == 0) || (widgetOnboardingDetails.widget.file == undefined && !widgetOnboardingDetails.isEditMode)
					|| (!widgetOnboardingDetails.widget.allUser && !widgetOnboardingDetails.allRoleSelected) || (widgetOnboardingDetails.widget.saving)}"
					ng-click="widgetOnboardingDetails.saveChanges()">Save</button>				
					<button class="btn btn-alt btn-small" id="widgets-details-cancel-button" ng-click="$dismiss('cancel')">Cancel</button>	
				</div>
			</div>
			
			
			
			

</div>