-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced waitlist registration action with mirrord for Teams action (#…
…221) * Replaced action * Changelog entry * Changed button text * Added notifications about mirrord for Teams * Changelog entry * Changelog merged
- Loading branch information
Showing
7 changed files
with
47 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Replaced waitlist registration action with mirrord for Teams actions. | ||
Added occasional notifications about mirrord for Teams. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordRunCounter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.metalbear.mirrord | ||
|
||
import com.intellij.ide.util.PropertiesComponent | ||
import com.intellij.notification.NotificationType | ||
|
||
private const val NOTIFY_AFTER: Int = 100 | ||
private const val NOTIFY_EVERY: Int = 30 | ||
private const val COUNTER_KEY: String = "mirrordForTeamsCounter" | ||
|
||
private const val DEPLOYMENT_EXEC_MESSAGE: String = "When targeting multi-pod deployments, mirrord impersonates the first pod in the deployment. Support for multi-pod impersonation requires the mirrord operator, which is part of mirrord for Teams." | ||
private const val REGULAR_EXEC_MESSAGE: String = "For more features of mirrord, including multi-pod impersonation, check out mirrord for Teams." | ||
class MirrordRunCounter(private val service: MirrordProjectService) { | ||
private fun showNotification(message: String) { | ||
service.notifier.notification(message, NotificationType.INFORMATION).withLink("Try it now", MIRRORD_FOR_TEAMS_URL).withDontShowAgain(MirrordSettingsState.NotificationId.MIRRORD_FOR_TEAMS).fire() | ||
} | ||
fun bump(isDeploymentExec: Boolean) { | ||
val pc = PropertiesComponent.getInstance() | ||
|
||
val previousRuns = pc.getInt(COUNTER_KEY, 0) | ||
pc.setValue(COUNTER_KEY, (previousRuns + 1).toString()) | ||
|
||
if (isDeploymentExec) { | ||
this.showNotification(DEPLOYMENT_EXEC_MESSAGE) | ||
} else if (previousRuns >= NOTIFY_AFTER) { | ||
if (previousRuns == NOTIFY_AFTER || (previousRuns - NOTIFY_AFTER) % NOTIFY_EVERY == 0) { | ||
this.showNotification(REGULAR_EXEC_MESSAGE) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 0 additions & 127 deletions
127
modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordWaitlistDialog.kt
This file was deleted.
Oops, something went wrong.