Skip to content

Commit

Permalink
Merge pull request #147 from alison985/130_modify_toggle_string_to_pe…
Browse files Browse the repository at this point in the history
…r_data_source

130 modify toggle string to per data source
  • Loading branch information
alison985 authored Jul 25, 2017
2 parents 2d5c413 + 8055689 commit 45aa946
Show file tree
Hide file tree
Showing 33 changed files with 184 additions and 3 deletions.
3 changes: 2 additions & 1 deletion client/app/pages/queries/schema-browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

<button class="btn btn-default"
title="Toggle Versioned Tables"
ng-click="$ctrl.flipToggleVersionedTables($ctrl.versionToggle)">
ng-click="$ctrl.flipToggleVersionedTables($ctrl.versionToggle)"
ng-if="dataSource.options.toggle_table_string != ''">
<span class="fa " ng-class="{'fa-toggle-on': $ctrl.versionToggle == true, 'fa-toggle-off': !$ctrl.versionToggle}">
<input type="checkbox" id="versioned-tables-toggle" ng-model="$ctrl.versionToggle" hidden/>
</span>
Expand Down
2 changes: 1 addition & 1 deletion client/app/pages/queries/schema-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function SchemaBrowserCtrl($scope) {
this.flipToggleVersionedTables = (versionToggle) => {
if (versionToggle === false) {
this.versionToggle = true;
this.versionFilter = '_v';
this.versionFilter = $scope.dataSource.options.toggle_table_string;
} else {
this.versionToggle = false;
this.versionFilter = 'abcdefghijklmnop';
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/activedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": "https://github.com/klahnakoski/ActiveData/tree/dev/docs"
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
"required": ["host_url"]
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/athena.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ def configuration_schema(cls):
'type': 'string',
'title': 'Schema Name',
'default': 'default'
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
'required': ['region', 's3_staging_dir'],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/axibase_tsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ def configuration_schema(cls):
'trust_certificate': {
'type': 'boolean',
'title': 'Trust SSL Certificate'
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
'required': ['username', 'password', 'hostname', 'protocol', 'port'],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/big_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ def configuration_schema(cls):
'maximumBillingTier': {
"type": "number",
"title": "Maximum Billing Tier"
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
'required': ['jsonKeyFile', 'projectId'],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/cass.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ def configuration_schema(cls):
'type': 'number',
'title': 'Protocol Version',
'default': 3
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
'required': ['keyspace', 'host']
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ def configuration_schema(cls):
"dbname": {
"type": "string",
"title": "Database Name"
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
"required": ["dbname"],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/dynamodb_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
"required": ["access_key", "secret_key"],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
"secret": ["basic_auth_password"],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/google_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ def configuration_schema(cls):
'jsonKeyFile': {
"type": "string",
'title': 'JSON Key File'
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
'required': ['jsonKeyFile'],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/google_spreadsheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
'required': ['jsonKeyFile'],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/graphite.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
'required': ['url'],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/hive_ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
"required": ["host"]
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/impala_ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
"required": ["host"],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/influx_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
'required': ['url']
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/jql.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
'required': ['url', 'username', 'password'],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/memsql_ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ def configuration_schema(cls):
},
"password": {
"type": "string"
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}

},
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
'required': ['connectionString', 'dbName']
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/mssql.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
"required": ["db"],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ def configuration_schema(cls):
'port': {
'type': 'number',
'default': 3306,
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
"order": ['host', 'port', 'user', 'passwd', 'db'],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
"required": ["servicename", "user", "password", "host", "port"],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
"order": ['host', 'port', 'user', 'password'],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/presto.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
'required': ['host']
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
}
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/salesforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ def configuration_schema(cls):
},
"sandbox": {
"type": "boolean"
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
"required": ["username", "password", "token"],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
'required': ['path']
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ def configuration_schema(cls):
},
"database": {
"type": "string"
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
"required": ["user", "password", "account", "database", "warehouse"],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
"required": ["dbpath"],
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/treasuredata.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
},
'required': ['apikey','db']
Expand Down
6 changes: 6 additions & 0 deletions redash/query_runner/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ def configuration_schema(cls):
"type": "string",
"title": "Documentation URL",
"default": cls.default_doc_url
},
"toggle_table_string": {
"type": "string",
"title": "Toggle Table String",
"default": "_v",
"info": "This string will be used to toggle visibility of tables in the schema browser when editing a query in order to remove non-useful tables from sight."
}
}
}
Expand Down
Loading

0 comments on commit 45aa946

Please sign in to comment.