fc89a41833bccb8653c6710d5098d26c467f33ad
[motion-next.git] /
1 <div
2   id="integrations-dynamics365Account"
3   class="page-layout simple tabbed"
4   layout="column"
5 >
6   <!-- HEADER -->
7   <div class="header md-accent-bg" layout="row" layout-align="start center">
8     <div class="white-fg" layout="row" layout-align="start center" flex>
9       <md-button
10         class="goto-dynamics365Accounts-button md-icon-button"
11         aria-label="Go to dynamics365Accounts"
12         ng-click="vm.gotoDynamics365Accounts()"
13         translate
14         translate-attr-aria-label="INTEGRATIONS.GO_TO_DYNAMICS365ACCOUNTS"
15       >
16         <md-icon md-font-icon="icon-arrow-left"></md-icon>
17       </md-button>
18
19       <div layout="row" layout-align="start center">
20         <div class="dynamics365Account-image" hide-xs>
21           <img ng-src="assets/images/business/dynamics365Accounts.jpg" />
22         </div>
23
24         <div layout="column" layout-align="start start">
25           <div class="h2">
26             #{{vm.dynamics365Account.id}}
27             <span ng-if="vm.dynamics365Account.name"
28               >{{vm.dynamics365Account.name}}</span
29             >
30           </div>
31           <div class="subtitle secondary-text">
32             <span translate="INTEGRATIONS.CREATED_AT"></span>
33             <span>{{vm.dynamics365Account.createdAt | date:'medium'}}</span>
34           </div>
35         </div>
36       </div>
37     </div>
38     <div>
39       <md-button
40         type="submit"
41         ng-click="vm.saveDynamics365Account()"
42         ng-if="vm.crudPermissions.canEdit"
43         class="send-button md-accent md-raised"
44         ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)"
45         translate="INTEGRATIONS.SAVE"
46         translate-attr-aria-label="INTEGRATIONS.SAVE"
47       >
48         SAVE
49       </md-button>
50     </div>
51   </div>
52   <!-- / HEADER -->
53
54   <!-- CONTENT -->
55   <div class="content">
56     <md-tabs
57       md-selected="vm.selectedTab"
58       md-stretch-tabs="always"
59       flex
60       layout-fill
61       md-dynamic-height
62     >
63       <md-tab>
64         <md-tab-label>
65           <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>
66         </md-tab-label>
67         <md-tab-body>
68           <div
69             class="dynamics365Account-detail-form-container general md-background-bg md-whiteframe-1dp"
70           >
71             <div class="pb-16" layout="row" layout-align="start center">
72               <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">
73                 GENERAL
74               </div>
75             </div>
76             <form name="generalForm" novalidate>
77               <md-input-container class="md-block">
78                 <label translate="INTEGRATIONS.NAME">Name</label>
79                 <input
80                   type="text"
81                   name="name"
82                   ng-model="vm.dynamics365Account.name"
83                   ng-required="true"
84                   autofocus
85                   ng-disabled="!vm.crudPermissions.canEdit"
86                 />
87
88                 <div
89                   ng-messages="generalForm['name'].$error"
90                   ng-show="generalForm['name'].$touched"
91                   role="alert"
92                 >
93                   <div ng-message="required">
94                     <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED"
95                       >Name field is required</span
96                     >
97                   </div>
98                 </div>
99               </md-input-container>
100               <md-input-container class="md-block">
101                 <label translate="INTEGRATIONS.USERNAME">Username</label>
102                 <input
103                   type="text"
104                   name="username"
105                   ng-model="vm.dynamics365Account.username"
106                   ng-required="true"
107                   ng-disabled="!vm.crudPermissions.canEdit"
108                 />
109
110                 <div
111                   ng-messages="generalForm['username'].$error"
112                   ng-show="generalForm['username'].$touched"
113                   role="alert"
114                 >
115                   <div ng-message="required">
116                     <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED"
117                       >Username field is required</span
118                     >
119                   </div>
120                 </div>
121               </md-input-container>
122               <md-input-container class="md-block">
123                 <label translate="INTEGRATIONS.PASSWORD">Password</label>
124                 <input
125                   type="password"
126                   name="password"
127                   ng-model="vm.dynamics365Account.password"
128                   placeholder="Password"
129                   translate
130                   translate-attr-placeholder="INTEGRATIONS.PASSWORD"
131                   required
132                 />
133                 <div ng-messages="generalForm['password'].$error" role="alert">
134                   <div ng-message="required">
135                     <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED"
136                       >Password field is required</span
137                     >
138                   </div>
139                   <div ng-message="pattern">
140                     <span
141                       translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN"
142                       >Must contain at least 8 characters, with a minimum of 1
143                       lowercase letter, 1 uppercase letter, 1 numeric character
144                       and 1 special character ~!?*@#$%^&-_=+[{]}.</span
145                     >
146                   </div>
147                 </div>
148               </md-input-container>
149
150               <md-input-container class="md-block">
151                 <label translate="INTEGRATIONS.URI">Uri</label>
152                 <input
153                   type="url"
154                   name="remoteUri"
155                   ng-model="vm.dynamics365Account.remoteUri"
156                   ng-required="true"
157                   ng-disabled="!vm.crudPermissions.canEdit"
158                 />
159
160                 <div
161                   ng-messages="generalForm['remoteUri'].$error"
162                   ng-show="generalForm['remoteUri'].$touched"
163                   role="alert"
164                 >
165                   <div ng-message="required">
166                     <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED"
167                       >Uri field is required</span
168                     >
169                   </div>
170                   <div ng-message="url">
171                     <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL"
172                       >Uri must be a valid url http://www.xcally.com</span
173                     >
174                   </div>
175                 </div>
176               </md-input-container>
177               <md-input-container class="md-block">
178                 <label translate="INTEGRATIONS.TENANTID">TenantId</label>
179                 <input
180                   type="text"
181                   name="tenantId"
182                   ng-model="vm.dynamics365Account.tenantId"
183                   ng-required="true"
184                   ng-disabled="!vm.crudPermissions.canEdit"
185                 />
186
187                 <div
188                   ng-messages="generalForm['tenantId'].$error"
189                   ng-show="generalForm['tenantId'].$touched"
190                   role="alert"
191                 >
192                   <div ng-message="required">
193                     <span translate="INTEGRATIONS.ERRORS.TENANTID_REQUIRED"
194                       >TenantId field is required</span
195                     >
196                   </div>
197                 </div>
198               </md-input-container>
199               <md-input-container class="md-block">
200                 <label translate="INTEGRATIONS.CLIENTID">ClientId</label>
201                 <input
202                   type="text"
203                   name="clientId"
204                   ng-model="vm.dynamics365Account.clientId"
205                   ng-required="true"
206                   ng-disabled="!vm.crudPermissions.canEdit"
207                 />
208
209                 <div
210                   ng-messages="generalForm['clientId'].$error"
211                   ng-show="generalForm['clientId'].$touched"
212                   role="alert"
213                 >
214                   <div ng-message="required">
215                     <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED"
216                       >ClientId field is required</span
217                     >
218                   </div>
219                 </div>
220               </md-input-container>
221               <md-input-container class="md-block">
222                 <label translate="INTEGRATIONS.CLIENTSECRET"
223                   >ClientSecret</label
224                 >
225                 <input
226                   type="text"
227                   name="clientSecret"
228                   ng-model="vm.dynamics365Account.clientSecret"
229                   ng-required="true"
230                   ng-disabled="!vm.crudPermissions.canEdit"
231                 />
232
233                 <div
234                   ng-messages="generalForm['clientSecret'].$error"
235                   ng-show="generalForm['clientSecret'].$touched"
236                   role="alert"
237                 >
238                   <div ng-message="required">
239                     <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED"
240                       >ClientSecret field is required</span
241                     >
242                   </div>
243                 </div>
244               </md-input-container>
245               <md-input-container class="md-block">
246                 <label translate="INTEGRATIONS.MOTIONPROXYADDRESS"
247                   >MotionProxyAddress</label
248                 >
249                 <input
250                   type="url"
251                   name="serverUrl"
252                   ng-model="vm.dynamics365Account.serverUrl"
253                   ng-disabled="!vm.crudPermissions.canEdit"
254                 />
255
256                 <div class="hint">
257                   <span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span>
258                 </div>
259                 <div
260                   ng-messages="generalForm['serverUrl'].$error"
261                   ng-show="generalForm['serverUrl'].$touched"
262                   role="alert"
263                 >
264                   <div ng-message="required">
265                     <span
266                       translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED"
267                       >MotionProxyAddress field is required</span
268                     >
269                   </div>
270                   <div ng-message="url">
271                     <span
272                       translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL"
273                       >MotionProxyAddress must be a valid url
274                       http://www.xcally.com</span
275                     >
276                   </div>
277                 </div>
278               </md-input-container>
279               <md-input-container class="md-block">
280                 <label translate="INTEGRATIONS.DESCRIPTION">Description</label>
281                 <input
282                   type="text"
283                   name="description"
284                   ng-model="vm.dynamics365Account.description"
285                   ng-disabled="!vm.crudPermissions.canEdit"
286                 />
287
288                 <div
289                   ng-messages="generalForm['description'].$error"
290                   ng-show="generalForm['description'].$touched"
291                   role="alert"
292                 >
293                   <div ng-message="required">
294                     <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED"
295                       >Description field is required</span
296                     >
297                   </div>
298                 </div>
299               </md-input-container>
300             </form>
301           </div>
302         </md-tab-body>
303       </md-tab>
304       <md-tab>
305         <md-tab-label>
306           <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>
307         </md-tab-label>
308         <md-tab-body>
309           <div
310             class="dynamics365Account-detail-form-container configurations md-background-bg md-whiteframe-1dp"
311           >
312             <div class="pb-16" layout="row" layout-align="start center">
313               <div
314                 class="h2 secondary-text"
315                 translate="INTEGRATIONS.CONFIGURATIONS"
316               >
317                 CONFIGURATIONS
318               </div>
319             </div>
320             <div
321               ng-controller="Dynamics365AccountConfigurationsController as vm_cc"
322               ng-init="vm_cc.init(vm.dynamics365Account, vm.crudPermissions)"
323               layout="row"
324             >
325               <md-card class="md-whiteframe-1dp" flex="30">
326                 <div layout="row" layout-align="center center">
327                   <md-subheader flex="75" class="md-no-sticky"
328                     >{{ 'INTEGRATIONS.CONFIGURATIONS' | translate
329                     }}</md-subheader
330                   >
331                   <md-button
332                     flex="25"
333                     ng-if="vm_cc.crudPermissions.canEdit"
334                     ng-click="vm_cc.createOrEditDynamics365Configuration($event)"
335                     class="md-icon-button"
336                     aria-label="create dynamics365Configuration"
337                   >
338                     <md-icon md-font-icon="icon-plus"></md-icon>
339                   </md-button>
340                 </div>
341                 <md-list>
342                   <md-list-item
343                     layout="row"
344                     layout-align="center center"
345                     ng-repeat="dynamics365Configuration in vm_cc.configurations"
346                     class="border-top"
347                     md-colors="{background: (vm_cc.selectedDynamics365Configuration == $index ? 'accent' : 'grey-A100')}"
348                     ng-click="vm_cc.getDynamics365Configuration($index)"
349                   >
350                     <span class="text-truncate" flex="80"
351                       >{{ dynamics365Configuration.name }}</span
352                     >
353                     <md-menu ng-if="vm_cc.crudPermissions.canDelete">
354                       <md-button
355                         class="md-icon-button"
356                         aria-label="More"
357                         translate
358                         translate-attr-aria-label="INTEGRATIONS.MORE"
359                         ng-click="$mdOpenMenu($event)"
360                       >
361                         <md-icon md-font-icon="icon-dots-vertical"></md-icon>
362                       </md-button>
363                       <md-menu-content width="3">
364                         <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">
365                           <md-button
366                             ng-click="vm_cc.deleteDynamics365Configuration($event, dynamics365Configuration)"
367                             translate="INTEGRATIONS.DELETE_DYNAMICS365CONFIGURATION"
368                           >
369                             Delete Dynamics365Configuration
370                           </md-button>
371                         </md-menu-item>
372                       </md-menu-content>
373                     </md-menu>
374                   </md-list-item>
375                 </md-list>
376               </md-card>
377               <div flex></div>
378               <md-card class="md-whiteframe-1dp" flex="65">
379                 <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>
380                   <md-tab>
381                     <md-tab-label>
382                       <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>
383                     </md-tab-label>
384                     <md-tab-body>
385                       <md-toolbar
386                         class="md-table-toolbar md-default no-padding"
387                         ng-hide="vm_cc.selectedSubjects.length"
388                       >
389                         <div class="md-toolbar-tools">
390                           <div flex></div>
391                           <ms-search-bar
392                             on-search="vm_cc.query.subject = query"
393                             on-collapse="vm_cc.query.subject = undefined"
394                             debounce="300"
395                           ></ms-search-bar>
396                           <md-button
397                             ng-if="vm_cc.crudPermissions.canEdit"
398                             class="md-icon-button"
399                             ng-click="vm_cc.createOrEditSubject($event)"
400                             aria-label="add subject"
401                             translate
402                             translate-attr-label="INTEGRATIONS.ADD_SUBJECT"
403                           >
404                             <md-icon md-font-icon="icon-plus"></md-icon>
405                           </md-button>
406                         </div>
407                       </md-toolbar>
408                       <md-toolbar
409                         class="md-table-toolbar md-accent"
410                         ng-show="vm_cc.selectedSubjects.length"
411                       >
412                         <div class="md-toolbar-tools">
413                           <span class="md-subhead"
414                             >{{vm_cc.selectedSubjects.length}}
415                             {{vm_cc.selectedSubjects.length > 1 ? 'items' :
416                             'item'}} selected</span
417                           >
418                           <div flex></div>
419                           <md-button
420                             ng-if="vm_cc.crudPermissions.canDelete"
421                             class="md-icon-button"
422                             ng-click="vm_cc.deleteSelectedSubjects($event)"
423                             aria-label="delete selected"
424                             translate
425                             translate-attr-label="INTEGRATIONS.DELETE_SELECTED"
426                           >
427                             <md-icon md-font-icon="icon-delete"></md-icon>
428                           </md-button>
429                         </div>
430                       </md-toolbar>
431                       <md-table-container
432                         class="md-whiteframe-1dp padding-horizontal"
433                       >
434                         <table
435                           md-table
436                           md-row-select
437                           multiple
438                           ng-model="vm_cc.selectedSubjects"
439                         >
440                           <thead md-head>
441                             <tr md-row>
442                               <th md-column>
443                                 {{ 'INTEGRATIONS.ID' | translate }}
444                               </th>
445                               <th md-column>
446                                 {{ 'INTEGRATIONS.TYPE' | translate }}
447                               </th>
448                               <th md-column>
449                                 {{ 'INTEGRATIONS.CONTENT' | translate }}
450                               </th>
451                               <th md-column width="10px"></th>
452                             </tr>
453                           </thead>
454                           <tbody md-body>
455                             <tr
456                               md-row
457                               md-select="subject"
458                               md-select-id="id"
459                               ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject"
460                             >
461                               <td
462                                 ng-click="vm_cc.createOrEditSubject($event, subject)"
463                                 md-cell
464                                 class="id"
465                               >
466                                 {{subject.id}}
467                               </td>
468                               <td
469                                 ng-click="vm_cc.createOrEditSubject($event, subject)"
470                                 md-cell
471                                 class="type"
472                               >
473                                 <span ng-if="subject.FieldId"
474                                   >{{subject.nameField ||
475                                   subject.idField}}</span
476                                 >
477                                 <span ng-if="!subject.FieldId"
478                                   >{{subject.type}}</span
479                                 >
480                               </td>
481                               <td
482                                 ng-switch="subject.type"
483                                 ng-click="vm_cc.createOrEditSubject($event, subject)"
484                                 md-cell
485                               >
486                                 <span ng-switch-when="string"
487                                   >{{subject.content}}</span
488                                 >
489                                 <span
490                                   ng-switch-when="variable"
491                                   class="text-boxed"
492                                   >{{subject.variableName}}</span
493                                 >
494                                 <span
495                                   ng-switch-when="customVariable"
496                                   class="text-boxed"
497                                   >{{
498                                   vm_cc.variablesById[subject.VariableId].name
499                                   }}</span
500                                 >
501                                 <span ng-switch-when="keyValue">
502                                   {{subject.key}}
503                                   <span ng-switch="description.keyType">
504                                     <span ng-switch-when="string"
505                                       >{{subject.keyContent}}</span
506                                     >
507                                     <span
508                                       ng-switch-when="variable"
509                                       class="text-boxed"
510                                       >{{subject.variableName}}</span
511                                     >
512                                     <span
513                                       ng-switch-when="customVariable"
514                                       class="text-boxed"
515                                       >{{
516                                       vm_cc.variablesById[subject.VariableId].name
517                                       }}</span
518                                     >
519                                   </span>
520                                 </span>
521                                 <span ng-switch-default
522                                   >{{subject.content}}</span
523                                 >
524                               </td>
525                               <td
526                                 md-cell
527                                 class="actions"
528                                 ng-if="!vm_cc.crudPermissions.readOnly"
529                               >
530                                 <md-menu>
531                                   <md-button
532                                     class="md-icon-button"
533                                     aria-label="More"
534                                     translate
535                                     translate-attr-aria-label="INTEGRATIONS.MORE"
536                                     ng-click="$mdOpenMenu($event)"
537                                   >
538                                     <md-icon
539                                       md-font-icon="icon-dots-vertical"
540                                     ></md-icon>
541                                   </md-button>
542
543                                   <md-menu-content width="3">
544                                     <md-menu-item
545                                       ng-if="vm_cc.crudPermissions.canEdit"
546                                     >
547                                       <md-button
548                                         ng-click="vm_cc.createOrEditSubject($event, subject)"
549                                         translate="INTEGRATIONS.EDIT_SUBJECT"
550                                       >
551                                         Edit Subject
552                                       </md-button>
553                                     </md-menu-item>
554                                     <md-menu-item
555                                       ng-if="vm_cc.crudPermissions.canDelete"
556                                     >
557                                       <md-button
558                                         ng-click="vm_cc.deleteSubjectConfirm($event, subject)"
559                                         translate="INTEGRATIONS.DELETE_SUBJECT"
560                                       >
561                                         Delete Subject
562                                       </md-button>
563                                     </md-menu-item>
564                                   </md-menu-content>
565                                 </md-menu>
566                               </td>
567                             </tr>
568                           </tbody>
569                         </table>
570                       </md-table-container>
571                     </md-tab-body>
572                   </md-tab>
573
574                   <md-tab>
575                     <md-tab-label>
576                       <span translate="INTEGRATIONS.DESCRIPTIONS"
577                         >DESCRIPTIONS</span
578                       >
579                     </md-tab-label>
580                     <md-tab-body>
581                       <md-toolbar
582                         class="md-table-toolbar md-default no-padding"
583                         ng-hide="vm_cc.selectedDescriptions.length"
584                       >
585                         <div class="md-toolbar-tools">
586                           <div flex></div>
587                           <ms-search-bar
588                             on-search="vm_cc.query.description = query"
589                             on-collapse="vm_cc.query.description = undefined"
590                             debounce="300"
591                           ></ms-search-bar>
592                           <md-button
593                             ng-if="vm_cc.crudPermissions.canEdit"
594                             class="md-icon-button"
595                             ng-click="vm_cc.createOrEditDescription($event)"
596                             aria-label="add description"
597                             translate
598                             translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION"
599                           >
600                             <md-icon md-font-icon="icon-plus"></md-icon>
601                           </md-button>
602                         </div>
603                       </md-toolbar>
604                       <md-toolbar
605                         class="md-table-toolbar md-accent"
606                         ng-show="vm_cc.selectedDescriptions.length"
607                       >
608                         <div class="md-toolbar-tools">
609                           <span class="md-subhead"
610                             >{{vm_cc.selectedDescriptions.length}}
611                             {{vm_cc.selectedDescriptions.length > 1 ? 'items' :
612                             'item'}} selected</span
613                           >
614                           <div flex></div>
615                           <md-button
616                             ng-if="vm_cc.crudPermissions.canDelete"
617                             class="md-icon-button"
618                             ng-click="vm_cc.deleteSelectedDescriptions($event)"
619                             aria-label="delete selected"
620                             translate
621                             translate-attr-label="INTEGRATIONS.DELETE_SELECTED"
622                           >
623                             <md-icon md-font-icon="icon-delete"></md-icon>
624                           </md-button>
625                         </div>
626                       </md-toolbar>
627                       <md-table-container
628                         class="md-whiteframe-1dp padding-horizontal"
629                       >
630                         <table
631                           md-table
632                           md-row-select
633                           multiple
634                           ng-model="vm_cc.selectedDescriptions"
635                         >
636                           <thead md-head>
637                             <tr md-row>
638                               <th md-column>
639                                 {{ 'INTEGRATIONS.ID' | translate }}
640                               </th>
641                               <th md-column>
642                                 {{ 'INTEGRATIONS.TYPE' | translate }}
643                               </th>
644                               <th md-column>
645                                 {{ 'INTEGRATIONS.CONTENT' | translate }}
646                               </th>
647                               <th md-column width="10px"></th>
648                             </tr>
649                           </thead>
650                           <tbody md-body>
651                             <tr
652                               md-row
653                               md-select="description"
654                               md-select-id="id"
655                               ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description"
656                             >
657                               <td
658                                 ng-click="vm_cc.createOrEditDescription($event, description)"
659                                 md-cell
660                                 class="id"
661                               >
662                                 {{description.id}}
663                               </td>
664                               <td
665                                 ng-click="vm_cc.createOrEditDescription($event, description)"
666                                 md-cell
667                                 class="type"
668                               >
669                                 <span ng-if="description.FieldId"
670                                   >{{description.nameField ||
671                                   description.idField}}</span
672                                 >
673                                 <span ng-if="!description.FieldId"
674                                   >{{description.type}}</span
675                                 >
676                               </td>
677                               <td
678                                 ng-switch="description.type"
679                                 ng-click="vm_cc.createOrEditDescription($event, description)"
680                                 md-cell
681                               >
682                                 <span ng-switch-when="string"
683                                   >{{description.content}}</span
684                                 >
685                                 <span
686                                   ng-switch-when="variable"
687                                   class="text-boxed"
688                                   >{{description.variableName}}</span
689                                 >
690                                 <span
691                                   ng-switch-when="customVariable"
692                                   class="text-boxed"
693                                   >{{
694                                   vm_cc.variablesById[description.VariableId].name
695                                   }}</span
696                                 >
697                                 <span ng-switch-when="keyValue">
698                                   {{description.key}}
699                                   <span ng-switch="description.keyType">
700                                     <span ng-switch-when="string"
701                                       >{{description.keyContent}}</span
702                                     >
703                                     <span
704                                       ng-switch-when="variable"
705                                       class="text-boxed"
706                                       >{{description.variableName}}</span
707                                     >
708                                     <span
709                                       ng-switch-when="customVariable"
710                                       class="text-boxed"
711                                       >{{
712                                       vm_cc.variablesById[description.VariableId].name
713                                       }}</span
714                                     >
715                                   </span>
716                                 </span>
717                                 <span ng-switch-default
718                                   >{{description.content}}</span
719                                 >
720                               </td>
721                               <td
722                                 md-cell
723                                 class="actions"
724                                 ng-if="!vm_cc.crudPermissions.readOnly"
725                               >
726                                 <md-menu>
727                                   <md-button
728                                     class="md-icon-button"
729                                     aria-label="More"
730                                     translate
731                                     translate-attr-aria-label="INTEGRATIONS.MORE"
732                                     ng-click="$mdOpenMenu($event)"
733                                   >
734                                     <md-icon
735                                       md-font-icon="icon-dots-vertical"
736                                     ></md-icon>
737                                   </md-button>
738
739                                   <md-menu-content width="3">
740                                     <md-menu-item
741                                       ng-if="vm_cc.crudPermissions.canEdit"
742                                     >
743                                       <md-button
744                                         ng-click="vm_cc.createOrEditDescription($event, description)"
745                                         translate="INTEGRATIONS.EDIT_DESCRIPTION"
746                                       >
747                                         Edit Description
748                                       </md-button>
749                                     </md-menu-item>
750                                     <md-menu-item
751                                       ng-if="vm_cc.crudPermissions.canDelete"
752                                     >
753                                       <md-button
754                                         ng-click="vm_cc.deleteDescriptionConfirm($event, description)"
755                                         translate="INTEGRATIONS.DELETE_DESCRIPTION"
756                                       >
757                                         Delete Description
758                                       </md-button>
759                                     </md-menu-item>
760                                   </md-menu-content>
761                                 </md-menu>
762                               </td>
763                             </tr>
764                           </tbody>
765                         </table>
766                       </md-table-container>
767                     </md-tab-body>
768                   </md-tab>
769
770                   <md-tab>
771                     <md-tab-label>
772                       <span translate="INTEGRATIONS.FIELDS">FIELDS</span>
773                     </md-tab-label>
774                     <md-tab-body>
775                       <md-toolbar
776                         class="md-table-toolbar md-default no-padding"
777                         ng-hide="vm_cc.selectedFields.length"
778                       >
779                         <div class="md-toolbar-tools">
780                           <div flex></div>
781                           <ms-search-bar
782                             on-search="vm_cc.query.field = query"
783                             on-collapse="vm_cc.query.field = undefined"
784                             debounce="300"
785                           ></ms-search-bar>
786                           <md-button
787                             ng-if="vm_cc.crudPermissions.canEdit"
788                             class="md-icon-button"
789                             ng-click="vm_cc.createOrEditField($event)"
790                             aria-label="add field"
791                             translate
792                             translate-attr-label="INTEGRATIONS.ADD_FIELD"
793                           >
794                             <md-icon md-font-icon="icon-plus"></md-icon>
795                           </md-button>
796                         </div>
797                       </md-toolbar>
798                       <md-toolbar
799                         class="md-table-toolbar md-accent"
800                         ng-show="vm_cc.selectedFields.length"
801                       >
802                         <div class="md-toolbar-tools">
803                           <span class="md-subhead"
804                             >{{vm_cc.selectedFields.length}}
805                             {{vm_cc.selectedFields.length > 1 ? 'items' :
806                             'item'}} selected</span
807                           >
808                           <div flex></div>
809                           <md-button
810                             ng-if="vm_cc.crudPermissions.canDelete"
811                             class="md-icon-button"
812                             ng-click="vm_cc.deleteSelectedFields($event)"
813                             aria-label="delete selected"
814                             translate
815                             translate-attr-label="INTEGRATIONS.DELETE_SELECTED"
816                           >
817                             <md-icon md-font-icon="icon-delete"></md-icon>
818                           </md-button>
819                         </div>
820                       </md-toolbar>
821                       <md-table-container
822                         class="md-whiteframe-1dp padding-horizontal"
823                       >
824                         <table
825                           md-table
826                           md-row-select
827                           multiple
828                           ng-model="vm_cc.selectedFields"
829                         >
830                           <thead md-head>
831                             <tr md-row>
832                               <th md-column>
833                                 {{ 'INTEGRATIONS.ID' | translate }}
834                               </th>
835                               <th md-column>
836                                 {{ 'INTEGRATIONS.TYPE' | translate }}
837                               </th>
838                               <th md-column>
839                                 {{ 'INTEGRATIONS.CONTENT' | translate }}
840                               </th>
841                               <th md-column width="10px"></th>
842                             </tr>
843                           </thead>
844                           <tbody md-body>
845                             <tr
846                               md-row
847                               md-select="field"
848                               md-select-id="id"
849                               ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field"
850                             >
851                               <td
852                                 ng-click="vm_cc.createOrEditField($event, field)"
853                                 md-cell
854                                 class="id"
855                               >
856                                 {{field.id}}
857                               </td>
858                               <td
859                                 ng-click="vm_cc.createOrEditField($event, field)"
860                                 md-cell
861                                 class="type"
862                               >
863                                 <span ng-if="field.FieldId"
864                                   >{{field.nameField || field.idField}}</span
865                                 >
866                                 <span ng-if="!field.FieldId"
867                                   >{{field.type}}</span
868                                 >
869                               </td>
870                               <td
871                                 ng-switch="field.type"
872                                 ng-click="vm_cc.createOrEditField($event, field)"
873                                 md-cell
874                               >
875                                 <span ng-switch-when="string"
876                                   >{{field.content}}</span
877                                 >
878                                 <span
879                                   ng-switch-when="variable"
880                                   class="text-boxed"
881                                   >{{field.variableName}}</span
882                                 >
883                                 <span
884                                   ng-switch-when="customVariable"
885                                   class="text-boxed"
886                                   >{{ vm_cc.variablesById[field.VariableId].name
887                                   }}</span
888                                 >
889                                 <span ng-switch-when="keyValue">
890                                   {{field.key}}
891                                   <span ng-switch="description.keyType">
892                                     <span ng-switch-when="string"
893                                       >{{field.keyContent}}</span
894                                     >
895                                     <span
896                                       ng-switch-when="variable"
897                                       class="text-boxed"
898                                       >{{field.variableName}}</span
899                                     >
900                                     <span
901                                       ng-switch-when="customVariable"
902                                       class="text-boxed"
903                                       >{{
904                                       vm_cc.variablesById[field.VariableId].name
905                                       }}</span
906                                     >
907                                   </span>
908                                 </span>
909                                 <span ng-switch-default>{{field.content}}</span>
910                               </td>
911                               <td
912                                 md-cell
913                                 class="actions"
914                                 ng-if="!vm_cc.crudPermissions.readOnly"
915                               >
916                                 <md-menu>
917                                   <md-button
918                                     class="md-icon-button"
919                                     aria-label="More"
920                                     translate
921                                     translate-attr-aria-label="INTEGRATIONS.MORE"
922                                     ng-click="$mdOpenMenu($event)"
923                                   >
924                                     <md-icon
925                                       md-font-icon="icon-dots-vertical"
926                                     ></md-icon>
927                                   </md-button>
928
929                                   <md-menu-content width="3">
930                                     <md-menu-item
931                                       ng-if="vm_cc.crudPermissions.canEdit"
932                                     >
933                                       <md-button
934                                         ng-click="vm_cc.createOrEditField($event, field)"
935                                         translate="INTEGRATIONS.EDIT_FIELD"
936                                       >
937                                         Edit Field
938                                       </md-button>
939                                     </md-menu-item>
940                                     <md-menu-item
941                                       ng-if="vm_cc.crudPermissions.canDelete"
942                                     >
943                                       <md-button
944                                         ng-click="vm_cc.deleteFieldConfirm($event, field)"
945                                         translate="INTEGRATIONS.DELETE_FIELD"
946                                       >
947                                         Delete Field
948                                       </md-button>
949                                     </md-menu-item>
950                                   </md-menu-content>
951                                 </md-menu>
952                               </td>
953                             </tr>
954                           </tbody>
955                         </table>
956                       </md-table-container>
957                     </md-tab-body>
958                   </md-tab>
959                 </md-tabs>
960                 <div
961                   class="padding-20"
962                   ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit"
963                   ng-click="vm_cc.createOrEditDynamics365Configuration($event)"
964                   layout="row"
965                   layout-sm="column"
966                   layout-align="center center"
967                   layout-wrap
968                 >
969                   <div
970                     class="padding-20 md-whiteframe-3dp md-accent-bg"
971                     layout="column"
972                     layout-align="center center"
973                   >
974                     <md-button class="md-icon-button">
975                       <md-icon md-font-icon="icon-plus"></md-icon>
976                     </md-button>
977                     <span
978                       aria-label="add configuration"
979                       translate
980                       translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION"
981                       >ADD CONFIGURATION</span
982                     >
983                   </div>
984                 </div>
985               </md-card>
986             </div>
987           </div>
988         </md-tab-body>
989       </md-tab>
990     </md-tabs>
991   </div>
992   <!-- / CONTENT -->
993 </div>