From 57d8dd922fd035ea812dbd622b8f6bfd54fb90a4 Mon Sep 17 00:00:00 2001 From: Jean-Roch Maitre Date: Mon, 27 Mar 2017 12:18:39 -0700 Subject: [PATCH] UI-2664: added chosen to next action dropdown, also added devices as an option --- i18n/en-US.json | 5 ++++- submodules/groups/groups.css | 4 ++++ submodules/groups/groups.js | 25 +++++++++++++++++++++++++ views/groups-feature-next_action.html | 5 +++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/i18n/en-US.json b/i18n/en-US.json index 162a189..e3b30d7 100644 --- a/i18n/en-US.json +++ b/i18n/en-US.json @@ -94,7 +94,10 @@ "menu": "Menu", "mainMenu": "Main Menu (Open hours)", "voicemails": "Voicemail Boxes", - "users": "Users" + "users": "Users", + "__comment": "UI-2664: Adding devices as next action", + "__version": "4.1", + "devices": "Devices" }, "__comment": "UI-819, v3.19_s1: Showing an error popup when group data is outdated.", "outdatedGroupsError": "Your Group's data is outdated and can not be rendered. Please contact your administrator to update your data.", diff --git a/submodules/groups/groups.css b/submodules/groups/groups.css index 98a0cd9..7ea7057 100644 --- a/submodules/groups/groups.css +++ b/submodules/groups/groups.css @@ -544,6 +544,10 @@ margin-left: 10px; } +/* Had to add this hack so the chosen dialog shows up correctly */ +.next-action-group-dialog .ui-dialog-content { + overflow: visible; +} /* Allow Call Forward Feature */ .monster-feature-popup-container[data-feature="forward"] .help-box { diff --git a/submodules/groups/groups.js b/submodules/groups/groups.js index 8351603..5e9647e 100644 --- a/submodules/groups/groups.js +++ b/submodules/groups/groups.js @@ -790,6 +790,8 @@ define(function(require){ switchFeature = featureTemplate.find('.switch-state'), popup; + featureTemplate.find('.next-action-select').chosen({ search_contains: true, width: '220px' }); + featureTemplate.find('.cancel-link').on('click', function() { popup.dialog('close').remove(); }); @@ -847,6 +849,7 @@ define(function(require){ }); popup = monster.ui.dialog(featureTemplate, { + dialogClass: 'next-action-group-dialog', title: data.group.extra.mapFeatures.next_action.title, position: ['center', 20] }); @@ -1334,10 +1337,32 @@ define(function(require){ }); }, + groupsListDevices: function(callback) { + var self = this; + + self.callApi({ + resource: 'device.list', + data: { + accountId: self.accountId, + filters: { + paginate: 'false' + } + }, + success: function(data) { + callback && callback(data.data); + } + }); + }, + groupsGetFeaturesData: function(groupId, callback) { var self = this; monster.parallel({ + devices: function(callback) { + self.groupsListDevices(function(data) { + callback(null, data); + }); + }, group: function(callback) { self.groupsGetGroup(groupId, function(data) { callback(null, data); diff --git a/views/groups-feature-next_action.html b/views/groups-feature-next_action.html index 4b26037..455885f 100644 --- a/views/groups-feature-next_action.html +++ b/views/groups-feature-next_action.html @@ -31,6 +31,11 @@ {{/each}} + + {{#each devices}} + + {{/each}} +