1e7670e0c086f503318ea8914c1468ff5064cd08
[motion-next.git] /
1 <md-dialog class="zendeskAccount-dialog" aria-label="New ZendeskAccount">
2   <form name="zendeskAccountForm" 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.zendeskAccount.name"
46           ng-required="true"
47           autofocus
48         />
49
50         <div
51           ng-messages="zendeskAccountForm['name'].$error"
52           ng-show="zendeskAccountForm['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.TYPE">Type</label>
64         <md-select name="type" ng-model="vm.zendeskAccount.type" required>
65           <md-option ng-value="'integrationTab'">
66             {{ 'INTEGRATIONS.INTEGRATION_TAB' | translate }}
67           </md-option>
68
69           <md-option ng-value="'newTab'">
70             {{ 'INTEGRATIONS.NEW_TAB' | translate }}
71           </md-option>
72         </md-select>
73         <div
74           ng-messages="zendeskAccountForm['type'].$error"
75           ng-show="zendeskAccountForm['type'].$touched"
76           role="alert"
77         >
78           <div ng-message="required">
79             <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED"
80               >Type field is required</span
81             >
82           </div>
83         </div>
84       </md-input-container>
85       <md-input-container class="md-block">
86         <label translate="INTEGRATIONS.USERNAME">Username</label>
87         <input
88           type="text"
89           name="username"
90           ng-model="vm.zendeskAccount.username"
91           ng-required="true"
92         />
93
94         <div
95           ng-messages="zendeskAccountForm['username'].$error"
96           ng-show="zendeskAccountForm['username'].$touched"
97           role="alert"
98         >
99           <div ng-message="required">
100             <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED"
101               >Username field is required</span
102             >
103           </div>
104         </div>
105       </md-input-container>
106       <md-input-container class="md-block">
107         <label translate="INTEGRATIONS.URI">Uri</label>
108         <input
109           type="url"
110           name="remoteUri"
111           ng-model="vm.zendeskAccount.remoteUri"
112           ng-required="true"
113         />
114
115         <div
116           ng-messages="zendeskAccountForm['remoteUri'].$error"
117           ng-show="zendeskAccountForm['remoteUri'].$touched"
118           role="alert"
119         >
120           <div ng-message="required">
121             <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED"
122               >Uri field is required</span
123             >
124           </div>
125           <div ng-message="url">
126             <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL"
127               >Uri must be a valid url http://www.xcally.com</span
128             >
129           </div>
130         </div>
131       </md-input-container>
132       <md-input-container class="md-block">
133         <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>
134         <md-select
135           name="authType"
136           ng-model="vm.zendeskAccount.authType"
137           required
138         >
139           <md-option ng-value="'password'">Password</md-option>
140           <md-option ng-value="'token'">Token</md-option>
141         </md-select>
142         <div
143           ng-messages="zendeskAccountForm['authType'].$error"
144           ng-show="zendeskAccountForm['authType'].$touched"
145           role="alert"
146         >
147           <div ng-message="required">
148             <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED"
149               >AuthType field is required</span
150             >
151           </div>
152         </div>
153       </md-input-container>
154       <md-input-container
155         class="md-block"
156         ng-if="vm.zendeskAccount.authType == 'password'"
157       >
158         <label translate="INTEGRATIONS.PASSWORD">Password</label>
159         <input
160           type="password"
161           name="password"
162           ng-model="vm.zendeskAccount.password"
163           placeholder="Password"
164           translate
165           translate-attr-placeholder="INTEGRATIONS.PASSWORD"
166           required
167         />
168         <div ng-messages="zendeskAccountForm['password'].$error" role="alert">
169           <div ng-message="required">
170             <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED"
171               >Password field is required</span
172             >
173           </div>
174           <div ng-message="pattern">
175             <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN"
176               >Must contain at least 8 characters, with a minimum of 1 lowercase
177               letter, 1 uppercase letter, 1 numeric character and 1 special
178               character ~!?*@#$%^&-_=+[{]}.</span
179             >
180           </div>
181         </div>
182       </md-input-container>
183
184       <md-input-container
185         ng-if="vm.zendeskAccount.authType == 'token'"
186         class="md-block"
187       >
188         <label translate="INTEGRATIONS.TOKEN">Token</label>
189         <input
190           type="text"
191           name="token"
192           ng-model="vm.zendeskAccount.token"
193           ng-required="true"
194         />
195
196         <div
197           ng-messages="zendeskAccountForm['token'].$error"
198           ng-show="zendeskAccountForm['token'].$touched"
199           role="alert"
200         >
201           <div ng-message="required">
202             <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED"
203               >Token field is required</span
204             >
205           </div>
206         </div>
207       </md-input-container>
208       <md-input-container class="md-block">
209         <label translate="INTEGRATIONS.MOTIONPROXYADDRESS"
210           >MotionProxyAddress</label
211         >
212         <input
213           type="url"
214           name="serverUrl"
215           ng-model="vm.zendeskAccount.serverUrl"
216         />
217
218         <div class="hint">
219           <span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span>
220         </div>
221         <div
222           ng-messages="zendeskAccountForm['serverUrl'].$error"
223           ng-show="zendeskAccountForm['serverUrl'].$touched"
224           role="alert"
225         >
226           <div ng-message="required">
227             <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED"
228               >MotionProxyAddress field is required</span
229             >
230           </div>
231           <div ng-message="url">
232             <span
233               translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL"
234               >MotionProxyAddress must be a valid url
235               http://www.xcally.com</span
236             >
237           </div>
238         </div>
239       </md-input-container>
240       <md-input-container class="md-block">
241         <label translate="INTEGRATIONS.DESCRIPTION">Description</label>
242         <input
243           type="text"
244           name="description"
245           ng-model="vm.zendeskAccount.description"
246         />
247
248         <div
249           ng-messages="zendeskAccountForm['description'].$error"
250           ng-show="zendeskAccountForm['description'].$touched"
251           role="alert"
252         >
253           <div ng-message="required">
254             <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED"
255               >Description field is required</span
256             >
257           </div>
258         </div>
259       </md-input-container>
260
261       <div class="error-list">
262         <div
263           ng-repeat="error in vm.errors"
264           class="error"
265           layout="row"
266           layout-align="space-between center"
267         >
268           <div>
269             <span class="message">{{error.message}}</span>
270             <span class="type">({{error.type}})</span>
271           </div>
272           <md-button class="md-icon-button">
273             <md-icon
274               md-font-icon="icon-alert-box"
275               aria-label="alert error"
276               class="s16"
277             ></md-icon>
278           </md-button>
279         </div>
280       </div>
281     </md-dialog-content>
282
283     <md-dialog-actions
284       layout="row"
285       layout-align="space-between center"
286       ng-if="!vm.crudPermissions.readOnly"
287     >
288       <div layout="row" layout-align="start center">
289         <md-button
290           type="submit"
291           ng-if="vm.crudPermissions.canEdit && !vm.newZendeskAccount"
292           ng-click="vm.saveZendeskAccount()"
293           class="send-button md-accent md-raised"
294           ng-disabled="zendeskAccountForm.$invalid || zendeskAccountForm.$pristine"
295           aria-label="SAVE"
296           translate="INTEGRATIONS.SAVE"
297           translate-attr-aria-label="INTEGRATIONS.SAVE"
298         >
299           SAVE
300         </md-button>
301
302         <md-button
303           type="submit"
304           ng-if="vm.crudPermissions.canEdit && vm.newZendeskAccount"
305           ng-click="vm.addNewZendeskAccount()"
306           class="send-button md-accent md-raised"
307           ng-disabled="zendeskAccountForm.$invalid"
308           aria-label="ADD"
309           translate="INTEGRATIONS.ADD_ZENDESKACCOUNT"
310           translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT"
311         >
312           ADD ZENDESKACCOUNT
313         </md-button>
314       </div>
315       <div layout="row">
316         <md-button
317           class="md-icon-button"
318           ng-if="vm.crudPermissions.canDelete && !vm.newZendeskAccount"
319           ng-click="vm.deleteZendeskAccount($event)"
320           aria-label="DELETE"
321           translate
322           translate-attr-aria-label="INTEGRATIONS.DELETE"
323         >
324           <md-icon md-font-icon="icon-delete"></md-icon>
325           <md-tooltip
326             ><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip
327           >
328         </md-button>
329       </div>
330     </md-dialog-actions>
331   </form>
332 </md-dialog>