From 94c386e7aa6189529ec1c2861e1dbdf99af4d788 Mon Sep 17 00:00:00 2001 From: chenos Date: Mon, 28 Dec 2020 11:11:49 +0800 Subject: [PATCH] fix: use simple table for the association tab view --- .../components/pages/CollectionLoader/CollectionTabPane.tsx | 1 + packages/app/src/components/views/index.tsx | 6 +++++- packages/plugin-pages/src/actions/getView.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/app/src/components/pages/CollectionLoader/CollectionTabPane.tsx b/packages/app/src/components/pages/CollectionLoader/CollectionTabPane.tsx index d09ff5120c..573745c70a 100644 --- a/packages/app/src/components/pages/CollectionLoader/CollectionTabPane.tsx +++ b/packages/app/src/components/pages/CollectionLoader/CollectionTabPane.tsx @@ -29,6 +29,7 @@ export function CollectionTabPane(props) { diff --git a/packages/app/src/components/views/index.tsx b/packages/app/src/components/views/index.tsx index ff4f4a8795..22b509971d 100644 --- a/packages/app/src/components/views/index.tsx +++ b/packages/app/src/components/views/index.tsx @@ -49,6 +49,7 @@ export default function ViewFactory(props: ViewProps) { viewName, mode, reference, + isAssociationView = false, } = props; console.log('propspropspropspropspropspropsprops', props); const { data = {}, loading } = useRequest(() => { @@ -67,7 +68,10 @@ export default function ViewFactory(props: ViewProps) { if (loading) { return ; } - const { template } = data; + let { template } = data; + if (isAssociationView && template === 'Table') { + template = 'SimpleTable'; + } const Template = getViewTemplate(template); return Template &&