So i have this in my atlassian-connect.json
.....
"modules": {
"dialogs": [
{
"url": "/deletionConfirmationDialog",
"options": {
"header": {
"value": "Example Dialog"
}
},
"key": "deletion-confirmation"
}
],
.....
Then this somewhere in my routes:
app.get('/deletionConfirmationDialog', addon.authenticate(), (req, res) => {
res.render('deletionConfirmationDialog')
})
and then some content inside deletionConfirmationDialog.hbs (simplified though)
<html>
<head>
<script src="{{hostScriptUrl}}" data-options="margin:false" type="text/javascript"></script>
</head>
<body>
<p>Are you sure you want to delete this?</p>
</div>
</body>
</html>
And lastly call from js file:
AP.dialog.create({
key: 'deletion-confirmation',
width: '500px',
height: '200px'
}).on("close", (data) => {
console.log('Closing')
});
Now everything above works but, dialog module docs tells nothing that options is required, just url and key, right? So when i remove options property everything should be fine, but i’m facing an error:
Error: The content resolver threw the following error: Unable to retrieve addon module URL. Please check your specified module key.
I basically removed options from worked example and it breaks, though it shouldn’t or should?
Also is there a way to tell which button was pressed: submit or cancel or i should remove chrome option (as i was trying and faced the error above) and make two of my buttons right inside template?
P.S. it’s quite tedious to make something like delete confirmation dialog or other kinds of similar small dialogs, since nothing except dialog module covers whole page, that’s so unfortunate.
And i got working dialog (i attached all i did for that in first comment).
