You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2019/01/09 18:45:54 UTC
[incubator-superset] branch 0.30 updated (7dddc61 -> 2521587)
This is an automated email from the ASF dual-hosted git repository.
michellet pushed a change to branch 0.30
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git.
from 7dddc61 0.30rc2
new 8392998 Fix deck.gl Polygon not show (#6545)
new e667437 [RfC] Fix URL too long (#6519)
new a8dd142 [fix] url shortner for long explore url (#6449)
new 2521587 0.30rc3
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
superset/assets/package.json | 2 +-
.../src/explore/components/ExploreViewContainer.jsx | 2 +-
superset/assets/src/explore/exploreUtils.js | 18 ++++++++++++++++--
superset/assets/src/visualizations/deckgl/utils.js | 4 +++-
superset/views/core.py | 9 +++++++--
5 files changed, 28 insertions(+), 7 deletions(-)
[incubator-superset] 02/04: [RfC] Fix URL too long (#6519)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michellet pushed a commit to branch 0.30
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
commit e667437328060e60dfa69d63916ce64939ff93a4
Author: Maxime Beauchemin <ma...@gmail.com>
AuthorDate: Tue Dec 18 16:14:20 2018 -0800
[RfC] Fix URL too long (#6519)
When a URL gets too long (usually happens with controls that allow
free form text), it creates an array of bugs.
* bug when creating a short URL, because the POST request's referrer
field is too long
* a bug when saving a chart (when the modal shows up) also because of
the referrer being too long
Some work has been done in the past to mitigate this, and I'm unclear if
it's some sort of regression because of the Flask upgrade or some
browser change, or whether these bugs have always been around.
This is a request for comment on an approach that works. Let me know if
you can think of better ideas as to how to manage this.
My current solution looks for 8000+ characters URLs and shrinks them to
only `/superset/explore/?URL_IS_TOO_LONG_TO_SHARE&form_data=...` and we
only keep the formData keys for `datasource` and `viz_type`. Not super
elegant but does the trick.
(cherry picked from commit 42067e077b404f4ca6f002ade273d55a3dec8616)
---
.../src/explore/components/ExploreViewContainer.jsx | 2 +-
superset/assets/src/explore/exploreUtils.js | 18 ++++++++++++++++--
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/superset/assets/src/explore/components/ExploreViewContainer.jsx b/superset/assets/src/explore/components/ExploreViewContainer.jsx
index 162cb16..ae52a0b 100644
--- a/superset/assets/src/explore/components/ExploreViewContainer.jsx
+++ b/superset/assets/src/explore/components/ExploreViewContainer.jsx
@@ -171,7 +171,7 @@ class ExploreViewContainer extends React.Component {
addHistory({ isReplace = false, title }) {
const { payload } = getExploreUrlAndPayload({ formData: this.props.form_data });
- const longUrl = getExploreLongUrl(this.props.form_data);
+ const longUrl = getExploreLongUrl(this.props.form_data, null, false);
try {
if (isReplace) {
history.replaceState(payload, title, longUrl);
diff --git a/superset/assets/src/explore/exploreUtils.js b/superset/assets/src/explore/exploreUtils.js
index 4eac3ab..e9bcc9f 100644
--- a/superset/assets/src/explore/exploreUtils.js
+++ b/superset/assets/src/explore/exploreUtils.js
@@ -2,6 +2,8 @@
import URI from 'urijs';
import { availableDomains } from '../utils/hostNamesConfig';
+const MAX_URL_LENGTH = 8000;
+
export function getChartKey(explore) {
const slice = explore.slice;
return slice ? (slice.slice_id) : 0;
@@ -40,7 +42,7 @@ export function getURIDirectory(formData, endpointType = 'base') {
return directory;
}
-export function getExploreLongUrl(formData, endpointType) {
+export function getExploreLongUrl(formData, endpointType, allowOverflow = true, extraSearch = {}) {
if (!formData.datasource) {
return null;
}
@@ -48,11 +50,23 @@ export function getExploreLongUrl(formData, endpointType) {
const uri = new URI('/');
const directory = getURIDirectory(formData, endpointType);
const search = uri.search(true);
+ Object.keys(extraSearch).forEach((key) => {
+ search[key] = extraSearch[key];
+ });
search.form_data = JSON.stringify(formData);
if (endpointType === 'standalone') {
search.standalone = 'true';
}
- return uri.directory(directory).search(search).toString();
+ const url = uri.directory(directory).search(search).toString();
+ if (!allowOverflow && url.length > MAX_URL_LENGTH) {
+ const minimalFormData = {
+ datasource: formData.datasource,
+ viz_type: formData.viz_type,
+ };
+ return getExploreLongUrl(
+ minimalFormData, endpointType, false, { URL_IS_TOO_LONG_TO_SHARE: null });
+ }
+ return url;
}
export function getExploreUrlAndPayload({
[incubator-superset] 01/04: Fix deck.gl Polygon not show (#6545)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michellet pushed a commit to branch 0.30
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
commit 83929985d0e0228a347711d07501f5ff4c67f6ad
Author: MukaJiTrue <45...@users.noreply.github.com>
AuthorDate: Wed Dec 19 02:16:09 2018 +0700
Fix deck.gl Polygon not show (#6545)
* Fix deck.gl Polygon not show
* Replace "//" to "// "
(cherry picked from commit 926f78c21d2ef513edcbc9af2e766bfe5c8e8b53)
---
superset/assets/src/visualizations/deckgl/utils.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/superset/assets/src/visualizations/deckgl/utils.js b/superset/assets/src/visualizations/deckgl/utils.js
index 10c9363..149ef2b 100644
--- a/superset/assets/src/visualizations/deckgl/utils.js
+++ b/superset/assets/src/visualizations/deckgl/utils.js
@@ -89,8 +89,10 @@ export function getBuckets(fd, features, accessor) {
breakPoints.slice(1).forEach((value, i) => {
const range = breakPoints[i] + ' - ' + breakPoints[i + 1];
const mid = 0.5 * (parseInt(breakPoints[i], 10) + parseInt(breakPoints[i + 1], 10));
+ // fix polygon doesn't show
+ const metricLabel = fd.metric ? fd.metric.label || fd.metric : null;
buckets[range] = {
- color: colorScaler({ [fd.metric.label || fd.metric]: mid }),
+ color: colorScaler({ [metricLabel || fd.metric]: mid }),
enabled: true,
};
});
[incubator-superset] 03/04: [fix] url shortner for long explore url
(#6449)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michellet pushed a commit to branch 0.30
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
commit a8dd1428dbbc4d86baf6c1340ac469b636929f22
Author: Grace Guo <gr...@airbnb.com>
AuthorDate: Mon Jan 7 14:28:30 2019 -0800
[fix] url shortner for long explore url (#6449)
- redirect explore url with r parameter
- redirect to relative path
(cherry picked from commit be1895f2dcae307f51b576bfebd49b82c5699756)
---
superset/views/core.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/superset/views/core.py b/superset/views/core.py
index f9eb299..a15d724 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -756,8 +756,13 @@ class R(BaseSupersetView):
@expose('/<url_id>')
def index(self, url_id):
url = db.session.query(models.Url).filter_by(id=url_id).first()
- if url:
- return redirect('/' + url.url)
+ if url and url.url:
+ explore_url = '//superset/explore/?'
+ if url.url.startswith(explore_url):
+ explore_url += f'r={url_id}'
+ return redirect(explore_url[1:])
+ else:
+ return redirect(url.url[1:])
else:
flash('URL to nowhere...', 'danger')
return redirect('/')
[incubator-superset] 04/04: 0.30rc3
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michellet pushed a commit to branch 0.30
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
commit 2521587655e389361cfd6361d08934fb9e272dd1
Author: Michelle Thomas <mi...@gmail.com>
AuthorDate: Wed Jan 9 10:45:00 2019 -0800
0.30rc3
---
superset/assets/package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/superset/assets/package.json b/superset/assets/package.json
index 2f41286..d60d9e7 100644
--- a/superset/assets/package.json
+++ b/superset/assets/package.json
@@ -1,6 +1,6 @@
{
"name": "superset",
- "version": "0.29.0rc2",
+ "version": "0.29.0rc3",
"description": "Superset is a data exploration platform designed to be visual, intuitive, and interactive.",
"license": "Apache-2.0",
"directories": {