refactor: hook name should start with 'use'
This commit is contained in:
parent
fe652bf6e8
commit
bc25467027
@ -19,7 +19,7 @@ export const TableBlockDesigner = () => {
|
|||||||
const sortFields = useSortFields(name);
|
const sortFields = useSortFields(name);
|
||||||
const { service } = useTableBlockContext();
|
const { service } = useTableBlockContext();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { dn, refresh } = useDesignable();
|
const { dn } = useDesignable();
|
||||||
const defaultFilter = fieldSchema?.['x-decorator-props']?.params?.filter || {};
|
const defaultFilter = fieldSchema?.['x-decorator-props']?.params?.filter || {};
|
||||||
const defaultSort = fieldSchema?.['x-decorator-props']?.params?.sort || [];
|
const defaultSort = fieldSchema?.['x-decorator-props']?.params?.sort || [];
|
||||||
const defaultResource = fieldSchema?.['x-decorator-props']?.resource;
|
const defaultResource = fieldSchema?.['x-decorator-props']?.resource;
|
||||||
|
@ -19,9 +19,9 @@ const supportsType = [
|
|||||||
'multipleSelect',
|
'multipleSelect',
|
||||||
'oho',
|
'oho',
|
||||||
'obo',
|
'obo',
|
||||||
'm2o'
|
'm2o',
|
||||||
];
|
];
|
||||||
const VariableTypes = (currentCollection) => {
|
const useVariableTypes = (currentCollection) => {
|
||||||
const { getCollectionFields, getInterface, getCollection } = useCollectionManager();
|
const { getCollectionFields, getInterface, getCollection } = useCollectionManager();
|
||||||
const collection = getCollection(currentCollection);
|
const collection = getCollection(currentCollection);
|
||||||
const fields = getCollectionFields(currentCollection);
|
const fields = getCollectionFields(currentCollection);
|
||||||
@ -91,7 +91,7 @@ const VariableTypes = (currentCollection) => {
|
|||||||
|
|
||||||
export function useVariableOptions(collectionName) {
|
export function useVariableOptions(collectionName) {
|
||||||
const compile = useCompile();
|
const compile = useCompile();
|
||||||
const options = VariableTypes(collectionName).map((item: any) => {
|
const options = useVariableTypes(collectionName).map((item) => {
|
||||||
const options = typeof item.options === 'function' ? item.options() : item.options;
|
const options = typeof item.options === 'function' ? item.options() : item.options;
|
||||||
return {
|
return {
|
||||||
label: compile(item.title),
|
label: compile(item.title),
|
||||||
|
Loading…
Reference in New Issue
Block a user