05de3cdc7358d39b236fd1103fd9e7fe61e74710
[motion-next.git] /
1 <md-dialog class="whatsappQueue-dialog" aria-label="New WhatsappQueue">
2   <form name="whatsappQueueForm" 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="WHATSAPP.NAME">Name</label>
42         <input
43           type="text"
44           name="name"
45           ng-model="vm.whatsappQueue.name"
46           ng-pattern="/^[A-Za-z0-9\.\_]+$/i"
47           ng-required="true"
48           autofocus
49           ng-disabled="!vm.newWhatsappQueue"
50         />
51
52         <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>
53         <div
54           ng-messages="whatsappQueueForm['name'].$error"
55           ng-show="whatsappQueueForm['name'].$touched"
56           role="alert"
57         >
58           <div ng-message="required">
59             <span translate="WHATSAPP.ERRORS.NAME_REQUIRED"
60               >Name field is required</span
61             >
62           </div>
63           <div ng-message="pattern">
64             <span
65               translate="WHATSAPP.ERRORS.NAME_MUST_VALID_PATTERN"
66               translate-values="{ regex: '/^[A-Za-z0-9\.\_]+$/i' }"
67               >Name must be valid pattern
68             </span>
69           </div>
70         </div>
71       </md-input-container>
72       <md-input-container class="md-block">
73         <label translate="WHATSAPP.STRATEGY">Strategy</label>
74         <md-select
75           name="strategy"
76           ng-model="vm.whatsappQueue.strategy"
77           required
78         >
79           <md-option ng-value="'beepall'">Beepall</md-option>
80           <md-option ng-value="'rrmemory'">RR Memory</md-option>
81         </md-select>
82         <div
83           ng-messages="whatsappQueueForm['strategy'].$error"
84           ng-show="whatsappQueueForm['strategy'].$touched"
85           role="alert"
86         >
87           <div ng-message="required">
88             <span translate="WHATSAPP.ERRORS.STRATEGY_REQUIRED"
89               >Strategy field is required</span
90             >
91           </div>
92         </div>
93       </md-input-container>
94       <md-input-container class="md-block">
95         <label translate="WHATSAPP.AGENT_TIMEOUT">Agent_Timeout</label>
96         <input
97           type="number"
98           name="timeout"
99           ng-model="vm.whatsappQueue.timeout"
100           min="1"
101           max="2147483"
102           ng-required="true"
103         />
104
105         <div
106           ng-messages="whatsappQueueForm['timeout'].$error"
107           ng-show="whatsappQueueForm['timeout'].$touched"
108           role="alert"
109         >
110           <div ng-message="required">
111             <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_REQUIRED"
112               >Agent_Timeout field is required</span
113             >
114           </div>
115           <div ng-message="min">
116             <span
117               translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO"
118               >Agent_Timeout must be a valid greater or equal than</span
119             >
120             <span>1</span>
121           </div>
122           <div ng-message="max">
123             <span
124               translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO"
125               >Agent_Timeout must be a valid greater or equal than</span
126             >
127             <span>2147483</span>
128           </div>
129         </div>
130       </md-input-container>
131       <md-input-container class="md-block">
132         <label translate="WHATSAPP.DESCRIPTION">Description</label>
133         <input
134           type="text"
135           name="description"
136           ng-model="vm.whatsappQueue.description"
137         />
138
139         <div
140           ng-messages="whatsappQueueForm['description'].$error"
141           ng-show="whatsappQueueForm['description'].$touched"
142           role="alert"
143         >
144           <div ng-message="required">
145             <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED"
146               >Description field is required</span
147             >
148           </div>
149         </div>
150       </md-input-container>
151
152       <div class="error-list">
153         <div
154           ng-repeat="error in vm.errors"
155           class="error"
156           layout="row"
157           layout-align="space-between center"
158         >
159           <div>
160             <span class="message">{{error.message}}</span>
161             <span class="type">({{error.type}})</span>
162           </div>
163           <md-button class="md-icon-button">
164             <md-icon
165               md-font-icon="icon-alert-box"
166               aria-label="alert error"
167               class="s16"
168             ></md-icon>
169           </md-button>
170         </div>
171       </div>
172     </md-dialog-content>
173
174     <md-dialog-actions
175       layout="row"
176       layout-align="space-between center"
177       ng-if="!vm.crudPermissions.readOnly"
178     >
179       <div layout="row" layout-align="start center">
180         <md-button
181           type="submit"
182           ng-if="vm.crudPermissions.canEdit && !vm.newWhatsappQueue"
183           ng-click="vm.saveWhatsappQueue()"
184           class="send-button md-accent md-raised"
185           ng-disabled="whatsappQueueForm.$invalid || whatsappQueueForm.$pristine"
186           aria-label="SAVE"
187           translate="WHATSAPP.SAVE"
188           translate-attr-aria-label="WHATSAPP.SAVE"
189         >
190           SAVE
191         </md-button>
192
193         <md-button
194           type="submit"
195           ng-if="vm.crudPermissions.canEdit && vm.newWhatsappQueue"
196           ng-click="vm.addNewWhatsappQueue()"
197           class="send-button md-accent md-raised"
198           ng-disabled="whatsappQueueForm.$invalid"
199           aria-label="ADD"
200           translate="WHATSAPP.ADD_WHATSAPPQUEUE"
201           translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPQUEUE"
202         >
203           ADD WHATSAPPQUEUE
204         </md-button>
205       </div>
206       <div layout="row">
207         <md-button
208           class="md-icon-button"
209           ng-if="vm.crudPermissions.canDelete && !vm.newWhatsappQueue"
210           ng-click="vm.deleteWhatsappQueue($event)"
211           aria-label="DELETE"
212           translate
213           translate-attr-aria-label="WHATSAPP.DELETE"
214         >
215           <md-icon md-font-icon="icon-delete"></md-icon>
216           <md-tooltip
217             ><span translate="WHATSAPP.DELETE">DELETE</span></md-tooltip
218           >
219         </md-button>
220       </div>
221     </md-dialog-actions>
222   </form>
223 </md-dialog>