Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Hidanio committed Dec 8, 2023
1 parent 5e0f8d5 commit cd1e53a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/kotlin/com/vk/admstorm/AdmStartupService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,17 @@ class AdmStartupService(private var project: Project) {
private fun setupIssueTrackers(project: Project) {
fun List<com.vk.admstorm.env.Service>.getByKey(key: String) = firstOrNull { it.key == key }

val prj = IssueNavigationConfiguration.getInstance(project)
val navigationConfig = IssueNavigationConfiguration.getInstance(project)
val service = Env.data.services.getByKey("jira") ?: return
val url = service.url + "/browse/\$0"

val isExist = prj.links.find { it ->
val isExist = navigationConfig.links.any { it ->
it.linkRegexp == url
}

if (isExist == null) {
if (!isExist) {
val jiraLink = IssueNavigationLink("[A-Z]+\\-\\d+", url)
prj.links.add(jiraLink)
navigationConfig.links.add(jiraLink)
}
}

Expand Down

0 comments on commit cd1e53a

Please sign in to comment.