Browse Source

After Bridge submodule

pull/4/head
Vladimir Barkasov 6 years ago
parent
commit
f79a643ef2
7 changed files with 238 additions and 2 deletions
  1. +2
    -1
      src/apps/callflows/app.js
  2. +23
    -0
      src/apps/callflows/i18n/en-US.json
  3. +2
    -1
      src/apps/callflows/style/app.css
  4. +3
    -0
      src/apps/callflows/submodules/afterbridge/afterbridge.css
  5. +175
    -0
      src/apps/callflows/submodules/afterbridge/afterbridge.js
  6. +23
    -0
      src/apps/callflows/submodules/afterbridge/views/transferDialog.html
  7. +10
    -0
      src/apps/callflows/submodules/afterbridge/views/warningDialog.html

+ 2
- 1
src/apps/callflows/app.js View File

@ -3,9 +3,10 @@ define(function(require) {
_ = require('lodash'),
monster = require('monster');
var appSubmodules = [
'afterbridge',
'audiomacro',
'blacklist',
'callcenter',
'audiomacro',
'conference',
'device',
'directory',


+ 23
- 0
src/apps/callflows/i18n/en-US.json View File

@ -27,6 +27,29 @@
"qubicle_tip": "Route to a queue",
"which_queue": "Which queue?"
},
"after_bridge": {
"category": "After bridge",
"park": {
"nodeName": "After bridge: Park",
"tooltip": "Allow park on the caller after the bridge is terminated.",
"action": "Park"
},
"transfer": {
"nodeName": "After bridge: Transfer",
"tooltip": "Allow transfer on the caller after the bridge is terminated.",
"dialog_title": "After bridge: Transfer",
"number": "Number"
},
"hangup": {
"nodeName": "After bridge: Hangup",
"tooltip": "Allow hangup on the caller after the bridge is terminated."
},
"warning_dialog": {
"title": "After bridge",
"message": "Place this item <b>in front</b> of the action item"
},
"warning": "Warning!"
},
"audio_macro": {
"dialog_title": "Audio Macro",
"macro_type": "Macro type",


+ 2
- 1
src/apps/callflows/style/app.css View File

@ -11,6 +11,7 @@
@import url('../submodules/temporalset/temporalset.css');
@import url('../submodules/callcenter/callcenter.css');
@import url('../submodules/audiomacro/audiomacro.css');
@import url('../submodules/afterbridge/afterbridge.css');
@import url('../../../css/vendor/bootstrap-tour.css');
/* style.css */
#ws_callflow > .callflow {
@ -416,7 +417,7 @@
#ws_callflow .div_icon > .fa,
.callflow-preview .div_icon > .fa {
font-size: 23px;
margin-right: 7px;
/* margin-right: 7px; */
color: white;
vertical-align: top;
}


+ 3
- 0
src/apps/callflows/submodules/afterbridge/afterbridge.css View File

@ -0,0 +1,3 @@
.dialog_popup .form_content .after-bridge-number input[type="text"] {
max-width: 135px;
}

+ 175
- 0
src/apps/callflows/submodules/afterbridge/afterbridge.js View File

@ -0,0 +1,175 @@
define(function(require) {
var $ = require('jquery'),
monster = require('monster');
var app = {
requests: {},
subscribe: {
'callflows.fetchActions': 'afterbridgeDefineActions'
},
afterbridgeDefineActions: function(args) {
var self = this,
callflow_nodes = args.actions,
i18n = self.i18n.active().callflows.after_bridge;
$.extend(callflow_nodes, {
'after_bridge[action=park]': {
name: i18n.park.nodeName,
icon: 'reply',
category: i18n.category,
module: 'after_bridge',
tip: i18n.park.tooltip,
data: {
action: 'park',
data: true
},
rules: [
{
type: 'quantity',
maxSize: '1'
}
],
isUsable: 'true',
weight: 48,
caption: function(node, caption_map) {
return '';
},
edit: function(node, callback) {
self.afterbridgeShowWarningDialog(node, callback);
}
},
'after_bridge[action=transfer]': {
name: i18n.transfer.nodeName,
icon: 'map-signs',
category: i18n.category,
module: 'after_bridge',
tip: i18n.transfer.tooltip,
data: {
action: 'transfer',
data: false
},
rules: [
{
type: 'quantity',
maxSize: '1'
}
],
isUsable: 'true',
weight: 48,
caption: function(node, caption_map) {
return node.getMetadata('data') || '';
},
edit: function(node, callback) {
self.afterbridgeTransferEdit(node, callback);
}
},
'after_bridge[action=hangup]': {
name: i18n.hangup.nodeName,
icon: 'power-off',
category: i18n.category,
module: 'after_bridge',
tip: i18n.hangup.tooltip,
data: {
action: 'hangup',
data: true
},
rules: [
{
type: 'quantity',
maxSize: '1'
}
],
isUsable: 'true',
weight: 48,
caption: function(node, caption_map) {
return '';
},
edit: function(node, callback) {
self.afterbridgeShowWarningDialog(node, callback);
}
}
});
},
afterbridgeShowWarningDialog: function (node, callback) {
var self = this,
$popup,
$dialog;
$dialog = $(self.getTemplate({
name: 'warningDialog',
data: {},
submodule: 'afterbridge'
}));
$popup = monster.ui.dialog($dialog, {
title: self.i18n.active().callflows.after_bridge.warning_dialog.title,
minHeight: '0',
width: 400,
beforeClose: function() {
if (typeof callback === 'function') {
callback();
}
}
});
$dialog.find('.js-confirm').click(function() {
if (typeof callback === 'function') {
callback();
}
$popup.dialog('close');
});
},
afterbridgeTransferEdit: function (node, callback) {
var self = this,
$popup,
$dialog,
action = node.getMetadata('action'),
number = node.getMetadata('data');
$dialog = $(self.getTemplate({
name: 'transferDialog',
data: {
action: action,
number: number || ''
},
submodule: 'afterbridge'
}));
$popup = monster.ui.dialog($dialog, {
title: self.i18n.active().callflows.after_bridge.transfer.dialog_title,
minHeight: '0',
width: 400,
beforeClose: function() {
if (typeof callback === 'function') {
callback();
}
}
});
$dialog.find('.js-save').click(function() {
var number = $('#after-bridge-number').val();
var caption = '';
if(!number) {
number = false
} else {
caption = number;
}
node.setMetadata('data', number);
node.caption = caption;
if (typeof callback === 'function') {
callback();
}
$popup.dialog('close');
});
}
};
return app;
});

+ 23
- 0
src/apps/callflows/submodules/afterbridge/views/transferDialog.html View File

@ -0,0 +1,23 @@
<div class="dialog_popup callflows-port after-bridge-dialog js-after-bridge-dialog">
<form method="post" action="#" class="after-bridge-form js-after-bridge-form">
<div class="form_content">
<div class="popup_field clear js-after-bridge-number after-bridge-number">
<label for="after-bridge-number">
{{ i18n.callflows.after_bridge.transfer.number }}
</label>
<div class="field_wrapper">
<input name="number" type="text" value="{{ number }}" id="after-bridge-number"/>
</div>
</div>
</div>
{{#monsterPanelText i18n.callflows.after_bridge.warning 'warning' 'fill-width'}}
{{{ i18n.callflows.after_bridge.warning_dialog.message }}}
{{/monsterPanelText}}
</form>
<div class="buttons-center">
<button class="monster-button monster-button-primary js-save">
{{ i18n.save }}
</button>
</div>
</div>

+ 10
- 0
src/apps/callflows/submodules/afterbridge/views/warningDialog.html View File

@ -0,0 +1,10 @@
<div class="dialog_popup callflows-port after-bridge-dialog js-after-bridge-dialog">
{{#monsterPanelText i18n.callflows.after_bridge.warning 'warning' 'fill-width'}}
{{{ i18n.callflows.after_bridge.warning_dialog.message }}}
{{/monsterPanelText}}
<div class="buttons-center">
<button class="monster-button monster-button-primary js-confirm">
{{ i18n.dialog.confirmOk }}
</button>
</div>
</div>

Loading…
Cancel
Save