[IFT] Git lessons cleanup

GitOrigin-RevId: 042ab06730f125d4c979a51952410b2d52a0dde1
This commit is contained in:
Konstantin Hudyakov
2023-02-15 18:08:13 +02:00
committed by intellij-monorepo-bot
parent 7ea1824ace
commit e6ceb976ea
5 changed files with 14 additions and 14 deletions

View File

@@ -86,7 +86,7 @@ object GitLessonsUtil {
fun TaskContext.highlightSubsequentCommitsInGitLog(startCommitRow: Int,
sequenceLength: Int = 1,
highlightInside: Boolean = true,
highlightInside: Boolean = false,
usePulsation: Boolean = false) {
triggerAndBorderHighlight {
this.highlightInside = highlightInside
@@ -97,7 +97,7 @@ object GitLessonsUtil {
}
fun TaskContext.highlightSubsequentCommitsInGitLog(sequenceLength: Int = 1,
highlightInside: Boolean = true,
highlightInside: Boolean = false,
usePulsation: Boolean = false,
startCommitPredicate: (VcsCommitMetadata) -> Boolean) {
triggerAndBorderHighlight {
@@ -115,7 +115,7 @@ object GitLessonsUtil {
fun TaskContext.highlightLatestCommitsFromBranch(branchName: String,
sequenceLength: Int = 1,
highlightInside: Boolean = true,
highlightInside: Boolean = false,
usePulsation: Boolean = false) {
highlightSubsequentCommitsInGitLog(sequenceLength, highlightInside, usePulsation) l@{ commit ->
val vcsData = VcsProjectLog.getInstance(project).dataManager ?: return@l false

View File

@@ -213,7 +213,7 @@ class GitCommitLesson : GitLesson("Git.Commit", GitLessonsBundle.message("git.co
resetGitLogWindow()
task {
highlightSubsequentCommitsInGitLog(startCommitRow = 0, highlightInside = false)
highlightSubsequentCommitsInGitLog(startCommitRow = 0)
}
task {
@@ -305,7 +305,7 @@ class GitCommitLesson : GitLesson("Git.Commit", GitLessonsBundle.message("git.co
}
task {
highlightSubsequentCommitsInGitLog(startCommitRow = 0, highlightInside = false)
highlightSubsequentCommitsInGitLog(startCommitRow = 0)
}
task {
@@ -335,7 +335,7 @@ class GitCommitLesson : GitLesson("Git.Commit", GitLessonsBundle.message("git.co
restoreCommitWindowStateInformer()
}
private fun TaskContext.highlightVcsChange(changeFileName: String, highlightBorder: Boolean = true) {
private fun TaskContext.highlightVcsChange(changeFileName: String) {
triggerAndBorderHighlight().treeItem { _: JTree, path: TreePath ->
path.pathCount > 2 && path.getPathComponent(2).toString().contains(changeFileName)
}

View File

@@ -100,7 +100,7 @@ class GitFeatureBranchWorkflowLesson : GitLesson("Git.BasicWorkflow", GitLessons
}
task {
highlightLatestCommitsFromBranch(branchName, sequenceLength = 2, highlightInside = false)
highlightLatestCommitsFromBranch(branchName, sequenceLength = 2)
}
task {
@@ -171,7 +171,7 @@ class GitFeatureBranchWorkflowLesson : GitLesson("Git.BasicWorkflow", GitLessons
triggerAndBorderHighlight().component { ui: JButton ->
ui.text == CommonBundle.getOkButtonText()
}
highlightSubsequentCommitsInGitLog(highlightInside = false) { commit ->
highlightSubsequentCommitsInGitLog { commit ->
commit.fullMessage == commitMessage
}
restoreByUiAndBackgroundTask(ActionsBundle.actionText("Vcs.UpdateProject").dropMnemonic(), delayMillis = defaultRestoreDelay)

View File

@@ -78,7 +78,7 @@ class GitInteractiveRebaseLesson : GitLesson("Git.InteractiveRebase", GitLessons
task {
text(GitLessonsBundle.message("git.interactive.rebase.introduction"))
highlightLatestCommitsFromBranch(branchName, sequenceLength = 5, highlightInside = false)
highlightLatestCommitsFromBranch(branchName, sequenceLength = 5)
proceedLink()
showWarningIfGitWindowClosed()
}
@@ -92,7 +92,7 @@ class GitInteractiveRebaseLesson : GitLesson("Git.InteractiveRebase", GitLessons
val vcsData = VcsProjectLog.getInstance(project).dataManager
commitHashToHighlight = vcsData?.findFirstCommitInBranch(branchName)
}
highlightSubsequentCommitsInGitLog(highlightInside = false) {
highlightSubsequentCommitsInGitLog {
it.id == commitHashToHighlight
}
}

View File

@@ -74,7 +74,7 @@ class GitProjectHistoryLesson : GitLesson("Git.ProjectHistory", GitLessonsBundle
}
task {
highlightLatestCommitsFromBranch(branchName, highlightInside = false)
highlightLatestCommitsFromBranch(branchName)
}
task {
@@ -104,7 +104,7 @@ class GitProjectHistoryLesson : GitLesson("Git.ProjectHistory", GitLessonsBundle
text(GitLessonsBundle.message("git.project.history.click.head.tooltip", choice),
LearningBalloonConfig(Balloon.Position.above, 250))
triggerUI().component { ui: BranchFilterPopupComponent ->
ui.currentText?.contains("HEAD") == true
ui.currentText.contains("HEAD")
}
showWarningIfGitWindowClosed(restoreTaskWhenResolved = true)
test {
@@ -138,7 +138,7 @@ class GitProjectHistoryLesson : GitLesson("Git.ProjectHistory", GitLessonsBundle
task {
text(GitLessonsBundle.message("git.project.history.select.me", strong(meFilterText)))
triggerUI().component { ui: UserFilterPopupComponent ->
ui.currentText?.contains(meFilterText) == true
ui.currentText.contains(meFilterText)
}
restoreByUi(delayMillis = defaultRestoreDelay)
test {
@@ -169,7 +169,7 @@ class GitProjectHistoryLesson : GitLesson("Git.ProjectHistory", GitLessonsBundle
task {
text(GitLessonsBundle.message("git.project.history.select.commit"))
highlightSubsequentCommitsInGitLog(0, highlightInside = false)
highlightSubsequentCommitsInGitLog(startCommitRow = 0)
triggerUI().component { ui: VcsLogGraphTable ->
ui.selectedRow == 0
}