Ap.context not returing board information

Hi,

we’d like to use the advantage of cacheable iframes in our plugin (Cacheable app iframes for Connect apps). Our plugin is using “jiraProjectPages” module (I suppouse it comes under “Pages” which is listed as supported modules), so that we are in the context of project. Our original url did contain these variables: " /index.html?projectId={project.id}&boardId={board.id}&boardType={board.type}"

Accordingly to documentation we should drop these context paramters and use Ap.context.getContext() function to get all necessary context information - but however I try to use it I get only jira Project information and don’t get any board information, so I cannot find current board.

After additional investigation it seems that module jiraProjectPages always gets additional query params (so it ignores “cacheable”: true). But even my webpanel in location “jira.agile.board.configuration” doesn’t get board in context…

Is this a bug or I’m missing something?

Edit:
Also I’m getting problem with passing data-options=“sizeToParent:true;” to https://connect-cdn.atl-paas.net/all.js - unfortunately the guide doesn’t specify that,

So to sum up questions:

  1. Is it possible to have cacheable iframe to jiraProjectPages?
  2. Is it possible to get board context from Ap.context.getContext() ?
  3. Is it possible to inject data-options=“sizeToParent:true;” to all.js downloaded via “https://connect-cdn.atl-paas.net/all.js” ?
  1. I don’t see why we wouldn’t add that to the list of allowed modules. I have made a ticket here to track this: [ACJIRA-1598] - Ecosystem Jira
  2. I have created the following ticket: [ACJIRA-1597] - Ecosystem Jira
  3. Yes. sizeToParent should work with the CDN url (you should just be able to swap the url in your code without changing anything else). Did sizeToParent work with jiraProjectPages before changing to the CDN?

Hello @cwhittington,

#1 and #2 - thank you for creating these issues I just started following them.
#3 Size to parent seems to work, I probably must have checked something wrong.

(This is probably another question, but I will drop it right here)
To be perfectly honest, I am still puzzled how the resizing work for different modules, I’m trying different approaches via trial and failure and I still don’t think it’s working correctly:

  • page modules (e.g. jiraProjectPages) my goal is to have full size of window, if content is larger, I’d like scrollbar inside my iframe
    ** add sizeToParent data-option - seems to work
  • webPanel (e.g. JIRA Board config page, View issue Panel) - My goal is to don’t see scrollbars at any time and to don’t waste space (shrink if needed)
    ** AFAIK I would need to wrap my content within ac-content class and all the magic should “just happen” - but it doesn’t seem to work for me every time
    ** If I call AP.resize at some point, that means that no matter what happens inside iframe the size will be as specified, or Connect logic will try to fit ac-content class after some time?
    ** I can also call Ap.resize() without any parameters, does it mean that connect will try to expand iframe as much as my content needs it?

What do you think it’s the best strategy to achieve my goals?