AP.resize does not work in resorted Page Properties Reports

Hi,

I am having trouble with AP.resize inside Page Properties Reports.

Steps to reproduce:

  1. Create a dynamic macro which uses AP.resize under a certain condition (you can just use random numbers to reproduce this).
  2. Insert this macro inside a table in a “Page Properties” macro.
  3. Create a page with a “Page Properties Report” which includes the one created before.
  4. AP.resize still works as expected for the macro inside the report.
  5. Resort the Page Properties report by any column.
  6. The AP.resize doesn’t work anymore. (the iframe isn’t resized anymore)

When I debugged the library I figured out that what AP.resize does is calling parent.postMessage like this:
parent.postMessage({ args: ['200px', '300px'], eid: JSON.parse(window.name).extension_id, fn: 'resize', mod: 'env', type: 'req', }, 'https://<YOUR_INSTANCE>.atlassian.net');

Atlassian listens to that and resizes the iframe accordingly similar to this guide: https://davidwalsh.name/window-iframe

However, it doesn’t listen to it in a resorted Page Properties Report. I tried calling parent.postMessage manually and noticed the same behavior (it worked everywhere except inside resorted Page Properties Reports).

Regards,

Jan

1 Like

Hi @jan.frei,

I don’t think the Page Properties macro is intended to support the embedding of other macros. According to the Page Properties Macro documentation, it’s purpose is to enable the display of “summary information from one page on another page” by inserting “key/value pairs” in tabular form.

The reason AP.resize stops working is that the resorting of the Page Properties Report table causes the re-rendering of the table content which includes your app. However, the rendering of an app iframe requires a certain amount of bootstrapping to ensure the AP API is set up correctly, but it seems this bootstrapping is only occurring in the initial rendering of the Page Properties Report table and not subsequent re-rendering of it.

What type of information are you intending to display in the macro you are inserting into the Page Properties macro?

Regards,
Dugald

Hi @dmorrow

Thank you for the information. The macro of our app is used inside Page Properties Reports.

Is there a ticket (on CONFCLOUD) we can follow regarding this issue?

Regards,
Jan

Hi @jan.frei,

I’ll first ask the Confluence PM if the Page Properties macro is intended to support the embedding of other macros.

Regards,
Dugald

1 Like

Hi @dmorrow

Do you have any updates on this?

We are also facing a new issue now. When users set one of our macros in Page Properties they don’t get rendered anymore in the Page Properties Report but instead the following error message is displayed:

This content cannot be displayed as it was created in a legacy version of Confluence and is unsupported.

Do you have any information on this and why this is suddenly the behavior for Page Properties Reports?

Our customers from Easy Dropdown Menu depend a lot on this functionality.

Thanks and regards,
Jan

Hi @jan.frei,

Sorry for the wait - I’m still trying to get an answer.

Regards,
Dugald

Hi @jan.frei,

The Confluence team believes this is a bug so I’ve created CONFCLOUD-70369.

Regards,
Dugald

2 Likes

@jan.frei Is this the same issue you raised in DEVHELP last week that was fixed?

This was the issue that solved their issue https://jira.atlassian.com/browse/CONFCLOUD-70357

Hi @rwhitbeck

Yes, the second issue I mentioned in this thread on July 2 is fixed in https://jira.atlassian.com/browse/CONFCLOUD-70357

However, the AP.resize (and the JavaScript API in general) is still broken after resizing a Page Properties Report: https://jira.atlassian.com/browse/CONFCLOUD-70369

Regards,
Jan

Thanks for confirming.

Hi @rwhitbeck

The same issue started reappearing again a few days ago. I thought it was fixed in https://jira.atlassian.com/browse/CONFCLOUD-70357 but I’m uncertain if those issues were even related in the first place.

Steps to reproduce:

  1. Insert any third-party app macro inside a table in a “Page Properties” macro.
  2. Create a page with a “Page Properties Report” which includes the one created before.

Expected result:
Successful render of the app macro in the Page Properties Report.

Actual result:

This content cannot be displayed as it was created in a legacy version of Confluence and is unsupported.

Please note that the macro preview (in the Page Properties Report macro editor) successfully renders the app macros in the report. It “only” fails in normal page view.

5 Likes