mirror of
https://github.com/apache/superset.git
synced 2026-06-03 22:59:21 +00:00
fix: Removes Redux state mutations - iteration 1 (#23522)
This commit is contained in:
committed by
GitHub
parent
ee9ef24509
commit
1ced7cdbbb
@@ -1,5 +1,3 @@
|
||||
import { logging } from '@superset-ui/core';
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
@@ -18,6 +16,8 @@ import { logging } from '@superset-ui/core';
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { logging } from '@superset-ui/core';
|
||||
|
||||
export default function updateComponentParentsList({
|
||||
currentComponent,
|
||||
layout = {},
|
||||
@@ -32,11 +32,14 @@ export default function updateComponentParentsList({
|
||||
|
||||
if (Array.isArray(currentComponent.children)) {
|
||||
currentComponent.children.forEach(childId => {
|
||||
const child = layout[childId];
|
||||
if (child) {
|
||||
child.parents = parentsList; // eslint-disable-line no-param-reassign
|
||||
if (layout[childId]) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
layout[childId] = {
|
||||
...layout[childId],
|
||||
parents: parentsList,
|
||||
};
|
||||
updateComponentParentsList({
|
||||
currentComponent: child,
|
||||
currentComponent: layout[childId],
|
||||
layout,
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user