Skip to content

Commit

Permalink
Fix issue with getting field config for func arg signature object (#1193
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ukrbublik authored Jan 24, 2025
1 parent 27ae61c commit d7b246c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Changelog
- 6.6.12
- Fix issue with getting field config for func arg signature object (PR #1193) (issue #1192)
- 6.6.11
- Fix issue with updating both config & tree value (PR #1190) (issue #1187)
- 6.6.10
Expand Down
5 changes: 4 additions & 1 deletion packages/core/modules/utils/configMemo.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ export const createConfigMemo = (meta = {
if ((configStore.size + 1) > maxSize) {
configStore.delete(configStore.keys().next().value);
}
configStore.set(config, extendedConfig);
// Note: because of desctructing, strict find would not be possible
// (see commented line in `findExtended`)
// (see issue #1187)
configStore.set({...config}, extendedConfig);
};

const findBasic = (findConfig) => {
Expand Down
24 changes: 21 additions & 3 deletions packages/core/modules/utils/configUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,16 @@ export const getFieldSrc = (field) => {
if (!field)
return null;
if (typeof field === "object") {
if (!field.func && !!field.type) {
// should not be possible
// if (field._isFuncArg) {
// // it's func arg
// return null;
// }
// if (field._isFunc) {
// // it's field func
// return "func";
// }
if (!field.func && field.type) {
// it's already a config
return "field";
}
Expand Down Expand Up @@ -267,16 +276,25 @@ export const getFieldConfig = (config, field) => {
if (!field)
return null;
if (typeof field == "object") {
if (!field.func && !!field.type) {
if (!field.func && !!field.type && !!field.widgets) {
// it's already a config
// but don't mess up with obj from `getFuncSignature`, it has `type` but no `widgets` and other keys !
return field;
}
if (field._isFuncArg) {
// it's func arg
return getFuncArgConfig(config, field._funcKey, field._argKey);
}
if (field._isFunc) {
// it's a func
return getFuncConfig(config, field._funcKey);
}
if (field.func) {
if (field.func && field.arg) {
// it's func arg
return getFuncArgConfig(config, field.func, field.arg);
} else {
// it's field func
// it's a func
return getFuncConfig(config, field.func);
}
}
Expand Down

0 comments on commit d7b246c

Please sign in to comment.