-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MNUM-7: Add "GO" under "Caller ID Numbers" tab #1048
base: master
Are you sure you want to change the base?
Conversation
@@ -173,6 +174,19 @@ define(function(require) { | |||
} | |||
}); | |||
|
|||
/* Save a list of the acccounts that have an associated external number */ | |||
_.each(mapAccounts, function(value) { | |||
self.listAccountExternalNumbers(value.id, function(data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The numbers should not be pre-loaded, because one request will be done per sub-account, and if the current account has a lot of sub-accounts, it will hit the server a lot of times. Also this is unnecessary, because these numbers are not displayed until the account is expanded in the view.
See how this works in the "Numbers" app, in the "Spare numbers" or "Numbers in use" tab.
@@ -811,6 +825,47 @@ define(function(require) { | |||
}); | |||
}; | |||
|
|||
var searchExternalNumber = function(searchString, parent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the sub-accounts' numbers will no longer be pre-loaded, this needs to be refactored. Check how the function searchListNumbers
that is a few lines above works and use it as an example, or if possible use that same function, as it should work in a similar way for the 3 number tabs.
@@ -1539,6 +1612,21 @@ define(function(require) { | |||
}); | |||
}, | |||
|
|||
listAccountExternalNumbers: function(accountId, success) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the functions in a submodule should have the submodule name as prefix. In this case it would be something like numbersListExternalNumbers
. Also, having the API call for externalNumbers.list
as a separate function, it would be a good time to use it in here: https://github.com/2600hz/monster-ui/blob/master/src/apps/common/submodules/numbers/numbers.js#L1729
No description provided.