-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dashboard): Fix scroll behaviour in DashboardBuilderSidepane (#20969
- Loading branch information
1 parent
d3684c0
commit 746276c
Showing
4 changed files
with
94 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
import logging | ||
|
||
from flask import g, request, Response | ||
from flask_appbuilder.api import BaseApi, expose, protect, safe | ||
|
||
from superset.charts.commands.exceptions import ChartNotFoundError | ||
from superset.constants import MODEL_API_RW_METHOD_PERMISSION_MAP, RouteMethod | ||
from superset.explore.commands.get import GetExploreCommand | ||
from superset.explore.commands.parameters import CommandParameters | ||
from superset.explore.exceptions import DatasetAccessDeniedError, WrongEndpointError | ||
from superset.explore.permalink.exceptions import ExplorePermalinkGetFailedError | ||
from superset.explore.schemas import ExploreContextSchema | ||
from superset.extensions import event_logger | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class SqlRestApi(BaseApi): | ||
method_permission_name = MODEL_API_RW_METHOD_PERMISSION_MAP | ||
include_route_methods = {RouteMethod.GET} | ||
# allow_browser_login = True | ||
class_permission_name = "Superset" | ||
resource_name = "sql" | ||
# openapi_spec_tag = "Explore" | ||
# openapi_spec_component_schemas = (ExploreContextSchema,) | ||
|
||
@expose("/", methods=["GET"]) | ||
@protect() | ||
@safe | ||
@event_logger.log_this_with_context( | ||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.get", | ||
log_to_statsd=True, | ||
) | ||
def get(self) -> Response: | ||
return self.response(200, result={"foo": "bar"}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
from flask_appbuilder import permission_name | ||
from flask_appbuilder.api import expose | ||
from flask_appbuilder.security.decorators import has_access | ||
|
||
from superset import event_logger | ||
from superset.superset_typing import FlaskResponse | ||
|
||
from .base import BaseSupersetView | ||
|
||
|
||
class SqlView(BaseSupersetView): | ||
route_base = "/sql" | ||
class_permission_name = "Superset" | ||
|
||
@expose("/") | ||
# @has_access | ||
# @permission_name("read") | ||
# @event_logger.log_this | ||
def root(self) -> FlaskResponse: | ||
return super().render_app_template() |