) =>
`${endpoint}?q=${rison.encode(queryObject)}`;
-describe.skip('Test explore links', () => {
+describe('Test explore links', () => {
beforeEach(() => {
cy.login();
interceptChart({ legacy: true }).as('chartData');
diff --git a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/line.test.ts b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/line.test.ts
index a4d99b850f3fc..b20f69a2140ba 100644
--- a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/line.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/line.test.ts
@@ -40,7 +40,10 @@ describe('Visualization > Line', () => {
cy.get('.panel-body').contains(
`Add required control values to preview chart`,
);
- cy.get('.text-danger').contains('Metrics');
+ cy.get('[data-test="metrics-header"]').contains('Metrics');
+ cy.get('[data-test="metrics-header"] [data-test="error-tooltip"]').should(
+ 'exist',
+ );
cy.get('[data-test=metrics]')
.contains('Drop columns/metrics here or click')
@@ -55,7 +58,11 @@ describe('Visualization > Line', () => {
.type('sum{enter}');
cy.get('[data-test="AdhocMetricEdit#save"]').contains('Save').click();
- cy.get('.text-danger').should('not.exist');
+ cy.get('[data-test="metrics-header"]').contains('Metrics');
+ cy.get('[data-test="metrics-header"] [data-test="error-tooltip"]').should(
+ 'not.exist',
+ );
+
cy.get('.ant-alert-warning').should('not.exist');
});
diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json
index 927126632b7c1..1f5c937db791f 100644
--- a/superset-frontend/package-lock.json
+++ b/superset-frontend/package-lock.json
@@ -6489,6 +6489,58 @@
"@types/istanbul-lib-report": "*"
}
},
+ "node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz",
+ "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==",
+ "dependencies": {
+ "@jridgewell/set-array": "^1.0.1",
+ "@jridgewell/sourcemap-codec": "^1.4.10",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz",
+ "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/set-array": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
+ "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/source-map": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz",
+ "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.0",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.4.14",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz",
+ "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw=="
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.14",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz",
+ "integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.0.3",
+ "@jridgewell/sourcemap-codec": "^1.4.10"
+ }
+ },
"node_modules/@lerna/add": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@lerna/add/-/add-4.0.0.tgz",
@@ -12817,13 +12869,14 @@
}
},
"node_modules/@storybook/builder-webpack5/node_modules/terser": {
- "version": "5.9.0",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz",
- "integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==",
+ "version": "5.14.2",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz",
+ "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==",
"devOptional": true,
"dependencies": {
+ "@jridgewell/source-map": "^0.3.2",
+ "acorn": "^8.5.0",
"commander": "^2.20.0",
- "source-map": "~0.7.2",
"source-map-support": "~0.5.20"
},
"bin": {
@@ -12868,15 +12921,6 @@
}
}
},
- "node_modules/@storybook/builder-webpack5/node_modules/terser/node_modules/source-map": {
- "version": "0.7.3",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
- "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
- "devOptional": true,
- "engines": {
- "node": ">= 8"
- }
- },
"node_modules/@storybook/builder-webpack5/node_modules/webpack-dev-middleware": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-4.3.0.tgz",
@@ -14694,13 +14738,14 @@
}
},
"node_modules/@storybook/manager-webpack5/node_modules/terser": {
- "version": "5.9.0",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz",
- "integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==",
+ "version": "5.14.2",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz",
+ "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==",
"devOptional": true,
"dependencies": {
+ "@jridgewell/source-map": "^0.3.2",
+ "acorn": "^8.5.0",
"commander": "^2.20.0",
- "source-map": "~0.7.2",
"source-map-support": "~0.5.20"
},
"bin": {
@@ -14745,15 +14790,6 @@
}
}
},
- "node_modules/@storybook/manager-webpack5/node_modules/terser/node_modules/source-map": {
- "version": "0.7.3",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
- "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
- "devOptional": true,
- "engines": {
- "node": ">= 8"
- }
- },
"node_modules/@storybook/manager-webpack5/node_modules/webpack-dev-middleware": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-4.3.0.tgz",
@@ -38044,7 +38080,8 @@
"node_modules/lodash.sortby": {
"version": "4.7.0",
"resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz",
- "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg="
+ "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=",
+ "dev": true
},
"node_modules/lodash.template": {
"version": "4.5.0",
@@ -49100,9 +49137,9 @@
}
},
"node_modules/terser": {
- "version": "4.6.3",
- "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.3.tgz",
- "integrity": "sha512-Lw+ieAXmY69d09IIc/yqeBqXpEQIpDGZqT34ui1QWXIUpR2RjbqEkT8X7Lgex19hslSqcWM5iMN2kM11eMsESQ==",
+ "version": "4.8.1",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz",
+ "integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==",
"dependencies": {
"commander": "^2.20.0",
"source-map": "~0.6.1",
@@ -49354,13 +49391,13 @@
}
},
"node_modules/terser-webpack-plugin/node_modules/terser": {
- "version": "5.13.1",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.13.1.tgz",
- "integrity": "sha512-hn4WKOfwnwbYfe48NgrQjqNOH9jzLqRcIfbYytOXCOv46LBfWr9bDS17MQqOi+BWGD0sJK3Sj5NC/gJjiojaoA==",
+ "version": "5.14.2",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz",
+ "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==",
"dependencies": {
+ "@jridgewell/source-map": "^0.3.2",
"acorn": "^8.5.0",
"commander": "^2.20.0",
- "source-map": "~0.8.0-beta.0",
"source-map-support": "~0.5.20"
},
"bin": {
@@ -49370,17 +49407,6 @@
"node": ">=10"
}
},
- "node_modules/terser-webpack-plugin/node_modules/terser/node_modules/source-map": {
- "version": "0.8.0-beta.0",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz",
- "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==",
- "dependencies": {
- "whatwg-url": "^7.0.0"
- },
- "engines": {
- "node": ">= 8"
- }
- },
"node_modules/terser-webpack-plugin/node_modules/webpack-sources": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",
@@ -49390,16 +49416,6 @@
"source-map": "~0.6.1"
}
},
- "node_modules/terser-webpack-plugin/node_modules/whatwg-url": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz",
- "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==",
- "dependencies": {
- "lodash.sortby": "^4.7.0",
- "tr46": "^1.0.1",
- "webidl-conversions": "^4.0.2"
- }
- },
"node_modules/terser-webpack-plugin/node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
@@ -49769,6 +49785,7 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz",
"integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=",
+ "dev": true,
"dependencies": {
"punycode": "^2.1.0"
}
@@ -51211,7 +51228,8 @@
"node_modules/webidl-conversions": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
- "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg=="
+ "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==",
+ "dev": true
},
"node_modules/webpack": {
"version": "5.52.1",
@@ -52047,12 +52065,13 @@
}
},
"node_modules/webpack/node_modules/terser": {
- "version": "5.8.0",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.8.0.tgz",
- "integrity": "sha512-f0JH+6yMpneYcRJN314lZrSwu9eKkUFEHLN/kNy8ceh8gaRiLgFPJqrB9HsXjhEGdv4e/ekjTOFxIlL6xlma8A==",
+ "version": "5.14.2",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz",
+ "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==",
"dependencies": {
+ "@jridgewell/source-map": "^0.3.2",
+ "acorn": "^8.5.0",
"commander": "^2.20.0",
- "source-map": "~0.7.2",
"source-map-support": "~0.5.20"
},
"bin": {
@@ -52096,14 +52115,6 @@
}
}
},
- "node_modules/webpack/node_modules/terser/node_modules/source-map": {
- "version": "0.7.3",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
- "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
- "engines": {
- "node": ">= 8"
- }
- },
"node_modules/webpack/node_modules/watchpack": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.2.0.tgz",
@@ -55753,7 +55764,7 @@
},
"plugins/plugin-chart-handlebars": {
"name": "@superset-ui/plugin-chart-handlebars",
- "version": "0.0.0",
+ "version": "0.18.25",
"license": "Apache-2.0",
"dependencies": {
"handlebars": "^4.7.7",
@@ -60740,6 +60751,49 @@
}
}
},
+ "@jridgewell/gen-mapping": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz",
+ "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==",
+ "requires": {
+ "@jridgewell/set-array": "^1.0.1",
+ "@jridgewell/sourcemap-codec": "^1.4.10",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ }
+ },
+ "@jridgewell/resolve-uri": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz",
+ "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w=="
+ },
+ "@jridgewell/set-array": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
+ "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw=="
+ },
+ "@jridgewell/source-map": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz",
+ "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==",
+ "requires": {
+ "@jridgewell/gen-mapping": "^0.3.0",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ }
+ },
+ "@jridgewell/sourcemap-codec": {
+ "version": "1.4.14",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz",
+ "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw=="
+ },
+ "@jridgewell/trace-mapping": {
+ "version": "0.3.14",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz",
+ "integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==",
+ "requires": {
+ "@jridgewell/resolve-uri": "^3.0.3",
+ "@jridgewell/sourcemap-codec": "^1.4.10"
+ }
+ },
"@lerna/add": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@lerna/add/-/add-4.0.0.tgz",
@@ -65570,22 +65624,15 @@
}
},
"terser": {
- "version": "5.9.0",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz",
- "integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==",
+ "version": "5.14.2",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz",
+ "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==",
"devOptional": true,
"requires": {
+ "@jridgewell/source-map": "^0.3.2",
+ "acorn": "^8.5.0",
"commander": "^2.20.0",
- "source-map": "~0.7.2",
"source-map-support": "~0.5.20"
- },
- "dependencies": {
- "source-map": {
- "version": "0.7.3",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
- "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
- "devOptional": true
- }
}
},
"terser-webpack-plugin": {
@@ -66876,22 +66923,15 @@
}
},
"terser": {
- "version": "5.9.0",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz",
- "integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==",
+ "version": "5.14.2",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz",
+ "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==",
"devOptional": true,
"requires": {
+ "@jridgewell/source-map": "^0.3.2",
+ "acorn": "^8.5.0",
"commander": "^2.20.0",
- "source-map": "~0.7.2",
"source-map-support": "~0.5.20"
- },
- "dependencies": {
- "source-map": {
- "version": "0.7.3",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
- "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
- "devOptional": true
- }
}
},
"terser-webpack-plugin": {
@@ -85817,7 +85857,8 @@
"lodash.sortby": {
"version": "4.7.0",
"resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz",
- "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg="
+ "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=",
+ "dev": true
},
"lodash.template": {
"version": "4.5.0",
@@ -94503,9 +94544,9 @@
}
},
"terser": {
- "version": "4.6.3",
- "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.3.tgz",
- "integrity": "sha512-Lw+ieAXmY69d09IIc/yqeBqXpEQIpDGZqT34ui1QWXIUpR2RjbqEkT8X7Lgex19hslSqcWM5iMN2kM11eMsESQ==",
+ "version": "4.8.1",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz",
+ "integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==",
"requires": {
"commander": "^2.20.0",
"source-map": "~0.6.1",
@@ -94684,24 +94725,14 @@
}
},
"terser": {
- "version": "5.13.1",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.13.1.tgz",
- "integrity": "sha512-hn4WKOfwnwbYfe48NgrQjqNOH9jzLqRcIfbYytOXCOv46LBfWr9bDS17MQqOi+BWGD0sJK3Sj5NC/gJjiojaoA==",
+ "version": "5.14.2",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz",
+ "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==",
"requires": {
+ "@jridgewell/source-map": "^0.3.2",
"acorn": "^8.5.0",
"commander": "^2.20.0",
- "source-map": "~0.8.0-beta.0",
"source-map-support": "~0.5.20"
- },
- "dependencies": {
- "source-map": {
- "version": "0.8.0-beta.0",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz",
- "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==",
- "requires": {
- "whatwg-url": "^7.0.0"
- }
- }
}
},
"webpack-sources": {
@@ -94713,16 +94744,6 @@
"source-map": "~0.6.1"
}
},
- "whatwg-url": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz",
- "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==",
- "requires": {
- "lodash.sortby": "^4.7.0",
- "tr46": "^1.0.1",
- "webidl-conversions": "^4.0.2"
- }
- },
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
@@ -95008,6 +95029,7 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz",
"integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=",
+ "dev": true,
"requires": {
"punycode": "^2.1.0"
}
@@ -96119,7 +96141,8 @@
"webidl-conversions": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
- "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg=="
+ "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==",
+ "dev": true
},
"webpack": {
"version": "5.52.1",
@@ -96327,20 +96350,14 @@
"integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ=="
},
"terser": {
- "version": "5.8.0",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.8.0.tgz",
- "integrity": "sha512-f0JH+6yMpneYcRJN314lZrSwu9eKkUFEHLN/kNy8ceh8gaRiLgFPJqrB9HsXjhEGdv4e/ekjTOFxIlL6xlma8A==",
+ "version": "5.14.2",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz",
+ "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==",
"requires": {
+ "@jridgewell/source-map": "^0.3.2",
+ "acorn": "^8.5.0",
"commander": "^2.20.0",
- "source-map": "~0.7.2",
"source-map-support": "~0.5.20"
- },
- "dependencies": {
- "source-map": {
- "version": "0.7.3",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
- "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ=="
- }
}
},
"terser-webpack-plugin": {
diff --git a/superset-frontend/packages/superset-ui-core/src/api/types/core.ts b/superset-frontend/packages/superset-ui-core/src/api/types/core.ts
new file mode 100644
index 0000000000000..9aeba85accc95
--- /dev/null
+++ b/superset-frontend/packages/superset-ui-core/src/api/types/core.ts
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// /superset/sqllab_viz
+interface SqlLabPostRequest {
+ data: {
+ schema: string;
+ sql: string;
+ dbId: number;
+ templateParams?: string | undefined;
+ datasourceName: string;
+ metrics?: string[];
+ columns?: string[];
+ };
+}
diff --git a/superset-frontend/packages/superset-ui-core/src/ui-overrides/ExtensionsRegistry.ts b/superset-frontend/packages/superset-ui-core/src/ui-overrides/ExtensionsRegistry.ts
index 964ff67a9b880..dc71c809ea760 100644
--- a/superset-frontend/packages/superset-ui-core/src/ui-overrides/ExtensionsRegistry.ts
+++ b/superset-frontend/packages/superset-ui-core/src/ui-overrides/ExtensionsRegistry.ts
@@ -38,6 +38,7 @@ type ReturningDisplayable = (props: P) => string | React.ReactElement;
export type Extensions = Partial<{
'embedded.documentation.description': ReturningDisplayable;
'embedded.documentation.url': string;
+ 'dashboard.nav.right': React.ComponentType;
'navbar.right': React.ComponentType;
'welcome.banner': React.ComponentType;
}>;
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-pivot-table/PivotTableStories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-pivot-table/PivotTableStories.tsx
new file mode 100644
index 0000000000000..54903c013aa25
--- /dev/null
+++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-pivot-table/PivotTableStories.tsx
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import React from 'react';
+import { withKnobs } from '@storybook/addon-knobs';
+import { SuperChart } from '@superset-ui/core';
+import { PivotTableChartPlugin } from '@superset-ui/plugin-chart-pivot-table';
+import { basicFormData, basicData } from './testData';
+import { withResizableChartDemo } from '../../../shared/components/ResizableChartDemo';
+
+export default {
+ title: 'Chart Plugins/plugin-chart-pivot-table',
+ decorators: [withKnobs, withResizableChartDemo],
+};
+
+new PivotTableChartPlugin().configure({ key: 'pivot_table_v2' }).register();
+
+export const basic = ({ width, height }) => (
+
+);
+basic.story = {
+ parameters: {
+ initialSize: {
+ width: 680,
+ height: 420,
+ },
+ },
+};
+
+export const MaximumAggregation = ({ width, height }) => (
+
+);
+basic.story = {
+ parameters: {
+ initialSize: {
+ width: 680,
+ height: 420,
+ },
+ },
+};
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-pivot-table/testData.ts b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-pivot-table/testData.ts
new file mode 100644
index 0000000000000..0e6457d0c122e
--- /dev/null
+++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-pivot-table/testData.ts
@@ -0,0 +1,126 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+export const basicFormData = {
+ datasource: '1__table',
+ viz_type: 'pivot_table_v2',
+ granularity_sqla: 'ts',
+ groupbyColumns: ['location'],
+ groupbyRows: ['program_language'],
+ metrics: [
+ {
+ expressionType: 'SIMPLE',
+ column: {
+ id: 1,
+ column_name: 'count',
+ description: null,
+ expression: null,
+ groupby: true,
+ is_dttm: false,
+ python_date_format: null,
+ type: 'BIGINT',
+ type_generic: 0,
+ },
+ aggregate: 'SUM',
+ sqlExpression: null,
+ isNew: false,
+ hasCustomLabel: true,
+ label: 'Count',
+ },
+ {
+ expressionType: 'SIMPLE',
+ column: {
+ id: 2,
+ column_name: 'ts',
+ description: null,
+ expression: "DATE_PARSE(ds || ' ' || hr, '%Y-%m-%d %H')",
+ groupby: true,
+ is_dttm: true,
+ type: 'TIMESTAMP',
+ type_generic: 2,
+ python_date_format: null,
+ },
+ aggregate: 'MAX',
+ sqlExpression: null,
+ isNew: false,
+ hasCustomLabel: true,
+ label: 'Most Recent Data',
+ },
+ ],
+ metricsLayout: 'COLUMNS',
+ order_desc: true,
+ aggregateFunction: 'Sum',
+ valueFormat: '~g',
+ date_format: 'smart_date',
+ rowOrder: 'key_a_to_z',
+ colOrder: 'key_a_to_z',
+};
+
+export const basicData = {
+ cache_key: 'f2cd2a37b6977e3619ce6c07d0027972',
+ cached_dttm: '2022-07-27T17:42:39',
+ cache_timeout: 129600,
+ applied_template_filters: [],
+ annotation_data: {},
+ error: null,
+ is_cached: true,
+ query: 'SELECT \nFROM\nWHERE',
+ status: 'success',
+ stacktrace: null,
+ rowcount: 5,
+ from_dttm: 1658426268000,
+ to_dttm: 1659031068000,
+ colnames: ['location', 'program_language', 'Count', 'Most Recent Data'],
+ indexnames: [0, 1, 2, 3, 4],
+ coltypes: [1, 1, 0, 1],
+ data: [
+ {
+ location: 'AMEA',
+ program_language: 'Javscript',
+ Count: 134,
+ 'Most Recent Data': '2022-07-25 13:00:00.000',
+ },
+ {
+ location: 'ASIA',
+ program_language: 'python',
+ Count: 19,
+ 'Most Recent Data': '2022-07-25 16:00:00.000',
+ },
+ {
+ location: 'ASIA',
+ program_language: 'Java',
+ Count: 7,
+ 'Most Recent Data': '2022-07-25 15:00:00.000',
+ },
+ {
+ location: 'ASIA',
+ program_language: 'C++',
+ Count: 1,
+ 'Most Recent Data': '2022-07-25 02:00:00.000',
+ },
+ {
+ location: 'ASIA',
+ program_language: 'PHP',
+ Count: 1,
+ 'Most Recent Data': '2022-07-24 00:00:00.000',
+ },
+ ],
+ result_format: 'json',
+ applied_filters: [],
+ rejected_filters: [],
+};
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.ts
index faf6271302f86..07ca77547b4ff 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.ts
@@ -125,8 +125,10 @@ export default function transformProps(
if (compareIndex < sortedData.length) {
const compareValue = sortedData[compareIndex][1];
// compare values must both be non-nulls
- if (bigNumber !== null && compareValue !== null && compareValue !== 0) {
- percentChange = (bigNumber - compareValue) / Math.abs(compareValue);
+ if (bigNumber !== null && compareValue !== null) {
+ percentChange = compareValue
+ ? (bigNumber - compareValue) / Math.abs(compareValue)
+ : 0;
formattedSubheader = `${formatPercentChange(
percentChange,
)} ${compareSuffix}`;
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx
index 5d30ee37e0a71..d5e8fcdee90af 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx
@@ -328,6 +328,35 @@ const config: ControlPanelConfig = {
row_limit: {
default: rowLimit,
},
+ limit: {
+ rerender: ['timeseries_limit_metric', 'order_desc'],
+ },
+ timeseries_limit_metric: {
+ label: t('Series Limit Sort By'),
+ description: t(
+ 'Metric used to order the limit if a series limit is present. ' +
+ 'If undefined reverts to the first metric (where appropriate).',
+ ),
+ visibility: ({ controls }) => Boolean(controls?.limit.value),
+ mapStateToProps: (state, controlState) => {
+ const timeserieslimitProps =
+ sharedControls.timeseries_limit_metric.mapStateToProps?.(
+ state,
+ controlState,
+ ) || {};
+ timeserieslimitProps.value = state.controls?.limit?.value
+ ? controlState.value
+ : [];
+ return timeserieslimitProps;
+ },
+ },
+ order_desc: {
+ label: t('Series Limit Sort Descending'),
+ default: false,
+ description: t(
+ 'Whether to sort descending or ascending if a series limit is present',
+ ),
+ },
},
formDataOverrides: formData => ({
...formData,
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts
index b6b23fc70141c..07f18c3d5e62f 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts
@@ -41,6 +41,7 @@ import {
EchartsTimeseriesSeriesType,
TimeseriesChartTransformedProps,
OrientationType,
+ AxisType,
} from './types';
import { DEFAULT_FORM_DATA } from './constants';
import { ForecastSeriesEnum, ForecastValue } from '../types';
@@ -337,13 +338,23 @@ export default function transformProps(
rotate: xAxisLabelRotation,
},
minInterval:
- xAxisType === 'time' && timeGrainSqla
+ xAxisType === AxisType.time && timeGrainSqla
? TIMEGRAIN_TO_TIMESTAMP[timeGrainSqla]
: 0,
};
+
+ if (xAxisType === AxisType.time) {
+ /**
+ * Overriding default behavior (false) for time axis regardless of the granilarity.
+ * Not including this in the initial declaration above so if echarts changes the default
+ * behavior for other axist types we won't unintentionally override it
+ */
+ xAxis.axisLabel.showMaxLabel = null;
+ }
+
let yAxis: any = {
...defaultYAxis,
- type: logAxis ? 'log' : 'value',
+ type: logAxis ? AxisType.log : AxisType.value,
min,
max,
minorTick: { show: true },
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/types.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/types.ts
index 946d41ec164d8..71729bd0f11d0 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/types.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/types.ts
@@ -94,3 +94,10 @@ export interface EchartsTimeseriesChartProps
export type TimeseriesChartTransformedProps =
EChartTransformedProps;
+
+export enum AxisType {
+ category = 'category',
+ value = 'value',
+ time = 'time',
+ log = 'log',
+}
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/constants.ts b/superset-frontend/plugins/plugin-chart-echarts/src/constants.ts
index 7dd823f644792..ec956a9591764 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/constants.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/constants.ts
@@ -31,7 +31,7 @@ import {
export const NULL_STRING = '';
export const TIMESERIES_CONSTANTS = {
- gridOffsetRight: 40,
+ gridOffsetRight: 20,
gridOffsetLeft: 20,
gridOffsetTop: 20,
gridOffsetBottom: 20,
diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.js b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.js
index 9ae5888819777..9b47132936b4e 100644
--- a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.js
+++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.js
@@ -231,7 +231,7 @@ const baseAggregatorTemplates = {
return {
sum: 0,
push(record) {
- if (Number.isNaN(parseFloat(record[attr]))) {
+ if (Number.isNaN(Number(record[attr]))) {
this.sum = record[attr];
} else {
this.sum += parseFloat(record[attr]);
@@ -259,7 +259,7 @@ const baseAggregatorTemplates = {
push(record) {
const x = record[attr];
if (['min', 'max'].includes(mode)) {
- const coercedValue = parseFloat(x);
+ const coercedValue = Number(x);
if (Number.isNaN(coercedValue)) {
this.val =
!this.val ||
@@ -308,7 +308,7 @@ const baseAggregatorTemplates = {
strMap: {},
push(record) {
const val = record[attr];
- const x = parseFloat(val);
+ const x = Number(val);
if (Number.isNaN(x)) {
this.strMap[val] = (this.strMap[val] || 0) + 1;
@@ -354,7 +354,7 @@ const baseAggregatorTemplates = {
s: 0.0,
strValue: null,
push(record) {
- const x = parseFloat(record[attr]);
+ const x = Number(record[attr]);
if (Number.isNaN(x)) {
this.strValue =
typeof record[attr] === 'string' ? record[attr] : this.strValue;
@@ -405,10 +405,10 @@ const baseAggregatorTemplates = {
sumNum: 0,
sumDenom: 0,
push(record) {
- if (!Number.isNaN(parseFloat(record[num]))) {
+ if (!Number.isNaN(Number(record[num]))) {
this.sumNum += parseFloat(record[num]);
}
- if (!Number.isNaN(parseFloat(record[denom]))) {
+ if (!Number.isNaN(Number(record[denom]))) {
this.sumDenom += parseFloat(record[denom]);
}
},
diff --git a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
index f56381bb96efd..8acc06199f66e 100644
--- a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
+++ b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
@@ -16,7 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-import React, { CSSProperties, useCallback, useMemo, useState } from 'react';
+import React, {
+ CSSProperties,
+ useCallback,
+ useLayoutEffect,
+ useMemo,
+ useState,
+} from 'react';
import {
ColumnInstance,
ColumnWithLooseAccessor,
@@ -50,9 +56,15 @@ import Styles from './Styles';
import { formatColumnValue } from './utils/formatValue';
import { PAGE_SIZE_OPTIONS } from './consts';
import { updateExternalFormData } from './DataTable/utils/externalAPIs';
+import getScrollBarSize from './DataTable/utils/getScrollBarSize';
type ValueRange = [number, number];
+interface TableSize {
+ width: number;
+ height: number;
+}
+
/**
* Return sortType based on data type
*/
@@ -198,7 +210,10 @@ export default function TableChart(
value => getTimeFormatterForGranularity(timeGrain)(value),
[timeGrain],
);
-
+ const [tableSize, setTableSize] = useState({
+ width: 0,
+ height: 0,
+ });
// keep track of whether column order changed, so that column widths can too
const [columnOrderToggle, setColumnOrderToggle] = useState(false);
@@ -526,6 +541,41 @@ export default function TableChart(
[setDataMask],
);
+ const handleSizeChange = useCallback(
+ ({ width, height }: { width: number; height: number }) => {
+ setTableSize({ width, height });
+ },
+ [],
+ );
+
+ useLayoutEffect(() => {
+ // After initial load the table should resize only when the new sizes
+ // Are not only scrollbar updates, otherwise, the table would twicth
+ const scrollBarSize = getScrollBarSize();
+ const { width: tableWidth, height: tableHeight } = tableSize;
+ // Table is increasing its original size
+ if (
+ width - tableWidth > scrollBarSize ||
+ height - tableHeight > scrollBarSize
+ ) {
+ handleSizeChange({
+ width: width - scrollBarSize,
+ height: height - scrollBarSize,
+ });
+ } else if (
+ tableWidth - width > scrollBarSize ||
+ tableHeight - height > scrollBarSize
+ ) {
+ // Table is decreasing its original size
+ handleSizeChange({
+ width,
+ height,
+ });
+ }
+ }, [width, height, handleSizeChange, tableSize]);
+
+ const { width: widthFromState, height: heightFromState } = tableSize;
+
return (
@@ -536,8 +586,8 @@ export default function TableChart(
pageSize={pageSize}
serverPaginationData={serverPaginationData}
pageSizeOptions={pageSizeOptions}
- width={width}
- height={height}
+ width={widthFromState}
+ height={heightFromState}
serverPagination={serverPagination}
onServerPaginationChange={handleServerPaginationChange}
onColumnOrderChange={() => setColumnOrderToggle(!columnOrderToggle)}
diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.js b/superset-frontend/src/SqlLab/actions/sqlLab.js
index 6a43821b5cbcc..1435e0d796e21 100644
--- a/superset-frontend/src/SqlLab/actions/sqlLab.js
+++ b/superset-frontend/src/SqlLab/actions/sqlLab.js
@@ -112,7 +112,7 @@ const queryClientMapping = {
id: 'remoteId',
db_id: 'dbId',
client_id: 'id',
- label: 'title',
+ label: 'name',
};
const queryServerMapping = invert(queryClientMapping);
@@ -541,7 +541,7 @@ export function cloneQueryToNewTab(query, autorun) {
qe => qe.id === tabHistory[tabHistory.length - 1],
);
const queryEditor = {
- title: t('Copy of %s', sourceQueryEditor.title),
+ name: t('Copy of %s', sourceQueryEditor.name),
dbId: query.dbId ? query.dbId : null,
schema: query.schema ? query.schema : null,
autorun,
@@ -629,7 +629,7 @@ export function switchQueryEditor(queryEditor, displayLimit) {
const loadedQueryEditor = {
id: json.id.toString(),
loaded: true,
- title: json.label,
+ name: json.label,
sql: json.sql,
selectedText: null,
latestQueryId: json.latest_query?.id,
@@ -834,24 +834,22 @@ export function queryEditorSetAutorun(queryEditor, autorun) {
};
}
-export function queryEditorSetTitle(queryEditor, title) {
+export function queryEditorSetTitle(queryEditor, name) {
return function (dispatch) {
const sync = isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE)
? SupersetClient.put({
endpoint: encodeURI(`/tabstateview/${queryEditor.id}`),
- postPayload: { label: title },
+ postPayload: { label: name },
})
: Promise.resolve();
return sync
- .then(() =>
- dispatch({ type: QUERY_EDITOR_SET_TITLE, queryEditor, title }),
- )
+ .then(() => dispatch({ type: QUERY_EDITOR_SET_TITLE, queryEditor, name }))
.catch(() =>
dispatch(
addDangerToast(
t(
- 'An error occurred while setting the tab title. Please contact your administrator.',
+ 'An error occurred while setting the tab name. Please contact your administrator.',
),
),
),
@@ -873,7 +871,7 @@ export function saveQuery(query) {
query,
result: savedQuery,
});
- dispatch(queryEditorSetTitle(query, query.title));
+ dispatch(queryEditorSetTitle(query, query.name));
return savedQuery;
})
.catch(() =>
@@ -908,7 +906,7 @@ export function updateSavedQuery(query) {
})
.then(() => {
dispatch(addSuccessToast(t('Your query was updated')));
- dispatch(queryEditorSetTitle(query, query.title));
+ dispatch(queryEditorSetTitle(query, query.name));
})
.catch(() =>
dispatch(addDangerToast(t('Your query could not be updated'))),
@@ -965,7 +963,7 @@ export function queryEditorSetQueryLimit(queryEditor, queryLimit) {
dispatch(
addDangerToast(
t(
- 'An error occurred while setting the tab title. Please contact your administrator.',
+ 'An error occurred while setting the tab name. Please contact your administrator.',
),
),
),
@@ -1264,7 +1262,7 @@ export function popStoredQuery(urlId) {
.then(({ json }) =>
dispatch(
addQueryEditor({
- title: json.title ? json.title : t('Shared query'),
+ name: json.name ? json.name : t('Shared query'),
dbId: json.dbId ? parseInt(json.dbId, 10) : null,
schema: json.schema ? json.schema : null,
autorun: json.autorun ? json.autorun : false,
@@ -1302,7 +1300,7 @@ export function popQuery(queryId) {
dbId: queryData.database.id,
schema: queryData.schema,
sql: queryData.sql,
- title: `Copy of ${queryData.tab_name}`,
+ name: `Copy of ${queryData.tab_name}`,
autorun: false,
};
return dispatch(addQueryEditor(queryEditorProps));
@@ -1318,7 +1316,7 @@ export function popDatasourceQuery(datasourceKey, sql) {
.then(({ json }) =>
dispatch(
addQueryEditor({
- title: `Query ${json.name}`,
+ name: `Query ${json.name}`,
dbId: json.database.id,
schema: json.schema,
autorun: sql !== undefined,
diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.test.js b/superset-frontend/src/SqlLab/actions/sqlLab.test.js
index f9e972d2a453e..1c4509b3a1ad4 100644
--- a/superset-frontend/src/SqlLab/actions/sqlLab.test.js
+++ b/superset-frontend/src/SqlLab/actions/sqlLab.test.js
@@ -38,8 +38,8 @@ describe('async actions', () => {
latestQueryId: null,
selectedText: null,
sql: 'SELECT *\nFROM\nWHERE',
- title: 'Untitled Query 1',
- schemaOptions: [{ value: 'main', label: 'main', title: 'main' }],
+ name: 'Untitled Query 1',
+ schemaOptions: [{ value: 'main', label: 'main', name: 'main' }],
};
let dispatch;
@@ -290,7 +290,7 @@ describe('async actions', () => {
const state = {
sqlLab: {
tabHistory: [id],
- queryEditors: [{ id, title: 'Dummy query editor' }],
+ queryEditors: [{ id, name: 'Dummy query editor' }],
},
};
const store = mockStore(state);
@@ -350,7 +350,7 @@ describe('async actions', () => {
const state = {
sqlLab: {
tabHistory: [id],
- queryEditors: [{ id, title: 'Dummy query editor' }],
+ queryEditors: [{ id, name: 'Dummy query editor' }],
},
};
const store = mockStore(state);
@@ -358,7 +358,7 @@ describe('async actions', () => {
{
type: actions.ADD_QUERY_EDITOR,
queryEditor: {
- title: 'Copy of Dummy query editor',
+ name: 'Copy of Dummy query editor',
dbId: 1,
schema: null,
autorun: true,
@@ -617,17 +617,17 @@ describe('async actions', () => {
it('updates the tab state in the backend', () => {
expect.assertions(2);
- const title = 'title';
+ const name = 'name';
const store = mockStore({});
const expectedActions = [
{
type: actions.QUERY_EDITOR_SET_TITLE,
queryEditor,
- title,
+ name,
},
];
return store
- .dispatch(actions.queryEditorSetTitle(queryEditor, title))
+ .dispatch(actions.queryEditorSetTitle(queryEditor, name))
.then(() => {
expect(store.getActions()).toEqual(expectedActions);
expect(fetchMock.calls(updateTabStateEndpoint)).toHaveLength(1);
diff --git a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx
index f68fe224da1f8..9e1df28b4b28f 100644
--- a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx
+++ b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import React, { CSSProperties } from 'react';
+import React from 'react';
import ButtonGroup from 'src/components/ButtonGroup';
import Alert from 'src/components/Alert';
import Button from 'src/components/Button';
@@ -54,8 +54,6 @@ enum LIMITING_FACTOR {
NOT_LIMITED = 'NOT_LIMITED',
}
-const LOADING_STYLES: CSSProperties = { position: 'relative', minHeight: 100 };
-
interface ResultSetProps {
showControls?: boolean;
actions: Record;
@@ -80,6 +78,17 @@ interface ResultSetState {
alertIsOpen: boolean;
}
+const ResultlessStyles = styled.div`
+ position: relative;
+ minheight: 100px;
+ [role='alert'] {
+ margin-top: ${({ theme }) => theme.gridUnit * 2}px;
+ }
+ .sql-result-track-job {
+ margin-top: ${({ theme }) => theme.gridUnit * 2}px;
+ }
+`;
+
// Making text render line breaks/tabs as is as monospace,
// but wrapping text too so text doesn't overflow
const MonospaceDiv = styled.div`
@@ -107,13 +116,6 @@ const ResultSetButtons = styled.div`
padding-right: ${({ theme }) => 2 * theme.gridUnit}px;
`;
-const ResultSetErrorMessage = styled.div`
- padding-top: ${({ theme }) => 4 * theme.gridUnit}px;
- .sql-result-track-job {
- margin-top: ${({ theme }) => 2 * theme.gridUnit}px;
- }
-`;
-
export default class ResultSet extends React.PureComponent<
ResultSetProps,
ResultSetState
@@ -185,7 +187,7 @@ export default class ResultSet extends React.PureComponent<
popSelectStar(tempSchema: string | null, tempTable: string) {
const qe = {
id: shortid.generate(),
- title: tempTable,
+ name: tempTable,
autorun: false,
dbId: this.props.query.dbId,
sql: `SELECT * FROM ${tempSchema ? `${tempSchema}.` : ''}${tempTable}`,
@@ -278,11 +280,8 @@ export default class ResultSet extends React.PureComponent<
this.props.database?.allows_virtual_table_explore && (
this.setState({ showSaveDatasetModal: true })}
+ onClick={this.createExploreResultsOnClick}
/>
- // In order to use the new workflow for a query powered chart, replace the
- // above function with:
- // onClick={this.createExploreResultsOnClick}
)}
{this.props.csv && (