Merge pull request #12889 from CartoDB/12888-csv-without-geometries

Csv export without geometries
pull/12851/head^2
Buti 7 years ago committed by GitHub
commit 34203106f9

@ -59,6 +59,7 @@ Development
* Remove data-observatory-multiple-measures feature flag (#304)
### Bug fixes / enhancements
* CSV export allowed without geometries (#12888)
* Fix handling of imports with long file names and existing tables with almost the same name (#12732)
* Update cartodb.js version
* Don't allow csv export for polygon or line (#9855)

@ -92,7 +92,7 @@ module.exports = CoreView.extend({
_.each(FORMATS, function (format) {
var isDisabled = (isGeoreferenced === false && format.geomRequired === true);
if (format.geomRestricted != null && !isDisabled) {
if (isGeoreferenced === true && format.geomRestricted != null && !isDisabled) {
isDisabled = !_.contains(format.geomRestricted, geometry);
}

@ -43,6 +43,16 @@ describe('components/modals/export-data/modal-export-data-view', function () {
expect(this.view.$('[data-format=csv]:checked').length).toBe(0);
expect(this.view.$('[data-format=shp]:checked').length).toBe(1);
});
it('should render properly for no geometries', function () {
this.queryGeometryModel.set('simple_geom', null);
this.view.render();
expect(this.view.$('.Modal-listFormItem').length).toBe(5);
expect(this.view.$('.Modal-listFormItem.is-disabled').length).toBe(4);
expect(this.view.$('[data-format=csv]:disabled').length).toBe(0);
expect(this.view.$('[data-format=csv]:checked').length).toBe(1);
});
});
describe('events', function () {

Loading…
Cancel
Save