Skip to content

Commit

Permalink
Added progress reporting in simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
lbrendanl committed Nov 29, 2016
1 parent 53a1358 commit d87b955
Show file tree
Hide file tree
Showing 12 changed files with 567 additions and 561 deletions.
2 changes: 1 addition & 1 deletion Examples/OAuthProxyExample/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script>

<!-- Latest WDC Library -->
<script src="https://connectors.tableau.com/libs/tableauwdc-2.0.latest.js" type="text/javascript"></script>
<script src="https://connectors.tableau.com/libs/tableauwdc-2.1.latest.js" type="text/javascript"></script>

<!-- Use to access cookie storage to grab access token -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.0.2/js.cookie.min.js" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion Examples/html/IncrementalRefreshConnector.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<script src="https://connectors.tableau.com/libs/tableauwdc-2.1.1.js" type="text/javascript"></script>
<script src="https://connectors.tableau.com/libs/tableauwdc-2.1.latest.js" type="text/javascript"></script>
<script src="../js/IncrementalRefreshConnector.js" type="text/javascript"></script>

</head>
Expand Down
2 changes: 1 addition & 1 deletion Examples/html/MadMoneyScraper.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<script src="https://connectors.tableau.com/libs/tableauwdc-2.1.1.js" type="text/javascript"></script>
<script src="https://connectors.tableau.com/libs/tableauwdc-2.1.latest.js" type="text/javascript"></script>
<script src="../js/MadMoneyScraper.js" type="text/javascript"></script>

</head>
Expand Down
2 changes: 1 addition & 1 deletion Examples/html/StandardConnectionsExample.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!-- In order to use promises, like this example, you will need to include this polyfill to add promises
functionality to the built in Tableau WDC browser (it does not have ES6 functionality by default) -->
<script src="https://www.promisejs.org/polyfills/promise-7.0.4.min.js"></script>
<script src="https://connectors.tableau.com/libs/tableauwdc-2.1.1.js" type="text/javascript"></script>
<script src="https://connectors.tableau.com/libs/tableauwdc-2.1.latest.js" type="text/javascript"></script>
<script src="../js/StandardConnectionsExample.js"></script>
<style>
* {
Expand Down
2 changes: 1 addition & 1 deletion Examples/html/StockQuoteConnector_promises.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore.js"></script>
<script src="https://connectors.tableau.com/libs/tableauwdc-2.1.1.js" type="text/javascript"></script>
<script src="https://connectors.tableau.com/libs/tableauwdc-2.1.latest.js" type="text/javascript"></script>
<script src="../js/es6-promise.min.js" type="text/javascript"></script>
<script src="../js/StockQuoteConnector_promises.js" type="text/javascript"></script>

Expand Down
2 changes: 1 addition & 1 deletion Examples/html/earthquakeMultilingual.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>

<script src="https://connectors.tableau.com/libs/tableauwdc-2.1.1.js" type="text/javascript"></script>
<script src="https://connectors.tableau.com/libs/tableauwdc-2.1.latest.js" type="text/javascript"></script>
<script src="../js/earthquakeMultilingual.js" type="text/javascript"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion Examples/html/earthquakeMultitable.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>

<script src="https://connectors.tableau.com/libs/tableauwdc-2.1.1.js" type="text/javascript"></script>
<script src="https://connectors.tableau.com/libs/tableauwdc-2.1.latest.js" type="text/javascript"></script>
<script src="../js/earthquakeMultitable.js" type="text/javascript"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion Examples/html/earthquakeUSGS.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>

<script src="https://connectors.tableau.com/libs/tableauwdc-2.1.1.js" type="text/javascript"></script>
<script src="https://connectors.tableau.com/libs/tableauwdc-2.1.latest.js" type="text/javascript"></script>
<script src="../js/earthquakeUSGS.js" type="text/javascript"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion Examples/js/StandardConnectionsExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function loadJSON(path, cb, isLocal) {
obj.open("GET", "../json/" + path + ".json", true);
}
else {
obj.open("GET", "https://crossorigin.me/http://jsonplaceholder.typicode.com/" + path, true);
obj.open("GET", "http://jsonplaceholder.typicode.com/" + path, true);
}
obj.onreadystatechange = function() {
if (obj.readyState == 4 && obj.status == "200"){
Expand Down
17 changes: 17 additions & 0 deletions Simulator/actions/messaging_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ export function receiveMessage(payload) {
dispatch(handleAbortForAuth(errorMsg));
break;
}

case eventNames.REPORT_PROGRESS: {
const progressMsg = msgData.progressMsg;
dispatch(handleReportProgress(progressMsg));
break;
}

default: {
// The message was not for the simulator, ignore it.
break;
Expand Down Expand Up @@ -223,6 +230,16 @@ export function handleAbortForAuth(msg) {
};
}

export function handleReportProgress(progressMsg) {
return () => {
// The WDC has reported a progress message, display in toast
/* eslint-disable no-console */
console.log(progressMsg);
/* eslint-enable no-console */
toastr.info(progressMsg, 'The WDC reported a progress message:');
};
}

// Send message thunks
export function sendMessage(messageName, payload = {}) {
return (dispatch, getState) => {
Expand Down
1 change: 1 addition & 0 deletions Simulator/utils/consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const eventNames = {
SHUTDOWN_CB: 'shutdownCallback',
ABORT: 'abortWithError',
ABORT_AUTH: 'abortForAuth',
REPORT_PROGRESS: 'reportProgress',
};

export const phases = {
Expand Down

0 comments on commit d87b955

Please sign in to comment.