Built motion from commit 3e059bc2.|2.5.32
[motion2.git] / server / config / seedDB / tree / index.js
1 'use strict';
2
3 /* Expected format of the node (there are no required fields)
4 {
5   id          : "string" // will be autogenerated if omitted
6   text        : "string" // node text
7   icon        : "string" // string for custom
8   state       : {
9     opened    : boolean  // is the node open
10     disabled  : boolean  // is the node disabled
11     selected  : boolean  // is the node selected
12   },
13   children    : []  // array of strings or objects
14 }
15 */
16
17 var getQueuesChildren = function(prefix) {
18   prefix += '_';
19   return [{
20     id: prefix + 'answered',
21     text: 'Answered'
22   }, {
23     id: prefix + 'unanswered',
24     text: 'Unanswered'
25   }, {
26     id: prefix + 'distribution',
27     text: 'Distribution'
28   }];
29 };
30
31 var getVoiceChildren = function(prefix) {
32   prefix += '_';
33   return [{
34     id: prefix + 'queues',
35     text: 'Queues',
36     icon: 'icon s20 icon-stackoverflow',
37     children: getQueuesChildren(prefix + 'queues')
38   }, {
39     id: prefix + 'calls',
40     text: 'Calls',
41     icon: 'icon s20 icon-phone-dots'
42   }, {
43     id: prefix + 'agents',
44     text: 'Agents',
45     icon: 'icon s20 icon-account-multiple'
46   }, {
47     id: prefix + 'callysquare',
48     text: 'Cally Square',
49     icon: 'icon s20 icon-sitemap'
50   }, {
51     id: prefix + 'recordings',
52     text: 'Recordings',
53     icon: 'icon s20 icon-microphone'
54   }];
55 };
56
57 var getBullChildren = function(prefix) {
58   prefix += '_';
59   return [{
60     id: prefix + 'queue_campaigns',
61     text: 'Queue Campaigns',
62     icon: 'icon s20 icon-stackoverflow'
63   }, {
64     id: prefix + 'ivr_campaigns',
65     text: 'IVR Campaigns',
66     icon: 'icon s20 icon-sitemap'
67   }];
68 };
69
70
71 var getMotionChildren = function(prefix) {
72   prefix += '_';
73   return [{
74     id: prefix + 'voice',
75     text: 'Voice',
76     icon: 'icon s20 icon-phone-log',
77     children: getVoiceChildren(prefix + 'voice')
78   }, {
79     id: prefix + 'bull',
80     text: 'Motion Bull',
81     icon: 'icon s20 icon-fire',
82     children: getBullChildren(prefix + 'bull')
83   }, {
84     id: prefix + 'chat',
85     text: 'Chat',
86     icon: 'icon s20 icon-hangouts'
87   }, {
88     id: prefix + 'mail',
89     text: 'Email',
90     icon: 'icon s20 icon-email'
91   }, {
92     id: prefix + 'openchannel',
93     text: 'Openchannel',
94     icon: 'icon s20 icon-google-earth'
95   }, {
96     id: prefix + 'sms',
97     text: 'Sms',
98     icon: 'icon s20 icon-message-text'
99   }, {
100     id: prefix + 'fax',
101     text: 'Fax',
102     icon: 'icon s20 icon-deskphone'
103   }, {
104     id: prefix + 'whatsapp',
105     text: 'WhatsApp Connector',
106     icon: 'icon s20 icon-whatsapp'
107   }, {
108     id: prefix + 'agents',
109     text: 'Agents',
110     icon: 'icon s20 icon-account-multiple'
111   }];
112 };
113
114 var getTree = function(custom) {
115   return [{
116     id: custom ? 'custom' : 'motion',
117     text: (custom ? 'Custom' : 'Motion') + ' Reports',
118     icon: 'icon s20 ' + (custom ? 'icon-laptop-chromebook' : 'icon-cloud'),
119     state: {
120       opened: true,
121       selected: true
122     },
123     children: getMotionChildren(custom ? 'custom' : 'motion')
124   }];
125 };
126
127 exports.motion = getTree(false);
128 exports.custom = getTree(true);