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

[feat] Introduce Foursquare cloud provider #2437

Merged
merged 2 commits into from Nov 18, 2023
Merged

Conversation

macrigiuseppe
Copy link
Collaborator

This PR introduces a new FSQ Studio provider to be able to store and fetch maps from Foursquare Studio

studio_provider

fetch_studio_map

Copy link
Collaborator

@ibgreen ibgreen left a comment

Choose a reason for hiding this comment

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

Nicely done! Minor nits, feel free to ignore.

- `props.name` **[string][28]**
- `props.displayName` **[string][28]**
- `props` **[object][27]**
- `props.name` **[string][28]**
Copy link
Collaborator

Choose a reason for hiding this comment

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

What are those numbers in brackets? Look like link tags - in that case shouldn't those tags be defined below? Or maybe this is a different markdown dialect?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the tags are defined at the end of the file

[27]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

const style = {
background: 'black'
};
export default class UnfoldedIcon extends Component {
Copy link
Collaborator

Choose a reason for hiding this comment

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

FoursquareIcon? (Nit: If we stop using default exports we won't be making such mistakes)

@@ -0,0 +1,41 @@
import React, {Component} from 'react';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we just call this foursquare-icon.js

const STUDIO_AUTH_AUDIENCE = 'https://foursquare.com/api/';
const STUDIO_AUTH_SCOPE = 'openid profile email';

const STUDIO_KEPLER_GL_IMPORT_SOURCE = 'kepler.gl-raw';
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does kepler.gl-raw mean? Is it a URL path, a parameter value, etc? Maybe add comment before this constant,

};
}

export default class FsqStudioProvider extends Provider {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I vote for FoursquareProvider

FSQ_STUDIO_DOMAIN,
FSQ_STUDIO_API_URL,
FSQ_STUDIO_USER_MAPS_URL
} = AUTH_TOKENS;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is no longer just AUTH_TOKENS. To make the code easier to follow, maybe consider renaming to CLOUD_PROVIDERS_CONFIGURATION or similar?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah we can do that

@@ -69,7 +69,11 @@ const CONFIG = {
'MapboxAccessToken',
'DropboxClientId',
'MapboxExportToken',
'CartoClientId'
'CartoClientId',
'FSQStudioClientId',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again recommend just going with Foursquare.

Suggested change
'FSQStudioClientId',
'FoursquareClientId',

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah

@@ -133,10 +135,10 @@ export default class Provider {
/**
* This method is called to determine whether user already logged in to this provider
* @public
* @returns true if a user already logged in
* @returns {Promise<string>} return the access token if a user already logged in
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we add types in typescript we should not add them to the TSDoc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -253,8 +255,7 @@ export default class Provider {
* }
*/
async downloadMap(loadParams): Promise<{map: SavedMap; format: string}> {
// @ts-expect-error
return;
return Promise.reject('You must implement downloadMap');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: In my opinion it is cleaner to just throw an error and the async function will convert that to a rejected promise.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah i can do that

@@ -1,5 +1,25 @@
// Copyright (c) 2023 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we needs to add this?

  • If we do, can't we just add a one liner // Copyright (c) 2023 Uber Technologies, Inc., MIT license? That is what we do in other vis.gl frameworks.
  • Should this be a FSQ copyright? Or is the year wrong? I assume Uber didn't do anything with this code in 2023.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess this is an automatic license added by uber-licence. Should it be disabled?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is part of the open source code. only files in the example folder should have the FSQ copyright

@@ -1,5 +1,25 @@
// Copyright (c) 2023 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess this is an automatic license added by uber-licence. Should it be disabled?

@macrigiuseppe macrigiuseppe force-pushed the studio_provider branch 2 times, most recently from ac5eda6 to 868c90e Compare November 17, 2023 01:36
@macrigiuseppe macrigiuseppe changed the title [feat] Introduce FSQ Studio provider [feat] Introduce Foursquare cloud provider Nov 17, 2023
@delete-merged-branch delete-merged-branch bot deleted the branch master November 17, 2023 03:03
@macrigiuseppe macrigiuseppe changed the base branch from refactor_cloud_provider to master November 17, 2023 03:14
@macrigiuseppe macrigiuseppe force-pushed the studio_provider branch 4 times, most recently from 2b3ca6b to 7cdfe35 Compare November 17, 2023 14:51
Signed-off-by: Giuseppe Macri <gmacri@foursquare.com>
Signed-off-by: Giuseppe Macri <gmacri@foursquare.com>
@macrigiuseppe macrigiuseppe merged commit d60ef31 into master Nov 18, 2023
8 checks passed
@delete-merged-branch delete-merged-branch bot deleted the studio_provider branch November 18, 2023 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants