修复view 中解析配置的schema,columns -》 name的问题 #1825
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
我发现在1.0.0-beta.3中,保存view的时候,列的信息中 columns -》 name 的值是字符串来的,但是到了1.0.0-beta.4 中 columns -》 name 的值是数组来的,然后这部分DataProviderServiceImpl#parseSchema 在 1.0.0-beta.4 版本去执行之前 版本所保存的view,关联的datachart图就会报解析错误了,因为之前的代码解析是默认将name当做数组解析了,所以导致name为字符串的时候就报错了。
我修改的代码就是判断一下类型,是数组的才用数组解析,否则都获取字符串对象
具体的报错信息如下:
目前这个影响的主要是解析parseSchema 这里,应该不影响界面功能,不过好像聚合那里用到schema,可能会影响聚合
麻烦大佬有空的时候,帮忙code review一下代码了