Make data shown in delete modals more consistent

This commit is contained in:
James Nuanez
2020-04-24 16:49:16 -07:00
parent 8ec8a725fc
commit 6594c5d196
4 changed files with 16 additions and 18 deletions
@@ -69,15 +69,12 @@ const AccountsList = () => {
// Delete account
//=============================================================================
const formatAccountToDelete = account => {
const password = '•'.repeat(account.password && account.password.length) || '[none]';
return [
{ name: 'Name:' , content: account.name || '' },
{ name: 'SIP Realm:' , content: account.sip_realm || '' },
{ name: 'Registration Webhook:' , content: account.url || '' },
{ name: 'Registration Method:' , content: account.method || '' },
{ name: 'Registration Username:' , content: account.username || '[none]' },
{ name: 'Registration Password:' , content: password },
const items = [
{ name: 'Name:' , content: account.name || '[none]' },
{ name: 'SIP Realm:' , content: account.sip_realm || '[none]' },
{ name: 'Registration Webhook:' , content: account.url || '[none]' },
];
return items;
};
const deleteAccount = async accountToDelete => {
try {
@@ -89,9 +89,10 @@ const ApplicationsList = () => {
//=============================================================================
const formatApplicationToDelete = app => {
return [
{ name: 'Name:', content: app.name || '' },
{ name: 'Calling Webhook:', content: app.call_hook_url || '' },
{ name: 'Call Status Webhook:', content: app.status_hook_url || '' },
{ name: 'Name:', content: app.name || '[none]' },
{ name: 'Account:', content: app.account || '[none]' },
{ name: 'Calling Webhook:', content: app.call_hook_url || '[none]' },
{ name: 'Call Status Webhook:', content: app.status_hook_url || '[none]' },
];
};
const deleteApplication = async applicationToDelete => {
@@ -126,10 +126,10 @@ const PhoneNumbersList = () => {
//=============================================================================
const formatPhoneNumberToDelete = p => {
return [
{ name: 'Number:', content: p.number || '' },
{ name: 'Account:', content: p.account || '' },
{ name: 'Application:', content: p.application || '' },
{ name: 'SIP Trunk:', content: p.sipTrunk || '' },
{ name: 'Number:', content: p.number || '[none]' },
{ name: 'SIP Trunk:', content: p.sipTrunk || '[none]' },
{ name: 'Account:', content: p.account || '[none]' },
{ name: 'Application:', content: p.application || '[none]' },
];
};
const deletePhoneNumber = async phoneNumber => {
@@ -99,9 +99,9 @@ const SipTrunksList = () => {
? trunk.gatewaysList
: trunk.gatewaysList[0];
return [
{ name: 'Name:', content: trunk.name || '' },
{ name: 'Description:', content: trunk.description || '' },
{ name: gatewayName, content: gatewayContent || '' },
{ name: 'Name:', content: trunk.name || '[none]' },
{ name: 'Description:', content: trunk.description || '[none]' },
{ name: gatewayName, content: gatewayContent || '[none]' },
];
};
const deleteSipTrunk = async sipTrunkToDelete => {