Hi,
I have created a plugin which uses a web panel within the view issue screen, and within this web panel a RESTful table should display. However, for some reason the JavaScript resource doesn’t seem to be loaded.
My web panel and main-resources are defined in the atlassian-plugin.xml as follows:
<web-resource key="main_resources" name="Main Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<dependency>com.atlassian.auiplugin:aui-experimental-restfultable</dependency>
<context>main-resources</context>
</web-resource>
<web-panel name="Steps" key="steps" location="atl.jira.view.issue.left.context" weight="400">
<description key="steps.description">Steps</description>
<resource name="view" type="velocity" location="/templates/steps.vm"/>
<resource type="download" name="steps.js" location="/js/steps.js"/>
</web-panel>
The velocity template file, steps.vm is as follows:
$webResourceManager.requireResourcesForContext("main-resources")
<div>
<table id="steps-table"></table>
</div>
The JavaScript file, steps.js is as follows:
AJS.toInit(function() {
// Basic Parameters
new AJS.RestfulTable({
autoFocus: true,
el: jQuery("#steps-table"),
allowReorder: true,
noEntriesMsg: "Please add a Step.",
resources: {
all: "/rest/myplugin/1.0/step",
self: "/rest/myplugin/1.0/step"
},
columns: [
{
id: "id",
header: "Id",
allowEdit: false
},
{
id: "num",
header: "#"
},
{
id: "name",
header: "Name"
},
{
id: "description",
header: "Description"
}
]
});
});
Looking at the developer tools in the browser, for the console I see no errors and I see that the ‘main-resources’ seem to be loaded. When looking at the network and the JS files that are loaded I don’t see the ‘steps.js’ resource at all. The path to the ‘steps.js’ file is 100% correct.
Does anyone have any idea whats going wrong here?