Skip to content

Commit

Permalink
[Bug] Fix integration with CARTO (<pr>)
Browse files Browse the repository at this point in the history
* Use DataContainers for processing data
* Request new permissions during the Oauth process

Signed-off-by: Moisés Calzado Cobo <mcalzado@cartodb.com>
Signed-off-by: moicalcob <mcalzado@cartodb.com>
  • Loading branch information
moicalcob committed Sep 3, 2021
1 parent c106ee0 commit e29bf70
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/demo-app/src/cloud-providers/carto/carto-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import Console from 'global/console';
import CartoIcon from './carto-icon';
import {formatCsv} from 'kepler.gl/processors';
import {Provider} from 'kepler.gl/cloud-providers';
import {createDataContainer} from 'kepler.gl';

const NAME = 'carto';
const DISPLAY_NAME = 'CARTO';
Expand All @@ -45,7 +46,7 @@ export default class CartoProvider extends Provider {
this._carto = new OAuthApp(
{
authorization: `https://${DOMAIN}/oauth2`,
scopes: 'schemas:c'
scopes: 'schemas:c datasets:rw:*'
},
{
serverUrlTemplate: `https://{user}.${DOMAIN}/`,
Expand Down Expand Up @@ -332,7 +333,9 @@ export default class CartoProvider extends Provider {
type: field.type
}));

const file = formatCsv(allData, fields);
const dataContainer = createDataContainer([...allData]);

const file = formatCsv(dataContainer, fields);

return {
name: id,
Expand Down

0 comments on commit e29bf70

Please sign in to comment.