2 id="integrations-deskAccount"
3 class="page-layout simple tabbed"
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>
10 class="goto-deskAccounts-button md-icon-button"
11 aria-label="Go to deskAccounts"
12 ng-click="vm.gotoDeskAccounts()"
14 translate-attr-aria-label="INTEGRATIONS.GO_TO_DESKACCOUNTS"
16 <md-icon md-font-icon="icon-arrow-left"></md-icon>
19 <div layout="row" layout-align="start center">
20 <div class="deskAccount-image" hide-xs>
21 <img ng-src="assets/images/business/deskAccounts.jpg" />
24 <div layout="column" layout-align="start start">
26 #{{vm.deskAccount.id}}
27 <span ng-if="vm.deskAccount.name">{{vm.deskAccount.name}}</span>
29 <div class="subtitle secondary-text">
30 <span translate="INTEGRATIONS.CREATED_AT"></span>
31 <span>{{vm.deskAccount.createdAt | date:'medium'}}</span>
39 ng-click="vm.saveDeskAccount()"
40 ng-if="vm.crudPermissions.canEdit"
41 class="send-button md-accent md-raised"
42 ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)"
43 translate="INTEGRATIONS.SAVE"
44 translate-attr-aria-label="INTEGRATIONS.SAVE"
55 md-selected="vm.selectedTab"
56 md-stretch-tabs="always"
63 <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>
67 class="deskAccount-detail-form-container general md-background-bg md-whiteframe-1dp"
69 <div class="pb-16" layout="row" layout-align="start center">
70 <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">
74 <form name="generalForm" novalidate>
75 <md-input-container class="md-block">
76 <label translate="INTEGRATIONS.NAME">Name</label>
80 ng-model="vm.deskAccount.name"
83 ng-disabled="!vm.crudPermissions.canEdit"
87 ng-messages="generalForm['name'].$error"
88 ng-show="generalForm['name'].$touched"
91 <div ng-message="required">
92 <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED"
93 >Name field is required</span
98 <md-input-container class="md-block">
99 <label translate="INTEGRATIONS.TYPE">Type</label>
102 ng-model="vm.deskAccount.type"
104 ng-disabled="!vm.crudPermissions.canEdit"
106 <md-option ng-value="'integrationTab'">
107 {{ 'INTEGRATIONS.INTEGRATION_TAB' | translate }}
110 <md-option ng-value="'newTab'">
111 {{ 'INTEGRATIONS.NEW_TAB' | translate }}
115 ng-messages="generalForm['type'].$error"
116 ng-show="generalForm['type'].$touched"
119 <div ng-message="required">
120 <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED"
121 >Type field is required</span
125 </md-input-container>
126 <md-input-container class="md-block">
127 <label translate="INTEGRATIONS.URI">Uri</label>
131 ng-model="vm.deskAccount.remoteUri"
133 ng-disabled="!vm.crudPermissions.canEdit"
137 ng-messages="generalForm['remoteUri'].$error"
138 ng-show="generalForm['remoteUri'].$touched"
141 <div ng-message="required">
142 <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED"
143 >Uri field is required</span
146 <div ng-message="url">
147 <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL"
148 >Uri must be a valid url http://www.xcally.com</span
152 </md-input-container>
153 <md-input-container class="md-block">
154 <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>
157 ng-model="vm.deskAccount.authType"
159 ng-disabled="!vm.crudPermissions.canEdit"
161 <md-option ng-value="'basic'">Basic</md-option>
164 ng-messages="generalForm['authType'].$error"
165 ng-show="generalForm['authType'].$touched"
168 <div ng-message="required">
169 <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED"
170 >AuthType field is required</span
174 </md-input-container>
176 ng-if="vm.deskAccount.authType == 'basic'"
179 <label translate="INTEGRATIONS.USERNAME">Username</label>
183 ng-model="vm.deskAccount.username"
185 ng-disabled="!vm.crudPermissions.canEdit"
189 ng-messages="generalForm['username'].$error"
190 ng-show="generalForm['username'].$touched"
193 <div ng-message="required">
194 <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED"
195 >Username field is required</span
199 </md-input-container>
202 ng-if="vm.deskAccount.authType == 'basic'"
204 <label translate="INTEGRATIONS.PASSWORD">Password</label>
208 ng-model="vm.deskAccount.password"
209 placeholder="Password"
211 translate-attr-placeholder="INTEGRATIONS.PASSWORD"
214 <div ng-messages="generalForm['password'].$error" role="alert">
215 <div ng-message="required">
216 <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED"
217 >Password field is required</span
220 <div ng-message="pattern">
222 translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN"
223 >Must contain at least 8 characters, with a minimum of 1
224 lowercase letter, 1 uppercase letter, 1 numeric character
225 and 1 special character ~!?*@#$%^&-_=+[{]}.</span
229 </md-input-container>
231 <md-input-container class="md-block">
232 <label translate="INTEGRATIONS.MOTIONPROXYADDRESS"
233 >MotionProxyAddress</label
238 ng-model="vm.deskAccount.serverUrl"
239 ng-disabled="!vm.crudPermissions.canEdit"
243 <span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span>
246 ng-messages="generalForm['serverUrl'].$error"
247 ng-show="generalForm['serverUrl'].$touched"
250 <div ng-message="required">
252 translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED"
253 >MotionProxyAddress field is required</span
256 <div ng-message="url">
258 translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL"
259 >MotionProxyAddress must be a valid url
260 http://www.xcally.com</span
264 </md-input-container>
265 <md-input-container class="md-block">
266 <label translate="INTEGRATIONS.DESCRIPTION">Description</label>
270 ng-model="vm.deskAccount.description"
271 ng-disabled="!vm.crudPermissions.canEdit"
275 ng-messages="generalForm['description'].$error"
276 ng-show="generalForm['description'].$touched"
279 <div ng-message="required">
280 <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED"
281 >Description field is required</span
285 </md-input-container>
292 <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>
296 class="deskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp"
298 <div class="pb-16" layout="row" layout-align="start center">
300 class="h2 secondary-text"
301 translate="INTEGRATIONS.CONFIGURATIONS"
307 ng-controller="DeskAccountConfigurationsController as vm_cc"
308 ng-init="vm_cc.init(vm.deskAccount, vm.crudPermissions)"
311 <md-card class="md-whiteframe-1dp" flex="30">
312 <div layout="row" layout-align="center center">
313 <md-subheader flex="75" class="md-no-sticky"
314 >{{ 'INTEGRATIONS.CONFIGURATIONS' | translate
319 ng-if="vm_cc.crudPermissions.canEdit"
320 ng-click="vm_cc.createOrEditDeskConfiguration($event)"
321 class="md-icon-button"
322 aria-label="create deskConfiguration"
324 <md-icon md-font-icon="icon-plus"></md-icon>
330 layout-align="center center"
331 ng-repeat="deskConfiguration in vm_cc.configurations"
333 md-colors="{background: (vm_cc.selectedDeskConfiguration == $index ? 'accent' : 'grey-A100')}"
334 ng-click="vm_cc.getDeskConfiguration($index)"
336 <span class="text-truncate" flex="80"
337 >{{ deskConfiguration.name }}</span
339 <md-menu ng-if="vm_cc.crudPermissions.canDelete">
341 class="md-icon-button"
344 translate-attr-aria-label="INTEGRATIONS.MORE"
345 ng-click="$mdOpenMenu($event)"
347 <md-icon md-font-icon="icon-dots-vertical"></md-icon>
349 <md-menu-content width="3">
350 <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">
352 ng-click="vm_cc.deleteDeskConfiguration($event, deskConfiguration)"
353 translate="INTEGRATIONS.DELETE_DESKCONFIGURATION"
355 Delete DeskConfiguration
364 <md-card class="md-whiteframe-1dp" flex="65">
365 <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>
368 <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>
372 class="md-table-toolbar md-default no-padding"
373 ng-hide="vm_cc.selectedSubjects.length"
375 <div class="md-toolbar-tools">
378 on-search="vm_cc.query.subject = query"
379 on-collapse="vm_cc.query.subject = undefined"
383 ng-if="vm_cc.crudPermissions.canEdit"
384 class="md-icon-button"
385 ng-click="vm_cc.createOrEditSubject($event)"
386 aria-label="add subject"
388 translate-attr-label="INTEGRATIONS.ADD_SUBJECT"
390 <md-icon md-font-icon="icon-plus"></md-icon>
395 class="md-table-toolbar md-accent"
396 ng-show="vm_cc.selectedSubjects.length"
398 <div class="md-toolbar-tools">
399 <span class="md-subhead"
400 >{{vm_cc.selectedSubjects.length}}
401 {{vm_cc.selectedSubjects.length > 1 ? 'items' :
402 'item'}} selected</span
406 ng-if="vm_cc.crudPermissions.canDelete"
407 class="md-icon-button"
408 ng-click="vm_cc.deleteSelectedSubjects($event)"
409 aria-label="delete selected"
411 translate-attr-label="INTEGRATIONS.DELETE_SELECTED"
413 <md-icon md-font-icon="icon-delete"></md-icon>
418 class="md-whiteframe-1dp padding-horizontal"
424 ng-model="vm_cc.selectedSubjects"
429 {{ 'INTEGRATIONS.ID' | translate }}
432 {{ 'INTEGRATIONS.TYPE' | translate }}
435 {{ 'INTEGRATIONS.CONTENT' | translate }}
437 <th md-column width="10px"></th>
445 ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject"
448 ng-click="vm_cc.createOrEditSubject($event, subject)"
455 ng-click="vm_cc.createOrEditSubject($event, subject)"
459 <span ng-if="subject.FieldId"
460 >{{subject.nameField ||
461 subject.idField}}</span
463 <span ng-if="!subject.FieldId"
464 >{{subject.type}}</span
468 ng-switch="subject.type"
469 ng-click="vm_cc.createOrEditSubject($event, subject)"
472 <span ng-switch-when="string"
473 >{{subject.content}}</span
476 ng-switch-when="variable"
478 >{{subject.variableName}}</span
481 ng-switch-when="customVariable"
484 vm_cc.variablesById[subject.VariableId].name
487 <span ng-switch-when="keyValue">
489 <span ng-switch="description.keyType">
490 <span ng-switch-when="string"
491 >{{subject.keyContent}}</span
494 ng-switch-when="variable"
496 >{{subject.variableName}}</span
499 ng-switch-when="customVariable"
502 vm_cc.variablesById[subject.VariableId].name
507 <span ng-switch-default
508 >{{subject.content}}</span
514 ng-if="!vm_cc.crudPermissions.readOnly"
518 class="md-icon-button"
521 translate-attr-aria-label="INTEGRATIONS.MORE"
522 ng-click="$mdOpenMenu($event)"
525 md-font-icon="icon-dots-vertical"
529 <md-menu-content width="3">
531 ng-if="vm_cc.crudPermissions.canEdit"
534 ng-click="vm_cc.createOrEditSubject($event, subject)"
535 translate="INTEGRATIONS.EDIT_SUBJECT"
541 ng-if="vm_cc.crudPermissions.canDelete"
544 ng-click="vm_cc.deleteSubjectConfirm($event, subject)"
545 translate="INTEGRATIONS.DELETE_SUBJECT"
556 </md-table-container>
562 <span translate="INTEGRATIONS.DESCRIPTIONS"
568 class="md-table-toolbar md-default no-padding"
569 ng-hide="vm_cc.selectedDescriptions.length"
571 <div class="md-toolbar-tools">
574 on-search="vm_cc.query.description = query"
575 on-collapse="vm_cc.query.description = undefined"
579 ng-if="vm_cc.crudPermissions.canEdit"
580 class="md-icon-button"
581 ng-click="vm_cc.createOrEditDescription($event)"
582 aria-label="add description"
584 translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION"
586 <md-icon md-font-icon="icon-plus"></md-icon>
591 class="md-table-toolbar md-accent"
592 ng-show="vm_cc.selectedDescriptions.length"
594 <div class="md-toolbar-tools">
595 <span class="md-subhead"
596 >{{vm_cc.selectedDescriptions.length}}
597 {{vm_cc.selectedDescriptions.length > 1 ? 'items' :
598 'item'}} selected</span
602 ng-if="vm_cc.crudPermissions.canDelete"
603 class="md-icon-button"
604 ng-click="vm_cc.deleteSelectedDescriptions($event)"
605 aria-label="delete selected"
607 translate-attr-label="INTEGRATIONS.DELETE_SELECTED"
609 <md-icon md-font-icon="icon-delete"></md-icon>
614 class="md-whiteframe-1dp padding-horizontal"
620 ng-model="vm_cc.selectedDescriptions"
625 {{ 'INTEGRATIONS.ID' | translate }}
628 {{ 'INTEGRATIONS.TYPE' | translate }}
631 {{ 'INTEGRATIONS.CONTENT' | translate }}
633 <th md-column width="10px"></th>
639 md-select="description"
641 ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description"
644 ng-click="vm_cc.createOrEditDescription($event, description)"
651 ng-click="vm_cc.createOrEditDescription($event, description)"
655 <span ng-if="description.FieldId"
656 >{{description.nameField ||
657 description.idField}}</span
659 <span ng-if="!description.FieldId"
660 >{{description.type}}</span
664 ng-switch="description.type"
665 ng-click="vm_cc.createOrEditDescription($event, description)"
668 <span ng-switch-when="string"
669 >{{description.content}}</span
672 ng-switch-when="variable"
674 >{{description.variableName}}</span
677 ng-switch-when="customVariable"
680 vm_cc.variablesById[description.VariableId].name
683 <span ng-switch-when="keyValue">
685 <span ng-switch="description.keyType">
686 <span ng-switch-when="string"
687 >{{description.keyContent}}</span
690 ng-switch-when="variable"
692 >{{description.variableName}}</span
695 ng-switch-when="customVariable"
698 vm_cc.variablesById[description.VariableId].name
703 <span ng-switch-default
704 >{{description.content}}</span
710 ng-if="!vm_cc.crudPermissions.readOnly"
714 class="md-icon-button"
717 translate-attr-aria-label="INTEGRATIONS.MORE"
718 ng-click="$mdOpenMenu($event)"
721 md-font-icon="icon-dots-vertical"
725 <md-menu-content width="3">
727 ng-if="vm_cc.crudPermissions.canEdit"
730 ng-click="vm_cc.createOrEditDescription($event, description)"
731 translate="INTEGRATIONS.EDIT_DESCRIPTION"
737 ng-if="vm_cc.crudPermissions.canDelete"
740 ng-click="vm_cc.deleteDescriptionConfirm($event, description)"
741 translate="INTEGRATIONS.DELETE_DESCRIPTION"
752 </md-table-container>
758 <span translate="INTEGRATIONS.FIELDS">FIELDS</span>
762 class="md-table-toolbar md-default no-padding"
763 ng-hide="vm_cc.selectedFields.length"
765 <div class="md-toolbar-tools">
768 on-search="vm_cc.query.field = query"
769 on-collapse="vm_cc.query.field = undefined"
773 ng-if="vm_cc.crudPermissions.canEdit"
774 class="md-icon-button"
775 ng-click="vm_cc.createOrEditField($event)"
776 aria-label="add field"
778 translate-attr-label="INTEGRATIONS.ADD_FIELD"
780 <md-icon md-font-icon="icon-plus"></md-icon>
785 class="md-table-toolbar md-accent"
786 ng-show="vm_cc.selectedFields.length"
788 <div class="md-toolbar-tools">
789 <span class="md-subhead"
790 >{{vm_cc.selectedFields.length}}
791 {{vm_cc.selectedFields.length > 1 ? 'items' :
792 'item'}} selected</span
796 ng-if="vm_cc.crudPermissions.canDelete"
797 class="md-icon-button"
798 ng-click="vm_cc.deleteSelectedFields($event)"
799 aria-label="delete selected"
801 translate-attr-label="INTEGRATIONS.DELETE_SELECTED"
803 <md-icon md-font-icon="icon-delete"></md-icon>
808 class="md-whiteframe-1dp padding-horizontal"
814 ng-model="vm_cc.selectedFields"
819 {{ 'INTEGRATIONS.ID' | translate }}
822 {{ 'INTEGRATIONS.TYPE' | translate }}
825 {{ 'INTEGRATIONS.CONTENT' | translate }}
827 <th md-column width="10px"></th>
835 ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field"
838 ng-click="vm_cc.createOrEditField($event, field)"
845 ng-click="vm_cc.createOrEditField($event, field)"
849 <span ng-if="field.FieldId"
850 >{{field.nameField || field.idField}}</span
852 <span ng-if="!field.FieldId"
853 >{{field.type}}</span
857 ng-switch="field.type"
858 ng-click="vm_cc.createOrEditField($event, field)"
861 <span ng-switch-when="string"
862 >{{field.content}}</span
865 ng-switch-when="variable"
867 >{{field.variableName}}</span
870 ng-switch-when="customVariable"
872 >{{ vm_cc.variablesById[field.VariableId].name
875 <span ng-switch-when="keyValue">
877 <span ng-switch="description.keyType">
878 <span ng-switch-when="string"
879 >{{field.keyContent}}</span
882 ng-switch-when="variable"
884 >{{field.variableName}}</span
887 ng-switch-when="customVariable"
890 vm_cc.variablesById[field.VariableId].name
895 <span ng-switch-default>{{field.content}}</span>
900 ng-if="!vm_cc.crudPermissions.readOnly"
904 class="md-icon-button"
907 translate-attr-aria-label="INTEGRATIONS.MORE"
908 ng-click="$mdOpenMenu($event)"
911 md-font-icon="icon-dots-vertical"
915 <md-menu-content width="3">
917 ng-if="vm_cc.crudPermissions.canEdit"
920 ng-click="vm_cc.createOrEditField($event, field)"
921 translate="INTEGRATIONS.EDIT_FIELD"
927 ng-if="vm_cc.crudPermissions.canDelete"
930 ng-click="vm_cc.deleteFieldConfirm($event, field)"
931 translate="INTEGRATIONS.DELETE_FIELD"
942 </md-table-container>
948 <span translate="INTEGRATIONS.TAGS">TAGS</span>
951 <md-table-container class="md-whiteframe-1dp padding-20">
952 <md-input-container class="md-block">
953 <label translate="INTEGRATIONS.TAGS">Tags</label>
955 ng-model="vm_cc.selectedTags"
956 ng-change="vm_cc.selectTagsChanged($event)"
961 ng-repeat="tag in vm_cc.tags"
962 >{{ tag.name }}</md-option
965 </md-input-container>
966 </md-table-container>
972 ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit"
973 ng-click="vm_cc.createOrEditDeskConfiguration($event)"
976 layout-align="center center"
980 class="padding-20 md-whiteframe-3dp md-accent-bg"
982 layout-align="center center"
984 <md-button class="md-icon-button">
985 <md-icon md-font-icon="icon-plus"></md-icon>
988 aria-label="add configuration"
990 translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION"
991 >ADD CONFIGURATION</span