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 interactivity when only 'cartodb_id' is selected #2153

Merged
merged 3 commits into from
Jul 5, 2018

Conversation

rubenmoya
Copy link
Contributor

Related to: #2089

Description

This PR changes how we check if a layer is interactive or not.

The problem is that we were checking this.getInteractiveColumnNames().length > 1 because we always add cartodb_id by default, so when adding it manually the check was false.

Copy link
Contributor

@jesusbotella jesusbotella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good but I'm missing some real world tests.

You are mocking method's response and if you change the method's specification, your test will pass even though it shouldn't.

What about doing something like this:

const layer = new carto.layer.Layer(cartoSource, cartoStyle, {
  featureClickColumns: ['cartodb_id']
});

expect(layer.isInteractive()).toBe(true);

@jesusbotella
Copy link
Contributor

I've tested this PR in local and Builder and seems like it works like a charm.

I've tested that you can edit, select, and the popups are shown successfully. ✨

@rubenmoya rubenmoya merged commit 80dca10 into master Jul 5, 2018
@rubenmoya rubenmoya deleted the 2089-interactivity-cartodbid branch July 5, 2018 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants