-
Notifications
You must be signed in to change notification settings - Fork 274
Display toast notifications with actions #5082
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package software.aws.toolkits.jetbrains.core.notifications | ||
|
|
||
| import com.intellij.notification.NotificationType | ||
| import com.intellij.openapi.actionSystem.AnAction | ||
| import software.aws.toolkits.jetbrains.utils.notifySticky | ||
|
|
||
| object DisplayToastNotifications { | ||
| fun show(title: String, message: String, action: List<AnAction>, notificationType: ToastNotificationType) { | ||
| val notifyType = when (notificationType) { | ||
| ToastNotificationType.CRITICAL -> NotificationType.ERROR | ||
| ToastNotificationType.WARNING -> NotificationType.WARNING | ||
| ToastNotificationType.PRODUCT_UPDATE -> NotificationType.INFORMATION | ||
|
Check warning on line 15 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/notifications/DisplayToastNotifications.kt
|
||
| } | ||
| notifySticky(notifyType, title, message, null, action) | ||
| } | ||
|
Check warning on line 18 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/notifications/DisplayToastNotifications.kt
|
||
| } | ||
|
|
||
| enum class ToastNotificationType { | ||
| CRITICAL, | ||
| WARNING, | ||
| PRODUCT_UPDATE, | ||
| } | ||
|
Check warning on line 25 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/notifications/DisplayToastNotifications.kt
|
||
|
Comment on lines
+21
to
+25
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'm assuming this will be part of model, so plan ahead and move this to another file |
||
Check warning
Code scanning / QDJVMC
Unused symbol Warning