69ed4574e6ab28917a88ea5893e512df615d8514
[motion-next.git] /
1 <md-dialog class="servicenowAccount-dialog" aria-label="New ServicenowAccount">
2   <form name="servicenowAccountForm" class="md-inline-form" novalidate>
3     <md-toolbar class="md-accent md-hue-2">
4       <div
5         class="md-toolbar-tools"
6         layout="row"
7         layout-align="space-between center"
8       >
9         <span class="title">{{ vm.title | translate }}</span>
10         <md-button class="md-icon-button" ng-click="vm.closeDialog()">
11           <md-icon
12             md-font-icon="icon-close"
13             aria-label="Close dialog"
14           ></md-icon>
15         </md-button>
16       </div>
17     </md-toolbar>
18
19     <md-dialog-content ms-scroll>
20       <div class="error-list">
21         <div
22           ng-repeat="error in vm.errors"
23           class="error"
24           layout="row"
25           layout-align="space-between center"
26         >
27           <div>
28             <span class="message">{{error.message}}</span>
29             <span class="type">({{error.type}})</span>
30           </div>
31           <md-button class="md-icon-button">
32             <md-icon
33               md-font-icon="icon-alert-box"
34               aria-label="alert error"
35               class="s16"
36             ></md-icon>
37           </md-button>
38         </div>
39       </div>
40       <md-input-container class="md-block">
41         <label translate="INTEGRATIONS.NAME">Name</label>
42         <input
43           type="text"
44           name="name"
45           ng-model="vm.servicenowAccount.name"
46           ng-required="true"
47           autofocus
48         />
49
50         <div
51           ng-messages="servicenowAccountForm['name'].$error"
52           ng-show="servicenowAccountForm['name'].$touched"
53           role="alert"
54         >
55           <div ng-message="required">
56             <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED"
57               >Name field is required</span
58             >
59           </div>
60         </div>
61       </md-input-container>
62       <md-input-container class="md-block">
63         <label translate="INTEGRATIONS.USERNAME">Username</label>
64         <input
65           type="text"
66           name="username"
67           ng-model="vm.servicenowAccount.username"
68           ng-required="true"
69         />
70
71         <div
72           ng-messages="servicenowAccountForm['username'].$error"
73           ng-show="servicenowAccountForm['username'].$touched"
74           role="alert"
75         >
76           <div ng-message="required">
77             <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED"
78               >Username field is required</span
79             >
80           </div>
81         </div>
82       </md-input-container>
83       <md-input-container class="md-block">
84         <label translate="INTEGRATIONS.PASSWORD">Password</label>
85         <input
86           type="password"
87           name="password"
88           ng-model="vm.servicenowAccount.password"
89           placeholder="Password"
90           translate
91           translate-attr-placeholder="INTEGRATIONS.PASSWORD"
92           required
93         />
94         <div
95           ng-messages="servicenowAccountForm['password'].$error"
96           role="alert"
97         >
98           <div ng-message="required">
99             <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED"
100               >Password field is required</span
101             >
102           </div>
103           <div ng-message="pattern">
104             <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN"
105               >Must contain at least 8 characters, with a minimum of 1 lowercase
106               letter, 1 uppercase letter, 1 numeric character and 1 special
107               character ~!?*@#$%^&-_=+[{]}.</span
108             >
109           </div>
110         </div>
111       </md-input-container>
112
113       <md-input-container class="md-block">
114         <label translate="INTEGRATIONS.EMAIL">Email</label>
115         <input
116           type="email"
117           name="email"
118           ng-model="vm.servicenowAccount.email"
119           ng-required="true"
120         />
121
122         <div
123           ng-messages="servicenowAccountForm['email'].$error"
124           ng-show="servicenowAccountForm['email'].$touched"
125           role="alert"
126         >
127           <div ng-message="required">
128             <span translate="INTEGRATIONS.ERRORS.EMAIL_REQUIRED"
129               >Email field is required</span
130             >
131           </div>
132           <div ng-message="email">
133             <span translate="INTEGRATIONS.ERRORS.EMAIL_MUST_VALID"
134               >Email must be a valid e-mail address</span
135             >
136           </div>
137         </div>
138       </md-input-container>
139       <md-input-container class="md-block">
140         <label translate="INTEGRATIONS.HOST">Host</label>
141         <input
142           type="url"
143           name="remoteUri"
144           ng-model="vm.servicenowAccount.remoteUri"
145           ng-required="true"
146         />
147
148         <div
149           ng-messages="servicenowAccountForm['remoteUri'].$error"
150           ng-show="servicenowAccountForm['remoteUri'].$touched"
151           role="alert"
152         >
153           <div ng-message="required">
154             <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED"
155               >Host field is required</span
156             >
157           </div>
158           <div ng-message="url">
159             <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL"
160               >Host must be a valid url http://www.xcally.com</span
161             >
162           </div>
163         </div>
164       </md-input-container>
165       <md-input-container class="md-block">
166         <label translate="INTEGRATIONS.MOTIONPROXYADDRESS"
167           >MotionProxyAddress</label
168         >
169         <input
170           type="url"
171           name="serverUrl"
172           ng-model="vm.servicenowAccount.serverUrl"
173         />
174
175         <div class="hint">
176           <span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span>
177         </div>
178         <div
179           ng-messages="servicenowAccountForm['serverUrl'].$error"
180           ng-show="servicenowAccountForm['serverUrl'].$touched"
181           role="alert"
182         >
183           <div ng-message="required">
184             <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED"
185               >MotionProxyAddress field is required</span
186             >
187           </div>
188           <div ng-message="url">
189             <span
190               translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL"
191               >MotionProxyAddress must be a valid url
192               http://www.xcally.com</span
193             >
194           </div>
195         </div>
196       </md-input-container>
197       <md-input-container class="md-block">
198         <label translate="INTEGRATIONS.DESCRIPTION">Description</label>
199         <input
200           type="text"
201           name="description"
202           ng-model="vm.servicenowAccount.description"
203         />
204
205         <div
206           ng-messages="servicenowAccountForm['description'].$error"
207           ng-show="servicenowAccountForm['description'].$touched"
208           role="alert"
209         >
210           <div ng-message="required">
211             <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED"
212               >Description field is required</span
213             >
214           </div>
215         </div>
216       </md-input-container>
217
218       <div class="error-list">
219         <div
220           ng-repeat="error in vm.errors"
221           class="error"
222           layout="row"
223           layout-align="space-between center"
224         >
225           <div>
226             <span class="message">{{error.message}}</span>
227             <span class="type">({{error.type}})</span>
228           </div>
229           <md-button class="md-icon-button">
230             <md-icon
231               md-font-icon="icon-alert-box"
232               aria-label="alert error"
233               class="s16"
234             ></md-icon>
235           </md-button>
236         </div>
237       </div>
238     </md-dialog-content>
239
240     <md-dialog-actions
241       layout="row"
242       layout-align="space-between center"
243       ng-if="!vm.crudPermissions.readOnly"
244     >
245       <div layout="row" layout-align="start center">
246         <md-button
247           type="submit"
248           ng-if="vm.crudPermissions.canEdit && !vm.newServicenowAccount"
249           ng-click="vm.saveServicenowAccount()"
250           class="send-button md-accent md-raised"
251           ng-disabled="servicenowAccountForm.$invalid || servicenowAccountForm.$pristine"
252           aria-label="SAVE"
253           translate="INTEGRATIONS.SAVE"
254           translate-attr-aria-label="INTEGRATIONS.SAVE"
255         >
256           SAVE
257         </md-button>
258
259         <md-button
260           type="submit"
261           ng-if="vm.crudPermissions.canEdit && vm.newServicenowAccount"
262           ng-click="vm.addNewServicenowAccount()"
263           class="send-button md-accent md-raised"
264           ng-disabled="servicenowAccountForm.$invalid"
265           aria-label="ADD"
266           translate="INTEGRATIONS.ADD_SERVICENOWACCOUNT"
267           translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWACCOUNT"
268         >
269           ADD SERVICENOWACCOUNT
270         </md-button>
271       </div>
272       <div layout="row">
273         <md-button
274           class="md-icon-button"
275           ng-if="vm.crudPermissions.canDelete && !vm.newServicenowAccount"
276           ng-click="vm.deleteServicenowAccount($event)"
277           aria-label="DELETE"
278           translate
279           translate-attr-aria-label="INTEGRATIONS.DELETE"
280         >
281           <md-icon md-font-icon="icon-delete"></md-icon>
282           <md-tooltip
283             ><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip
284           >
285         </md-button>
286       </div>
287     </md-dialog-actions>
288   </form>
289 </md-dialog>