Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-4835

Calling cancel(KeyedMessage) on a PullRequestOpenRequestedEvent does not display the KeyedMessage in the UI

    XMLWordPrintable

Details

    Description

      Calling cancel(KeyedMessage) on a PullRequestOpenRequestedEvent does not display the KeyedMessage in the UI. All that is shown in the UI is the default "stash.service.pullrequest.creationcanceled" KeyedMessage. That is the generic "Pull request creation was canceled." message.

      It would be nice to see custom messages included with the generic canceled message.

      Example from a custom plugin that listens for the PullRequestOpenRequestedEvent.

      i18n.properties
      customplugin.pullrequest.cancel="Pull request creation was canceled because the title does not contain a valid JIRA ticket number"

      customEventListener.java
      @EventListener
      public void customEventListener (PullRequestOpenRequestedEvent event)

      { event.cancel(i18nService.createKeyedMessage("customplugin.pullrequest.cancel") }

      I am not very familiar with how you send error messages to the UI, but my guess is something in stash-parent/webapp/default/src/main/webapp/static/page/pull-request/create/pull-request-create.soy is not showing the getCancelMessages() from the PullRequestOpenCanceledException

      Attachments

        Issue Links

          Activity

            People

              bturner Bryan Turner (Inactive)
              1162445d7df9 Chris Swiontek
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: