在合流插件上创建自定义内容时出错
问题描述:
今天我试图为我的公司创建一个合流插件,我试着遵循atlassian documents。在合流插件上创建自定义内容时出错
我的问题是在运行npm start
后,向atlassian-connect.json添加一个新的customContent时运行快速应用程序出现以下错误。
Failed to register with host https://admin:[email protected]/wiki (200)
{"type":"INSTALL","pingAfter":300,"status":{"done":true,"statusCode":200,"con
tentType":"application/vnd.atl.plugins.task.install.err+json","subCode":"upm.
pluginInstall.error.descriptor.not.from.marketplace","source":"https://1a0adc
8f.ngrok.io/atlassian-connect.json","name":"https://1a0adc8f.ngrok.io/atlassi
an-connect.json"},"links":{"self":"/wiki/rest/plugins/1.0/pending/b88594d3-c3
c2-4760-b687-c8d860c0a377","alternate":"/wiki/rest/plugins/1.0/tasks/b88594d3
-c3c2-4760-b687-c8d860c0a377"},"timestamp":1502272147602,"userKey":"xxx","id":"xxx"}
Add-on not registered; no compatible hosts detected
这是我Atlassian的-connect.json文件:
{
"key": "my-add-on",
"name": "Ping Pong",
"description": "My very first add-on",
"vendor": {
"name": "Angry Nerds",
"url": "https://www.atlassian.com/angrynerds"
},
"baseUrl": "{{localBaseUrl}}",
"links": {
"self": "{{localBaseUrl}}/atlassian-connect.json",
"homepage": "{{localBaseUrl}}/atlassian-connect.json"
},
"authentication": {
"type": "jwt"
},
"lifecycle": {
"installed": "/installed"
},
"scopes": [
"READ"
],
"modules": {
"generalPages": [
{
"key": "hello-world-page-jira",
"location": "system.top.navigation.bar",
"name": {
"value": "Hello World"
},
"url": "/hello-world",
"conditions": [{
"condition": "user_is_logged_in"
}]
},
{
"key": "customersViewer",
"location": "system.header/left",
"name": {
"value": "Hello World"
},
"url": "/hello-world",
"conditions": [{
"condition": "user_is_logged_in"
}]
}
],
"customContent": [
{
"key": "customer",
"name": {
"value": "Customers"
},
"uiSupport": {
"contentViewComponent": {
"moduleKey": "customersViewer"
},
"listViewComponent": {
"moduleKey": "customerList"
},
"icons": {
"item": {
"url": "/images/customers.png"
}
}
},
"apiSupport": {
"supportedContainerTypes": ["space"]
}
}
]
}
}
有谁有什么事的想法?
答
contentViewComponent无法找到它在moduleKey中引用的generalPage。
从文档:
在上面的片段中,moduleKey“customersViewer”映射到我们已经在插件上定义的 generalPage模块。此通用页面是 传递了我们指定的上下文参数,并相应地将我们的内容 可视化。
如果您将密钥hello-world-page-confluence
的generalPage更改为customersViewer
,则可以安装并启动并运行。
+0
感谢您的回答,可悲的是这并不适合我,我更新了atlassian-connect.json文件和原始文章中的错误,我又做了什么错误? – nicowernli
我认为这里的问题是你没有在Confluence的管理加载项设置中启用开发模式。 'https:// [your_domain] .atlassian.net/wiki/plugins/servlet/upm'>点击“设置”并选中“启用开发模式” – rorschach