Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-21720

Routing not working on Jira 9.7.0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 9.11.0, 9.10.2
    • 9.7.0
    • JSW DoS
    • None

    Description

      Issue Summary

      After upgrading jira server version to 9.7.0 hash routers stopped working.

      This is reproducible on Data Center: (yes) / (no)

      Steps to Reproduce

      1. create a Jira server plugin
      2. add a hash router
      <web-section key="project-configuration-section" location="atl.jira.proj.config" weight="300">
      </web-section>
      <web-item key="project-configuration-item" section="atl.jira.proj.config/project-configuration-section">
              <label key="project.section.title"/>
              <link linkId="configuration_area">/secure/TestManagementProjectSettings.jspa?projectKey=$project.key#/project-settings</link>
          </web-item>
      
      $webResourceManager.requireResourcesForContext("<className>")
          <script>
            window.location.hash = "/project-settings";
          </script>
      

      Expected Results

      The router should work as usual

      Actual Results

      Routing doe not happen

      Workaround

      https://community.developer.atlassian.com/t/page-decorator-value-for-project-settings-page-in-jira/2376/4

      As a quick workaround, you can implement the following code just before your HashRouter on the sides connected to the sidebar but not connected to the Board or Backlog page:

      (function (history, $) {
          if (!$) {
              console.log('Couldn`t apply workaround for JSW History: jQuery is required');
          }
      
          const applyWorkaround = () => {
              $(window).off('popstate', undefined, history.onPopState);
              history.Adapter.trigger = () => {
                  console.log('bypassing History.trigger...')
              };
              history.onPopState = () => {
                  console.log('bypassing History onPopState...')
              };
          }
      
          if (!history || !history.Adapter) {
              $(applyWorkaround);
          } else {
              applyWorkaround();
          }
      })(window.History, window.jQuery);
      

      This temporary solution will remain in place until we introduce a proper solution.

      Attachments

        Issue Links

          Activity

            People

              3c952976cf76 Adrianna Musialik
              71f1dad54ffe Wagner M.
              Votes:
              5 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: