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

Export button feature don't work as expected #217

Open
AlexisJC opened this issue Feb 24, 2020 · 5 comments
Open

Export button feature don't work as expected #217

AlexisJC opened this issue Feb 24, 2020 · 5 comments

Comments

@AlexisJC
Copy link

AlexisJC commented Feb 24, 2020

Hi,

The export button not seem to have the correct behaviour, before and after this commit : 0a07c42#diff-63103223f3a15739abbf1bfb73fe645d

BEFORE (>2.5.5)

The urlFix function remove the virtual proxy.

// url = 'https://sub.domain.com/virtualproxy/tempcontent/3f34ee45-3236-4bd0-8162-3962defcd086/7714207e-274d-4284-9764-35a6c9a1f1f4.csv?serverNodeId=06a72d32-e22b-4cc6-8b0e-e58a66043bb8'
if (qViz) {
     const _options = (options) || { format: 'CSV_T', state: 'P' };
     const url = await qViz.exportData(_options);
     const _url = urlFix(url); // it removes the virtual proxy prefix :(
     window.open(_url, '_blank');
}
// _url = 'https://sub.domain.com/tempcontent/3f34ee45-3236-4bd0-8162-3962defcd086/7714207e-274d-4284-9764-35a6c9a1f1f4.csv?serverNodeId=06a72d32-e22b-4cc6-8b0e-e58a66043bb8'

AFTER (<=2.5.5)

The regex replacing the urlFix method don't work in my case.

// url = https://sub.domain.com/virtualproxy/tempcontent/3f34ee45-3236-4bd0-8162-3962defcd086/7714207e-274d-4284-9764-35a6c9a1f1f4.csv?serverNodeId=06a72d32-e22b-4cc6-8b0e-e58a66043bb8
if (qViz) {
     const _options = (options) || { format: 'CSV_T', state: 'P' };
     const url = await qViz.exportData(_options);
     const _url = url.split(/(?=http.?:\/\/)(.*)(?=http.?:\/\/)/)[2];
     window.open(_url, '_blank'); 
}
// _url is undefined because the array returned by the split method 
// contain only one index with this regex

This is leading to open a blank page, because the url is undefined.

To Reproduce

I'm able to reproduce this bug with your html example (https://github.com/qlik-demo-team/qdt-components/blob/master/docs/usage/Html.md) and my settings

<head>
  <script type="text/javascript" src="qdt-components.js"></script>
</head>
<body>
  <qdt-component id="qdt1"></qdt-component>
</body>

<script type="text/javascript">
  var options = {
    config: {
      host: "sub.domain.com",
      secure: true,
      port: 443,
      prefix: "virtualproxy",
      appId: "70cfeb89-544b-4f35-b9f3-01197aa349ae"
    },
    connections: { 
      vizApi: true, 
      engineApi: true 
    }
  }
  var qdtComponents = new QdtComponents(options.config, options.connections);
  var element = document.getElementById('qdt1');
  qdtComponents.render('QdtViz', {id: 'cFTyznX', height:'300px', exportData: true}, element);
</script>
@Jackoc123
Copy link

I am also experiencing this issue.

Removing the Regex and just using the passed url variable seems to fix this issue

@BoatPartyJesus
Copy link

I too am experiencing this issue, trying what @Jackoc123 mentioned fixes the issues

@JMC40
Copy link

JMC40 commented Apr 1, 2020

Hello,
I'm also experiencing an issue with the export button.
The export image directs you to a blank page.
Thank you!

@wheatleb
Copy link

I had the same issue. @Jackoc123 is correct- by removing the Regexp and simply using the straight up URL resolved the problem

@fabdulazeez
Copy link

Is there a fix availble now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants