mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-08 06:59:26 +08:00
fix(plugin-workflow-aggregate): limit aggregate instruction to only work on db data source (#5033)
This commit is contained in:
parent
70bb95bcaf
commit
65ec69cc62
@ -238,6 +238,11 @@ export default class extends Instruction {
|
|||||||
required: true,
|
required: true,
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'DataSourceCollectionCascader',
|
'x-component': 'DataSourceCollectionCascader',
|
||||||
|
'x-component-props': {
|
||||||
|
dataSourceFilter(datasource) {
|
||||||
|
return datasource.key === 'main' || datasource.options.isDBInstance;
|
||||||
|
},
|
||||||
|
},
|
||||||
title: `{{t("Data of collection", { ns: "${NAMESPACE}" })}}`,
|
title: `{{t("Data of collection", { ns: "${NAMESPACE}" })}}`,
|
||||||
'x-reactions': [
|
'x-reactions': [
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,10 @@ export default class extends Instruction {
|
|||||||
const options = processor.getParsedValue(params, node.id);
|
const options = processor.getParsedValue(params, node.id);
|
||||||
const [dataSourceName, collectionName] = parseCollectionName(collection);
|
const [dataSourceName, collectionName] = parseCollectionName(collection);
|
||||||
const { collectionManager } = this.workflow.app.dataSourceManager.dataSources.get(dataSourceName);
|
const { collectionManager } = this.workflow.app.dataSourceManager.dataSources.get(dataSourceName);
|
||||||
|
// @ts-ignore
|
||||||
|
if (!collectionManager.db) {
|
||||||
|
throw new Error('aggregate instruction can only work with data source of type database');
|
||||||
|
}
|
||||||
const repo = associated
|
const repo = associated
|
||||||
? collectionManager.getRepository(
|
? collectionManager.getRepository(
|
||||||
`${association?.associatedCollection}.${association.name}`,
|
`${association?.associatedCollection}.${association.name}`,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user