Class InteractiveInputJobAction

java.lang.Object
io.jenkins.plugins.interactiveinput.ui.InteractiveInputJobAction
All Implemented Interfaces:
Action, ModelObject, Badgeable

public class InteractiveInputJobAction extends Object implements Action, Badgeable
Per-project notification centre (§per-project surfaces). Attached to every Job by InteractiveInputJobAction.Factory when the perProjectCentre feature is on.

Renders two surfaces from the action's resources:

  • jobMain.jelly — an inline box on the job/pipeline page listing that job's pending questions (rendered by WorkflowJob/main.jelly and AbstractProject/main.jelly which iterate allActions and include each action's jobMain.jelly). It self-hides when nothing is pending.
  • index.jelly — the action's own page (reached via the left-sidebar link that appears only when there are pending questions, driven by getIconFileName()). While showing, getBadge() supplies the pending count to core's sidepanel / overflow menu, and the always-present data-ii-tasklink controller (jobMain.jelly / the action page / bell.js) keeps that pill live so the number does not go stale until a page reload.

Both surfaces mount the shared JS widget, which polls the scoped REST endpoint (/interactive-input/api/v1/questions?job=<fullName>) and opens the shared modal. All permission and existence checks live in the store/REST layer; this action only exposes metadata.

  • Field Details

    • URL_NAME

      public static final String URL_NAME
      Stable URL segment under the job (e.g. /job/foo/interactive-input/).
      See Also:
  • Constructor Details

    • InteractiveInputJobAction

      public InteractiveInputJobAction(@NonNull Job<?,?> job)
  • Method Details

    • isJobPageBoxEnabled

      public boolean isJobPageBoxEnabled()
      Returns:
      whether the large inline job-page box is enabled (independent of the sidebar/badge).
    • isJobBoxVisibleClassic

      public boolean isJobBoxVisibleClassic()
      Returns:
      whether the inline job-page box should render. Suppressed under the experimental job page, where core wraps jobMain.jelly in its "Legacy" card and there is no plugin-usable native-card API (WidgetFactory is @Restricted(NoExternalUse)). The action stays reachable there via the native "more actions" overflow menu, the global bell, and the dedicated interactive-input/ page. The classic layout is unchanged.
    • getIconClassName

      @NonNull public String getIconClassName()
      Returns:
      the theme-aware symbol class for the configured notification icon.
    • getJob

      @NonNull public Job<?,?> getJob()
    • getObject

      @NonNull public Job<?,?> getObject()
      Returns:
      the owning job. Required by core's l:job-subpage (it.object).
    • getJobFullName

      @NonNull public String getJobFullName()
    • getPendingCount

      public int getPendingCount()
      Returns:
      WAITING questions this job should surface to the current viewer (0 on any store error).
    • getPollingIntervalSeconds

      public int getPollingIntervalSeconds()
    • isRichModalEnabled

      public boolean isRichModalEnabled()
    • getIconFileName

      @CheckForNull public String getIconFileName()
      Specified by:
      getIconFileName in interface Action
      Returns:
      the sidebar icon path, or null to hide the link. The link appears only when the feature is on and this job has pending questions (so it stays a per-project indicator, not permanent clutter on every job). While it is showing, the always-present data-ii-tasklink controller (see jobMain.jelly / bell.js) keeps its pending-count badge live and hides the row when the count reaches zero, so the number no longer goes stale until a full page reload.
    • getDisplayName

      @NonNull public String getDisplayName()
      Specified by:
      getDisplayName in interface Action
      Specified by:
      getDisplayName in interface ModelObject
      Returns:
      the stable sidebar / overflow label. The pending count is getBadge(), not a (N) suffix, so the classic sidepanel does not flicker from Interactive Input (N) to a pill.
    • getBadge

      @CheckForNull public Badge getBadge()
      Specified by:
      getBadge in interface Badgeable
      Returns:
      a numeric DANGER badge while this job has pending questions the current viewer should act on; null at zero. Core renders this on the sidepanel (task-icon-badge) and in the experimental overflow / tab chrome.
    • getUrlName

      @NonNull public String getUrlName()
      Specified by:
      getUrlName in interface Action