You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "villebro (via GitHub)" <gi...@apache.org> on 2023/06/20 05:45:00 UTC

[GitHub] [superset] villebro commented on a diff in pull request #24154: feat: Add Deck.gl Contour Layer

villebro commented on code in PR #24154:
URL: https://github.com/apache/superset/pull/24154#discussion_r1234760262


##########
superset-frontend/src/explore/components/controls/ContourControl/ContourPopoverControl.tsx:
##########
@@ -0,0 +1,311 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React, { useState, useEffect } from 'react';
+import { Row, Col } from 'src/components';
+import Button from 'src/components/Button';
+import Tabs from 'src/components/Tabs';
+import { legacyValidateInteger, styled, t } from '@superset-ui/core';
+import ControlHeader from '../../ControlHeader';
+import TextControl from '../TextControl';
+import ColorPickerControl from '../ColorPickerControl';
+import {
+  ContourPopoverControlProps,
+  colorType,
+  contourType,
+  errorMapType,
+} from './types';
+
+enum CONTOUR_TYPES {
+  ISOLINE = 'ISOLINE',
+  ISOBAND = 'ISOBAND',
+}

Review Comment:
   nit: PascalCase tends to be used for enums, at least in the official TS docs: https://www.typescriptlang.org/docs/handbook/enums.html#string-enums
   
   ```suggestion
   enum CONTOUR_TYPES {
     Isoline = 'ISOLINE',
     Isoband = 'ISOBAND',
   }
   ```



##########
docker/pythonpath_dev/superset_config.py:
##########
@@ -108,6 +108,8 @@ class CeleryConfig(object):
 
 SQLLAB_CTAS_NO_LIMIT = True
 
+MAPBOX_API_KEY = os.getenv("MAPBOX_API_KEY")
+

Review Comment:
   We appear to be using `get_env_variable` in this file, maybe use that here, too, for consistency?
   ```suggestion
   MAPBOX_API_KEY = get_env_variable("MAPBOX_API_KEY")
   
   ```



##########
superset-frontend/src/explore/components/controls/TextControl/index.tsx:
##########
@@ -30,7 +30,7 @@ export interface TextControlProps<T extends InputValueType = InputValueType> {
   disabled?: boolean;
   isFloat?: boolean;
   isInt?: boolean;
-  onChange?: (value: T, errors: any) => {};
+  onChange?: (value: T, errors: any) => void;

Review Comment:
   good catch, thanks for improving this 👍 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org