You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/12/12 19:06:16 UTC

[GitHub] hughhhh commented on a change in pull request #6519: [RfC] Fix URL too long

hughhhh commented on a change in pull request #6519: [RfC] Fix URL too long
URL: https://github.com/apache/incubator-superset/pull/6519#discussion_r241145935
 
 

 ##########
 File path: superset/assets/src/explore/exploreUtils.js
 ##########
 @@ -40,19 +42,31 @@ 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;
   }
 
   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 = {
 
 Review comment:
   Shouldn't we always want to send the minimalFormData?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org