-
Notifications
You must be signed in to change notification settings - Fork 650
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
SQLViewData is not read only when filtering #3812
Conversation
@@ -99,10 +95,10 @@ cdb.admin.SQLViewData = cdb.admin.CartoDBTableData.extend({ | |||
}); | |||
}, | |||
|
|||
// TODO: Is this being used? | |||
filterColumn: function(columnName, tableName, filter) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found two references to this method:
@xavijam do you think I can remove it?
THIS IS FUCKING GOOD |
@javisantana, please, could you take care of this PR? |
Frontend tests were OK 👍 (details) |
Frontend tests were OK 👍 (details) |
…s change due to data modifications
Frontend tests were OK 👍 (details) |
@javisantana This is ready for review again. There was some hidden work here: filters were not being re-rendered correctly when the data was saved because:
Thx to @javierarce for helping me out with the histogram issue! |
Frontend tests were OK 👍 (details) |
Frontend tests were OK 👍 (details) |
@@ -1,5 +1,13 @@ | |||
describe('modules.Filters', function() { | |||
|
|||
var clone = function(obj) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not _.clone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed! Thanks!
Hey @javierarce, can you please take a look at this PR? Thanks! |
Frontend tests were OK 👍 (details) |
@alonsogarciapablo: code looks good to me 👍 |
// filter table by column | ||
this.setSQL(this.filterColumnSQL(columnName, tableName, filter)); | ||
this.readOnly = false; | ||
return this.sqlSource() !== 'filters'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing that we could check here to determine if a row is editable:
return !!this.getSQL().indexOf("SELECT * FROM " + this.table.get('id'))
This way, SQLViews (and cells) will be editable when filtering or when a SQL query is applied and all the columns are being selected.
cc/ @javisantana
SQLViewData is not read only when filtering
Should it work on the Map page too? I'm not able to edit my data in the map page (dataset view) when filtering on a category column... |
Frontend tests were OK 👍 (details) |
weird, now it works :) Thanks! |
Fixes #152. Basically: you will now be able to edit cells while filtering, but not when a sql query has been applied, and active filters are updated accordingly :)