浏览代码

HUE-7757 [dashboard] Text label for older saved dashboard

jdesjean 7 年之前
父节点
当前提交
7b75742
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      desktop/libs/dashboard/src/dashboard/models.py

+ 5 - 2
desktop/libs/dashboard/src/dashboard/models.py

@@ -139,8 +139,11 @@ class Collection2(object):
         properties['domain'] = {'blockParent': [], 'blockChildren': []}
       if 'missing' not in properties:
         properties['missing'] = False
-      if 'fieldLabel' not in properties:
-        properties['fieldLabel'] = None
+
+      if properties.get('facets'):
+        for facet_facet in properties['facets']:
+          if 'fieldLabel' not in facet_facet:
+            facet_facet['fieldLabel'] = facet_facet['field']
 
       if facet['widgetType'] == 'histogram-widget':
         if 'timelineChartType' not in properties: