open-hand / choerodon-ui

An enterprise UI framework and react-based implementation.
http://choerodon.io
MIT License
316 stars 140 forks source link

Error on names between parent and child dataset? #1480

Closed Mahoo12138 closed 1 year ago

Mahoo12138 commented 1 year ago

https://github.com/open-hand/choerodon-ui/blob/e0f2c94ccdfe1776c127c5d6a6f9f59706d630a1/components-dataset/data-set/DataSet.tsx#L2843-L2867

Look the tenth line of bind(...) function above, name is used as the key for the children of parent dataset, but the code comment show that name is the name of the parent dataset, it's illogical.

And we can presume from syncChild that name should be the name of the child dataset: https://github.com/open-hand/choerodon-ui/blob/e0f2c94ccdfe1776c127c5d6a6f9f59706d630a1/components-dataset/data-set/DataSet.tsx#L3438-L3444

Huihuawk commented 1 year ago
 ds.children[name] = this; 
 this.parent = ds; 
 this.parentName = name;