fix: sub menu hide (#3168)
This commit is contained in:
parent
4665095372
commit
810ab3294d
@ -34,19 +34,19 @@ const useRelationFields = () => {
|
|||||||
.map((field) => {
|
.map((field) => {
|
||||||
if (['hasOne', 'belongsTo'].includes(field.type)) {
|
if (['hasOne', 'belongsTo'].includes(field.type)) {
|
||||||
return {
|
return {
|
||||||
key: field.name,
|
name: field.name,
|
||||||
type: 'subMenu',
|
type: 'subMenu',
|
||||||
title: field?.uiSchema?.title || field.name,
|
title: field?.uiSchema?.title || field.name,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
key: `${field.name}_details`,
|
name: `${field.name}_details`,
|
||||||
type: 'item',
|
type: 'item',
|
||||||
title: '{{t("Details")}}',
|
title: '{{t("Details")}}',
|
||||||
field,
|
field,
|
||||||
Component: 'RecordReadPrettyAssociationFormBlockInitializer',
|
Component: 'RecordReadPrettyAssociationFormBlockInitializer',
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// key: `${field.name}_form`,
|
// name: `${field.name}_form`,
|
||||||
// type: 'item',
|
// type: 'item',
|
||||||
// title: '{{t("Form")}}',
|
// title: '{{t("Form")}}',
|
||||||
// field,
|
// field,
|
||||||
@ -58,47 +58,47 @@ const useRelationFields = () => {
|
|||||||
|
|
||||||
if (['hasMany', 'belongsToMany'].includes(field.type)) {
|
if (['hasMany', 'belongsToMany'].includes(field.type)) {
|
||||||
return {
|
return {
|
||||||
key: field.name,
|
name: field.name,
|
||||||
type: 'subMenu',
|
type: 'subMenu',
|
||||||
title: field?.uiSchema?.title || field.name,
|
title: field?.uiSchema?.title || field.name,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
key: `${field.name}_table`,
|
name: `${field.name}_table`,
|
||||||
type: 'item',
|
type: 'item',
|
||||||
title: '{{t("Table")}}',
|
title: '{{t("Table")}}',
|
||||||
field,
|
field,
|
||||||
Component: 'RecordAssociationBlockInitializer',
|
Component: 'RecordAssociationBlockInitializer',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: `${field.name}_details`,
|
name: `${field.name}_details`,
|
||||||
type: 'item',
|
type: 'item',
|
||||||
title: '{{t("Details")}}',
|
title: '{{t("Details")}}',
|
||||||
field,
|
field,
|
||||||
Component: 'RecordAssociationDetailsBlockInitializer',
|
Component: 'RecordAssociationDetailsBlockInitializer',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: `${field.name}_list`,
|
name: `${field.name}_list`,
|
||||||
type: 'item',
|
type: 'item',
|
||||||
title: '{{t("List")}}',
|
title: '{{t("List")}}',
|
||||||
field,
|
field,
|
||||||
Component: 'RecordAssociationListBlockInitializer',
|
Component: 'RecordAssociationListBlockInitializer',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: `${field.name}_grid_card`,
|
name: `${field.name}_grid_card`,
|
||||||
type: 'item',
|
type: 'item',
|
||||||
title: '{{t("Grid Card")}}',
|
title: '{{t("Grid Card")}}',
|
||||||
field,
|
field,
|
||||||
Component: 'RecordAssociationGridCardBlockInitializer',
|
Component: 'RecordAssociationGridCardBlockInitializer',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: `${field.name}_form`,
|
name: `${field.name}_form`,
|
||||||
type: 'item',
|
type: 'item',
|
||||||
title: '{{t("Form")}}',
|
title: '{{t("Form")}}',
|
||||||
field,
|
field,
|
||||||
Component: 'RecordAssociationFormBlockInitializer',
|
Component: 'RecordAssociationFormBlockInitializer',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: `${field.name}_calendar`,
|
name: `${field.name}_calendar`,
|
||||||
type: 'item',
|
type: 'item',
|
||||||
title: '{{t("Calendar")}}',
|
title: '{{t("Calendar")}}',
|
||||||
field,
|
field,
|
||||||
@ -109,7 +109,7 @@ const useRelationFields = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
key: field.name,
|
name: field.name,
|
||||||
type: 'item',
|
type: 'item',
|
||||||
field,
|
field,
|
||||||
title: field?.uiSchema?.title || field.name,
|
title: field?.uiSchema?.title || field.name,
|
||||||
@ -125,7 +125,6 @@ const useDetailCollections = (props) => {
|
|||||||
const detailCollections = [
|
const detailCollections = [
|
||||||
{
|
{
|
||||||
name: collection.name,
|
name: collection.name,
|
||||||
key: collection.name,
|
|
||||||
type: 'item',
|
type: 'item',
|
||||||
title: collection?.title || collection.name,
|
title: collection?.title || collection.name,
|
||||||
Component: 'RecordReadPrettyFormBlockInitializer',
|
Component: 'RecordReadPrettyFormBlockInitializer',
|
||||||
@ -137,7 +136,6 @@ const useDetailCollections = (props) => {
|
|||||||
childrenCollections.map((c) => {
|
childrenCollections.map((c) => {
|
||||||
return {
|
return {
|
||||||
name: c.name,
|
name: c.name,
|
||||||
key: c.name,
|
|
||||||
type: 'item',
|
type: 'item',
|
||||||
title: c?.title || c.name,
|
title: c?.title || c.name,
|
||||||
Component: 'RecordReadPrettyFormBlockInitializer',
|
Component: 'RecordReadPrettyFormBlockInitializer',
|
||||||
@ -155,7 +153,6 @@ const useFormCollections = (props) => {
|
|||||||
const formCollections = [
|
const formCollections = [
|
||||||
{
|
{
|
||||||
name: collection.name,
|
name: collection.name,
|
||||||
key: collection.name,
|
|
||||||
type: 'item',
|
type: 'item',
|
||||||
title: collection?.title || collection.name,
|
title: collection?.title || collection.name,
|
||||||
Component: 'RecordFormBlockInitializer',
|
Component: 'RecordFormBlockInitializer',
|
||||||
@ -167,7 +164,6 @@ const useFormCollections = (props) => {
|
|||||||
childrenCollections.map((c) => {
|
childrenCollections.map((c) => {
|
||||||
return {
|
return {
|
||||||
name: c.name,
|
name: c.name,
|
||||||
key: c.name,
|
|
||||||
type: 'item',
|
type: 'item',
|
||||||
title: c?.title || c.name,
|
title: c?.title || c.name,
|
||||||
Component: 'RecordFormBlockInitializer',
|
Component: 'RecordFormBlockInitializer',
|
||||||
|
Loading…
Reference in New Issue
Block a user