From 2310a51b58563b00e45a138fdd0a0dff33cd986f Mon Sep 17 00:00:00 2001 From: John Dance Date: Mon, 30 Aug 2021 13:36:28 -0700 Subject: [PATCH 1/2] Fix the filter example, and update typescript compiler version --- Samples-Typescript/Filtering/filtering.ts | 3 ++- package.json | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Samples-Typescript/Filtering/filtering.ts b/Samples-Typescript/Filtering/filtering.ts index 58d397d6..065996c4 100644 --- a/Samples-Typescript/Filtering/filtering.ts +++ b/Samples-Typescript/Filtering/filtering.ts @@ -155,6 +155,7 @@ import { dashboard.worksheets.forEach(function(worksheet) { worksheet.getFiltersAsync().then(async (filtersForWorksheet) => { + console.log(filtersForWorksheet); const filterClearPromises = []; filtersForWorksheet.forEach(function(filter) { @@ -163,7 +164,7 @@ import { // Same pattern as in fetchFilters, wait until all promises have finished // before updating the UI state. - await Promise.all(filterClearPromises); + await Promise.allSettled(filterClearPromises); this.updateUIState(false); }); }, this); diff --git a/package.json b/package.json index 1effb221..3c9026f5 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Sample code and documentation for the Tableau Extensions API.", "scripts": { "build": "npm run lint && webpack --config webpack.config.js --display-error-details", - "start": "node node_modules/http-server/bin/http-server -p 8765", + "start": "node node_modules/http-server/bin/http-server -p 8765 -c-1", "start-sandbox": "npx tabextsandbox --config sandbox-config.json", "lint": "npm run jslint && npm run tslint", "jslint": "semistandard ./Samples/*/*.js", @@ -28,7 +28,7 @@ "semistandard": "^11.0.0", "ts-loader": "^5.4.5", "tslint": "^5.16.0", - "typescript": "^3.4.5", + "typescript": "^3.9.10", "webpack": "^4.30.0", "webpack-cli": "^3.3.1" }, From 98761709fc6be141d48e1d71ddf0a54a0f5981e1 Mon Sep 17 00:00:00 2001 From: John Dance Date: Mon, 30 Aug 2021 14:08:38 -0700 Subject: [PATCH 2/2] remove debugging output and also fix javascript version --- Samples-Typescript/Filtering/filtering.ts | 1 - Samples/Filtering/filtering.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Samples-Typescript/Filtering/filtering.ts b/Samples-Typescript/Filtering/filtering.ts index 065996c4..8f3ebdde 100644 --- a/Samples-Typescript/Filtering/filtering.ts +++ b/Samples-Typescript/Filtering/filtering.ts @@ -155,7 +155,6 @@ import { dashboard.worksheets.forEach(function(worksheet) { worksheet.getFiltersAsync().then(async (filtersForWorksheet) => { - console.log(filtersForWorksheet); const filterClearPromises = []; filtersForWorksheet.forEach(function(filter) { diff --git a/Samples/Filtering/filtering.js b/Samples/Filtering/filtering.js index beb88c44..1a5945d9 100644 --- a/Samples/Filtering/filtering.js +++ b/Samples/Filtering/filtering.js @@ -144,7 +144,7 @@ // Same pattern as in fetchFilters, wait until all promises have finished // before updating the UI state. - Promise.all(filterClearPromises).then(function () { + Promise.allSettled(filterClearPromises).then(function () { updateUIState(false); }); });