Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-65861

No way to tell if macro request comes from editor or normal page view

    XMLWordPrintable

Details

    Description

      Issue Summary

      In the new editor, macros are rendered with output.type=display once save is clicked in edit macro screen even if the page/blog/content is not yet published. The old editor rendered them with output.type=preview until publish is clicked.

      This change makes it impossible to make the macro render consistently with the contents of the page it is being rendered on, since my add-on cannot know that it should request the draft version (confluence sends the most recent published version number, which in fact is wrong). Sending the wrong page number is also a bug.

      Steps to Reproduce

      1. Create a dynamic macro
      2. Pass output.type context parameter in the URL
      3. Add the dynamic macro using the new editor
      4. Hit "Save" button in the edit macro dialog

      Expected Results

      A way to differentiate that the page is still in edit page view.

      Actual Results

      Hitting "Save" in edit macro view triggers a call to the dynamic macro URL with output.type equal to display. See screen capture http://recordit.co/viZhU5iSux

      Workaround

      Calling the `AP.navigator.getLocation()` api in the frontend javascript code will allow the app to figure out whether it is in view mode or edit mode: https://developer.atlassian.com/cloud/confluence/jsapi/navigator/

      Attachments

        Issue Links

          Activity

            People

              rtalusan Ryan Talusan
              d47cea233c7f Jason Boileau
              Votes:
              26 Vote for this issue
              Watchers:
              29 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: