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

fix: Right click on country map with code filter #22081

Merged
merged 3 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,14 @@ describe('Drill to detail modal', () => {

cy.get("[data-test-viz-type='world_map'] svg").then($canvas => {
cy.wrap($canvas).scrollIntoView().rightclick(70, 150);
openModalFromChartContext('Drill to detail by United States');
cy.getBySel('filter-val').should('contain', 'United States');
openModalFromChartContext('Drill to detail by USA');
cy.getBySel('filter-val').should('contain', 'USA');
closeModal();
});
cy.get("[data-test-viz-type='world_map'] svg").then($canvas => {
cy.wrap($canvas).scrollIntoView().rightclick(200, 140);
openModalFromChartContext('Drill to detail by Slovakia');
cy.getBySel('filter-val').should('contain', 'Slovakia');
openModalFromChartContext('Drill to detail by SVK');
cy.getBySel('filter-val').should('contain', 'SVK');
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const formatter = getNumberFormatter();

function WorldMap(element, props) {
const {
countryFieldtype,
entity,
data,
width,
Expand Down Expand Up @@ -111,7 +112,7 @@ function WorldMap(element, props) {
const pointerEvent = d3.event;
pointerEvent.preventDefault();
const key = source.id || source.country;
const val = mapData[key]?.name;
const val = countryFieldtype === 'name' ? mapData[key]?.name : key;
if (val) {
const filters = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default function transformProps(chartProps) {
chartProps;
const { onContextMenu } = hooks;
const {
countryFieldtype,
entity,
maxBubbleSize,
showBubbles,
Expand All @@ -35,6 +36,7 @@ export default function transformProps(chartProps) {
const { r, g, b } = colorPicker;

return {
countryFieldtype,
entity,
data: queriesData[0].data,
width,
Expand Down