Professional Documents
Culture Documents
module('aa51e100-f601-4f2c-ba4c-767a05c45ebe', [
'core.services.WidgetAPI'
]).directive('knowledgeBase', widgetComponent);
function widgetComponent(WidgetAPI) {
scope.createCustomCard = function() {
var customCard = {
channel: "CUSTOM",
destinationAddress: "(014) 427-4427",
establishedTime: "2017-06-05T09:02:44.121Z",
id: generateID(),
legTitle: "(014) 427-4427",
originatingAddress: "1001",
state: "ACTIVE",
title: "Pom Outbound Call"
}
api.createCustomCard(customCard);
}
scope.deleteCustomCard = function() {
var customCard = {
channel: "CUSTOM",
destinationAddress: "(014) 427-4427",
establishedTime: "2017-06-05T09:02:44.121Z",
id: getID(),
legTitle: "(014) 427-4427",
originatingAddress: "1001",
state: "ACTIVE",
title: "Pom Outbound Call"
}
cardIds = [];
api.deleteCustomCard(customCard);
}
scope.updateCustomCard = function() {
var customCard = {
channel: "CUSTOM",
destinationAddress: "(014) 427-4427",
establishedTime: "2017-06-05T09:02:44.121Z",
id: getID(),
legTitle: "(014) 427-4427",
originatingAddress: "1001",
state: "HELD",
title: "Pom Outbound Call"
}
api.updateCustomCard(customCard);
}
function generateID() {
var id = _.sample(['2345','6456','0980','9877']) +
_.sample(['fngn','jgfh','mjkj','vbnv']) + _.sample(['8786','7566','4563','2345']);
cardIds.push(id);
return id;
}
function getID() {
return cardIds[0];
}
return {
scope: {},
replace: true,
template: template,
link: widgetContainer
};
}