Interface InaccessibleProjectTypeDialogDataProvider

All Known Implementing Classes:
InaccessibleProjectTypeDialogDataProviderImpl

@PublicApi public interface InaccessibleProjectTypeDialogDataProvider
Provides the data required to render the dialog attached to the warning symbol that is displayed when a project type is inaccessible.

In order to generate a fully functional project type warning on the page, you need to:

- Call shouldDisplayInaccessibleWarning(ApplicationUser, Project) to find out the project type(s) for which you need to generate the warning icon.

- For each project type that needs a warning attached, generate an DOM element with the class "project-type-warning-icon-{key}" (where key is the key of the project type that the warning corresponds to)

- Call provideData(WebResourceAssembler, ApplicationUser, Project) or InaccessibleProjectTypeDialogDataProvider#provideResourcesMultipleProjects(WebResourceAssembler, ApplicationUser, ProjectTypeKey...) (depending on whether only one project is displayed on the page or several)

- Require the jira.webresources:project-type-warning web-resource

- From the client side: require the "jira/project/types/warning/dialog" AMD module and call "init" on the returned JavaScript object.

Since:
7.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    provideData(com.atlassian.webresource.api.assembler.WebResourceAssembler assembler, ApplicationUser user, Project project)
    Provides the data needed to render the dialog attached to the warning symbols displayed for the project type of the given project.
    boolean
    Indicates whether the inaccessible project type warning should be displayed or not, on a page that is displaying a single project.
  • Method Details

    • shouldDisplayInaccessibleWarning

      boolean shouldDisplayInaccessibleWarning(ApplicationUser user, Project project)
      Indicates whether the inaccessible project type warning should be displayed or not, on a page that is displaying a single project.
      Parameters:
      user - The user for which we are performing the check.
      project - The project with the type for which we will display the warning
      Returns:
      Whether the inaccessible project type warning should be displayed.
    • provideData

      void provideData(com.atlassian.webresource.api.assembler.WebResourceAssembler assembler, ApplicationUser user, Project project)
      Provides the data needed to render the dialog attached to the warning symbols displayed for the project type of the given project.

      This method should be used when the warning symbols are displayed on a page that is displaying a single project, since the messages of the dialogs will have nouns in singular form.

      Parameters:
      assembler - The assembler to be used to provide the data
      user - The user for which the warning dialog will be rendered
      project - The keys of the project types for which the warning dialogs will be rendered