Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

Isaac2600Hz
Copy link
Contributor

No description provided.

@Isaac2600Hz Isaac2600Hz requested review from a team and guillegr123 and removed request for a team January 25, 2023 09:08
@@ -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) {
Copy link
Contributor

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) {
Copy link
Contributor

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) {
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants