Skip to content

Commit 45aa946

Browse files
authored
Merge pull request #147 from alison985/130_modify_toggle_string_to_per_data_source
130 modify toggle string to per data source
2 parents 2d5c413 + 8055689 commit 45aa946

33 files changed

+184
-3
lines changed

client/app/pages/queries/schema-browser.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
<button class="btn btn-default"
1111
title="Toggle Versioned Tables"
12-
ng-click="$ctrl.flipToggleVersionedTables($ctrl.versionToggle)">
12+
ng-click="$ctrl.flipToggleVersionedTables($ctrl.versionToggle)"
13+
ng-if="dataSource.options.toggle_table_string != ''">
1314
<span class="fa " ng-class="{'fa-toggle-on': $ctrl.versionToggle == true, 'fa-toggle-off': !$ctrl.versionToggle}">
1415
<input type="checkbox" id="versioned-tables-toggle" ng-model="$ctrl.versionToggle" hidden/>
1516
</span>

client/app/pages/queries/schema-browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function SchemaBrowserCtrl($scope) {
2424
this.flipToggleVersionedTables = (versionToggle) => {
2525
if (versionToggle === false) {
2626
this.versionToggle = true;
27-
this.versionFilter = '_v';
27+
this.versionFilter = $scope.dataSource.options.toggle_table_string;
2828
} else {
2929
this.versionToggle = false;
3030
this.versionFilter = 'abcdefghijklmnop';

redash/query_runner/activedata.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ def configuration_schema(cls):
4141
"type": "string",
4242
"title": "Documentation URL",
4343
"default": "https://github.com/klahnakoski/ActiveData/tree/dev/docs"
44+
},
45+
"toggle_table_string": {
46+
"type": "string",
47+
"title": "Toggle Table String",
48+
"default": "_v",
49+
"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."
4450
}
4551
},
4652
"required": ["host_url"]

redash/query_runner/athena.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ def configuration_schema(cls):
8181
'type': 'string',
8282
'title': 'Schema Name',
8383
'default': 'default'
84+
},
85+
"toggle_table_string": {
86+
"type": "string",
87+
"title": "Toggle Table String",
88+
"default": "_v",
89+
"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."
8490
}
8591
},
8692
'required': ['region', 's3_staging_dir'],

redash/query_runner/axibase_tsd.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ def configuration_schema(cls):
133133
'trust_certificate': {
134134
'type': 'boolean',
135135
'title': 'Trust SSL Certificate'
136+
},
137+
"toggle_table_string": {
138+
"type": "string",
139+
"title": "Toggle Table String",
140+
"default": "_v",
141+
"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."
136142
}
137143
},
138144
'required': ['username', 'password', 'hostname', 'protocol', 'port'],

redash/query_runner/big_query.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ def configuration_schema(cls):
123123
'maximumBillingTier': {
124124
"type": "number",
125125
"title": "Maximum Billing Tier"
126+
},
127+
"toggle_table_string": {
128+
"type": "string",
129+
"title": "Toggle Table String",
130+
"default": "_v",
131+
"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."
126132
}
127133
},
128134
'required': ['jsonKeyFile', 'projectId'],

redash/query_runner/cass.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ def configuration_schema(cls):
6363
'type': 'number',
6464
'title': 'Protocol Version',
6565
'default': 3
66+
},
67+
"toggle_table_string": {
68+
"type": "string",
69+
"title": "Toggle Table String",
70+
"default": "_v",
71+
"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."
6672
}
6773
},
6874
'required': ['keyspace', 'host']

redash/query_runner/clickhouse.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ def configuration_schema(cls):
2929
"dbname": {
3030
"type": "string",
3131
"title": "Database Name"
32+
},
33+
"toggle_table_string": {
34+
"type": "string",
35+
"title": "Toggle Table String",
36+
"default": "_v",
37+
"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."
3238
}
3339
},
3440
"required": ["dbname"],

redash/query_runner/dynamodb_sql.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ def configuration_schema(cls):
5555
"type": "string",
5656
"title": "Documentation URL",
5757
"default": cls.default_doc_url
58+
},
59+
"toggle_table_string": {
60+
"type": "string",
61+
"title": "Toggle Table String",
62+
"default": "_v",
63+
"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."
5864
}
5965
},
6066
"required": ["access_key", "secret_key"],

redash/query_runner/elasticsearch.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ def configuration_schema(cls):
6868
"type": "string",
6969
"title": "Documentation URL",
7070
"default": cls.default_doc_url
71+
},
72+
"toggle_table_string": {
73+
"type": "string",
74+
"title": "Toggle Table String",
75+
"default": "_v",
76+
"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."
7177
}
7278
},
7379
"secret": ["basic_auth_password"],

0 commit comments

Comments
 (0)