Skip to content

Commit

Permalink
chore(deps):update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed Dec 1, 2023
1 parent cdad6a5 commit b538452
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
30 changes: 27 additions & 3 deletions src/main/kotlin/com/dsoftware/ghmanager/Constants.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
package com.dsoftware.ghmanager

import com.intellij.ide.BrowserUtil
import com.intellij.ui.SimpleTextAttributes
import com.intellij.util.ui.StatusText

object Constants {
const val LOG_MSG_PICK_JOB = "Pick a job to view logs"
const val LOG_MSG_MISSING = "Job logs missing for: "
const val LOG_MSG_JOB_IN_PROGRESS = "Job is still in progress, can't view logs"
const val LOG_MSG_JOB_IN_PROGRESS = "Job is still in progress, can't view logs."

fun emptyTextMessage(logValue: String): Boolean {
return (logValue.startsWith(LOG_MSG_MISSING)
|| logValue.startsWith(LOG_MSG_PICK_JOB)
|| logValue.startsWith(LOG_MSG_JOB_IN_PROGRESS)
)
|| logValue.startsWith(
LOG_MSG_JOB_IN_PROGRESS
))
}

fun updateEmptyText(logValue: String, emptyText: StatusText): Boolean {
if (logValue.startsWith(LOG_MSG_MISSING)
|| logValue.startsWith(LOG_MSG_PICK_JOB)
) {
emptyText.text = logValue
return true
}
if (logValue.startsWith(LOG_MSG_JOB_IN_PROGRESS)) {
emptyText.text = "Job is still in progress, can't view logs."
emptyText.appendSecondaryText(
"Please upvote this issue on GitHub so they will prioritize it.",
SimpleTextAttributes.LINK_PLAIN_ATTRIBUTES
) {
BrowserUtil.browse("https://github.com/orgs/community/discussions/75518")
}
return true
}
return false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ fun createLogConsolePanel(
if (logValue.isNullOrBlank()) {
return
}
if (Constants.emptyTextMessage(logValue)) {
panel.emptyText.text = logValue
} else {
if (!Constants.updateEmptyText(logValue, panel.emptyText)) {
panel.removeAll()
val console = LogConsolePanel(project, logValue, parentDisposable)
panel.add(console.component, BorderLayout.CENTER)
Expand Down

0 comments on commit b538452

Please sign in to comment.