mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 01:56:16 +00:00
fix(data-vi): fix incorrect data source context when multiple data sources exist (#5237)
Some checks are pending
auto-merge / push-commit (push) Waiting to run
Build Docker Image / build-and-push (push) Waiting to run
Build Pro Image / build-and-push (push) Waiting to run
deploy client docs / Build (push) Waiting to run
E2E / Build (push) Waiting to run
E2E / Core and plugins (push) Blocked by required conditions
E2E / plugin-workflow (push) Blocked by required conditions
E2E / plugin-workflow-approval (push) Blocked by required conditions
E2E / plugin-data-source-main (push) Blocked by required conditions
E2E / Comment on PR (push) Blocked by required conditions
NocoBase FrontEnd Test / frontend-test (18) (push) Waiting to run
Some checks are pending
auto-merge / push-commit (push) Waiting to run
Build Docker Image / build-and-push (push) Waiting to run
Build Pro Image / build-and-push (push) Waiting to run
deploy client docs / Build (push) Waiting to run
E2E / Build (push) Waiting to run
E2E / Core and plugins (push) Blocked by required conditions
E2E / plugin-workflow (push) Blocked by required conditions
E2E / plugin-workflow-approval (push) Blocked by required conditions
E2E / plugin-data-source-main (push) Blocked by required conditions
E2E / Comment on PR (push) Blocked by required conditions
NocoBase FrontEnd Test / frontend-test (18) (push) Waiting to run
This commit is contained in:
parent
4399856eae
commit
011bba4529
@ -215,6 +215,7 @@ export const querySchema: ISchema = {
|
||||
'x-component-props': {
|
||||
onChange: '{{ onCollectionChange }}',
|
||||
placeholder: '{{t("Collection")}}',
|
||||
showSearch: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -41,9 +41,10 @@ export type FieldOption = {
|
||||
|
||||
export const useChartDataSource = (dataSource?: string) => {
|
||||
const { current } = useContext(ChartConfigContext);
|
||||
const { dataSource: _dataSource = dataSource || DEFAULT_DATA_SOURCE_KEY, collection } = current || {};
|
||||
const { dataSource: currentDataSource, collection } = current || {};
|
||||
dataSource = dataSource || currentDataSource || DEFAULT_DATA_SOURCE_KEY;
|
||||
const dm = useDataSourceManager();
|
||||
const ds = dm.getDataSource(_dataSource);
|
||||
const ds = dm.getDataSource(dataSource);
|
||||
const fim = dm.collectionFieldInterfaceManager;
|
||||
const cm = ds?.collectionManager;
|
||||
return { cm, fim, collection };
|
||||
|
Loading…
Reference in New Issue
Block a user