Skip to content

Commit a3e36f2

Browse files
authored
Add warning to indicate time delay in SQS queue deletion (#3141)
1 parent 91ef50a commit a3e36f2

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "feature",
3+
"description" : "Add warning to indicate time delay in SQS queue deletion"
4+
}

jetbrains-core/src/software/aws/toolkits/jetbrains/core/explorer/DeleteResourceDialog.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package software.aws.toolkits.jetbrains.core.explorer
66
import com.intellij.openapi.project.Project
77
import com.intellij.openapi.ui.DialogWrapper
88
import com.intellij.openapi.ui.Messages
9+
import com.intellij.openapi.ui.panel.ComponentPanelBuilder
910
import com.intellij.ui.DocumentAdapter
1011
import com.intellij.ui.components.JBLabel
1112
import com.intellij.ui.components.JBTextField
@@ -17,7 +18,8 @@ import javax.swing.event.DocumentEvent
1718
class DeleteResourceDialog(
1819
project: Project,
1920
private val resourceType: String,
20-
private val resourceName: String
21+
private val resourceName: String,
22+
private val comment: String = ""
2123
) : DialogWrapper(project) {
2224
private val deleteResourceConfirmation = JBTextField().apply {
2325
emptyText.text = message("delete_resource.confirmation_text")
@@ -33,6 +35,14 @@ class DeleteResourceDialog(
3335
row {
3436
deleteResourceConfirmation(grow)
3537
}
38+
createNoteOrCommentRow(
39+
ComponentPanelBuilder.createCommentComponent(
40+
comment,
41+
true,
42+
-1,
43+
true
44+
)
45+
).visible = !comment.isNullOrEmpty()
3646
}
3747
}
3848

jetbrains-core/src/software/aws/toolkits/jetbrains/core/explorer/actions/DeleteResourceAction.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ abstract class DeleteResourceAction<in T : AwsExplorerResourceNode<*>> : SingleR
2020
constructor() : super()
2121
constructor(text: String) : super(text, icon = AllIcons.Actions.Cancel)
2222

23+
open val comment: String = ""
24+
2325
final override fun actionPerformed(selected: T, e: AnActionEvent) {
2426
val resourceType = selected.resourceType()
2527
val resourceName = selected.displayName()
26-
val response = DeleteResourceDialog(selected.nodeProject, resourceType, resourceName).showAndGet()
28+
val response = DeleteResourceDialog(selected.nodeProject, resourceType, resourceName, comment).showAndGet()
2729
if (!response) {
2830
AwsTelemetry.deleteResource(selected.project, selected.serviceId, Result.Cancelled)
2931
} else {

jetbrains-core/src/software/aws/toolkits/jetbrains/services/sqs/actions/DeleteQueueAction.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ class DeleteQueueAction : DeleteResourceAction<SqsQueueNode>(message("sqs.delete
2323
client.deleteQueue { it.queueUrl(selected.queueUrl) }
2424
project.refreshAwsTree(SqsResources.LIST_QUEUE_URLS)
2525
}
26+
27+
override val comment: String = message("resource.delete.warning_text", "queue")
2628
}

resources/resources/software/aws/toolkits/resources/MessagesBundle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,7 @@ redshift.validation.invalid_credential_specified=Invalid credential profile {0}
838838
redshift.validation.invalid_region_specified=Invalid region {0} selected!
839839
redshift.validation.no_cluster_id=No cluster ID specified!
840840
redshift.validation.username=A non-empty username is required
841+
resource.delete.warning_text=Deletion of the {0} may take more than a minute to be reflected
841842
run_configuration_extension.currently_selected=Use the currently selected credential profile/region
842843
run_configuration_extension.feature.java.description=Allow injecting AWS Credentials via Environment Variables into some Java-based Run Configurations
843844
run_configuration_extension.feature.java.title=AWS connected Java Run Configurations

0 commit comments

Comments
 (0)