You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/04/18 17:43:29 UTC

[GitHub] [superset] diegomedina248 commented on a diff in pull request #19765: fix(chart & explore): make to show label of slidercontrol

diegomedina248 commented on code in PR #19765:
URL: https://github.com/apache/superset/pull/19765#discussion_r852287150


##########
superset-frontend/src/explore/components/controls/SliderControl.tsx:
##########
@@ -16,21 +16,65 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import React from 'react';
+import React, { ReactNode } from 'react';
 import Slider from 'src/components/Slider';
 import ControlHeader from 'src/explore/components/ControlHeader';
 
 type SliderControlProps = {
   onChange: (value: number) => void;
   value: number;
   default?: number;
+  name: string;
+  description: string;
+
+  // ControlHeader props
+  label: string;
+  renderTrigger?: boolean;
+  validationErrors?: string[];
+  rightNode?: ReactNode;
+  leftNode?: ReactNode;
+  hovered?: boolean;
+  warning?: string;
+  danger?: string;
+  onClick?: () => void;
+  tooltipOnClick?: () => void;
 };
 
 export default function SliderControl(props: SliderControlProps) {
-  const { onChange = () => {}, default: defaultValue, ...rest } = props;
+  const {

Review Comment:
   Move this to the function declaration please



##########
superset-frontend/src/explore/components/controls/SliderControl.tsx:
##########
@@ -16,21 +16,65 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import React from 'react';
+import React, { ReactNode } from 'react';
 import Slider from 'src/components/Slider';
 import ControlHeader from 'src/explore/components/ControlHeader';
 
 type SliderControlProps = {
   onChange: (value: number) => void;
   value: number;
   default?: number;
+  name: string;

Review Comment:
   You can use the `ControlHeaderProps` like so:
   ```js
   type SliderControlProps = ControlHeaderProps & {
     onChange: (value: number) => void;
     value: number;
     default?: number;
   };
   ```



-- 
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