You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by wi...@apache.org on 2020/09/04 22:52:37 UTC
[incubator-superset] branch master updated: fix: MVC show saved
query (#10781)
This is an automated email from the ASF dual-hosted git repository.
willbarrett 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 c1ff1c5 fix: MVC show saved query (#10781)
c1ff1c5 is described below
commit c1ff1c5d7009f8f90ad9279442c2f9232f05b2ca
Author: Daniel Vaz Gaspar <da...@gmail.com>
AuthorDate: Fri Sep 4 23:52:03 2020 +0100
fix: MVC show saved query (#10781)
* fix: MVC show saved query
* remove it completely
* fix lint
---
.../templates/superset/models/savedquery/show.html | 33 ----------------------
superset/views/sql_lab.py | 22 +--------------
2 files changed, 1 insertion(+), 54 deletions(-)
diff --git a/superset/templates/superset/models/savedquery/show.html b/superset/templates/superset/models/savedquery/show.html
deleted file mode 100644
index 10da572..0000000
--- a/superset/templates/superset/models/savedquery/show.html
+++ /dev/null
@@ -1,33 +0,0 @@
-{#
- 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.
-#}
-{% extends "appbuilder/general/model/show.html" %}
-
-{% block show_form %}
- {{ super() }}
- <div
- id="schedule-info"
- style="padding: 0 10px;"
- data-bootstrap="{{ bootstrap_data }}"
- ></div>
-{% endblock %}
-
-{% block tail_js %}
- {{ super() }}
- {{ js_bundle("showSavedQuery") }}
-{% endblock %}
diff --git a/superset/views/sql_lab.py b/superset/views/sql_lab.py
index 606e9a6..a85fb53 100644
--- a/superset/views/sql_lab.py
+++ b/superset/views/sql_lab.py
@@ -21,7 +21,7 @@ from flask_appbuilder.models.sqla.interface import SQLAInterface
from flask_appbuilder.security.decorators import has_access, has_access_api
from flask_babel import lazy_gettext as _
-from superset import db, get_feature_flags
+from superset import db
from superset.constants import RouteMethod
from superset.models.sql_lab import Query, SavedQuery, TableSchema, TabState
from superset.typing import FlaskResponse
@@ -75,32 +75,12 @@ class SavedQueryView(
"changed_on": _("Changed on"),
}
- show_template = "superset/models/savedquery/show.html"
-
def pre_add(self, item: "SavedQueryView") -> None:
item.user = g.user
def pre_update(self, item: "SavedQueryView") -> None:
self.pre_add(item)
- @has_access
- @expose("show/<pk>")
- def show(self, pk: int) -> FlaskResponse:
- pk = self._deserialize_pk_if_composite(pk)
- widgets = self._show(pk)
- query = self.datamodel.get(pk).to_json()
- query["extra_json"] = json.loads(query["extra_json"])
- payload = {"common": {"feature_flags": get_feature_flags(), "query": query}}
-
- return self.render_template(
- self.show_template,
- pk=pk,
- title=self.show_title,
- widgets=widgets,
- related_views=self._related_views,
- bootstrap_data=json.dumps(payload, default=utils.json_iso_dttm_ser),
- )
-
class SavedQueryViewApi(SavedQueryView): # pylint: disable=too-many-ancestors
include_route_methods = {