mirror of
https://github.com/apache/superset.git
synced 2024-09-07 06:17:45 -04:00
fix: Right click on country map with code filter (#22081)
This commit is contained in:
parent
ed1f50eab6
commit
824dc7188b
@ -409,14 +409,14 @@ describe('Drill to detail modal', () => {
|
|||||||
|
|
||||||
cy.get("[data-test-viz-type='world_map'] svg").then($canvas => {
|
cy.get("[data-test-viz-type='world_map'] svg").then($canvas => {
|
||||||
cy.wrap($canvas).scrollIntoView().rightclick(70, 150);
|
cy.wrap($canvas).scrollIntoView().rightclick(70, 150);
|
||||||
openModalFromChartContext('Drill to detail by United States');
|
openModalFromChartContext('Drill to detail by USA');
|
||||||
cy.getBySel('filter-val').should('contain', 'United States');
|
cy.getBySel('filter-val').should('contain', 'USA');
|
||||||
closeModal();
|
closeModal();
|
||||||
});
|
});
|
||||||
cy.get("[data-test-viz-type='world_map'] svg").then($canvas => {
|
cy.get("[data-test-viz-type='world_map'] svg").then($canvas => {
|
||||||
cy.wrap($canvas).scrollIntoView().rightclick(200, 140);
|
cy.wrap($canvas).scrollIntoView().rightclick(200, 140);
|
||||||
openModalFromChartContext('Drill to detail by Slovakia');
|
openModalFromChartContext('Drill to detail by SVK');
|
||||||
cy.getBySel('filter-val').should('contain', 'Slovakia');
|
cy.getBySel('filter-val').should('contain', 'SVK');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -52,6 +52,7 @@ const formatter = getNumberFormatter();
|
|||||||
|
|
||||||
function WorldMap(element, props) {
|
function WorldMap(element, props) {
|
||||||
const {
|
const {
|
||||||
|
countryFieldtype,
|
||||||
entity,
|
entity,
|
||||||
data,
|
data,
|
||||||
width,
|
width,
|
||||||
@ -111,7 +112,7 @@ function WorldMap(element, props) {
|
|||||||
const pointerEvent = d3.event;
|
const pointerEvent = d3.event;
|
||||||
pointerEvent.preventDefault();
|
pointerEvent.preventDefault();
|
||||||
const key = source.id || source.country;
|
const key = source.id || source.country;
|
||||||
const val = mapData[key]?.name;
|
const val = countryFieldtype === 'name' ? mapData[key]?.name : key;
|
||||||
if (val) {
|
if (val) {
|
||||||
const filters = [
|
const filters = [
|
||||||
{
|
{
|
||||||
|
@ -23,6 +23,7 @@ export default function transformProps(chartProps) {
|
|||||||
chartProps;
|
chartProps;
|
||||||
const { onContextMenu } = hooks;
|
const { onContextMenu } = hooks;
|
||||||
const {
|
const {
|
||||||
|
countryFieldtype,
|
||||||
entity,
|
entity,
|
||||||
maxBubbleSize,
|
maxBubbleSize,
|
||||||
showBubbles,
|
showBubbles,
|
||||||
@ -35,6 +36,7 @@ export default function transformProps(chartProps) {
|
|||||||
const { r, g, b } = colorPicker;
|
const { r, g, b } = colorPicker;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
countryFieldtype,
|
||||||
entity,
|
entity,
|
||||||
data: queriesData[0].data,
|
data: queriesData[0].data,
|
||||||
width,
|
width,
|
||||||
|
Loading…
Reference in New Issue
Block a user