Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesPull RequestsActionsSecurityInsightsSettings
✨ AI
More
Blame · Line-by-line history

CreateIssueAction.kt

Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.

CreateIssueAction.ktBlame44 lines · 1 contributor
0377886Claude1package com.gluecron.actions
2
3import com.gluecron.GluecronUtil
4import com.gluecron.settings.GluecronSettingsState
5import com.intellij.notification.NotificationType
6import com.intellij.openapi.actionSystem.AnAction
7import com.intellij.openapi.actionSystem.AnActionEvent
8import com.intellij.openapi.project.DumbAware
9
10/**
11 * Opens a browser tab showing the new-issue form for the current repository.
12 *
13 * URL pattern: {host}/{owner}/{repo}/issues/new
14 *
15 * This is the JetBrains equivalent of the VS Code "gluecron.createIssue" flow.
16 * Rather than embedding a form in the IDE (which would require additional UI
17 * scaffolding), we open the Gluecron web UI so users can fill in labels,
18 * assignees, and description with full markdown preview.
19 */
20class CreateIssueAction : AnAction(), DumbAware {
21
22 override fun actionPerformed(e: AnActionEvent) {
23 val project = e.project ?: return
24 val settings = GluecronSettingsState.getInstance()
25
26 val (owner, repo) = GluecronUtil.detectOwnerRepo(project)
27 ?: run {
28 GluecronUtil.notify(
29 project,
30 "No Gluecron remote detected. Ensure the project has a git remote " +
31 "pointing to ${settings.host}.",
32 NotificationType.WARNING
33 )
34 return
35 }
36
37 val url = "${settings.host}/$owner/$repo/issues/new"
38 GluecronUtil.openBrowser(url)
39 }
40
41 override fun update(e: AnActionEvent) {
42 e.presentation.isEnabledAndVisible = e.project != null
43 }
44}