Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nocobase
Commits
e51feafe
Unverified
Commit
e51feafe
authored
3 years ago
by
金昶
Committed by
GitHub
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
fix(client): select component cannot be opened in sub-table block (#431)
parent
9a64384b
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/core/client/src/collection-manager/Configuration/AddFieldAction.tsx
+18
-0
...t/src/collection-manager/Configuration/AddFieldAction.tsx
packages/core/client/src/collection-manager/Configuration/EditFieldAction.tsx
+19
-0
.../src/collection-manager/Configuration/EditFieldAction.tsx
with
37 additions
and
0 deletions
+37
-0
packages/core/client/src/collection-manager/Configuration/AddFieldAction.tsx
+
18
-
0
View file @
e51feafe
...
...
@@ -94,6 +94,24 @@ const useCreateCollectionField = () => {
}),
);
}
function
recursiveChildren
(
children
=
[],
prefix
=
'
children
'
)
{
children
.
forEach
((
item
,
index
)
=>
{
const
itemOptions
=
item
.
uiSchema
?.
enum
?.
slice
()
||
[];
form
.
setValuesIn
(
`
${
prefix
}
[
${
index
}
].uiSchema.enum`
,
itemOptions
.
map
((
option
)
=>
{
return
{
value
:
uid
(),
...
option
,
};
}),
);
recursiveChildren
(
item
.
children
,
`
${
prefix
}
[
${
index
}
].children`
);
});
}
recursiveChildren
(
form
?.
values
?.
children
);
if
(
form
?.
values
?.
interface
===
'
linkTo
'
&&
title
)
{
form
.
setValuesIn
(
'
reverseField.uiSchema.title
'
,
title
);
}
...
...
This diff is collapsed.
Click to expand it.
packages/core/client/src/collection-manager/Configuration/EditFieldAction.tsx
+
19
-
0
View file @
e51feafe
...
...
@@ -83,6 +83,25 @@ const useUpdateCollectionField = () => {
};
}),
);
function
recursiveChildren
(
children
=
[],
prefix
=
'
children
'
)
{
children
.
forEach
((
item
,
index
)
=>
{
const
itemOptions
=
item
.
uiSchema
?.
enum
?.
slice
()
||
[];
form
.
setValuesIn
(
`
${
prefix
}
[
${
index
}
].uiSchema.enum`
,
itemOptions
.
map
((
option
)
=>
{
return
{
value
:
uid
(),
...
option
,
};
}),
);
recursiveChildren
(
item
.
children
,
`
${
prefix
}
[
${
index
}
].children`
);
});
}
recursiveChildren
(
form
?.
values
?.
children
);
await
run
();
await
refreshCM
();
},
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help