c0ce8008df50b662358c14028fc27abd2be9f070
[motion-next.git] /
1 <md-dialog
2   class="salesforceConfiguration-dialog"
3   aria-label="New SalesforceConfiguration"
4 >
5   <form name="salesforceConfigurationForm" class="md-inline-form" novalidate>
6     <md-toolbar class="md-accent md-hue-2">
7       <div
8         class="md-toolbar-tools"
9         layout="row"
10         layout-align="space-between center"
11       >
12         <span class="title">{{ vm.title | translate }}</span>
13         <md-button class="md-icon-button" ng-click="vm.closeDialog()">
14           <md-icon
15             md-font-icon="icon-close"
16             aria-label="Close dialog"
17           ></md-icon>
18         </md-button>
19       </div>
20     </md-toolbar>
21
22     <md-dialog-content ms-scroll>
23       <div class="error-list">
24         <div
25           ng-repeat="error in vm.errors"
26           class="error"
27           layout="row"
28           layout-align="space-between center"
29         >
30           <div>
31             <span class="message">{{error.message}}</span>
32             <span class="type">({{error.type}})</span>
33           </div>
34           <md-button class="md-icon-button">
35             <md-icon
36               md-font-icon="icon-alert-box"
37               aria-label="alert error"
38               class="s16"
39             ></md-icon>
40           </md-button>
41         </div>
42       </div>
43       <md-input-container class="md-block">
44         <label translate="INTEGRATIONS.NAME">Name</label>
45         <input
46           type=""
47           name="name"
48           ng-model="vm.salesforceConfiguration.name"
49           ng-required="true"
50           autofocus
51         />
52
53         <div
54           ng-messages="salesforceConfigurationForm['name'].$error"
55           ng-show="salesforceConfigurationForm['name'].$touched"
56           role="alert"
57         >
58           <div ng-message="required">
59             <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED"
60               >Name field is required</span
61             >
62           </div>
63         </div>
64       </md-input-container>
65       <md-input-container class="md-block">
66         <label translate="INTEGRATIONS.CHANNEL">Channel</label>
67         <md-select
68           name="channel"
69           ng-model="vm.salesforceConfiguration.channel"
70           required
71         >
72           <md-option ng-value="'voice'">
73             {{ 'INTEGRATIONS.VOICE' | translate }}
74           </md-option>
75         </md-select>
76         <div
77           ng-messages="salesforceConfigurationForm['channel'].$error"
78           ng-show="salesforceConfigurationForm['channel'].$touched"
79           role="alert"
80         >
81           <div ng-message="required">
82             <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED"
83               >Channel field is required</span
84             >
85           </div>
86         </div>
87       </md-input-container>
88       <md-input-container class="md-block">
89         <label translate="INTEGRATIONS.TYPE">Type</label>
90         <md-select
91           name="type"
92           ng-model="vm.salesforceConfiguration.type"
93           required
94         >
95           <md-option ng-value="'inbound'">
96             {{ 'INTEGRATIONS.INBOUND_IN_QUEUE' | translate }}
97           </md-option>
98
99           <md-option ng-value="'outbound'">
100             {{ 'INTEGRATIONS.OUTBOUND_CALL' | translate }}
101           </md-option>
102         </md-select>
103         <div
104           ng-messages="salesforceConfigurationForm['type'].$error"
105           ng-show="salesforceConfigurationForm['type'].$touched"
106           role="alert"
107         >
108           <div ng-message="required">
109             <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED"
110               >Type field is required</span
111             >
112           </div>
113         </div>
114       </md-input-container>
115       <md-input-container class="md-block">
116         <label translate="INTEGRATIONS.TICKETTYPE">TicketType</label>
117         <md-select
118           name="ticketType"
119           ng-model="vm.salesforceConfiguration.ticketType"
120           required
121         >
122           <md-option ng-value="'Task'">
123             {{ 'INTEGRATIONS.TASK' | translate }}
124           </md-option>
125
126           <md-option ng-value="'Case'">
127             {{ 'INTEGRATIONS.CASE' | translate }}
128           </md-option>
129         </md-select>
130         <div
131           ng-messages="salesforceConfigurationForm['ticketType'].$error"
132           ng-show="salesforceConfigurationForm['ticketType'].$touched"
133           role="alert"
134         >
135           <div ng-message="required">
136             <span translate="INTEGRATIONS.ERRORS.TICKETTYPE_REQUIRED"
137               >TicketType field is required</span
138             >
139           </div>
140         </div>
141       </md-input-container>
142
143       <div class="error-list">
144         <div
145           ng-repeat="error in vm.errors"
146           class="error"
147           layout="row"
148           layout-align="space-between center"
149         >
150           <div>
151             <span class="message">{{error.message}}</span>
152             <span class="type">({{error.type}})</span>
153           </div>
154           <md-button class="md-icon-button">
155             <md-icon
156               md-font-icon="icon-alert-box"
157               aria-label="alert error"
158               class="s16"
159             ></md-icon>
160           </md-button>
161         </div>
162       </div>
163     </md-dialog-content>
164
165     <md-dialog-actions
166       layout="row"
167       layout-align="space-between center"
168       ng-if="!vm.crudPermissions.readOnly"
169     >
170       <div layout="row" layout-align="start center">
171         <md-button
172           type="submit"
173           ng-if="vm.crudPermissions.canEdit && !vm.newSalesforceConfiguration"
174           ng-click="vm.saveSalesforceConfiguration()"
175           class="send-button md-accent md-raised"
176           ng-disabled="salesforceConfigurationForm.$invalid || salesforceConfigurationForm.$pristine"
177           aria-label="SAVE"
178           translate="INTEGRATIONS.SAVE"
179           translate-attr-aria-label="INTEGRATIONS.SAVE"
180         >
181           SAVE
182         </md-button>
183
184         <md-button
185           type="submit"
186           ng-if="vm.crudPermissions.canEdit && vm.newSalesforceConfiguration"
187           ng-click="vm.addNewSalesforceConfiguration()"
188           class="send-button md-accent md-raised"
189           ng-disabled="salesforceConfigurationForm.$invalid"
190           aria-label="ADD"
191           translate="INTEGRATIONS.ADD_SALESFORCECONFIGURATION"
192           translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCECONFIGURATION"
193         >
194           ADD SALESFORCECONFIGURATION
195         </md-button>
196       </div>
197       <div layout="row">
198         <md-button
199           class="md-icon-button"
200           ng-if="vm.crudPermissions.canDelete && !vm.newSalesforceConfiguration"
201           ng-click="vm.deleteSalesforceConfiguration($event)"
202           aria-label="DELETE"
203           translate
204           translate-attr-aria-label="INTEGRATIONS.DELETE"
205         >
206           <md-icon md-font-icon="icon-delete"></md-icon>
207           <md-tooltip
208             ><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip
209           >
210         </md-button>
211       </div>
212     </md-dialog-actions>
213   </form>
214 </md-dialog>