mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 16:15:44 +00:00
refactor: association schemaInitialize
This commit is contained in:
parent
4110601d8b
commit
2b5a566e58
@ -65,7 +65,6 @@ const InternalFileManager = (props) => {
|
||||
const [selectedRows, setSelectedRows] = useState([]);
|
||||
const insertSelector = useInsertSchema('Selector');
|
||||
const fieldNames = useFieldNames(props);
|
||||
console.log(fieldNames)
|
||||
const field: any = useField();
|
||||
const [options, setOptions] = useState([]);
|
||||
const { getField } = useCollection();
|
||||
@ -180,7 +179,6 @@ const FileManageReadPretty = connect((props) => {
|
||||
const field: any = useField();
|
||||
const { getField } = useCollection();
|
||||
const collectionField = getField(field.props.name);
|
||||
console.log(props)
|
||||
return collectionField ? <Preview {...props} /> : null;
|
||||
});
|
||||
|
||||
|
@ -15,8 +15,7 @@ export const ReadPretty = (props) => {
|
||||
const { getCollection } = useCollectionManager();
|
||||
const collectionField = getField(field.props.name);
|
||||
const isFileCollection = getCollection(collectionField?.target).template === 'file';
|
||||
const [currentMode, setCurrentMode] = useState(props.mode || isFileCollection ? 'FileManager' : 'Select');
|
||||
console.log(props)
|
||||
const [currentMode, setCurrentMode] = useState(props.mode || (isFileCollection ? 'FileManager' : 'Select'));
|
||||
useEffect(() => {
|
||||
props.mode && setCurrentMode(props.mode);
|
||||
}, [props.mode]);
|
||||
|
Loading…
Reference in New Issue
Block a user