Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Schema Viewer Drawer (#3291)" #3585

Merged
merged 1 commit into from
Mar 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion client/app/assets/less/ant.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
@import '~antd/lib/radio/style/index';
@import '~antd/lib/time-picker/style/index';
@import '~antd/lib/pagination/style/index';
@import '~antd/lib/drawer/style/index';
@import '~antd/lib/table/style/index';
@import '~antd/lib/popover/style/index';
@import '~antd/lib/icon/style/index';
Expand Down
14 changes: 5 additions & 9 deletions client/app/assets/less/inc/schema-browser.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ div.table-name {
border-radius: @redash-radius;
position: relative;

.copy-to-editor, .info {
.copy-to-editor {
display: none;
}

&:hover {
background: fade(@redash-gray, 10%);

.copy-to-editor, .info {
.copy-to-editor {
display: flex;
}
}
Expand All @@ -36,7 +36,7 @@ div.table-name {
background: transparent;
}

.copy-to-editor, .info {
.copy-to-editor {
color: fade(@redash-gray, 90%);
cursor: pointer;
position: absolute;
Expand All @@ -49,25 +49,21 @@ div.table-name {
justify-content: center;
}

.info {
right: 20px
}

.table-open {
padding: 0 22px 0 26px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
position: relative;

.copy-to-editor, .info {
.copy-to-editor {
display: none;
}

&:hover {
background: fade(@redash-gray, 10%);

.copy-to-editor, .info {
.copy-to-editor {
display: flex;
}
}
Expand Down
7 changes: 0 additions & 7 deletions client/app/components/proptypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ export const DataSource = PropTypes.shape({
type_name: PropTypes.string,
});

export const DataSourceMetadata = PropTypes.shape({
key: PropTypes.number,
name: PropTypes.string,
type: PropTypes.string,
example: PropTypes.string,
});

export const Table = PropTypes.shape({
columns: PropTypes.arrayOf(PropTypes.string).isRequired,
});
Expand Down
65 changes: 0 additions & 65 deletions client/app/components/queries/SchemaData.jsx

This file was deleted.

12 changes: 2 additions & 10 deletions client/app/components/queries/schema-browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,15 @@
<span title="{{table.name}}">{{table.name}}</span>
<span ng-if="table.size !== undefined"> ({{table.size}})</span>
</strong>
<i ng-if="table.hasColumnMetadata" class="fa fa-question-circle info" title="More Info" aria-hidden="true"
ng-click="openSchemaInfo($event, table.name, table.columns)"></i>
<i class="fa fa-angle-double-right copy-to-editor" aria-hidden="true"
ng-click="$ctrl.itemSelected($event, [table.name])"></i>
</div>
<div uib-collapse="table.collapsed">
<div ng-repeat="column in table.columns | filter:$ctrl.schemaFilterColumn track by column.key" class="table-open">{{column.name}}
<div ng-repeat="column in table.columns | filter:$ctrl.schemaFilterColumn track by column" class="table-open">{{column}}
<i class="fa fa-angle-double-right copy-to-editor" aria-hidden="true"
ng-click="$ctrl.itemSelected($event, [column.name])"></i>
ng-click="$ctrl.itemSelected($event, [column])"></i>
</div>
</div>
</div>
</div>
<schema-data
show="showSchemaInfo"
table-name="tableName"
table-metadata="tableMetadata"
on-close="closeSchemaInfo"
></schema-data>
</div>
11 changes: 0 additions & 11 deletions client/app/components/queries/schema-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,6 @@ function SchemaBrowserCtrl($rootScope, $scope) {
$scope.$broadcast('vsRepeatTrigger');
};

$scope.showSchemaInfo = false;
$scope.openSchemaInfo = ($event, tableName, tableMetadata) => {
$scope.tableName = tableName;
$scope.tableMetadata = tableMetadata;
$scope.showSchemaInfo = true;
$event.stopPropagation();
};
$scope.closeSchemaInfo = () => {
$scope.$apply(() => { $scope.showSchemaInfo = false; });
};

this.getSize = (table) => {
let size = 22;

Expand Down
55 changes: 0 additions & 55 deletions migrations/versions/280daa582976_.py

This file was deleted.

14 changes: 3 additions & 11 deletions redash/handlers/data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
from six import text_type
from sqlalchemy.exc import IntegrityError

from redash import models, settings
from redash import models
from redash.handlers.base import BaseResource, get_object_or_404
from redash.permissions import (require_access, require_admin,
require_permission, view_only)
from redash.tasks.queries import refresh_schemas
from redash.query_runner import (get_configuration_schema_for_query_runner_type,
query_runners, NotSupported)
from redash.utils import filter_none
Expand Down Expand Up @@ -53,9 +52,6 @@ def post(self, data_source_id):
data_source.name = req['name']
models.db.session.add(data_source)

# Refresh the stored schemas when a data source is updated
refresh_schemas.apply_async(queue=settings.SCHEMAS_REFRESH_QUEUE)

try:
models.db.session.commit()
except IntegrityError as e:
Expand Down Expand Up @@ -133,9 +129,6 @@ def post(self):
options=config)

models.db.session.commit()

# Refresh the stored schemas when a new data source is added to the list
refresh_schemas.apply_async(queue=settings.SCHEMAS_REFRESH_QUEUE)
except IntegrityError as e:
if req['name'] in e.message:
abort(400, message="Data source with the name {} already exists.".format(req['name']))
Expand All @@ -158,10 +151,9 @@ def get(self, data_source_id):
refresh = request.args.get('refresh') is not None

response = {}

try:
if refresh:
refresh_schemas.apply(queue=settings.SCHEMAS_REFRESH_QUEUE)
response['schema'] = data_source.get_schema()
response['schema'] = data_source.get_schema(refresh)
except NotSupported:
response['error'] = {
'code': 1,
Expand Down
Loading