ee6dd870e236e73da8bbeb6aab74259df0281c67
[motion-next.git] /
1 <md-dialog class="salesforceAccount-dialog" aria-label="New SalesforceAccount">
2   <form name="salesforceAccountForm" 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.salesforceAccount.name"
46           ng-required="true"
47           autofocus
48         />
49
50         <div
51           ng-messages="salesforceAccountForm['name'].$error"
52           ng-show="salesforceAccountForm['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.salesforceAccount.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="salesforceAccountForm['type'].$error"
75           ng-show="salesforceAccountForm['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.salesforceAccount.username"
91           ng-required="true"
92         />
93
94         <div
95           ng-messages="salesforceAccountForm['username'].$error"
96           ng-show="salesforceAccountForm['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.salesforceAccount.remoteUri"
112           ng-required="true"
113         />
114
115         <div
116           ng-messages="salesforceAccountForm['remoteUri'].$error"
117           ng-show="salesforceAccountForm['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.PASSWORD">Password</label>
134         <input
135           type="password"
136           name="password"
137           ng-model="vm.salesforceAccount.password"
138           placeholder="Password"
139           translate
140           translate-attr-placeholder="INTEGRATIONS.PASSWORD"
141           required
142         />
143         <div
144           ng-messages="salesforceAccountForm['password'].$error"
145           role="alert"
146         >
147           <div ng-message="required">
148             <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED"
149               >Password field is required</span
150             >
151           </div>
152           <div ng-message="pattern">
153             <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN"
154               >Must contain at least 8 characters, with a minimum of 1 lowercase
155               letter, 1 uppercase letter, 1 numeric character and 1 special
156               character ~!?*@#$%^&-_=+[{]}.</span
157             >
158           </div>
159         </div>
160       </md-input-container>
161
162       <md-input-container class="md-block">
163         <label translate="INTEGRATIONS.CLIENTID">ClientId</label>
164         <input
165           type="text"
166           name="clientId"
167           ng-model="vm.salesforceAccount.clientId"
168           ng-required="true"
169         />
170
171         <div
172           ng-messages="salesforceAccountForm['clientId'].$error"
173           ng-show="salesforceAccountForm['clientId'].$touched"
174           role="alert"
175         >
176           <div ng-message="required">
177             <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED"
178               >ClientId field is required</span
179             >
180           </div>
181         </div>
182       </md-input-container>
183       <md-input-container class="md-block">
184         <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>
185         <input
186           type="text"
187           name="clientSecret"
188           ng-model="vm.salesforceAccount.clientSecret"
189           ng-required="true"
190         />
191
192         <div
193           ng-messages="salesforceAccountForm['clientSecret'].$error"
194           ng-show="salesforceAccountForm['clientSecret'].$touched"
195           role="alert"
196         >
197           <div ng-message="required">
198             <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED"
199               >ClientSecret field is required</span
200             >
201           </div>
202         </div>
203       </md-input-container>
204       <md-input-container class="md-block">
205         <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>
206         <input
207           type="text"
208           name="securityToken"
209           ng-model="vm.salesforceAccount.securityToken"
210           ng-required="true"
211         />
212
213         <div
214           ng-messages="salesforceAccountForm['securityToken'].$error"
215           ng-show="salesforceAccountForm['securityToken'].$touched"
216           role="alert"
217         >
218           <div ng-message="required">
219             <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED"
220               >SecurityToken field is required</span
221             >
222           </div>
223         </div>
224       </md-input-container>
225       <md-input-container class="md-block">
226         <label translate="INTEGRATIONS.MOTIONPROXYADDRESS"
227           >MotionProxyAddress</label
228         >
229         <input
230           type="url"
231           name="serverUrl"
232           ng-model="vm.salesforceAccount.serverUrl"
233         />
234
235         <div class="hint">
236           <span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span>
237         </div>
238         <div
239           ng-messages="salesforceAccountForm['serverUrl'].$error"
240           ng-show="salesforceAccountForm['serverUrl'].$touched"
241           role="alert"
242         >
243           <div ng-message="required">
244             <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED"
245               >MotionProxyAddress field is required</span
246             >
247           </div>
248           <div ng-message="url">
249             <span
250               translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL"
251               >MotionProxyAddress must be a valid url
252               http://www.xcally.com</span
253             >
254           </div>
255         </div>
256       </md-input-container>
257       <md-input-container class="md-block">
258         <label translate="INTEGRATIONS.DESCRIPTION">Description</label>
259         <input
260           type="text"
261           name="description"
262           ng-model="vm.salesforceAccount.description"
263         />
264
265         <div
266           ng-messages="salesforceAccountForm['description'].$error"
267           ng-show="salesforceAccountForm['description'].$touched"
268           role="alert"
269         >
270           <div ng-message="required">
271             <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED"
272               >Description field is required</span
273             >
274           </div>
275         </div>
276       </md-input-container>
277
278       <div class="error-list">
279         <div
280           ng-repeat="error in vm.errors"
281           class="error"
282           layout="row"
283           layout-align="space-between center"
284         >
285           <div>
286             <span class="message">{{error.message}}</span>
287             <span class="type">({{error.type}})</span>
288           </div>
289           <md-button class="md-icon-button">
290             <md-icon
291               md-font-icon="icon-alert-box"
292               aria-label="alert error"
293               class="s16"
294             ></md-icon>
295           </md-button>
296         </div>
297       </div>
298     </md-dialog-content>
299
300     <md-dialog-actions
301       layout="row"
302       layout-align="space-between center"
303       ng-if="!vm.crudPermissions.readOnly"
304     >
305       <div layout="row" layout-align="start center">
306         <md-button
307           type="submit"
308           ng-if="vm.crudPermissions.canEdit && !vm.newSalesforceAccount"
309           ng-click="vm.saveSalesforceAccount()"
310           class="send-button md-accent md-raised"
311           ng-disabled="salesforceAccountForm.$invalid || salesforceAccountForm.$pristine"
312           aria-label="SAVE"
313           translate="INTEGRATIONS.SAVE"
314           translate-attr-aria-label="INTEGRATIONS.SAVE"
315         >
316           SAVE
317         </md-button>
318
319         <md-button
320           type="submit"
321           ng-if="vm.crudPermissions.canEdit && vm.newSalesforceAccount"
322           ng-click="vm.addNewSalesforceAccount()"
323           class="send-button md-accent md-raised"
324           ng-disabled="salesforceAccountForm.$invalid"
325           aria-label="ADD"
326           translate="INTEGRATIONS.ADD_SALESFORCEACCOUNT"
327           translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT"
328         >
329           ADD SALESFORCEACCOUNT
330         </md-button>
331       </div>
332       <div layout="row">
333         <md-button
334           class="md-icon-button"
335           ng-if="vm.crudPermissions.canDelete && !vm.newSalesforceAccount"
336           ng-click="vm.deleteSalesforceAccount($event)"
337           aria-label="DELETE"
338           translate
339           translate-attr-aria-label="INTEGRATIONS.DELETE"
340         >
341           <md-icon md-font-icon="icon-delete"></md-icon>
342           <md-tooltip
343             ><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip
344           >
345         </md-button>
346       </div>
347     </md-dialog-actions>
348   </form>
349 </md-dialog>