Allow custom components in cloud
This commit is contained in:
parent
917ce9e177
commit
7bee35f816
|
@ -33,26 +33,23 @@ exports.fetchAppComponentDefinitions = async function (ctx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// for now custom components only supported in self-host
|
// Add custom components
|
||||||
if (env.SELF_HOSTED) {
|
const globalDB = getGlobalDB()
|
||||||
// Add custom components
|
const response = await globalDB.allDocs(
|
||||||
const globalDB = getGlobalDB()
|
getPluginParams(null, {
|
||||||
const response = await globalDB.allDocs(
|
include_docs: true,
|
||||||
getPluginParams(null, {
|
})
|
||||||
include_docs: true,
|
)
|
||||||
})
|
response.rows
|
||||||
)
|
.map(row => row.doc)
|
||||||
response.rows
|
.filter(plugin => plugin.schema.type === "component")
|
||||||
.map(row => row.doc)
|
.forEach(plugin => {
|
||||||
.filter(plugin => plugin.schema.type === "component")
|
const fullComponentName = `plugin/${plugin.name}`
|
||||||
.forEach(plugin => {
|
definitions[fullComponentName] = {
|
||||||
const fullComponentName = `plugin/${plugin.name}`
|
component: fullComponentName,
|
||||||
definitions[fullComponentName] = {
|
...plugin.schema.schema,
|
||||||
component: fullComponentName,
|
}
|
||||||
...plugin.schema.schema,
|
})
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.body = definitions
|
ctx.body = definitions
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in New Issue