Displaying Dialog2 outside of iframe addon

Brian Kelley September 22, 2017

The deprecated dialog 1 modal window is able to target a defined web-panel for a Connect add on and display across the entire Jira window without issue.

In trying to implement a new Dialog2 modal and following the example laid out in the documentation, the dialog window shows within the add on iframe web panel and I am unable to figure out how to either have it shown across the entire window or target a web-panel as I did with the deprecated Dialog version.

Is there a way of doing this with the Dialog2 api?

2 answers

0 votes
Kin November 23, 2020

Another solution is to use AP.dialog.create with a key that refers to modules in atlassian-connect.json.

Javascript:

AP.dialog.create({
"key": 'my-custom-dialog',
"chrome": false,
"size" : "large",
"header":{
"value":"My custom dialog"
}
});

atlassian-connect.json:

...
"webItems"
: [
{
"name": {
"value": "My custom dialog"
},
"key": "my-custom-dialog",
"url": "/my-custom-dialog-view",
"location": "none",
"context": "addon",
"target":{
"type":"dialog"
}
}
]
...


But unfortunately, it does not support queryparams or any kind of custom context nor does it have an on open event...

This is only a workable solution if you intend to open your app in a dialog from a button or link.
Then every main interaction with your app should happen inside the dialog's iframe.

0 votes
Glib Briia March 9, 2018

Hi @Brian Kelley, have you found the solution for this?

Thanks,

Glib

Brian Kelley March 9, 2018

@Glib Briia No I ended up giving up and just going with the Dialog 1 modal since it works. *shrug*

Glib Briia March 9, 2018

Thank you, I'll try that

Suggest an answer

Log in or Sign up to answer