This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 0d4137d  Add translatable columns in label_columns of the view (#3032)
0d4137d is described below

commit 0d4137d21ef04626b5ed5fc93d279f3c7b2a574e
Author: Rogan <quang...@gmail.com>
AuthorDate: Fri Aug 11 13:28:06 2017 +0800

    Add translatable columns in label_columns of the view (#3032)
    
    * add translatable columns in label_columns of the view
    
    * display the verbose_name of columns in list view, just like in the 
metrics list
    
    * Revert "display the verbose_name of columns in list view, just like in 
the metrics list"
    
    This reverts commit f815d3b3ede4e691f4adcbb51654940e8572ad10.
---
 superset/connectors/sqla/views.py | 14 ++++++++++----
 superset/views/core.py            |  7 ++++++-
 superset/views/sql_lab.py         | 17 +++++++++++++++++
 3 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/superset/connectors/sqla/views.py 
b/superset/connectors/sqla/views.py
index 6c9b233..21529b1 100644
--- a/superset/connectors/sqla/views.py
+++ b/superset/connectors/sqla/views.py
@@ -91,7 +91,8 @@ class TableColumnInlineView(CompactCRUDMixin, 
SupersetModelView):  # noqa
         'expression': _("Expression"),
         'is_dttm': _("Is temporal"),
         'python_date_format': _("Datetime Format"),
-        'database_expression': _("Database Expression")
+        'database_expression': _("Database Expression"),
+        'type': _('Type'),
     }
 appbuilder.add_view_no_menu(TableColumnInlineView)
 
@@ -133,6 +134,8 @@ class SqlMetricInlineView(CompactCRUDMixin, 
SupersetModelView):  # noqa
         'metric_type': _("Type"),
         'expression': _("SQL Expression"),
         'table': _("Table"),
+        'd3format': _("D3 Format"),
+        'is_restricted': _('Is Restricted')
     }
 
     def post_add(self, metric):
@@ -216,11 +219,14 @@ class TableModelView(DatasourceModelView, DeleteMixin):  
# noqa
         'changed_on_': _("Last Changed"),
         'filter_select_enabled': _("Enable Filter Select"),
         'schema': _("Schema"),
-        'default_endpoint': _(
-            "Redirects to this endpoint when clicking on the datasource "
-            "from the datasource list"),
+        'default_endpoint': _('Default Endpoint'),
         'offset': _("Offset"),
         'cache_timeout': _("Cache Timeout"),
+        'table_name': _("Table Name"),
+        'fetch_values_predicate': _('Fetch Values Predicate'),
+        'owner': _("Owner"),
+        'main_dttm_col': _("Main Datetime Column"),
+        'description': _('Description'),
     }
 
     def pre_add(self, table):
diff --git a/superset/views/core.py b/superset/views/core.py
index 83acd8a..67b353a 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -247,6 +247,8 @@ class DatabaseView(SupersetModelView, DeleteMixin):  # noqa
         'sqlalchemy_uri': _("SQLAlchemy URI"),
         'cache_timeout': _("Cache Timeout"),
         'extra': _("Extra"),
+        'allow_run_sync': _("Allow Run Sync"),
+        'allow_run_async': _("Allow Run Async"),
     }
 
     def pre_add(self, db):
@@ -333,7 +335,7 @@ class SliceModelView(SupersetModelView, DeleteMixin):  # 
noqa
 
     can_add = False
     label_columns = {
-        'datasource_link': 'Datasource',
+        'datasource_link': _('Datasource'),
     }
     search_columns = (
         'slice_name', 'description', 'viz_type', 'owners',
@@ -2307,6 +2309,9 @@ class CssTemplateModelView(SupersetModelView, 
DeleteMixin):
     list_columns = ['template_name']
     edit_columns = ['template_name', 'css']
     add_columns = edit_columns
+    label_columns = {
+        'template_name': _('Template Name'),
+    }
 
 
 class CssTemplateAsyncModelView(CssTemplateModelView):
diff --git a/superset/views/sql_lab.py b/superset/views/sql_lab.py
index 03f382e..eea71d4 100644
--- a/superset/views/sql_lab.py
+++ b/superset/views/sql_lab.py
@@ -14,6 +14,13 @@ from .base import SupersetModelView, BaseSupersetView, 
DeleteMixin
 class QueryView(SupersetModelView):
     datamodel = SQLAInterface(Query)
     list_columns = ['user', 'database', 'status', 'start_time', 'end_time']
+    label_columns = {
+        'user': _('User'),
+        'database': _('Database'),
+        'status': _('Status'),
+        'start_time': _('Start Time'),
+        'end_time': _('End Time'),
+    }
 
 appbuilder.add_view(
     QueryView,
@@ -42,6 +49,16 @@ class SavedQueryView(SupersetModelView, DeleteMixin):
     add_columns = ['label', 'database', 'description', 'sql']
     edit_columns = add_columns
     base_order = ('changed_on', 'desc')
+    label_columns = {
+        'label': _('Label'),
+        'user': _('User'),
+        'database': _('Database'),
+        'description': _('Description'),
+        'modified': _('Modified'),
+        'end_time': _('End Time'),
+        'pop_tab_link': _('Pop Tab Link'),
+        'changed_on': _('Changed on'),
+    }
 
     def pre_add(self, obj):
         obj.user = g.user

-- 
To stop receiving notification emails like this one, please contact
['"comm...@superset.apache.org" <comm...@superset.apache.org>'].

Reply via email to