refactor: sub-table acl ignore (#2259)

This commit is contained in:
katherinehhh 2023-07-25 14:01:54 +08:00 committed by GitHub
parent 137e3eb171
commit 1f8e0284fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -233,7 +233,10 @@ export const useACLFieldWhitelist = () => {
.concat(params?.appends || []); .concat(params?.appends || []);
return { return {
whitelist, whitelist,
schemaInWhitelist(fieldSchema: Schema) { schemaInWhitelist(fieldSchema: Schema, isSkip?) {
if (isSkip) {
return true;
}
if (whitelist.length === 0) { if (whitelist.length === 0) {
return true; return true;
} }

View File

@ -97,6 +97,7 @@ export const SubTable: any = observer(
</Button> </Button>
) )
} }
isSubTable={true}
/> />
</div> </div>
); );

View File

@ -37,7 +37,7 @@ const useTableColumns = (props) => {
const { exists, render } = useSchemaInitializer(schema['x-initializer']); const { exists, render } = useSchemaInitializer(schema['x-initializer']);
const columns = schema const columns = schema
.reduceProperties((buf, s) => { .reduceProperties((buf, s) => {
if (isColumnComponent(s) && schemaInWhitelist(Object.values(s.properties || {}).pop())) { if (isColumnComponent(s) && schemaInWhitelist(Object.values(s.properties || {}).pop(), props?.isSubTable)) {
return buf.concat([s]); return buf.concat([s]);
} }
return buf; return buf;