fix: source field type filtering association fields in sql collection & view collection (#5014)
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

* fix: source field type filtering relationship fields in sql collection and view collection

* fix: bug

* fix: bug
This commit is contained in:
Katherine 2024-08-08 15:52:06 +08:00 committed by GitHub
parent bd573b6ee2
commit cd5d48eb80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -69,7 +69,7 @@ const PreviewCom = (props) => {
};
});
const children = collection.fields
.filter((v) => !['hasOne', 'hasMany', 'belongsToMany'].includes(v?.type))
.filter((v) => !['obo', 'oho', 'm2m', 'o2m'].includes(v?.interface))
?.map((v) => {
return { value: v.name, key: v.name, label: t(v.uiSchema?.title || v.name) };
})

View File

@ -68,11 +68,12 @@ const useSourceFieldsOptions = () => {
return;
}
const children = (collection.fields as FieldOptions[])
.filter((v) => !['hasOne', 'hasMany', 'belongsToMany'].includes(v?.type))
.filter((v) => {
return !['hasOne', 'hasMany', 'belongsToMany', 'belongsTo'].includes(v?.type);
})
?.map((v) => {
return { value: v.name, label: t(v.uiSchema?.title) };
});
data.push({
value: item,
label: t(collection.title),
@ -110,7 +111,6 @@ export const FieldsConfigure = observer(
[compile],
);
const sourceFieldsOptions = useSourceFieldsOptions();
const refGetInterface = useRef(getInterface);
useEffect(() => {
const fieldsMp = new Map();