-
Notifications
You must be signed in to change notification settings - Fork 409
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
Delete phone numbers from inventory and Twilio #1881
Delete phone numbers from inventory and Twilio #1881
Conversation
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.
Maybe not a task for this first iteration, but would be nice to be able to control how many numbers are being deleted - add some sort of limit there.
Otherwise looks mostly good!
style: inlineStyles.column, | ||
render: (columnKey, row) => | ||
this.props.params.ownerPerms ? ( | ||
<FlatButton |
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.
Why not an IconButton
?
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.
I initially tried IconButton
but it didn't look right to me. No hover state and the tool tip was getting cut off by the row, which I'm sure is fixable but FlatButton
seemed fine.
@@ -264,6 +309,29 @@ class AdminPhoneNumberInventory extends React.Component { | |||
> | |||
{this.renderBuyNumbersForm()} | |||
</Dialog> | |||
<Dialog | |||
title="Delete Numbers" | |||
modal={false} |
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.
I believe false
is the default here.
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.
🙌
src/server/api/lib/twilio.js
Outdated
*/ | ||
async function deleteNumber(twilioInstance, phoneSid, phoneNumber) { | ||
const response = await twilioInstance.incomingPhoneNumbers(phoneSid).remove(); | ||
if (response.error) { |
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.
I think my one request here is that instead of throwing if deleting a number fails, we should just count/track the errors here. A use case that came up for us and at least one other campaign was deleting numbers in Spoke when at least some of them were already deleted from the Twilio console.
Other than that, looks good.
Description
Adds delete buttons to the phone number inventory page, which lets you bulk remove unallocated numbers for an area code from both the Spoke inventory and you Twilio account.
Checklist: